@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Fredoka:wght@300;400;500;600&display=swap');

:root {
  --bg: #0c0c0e;
  --panel: rgba(255,255,255,0.035);
  --panel-border: rgba(255,255,255,0.08);
  --fg1: #f2f0ea;
  --fg2: rgba(242,240,234,0.66);
  --fg3: rgba(242,240,234,0.42);
  --gold: #ffd166;
  --gold-mid: #ffb347;
  --green: #7fd1a3;
  --red: #e5766e;
  --serif: 'Instrument Serif', Georgia, serif;
  --cream: #f3ead2;
  --sans: 'Fredoka', -apple-system, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg1); font-family: var(--sans); font-size: 14px; }
a { color: var(--gold); text-decoration: none; }
button { font: inherit; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 28px 24px 64px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand .wordmark { height: 30px; width: auto; display: block; }
.brand .who { color: var(--fg3); font-size: 12px; }
.brand .who b { color: var(--fg2); font-weight: 500; }
.controls { display: flex; align-items: center; gap: 10px; }
.seg { display: inline-flex; border: 1px solid var(--panel-border); border-radius: 999px; overflow: hidden; }
.seg button { background: transparent; border: 0; color: var(--fg2); padding: 6px 12px; cursor: pointer; }
.seg button.on { background: rgba(255,209,102,0.14); color: var(--gold); }
.ghost { background: transparent; border: 1px solid var(--panel-border); color: var(--fg2); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.ghost:hover { color: var(--fg1); }

.grid { display: grid; gap: 14px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 14px; }
.two { grid-template-columns: 1.4fr 1fr; }
@media (max-width: 860px) { .two { grid-template-columns: 1fr; } }

.card { background: var(--panel); border: 1px solid var(--panel-border); border-radius: 16px; padding: 16px 18px; min-width: 0; }
.card h2 { font-family: var(--serif); font-weight: 400; font-size: 20px; margin: 0 0 4px; }
.card .sub { color: var(--fg3); font-size: 12px; margin-bottom: 12px; }
.kpi .label { color: var(--fg3); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.kpi .value { font-family: var(--serif); font-size: 34px; line-height: 1.1; margin-top: 6px; }
.kpi .hint { color: var(--fg2); font-size: 12px; margin-top: 4px; }
.kpi.good .value { color: var(--green); }
.kpi.warn .value { color: var(--red); }
.kpi.gold .value { color: var(--gold); }

.section { margin-top: 22px; }
.chart { position: relative; height: 240px; }
.chart.tall { height: 360px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--fg3); font-weight: 500; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; padding: 8px 8px; border-bottom: 1px solid var(--panel-border); }
td { padding: 9px 8px; border-bottom: 1px solid rgba(255,255,255,0.05); color: var(--fg2); vertical-align: top; }
td.name { color: var(--fg1); }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
th.num { text-align: right; }
.tablewrap { overflow-x: auto; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; border: 1px solid var(--panel-border); color: var(--fg2); }
.pill.gold { color: var(--gold); border-color: rgba(255,209,102,0.35); }
.pill.green { color: var(--green); border-color: rgba(127,209,163,0.35); }
.pill.red { color: var(--red); border-color: rgba(229,118,110,0.35); }
.empty { color: var(--fg3); padding: 18px 0; text-align: center; font-style: italic; font-family: var(--serif); font-size: 16px; }
.err { color: var(--red); font-size: 12px; margin-top: 8px; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs button { background: transparent; border: 1px solid var(--panel-border); color: var(--fg2); border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.tabs button.on { color: var(--gold); border-color: rgba(255,209,102,0.4); background: rgba(255,209,102,0.08); }
.foot { color: var(--fg3); font-size: 12px; margin-top: 28px; }

/* ── login (split: scene left, form right) ── */
.login-body { overflow: hidden; }
.split { display: grid; grid-template-columns: 1.15fr 1fr; min-height: 100vh; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } .scene { min-height: 34vh; } }
.scene { position: relative; overflow: hidden; background: #0c0c0e; }
.scene-video, .scene-still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scene-video { z-index: 1; opacity: 0; transition: opacity 1s; }
.scene-video.ready { opacity: 1; }
.scene-video.missing { display: none; }
.way { width: 100%; height: 100%; display: block; }
.stars circle { animation: twinkle 6s ease-in-out infinite; }
.stars circle:nth-child(2n) { animation-delay: -2s; } .stars circle:nth-child(3n) { animation-delay: -4s; }
@keyframes twinkle { 0%, 100% { opacity: 0.25; } 50% { opacity: 0.9; } }
.crest { transform-box: fill-box; transform-origin: center; animation: breathe 7s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { opacity: 0.75; transform: scale(1); } 50% { opacity: 1; transform: scale(1.08); } }
.walker { stroke-dasharray: 60 1200; stroke-dashoffset: 1260; animation: walk 9s linear infinite; }
@keyframes walk { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .stars circle, .crest, .walker { animation: none; } }
.scene-fade { position: absolute; inset: 0; z-index: 2; background: linear-gradient(to right, rgba(12,12,14,0) 55%, var(--bg) 100%), linear-gradient(to top, rgba(12,12,14,0.85), rgba(12,12,14,0) 45%); }
@media (max-width: 900px) { .scene-fade { background: linear-gradient(to bottom, rgba(12,12,14,0) 40%, var(--bg) 100%); } }
.scene-copy { position: absolute; left: 40px; bottom: 40px; right: 40px; z-index: 3; }
.scene-wordmark { height: 46px; width: auto; display: block; margin-bottom: 18px; opacity: 0.96; }
.scene-copy p { font-family: var(--serif); font-size: 26px; line-height: 1.2; color: var(--fg1); margin: 0 0 8px; max-width: 22ch; }
.scene-ref { color: var(--gold); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; }
.pane { display: grid; place-items: center; padding: 40px 28px; background: var(--bg); }
.auth { width: 100%; max-width: 360px; }
.auth-mark { height: 44px; width: auto; display: block; margin-bottom: 18px; }
.auth h1 { font-family: var(--serif); font-weight: 400; font-size: 34px; margin: 0 0 6px; letter-spacing: -0.01em; }
.auth-sub { color: var(--fg3); margin: 0 0 26px; }
.auth label { display: block; color: var(--fg3); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; margin: 0 0 6px; }
.auth input { width: 100%; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--panel-border); background: rgba(255,255,255,0.04); color: var(--fg1); font: inherit; font-size: 15px; outline: none; margin-bottom: 16px; transition: border-color 0.15s; }
.auth input:focus { border-color: rgba(255,209,102,0.55); background: rgba(255,255,255,0.055); }
.auth .cta { width: 100%; margin-top: 4px; padding: 13px; border-radius: 12px; border: 0; background: var(--gold-mid); color: #1a1408; font-weight: 600; font-size: 15px; cursor: pointer; transition: transform 0.1s, filter 0.15s; }
.auth .cta:hover { filter: brightness(1.05); }
.auth .cta:active { transform: scale(0.99); }
.auth .cta:disabled { opacity: 0.6; cursor: default; }
.auth .err { min-height: 18px; margin-top: 10px; }
.auth-foot { color: var(--fg3); font-size: 12px; margin-top: 26px; }

/* feedback inbox */
.tickets tr.ticket { cursor: pointer; transition: background 0.12s; }
.tickets tr.ticket:hover td { background: rgba(255,209,102,0.04); }
.tickets tr.done td { opacity: 0.55; }
.tickets td { vertical-align: middle; }
.tickets td.name { white-space: nowrap; }
.tickets td.msg { max-width: 460px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--fg1); }
.tickets td.when { white-space: nowrap; color: var(--fg3); }
.tickets .col-complete { width: 150px; text-align: right; white-space: nowrap; }
.avatar { display: inline-grid; place-items: center; border-radius: 999px; background: linear-gradient(135deg, #3a2f14, #1b1710); color: var(--gold); font-family: var(--serif); letter-spacing: 0.02em; border: 1px solid rgba(255,209,102,0.25); }
.avatar.sm { width: 26px; height: 26px; font-size: 12px; margin-right: 10px; vertical-align: middle; }
.avatar.lg { width: 56px; height: 56px; font-size: 22px; }
.cpill { display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; padding: 6px 14px 6px 10px; font-size: 12px; font-weight: 500; cursor: pointer; border: 1px solid var(--panel-border); background: rgba(255,255,255,0.03); color: var(--fg2); transition: all 0.15s; white-space: nowrap; }
.cpill .dot { width: 8px; height: 8px; border-radius: 999px; background: var(--fg3); box-shadow: 0 0 0 3px rgba(255,255,255,0.05); transition: all 0.15s; }
.cpill:hover { border-color: rgba(127,209,163,0.5); color: var(--green); }
.cpill:hover .dot { background: var(--green); }
.cpill.on { background: rgba(127,209,163,0.14); border-color: rgba(127,209,163,0.55); color: var(--green); }
.cpill.on .dot { background: var(--green); box-shadow: 0 0 0 3px rgba(127,209,163,0.18), 0 0 12px rgba(127,209,163,0.5); }
.cpill:disabled { opacity: 0.6; }
.fb-meta { color: var(--fg3); font-size: 12px; }
/* ticket window */
.modal { position: fixed; inset: 0; background: rgba(6,6,8,0.7); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: grid; place-items: center; padding: 24px; z-index: 50; opacity: 0; transition: opacity 0.18s; }
.modal.in { opacity: 1; }
.sheet { position: relative; width: 100%; max-width: 680px; max-height: 88vh; overflow: auto; background: linear-gradient(180deg, #17171a, #111113); border: 1px solid rgba(255,209,102,0.16); border-radius: 22px; padding: 26px 28px 28px; box-shadow: 0 40px 100px rgba(0,0,0,0.7), inset 0 1px 0 rgba(255,255,255,0.05); transform: translateY(10px) scale(0.985); transition: transform 0.18s; }
.modal.in .sheet { transform: none; }
.sheet .x { position: absolute; top: 14px; right: 16px; width: 34px; height: 34px; border-radius: 999px; border: 1px solid var(--panel-border); background: transparent; color: var(--fg2); font-size: 20px; line-height: 1; cursor: pointer; }
.sheet .x:hover { color: var(--fg1); border-color: var(--fg3); }
.sheet-top { display: flex; align-items: center; gap: 16px; padding-right: 44px; }
.sheet-id { flex: 1; min-width: 0; }
.sheet-name { font-family: var(--serif); font-size: 28px; line-height: 1.1; color: var(--fg1); }
.sheet-sub { color: var(--fg3); font-size: 12px; margin-top: 4px; }
.ticket-card { margin-top: 22px; border: 1px solid var(--panel-border); border-left: 3px solid var(--gold-mid); border-radius: 14px; padding: 14px 16px; background: rgba(255,255,255,0.025); }
.ticket-card-head { display: flex; align-items: center; gap: 10px; }
.ticket-card blockquote { margin: 12px 0 0; font-family: var(--serif); font-size: 20px; line-height: 1.35; color: var(--fg1); white-space: pre-wrap; }
.sheet-section { margin: 22px 0 10px; color: var(--fg3); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 560px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { border: 1px solid var(--panel-border); border-radius: 12px; padding: 12px 14px; background: rgba(255,255,255,0.02); }
.stat b { display: block; font-family: var(--serif); font-size: 26px; line-height: 1; color: var(--fg1); font-weight: 400; }
.stat span { display: block; margin-top: 6px; color: var(--fg3); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
.stat.gold b { color: var(--gold); } .stat.green b { color: var(--green); } .stat.red b { color: var(--red); }
.lines { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
@media (max-width: 560px) { .lines { grid-template-columns: 1fr; } }
.line { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 13px; }
.line span { color: var(--fg3); } .line b { color: var(--fg1); font-weight: 500; text-align: right; }
.line .mono { font-family: ui-monospace, Menlo, monospace; font-size: 10px; color: var(--fg2); word-break: break-all; }

.kpi.skel .label, .kpi.skel .value, .kpi.skel .hint { background: rgba(255,255,255,0.05); border-radius: 6px; color: transparent; animation: pulse 1.2s ease-in-out infinite; }
.kpi.skel .value { height: 34px; width: 40%; } .kpi.skel .label { width: 50%; } .kpi.skel .hint { width: 70%; }
@keyframes pulse { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }
