@font-face {
  font-family: 'Nexus Sans';
  src: url('/fonts/nexus-sans.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --brand-accent: #c9a84c;
  --red: var(--brand-accent);
  --red-dark: #e0c679;
  --red-hover: #e0c679;
  --red-soft: #30291a;
  --wine: #000;
  --wine-light: #1d1d1d;
  --wine-active: #c9a84c;
  --ink: #f5f5f3;
  --text: #deded9;
  --muted: #b3b3ad;
  --surface: #161616;
  --background: #0b0b0b;
  --canvas: #0b0b0b;
  --surface-soft: #202020;
  --line: #353535;
  --control-line: #70706b;
  --focus: #e0c679;
  --focus-ring: #c9a84c40;
  --font-body: 'Nexus Sans', sans-serif;
  --font-heading: 'Nexus Sans', sans-serif;
  --nav-text: #deded9;
  --nav-muted: #b3b3ad;
  --nav-line: #353535;
  --gold: #c9a84c;
  --gold-ink: #e0c679;
  --gold-soft: #30291a;
  --danger: #f3aaa3;
  --danger-soft: #361c1b;
  --success: #a6dcbb;
  --success-soft: #193123;
  --track: #303030;
  --progress-light: #c9a84c;
  --progress-mid: #e0c679;
  --brand-shadow: #0000;
  --shadow: #0000;
  --deep-shadow: #0006;
}
body { font-family: var(--font-body); font-size: 14px; background: var(--background); line-height: 1.55; caret-color: var(--focus); }
h1, h2, h3, .brand { font-family: var(--font-heading); letter-spacing: -.025em; }
h1 { font-size: 30px; font-weight: 650; }
h2 { font-size: 18px; font-weight: 650; }
a { text-underline-offset: 4px; }
::selection { background: var(--brand-accent); color: #14120b; }
*:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
* { scrollbar-color: #77766e #202020; scrollbar-width: thin; }
.ui-icon { width: 20px; height: 20px; flex-shrink: 0; }
.sidebar { width: 248px; background: #000; color: var(--nav-text); padding: 0 0 20px; z-index: 30; }
.main-area { margin-left: 248px; width: calc(100% - 248px); }
.nexus-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 13px; padding: 28px 27px 27px; line-height: 1.2; letter-spacing: 0; color: var(--ink); }
.nexus-logo { display: block; width: 182px; height: auto; aspect-ratio: 2129 / 1067; object-fit: contain; }
.nexus-brand-caption strong { font-size: 14px; font-weight: 650; letter-spacing: -.02em; }
.nexus-brand-caption small { display: block; margin-top: 6px; font-family: var(--font-body); font-size: 11px; font-weight: 400; letter-spacing: 0; color: var(--nav-muted); }
.sidebar nav { padding: 0 14px; }
.nav-link { display: flex; align-items: center; gap: 13px; min-height: 45px; padding: 11px 13px; border-radius: 8px; font-size: 13px; color: var(--nav-text); margin: 3px 0; }
.nav-link.active, .nav-link:hover:not(.nav-disabled).active { background: var(--brand-accent); color: #14120b; font-weight: 650; }
.nav-link:not(.active):hover { background: #242424; color: var(--ink); }
.nav-caption { color: var(--nav-muted); font-size: 11px; letter-spacing: .025em; padding-left: 27px; text-transform: none; }
.nav-caption-lower { margin-top: 31px; }
.sidebar-bottom { color: var(--nav-text); font-size: 11px; padding: 20px; line-height: 1.6; }
.sidebar-bottom small { display: block; clear: both; color: var(--nav-muted); letter-spacing: .05em; font-size: 10px; margin-top: 9px; }
.status-light { background: var(--brand-accent); }
.topbar { background: #101010; border-bottom: 1px solid var(--line); height: 76px; padding: 0 36px; }
.breadcrumb { font-size: 12px; }
.breadcrumb strong { font-weight: 650; }
.avatar { background: var(--red-soft); color: var(--gold-ink); }
.logout { font-size: 12px; color: var(--muted); }
.content { padding: 34px 36px 64px; max-width: 1600px; margin: auto; }
.page-heading { margin-bottom: 28px; }
.page-heading p, .muted { font-size: 13px; color: var(--muted); }
.panel, .metric-card, .summary-card { border: 1px solid var(--line); box-shadow: none; border-radius: 12px; }
.metric-card strong { font-family: var(--font-body); font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.025em; }
.metric-card small { font-size: 11px; }
.metric-top span:first-child { font-size: 12px; }
.metric-icon { display: none !important; }
.step-list strong { color: var(--ink); }
.button { font-family: var(--font-body); min-height: 42px; font-size: 12px; gap: 9px; border-radius: 8px; }
.button.primary { background: var(--brand-accent); border-color: var(--brand-accent); color: #14120b; box-shadow: none; }
.button.primary:hover { background: var(--red-hover); border-color: var(--red-hover); }
.button.secondary { background: var(--surface); color: var(--text); border-color: var(--control-line); }
.button.secondary:hover { background: #292929; }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button .ui-icon { width: 18px; height: 18px; }
.field label, .form-stack label { font-size: 12px; line-height: 1.45; }
.field input, .field select, .field textarea { font-family: var(--font-body); font-size: 13px; border-radius: 7px; min-height: 43px; border-color: var(--control-line); background: var(--surface); color: var(--ink); }
.field textarea { padding: 12px; min-height: 100px; }
.field input[type=color] { padding: 5px; max-width: 180px; }
.field small, .filter-help { font-size: 11px; color: var(--muted); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input[type=checkbox] { accent-color: var(--brand-accent); }
td, th { font-size: 12px; font-variant-numeric: tabular-nums; }
th { color: var(--muted); }
td strong, .contact-name { color: var(--ink); }
table tbody tr:hover { background: #202020; }
.tag { font-size: 11px; }
.alert { border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); color: var(--text); font-size: 13px; }
.alert.error { border-color: #804e48; background: var(--danger-soft); color: var(--danger); }
.alert.success { border-color: #426d51; background: var(--success-soft); color: var(--success); }
.contact-tabs { font-size: 13px; }
.additional-heading { margin-top: 32px; }
.detail-grid strong { overflow-wrap: anywhere; }
.reply-action-row { display: grid; grid-template-columns: 120px 1fr 160px; gap: 12px; padding: 20px 0; border-top: 1px solid var(--line); }
.reply-action-row .reply-text { grid-column: 1 / 3; }
.reply-action-row .reply-image { grid-column: 3; }
.skip-link { position: fixed; top: -70px; left: 18px; background: var(--brand-accent); padding: 12px; z-index: 100; color: #14120b; }
.skip-link:focus { top: 12px; }
.sidebar-close, .menu-toggle { color: inherit; background: transparent; border: 0; }
.sidebar-close { display: none; }
.menu-backdrop { display: none; }
.menu-open .menu-backdrop { display: block; position: fixed; inset: 0; background: #0009; border: 0; z-index: 29; }
.nexus-login { background: var(--background); min-height: 100vh; }
.login-layout { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.login-story { background: #000; color: var(--ink); padding: 25px 7vw 24px; display: flex; flex-direction: column; justify-content: space-between; }
.login-story .nexus-brand { padding: 10px 0; }
.login-story .nexus-logo { width: 216px; }
.login-story-copy { padding: 46px 0 65px; }
.login-story h1 { font-size: clamp(36px, 4.2vw, 61px); line-height: 1.13; font-weight: 550; color: var(--ink); letter-spacing: -.035em; margin-bottom: 29px; max-width: 14ch; }
.login-story-copy > p { font-size: 15px; color: var(--text); line-height: 1.8; max-width: 40ch; }
.login-flow { list-style: none; padding: 29px 0 0; margin: 0; display: flex; flex-direction: column; gap: 17px; font-size: 13px; color: var(--text); }
.login-flow li { display: flex; align-items: center; gap: 13px; }
.login-story-footer { font-size: 11px; color: var(--muted); margin-bottom: 12px; }
.login-entry { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 40px; position: relative; }
.login-entry-content { width: 100%; max-width: 352px; }
.login-entry h2 { font-size: 27px; font-weight: 650; margin-bottom: 11px; }
.login-entry-content > p { font-size: 13px; color: var(--muted); margin-bottom: 33px; }
.login-entry-form { display: flex; flex-direction: column; gap: 21px; }
.login-entry-form .button { width: 100%; justify-content: space-between; padding: 12px 17px; min-height: 48px; }
.login-entry-note { display: flex; justify-content: center; align-items: center; gap: 8px; font-size: 11px !important; margin-top: 27px; }
.login-entry-note .ui-icon { width: 14px; height: 14px; }
.login-bottom { position: absolute; bottom: 28px; font-size: 11px; color: var(--muted); }
.import-progress progress { width: 100%; accent-color: var(--brand-accent); display: block; margin: 12px 0 5px; }
.table-panel > .filter-help, .table-panel > .muted, .table-panel > .contact-history-legend { padding: 18px 20px; margin: 0; }
table:has(.empty-table) { min-width: 100% !important; width: 100%; }
table:has(.empty-table) thead { display: none; }
table:has(.empty-table) .empty-table { white-space: normal; font-size: 12px; padding: 32px 20px; text-align: center; }
code { overflow-wrap: anywhere; white-space: normal; }
[data-range] label { min-height: 36px; display: flex; align-items: flex-end; }
[data-range] .field { min-width: 0; }
@media (max-width: 1100px) {
  .content { padding: 30px 24px 50px; }
  .topbar { padding: 0 24px; }
  .login-story { padding-left: 5vw; padding-right: 5vw; }
}
@media (max-width: 760px) {
  .main-area { margin-left: 0; width: 100%; }
  .sidebar-close { display: block; position: absolute; right: 10px; top: 10px; padding: 7px; }
  .menu-toggle { display: block; color: var(--ink); padding: 7px; }
  .topbar { height: 64px; padding: 0 16px; }
  .breadcrumb { font-size: 11px; }
  .breadcrumb strong, .breadcrumb > span { display: none; }
  .content { padding: 26px 16px 50px; }
  .page-heading h1 { font-size: 26px; }
  .login-layout { grid-template-columns: 1fr; }
  .login-story { padding: 14px 25px 0; }
  .login-story .nexus-brand { padding: 10px 0 25px; flex-direction: row; align-items: center; gap: 22px; }
  .login-story .nexus-logo { width: 126px; }
  .login-story .nexus-brand-caption strong { font-size: 13px; }
  .login-story .nexus-brand-caption small { font-size: 10px; }
  .login-story-copy { padding: 10px 0 30px; }
  .login-story h1 { font-size: 35px; max-width: none; margin-bottom: 16px; }
  .login-story h1 br:nth-child(2) { display: none; }
  .login-story-copy > p { font-size: 13px; max-width: 46ch; }
  .login-flow, .login-story-footer { display: none; }
  .login-entry { padding: 38px 25px 68px; min-height: 440px; }
  .login-entry h2 { font-size: 24px; }
  .login-bottom { bottom: 18px; }
  .reply-action-row { grid-template-columns: 1fr 1fr; }
  .reply-action-row .reply-text, .reply-action-row .reply-image, .reply-action-row .field:first-child { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .dashboard-metrics, .message-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
  .dashboard-metrics .metric-card { min-height: 130px; padding: 16px; }
  .message-metrics .metric-card { padding: 16px; }
  .metric-card strong { font-size: 27px; }
  .dashboard-details .panel { min-height: 180px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
