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

:root {
  --navy: #071A38;
  --navy-deep: #06142C;
  --navy-mid: #081A38;
  --navy-card: #102C59;
  --navy-panel: #0D244A;
  --blue: #2E5BFF;
  --blue-hover: #2450F0;
  --blue-active: #142B63;
  --blue-electric: #4B7BFF;
  --blue-pale: rgba(46,91,255,.12);
  --blue-ghost: rgba(46,91,255,.06);
  --text-headline: #EAF0F8;
  --text-body: #A7B4C7;
  --text-muted: #8FA2BD;
  --text-dim: #64748B;
  --border: rgba(255,255,255,.08);
  --border-light: rgba(255,255,255,.04);
  --bg: #081A38;
  --surface: #0D244A;
  --success: #00C48C;
  --success-bg: rgba(0,196,140,.16);
  --warning: #FFB547;
  --warning-bg: rgba(255,181,71,.16);
  --danger: #FF5A5F;
  --danger-bg: rgba(255,90,95,.16);
  --radius: 12px;
  --radius-card: 14px;
  --radius-panel: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.1), 0 4px 12px rgba(0,0,0,.1);
  --shadow-hover: 0 4px 16px rgba(46,91,255,.15);
  --sidebar-w: 230px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--navy);
  color: var(--text-headline);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ── SIDEBAR ───────────────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--navy-deep);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 50;
}
.nav-inner { display: flex; flex-direction: column; height: 100%; }
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  cursor: pointer;
}
.nav-brand img { height: 26px; }
.nav-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 14px;
  flex: 1;
}
.nav-link {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.nav-link:hover { background: rgba(255,255,255,.04); color: var(--text-headline); }
.nav-link.active { background: var(--blue-active); color: #fff; }
.nav-link svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .55; }
.nav-link.active svg { opacity: 1; stroke: #fff; }
.nav-right {
  padding: 16px;
  border-top: 1px solid var(--border);
}
.nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s;
}
.nav-user:hover { background: rgba(255,255,255,.04); }
.nav-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.nav-user-info { flex: 1; min-width: 0; }
.nav-user-name { color: var(--text-headline); font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-user-role { font-size: 11px; color: var(--text-dim); }
.nav-user-chevron { opacity: .3; flex-shrink: 0; }

/* ── TOP BAR ───────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  margin-left: var(--sidebar-w);
  height: 56px;
  background: rgba(8,26,56,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 26px;
}
.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  min-width: 240px;
}
.topbar-search kbd {
  margin-left: auto;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.04);
  color: var(--text-dim);
  font-family: inherit;
}
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .15s;
}
.topbar-icon-btn:hover { border-color: var(--blue); }
.topbar-icon-btn svg { stroke: var(--text-dim); }
.topbar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── MAIN CONTENT ──────────────────────────────────────────────── */
.app-body { margin-left: var(--sidebar-w); min-height: 100vh; position: relative; }

/* ── BUTTONS ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: all .15s;
  text-decoration: none;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hover); box-shadow: 0 8px 24px rgba(46,91,255,.25); }
.btn-ghost { background: transparent; color: var(--text-body); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }
.btn-success { background: var(--success-bg); color: var(--success); }
.btn-warning { background: var(--warning-bg); color: var(--warning); }
.text-muted { color: var(--text-dim); }

/* ── CONTAINER ────────────────────────────────────────────────── */
.container { max-width: 1400px; margin: 0 auto; padding: 26px; }
.page { animation: fadeIn .15s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── DASHBOARD ────────────────────────────────────────────────── */
.dash-greeting { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 22px; }
.dash-greeting h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.04em; margin-bottom: 4px; }

.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.stat-card {
  background: var(--navy-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat-card-icon { display: none; }
.stat-card-body { display: flex; flex-direction: column; }
.stat-card-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: .06em;
}
.stat-card-val {
  font-size: 30px;
  font-weight: 800;
  color: #fff;
  margin-top: 6px;
}
.stat-card-sub { font-size: 12px; font-weight: 700; }
.stat-card-sub.up { color: var(--success); }
.stat-card-sub.down { color: var(--danger); }
.stat-card-arrow { display: none; }

/* ── DASHBOARD GRID ───────────────────────────────────────────── */
.dash-main-grid {
  display: grid;
  grid-template-columns: 1.3fr .8fr;
  gap: 18px;
}
.dash-left { display: flex; flex-direction: column; gap: 18px; }
.dash-section {}
.dash-section-title { font-size: 16px; font-weight: 700; color: #DCE7F7; margin-bottom: 18px; }

/* Project rows */
.dash-project-list { display: flex; flex-direction: column; gap: 0; }
.dash-project-row {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .1s;
}
.dash-project-row:last-child { border: none; }
.dash-project-row:hover { background: rgba(255,255,255,.02); }
.dash-project-thumb {
  width: 40px; height: 40px; border-radius: 8px;
  display: none;
}
.dash-project-info { min-width: 0; }
.dash-project-name { font-size: 14px; font-weight: 700; color: #fff; }
.dash-project-org { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.dash-project-stats { display: none; }
.dash-project-confidence { display: none; }
.dash-project-arrow { display: none; }

/* Change rows - dashboard style */
.dash-changes-list { display: flex; flex-direction: column; gap: 0; }
.dash-change-row {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .1s;
}
.dash-change-row:last-child { border: none; }
.dash-change-row:hover { background: rgba(255,255,255,.02); }
.dash-change-id { color: var(--text-dim); font-weight: 800; font-size: 13px; }
.dash-change-info { min-width: 0; }
.dash-change-title { font-size: 14px; font-weight: 700; color: #fff; }
.dash-change-sub { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.dash-change-chips { display: none; }
.dash-change-time { display: none; }
.dash-change-arrow { display: none; }
.dash-view-all {
  font-size: 13px; font-weight: 600; color: var(--blue);
  text-decoration: none; cursor: pointer; display: inline-block; margin-top: 12px;
}
.dash-view-all:hover { text-decoration: underline; }

/* Dashboard panels */
.dash-section > .dash-project-list,
.dash-section > .dash-changes-list {
  background: var(--navy-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  padding: 18px;
}

/* Right panel */
.dash-right {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.dash-right-empty {
  background: var(--navy-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  padding: 40px; text-align: center; color: var(--text-dim);
}
.dash-right-header { margin-bottom: 8px; }
.dash-right-label { font-size: 11px; color: var(--text-dim); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.dash-right-title { font-size: 18px; font-weight: 800; color: #fff; margin-top: 4px; }
.dash-right-meta { font-size: 12px; color: var(--text-dim); margin-bottom: 16px; }
.dash-right-diff {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden; margin-bottom: 12px;
}
.dash-right-diff-header {
  padding: 10px 14px;
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--text-dim); font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.dash-right-diff-legend {
  display: flex; gap: 16px; font-size: 10px; color: var(--text-dim);
}
.dash-right-diff-legend span { display: flex; align-items: center; gap: 4px; }
.dash-right-diff-legend i { width: 6px; height: 6px; border-radius: 2px; display: inline-block; }
.dash-right-diff img { width: 100%; display: block; }
.dash-right-link {
  font-size: 13px; font-weight: 600; color: var(--blue);
  text-decoration: none; cursor: pointer; display: inline-block; margin-bottom: 20px;
}
.dash-right-link:hover { text-decoration: underline; }
.dash-right-reviews { margin-bottom: 20px; }
.dash-right-reviews h4 { font-size: 14px; font-weight: 700; margin-bottom: 12px; color: #DCE7F7; }
.dash-review-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  gap: 8px;
}
.dash-review-row:last-child { border: none; }
.dash-review-left { flex: 1; min-width: 0; }
.dash-review-disc { font-size: 13px; font-weight: 600; color: var(--text-headline); }
.dash-review-note { font-size: 12px; color: var(--text-dim); }
.dash-review-actions { display: flex; gap: 6px; flex-shrink: 0; }
.review-badge {
  padding: 5px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: all .15s;
}
.review-badge-reviewed { background: var(--success-bg); color: var(--success); }
.review-badge-pending { background: var(--warning-bg); color: var(--warning); }
.review-badge-approve { background: rgba(255,255,255,.04); color: var(--blue); border: 1px solid var(--border); }
.review-badge-approve:hover { background: var(--blue); color: #fff; }
.review-badge-flag { background: rgba(255,255,255,.04); color: var(--text-dim); border: 1px solid var(--border); }
.review-badge-flag:hover { background: var(--danger); color: #fff; }

/* Activity */
.dash-activity h4 { font-size: 14px; font-weight: 700; margin-bottom: 12px; color: #DCE7F7; }
.dash-act-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  font-size: 13px;
  color: var(--text-body);
}
.dash-act-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.dash-act-dot.blue { background: var(--blue); }
.dash-act-dot.green { background: var(--success); }
.dash-act-text { flex: 1; line-height: 1.5; }
.dash-act-time { font-size: 12px; color: var(--text-dim); white-space: nowrap; }
.dash-right-viewall {
  font-size: 13px; font-weight: 600; color: var(--blue);
  text-decoration: none; cursor: pointer; display: inline-block; margin-top: 8px;
}
.dash-right-viewall:hover { text-decoration: underline; }

/* Donut chart for dashboard */
.dash-donut-wrap {
  background: var(--navy-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  padding: 18px;
}
.dash-donut-wrap h2 { font-size: 16px; font-weight: 700; color: #DCE7F7; margin-bottom: 16px; }
.dash-donut-container { display: flex; justify-content: center; margin: 20px 0 16px; }
.dash-donut-svg { position: relative; }
.dash-donut-label-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.dash-donut-label-center strong { font-size: 32px; font-weight: 800; color: #fff; }
.dash-donut-label-center small { font-size: 12px; color: var(--text-muted); }
.dash-legend-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  font-size: 12px; color: var(--text-body);
}
.dash-legend-grid span { display: flex; align-items: center; gap: 8px; }
.dash-legend-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* Activity panel */
.dash-activity-panel {
  background: var(--navy-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  padding: 18px;
}
.dash-activity-panel h2 { font-size: 16px; font-weight: 700; color: #DCE7F7; margin-bottom: 14px; }
.dash-activity-panel li {
  list-style: none;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-body);
  font-size: 13px;
}
.dash-activity-panel li:last-child { border: none; }

/* ── PROJECT CARDS ─────────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.card {
  background: var(--navy-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 22px;
  cursor: pointer;
  transition: all .15s;
}
.card:hover { border-color: var(--blue); box-shadow: var(--shadow-hover); }
.card-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; color: #fff; }
.card-desc { font-size: 13px; color: var(--text-body); margin-bottom: 16px; line-height: 1.6; }
.card-footer {
  display: flex; gap: 16px; font-size: 12px; color: var(--text-dim);
  padding-top: 14px; border-top: 1px solid var(--border-light);
}

/* ── CHIPS ─────────────────────────────────────────────────────── */
.chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 5px 14px;
  background: var(--blue-pale);
  color: var(--blue-electric);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

/* ── BADGES ────────────────────────────────────────────────────── */
.dash-chip {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}
.dash-chip.blue { background: var(--blue-pale); color: var(--blue); }
.dash-chip.green { background: var(--success-bg); color: var(--success); }
.dash-chip.orange { background: var(--warning-bg); color: var(--warning); }
.dash-chip.red { background: var(--danger-bg); color: var(--danger); }

/* ── CHANGES LIST ──────────────────────────────────────────────── */
.changes-list { display: flex; flex-direction: column; gap: 8px; }
.change-row {
  background: var(--navy-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all .15s;
}
.change-row:hover { border-color: var(--blue); box-shadow: var(--shadow-hover); }
.change-row-left h4 { font-size: 14px; font-weight: 700; color: #fff; }
.change-row-left span { font-size: 12px; color: var(--text-dim); }
.change-badge {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  background: var(--blue-pale);
  color: var(--blue);
}

/* ── CHANGE DETAIL ─────────────────────────────────────────────── */
.change-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
  align-items: start;
}
.diff-panel {
  background: var(--navy-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  padding: 24px;
}
.diff-panel h3 { margin-bottom: 16px; font-size: 16px; font-weight: 700; color: #DCE7F7; }
.diff-image-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--navy-card);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}
.diff-image-wrap img { width: 100%; display: block; }
.legend { display: flex; gap: 20px; font-size: 13px; color: var(--text-dim); }
.legend-item { display: flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot-minor { background: var(--success); }
.dot-moderate { background: var(--warning); }
.dot-major { background: var(--danger); }

.reviews-panel {
  background: var(--navy-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  padding: 24px;
}
.reviews-panel h3 { margin-bottom: 16px; font-size: 16px; font-weight: 700; color: #DCE7F7; }
.reviews-list { display: flex; flex-direction: column; gap: 12px; }
.review-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: rgba(255,255,255,.02);
}
.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.review-discipline { font-weight: 700; font-size: 13px; color: var(--text-headline); }
.status-badge {
  padding: 4px 10px; border-radius: 6px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px;
}
.status-pending { background: var(--warning-bg); color: var(--warning); }
.status-reviewed { background: var(--success-bg); color: var(--success); }
.status-flagged { background: var(--danger-bg); color: var(--danger); }
.review-notes { font-size: 13px; color: var(--text-dim); margin-bottom: 8px; }
.review-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.review-actions .btn { padding: 5px 12px; font-size: 12px; }
.review-notes-input {
  width: 100%; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; font-family: inherit;
  margin-bottom: 10px; resize: vertical;
  background: rgba(255,255,255,.03); color: var(--text-headline);
}
.review-notes-input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(46,91,255,.2); }

/* ── MY REVIEWS QUEUE ──────────────────────────────────────────── */
.reviews-queue { display: flex; flex-direction: column; gap: 8px; }
.review-queue-card {
  background: var(--navy-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all .15s;
}
.review-queue-card:hover { border-color: var(--blue); box-shadow: var(--shadow-hover); }
.review-queue-left h4 { font-size: 14px; font-weight: 700; color: #fff; }
.review-queue-left span { font-size: 12px; color: var(--text-dim); }

/* ── PAGE HEADERS ─────────────────────────────────────────────── */
.page-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 24px;
}
.page-header h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; color: #fff; }
.page-header p { font-size: 14px; color: var(--text-dim); }
.btn-back {
  font-size: 13px; font-weight: 600; color: var(--blue);
  background: none; border: none; cursor: pointer; font-family: inherit;
  margin-bottom: 16px;
}

/* ── EMPTY STATES ──────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 80px 20px; }
.empty-icon {
  width: 64px; height: 64px; border-radius: 50%; background: var(--blue-pale);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 20px;
}
.empty-icon svg { stroke: var(--blue); }
.empty-state h3 { margin-bottom: 6px; font-size: 18px; font-weight: 700; color: #fff; }
.empty-state p { color: var(--text-body); margin-bottom: 20px; font-size: 14px; max-width: 360px; margin-left: auto; margin-right: auto; }
.empty-state-sm {
  text-align: center; padding: 40px; color: var(--text-dim); font-size: 14px;
  background: var(--navy-panel); border: 2px dashed var(--border); border-radius: var(--radius-card);
}

/* ── AUTH ───────────────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 900px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
}
.auth-hero {
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 64px; position: relative; overflow: hidden;
}
.auth-hero::before {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(46,91,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(46,91,255,.04) 1px, transparent 1px);
  background-size: 48px 48px;
}
.auth-hero-content { position: relative; text-align: center; }
.auth-hero-content img { max-width: 280px; }
.auth-features { margin-top: 48px; text-align: left; display: flex; flex-direction: column; gap: 16px; }
.auth-feature { display: flex; align-items: flex-start; gap: 14px; color: rgba(255,255,255,.5); font-size: 13px; line-height: 1.6; }
.auth-feature-icon {
  width: 36px; height: 36px; border-radius: 8px;
  background: rgba(46,91,255,.12); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.auth-feature-icon svg { stroke: var(--blue-electric); width: 16px; height: 16px; }
.auth-form-side { display: flex; align-items: center; justify-content: center; padding: 48px; background: var(--navy); }
.auth-card { width: 100%; max-width: 380px; }
.auth-card-header { margin-bottom: 32px; }
.auth-card-header h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 4px; color: #fff; }
.auth-card-header p { color: var(--text-dim); font-size: 14px; }
.auth-tabs { display: flex; margin-bottom: 28px; border-bottom: 2px solid var(--border); }
.auth-tab {
  flex: 1; padding: 10px; border: none; background: none;
  font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
  color: var(--text-dim); border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.auth-tab.active { color: var(--blue); border-bottom-color: var(--blue); }
.auth-error {
  color: var(--danger); font-size: 13px; text-align: center; margin-top: 14px;
  padding: 10px; background: var(--danger-bg); border-radius: 8px;
}

/* ── FORMS ─────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 6px; color: var(--text-body); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: 10px;
  font-size: 14px; font-family: inherit;
  background: rgba(255,255,255,.04); color: var(--text-headline);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(46,91,255,.2);
}
.form-group input::placeholder { color: var(--text-dim); }
.form-group select option { background: var(--navy-panel); color: var(--text-headline); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* File drop */
.file-drop {
  position: relative; border: 2px dashed var(--border); border-radius: 10px;
  padding: 28px 14px; text-align: center; cursor: pointer;
}
.file-drop:hover { border-color: var(--blue); background: var(--blue-ghost); }
.file-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-drop p { font-size: 13px; color: var(--text-dim); pointer-events: none; }
.file-drop.has-file { border-color: var(--success); background: var(--success-bg); }
.file-drop.has-file p { color: var(--success); font-weight: 600; }

/* ── MODAL ─────────────────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: fadeIn .1s;
}
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.5); backdrop-filter: blur(6px); }
.modal-content {
  position: relative; background: var(--navy-panel);
  border: 1px solid var(--border); border-radius: var(--radius-panel);
  padding: 32px; width: 100%; max-width: 500px;
  box-shadow: 0 24px 64px rgba(0,0,0,.3);
  max-height: 90vh; overflow-y: auto;
}
.modal-content h3 { font-size: 20px; font-weight: 800; margin-bottom: 24px; letter-spacing: -0.02em; color: #fff; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }

/* ── TOAST ─────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--blue); color: #fff;
  padding: 14px 22px; border-radius: 10px;
  font-size: 13px; font-weight: 500; z-index: 200;
  box-shadow: 0 8px 24px rgba(46,91,255,.3);
  animation: slideUp .25s ease;
}
@keyframes slideUp { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ── SPINNER ───────────────────────────────────────────────────── */
.spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.25); border-top-color: #fff;
  border-radius: 50%; animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── SCROLLBAR ─────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 3px; }

/* ── DASHBOARD TOPBAR PROJECT ─────────────────────────────────── */
.topbar-project { font-size: 14px; font-weight: 700; color: var(--text-muted); margin-bottom: 4px; }

/* ── DASHBOARD IMPACT MAP (inline) ───────────────────────────── */
.dash-impact-map {
  height: 300px;
  position: relative;
  background: radial-gradient(circle at center, rgba(46,91,255,.18), transparent 45%);
  border-radius: var(--radius-panel);
  border: 1px solid var(--border);
  overflow: hidden;
}
.impact-map-inner { position: relative; width: 100%; height: 100%; }
.impact-map-inner svg { position: absolute; inset: 0; }
.im-node {
  position: absolute;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--navy-card);
  border: 1px solid rgba(46,91,255,.5);
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  z-index: 2;
  cursor: pointer;
  transition: all .15s;
}
.im-node:hover { border-color: var(--blue); box-shadow: 0 0 16px rgba(46,91,255,.3); }
.im-node.center {
  background: var(--blue);
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 4px 20px rgba(46,91,255,.4);
}

/* ── IMPACT MAP (full page) ──────────────────────────────────── */
#page-impact { padding: 0 !important; }
.impact-wrap {
  height: calc(100vh - 56px);
  display: flex; flex-direction: column;
  background: #0B1120;
  color: #E2E8F0;
}
.impact-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  background: rgba(11,17,32,.95);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
}
.impact-topbar-left { display: flex; align-items: center; gap: 16px; }
.impact-title { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; color: #fff; }
.impact-select {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px; padding: 7px 14px; color: #CBD5E1; font-size: 13px;
  font-family: inherit; cursor: pointer; min-width: 160px;
}
.impact-select:focus { outline: none; border-color: var(--blue); }
.impact-select option { background: #1E293B; color: #E2E8F0; }
.impact-topbar-right { display: flex; align-items: center; gap: 20px; }
.impact-legend { display: flex; gap: 16px; font-size: 12px; color: #94A3B8; }
.impact-legend-item { display: flex; align-items: center; gap: 6px; }
.impact-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.impact-dot.direct { background: #2E5BFF; box-shadow: 0 0 8px rgba(46,91,255,.5); }
.impact-dot.indirect { background: #FFB547; box-shadow: 0 0 8px rgba(255,181,71,.4); }
.impact-dot.none { background: #334155; }

.impact-body { flex: 1; display: flex; min-height: 0; }
.impact-canvas {
  flex: 1; position: relative; overflow: hidden;
  background:
    radial-gradient(ellipse at center, rgba(46,91,255,.04) 0%, transparent 70%),
    linear-gradient(rgba(255,255,255,.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.02) 1px, transparent 1px);
  background-size: 100% 100%, 40px 40px, 40px 40px;
}
#impact-svg { position: absolute; inset: 0; }
.impact-empty-state {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; color: rgba(255,255,255,.3); font-size: 14px;
}

.impact-panel {
  width: 340px; flex-shrink: 0;
  background: rgba(15,23,42,.95);
  border-left: 1px solid rgba(255,255,255,.06);
  padding: 24px;
  overflow-y: auto;
}
.impact-panel-empty {
  display: flex; align-items: center; justify-content: center;
  height: 100%; color: #64748B; font-size: 14px; text-align: center;
}
.impact-panel h3 { font-size: 16px; font-weight: 700; color: #fff; margin-bottom: 4px; }
.impact-panel-sub { font-size: 12px; color: #64748B; margin-bottom: 20px; }
.impact-panel-section { margin-bottom: 24px; }
.impact-panel-section h4 {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: #64748B; margin-bottom: 12px;
}
.impact-review-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.04);
}
.impact-review-row:last-child { border: none; }
.impact-review-disc { font-size: 13px; font-weight: 600; color: #E2E8F0; }
.impact-review-badge {
  padding: 4px 10px; border-radius: 6px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
}
.impact-review-badge.reviewed { background: rgba(5,150,105,.15); color: #34D399; }
.impact-review-badge.pending { background: rgba(217,119,6,.15); color: #FBBF24; }
.impact-review-badge.flagged { background: rgba(220,38,38,.15); color: #F87171; }
.impact-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.impact-stat-card {
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.06);
  border-radius: 10px; padding: 14px; text-align: center;
}
.impact-stat-val { display: block; font-size: 24px; font-weight: 800; color: #fff; }
.impact-stat-label { font-size: 11px; color: #64748B; text-transform: uppercase; letter-spacing: .05em; }

/* ── CHAT ─────────────────────────────────────────────────────── */
.chat-wrap {
  display: flex; height: calc(100vh - 100px);
  background: var(--navy-panel); border: 1px solid var(--border);
  border-radius: var(--radius-panel); overflow: hidden;
}
.chat-sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--navy-deep);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
}
.chat-sidebar-header {
  padding: 18px 16px 12px; border-bottom: 1px solid var(--border);
}
.chat-sidebar-header h3 { font-size: 14px; font-weight: 700; color: #DCE7F7; }
.chat-channel {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; font-size: 13px; font-weight: 500;
  color: var(--text-muted); cursor: pointer;
  transition: background .1s;
}
.chat-channel:hover { background: rgba(255,255,255,.04); }
.chat-channel.active { background: var(--blue-active); color: #fff; font-weight: 600; }
.chat-channel svg { flex-shrink: 0; }

.chat-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.chat-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.chat-header h3 { font-size: 16px; font-weight: 700; color: #DCE7F7; }
.chat-header-sub { font-size: 12px; color: var(--text-dim); }

.chat-messages {
  flex: 1; overflow-y: auto; padding: 20px 24px;
  display: flex; flex-direction: column; gap: 4px;
}
.chat-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; height: 100%; color: var(--text-dim); font-size: 14px;
}
.chat-msg { display: flex; gap: 12px; padding: 8px 0; }
.chat-msg-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.chat-msg-body { flex: 1; min-width: 0; }
.chat-msg-header { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.chat-msg-name { font-size: 13px; font-weight: 700; color: var(--text-headline); }
.chat-msg-time { font-size: 11px; color: var(--text-dim); }
.chat-msg-text { font-size: 14px; color: var(--text-body); line-height: 1.6; word-break: break-word; }

.chat-input-bar {
  display: flex; gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.chat-input-bar input {
  flex: 1; padding: 10px 16px;
  border: 1px solid var(--border); border-radius: 10px;
  font-size: 14px; font-family: inherit;
  background: rgba(255,255,255,.04); color: var(--text-headline);
}
.chat-input-bar input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(46,91,255,.2); }

/* ── RESPONSIVE ────────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .dash-main-grid { grid-template-columns: 1fr; }
  .dash-right { position: static; }
  .change-layout { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .app-body { margin-left: 0; }
  .topbar { margin-left: 0; }
  nav { display: none; }
  .container { padding: 20px 16px; }
  .stat-cards { grid-template-columns: 1fr 1fr; }
}
