:root {
  --ink: #081B36;
  --ink-2: #11264a;
  --ink-3: #1b3056;
  --current: #0090FD;
  --current-2: #0078d6;
  --paper: #ffffff;
  --paper-2: #F5F7FA;
  --mist: #E4F0FF;
  --white: #fff;
  --slate: #5A6B85;
  --pebble: #8A98AC;
  --sand: #CBD5E1;
  --rf-accent: #B98948;
  --rf-sage: #6F8B7A;
  --amber: #F2B441;
  --coral: #FF7849;

  --bg: var(--paper);
  --bg-2: var(--paper-2);
  --surface: #FAFBFC;
  --fg: var(--ink);
  --fg-soft: rgba(8, 27, 54, 0.62);
  --fg-faint: rgba(8, 27, 54, 0.38);
  --rule: rgba(8, 27, 54, 0.08);
  --rule-soft: rgba(8, 27, 54, 0.04);
  --hairline: rgba(8, 27, 54, 0.85);

  --font-display: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --r-1: 4px;
  --r-2: 8px;
  --r-3: 12px;
  --r-pill: 999px;
}

* { box-sizing: border-box }
html, body { margin: 0; padding: 0 }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'ss01', 'cv11';
}
button, input, select, textarea { font: inherit; color: inherit }
button { cursor: pointer; background: none; border: 0; padding: 0 }
a { color: inherit; text-decoration: none }
::selection { background: var(--current); color: #fff }

/* Typography */
.mono { font-family: var(--font-mono); font-feature-settings: 'tnum', 'ss01' }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.h1 { font-family: var(--font-display); font-weight: 600; font-size: 34px; line-height: 1.05; letter-spacing: -.02em; margin: 0 }
.h2 { font-family: var(--font-display); font-weight: 600; font-size: 22px; line-height: 1.15; letter-spacing: -.015em; margin: 0 }
.h3 { font-family: var(--font-display); font-weight: 500; font-size: 17px; line-height: 1.2; letter-spacing: -.01em; margin: 0 }
.num { font-family: var(--font-display); font-weight: 500; letter-spacing: -.02em; font-feature-settings: 'tnum' }
.muted { color: var(--fg-soft) }
.faint { color: var(--fg-faint) }

/* Login */
.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  background: var(--bg);
}
@media (min-width: 900px) { .login { grid-template-columns: 1.1fr 1fr } }

.login-aside {
  background: var(--ink);
  color: #EEF3FB;
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
@media (min-width: 900px) { .login-aside { padding: 48px 56px } }
.login-aside .mark { display: flex; align-items: center; gap: 10px; position: relative; z-index: 1 }
.login-aside .mark img { width: 32px; height: 32px; filter: brightness(0) invert(1) }
.login-aside .mark span { font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; font-size: 17px }
.login-aside .pitch {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -.025em;
  font-size: clamp(36px, 6vw, 64px);
  line-height: .98;
  margin: 0;
  max-width: 14ch;
  position: relative;
  z-index: 1;
}
.login-aside .pitch em { font-style: normal; color: var(--current) }
.login-aside .meta {
  display: flex;
  gap: 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: rgba(238, 243, 251, .6);
  position: relative;
  z-index: 1;
  flex-wrap: wrap;
}
.login-aside .meta b { color: #fff; font-weight: 500 }
.login-aside::after {
  content: "";
  position: absolute;
  right: -120px;
  top: -80px;
  width: 540px;
  height: 540px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, rgba(0, 144, 253, .35), transparent 60%);
  pointer-events: none;
}

.login-main {
  padding: 48px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
@media (min-width: 900px) { .login-main { padding: 56px } }
.login-form { width: 100%; max-width: 380px }
.login-form .eyebrow { margin-bottom: 10px; display: inline-flex }
.login-form .eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
  display: inline-block;
  margin-right: 8px;
  opacity: .6;
  vertical-align: middle;
}
.login-form h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 38px;
  line-height: 1;
  letter-spacing: -.025em;
  margin: 0 0 28px;
}

/* Inputs */
.field { margin: 0 }
.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: 6px;
}
.field-hint { font-size: 12px; color: var(--fg-soft); margin-top: 6px }
.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--rule);
  background: var(--surface);
  border-radius: var(--r-2);
  padding: 0 14px;
  height: 44px;
  font-size: 14.5px;
  outline: 0;
  transition: border-color .15s, background .15s;
}
.textarea {
  padding: 12px 14px;
  height: auto;
  min-height: 96px;
  resize: vertical;
  line-height: 1.5;
  font-family: var(--font-body);
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--ink); background: var(--white) }
.input::placeholder, .textarea::placeholder { color: var(--fg-faint) }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23081B36' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--r-2);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -.005em;
  border: 1px solid transparent;
  transition: transform .12s, background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) }
.btn-primary { background: var(--ink); color: #fff; border-color: var(--ink) }
.btn-primary:hover { background: var(--ink-2); border-color: var(--ink-2) }
.btn-current { background: var(--current); color: #fff; border-color: var(--current) }
.btn-current:hover { background: var(--current-2); border-color: var(--current-2) }
.btn-secondary { border-color: var(--hairline); color: var(--fg); background: transparent }
.btn-secondary:hover { background: var(--white) }
.btn-ghost { color: var(--fg); background: transparent }
.btn-ghost:hover { background: var(--rule-soft) }
.btn-danger { color: var(--coral); border: 1px solid var(--rule); background: transparent }
.btn-block { width: 100% }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: var(--r-2) }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px }
.btn .ico { display: inline-flex }

/* App shell */
.app { min-height: 100vh; display: grid; grid-template-rows: auto 1fr }
.app-shell { display: grid; grid-template-columns: 1fr; min-height: 0 }
@media (min-width: 900px) {
  .app-shell { grid-template-columns: 240px 1fr }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in oklab, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule);
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  height: 60px;
}
@media (min-width: 900px) { .topbar-inner { padding: 12px 28px } }
.topbar .brand { display: flex; align-items: center; gap: 8px; min-width: 0 }
.topbar .brand img { width: 24px; height: 24px }
.topbar .brand .name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15.5px;
  letter-spacing: -.01em;
  white-space: nowrap;
}
.topbar .brand .sub {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--fg-faint);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-left: 6px;
  padding-left: 10px;
  border-left: 1px solid var(--rule);
}
.topbar .grow { flex: 1 }
.topbar .top-actions { display: flex; align-items: center; gap: 6px }

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--rule);
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--fg-soft);
  background: var(--surface);
}
.role-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--current) }
.role-badge.admin .dot { background: var(--ink) }

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border: 1px solid var(--rule);
  border-radius: var(--r-pill);
  height: 36px;
  background: var(--surface);
}
.user-chip .avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 500;
}
.user-chip .who { font-size: 13px; line-height: 1; font-weight: 500 }
.user-chip .who small {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--fg-soft);
  font-family: var(--font-mono);
  letter-spacing: .04em;
}
@media (max-width: 720px) {
  .user-chip .who { display: none }
}

.hamburger {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: var(--r-2);
  border: 1px solid var(--rule);
  background: var(--surface);
  align-items: center;
  justify-content: center;
}
@media (max-width: 899px) { .hamburger { display: inline-flex } }

/* Sidebar */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--rule);
  padding: 24px 14px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
}
@media (max-width: 899px) {
  .sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    height: auto;
    width: 280px;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: 0 12px 32px rgba(8, 27, 54, .12);
    padding: 18px 14px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .sidebar.open { transform: translateX(0) }
  .sidebar .sidebar-foot { margin-top: 24px; flex-shrink: 0; padding-bottom: 24px }
  body.menu-open { overflow: hidden }
}
.nav-section { margin-bottom: 18px }
.nav-section .label { padding: 0 12px; margin-bottom: 6px }
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--r-2);
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-soft);
  transition: background .12s, color .12s;
  margin-bottom: 1px;
}
.nav-link:hover { background: var(--rule-soft); color: var(--fg) }
.nav-link.active { background: var(--ink); color: #fff }
.nav-link.active .nav-ico { color: #fff }
.nav-link .nav-ico { width: 16px; height: 16px; color: var(--fg-faint); flex: 0 0 auto }
.nav-link .nav-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10.5px;
  background: var(--rule-soft);
  color: var(--fg-soft);
  padding: 1px 7px;
  border-radius: var(--r-pill);
  letter-spacing: .04em;
}
.nav-link.active .nav-count { background: rgba(255, 255, 255, .16); color: #fff }
.sidebar-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-faint);
  letter-spacing: .04em;
  padding-left: 12px;
}
.sidebar-foot a { color: var(--fg-soft) }
.sidebar-foot a:hover { color: var(--current) }

/* Main / page */
.main { min-width: 0; min-height: calc(100vh - 60px); overflow-x: hidden }
.page { max-width: 1240px; margin: 0 auto; padding: 24px 16px 72px; overflow-x: hidden }
@media (min-width: 900px) { .page { padding: 32px 32px 96px } }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.page-head h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 32px;
  line-height: 1.05;
  letter-spacing: -.022em;
  margin: 0;
}
.page-head .crumbs {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-faint);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.page-head .crumbs a:hover { color: var(--current) }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-3);
  padding: 20px;
}
.card.tight { padding: 16px }
.card.ink { background: var(--ink); color: #EEF3FB; border-color: var(--ink-2) }
.card.ink .muted { color: rgba(238, 243, 251, .6) }
.card.ink .label { color: rgba(238, 243, 251, .5) }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.card-head h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: -.005em;
  margin: 0;
}
.card-head .right { display: flex; gap: 6px; align-items: center }

/* Grids */
.grid { display: grid; gap: 14px }
.grid-2 { grid-template-columns: 1fr }
.grid-3 { grid-template-columns: 1fr }
.grid-4 { grid-template-columns: repeat(2, 1fr) }
.grid-12 { grid-template-columns: 1fr }
@media (min-width: 700px) {
  .grid-2 { grid-template-columns: 1fr 1fr }
  .grid-3 { grid-template-columns: repeat(3, 1fr) }
  .grid-4 { grid-template-columns: repeat(4, 1fr) }
}
@media (min-width: 1024px) {
  .grid-12 { grid-template-columns: 2fr 1fr }
}

/* Stat tile */
.stat {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-3);
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
}
.stat .label { margin-bottom: 2px }
.stat .v {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 30px;
  line-height: 1;
  letter-spacing: -.022em;
  font-feature-settings: 'tnum';
}
.stat .delta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-soft);
  letter-spacing: .04em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.stat .delta.up { color: var(--rf-sage) }
.stat .delta.down { color: var(--coral) }
.stat .spark { position: absolute; right: 14px; bottom: 12px; opacity: .55 }

/* Pull row */
.pull-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--rule);
  background: var(--surface);
  border-radius: var(--r-3);
}
.pull-row .field { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 }
.pull-row .field .label { margin: 0 }
.pull-row .field .v { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.pull-row .v-mono { font-family: var(--font-mono); font-size: 13px }

/* Status pill */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  background: var(--rule-soft);
  color: var(--fg-soft);
  white-space: nowrap;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: 0 0 auto }
.pill.live { background: rgba(111, 139, 122, .16); color: #3a5a48 }
.pill.maint { background: rgba(242, 180, 65, .18); color: #8a5d10 }
.pill.overdue, .pill.danger { background: rgba(255, 120, 73, .16); color: #c4451b }
.pill.progress { background: rgba(0, 144, 253, .12); color: var(--current-2) }
.pill.done { background: rgba(111, 139, 122, .16); color: #3a5a48 }
.pill.submitted { background: rgba(90, 107, 133, .16); color: var(--slate) }
.pill.paid { background: rgba(111, 139, 122, .16); color: #3a5a48 }
.pill.draft { background: rgba(8, 27, 54, .06); color: var(--fg-soft) }
.pill.scheduled { background: rgba(0, 144, 253, .12); color: var(--current-2) }

/* Table */
.table-wrap {
  border: 1px solid var(--rule);
  border-radius: var(--r-3);
  background: var(--surface);
  overflow: hidden;
}
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px }
table.tbl thead th {
  text-align: left;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fg-faint);
  padding: 14px 16px;
  border-bottom: 1px solid var(--rule);
  background: var(--bg-2);
}
table.tbl tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
}
table.tbl tbody tr:last-child td { border-bottom: 0 }
table.tbl tbody tr { cursor: pointer; transition: background .12s }
table.tbl tbody tr:hover { background: var(--bg-2) }
table.tbl .num-c { font-family: var(--font-mono); font-feature-settings: 'tnum'; white-space: nowrap }
table.tbl .name-c { font-weight: 500 }
table.tbl .name-c small {
  display: block;
  font-weight: 400;
  color: var(--fg-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .02em;
  margin-top: 2px;
}
.table-wrap.scroll { overflow-x: auto }
.table-wrap.scroll table { min-width: 720px }

/* Chart */
.chart { display: block; width: 100%; height: auto; overflow: visible }
.chart .axis { stroke: var(--rule); stroke-width: 1 }
.chart .grid { stroke: var(--rule-soft); stroke-width: 1; stroke-dasharray: 2 4 }
.chart .axis-label { font-family: var(--font-mono); font-size: 10px; fill: var(--fg-faint); letter-spacing: .06em }
.chart .ln { fill: none; stroke: var(--current); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round }
.chart .area { fill: url(#areaGrad); opacity: .9 }
.chart .pt { fill: var(--current); stroke: var(--surface); stroke-width: 2 }

/* List */
.list { display: flex; flex-direction: column }
.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--rule);
}
.list-row:first-child { border-top: 0 }
.list-row .left { display: flex; gap: 14px; align-items: center; min-width: 0; flex: 1 }
.list-row .meta { min-width: 0 }
.list-row .ttl { font-size: 14.5px; font-weight: 500; line-height: 1.3; word-break: break-word }
.list-row .sub { font-size: 12px; color: var(--fg-soft); margin-top: 2px; font-family: var(--font-mono); letter-spacing: .02em }

/* Form rows */
.form-grid { display: grid; gap: 14px; grid-template-columns: 1fr }
@media (min-width: 700px) { .form-grid.two { grid-template-columns: 1fr 1fr } }

/* Modal */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(8, 27, 54, .55);
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.modal {
  background: var(--bg);
  border-radius: var(--r-3);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow: auto;
  border: 1px solid var(--rule);
  box-shadow: 0 24px 60px rgba(8, 27, 54, .25);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--rule);
}
.modal-head h2 { font-family: var(--font-display); font-weight: 600; font-size: 18px; letter-spacing: -.015em; margin: 0 }
.modal-body { padding: 20px }
.modal-foot {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 14px 20px;
  border-top: 1px solid var(--rule);
  background: var(--bg-2);
}
.x-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--r-2);
  display: grid;
  place-items: center;
  color: var(--fg-soft);
}
.x-btn:hover { background: var(--rule-soft); color: var(--fg) }

/* Donut */
.donut-row { display: flex; gap: 18px; align-items: center }
.donut-legend { flex: 1; display: flex; flex-direction: column; gap: 8px; font-size: 13px }
.donut-legend .lg-row { display: flex; align-items: center; gap: 8px }
.donut-legend .swatch { width: 10px; height: 10px; border-radius: 2px }
.donut-legend .pct { margin-left: auto; font-family: var(--font-mono); color: var(--fg-soft); font-size: 12px }

/* Bars list */
.bars-list { display: flex; flex-direction: column; gap: 10px }
.bars-list .br { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px }
.bars-list .br .ttl { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.bars-list .br .num { font-family: var(--font-mono); font-size: 12px; color: var(--fg-soft); white-space: nowrap }
.bars-list .br .bg { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--rule-soft); overflow: hidden; margin-top: -2px }
.bars-list .br .bg .fil { height: 100%; background: var(--ink); border-radius: 3px }

/* KV */
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 10px 18px; font-size: 14px }
.kv dt { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-faint); padding-top: 2px }
.kv dd { margin: 0; color: var(--fg) }
@media (max-width: 600px) {
  .kv { grid-template-columns: 1fr }
  .kv dt { padding-top: 6px }
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--r-pill);
  font-size: 13.5px;
  z-index: 100;
  box-shadow: 0 12px 28px rgba(8, 27, 54, .25);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  animation: tIn .25s ease-out;
}
.toast .check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--rf-sage);
  color: #fff;
  display: grid;
  place-items: center;
}
@keyframes tIn {
  from { opacity: 0; transform: translateX(-50%) translateY(8px) }
  to { opacity: 1; transform: translateX(-50%) translateY(0) }
}

/* Misc */
.divider { height: 1px; background: var(--rule); margin: 18px 0 }
.hairline-top { border-top: 1px solid var(--hairline); margin-top: 16px; padding-top: 14px }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--rule); margin-bottom: 18px; overflow-x: auto }
.tabs button {
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--fg-soft);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  border-radius: 0;
  white-space: nowrap;
}
.tabs button.active { color: var(--fg); border-bottom-color: var(--ink) }
.tabs button:hover { color: var(--fg) }

/* Empty */
.empty {
  padding: 36px 20px;
  text-align: center;
  color: var(--fg-soft);
  border: 1px dashed var(--rule);
  border-radius: var(--r-3);
}
.empty .h3 { margin-bottom: 6px; color: var(--fg) }

/* Device split */
.device-split { display: flex; gap: 14px; align-items: stretch }

/* Loading */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  color: var(--fg-faint);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .06em;
}

/* Check email screen */
.check-email {
  text-align: center;
  max-width: 380px;
}
.check-email .icon-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(0, 144, 253, .12);
  color: var(--current);
  display: grid;
  place-items: center;
  margin: 0 auto 20px;
}

/* File upload */
.file-drop {
  border: 2px dashed var(--rule);
  border-radius: var(--r-3);
  padding: 24px;
  text-align: center;
  color: var(--fg-faint);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.file-drop:hover,
.file-drop.dragover {
  border-color: var(--current);
  background: rgba(0, 144, 253, .04);
}
.file-drop input { display: none }
.file-drop .file-name {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  color: var(--fg-soft);
  font-weight: 500;
}

/* Mobile responsive */
html { overflow-x: hidden; width: 100%; max-width: 100vw }
body { overflow-x: hidden; width: 100%; max-width: 100vw }
.app { max-width: 100vw; overflow-x: hidden }

@media (max-width: 720px) {
  .device-split { flex-direction: column }
  .device-split > div { min-height: 80px !important; flex-direction: row !important; align-items: center !important; justify-content: space-between !important; padding: 14px 16px !important }

  /* Topbar */
  .topbar-inner { padding: 10px 12px; gap: 8px; height: 56px }
  .topbar .brand img { width: 22px; height: 22px }
  .topbar .brand .name { font-size: 14px }
  .topbar .brand .sub { display: none }
  .role-badge { display: none }
  .topbar .grow { flex: 1 1 0; min-width: 0 }
  .top-actions { flex-shrink: 0 }
  .top-actions .btn { height: 32px; padding: 0 10px; font-size: 12.5px }
  .top-actions .btn.btn-ghost.btn-sm { display: none }

  /* User chip — force 44px tap target, high z-index */
  .user-chip {
    position: relative;
    z-index: 31;
    min-width: 44px;
    min-height: 44px;
    height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    -webkit-tap-highlight-color: rgba(0,0,0,.05);
    border: 1px solid var(--rule);
    border-radius: 50%;
    background: var(--surface);
  }
  .user-chip .avatar { width: 32px; height: 32px; font-size: 12px; pointer-events: none }

  /* Sidebar */
  .sidebar {
    width: 84vw;
    max-width: 320px;
    top: 56px;
    bottom: 0;
    height: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
  }
  .sidebar .nav-section { flex-shrink: 0 }
  .sidebar .sidebar-foot {
    margin-top: 24px;
    flex-shrink: 0;
    padding-bottom: 24px;
  }
  .sidebar .nav-link {
    min-height: 44px;
    padding: 10px 12px;
  }

  /* Page & content containment */
  .main { overflow-x: hidden; max-width: 100vw; width: 100% }
  .page {
    padding: 16px 12px 80px;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-wrap: break-word;
    word-break: break-word;
  }
  .grid { gap: 10px; max-width: 100%; overflow: hidden }
  .page-head {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 18px;
    max-width: 100%;
  }
  .page-head h1 { font-size: 24px; line-height: 1.12; letter-spacing: -.02em }
  .page-head .crumbs { font-size: 10px; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }

  .page-actions {
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
  }
  .page-actions .btn { height: 36px; padding: 0 12px; font-size: 13px; flex: 1 1 auto; min-width: 0 }

  /* Stat cards */
  .stat { padding: 13px 14px 12px; gap: 4px; overflow: hidden; max-width: 100% }
  .stat .v { font-size: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
  .stat .delta { font-size: 10.5px }
  .stat .spark { display: none }

  /* Cards */
  .card { padding: 14px; border-radius: 14px; overflow: hidden; max-width: 100%; box-sizing: border-box }
  .card.tight { padding: 12px }
  .card-head { margin-bottom: 12px; flex-wrap: wrap; gap: 8px 12px }
  .card-head h3 { font-size: 15px }
  .card.ink { padding: 18px }

  .pull-row { padding: 12px 14px; gap: 10px; max-width: 100%; overflow: hidden }
  .pull-row .field .v { font-size: 14px }

  .list-row { padding: 12px 0; gap: 10px; align-items: flex-start; max-width: 100% }
  .list-row .ttl { font-size: 14px }
  .list-row .sub { font-size: 11.5px }

  .kv { grid-template-columns: 1fr; gap: 4px 0 }
  .kv dt { padding-top: 10px; color: var(--fg-faint) }
  .kv dt:first-of-type { padding-top: 0 }
  .kv dd { padding-bottom: 6px; border-bottom: 1px solid var(--rule-soft); overflow: hidden; text-overflow: ellipsis }
  .kv dd:last-of-type { border-bottom: 0 }

  /* Table → card layout on mobile */
  .table-wrap, .table-wrap.scroll {
    background: transparent;
    border: 0;
    overflow: hidden;
    max-width: 100%;
  }
  .table-wrap table { min-width: 0 !important; display: block; width: 100%; max-width: 100% }
  .table-wrap thead { display: none }
  .table-wrap tbody { display: block; width: 100% }
  .table-wrap tbody tr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    padding: 13px 14px;
    margin-bottom: 8px;
    border: 1px solid var(--rule);
    background: var(--surface);
    border-radius: var(--r-3);
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }
  .table-wrap tbody tr:hover { background: var(--surface) }
  .table-wrap tbody td {
    display: inline-flex;
    align-items: center;
    padding: 0;
    border: 0;
    font-size: 13px;
    white-space: normal;
    max-width: 100%;
    overflow: hidden;
  }
  .table-wrap tbody td.name-c {
    flex: 1 1 100%;
    font-size: 14.5px;
    font-weight: 500;
    display: block;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .table-wrap tbody td.name-c small { font-size: 11.5px; margin-top: 2px; display: block; overflow: hidden; text-overflow: ellipsis }
  .table-wrap tbody td[style*="text-align:right"],
  .table-wrap tbody td[style*="text-align: right"] { text-align: left !important }

  .form-grid.two { grid-template-columns: 1fr }
  .field label { font-size: 10px }
  .input, .select, .textarea { font-size: 15px }

  .login-aside { padding: 24px 22px; min-height: auto }
  .login-aside::after { width: 300px; height: 300px; right: -90px; top: -70px }
  .login-aside .pitch { font-size: 30px; max-width: none }
  .login-aside .meta { font-size: 10.5px; gap: 14px }
  .login-main { padding: 28px 20px }
  .login-form h1 { font-size: 28px; margin-bottom: 18px }

  .modal-mask { padding: 0; align-items: flex-end }
  .modal {
    max-width: 100%;
    width: 100%;
    max-height: 92vh;
    border-radius: 18px 18px 0 0;
    animation: slideUp .22s ease-out;
  }
  .modal-head { padding: 16px 18px }
  .modal-head h2 { font-size: 16px }
  .modal-body { padding: 18px }
  .modal-foot { padding: 12px 18px; flex-direction: column-reverse; gap: 8px }
  .modal-foot .btn { width: 100% }
  @keyframes slideUp { from { transform: translateY(100%) } to { transform: translateY(0) } }

  .donut-row { flex-direction: column; align-items: stretch; gap: 14px }
  .donut-row svg { align-self: center }
  .toast { bottom: 18px; max-width: calc(100vw - 32px); font-size: 13px }
  .grid-4 { grid-template-columns: 1fr 1fr }
  .grid-3, .grid-2, .grid-12 { grid-template-columns: 1fr }

  .chart { max-width: 100%; overflow: hidden }
  svg.chart { width: 100% !important }

  /* Hamburger tap target */
  .hamburger { width: 44px; height: 44px }
}

@media (max-width: 420px) {
  .page-head h1 { font-size: 22px }
  .stat .v { font-size: 18px }
  .card-head h3 { font-size: 14px }
  .grid-4 { grid-template-columns: 1fr }
  .page-actions .btn { width: 100% }
}

/* Hidden utility */
[hidden] { display: none !important }
