:root {
    --blue-950: #0b1f4d;
    --blue-900: #123a7c;
    --blue-700: #1d5fd0;
    --blue-600: #2876e6;
    --blue-100: #dcecff;
    --blue-50: #f3f8ff;
    --ink: #172033;
    --muted: #61718c;
    --line: #d8e2f1;
    --white: #ffffff;
    --danger: #b42318;
    --danger-bg: #fff1f0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--blue-50);
}

a {
    color: inherit;
    text-decoration: none;
}

.auth-body {
    min-height: 100vh;
    background:
        linear-gradient(135deg, rgba(11, 31, 77, 0.94), rgba(29, 95, 208, 0.86)),
        linear-gradient(45deg, var(--blue-950), var(--blue-600));
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-panel {
    width: min(100%, 420px);
    background: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 34px;
    box-shadow: 0 24px 70px rgba(9, 25, 58, 0.28);
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: var(--blue-700);
    color: var(--white);
    font-weight: 800;
}

.eyebrow {
    margin: 18px 0 8px;
    color: var(--blue-700);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 12px;
    color: var(--blue-950);
    font-size: 2rem;
    line-height: 1.1;
}

.login-copy,
.hero-copy,
.module-card p {
    color: var(--muted);
    line-height: 1.6;
}

.login-form {
    display: grid;
    gap: 10px;
    margin-top: 24px;
}

label {
    color: var(--blue-950);
    font-weight: 700;
}

input,
select {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 14px;
    color: var(--ink);
    font: inherit;
    outline: none;
    background: var(--white);
}

input:focus,
select:focus {
    border-color: var(--blue-600);
    box-shadow: 0 0 0 4px rgba(40, 118, 230, 0.14);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border: 0;
    border-radius: 8px;
    padding: 0 18px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.button-primary {
    margin-top: 12px;
    background: var(--blue-700);
    color: var(--white);
}

.button-primary:hover,
.button-secondary:hover {
    background: var(--blue-900);
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.button-secondary {
    background: var(--blue-700);
    color: var(--white);
}

.button-light {
    min-height: 36px;
    border: 1px solid var(--line);
    background: var(--white);
    color: var(--blue-700);
}

.button-light:hover {
    border-color: #aac8ef;
    background: #f7fbff;
}

.alert {
    margin-top: 18px;
    border: 1px solid #ffcbc7;
    border-radius: 8px;
    padding: 12px 14px;
    background: var(--danger-bg);
    color: var(--danger);
    font-weight: 700;
}

.alert-success {
    border-color: #b8e6ca;
    background: #effaf4;
    color: #17663a;
}

.alert-info {
    border-color: #b6d7ff;
    background: #edf6ff;
    color: var(--blue-900);
}

.alert-danger {
    border-color: #ffcbc7;
    background: var(--danger-bg);
    color: var(--danger);
}

.is-hidden {
    display: none;
}

.admin-body {
    min-height: 100vh;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
    padding: 0 clamp(18px, 4vw, 44px);
    background: var(--white);
    border-bottom: 1px solid var(--line);
}

.app-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--blue-950);
    font-weight: 900;
}

.topnav a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    color: var(--blue-700);
    font-weight: 800;
}

.topnav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}

.page-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 36px 0 56px;
}

.hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 34px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.hero .eyebrow {
    margin-top: 0;
}

.hero h1 {
    max-width: 700px;
}

.hero-copy {
    max-width: 720px;
    margin-bottom: 0;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 18px;
    margin-top: 22px;
}

.module-card {
    display: flex;
    gap: 14px;
    min-height: 146px;
    padding: 22px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.module-card:hover {
    border-color: #aac8ef;
    box-shadow: 0 14px 36px rgba(13, 47, 109, 0.08);
}

.module-icon {
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: var(--blue-100);
    color: var(--blue-900);
    font-weight: 900;
}

.module-card h2 {
    margin-bottom: 8px;
    color: var(--blue-950);
    font-size: 1.05rem;
}

.module-card p {
    margin-bottom: 0;
    font-size: 0.95rem;
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.page-heading .eyebrow {
    margin-top: 0;
}

.panel {
    margin-top: 20px;
    padding: 24px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.panel h2 {
    margin-bottom: 18px;
    color: var(--blue-950);
    font-size: 1.15rem;
}

.entity-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    align-items: end;
    gap: 16px;
}

.import-form {
    margin-bottom: 12px;
}

.form-hint {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.field {
    display: grid;
    gap: 8px;
}

.field-wide {
    grid-column: span 2;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.section-title h2 {
    margin-bottom: 0;
}

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

.table-wrap {
    overflow-x: auto;
    margin-top: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
}

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

th {
    background: #f7fbff;
    color: var(--blue-950);
    font-size: 0.82rem;
    text-transform: uppercase;
}

td {
    color: var(--ink);
}

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

.empty-state {
    color: var(--muted);
    text-align: center;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 18px;
}

.page-link {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 14px;
    color: var(--blue-700);
    font-weight: 800;
    background: var(--white);
}

.page-link.is-disabled {
    color: var(--muted);
    opacity: 0.55;
}

.page-count {
    color: var(--muted);
    font-weight: 800;
}

@media (max-width: 680px) {
    .login-panel,
    .hero {
        padding: 24px;
    }

    .hero,
    .topbar {
        align-items: stretch;
        flex-direction: column;
    }

    .button-secondary {
        width: 100%;
    }

    .field-wide {
        grid-column: auto;
    }

    .section-title,
    .pagination {
        align-items: stretch;
        flex-direction: column;
    }
}
