:root {
  --bg: #e9eef3;
  --surface: #ffffff;
  --ink: #172033;
  --muted: #5a6a7b;
  --line: #d5dde6;
  --line-2: #c3ced9;
  --navy: #0c2340;
  --navy-2: #143356;
  --brand: #a33b16;
  --ok: #17663f;
  --ok-bg: #e7f4ec;
  --warn: #8a5800;
  --warn-bg: #f7efd9;
  --bad: #b42318;
  --bad-bg: #f8e8e6;
  --info-bg: #e8eef5;
  --sidebar: 220px;
  --font: "IBM Plex Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", ui-monospace, Menlo, monospace;
  --shadow: 0 8px 24px rgba(12, 35, 64, 0.12);
  --r: 4px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.45;
}
button, input, select, textarea { font-family: inherit; font-size: 14px; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; color: var(--ink); }
a { color: var(--navy-2); }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }

.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 300px 1fr;
}
.auth-rail {
  background: var(--navy);
  color: #d7e0ea;
  padding: 36px 28px;
  display: flex;
  flex-direction: column;
}
.auth-rail .logo { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 600; }
.auth-rail .logo span { display: block; font-size: 11px; font-weight: 500; color: #8ea0b5; letter-spacing: 0.04em; }
.auth-rail .rail-copy { margin-top: auto; font-size: 13px; color: #9aadc0; }
.auth-rail ul { margin: 18px 0 0; padding: 0; list-style: none; }
.auth-rail li {
  padding: 8px 0;
  border-top: 1px solid #1e3a58;
  color: #c5d2de;
  font-size: 13px;
}
.auth-rail .legal { margin-top: 28px; font-size: 11px; color: #7d8fa3; }
.auth-main {
  display: flex;
  flex-direction: column;
  background: var(--surface);
}
.auth-form-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 48px 56px;
}
.auth-form { width: min(380px, 100%); }
.auth-form h1 { font-size: 22px; margin-bottom: 6px; }
.auth-form .sub { color: var(--muted); margin: 0 0 28px; font-size: 13px; }
.auth-foot {
  border-top: 1px solid var(--line);
  padding: 14px 56px;
  font-size: 12px;
  color: var(--muted);
}

.logo-mark {
  width: 28px;
  height: 28px;
  background: var(--brand);
  flex-shrink: 0;
  display: grid;
  grid-template-rows: 1fr 3px 1fr 3px 1fr;
  padding: 6px 4px;
}
.logo-mark i { background: var(--navy); display: block; }

label { display: block; font-size: 12px; font-weight: 600; margin: 0 0 5px; color: var(--ink); }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line-2);
  background: #fff;
  border-radius: var(--r);
  padding: 8px 10px;
  color: var(--ink);
  min-height: 38px;
}
textarea { min-height: 88px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: #9aabbc; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(12, 35, 64, 0.12);
}
input:disabled, select:disabled, textarea:disabled { background: #f3f6f9; color: #667; }
.row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.field { margin-bottom: 14px; min-width: 0; }
.security-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}
.security-filters .field { margin-bottom: 12px; }
.security-filters select { width: 100%; max-width: 100%; }
.form-error {
  background: var(--bad-bg);
  color: var(--bad);
  border: 1px solid #e8c4c0;
  padding: 8px 10px;
  border-radius: var(--r);
  font-size: 13px;
  margin-bottom: 14px;
}
.form-error[hidden] { display: none !important; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 10px 0; }
.check input, input[type="checkbox"] {
  width: 15px;
  height: 15px;
  min-height: 15px;
  padding: 0;
  margin: 0;
  border-radius: 3px;
  accent-color: var(--navy);
  cursor: pointer;
  vertical-align: middle;
  box-shadow: none;
}
input[type="checkbox"]:focus { box-shadow: none; border-color: var(--navy); }
.cust-select { width: 36px; text-align: center; padding-left: 8px; padding-right: 8px; }
tr.cust-row.is-selected td { background: #f3f6fb; }
.cust-count { font-size: 12px; color: var(--muted); min-height: 18px; margin: 0 0 8px; }
.demo {
  margin-top: 20px;
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 8px 10px;
}
.demo summary { cursor: pointer; font-weight: 600; color: var(--navy); }
.demo dl { margin: 8px 0 0; display: grid; grid-template-columns: 88px 1fr; gap: 4px 10px; }
.demo dt { color: var(--muted); }
.demo dd { margin: 0; font-family: var(--mono); font-size: 11px; }

a.btn { text-decoration: none; }
.btn {
  appearance: none;
  border: 1px solid transparent;
  background: var(--navy);
  color: #fff;
  padding: 8px 14px;
  border-radius: var(--r);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  text-decoration: none;
}
.btn:hover { background: var(--navy-2); }
.btn.ghost {
  background: #fff;
  color: var(--navy);
  border-color: var(--line-2);
}
.btn.ghost:hover { background: #f4f7fa; }
.btn.danger { background: var(--bad); }
.btn.full { width: 100%; }
.btn.sm { padding: 5px 10px; min-height: 30px; font-size: 12px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; position: relative; }
.sidebar {
  background: var(--navy);
  color: #c5d0dc;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 16px 14px;
  border-bottom: 1px solid #1a3a5a;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
}
.brand small {
  display: block;
  font-weight: 500;
  font-size: 10px;
  color: #8ea0b5;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.nav { display: flex; flex-direction: column; padding: 10px 8px; flex: 1; gap: 2px; }
.nav a {
  color: #b7c5d3;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: var(--r);
  font-size: 13px;
  font-weight: 500;
  border-left: 3px solid transparent;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
}
.nav-count {
  min-width: 14px;
  height: 14px;
  padding: 0 4px;
  border-radius: 999px;
  background: #b23b32;
  color: #fff;
  font-size: 9px;
  font-weight: 600;
  line-height: 14px;
  text-align: center;
  letter-spacing: 0;
}
.nav a:hover { background: #143356; color: #fff; }
.nav a.active {
  background: #143356;
  color: #fff;
  border-left-color: var(--brand);
}
.who {
  padding: 12px 14px 16px;
  border-top: 1px solid #1a3a5a;
  font-size: 12px;
}
.who b { color: #fff; display: block; font-size: 13px; }
.who em { font-style: normal; color: #8ea0b5; font-size: 11px; }
.who .btn { margin-top: 10px; width: 100%; }

.main { padding: 20px 28px 64px; min-width: 0; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 20px; }
.topbar p { color: var(--muted); margin: 4px 0 0; font-size: 13px; max-width: 62ch; }
.dept-host {
  display: flex;
  justify-content: flex-end;
  margin: -4px 0 12px;
}
.dept-switch {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface);
}
.dept-switch button {
  border: 0;
  background: transparent;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-right: 1px solid var(--line);
}
.dept-switch button:last-child { border-right: 0; }
.dept-switch button.on {
  background: var(--navy, #0b2a4a);
  color: #fff;
}
body.dept-air {
  --brand: #1d5aa6;
  --navy: #0e3d78;
  --navy-2: #1d5aa6;
  --info-bg: #e7f1fb;
}
body.dept-air .nav a.active { border-left-color: #7eb6ff; }
body.dept-air .tabs button.on { color: #1d5aa6; border-bottom-color: #1d5aa6; }
body.dept-air .dept-switch button.on { background: #1d5aa6; }
.dept-checks { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 14px;
}
.kpi .lbl { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.kpi .val { font-family: var(--mono); font-size: 22px; font-weight: 500; margin-top: 4px; color: var(--ink); }
.kpi.good .val { color: var(--ok); }
.kpi.warn .val { color: var(--warn); }
.kpi.bad .val { color: var(--bad); }
a.kpi, .kpi.dash-jump { display: block; color: inherit; text-decoration: none; cursor: pointer; }
.kpi.dash-jump:hover, a.kpi:hover { border-color: var(--navy); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px;
}
.card + .card { margin-top: 12px; }
.card h3 { font-size: 14px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.split { display: grid; grid-template-columns: 1.45fr 0.85fr; gap: 12px; }
.split > .card + .card { margin-top: 0; }
.dash-bills { grid-template-columns: 1fr 1fr; min-width: 0; }
.dash-bills > .card { min-width: 0; overflow: hidden; }
.dash-bills table { table-layout: fixed; width: 100%; }
.dash-bills th { white-space: normal; line-height: 1.25; }
.dash-bills td { overflow: hidden; }
.dash-bills td:first-child,
.dash-bills th:first-child { width: 28%; white-space: normal; }
.dash-bills .job-id { white-space: nowrap; }
.job-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
}
.job-cell .mode-pill {
  max-width: 100%;
  white-space: normal;
  line-height: 1.2;
  word-break: break-word;
}

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
.role-matrix { overflow: auto; }
.role-matrix th, .role-matrix td { white-space: nowrap; }
th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line-2);
  padding: 8px 10px;
  background: #f7f9fb;
  white-space: nowrap;
}
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr.purchase-approved td { background: #e7f6ec; }
tr.purchase-open td { background: #fff6d6; }
tr.purchase-rejected td { background: #fde8e8; }
.purchase-state { color: #146c2e; font-weight: 600; }
.purchase-rejected-label { color: #9b2c2c; font-weight: 600; }
.proof-upload { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.proof-upload input[type="file"] { max-width: 160px; font-size: 12px; }
tr.clickable:hover { background: #f3f7fb; }
.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 12px; }
.job-id { font-family: var(--mono); font-size: 12px; font-weight: 500; }

.badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 2px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: #eef1f5;
  color: #3d4d5c;
  white-space: nowrap;
}
.st-draft { background: #eef1f5; color: #3d4d5c; }
.st-confirmed, .st-contacted, .st-billed { background: var(--info-bg); color: #1d3d63; }
.st-assigned, .st-proposal, .st-simulated { background: var(--warn-bg); color: var(--warn); }
.st-in_transit, .st-pending_approval { background: #f6e6dc; color: var(--brand); }
.st-delivered, .st-won, .st-posted, .st-approved, .st-sent, .st-paid, .st-accepted { background: var(--ok-bg); color: var(--ok); }
.st-closed, .st-new { background: #eef1f5; color: #3d4d5c; }
.st-lost, .st-failed, .st-rejected, .st-critical { background: var(--bad-bg); color: var(--bad); }

.filters { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.filters input, .filters select { width: auto; min-width: 180px; background: #fff; }

.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin: 4px 0 16px; flex-wrap: wrap; }
.tabs button {
  border: 0;
  background: none;
  padding: 8px 12px;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabs button.on { color: var(--navy); border-bottom-color: var(--brand); }

.job-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.job-no { font-family: var(--mono); font-size: 18px; font-weight: 500; }
.route { font-size: 13px; color: var(--muted); margin-top: 4px; }

.log { display: flex; flex-direction: column; gap: 8px; }
.log-item {
  border-left: 3px solid var(--navy);
  padding: 8px 12px;
  background: #f6f8fb;
}
.log-item .meta { font-size: 11px; color: var(--muted); margin-bottom: 4px; }

.kanban { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.col { background: #e4eaf0; border-radius: 6px; padding: 8px; min-height: 260px; }
.col h4 { font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; margin: 4px 6px 8px; color: var(--muted); }

.bar { height: 6px; background: #e1e7ee; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--navy); }

.toast {
  display: none;
  position: fixed;
  right: 16px;
  bottom: 16px;
  background: var(--navy);
  color: #fff;
  padding: 10px 14px;
  border-radius: var(--r);
  z-index: 60;
  max-width: 360px;
  font-size: 13px;
  box-shadow: var(--shadow);
}
.toast.is-open { display: block; }

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(12, 35, 64, 0.45);
  z-index: 50;
  padding: 24px;
  align-items: flex-start;
  justify-content: center;
  overflow: auto;
}
.modal.is-open { display: flex; }
.modal-card {
  background: #fff;
  width: min(520px, 100%);
  border-radius: 6px;
  padding: 20px 22px 18px;
  position: relative;
  margin-top: 8vh;
  box-shadow: var(--shadow);
  max-width: 100%;
  min-width: 0;
}
.modal-card.modal-wide { width: min(1180px, 100%); }
.modal-card table { border: 1px solid var(--line); width: 100%; table-layout: fixed; }
.modal-card th, .modal-card td { border: 1px solid var(--line); }
.modal-card th { white-space: normal; }
.modal-card td { overflow-wrap: anywhere; }
.modal-card .mis-detail {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  width: 100%;
  min-width: 0;
}
.modal-card .mis-detail > div { min-width: 0; overflow: auto; }
.pay-link { border: 0; background: none; padding: 0; cursor: pointer; }
.modal-card h3 { font-size: 16px; margin-bottom: 14px; }
.modal-close {
  position: absolute;
  right: 10px;
  top: 8px;
  border: 0;
  background: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--muted);
  line-height: 1;
  width: 32px;
  height: 32px;
}

.drive-shell { max-width: 440px; margin: 0 auto; padding: 16px 16px 96px; background: var(--bg); min-height: 100vh; }
.drive-card {
  background: #fff;
  border-radius: 6px;
  padding: 14px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
}
.drive-card h2 { font-size: 16px; font-family: var(--mono); font-weight: 500; }
.drive-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.drive-actions .btn { min-height: 44px; }
.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--navy);
  display: flex;
  justify-content: space-around;
  padding: 10px 8px calc(10px + env(safe-area-inset-bottom));
}
.bottom-nav a, .bottom-nav button {
  color: #c5d0dc;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  background: none;
  border: 0;
  cursor: pointer;
}

.muted { color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 10px; }
.chips { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.empty { padding: 28px 12px; text-align: center; color: var(--muted); font-size: 13px; }
.file-list a { font-weight: 600; text-decoration: none; }
.file-cell {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
a.file-open {
  color: var(--brand);
  font-weight: 650;
  text-decoration: underline;
}
a.file-open:hover { color: var(--navy); }
.lock {
  display: inline-block;
  background: var(--bad-bg);
  color: var(--bad);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  margin-left: 6px;
}
.notice {
  background: var(--warn-bg);
  border: 1px solid #ead9a8;
  color: #5c4308;
  padding: 8px 10px;
  border-radius: var(--r);
  font-size: 13px;
  margin: 8px 0 12px;
}
.page-loading { padding: 48px; color: var(--muted); text-align: center; }

@media (max-width: 980px) {
  .auth { grid-template-columns: 1fr; }
  .auth-rail { padding: 20px; }
  .auth-rail .rail-copy { display: none; }
  .auth-form-wrap, .auth-foot { padding-left: 20px; padding-right: 20px; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { height: auto; position: relative; padding-top: 4px; }
  .brand { padding-right: 280px; }
  .dept-host {
    position: absolute;
    top: 12px;
    right: 12px;
    margin: 0;
    z-index: 6;
  }
  .dept-switch {
    background: #0a1c33;
    border-color: #2a4a6a;
  }
  .dept-switch button {
    color: #c5d0dc;
    border-right-color: #2a4a6a;
  }
  .dept-switch button.on {
    background: #fff;
    color: var(--navy);
  }
  .nav { flex-direction: row; overflow: auto; }
  .nav a { border-left: 0; border-bottom: 3px solid transparent; }
  .nav a.active { border-bottom-color: var(--brand); }
  .kpis, .kanban, .split, .dash-bills, .row, .row-3, .security-filters { grid-template-columns: 1fr; }
  .main { padding: 14px 12px 80px; }
  .who .btn { width: auto; }
  .sheet { grid-template-columns: 1fr; }
}

.mode-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border: 1px solid #111;
}
.mode-pill.air { background: #c5ddf7; }
.mode-pill.sea { background: #f6de4a; }

.docket-page { max-width: 100%; overflow-x: auto; }
.paper { width: 100%; }
.mode-switch { display: flex; gap: 8px; margin-bottom: 10px; }
.user-team { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.user-team select { width: auto; min-width: 140px; min-height: 34px; }
.users-table input, .users-table select { min-width: 0; width: 100%; }
.users-table .user-actions { white-space: nowrap; }
.users-table .user-actions .btn { margin: 0 4px 4px 0; }
.new-pass-box {
  margin-top: 8px;
  padding: 8px 10px;
  background: #f6de4a;
  border: 1px solid #111;
  white-space: normal;
  max-width: 240px;
  text-align: left;
}
.new-pass-box span { display: block; font-weight: 600; }
.new-pass-box strong, .new-pass-display {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 20px;
  letter-spacing: 0.06em;
  margin: 6px 0;
  word-break: break-all;
}
.new-pass-display {
  background: #f6de4a;
  border: 1px solid #111;
  padding: 12px 14px;
}
.inline { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; }
.mode-tab {
  border: 2px solid #111;
  background: #fff;
  color: #111;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 8px 22px;
  cursor: pointer;
  min-height: 0;
}
.mode-tab.air.on { background: #1d5aa6; color: #fff; }
.mode-tab.sea.on { background: #e2b400; color: #111; }
.mode-tab.on { background: #0c2340; color: #fff; }

.docket-air .paper { background: #d7e8fb; }
.docket-sea .paper { background: #f6de4a; }
.paper {
  border: 2px solid #111;
  color: #111;
  font-family: Arial, Helvetica, sans-serif;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
}
.letterhead {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px 8px;
}
.co {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.04em;
}
.swift {
  font-style: italic;
  font-weight: 700;
  font-size: 14px;
  margin-top: 2px;
}
.addr { margin: 4px 0 0; font-size: 11px; line-height: 1.35; }
.stamp {
  border: 2px solid #111;
  min-width: 88px;
  height: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.12em;
  background: rgba(255, 255, 255, 0.35);
}
.stamp small {
  display: block;
  font-size: 11px;
  letter-spacing: 0.08em;
  font-weight: 700;
}
.id-row {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  border-top: 1.5px solid #111;
}
.id-side {
  padding: 6px 10px 8px;
  min-width: 0;
}
.id-side + .id-side { border-left: 1.5px solid #111; }
.id-row .dline { min-height: 26px; }
.party-lookup { position: relative; flex-wrap: wrap; }
.party-menu {
  position: absolute;
  z-index: 4;
  top: 100%;
  left: 0;
  right: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  background: #fff;
  border: 1px solid #111;
  max-height: 160px;
  overflow: auto;
}
.party-menu li { padding: 5px 8px; cursor: pointer; font-size: 12px; font-weight: 600; }
.party-menu li:hover { background: #e7f0fa; }
.docket input.jobno-field {
  font-weight: 700;
  color: #111;
  background: transparent;
  cursor: default;
}
.sheet-col h4, .office h4 {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin: 0 0 2px;
}
.sheet-col h4, .office h4 {
  text-align: center;
  border-bottom: 1px solid #111;
  padding-bottom: 4px;
  margin-bottom: 4px;
}
.jobno { font-weight: 700; font-size: 13px; min-height: 22px; }
.sheet {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  border-top: 1.5px solid #111;
}
.sheet-col {
  border-right: 1.5px solid #111;
  padding: 6px 8px 8px;
  min-width: 0;
}
.sheet-col:last-child { border-right: 0; }
.docket .dline {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  margin: 0;
  padding: 2px 0;
  font-size: 11px;
  font-weight: 700;
}
.docket .dline > span { flex: 0 0 auto; white-space: nowrap; }
.docket .dline.pair > span:first-child { flex: 0 0 auto; }
.docket .dtd { font-weight: 700; margin-left: 4px; }
.docket input {
  flex: 1;
  width: auto;
  min-width: 0;
  min-height: 18px;
  height: 20px;
  border: 0;
  border-bottom: 1px solid #111;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0 3px 1px;
  color: #111;
  font-size: 12px;
  font-weight: 600;
}
.docket input:focus { outline: none; box-shadow: none; background: rgba(255, 255, 255, 0.45); }
.docket input:disabled { background: transparent; color: #111; }
.pay { width: 100%; border-collapse: collapse; font-size: 10px; margin-top: 4px; }
.pay th, .pay td { border: 1px solid #111; padding: 2px; vertical-align: middle; font-weight: 700; }
.pay th { text-align: center; line-height: 1.15; }
.pay .sno { width: 28px; text-align: center; }
.pay input { width: 100%; border-bottom: 0; text-align: center; }
.office { margin-top: 8px; border-top: 1.5px solid #111; padding-top: 6px; }
.bill-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  border-top: 1.5px solid #111;
  padding: 6px 10px 8px;
}
.docket-save { margin-top: 12px; }
.docket .dline.containers { align-items: flex-start; }
.docket .dline.containers > span { padding-top: 3px; }
.container-list { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; align-items: stretch; }
.container-add { align-self: flex-start; }
.docket .yn-choices { display: flex; gap: 14px; align-items: center; flex: 1; }
.docket .yn-opt {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  margin: 0;
}
.docket .yn-opt input {
  width: auto;
  min-width: 0;
  min-height: 0;
  height: auto;
  flex: 0 0 auto;
  border: 0;
  padding: 0;
}
.container-item { display: flex; gap: 4px; align-items: center; }
.docket .container-item input { flex: 1; }
.container-add, .container-remove {
  border: 1px solid #111;
  background: transparent;
  color: #111;
  min-height: 20px;
  height: 22px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}
.container-add:hover, .container-remove:hover { background: rgba(255, 255, 255, 0.45); }
.container-add:disabled, .container-remove:disabled { display: none; }

.access-layout { display: grid; grid-template-columns: 240px 1fr; gap: 16px; align-items: start; }
.access-side { padding: 12px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 12px; }
.access-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 8px; }
.access-modes button, .access-pick {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  text-align: left;
  padding: 8px 10px;
  cursor: pointer;
  font: inherit;
}
.access-modes button.on, .access-pick.on { border-color: var(--brand); background: #f8efe9; }
.access-pick b { display: block; font-size: 13px; }
.access-pick small { color: var(--muted); font-size: 11px; }
.access-head { display: flex; justify-content: space-between; gap: 16px; align-items: end; margin-bottom: 12px; }
.access-head h2 { font-size: 18px; margin: 0; }
.access-head p { color: var(--muted); font-size: 13px; margin: 4px 0 0; max-width: 62ch; }
.access-head input { min-width: 220px; }
.access-group { margin-bottom: 12px; }
.access-group h3 { font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.access-row { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.access-row b { display: block; font-size: 14px; }
.access-row p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.switch {
  width: 44px;
  height: 26px;
  border: 0;
  border-radius: 13px;
  background: #c5ced6;
  position: relative;
  flex: 0 0 auto;
  cursor: pointer;
  padding: 0;
}
.switch i {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  top: 3px;
  left: 3px;
  transition: left 0.15s ease;
}
.switch.on { background: var(--ok); }
.switch.on i { left: 21px; }
@media (max-width: 900px) {
  .access-layout { grid-template-columns: 1fr; }
  .access-side { position: static; }
}

.mis-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 12px; }
.mis-field { display: flex; flex-direction: column; gap: 4px; min-width: 140px; font-size: 12px; color: var(--muted); }
.mis-field select, .mis-field input { min-width: 140px; }
.mis-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.btn.excel { background: #17663f; color: #fff; }
.mis-table a { color: var(--brand); font-weight: 650; }
.mis-expand {
  width: 22px; height: 22px; border-radius: 4px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; font-weight: 700;
}
.mis-profit { color: var(--ok); font-weight: 650; }
.mis-loss { color: #9b2c2c; font-weight: 650; }
.pay-pill { display: inline-block; border-radius: 999px; padding: 2px 8px; font-size: 12px; font-weight: 650; }
.pay-paid { background: #e7f6ec; color: #17663f; }
.pay-unpaid { background: #fde8e8; color: #9b2c2c; }
.pay-pending { background: #fff4d6; color: #8a5a00; }
.mis-detail { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 12px; background: #f7f9fb; padding: 8px; }
.mis-detail h3 { font-size: 13px; margin-bottom: 8px; }
.mis-pager { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; color: var(--muted); font-size: 12px; }
.mis-notes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 12px; }
.mis-notes div { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.mis-notes b { display: block; font-size: 13px; margin-bottom: 4px; }
.mis-notes span { color: var(--muted); font-size: 12px; }
.timeline { list-style: none; margin: 0; padding: 4px 0 8px; }
.timeline li { display: grid; grid-template-columns: 16px 1fr; gap: 12px; }
.timeline li.empty { display: block; grid-template-columns: none; }
.timeline-mark { width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: var(--navy, #0c2340); box-shadow: 0 0 0 4px #e7eef6; }
.timeline li > div:last-child { border-left: 2px solid #d5dee8; margin-left: -22px; padding: 0 0 18px 24px; }
.timeline li:last-child > div:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline p { margin: 2px 0; }
.timeline time { color: var(--muted); font-size: 12px; }
@media (max-width: 900px) {
  .mis-detail, .mis-notes { grid-template-columns: 1fr; }
  .mis-actions { margin-left: 0; }
}
