/* Centered card frame, matching account.css so account / zaznam / admin share
   one look. The shell is a touch wider than the account card (980px) so the
   log + user tables keep room. */
.admin-body {
  /* style.css sets html,body{overflow:hidden} for the fullscreen timer — undo it
     here so the admin (traffic/users) and /zaznam pages can scroll their tables. */
  overflow: auto;
  min-height: 100dvh;
  display: grid;
  /* minmax(0,1fr) pins the single column to the viewport width so a wide table
     inside can't stretch the whole card past the screen — the table scrolls on
     its own (.table-wrap) instead. Without this the auto track sizes to the
     table's content and the card overflows (clipped on mobile). */
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  align-items: start;
  padding: 2.5rem 1rem 4rem;
  background:
    radial-gradient(900px 500px at 50% -10%, rgba(79,140,255,0.14), transparent 70%),
    var(--bg);
}
.admin-shell {
  width: 100%;
  min-width: 0;   /* allow the card to shrink so .table-wrap's scroll engages */
  max-width: 1080px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 20px;
  padding: 1.6rem clamp(1.2rem, 3vw, 2.4rem) 2rem;
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
}
/* The admin dashboard has wider, denser tables (user list = 10 columns). */
.admin-shell-wide { max-width: 1320px; }

.admin-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.6rem; flex-wrap: wrap;
}
.admin-head h1 { font-size: 1.4rem; }
.admin-title { display: flex; align-items: center; gap: 0.7rem; }
.admin-title img { width: 34px; height: 34px; }
.admin-title h1 { font-size: 1.4rem; }
.back { color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.back:hover { color: var(--fg); }

.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem; margin-bottom: 1.8rem;
}
.stat {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px; padding: 1.1rem 1.3rem;
  display: flex; flex-direction: column; gap: 0.3rem;
}
.stat .num { font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .lbl { color: var(--muted); font-size: 0.85rem; }

.table-wrap {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px; overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { padding: 0.7rem 0.9rem; text-align: left; white-space: nowrap; }
thead th {
  position: sticky; top: 0;
  background: rgba(255,255,255,0.06);
  color: var(--muted); font-weight: 600; font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: 0.05em;
}
tbody tr { border-top: 1px solid rgba(255,255,255,0.06); }
tbody tr:hover { background: rgba(255,255,255,0.03); }
td.muted { color: var(--muted); }
td.yes { color: #5fd38a; }
td.no { color: #ff6b6b; }

.empty { padding: 2rem; text-align: center; color: var(--muted); }
.note { margin-top: 1rem; color: var(--muted); font-size: 0.82rem; }
.note code {
  background: rgba(0,0,0,0.3); padding: 0.1rem 0.35rem; border-radius: 5px; color: var(--fg);
}

/* ---- Responsive (shared by /admin and /zaznam via .admin-body/.admin-shell) ---- */

/* Small tablet / large phone: the shell hugs the viewport, tables get denser. */
@media (max-width: 720px) {
  .admin-body { padding: 1.2rem 0.7rem 3rem; }
  .admin-shell { padding: 1.2rem 1rem 1.6rem; border-radius: 16px; }
  .admin-head { margin-bottom: 1.2rem; }
  .admin-head h1, .admin-title h1 { font-size: 1.2rem; }
  .stats { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0.7rem; margin-bottom: 1.2rem; }
  .stat { padding: 0.85rem 1rem; }
  .stat .num { font-size: 1.6rem; }
  th, td { padding: 0.55rem 0.65rem; }
}

/* Phone: edge-to-edge card, no wasted margin. */
@media (max-width: 480px) {
  .admin-body { padding: 0.8rem 0.5rem 2.5rem; }
  .admin-shell { padding: 1rem 0.8rem 1.4rem; border-radius: 14px; }
  table { font-size: 0.85rem; }
}
