:root {
  color-scheme: dark;
  --bg: #07110f;
  --surface: rgba(13, 29, 25, 0.76);
  --surface-strong: #10251f;
  --line: rgba(180, 231, 212, 0.13);
  --text: #eefbf6;
  --muted: #8ca69d;
  --mint: #76f0bc;
  --mint-strong: #36d995;
  --danger: #ff8b8b;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.34);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); overflow-x: hidden; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.ambient { position: fixed; width: 560px; height: 560px; border-radius: 999px; filter: blur(110px); opacity: .16; pointer-events: none; }
.ambient-a { background: #36d995; top: -260px; right: -140px; }
.ambient-b { background: #397dff; bottom: -340px; left: -180px; opacity: .1; }
.shell { width: min(1440px, calc(100% - 40px)); margin: 0 auto; padding: 24px 0 64px; position: relative; z-index: 1; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 6px 0 32px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: linear-gradient(135deg, var(--mint), #2cba83); color: #052017; font-weight: 900; box-shadow: 0 12px 35px rgba(54, 217, 149, .2); }
.brand div { display: grid; gap: 1px; }
.brand strong { font-size: 15px; letter-spacing: .01em; }
.brand span:not(.brand-mark) { color: var(--muted); font-size: 12px; }
.status-pill { border: 1px solid var(--line); background: rgba(8, 22, 18, .55); padding: 9px 13px; border-radius: 999px; color: #b4cbc2; font-size: 12px; display: flex; align-items: center; gap: 8px; }
.status-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 14px var(--mint); }
.glass { background: linear-gradient(145deg, rgba(17, 38, 32, .88), rgba(10, 25, 21, .7)); border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: blur(20px); }

.login-wrap { min-height: calc(100vh - 150px); display: grid; place-items: center; padding-bottom: 100px; }
.login-card { width: min(650px, 100%); padding: clamp(28px, 5vw, 54px); border-radius: 28px; }
.eyebrow { margin: 0 0 10px; color: var(--mint); font-weight: 800; font-size: 10px; letter-spacing: .18em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 12px; font-size: clamp(30px, 4.5vw, 52px); line-height: 1.04; letter-spacing: -.045em; }
h2 { margin-bottom: 0; font-size: 20px; letter-spacing: -.02em; }
.muted { color: var(--muted); line-height: 1.7; }
form label:not(.drop-zone) { display: block; margin: 24px 0 8px; font-size: 12px; color: #b9cec6; font-weight: 700; }
input, select { width: 100%; border: 1px solid var(--line); background: rgba(4, 15, 12, .72); color: var(--text); border-radius: 13px; padding: 13px 14px; outline: none; transition: border-color .2s, box-shadow .2s; }
input:focus, select:focus { border-color: rgba(118, 240, 188, .58); box-shadow: 0 0 0 4px rgba(118, 240, 188, .08); }
.token-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
button { border: 0; border-radius: 13px; padding: 12px 18px; font-weight: 800; transition: transform .18s, opacity .18s, background .18s; }
button:hover { transform: translateY(-1px); }
button:disabled { opacity: .55; cursor: wait; transform: none; }
.primary { color: #062117; background: linear-gradient(135deg, var(--mint), var(--mint-strong)); box-shadow: 0 12px 28px rgba(54, 217, 149, .17); }
.ghost { color: #bfd5cd; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.danger-text { color: var(--danger); }
.full { width: 100%; margin-top: 16px; }
.form-error { min-height: 20px; margin: 10px 0 0; color: var(--danger); font-size: 12px; }
.form-status { min-height: 20px; margin: 10px 0 0; color: var(--mint); font-size: 12px; }

.dashboard { animation: enter .4s ease both; }
@keyframes enter { from { opacity: 0; transform: translateY(10px); } }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 24px 0 28px; }
.page-heading h1 { font-size: clamp(30px, 4vw, 48px); margin: 0; }
.heading-actions { display: flex; gap: 8px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.metric-card { min-height: 158px; border-radius: 20px; padding: 22px; display: flex; flex-direction: column; }
.metric-card > span { color: #a9c1b8; font-size: 12px; }
.metric-card strong { font-size: clamp(32px, 4vw, 48px); margin: 14px 0 8px; letter-spacing: -.045em; }
.metric-card small { color: var(--muted); margin-top: auto; }
.accent-card { background: linear-gradient(145deg, rgba(31, 82, 65, .88), rgba(9, 35, 27, .75)); }
.content-grid { display: grid; grid-template-columns: minmax(320px, .82fr) minmax(480px, 1.4fr); gap: 14px; margin-top: 14px; }
.panel { border-radius: 22px; padding: 22px; }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.panel-title .eyebrow { margin-bottom: 6px; }
.drop-zone { margin-top: 8px; min-height: 150px; border: 1px dashed rgba(118, 240, 188, .32); background: rgba(5, 19, 15, .4); border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 20px; cursor: pointer; }
.drop-zone:hover { border-color: var(--mint); background: rgba(54, 217, 149, .05); }
.drop-zone input { display: none; }
.drop-zone small { color: var(--muted); max-width: 330px; line-height: 1.45; }
.upload-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: var(--mint); background: rgba(118, 240, 188, .1); font-size: 22px; }
.period-panel { min-height: 430px; }
.period-panel select { width: min(220px, 48%); }
.period-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.period-number { min-height: 128px; display: flex; flex-direction: column; justify-content: space-between; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: rgba(4, 18, 14, .42); }
.period-number span { color: #9ab2a9; font-size: 12px; }
.period-number strong { font-size: clamp(32px, 4vw, 46px); letter-spacing: -.04em; }
.period-note { margin: 18px 0 0; color: var(--muted); font-size: 11px; }
.table-panel { margin-top: 14px; }
.count-badge { color: var(--muted); font-size: 11px; border: 1px solid var(--line); border-radius: 999px; padding: 7px 10px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 900px; }
th { text-align: left; color: #789087; font-size: 10px; letter-spacing: .09em; text-transform: uppercase; padding: 10px 12px; border-bottom: 1px solid var(--line); }
td { padding: 16px 12px; border-bottom: 1px solid rgba(180, 231, 212, .08); color: #cce0d8; font-size: 12px; }
td:first-child { color: var(--text); font-weight: 750; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.row-actions { display: flex; justify-content: flex-end; gap: 6px; }
.row-actions button { padding: 7px 10px; border-radius: 9px; font-size: 11px; color: #bcd4cb; background: rgba(255, 255, 255, .045); border: 1px solid var(--line); }
.row-actions .delete { color: var(--danger); }
.empty-state { text-align: center; color: var(--muted); padding: 38px; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 20; background: #10271f; border: 1px solid rgba(118, 240, 188, .28); box-shadow: var(--shadow); border-radius: 13px; padding: 12px 16px; color: #dff9ee; transform: translateY(80px); opacity: 0; transition: .25s ease; }
.toast.show { transform: translateY(0); opacity: 1; }

@media (max-width: 980px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .content-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .shell { width: min(100% - 24px, 1440px); padding-top: 14px; }
  .topbar { padding-bottom: 16px; }
  .status-pill { display: none; }
  .token-row { grid-template-columns: 1fr; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metric-card { min-height: 132px; padding: 16px; }
  .metric-card strong { font-size: 30px; }
  .panel { padding: 17px; }
  .period-panel { min-height: auto; }
  .period-grid { gap: 8px; }
  .period-number { min-height: 112px; padding: 14px; }
}
