@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --night: #12172B; --night2: #1B2140; --cream: #F7F4EF;
  --coral: #FF5D73; --mustard: #E8B84B; --green: #1F7A5C;
  --line: rgba(247,244,239,0.12);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--night); color: var(--cream); font-family: 'Inter', -apple-system, sans-serif; }

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

.admin-sidebar {
  width: 220px; flex-shrink: 0; background: var(--night2); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 20px 14px; position: sticky; top: 0; height: 100vh;
}
.admin-brand { display: flex; align-items: center; gap: 8px; padding: 0 6px 20px; }
.brand-badge { width: 26px; height: 26px; border-radius: 7px; background: var(--coral); color: var(--night); display: flex; align-items: center; justify-content: center; font-family: 'Space Grotesk', sans-serif; font-weight: 800; font-size: 13px; }
.brand-name { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 15px; }

.admin-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.admin-nav a { color: rgba(247,244,239,0.65); text-decoration: none; padding: 10px 12px; border-radius: 8px; font-size: 14px; font-weight: 600; }
.admin-nav a:hover { background: rgba(247,244,239,0.06); color: var(--cream); }
.admin-nav a.active { background: var(--coral); color: var(--night); }

.admin-user { padding-top: 14px; border-top: 1px solid var(--line); }
.admin-user-name { font-size: 13px; font-weight: 600; }
.admin-logout { font-size: 12.5px; color: rgba(247,244,239,0.5); text-decoration: none; }

.admin-main { flex: 1; min-width: 0; padding: 28px 32px 60px; }
.admin-title { font-family: 'Space Grotesk', sans-serif; font-size: 24px; margin: 0 0 22px; }

/* Cards / stats */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 28px; }
.stat-card { background: var(--night2); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.stat-label { font-size: 12px; color: rgba(247,244,239,0.55); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.stat-value { font-family: 'Space Grotesk', sans-serif; font-size: 26px; font-weight: 700; margin-top: 6px; }

/* Table */
.admin-table { width: 100%; border-collapse: collapse; background: var(--night2); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; font-size: 14px; }
.admin-table th, .admin-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); }
.admin-table th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: rgba(247,244,239,0.5); font-weight: 700; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table a { color: var(--mustard); text-decoration: none; font-weight: 600; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.badge-published { background: rgba(31,122,92,0.2); color: #7FD9B5; }
.badge-draft { background: rgba(247,244,239,0.1); color: rgba(247,244,239,0.7); }
.badge-cancelled { background: rgba(255,93,115,0.2); color: #FFB3BE; }
.badge-paid { background: rgba(31,122,92,0.2); color: #7FD9B5; }
.badge-pending { background: rgba(232,184,75,0.2); color: #F3D08A; }

/* Forms */
.admin-form { max-width: 640px; }
.form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-row label { font-size: 13px; font-weight: 600; color: rgba(247,244,239,0.8); }
.form-row input, .form-row select, .form-row textarea {
  background: var(--night2); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 13px; color: var(--cream); font-size: 14.5px; font-family: inherit; outline: none;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { border-color: var(--coral); }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-hint { font-size: 12px; color: rgba(247,244,239,0.45); }

.tier-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr auto auto; gap: 10px; align-items: center; margin-bottom: 10px; background: var(--night2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.tier-visibility { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: rgba(247,244,239,0.75); white-space: nowrap; cursor: pointer; }
.tier-visibility input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--coral); cursor: pointer; }

.btn { display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; padding: 11px 20px; font-weight: 700; font-size: 14px; cursor: pointer; border: none; text-decoration: none; }
.btn-primary { background: var(--coral); color: var(--night); }
.btn-secondary { background: transparent; border: 1px solid var(--line); color: var(--cream); }
.btn-danger { background: rgba(255,93,115,0.15); color: #FFB3BE; border: 1px solid rgba(255,93,115,0.4); }
.btn-sm { padding: 7px 14px; font-size: 13px; }

.notice { border-radius: 10px; padding: 12px 14px; font-size: 13.5px; margin-bottom: 18px; }
.notice-error { background: rgba(255,93,115,0.12); border: 1px solid rgba(255,93,115,0.4); color: #FFD3D9; }
.notice-success { background: rgba(31,122,92,0.15); border: 1px solid rgba(31,122,92,0.5); color: #B7E3D2; }

.color-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.color-row input[type="color"] { width: 44px; height: 40px; border-radius: 8px; border: 1px solid var(--line); background: var(--night2); padding: 2px; cursor: pointer; }
.color-row label { flex: 1; font-size: 14px; font-weight: 600; }
.color-preview-bar { display: flex; height: 44px; border-radius: 10px; overflow: hidden; margin: 18px 0; border: 1px solid var(--line); }
.color-preview-bar span { flex: 1; }

.ad-slot-card { background: var(--night2); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 14px; }
.ad-position-tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--mustard); }

@media (max-width: 800px) {
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; height: auto; position: static; flex-direction: row; overflow-x: auto; }
  .admin-nav { flex-direction: row; }
  .admin-main { padding: 20px; }
  .tier-row, .form-row-2 { grid-template-columns: 1fr; }
}
