/* ============================================
   Admin Portal - Government Theme
   ============================================ */
:root {
    --gov-navy: #071B3A;
    --gov-navy-light: #0E2D5A;
    --gov-gold: #C8A951;
    --gov-gold-light: #E8D48B;
    --gov-red: #B22234;
    --gov-white: #FFFFFF;
    --gov-light: #F5F6FA;
    --gov-border: #E2E8F0;
    --gov-text: #1E293B;
    --gov-muted: #64748B;
    --font-heading: 'Plus Jakarta Sans', 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { min-width: 320px; }
body { font-family: var(--font-body); background: var(--gov-light); color: var(--gov-text); overflow-x: hidden; }
a { text-decoration: none; color: inherit; }

/* --- Login --- */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
    background: linear-gradient(160deg, var(--gov-navy) 0%, var(--gov-navy-light) 100%);
}

.login-container {
    background: var(--gov-white);
    padding: clamp(1.5rem, 5vw, 3rem);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: min(100%, 420px);
    border-top: 4px solid var(--gov-gold);
}

.login-header { text-align: center; margin-bottom: 2rem; }
.login-header h2 { font-family: var(--font-heading); color: var(--gov-navy); font-size: 1.3rem; }
.login-header p { color: var(--gov-muted); font-size: 0.9rem; }
.login-logo { height: 56px; margin-bottom: 1rem; }

/* --- Forms --- */
.form-group { margin-bottom: 1.5rem; }
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--gov-text);
}

.form-group input,
.form-group textarea,
.form-group select,
select {
    display: block;
    width: 100%;
    max-width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gov-border);
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 1rem;
    background: var(--gov-white);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group textarea { resize: vertical; min-height: 96px; }
.form-group textarea[name="content"] { min-height: 220px; }
.compact-field { max-width: 260px; }

.form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.1rem;
}

.form-group-full {
    width: 100%;
}

.editor-card {
    max-width: 1120px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus,
select:focus {
    outline: none;
    border-color: var(--gov-navy);
    box-shadow: 0 0 0 3px rgba(7,27,58,0.1);
}

.form-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0.7rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.btn-primary { background: var(--gov-navy); color: var(--gov-white); }
.btn-primary:hover { background: var(--gov-navy-light); }
.btn-secondary { background: #e2e8f0; color: var(--gov-text); }
.btn-secondary:hover { background: #cbd5e1; }
.btn-small { min-height: 32px; padding: 0.4rem 0.65rem; font-size: 0.8rem; }
.btn-block { width: 100%; }

.alert {
    padding: 0.85rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }

/* --- Dashboard Layout --- */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.header-mobile {
    display: none;
    background: var(--gov-white);
    border-bottom: 1px solid var(--gov-border);
    padding: 0.85rem 1rem;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 20;
}

.mobile-brand {
    font-family: var(--font-heading);
    color: var(--gov-navy);
    font-weight: 700;
}

.menu-toggle {
    min-width: 76px;
    min-height: 40px;
    border: 1px solid var(--gov-border);
    background: var(--gov-white);
    color: var(--gov-navy);
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
}

.sidebar {
    width: 260px;
    flex: 0 0 260px;
    background: var(--gov-navy);
    color: var(--gov-white);
    padding: 2rem 1rem;
    border-right: 3px solid var(--gov-gold);
}

.sidebar-logo {
    display: block;
    font-family: var(--font-heading);
    color: var(--gov-gold);
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.nav-item {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 42px;
    padding: 0.75rem 1rem;
    color: rgba(255,255,255,0.75);
    border-radius: 6px;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
    text-align: left;
    transition: background 0.2s, color 0.2s;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(200,169,81,0.15);
    color: var(--gov-gold);
}

.logout-form { margin-top: 2rem; }
.logout-button {
    background: transparent;
    border: 0;
    cursor: pointer;
    color: #fca5a5;
    font-family: inherit;
}

.main-content {
    flex: 1;
    min-width: 0;
    padding: clamp(1rem, 3vw, 2.5rem);
    background: var(--gov-light);
}

.main-content > * {
    max-width: 1180px;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-header h2 {
    font-family: var(--font-heading);
    color: var(--gov-navy);
    font-size: clamp(1.35rem, 3vw, 1.8rem);
    line-height: 1.2;
}

.page-header p,
.muted-text {
    color: var(--gov-muted);
    font-size: 0.92rem;
    margin-top: 0.35rem;
}

.card {
    background: var(--gov-white);
    padding: clamp(1rem, 3vw, 2rem);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border-top: 3px solid var(--gov-gold);
    min-width: 0;
}

.stack-card { margin-bottom: 1.5rem; }
.card h3 { color: var(--gov-navy); margin-bottom: 0.85rem; }

/* --- Table --- */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--gov-border);
    border-radius: 8px;
    margin-top: 1rem;
}

table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
    background: var(--gov-white);
}

th, td {
    padding: 0.9rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gov-border);
    vertical-align: middle;
}

tr:last-child td { border-bottom: 0; }

th {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--gov-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0;
    background: #f8fafc;
    white-space: nowrap;
}

td { font-size: 0.92rem; }

.status-text { font-weight: 700; white-space: nowrap; }
.status-text.pending { color: #d97706; }
.status-text.verified { color: #059669; }
.status-text.rejected { color: #dc2626; }
.muted-date { color: var(--gov-muted); font-size: 0.85rem; white-space: nowrap; }
.empty-cell { text-align: center; color: var(--gov-muted); padding: 1.5rem; }
.inline-form { display: inline; }
.row-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.text-action {
    color: var(--gov-gold);
    font-weight: 700;
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.92rem;
}
.text-action.danger { color: #ef4444; }

@media (max-width: 900px) {
    .dashboard-layout {
        flex-direction: column;
    }

    .header-mobile {
        display: flex;
    }

    .sidebar {
        display: none;
        width: 100%;
        flex-basis: auto;
        padding: 1rem;
        border-right: 0;
        border-bottom: 3px solid var(--gov-gold);
    }

    .sidebar.show {
        display: block;
    }

    .sidebar-logo {
        display: none;
    }

    .logout-form {
        margin-top: 0.5rem;
    }

    .main-content {
        padding: 1rem;
    }

    .page-header {
        margin-bottom: 1rem;
    }

    .card {
        border-radius: 8px;
    }
}

@media (max-width: 520px) {
    .form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }

    .compact-field {
        max-width: none;
    }
}
