/* Compliance Gateway — Design System Tokens (PRD §6.5)
   Renamed from mockup legacy names to PRD semantic names. */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&display=swap');

:root {
  /* Neutrals */
  --paper:        #F7F5EE;
  --surface:      #FFFFFF;
  --surface-2:    #F3F0E7;
  --ink:          #151719;
  --ink-2:        #3C4045;
  --ink-3:        #85898E;
  --border:       #DED9CB;
  --border-soft:  #E9E4D5;

  /* Primary — navy */
  --navy:         #1E3A5F;
  --navy-2:       #2C4E78;
  --navy-soft:    #E4E9F1;

  /* HITL / compliance warning — amber */
  --amber:        #A3661F;
  --amber-soft:   #F6E8CE;

  /* Failure — brick red */
  --red:          #9A2D1F;
  --red-soft:     #F1DDD8;

  /* Completed — sage */
  --sage:         #3B5F3E;
  --sage-soft:    #E1E9DE;

  /* Workflow accents */
  --wf-lam:       #5A3A6B;
  --wf-masipp:    #37516F;
  --wf-pep:       #8A3A52;
  --wf-email:     #2C4E78;

  /* Slate (secondary) */
  --slate:        #37516F;
  --slate-soft:   #E3E8EF;

  /* Typography */
  --font-display: 'Instrument Serif', 'Cormorant Garamond', 'Times New Roman', serif;
  --font-sans:    -apple-system, 'SF Pro Text', 'Segoe UI', Inter, system-ui, sans-serif;
  --font-mono:    'SFMono-Regular', 'JetBrains Mono', Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; font-size: inherit; }

/* ==================== LOGIN SCREEN ==================== */
.login-screen {
  display: flex;
  min-height: 100vh;
  padding: 12px;
  background: var(--paper);
}
.login-art {
  flex: 1 1 58%;
  border-radius: 20px;
  padding: 48px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(ellipse 70% 50% at 18% 25%, rgba(95, 130, 180, 0.35) 0%, transparent 55%),
    radial-gradient(ellipse 90% 70% at 80% 80%, rgba(20, 35, 60, 0.6) 0%, transparent 50%),
    linear-gradient(135deg, #1A2B47 0%, #243D63 45%, #1E3555 100%);
  color: #F0EEE6;
  min-height: 560px;
  overflow: hidden;
}
.login-art::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,0.04) 0%, transparent 40%),
    radial-gradient(circle at 70% 80%, rgba(255,255,255,0.03) 0%, transparent 35%);
  pointer-events: none;
}
.login-art > * { position: relative; }
.login-art-logo {
  font-size: 14px;
  letter-spacing: 0.05em;
  opacity: 0.85;
  font-weight: 500;
}
.login-art-logo::before {
  content: "\2731";
  margin-right: 6px;
  color: rgba(255,255,255,0.7);
}
.login-art-headline {
  font-family: var(--font-display);
  font-size: 56px;
  line-height: 1.05;
  font-weight: 400;
  letter-spacing: -0.02em;
}
.login-art-headline span { color: #D4B878; font-style: italic; font-weight: 300; }
.login-art-sub {
  margin-top: 20px;
  max-width: 380px;
  font-size: 14px;
  opacity: 0.85;
  line-height: 1.6;
}
.login-panel {
  flex: 0 0 42%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  position: relative;
}
.login-card {
  width: 340px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px 28px;
}
.login-brand {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 28px;
}
.login-brand-sup { font-size: 11px; vertical-align: super; color: var(--ink-3); }
.login-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-bottom: 4px;
}
.login-sub {
  font-size: 13px;
  color: var(--ink-3);
  margin-bottom: 24px;
}
.google-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s;
}
.google-btn:hover { border-color: var(--ink-2); }
.google-btn svg { width: 16px; height: 16px; }
.login-foot {
  margin-top: 16px;
  font-size: 11px;
  color: var(--ink-3);
  text-align: center;
  line-height: 1.5;
}
.login-legal {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--ink-3);
}

/* ==================== APP SHELL ==================== */
.app-shell {
  display: flex;
  height: 100vh;
  padding: 12px;
  gap: 12px;
}

/* Sidebar */
.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  padding: 8px 4px;
  font-size: 13px;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin-bottom: 16px;
}
.sidebar-logo {
  width: 28px;
  height: 28px;
  background: var(--ink);
  color: white;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 15px;
}
.sidebar-workspace {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: -0.01em;
}
.sidebar-section-label {
  font-size: 10px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  padding: 8px 12px 4px;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-radius: 7px;
  color: var(--ink-2);
  cursor: pointer;
  position: relative;
  text-decoration: none;
}
.sidebar-item:hover { background: rgba(0,0,0,0.04); color: var(--ink); }
.sidebar-item.active {
  background: var(--surface);
  color: var(--ink);
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.sidebar-item.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.sidebar-icon {
  width: 16px; height: 16px; opacity: 0.65;
  flex-shrink: 0;
}
.sidebar-item.active .sidebar-icon { opacity: 0.9; }
.sidebar-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--ink-3);
  background: var(--border-soft);
  padding: 1px 7px;
  border-radius: 999px;
}
.sidebar-count.urgent {
  background: var(--amber-soft);
  color: var(--amber);
  font-weight: 600;
}
.sidebar-group { margin-bottom: 10px; }
.sidebar-spacer { flex: 1; }
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-top: 1px solid var(--border-soft);
  margin-top: 8px;
}
.user-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--navy);
  color: white;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.user-name { font-size: 12px; font-weight: 500; line-height: 1.2; }
.user-role { font-size: 11px; color: var(--ink-3); line-height: 1.2; }

/* Main content */
.main-content {
  flex: 1;
  background: var(--surface);
  border-radius: 14px;
  border: 1px solid var(--border-soft);
  overflow-y: auto;
  padding: 0;
}
.main-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 32px 36px 20px;
  gap: 20px;
}
.greeting {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.header-meta {
  font-size: 12px;
  color: var(--ink-3);
  text-align: right;
  white-space: nowrap;
  padding-top: 8px;
}
.header-meta .divider {
  margin: 0 8px;
  opacity: 0.5;
}

/* Sections */
.section { padding: 0 36px 32px; }
.section-label {
  font-size: 11px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Action required bar */
.action-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.action-card {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  text-decoration: none;
  color: inherit;
}
.action-card:hover { background: #F5EFDF; border-color: var(--border); }
.action-card.urgent {
  background: var(--amber-soft);
  border-color: #EAD79C;
}
.action-card.urgent:hover { background: #F8E8B8; }
.action-icon-box {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}
.action-card.urgent .action-icon-box { background: white; }
.action-text { flex: 1; }
.action-label { font-size: 13px; font-weight: 500; color: var(--ink); }
.action-sub { font-size: 11px; color: var(--ink-3); margin-top: 1px; }
.action-pill {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 500;
  white-space: nowrap;
  background: white;
  color: var(--ink-2);
  border: 1px solid var(--border);
}
.action-pill.amber { background: white; color: var(--amber); border-color: #EAD79C; font-weight: 600; }

/* Stats row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}
.stat-box {
  padding: 14px 18px;
  border-right: 1px solid var(--border-soft);
}
.stat-box:last-child { border-right: none; }
.stat-num {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--ink);
}
.stat-label {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 6px;
}
.stat-num.navy { color: var(--navy); }
.stat-num.amber { color: var(--amber); }

/* Filters */
.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
  font-family: var(--font-sans);
  text-decoration: none;
}
.filter-chip:hover { border-color: var(--ink-3); }
.filter-chip.active {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}
.filter-search {
  margin-left: auto;
  flex: 0 0 240px;
  position: relative;
}
.filter-search input {
  width: 100%;
  padding: 6px 12px 6px 30px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  background: var(--surface);
  font-family: inherit;
  color: var(--ink);
}
.filter-search input:focus { outline: none; border-color: var(--ink-2); }
.filter-search::before {
  content: "\2315";
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  font-size: 13px;
}

/* Task table */
.task-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.task-table thead th {
  padding: 8px 12px;
  text-align: left;
  font-weight: 500;
  font-size: 11px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border-soft);
}
.task-table tbody tr {
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
}
.task-table tbody tr:hover { background: var(--surface-2); }
.task-table tbody tr:last-child { border-bottom: none; }
.task-table td {
  padding: 13px 12px;
  vertical-align: middle;
}
.task-table a {
  display: contents;
  color: inherit;
  text-decoration: none;
}

/* Workflow tag */
.wf-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-2);
}
.wf-tag .dot {
  width: 6px; height: 6px; border-radius: 50%;
}
.wf-tag.lam .dot   { background: var(--wf-lam); }
.wf-tag.masipp .dot { background: var(--wf-masipp); }
.wf-tag.pep .dot   { background: var(--wf-pep); }
.wf-tag.email .dot { background: var(--wf-email); }

/* Subject (masked CIF) */
.subject-cif {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink);
  letter-spacing: 0.03em;
}

/* Status pill */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 999px;
}
.status-pill .dot { width: 5px; height: 5px; border-radius: 50%; }
.pill-inprogress { background: var(--sage-soft); color: var(--sage); }
.pill-inprogress .dot { background: var(--sage); }
.pill-hitl { background: var(--amber-soft); color: var(--amber); }
.pill-hitl .dot { background: var(--amber); }
.pill-done { background: var(--navy-soft); color: var(--navy); }
.pill-done .dot { background: var(--navy); }
.pill-failed { background: var(--red-soft); color: var(--red); }
.pill-failed .dot { background: var(--red); }

.pic-cell {
  display: flex;
  align-items: center;
  gap: 7px;
}
.pic-avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  color: white;
  background: #2F4557;
}

.age-cell { color: var(--ink-3); font-size: 12px; white-space: nowrap; }

/* ==================== DETAIL PAGE ==================== */
.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 6px 6px;
  margin: 24px 36px 8px;
  border-radius: 7px;
  font-size: 12px;
  color: var(--ink-3);
  background: transparent;
  border: none;
  cursor: pointer;
  text-decoration: none;
}
.detail-back:hover { background: var(--surface-2); color: var(--ink); }

.detail-hero {
  padding: 8px 36px 24px;
  border-bottom: 1px solid var(--border-soft);
}
.detail-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 12px;
}
.detail-id {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
}
.detail-name {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 6px;
}
.detail-cif {
  font-size: 13px;
  color: var(--ink-2);
}
.detail-cif .label { color: var(--ink-3); margin-right: 4px; }
.detail-cif .mono { font-family: var(--font-mono); }

/* HITL banner */
.hitl-banner {
  margin: 24px 36px 0;
  background: var(--amber-soft);
  border: 1px solid #EAD79C;
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.hitl-banner-icon {
  width: 28px; height: 28px;
  background: white;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.hitl-banner-text { flex: 1; font-size: 13px; }
.hitl-banner-title { font-weight: 600; color: var(--amber); margin-bottom: 2px; }
.hitl-banner-sub { color: var(--ink-2); line-height: 1.5; }
.hitl-banner-sub code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: white;
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--amber);
  font-weight: 600;
}
.hitl-banner-cta {
  padding: 7px 14px;
  background: var(--amber);
  color: white;
  border: none;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}
.hitl-banner-cta:hover { background: #9B6A1A; }

/* Detail body (2-col) */
.detail-body {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  padding: 24px 36px 36px;
}

.block { margin-bottom: 24px; }
.block-label {
  font-size: 11px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-bottom: 10px;
}

/* Checklist (workflow steps) */
.checklist { list-style: none; }
.checklist li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13px;
}
.checklist li:last-child { border-bottom: none; }
.check-icon {
  width: 18px; height: 18px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
}
.check-done    { background: var(--navy-soft); color: var(--navy); }
.check-waiting { background: var(--amber-soft); color: var(--amber); }
.check-pending { background: var(--border-soft); color: var(--ink-3); }
.check-label { flex: 1; color: var(--ink); }
.check-label.waiting { color: var(--amber); font-weight: 500; }
.check-label.pending { color: var(--ink-3); }
.check-ts { font-size: 11px; color: var(--ink-3); font-family: var(--font-mono); }
.check-ts.waiting { color: var(--amber); font-weight: 600; }

/* Docs */
.doc-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13px;
}
.doc-item:last-child { border-bottom: none; }
.doc-icon {
  width: 24px; height: 24px;
  background: var(--surface-2);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}
.doc-name {
  flex: 1;
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}
.doc-name:hover { text-decoration: underline; }
.doc-type {
  font-size: 11px;
  color: var(--ink-3);
}
.doc-item.pending { opacity: 0.5; }
.doc-item.pending .doc-name { cursor: default; color: var(--ink-3); }

/* Audit log */
.audit-item {
  display: grid;
  grid-template-columns: 80px auto 1fr;
  gap: 12px;
  padding: 8px 0;
  font-size: 12px;
  border-bottom: 1px solid var(--border-soft);
}
.audit-item:last-child { border-bottom: none; }
.audit-ts { color: var(--ink-3); font-family: var(--font-mono); white-space: nowrap; }
.audit-actor { color: var(--ink-2); font-weight: 500; white-space: nowrap; }
.audit-actor.sys { color: var(--ink-3); font-style: italic; font-weight: 400; }
.audit-detail { color: var(--ink); }

/* Sidebar info card */
.info-card {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
}
.info-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 12px;
  border-bottom: 1px solid var(--border-soft);
}
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--ink-3); }
.info-val { color: var(--ink); font-weight: 500; text-align: right; }
.info-val.mono { font-family: var(--font-mono); }
.info-val.amber { color: var(--amber); font-weight: 600; }
.info-val a { color: var(--navy); text-decoration: none; font-weight: 500; }
.info-val a:hover { text-decoration: underline; }

/* Notes */
.notes-box {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 14px 16px;
}
.notes-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.notes-head .block-label { margin-bottom: 0; }
.notes-head .hint { font-size: 10px; color: var(--ink-3); font-weight: 400; text-transform: none; letter-spacing: 0; }
.notes-textarea {
  width: 100%;
  min-height: 90px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 13px;
  font-family: inherit;
  color: var(--ink);
  resize: vertical;
  line-height: 1.55;
}
.notes-textarea:focus { outline: none; border-color: var(--ink-2); }
.notes-save {
  margin-top: 8px;
  padding: 6px 14px;
  background: var(--ink);
  color: white;
  border: none;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.notes-save:hover { background: var(--ink-2); }

/* Empty state */
.empty {
  padding: 64px 24px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}
.empty-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
  margin-bottom: 6px;
  color: var(--ink);
}
.empty-sub {
  font-size: 13px;
  color: var(--ink-3);
  max-width: 360px;
  margin: 0 auto;
  line-height: 1.55;
}

/* ==================== FEEDBACK WIDGET ==================== */
.fb-trigger {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--ink);
  color: white;
  border: none;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  transition: background 0.15s, transform 0.15s;
}
.fb-trigger:hover { background: var(--ink-2); transform: translateY(-1px); }

.fb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  justify-content: flex-end;
  align-items: flex-end;
  padding: 24px;
}
.fb-overlay.open { display: flex; }

.fb-panel {
  width: 400px;
  max-height: 80vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.fb-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-soft);
}
.fb-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}
.fb-close {
  width: 28px;
  height: 28px;
  border: none;
  background: var(--surface-2);
  border-radius: 7px;
  font-size: 18px;
  color: var(--ink-3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fb-close:hover { background: var(--border-soft); color: var(--ink); }

.fb-body { padding: 20px; }
.fb-field { margin-bottom: 16px; }
.fb-label {
  display: block;
  font-size: 11px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-bottom: 8px;
}
.fb-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.fb-context {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--ink-3);
  margin-bottom: 16px;
  line-height: 1.4;
}
.fb-context code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-2);
}

.fb-submit {
  width: 100%;
  padding: 10px;
  background: var(--ink);
  color: white;
  border: none;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: background 0.15s;
}
.fb-submit:hover { background: var(--ink-2); }
.fb-submit:disabled { opacity: 0.7; cursor: wait; }

/* Responsive */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
@media (max-width: 960px) {
  .detail-body { grid-template-columns: 1fr; }
  .login-screen { flex-direction: column; padding: 8px; }
  .login-art { min-height: 240px; }
  .login-panel { flex: 1; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .stat-box:nth-child(2) { border-right: none; }
  .sidebar { width: 64px; }
  .sidebar-brand span, .sidebar-item span:not(.sidebar-count), .sidebar-section-label, .sidebar-user > div { display: none; }
}

/* ==================== AUTH FORMS ==================== */
.auth-form { display: flex; flex-direction: column; gap: 16px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--ink-2);
  text-transform: uppercase;
}
.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.form-input:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px var(--navy-soft);
}
.form-input::placeholder { color: var(--ink-3); }

.pw-wrap { position: relative; }
.pw-wrap .form-input { padding-right: 40px; }
.pw-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  color: var(--ink-3);
  line-height: 1;
}
.pw-toggle:hover { color: var(--ink-2); }

.btn-primary {
  width: 100%;
  padding: 11px 14px;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--navy-2); }
.btn-primary:active { background: var(--navy); }

.form-error {
  padding: 10px 12px;
  background: var(--red-soft);
  border: 1px solid var(--red);
  border-radius: 8px;
  font-size: 13px;
  color: var(--red);
}

.form-success {
  padding: 10px 12px;
  background: var(--sage-soft);
  border: 1px solid var(--sage);
  border-radius: 8px;
  font-size: 13px;
  color: var(--sage);
}

.form-divider {
  text-align: center;
  font-size: 12px;
  color: var(--ink-3);
  margin: 4px 0;
}

.form-link { color: var(--navy); text-decoration: none; }
.form-link:hover { text-decoration: underline; }
