:root {
  color-scheme: dark;
  --bg: #0c0907;
  --surface: #15110f;
  --surface-raised: #1b1612;
  --surface-soft: #211a15;
  --gold: #c4955a;
  --gold-bright: #e0bd83;
  --gold-deep: #8f6739;
  --text: #eee7db;
  --muted: #a49a8f;
  --dim: #70665e;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(196, 149, 90, 0.28);
  --success: #84b59a;
  --danger: #d7877b;
  --warning: #d8ad67;
  --info: #8caab6;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
  --display: 'Cormorant Garamond', Georgia, serif;
  --interface: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 88% 6%, rgba(196, 149, 90, 0.09), transparent 31rem),
    radial-gradient(circle at 8% 82%, rgba(92, 57, 37, 0.12), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: var(--interface);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.012) 1px, transparent 1px);
  background-size: 32px 32px;
  content: '';
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

button,
input,
select,
textarea,
a {
  font: inherit;
}

button,
a {
  min-height: 44px;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(224, 189, 131, 0.72);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  min-height: auto;
  padding: 9px 13px;
  border-radius: 6px;
  background: #f5ede1;
  color: #17100c;
  font-weight: 700;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.boot-state {
  display: grid;
  min-height: 100vh;
  place-content: center;
  gap: 14px;
  color: var(--muted);
  text-align: center;
}

.brand-monogram {
  color: var(--gold-bright);
  font-family: var(--display);
  font-size: 36px;
  font-weight: 600;
  letter-spacing: 0.22em;
}

.login-shell {
  display: grid;
  width: min(1120px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0;
  align-items: center;
}

.login-layout {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(18, 14, 12, 0.92);
  box-shadow: var(--shadow);
}

.login-story {
  position: relative;
  display: grid;
  min-height: 360px;
  padding: clamp(30px, 7vw, 64px);
  align-content: space-between;
  background:
    linear-gradient(140deg, rgba(196, 149, 90, 0.13), transparent 52%),
    #100c0a;
}

.login-story::after {
  position: absolute;
  right: -70px;
  bottom: -90px;
  width: 280px;
  height: 280px;
  border: 1px solid rgba(196, 149, 90, 0.16);
  border-radius: 50%;
  content: '';
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  place-items: center;
  color: var(--gold-bright);
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.brand-copy {
  display: grid;
  line-height: 1.08;
}

.brand-copy strong {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.035em;
}

.brand-copy small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.login-story h1,
.page-title h1,
.drawer-title h2,
.modal-title h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: -0.015em;
}

.login-story h1 {
  max-width: 570px;
  font-size: clamp(42px, 7vw, 68px);
  line-height: 0.98;
}

.login-story p {
  max-width: 560px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.trust-strip {
  display: grid;
  margin-top: 38px;
  gap: 10px;
}

.trust-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.trust-dot,
.live-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(132, 181, 154, 0.09);
}

.login-panel {
  display: grid;
  padding: clamp(30px, 7vw, 58px);
  align-content: center;
  background: var(--surface);
}

.login-panel h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 38px;
  font-weight: 500;
}

.login-panel > p {
  margin: 8px 0 28px;
  color: var(--muted);
}

.field {
  display: grid;
  margin-bottom: 18px;
  gap: 7px;
}

.field-spaced {
  margin-top: 18px;
}

.field label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea,
.toolbar input,
.toolbar select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 7px;
  outline: 0;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
}

.field input,
.field select,
.toolbar input,
.toolbar select {
  min-height: 46px;
  padding: 0 13px;
}

.field textarea {
  min-height: 112px;
  padding: 12px 13px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.toolbar input:focus,
.toolbar select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(196, 149, 90, 0.13);
}

.field-help {
  color: var(--dim);
  font-size: 11px;
}

.primary-button,
.secondary-button,
.quiet-button,
.danger-button {
  display: inline-flex;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 7px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.035em;
}

.primary-button {
  border-color: var(--gold);
  background: var(--gold);
  color: #140e0a;
}

.primary-button:hover {
  background: var(--gold-bright);
}

.secondary-button {
  border-color: var(--border-strong);
  background: rgba(196, 149, 90, 0.08);
  color: var(--gold-bright);
}

.quiet-button {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
}

.danger-button {
  border-color: rgba(215, 135, 123, 0.38);
  background: rgba(215, 135, 123, 0.09);
  color: #efb0a7;
}

.primary-button:disabled,
.secondary-button:disabled,
.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.login-panel .primary-button {
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
}

.local-note {
  margin-top: 22px;
  padding: 13px 14px;
  border-left: 2px solid var(--gold-deep);
  background: rgba(196, 149, 90, 0.055);
  color: var(--muted);
  font-size: 11px;
}

.local-note strong {
  color: var(--gold-bright);
}

.form-error {
  min-height: 20px;
  margin: 0 0 10px;
  color: #efaca1;
  font-size: 12px;
}

.admin-shell {
  display: grid;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 50;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  border-top: 1px solid var(--border);
  background: rgba(12, 9, 7, 0.95);
  backdrop-filter: blur(18px);
}

.sidebar-header,
.sidebar-context,
.sidebar-footer {
  display: none;
}

.sidebar-nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.nav-button {
  display: grid;
  min-width: 0;
  min-height: 62px;
  padding: 9px 4px 7px;
  border: 0;
  place-items: center;
  gap: 3px;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.nav-button::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  content: '';
}

.nav-button:hover,
.nav-button[aria-current='page'] {
  color: var(--gold-bright);
}

.nav-button[aria-current='page'] {
  background: rgba(196, 149, 90, 0.08);
}

.workspace {
  min-width: 0;
  padding-bottom: 76px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  min-height: 72px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(12, 9, 7, 0.88);
  backdrop-filter: blur(18px);
}

.page-title {
  min-width: 0;
}

.page-title h1 {
  overflow: hidden;
  font-size: clamp(25px, 5vw, 34px);
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-title p {
  display: none;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

@media (max-width: 700px) {
  .topbar { flex-wrap: wrap; }
  .topbar-actions { width: 100%; }
}

.mobile-sign-out {
  padding: 0 12px;
}

.live-status {
  display: none;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.content {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 20px 16px 40px;
}

.section-heading {
  display: flex;
  margin: 0 0 14px;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.section-heading h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 27px;
  font-weight: 500;
}

.section-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.metrics-grid {
  display: grid;
  margin-bottom: 18px;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric {
  min-width: 0;
  padding: 17px;
  border: 1px solid var(--border);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.008));
}

.metric-label {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.metric strong {
  display: block;
  margin-top: 9px;
  color: var(--gold-bright);
  font-family: var(--display);
  font-size: clamp(29px, 6vw, 42px);
  font-weight: 500;
  line-height: 1;
}

.metric small {
  display: block;
  margin-top: 7px;
  color: var(--dim);
  font-size: 11px;
}

.overview-grid {
  display: grid;
  gap: 18px;
}

.panel {
  min-width: 0;
  border: 1px solid var(--border);
  background: rgba(21, 17, 15, 0.74);
}

.panel-header {
  display: flex;
  min-height: 60px;
  padding: 14px 17px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-header h2,
.panel-header h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 500;
}

.panel-header p {
  margin: 2px 0 0;
  color: var(--dim);
  font-size: 11px;
}

.count-badge,
.status-badge,
.role-badge {
  display: inline-flex;
  min-height: 24px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  align-items: center;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-badge[data-tone='success'] {
  border-color: rgba(132, 181, 154, 0.3);
  background: rgba(132, 181, 154, 0.07);
  color: var(--success);
}

.status-badge[data-tone='warning'] {
  border-color: rgba(216, 173, 103, 0.3);
  background: rgba(216, 173, 103, 0.07);
  color: var(--warning);
}

.status-badge[data-tone='danger'] {
  border-color: rgba(215, 135, 123, 0.3);
  background: rgba(215, 135, 123, 0.07);
  color: var(--danger);
}

.status-badge[data-tone='info'] {
  border-color: rgba(140, 170, 182, 0.3);
  background: rgba(140, 170, 182, 0.07);
  color: var(--info);
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table th {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--dim);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  color: var(--muted);
  vertical-align: middle;
  white-space: nowrap;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover td {
  background: rgba(196, 149, 90, 0.035);
}

.cell-primary {
  display: block;
  max-width: 240px;
  overflow: hidden;
  color: var(--text);
  font-weight: 600;
  text-overflow: ellipsis;
}

.cell-secondary {
  display: block;
  max-width: 240px;
  margin-top: 2px;
  overflow: hidden;
  color: var(--dim);
  font-size: 11px;
  text-overflow: ellipsis;
}

.numeric {
  color: var(--text) !important;
  font-variant-numeric: tabular-nums;
  text-align: right !important;
}

.monospace {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
}

.row-action {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--gold-bright);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.queue-list {
  display: grid;
}

.queue-item {
  display: grid;
  padding: 15px 17px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
}

.queue-item:last-child {
  border-bottom: 0;
}

.queue-item__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.queue-item strong {
  display: block;
  color: var(--text);
  font-size: 12px;
}

.queue-item p,
.queue-item small {
  margin: 3px 0 0;
  color: var(--dim);
  font-size: 11px;
}

.empty-state {
  display: grid;
  min-height: 210px;
  padding: 28px;
  place-content: center;
  color: var(--dim);
  text-align: center;
}

.empty-state strong {
  margin-bottom: 5px;
  color: var(--muted);
  font-family: var(--display);
  font-size: 22px;
  font-weight: 500;
}

.toolbar {
  display: grid;
  margin-bottom: 14px;
  gap: 10px;
}

.toolbar-search {
  position: relative;
}

.toolbar input {
  padding-left: 14px;
}

.result-summary {
  margin: 0 0 12px;
  color: var(--dim);
  font-size: 11px;
}

.inline-alert {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid rgba(220, 106, 106, 0.38);
  background: rgba(220, 106, 106, 0.08);
  color: var(--danger);
  font-size: 11px;
}

.enquiry-list {
  display: grid;
  gap: 12px;
}

.enquiry-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--border);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.008));
}

.enquiry-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.enquiry-card__header strong,
.enquiry-card__header span {
  display: block;
}

.enquiry-card__header strong {
  color: var(--text);
  font-family: var(--display);
  font-size: 21px;
  font-weight: 500;
}

.enquiry-card__header div > span {
  overflow-wrap: anywhere;
  margin-top: 3px;
  color: var(--gold-bright);
  font-size: 11px;
}

.enquiry-card__meta {
  display: flex;
  flex-wrap: wrap;
  margin-top: 12px;
  gap: 6px 14px;
  color: var(--dim);
  font-size: 11px;
}

.enquiry-card__message {
  margin: 14px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.enquiry-card__badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.enquiry-workflow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.enquiry-workflow label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
}

.enquiry-workflow label:nth-child(4) {
  grid-column: 1 / -1;
}

.enquiry-workflow input,
.enquiry-workflow select,
.enquiry-workflow textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  font: inherit;
}

.enquiry-workflow textarea {
  min-height: 78px;
  resize: vertical;
}

.enquiry-workflow .button {
  justify-self: start;
}

.login-mode-link {
  display: inline-flex;
  min-height: 44px;
  margin-top: 14px;
  align-items: center;
  color: var(--gold-bright);
  font-size: 12px;
  font-weight: 600;
}

.enquiry-history {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.018);
}

.enquiry-history summary {
  min-height: 32px;
  color: var(--gold-bright);
  cursor: pointer;
  font-size: 12px;
}

.enquiry-history ol {
  display: grid;
  margin: 10px 0 0;
  padding-left: 20px;
  gap: 8px;
}

.enquiry-history li strong,
.enquiry-history li span {
  display: block;
}

.enquiry-history li span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.finance-workspace,
.finance-batch-list {
  display: grid;
  gap: 16px;
}

.finance-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.finance-summary {
  display: grid;
  min-height: 132px;
  align-content: center;
  gap: 8px;
  padding: 20px;
}

.finance-summary > strong {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
}

.finance-summary small,
.finance-create p {
  color: var(--muted);
}

.reconciliation-evidence,
.finance-create,
.finance-batch {
  padding: 20px;
}

.reconciliation-evidence > div:first-child,
.finance-batch__header,
.finance-create {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.reconciliation-evidence > div:first-child span {
  color: var(--muted);
}

.reconciliation-evidence dl,
.finance-batch__facts {
  display: grid;
  margin: 18px 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.reconciliation-evidence dl div,
.finance-batch__facts div {
  min-width: 0;
  padding: 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
}

.reconciliation-evidence dt,
.finance-batch__facts dt {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.reconciliation-evidence dd,
.finance-batch__facts dd {
  overflow-wrap: anywhere;
  margin: 4px 0 0;
  color: var(--text);
  font-size: 12px;
}

.success-note { color: #9ed7b7; }

.finance-create h3,
.finance-batch h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 500;
}

.finance-create__fields,
.finance-proof-fields {
  display: grid;
  min-width: min(100%, 620px);
  grid-template-columns: minmax(180px, 1fr) minmax(160px, 0.7fr) auto;
  align-items: end;
  gap: 10px;
}

.finance-proof-fields {
  grid-template-columns: repeat(3, minmax(150px, 1fr)) auto;
}

.finance-create label,
.finance-proof-fields label {
  display: grid;
  color: var(--muted);
  font-size: 11px;
  gap: 6px;
}

.finance-create input,
.finance-proof-fields input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--text);
}

.proof-evidence {
  display: grid;
  margin-top: 14px;
  padding: 14px;
  border-left: 2px solid #62b889;
  background: rgba(98, 184, 137, 0.07);
  gap: 5px;
}

.proof-evidence code {
  overflow-wrap: anywhere;
  color: var(--dim);
  font-size: 11px;
}

.proof-evidence small { color: var(--muted); }

@media (max-width: 780px) {
  .enquiry-workflow {
    grid-template-columns: 1fr;
  }

  .enquiry-workflow label:nth-child(4) {
    grid-column: auto;
  }

  .finance-summary-grid,
  .reconciliation-evidence dl,
  .finance-batch__facts,
  .finance-create__fields,
  .finance-proof-fields {
    grid-template-columns: 1fr;
  }

  .reconciliation-evidence > div:first-child,
  .finance-batch__header,
  .finance-create {
    flex-direction: column;
  }
}

.drawer-backdrop,
.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(4px);
}

.drawer {
  position: fixed;
  z-index: 110;
  top: 0;
  right: 0;
  bottom: 0;
  overflow-y: auto;
  width: min(680px, 100%);
  border-left: 1px solid var(--border-strong);
  background: #110e0c;
  box-shadow: -24px 0 70px rgba(0, 0, 0, 0.42);
}

.drawer-header,
.modal-header {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  min-height: 78px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(17, 14, 12, 0.96);
  backdrop-filter: blur(14px);
}

.drawer-title h2,
.modal-title h2 {
  font-size: 28px;
}

.drawer-title p,
.modal-title p {
  margin: 3px 0 0;
  color: var(--dim);
  font-size: 11px;
}

.close-button {
  width: 42px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 20px;
}

.drawer-body {
  padding: 20px;
}

.detail-hero {
  display: grid;
  margin-bottom: 18px;
  padding: 20px;
  border: 1px solid var(--border-strong);
  background: linear-gradient(145deg, rgba(196, 149, 90, 0.1), rgba(196, 149, 90, 0.025));
  gap: 15px;
}

.detail-balance {
  color: var(--gold-bright);
  font-family: var(--display);
  font-size: 46px;
  font-weight: 500;
  line-height: 1;
}

.detail-balance small {
  color: var(--muted);
  font-family: var(--interface);
  font-size: 11px;
  font-weight: 500;
}

.detail-grid {
  display: grid;
  margin-bottom: 18px;
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-field {
  min-width: 0;
  padding: 13px 14px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.detail-field span {
  display: block;
  color: var(--dim);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-field strong {
  display: block;
  overflow: hidden;
  margin-top: 5px;
  color: var(--text);
  font-size: 12px;
  text-overflow: ellipsis;
}

.detail-section {
  margin-top: 22px;
}

.detail-section h3 {
  margin: 0 0 10px;
  color: var(--gold-bright);
  font-family: var(--display);
  font-size: 22px;
  font-weight: 500;
}

.ledger-list {
  display: grid;
  border-top: 1px solid var(--border);
}

.ledger-row {
  display: grid;
  padding: 12px 2px;
  border-bottom: 1px solid var(--border);
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 16px;
}

.ledger-row strong {
  color: var(--text);
  font-size: 12px;
}

.ledger-row small {
  color: var(--dim);
  font-size: 11px;
}

.ledger-amount {
  align-self: center;
  color: var(--success);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.ledger-amount[data-negative='true'] {
  color: var(--danger);
}

.modal {
  position: fixed;
  z-index: 120;
  top: 50%;
  left: 50%;
  overflow: hidden;
  width: min(560px, calc(100% - 28px));
  max-height: calc(100vh - 28px);
  border: 1px solid var(--border-strong);
  background: #15110f;
  box-shadow: var(--shadow);
  transform: translate(-50%, -50%);
}

.modal-body {
  overflow-y: auto;
  max-height: calc(100vh - 108px);
  padding: 20px;
}

.segmented {
  display: grid;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 8px;
  grid-template-columns: repeat(2, 1fr);
  background: rgba(255, 255, 255, 0.02);
}

.segmented label {
  cursor: pointer;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: grid;
  min-height: 42px;
  border-radius: 6px;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.segmented input:checked + span {
  background: rgba(196, 149, 90, 0.13);
  color: var(--gold-bright);
}

.adjustment-preview {
  display: grid;
  margin: 18px 0;
  padding: 15px;
  border: 1px solid var(--border);
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.018);
  text-align: center;
}

.adjustment-preview span {
  display: block;
  color: var(--dim);
  font-size: 10px;
  text-transform: uppercase;
}

.adjustment-preview strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.adjustment-preview b {
  color: var(--gold);
  font-size: 18px;
}

.modal-actions {
  display: flex;
  margin-top: 20px;
  justify-content: flex-end;
  gap: 9px;
}

.warning-note {
  margin: 14px 0 0;
  padding: 12px 13px;
  border-left: 2px solid var(--warning);
  background: rgba(216, 173, 103, 0.06);
  color: var(--muted);
  font-size: 11px;
}

.toast-region {
  position: fixed;
  z-index: 180;
  right: 16px;
  bottom: 86px;
  display: grid;
  width: min(390px, calc(100% - 32px));
  gap: 9px;
}

.toast {
  padding: 13px 15px;
  border: 1px solid var(--border-strong);
  background: #211a15;
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 12px;
}

.toast[data-tone='error'] {
  border-color: rgba(215, 135, 123, 0.5);
}

.loading-panel {
  display: grid;
  min-height: 420px;
  place-content: center;
  color: var(--muted);
}

.runbook-shell {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 56px;
}

.runbook-header {
  padding: clamp(28px, 7vw, 58px);
  border: 1px solid var(--border);
  background: rgba(18, 14, 12, 0.92);
  box-shadow: var(--shadow);
}

.runbook-header h1 {
  max-width: 760px;
  margin: 18px 0 0;
  font-family: var(--display);
  font-size: clamp(42px, 7vw, 68px);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 0.98;
}

.runbook-lede {
  max-width: 760px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.runbook-status {
  display: grid;
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 18px;
}

.runbook-status span,
.runbook-marker {
  color: var(--dim);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.runbook-status strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 13px;
  letter-spacing: normal;
  text-transform: none;
}

.runbook-grid {
  display: grid;
  margin-top: 18px;
  gap: 18px;
}

.runbook-card {
  padding: 24px;
  border: 1px solid var(--border);
  background: rgba(21, 17, 15, 0.9);
}

.runbook-card h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 28px;
  font-weight: 500;
}

.runbook-card ol,
.runbook-card ul {
  margin: 16px 0 0;
  padding-left: 20px;
  color: var(--muted);
}

.runbook-card li + li {
  margin-top: 10px;
}

.runbook-callout {
  margin-top: 18px;
  padding: 20px 22px;
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--gold);
  background: rgba(33, 26, 21, 0.92);
  color: var(--muted);
}

.runbook-callout strong {
  color: var(--gold-bright);
}

.runbook-footer {
  display: flex;
  margin-top: 24px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.runbook-footer a {
  display: inline-flex;
  padding: 0 16px;
  border: 1px solid var(--border-strong);
  align-items: center;
  color: var(--gold-bright);
}

@media (min-width: 720px) {
  .login-layout {
    grid-template-columns: minmax(0, 1.15fr) minmax(330px, 0.85fr);
  }

  .metrics-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .toolbar {
    grid-template-columns: minmax(280px, 1fr) 190px 190px;
  }

  .page-title p,
  .live-status {
    display: flex;
  }

  .runbook-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1060px) {
  .mobile-sign-out {
    display: none;
  }

  .admin-shell {
    grid-template-columns: 244px minmax(0, 1fr);
  }

  .sidebar {
    position: sticky;
    top: 0;
    display: flex;
    width: 244px;
    height: 100vh;
    border-top: 0;
    border-right: 1px solid var(--border);
    flex-direction: column;
    background: rgba(14, 11, 9, 0.92);
  }

  .sidebar-header,
  .sidebar-context,
  .sidebar-footer {
    display: block;
  }

  .sidebar-header {
    padding: 24px 22px;
    border-bottom: 1px solid var(--border);
  }

  .sidebar-context {
    margin: 18px 16px 8px;
    padding: 12px;
    border-left: 2px solid var(--gold-deep);
    color: var(--muted);
    font-size: 11px;
  }

  .sidebar-context strong {
    display: block;
    margin-bottom: 3px;
    color: var(--text);
    font-size: 11px;
  }

  .sidebar-nav {
    display: grid;
    padding: 8px 12px;
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .nav-button {
    min-height: 46px;
    padding: 0 13px;
    border-radius: 6px;
    grid-template-columns: 7px 1fr;
    place-items: center start;
    gap: 11px;
    font-size: 11px;
    letter-spacing: 0.02em;
  }

  .sidebar-footer {
    margin-top: auto;
    padding: 18px 16px;
    border-top: 1px solid var(--border);
  }

  .role-badge {
    margin-bottom: 10px;
    color: var(--gold-bright);
  }

  .sidebar-links {
    display: grid;
    margin: 4px 0 14px;
  }

  .sidebar-links a {
    display: flex;
    min-height: 40px;
    align-items: center;
    color: var(--dim);
    font-size: 11px;
  }

  .sidebar-links a:hover {
    color: var(--gold-bright);
  }

  .workspace {
    padding-bottom: 0;
  }

  .topbar {
    min-height: 82px;
    padding: 14px 28px;
  }

  .content {
    padding: 26px 28px 52px;
  }

  .overview-grid {
    grid-template-columns: minmax(0, 1.55fr) minmax(310px, 0.65fr);
  }

  .toast-region {
    bottom: 22px;
  }
}

@media (min-width: 1320px) {
  .sidebar {
    width: 262px;
  }

  .admin-shell {
    grid-template-columns: 262px minmax(0, 1fr);
  }

  .content {
    padding-right: 38px;
    padding-left: 38px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
