:root {
    --ink: #172026;
    --muted: #60717a;
    --line: #d9e2e5;
    --bg: #f5f8f7;
    --panel: #ffffff;
    --brand: #126b5e;
    --brand-dark: #0c4b43;
    --accent: #d59f2a;
    --danger: #a73939;
    --success: #23704f;
    --shadow: 0 18px 45px rgba(23, 32, 38, 0.09);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background: var(--bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: inherit;
}

.topbar {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px clamp(18px, 5vw, 56px);
    background: var(--panel);
    border-bottom: 1px solid var(--line);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

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

.brand strong,
.brand small {
    display: block;
    line-height: 1.1;
}

.brand small,
.eyebrow,
.muted {
    color: var(--muted);
}

.nav,
.actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.nav a {
    padding: 9px 12px;
    border-radius: 7px;
    text-decoration: none;
}

.nav a:hover {
    background: #edf3f2;
}

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

.footer {
    padding: 24px;
    color: var(--muted);
    text-align: center;
    border-top: 1px solid var(--line);
}

.hero,
.auth-layout {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 28px;
    margin-bottom: 24px;
    padding: clamp(24px, 4vw, 42px);
    color: white;
    background: linear-gradient(125deg, #0f3d36, #16756a 58%, #b98218);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.hero.compact {
    align-items: center;
}

.auth-layout {
    min-height: 520px;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 430px);
    align-items: center;
}

.hero .eyebrow,
.auth-layout .eyebrow {
    color: rgba(255, 255, 255, 0.78);
}

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

h1 {
    margin-bottom: 10px;
    font-size: clamp(2rem, 4vw, 4rem);
    line-height: 1;
}

h2 {
    font-size: 1.25rem;
}

.eyebrow {
    margin-bottom: 8px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.panel,
.empty-state {
    padding: 24px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.narrow {
    max-width: 720px;
    margin-inline: auto;
}

.login-panel {
    color: var(--ink);
}

.section-heading.row,
.app-admin-heading {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.status-chip,
.badge {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.18);
}

.badge {
    color: var(--ink);
    background: #eef2f3;
}

.badge.good {
    color: var(--success);
    background: #e5f4ed;
}

.badge.bad {
    color: var(--danger);
    background: #f7e8e8;
}

.app-grid,
.metric-grid,
.app-admin-list {
    display: grid;
    gap: 16px;
}

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

.metric-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-bottom: 16px;
}

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

.metric span {
    display: block;
    margin-bottom: 4px;
    color: var(--brand);
    font-size: 2rem;
    font-weight: 800;
}

.app-card {
    min-height: 220px;
    display: grid;
    align-content: space-between;
    gap: 18px;
    padding: 22px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.app-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    color: white;
    border-radius: 8px;
    font-weight: 800;
}

.button,
button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    color: var(--brand-dark);
    background: #eaf3f1;
    border: 1px solid #c7dcda;
    border-radius: 7px;
    font: inherit;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.button.primary,
button.primary {
    color: white;
    background: var(--brand);
    border-color: var(--brand);
}

.button.small,
button.small {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 0.9rem;
}

.form-grid {
    display: grid;
    gap: 16px;
}

.form-grid.inline {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    align-items: end;
}

label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 700;
}

input,
select {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    color: var(--ink);
    background: white;
    border: 1px solid #c9d5d8;
    border-radius: 7px;
    font: inherit;
}

input[type="color"] {
    padding: 4px;
}

.alert {
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 7px;
    border: 1px solid var(--line);
    background: white;
}

.alert-success {
    color: var(--success);
    background: #e5f4ed;
    border-color: #b7ddca;
}

.alert-danger {
    color: var(--danger);
    background: #f7e8e8;
    border-color: #e6bcbc;
}

table {
    width: 100%;
    border-collapse: collapse;
}

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

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

.assignment-list {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.check-row {
    grid-template-columns: auto 1fr;
    align-items: center;
    padding: 10px;
    background: #f7faf9;
    border: 1px solid var(--line);
    border-radius: 7px;
}

.check-row input {
    width: 18px;
    min-height: 18px;
}

.check-row small {
    display: block;
    color: var(--muted);
    font-weight: 500;
}

.secret {
    display: block;
    max-width: min(100%, 620px);
    overflow-wrap: anywhere;
    padding: 9px 10px;
    color: #2b4d57;
    background: #eef5f4;
    border: 1px solid var(--line);
    border-radius: 7px;
}

@media (max-width: 760px) {
    .topbar,
    .section-heading.row,
    .app-admin-heading {
        align-items: stretch;
        flex-direction: column;
    }

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

    table {
        display: block;
        overflow-x: auto;
    }
}
