:root {
    --royal: #123D8D;
    --royal-2: #1f5fbd;
    --navy: #071b3f;
    --navy-soft: #0e2c61;
    --sky: #eaf3ff;
    --soft: #f4f7fb;
    --line: rgba(132, 154, 184, 0.25);
    --text: #0d2340;
    --muted: #5c718d;
    --danger: #dc4a4a;
    --success: #1e8e62;
    --radius: 16px;
    --shadow: 0 20px 50px rgba(7, 27, 63, 0.13);
    --shadow-soft: 0 12px 30px rgba(7, 27, 63, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    font-family: Inter, Poppins, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(18, 61, 141, 0.14), transparent 34rem),
        linear-gradient(135deg, #fbfdff 0%, #eef5ff 52%, #f6f8fb 100%);
    letter-spacing: 0;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.6) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.6) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.45), transparent 72%);
}

.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    width: 292px;
    height: 100vh;
    padding: 26px 18px;
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 28px;
    overflow-y: auto;
    background:
        linear-gradient(160deg, rgba(18, 61, 141, 0.98), rgba(7, 27, 63, 0.98)),
        radial-gradient(circle at 20% 0%, rgba(91, 171, 255, 0.38), transparent 18rem);
    border-right: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 18px 0 48px rgba(7, 27, 63, 0.2);
}

.sidebar .sidebar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 6px 18px;
    font-size: 1.06rem;
    line-height: 1.25;
    font-weight: 900;
}

.sidebar .sidebar-brand .logo {
    width: 62px;
    height: 62px;
    object-fit: contain;
    flex: 0 0 auto;
    padding: 6px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 14px 28px rgba(2, 15, 35, 0.25);
}

.sidebar .navbar {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.sidebar .navbar a {
    min-height: 46px;
    display: flex;
    align-items: center;
    color: rgba(238, 246, 255, 0.9);
    text-decoration: none;
    padding: 12px 16px;
    border-radius: 16px;
    font-weight: 750;
    border: 1px solid transparent;
    transition: transform 0.22s ease, background 0.22s ease, color 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.sidebar .navbar a::before {
    content: "";
    width: 8px;
    height: 8px;
    margin-right: 12px;
    border-radius: 999px;
    background: rgba(205, 228, 255, 0.74);
    box-shadow: 0 0 0 5px rgba(205, 228, 255, 0.08);
}

.sidebar .navbar a:hover,
.sidebar .navbar a.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 14px 26px rgba(2, 15, 35, 0.16);
    transform: translateX(4px);
}

.sidebar .navbar .logout {
    justify-content: center;
    margin-top: 18px;
    color: #fff;
    background: linear-gradient(135deg, #e15353, #c83e4d);
    box-shadow: 0 14px 28px rgba(220, 74, 74, 0.25);
}

.sidebar .navbar .logout::before {
    display: none;
}

.main-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

header.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 38px;
    background: rgba(255, 255, 255, 0.82);
    border-bottom: 1px solid rgba(202, 216, 236, 0.72);
    box-shadow: 0 12px 32px rgba(7, 27, 63, 0.06);
    backdrop-filter: blur(16px);
}

header.topbar .topbar-brand {
    color: var(--navy);
    font-family: Poppins, Inter, sans-serif;
    font-size: 1.32rem;
    font-weight: 900;
}

header.topbar .userbox {
    color: #455f80;
    font-size: 0.95rem;
    font-weight: 650;
    padding: 10px 18px;
    border-radius: 999px;
    background: rgba(242, 247, 255, 0.88);
    border: 1px solid rgba(185, 205, 229, 0.5);
}

.container {
    width: min(100%, 1240px);
    margin: 0 auto;
    padding: 34px 32px 54px;
}

.container:has(.aims-hero) {
    width: 100%;
    max-width: none;
    padding: 0 0 54px;
}

h1,
h2,
h3 {
    margin-top: 0;
    color: var(--text);
    font-family: Poppins, Inter, sans-serif;
    letter-spacing: 0;
}

h1 {
    margin-bottom: 24px;
    font-size: clamp(2rem, 3.2vw, 3.15rem);
    line-height: 1.08;
    font-weight: 900;
}

h2 {
    margin-bottom: 18px;
    font-size: clamp(1.25rem, 1.7vw, 1.75rem);
    line-height: 1.2;
}

p {
    color: #294765;
}

.aims-hero {
    position: relative;
    min-height: clamp(440px, 58vh, 660px);
    display: grid;
    place-items: center;
    isolation: isolate;
    overflow: hidden;
    background-image: url("bg.jpg");
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    box-shadow: inset 0 -120px 100px rgba(247, 250, 255, 0.92);
}

.aims-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    background-image: inherit;
    background-size: cover;
    background-position: center;
    transform: scale(1.04);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(135deg, rgba(7, 27, 63, 0.72), rgba(18, 61, 141, 0.66)),
        linear-gradient(to bottom, rgba(7, 27, 63, 0.12), rgba(7, 27, 63, 0.56));
}

.hero-content {
    width: min(980px, calc(100% - 36px));
    padding: 64px 28px;
    color: #fff;
    text-align: center;
}

.hero-kicker,
.section-heading span {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 16px;
    color: #dbeaff;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.hero-kicker::before,
.section-heading span::before {
    content: "";
    width: 34px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.aims-hero h1 {
    margin: 0 auto 18px;
    color: #fff;
    font-size: clamp(2.35rem, 5.2vw, 5rem);
    line-height: 0.98;
    font-weight: 900;
    text-transform: uppercase;
    text-wrap: balance;
    text-shadow: 0 18px 38px rgba(0, 0, 0, 0.34);
}

.aims-hero h1::after {
    content: "";
    display: block;
    width: 92px;
    height: 4px;
    margin: 22px auto 0;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.2), #fff, rgba(255, 255, 255, 0.2));
}

.aims-hero p {
    max-width: 780px;
    margin: 0 auto;
    color: rgba(255, 255, 255, 0.92);
    font-size: clamp(1rem, 1.6vw, 1.3rem);
    line-height: 1.75;
}

.hero-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 34px;
}

button,
.button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 11px 18px;
    color: #fff;
    font: inherit;
    font-weight: 800;
    text-decoration: none;
    border: 0;
    border-radius: 14px;
    cursor: pointer;
    background: linear-gradient(135deg, var(--royal), var(--royal-2));
    box-shadow: 0 12px 22px rgba(18, 61, 141, 0.24);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

button:hover,
.button:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 28px rgba(18, 61, 141, 0.3);
}

button.small,
.button.small {
    min-height: 36px;
    padding: 8px 13px;
    border-radius: 12px;
    font-size: 0.9rem;
}

.hero-actions .button {
    min-width: 164px;
    min-height: 50px;
    border-radius: 16px;
}

.hero-primary,
.hero-primary:hover {
    color: var(--royal);
    background: #fff;
}

.hero-secondary {
    color: #fff;
    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.38);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 18px 34px rgba(0, 0, 0, 0.14);
    backdrop-filter: blur(12px);
}

.dashboard-body {
    width: min(100%, 1240px);
    margin: -42px auto 0;
    padding: 0 32px;
}

.section-heading {
    position: relative;
    z-index: 1;
    max-width: 870px;
    margin: 0 auto 28px;
    padding: 30px 34px;
    text-align: center;
    border: 1px solid rgba(188, 208, 230, 0.62);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.section-heading span {
    color: var(--royal);
}

.section-heading h2 {
    margin-bottom: 12px;
    color: var(--navy);
    font-size: clamp(1.55rem, 2.7vw, 2.45rem);
}

.section-heading p {
    max-width: 720px;
    margin: 0 auto;
    line-height: 1.75;
}

.grid {
    display: grid;
    gap: 24px;
}

.portal-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 24px;
}

.card,
.portal-card {
    position: relative;
    margin-bottom: 24px;
    padding: 28px;
    overflow: hidden;
    border-radius: var(--radius);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(248, 252, 255, 0.88));
    border: 1px solid rgba(188, 208, 230, 0.58);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(14px);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.card:hover,
.portal-card:hover {
    transform: translateY(-3px);
    border-color: rgba(18, 61, 141, 0.32);
    box-shadow: var(--shadow);
}

.glass-card {
    min-height: 232px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(242, 247, 255, 0.68)),
        radial-gradient(circle at top right, rgba(18, 61, 141, 0.12), transparent 12rem);
    border-color: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(18px);
}

.portal-card > i,
.stat-card > i {
    display: inline-grid;
    place-items: center;
    width: 54px;
    height: 54px;
    margin-bottom: 20px;
    color: #fff;
    font-size: 1.35rem;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--royal), var(--royal-2));
    box-shadow: 0 14px 26px rgba(18, 61, 141, 0.24);
}

.portal-card h3 {
    margin: 0 0 10px;
    color: var(--navy);
    font-size: 1.18rem;
}

.portal-card p {
    margin: 0;
    line-height: 1.7;
}

.summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.stat-card {
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.stat-card::before {
    content: "";
    position: absolute;
    right: -52px;
    top: -62px;
    width: 170px;
    height: 170px;
    border-radius: 50%;
    background: rgba(18, 61, 141, 0.09);
}

.stat-card h2,
.summary-grid .card h2 {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.stat-card p,
.summary-grid .card p {
    margin: 0;
    color: var(--navy);
    font-size: 3rem;
    line-height: 1;
    font-weight: 950;
}

.stat-card > i {
    margin: 0;
    flex: 0 0 auto;
    opacity: 0.92;
}

.content-grid {
    grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.85fr);
    align-items: start;
}

.large-card {
    min-height: 280px;
}

.dashboard-intro {
    border-left: 6px solid var(--royal);
}

.dashboard-intro p {
    margin: 0;
    line-height: 1.8;
}

.list-small {
    list-style: none;
    margin: 0;
    padding: 0;
}

.list-small li {
    position: relative;
    margin-bottom: 18px;
    padding: 16px 18px 16px 20px;
    border-radius: 16px;
    background: rgba(247, 251, 255, 0.78);
    border: 1px solid rgba(202, 216, 233, 0.58);
}

.list-small li::before {
    content: "";
    position: absolute;
    top: 18px;
    left: 0;
    width: 4px;
    height: 32px;
    border-radius: 999px;
    background: linear-gradient(var(--royal-2), var(--royal));
}

.list-small li strong {
    display: inline-block;
    margin-right: 8px;
    color: #0e2743;
    font-size: 1.02rem;
}

.list-small li span {
    color: var(--muted);
    font-weight: 700;
}

.list-small li p {
    margin: 9px 0 0;
    line-height: 1.65;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border-radius: 16px;
}

table th,
table td {
    padding: 15px 16px;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

table th {
    color: var(--text);
    font-size: 0.86rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: rgba(234, 243, 255, 0.82);
}

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

table tbody tr:hover {
    background: rgba(234, 243, 255, 0.5);
}

.actions a {
    margin-right: 10px;
    color: var(--royal);
    font-weight: 750;
    text-decoration: none;
}

.actions a:hover {
    color: var(--navy);
    text-decoration: underline;
}

.form-card form label {
    display: block;
    margin-top: 16px;
    color: #254461;
    font-weight: 800;
}

.form-card form input,
.form-card form select,
.form-card form textarea,
.search-form input,
.login-card input,
.login-card select {
    width: 100%;
    padding: 12px 14px;
    color: var(--text);
    border: 1px solid rgba(154, 176, 202, 0.62);
    border-radius: 14px;
    outline: none;
    background: rgba(255, 255, 255, 0.9);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.form-card form input,
.form-card form select,
.form-card form textarea {
    margin-top: 7px;
}

.form-card form textarea {
    min-height: 130px;
    resize: vertical;
}

.form-card form input:focus,
.form-card form select:focus,
.form-card form textarea:focus,
.search-form input:focus,
.login-card input:focus,
.login-card select:focus {
    border-color: rgba(18, 61, 141, 0.78);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(18, 61, 141, 0.13);
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 18px;
}

.profile-hero-wrap {
    margin-bottom: 22px;
}

.profile-photo-panel {
    min-width: 180px;
}

@media (min-width: 768px) {
    .profile-photo-panel {
        margin-right: 24px;
    }
}

.profile-photo-frame {
    width: 150px;
    height: 150px;
    padding: 5px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 50%;
    background: #fff;
    border: 5px solid #fff;
    box-shadow: 0 16px 36px rgba(7, 27, 63, 0.16);
}

.profile-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.upload-photo-btn {
    min-height: 38px;
    padding: 8px 14px;
    font-size: 0.92rem;
    cursor: pointer;
}

.upload-photo-btn input {
    display: none;
}

.photo-action-buttons .button {
    min-width: 160px;
    text-align: center;
}

.photo-action-buttons .btn-danger {
    background: linear-gradient(135deg, #e15353, #c83e4d);
}

@media (min-width: 768px) {
    .profile-photo-panel {
        margin-right: 24px;
        transform: translateX(-8px);
    }
}

.search-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.search-form input {
    min-width: 250px;
}

.alert {
    padding: 15px 18px;
    margin-bottom: 18px;
    border-radius: 16px;
    border: 1px solid transparent;
    font-weight: 750;
    box-shadow: var(--shadow-soft);
}

.alert.success {
    color: #146445;
    background: rgba(223, 247, 236, 0.92);
    border-color: rgba(30, 142, 98, 0.18);
}

.alert.error {
    color: #922f36;
    background: rgba(255, 229, 231, 0.94);
    border-color: rgba(220, 74, 74, 0.18);
}

.footer {
    margin-top: auto;
    padding: 18px 32px 24px;
    color: #72859a;
    text-align: center;
}

.footer p {
    margin: 0;
    color: inherit;
}

.report-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.login-page {
    position: relative;
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow: hidden;
    background-image:
        linear-gradient(135deg, rgba(7, 27, 63, 0.74), rgba(18, 61, 141, 0.56)),
        url("bg.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.login-card {
    position: relative;
    z-index: 1;
    width: min(410px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    padding: 32px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.62);
    box-shadow: 0 24px 70px rgba(4, 22, 46, 0.28);
    backdrop-filter: blur(18px);
}

.login-card.register-card {
    width: min(620px, 100%);
}

.login-card h1 {
    margin-bottom: 22px;
    color: var(--navy);
    font-size: 1.85rem;
    text-align: center;
}

.login-card label {
    display: block;
    margin: 10px 0 6px;
    color: #314f6b;
    font-size: 0.9rem;
    font-weight: 850;
}

.login-card label:first-of-type {
    margin-top: 0;
}

.login-card button {
    width: 100%;
    margin-top: 18px;
    padding: 12px 16px;
}

.login-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 18px;
}

.login-actions .button.secondary {
    flex: 1;
    color: #274766;
    text-align: center;
    background: rgba(238, 244, 251, 0.9);
    border: 1px solid rgba(154, 176, 202, 0.5);
    box-shadow: none;
}

.login-card form {
    width: 100%;
    max-width: 330px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.login-card form.register-form {
    max-width: 100%;
}

.register-form {
    display: flex;
    max-width: 100%;
    height: 100%;
    flex-direction: column;
    gap: 18px;
}

.register-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
}

.register-grid > div {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.container > h1,
.container > .card,
.container > .grid,
.container > .aims-hero,
.dashboard-body > .section-heading,
.dashboard-body > .grid {
    animation: fadeUp 0.55s ease both;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

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

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (max-width: 1080px) {
    .sidebar {
        width: 260px;
    }

    header.topbar {
        padding: 20px 28px;
    }

    .portal-grid,
    .content-grid {
        grid-template-columns: 1fr;
    }
}

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

    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        padding: 18px 16px;
    }

    .sidebar .sidebar-brand {
        padding-bottom: 8px;
    }

    .sidebar .navbar {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    }

    .sidebar .navbar a:hover,
    .sidebar .navbar a.active {
        transform: none;
    }

    .sidebar .navbar .logout {
        margin-top: 0;
    }

    header.topbar {
        position: relative;
        flex-direction: column;
        align-items: flex-start;
        padding: 18px 20px;
    }

    header.topbar .userbox {
        width: 100%;
        border-radius: 16px;
    }

    .container {
        padding: 28px 18px 42px;
    }

    .container:has(.aims-hero) {
        padding-bottom: 42px;
    }

    .aims-hero {
        min-height: 520px;
        background-attachment: scroll;
    }

    .dashboard-body {
        padding: 0 18px;
    }

    .section-heading,
    .card,
    .portal-card {
        padding: 22px;
    }

    .toolbar,
    .search-form {
        align-items: stretch;
        flex-direction: column;
    }

    .search-form input,
    .search-form button,
    .search-form .button,
    .toolbar .button {
        width: 100%;
    }
}

@media (max-width: 560px) {
    h1 {
        font-size: 2rem;
    }

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

    .hero-actions .button {
        width: 100%;
    }

    .sidebar .sidebar-brand .logo {
        width: 56px;
        height: 56px;
    }

    .sidebar .navbar,
    .summary-grid {
        grid-template-columns: 1fr;
    }

    .login-page {
        padding: 16px;
    }

    .login-card {
        padding: 24px;
    }

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

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}
