/* ============================================================
   REGULATORY AUTOMATION PLATFORM — Main Stylesheet
   Color palette: Teal #377477 / Blue #2692b6
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

:root {
  /* — Core Brand — */
  --primary:        #2692b6;
  --primary-dark:   #1e7a99;
  --primary-light:  #3aafd4;

  /* — Agent Accent Colors — */
  --agent-dossier:    #E07B2A;   /* orange  – Regulatory Dossier */
  --agent-cmc:        #2E8B57;   /* green   – CMC/Quality */
  --agent-irb:        #7B3FA0;   /* purple  – IRB/Ethics */
  --agent-safety:     #E07B2A;   /* orange  – Safety Narrative */
  --agent-deficiency: #E8A020;   /* gold    – Deficiency Response */
  --agent-labeling:   #377477;   /* teal    – Labeling & SPL */

  /* — Semantic — */
  --success:   #2E8B57;
  --warning:   #E8A020;
  --danger:    #C0392B;
  --info:      #2692b6;

  /* — Neutrals — */
  --bg:        #F2F8FA;
  --surface:   #FFFFFF;
  --border:    #C8DCE3;
  --text:      #152830;
  --text-muted:#52717A;
  --text-light:#8AAAB3;

  /* — Sidebar — */
  --sidebar-bg:     #1e4a4d;
  --sidebar-active: #2692b6;
  --sidebar-text:   #B8D8DC;
  --sidebar-hover:  rgba(255,255,255,0.07);

  /* — Spacing & Shape — */
  --radius-sm:  6px;
  --radius:     10px;
  --radius-lg:  16px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.08);
  --shadow:     0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.14);

  /* — Typography — */
  --font-main:  'DM Sans', system-ui, sans-serif;
  --font-mono:  'Space Mono', monospace;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-light); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

/* ══════════════════════════════════════════
   LAYOUT
═══════════════════════════════════════════ */
.platform-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-template-rows: 60px 1fr;
  min-height: 100vh;
  grid-template-areas:
    "sidebar topbar"
    "sidebar main";
}

/* ── Sidebar ── */
.sidebar {
  grid-area: sidebar;
  background: linear-gradient(
    280deg,
    #377477 0%,
    #2692b6 100%
  );
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  width: 260px;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-logo {
  padding: 20px 22px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logo .brand-name {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #fff;
  line-height: 1.3;
}
.sidebar-logo .brand-sub {
  font-size: 0.68rem;
  color: var(--sidebar-text);
  margin-top: 2px;
}
.sidebar-logo .logo-icon {
  width: 32px; height: 32px;
  background: rgba(255,255,255,0.18);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
  font-size: 1rem;
}

.nav-section {
  padding: 18px 12px 4px;
}
.nav-section-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f0ebff;
  padding: 0 10px;
  margin-bottom: 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: #f6f6f6;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.18s;
  margin-bottom: 2px;
}
.nav-item:hover {
  background: var(--sidebar-hover);
  color: #fff;
  text-decoration: none;
}
.nav-item.active {
  background: rgba(255,255,255,0.20);
  color: #FFFFFF;
}
.nav-item .nav-icon {
  width: 20px; height: 20px;
  opacity: 0.85;
  flex-shrink: 0;
}
.nav-item .nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
}

/* Agent color dots in sidebar */
.nav-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sidebar-user {
  margin-top: auto;
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-user .user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.20);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 0.8rem;
  flex-shrink: 0;
}
.sidebar-user .user-name {
  font-size: 0.8rem; font-weight: 600; color: #fff; line-height: 1.2;
}
.sidebar-user .user-role {
  font-size: 0.68rem; color: var(--sidebar-text);
}
.sidebar-user .logout-btn {
  margin-left: auto;
  color: var(--sidebar-text);
  opacity: 0.7;
  transition: opacity 0.15s;
}
.sidebar-user .logout-btn:hover { opacity: 1; }

/* ── Top Bar ── */
.topbar {
  grid-area: topbar;
  position: fixed; top: 0;
  left: 0; right: 0;
  height: 60px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px;
  gap: 16px;
  z-index: 90;
  box-shadow: var(--shadow-sm);
}
.topbar-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  flex: 1;
  display: block;
  width: 100%;
  white-space: nowrap;
}
.topbar-search {
  flex: 1; max-width: 420px;
  position: relative;
}
.topbar-search input {
  width: 100%;
  padding: 8px 14px 8px 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  font-size: 0.85rem;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.topbar-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(38,146,182,0.12);
}
.topbar-search .search-icon {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 0.85rem;
}
.topbar-actions {
  height: 56px;
  display: flex ;
  align-items: center ;
  gap: 8px ;
  margin: 0 ;
}
.topbar-btn {
  width: 36px; height: 36px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}
.topbar-btn:hover { border-color: var(--primary); color: var(--primary); }
.topbar-btn .badge {
  position: absolute; top: -4px; right: -4px;
  width: 16px; height: 16px;
  background: var(--danger); color: #fff;
  font-size: 0.6rem; font-weight: 700;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--surface);
}
.topbar-divider {
  width: 1px; height: 28px; background: var(--border);
}

/* ── Main Content ── */
.main-content {
  grid-area: main;
  padding: 28px;
  min-height: calc(100vh - 60px);
}

/* ══════════════════════════════════════════
   COMPONENTS
═══════════════════════════════════════════ */

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-header {
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}
.card-body { padding: 18px 20px; }
.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: rgba(242,248,250,0.5);
  border-radius: 0 0 var(--radius) var(--radius);
}

/* Stat Cards */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
  position: relative;
  overflow: hidden;
}
.stat-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0;
  width: 4px; height: 100%;
}
.stat-card.blue::before   { background: var(--primary); }
.stat-card.teal::before   { background: var(--agent-labeling); }
.stat-card.green::before  { background: var(--success); }
.stat-card.orange::before { background: var(--agent-dossier); }
.stat-card.red::before    { background: var(--danger); }
.stat-card.purple::before { background: var(--agent-irb); }

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
  margin-bottom: 4px;
}
.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.stat-icon {
  position: absolute; right: 16px; top: 16px;
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  opacity: 0.15;
}

/* Badges / Status Pills */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.badge-draft      { background: #E8F4F7; color: #377477; }
.badge-review     { background: #FFF3E0; color: #E07B2A; }
.badge-approved   { background: #E8F5E9; color: #2E7D32; }
.badge-validated  { background: #E0F4FA; color: #1a7a9c; }
.badge-pending    { background: #FFF8E1; color: #F57F17; }
.badge-rejected   { background: #FFEBEE; color: #C62828; }
.badge-submitted  { background: #E0F3FA; color: #1e6e8a; }
.badge-running    { background: #E0F7FA; color: #2692b6; }
.badge-new        { background: #E5F4F5; color: #2a6466; }

/* Tags */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: #e5f4f7;
  color: #377477;
}
.tag-blue   { background: #e0f2fa; color: #1976d2; }
.tag-green  { background: #e8f5e9; color: #2e8b57; }
.tag-orange { background: #fff3e0; color: #e07b2a; }
.tag-purple { background: #f3e5f5; color: #7b3fa0; }
.tag-gray   { background: #f5f5f5; color: #616161; }

/* Tables */
.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.data-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
.data-table tbody tr:hover { background: rgba(38,146,182,0.04); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* Section List Items (ICH E3 Sections) */
.section-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}
.section-list-item:last-child {
  border-bottom: none;
}
.section-list-item:hover {
  background-color: rgba(38, 146, 182, 0.04);
}
.section-num {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #2692b6, #1e7a99);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.section-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  display: block;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.section-list-item:hover .section-name {
  color: var(--primary);
}
.section-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  background: rgba(38, 146, 182, 0.08);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}
.section-list-item .badge {
  flex-shrink: 0;
}
.section-list-item .btn-xs {
  flex-shrink: 0;
  padding: 4px 10px;
  font-size: 0.72rem;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.18s;
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary   { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-teal      { background: #377477; color: #fff; }
.btn-teal:hover { background: #2b5d60; color: #fff; }
.btn-success   { background: var(--success); color: #fff; }
.btn-success:hover { background: #236B43; color: #fff; }
.btn-warning   { background: var(--warning); color: #fff; }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-outline   { background: transparent; border: 1px solid var(--border); color: var(--text-muted); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: rgba(38,146,182,0.05); }
.btn-secondary { background: #f0f1f3; color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: #e5e7eb; color: var(--text); border-color: var(--text-muted); }
.btn-sm { padding: 5px 12px; font-size: 0.78rem; }
.btn-xs { padding: 4px 10px; font-size: 0.72rem; }
.btn-lg { padding: 12px 24px; font-size: 0.95rem; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* Forms */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 0.875rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(38,146,182,0.10);
}
.form-control::placeholder { color: var(--text-light); }
.form-help { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 0.75rem; color: var(--danger); margin-top: 4px; }

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 16px;
  display: flex; align-items: flex-start; gap: 10px;
}
.alert-danger  { background: #FFEBEE; border-left: 4px solid var(--danger); color: #C62828; }
.alert-success { background: #E8F5E9; border-left: 4px solid var(--success); color: #2E7D32; }
.alert-warning { background: #FFF8E1; border-left: 4px solid var(--warning); color: #E65100; }
.alert-info    { background: #E0F4FA; border-left: 4px solid var(--primary); color: #1e6e8a; }

/* Page Header */
.page-header {
  display: flex; align-items: flex-start; gap: 14px;
  margin-bottom: 28px;
}
.page-header-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  background: rgba(38,146,182,0.10);
  color: var(--primary);
}
.page-header h1 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.page-header .subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 3px;
}
.page-header-actions {
  margin-left: auto;
  display: flex; align-items: center; gap: 10px;
}

/* Grid Utilities */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-cols-3-2 { grid-template-columns: 2fr 1fr; }

/* Timeline */
.timeline { position: relative; padding-left: 24px; }
.timeline::before {
  content: '';
  position: absolute; left: 8px; top: 6px; bottom: 6px;
  width: 2px; background: var(--border);
}
.timeline-item { position: relative; margin-bottom: 18px; }
.timeline-item::before {
  content: '';
  position: absolute; left: -20px; top: 6px;
  width: 10px; height: 10px;
  background: var(--primary); border: 2px solid var(--surface);
  border-radius: 50%; box-shadow: 0 0 0 2px var(--primary);
}
.timeline-item.done::before { background: var(--success); box-shadow: 0 0 0 2px var(--success); }
.timeline-item.pending::before { background: var(--border); box-shadow: 0 0 0 2px var(--border); }
.timeline-title { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.timeline-meta  { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

/* Agent Header Accent Bars */
.agent-header { padding: 20px 24px; border-radius: var(--radius); color: #fff; margin-bottom: 24px; }
.agent-header.dossier    { background: linear-gradient(135deg, #E07B2A, #C0622A); }
.agent-header.cmc        { background: linear-gradient(135deg, #2E8B57, #1E6B3F); }
.agent-header.irb        { background: linear-gradient(135deg, #7B3FA0, #5B2A80); }
.agent-header.safety     { background: linear-gradient(135deg, #E07B2A, #B5601C); }
.agent-header.deficiency { background: linear-gradient(135deg, #E8A020, #C07A00); }
.agent-header.labeling   { background: linear-gradient(135deg, #377477, #255a5c); }
.agent-header.orchestration { background: linear-gradient(135deg, #2692b6, #1e7a99); }
.agent-header h2 { font-size: 1.15rem; font-weight: 700; }
.agent-header p  { font-size: 0.82rem; opacity: 0.88; margin-top: 4px; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 22px; }
.tab {
  padding: 9px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Breadcrumb */
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { opacity: 0.4; }

/* ══════════════════════════════════════════
   AUTH PAGES
═══════════════════════════════════════════ */
.auth-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg);
}
.auth-panel {
  display: flex; align-items: center; justify-content: center;
  padding: 48px 40px;
}
.auth-brand {
  background: linear-gradient(145deg, #2692b6  0%, #1e4a4d 100%);
  padding: 48px 40px;
  display: flex; flex-direction: column; justify-content: center;
  position: relative; overflow: hidden;
}
.auth-brand::after {
  content: '';
  position: absolute; bottom: -80px; right: -80px;
  width: 320px; height: 320px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
}
.auth-brand::before {
  content: '';
  position: absolute; top: -40px; left: -40px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,0.03);
}
.auth-brand h1 { font-size: 2rem; font-weight: 700; color: #fff; line-height: 1.2; }
.auth-brand p  { color: rgba(184,216,220,0.85); font-size: 0.9rem; margin-top: 12px; line-height: 1.6; }
.auth-brand .feature-list { margin-top: 36px; }
.auth-brand .feature-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.auth-brand .feature-item:last-child { border-bottom: none; }
.auth-brand .feature-dot {
  width: 10px; height: 10px; border-radius: 50%;
  flex-shrink: 0;
}
.auth-brand .feature-text { font-size: 0.85rem; color: rgba(184,216,220,0.9); }

.auth-form-box { width: 100%; max-width: 420px; }
.auth-form-box .form-title {
  font-size: 1.4rem; font-weight: 700; color: var(--text); margin-bottom: 6px;
}
.auth-form-box .form-subtitle { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 28px; }

/* Social buttons styles for auth pages */
.social-buttons { display:flex; flex-direction:column; gap:10px; margin-top:14px; }
.social-btn {
  display:flex; align-items:center; gap:12px; padding:10px 14px; border-radius:10px;
  border:1px solid var(--border); background:var(--surface); color:var(--text); text-decoration:none;
  transition: box-shadow 0.16s, transform 0.12s;
}
.social-btn:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.social-btn .icon { width:20px; height:20px; display:inline-flex; align-items:center; justify-content:center; }
.social-btn .label { font-weight:700; font-size:0.92rem; }
.social-btn.microsoft { border-color: #e9e9e9; }

@media (max-width: 600px) {
  .auth-panel { padding: 28px 18px; }
  .auth-form-box { padding: 12px; }
}

/* ══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .platform-layout { grid-template-columns: 1fr; grid-template-areas: "topbar" "main"; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .topbar { left: 0; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .grid-cols-3-2 { grid-template-columns: 1fr; }
  .auth-layout { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
}

/* CSR Content & Editor Styles */
.csr-content-area {
  min-height: 300px;
  line-height: 1.8;
  font-size: 0.95rem;
  color: var(--text);
}
.csr-content-area.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  text-align: center;
  background: rgba(38, 146, 182, 0.02);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-style: italic;
}
.csr-rendered-content {
  padding: 20px;
  background: #fafbfc;
  border-radius: var(--radius-sm);
  overflow-x: auto;
}
.csr-rendered-content p {
  margin-bottom: 14px;
  line-height: 1.8;
}
.csr-rendered-content h2,
.csr-rendered-content h3,
.csr-rendered-content h4 {
  margin-top: 20px;
  margin-bottom: 12px;
  font-weight: 700;
  color: var(--text);
}
.csr-rendered-content h2 { font-size: 1.15rem; }
.csr-rendered-content h3 { font-size: 1rem; }
.csr-rendered-content h4 { font-size: 0.95rem; }
.csr-rendered-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}
.csr-rendered-content table th,
.csr-rendered-content table td {
  padding: 10px 12px;
  border: 1px solid var(--border);
  text-align: left;
}
.csr-rendered-content table th {
  background: rgba(38, 146, 182, 0.08);
  font-weight: 600;
  color: var(--text);
}
.csr-rendered-content table tbody tr:hover {
  background: rgba(38, 146, 182, 0.04);
}
.csr-rendered-content ul,
.csr-rendered-content ol {
  margin: 12px 0 12px 24px;
}
.csr-rendered-content li {
  margin-bottom: 6px;
}
.csr-rendered-content blockquote {
  margin: 16px 0;
  padding: 12px 16px;
  border-left: 4px solid var(--primary);
  background: rgba(38, 146, 182, 0.05);
  color: var(--text-muted);
  font-style: italic;
}

.csr-editor {
  width: 100%;
  min-height: 600px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.csr-editor:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(38, 146, 182, 0.10);
}
.csr-editor::placeholder {
  color: var(--text-light);
}

/* Status Dot for Section Navigation */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.draft      { background: #377477; }
.status-dot.review     { background: #e07b2a; }
.status-dot.approved   { background: #2e8b57; }
.status-dot.validated  { background: #1a7a9c; }
.status-dot.pending    { background: #f57f17; }
.status-dot.rejected   { background: #c62828; }
.status-dot.submitted  { background: #1e6e8a; }
.status-dot.running    { background: #2692b6; animation: pulse 1.5s ease-in-out infinite; }
.status-dot.locked     { background: #6b7280; }
.status-dot.generated  { background: #2e8b57; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Spinner for loading states */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(38, 146, 182, 0.3);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-light); }

/* Utility classes */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.text-sm { font-size: 0.8rem; }
.text-xs { font-size: 0.72rem; }
.text-muted { color: var(--text-muted); }
.font-bold { font-weight: 700; }
.w-full { width: 100%; }
.truncate { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
