/* Admin panel — shares design tokens with the public site */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --navy-deep: #0B2338;
  --navy: #123A57;
  --navy-mid: #1B4E71;
  --gold: #E8A33D;
  --gold-light: #F4C875;
  --coral: #DE6B36;
  --slate: #4A5058;
  --paper: #F6F4EF;
  --paper-dim: #EFEAE0;
  --ink: #1B1E22;
  --ink-soft: #5B6169;
  --line: #E1DACB;
  --white: #FFFFFF;
  --radius-m: 12px;
  --radius-l: 18px;
  --shadow: 0 10px 26px -14px rgba(11,35,56,0.25);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Sora', system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

.admin-shell { display: flex; min-height: 100vh; }

.admin-sidebar {
  width: 250px;
  flex-shrink: 0;
  background: var(--navy-deep);
  color: rgba(255,255,255,0.85);
  padding: 26px 20px;
  display: flex;
  flex-direction: column;
}
.admin-sidebar .brand { display: flex; align-items: center; gap: 10px; margin-bottom: 40px; padding: 0 6px; }
.admin-sidebar .brand img { width: 34px; height: 34px; border-radius: 8px; }
.admin-sidebar .brand strong { font-size: 13.5px; color: white; line-height: 1.2; display:block; }
.admin-sidebar .brand span { font-size: 10.5px; color: var(--gold-light); text-transform: uppercase; letter-spacing: .08em; font-family: 'IBM Plex Mono', monospace; }

.admin-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 500;
  margin-bottom: 4px;
  color: rgba(255,255,255,0.72);
  transition: background .15s ease, color .15s ease;
}
.admin-nav a:hover { background: rgba(255,255,255,0.06); color: white; }
.admin-nav a.active { background: var(--gold); color: var(--navy-deep); font-weight: 600; }

.admin-sidebar .sidebar-footer { margin-top: auto; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.1); }
.admin-sidebar .sidebar-footer a { font-size: 13.5px; color: rgba(255,255,255,0.6); }
.admin-sidebar .sidebar-footer a:hover { color: white; }

.admin-main { flex: 1; min-width: 0; }
.admin-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 32px;
  background: white;
  border-bottom: 1px solid var(--line);
}
.admin-topbar h1 { font-size: 19px; margin: 0; }
.admin-topbar .sub { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }
.admin-content { padding: 32px; max-width: 1100px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'Sora', sans-serif; font-weight: 600; font-size: 14px;
  padding: 11px 20px; border-radius: 10px; border: 1px solid transparent;
  transition: all .15s ease; cursor: pointer;
}
.btn-primary { background: var(--gold); color: var(--navy-deep); }
.btn-primary:hover { background: var(--gold-light); }
.btn-dark { background: var(--navy-deep); color: white; }
.btn-dark:hover { background: var(--navy); }
.btn-outline { border-color: var(--line); color: var(--ink); background: white; }
.btn-outline:hover { border-color: var(--gold); }
.btn-danger { background: #FDEDEC; color: #A5342A; border-color: #F3C3BE; }
.btn-danger:hover { background: #F9DAD6; }
.btn-sm { padding: 7px 14px; font-size: 13px; }

.card { background: white; border: 1px solid var(--line); border-radius: var(--radius-l); padding: 28px; margin-bottom: 24px; box-shadow: var(--shadow); }

.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 28px; }
.stat-card { background: white; border: 1px solid var(--line); border-radius: var(--radius-m); padding: 22px; }
.stat-card .n { font-family: 'IBM Plex Mono', monospace; font-size: 26px; color: var(--navy-deep); font-weight: 500; }
.stat-card .l { font-size: 13px; color: var(--ink-soft); margin-top: 4px; }
@media (max-width: 900px) { .stat-cards { grid-template-columns: repeat(2,1fr); } }

table.admin-table { width: 100%; border-collapse: collapse; background: white; border-radius: var(--radius-m); overflow: hidden; }
table.admin-table th, table.admin-table td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 14.5px; }
table.admin-table th { font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); background: var(--paper-dim); }
table.admin-table tr:last-child td { border-bottom: none; }
table.admin-table td.actions { display: flex; gap: 8px; }

.badge { font-family: 'IBM Plex Mono', monospace; font-size: 11px; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; letter-spacing: .04em; }
.badge-published { background: #E8F5E9; color: #256029; }
.badge-draft { background: #FDF3E3; color: #92650B; }

.form-grid { display: grid; gap: 20px; }
.field label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 7px; color: var(--navy-deep); }
.field input[type=text], .field input[type=email], .field input[type=password], .field select, .field textarea {
  width: 100%; font-family: 'Sora', sans-serif; font-size: 14.5px;
  padding: 12px 14px; border-radius: 9px; border: 1px solid var(--line); background: var(--paper);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(232,163,61,0.18); }
.field .hint { font-size: 12.5px; color: var(--ink-soft); margin-top: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.alert { padding: 14px 18px; border-radius: 10px; font-size: 14px; margin-bottom: 20px; }
.alert-success { background: #E8F5E9; color: #256029; border: 1px solid #BEE3BE; }
.alert-error { background: #FDEDEC; color: #A5342A; border: 1px solid #F3C3BE; }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, var(--navy-deep), var(--navy-mid)); padding: 24px; }
.login-card { width: 100%; max-width: 400px; background: white; border-radius: var(--radius-l); padding: 40px; box-shadow: 0 30px 60px -20px rgba(0,0,0,0.4); }
.login-card .brand { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 26px; }
.login-card .brand img { width: 56px; height: 56px; border-radius: 12px; margin-bottom: 14px; }
.login-card .brand strong { font-size: 16px; }
.login-card .brand span { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--coral); text-transform: uppercase; letter-spacing: .1em; margin-top: 4px; }
.login-card .btn { width: 100%; justify-content: center; margin-top: 6px; }

.empty { text-align: center; padding: 60px 20px; color: var(--ink-soft); }

@media (max-width: 860px) {
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; flex-direction: row; align-items: center; overflow-x: auto; padding: 14px 18px; }
  .admin-sidebar .brand { margin-bottom: 0; margin-right: 20px; }
  .admin-nav { display: flex; gap: 4px; }
  .admin-sidebar .sidebar-footer { display: none; }
  .form-grid, .field-row { grid-template-columns: 1fr; }
  .stat-cards { grid-template-columns: 1fr 1fr; }
}
