:root {
    --bg: #f4f8fb;
    --ink: #18202f;
    --muted: #677085;
    --line: #dfe5ef;
    --panel: #ffffff;
    --primary: #00468a;
    --primary-dark: #00356a;
    --success: #25d044;
    --success-dark: #1eba3a;
    --accent: #00a3df;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(0, 163, 223, .16), transparent 34rem),
        linear-gradient(135deg, #f8fbfd 0%, #eef6fb 46%, #f7fafc 100%);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
}

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

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

.sidebar {
    width: 240px;
    padding: 24px 18px;
    background: #18202f;
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
}

.brand-mark {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
    background: var(--accent);
    color: #1c1c1c;
    font-weight: 700;
}

nav {
    display: grid;
    gap: 8px;
}

nav a,
.logout {
    padding: 11px 12px;
    border-radius: 8px;
    color: #d8dfec;
}

nav a.active,
nav a:hover,
.logout:hover {
    background: rgba(255, 255, 255, .12);
    color: #fff;
}

.logout {
    margin-top: auto;
}

.content,
.auth-content {
    width: 100%;
    padding: 28px;
}

.auth-content {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 36px 18px;
    position: relative;
    overflow: hidden;
}

.auth-content::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(0, 70, 138, .06) 1px, transparent 1px),
        linear-gradient(180deg, rgba(0, 70, 138, .06) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .6), transparent 72%);
    pointer-events: none;
}

.auth-card,
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(24, 32, 47, .06);
}

.auth-card {
    width: min(420px, 100%);
    padding: 46px 40px 34px;
    position: relative;
    z-index: 1;
    display: grid;
    justify-items: stretch;
    border-color: rgba(0, 70, 138, .12);
    box-shadow: 0 22px 60px rgba(0, 70, 138, .14);
}

.auth-logo {
    width: 118px;
    max-width: 46vw;
    height: auto;
    justify-self: center;
    margin-bottom: 34px;
}

.auth-heading {
    text-align: center;
    margin-bottom: 22px;
}

.auth-heading h1 {
    margin-bottom: 8px;
    color: var(--primary);
    font-size: 17px;
    line-height: 1.3;
    text-transform: uppercase;
}

.auth-heading p {
    max-width: 300px;
    margin: 0 auto;
    font-size: 14px;
    line-height: 1.45;
}

.auth-form {
    display: grid;
    gap: 18px;
}

.auth-form label {
    gap: 8px;
    color: var(--primary);
    font-weight: 700;
    text-align: center;
}

.auth-form input {
    min-height: 48px;
    border-color: #d5dce5;
    border-radius: 4px;
    background: #fff;
    box-shadow: inset 0 1px 2px rgba(24, 32, 47, .04);
    font-weight: 400;
    text-align: left;
}

.auth-form input::placeholder {
    color: #b8c0cc;
}

.auth-form input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 163, 223, .14);
    outline: none;
}

.auth-form button {
    min-height: 48px;
    margin-top: 20px;
    border-radius: 4px;
    background: var(--success);
    font-size: 13px;
    text-transform: uppercase;
}

.auth-form button:hover {
    background: var(--success-dark);
}

.recover-link {
    justify-self: center;
    color: #004eea;
    font-size: 12px;
    font-weight: 700;
}

.recover-link:hover {
    text-decoration: underline;
}

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

p,
.page-title span,
.empty {
    color: var(--muted);
}

.page-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.page-title h1 {
    margin: 0;
    font-size: 28px;
}

.metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.metrics article {
    padding: 22px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.metrics strong {
    display: block;
    margin-bottom: 8px;
    font-size: 30px;
}

.metrics span {
    color: var(--muted);
}

.panel {
    padding: 20px;
    margin-bottom: 18px;
}

.form-grid,
.form-row {
    display: grid;
    gap: 14px;
}

.form-row {
    grid-template-columns: repeat(4, minmax(140px, 1fr)) auto;
    align-items: end;
}

label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 14px;
}

input,
select,
button {
    min-height: 42px;
    border-radius: 8px;
    font: inherit;
}

input,
select {
    width: 100%;
    border: 1px solid var(--line);
    padding: 0 12px;
    background: #fff;
    color: var(--ink);
}

button {
    border: 0;
    padding: 0 18px;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

button:hover {
    background: var(--primary-dark);
}

.flash {
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid #b9dfd6;
    border-radius: 8px;
    background: #e9f8f4;
    color: #155b50;
}

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

.module-grid span {
    padding: 16px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--muted);
}

.table-panel {
    overflow-x: auto;
}

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

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

th {
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
}

@media (max-width: 900px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        width: 100%;
    }

    .metrics,
    .module-grid,
    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .auth-card {
        padding: 34px 22px 28px;
    }

    .auth-logo {
        width: 104px;
        margin-bottom: 28px;
    }

    .auth-heading h1 {
        font-size: 16px;
    }
}
