:root {
    --navy: #071b3a;
    --navy-2: #0d2c5f;
    --gold: #d4a017;
    --gold-2: #f3c64f;
    --light: #f4f7fb;
    --ink: #1d2939;
    --muted: #667085;
    --card: #ffffff;
    --shadow: 0 18px 45px rgba(7, 27, 58, .12);
}

* { letter-spacing: 0; }

html {
    overflow-x: hidden;
}

body {
    background: var(--light);
    color: var(--ink);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    overflow-x: hidden;
}

a { text-decoration: none; }

.site-logo {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    object-fit: cover;
    background: #fff;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .16);
}

.site-logo.lg {
    width: 52px;
    height: 52px;
}

.app-navbar,
.site-footer,
.admin-topbar {
    background: linear-gradient(135deg, var(--navy), var(--navy-2));
}

.text-gold { color: var(--gold-2) !important; }

.btn-gold {
    background: var(--gold);
    border-color: var(--gold);
    color: #111827;
    font-weight: 700;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.btn-gold:hover {
    background: var(--gold-2);
    border-color: var(--gold-2);
    color: #111827;
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(212, 160, 23, .28);
}

.hero {
    min-height: 76vh;
    display: flex;
    align-items: center;
    color: #fff;
    background:
        linear-gradient(120deg, rgba(7, 27, 58, .94), rgba(13, 44, 95, .76)),
        url("https://images.unsplash.com/photo-1524995997946-a1c2e315a42f?auto=format&fit=crop&w=1800&q=80") center/cover;
}

.hero h1 {
    font-size: clamp(2.35rem, 6vw, 5.5rem);
    line-height: 1;
    max-width: 980px;
}

.hero-search {
    background: rgba(255, 255, 255, .96);
    padding: .65rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.glass-strip {
    margin-top: -42px;
    position: relative;
    z-index: 2;
}

.metric-card,
.resource-card,
.panel-card,
.auth-card {
    background: var(--card);
    border: 1px solid rgba(13, 44, 95, .08);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(7, 27, 58, .08);
    transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease;
}

.metric-card:hover,
.resource-card:hover,
.panel-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow);
    border-color: rgba(212, 160, 23, .45);
}

.programme-folder {
    color: inherit;
}

.metric-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(212, 160, 23, .16);
    color: var(--navy);
    font-size: 1.4rem;
}

.section-title {
    color: var(--navy);
    font-weight: 800;
}

.resource-cover {
    height: 210px;
    object-fit: contain;
    width: 100%;
    padding: .7rem;
    background:
        linear-gradient(135deg, rgba(255,255,255,.88), rgba(255,255,255,.74)),
        linear-gradient(135deg, #e8edf5, #fff);
    border-radius: 8px 8px 0 0;
    display: block;
}

.resource-placeholder {
    height: 210px;
    display: grid;
    place-items: center;
    color: var(--navy);
    font-size: 3rem;
    background: linear-gradient(135deg, #e8edf5, #fff);
    border-radius: 8px 8px 0 0;
}

.detail-cover {
    height: 460px;
    max-height: 62vh;
    object-fit: contain;
    padding: 1.2rem;
    background: linear-gradient(135deg, #eef2f7, #fff);
}

.cover-thumb {
    width: 54px;
    height: 68px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid rgba(13, 44, 95, .12);
}

.hover-lift,
.table-hover tbody tr {
    transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}

.hover-lift:hover {
    transform: translateY(-3px);
}

.table-hover tbody tr:hover {
    background: #fff8e6;
}

.fade-up {
    opacity: 0;
    transform: translateY(18px);
    animation: fadeUp .62s ease forwards;
}

.resource-card {
    animation: cardFloatIn .46s ease both;
}

@keyframes fadeUp {
    to { opacity: 1; transform: translateY(0); }
}

@keyframes cardFloatIn {
    from { opacity: 0; transform: translateY(16px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: no-preference) {
    .app-navbar {
        animation: slideDown .35s ease both;
    }

    .btn,
    .nav-link,
    .form-control,
    .form-select {
        transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease, color .2s ease;
    }

    .nav-link:hover {
        transform: translateY(-1px);
    }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-wrap {
    min-height: calc(100vh - 150px);
    display: grid;
    place-items: center;
    padding: 4rem 1rem;
}

.auth-card {
    width: min(100%, 460px);
    padding: 2rem;
}

.admin-body { background: #eef2f7; }

.admin-shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

.admin-sidebar {
    background: var(--navy);
    color: #fff;
    padding: 1.25rem;
    position: sticky;
    top: 0;
    height: 100vh;
}

.admin-sidebar .brand {
    display: flex;
    gap: .6rem;
    align-items: center;
    color: #fff;
    font-weight: 800;
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

.admin-menu {
    display: grid;
    gap: .35rem;
}

.admin-menu a {
    color: rgba(255, 255, 255, .78);
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .78rem .85rem;
    border-radius: 8px;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}

.admin-menu a:hover,
.admin-menu a:focus {
    background: rgba(255, 255, 255, .12);
    color: #fff;
    transform: translateX(4px);
}

.admin-content { min-width: 0; }

.admin-topbar {
    min-height: 70px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 20;
}

.table-responsive {
    border-radius: 8px;
}

.table {
    min-width: 760px;
}

.auth-card,
.panel-card,
.resource-card,
.metric-card {
    max-width: 100%;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 .22rem rgba(212, 160, 23, .18);
}

.status-dot {
    display: inline-block;
    width: .6rem;
    height: .6rem;
    border-radius: 50%;
    margin-right: .35rem;
}

.status-active { background: #12b76a; }
.status-inactive { background: #f04438; }
.status-pending { background: #d4a017; }

.theme-option {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
    padding: .9rem;
    border: 1px solid rgba(13, 44, 95, .12);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    height: 100%;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.theme-option:hover,
.theme-option.active {
    transform: translateY(-3px);
    border-color: var(--gold);
    box-shadow: 0 14px 30px rgba(7, 27, 58, .1);
}

.theme-option input {
    margin-top: .25rem;
}

.swatches {
    display: flex;
    gap: .35rem;
    margin-top: .6rem;
}

.swatches i {
    width: 32px;
    height: 22px;
    border-radius: 5px;
    border: 1px solid rgba(0, 0, 0, .08);
}

.site-preview-card {
    background:
        linear-gradient(135deg, rgba(255,255,255,.96), rgba(255,255,255,.9)),
        linear-gradient(135deg, var(--navy), var(--gold));
}

.preview-header {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(13, 44, 95, .1);
}

@media (max-width: 991px) {
    .admin-shell { grid-template-columns: 1fr; }
    .admin-sidebar {
        position: fixed;
        transform: translateX(-105%);
        transition: transform .25s ease;
        z-index: 50;
        width: 280px;
    }
    .admin-sidebar.open { transform: translateX(0); }
    .hero { min-height: 68vh; }
    .resource-cover,
    .resource-placeholder {
        height: 190px;
    }

    .detail-cover {
        height: 360px;
    }

    .admin-topbar {
        padding: .85rem 1rem;
    }

    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (max-width: 575px) {
    .hero {
        min-height: auto;
        padding: 3rem 0 4.5rem;
    }

    .hero h1 {
        font-size: 2.25rem;
    }

    .hero-search {
        padding: .55rem;
    }

    .glass-strip {
        margin-top: -26px;
    }

    .auth-card {
        padding: 1.35rem;
    }

    .resource-cover,
    .resource-placeholder {
        height: 220px;
    }

    .detail-cover {
        height: 300px;
    }

    .btn,
    .form-control,
    .form-select {
        min-height: 42px;
    }

    .admin-sidebar {
        width: min(86vw, 280px);
    }

    .admin-topbar {
        flex-wrap: wrap;
    }
}

@media (min-width: 1600px) {
    .container { max-width: 1480px; }
    body { font-size: 1.05rem; }

    .resource-cover,
    .resource-placeholder {
        height: 250px;
    }
}
