:root {
    --bg: #f4f6fb;
    --card: #ffffff;
    --line: #d8deea;
    --text: #1f2937;
    --muted: #55627a;
    --primary: #14532d;
    --primary-2: #16a34a;
    --danger: #b91c1c;
    --accent: #2563eb;
    --accent-light: #eff6ff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, sans-serif;
    color: var(--text);
    background: radial-gradient(circle at top, #e8eefc, var(--bg) 46%);
}

.container {
    max-width: 920px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.container.wide {
    max-width: 1300px;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1.2rem;
    box-shadow: 0 8px 24px rgba(4, 16, 34, 0.08);
}

.card.small {
    max-width: 500px;
    margin: 0 auto;
}

h1 {
    margin-top: 0;
    margin-bottom: 0.6rem;
}

.muted {
    color: var(--muted);
}

label {
    display: block;
    margin: 0.8rem 0 0.35rem;
    font-weight: 600;
}

fieldset {
    border: 0;
    padding: 0;
    margin: 0;
    min-width: 0;
}

fieldset:disabled {
    opacity: 0.7;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
button {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.7rem;
    font-size: 0.95rem;
}

button {
    border-color: var(--primary);
    background: linear-gradient(180deg, var(--primary-2), var(--primary));
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    margin-top: 1rem;
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

button:hover {
    filter: brightness(0.95);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(20, 83, 45, 0.2);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    filter: none;
    transform: none;
    box-shadow: none;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(15, 76, 129, 0.25);
    outline-offset: 1px;
}

.warning {
    margin-top: 0.45rem;
    color: #1e3a8a;
    font-size: 0.9rem;
}

.matric-check-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.65rem;
    align-items: center;
}

.secondary-action {
    width: auto;
    min-width: 150px;
    margin-top: 0;
    white-space: nowrap;
}

.upload-guide {
    margin: 0.35rem 0 0.65rem;
    padding: 0.75rem 0.85rem;
    background: #f8fafc;
    border: 2px solid #3b82f6;
    border-radius: 8px;
    animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
    0% {
        border-color: #3b82f6;
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
    }

    70% {
        border-color: #60a5fa;
        box-shadow: 0 0 0 6px rgba(59, 130, 246, 0);
    }

    100% {
        border-color: #3b82f6;
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

.upload-guide-title {
    margin: 0 0 0.35rem;
    font-weight: 700;
    color: #0f172a;
}

.upload-guide ol {
    margin: 0;
    padding-left: 1.1rem;
}

.upload-guide li {
    margin: 0.2rem 0;
    color: #334155;
}

.upload-guide a {
    color: #0f4c81;
    text-decoration: none;
    font-weight: 600;
}

.upload-guide a:hover {
    text-decoration: underline;
}

.photo-guidelines {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin: 1rem 0;
}

@media (min-width: 600px) {
    .photo-guidelines {
        grid-template-columns: repeat(4, 1fr);
    }
}

.guideline-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.6rem;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.guideline-item:hover {
    transform: translateY(-2px);
}

.guideline-item.accepted {
    border-color: #10b981;
    background: #f0fdf4;
}

.guideline-item.unaccepted {
    border-color: #ef4444;
    background: #fef2f2;
}

.guideline-img {
    width: 100%;
    max-width: 140px;
    height: auto;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    aspect-ratio: 1/1;
    object-fit: contain;
}

.guideline-label {
    display: block;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.guideline-item.accepted .guideline-label {
    color: #047857;
}

.guideline-item.unaccepted .guideline-label {
    color: #b91c1c;
}

.guideline-desc {
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.3;
}

.instruction-ack {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    margin: 0.45rem 0 0.55rem;
}

.instruction-ack input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    padding: 0;
    accent-color: #14532d;
    cursor: pointer;
    flex-shrink: 0;
}

.instruction-ack label {
    display: inline;
    margin: 0;
    font-weight: 600;
    color: #0f172a;
    cursor: pointer;
    line-height: 1.4;
}

.error-text {
    color: var(--danger);
}

.success-text {
    color: var(--primary-2);
}

.preview {
    margin-top: 0.8rem;
    width: 130px;
    height: 150px;
    object-fit: cover;
    border-radius: 6px;
}

.preview.always {
    display: block;
}

.alert {
    border-radius: 8px;
    padding: 0.65rem 0.8rem;
    margin: 0.8rem 0;
}

.alert.success {
    background: #dcfce7;
    color: #14532d;
}

.alert.error {
    background: #fee2e2;
    color: #991b1b;
}

.admin-link {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-start;
}

.link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #0f4c81;
    border-radius: 8px;
    padding: 0.45rem 0.72rem;
    background: #0f4c81;
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    line-height: 1;
    transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
}

.link-btn:hover {
    filter: brightness(0.95);
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(15, 76, 129, 0.24);
}

.link-btn.secondary {
    border-color: #334155;
    background: #334155;
}

.link-btn.danger {
    border-color: #991b1b;
    background: #991b1b;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.action-links {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.site-footer {
    margin-top: 1.2rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--line);
    text-align: center;
    color: var(--muted);
    font-size: 0.92rem;
}

.site-footer a {
    color: #0f4c81;
    text-decoration: none;
    font-weight: 700;
}

.site-footer a:hover {
    text-decoration: underline;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

@media (max-width: 600px) {
    .matric-check-row {
        grid-template-columns: 1fr;
    }
    .secondary-action {
        width: 100%;
    }
    .topbar {
        flex-direction: column;
        align-items: flex-start;
        text-align: center;
    }
    .topbar-actions {
        width: 100%;
        justify-content: center;
    }
}


.filters {
    display: grid;
    grid-template-columns: 1fr 200px 140px;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.bulk-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    gap: 0.6rem;
    margin-bottom: 0.8rem;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 0.6rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

tbody tr:hover {
    background: #f8fafc;
}

.thumb {
    width: 52px;
    height: 58px;
    object-fit: cover;
    border-radius: 4px;
}

/* Admin Dashboard Enhancements */
.admin-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 1.5rem;
    align-items: flex-start;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: #fff;
    padding: 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-card .label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text);
}

.stat-card.primary { border-left: 4px solid var(--primary); }
.stat-card.success { border-left: 4px solid var(--primary-2); }
.stat-card.warning { border-left: 4px solid #f59e0b; }

.search-container {
    margin-bottom: 1.5rem;
}

.search-container form {
    display: flex;
    gap: 0.5rem;
}

.search-container input {
    flex: 1;
}

.search-container button {
    width: auto;
    margin-top: 0;
    padding: 0 1.5rem;
}

@media (max-width: 600px) {
    .container {
        padding: 1rem 0.75rem;
    }
    .card {
        padding: 1rem;
    }
    .search-container form {
        flex-direction: column;
    }
    .search-container button,
    .search-container .status-btn {
        width: 100%;
        justify-content: center;
    }
    .bulk-row {
        grid-template-columns: 1fr;
    }
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    .btn-group {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 0.35rem;
    }
    .status-btn {
        white-space: nowrap;
        flex: 0 0 auto;
    }
}



.admin-sidebar {
    position: sticky;
    top: 1.5rem;
}

.nav-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1.5rem;
}

.nav-link {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--muted);
    font-weight: 600;
    transition: background 0.2s, color 0.2s;
}

.nav-link:hover {
    background: #e2e8f0;
    color: var(--text);
}

.nav-link.active {
    background: var(--primary);
    color: #fff;
}

.btn-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.status-btn {
    padding: 0.45rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.status-btn:hover {
    background: #f1f5f9;
}

.status-btn.active {
    background: var(--accent-light);
    color: var(--accent);
    border-color: var(--accent);
}

.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge.success {
    background: #dcfce7;
    color: #166534;
}

.badge.warning {
    background: #fef3c7;
    color: #92400e;
}

@media (max-width: 1000px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }
    .admin-sidebar {
        position: static;
    }
    .nav-group {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }
    .nav-link {
        white-space: nowrap;
    }
}

@media (max-width: 767px) {
    .admin-dashboard-table {
        min-width: 0;
    }

    .admin-dashboard-table thead {
        display: none;
    }

    .admin-dashboard-table,
    .admin-dashboard-table tbody,
    .admin-dashboard-table tr,
    .admin-dashboard-table td {
        display: block;
        width: 100%;
    }

    .admin-dashboard-table tbody {
        display: grid;
        gap: 0.9rem;
    }

    .admin-dashboard-table tr {
        border: 1px solid var(--line);
        border-radius: 12px;
        background: #fff;
        padding: 0.25rem 0;
        box-shadow: 0 8px 24px rgba(4, 16, 34, 0.06);
    }

    .admin-dashboard-table td {
        border-bottom: 1px solid #eef2f7;
        padding: 0.85rem 1rem;
        text-align: right;
    }

    .admin-dashboard-table td:last-child {
        border-bottom: 0;
    }

    .admin-dashboard-table td::before {
        content: attr(data-label);
        float: left;
        font-size: 0.78rem;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: var(--muted);
    }

    .admin-dashboard-table td[data-label="Select"],
    .admin-dashboard-table td[data-label="Image"],
    .admin-dashboard-table td[data-label="Actions"] {
        text-align: left;
    }

    .admin-dashboard-table td[data-label="Select"] input {
        margin-top: 0.15rem;
    }

    .admin-dashboard-table td[data-label="Image"] .thumb {
        width: 64px;
        height: 72px;
    }

    .admin-dashboard-table td[data-label="Actions"]::before {
        float: none;
        display: block;
        margin-bottom: 0.65rem;
    }

    .admin-dashboard-table td[data-label="Image"]::before,
    .admin-dashboard-table td[data-label="Select"]::before {
        margin-top: 0.2rem;
    }

    .action-links {
        display: grid;
        grid-template-columns: 1fr;
    }

    .action-links .link-btn {
        justify-content: center;
        width: 100%;
    }
}
