/* Heroes Ascend admin — desktop first, usable on a phone. No external fonts or scripts (CSP: self only). */
:root {
  --bg: #f4f5f8; --panel: #ffffff; --ink: #1c2230; --ink-2: #4a5468; --ink-3: #7b8496; --line: #dfe3ea;
  --navy: #142036; --navy-2: #1f2f4d; --gold: #b8914a; --gold-2: #8a6a2e;
  --ok: #1f7a4d; --ok-bg: #e5f4ec; --warn: #9a6400; --warn-bg: #fdf3dc; --bad: #b42318; --bad-bg: #fde8e6; --info: #2457a8; --info-bg: #e7eefb;
  --radius: 8px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
a { color: var(--info); }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: 20px; margin: 0 0 4px; } h2 { font-size: 16px; margin: 0 0 10px; } h3 { font-size: 14px; margin: 14px 0 8px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.muted { color: var(--ink-3); } .small { font-size: 12px; } .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .grow { flex: 1; } .right { margin-left: auto; }
.stack > * + * { margin-top: 12px; }

/* environment banner: impossible to miss which system you are touching */
.env-banner { position: sticky; top: 0; z-index: 30; text-align: center; font-weight: 700; letter-spacing: .08em; font-size: 12px; padding: 5px 8px; color: #fff; }
.env-development { background: #2e7d4f; } .env-staging { background: #b7791f; } .env-production { background: #b42318; }
.env-demo { background: repeating-linear-gradient(45deg, #5b3fa3, #5b3fa3 12px, #6d4fb8 12px, #6d4fb8 24px); }

.app { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 26px); }
.side { background: var(--navy); color: #dfe5f1; padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; }
.brand { font-weight: 700; color: #fff; padding: 2px 10px 14px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 8px; }
.brand small { display: block; color: var(--gold); font-weight: 600; letter-spacing: .06em; font-size: 11px; text-transform: uppercase; }
.nav a { display: block; padding: 8px 10px; border-radius: 6px; color: #cdd5e4; text-decoration: none; }
.nav a:hover { background: var(--navy-2); color: #fff; }
.nav a.on { background: var(--navy-2); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.side .who { margin-top: auto; font-size: 12px; color: #a9b3c7; padding: 10px; border-top: 1px solid rgba(255,255,255,.08); }
.side .who b { color: #fff; }
.main { padding: 22px 26px 60px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.grid { display: grid; gap: 14px; } .g4 { grid-template-columns: repeat(4, 1fr); } .g2 { grid-template-columns: 1fr 1fr; } .g3 { grid-template-columns: repeat(3, 1fr); }
.stat .n { font-size: 26px; font-weight: 700; } .stat .l { color: var(--ink-3); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }

.btn { border: 1px solid var(--line); background: #fff; padding: 7px 12px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #c4cad6; } .btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; } .btn.primary:hover { background: var(--navy-2); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; } .btn.ghost { border-color: transparent; background: transparent; color: var(--info); }
.btn.sm { padding: 4px 9px; font-size: 12.5px; }
input[type=text], input[type=password], input[type=number], input[type=datetime-local], input[type=search], select, textarea {
  border: 1px solid #cfd5df; border-radius: 6px; padding: 7px 9px; background: #fff; width: 100%; }
textarea { min-height: 64px; resize: vertical; }
label { display: block; font-weight: 600; font-size: 12.5px; color: var(--ink-2); margin-bottom: 4px; }
.field { margin-bottom: 12px; } .field .hint { font-weight: 400; color: var(--ink-3); font-size: 12px; margin-top: 3px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; color: var(--ink); } .check input { margin-top: 3px; }

table { width: 100%; border-collapse: collapse; } th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); font-weight: 600; background: #fafbfc; }
tr.click { cursor: pointer; } tr.click:hover td { background: #f7f9fc; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid transparent; }
.b-ok { background: var(--ok-bg); color: var(--ok); } .b-warn { background: var(--warn-bg); color: var(--warn); } .b-bad { background: var(--bad-bg); color: var(--bad); }
.b-info { background: var(--info-bg); color: var(--info); } .b-mute { background: #eef0f4; color: var(--ink-2); }

.state { padding: 26px; text-align: center; color: var(--ink-3); } .state.err { color: var(--bad); background: var(--bad-bg); border-radius: var(--radius); }
.notice { padding: 10px 12px; border-radius: 6px; font-size: 13px; } .notice.warn { background: var(--warn-bg); color: #6b4a00; } .notice.err { background: var(--bad-bg); color: var(--bad); }
.notice.ok { background: var(--ok-bg); color: var(--ok); } .notice.info { background: var(--info-bg); color: #1d3f78; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid #c8cfdb; border-top-color: var(--navy); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 6px 0 14px; flex-wrap: wrap; }
.tabs button { border: 0; background: none; padding: 8px 12px; cursor: pointer; color: var(--ink-2); border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--gold); font-weight: 600; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 10px 0; color: var(--ink-3); }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 12px; } .kv div:nth-child(odd) { color: var(--ink-3); }
.diff { display: flex; gap: 12px; align-items: center; font-size: 22px; font-weight: 700; } .diff .arrow { color: var(--ink-3); }
.diff .up { color: var(--ok); } .diff .down { color: var(--bad); }
.internal { border-left: 3px solid var(--warn); background: #fffaf0; padding: 6px 10px; } .player-facing { border-left: 3px solid var(--info); background: #f4f8ff; padding: 6px 10px; }

.login { max-width: 380px; margin: 9vh auto; } .login .card { padding: 26px; }
.boot { padding: 40px; color: var(--ink-3); }

.modal-scrim { position: fixed; inset: 0; background: rgba(15,22,35,.45); z-index: 40; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 12px; overflow-y: auto; }
.modal { background: #fff; border-radius: 10px; width: min(560px, 100%); box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal header { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.modal .body { padding: 16px 18px; } .modal footer { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }

.toast { position: fixed; right: 18px; bottom: 18px; z-index: 50; padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow); max-width: 420px; }
.toast.ok { background: var(--ok); color: #fff; } .toast.err { background: var(--bad); color: #fff; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { flex-direction: row; align-items: center; padding: 8px 10px; overflow-x: auto; }
  .brand { border: 0; padding: 0 8px 0 2px; margin: 0; white-space: nowrap; } .brand small { display: none; }
  .nav { display: flex; gap: 2px; } .nav a { padding: 6px 9px; white-space: nowrap; }
  .side .who { display: none; }
  .main { padding: 14px 12px 50px; }
  .g4 { grid-template-columns: 1fr 1fr; } .g2, .g3 { grid-template-columns: 1fr; } .kv { grid-template-columns: 120px 1fr; }
}

/* ---- events (D-606) */
.card.dev { border-color: #e4c98a; background: #fffaf0; }
.cal { position: relative; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #f6f3ea; margin: 8px 0; }
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--navy); }
.cal-day { color: #cdd5e4; text-align: center; font-size: 12px; padding: 6px 2px; border-right: 1px solid rgba(255,255,255,.06); }
.cal-day.today { background: #2b3f66; color: #fff; font-weight: 700; box-shadow: inset 0 -3px 0 var(--gold); }
.cal-row { padding: 4px 0; background-image: linear-gradient(to right, rgba(0,0,0,.05) 1px, transparent 1px); background-size: calc(100% / 7) 100%; }
.cal-bar { height: 28px; line-height: 28px; border-radius: 6px; padding: 0 10px; color: #fff; font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: inset 0 -2px 0 rgba(0,0,0,.2); }
.cal-bar.t-city_development { background: linear-gradient(#d9a441, #b9832a); }
.cal-bar.t-army_preparation { background: linear-gradient(#7b5bc4, #5d42a0); }
.cal-bar.t-academy_advancement { background: linear-gradient(#3e78c6, #2b5a9e); }
.cal-bar.t-heralds_ascent { background: linear-gradient(#b83a3e, #8f2629); }
.cal-bar.t-login_reward { background: linear-gradient(#3d9a6a, #2b7a51); }
.cal-bar.s-draft { opacity: .55; background: repeating-linear-gradient(45deg, #9aa3b4, #9aa3b4 8px, #8a93a4 8px, #8a93a4 16px); color: #1c2230; }
.cal-bar.s-cancelled { opacity: .45; text-decoration: line-through; }
.cal-bar.s-ended { filter: saturate(.35); }
.cal-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--gold); pointer-events: none; }
.tpl-card { display: flex; gap: 12px; align-items: center; text-align: left; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 10px; cursor: pointer; width: 100%; }
.tpl-card:hover { border-color: var(--gold); }
.tpl-art { width: 150px; height: 60px; border-radius: 6px; background-size: cover; background-position: center; flex: none; }
.art-evt_city { background-image: url('art/evt_city.jpg'); } .art-evt_army { background-image: url('art/evt_army.jpg'); }
.art-evt_academy { background-image: url('art/evt_academy.jpg'); } .art-evt_herald { background-image: url('art/evt_herald.jpg'); }
.evt-banner { height: 170px; border-radius: 10px; background-size: cover; background-position: center; padding: 18px 20px; color: #fff; position: relative; }
.evt-title { font-size: 26px; font-weight: 800; color: #f6dc93; text-shadow: 0 2px 6px rgba(0,0,0,.7); }
.evt-sub { max-width: 60%; font-size: 13px; text-shadow: 0 1px 4px rgba(0,0,0,.8); }
.evt-time { position: absolute; bottom: 12px; left: 20px; font-size: 12px; background: rgba(8,13,28,.75); padding: 3px 8px; border-radius: 999px; }
.ms-track { display: flex; gap: 10px; flex-wrap: wrap; } .ms { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-width: 140px; background: #fff; }
.ms-box { border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: #fafbfc; }
.chest { display: inline-block; width: 22px; height: 18px; border-radius: 4px 4px 3px 3px; vertical-align: -4px; margin-right: 6px; box-shadow: inset 0 -5px 0 rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.2); }
.chest.c-bronze { background: #b0703b; } .chest.c-silver { background: #9aa6b6; } .chest.c-gold { background: #e0b444; } .chest.c-royal { background: #7b5bc4; }
table.compact td { padding: 4px 8px; }

/* ---- Store (D-613) */
.art-pack_starter { background-image: url('art/pack_starter.jpg'); } .art-pack_builder { background-image: url('art/pack_builder.jpg'); }
.art-pack_muster { background-image: url('art/pack_muster.jpg'); } .art-pack_scholar { background-image: url('art/pack_scholar.jpg'); }
.art-pack_crown { background-image: url('art/pack_crown.jpg'); } .art-pack_sovereign { background-image: url('art/pack_sovereign.jpg'); }
.pv { background: #0b1222; color: #efe8d1; border: 1px solid #b8914a; border-radius: 12px; overflow: hidden; max-width: 460px; box-shadow: var(--shadow); }
.pv-art { height: 170px; background-size: cover; background-position: center; position: relative; padding: 14px 16px; }
.pv-title { font-size: 22px; font-weight: 800; color: #f6dc93; text-shadow: 0 2px 6px rgba(0,0,0,.8); }
.pv-sub { font-size: 12.5px; color: #ffe9b8; text-shadow: 0 1px 4px rgba(0,0,0,.9); margin-top: 2px; }
.pv-vip { position: absolute; top: 12px; right: 12px; background: rgba(8,13,28,.85); color: #9ef29a; font-weight: 700; font-size: 12.5px; padding: 3px 10px; border-radius: 999px; }
.pv-ends { position: absolute; bottom: 10px; right: 12px; background: rgba(8,13,28,.85); color: #fff; font-size: 12px; padding: 3px 10px; border-radius: 999px; }
.pv-items { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 14px 4px; }
.pv-item { width: 92px; background: #17233f; border-radius: 6px; padding: 6px; text-align: center; font-size: 11.5px; line-height: 1.25; }
.pv-item b { display: block; color: #fff; font-size: 13px; }
.pv-foot { display: flex; align-items: center; gap: 10px; padding: 10px 14px 14px; font-size: 12.5px; color: #c9c1a8; }
.pv-buy { margin-left: auto; background: #d9a840; color: #33210a; font-weight: 800; border-radius: 999px; padding: 8px 16px; white-space: nowrap; }
.pv-note { padding: 0 14px 12px; font-size: 11.5px; color: #8f97aa; }
.b-warn2 { background: var(--warn-bg); color: var(--warn); }

.modal.wide { width: min(1120px, 96vw); max-width: min(1120px, 96vw); }
.mail-body { white-space: pre-wrap; font-size: 13px; margin: 6px 0 0; background: #fff; border: 1px solid #eee2c4; border-radius: 6px; padding: 10px; }
.n.big { font-size: 30px; font-weight: 700; } td.pos { color: #1f7a3a; font-weight: 600; } td.neg { color: #a33a2c; font-weight: 600; } pre.mono { white-space: pre-wrap; max-height: 320px; overflow: auto; margin: 0; }
