:root {
    --navy-950: #082344;
    --navy-900: #0d315d;
    --blue-700: #1769c2;
    --blue-600: #2380dd;
    --blue-100: #dfeeff;
    --cyan-600: #0891b2;
    --cyan-100: #cff5fb;
    --amber-600: #d97706;
    --amber-100: #fff0c7;
    --violet-600: #7c3aed;
    --violet-100: #ede9fe;
    --slate-950: #172033;
    --slate-700: #42516a;
    --slate-500: #718096;
    --slate-200: #dfe6ef;
    --slate-100: #edf2f7;
    --surface: rgba(255, 255, 255, 0.96);
    --shadow-sm: 0 8px 24px rgba(23, 39, 68, 0.07);
    --shadow-lg: 0 24px 60px rgba(13, 49, 93, 0.14);
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 8% 0%, rgba(35, 128, 221, 0.10), transparent 30%),
        radial-gradient(circle at 94% 18%, rgba(8, 145, 178, 0.08), transparent 26%),
        #f4f7fb;
    color: var(--slate-950);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 12px 30px;
    background: linear-gradient(115deg, var(--navy-950), var(--navy-900) 62%, #145da5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 24px rgba(8, 35, 68, 0.18);
}

.topbar-inner,
.container,
.messages {
    max-width: 1240px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: #fff;
    text-decoration: none;
    letter-spacing: 0;
}

.brand-mark {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.13);
    font-size: 19px;
    font-weight: 800;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-copy strong {
    font-size: 18px;
}

.brand-copy small {
    margin-top: 3px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.nav {
    gap: 9px;
}

.nav a,
.logout-button,
.user-pill {
    border-radius: 10px;
}

.nav a,
.logout-button {
    padding: 8px 13px;
    transition: background 0.18s ease, transform 0.18s ease;
}

.nav a:hover,
.logout-button:hover {
    transform: translateY(-1px);
}

.user-pill {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.82);
}

.container {
    margin: 34px auto;
}

.hero {
    position: relative;
    display: grid;
    min-height: 310px;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
    overflow: hidden;
    border: 1px solid rgba(35, 128, 221, 0.18);
    border-radius: 28px;
    background: linear-gradient(128deg, #fff 0%, #f5faff 54%, #deefff 100%);
    box-shadow: var(--shadow-lg);
}

.hero-content {
    position: relative;
    z-index: 2;
    align-self: center;
    padding: 48px 52px;
}

.eyebrow {
    display: inline-block;
    color: var(--blue-700);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hero h1,
.category-hero h1 {
    margin: 10px 0 14px;
    color: var(--navy-950);
    font-size: clamp(34px, 4.3vw, 52px);
    line-height: 1.12;
    letter-spacing: -0.035em;
}

.hero p {
    max-width: 690px;
    margin: 0;
    color: var(--slate-700);
    font-size: 17px;
    line-height: 1.8;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
}

.hero-meta span {
    padding: 8px 12px;
    border: 1px solid rgba(35, 128, 221, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--slate-700);
    font-size: 13px;
}

.hero-meta strong {
    color: var(--blue-700);
}

.hero-visual {
    position: relative;
    min-height: 260px;
}

.hero-emblem {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    width: 116px;
    height: 116px;
    place-items: center;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 32px;
    background: linear-gradient(145deg, #1b74ce, #0b427b);
    color: #fff;
    font-size: 44px;
    font-weight: 800;
    box-shadow: 0 22px 45px rgba(13, 67, 122, 0.28);
}

.hero-orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    border: 1px solid rgba(23, 105, 194, 0.18);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.orbit-one { width: 210px; height: 210px; }
.orbit-two { width: 300px; height: 300px; }

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin: 42px 2px 20px;
}

.section-heading.compact {
    margin-top: 32px;
}

.section-heading h2 {
    margin: 6px 0 0;
    color: var(--navy-950);
    font-size: 27px;
}

.section-heading p {
    margin: 0;
    color: var(--slate-500);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.category-card {
    position: relative;
    display: flex;
    min-height: 214px;
    flex-direction: column;
    padding: 26px;
    overflow: hidden;
    border: 1px solid var(--slate-200);
    border-radius: 22px;
    background: var(--surface);
    color: inherit;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.category-card::after {
    position: absolute;
    right: -48px;
    bottom: -62px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: var(--accent-soft);
    content: "";
    opacity: 0.62;
}

.category-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 20px 42px rgba(23, 39, 68, 0.13);
}

.accent-blue { --accent: var(--blue-600); --accent-soft: var(--blue-100); }
.accent-cyan { --accent: var(--cyan-600); --accent-soft: var(--cyan-100); }
.accent-amber { --accent: var(--amber-600); --accent-soft: var(--amber-100); }
.accent-violet { --accent: var(--violet-600); --accent-soft: var(--violet-100); }

.category-icon,
.category-hero-icon {
    display: grid;
    place-items: center;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 850;
}

.category-icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    font-size: 25px;
}

.category-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    margin-top: 22px;
}

.category-count {
    color: var(--accent);
    font-size: 12px;
    font-weight: 750;
}

.category-content strong {
    margin: 6px 0 9px;
    color: var(--navy-950);
    font-size: 23px;
}

.category-content > span:last-child {
    color: var(--slate-500);
    font-size: 14px;
    line-height: 1.65;
}

.card-arrow {
    position: absolute;
    right: 22px;
    top: 24px;
    color: var(--accent);
    font-size: 24px;
    transition: transform 0.2s ease;
}

.category-card:hover .card-arrow {
    transform: translateX(4px);
}

.welcome-strip {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 24px;
    padding: 17px 20px;
    border: 1px solid var(--slate-200);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
}

.welcome-avatar {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 12px;
    background: var(--navy-900);
    color: #fff;
    font-weight: 800;
}

.welcome-strip > div:nth-child(2) {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 3px;
}

.welcome-strip span {
    color: var(--slate-500);
    font-size: 13px;
}

.status-dot {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.status-dot i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22a06b;
    box-shadow: 0 0 0 4px rgba(34, 160, 107, 0.12);
}

.breadcrumb {
    display: flex;
    gap: 9px;
    margin-bottom: 18px;
    color: var(--slate-500);
    font-size: 13px;
}

.breadcrumb a,
.text-link {
    color: var(--blue-700);
    font-weight: 650;
    text-decoration: none;
}

.category-hero {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 24px;
    padding: 34px 38px;
    border: 1px solid var(--slate-200);
    border-radius: 24px;
    background: linear-gradient(125deg, #fff, var(--accent-soft));
    box-shadow: var(--shadow-sm);
}

.category-hero-icon {
    width: 76px;
    height: 76px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 22px;
    font-size: 32px;
    box-shadow: 0 12px 24px rgba(23, 39, 68, 0.09);
}

.category-hero h1 {
    margin: 5px 0 7px;
    font-size: 34px;
}

.category-hero p {
    margin: 0;
    color: var(--slate-700);
    line-height: 1.7;
}

.category-total {
    display: flex;
    min-width: 112px;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.68);
}

.category-total strong {
    color: var(--accent);
    font-size: 30px;
}

.category-total span {
    color: var(--slate-500);
    font-size: 12px;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.module-card {
    display: flex;
    min-height: 260px;
    flex-direction: column;
    padding: 24px;
    border: 1px solid var(--slate-200);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.module-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 38px rgba(23, 39, 68, 0.12);
}

.module-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.module-icon {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 14px;
    background: #eaf3ff;
    color: var(--blue-700);
    font-size: 17px;
    font-weight: 800;
}

.module-badge {
    padding: 5px 9px;
    border-radius: 999px;
    background: var(--slate-100);
    color: var(--slate-500);
    font-size: 11px;
    font-weight: 700;
}

.module-card h2 {
    margin: 20px 0 9px;
    color: var(--navy-950);
    font-size: 20px;
}

.module-card p {
    flex: 1;
    margin: 0;
    color: var(--slate-500);
    font-size: 14px;
    line-height: 1.7;
}

.module-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--slate-100);
    color: var(--blue-700);
    font-size: 14px;
    font-weight: 750;
    text-decoration: none;
}

.module-link span {
    font-size: 20px;
    transition: transform 0.18s ease;
}

.module-link:hover span {
    transform: translateX(4px);
}

.card,
.form-card,
fieldset {
    border-color: var(--slate-200);
    box-shadow: var(--shadow-sm);
}

fieldset {
    margin: 20px 0;
    padding: 20px;
    border: 1px solid var(--slate-200);
    border-radius: 14px;
    background: #fbfdff;
}

legend {
    padding: 0 8px;
    color: var(--navy-900);
    font-weight: 750;
}

table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--slate-200);
    background: #fff;
}

th,
td {
    padding: 11px 13px;
    border: 1px solid var(--slate-200);
    text-align: left;
}

th {
    background: #edf5ff;
    color: var(--navy-900);
}

input:focus,
select:focus,
textarea:focus,
a:focus-visible,
button:focus-visible {
    outline: 3px solid rgba(35, 128, 221, 0.22);
    outline-offset: 2px;
}

.footer {
    padding: 26px 18px 36px;
    line-height: 1.8;
}

@media (max-width: 900px) {
    .topbar-inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .nav {
        width: 100%;
        flex-wrap: wrap;
    }

    .hero {
        grid-template-columns: 1fr;
    }

    .hero-content {
        padding: 38px 30px 20px;
    }

    .hero-visual {
        min-height: 210px;
    }

    .category-grid,
    .module-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .category-hero {
        grid-template-columns: auto 1fr;
    }

    .category-total {
        display: none;
    }
}

@media (max-width: 620px) {
    .topbar {
        padding: 12px 16px;
    }

    .brand-copy small,
    .user-pill {
        display: none;
    }

    .container {
        margin-top: 20px;
        padding: 0 14px;
    }

    .hero {
        border-radius: 20px;
    }

    .hero-content {
        padding: 30px 22px 10px;
    }

    .hero h1 {
        font-size: 34px;
    }

    .hero-meta {
        gap: 7px;
    }

    .section-heading,
    .welcome-strip {
        align-items: flex-start;
        flex-direction: column;
    }

    .category-grid,
    .module-grid {
        grid-template-columns: 1fr;
    }

    .category-card {
        min-height: 190px;
    }

    .category-hero {
        grid-template-columns: 1fr;
        padding: 26px 22px;
    }

    .category-hero-icon {
        width: 60px;
        height: 60px;
        border-radius: 18px;
    }

    .status-dot {
        margin-left: 54px;
    }
}
