:root {
  --bg: #0b1020;
  --bg-soft: #11183a;
  --card: #161e44;
  --border: #243068;
  --text: #e6ecff;
  --muted: #93a0d1;
  --primary: #6c8cff;
  --primary-hover: #88a3ff;
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
  --radius: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(180deg, #0a0e25, #0b1224 60%, #0a0e25);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); text-decoration: underline; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(11, 16, 32, 0.85);
  backdrop-filter: blur(6px);
  position: sticky; top: 0; z-index: 5;
}
.nav { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { color: #ffd166; font-size: 20px; }
.brand-text { letter-spacing: 0.5px; }
.nav-links { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.nav-links a { color: var(--muted); }
.nav-links a:hover { color: var(--text); }

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 80px;
  padding: 24px 0;
  color: var(--muted);
  font-size: 14px;
}

.hero { text-align: center; padding: 80px 0 40px; }
.hero h1 { font-size: 44px; margin: 0 0 10px; }
.lede { color: var(--muted); font-size: 18px; max-width: 560px; margin: 0 auto 24px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 40px; }
.card { background: var(--card); border: 1px solid var(--border); padding: 20px; border-radius: var(--radius); }
.card h3, .card h2 { margin-top: 0; }

.btn-primary, .btn-secondary, .btn-danger, .btn-google {
  display: inline-block; cursor: pointer; border: 1px solid transparent;
  padding: 10px 16px; border-radius: var(--radius); font-weight: 600;
  font-size: 14px; transition: all 120ms ease; text-decoration: none;
}
.btn-primary { background: var(--primary); color: #0a1024; }
.btn-primary:hover { background: var(--primary-hover); text-decoration: none; }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg-soft); text-decoration: none; }
.btn-danger { background: transparent; color: var(--danger); border-color: rgba(239, 68, 68, 0.3); }
.btn-danger:hover { background: rgba(239, 68, 68, 0.1); }
.btn-google { background: #fff; color: #1a1a1a; border-color: #ddd; display: inline-flex; align-items: center; gap: 10px; }
.btn-google:hover { background: #f5f5f5; text-decoration: none; }
.g-mark { font-weight: 800; color: #4285f4; }

.link-button {
  background: none; border: none; color: var(--muted); cursor: pointer;
  padding: 0; font: inherit;
}
.link-button:hover { color: var(--text); text-decoration: underline; }

.auth-card {
  max-width: 440px; margin: 60px auto; padding: 32px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  text-align: center;
}
.auth-card h1 { margin-top: 0; }

.flash { padding: 12px 16px; border-radius: var(--radius); margin: 16px 0; border: 1px solid var(--border); }
.flash-success { background: rgba(34, 197, 94, 0.12); border-color: rgba(34, 197, 94, 0.35); color: #bbf7d0; }
.flash-error { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.35); color: #fecaca; }
.flash-warning { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.35); color: #fde68a; }

.page-head { margin: 30px 0 20px; }
.page-head h1 { margin: 0 0 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 30px; }
.stat {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px;
  color: var(--text);
}
.stat:hover { background: var(--bg-soft); text-decoration: none; }
.stat-label { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 28px; font-weight: 700; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 720px) { .two-col { grid-template-columns: 1fr; } }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; }
.data-table th { color: var(--muted); font-weight: 500; font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; }
.data-table .truncate { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.stacked-form { display: flex; flex-direction: column; gap: 12px; }
.stacked-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.stacked-form input[type="text"],
.stacked-form input[type="url"],
.stacked-form input[type="email"],
.stacked-form input[type="password"],
.stacked-form input[type="datetime-local"],
.stacked-form textarea {
  background: var(--bg-soft); color: var(--text); border: 1px solid var(--border);
  padding: 10px 12px; border-radius: 8px; font: inherit; width: 100%;
}
.stacked-form textarea { resize: vertical; min-height: 64px; }
.stacked-form .row { display: flex; gap: 12px; flex-wrap: wrap; }
.stacked-form .row > label { flex: 0 0 auto; min-width: 200px; }
.stacked-form .row > label.grow { flex: 1 1 320px; }
.checkboxes { align-items: center; gap: 18px; }
.check { flex-direction: row !important; align-items: center; gap: 8px !important; color: var(--text) !important; }

.row-actions { display: flex; gap: 10px; }
.inline-form { display: inline; }

.edit-list { display: flex; flex-direction: column; gap: 16px; }
.edit-row {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; position: relative;
}
.edit-row .inline-form { position: absolute; top: 14px; right: 14px; }
.slug-cell { display: flex; flex-direction: column; gap: 4px; min-width: 140px; }
.hit-badge { color: var(--muted); font-size: 12px; }

.announcement-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.announcement { background: var(--card); border: 1px solid var(--border); padding: 16px; border-radius: var(--radius); }
.announcement.pinned { border-color: rgba(255, 209, 102, 0.5); }
.announcement header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; gap: 12px; }
.announcement h3 { margin: 0; }
.announcement time { color: var(--muted); font-size: 12px; }
.pin { margin-right: 4px; }

.event-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.event-list li { display: flex; gap: 14px; padding: 12px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.event-when { min-width: 160px; color: var(--muted); font-variant-numeric: tabular-nums; }

code {
  background: var(--bg-soft); padding: 2px 6px; border-radius: 4px;
  font-size: 0.95em; color: #d8e0ff;
}
