/* ==============================
   U-SHOW - Common Styles
   ============================== */

:root {
  --sidebar-bg: #0f1c2e;
  --sidebar-hover: #1a2d45;
  --sidebar-active: #1e3a5f;
  --sidebar-text: #a8b8cc;
  --sidebar-text-active: #ffffff;
  --sidebar-border: #1e3a5f;

  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --secondary: #64748b;
  --accent-orange: #f97316;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-yellow: #f59e0b;
  --accent-purple: #8b5cf6;

  --bg-main: #f0f4f8;
  --bg-card: #ffffff;
  --bg-hover: #f8fafc;
  --border: #e2e8f0;
  --border-light: #f1f5f9;

  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;

  --badge-d-bg: #dbeafe;
  --badge-d-color: #1d4ed8;
  --badge-n-bg: #dcfce7;
  --badge-n-color: #15803d;
  --badge-e-bg: #ffedd5;
  --badge-e-color: #c2410c;
  --badge-em-bg: #ede9fe;
  --badge-em-color: #6d28d9;

  --radius: 8px;
  --radius-sm: 4px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.08), 0 4px 6px rgba(0,0,0,0.05);

  --sidebar-width: 220px;
  --right-panel-width: 280px;
  --header-height: 56px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Noto Sans JP', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-main);
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.5;
  overflow: hidden;
  height: 100vh;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ==============================
   LAYOUT
   ============================== */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ==============================
   SIDEBAR
   ============================== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: #2a4a6b; border-radius: 2px; }

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 14px;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-logo-icon {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-logo-icon svg { width: 18px; height: 18px; fill: white; }

.sidebar-logo-text h1 {
  font-size: 14px;
  font-weight: 700;
  color: white;
  letter-spacing: 1px;
}

.sidebar-logo-text p {
  font-size: 9px;
  color: var(--sidebar-text);
  letter-spacing: 0.5px;
}

.sidebar-project {
  padding: 10px 12px;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-project label {
  font-size: 9px;
  color: var(--sidebar-text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 4px;
}

.sidebar-project select {
  width: 100%;
  background: var(--sidebar-hover);
  border: 1px solid #2a4a6b;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 11px;
  padding: 5px 8px;
  outline: none;
}

.sidebar-project select option { background: var(--sidebar-bg); }

.sidebar-nav {
  flex: 1;
  padding: 8px 0;
  overflow-y: auto;
}

.sidebar-nav::-webkit-scrollbar { display: none; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px;
  color: var(--sidebar-text);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  border-radius: 0;
  position: relative;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-active);
}

.nav-item.active {
  background: var(--sidebar-active);
  color: white;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--primary);
  border-radius: 0 2px 2px 0;
}

.nav-item svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-item.active svg { opacity: 1; }

.nav-badge {
  margin-left: auto;
  background: var(--accent-red);
  color: white;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 9px;
  font-weight: 600;
}

.nav-group-label {
  font-size: 9px;
  color: #4a6a8a;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 10px 14px 3px;
  font-weight: 600;
}

.nav-sub-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px 5px 32px;
  color: var(--sidebar-text);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
}

.nav-sub-item:hover {
  background: var(--sidebar-hover);
  color: white;
}

.nav-sub-item.active {
  background: var(--sidebar-active);
  color: #93c5fd;
}

.nav-toggle {
  margin-left: auto;
  width: 14px;
  height: 14px;
  transition: transform 0.2s;
}

.nav-item.open .nav-toggle { transform: rotate(180deg); }

.sidebar-user {
  padding: 10px 12px;
  border-top: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: 9px;
}

.sidebar-user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 11px; font-weight: 600; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 9px; color: var(--sidebar-text); }

/* ==============================
   MAIN CONTENT
   ============================== */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ==============================
   TOP BAR (breadcrumb + page title + actions)
   ============================== */
.top-bar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  flex-shrink: 0;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0 4px;
  font-size: 11px;
  color: var(--text-muted);
}

.breadcrumb span { color: var(--text-secondary); }
.breadcrumb .sep { color: var(--text-muted); }
.breadcrumb .current { color: var(--text-primary); font-weight: 500; }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.page-desc {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ==============================
   BUTTONS
   ============================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  border: none;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn svg { width: 13px; height: 13px; }

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover { background: var(--primary-hover); }

.btn-secondary {
  background: white;
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-hover); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-light); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-orange {
  background: var(--accent-orange);
  color: white;
}
.btn-orange:hover { background: #ea6a0a; }

.btn-green {
  background: var(--accent-green);
  color: white;
}
.btn-green:hover { background: #059669; }

.btn-sm {
  padding: 4px 9px;
  font-size: 11px;
}

.btn-xs {
  padding: 2px 7px;
  font-size: 10px;
}

/* ==============================
   METADATA BAR
   ============================== */
.meta-bar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 8px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.meta-item { display: flex; flex-direction: column; gap: 1px; }
.meta-label { font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.meta-value { font-size: 12px; font-weight: 500; color: var(--text-primary); }

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 600;
}

.status-badge.adjusting { background: #d1fae5; color: #065f46; }
.status-badge.draft { background: #f3f4f6; color: #374151; }
.status-badge.active { background: #dbeafe; color: #1e40af; }
.status-badge.review { background: #fef3c7; color: #92400e; }
.status-badge.approved { background: #d1fae5; color: #065f46; }
.status-badge.rejected { background: #fee2e2; color: #991b1b; }

/* ==============================
   CONTENT AREA (3-panel layout)
   ============================== */
.content-area {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.content-main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 20px;
}

.content-main::-webkit-scrollbar { width: 6px; }
.content-main::-webkit-scrollbar-track { background: transparent; }
.content-main::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* ==============================
   RIGHT PANEL (AI Assist)
   ============================== */
.right-panel {
  width: var(--right-panel-width);
  background: white;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
}

.right-panel::-webkit-scrollbar { width: 4px; }
.right-panel::-webkit-scrollbar-track { background: transparent; }
.right-panel::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }

.right-panel-header {
  padding: 12px 14px 8px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.right-panel-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 5px;
}

.right-panel-title svg {
  width: 14px;
  height: 14px;
  color: var(--primary);
}

.ai-assist-section {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
}

.ai-accordion-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 5px;
  overflow: hidden;
}

.ai-accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  font-size: 11px;
  color: var(--text-primary);
  background: var(--bg-hover);
  cursor: pointer;
  font-weight: 500;
}

.ai-accordion-header:hover { background: var(--primary-light); color: var(--primary); }

.ai-accordion-header svg {
  width: 12px;
  height: 12px;
  color: var(--text-muted);
  transition: transform 0.2s;
}

.ai-accordion-header.open svg { transform: rotate(180deg); }

.ai-accordion-body {
  padding: 8px 10px;
  font-size: 11px;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
  display: none;
}

.ai-accordion-body.open { display: block; }

.ai-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all 0.15s;
  margin-bottom: 5px;
}

.ai-action-btn.blue { background: #eff6ff; color: #1d4ed8; }
.ai-action-btn.blue:hover { background: #dbeafe; }
.ai-action-btn.green { background: #f0fdf4; color: #15803d; }
.ai-action-btn.green:hover { background: #dcfce7; }
.ai-action-btn.orange { background: #fff7ed; color: #c2410c; }
.ai-action-btn.orange:hover { background: #ffedd5; }
.ai-action-btn.purple { background: #faf5ff; color: #6d28d9; }
.ai-action-btn.purple:hover { background: #ede9fe; }

.ai-action-btn svg { width: 12px; height: 12px; flex-shrink: 0; }

/* ==============================
   PROGRESS CHART (Donut)
   ============================== */
.progress-section {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
}

.progress-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.donut-chart-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.donut-chart {
  position: relative;
  width: 70px;
  height: 70px;
  flex-shrink: 0;
}

.donut-chart svg { width: 70px; height: 70px; transform: rotate(-90deg); }

.donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.donut-percent {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.donut-label {
  font-size: 9px;
  color: var(--text-secondary);
}

.progress-legend { flex: 1; }

.progress-legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 4px;
  flex-shrink: 0;
}

.progress-note {
  font-size: 10px;
  color: var(--primary);
  cursor: pointer;
  margin-top: 6px;
}

.progress-note:hover { text-decoration: underline; }

/* ==============================
   COMMENT SECTION
   ============================== */
.comment-section {
  padding: 10px 14px;
}

.comment-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.comment-section-title { font-size: 11px; font-weight: 600; color: var(--text-primary); }
.comment-see-all { font-size: 10px; color: var(--primary); cursor: pointer; }
.comment-see-all:hover { text-decoration: underline; }

.comment-item {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.comment-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.comment-content { flex: 1; min-width: 0; }

.comment-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}

.comment-name { font-size: 10px; font-weight: 600; color: var(--text-primary); }
.comment-date { font-size: 9px; color: var(--text-muted); }
.comment-text { font-size: 10px; color: var(--text-secondary); line-height: 1.4; }

.comment-confirmed {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9px;
  color: var(--accent-green);
  font-weight: 600;
  margin-top: 3px;
}

/* ==============================
   PAGE TABS
   ============================== */
.page-tabs {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  display: flex;
  gap: 0;
  flex-shrink: 0;
}

.page-tab {
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
}

.page-tab:hover { color: var(--primary); }

.page-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

/* ==============================
   CARDS
   ============================== */
.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ==============================
   TABLES
   ============================== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table th {
  background: var(--bg-hover);
  color: var(--text-secondary);
  font-weight: 600;
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  white-space: nowrap;
}

.data-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tr:hover td { background: var(--bg-hover); }

.data-table tr.selected td { background: #eff6ff; }

/* ==============================
   BADGES (D/N/E/EM)
   ============================== */
.dn-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 18px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
}

.dn-badge.D { background: var(--badge-d-bg); color: var(--badge-d-color); }
.dn-badge.N { background: var(--badge-n-bg); color: var(--badge-n-color); }
.dn-badge.E { background: var(--badge-e-bg); color: var(--badge-e-color); }
.dn-badge.EM { background: var(--badge-em-bg); color: var(--badge-em-color); }

/* ==============================
   CAST CIRCLES
   ============================== */
.cast-circles {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}

.cast-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ==============================
   FILTER BAR
   ============================== */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.filter-label { font-size: 11px; color: var(--text-secondary); font-weight: 500; }

.filter-btn {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  border: 1px solid var(--border);
  background: white;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.filter-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

.filter-select {
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: white;
  color: var(--text-primary);
  font-size: 11px;
  outline: none;
  cursor: pointer;
}

.filter-select:focus { border-color: var(--primary); }

/* ==============================
   SEARCH INPUT
   ============================== */
.search-input-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.search-input-wrap svg {
  position: absolute;
  left: 8px;
  width: 12px;
  height: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  padding: 5px 8px 5px 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 11px;
  outline: none;
  background: white;
  color: var(--text-primary);
  min-width: 180px;
}

.search-input:focus { border-color: var(--primary); }

/* ==============================
   STAT CARDS
   ============================== */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon svg { width: 18px; height: 18px; }

.stat-icon.blue { background: #dbeafe; color: var(--primary); }
.stat-icon.orange { background: #ffedd5; color: var(--accent-orange); }
.stat-icon.yellow { background: #fef3c7; color: var(--accent-yellow); }
.stat-icon.green { background: #d1fae5; color: var(--accent-green); }
.stat-icon.red { background: #fee2e2; color: var(--accent-red); }
.stat-icon.purple { background: #ede9fe; color: var(--accent-purple); }

.stat-info { flex: 1; min-width: 0; }
.stat-number { font-size: 22px; font-weight: 700; color: var(--text-primary); line-height: 1; }
.stat-desc { font-size: 10px; color: var(--text-secondary); margin-top: 2px; }

/* ==============================
   AUTOSAVE BAR
   ============================== */
.autosave-bar {
  background: white;
  border-top: 1px solid var(--border);
  padding: 6px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.autosave-bar .saved {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--accent-green);
  font-weight: 500;
}

.autosave-bar .saved svg { width: 12px; height: 12px; }
.autosave-link { color: var(--primary); cursor: pointer; }
.autosave-link:hover { text-decoration: underline; }

/* ==============================
   MODAL
   ============================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 480px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  transform: scale(0.95);
  transition: transform 0.2s;
}

.modal-overlay.open .modal { transform: scale(1); }

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }

.modal-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--bg-hover);
  color: var(--text-secondary);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.modal-close:hover { background: var(--border); }

.modal-body { padding: 16px 20px; }

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ==============================
   TOAST
   ============================== */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: #1e293b;
  color: white;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-md);
  animation: slideIn 0.2s ease;
  max-width: 300px;
}

.toast.success { border-left: 3px solid var(--accent-green); }
.toast.error { border-left: 3px solid var(--accent-red); }
.toast.info { border-left: 3px solid var(--primary); }

@keyframes slideIn {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==============================
   UTILITY
   ============================== */
.text-primary { color: var(--primary) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-success { color: var(--accent-green) !important; }
.text-danger { color: var(--accent-red) !important; }
.text-warning { color: var(--accent-yellow) !important; }
.text-bold { font-weight: 700; }
.text-right { text-align: right; }
.text-center { text-align: center; }

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }

.hidden { display: none !important; }
.w-full { width: 100%; }

/* Scrollable table wrapper */
.table-scroll {
  overflow-x: auto;
  overflow-y: auto;
}
.table-scroll::-webkit-scrollbar { height: 5px; width: 5px; }
.table-scroll::-webkit-scrollbar-track { background: transparent; }
.table-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* Page with inner left panel */
.content-with-left {
  display: flex;
  height: 100%;
  overflow: hidden;
}

.inner-left-panel {
  width: 200px;
  flex-shrink: 0;
  background: white;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 12px 0;
}

.inner-left-panel::-webkit-scrollbar { width: 4px; }
.inner-left-panel::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }

.inner-left-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 11px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s;
}

.inner-left-item:hover { background: var(--bg-hover); }
.inner-left-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.inner-left-item svg { width: 13px; height: 13px; flex-shrink: 0; color: var(--text-muted); }
.inner-left-item.active svg { color: var(--primary); }

.inner-left-header {
  padding: 4px 12px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.inner-left-title { font-size: 11px; font-weight: 700; color: var(--text-primary); }

.inner-left-meta { font-size: 9px; color: var(--text-muted); margin-top: 1px; }

/* Divider */
.divider {
  height: 1px;
  background: var(--border);
  margin: 10px 0;
}

/* Loading spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Checkbox */
.checkbox {
  width: 14px;
  height: 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 3px;
  cursor: pointer;
  appearance: none;
  background: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.1s;
  flex-shrink: 0;
}

.checkbox:checked {
  background: var(--primary);
  border-color: var(--primary);
}

.checkbox:checked::after {
  content: '✓';
  color: white;
  font-size: 9px;
  font-weight: 700;
}

/* Form elements */
.form-group { margin-bottom: 12px; }
.form-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.form-required { color: var(--accent-orange); font-size: 10px; }
.form-input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  outline: none;
  color: var(--text-primary);
}
.form-input:focus { border-color: var(--primary); }
.form-textarea {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  outline: none;
  resize: vertical;
  min-height: 60px;
  color: var(--text-primary);
}
.form-textarea:focus { border-color: var(--primary); }
.form-select {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  outline: none;
  color: var(--text-primary);
  background: white;
}
.form-select:focus { border-color: var(--primary); }

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  font-size: 11px;
  color: var(--text-secondary);
}

.pagination-info { }

.pagination-btns {
  display: flex;
  align-items: center;
  gap: 3px;
}

.page-btn {
  width: 26px;
  height: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  color: var(--text-primary);
}

.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
