/* =================================================================
   PORTAL STYLESHEET
   Extends the main site design system. Import after styles.css.
   ================================================================= */

:root {
  --ink: #0F1923;
  --ink-soft: #1a2433;
  --navy: #081627;
  --navy-mid: #0d2035;
  --gold: #C9A24D;
  --gold-deep: #9c7d35;
  --gold-light: #E2C879;
  --gold-wash: #FAF5E8;
  --gold-pale: rgba(201,162,77,.10);
  --paper: #FFFFFF;
  --paper-deep: #F2F3F6;
  --paper-warm: #F6F7F9;
  --muted: #687585;
  --muted-soft: #8b97a6;
  --hairline: #dde2ea;
  --hairline-light: #e8ecf1;
  --success: #1f7a5a;
  --warning: #d97706;
  --error: #c8102e;
  --info: #2563eb;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Instrument Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper-warm);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; }
input, select, textarea, button { font-family: inherit; font-size: inherit; }

.serif { font-family: 'Fraunces', Georgia, serif; font-optical-sizing: auto; }
.mono { font-family: 'IBM Plex Mono', 'SF Mono', Consolas, monospace; }
.emph { font-style: italic; color: var(--gold); font-variation-settings: 'SOFT' 100, 'WONK' 1; }

.eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}

h1, h2, h3, h4 { font-family: 'Fraunces', serif; font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; }

/* =================================================================
   AUTH LAYOUT — split hero / form
   ================================================================= */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.auth-side {
  background: var(--navy);
  color: var(--paper);
  padding: 60px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.auth-side::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 30%, rgba(201, 162, 77, 0.15), transparent 60%);
  pointer-events: none;
}
.auth-side-inner { position: relative; z-index: 1; max-width: 480px; }
.auth-side .logo {
  font-family: 'Fraunces', serif;
  font-size: 28px;
  letter-spacing: -0.02em;
  color: var(--paper);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.auth-side .logo .dot { width: 6px; height: 6px; background: var(--gold); border-radius: 50%; display: inline-block; }
.auth-side .display {
  font-family: 'Fraunces', serif;
  font-size: clamp(36px, 4vw, 56px);
  line-height: 1;
  letter-spacing: -0.035em;
  margin: 40px 0 24px;
}
.auth-side .lead {
  font-size: 16px;
  color: #B5B5B5;
  line-height: 1.7;
  max-width: 44ch;
}
.auth-side .footer {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: #6a6a6a;
  text-transform: uppercase;
}
.auth-side .quote {
  padding: 28px 32px;
  border-left: 3px solid var(--gold);
  background: rgba(255, 255, 255, 0.03);
  margin-top: 40px;
}
.auth-side .quote p {
  font-family: 'Fraunces', serif;
  font-size: 19px;
  font-style: italic;
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--paper);
}
.auth-side .quote cite {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: #8a8a8a;
  margin-top: 16px;
  letter-spacing: 0.1em;
  font-style: normal;
  text-transform: uppercase;
}

.auth-main {
  padding: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--paper);
}
.auth-main-inner { max-width: 440px; margin: 0 auto; width: 100%; }
.auth-main h1 {
  font-size: clamp(32px, 4vw, 44px);
  margin-bottom: 12px;
}
.auth-main .subtitle {
  color: var(--muted);
  font-size: 16px;
  margin-bottom: 40px;
  line-height: 1.6;
}
.auth-main .alt-action {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}
.auth-main .alt-action a { color: var(--gold); font-weight: 500; }
.auth-main .alt-action a:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-main { padding: 40px 24px; min-height: 100vh; }
}

/* =================================================================
   FORMS
   ================================================================= */
.form-field { margin-bottom: 20px; }
.form-label {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 500;
}
.form-input, .form-textarea, .form-select {
  width: 100%;
  border: 1px solid var(--hairline);
  padding: 14px 16px;
  font-size: 15px;
  background: var(--paper);
  outline: none;
  font-family: 'Instrument Sans', sans-serif;
  color: var(--ink);
  transition: all 0.2s;
  border-radius: 2px;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(201, 162, 77, 0.08);
}
.form-input[aria-invalid="true"] { border-color: var(--gold); }
.form-textarea { resize: vertical; min-height: 100px; }
.form-help {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: 0.03em;
}
.form-error {
  font-size: 12px;
  color: var(--gold);
  margin-top: 6px;
  display: none;
}
.form-error.shown { display: block; }

/* Password strength indicator */
.pw-strength {
  display: flex;
  gap: 4px;
  margin-top: 10px;
}
.pw-strength-bar {
  height: 3px;
  flex: 1;
  background: var(--hairline);
  transition: background 0.3s;
}
.pw-strength-bar.filled-weak { background: var(--gold); }
.pw-strength-bar.filled-fair { background: var(--warning); }
.pw-strength-bar.filled-good { background: var(--success); }
.pw-strength-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 6px;
  font-family: 'IBM Plex Mono', monospace;
}

/* =================================================================
   BUTTONS
   ================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  border-radius: 2px;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-primary { background: var(--gold); color: var(--paper); }
.btn-primary:hover { background: var(--gold-deep); transform: translateY(-1px); }
.btn-primary:disabled { background: var(--muted); cursor: not-allowed; transform: none; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--hairline); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-dark { background: var(--navy); color: var(--paper); }
.btn-dark:hover { background: var(--ink-soft); }
.btn-block { width: 100%; }
.btn-large { padding: 16px 28px; font-size: 15px; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn .arrow { transition: transform 0.2s; }
.btn:hover .arrow { transform: translateX(3px); }

/* =================================================================
   PORTAL LAYOUT — sidebar + main (flexbox for reliability)
   ================================================================= */
.portal {
  display: flex;
  align-items: stretch;
  min-height: 100vh;
  position: relative;
}

.sidebar {
  background: var(--navy);
  color: var(--paper);
  padding: 28px 0;
  width: 260px;
  flex-shrink: 0;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-self: flex-start;
}
.sidebar-brand {
  padding: 0 28px 28px;
  border-bottom: 1px solid #2a2a2a;
  margin-bottom: 28px;
}
.sidebar-brand .logo {
  font-family: 'Fraunces', serif;
  font-size: 24px;
  color: var(--paper);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  letter-spacing: -0.02em;
}
.sidebar-brand .logo .dot { width: 5px; height: 5px; background: var(--gold); border-radius: 50%; display: inline-block; }
.sidebar-brand .tag {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  color: #8a8a8a;
  text-transform: uppercase;
  margin-top: 6px;
}

.sidebar-label {
  padding: 0 28px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: #6a6a6a;
  text-transform: uppercase;
  margin-bottom: 12px;
  font-weight: 500;
}
.sidebar-nav { list-style: none; padding: 0; margin-bottom: 24px; }
.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 28px;
  color: #cccccc;
  font-size: 14px;
  transition: all 0.15s;
  position: relative;
}
.sidebar-nav li a:hover { color: var(--paper); background: rgba(255,255,255,0.03); }
.sidebar-nav li a.active { color: var(--paper); background: rgba(201, 162, 77, 0.12); }
.sidebar-nav li a.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--gold);
}
.sidebar-nav .icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: currentColor;
  opacity: 0.8;
}
.sidebar-nav .badge {
  margin-left: auto;
  background: var(--gold);
  color: var(--paper);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 2px;
  letter-spacing: 0.05em;
}
.sidebar-foot {
  margin-top: auto;
  padding: 24px 28px 0;
  border-top: 1px solid #2a2a2a;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-user .avatar {
  width: 36px;
  height: 36px;
  background: var(--gold);
  border-radius: 50%;
  color: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fraunces', serif;
  font-size: 15px;
  font-weight: 500;
  flex-shrink: 0;
}
.sidebar-user .who { min-width: 0; overflow: hidden; flex: 1; }
.sidebar-user .name { font-size: 13px; color: var(--paper); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .role { font-size: 11px; color: #8a8a8a; font-family: 'IBM Plex Mono', monospace; letter-spacing: 0.05em; text-transform: uppercase; margin-top: 2px; }
.sidebar-user .menu-trigger { color: #8a8a8a; padding: 6px; }
.sidebar-user .menu-trigger:hover { color: var(--paper); }

/* Main column */
.main {
  flex: 1;
  min-width: 0;
  background: var(--paper-warm);
  overflow-x: hidden;
}
.main-topbar {
  padding: 20px 40px;
  background: var(--paper);
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.main-topbar .search {
  flex: 1;
  max-width: 480px;
  position: relative;
}
.main-topbar .search input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  border: 1px solid var(--hairline);
  background: var(--paper-deep);
  border-radius: 2px;
  font-size: 14px;
  outline: none;
}
.main-topbar .search input:focus { border-color: var(--ink); background: var(--paper); }
.main-topbar .search .icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}
.main-topbar .actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.icon-btn {
  width: 40px; height: 40px;
  border-radius: 2px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  position: relative;
}
.icon-btn:hover { background: var(--paper-deep); border-color: var(--hairline); }
.icon-btn.has-alert::after {
  content: '';
  position: absolute;
  top: 10px; right: 10px;
  width: 8px; height: 8px;
  background: var(--gold);
  border: 2px solid var(--paper);
  border-radius: 50%;
}

.main-content { padding: 40px; max-width: 1280px; width: 100%; }

/* Page headers */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--hairline);
  flex-wrap: wrap;
}
.page-header h1 {
  font-size: clamp(32px, 4vw, 44px);
  letter-spacing: -0.025em;
  line-height: 1;
}
.page-header .subtitle {
  color: var(--muted);
  font-size: 15px;
  margin-top: 10px;
  max-width: 60ch;
}
.page-header-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--gold); }
.breadcrumb .sep { color: var(--hairline); }
.breadcrumb .current { color: var(--ink); }

/* Cards / panels */
.panel {
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: 2px;
  overflow: hidden;
}
.panel-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.panel-header h3 {
  font-size: 18px;
  letter-spacing: -0.015em;
}
.panel-header .actions a {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}
.panel-body { padding: 24px; }
.panel-body.flush { padding: 0; }

/* Dashboard stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}
.stat-card {
  background: var(--paper);
  border: 1px solid var(--hairline);
  padding: 24px;
  border-radius: 2px;
  position: relative;
}
.stat-card .stat-num {
  font-family: 'Fraunces', serif;
  font-size: 44px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.03em;
  margin-top: 12px;
}
.stat-card .stat-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.stat-card .stat-delta {
  margin-top: 14px;
  font-size: 12px;
  color: var(--success);
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: 0.05em;
}

/* =================================================================
   FOLDERS GRID
   ================================================================= */
.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.folder-card {
  background: var(--paper);
  border: 1px solid var(--hairline);
  padding: 24px;
  border-radius: 2px;
  transition: all 0.2s;
  cursor: pointer;
  position: relative;
  display: block;
  color: inherit;
}
.folder-card:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.04);
}
.folder-card.preset::before {
  content: 'PRESET';
  position: absolute;
  top: 14px;
  right: 14px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.15em;
  color: var(--muted);
  background: var(--paper-deep);
  padding: 3px 6px;
  border-radius: 2px;
}
.folder-card .folder-icon {
  width: 48px; height: 38px;
  background: var(--gold);
  border-radius: 2px 2px 2px 2px;
  position: relative;
  margin-bottom: 20px;
}
.folder-card .folder-icon::before {
  content: '';
  position: absolute;
  top: -6px; left: 0;
  width: 40%;
  height: 6px;
  background: var(--gold);
  border-radius: 2px 2px 0 0;
}
.folder-card.preset .folder-icon { background: var(--navy); }
.folder-card.preset .folder-icon::before { background: var(--navy); }
.folder-card .name {
  font-family: 'Fraunces', serif;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.015em;
  margin-bottom: 6px;
}
.folder-card .meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}
.folder-card .unread {
  position: absolute;
  top: 14px;
  left: 14px;
  background: var(--gold);
  color: var(--paper);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  padding: 3px 6px;
  border-radius: 2px;
  letter-spacing: 0.05em;
}

/* New folder card */
.folder-card.new-folder {
  border: 1px dashed var(--hairline);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  color: var(--muted);
  text-align: center;
}
.folder-card.new-folder:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--paper);
}
.folder-card.new-folder .plus {
  font-family: 'Fraunces', serif;
  font-size: 32px;
  line-height: 1;
  display: block;
  margin-bottom: 8px;
}

/* =================================================================
   FILE LIST
   ================================================================= */
.file-list { width: 100%; border-collapse: collapse; }
.file-list thead tr {
  border-bottom: 1px solid var(--hairline);
}
.file-list th {
  text-align: left;
  padding: 14px 16px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.file-list tbody tr {
  border-bottom: 1px solid var(--hairline-light);
  transition: background 0.15s;
}
.file-list tbody tr:hover { background: var(--paper-deep); }
.file-list tbody tr.unread { background: rgba(201, 162, 77, 0.03); }
.file-list tbody tr.unread td:first-child { position: relative; }
.file-list tbody tr.unread td:first-child::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px; height: 6px;
  background: var(--gold);
  border-radius: 50%;
}
.file-list td {
  padding: 14px 16px;
  font-size: 14px;
  vertical-align: middle;
}
.file-list .file-name {
  display: flex;
  align-items: center;
  gap: 14px;
}
.file-icon {
  width: 36px; height: 44px;
  background: var(--paper-deep);
  border: 1px solid var(--hairline);
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  font-weight: 500;
  color: var(--muted);
  flex-shrink: 0;
  letter-spacing: 0.05em;
  position: relative;
}
.file-icon[data-type="pdf"] { color: var(--gold); border-color: var(--gold); background: var(--gold-wash); }
.file-icon[data-type="docx"], .file-icon[data-type="doc"] { color: #2563eb; border-color: #2563eb; background: #EEF4FF; }
.file-icon[data-type="xlsx"], .file-icon[data-type="csv"] { color: var(--success); border-color: var(--success); background: #EBF4EE; }
.file-icon[data-type="png"], .file-icon[data-type="jpg"], .file-icon[data-type="jpeg"] { color: #9333ea; border-color: #9333ea; background: #F5EEFB; }

.file-name-text { font-weight: 500; color: var(--ink); }
.file-name-meta { font-size: 12px; color: var(--muted); font-family: 'IBM Plex Mono', monospace; letter-spacing: 0.03em; margin-top: 2px; }
.file-list .uploader {
  font-size: 13px;
  color: var(--muted);
}
.file-list .uploader.admin { color: var(--ink); }
.file-list .uploader.admin::before {
  content: 'ADMIN';
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.15em;
  background: var(--navy);
  color: var(--paper);
  padding: 2px 5px;
  border-radius: 2px;
  margin-right: 8px;
}
.file-list .uploader.self::before {
  content: 'YOU';
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.15em;
  background: var(--gold);
  color: var(--paper);
  padding: 2px 5px;
  border-radius: 2px;
  margin-right: 8px;
}

.file-list .row-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}
.row-action {
  width: 32px; height: 32px;
  border-radius: 2px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.row-action:hover { color: var(--gold); background: var(--paper-deep); }

/* =================================================================
   UPLOAD ZONE
   ================================================================= */
.upload-zone {
  border: 2px dashed var(--hairline);
  border-radius: 2px;
  padding: 48px 32px;
  text-align: center;
  background: var(--paper);
  transition: all 0.2s;
  cursor: pointer;
}
.upload-zone:hover, .upload-zone.dragging {
  border-color: var(--gold);
  background: var(--gold-wash);
}
.upload-zone .upload-icon {
  font-family: 'Fraunces', serif;
  font-size: 40px;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 16px;
}
.upload-zone h4 {
  font-size: 18px;
  margin-bottom: 8px;
  letter-spacing: -0.015em;
}
.upload-zone p {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
}
.upload-zone .upload-cta {
  color: var(--gold);
  font-weight: 500;
  text-decoration: underline;
  cursor: pointer;
}

/* =================================================================
   NOTIFICATIONS
   ================================================================= */
.notif-list { list-style: none; padding: 0; }
.notif-item {
  display: flex;
  gap: 20px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--hairline-light);
  align-items: flex-start;
  transition: background 0.15s;
}
.notif-item:hover { background: var(--paper-deep); }
.notif-item.unread { background: rgba(201, 162, 77, 0.025); }
.notif-item.unread::before {
  content: '';
  width: 8px; height: 8px;
  background: var(--gold);
  border-radius: 50%;
  margin-top: 8px;
  flex-shrink: 0;
}
.notif-item:not(.unread)::before {
  content: '';
  width: 8px; height: 8px;
  background: transparent;
  margin-top: 8px;
  flex-shrink: 0;
}
.notif-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--paper-deep);
  border: 1px solid var(--hairline);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  flex-shrink: 0;
}
.notif-body { flex: 1; min-width: 0; }
.notif-body .notif-title {
  font-size: 15px;
  margin-bottom: 4px;
  color: var(--ink);
}
.notif-body .notif-title strong { font-weight: 600; }
.notif-body .notif-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.notif-actions a {
  color: var(--gold);
  font-size: 12px;
  font-weight: 500;
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* =================================================================
   TOASTS
   ================================================================= */
.toasts {
  position: fixed;
  top: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
  pointer-events: none;
}
.toast {
  background: var(--navy);
  color: var(--paper);
  padding: 16px 20px;
  border-radius: 2px;
  border-left: 3px solid var(--gold);
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.14);
  max-width: 360px;
  pointer-events: auto;
  animation: slideIn 0.3s ease;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.toast.success { border-left-color: var(--success); }
.toast-body { flex: 1; }
.toast strong { display: block; margin-bottom: 2px; font-weight: 600; }
.toast span { color: #cccccc; font-size: 13px; }
.toast .close { color: #8a8a8a; background: none; border: 0; cursor: pointer; padding: 4px; }
.toast .close:hover { color: var(--paper); }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* =================================================================
   TABS
   ================================================================= */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 32px;
}
.tab {
  padding: 14px 24px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 500;
  margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* =================================================================
   MISC
   ================================================================= */
.empty-state {
  padding: 80px 32px;
  text-align: center;
  color: var(--muted);
}
.empty-state .icon {
  font-family: 'Fraunces', serif;
  font-size: 64px;
  line-height: 1;
  color: var(--hairline);
  margin-bottom: 20px;
  font-weight: 300;
}
.empty-state h3 {
  color: var(--ink);
  margin-bottom: 8px;
  font-size: 20px;
}

.badge {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 2px;
  font-weight: 500;
  display: inline-block;
}
.badge-red { background: var(--gold); color: var(--paper); }
.badge-dark { background: var(--navy); color: var(--paper); }
.badge-outline { background: transparent; color: var(--muted); border: 1px solid var(--hairline); }
.badge-success { background: #EBF4EE; color: var(--success); }

.divider {
  height: 1px;
  background: var(--hairline);
  margin: 24px 0;
}

/* =================================================================
   MOBILE
   ================================================================= */
@media (max-width: 900px) {
  .portal { display: block; }
  .sidebar {
    position: fixed;
    top: 0; left: -280px;
    width: 260px;
    height: 100vh;
    z-index: 200;
    transition: left 0.3s;
    align-self: auto;
  }
  .sidebar.open { left: 0; }
  .main {
    width: 100%;
  }
  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 150;
  }
  .sidebar-backdrop.shown { display: block; }
  .main-topbar { padding: 16px 20px; }
  .main-content { padding: 24px 20px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .folder-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .main-topbar .search { max-width: none; }
  .mobile-menu-trigger { display: inline-flex !important; }
  .file-list { font-size: 13px; }
  .file-list .hide-mobile { display: none; }
  .file-list th, .file-list td { padding: 10px 8px; }
}
.mobile-menu-trigger { display: none; }

@media (min-width: 901px) {
  .hide-desktop { display: none !important; }
}

/* =================================================================
   NEW COMPONENTS — Dashboard tiles, tabs, mailbox, AI summary
   ================================================================= */

/* ===== DOCUMENT DASHBOARD HEADER TILES ===== */
.dash-tiles {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  margin-bottom: 32px;
}
.dash-tile {
  background: var(--paper); border: 1px solid var(--hairline);
  padding: 22px 22px 20px; position: relative; transition: all 0.2s;
}
.dash-tile:hover { border-color: var(--navy); }
.dash-tile.accent { background: var(--navy); color: var(--paper); border-color: var(--navy); }
.dash-tile.accent .tile-label { color: var(--gold); }
.dash-tile.accent .tile-meta { color: rgba(255,255,255,.55); }
.tile-label {
  font-family: 'IBM Plex Mono', monospace; font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold);
  margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
}
.tile-label svg { flex-shrink: 0; }
.tile-value {
  font-family: 'Fraunces', serif; font-size: 40px; font-weight: 500;
  letter-spacing: -0.03em; line-height: 1; margin-bottom: 6px;
}
.dash-tile.accent .tile-value { color: var(--paper); }
.tile-meta {
  font-size: 12px; color: var(--muted); line-height: 1.5;
}
.tile-pulse {
  position: absolute; top: 20px; right: 20px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--gold);
  box-shadow: 0 0 0 0 rgba(201, 162, 77, 0.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(201, 162, 77, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(201, 162, 77, 0); }
  100% { box-shadow: 0 0 0 0 rgba(201, 162, 77, 0); }
}

/* ===== ALERT STRIP ===== */
.alert-strip {
  background: var(--gold-wash); border: 1px solid rgba(201,162,77,.3);
  border-left: 3px solid var(--gold); padding: 18px 24px;
  display: flex; gap: 18px; align-items: flex-start; margin-bottom: 32px;
}
.alert-strip-icon {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%;
  background: var(--gold); color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-family: 'Fraunces', serif;
}
.alert-strip-body { flex: 1; }
.alert-strip-title {
  font-family: 'Fraunces', serif; font-size: 17px; font-weight: 500;
  margin-bottom: 4px;
}
.alert-strip-text { font-size: 14px; color: var(--ink); line-height: 1.5; }
.alert-strip-text strong { color: var(--gold-deep); font-weight: 600; }

/* ===== TAB BAR ===== */
.tab-bar {
  display: flex; gap: 0; border-bottom: 1px solid var(--hairline);
  margin-bottom: 28px; overflow-x: auto;
}
.tab-btn {
  background: transparent; border: 0; padding: 16px 24px; cursor: pointer;
  font-family: 'Instrument Sans', sans-serif; font-size: 14px;
  font-weight: 500; color: var(--muted); position: relative;
  transition: color 0.2s; display: inline-flex; align-items: center; gap: 10px;
  white-space: nowrap; border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--ink); }
.tab-btn.active {
  color: var(--navy); border-bottom-color: var(--gold);
}
.tab-btn .tab-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 7px;
  border-radius: 11px; background: var(--paper-deep);
  font-family: 'IBM Plex Mono', monospace; font-size: 11px;
  color: var(--muted); font-weight: 500;
}
.tab-btn.active .tab-count {
  background: var(--gold); color: var(--navy);
}
.tab-btn .tab-count.alert {
  background: var(--error); color: var(--paper);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: tabFade 0.25s ease; }
@keyframes tabFade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== MAILBOX INBOX ===== */
.mailbox-controls {
  display: flex; gap: 14px; margin-bottom: 20px; align-items: center;
  flex-wrap: wrap;
}
.mailbox-search {
  flex: 1; min-width: 240px; position: relative;
}
.mailbox-search input {
  width: 100%; border: 1px solid var(--hairline);
  background: var(--paper); padding: 11px 14px 11px 38px;
  font-family: inherit; font-size: 14px; outline: none;
  border-radius: 2px; transition: border-color 0.2s;
}
.mailbox-search input:focus { border-color: var(--gold); }
.mailbox-search svg {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none;
}
.mailbox-filters {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--paper); border: 1px solid var(--hairline);
  padding: 8px 14px; font-size: 12px; font-weight: 500;
  font-family: 'IBM Plex Mono', monospace; letter-spacing: 0.05em;
  text-transform: uppercase; cursor: pointer; transition: all 0.2s;
  color: var(--muted); border-radius: 2px;
}
.filter-chip:hover { border-color: var(--navy); color: var(--ink); }
.filter-chip.active {
  background: var(--navy); border-color: var(--navy); color: var(--paper);
}
.filter-chip .chip-count {
  font-size: 10px; padding: 1px 6px; background: rgba(255,255,255,.15);
  border-radius: 8px;
}
.filter-chip:not(.active) .chip-count {
  background: var(--paper-deep); color: var(--muted);
}

.mailbox-list {
  background: var(--paper); border: 1px solid var(--hairline);
  overflow: hidden;
}
.mailbox-item {
  display: grid; grid-template-columns: 44px 1fr auto auto;
  gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--hairline);
  cursor: pointer; transition: all 0.15s; align-items: center;
  position: relative; text-decoration: none; color: inherit;
}
.mailbox-item:last-child { border-bottom: 0; }
.mailbox-item:hover { background: var(--paper-warm); }
.mailbox-item.unread { background: rgba(201,162,77,.04); }
.mailbox-item.unread::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--gold);
}
.mailbox-item.unread .mail-subject { font-weight: 600; color: var(--navy); }
.mail-sender-icon {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--paper-deep); color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Fraunces', serif; font-size: 17px; font-weight: 500;
  flex-shrink: 0; border: 1px solid var(--hairline);
}
.mail-content { min-width: 0; }
.mail-top-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 4px;
  flex-wrap: wrap;
}
.mail-sender {
  font-weight: 500; font-size: 14px; color: var(--ink);
}
.mail-subject {
  font-size: 14px; color: var(--muted); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mail-meta-cell {
  text-align: right; min-width: 100px;
}
.mail-date {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px;
  color: var(--muted); letter-spacing: 0.05em;
}
.mail-pages {
  font-size: 11px; color: var(--muted-soft); margin-top: 2px;
  font-family: 'IBM Plex Mono', monospace; letter-spacing: 0.05em;
}
.mail-arrow {
  color: var(--muted-soft); transition: all 0.2s; flex-shrink: 0;
}
.mailbox-item:hover .mail-arrow { color: var(--gold); transform: translateX(4px); }

/* ===== CATEGORY BADGES ===== */
.cat-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'IBM Plex Mono', monospace; font-size: 9px;
  letter-spacing: 0.14em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 2px; font-weight: 500;
  white-space: nowrap;
}
.cat-badge::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; flex-shrink: 0;
}
.cat-hmrc            { background: rgba(200,16,46,.10);   color: #9a0c24; }
.cat-companies-house { background: rgba(37,99,235,.10);   color: #1d4ed8; }
.cat-bank            { background: rgba(31,122,90,.10);   color: var(--success); }
.cat-legal           { background: rgba(124,58,237,.10);  color: #6d28d9; }
.cat-supplier        { background: rgba(217,119,6,.10);   color: var(--warning); }
.cat-customer        { background: rgba(13,148,136,.10);  color: #0f766e; }
.cat-insurance       { background: rgba(8,22,39,.08);     color: var(--navy); }
.cat-general         { background: rgba(104,117,133,.10); color: var(--muted); }

/* ===== DEADLINE BADGES ===== */
.deadline-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: 'IBM Plex Mono', monospace; font-size: 10px;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 4px 8px; border-radius: 2px; font-weight: 500;
}
.deadline-badge.overdue  { background: rgba(200,16,46,.12); color: #9a0c24; }
.deadline-badge.urgent   { background: rgba(217,119,6,.12); color: var(--warning); }
.deadline-badge.soon     { background: rgba(217,119,6,.08); color: var(--warning); }
.deadline-badge.upcoming { background: rgba(8,22,39,.06);   color: var(--navy); }
.deadline-badge.distant  { background: var(--paper-deep);   color: var(--muted); }

/* ===== RECEIVED DOCUMENTS LIST ===== */
.doc-list {
  background: var(--paper); border: 1px solid var(--hairline);
}
.doc-row {
  display: grid; grid-template-columns: 36px 1fr auto auto auto;
  gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--hairline);
  align-items: center;
}
.doc-row:last-child { border-bottom: 0; }
.doc-row:hover { background: var(--paper-warm); }
.doc-row.unread { background: rgba(201,162,77,.04); }
.doc-icon {
  width: 36px; height: 36px; background: var(--paper-deep);
  display: flex; align-items: center; justify-content: center;
  font-family: 'IBM Plex Mono', monospace; font-size: 10px;
  font-weight: 600; color: var(--navy); border-radius: 2px;
}
.doc-icon.pdf  { background: rgba(200,16,46,.10); color: #9a0c24; }
.doc-icon.docx { background: rgba(37,99,235,.10); color: #1d4ed8; }
.doc-icon.xlsx { background: rgba(31,122,90,.10); color: var(--success); }
.doc-icon.zip  { background: rgba(124,58,237,.10); color: #6d28d9; }
.doc-info { min-width: 0; }
.doc-name {
  font-size: 14px; font-weight: 500; color: var(--ink); margin-bottom: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.doc-row.unread .doc-name { color: var(--navy); }
.doc-meta {
  font-size: 12px; color: var(--muted);
  display: flex; gap: 10px; flex-wrap: wrap;
}
.doc-meta-action {
  font-size: 11px; padding: 3px 8px;
  font-family: 'IBM Plex Mono', monospace; letter-spacing: 0.1em;
  text-transform: uppercase; border-radius: 2px;
}
.doc-meta-action.approval { background: var(--gold-wash); color: var(--gold-deep); }
.doc-meta-action.info     { background: var(--paper-deep);  color: var(--muted); }
.doc-actions {
  display: flex; gap: 8px;
}
.doc-action-btn {
  width: 32px; height: 32px; border-radius: 2px;
  background: transparent; border: 1px solid var(--hairline);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); cursor: pointer; transition: all 0.2s;
}
.doc-action-btn:hover { background: var(--navy); border-color: var(--navy); color: var(--paper); }

/* ===== TO-UPLOAD LIST ===== */
.upload-row {
  display: grid; grid-template-columns: 44px 1fr auto auto;
  gap: 16px; padding: 22px; border-bottom: 1px solid var(--hairline);
  align-items: center; background: var(--paper);
}
.upload-row:hover { background: var(--paper-warm); }
.upload-row.uploaded { background: rgba(31,122,90,.04); }
.upload-status-icon {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--paper-deep); color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 14px;
  border: 2px dashed var(--hairline);
}
.upload-row.uploaded .upload-status-icon {
  background: var(--success); color: var(--paper);
  border: 2px solid var(--success);
}
.upload-info { min-width: 0; }
.upload-info-top {
  display: flex; align-items: center; gap: 10px; margin-bottom: 6px;
  flex-wrap: wrap;
}
.upload-name {
  font-family: 'Fraunces', serif; font-size: 16px;
  font-weight: 500; color: var(--ink);
}
.upload-row.uploaded .upload-name { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--muted-soft); text-decoration-thickness: 1px; }
.upload-note { font-size: 13px; color: var(--muted); line-height: 1.5; }
.upload-btn {
  background: var(--navy); color: var(--paper); border: 0;
  padding: 11px 20px; font-size: 13px; font-weight: 500;
  font-family: inherit; border-radius: 2px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  transition: all 0.2s; white-space: nowrap;
}
.upload-btn:hover { background: var(--gold); color: var(--navy); }
.upload-btn.uploaded {
  background: transparent; color: var(--success);
  border: 1px solid var(--success);
}
.upload-btn.uploaded:hover { background: var(--success); color: var(--paper); }

/* ===== MAILBOX ITEM DETAIL PAGE — AI summary panel ===== */
.detail-grid {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px;
  align-items: start;
}
.detail-doc-preview {
  background: var(--paper); border: 1px solid var(--hairline);
  position: sticky; top: 100px; max-height: calc(100vh - 140px);
  overflow: hidden; display: flex; flex-direction: column;
}
.detail-doc-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--hairline);
  background: var(--paper-deep); flex-shrink: 0;
}
.detail-doc-header-title {
  font-family: 'IBM Plex Mono', monospace; font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
.detail-doc-actions { display: flex; gap: 6px; }
.detail-doc-action {
  background: transparent; border: 1px solid var(--hairline);
  width: 30px; height: 30px; border-radius: 2px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); cursor: pointer; transition: all 0.2s;
}
.detail-doc-action:hover { border-color: var(--navy); color: var(--navy); }
.detail-doc-body {
  padding: 32px; overflow-y: auto; background: var(--paper-deep);
  flex: 1;
}
.detail-doc-page {
  background: var(--paper); padding: 48px 56px;
  box-shadow: 0 4px 24px rgba(8,22,39,.06);
  margin-bottom: 20px; min-height: 500px;
  font-family: 'Times New Roman', serif; font-size: 14px;
  line-height: 1.6; color: #222;
}
.detail-doc-page .stamp {
  font-family: 'IBM Plex Mono', monospace; font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase; color: #999;
  padding-bottom: 14px; border-bottom: 1px solid #eee; margin-bottom: 24px;
}

/* AI summary side panel */
.ai-panel {
  background: var(--navy); color: var(--paper); padding: 28px;
  position: relative; overflow: hidden;
}
.ai-panel::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 3px; background: var(--gold);
}
.ai-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; padding-bottom: 18px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.ai-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'IBM Plex Mono', monospace; font-size: 10px;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold);
  font-weight: 500;
}
.ai-badge .ai-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--gold);
  box-shadow: 0 0 0 0 rgba(201, 162, 77, 0.6);
  animation: pulse 2s infinite;
}
.ai-confidence {
  font-family: 'IBM Plex Mono', monospace; font-size: 10px;
  letter-spacing: 0.1em; color: rgba(255,255,255,.5);
  text-transform: uppercase;
}
.ai-confidence strong { color: var(--gold); }

.ai-section { margin-bottom: 24px; }
.ai-section h4 {
  font-family: 'IBM Plex Mono', monospace; font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold);
  margin-bottom: 12px; font-weight: 500;
}
.ai-type {
  font-family: 'Fraunces', serif; font-size: 22px;
  font-weight: 500; color: var(--paper); margin-bottom: 12px;
  letter-spacing: -0.015em;
}
.ai-keyinfo {
  display: grid; gap: 0;
  border: 1px solid rgba(255,255,255,.12);
}
.ai-keyinfo-row {
  display: grid; grid-template-columns: 1fr 1fr;
  padding: 10px 14px; gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  font-size: 13px;
}
.ai-keyinfo-row:last-child { border-bottom: 0; }
.ai-keyinfo-row .k {
  color: rgba(255,255,255,.55);
  font-family: 'IBM Plex Mono', monospace; font-size: 11px;
  letter-spacing: 0.05em;
}
.ai-keyinfo-row .v { color: var(--paper); font-weight: 500; }

.ai-points {
  list-style: none; padding: 0; display: grid; gap: 10px;
}
.ai-points li {
  position: relative; padding-left: 20px;
  font-size: 13px; line-height: 1.6; color: rgba(255,255,255,.85);
}
.ai-points li::before {
  content: ''; position: absolute; left: 0; top: 9px;
  width: 8px; height: 1px; background: var(--gold);
}

.ai-recommended {
  background: rgba(201,162,77,.10);
  border-left: 3px solid var(--gold);
  padding: 14px 18px; margin-top: 8px;
}
.ai-recommended-label {
  font-family: 'IBM Plex Mono', monospace; font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold);
  margin-bottom: 6px;
}
.ai-recommended-text {
  font-size: 13px; line-height: 1.6; color: var(--paper);
}

.ai-actions {
  margin-top: 24px; padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,.12);
  display: grid; gap: 10px;
}
.ai-action-btn {
  background: transparent; color: var(--paper);
  border: 1px solid rgba(255,255,255,.2); padding: 12px;
  font-family: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: space-between;
  border-radius: 2px;
}
.ai-action-btn:hover { background: var(--gold); color: var(--navy); border-color: var(--gold); }
.ai-action-btn.primary { background: var(--gold); color: var(--navy); border-color: var(--gold); }
.ai-action-btn.primary:hover { background: var(--gold-light); }

/* ===== DETAIL PAGE HEADER ===== */
.detail-header {
  display: flex; gap: 24px; align-items: flex-start;
  padding-bottom: 24px; margin-bottom: 28px;
  border-bottom: 1px solid var(--hairline);
}
.detail-back {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--muted); font-size: 13px; text-decoration: none;
  transition: color 0.2s; padding: 6px 0;
}
.detail-back:hover { color: var(--ink); }
.detail-title-block { flex: 1; min-width: 0; }
.detail-meta-line {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-bottom: 12px; font-size: 13px; color: var(--muted);
}
.detail-meta-line .dot { width: 3px; height: 3px; background: var(--muted-soft); border-radius: 50%; }
.detail-title {
  font-family: 'Fraunces', serif; font-size: clamp(24px, 3vw, 36px);
  line-height: 1.15; letter-spacing: -0.02em; font-weight: 500;
  margin-bottom: 8px;
}
.detail-sender-block { font-size: 13px; color: var(--muted); }
.detail-sender-name { color: var(--ink); font-weight: 500; }

/* ===== DIRECTORS LIST (profile page) ===== */
.directors-grid {
  display: grid; gap: 16px;
}
.director-card {
  background: var(--paper); border: 1px solid var(--hairline);
  padding: 28px 32px; display: grid;
  grid-template-columns: 56px 1fr auto; gap: 20px; align-items: start;
  transition: all 0.2s;
}
.director-card:hover { border-color: var(--navy); }
.director-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--navy); color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Fraunces', serif; font-size: 22px; font-weight: 500;
}
.director-info {}
.director-name-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 6px;
}
.director-name {
  font-family: 'Fraunces', serif; font-size: 22px; font-weight: 500;
  letter-spacing: -0.015em;
}
.director-roles {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.role-pill {
  font-family: 'IBM Plex Mono', monospace; font-size: 9px;
  letter-spacing: 0.14em; text-transform: uppercase; font-weight: 500;
  padding: 3px 8px; border-radius: 2px;
}
.role-director    { background: var(--gold-wash); color: var(--gold-deep); }
.role-shareholder { background: rgba(8,22,39,.08); color: var(--navy); }
.role-psc         { background: rgba(124,58,237,.10); color: #6d28d9; }
.director-sub {
  font-size: 13px; color: var(--muted); margin-bottom: 18px;
}
.director-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 32px;
  font-size: 13px;
}
.director-grid > div { min-width: 0; }
.director-field-label {
  font-family: 'IBM Plex Mono', monospace; font-size: 10px;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 4px;
}
.director-field-value {
  color: var(--ink); word-break: break-word;
}
.director-aml {
  text-align: right;
}
.aml-status {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(31,122,90,.08); color: var(--success);
  padding: 6px 10px; font-family: 'IBM Plex Mono', monospace;
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  font-weight: 500; border-radius: 2px;
}
.aml-status::before {
  content: '✓'; font-weight: 700;
}
.director-aml-meta {
  margin-top: 8px; font-size: 11px; color: var(--muted);
  font-family: 'IBM Plex Mono', monospace; letter-spacing: 0.05em;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 980px) {
  .dash-tiles { grid-template-columns: repeat(2, 1fr); }
  .mailbox-item { grid-template-columns: 44px 1fr auto; }
  .mailbox-item .mail-arrow { display: none; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-doc-preview { position: static; max-height: none; }
  .director-card { grid-template-columns: 1fr; }
  .director-aml { text-align: left; }
}
@media (max-width: 600px) {
  .dash-tiles { grid-template-columns: 1fr; }
  .doc-row { grid-template-columns: 36px 1fr; }
  .doc-row > *:nth-child(n+3) { grid-column: 2; padding-top: 4px; }
  .upload-row { grid-template-columns: 44px 1fr; }
  .upload-row > *:nth-child(n+3) { grid-column: 2; }
  .director-grid { grid-template-columns: 1fr; }
}

/* =================================================================
   SIDEBAR SUB-NAV (Documents has sub-items)
   ================================================================= */
.sidebar-nav .sub-nav {
  list-style: none; padding: 4px 0 8px;
  margin-left: 32px; border-left: 1px solid rgba(255,255,255,.10);
  margin-top: 4px; margin-bottom: 4px;
}
.sidebar-nav .sub-nav li { margin: 0; }
.sidebar-nav .sub-nav a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 14px; color: rgba(255,255,255,.55);
  font-size: 13px; transition: all 0.15s; gap: 8px;
  position: relative;
}
.sidebar-nav .sub-nav a::before {
  content: ''; position: absolute; left: -1px; top: 50%;
  width: 8px; height: 1px; background: rgba(255,255,255,.15);
  transform: translateY(-50%);
}
.sidebar-nav .sub-nav a:hover { color: rgba(255,255,255,.9); }
.sidebar-nav .sub-nav a.active {
  color: var(--gold); font-weight: 500;
}
.sidebar-nav .sub-nav a.active::before { background: var(--gold); }
.sidebar-nav .sub-nav .badge {
  font-size: 9px; padding: 1px 6px; background: rgba(255,255,255,.10);
  color: rgba(255,255,255,.7); border-radius: 8px;
  font-family: 'IBM Plex Mono', monospace;
}
.sidebar-nav .sub-nav a.active .badge {
  background: var(--gold); color: var(--navy);
}

/* Parent item — pad slightly less when sub-nav is below */
.sidebar-nav > li.has-sub > a { padding-bottom: 6px; }

/* =================================================================
   STATUTORY DEADLINES LIST (documents dashboard)
   ================================================================= */
.deadlines-grid {
  display: grid; gap: 12px;
}
.deadline-card {
  background: var(--paper); border: 1px solid var(--hairline);
  padding: 18px 22px; display: grid;
  grid-template-columns: auto 1fr auto auto; gap: 18px; align-items: center;
  transition: all 0.2s;
}
.deadline-card:hover { border-color: var(--navy); }
.deadline-card.overdue { border-left: 3px solid var(--error); }
.deadline-card.urgent  { border-left: 3px solid var(--warning); }
.deadline-card.soon    { border-left: 3px solid var(--gold); }

.deadline-icon {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--paper-deep); color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  font-family: 'IBM Plex Mono', monospace; font-size: 11px;
  font-weight: 600; letter-spacing: 0.04em;
}
.deadline-info { min-width: 0; }
.deadline-label {
  font-family: 'Fraunces', serif; font-size: 16px;
  font-weight: 500; color: var(--ink); margin-bottom: 4px;
  letter-spacing: -0.015em;
}
.deadline-sub {
  font-size: 12px; color: var(--muted);
  display: flex; gap: 10px; flex-wrap: wrap;
}
.deadline-handler {
  font-family: 'IBM Plex Mono', monospace; font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 4px 8px; border-radius: 2px;
  background: var(--gold-pale); color: var(--gold-deep);
}
.status-pill {
  font-family: 'IBM Plex Mono', monospace; font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 2px; font-weight: 500;
}
.status-pending     { background: var(--paper-deep);          color: var(--muted); }
.status-in-progress { background: rgba(217,119,6,.10);        color: var(--warning); }
.status-filed       { background: rgba(31,122,90,.10);        color: var(--success); }
.status-overdue     { background: rgba(200,16,46,.10);        color: var(--error); }

/* =================================================================
   COMPLIANCE / DOCUMENT REQUESTS — split two-column layout
   ================================================================= */
.split-section {
  display: grid; grid-template-columns: 1fr 1fr; gap: 28px;
  margin-bottom: 32px;
}
.split-col h3 {
  font-family: 'Fraunces', serif; font-size: 20px;
  font-weight: 500; letter-spacing: -0.02em; margin-bottom: 6px;
}
.split-col .col-sub {
  font-size: 13px; color: var(--muted); margin-bottom: 18px;
}

@media (max-width: 980px) {
  .split-section { grid-template-columns: 1fr; }
  .deadline-card { grid-template-columns: auto 1fr; }
  .deadline-card > *:nth-child(n+3) { grid-column: 2; }
}

/* =================================================================
   MAIL ATTACHMENT BADGE (mailbox-item.html)
   ================================================================= */
.mail-attachment {
  display: flex; gap: 14px; align-items: center;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.10);
  padding: 14px 16px; margin-top: 18px; border-radius: 2px;
}
.mail-attachment-icon {
  width: 36px; height: 36px; flex-shrink: 0;
  background: rgba(200,16,46,.12); color: #fda4af;
  display: flex; align-items: center; justify-content: center;
  font-family: 'IBM Plex Mono', monospace; font-size: 10px;
  font-weight: 600; border-radius: 2px;
}
.mail-attachment-info { flex: 1; min-width: 0; }
.mail-attachment-name {
  font-size: 13px; color: var(--paper); font-weight: 500;
  word-break: break-all; line-height: 1.4;
}
.mail-attachment-meta {
  font-size: 11px; color: rgba(255,255,255,.5);
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: 0.04em; margin-top: 4px;
}
.mail-attachment-action {
  background: transparent; color: var(--gold);
  border: 1px solid var(--gold); padding: 8px 14px;
  font-family: inherit; font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all 0.2s; border-radius: 2px;
  white-space: nowrap;
}
.mail-attachment-action:hover { background: var(--gold); color: var(--navy); }
