:root {
    --bg: #f4f7f6;
    --surface: #ffffff;
    --surface-strong: #eef3f1;
    --text: #18211f;
    --muted: #5f6f6a;
    --line: #d7e0dd;
    --primary: #145c52;
    --primary-strong: #0d433c;
    --accent: #d98d28;
    --danger: #a73535;
    --success: #21764f;
    --shadow: 0 12px 30px rgba(15, 33, 29, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

a {
    color: var(--primary);
}

.site-header,
.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.site-footer {
    border-top: 1px solid var(--line);
    border-bottom: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 13rem;
}

.brand strong,
.brand span {
    display: block;
}

.brand span {
    color: var(--muted);
    font-size: 0.85rem;
}

.brand-mark {
    display: grid;
    width: 2.5rem;
    height: 2.5rem;
    place-items: center;
    border-radius: 8px;
    background: var(--primary);
    color: #ffffff;
    font-weight: 700;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.site-nav a {
    padding: 0.55rem 0.8rem;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
}

.site-nav a.active,
.site-nav a:hover {
    background: var(--surface-strong);
}

.logout-form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--muted);
}

button,
.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.6rem;
    padding: 0.65rem 1rem;
    border: 0;
    border-radius: 8px;
    background: var(--primary);
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

button:hover,
.primary-button:hover {
    background: var(--primary-strong);
}

.page-shell {
    width: min(1080px, calc(100% - 2rem));
    min-height: calc(100vh - 9rem);
    margin: 0 auto;
    padding: 2rem 0;
}

.page-heading {
    margin-bottom: 1.5rem;
}

.page-heading h1,
.auth-card h1 {
    margin: 0 0 0.5rem;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    line-height: 1.1;
}

.page-heading p,
.muted {
    color: var(--muted);
}

.eyebrow {
    margin: 0 0 0.4rem;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.panel,
.auth-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.panel {
    padding: 1.25rem;
}

.panel h2 {
    margin-top: 0;
    font-size: 1.15rem;
}

.auth-shell {
    display: grid;
    min-height: 65vh;
    place-items: center;
}

.auth-card {
    width: min(100%, 28rem);
    padding: 1.5rem;
}

.stacked-form {
    display: grid;
    gap: 0.7rem;
    margin-top: 1.25rem;
}

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

input {
    width: 100%;
    min-height: 2.7rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text);
    font: inherit;
}

input:focus {
    border-color: var(--primary);
    outline: 3px solid rgba(20, 92, 82, 0.16);
}

.alert {
    margin-bottom: 1rem;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--surface);
}

.alert-success {
    border-color: rgba(33, 118, 79, 0.35);
    color: var(--success);
    background: #eef8f3;
}

.alert-error {
    border-color: rgba(167, 53, 53, 0.35);
    color: var(--danger);
    background: #fff1f1;
}

.detail-list {
    display: grid;
    gap: 0.8rem;
    margin: 0;
}

.detail-list div {
    display: grid;
    grid-template-columns: 7rem 1fr;
    gap: 1rem;
}

.detail-list dt {
    color: var(--muted);
    font-weight: 700;
}

.detail-list dd {
    margin: 0;
}

.status-list {
    margin: 0;
    padding-left: 1.2rem;
}

.status-list li + li {
    margin-top: 0.45rem;
}

.debug-output {
    overflow: auto;
    padding: 1rem;
    background: #111;
    color: #fff;
    border-radius: 8px;
}

@media (max-width: 760px) {
    .site-header,
    .site-footer,
    .logout-form {
        align-items: stretch;
        flex-direction: column;
    }

    .site-nav {
        width: 100%;
    }

    .site-nav a,
    .logout-form button {
        width: 100%;
    }

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

    .detail-list div {
        grid-template-columns: 1fr;
        gap: 0.2rem;
    }
}

