/* ═══════════════════════════════════════════════════════════════
   TENANTPULSE — DESIGN SYSTEM
   Theme: Ocean Depths × Desert Rose hybrid — professional, warm, trustworthy
   Fonts: Playfair Display (headings) + Inter (body)
═══════════════════════════════════════════════════════════════ */

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Core palette */
  --navy:        #0F2A45;
  --navy-mid:    #1A3A5C;
  --navy-light:  #234E78;
  --blue:        #2E7BB8;
  --blue-light:  #4A9FD4;
  --sky:         #E8F4FD;

  /* Accent */
  --teal:        #1A8C7A;
  --teal-light:  #E6F5F2;
  --amber:       #D97706;
  --amber-light: #FEF3C7;
  --red:         #DC2626;
  --red-light:   #FEE2E2;
  --green:       #16A34A;
  --green-light: #DCFCE7;
  --purple:      #7C3AED;
  --purple-light:#EDE9FE;

  /* Neutrals */
  --white:       #FFFFFF;
  --gray-50:     #F8FAFC;
  --gray-100:    #F1F5F9;
  --gray-200:    #E2E8F0;
  --gray-300:    #CBD5E1;
  --gray-400:    #94A3B8;
  --gray-500:    #64748B;
  --gray-600:    #475569;
  --gray-700:    #334155;
  --gray-800:    #1E293B;
  --gray-900:    #0F172A;

  /* Spacing */
  --sidebar-w:   260px;
  --topbar-h:    64px;
  --radius:      12px;
  --radius-sm:   8px;
  --radius-lg:   16px;

  /* Shadows */
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow:      0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.05);
  --shadow-lg:   0 10px 30px rgba(0,0,0,.12), 0 4px 8px rgba(0,0,0,.06);
  --shadow-xl:   0 20px 50px rgba(0,0,0,.18);

  /* Transitions */
  --ease:        cubic-bezier(.4,0,.2,1);
}

html { font-size: 16px; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ═══════════════════════════════════════════════════════════════
   LAYOUT
═══════════════════════════════════════════════════════════════ */
#app {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform .3s var(--ease);
  overflow: hidden;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.logo-icon {
  width: 40px; height: 40px;
  background: var(--blue);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: white;
  flex-shrink: 0;
}
.logo-icon svg { width: 20px; height: 20px; }

.logo-title {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: white;
  line-height: 1.2;
}
.logo-sub {
  display: block;
  font-size: .7rem;
  color: rgba(255,255,255,.45);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: rgba(255,255,255,.6);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s var(--ease);
  text-align: left;
  width: 100%;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: rgba(255,255,255,.08); color: white; }
.nav-item.active {
  background: var(--blue);
  color: white;
  box-shadow: 0 2px 8px rgba(46,123,184,.4);
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-date {
  font-size: .75rem;
  color: rgba(255,255,255,.35);
}

/* ── MAIN CONTENT ── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── TOPBAR ── */
.topbar {
  height: var(--topbar-h);
  background: white;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-600);
  padding: 6px;
  border-radius: 6px;
}
.menu-toggle:hover { background: var(--gray-100); }
.menu-toggle svg { width: 20px; height: 20px; }

.topbar-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--gray-800);
  flex: 1;
}

/* ── VIEWS ── */
.view {
  display: none;
  padding: 32px 28px;
  flex: 1;
  animation: fadeIn .25s var(--ease);
}
.view.active { display: block; }

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

.view-header {
  margin-bottom: 28px;
}
.view-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
}
.view-subtitle {
  font-size: .875rem;
  color: var(--gray-500);
  margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════════════════ */
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--blue);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s var(--ease);
  white-space: nowrap;
}
.btn-primary:hover { background: var(--navy-light); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-primary svg { width: 16px; height: 16px; }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent;
  color: var(--gray-600);
  border: 1px solid var(--gray-200);
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s var(--ease);
}
.btn-ghost:hover { background: var(--gray-100); color: var(--gray-800); border-color: var(--gray-300); }
.btn-ghost svg { width: 15px; height: 15px; }

.btn-success {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--green);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s var(--ease);
}
.btn-success:hover { background: #15803d; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-success svg { width: 16px; height: 16px; }

.btn-danger {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--red);
  color: white;
  border: none;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s var(--ease);
}
.btn-danger:hover { background: #b91c1c; }
.btn-danger svg { width: 15px; height: 15px; }

/* ═══════════════════════════════════════════════════════════════
   DASHBOARD
═══════════════════════════════════════════════════════════════ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.kpi-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.kpi-icon svg { width: 22px; height: 22px; }

.kpi-blue .kpi-icon  { background: var(--sky); color: var(--blue); }
.kpi-green .kpi-icon { background: var(--green-light); color: var(--green); }
.kpi-amber .kpi-icon { background: var(--amber-light); color: var(--amber); }
.kpi-purple .kpi-icon{ background: var(--purple-light); color: var(--purple); }

.kpi-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}
.kpi-label {
  font-size: .8rem;
  color: var(--gray-500);
  margin-top: 4px;
}

/* CHARTS ROW */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.chart-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
}
.chart-card-header h3 {
  font-size: .9rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 16px;
}
.chart-wrap {
  min-height: 160px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

/* Bar chart bars */
.chart-bar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
}
.chart-bar {
  width: 100%;
  border-radius: 6px 6px 0 0;
  transition: height .5s var(--ease);
  min-height: 4px;
  position: relative;
}
.chart-bar:hover::after {
  content: attr(data-val);
  position: absolute;
  top: -28px; left: 50%;
  transform: translateX(-50%);
  background: var(--gray-800);
  color: white;
  font-size: .7rem;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.chart-bar-label {
  font-size: .68rem;
  color: var(--gray-500);
  text-align: center;
  line-height: 1.2;
}
.chart-bar-val {
  font-size: .75rem;
  font-weight: 700;
  color: var(--gray-700);
}

/* TABLE CARD */
.table-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}
.table-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
}
.table-card-header h3 {
  font-size: .9rem;
  font-weight: 600;
  color: var(--gray-700);
}

/* SURVEY TABLE */
.survey-table {
  width: 100%;
  border-collapse: collapse;
}
.survey-table th {
  text-align: left;
  font-size: .75rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 10px 20px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}
.survey-table td {
  padding: 14px 20px;
  font-size: .875rem;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
.survey-table tr:last-child td { border-bottom: none; }
.survey-table tbody tr {
  cursor: pointer;
  transition: background .15s;
}
.survey-table tbody tr:hover { background: var(--gray-50); }

/* ═══════════════════════════════════════════════════════════════
   BADGES / PILLS (display)
═══════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: .75rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-green  { background: var(--green-light);  color: var(--green); }
.badge-blue   { background: var(--sky);           color: var(--blue); }
.badge-amber  { background: var(--amber-light);   color: var(--amber); }
.badge-red    { background: var(--red-light);     color: var(--red); }
.badge-purple { background: var(--purple-light);  color: var(--purple); }
.badge-gray   { background: var(--gray-100);      color: var(--gray-600); }
.badge-teal   { background: var(--teal-light);    color: var(--teal); }

/* ═══════════════════════════════════════════════════════════════
   FORM — PROGRESS
═══════════════════════════════════════════════════════════════ */
.progress-container {
  background: white;
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
}

.progress-steps {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.step-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--gray-200);
  color: var(--gray-500);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem;
  font-weight: 700;
  transition: all .3s var(--ease);
}

.progress-step.active .step-dot {
  background: var(--blue);
  color: white;
  box-shadow: 0 0 0 4px rgba(46,123,184,.2);
}
.progress-step.done .step-dot {
  background: var(--green);
  color: white;
}
.progress-step.done .step-dot span { display: none; }
.progress-step.done .step-dot::after {
  content: '✓';
  font-size: .85rem;
}

.step-label {
  font-size: .7rem;
  font-weight: 500;
  color: var(--gray-400);
  white-space: nowrap;
}
.progress-step.active .step-label { color: var(--blue); font-weight: 600; }
.progress-step.done .step-label   { color: var(--green); }

.progress-line {
  flex: 1;
  height: 2px;
  background: var(--gray-200);
  margin: 0 8px;
  margin-bottom: 22px;
  transition: background .3s;
}
.progress-line.done { background: var(--green); }

.progress-bar-track {
  height: 4px;
  background: var(--gray-200);
  border-radius: 99px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--teal));
  border-radius: 99px;
  transition: width .4s var(--ease);
  width: 20%;
}

/* ═══════════════════════════════════════════════════════════════
   FORM STEPS
═══════════════════════════════════════════════════════════════ */
.form-container {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}

.form-step {
  display: none;
  padding: 32px;
  animation: fadeIn .25s var(--ease);
}
.form-step.active { display: block; }

.step-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--gray-100);
}
.step-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--navy);
}
.step-header p {
  font-size: .875rem;
  color: var(--gray-500);
  margin-top: 2px;
}

.step-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.step-icon svg { width: 20px; height: 20px; }
.step-icon-blue   { background: var(--sky);           color: var(--blue); }
.step-icon-green  { background: var(--green-light);   color: var(--green); }
.step-icon-purple { background: var(--purple-light);  color: var(--purple); }
.step-icon-amber  { background: var(--amber-light);   color: var(--amber); }
.step-icon-teal   { background: var(--teal-light);    color: var(--teal); }

/* FORM GRID */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }

label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.req { color: var(--red); }

input[type="text"],
input[type="date"],
textarea,
select {
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-family: 'Inter', sans-serif;
  color: var(--gray-800);
  background: white;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
  width: 100%;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(46,123,184,.12);
}
input::placeholder, textarea::placeholder { color: var(--gray-400); }
textarea { resize: vertical; min-height: 80px; }

/* QUESTION BLOCKS */
.question-block {
  margin-bottom: 28px;
}
.question-label {
  font-size: .95rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 12px;
}

/* PILL SELECTOR */
.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: 99px;
  border: 2px solid var(--gray-200);
  background: white;
  color: var(--gray-600);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s var(--ease);
  white-space: nowrap;
}
.pill svg { width: 15px; height: 15px; }
.pill:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--sky);
  transform: translateY(-1px);
}
.pill.selected {
  border-color: var(--blue);
  background: var(--blue);
  color: white;
  box-shadow: 0 2px 8px rgba(46,123,184,.35);
}

/* Coloured pill variants */
.pill-green.selected  { border-color: var(--green);  background: var(--green);  box-shadow: 0 2px 8px rgba(22,163,74,.3); }
.pill-green:hover     { border-color: var(--green);  color: var(--green);  background: var(--green-light); }
.pill-blue.selected   { border-color: var(--blue);   background: var(--blue);   box-shadow: 0 2px 8px rgba(46,123,184,.3); }
.pill-amber.selected  { border-color: var(--amber);  background: var(--amber);  box-shadow: 0 2px 8px rgba(217,119,6,.3); }
.pill-amber:hover     { border-color: var(--amber);  color: var(--amber);  background: var(--amber-light); }
.pill-red.selected    { border-color: var(--red);    background: var(--red);    box-shadow: 0 2px 8px rgba(220,38,38,.3); }
.pill-red:hover       { border-color: var(--red);    color: var(--red);    background: var(--red-light); }
.pill-neutral.selected{ border-color: var(--gray-500); background: var(--gray-500); }
.pill-positive.selected { border-color: var(--teal); background: var(--teal); box-shadow: 0 2px 8px rgba(26,140,122,.3); }
.pill-positive:hover  { border-color: var(--teal);   color: var(--teal);   background: var(--teal-light); }
.pill-negative.selected { border-color: var(--red);  background: var(--red); }
.pill-negative:hover  { border-color: var(--red);    color: var(--red);    background: var(--red-light); }

/* CONDITION SCALE */
.condition-scale {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.condition-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  border-radius: var(--radius);
  border: 2px solid var(--gray-200);
  background: white;
  cursor: pointer;
  transition: all .2s var(--ease);
  min-width: 90px;
  font-size: .8rem;
  font-weight: 500;
  color: var(--gray-600);
}
.condition-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.condition-btn.selected { border-color: currentColor; }

.condition-dot {
  width: 20px; height: 20px;
  border-radius: 50%;
}
.dot-excellent { background: #16A34A; }
.dot-good      { background: #65A30D; }
.dot-fair      { background: #D97706; }
.dot-poor      { background: #EA580C; }
.dot-very-poor { background: #DC2626; }

.condition-btn.selected.dot-excellent-parent,
.condition-btn[data-value="excellent"].selected { border-color: #16A34A; background: #F0FDF4; color: #16A34A; }
.condition-btn[data-value="good"].selected      { border-color: #65A30D; background: #F7FEE7; color: #65A30D; }
.condition-btn[data-value="fair"].selected      { border-color: #D97706; background: #FFFBEB; color: #D97706; }
.condition-btn[data-value="poor"].selected      { border-color: #EA580C; background: #FFF7ED; color: #EA580C; }
.condition-btn[data-value="very_poor"].selected { border-color: #DC2626; background: #FEF2F2; color: #DC2626; }

/* TOGGLE QUESTIONS */
.toggle-questions {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
}
.toggle-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: white;
  gap: 16px;
}
.toggle-question:not(:last-child) { border-bottom: 1px solid var(--gray-100); }
.tq-label { font-size: .9rem; font-weight: 600; color: var(--gray-700); }
.tq-sub   { font-size: .8rem; color: var(--gray-400); margin-top: 2px; }

.toggle-group {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.toggle-btn {
  padding: 7px 16px;
  border-radius: 99px;
  border: 1.5px solid var(--gray-200);
  background: white;
  font-size: .8rem;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  transition: all .2s var(--ease);
}
.toggle-btn:hover { border-color: var(--blue); color: var(--blue); }
.toggle-btn.selected[data-value="yes"]     { background: var(--green);  border-color: var(--green);  color: white; }
.toggle-btn.selected[data-value="no"]      { background: var(--gray-600); border-color: var(--gray-600); color: white; }
.toggle-btn.selected[data-value="unknown"] { background: var(--amber);  border-color: var(--amber);  color: white; }

/* PERCENTAGE CHANGE INPUT */
.pct-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.pct-direction-group {
  display: flex;
  gap: 8px;
}

.pct-dir-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: 99px;
  border: 2px solid var(--gray-200);
  background: white;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s var(--ease);
  color: var(--gray-500);
}
.pct-dir-btn svg { width: 15px; height: 15px; }
.pct-dir-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }

.pct-up:hover,
.pct-up.selected   { border-color: var(--teal);  background: var(--teal);  color: white; box-shadow: 0 2px 8px rgba(26,140,122,.3); }
.pct-flat:hover,
.pct-flat.selected { border-color: var(--blue);  background: var(--blue);  color: white; box-shadow: 0 2px 8px rgba(46,123,184,.3); }
.pct-down:hover,
.pct-down.selected { border-color: var(--red);   background: var(--red);   color: white; box-shadow: 0 2px 8px rgba(220,38,38,.3); }

.pct-number-wrap {
  display: flex;
  align-items: center;
  gap: 0;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
  background: white;
}
.pct-number-wrap:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(46,123,184,.12);
}
.pct-number-wrap input[type="number"] {
  border: none;
  box-shadow: none;
  width: 80px;
  padding: 10px 12px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  text-align: center;
  -moz-appearance: textfield;
}
.pct-number-wrap input[type="number"]::-webkit-outer-spin-button,
.pct-number-wrap input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }
.pct-number-wrap input[type="number"]:focus { box-shadow: none; border-color: transparent; }

.pct-symbol {
  padding: 10px 14px 10px 4px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gray-400);
  background: white;
}

.pct-preview {
  margin-top: 10px;
  min-height: 28px;
  font-size: .9rem;
  font-weight: 600;
  transition: all .2s;
}
.pct-preview.up   { color: var(--teal); }
.pct-preview.down { color: var(--red); }
.pct-preview.flat { color: var(--blue); }

/* CONDITIONAL BLOCKS */
.conditional-block {
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: -12px;
  margin-bottom: 20px;
  animation: fadeIn .2s var(--ease);
}

/* ═══════════════════════════════════════════════════════════════
   REVIEW STEP
═══════════════════════════════════════════════════════════════ */
.review-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.review-section {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
}
.review-section-title {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gray-400);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.review-section-title svg { width: 13px; height: 13px; }
.review-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--gray-200);
  gap: 12px;
}
.review-row:last-child { border-bottom: none; }
.review-key   { font-size: .8rem; color: var(--gray-500); flex-shrink: 0; }
.review-value { font-size: .85rem; font-weight: 600; color: var(--gray-800); text-align: right; }

/* ═══════════════════════════════════════════════════════════════
   FORM NAVIGATION
═══════════════════════════════════════════════════════════════ */
.form-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 0;
}
.form-nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ═══════════════════════════════════════════════════════════════
   SURVEYS LIST
═══════════════════════════════════════════════════════════════ */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.search-wrap {
  flex: 1;
  min-width: 200px;
  position: relative;
  display: flex;
  align-items: center;
}
.search-wrap svg {
  position: absolute;
  left: 12px;
  width: 16px; height: 16px;
  color: var(--gray-400);
  pointer-events: none;
}
.search-wrap input {
  padding-left: 38px;
}
.filter-wrap {
  display: flex;
  gap: 10px;
}
.filter-wrap select {
  width: auto;
  padding: 9px 14px;
  font-size: .85rem;
}

.surveys-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.survey-card {
  background: white;
  border-radius: var(--radius);
  border: 1.5px solid var(--gray-200);
  padding: 20px;
  cursor: pointer;
  transition: all .2s var(--ease);
  box-shadow: var(--shadow-sm);
}
.survey-card:hover {
  border-color: var(--blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.survey-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}
.survey-card-title {
  font-weight: 700;
  font-size: .95rem;
  color: var(--navy);
}
.survey-card-sub {
  font-size: .8rem;
  color: var(--gray-500);
  margin-top: 2px;
}
.survey-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.survey-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--gray-100);
  font-size: .78rem;
  color: var(--gray-400);
}

/* ═══════════════════════════════════════════════════════════════
   PROPERTIES VIEW
═══════════════════════════════════════════════════════════════ */
.property-group {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.property-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--navy);
  color: white;
}
.property-group-name {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 700;
}
.property-group-count {
  font-size: .8rem;
  background: rgba(255,255,255,.15);
  padding: 3px 10px;
  border-radius: 99px;
}

/* ═══════════════════════════════════════════════════════════════
   DETAIL VIEW
═══════════════════════════════════════════════════════════════ */
.detail-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.back-btn { flex-shrink: 0; }
.detail-header > div { flex: 1; }
.detail-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.detail-card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.detail-card-title {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gray-400);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.detail-card-title svg { width: 13px; height: 13px; }
.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-100);
  gap: 12px;
}
.detail-row:last-child { border-bottom: none; }
.detail-key   { font-size: .82rem; color: var(--gray-500); }
.detail-val   { font-size: .88rem; font-weight: 600; color: var(--gray-800); text-align: right; }

.detail-notes {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}
.detail-notes-title {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gray-400);
  margin-bottom: 10px;
}
.detail-notes p {
  font-size: .9rem;
  color: var(--gray-600);
  line-height: 1.7;
}

/* ═══════════════════════════════════════════════════════════════
   EMPTY STATE
═══════════════════════════════════════════════════════════════ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  gap: 12px;
  color: var(--gray-400);
}
.empty-state svg { width: 48px; height: 48px; opacity: .4; }
.empty-state p { font-size: .9rem; max-width: 280px; line-height: 1.6; }

/* ═══════════════════════════════════════════════════════════════
   TOAST
═══════════════════════════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--gray-900);
  color: white;
  padding: 14px 20px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .875rem;
  font-weight: 500;
  box-shadow: var(--shadow-xl);
  transform: translateY(80px);
  opacity: 0;
  transition: all .35s var(--ease);
  z-index: 999;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast svg { width: 18px; height: 18px; color: var(--green); }

/* ═══════════════════════════════════════════════════════════════
   MODAL
═══════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
  backdrop-filter: blur(4px);
}
.modal-overlay.show { opacity: 1; pointer-events: all; }

.modal {
  background: white;
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow-xl);
  transform: scale(.95);
  transition: transform .25s var(--ease);
}
.modal-overlay.show .modal { transform: scale(1); }
.modal-icon {
  width: 56px; height: 56px;
  background: var(--red-light);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  color: var(--red);
}
.modal-icon svg { width: 24px; height: 24px; }
.modal h3 { font-size: 1.1rem; font-weight: 700; color: var(--gray-800); margin-bottom: 8px; }
.modal p  { font-size: .875rem; color: var(--gray-500); line-height: 1.6; margin-bottom: 24px; }
.modal-actions { display: flex; gap: 10px; justify-content: center; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-row { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  .sidebar {
    transform: translateX(-260px);
    width: 260px;
  }
  .sidebar.open { transform: translateX(0); }

  .main-content { margin-left: 0; }
  .menu-toggle { display: flex; }

  .view { padding: 20px 16px; }
  .topbar { padding: 0 16px; }

  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .form-grid { grid-template-columns: 1fr; }
  .review-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .condition-scale { gap: 8px; }
  .condition-btn { min-width: 70px; padding: 12px 10px; }
  .toggle-question { flex-direction: column; align-items: flex-start; }
  .surveys-grid { grid-template-columns: 1fr; }
  .progress-steps { overflow-x: auto; padding-bottom: 4px; }
  .step-label { display: none; }
  .form-step { padding: 20px; }
  .detail-header { flex-direction: column; }
  .detail-actions { width: 100%; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .topbar-actions .btn-primary span { display: none; }
  .charts-row { display: none; }
}

/* ── SIDEBAR OVERLAY (mobile) ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 99;
}
.sidebar-overlay.show { display: block; }

/* ── INTEL BUTTON ── */
.btn-intel {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  color: white;
  border: none;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s var(--ease);
  white-space: nowrap;
}
.btn-intel:hover { opacity: .9; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-intel svg { width: 15px; height: 15px; }

/* ═══════════════════════════════════════════════════════════════
   COMPANY INTELLIGENCE MODAL
═══════════════════════════════════════════════════════════════ */
.intel-modal {
  max-width: 780px !important;
  width: 95vw !important;
  padding: 0 !important;
  text-align: left !important;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.intel-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-200);
  flex-shrink: 0;
}
.intel-modal-title {
  display: flex;
  align-items: center;
  gap: 14px;
}
.intel-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--navy), var(--blue));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: white;
  flex-shrink: 0;
}
.intel-icon svg { width: 18px; height: 18px; }
.intel-modal-header h3 { font-size: 1.05rem; font-weight: 700; color: var(--navy); margin: 0; }
.intel-modal-header p  { font-size: .8rem; color: var(--gray-400); margin: 2px 0 0; }

.intel-close {
  background: none; border: none; cursor: pointer;
  color: var(--gray-400); padding: 6px; border-radius: 6px;
  transition: all .15s;
}
.intel-close:hover { background: var(--gray-100); color: var(--gray-700); }
.intel-close svg { width: 18px; height: 18px; }

/* TABS */
.intel-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--gray-200);
  padding: 0 24px;
  flex-shrink: 0;
  overflow-x: auto;
}
.intel-tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 12px 18px;
  border: none; background: none;
  font-size: .85rem; font-weight: 500;
  color: var(--gray-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all .2s;
  white-space: nowrap;
}
.intel-tab svg { width: 14px; height: 14px; }
.intel-tab:hover { color: var(--navy); }
.intel-tab.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }

/* BODY */
.intel-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.intel-tab-panel { display: none; }
.intel-tab-panel.active { display: block; }

/* LOADING */
.intel-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 20px;
  color: var(--gray-400);
  font-size: .9rem;
}
.intel-spinner {
  width: 22px; height: 22px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* OVERVIEW */
.intel-company-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--sky);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
}
.intel-company-logo {
  width: 52px; height: 52px;
  background: var(--navy);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 1.3rem;
  font-weight: 700;
  flex-shrink: 0;
}
.intel-company-name { font-size: 1.1rem; font-weight: 700; color: var(--navy); }
.intel-company-number { font-size: .8rem; color: var(--gray-500); margin-top: 2px; }
.intel-company-status { margin-top: 6px; }

.intel-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.intel-info-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 14px;
}
.intel-info-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gray-400);
  margin-bottom: 6px;
}
.intel-info-value {
  font-size: .9rem;
  font-weight: 600;
  color: var(--gray-800);
  line-height: 1.4;
}

.intel-officers {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 16px;
}
.intel-officers-title {
  padding: 10px 14px;
  background: var(--gray-50);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gray-500);
  border-bottom: 1px solid var(--gray-200);
}
.intel-officer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--gray-100);
  gap: 12px;
}
.intel-officer-row:last-child { border-bottom: none; }
.intel-officer-name { font-size: .875rem; font-weight: 600; color: var(--gray-800); }
.intel-officer-role { font-size: .78rem; color: var(--gray-500); margin-top: 1px; }

/* FINANCIALS */
.intel-fin-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.intel-fin-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}
.intel-fin-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gray-400);
  margin-bottom: 8px;
}
.intel-fin-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--navy);
}
.intel-fin-sub {
  font-size: .75rem;
  color: var(--gray-400);
  margin-top: 4px;
}

.intel-accounts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}
.intel-accounts-table th {
  text-align: left;
  padding: 8px 12px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gray-500);
}
.intel-accounts-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
}
.intel-accounts-table tr:last-child td { border-bottom: none; }
.intel-accounts-table td:not(:first-child) { font-weight: 600; color: var(--gray-800); }

/* NEWS */
.intel-news-list { display: flex; flex-direction: column; gap: 12px; }
.intel-news-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  transition: all .2s;
  text-decoration: none;
  display: block;
  cursor: pointer;
}
.intel-news-card:hover { border-color: var(--blue); box-shadow: var(--shadow-sm); transform: translateX(3px); }
.intel-news-source {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--blue);
  margin-bottom: 5px;
}
.intel-news-title {
  font-size: .9rem;
  font-weight: 600;
  color: var(--gray-800);
  line-height: 1.4;
  margin-bottom: 6px;
}
.intel-news-snippet {
  font-size: .8rem;
  color: var(--gray-500);
  line-height: 1.5;
  margin-bottom: 8px;
}
.intel-news-date {
  font-size: .75rem;
  color: var(--gray-400);
}

/* FILINGS */
.intel-filings-list { display: flex; flex-direction: column; gap: 8px; }
.intel-filing-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  transition: all .15s;
}
.intel-filing-row:hover { border-color: var(--blue); }
.intel-filing-icon {
  width: 34px; height: 34px;
  background: var(--sky);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--blue);
  flex-shrink: 0;
}
.intel-filing-icon svg { width: 15px; height: 15px; }
.intel-filing-type { font-size: .85rem; font-weight: 600; color: var(--gray-800); }
.intel-filing-desc { font-size: .78rem; color: var(--gray-500); margin-top: 1px; }
.intel-filing-date { font-size: .78rem; color: var(--gray-400); margin-left: auto; white-space: nowrap; }

/* SEARCH OVERRIDE */
.intel-search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.intel-search-bar input {
  flex: 1;
  padding: 9px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: .875rem;
}
.intel-search-bar input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(46,123,184,.12);
  outline: none;
}

.intel-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--gray-400);
}
.intel-empty svg { width: 36px; height: 36px; opacity: .4; margin-bottom: 10px; }
.intel-empty p { font-size: .875rem; }

.intel-ch-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .8rem;
  color: var(--blue);
  text-decoration: none;
  margin-top: 12px;
  font-weight: 500;
}
.intel-ch-link:hover { text-decoration: underline; }

.intel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-top: 1px solid var(--gray-200);
  flex-shrink: 0;
}
.intel-source {
  font-size: .75rem;
  color: var(--gray-400);
}

@media (max-width: 600px) {
  .intel-info-grid { grid-template-columns: 1fr; }
  .intel-fin-summary { grid-template-columns: 1fr 1fr; }
  .intel-modal-header { padding: 16px; }
  .intel-body { padding: 16px; }
}

/* ═══════════════════════════════════════════════════════════════
   ACCOUNTS UPLOAD & ANALYSIS
═══════════════════════════════════════════════════════════════ */

/* UPLOAD ZONE */
.upload-zone {
  border: 2.5px dashed var(--gray-300);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  background: var(--gray-50);
  transition: all .25s var(--ease);
  cursor: pointer;
  position: relative;
}
.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--blue);
  background: var(--sky);
  transform: scale(1.01);
}
.upload-zone.drag-over { box-shadow: 0 0 0 4px rgba(46,123,184,.15); }

.upload-zone-icon {
  width: 64px; height: 64px;
  background: white;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  box-shadow: var(--shadow);
  color: var(--blue);
}
.upload-zone-icon svg { width: 28px; height: 28px; }

.upload-zone-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-700);
  margin-bottom: 6px;
}
.upload-zone-sub {
  font-size: .82rem;
  color: var(--gray-400);
  margin-bottom: 20px;
}
.upload-browse-btn { margin: 0 auto; }

/* PREVIOUS ACCOUNTS */
.accounts-prev-title {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gray-400);
  margin: 20px 0 10px;
}
.accounts-prev-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all .15s;
}
.accounts-prev-item:hover { border-color: var(--blue); background: var(--sky); }
.accounts-prev-icon {
  width: 36px; height: 36px;
  background: var(--red-light);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--red);
  flex-shrink: 0;
}
.accounts-prev-icon.txt-icon { background: var(--sky); color: var(--blue); }
.accounts-prev-icon svg { width: 16px; height: 16px; }
.accounts-prev-name { font-size: .875rem; font-weight: 600; color: var(--gray-800); }
.accounts-prev-meta { font-size: .75rem; color: var(--gray-400); margin-top: 1px; }
.accounts-prev-delete {
  margin-left: auto;
  background: none; border: none; cursor: pointer;
  color: var(--gray-300); padding: 4px; border-radius: 4px;
  transition: all .15s; flex-shrink: 0;
}
.accounts-prev-delete:hover { color: var(--red); background: var(--red-light); }
.accounts-prev-delete svg { width: 14px; height: 14px; }

/* PROCESSING STEPS */
.processing-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 280px;
}
.proc-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--gray-100);
  font-size: .85rem;
  color: var(--gray-400);
  transition: all .3s;
}
.proc-step svg { width: 15px; height: 15px; flex-shrink: 0; }
.proc-step.active {
  background: var(--sky);
  color: var(--blue);
  font-weight: 600;
}
.proc-step.done {
  background: var(--green-light);
  color: var(--green);
  font-weight: 600;
}

/* ANALYSIS HEADER */
.analysis-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--gray-200);
  gap: 12px;
  flex-wrap: wrap;
}
.analysis-file-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.analysis-file-icon {
  width: 38px; height: 38px;
  background: var(--red-light);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--red);
  flex-shrink: 0;
}
.analysis-file-icon svg { width: 16px; height: 16px; }
.analysis-file-name { font-size: .9rem; font-weight: 700; color: var(--gray-800); }
.analysis-file-meta { font-size: .75rem; color: var(--gray-400); margin-top: 1px; }

/* KEY METRICS STRIP */
.analysis-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.metric-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 14px 12px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.metric-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.metric-card.positive::before { background: var(--green); }
.metric-card.negative::before { background: var(--red); }
.metric-card.neutral::before  { background: var(--blue); }
.metric-card.warning::before  { background: var(--amber); }

.metric-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gray-400);
  margin-bottom: 6px;
}
.metric-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.1;
}
.metric-value.positive { color: var(--green); }
.metric-value.negative { color: var(--red); }
.metric-value.warning  { color: var(--amber); }
.metric-change {
  font-size: .72rem;
  color: var(--gray-400);
  margin-top: 4px;
}

/* HEALTH SCORE */
.analysis-health {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.health-score-ring {
  position: relative;
  width: 80px; height: 80px;
  flex-shrink: 0;
}
.health-score-ring svg { transform: rotate(-90deg); }
.health-score-ring .ring-bg   { fill: none; stroke: var(--gray-200); stroke-width: 8; }
.health-score-ring .ring-fill { fill: none; stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset .8s var(--ease); }
.health-score-number {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--navy);
}
.health-score-body { flex: 1; }
.health-score-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
}
.health-score-desc {
  font-size: .85rem;
  color: var(--gray-500);
  line-height: 1.5;
}
.health-score-rating {
  font-size: .8rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 99px;
  margin-top: 8px;
  display: inline-block;
}
.rating-strong   { background: var(--green-light);  color: var(--green); }
.rating-good     { background: var(--teal-light);   color: var(--teal); }
.rating-moderate { background: var(--amber-light);  color: var(--amber); }
.rating-weak     { background: var(--red-light);    color: var(--red); }
.rating-unknown  { background: var(--gray-100);     color: var(--gray-500); }

/* ANALYSIS SECTIONS */
.analysis-section {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
}
.analysis-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gray-500);
}
.analysis-section-header svg { width: 14px; height: 14px; }
.analysis-section-body { padding: 16px; }

/* FINANCIAL TABLE */
.fin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}
.fin-table th {
  text-align: left;
  padding: 7px 10px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--gray-400);
  border-bottom: 1px solid var(--gray-200);
}
.fin-table th:not(:first-child) { text-align: right; }
.fin-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
}
.fin-table td:not(:first-child) { text-align: right; font-weight: 600; color: var(--gray-800); }
.fin-table tr:last-child td { border-bottom: none; }
.fin-table tr.total-row td { font-weight: 700; color: var(--navy); background: var(--gray-50); }
.fin-table tr.highlight-row td { background: var(--sky); }
.fin-positive { color: var(--green) !important; }
.fin-negative { color: var(--red) !important; }
.fin-warning  { color: var(--amber) !important; }

/* RATIO GRID */
.ratio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.ratio-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}
.ratio-name  { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--gray-400); margin-bottom: 6px; }
.ratio-value { font-size: 1.1rem; font-weight: 800; color: var(--navy); }
.ratio-bench { font-size: .72rem; color: var(--gray-400); margin-top: 3px; }
.ratio-status { font-size: .7rem; font-weight: 700; margin-top: 5px; }
.ratio-status.good    { color: var(--green); }
.ratio-status.warning { color: var(--amber); }
.ratio-status.bad     { color: var(--red); }

/* INSIGHTS */
.insight-list { display: flex; flex-direction: column; gap: 10px; }
.insight-item {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}
.insight-item.positive { background: var(--green-light); border-color: #BBF7D0; }
.insight-item.warning  { background: var(--amber-light); border-color: #FDE68A; }
.insight-item.negative { background: var(--red-light);   border-color: #FECACA; }
.insight-item.neutral  { background: var(--sky);         border-color: var(--gray-200); }
.insight-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.insight-text { font-size: .875rem; color: var(--gray-700); line-height: 1.5; }
.insight-text strong { color: var(--gray-900); }

/* RISK ASSESSMENT */
.risk-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.risk-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
}
.risk-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}
.risk-dot.green  { background: var(--green); }
.risk-dot.amber  { background: var(--amber); }
.risk-dot.red    { background: var(--red); }
.risk-dot.gray   { background: var(--gray-400); }
.risk-label { font-size: .8rem; font-weight: 700; color: var(--gray-700); margin-bottom: 2px; }
.risk-value { font-size: .78rem; color: var(--gray-500); }

/* RAW TEXT */
.analysis-raw {
  margin-top: 14px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.analysis-raw summary {
  padding: 10px 14px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  background: var(--gray-50);
  user-select: none;
}
.analysis-raw summary:hover { background: var(--gray-100); }
.analysis-raw pre {
  padding: 14px;
  font-size: .75rem;
  color: var(--gray-600);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 300px;
  overflow-y: auto;
  background: white;
  line-height: 1.6;
}

/* NOT FOUND / PARTIAL */
.analysis-partial-banner {
  background: var(--amber-light);
  border: 1px solid #FDE68A;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: .82rem;
  color: #92400E;
  margin-bottom: 16px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.analysis-partial-banner svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }

@media (max-width: 600px) {
  .analysis-metrics { grid-template-columns: repeat(2, 1fr); }
  .ratio-grid { grid-template-columns: repeat(2, 1fr); }
  .risk-grid  { grid-template-columns: 1fr; }
  .analysis-health { flex-direction: column; text-align: center; }
}

/* ── VALIDATION ERROR ── */
.field-error {
  border-color: var(--red) !important;
  box-shadow: 0 0 0 3px rgba(220,38,38,.12) !important;
}
.error-msg {
  font-size: .75rem;
  color: var(--red);
  margin-top: 4px;
}