/* ==========================================================================
   admin.css — Neo-Brutalism admin panel for the Logo Maker
   Loaded standalone (the front-end style.css is not needed here).
   ========================================================================== */

:root {
  --ink: #0E0E0E;
  --ink-soft: #2A2A2A;
  --paper: #F4F0E6;
  --white: #FFFFFF;
  --yellow: #FFD93D;
  --coral: #FF5F5F;
  --sky: #6EC1E4;
  --lime: #B9F227;
  --violet: #C77DFF;
  --muted: #6B675F;
  --line: var(--ink);
  --bw: 3px;
  --shadow: 7px 7px 0 var(--ink);
  --shadow-sm: 4px 4px 0 var(--ink);
  --font-head: 'Archivo Black', 'Arial Black', system-ui, sans-serif;
  --font-body: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Space Mono', ui-monospace, 'Courier New', monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background: var(--paper);
  background-image: radial-gradient(var(--ink) 1.1px, transparent 1.1px);
  background-size: 22px 22px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); }

h1, h2, h3 { font-family: var(--font-head); margin: 0; letter-spacing: .01em; }

/* ----------------------------------------------------------
   Shell: sidebar + main
   ---------------------------------------------------------- */
.admin-shell {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
}

.admin-side {
  background: var(--white);
  border-right: var(--bw) solid var(--ink);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-size: 17px;
  text-transform: uppercase;
  padding: 4px 6px 18px;
  border-bottom: var(--bw) solid var(--ink);
  margin-bottom: 14px;
}
.admin-brand small {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  background: var(--yellow);
  border: 2px solid var(--ink);
  padding: 1px 7px;
  margin-left: 2px;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  background: var(--yellow);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-sm);
}
.brand-mark svg { width: 18px; height: 18px; }

.admin-side nav { display: flex; flex-direction: column; gap: 8px; }

.admin-nav-link {
  display: block;
  border: 2px solid var(--ink);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  padding: 9px 12px;
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .06em;
  text-decoration: none;
  transition: transform .06s ease, box-shadow .06s ease, background .12s ease;
}
.admin-nav-link:hover { background: var(--yellow); }
.admin-nav-link:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.admin-nav-link.is-on { background: var(--ink); color: var(--white); }
.admin-nav-link.is-on:hover { background: var(--ink); }

.admin-site-link { margin-top: auto; background: var(--sky); text-align: center; }
.admin-site-link:hover { background: var(--lime); }

.admin-body { min-width: 0; }

.admin-main { padding: 30px clamp(16px, 3vw, 40px) 60px; }

.admin-main-inner { max-width: 1060px; }

/* ----------------------------------------------------------
   Page header / toolbar
   ---------------------------------------------------------- */
.admin-title { font-size: clamp(24px, 3.4vw, 32px); text-transform: uppercase; }
.admin-sub { color: var(--muted); font-weight: 600; margin: 6px 0 0; }

.admin-topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.toolbar .spacer { flex: 1; }

/* ----------------------------------------------------------
   Buttons
   ---------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .05em;
  border: var(--bw) solid var(--ink);
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  padding: 10px 18px;
  cursor: pointer;
  text-decoration: none;
  transition: transform .06s ease, box-shadow .06s ease, background .12s ease;
}
.btn:hover { background: var(--yellow); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }

.btn-admin { background: var(--yellow); }
.btn-admin:hover { background: var(--lime); }

.btn-danger { background: var(--coral); color: var(--white); }
.btn-danger:hover { background: #ff8080; }

.btn-sm { padding: 6px 12px; font-size: 12px; border-width: 2px; box-shadow: 3px 3px 0 var(--ink); }
.btn-sm:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

.btn-block { width: 100%; justify-content: center; }

/* ----------------------------------------------------------
   Flash messages
   ---------------------------------------------------------- */
.flash {
  border: var(--bw) solid var(--ink);
  box-shadow: var(--shadow-sm);
  padding: 12px 16px;
  font-weight: 800;
  margin-bottom: 18px;
  background: var(--white);
}
.flash-ok { background: var(--lime); }
.flash-err { background: var(--coral); color: var(--white); }

/* ----------------------------------------------------------
   Stat boxes
   ---------------------------------------------------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 26px;
}
.stat-box {
  background: var(--white);
  border: var(--bw) solid var(--ink);
  box-shadow: var(--shadow-sm);
  padding: 16px 18px;
}
.stat-box:nth-child(2) { background: #FFF7D6; }
.stat-box:nth-child(3) { background: #EAF9E3; }
.stat-box:nth-child(4) { background: #E4F4FB; }
.stat-num { font-family: var(--font-head); font-size: 34px; line-height: 1.05; }
.stat-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  margin-top: 4px;
}

/* ----------------------------------------------------------
   Panels
   ---------------------------------------------------------- */
.panel {
  background: var(--white);
  border: var(--bw) solid var(--ink);
  box-shadow: var(--shadow);
  margin-bottom: 28px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-bottom: var(--bw) solid var(--ink);
  padding: 13px 18px;
  background: var(--yellow);
}
.panel-head h2 { font-size: 16px; text-transform: uppercase; }
.panel-head .panel-note { font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.panel-body { padding: 20px 18px 24px; }
.panel-body > :last-child { margin-bottom: 0; }

/* ----------------------------------------------------------
   Tables
   ---------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  padding: 10px 12px;
  border-bottom: var(--bw) solid var(--ink);
  white-space: nowrap;
}
.table td {
  padding: 12px;
  border-bottom: 2px solid var(--ink);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table .t-title { font-weight: 800; }
.table .t-title a { text-decoration: none; border-bottom: 2px solid var(--yellow); }
.table .t-title a:hover { border-bottom-color: var(--ink); }
.table .t-slug { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.table .t-date { font-family: var(--font-mono); font-size: 12px; white-space: nowrap; }
.table .t-actions { display: flex; gap: 8px; align-items: center; }
.table .t-actions form { margin: 0; display: inline; }

/* Status pills */
.pill {
  display: inline-block;
  border: 2px solid var(--ink);
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  white-space: nowrap;
}
.pill-ok { background: var(--lime); }
.pill-off { background: #E9E5DB; color: var(--muted); }
.pill-warn { background: var(--yellow); }

/* ----------------------------------------------------------
   Forms
   ---------------------------------------------------------- */
.field { margin-bottom: 18px; }
.field > label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 6px;
}
.field input[type="text"],
.field input[type="password"],
.field input[type="number"],
.field input[type="email"],
.field input[type="url"],
.field input[type="date"],
.field select,
.field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  background: var(--white);
  border: var(--bw) solid var(--ink);
  box-shadow: inset 2px 2px 0 rgba(14, 14, 14, .06);
  padding: 10px 12px;
  border-radius: 0;
}
.field textarea { resize: vertical; min-height: 90px; line-height: 1.45; }
.field textarea.mono { font-family: var(--font-mono); font-size: 13px; }
.field select { cursor: pointer; appearance: none; background-image: none; padding-right: 12px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  background: #FFFDE8;
  box-shadow: var(--shadow-sm);
}
.field .hint {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin: 5px 0 0;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 18px;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}
.check input[type="checkbox"] {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  margin-top: 1px;
  accent-color: var(--ink);
  cursor: pointer;
}
.check label { font-weight: 700; cursor: pointer; }
.check .hint { margin-top: 2px; }

.form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  border-top: var(--bw) solid var(--ink);
  padding-top: 18px;
  margin-top: 6px;
}

/* AdSense slot grid */
.slots-table input[type="text"], .slots-table textarea {
  padding: 7px 9px;
  font-size: 13px;
  border-width: 2px;
}
.slots-table textarea { min-height: 54px; font-family: var(--font-mono); font-size: 12px; }
.slots-table td { vertical-align: top; }
.slot-name { font-weight: 800; white-space: nowrap; }
.slot-name small { display: block; font-weight: 600; color: var(--muted); font-size: 11px; }

/* ----------------------------------------------------------
   Empty state
   ---------------------------------------------------------- */
.empty {
  border: 3px dashed var(--ink);
  background: var(--white);
  padding: 42px 24px;
  text-align: center;
}
.empty p { color: var(--muted); font-weight: 600; margin: 0 0 16px; }

/* ----------------------------------------------------------
   Login screen
   ---------------------------------------------------------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border: var(--bw) solid var(--ink);
  box-shadow: var(--shadow);
  padding: 30px 28px 26px;
}
.login-brand { padding-bottom: 16px; }
.login-title { font-size: 26px; text-transform: uppercase; margin-bottom: 4px; }
.login-sub { color: var(--muted); font-weight: 600; margin: 0 0 20px; }
.login-foot {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 2px solid var(--ink);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.login-foot a { color: var(--muted); }

/* ----------------------------------------------------------
   Misc
   ---------------------------------------------------------- */
.kv {
  display: grid;
  grid-template-columns: minmax(140px, auto) 1fr;
  gap: 8px 18px;
  font-size: 14px;
}
.kv dt { font-weight: 800; text-transform: uppercase; font-size: 11px; letter-spacing: .1em; color: var(--muted); padding-top: 2px; }
.kv dd { margin: 0; font-weight: 600; }
.kv dd.mono { font-family: var(--font-mono); font-size: 13px; }

.quick-links { display: flex; gap: 12px; flex-wrap: wrap; }

/* ----------------------------------------------------------
   Responsive
   ---------------------------------------------------------- */
@media (max-width: 960px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: var(--bw) solid var(--ink);
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 16px;
  }
  .admin-brand { border-bottom: none; padding: 0 10px 0 0; margin-bottom: 0; border-right: 2px solid var(--ink); }
  .admin-side nav { flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .admin-site-link { margin-top: 0; margin-left: auto; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .field-row { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .stat-grid { grid-template-columns: 1fr; }
  .admin-main { padding: 20px 14px 48px; }
}
