/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f4f6f9; color: #1a1a2e;
    min-height: 100vh; display: flex; flex-direction: column;
}
a { color: #7c3aed; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
    background: #1a1a2e; padding: 0 2rem;
    display: flex; align-items: center; justify-content: space-between;
    height: 60px; position: sticky; top: 0; z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.nav-brand a { color: #fff; font-size: 1.3rem; font-weight: 700; letter-spacing: 1px; }
.nav-links { display: flex; align-items: center; gap: 1.5rem; }
.nav-links a { color: #cbd5e1; font-size: 0.95rem; transition: color 0.2s; }
.nav-links a:hover { color: #fff; text-decoration: none; }
.btn-nav { background: #7c3aed; color: #fff !important; padding: 0.4rem 1rem; border-radius: 6px; }
.btn-nav:hover { background: #6d28d9; }
.nav-badge { font-size: 0.7rem; font-weight: 700; padding: 0.2rem 0.5rem;
             border-radius: 4px; letter-spacing: 0.5px; }
.nav-badge.super { background: #f59e0b; color: #1a1a2e; }
.nav-badge.admin { background: #7c3aed; color: #fff; }

/* ── Container ──────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 2rem 1.5rem; flex: 1; }

/* ── Alerts ─────────────────────────────────────────────────── */
.alert { padding: 0.9rem 1.2rem; border-radius: 8px; margin-bottom: 1.2rem;
         font-size: 0.95rem; border-left: 4px solid transparent; }
.alert-success { background: #d1fae5; border-color: #059669; color: #065f46; }
.alert-danger  { background: #fee2e2; border-color: #dc2626; color: #991b1b; }
.alert-warning { background: #fef3c7; border-color: #d97706; color: #92400e; }
.alert-info    { background: #dbeafe; border-color: #2563eb; color: #1e3a5f; }

/* ── Page Header ────────────────────────────────────────────── */
.page-header { display: flex; align-items: center; justify-content: space-between;
               margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem; }
.page-header h1 { font-size: 1.8rem; }
.subtitle { color: #64748b; margin-bottom: 1.5rem; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn { display: inline-block; padding: 0.6rem 1.4rem; border-radius: 7px;
       font-size: 0.95rem; font-weight: 600; border: none; cursor: pointer;
       transition: opacity 0.15s, transform 0.1s; text-decoration: none; }
.btn:hover { opacity: 0.88; transform: translateY(-1px); text-decoration: none; }
.btn-primary   { background: #7c3aed; color: #fff; }
.btn-secondary { background: #64748b; color: #fff; }
.btn-danger    { background: #dc2626; color: #fff; }
.btn-super     { background: #f59e0b; color: #1a1a2e; }
.btn-sm   { padding: 0.3rem 0.8rem; font-size: 0.85rem; }
.btn-lg   { padding: 0.8rem 2rem; font-size: 1.05rem; }
.btn-block { display: block; width: 100%; text-align: center; }

/* ── Schools Grid ───────────────────────────────────────────── */
.schools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px,1fr)); gap: 1.5rem; }
.school-card { background: #fff; border-radius: 14px; padding: 1.8rem;
               box-shadow: 0 2px 10px rgba(0,0,0,0.08);
               transition: transform 0.2s, box-shadow 0.2s;
               border-top: 4px solid #7c3aed; }
.school-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,0.12); }
.school-card--closed { border-top-color: #94a3b8; opacity: 0.85; }
.school-card h2 { font-size: 1.2rem; margin-bottom: 0.6rem; }
.school-card p { color: #64748b; font-size: 0.9rem; margin-bottom: 0.8rem; }
.school-meta { display: flex; flex-direction: column; gap: 0.3rem;
               font-size: 0.85rem; color: #64748b; margin-bottom: 1.2rem; }
.school-actions { display: flex; gap: 0.8rem; margin-bottom: 0.8rem; flex-wrap: wrap; align-items: center; }
.open-badge { display: inline-block; font-size: 0.8rem; color: #059669; font-weight: 600; }
.closed-badge { display: inline-block; background: #fee2e2; color: #dc2626;
                padding: 0.5rem 1rem; border-radius: 8px; font-weight: 600; margin-top: 1rem; }

/* ── School Badge ───────────────────────────────────────────── */
.school-badge { display: inline-block; background: #7c3aed; color: #fff;
                font-weight: 700; border-radius: 8px; padding: 0.4rem 0.9rem;
                font-size: 0.9rem; letter-spacing: 1px; margin-bottom: 0.8rem; }
.school-badge.large { font-size: 1.4rem; padding: 0.6rem 1.4rem; }
.school-badge.small { font-size: 0.8rem; padding: 0.25rem 0.6rem; }

/* ── School Hero ────────────────────────────────────────────── */
.school-hero { background: #fff; border-radius: 14px; padding: 2.5rem;
               box-shadow: 0 2px 10px rgba(0,0,0,0.08); margin-bottom: 2rem;
               border-top: 5px solid #7c3aed; }
.school-hero h1 { font-size: 2rem; margin-bottom: 0.6rem; }
.school-hero p { color: #64748b; margin-bottom: 1rem; }
.school-hero .school-meta { flex-direction: row; flex-wrap: wrap; gap: 1.2rem; margin-bottom: 1.5rem; }

/* ── Posts Grid ─────────────────────────────────────────────── */
.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 1.5rem; }
.post-card { background: #fff; border-radius: 12px; overflow: hidden;
             box-shadow: 0 2px 10px rgba(0,0,0,0.08); transition: transform 0.2s; }
.post-card:hover { transform: translateY(-3px); }
.post-card img { width: 100%; height: 180px; object-fit: cover; display: block; }
.post-body { padding: 1.2rem; }
.post-body h3 { font-size: 1rem; margin-bottom: 0.4rem; }
.post-body p { color: #64748b; font-size: 0.88rem; margin-bottom: 0.4rem; }
.post-body small { color: #94a3b8; font-size: 0.78rem; }
.post-actions { margin-top: 0.8rem; padding-top: 0.8rem; border-top: 1px solid #f1f5f9; }

/* ── Forms ──────────────────────────────────────────────────── */
.form-page { max-width: 640px; margin: 0 auto; }
.form-school-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.4rem; }
.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: 0.4rem;
                    font-size: 0.95rem; color: #374151; }
.form-control { width: 100%; padding: 0.65rem 0.9rem; border: 1.5px solid #d1d5db;
                border-radius: 7px; font-size: 1rem; background: #fff;
                transition: border-color 0.2s, box-shadow 0.2s; color: #1a1a2e; }
.form-control:focus { outline: none; border-color: #7c3aed;
                      box-shadow: 0 0 0 3px rgba(124,58,237,0.15); }
textarea.form-control { resize: vertical; min-height: 90px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.error { color: #dc2626; font-size: 0.85rem; display: block; margin-top: 0.3rem; }
.optional { color: #94a3b8; font-size: 0.85rem; font-weight: 400; }
.form-actions { display: flex; gap: 1rem; margin-top: 1.5rem; }
.checkbox-group { display: flex; align-items: center; gap: 0.5rem; }
.checkbox-group label { margin-bottom: 0; font-weight: 400; }
.info-box { margin-top: 1.2rem; padding: 0.9rem 1.2rem; background: #f0f9ff;
            border-radius: 8px; border-left: 4px solid #0891b2; color: #0c4a6e;
            font-size: 0.9rem; }

/* ── Auth ───────────────────────────────────────────────────── */
.auth-page { display: flex; justify-content: center; padding-top: 3rem; }
.auth-card { background: #fff; padding: 2.5rem; border-radius: 14px;
             box-shadow: 0 4px 20px rgba(0,0,0,0.1); width: 100%; max-width: 440px; }
.auth-card h1 { margin-bottom: 0.4rem; }
.auth-card .subtitle { color: #64748b; margin-bottom: 1.5rem; font-size: 0.9rem; }
.super-card { border-top: 5px solid #f59e0b; }

/* ── Setup ──────────────────────────────────────────────────── */
.setup-page { max-width: 800px; margin: 0 auto; }
.setup-header { background: linear-gradient(135deg,#7c3aed,#1d4ed8); color: #fff;
                border-radius: 14px; padding: 2rem; margin-bottom: 2rem; }
.setup-header h1 { color: #fff; font-size: 1.8rem; margin-bottom: 0.4rem; }
.setup-header p { color: rgba(255,255,255,0.85); }
.setup-section { background: #fff; border-radius: 12px; padding: 2rem;
                 margin-bottom: 1.5rem; box-shadow: 0 2px 8px rgba(0,0,0,0.07); }
.setup-section h2 { font-size: 1.2rem; margin-bottom: 0.3rem; }
.section-desc { color: #64748b; font-size: 0.9rem; margin-bottom: 1.2rem; }

/* ── Stats ──────────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr));
              gap: 1.2rem; margin-bottom: 2rem; }
.stat-card { background: #fff; border-radius: 12px; padding: 1.5rem;
             box-shadow: 0 2px 8px rgba(0,0,0,0.07); text-align: center; }
.stat-card.highlight { border-top: 4px solid #d97706; }
.stat-number { font-size: 2.5rem; font-weight: 700; color: #7c3aed; line-height: 1; }
.stat-label  { color: #64748b; font-size: 0.9rem; margin: 0.4rem 0 0.8rem; }
.stat-link   { font-size: 0.85rem; color: #7c3aed; font-weight: 600; }
.dashboard-actions { display: flex; gap: 1rem; margin-bottom: 2.5rem; flex-wrap: wrap; }

/* ── Table ──────────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; background: #fff;
         border-radius: 10px; overflow: hidden;
         box-shadow: 0 2px 8px rgba(0,0,0,0.07); font-size: 0.9rem; }
.table thead { background: #1a1a2e; color: #fff; }
.table th { padding: 0.9rem 1rem; text-align: left; font-weight: 600; }
.table td { padding: 0.8rem 1rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.table tbody tr:hover { background: #f8fafc; }
.table tbody tr:last-child td { border-bottom: none; }
.table code { background: #f1f5f9; padding: 0.2rem 0.5rem; border-radius: 4px;
              font-size: 0.82rem; word-break: break-all; }
.message-row td { background: #fafafa; color: #64748b; font-size: 0.85rem; }

/* ── Badges ─────────────────────────────────────────────────── */
.badge { display: inline-block; padding: 0.25rem 0.7rem; border-radius: 99px;
         font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.badge-pending      { background: #fef3c7; color: #92400e; }
.badge-under_review { background: #dbeafe; color: #1e3a5f; }
.badge-approved     { background: #d1fae5; color: #065f46; }
.badge-rejected     { background: #fee2e2; color: #991b1b; }

/* ── Filters ────────────────────────────────────────────────── */
.filter-bar { display: flex; align-items: center; gap: 0.6rem;
              margin-bottom: 1.5rem; flex-wrap: wrap; font-size: 0.9rem; color: #64748b; }
.filter-btn { padding: 0.35rem 0.9rem; border-radius: 99px; background: #fff;
              border: 1.5px solid #e2e8f0; color: #64748b; font-size: 0.85rem; transition: all 0.2s; }
.filter-btn:hover { border-color: #7c3aed; color: #7c3aed; text-decoration: none; }
.filter-btn.active { background: #7c3aed; color: #fff; border-color: #7c3aed; }

/* ── Select Inline ──────────────────────────────────────────── */
.select-inline { padding: 0.3rem 0.6rem; border: 1.5px solid #d1d5db;
                 border-radius: 6px; font-size: 0.85rem; cursor: pointer; background: #fff; }

/* ── Status Result ──────────────────────────────────────────── */
.status-result { margin-top: 2rem; background: #fff; border-radius: 12px;
                 padding: 1.8rem; box-shadow: 0 2px 12px rgba(0,0,0,0.08);
                 border-top: 5px solid #7c3aed; }
.status-result.status-approved     { border-top-color: #059669; }
.status-result.status-rejected     { border-top-color: #dc2626; }
.status-result.status-under_review { border-top-color: #2563eb; }
.status-result h2 { margin-bottom: 1.2rem; }
.status-grid { display: flex; flex-direction: column; gap: 0.7rem; margin-bottom: 1.2rem; }
.status-row { display: flex; gap: 1rem; align-items: center;
              padding: 0.5rem 0; border-bottom: 1px solid #f1f5f9; }
.status-row .label { font-weight: 600; color: #64748b; min-width: 110px; font-size: 0.9rem; }
.status-row .value { color: #1a1a2e; }
.status-message { margin-top: 1rem; padding: 0.9rem 1.2rem;
                  background: #f8fafc; border-radius: 8px; font-size: 0.95rem; }

/* ── PAIA Section ───────────────────────────────────────────── */
.paia-section { margin-top: 1.5rem; padding: 1.2rem 1.4rem;
                background: #ede9fe; border-radius: 10px;
                border-left: 4px solid #7c3aed; }
.paia-section h3 { font-size: 1rem; color: #5b21b6; margin-bottom: 0.4rem; }
.paia-section p { font-size: 0.9rem; color: #4c1d95; margin-bottom: 0.8rem; line-height: 1.5; }
.paia-section small { display: block; margin-top: 0.5rem; color: #6d28d9; font-size: 0.82rem; }

/* ── Recent Section ─────────────────────────────────────────── */
.recent-section { margin-top: 2.5rem; }
.recent-section h2 { margin-bottom: 1rem; font-size: 1.2rem; }

/* ── Empty State ────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 4rem 2rem; color: #94a3b8;
               background: #fff; border-radius: 12px; }

/* ── Error Page ─────────────────────────────────────────────── */
.error-page { text-align: center; padding: 6rem 2rem; }
.error-page h1 { font-size: 5rem; color: #7c3aed; line-height: 1; margin-bottom: 0.5rem; }
.error-page p { color: #64748b; margin-bottom: 1.5rem; font-size: 1.1rem; }

/* ── Footer ─────────────────────────────────────────────────── */
.footer { text-align: center; padding: 1.5rem; color: #94a3b8; font-size: 0.85rem;
          background: #fff; border-top: 1px solid #e2e8f0; margin-top: auto; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 640px) {
    .navbar { padding: 0 1rem; }
    .nav-links { gap: 0.8rem; }
    .container { padding: 1.5rem 1rem; }
    .schools-grid, .posts-grid, .stats-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .table { font-size: 0.8rem; }
    .table th, .table td { padding: 0.6rem 0.7rem; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .school-hero .school-meta { flex-direction: column; }
    .dashboard-actions { flex-direction: column; }
}
