:root {
  color-scheme: dark;
  --black: #080807;
  --surface: #11110f;
  --surface-raised: #181714;
  --line: #343127;
  --line-soft: #29271f;
  --gold: #f0c95d;
  --gold-bright: #ffe69a;
  --gold-dark: #9b7725;
  --text: #f6f1e6;
  --muted: #aaa398;
  --danger: #f0a294;
  font-family: "Segoe UI", Inter, system-ui, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--black); }
body { margin: 0; color: var(--text); background: var(--black); font-size: 14px; line-height: 1.5; }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; background: radial-gradient(circle at 86% -10%, rgba(192, 135, 27, .12), transparent 38%); }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
input, textarea { width: 100%; padding: 12px 14px; border: 1px solid #504a37; border-radius: 9px; color: var(--text); background: #0b0b0a; outline: none; }
input::placeholder, textarea::placeholder { color: #827d72; }
input:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }
textarea { min-height: 88px; resize: vertical; }
label { display: block; margin-bottom: 7px; color: #dfd6bf; font-weight: 600; }
h1, h2, p { margin-top: 0; }
h1, h2 { line-height: 1.15; letter-spacing: -.035em; }
h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
h2 { margin-bottom: 0; font-size: 1.16rem; }
p { color: var(--muted); }
small { color: var(--muted); }

.shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; position: relative; }
.sidebar { display: flex; flex-direction: column; gap: 34px; padding: 28px 16px; border-right: 1px solid var(--line-soft); background: #0d0d0c; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px; font-size: 24px; font-weight: 850; letter-spacing: -.06em; }
.brand img { width: 48px; height: 48px; object-fit: contain; }
.brand span { display: flex; flex-direction: column; line-height: .9; }
.brand small { margin-top: 6px; color: var(--gold); font-size: 10px; font-weight: 750; letter-spacing: .23em; }
.sidebar nav { display: grid; gap: 5px; }
.nav-link { padding: 11px 13px; border: 1px solid transparent; border-radius: 9px; color: #bdb7a9; font-weight: 600; transition: color .15s, background .15s, border-color .15s; }
.nav-link:hover { color: var(--text); background: #1a1916; }
.nav-link.active { color: var(--gold-bright); border-color: #594625; background: linear-gradient(90deg, #302617, #1c1a15); }
.sidebar-bottom { margin-top: auto; }
.logout { width: 100%; padding: 11px 13px; text-align: left; border: 0; border-radius: 9px; color: var(--muted); background: transparent; }
.logout:hover { color: var(--text); background: #1a1916; }
.main { min-width: 0; max-width: 1600px; width: 100%; padding: 0 clamp(20px, 3.4vw, 52px) 56px; margin: 0 auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 77px; margin-bottom: 28px; border-bottom: 1px solid var(--line-soft); color: #c4beaf; font-size: 13px; font-weight: 600; }
.divider { margin: 0 8px; color: var(--gold-dark); }
.private-tag { padding: 5px 9px; border: 1px solid #5a4827; border-radius: 5px; color: var(--gold); font-size: 10px; letter-spacing: .14em; }

.hero { position: relative; display: flex; align-items: center; justify-content: space-between; min-height: 218px; padding: 34px clamp(24px, 4vw, 48px); overflow: hidden; border: 1px solid #5d4720; border-radius: 17px; background: radial-gradient(circle at 83% 43%, #634414 0, #2b2112 24%, #171512 56%, #11110f 100%); }
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, transparent 30%, rgba(255, 207, 96, .05)); }
.hero-copy { position: relative; z-index: 1; }
.eyebrow { margin-bottom: 12px; color: var(--gold); font-size: 11px; font-weight: 800; letter-spacing: .2em; }
.hero h1 { margin-bottom: 10px; font-size: clamp(2.5rem, 5vw, 4rem); }
.hero p { max-width: 430px; margin-bottom: 0; color: #d4c7a8; font-size: 15px; }
.hero-coin { z-index: 1; width: clamp(160px, 21vw, 248px); height: auto; margin: -28px 18px -32px 0; filter: drop-shadow(0 20px 26px rgba(0, 0, 0, .5)); }
.panel { min-width: 0; margin-top: 20px; padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.approval-panel { margin-top: 22px; background: linear-gradient(135deg, #17150f, #11110f 55%); }
.compact-panel { margin-top: 0; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 19px; }
.section-heading p { margin: 6px 0 0; }
.approval-form { max-width: 780px; }
.input-action { display: flex; align-items: stretch; gap: 10px; }
.input-action input { min-width: 0; flex: 1; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 43px; padding: 10px 18px; white-space: nowrap; border: 1px solid #625537; border-radius: 9px; color: var(--gold-bright); background: #282319; font-weight: 750; transition: transform .15s, background .15s, border-color .15s; }
.button:hover { transform: translateY(-1px); background: #3a301c; border-color: var(--gold); }
.button.primary { border-color: #e8b94c; color: #171309; background: linear-gradient(180deg, #ffe18b, #ddb044); box-shadow: inset 0 1px rgba(255, 255, 255, .35); }
.button.primary:hover { background: linear-gradient(180deg, #fff0b2, #f0c45a); }
.button.small { min-height: 40px; padding: 7px 13px; }
.button.subtle-danger { color: #ffc0b6; border-color: #74453d; background: #33201d; }
.button.subtle-danger:hover { background: #482921; border-color: #ac6457; }
.button.wide { width: 100%; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
.stat-card { min-width: 0; padding: 19px 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-raised); }
.stat-label { display: block; color: #bcb19a; font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.stat-card strong { display: block; margin-top: 11px; color: var(--gold-bright); font-size: clamp(1.45rem, 2.4vw, 2.2rem); font-variant-numeric: tabular-nums; line-height: 1.1; }
.unit { color: var(--muted); font-size: .55em; font-weight: 600; }
.page-heading { margin: 8px 0 25px; }
.page-heading h1 { margin: 0 0 7px; }
.page-heading p { margin: 0; }
.page-heading .text-link { display: inline-block; margin-bottom: 17px; }
.search { display: flex; gap: 8px; width: min(100%, 390px); }
.search input { min-width: 0; }
.table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--line-soft); border-radius: 9px; }
table { width: 100%; min-width: 680px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 13px 15px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line-soft); }
tr:last-child td { border-bottom: 0; }
th { color: #b4a990; background: #1b1914; font-size: 10px; font-weight: 800; letter-spacing: .11em; white-space: nowrap; }
td { color: #e0d9cc; }
tbody tr:hover { background: #1b1a16; }
.person { display: inline-flex; flex-direction: column; gap: 1px; }
.person strong { color: var(--text); font-weight: 650; }
.person small { font-size: 11px; white-space: nowrap; }
.person:hover strong, .mono-link:hover, .text-link:hover { color: var(--gold-bright); }
.amount { white-space: nowrap; font-weight: 700; }
.amount.positive { color: #a8d9a5; }
.amount.negative { color: #f0a294; }
.badge { display: inline-block; padding: 4px 9px; border: 1px solid; border-radius: 999px; font-size: 11px; font-weight: 750; white-space: nowrap; }
.badge.good { color: #b9dba8; border-color: #405c38; background: #1c2a1a; }
.badge.pending { color: var(--gold-bright); border-color: #715b30; background: #302719; }
.badge.danger { color: #ffc0b6; border-color: #71463e; background: #331f1c; }
.empty { padding: 25px; color: var(--muted); text-align: center; }
.text-link { color: var(--gold); font-weight: 700; white-space: nowrap; }
.mono-link, .uuid { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; overflow-wrap: anywhere; }
.mono-link { color: var(--gold); }
.muted { color: var(--muted); }
.event-tag { display: inline-block; padding: 3px 7px; border-radius: 5px; color: #e7d5a7; background: #2b261b; font-size: 11px; font-weight: 700; text-transform: capitalize; white-space: nowrap; }
.event-details summary { color: var(--gold); cursor: pointer; }
.event-details[open] { min-width: 200px; }
.event-details div { margin-top: 7px; overflow-wrap: anywhere; font-size: 11px; }
.event-details pre { max-width: 300px; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); font-size: 11px; }
.access-panel { display: flex; align-items: center; justify-content: space-between; gap: 25px; }
.access-panel h2 { margin: 6px 0 4px; font-size: 1.5rem; }
.access-panel p { margin: 0; }
.inline-form { width: min(100%, 440px); }
.two-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.stack-form { display: flex; flex-direction: column; align-items: flex-start; }
.stack-form input, .stack-form textarea { margin-bottom: 15px; }
.settings-panel { max-width: 1100px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 19px 24px; }
.settings-grid small { display: block; margin: -3px 0 7px; }
.settings-submit { display: flex; align-items: end; gap: 14px; margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line-soft); }
.settings-submit > div { flex: 1; }
.login-body { display: grid; min-height: 100vh; padding: 24px; place-items: center; }
.login-card { position: relative; width: min(100%, 420px); padding: 34px; border: 1px solid #5d4924; border-radius: 18px; background: linear-gradient(155deg, #1b1914, #10100e 56%); box-shadow: 0 30px 80px rgba(0, 0, 0, .45); text-align: center; }
.login-coin { width: 112px; height: 112px; object-fit: contain; margin-bottom: 18px; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .5)); }
.login-card h1 { margin: 0 0 6px; font-size: 3rem; color: var(--gold-bright); }
.login-card p { margin-bottom: 26px; }
.login-card form { text-align: left; }
.login-card form input { margin-bottom: 18px; }
.alert { margin-bottom: 18px; padding: 10px 13px; border: 1px solid #854e43; border-radius: 8px; color: #ffc6b7; background: #35201c; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 850px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 20px; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: 2px; order: 3; width: 100%; }
  .nav-link { padding: 8px 10px; }
  .sidebar-bottom { margin: 0; }
  .logout { width: auto; }
  .main { padding-bottom: 35px; }
  .topbar { min-height: 56px; margin-bottom: 20px; }
}
@media (max-width: 620px) {
  .hero { min-height: 188px; padding: 24px; }
  .hero-coin { width: 128px; margin: -10px -45px -16px 0; opacity: .65; }
  .hero-copy { max-width: 235px; }
  .hero h1 { font-size: 2.5rem; }
  .hero p { font-size: 13px; }
  .stats, .two-column, .settings-grid { grid-template-columns: 1fr; }
  .stats { gap: 10px; }
  .stat-card { padding: 16px; }
  .stat-card strong { margin-top: 4px; }
  .panel { padding: 18px; }
  .section-heading, .access-panel, .settings-submit { align-items: flex-start; flex-direction: column; }
  .section-heading .search, .inline-form, .settings-submit > div { width: 100%; }
  .input-action { flex-direction: column; }
  .input-action .button { width: 100%; }
  .settings-submit .button { width: 100%; }
  .private-tag { font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
