/* Zipper // Admin — dark editorial */

:root {
  --bg:        #0E1014;
  --bg-elev:   #15171D;
  --bg-elev-2: #1B1E26;
  --ink:       #E8E3D6;
  --ink-soft:  #8A867C;
  --rule:      #2A2D36;
  --accent:    #DD3A1A;
  --accent-deep: #B22D11;
  --accent-soft: #2A1B16;
  --ok:        #4FAA75;
  --err:       #E45656;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'Geist', system-ui, -apple-system, sans-serif;
  --font-mono:    'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --container: 1280px;
  --gutter: clamp(20px, 4vw, 56px);
}

*, *::before, *::after { box-sizing: border-box; }

body.dark {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  opacity: 0.06;
  mix-blend-mode: screen;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.55 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

.container {
  width: 100%; max-width: var(--container);
  padding-inline: var(--gutter);
  margin-inline: auto;
  position: relative; z-index: 2;
}

a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.display {
  font-family: var(--font-display);
  font-weight: 600;
  font-variation-settings: "opsz" 144, "SOFT" 50;
  letter-spacing: -0.015em;
  line-height: 1.05;
}
.display em {
  font-style: italic;
  font-variation-settings: "opsz" 144, "SOFT" 100;
}

.mono {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.rule-dark, .card-rule {
  height: 1px;
  background: var(--rule);
  width: 100%;
}

/* ── Brand block ────────────────────────────────────────── */
.brand {
  display: flex; align-items: baseline; gap: 14px;
}
.brand .word {
  font-family: var(--font-display);
  font-weight: 900; font-style: italic;
  font-variation-settings: "opsz" 144, "SOFT" 100;
  font-size: clamp(26px, 2.4vw, 34px);
  letter-spacing: -0.02em;
}
.brand .slash {
  color: var(--accent);
  letter-spacing: 0.22em;
}

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: transform 90ms ease, background 120ms ease, color 120ms ease, box-shadow 120ms ease;
}
.btn:hover { transform: translate(-1px,-1px); box-shadow: 3px 3px 0 var(--accent); }
.btn:active { transform: translate(0,0); box-shadow: none; }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-deep); border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.btn-ghost-dark { background: transparent; border-color: var(--rule); color: var(--ink); }
.btn-ghost-dark:hover { border-color: var(--accent); color: var(--accent); box-shadow: none; transform: none; }

/* ── Login ──────────────────────────────────────────────── */
.login-shell {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 48px 16px;
  background:
    radial-gradient(circle at 30% 20%, rgba(221,58,26,0.08), transparent 60%),
    radial-gradient(circle at 80% 80%, rgba(221,58,26,0.05), transparent 60%);
}
.login-card {
  width: 100%; max-width: 460px;
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  padding: 32px 32px 24px;
  position: relative; z-index: 2;
}
.card-top { display: grid; gap: 18px; padding-bottom: 6px; }
.login-title {
  font-size: clamp(28px, 3.4vw, 36px);
  margin: 28px 0 6px;
  max-width: 18ch;
}
.login-sub { color: var(--ink-soft); margin: 0 0 24px; font-size: 14.5px; }

.field { display: block; margin-bottom: 16px; }
.field-label {
  display: block; color: var(--ink-soft);
  margin-bottom: 8px;
  font-size: 11px;
}
.field input {
  width: 100%;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--rule);
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.04em;
  border-radius: 0;
}
.field input:focus { border-color: var(--accent); outline: none; }
.field input:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 1000px var(--bg) inset;
}

.login-row {
  display: flex; align-items: center; gap: 16px; margin-top: 20px; flex-wrap: wrap;
}
.login-meta { color: var(--err); }
.login-meta.muted { color: var(--ink-soft); }

.card-foot {
  margin: 18px 0 0;
  color: var(--ink-soft);
  font-size: 10.5px;
}

/* ── Admin header ───────────────────────────────────────── */
.admin-header { padding-top: 18px; }
.header-row {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 16px; gap: 18px;
}
.header-right { display: flex; align-items: center; gap: 16px; }
.who { color: var(--ink-soft); }

.admin-main { padding: 28px 0 64px; }

/* ── Stats strip ────────────────────────────────────────── */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: 8px 0 0;
}
.stat {
  padding: 22px 24px;
  border-right: 1px solid var(--rule);
}
.stat:last-child { border-right: 0; }
.stat-num {
  font-size: clamp(34px, 3.6vw, 48px);
  color: var(--ink);
  font-variation-settings: "opsz" 120, "SOFT" 30;
  letter-spacing: -0.02em;
  line-height: 1;
}
.stat:first-child .stat-num,
.stat:nth-child(3) .stat-num { color: var(--accent); }
.stat-cap { color: var(--ink-soft); margin-top: 10px; font-size: 10.5px; }

@media (max-width: 760px) {
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
  .stat { border-bottom: 1px solid var(--rule); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(3), .stat:nth-child(4) { border-bottom: 0; }
  .stat:nth-child(3) { border-right: 1px solid var(--rule); }
}

/* ── Table ──────────────────────────────────────────────── */
.table-section { margin-top: 28px; }
.table-head {
  display: flex; justify-content: space-between; align-items: end;
  gap: 16px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.table-head .display { font-size: clamp(28px, 3vw, 40px); margin: 0; }
.table-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.filter {
  width: 280px; max-width: 60vw;
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  color: var(--ink);
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
}
.filter:focus { border-color: var(--accent); outline: none; }

.table-wrap { border: 1px solid var(--rule); background: var(--bg-elev); position: relative; }
table#files { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table#files th, table#files td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
}
table#files thead th {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
  background: var(--bg-elev-2);
  position: sticky; top: 0; z-index: 1;
}
table#files thead th:hover { color: var(--ink); }
table#files thead th.active { color: var(--accent); }
.sort-ind { display: inline-block; min-width: 12px; text-align: right; color: var(--accent); font-size: 11px; }
.th-num { width: 48px; }
.th-act { width: 180px; text-align: right; }

table#files td.col-name { max-width: 36ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table#files td.col-size, table#files td.col-time, table#files td.col-ip { font-family: var(--font-mono); font-size: 13px; color: var(--ink-soft); }
table#files td.col-num { color: var(--ink-soft); font-family: var(--font-mono); font-size: 12px; }

.row-actions { display: inline-flex; gap: 8px; justify-content: flex-end; }
.icon-btn {
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink);
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease, background 120ms ease;
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn.dl { color: var(--accent); border-color: var(--accent); }
.icon-btn.dl:hover { background: var(--accent); color: #fff; }
.icon-btn.del:hover { color: var(--err); border-color: var(--err); }
a.icon-btn { text-decoration: none; }

.empty {
  padding: 64px 24px;
  text-align: center;
}
.empty .display { font-size: 32px; margin: 0 0 8px; color: var(--ink-soft); }
.empty-sub { color: var(--ink-soft); }

.admin-foot {
  margin-top: 28px;
  color: var(--ink-soft);
  text-align: center;
  font-size: 10.5px;
}

@media (max-width: 720px) {
  .th-act, td.col-act { width: 110px; }
  table#files td.col-name { max-width: 18ch; }
  .filter { width: 100%; }
}
