/* ================================================================
   YonderWorks Platform — Main Stylesheet
   Puerto Rico Tax Software | Version 2.0
   Color Palette: YonderWorks Blue #28b0f8, Navy #082030
   ================================================================ */
:root {
  /* ── YonderWorks Brand ─────────────────────────────────────── */
  --yw-blue:      #28b0f8;   /* primary — logo sky blue            */
  --yw-blue-dark: #0e86cc;   /* hover / active states              */
  --yw-blue-lite: #60c8fa;   /* lighter accent                     */
  --yw-navy:      #082030;   /* deep navy — logo shadow / sidebar  */
  --yw-navy-mid:  #0d3050;   /* mid-tone navy                      */
  --yw-highlight: #88d8f8;   /* pale blue highlight                */
  /* ── Aliases (keep old names so existing PHP/JS never breaks) ─ */
  --aim-red:      #28b0f8;   /* was #CC0000 — now brand blue       */
  --aim-red-dark: #0e86cc;   /* was #990000                        */
  --aim-red-lite: #60c8fa;   /* was #ff3333                        */
  --aim-dark:     #082030;   /* was #1a1a1a — now navy             */
  --aim-dark2:    #0d3050;   /* was #2d2d2d                        */
  --aim-sidebar:  #082030;   /* was #1e1e2e — navy sidebar         */
  --aim-accent:   #e8a020;   /* gold accent — unchanged            */
  /* ── Neutrals ─────────────────────────────────────────────── */
  --bg:           #f0f2f5;
  --bg-card:      #ffffff;
  --border:       #dee2e6;
  --border-dark:  #adb5bd;
  --text:         #212529;
  --text-muted:   #6c757d;
  /* ── Semantic ──────────────────────────────────────────────── */
  --success:      #198754;
  --warning:      #ffc107;
  --danger:       #dc3545;
  --info:         #0dcaf0;
  --purple:       #6f42c1;
  --teal:         #20c997;
  /* ── Layout ────────────────────────────────────────────────── */
  --radius:       6px;
  --radius-lg:    10px;
  --shadow:       0 2px 8px rgba(0,0,0,.1);
  --shadow-lg:    0 4px 24px rgba(0,0,0,.15);
  --sidebar-w:    240px;
  --topnav-h:     56px;
  --transition:   all .2s ease;
}
/* ================================================================
   LIGHT MODE
   ================================================================ */
[data-theme="light"] {
  --bg:           #f8f9fb;
  --bg-card:      #ffffff;
  --bg-alt:       #f0f2f5;
  --border:       #e2e5ea;
  --border-dark:  #c8cdd4;
  --text:         #1a202c;
  --text-muted:   #64748b;
  --aim-dark:     #ffffff;
  --aim-dark2:    #f1f3f6;
  --aim-sidebar:  #082030;   /* keep sidebar navy in light mode */
  --shadow:       0 1px 4px rgba(0,0,0,.08);
  --shadow-lg:    0 4px 16px rgba(0,0,0,.1);
}
[data-theme="light"] .top-nav {
  background: #ffffff;
  color: #1a202c;
  border-bottom: 3px solid var(--yw-blue);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
[data-theme="light"] .sidebar-toggle,
[data-theme="light"] .user-btn,
[data-theme="light"] .btn-lang,
[data-theme="light"] .btn-mode,
[data-theme="light"] .save-indicator,
[data-theme="light"] .breadcrumb-nav,
[data-theme="light"] .breadcrumb-nav a,
[data-theme="light"] .return-badge,
[data-theme="light"] .user-name {
  color: #1a202c;
}
[data-theme="light"] .sidebar-toggle:hover,
[data-theme="light"] .user-btn:hover {
  background: rgba(0,0,0,.06);
}
[data-theme="light"] .lang-toggle,
[data-theme="light"] .mode-toggle {
  background: rgba(0,0,0,.07);
}
[data-theme="light"] .btn-lang.active,
[data-theme="light"] .btn-mode.active {
  background: var(--yw-blue);
  color: #fff;
}
[data-theme="light"] .btn-lang:hover,
[data-theme="light"] .btn-mode:hover {
  color: var(--yw-blue-dark);
}
[data-theme="light"] .return-badge {
  background: rgba(0,0,0,.06);
}
[data-theme="light"] .bc-sep { color: rgba(0,0,0,.3); }
[data-theme="light"] body,
[data-theme="light"] .app-body {
  background: #f0f3f8;
}
[data-theme="light"] .panel {
  background: #ffffff;
  border-color: #e2e5ea;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
[data-theme="light"] .panel-header {
  background: #fafbfc;
  border-color: #e2e5ea;
}
[data-theme="light"] .stat-card {
  background: #ffffff;
  border-color: #e2e5ea;
}
[data-theme="light"] .form-control,
[data-theme="light"] .form-select {
  background: #ffffff;
  border-color: #d1d5db;
  color: #1a202c;
}
[data-theme="light"] .form-control:focus {
  border-color: var(--yw-blue);
  box-shadow: 0 0 0 2px rgba(40,176,248,.15);
}
[data-theme="light"] .data-table th {
  background: #f1f3f6;
  color: #374151;
  border-color: #e2e5ea;
}
[data-theme="light"] .data-table td {
  border-color: #e9ecef;
}
[data-theme="light"] .data-table tr:hover td {
  background: #f0f8ff;
}
[data-theme="light"] .user-dropdown {
  background: #ffffff;
  border-color: #e2e5ea;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
[data-theme="light"] .user-dropdown a { color: #1a202c; }
[data-theme="light"] .user-dropdown a:hover { background: #f5f5f5; }
[data-theme="light"] .modal-box {
  background: #ffffff;
  border: 1px solid #e2e5ea;
}
[data-theme="light"] .modal-header {
  background: #fafbfc;
  border-color: #e2e5ea;
}
[data-theme="light"] .modal-overlay { background: rgba(0,0,0,.4); }
[data-theme="light"] .error-panel {
  background: #ffffff;
  border-color: #e2e5ea;
  box-shadow: 0 4px 20px rgba(0,0,0,.12);
}
[data-theme="light"] .kb-tip {
  background: #ecfdf5; border-color: #6ee7b7; color: #065f46;
}
[data-theme="light"] .kb-warning {
  background: #fffbeb; border-color: #fcd34d; color: #78350f;
}
[data-theme="light"] .kb-code,
[data-theme="light"] pre.kb-code {
  background: #f1f3f6; color: #1a202c;
}
/* ── Theme toggle ────────────────────────────────────────────── */
.theme-toggle-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 20px;
  color: #fff;
  cursor: pointer;
  padding: 4px 12px;
  font-size: .8rem;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all .15s;
  white-space: nowrap;
}
.theme-toggle-btn:hover { background: rgba(255,255,255,.15); }
[data-theme="light"] .theme-toggle-btn {
  border-color: rgba(0,0,0,.2);
  color: #1a202c;
}
[data-theme="light"] .theme-toggle-btn:hover { background: rgba(0,0,0,.07); }
/* ─── RESET ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
       background: var(--bg); color: var(--text); line-height: 1.5; }
a { color: var(--yw-blue); text-decoration: none; }
a:hover { color: var(--yw-blue-dark); }
img { max-width: 100%; }
.hidden { display: none !important; }
.text-muted    { color: var(--text-muted) !important; }
.text-danger   { color: var(--danger) !important; }
.text-success  { color: var(--success) !important; }
.text-warning  { color: var(--warning) !important; }
.text-primary  { color: var(--yw-blue) !important; }
.small  { font-size: .85em; }
.ms-2   { margin-left: .5rem; }
.mb-3   { margin-bottom: 1rem; }
.mt-2   { margin-top: .5rem; }
.mb-0   { margin-bottom: 0; }
.p-2    { padding: .5rem; }
.fw-bold { font-weight: 700; }
/* ─── LOGIN PAGE ─────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #082030 0%, #0d3050 40%, #1a4a6b 70%, #082030 100%);
}
.login-container { width: 100%; max-width: 420px; padding: 20px; }
.login-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  border-top: 4px solid var(--yw-blue);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo .logo-img { max-height: 70px; }
.login-form .form-group { margin-bottom: 18px; }
.btn-login { width: 100%; padding: 12px; font-size: 1rem; margin-top: 8px; border-radius: var(--radius); }
.login-footer { text-align: center; margin-top: 20px; color: var(--text-muted); }
.lang-switch-login { display: flex; gap: 12px; margin-bottom: 16px; }
.lang-switch-login a { color: var(--text-muted); font-size: .9em; }
.lang-switch-login a.active { color: var(--yw-blue); font-weight: 700; }
.input-group { display: flex; gap: 0; }
.input-group .form-control { flex: 1; border-radius: var(--radius) 0 0 var(--radius); }
.btn-eye { background: var(--border); border: 1px solid var(--border-dark); border-left: none;
           padding: 0 12px; border-radius: 0 var(--radius) var(--radius) 0; cursor: pointer; }
/* ─── TOP NAVIGATION ─────────────────────────────────────────── */
.top-nav {
  position: fixed; top: 0; left: 0; right: 0; height: var(--topnav-h);
  background: var(--yw-navy);
  color: #fff;
  display: flex; align-items: center; padding: 0 16px;
  z-index: 1000; box-shadow: 0 2px 8px rgba(0,0,0,.3); gap: 12px;
  border-bottom: 3px solid var(--yw-blue);
}
.nav-left  { display: flex; align-items: center; gap: 12px; flex: 1; }
.nav-center { flex: 1; text-align: center; }
.nav-right  { display: flex; align-items: center; gap: 12px; }
.sidebar-toggle { background: none; border: none; color: #fff; font-size: 1.2rem;
                  cursor: pointer; padding: 6px; border-radius: var(--radius); transition: var(--transition); }
.sidebar-toggle:hover { background: rgba(255,255,255,.1); }
.nav-logo { display: flex; align-items: center; }
/* ─── LOGO VISIBILITY — DARK / LIGHT THEME ─────────────────── */
/* Dark mode (default): top nav is navy #082030. Logo has navy
   elements that vanish. White pill makes the full logo visible. */
.nav-logo img { height: 36px; background: rgba(255,255,255,.92); border-radius: 6px; padding: 3px 10px; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
/* Light mode: top nav is white — logo visible, no background needed */
[data-theme="light"] .nav-logo img { height: 36px; background: transparent; border-radius: 0; padding: 0; box-shadow: none; }
.breadcrumb-nav { display: flex; align-items: center; gap: 6px; color: rgba(255,255,255,.7); font-size: .85em; }
.breadcrumb-nav a { color: rgba(255,255,255,.7); }
.breadcrumb-nav a:hover { color: #fff; }
.bc-sep { color: rgba(255,255,255,.4); }
.return-badge { background: rgba(40,176,248,.15); border: 1px solid rgba(40,176,248,.3);
                border-radius: 20px; padding: 4px 16px; font-size: .85em; color: #fff; }
/* Lang / Mode toggles */
.lang-toggle, .mode-toggle { display: flex; background: rgba(255,255,255,.1); border-radius: 20px; overflow: hidden; }
.btn-lang, .btn-mode { background: none; border: none; color: rgba(255,255,255,.8);
                        padding: 4px 10px; cursor: pointer; font-size: .8em; transition: var(--transition);
                        text-decoration: none; display: flex; align-items: center; gap: 4px; }
.btn-lang.active, .btn-mode.active { background: var(--yw-blue); color: #fff; }
.btn-lang:hover, .btn-mode:hover { color: #fff; }
/* User menu */
.user-btn { background: none; border: none; color: #fff; cursor: pointer;
            display: flex; align-items: center; gap: 8px; padding: 6px 10px;
            border-radius: var(--radius); transition: var(--transition); }
.user-btn:hover { background: rgba(255,255,255,.1); }
.user-name { font-size: .85em; max-width: 140px; overflow: hidden;
             text-overflow: ellipsis; white-space: nowrap; }
/* Avatar */
.user-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover;
               border: 2px solid var(--yw-blue); vertical-align: middle; }
.user-dropdown { position: absolute; top: calc(var(--topnav-h) - 4px); right: 8px;
                 background: var(--bg-card); border: 1px solid var(--border);
                 border-radius: var(--radius); min-width: 220px; border-top: 3px solid var(--yw-blue);
                 box-shadow: var(--shadow-lg); z-index: 2000; }
.user-dropdown .user-info { padding: 12px 16px; }
.user-dropdown .user-info strong { display: block; }
.user-dropdown .user-info small { display: block; color: var(--text-muted); }
.user-dropdown a { display: flex; align-items: center; gap: 10px;
                   padding: 8px 16px; color: var(--text); transition: var(--transition); }
.user-dropdown a:hover { background: var(--bg); color: var(--yw-blue); }
.user-dropdown hr { border: none; border-top: 1px solid var(--border); margin: 4px 0; }
.user-menu { position: relative; }
/* Save indicator */
.save-indicator { display: flex; align-items: center; gap: 6px; color: rgba(255,255,255,.7); font-size: .8em; }
/* KB/Help button */
.btn-nav-icon { background: none; border: none; color: rgba(255,255,255,.75);
                cursor: pointer; padding: 6px 8px; border-radius: var(--radius);
                font-size: 1.1rem; transition: var(--transition);
                display: flex; align-items: center; }
.btn-nav-icon:hover { color: var(--yw-blue); background: rgba(255,255,255,.1); }
/* ─── SIDEBAR ─────────────────────────────────────────────────── */
.sidebar { position: fixed; top: var(--topnav-h); left: 0;
           width: var(--sidebar-w); height: calc(100vh - var(--topnav-h));
           background: var(--yw-navy); overflow-y: auto;
           transition: transform .25s ease; z-index: 900;
           border-right: 1px solid rgba(40,176,248,.1); }
.sidebar.collapsed { transform: translateX(-100%); }
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(40,176,248,.3); border-radius: 2px; }
.sidebar-nav { padding: 12px 0; }
.nav-item { display: flex; align-items: center; gap: 10px;
            padding: 9px 20px; color: rgba(255,255,255,.7);
            transition: var(--transition); font-size: .9em; }
.nav-item:hover { background: rgba(40,176,248,.1); color: #fff; }
.nav-item.active { background: var(--yw-blue); color: #fff; }
.nav-item i { width: 18px; text-align: center; opacity: .8; }
.nav-section { margin-top: 6px; }
.nav-section-title { padding: 8px 20px 4px; font-size: .7em;
                     text-transform: uppercase; letter-spacing: .08em;
                     color: rgba(255,255,255,.35); font-weight: 700; }
.nav-efile { color: var(--aim-accent) !important; font-weight: 600; }
.nav-efile:hover { color: #fff !important; }
.nav-schedule { padding-left: 32px; font-size: .85em; }
/* Sidebar accent line for active module */
.sidebar .nav-section[style*="border-left"] {
  border-left-color: var(--yw-blue) !important;
}
/* ─── MAIN CONTENT ─────────────────────────────────────────────── */
.main-content { margin-left: var(--sidebar-w); margin-top: var(--topnav-h);
                min-height: calc(100vh - var(--topnav-h)); transition: margin-left .25s ease; }
.main-content.sidebar-collapsed { margin-left: 0; }
.content-wrapper { padding: 24px; max-width: 1400px; }
/* ─── DASHBOARD ─────────────────────────────────────────────────── */
.dashboard-grid { display: flex; flex-direction: column; gap: 20px; }
.stats-bar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.stat-card { background: var(--bg-card); border-radius: var(--radius-lg);
             padding: 16px 20px; display: flex; align-items: center; gap: 16px;
             box-shadow: var(--shadow); border-left: 4px solid; }
.stat-card.primary { border-color: var(--yw-blue); }
.stat-card.warning { border-color: var(--warning); }
.stat-card.success { border-color: var(--success); }
.stat-card.info    { border-color: var(--info); }
.stat-card.purple  { border-color: var(--purple); }
.stat-icon  { font-size: 1.8rem; opacity: .6; }
.stat-num   { font-size: 1.8rem; font-weight: 800; line-height: 1; }
.stat-label { font-size: .8em; color: var(--text-muted); margin-top: 2px; }
.quick-actions .action-buttons { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.btn-action { display: flex; align-items: center; gap: 8px; }
.mode-banner { padding: 10px 20px; border-radius: var(--radius);
               display: flex; align-items: center; gap: 10px; font-size: .9em; }
.mode-banner.professional { background: rgba(8,32,48,.8); color: #b8e4fb;
                             border: 1px solid rgba(40,176,248,.2); }
.mode-banner.interview    { background: #1a4a2a; color: #ccf5d4; }
/* ─── PANEL ─────────────────────────────────────────────────────── */
.panel { background: var(--bg-card); border-radius: var(--radius-lg);
         box-shadow: var(--shadow); overflow: hidden; }
.panel-header { padding: 14px 20px; border-bottom: 1px solid var(--border);
                display: flex; align-items: center; justify-content: space-between; }
.panel-header h3 { font-size: 1rem; font-weight: 700; margin: 0;
                   display: flex; align-items: center; gap: 8px; }
.panel-body { padding: 20px; }
.section-title { font-size: .9rem; font-weight: 700; color: var(--text-muted);
                 text-transform: uppercase; letter-spacing: .05em; margin-bottom: 12px; }
/* ─── BUTTONS ─────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px;
       border: none; border-radius: var(--radius); cursor: pointer;
       font-size: .875rem; font-weight: 500; transition: var(--transition);
       text-decoration: none; line-height: 1.4; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary   { background: var(--yw-blue); color: #fff; }
.btn-primary:hover { background: var(--yw-blue-dark); color: #fff; }
.btn-secondary { background: #6c757d; color: #fff; }
.btn-secondary:hover { background: #5a6268; color: #fff; }
.btn-success   { background: var(--success); color: #fff; }
.btn-success:hover { background: #157347; color: #fff; }
.btn-warning   { background: var(--warning); color: #000; }
.btn-warning:hover { background: #e0a800; }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #bb2d3b; color: #fff; }
.btn-teal      { background: var(--teal); color: #000; }
.btn-teal:hover { background: #1bab86; }
.btn-navy      { background: var(--yw-navy); color: #fff; }
.btn-navy:hover { background: var(--yw-navy-mid); color: #fff; }
.btn-outline   { background: transparent; border: 1px solid var(--border-dark); color: var(--text); }
.btn-outline:hover { background: var(--bg); }
.btn-outline-light { background: transparent; border: 1px solid rgba(255,255,255,.5); color: #fff; }
.btn-outline-light:hover { background: rgba(255,255,255,.1); }
.btn-sm { padding: 4px 10px; font-size: .8rem; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }
.btn-group { display: flex; gap: 4px; }
.btn-close    { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--text-muted); line-height: 1; }
.btn-close-xs { background: none; border: none; font-size: 1rem; cursor: pointer; color: var(--text-muted); }
/* ─── FORMS ─────────────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-weight: 600; font-size: .8rem;
                    margin-bottom: 4px; color: var(--text); }
.form-control { width: 100%; padding: 7px 10px; font-size: .875rem;
                border: 1px solid var(--border); border-radius: var(--radius);
                background: #fff; transition: var(--transition); }
.form-control:focus { outline: none; border-color: var(--yw-blue);
                       box-shadow: 0 0 0 3px rgba(40,176,248,.18); }
.form-control.field-error   { border-color: var(--danger) !important;
                               background: #fff5f5; box-shadow: 0 0 0 3px rgba(220,53,69,.15); }
.form-control.field-warning { border-color: var(--warning) !important; background: #fffdf0; }
.form-row { display: grid; gap: 12px; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row.cols-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
.money-input { text-align: right; font-family: 'Courier New', monospace; letter-spacing: .02em; }
.money-input::placeholder { text-align: right; }
.form-group label.required::after { content: ' *'; color: var(--danger); }
/* ─── TABLES ─────────────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.data-table th { background: #f8f9fa; font-weight: 700; padding: 10px 12px;
                 border-bottom: 2px solid var(--yw-blue); text-align: left;
                 white-space: nowrap; font-size: .8rem; text-transform: uppercase;
                 letter-spacing: .04em; color: var(--text-muted); }
.data-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tbody tr:hover { background: #f0f8ff; }
.data-table tbody tr:last-child td { border-bottom: none; }
.ein-display { font-family: monospace; font-size: .85em; }
/* ─── BADGES ─────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 4px;
         padding: 3px 8px; border-radius: 20px; font-size: .75em; font-weight: 700; }
.badge-in_progress { background: #daf0fd; color: #0a5f94; }
.badge-review      { background: #fff3cd; color: #664d03; }
.badge-complete    { background: #d1e7dd; color: #0a3622; }
.badge-filed       { background: #d1ecf1; color: #0c5460; }
.badge-rejected    { background: #f8d7da; color: #842029; }
.badge-success     { background: #d1e7dd; color: #0a3622; }
.badge-danger      { background: #f8d7da; color: #842029; }
.badge-warning     { background: #fff3cd; color: #664d03; }
.badge-secondary   { background: #e2e3e5; color: #41464b; }
.badge-primary     { background: rgba(40,176,248,.15); color: var(--yw-blue-dark); }
/* ─── ALERTS ─────────────────────────────────────────────────────── */
.alert { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px;
         display: flex; align-items: flex-start; gap: 10px; font-size: .875rem; }
.alert i { margin-top: 2px; flex-shrink: 0; }
.alert-danger  { background: #f8d7da; color: #842029; border: 1px solid #f5c2c7; }
.alert-warning { background: #fff3cd; color: #664d03; border: 1px solid #ffecb5; }
.alert-success { background: #d1e7dd; color: #0a3622; border: 1px solid #badbcc; }
.alert-info    { background: #daf0fd; color: #0a5f94; border: 1px solid #b8e4fb; }
/* ─── FORM SECTIONS (tax form layout) ───────────────────────────── */
.form-section { background: var(--bg-card); border-radius: var(--radius-lg);
                box-shadow: var(--shadow); margin-bottom: 20px; overflow: hidden; }
.form-section-header { background: var(--yw-navy); color: #fff; padding: 10px 20px;
                        display: flex; align-items: center; justify-content: space-between;
                        cursor: pointer; user-select: none; }
.form-section-header:hover { background: var(--yw-navy-mid); }
.form-section-header h4 { margin: 0; font-size: .9rem; font-weight: 700;
                           display: flex; align-items: center; gap: 8px; }
.form-section-header .section-num { background: var(--yw-blue); padding: 1px 8px;
                                     border-radius: 3px; font-size: .75em; }
.form-section-body { padding: 20px; }
.form-section-body.collapsed { display: none; }
/* Line items */
.form-line { display: flex; align-items: center; gap: 8px;
             padding: 5px 0; border-bottom: 1px solid #f0f0f0; }
.form-line:last-child { border-bottom: none; }
.form-line .line-num   { font-weight: 700; min-width: 28px; color: var(--text-muted); font-size: .8em; }
.form-line .line-label { flex: 1; font-size: .875rem; }
.form-line .line-input    { min-width: 140px; }
.form-line .line-input-sm { min-width: 90px; }
.form-line .line-input-lg { min-width: 200px; }
.form-line .line-note  { font-size: .75em; color: var(--text-muted); }
.form-line.total-line  { border-top: 2px solid var(--yw-navy); margin-top: 4px;
                          padding-top: 8px; font-weight: 700; }
.form-line.section-break { border-top: 2px solid var(--yw-blue); margin-top: 8px; padding-top: 8px; }
/* Questionnaire YES/NO */
.q-item { display: grid; grid-template-columns: 1fr auto;
          align-items: start; gap: 12px; padding: 8px 0; border-bottom: 1px solid #f0f0f0; }
.q-item:last-child { border-bottom: none; }
.q-text { font-size: .875rem; line-height: 1.4; }
.q-text .q-num { font-weight: 700; margin-right: 4px; color: var(--text-muted); }
.q-controls { display: flex; gap: 8px; white-space: nowrap; }
.q-controls label { display: flex; align-items: center; gap: 4px; cursor: pointer; font-size: .85em; }
.q-controls input[type="radio"] { cursor: pointer; }
/* ─── MODAL ─────────────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6);
                 z-index: 3000; display: flex; align-items: center; justify-content: center; }
.modal-box { background: var(--bg-card); border-radius: var(--radius-lg);
             width: 90vw; max-width: 560px; box-shadow: var(--shadow-lg);
             max-height: 90vh; overflow-y: auto; }
.modal-box.modal-lg { max-width: 760px; }
.modal-box.modal-xl { max-width: 960px; }
.modal-box.modal-sm { max-width: 420px; }
.modal-header { padding: 14px 20px; border-bottom: 1px solid var(--border);
                background: var(--yw-navy); color: #fff;
                border-radius: var(--radius-lg) var(--radius-lg) 0 0;
                display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { margin: 0; font-size: 1rem; font-weight: 700;
                   display: flex; align-items: center; gap: 8px; color: #fff; }
.modal-header .btn-close { color: rgba(255,255,255,.7); }
.modal-header .btn-close:hover { color: #fff; }
.modal-body   { padding: 20px; }
.modal-footer { padding: 12px 20px; border-top: 1px solid var(--border);
                display: flex; justify-content: flex-end; gap: 10px; }
/* ─── ERROR PANEL ─────────────────────────────────────────────── */
.error-panel { position: fixed; right: 20px; bottom: 20px; width: 380px;
               max-height: 60vh; background: var(--bg-card);
               border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
               border: 2px solid var(--danger); z-index: 2500;
               display: flex; flex-direction: column; }
.error-panel-header { background: var(--danger); color: #fff; padding: 10px 14px;
                       border-radius: var(--radius-lg) var(--radius-lg) 0 0;
                       display: flex; align-items: center; justify-content: space-between;
                       font-weight: 700; font-size: .9rem; }
.error-panel-body { overflow-y: auto; padding: 10px; flex: 1; }
.error-item { background: #fff5f5; border: 1px solid #f5c2c7; border-radius: var(--radius);
              padding: 8px 12px; margin-bottom: 8px; cursor: pointer; transition: var(--transition); }
.error-item:hover { background: #f8d7da; }
.error-item .err-code    { font-size: .7em; color: var(--text-muted); margin-bottom: 2px; }
.error-item .err-msg     { font-size: .85em; color: #842029; }
.error-item .err-actions { margin-top: 6px; display: flex; gap: 6px; }
.error-item.warning      { background: #fffacd; border-color: #ffd700; }
.error-item.warning .err-msg { color: #664d03; }
.error-item.info         { background: #daf0fd; border-color: #b8e4fb; }
.error-item.info .err-msg { color: #0a5f94; }
/* ─── FIELD HELP TOOLTIP ─────────────────────────────────────── */
.field-help-tooltip { position: fixed; width: 320px; background: var(--bg-card);
                       border-radius: var(--radius); box-shadow: var(--shadow-lg);
                       border: 1px solid var(--border); border-top: 3px solid var(--yw-blue);
                       z-index: 4000; }
.fh-header { background: var(--yw-navy); color: #fff; padding: 8px 12px;
              border-radius: var(--radius) var(--radius) 0 0;
              display: flex; align-items: center; justify-content: space-between; font-size: .85em; }
.fh-body { padding: 12px; font-size: .85em; line-height: 1.5; max-height: 300px; overflow-y: auto; }
/* ─── CONTEXT MENU ─────────────────────────────────────────────── */
.context-menu { position: fixed; background: var(--bg-card); border-radius: var(--radius);
                box-shadow: var(--shadow-lg); border: 1px solid var(--border);
                border-top: 3px solid var(--yw-blue);
                z-index: 5000; min-width: 200px; padding: 4px 0; }
.context-menu ul { list-style: none; padding: 0; margin: 0; }
.context-menu li { padding: 8px 16px; cursor: pointer; font-size: .875rem;
                    display: flex; align-items: center; gap: 10px; transition: var(--transition); }
.context-menu li:hover { background: rgba(40,176,248,.08); color: var(--yw-blue-dark); }
.context-menu li.separator { padding: 0; border-top: 1px solid var(--border); margin: 4px 0; }
/* ─── SIGNATURE ─────────────────────────────────────────────────── */
.sig-tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 16px; }
.sig-tab { background: none; border: none; padding: 8px 16px; cursor: pointer;
           font-size: .875rem; color: var(--text-muted); border-bottom: 2px solid transparent;
           margin-bottom: -2px; transition: var(--transition); }
.sig-tab.active { color: var(--yw-blue); border-bottom-color: var(--yw-blue); font-weight: 700; }
.sig-pad-wrap { position: relative; border: 2px dashed var(--border); border-radius: var(--radius); background: #fafafa; }
.sig-canvas   { display: block; width: 100%; cursor: crosshair; }
.sig-hint     { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
                color: var(--border); font-size: 1.5rem; pointer-events: none; font-style: italic; }
.sig-controls { display: flex; gap: 8px; margin-top: 10px; align-items: center; flex-wrap: wrap; }
.sig-info-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px;
                margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.sig-preview  { max-width: 100%; border: 1px solid var(--border); border-radius: var(--radius); margin-top: 10px; }
.topaz-instructions, .mobile-instructions { text-align: center; padding: 20px; }
.qr-container { display: inline-block; margin: 10px auto; }
/* ─── TOAST NOTIFICATIONS ────────────────────────────────────── */
.toast-container { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
                   z-index: 6000; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--yw-navy); color: #fff; padding: 10px 20px;
          border-radius: 20px; font-size: .875rem; box-shadow: var(--shadow-lg);
          display: flex; align-items: center; gap: 8px; animation: toastIn .3s ease; }
.toast.success { background: var(--success); }
.toast.danger  { background: var(--danger); }
.toast.warning { background: var(--warning); color: #000; }
.toast.info    { background: var(--yw-blue); color: #fff; }
@keyframes toastIn { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }
/* ─── EFILE PAGE ─────────────────────────────────────────────── */
.efile-panel { max-width: 800px; margin: 0 auto; }
.efile-env-selector { display: flex; gap: 16px; margin-bottom: 20px; }
.env-card { flex: 1; border: 2px solid var(--border); border-radius: var(--radius-lg);
            padding: 16px; cursor: pointer; transition: var(--transition); text-align: center; }
.env-card:hover    { border-color: var(--yw-blue); }
.env-card.selected { border-color: var(--yw-blue); background: rgba(40,176,248,.06); }
.env-card h4 { margin: 8px 0 4px; }
.efile-result { margin-top: 20px; }
.efile-result pre { background: var(--bg); padding: 14px; border-radius: var(--radius);
                    font-size: .8rem; white-space: pre-wrap; overflow-x: auto; }
.transmission-history { margin-top: 24px; }
/* ─── OCR ────────────────────────────────────────────────────── */
.ocr-upload-zone { border: 2px dashed var(--border); border-radius: var(--radius-lg);
                   padding: 40px 20px; text-align: center; cursor: pointer; transition: var(--transition); }
.ocr-upload-zone:hover,
.ocr-upload-zone.drag-over { border-color: var(--yw-blue); background: rgba(40,176,248,.05); }
.ocr-upload-zone i { color: var(--text-muted); margin-bottom: 12px; }
.progress-bar-wrap { background: var(--bg); border-radius: 10px; height: 8px; overflow: hidden; margin-bottom: 8px; }
.progress-bar-fill { height: 100%; background: var(--yw-blue); transition: width .3s ease; border-radius: 10px; }
/* ─── EMPTY STATE ────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.empty-state i { display: block; margin-bottom: 16px; opacity: .3; }
.empty-state p { margin-bottom: 20px; }
/* ─── INTERVIEW MODE ────────────────────────────────────────── */
.interview-mode .form-section-body { font-size: 1.05rem; line-height: 1.7; }
.interview-mode .form-line .line-label { font-size: 1rem; }
.interview-step-progress { background: var(--bg-card); border-radius: var(--radius-lg);
                            padding: 14px 20px; margin-bottom: 20px; box-shadow: var(--shadow); }
.step-bar      { background: var(--border); height: 6px; border-radius: 3px; overflow: hidden; }
.step-bar-fill { height: 100%; background: var(--yw-blue); transition: width .4s ease; }
/* ─── SCHEDULE HEADER ─────────────────────────────────────────── */
.schedule-header { background: linear-gradient(135deg, var(--yw-navy), var(--yw-navy-mid));
                    color: #fff; padding: 16px 20px;
                    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
                    border-bottom: 3px solid var(--yw-blue); }
.schedule-header h2 { margin: 0 0 4px; font-size: 1.1rem; }
.schedule-header .decree-info { font-size: .8em; opacity: .8; }
.schedule-tabs { display: flex; border-bottom: 2px solid var(--border);
                  background: #f8f9fa; padding: 0 20px; overflow-x: auto; }
.schedule-tab { padding: 10px 16px; border: none; background: none; cursor: pointer;
                 font-size: .875rem; color: var(--text-muted); border-bottom: 2px solid transparent;
                 margin-bottom: -2px; white-space: nowrap; transition: var(--transition); }
.schedule-tab.active { color: var(--yw-blue); border-bottom-color: var(--yw-blue); font-weight: 700; }
.schedule-tab-content { padding: 20px; }
.schedule-tab-pane.hidden { display: none; }
.dual-col-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.col-header { text-align: center; font-weight: 700; padding: 4px;
               background: var(--bg); border-radius: var(--radius); font-size: .8em; }
/* ─── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .stats-bar { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    :root { --sidebar-w: 0px; }
    .sidebar { transform: translateX(-240px); }
    .sidebar.open { transform: translateX(0); width: 240px; }
    .main-content { margin-left: 0; }
    .stats-bar { grid-template-columns: repeat(2, 1fr); }
    .form-row.cols-3, .form-row.cols-4 { grid-template-columns: 1fr 1fr; }
    .form-row.cols-2 { grid-template-columns: 1fr; }
    .sig-info-row { grid-template-columns: 1fr; }
    .efile-env-selector { flex-direction: column; }
    .content-wrapper { padding: 12px; }
    .breadcrumb-nav { display: none; }
    .user-name { display: none; }
    .mode-toggle { display: none; }
}
@media (max-width: 480px) {
    .stats-bar { grid-template-columns: 1fr 1fr; }
    .stat-num { font-size: 1.4rem; }
}
/* ─── PRINT ──────────────────────────────────────────────────── */
@media print {
    .sidebar, .top-nav, .error-panel, .toast-container,
    .btn, .nav-item, .context-menu { display: none !important; }
    .main-content { margin-left: 0 !important; margin-top: 0 !important; }
    .form-section { box-shadow: none; break-inside: avoid; }
    .form-control { border: 1px solid #999 !important; }
}