@import url('https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&family=Sora:wght@100..800&display=swap');

:root {
  /* Primary Colors - Blue Theme */
  --bg: #f0f4f8;
  --bg-deep: #e2e8f0;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --surface-3: #eef2f7;
  
  /* Ink Colors - Dark Blue/Gray */
  --ink: #0f1724;
  --ink-2: #334155;
  --ink-3: #64748b;
  --ink-4: #94a3b8;
  
  /* Border Colors */
  --line: #dce2ec;
  --line-2: #c8d0dc;
  --line-strong: #0f1724;
  
  /* Accent Colors - Blue */
  --accent: #1a56db;
  --accent-2: #1e40af;
  --accent-3: #2563eb;
  --accent-soft: #e8eefa;
  --accent-light: #dbeafe;
  
  /* Secondary Colors */
  --gold: #8a6a1c;
  --gold-soft: #f0e8d4;
  --teal: #0e7490;
  --teal-soft: #d8e8e6;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --ok: #16a34a;
  --ok-soft: #dcfce7;
  
  /* Typography */
  --display: 'Nunito', Georgia, serif;
  --sans: 'Nunito', -apple-system, sans-serif;
  --mono: 'Nunito', ui-monospace, monospace;

  /* Typography */
  /* --display: 'Newsreader', Georgia, serif;
  --sans: 'Inter Tight', -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace; */
}

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

html,
body,
#root {
  height: 100%;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  cursor: pointer;
}

input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* === LAYOUT === */
.app {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
}

/* ========================================
   SIDEBAR WRAPPER
   ======================================== */

.sidebar-wrapper {
  display: flex;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 99;
}

/* ========================================
   MINI SIDEBAR - Left Side
   ======================================== */

.mini-sidebar {
  width: 48px;
  background: #0f1724;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
  height: 100vh;
  overflow-y: auto;
}

.mini-sidebar-brand {
  padding: 8px 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 12px;
  width: 100%;
  display: flex;
  justify-content: center;
}

.mini-brand-icon {
  width: 28px;
  height: 28px;
  background: #1a56db;
  color: #ffffff;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  font-family: var(--display);
}

.mini-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  padding: 0 6px;
}

.mini-nav-item {
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  color: rgba(255, 255, 255, 0.4);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  font-size: 16px;
  margin: 0 auto;
}

.mini-nav-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.mini-nav-item.active {
  color: #1a56db;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.mini-nav-item.logout {
  margin-top: auto;
  color: rgba(255, 255, 255, 0.3);
}

.mini-nav-item.logout:hover {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.12);
}

.mini-sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* ========================================
   MAIN SIDEBAR - Right Side
   ======================================== */

.sidebar {
  width: 220px;
  background: var(--accent-2);
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100vh;
  overflow: hidden;
}

.brand {
  padding: 16px 18px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-mark {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: #ffffff;
  line-height: 1;
}

.brand-mark::after {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  background: #ffffff;
  margin-left: 4px;
  vertical-align: 5px;
  border-radius: 50%;
  opacity: 0.6;
}

.brand-sub {
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #fffffff7;
  margin-top: 4px;
}

.nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 10px;
}

.nav-group {
  margin-bottom: 14px;
}

.nav-group-label {
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgb(255 255 255 / 71%);
  padding: 0 8px 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-group-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgb(255 255 255 / 71%);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  font-size: 12px;
  color: #fffffff7;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  user-select: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.nav-item.active {
  color: #1a56db;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.nav-item.active i {
  color: #1a56db;
  opacity: 1;
}

.nav-item i {
  font-size: 14px;
  flex-shrink: 0;
  opacity: 0.8;
  width: 16px;
}

.nav-badge {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 9px;
  color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.1);
  padding: 0 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.nav-item.active .nav-badge {
  color: #1a56db;
  background: rgba(26, 86, 219, 0.08);
}

.sidebar-foot {
  padding: 10px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 28px;
  height: 28px;
  background: rgb(26 86 219);
  color: #ffffff;
  border-radius: 6px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-name {
  font-size: 12px;
  color: #ffffff;
  font-weight: 500;
}

.user-role {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.4);
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Scrollbar for Mini Sidebar */
.mini-sidebar::-webkit-scrollbar {
  width: 3px;
}

.mini-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.mini-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

/* Scrollbar for Main Sidebar */
.sidebar ::-webkit-scrollbar {
  width: 4px;
}

.sidebar ::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
}

.sidebar ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
}

.sidebar ::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 1024px) {
  .sidebar {
    width: 180px;
  }
  
  .brand-mark {
    font-size: 17px;
  }
  
  .nav-item {
    font-size: 11px;
    padding: 5px 6px;
  }
  
  .nav-item i {
    font-size: 13px;
    width: 14px;
  }
}

@media (max-width: 768px) {
  .sidebar-wrapper {
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    height: 100vh;
  }
  
  .mini-sidebar {
    width: 40px;
    padding: 8px 0;
  }
  
  .mini-nav-item {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }
  
  .mini-brand-icon {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }
  
  .sidebar {
    width: 160px;
  }
  
  .brand {
    padding: 12px 12px 10px;
  }
  
  .brand-mark {
    font-size: 15px;
  }
  
  .brand-sub {
    font-size: 8px;
  }
  
  .nav {
    padding: 6px 6px;
  }
  
  .nav-group {
    margin-bottom: 10px;
  }
  
  .nav-group-label {
    font-size: 8px;
    padding: 0 6px 4px;
  }
  
  .nav-item {
    font-size: 10px;
    padding: 4px 6px;
    gap: 6px;
  }
  
  .nav-item i {
    font-size: 12px;
    width: 12px;
  }
  
  .nav-badge {
    font-size: 8px;
    min-width: 14px;
    padding: 0 4px;
  }
  
  .sidebar-foot {
    padding: 8px 10px;
  }
  
  .user-avatar {
    width: 22px;
    height: 22px;
    font-size: 10px;
  }
  
  .user-name {
    font-size: 10px;
  }
  
  .user-role {
    font-size: 8px;
  }
}

@media (max-width: 480px) {
  .mini-sidebar {
    width: 36px;
    padding: 6px 0;
  }
  
  .mini-nav-item {
    width: 26px;
    height: 26px;
    font-size: 12px;
  }
  
  .mini-brand-icon {
    width: 20px;
    height: 20px;
    font-size: 10px;
  }
  
  .sidebar {
    width: 140px;
  }
  
  .brand-mark {
    font-size: 13px;
  }
  
  .nav-item {
    font-size: 9px;
    padding: 3px 4px;
    gap: 4px;
  }
  
  .nav-item i {
    font-size: 11px;
    width: 10px;
  }
}

/* === MAIN === */
.main {
  background: var(--bg);
  min-width: 0;
}

.topbar {
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 3px rgba(15, 23, 36, 0.05);
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  flex: 1;
  min-width: 0;
}

.crumbs i {
  font-size: 11px;
}

.crumbs .cur {
  color: var(--ink);
  font-weight: 600;
}

.topbar-search {
  flex: 0 0 280px;
  position: relative;
}

.topbar-search input {
  width: 100%;
  padding: 7px 12px 7px 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
  background: var(--surface-2);
  outline: none;
  font-family: var(--sans);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.topbar-search input:focus {
  border-color: var(--accent-3);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.topbar-search i {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  font-size: 13px;
}

.page {
  padding: 28px 32px 80px;
  max-width: 1480px;
}

/* === TYPOGRAPHY === */
.page-eyebrow {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent-3);
  margin-bottom: 8px;
  font-weight: 500;
}

.page-title {
  font-family: var(--display);
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--ink);
}

.page-sub {
  font-size: 13.5px;
  color: var(--ink-2);
  margin-top: 8px;
  max-width: 720px;
  line-height: 1.55;
}

.page-header {
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.section-label {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 28px 0 14px;
  font-weight: 500;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.section-label .count {
  background: var(--accent-3);
  color: #ffffff;
  padding: 1px 8px;
  font-size: 9px;
  border-radius: 10px;
}

/* === CARDS === */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15, 23, 36, 0.04);
}

.card-pad {
  padding: 18px 22px;
}

.card-title {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-2);
  margin-bottom: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* === METRICS === */
.metric-strip {
  display: grid;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.metric-cell {
  padding: 18px 22px;
  border-right: 1px solid var(--line);
}

.metric-cell:last-child {
  border-right: none;
}

.metric-label {
  font-family: var(--mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  margin-bottom: 6px;
  font-weight: 500;
}

.metric-value {
  font-family: var(--display);
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--ink);
}

.metric-foot {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.metric-foot.up {
  color: var(--ok);
}

.metric-foot.down {
  color: var(--danger);
}

/* === BUTTONS - Blue Theme === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--sans);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}

.btn:hover {
  background: var(--surface-2);
  border-color: var(--ink-3);
}

.btn:active {
  background: var(--surface-3);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent-3);
  border-color: var(--accent-3);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent-2);
  border-color: var(--accent-2);
}

.btn-accent {
  background: var(--accent-3);
  border-color: var(--accent-3);
  color: #ffffff;
}

.btn-accent:hover {
  background: var(--accent-2);
  border-color: var(--accent-2);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--surface-2);
}

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

.btn-xs {
  padding: 2px 8px;
  font-size: 10.5px;
}

.icon-btn {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.icon-btn:hover {
  background: var(--accent-light);
  color: var(--accent-3);
}

.icon-btn i {
  font-size: 14px;
}

/* === BADGES === */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  font-size: 10.5px;
  font-weight: 500;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 4px;
  background: var(--surface-3);
  color: var(--ink-2);
  border: 1px solid var(--line);
  white-space: nowrap;
}

.tag-ok {
  background: var(--ok-soft);
  color: var(--ok);
  border-color: #bbf7d0;
}

.tag-warn {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: #fde68a;
}

.tag-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: #fca5a5;
}

.tag-info {
  background: var(--teal-soft);
  color: var(--teal);
  border-color: #a5f3fc;
}

.tag-gold {
  background: var(--gold-soft);
  color: var(--gold);
  border-color: #fde68a;
}

.tag-accent {
  background: var(--accent-soft);
  color: var(--accent-3);
  border-color: #bfdbfe;
}

.tag-dot::before {
  content: '\25CF';
  font-size: 7px;
  vertical-align: middle;
  margin-right: 2px;
}

.tag-solid {
  background: var(--accent-3);
  color: #ffffff;
  border-color: var(--accent-3);
}

/* === TABLES === */
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.tbl th {
  text-align: left;
  padding: 9px 14px;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  font-weight: 500;
}

.tbl td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.tbl tr:last-child td {
  border-bottom: none;
}

.tbl tbody tr {
  transition: background 0.08s;
}

.tbl tbody tr:hover td {
  background: var(--accent-light);
}

.tbl tbody tr.selected td {
  background: var(--accent-light);
}

.tbl .num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.tbl .id {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-2);
}

/* === FORMS === */
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}

.field-label {
  font-family: var(--mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  font-weight: 500;
}

.field-label .req {
  color: var(--danger);
  margin-left: 2px;
}

.field input,
.field select,
.field textarea {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  background: var(--surface);
  outline: none;
  color: var(--ink);
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent-3);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.field textarea {
  resize: vertical;
  min-height: 70px;
  font-family: var(--sans);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}

.field-hint {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 2px;
}

/* === UTILITIES === */
.row {
  display: flex;
  gap: 18px;
}

.col {
  flex: 1;
  min-width: 0;
}

.flex {
  display: flex;
}

.between {
  justify-content: space-between;
}

.center {
  align-items: center;
}

.gap-1 {
  gap: 4px;
}
.gap-2 {
  gap: 8px;
}
.gap-3 {
  gap: 12px;
}
.gap-4 {
  gap: 16px;
}

.mb-1 {
  margin-bottom: 4px;
}
.mb-2 {
  margin-bottom: 8px;
}
.mb-3 {
  margin-bottom: 14px;
}
.mb-4 {
  margin-bottom: 20px;
}
.mb-5 {
  margin-bottom: 28px;
}

.mt-1 {
  margin-top: 4px;
}
.mt-2 {
  margin-top: 8px;
}
.mt-3 {
  margin-top: 14px;
}
.mt-4 {
  margin-top: 20px;
}

.muted {
  color: var(--ink-3);
}
.sm {
  font-size: 12px;
}
.xs {
  font-size: 11px;
}
.tiny {
  font-size: 10px;
}
.bold {
  font-weight: 600;
}
.medium {
  font-weight: 500;
}
.mono {
  font-family: var(--mono);
}
.display {
  font-family: var(--display);
}
.text-accent {
  color: var(--accent-3);
}
.text-ok {
  color: var(--ok);
}
.text-warn {
  color: var(--warn);
}
.text-danger {
  color: var(--danger);
}
.hide {
  display: none !important;
}
.italic {
  font-style: italic;
}
.uc {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* === PROGRESS === */
.bar {
  height: 4px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.bar > span {
  display: block;
  height: 100%;
  background: var(--accent-3);
  border-radius: 2px;
}

/* === DIVIDER === */
.divider {
  height: 1px;
  background: var(--line);
  margin: 18px 0;
}
.divider-strong {
  height: 1px;
  background: var(--ink);
  margin: 18px 0;
}

/* === EMPTY STATE === */
.empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--ink-3);
}
.empty i {
  font-size: 28px;
  margin-bottom: 10px;
  display: block;
  opacity: 0.5;
}
.empty-title {
  font-family: var(--display);
  font-size: 18px;
  color: var(--ink-2);
  margin-bottom: 4px;
}

/* === MODALS === */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 36, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(15, 23, 36, 0.15);
}

.modal-wide {
  max-width: 920px;
}

.modal-head {
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-2);
  border-radius: 8px 8px 0 0;
}

.modal-title {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.modal-body {
  padding: 22px 24px;
}

.modal-foot {
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  background: var(--surface-2);
  border-radius: 0 0 8px 8px;
}

/* === TOASTS === */
.toasts {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 200;
}

.toast {
  background: var(--ink);
  color: var(--bg);
  padding: 12px 18px 12px 14px;
  border-radius: 6px;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  max-width: 420px;
  border-left: 3px solid var(--accent-3);
  animation: toast-in 0.2s ease-out;
  box-shadow: 0 4px 12px rgba(15, 23, 36, 0.15);
}

.toast.ok {
  border-left-color: var(--ok);
}
.toast.warn {
  border-left-color: var(--warn);
}

@keyframes toast-in {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--ink-4);
}

.sidebar ::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}

.sidebar ::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* === TABLE OF CONTENTS / TREE === */
.tree {
  font-size: 13px;
}

.tree-node {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  cursor: pointer;
  border-radius: 4px;
  color: var(--ink-2);
  user-select: none;
  transition: background 0.1s;
}

.tree-node:hover {
  background: var(--accent-light);
}

.tree-node.active {
  background: var(--accent-3);
  color: #ffffff;
}

.tree-node.active i {
  color: #ffffff;
}

.tree-node i {
  font-size: 14px;
  flex-shrink: 0;
  color: var(--ink-3);
}

.tree-node .count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
}

.tree-node.active .count {
  color: rgba(255, 255, 255, 0.7);
}

.tree-indent {
  padding-left: 20px;
}

/* === CHAT/SEARCH MESSAGES === */
.msg {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
}

.msg-avatar {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-weight: 600;
  font-size: 12px;
}

.msg-avatar.user {
  background: var(--surface-3);
  color: var(--ink);
}

.msg-avatar.engine {
  background: var(--accent-3);
  color: #ffffff;
}

.msg-body {
  flex: 1;
  min-width: 0;
}

.msg-content {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px 18px;
  font-size: 13.5px;
  line-height: 1.6;
}

.msg-content.user {
  background: var(--surface-2);
}

.msg-meta {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cite-sup {
  display: inline-block;
  background: var(--accent-3);
  color: #ffffff;
  font-family: var(--mono);
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  vertical-align: super;
  margin: 0 1px;
  text-decoration: none;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
}

.cite-sup:hover {
  background: var(--accent-2);
}

/* === REPORT === */
.report-paper {
  background: #ffffff;
  border: 1px solid var(--line);
  padding: 48px 56px;
  font-family: var(--display);
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink);
  position: relative;
  min-height: 600px;
  max-height: 720px;
  overflow-y: auto;
  border-radius: 8px;
}

.report-paper.draft::before {
  content: 'DRAFT';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-32deg);
  font-family: var(--display);
  font-size: 140px;
  font-weight: 600;
  color: rgba(26, 86, 219, 0.04);
  pointer-events: none;
  letter-spacing: -0.04em;
}

.report-paper h1 {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
  color: var(--accent-3);
}

.report-paper h2 {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 22px 0 10px;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  padding-bottom: 4px;
}

.report-paper h3 {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 14px 0 6px;
  color: var(--ink-2);
}

.report-paper p {
  margin-bottom: 10px;
}

.report-paper table {
  width: 100%;
  font-family: var(--sans);
  font-size: 12px;
  border-collapse: collapse;
  margin: 6px 0 10px;
  text-align: left;
}

.report-paper table td {
  padding: 5px 0;
  border-bottom: 1px dotted var(--line);
}

.report-paper table td:first-child {
  color: var(--ink-3);
  width: 35%;
}

.report-paper .stamp {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 12px;
}

.report-paper .verdict {
  padding: 14px 18px;
  font-family: var(--sans);
  font-size: 13px;
  border-left: 3px solid var(--ok);
  background: var(--ok-soft);
  margin: 10px 0;
  border-radius: 4px;
}

.report-paper .verdict.warn {
  border-left-color: var(--warn);
  background: var(--warn-soft);
}

.report-paper .verdict.danger {
  border-left-color: var(--danger);
  background: var(--danger-soft);
}

/* === SPLIT-PANE === */
.split {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.split-left {
  border-right: 1px solid var(--line);
  padding: 18px;
  background: var(--surface-2);
  overflow-y: auto;
  max-height: 720px;
}

.split-right {
  padding: 22px;
  min-width: 0;
  overflow-y: auto;
  max-height: 720px;
}

/* === STEPPER === */
.steps {
  display: flex;
  gap: 0;
  margin-bottom: 18px;
}

.step {
  flex: 1;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-right: none;
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  position: relative;
  cursor: pointer;
  transition: background 0.15s;
}

.step:first-child {
  border-radius: 6px 0 0 6px;
}

.step:last-child {
  border-right: 1px solid var(--line);
  border-radius: 0 6px 6px 0;
}

.step.done {
  background: var(--accent-3);
  color: #ffffff;
  border-color: var(--accent-3);
}

.step.current {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--accent-3);
  font-weight: 500;
}

.step-num {
  font-family: var(--display);
  font-size: 14px;
  margin-right: 6px;
  font-weight: 600;
}

/* === TIMELINE === */
.timeline {
  position: relative;
  padding-left: 22px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--line);
}

.timeline-item {
  position: relative;
  padding-bottom: 16px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -22px;
  top: 5px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--surface);
  background: var(--ink-3);
  border-radius: 50%;
}

.timeline-item.accent::before {
  background: var(--accent-3);
}

.timeline-item.ok::before {
  background: var(--ok);
}

.timeline-time {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 2px;
}

.timeline-title {
  font-size: 12.5px;
  font-weight: 500;
}

.timeline-desc {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 2px;
}
/* ========================================
   BIOEQUIVALENCE MODULE - Enhanced Styles
   ======================================== */

.bioequivalence-module {
  width: 100%;
}

.bioequivalence-module .metric-strip {
  display: grid;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.bioequivalence-module .metric-cell {
  padding: 14px 18px;
  border-right: 1px solid var(--line);
}

.bioequivalence-module .metric-cell:last-child {
  border-right: none;
}

.bioequivalence-module .metric-label {
  font-family: var(--mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  font-weight: 500;
  margin-bottom: 2px;
}

.bioequivalence-module .metric-value {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--ink);
}

.bioequivalence-module .metric-foot {
  font-size: 11px;
  color: var(--ink-3);
}

.bioequivalence-module .divider {
  height: 1px;
  background: var(--line);
  margin: 12px 0;
}

.bioequivalence-module .field-hint {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 2px;
}

/* Tabs */
.bioequivalence-module .tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
  gap: 0;
  flex-wrap: wrap;
}

.bioequivalence-module .tab {
  padding: 9px 16px;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink-3);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  user-select: none;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: var(--sans);
  transition: color 0.15s, border-color 0.15s;
}

.bioequivalence-module .tab:hover {
  color: var(--ink-2);
}

.bioequivalence-module .tab.active {
  color: var(--ink);
  border-bottom-color: var(--accent-3);
  font-weight: 500;
}

.bioequivalence-module .tab i {
  margin-right: 6px;
}

/* Tab Content */
.bioequivalence-module .tab-content {
  min-height: 200px;
}

/* Justification */
.bioequivalence-module .justification h4 {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-3);
  margin-top: 18px;
  margin-bottom: 6px;
  font-weight: 600;
}

.bioequivalence-module .justification h4:first-child {
  margin-top: 0;
}

.bioequivalence-module .justification p {
  margin: 6px 0 12px;
  line-height: 1.65;
}

.bioequivalence-module .justification ul {
  margin: 6px 0 12px;
  padding-left: 22px;
}

.bioequivalence-module .justification ul li {
  margin-bottom: 4px;
  line-height: 1.55;
}

.bioequivalence-module .justification ul li ul {
  margin: 2px 0 4px;
  padding-left: 18px;
}

.bioequivalence-module .justification strong {
  color: var(--ink);
}

.bioequivalence-module .justification table {
  width: 100%;
  font-size: 13px;
  border-collapse: collapse;
  margin: 10px 0;
}

.bioequivalence-module .justification table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
}

.bioequivalence-module .justification table tr:last-child td {
  border-bottom: none;
}

/* Curves */
.bioequivalence-module svg {
  width: 100%;
  max-width: 100%;
  height: auto;
}

/* Responsive */
@media (max-width: 1024px) {
  .bioequivalence-module .row {
    flex-direction: column;
  }
  
  .bioequivalence-module .col {
    max-width: 100% !important;
  }
}

@media (max-width: 768px) {
  .bioequivalence-module .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .bioequivalence-module .metric-strip {
    grid-template-columns: 1fr 1fr !important;
  }

  .bioequivalence-module .metric-cell:nth-child(2) {
    border-right: none;
  }

  .bioequivalence-module .field-row,
  .bioequivalence-module .field-row-3 {
    grid-template-columns: 1fr !important;
  }

  .bioequivalence-module .tabs {
    flex-direction: column;
    border-bottom: none;
  }

  .bioequivalence-module .tab {
    border-bottom: 1px solid var(--line);
    margin-bottom: 0;
  }

  .bioequivalence-module .tab.active {
    border-bottom-color: var(--accent-3);
    border-bottom-width: 2px;
  }
}

@media (max-width: 480px) {
  .bioequivalence-module .metric-strip {
    grid-template-columns: 1fr !important;
  }

  .bioequivalence-module .metric-cell {
    border-right: none !important;
    border-bottom: 1px solid var(--line);
  }

  .bioequivalence-module .metric-cell:last-child {
    border-bottom: none;
  }

  .bioequivalence-module .justification table {
    font-size: 11px;
  }

  .bioequivalence-module .justification table td {
    padding: 4px 6px;
  }
}

/* Tree folder structure */
.tree {
  font-size: 13px;
  user-select: none;
}

.tree-node {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  cursor: pointer;
  border-radius: 4px;
  color: var(--ink-2);
  transition: background 0.1s, color 0.1s;
}

.tree-node:hover {
  background: var(--accent-light);
}

.tree-node.active {
  background: var(--accent-3);
  color: #ffffff;
}

.tree-node.active i {
  color: #ffffff;
}

.tree-node.active .count {
  color: rgba(255, 255, 255, 0.7);
}

.tree-node i {
  font-size: 14px;
  flex-shrink: 0;
  color: var(--ink-3);
}

.tree-node .count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  background: var(--surface-2);
  padding: 0 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.tree-node.active .count {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.tree-node .tree-toggle {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  font-size: 12px;
  color: var(--ink-3);
  cursor: pointer;
  transition: background 0.1s;
  flex-shrink: 0;
}

.tree-node .tree-toggle:hover {
  background: var(--surface-3);
}

.tree-node.active .tree-toggle {
  color: #ffffff;
}

.tree-node.active .tree-toggle:hover {
  background: rgba(255, 255, 255, 0.15);
}

.tree-children {
  padding-left: 20px;
}

/* Folder count badge */
.folder-count {
  background: var(--surface-2);
  color: var(--ink-3);
  font-size: 10px;
  font-family: var(--mono);
  padding: 0 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* Document list improvements */
.document-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line-2);
  cursor: pointer;
  transition: background 0.1s;
}

.document-item:hover {
  background: var(--accent-light);
}

.document-item .doc-icon {
  font-size: 16px;
  color: var(--ink-3);
  flex-shrink: 0;
}

.document-item .doc-name {
  font-weight: 500;
  font-size: 13px;
}

.document-item .doc-meta {
  font-size: 11px;
  color: var(--ink-3);
}

.document-item .doc-status {
  margin-left: auto;
}

/* Responsive */
@media (max-width: 768px) {
  .split {
    grid-template-columns: 1fr;
  }
  
  .split-left {
    border-right: none;
    border-bottom: 1px solid var(--line);
    max-height: 300px;
  }
  
  .split-right {
    max-height: none;
  }
}

/* ========================================
   MILESTONE TIMELINE - EXACT DESIGN
   ======================================== */

.milestone-timeline-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px 24px;
  position: relative;
  overflow: hidden;
}

/* Month Labels - Exact */
.milestone-months-header {
  position: relative;
  width: 100%;
  height: 22px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}

.milestone-month {
  position: absolute;
  transform: translateX(-50%);
  font-size: 10px;
  font-family: var(--mono);
  text-transform: uppercase;
  color: var(--ink-3);
  letter-spacing: 0.08em;
  font-weight: 500;
  top: 0;
}

/* Today Marker - Exact */
.milestone-today-line {
  position: absolute;
  top: 10px;
  bottom: 10px;
  width: 1px;
  background: var(--accent-3);
  z-index: 5;
  pointer-events: none;
}

.milestone-today-label {
  position: absolute;
  top: -12px;
  transform: translateX(-50%);
  font-size: 9px;
  font-family: var(--mono);
  color: var(--accent-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  font-weight: 600;
  z-index: 5;
  background: var(--surface);
  padding: 0 8px;
  border-radius: 3px;
}

/* Milestone Rows - Exact */
.milestone-rows-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 14px;
}

.milestone-row-item {
  display: flex;
  gap: 16px;
  align-items: center;
  min-height: 30px;
  position: relative;
}

.milestone-name-cell {
  flex: 0 0 240px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: 4px;
}

.milestone-name-text {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
}

.milestone-progress-pill {
  font-size: 10px;
  font-family: var(--mono);
  color: var(--ink-3);
  background: var(--surface-2);
  padding: 0 6px;
  border-radius: 3px;
}

.milestone-status-tag {
  font-size: 10px;
  font-family: var(--mono);
  font-weight: 400;
}

.milestone-status-done {
  color: #0f6e56;
}

.milestone-status-at_risk {
  color: #ba7517;
}

.milestone-status-active {
  color: #5947b8;
}

.milestone-status-planned {
  color: var(--ink-3);
}

/* Track - Exact */
.milestone-track-cell {
  flex: 1;
  position: relative;
  height: 30px;
  display: flex;
  align-items: center;
}

/* Bars - Exact */
.milestone-bar-line {
  position: absolute;
  height: 20px;
  border-radius: 4px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 4px;
  transition: opacity 0.15s;
  overflow: hidden;
}

.milestone-bar-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px 0 0 4px;
}

.milestone-bar-status-text {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  font-family: var(--mono);
  font-weight: 500;
  white-space: nowrap;
  z-index: 2;
  padding-left: 8px;
}

/* Legend - Exact */
.milestone-legend {
  display: flex;
  gap: 20px;
  padding-top: 14px;
  margin-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 10px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  flex-wrap: wrap;
}

.milestone-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.milestone-legend-color {
  display: inline-block;
  width: 20px;
  height: 10px;
  border-radius: 3px;
}

.milestone-legend-today {
  color: var(--accent-3);
}

.milestone-legend-today-line {
  display: inline-block;
  width: 20px;
  height: 2px;
  background: var(--accent-3);
  vertical-align: middle;
}

/* Responsive */
@media (max-width: 1024px) {
  .milestone-name-cell {
    flex: 0 0 180px;
  }
  
  .milestone-name-text {
    font-size: 11px;
  }
}

@media (max-width: 768px) {
  .milestone-timeline-card {
    padding: 16px;
    overflow-x: auto;
  }

  .milestone-name-cell {
    flex: 0 0 140px;
  }

  .milestone-name-text {
    font-size: 10px;
  }

  .milestone-progress-pill {
    font-size: 9px;
  }

  .milestone-status-tag {
    font-size: 9px;
  }

  .milestone-bar-line {
    height: 16px;
  }

  .milestone-bar-status-text {
    font-size: 9px;
  }

  .milestone-month {
    font-size: 9px;
  }

  .milestone-today-label {
    font-size: 8px;
    top: -10px;
  }

  .milestone-legend {
    gap: 12px;
    font-size: 9px;
  }

  .milestone-legend-color {
    width: 16px;
    height: 8px;
  }
}

@media (max-width: 480px) {
  .milestone-timeline-card {
    padding: 12px;
  }

  .milestone-name-cell {
    flex: 0 0 100px;
  }

  .milestone-name-text {
    font-size: 9px;
  }

  .milestone-progress-pill {
    font-size: 8px;
    padding: 0 4px;
  }

  .milestone-status-tag {
    font-size: 8px;
  }

  .milestone-bar-line {
    height: 14px;
    min-width: 3px;
  }

  .milestone-bar-status-text {
    font-size: 8px;
    padding-left: 4px;
  }

  .milestone-month {
    font-size: 8px;
  }

  .milestone-today-label {
    font-size: 7px;
    top: -8px;
    padding: 0 4px;
  }

  .milestone-legend {
    gap: 8px;
    font-size: 8px;
  }

  .milestone-legend-color {
    width: 14px;
    height: 7px;
  }
}

/* ========================================
   STUDY DETAIL PAGE - Tabs & Content
   ======================================== */

/* Tabs */
.study-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  overflow-x: auto;
  background: var(--surface);
  border-radius: 8px 8px 0 0;
  padding: 0 4px;
}

.study-tab {
  padding: 10px 16px;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color 0.12s, border-color 0.12s;
}

.study-tab:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.study-tab.active {
  color: var(--ink);
  border-bottom-color: var(--accent-3);
  font-weight: 600;
}

.study-tab i {
  margin-right: 6px;
  font-size: 14px;
}

.study-tab .tab-badge {
  display: inline-block;
  background: var(--surface-3);
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 600;
  padding: 0 6px;
  border-radius: 10px;
  margin-left: 4px;
  min-width: 18px;
  text-align: center;
}

.study-tab.active .tab-badge {
  background: var(--accent-soft);
  color: var(--accent-3);
}

/* Tab Content */
.tab-content {
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Grid layouts */
.grid-split {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 22px;
  align-items: start;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Stats */
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}

.stat-label {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
  margin-bottom: 6px;
}

.stat-value {
  font-family: var(--display);
  font-size: 32px;
  font-weight: 500;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.stat-sub {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 6px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

/* Banners */
.banner {
  padding: 14px 18px;
  border-radius: 10px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 13px;
  border: 1px solid;
  margin-bottom: 20px;
}

.banner-pass {
  background: var(--ok-soft);
  border-color: rgba(22, 163, 74, 0.25);
  color: var(--ok);
}

.banner-fail {
  background: var(--danger-soft);
  border-color: rgba(220, 38, 38, 0.25);
  color: var(--danger);
}

.banner-info {
  background: var(--info-soft);
  border-color: rgba(44, 84, 112, 0.2);
  color: var(--info);
}

.banner-warn {
  background: var(--warn-soft);
  border-color: rgba(180, 83, 9, 0.25);
  color: var(--warn);
}

.banner-icon {
  flex-shrink: 0;
  margin-top: 1px;
}

/* Section Headers */
.section-h {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  gap: 12px;
  flex-wrap: wrap;
}

.section-h h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

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

/* Document Table */
.tbl-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.tbl th, .tbl td {
  padding: 12px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.tbl th {
  background: var(--surface-2);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.tbl tr:last-child td {
  border-bottom: none;
}

.tbl tr.clickable {
  cursor: pointer;
  transition: background 0.1s;
}

.tbl tr.clickable:hover td {
  background: var(--surface-2);
}

.tbl td.num {
  font-family: 'JetBrains Mono', monospace;
  text-align: right;
}

.tbl-tight th, .tbl-tight td {
  padding: 9px 14px;
}

/* Tree */
.tree {
  font-size: 13px;
  user-select: none;
}

.tree-node {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  cursor: pointer;
  border-radius: 4px;
  color: var(--ink-2);
  transition: background 0.1s, color 0.1s;
}

.tree-node:hover {
  background: var(--accent-light);
}

.tree-node.active {
  background: var(--accent-3);
  color: #ffffff;
}

.tree-node.active i {
  color: #ffffff;
}

.tree-node.active .count {
  color: rgba(255, 255, 255, 0.7);
}

.tree-node i {
  font-size: 14px;
  flex-shrink: 0;
  color: var(--ink-3);
}

.tree-node .count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  background: var(--surface-2);
  padding: 0 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.tree-node.active .count {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.tree-children {
  padding-left: 20px;
}

/* Progress steps */
.progress-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.progress-step:last-child {
  border-bottom: none;
}

.progress-step .step-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
}

.progress-step .step-icon.done {
  background: var(--ok);
  color: white;
}

.progress-step .step-icon.pending {
  background: var(--surface-3);
  color: var(--ink-3);
}

.progress-step .step-label {
  font-size: 13px;
  font-weight: 500;
  flex: 1;
}

.progress-step .step-label.done {
  color: var(--ink);
}

.progress-step .step-label.pending {
  color: var(--ink-3);
}

.progress-step .step-status {
  font-size: 11px;
  color: var(--ok);
}

/* Empty state */
.empty {
  text-align: center;
  padding: 56px 24px;
  color: var(--ink-3);
}

.empty-mark {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  background: var(--surface-2);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-4);
}

.empty-title {
  font-family: var(--display);
  font-size: 22px;
  color: var(--ink);
  margin-bottom: 6px;
}

.empty-desc {
  font-size: 13px;
  margin-bottom: 18px;
}

@media (max-width: 768px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
  
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .study-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
  }
  
  .study-tab {
    font-size: 12px;
    padding: 8px 12px;
  }
  
  .study-tab i {
    display: none;
  }
  
  .tbl-wrap {
    overflow-x: auto;
  }
  
  .tbl {
    font-size: 12px;
  }
  
  .tbl th, .tbl td {
    padding: 8px 10px;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .study-tab {
    font-size: 11px;
    padding: 6px 10px;
  }
  
  .card-lg-pad {
    padding: 16px;
  }
}