:root {
    --navy: #0e2438;
    --blue: #1d4f7a;
    --teal: #176f6a;
    --gold: #b88a44;
    --rose: #6f7f92;
    --white: #ffffff;
    --text: #182230;
    --muted: #667085;
    --border: rgba(148, 163, 184, 0.32);
    --line: rgba(15, 35, 58, 0.12);
    --danger: #b42318;
    --success: #067647;
    --glass: rgba(255, 255, 255, 0.78);
    --glass-strong: rgba(255, 255, 255, 0.92);
    --shadow: 0 22px 58px rgba(15, 35, 58, 0.14);
    --soft-shadow: 0 12px 30px rgba(15, 35, 58, 0.09);
    --radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    padding-top: 132px;
    padding-bottom: 88px;
    color: var(--text);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    line-height: 1.6;
    background:
        linear-gradient(135deg, #eef3f8 0%, #f7f9fc 42%, #f2f6f8 100%);
    background-attachment: fixed;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.22)),
        repeating-linear-gradient(135deg, rgba(15, 35, 58, 0.026) 0, rgba(15, 35, 58, 0.026) 1px, transparent 1px, transparent 28px);
}

.header,
.navbar,
.container,
.dashboard-hero,
.metric-card,
.dashboard-panel,
.module-card,
.modal-content,
.notice,
table {
    border: 1px solid var(--border);
    background: var(--glass);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    box-shadow: var(--soft-shadow);
}

.header {
    position: fixed;
    top: 14px;
    left: 50%;
    z-index: 1000;
    width: min(1180px, calc(100% - 28px));
    padding: 16px 22px;
    transform: translateX(-50%);
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.24);
    background: linear-gradient(135deg, rgba(14, 36, 56, 0.98), rgba(29, 79, 122, 0.92));
    box-shadow: var(--shadow);
    border-radius: var(--radius);
}

.header::after {
    content: "";
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 0;
    height: 2px;
    background: linear-gradient(90deg, rgba(184, 138, 68, 0.9), rgba(255, 255, 255, 0.55), rgba(23, 111, 106, 0.85));
}

.header-logo {
    max-width: calc(100% - 360px);
    font-size: 20px;
    font-weight: 850;
    line-height: 1.2;
    text-transform: uppercase;
}

.user-info {
    position: absolute;
    top: 17px;
    right: 22px;
    display: flex;
    align-items: center;
    gap: 14px;
    list-style: none;
}

.user-info li {
    color: rgba(255, 255, 255, 0.88);
    font-size: 13px;
    font-weight: 750;
}

.user-info a {
    color: #ffffff;
    text-decoration: none;
}

.user-info a:hover {
    color: #f1d59a;
}

.navbar {
    position: fixed;
    top: 82px;
    left: 50%;
    z-index: 999;
    width: min(1180px, calc(100% - 28px));
    transform: translateX(-50%);
    border-color: rgba(148, 163, 184, 0.24);
    background: rgba(255, 255, 255, 0.84);
    border-radius: var(--radius);
}

.nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    list-style: none;
}

.nav-links li {
    position: relative;
}

.nav-links a {
    display: block;
    padding: 9px 14px;
    border-radius: var(--radius);
    color: var(--navy);
    text-decoration: none;
    font-size: 14px;
    font-weight: 800;
    transition: 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: #ffffff;
    background: linear-gradient(135deg, var(--navy), var(--blue));
    box-shadow: 0 12px 24px rgba(29, 79, 122, 0.18);
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 230px;
    padding: 8px;
    list-style: none;
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
}

.dropdown-menu a {
    border-radius: 6px;
}

.page-container {
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 36px 20px;
}

.container {
    width: 100%;
    max-width: 780px;
    position: relative;
    overflow: hidden;
    padding: 42px;
    text-align: center;
    border-radius: var(--radius);
}

.container::before,
.dashboard-panel::before,
.metric-card::before,
.module-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, var(--blue), var(--teal), var(--gold));
}

.wide-container {
    max-width: 1120px;
    text-align: left;
}

.container h1,
.container h2,
.container h3 {
    margin-bottom: 14px;
    color: var(--navy);
    font-weight: 850;
    line-height: 1.25;
}

.container p {
    color: var(--muted);
}

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-shell,
.auth-card {
    width: 100%;
    max-width: 460px;
}

.section-heading,
.panel-heading,
.hero-actions,
.table-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.section-heading {
    justify-content: space-between;
    margin-bottom: 22px;
}

.section-heading p,
.panel-heading p {
    text-align: left;
}

form {
    margin-top: 26px;
}

label {
    display: block;
    margin-top: 12px;
    color: var(--navy);
    text-align: left;
    font-size: 14px;
    font-weight: 800;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="file"],
select,
textarea {
    width: 100%;
    display: block;
    margin: 8px 0 14px;
    padding: 14px 15px;
    border: 1px solid rgba(148, 163, 184, 0.34);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.9);
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
    transition: 0.2s ease;
}

input[type="file"] {
    cursor: pointer;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(29, 79, 122, 0.58);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(29, 79, 122, 0.11);
}

input[type="submit"],
button,
.button-link {
    min-height: 46px;
    border: 0;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 15px;
    font-weight: 850;
    cursor: pointer;
    transition: 0.2s ease;
}

input[type="submit"],
button {
    width: 100%;
    margin-top: 8px;
    padding: 0 18px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--navy), var(--blue));
    box-shadow: 0 14px 30px rgba(29, 79, 122, 0.2);
}

input[type="submit"]:hover,
button:hover,
.button-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 38px rgba(16, 35, 63, 0.18);
}

input[type="submit"]:active,
button:active {
    transform: translateY(0);
}

.inline-button,
.close {
    width: auto;
}

.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    text-decoration: none;
}

.button-link.primary {
    color: #ffffff;
    background: linear-gradient(135deg, var(--navy), var(--blue));
}

.dashboard-hero .button-link.primary {
    color: var(--navy);
    background: rgba(255, 255, 255, 0.88);
}

.button-link.secondary {
    color: var(--navy);
    border: 1px solid rgba(148, 163, 184, 0.32);
    background: rgba(255, 255, 255, 0.78);
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(14, 36, 56, 0.44);
    backdrop-filter: blur(8px);
}

.modal-content {
    width: min(92%, 620px);
    margin: 12vh auto;
    padding: 32px;
    border-radius: var(--radius);
}

.close {
    float: right;
    min-width: 42px;
    min-height: 42px;
    padding: 0;
    margin: 0;
}

.dashboard-shell {
    width: min(1180px, 100%);
}

.dashboard-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    position: relative;
    overflow: hidden;
    padding: 34px;
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(14, 36, 56, 0.98), rgba(29, 79, 122, 0.9));
    box-shadow: var(--shadow);
}

.dashboard-hero h1 {
    margin-bottom: 8px;
    font-size: 42px;
    line-height: 1.1;
}

.dashboard-hero p {
    max-width: 640px;
    color: rgba(255, 255, 255, 0.84);
    text-align: left;
}

.eyebrow {
    margin-bottom: 8px;
    color: #e8c889;
    font-size: 13px;
    font-weight: 850;
    text-transform: uppercase;
}

.metric-grid,
.module-grid,
.dashboard-grid {
    display: grid;
    gap: 18px;
}

.metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 22px;
}

.metric-card,
.dashboard-panel,
.module-card,
.notice {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
}

.metric-card {
    padding: 22px;
}

.metric-card span,
.module-card small,
.recent-list span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.metric-card strong {
    display: block;
    margin-top: 8px;
    color: var(--navy);
    font-size: 32px;
    line-height: 1;
}

.notice {
    margin-top: 18px;
    padding: 16px 18px;
    text-align: left;
}

.notice.warning {
    color: #7a4d00;
    border-color: rgba(245, 197, 111, 0.58);
    background: rgba(255, 248, 232, 0.72);
}

.dashboard-grid {
    grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.8fr);
    margin-top: 22px;
}

.dashboard-panel {
    padding: 24px;
}

.panel-heading {
    justify-content: space-between;
    margin-bottom: 18px;
}

.panel-heading h2 {
    margin: 0;
}

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

.module-card {
    display: block;
    padding: 18px;
    color: inherit;
    text-align: left;
    text-decoration: none;
    transition: 0.2s ease;
}

.module-card:hover {
    transform: translateY(-2px);
    border-color: rgba(37, 99, 235, 0.4);
}

.module-card span {
    color: var(--navy);
    font-size: 16px;
    font-weight: 850;
}

.module-card strong {
    display: block;
    margin: 8px 0 5px;
    color: var(--blue);
    font-size: 22px;
}

.recent-list {
    list-style: none;
}

.recent-list li {
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.recent-list li:first-child {
    padding-top: 0;
}

.recent-list li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.recent-list a {
    display: block;
    color: var(--navy);
    font-weight: 850;
    text-decoration: none;
    word-break: break-word;
}

.empty-state {
    padding: 28px 0;
    color: var(--muted);
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    margin: 26px 0;
    overflow: hidden;
    border-collapse: collapse;
    border-radius: var(--radius);
}

table thead {
    color: #ffffff;
    background: linear-gradient(135deg, var(--navy), var(--blue));
}

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

table th {
    font-weight: 850;
}

table tbody tr {
    transition: 0.18s ease;
}

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

.table-actions {
    align-items: flex-start;
}

.table-actions a,
p a {
    color: var(--blue);
    font-weight: 850;
    text-decoration: none;
}

.table-actions a:hover,
p a:hover {
    color: var(--navy);
}

.error-message,
.success-message {
    margin: 12px 0;
    text-align: center;
    font-size: 14px;
    font-weight: 850;
}

.error-message {
    color: var(--danger);
}

.success-message {
    color: var(--success);
}

p {
    text-align: center;
    font-size: 14px;
}

footer {
    position: fixed;
    left: 50%;
    bottom: 14px;
    z-index: 998;
    width: min(1180px, calc(100% - 28px));
    padding: 13px 20px;
    transform: translateX(-50%);
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(14, 36, 56, 0.96), rgba(29, 79, 122, 0.86));
    backdrop-filter: blur(18px);
    box-shadow: var(--soft-shadow);
}

footer p {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.container,
.modal-content,
.dashboard-hero,
.metric-card,
.dashboard-panel,
.module-card,
table {
    animation: fadeIn 0.32s ease both;
}

@media (max-width: 768px) {
    body {
        padding-top: 170px;
        padding-bottom: 96px;
    }

    .header {
        top: 10px;
        padding: 14px 16px;
    }

    .header-logo {
        max-width: 100%;
        font-size: 17px;
    }

    .user-info {
        position: static;
        flex-wrap: wrap;
        justify-content: flex-start;
        margin-top: 10px;
        gap: 8px 12px;
    }

    .navbar {
        top: 104px;
        overflow-x: auto;
    }

    .nav-links {
        justify-content: flex-start;
        width: max-content;
    }

    .page-container {
        padding: 24px 14px;
    }

    .container {
        padding: 30px 18px;
    }

    .section-heading,
    .dashboard-hero,
    .panel-heading,
    .hero-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .dashboard-hero {
        padding: 26px 20px;
    }

    .dashboard-hero h1 {
        font-size: 32px;
    }

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

    .button-link {
        width: 100%;
    }

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