@font-face { font-family: "Lalezar"; src: url("fonts/Lalezar.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Readex"; src: url("fonts/ReadexPro.ttf") format("truetype"); font-display: swap; }

:root {
  --bg: #1A120E; --surface: #3E2A20; --surface2: #2c1d16; --line: #5a3f2c;
  --brass: #E5A13A; --brass-light: #F8D894; --brass-dark: #9C6A1E;
  --teal: #3B6A63; --rose: #B82A4B; --mint: #7FBF8E; --text: #F7E8D1; --muted: #C4B297;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 "Readex", system-ui, sans-serif; }
a { color: var(--brass); }
h1, h2, h3, .num, .brand, button { font-family: "Lalezar", "Readex", sans-serif; font-weight: 400; }
h2 { color: var(--brass-light); margin: 0 0 12px; font-size: 24px; }
h3 { color: var(--brass-light); margin: 0 0 8px; font-size: 18px; }

/* layout */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
nav { background: var(--surface2); border-left: 1px solid var(--line); padding: 18px 12px; position: sticky; top: 0; height: 100vh; }
nav .brand { display: flex; align-items: center; gap: 8px; color: var(--brass-light); font-size: 22px; margin-bottom: 18px; }
nav .brand img { width: 38px; }
nav a { display: block; padding: 9px 12px; border-radius: 10px; color: var(--text); text-decoration: none; margin-bottom: 2px; }
nav a.on, nav a:hover { background: var(--surface); color: var(--brass-light); }
nav .who { position: absolute; bottom: 16px; right: 12px; left: 12px; color: var(--muted); font-size: 13px; }
main { padding: 22px 26px 60px; max-width: 1200px; }

/* cards */
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); margin-bottom: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; position: relative; }
.card .k { color: var(--muted); font-size: 13px; }
.card .num { font-size: 32px; color: var(--brass-light); line-height: 1.2; }
.card.ok .num { color: var(--mint); } .card.bad .num { color: #ff8a8a; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; margin-bottom: 16px; }
.bar { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.bar .l { width: 110px; color: var(--muted); font-size: 13px; }
.bar .t { flex: 1; background: var(--surface2); border-radius: 6px; height: 14px; overflow: hidden; }
.bar .f { height: 100%; background: linear-gradient(90deg, var(--brass-dark), var(--brass)); border-radius: 6px; }
.bar .v { width: 90px; text-align: left; font-variant-numeric: tabular-nums; }

/* tables & forms */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: right; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 14px; }
th { color: var(--muted); font-weight: 400; }
tr.click { cursor: pointer; } tr.click:hover { background: var(--surface2); }
input, select, textarea { background: var(--surface2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font: inherit; }
input:focus, textarea:focus { outline: 2px solid var(--brass-dark); }
label { display: block; color: var(--muted); font-size: 13px; margin: 10px 0 4px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
button { border: 0; border-radius: 22px; padding: 8px 20px; font-size: 16px; cursor: pointer; background: linear-gradient(#F8D894, #E5A13A 45%, #CB8526); color: var(--bg); box-shadow: 0 3px 0 var(--brass-dark); }
button.sec { background: linear-gradient(#5C8F86, #3B6A63 45%, #2D554F); color: var(--text); box-shadow: 0 3px 0 #1F3B37; }
button.danger { background: linear-gradient(#d4566f, #B82A4B); color: var(--text); box-shadow: 0 3px 0 #6d1a2c; }
button:active { transform: translateY(2px); box-shadow: none; }
.pill { display: inline-block; padding: 1px 10px; border-radius: 10px; font-size: 12px; background: var(--surface2); color: var(--muted); }
.pill.on { background: var(--teal); color: var(--text); } .pill.ban { background: var(--rose); color: var(--text); }
.toast { position: fixed; bottom: 18px; left: 18px; background: var(--teal); padding: 10px 16px; border-radius: 12px; box-shadow: 0 6px 20px #000a; }
.toast.err { background: var(--rose); }
.mono { font-family: ui-monospace, Consolas, monospace; direction: ltr; unicode-bidi: embed; font-size: 13px; }
.plus { color: var(--mint); } .minus { color: #ff8a8a; }

/* login */
.login { max-width: 380px; margin: 10vh auto; text-align: center; }
.login img { width: 96px; }
.login .panel { text-align: right; }
.login input { width: 100%; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin: 10px 0; }

@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  nav { position: static; height: auto; display: flex; flex-wrap: wrap; gap: 4px; }
  nav .brand, nav .who { display: none; }
  main { padding: 14px; }
}
