:root {
    --brand: #7c3aed;
    --surface: #f8fafc;
    --text: #111827;
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #dc2626;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--surface);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
}

a {
    color: inherit;
}

.skip-link {
    left: 1rem;
    position: absolute;
    top: -4rem;
}

.skip-link:focus {
    background: #ffffff;
    border: 2px solid var(--brand);
    padding: .75rem;
    top: 1rem;
    z-index: 20;
}

.sr-only {
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
}

.page {
    min-height: 100vh;
}

.shell {
    margin: 0 auto;
    max-width: 1120px;
    padding: 1rem;
}

.topbar {
    align-items: center;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    min-height: 64px;
}

.topbar .shell {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    width: 100%;
}

.brand {
    color: var(--brand);
    font-size: 1.125rem;
    font-weight: 700;
    text-decoration: none;
}

.topnav {
    display: flex;
    gap: .75rem;
}

.topnav a {
    color: #374151;
    font-size: .9rem;
    font-weight: 700;
    text-decoration: none;
}

.panel {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(17, 24, 39, .06);
}

.login-wrap {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
    margin: 2rem auto;
    max-width: 960px;
}

.auth-wrap {
    display: grid;
    gap: 1.5rem;
    margin: 2rem auto;
    max-width: 760px;
}

.login-copy,
.login-form {
    padding: 1.25rem;
}

.eyebrow {
    color: var(--brand);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

h1 {
    font-size: clamp(1.8rem, 3vw, 3rem);
    line-height: 1.08;
    margin: .5rem 0 1rem;
}

.muted {
    color: #4b5563;
    line-height: 1.6;
}

.field {
    display: grid;
    gap: .4rem;
    margin-bottom: 1rem;
}

label {
    font-weight: 700;
}

input,
textarea,
select {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font: inherit;
    min-height: 44px;
    padding: .7rem .8rem;
    width: 100%;
}

textarea {
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--brand);
    outline: 3px solid rgba(124, 58, 237, .18);
}

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

.button:hover,
.button:focus {
    background: #6d28d9;
}

.button-secondary {
    background: #111827;
}

.button-secondary:hover,
.button-secondary:focus {
    background: #374151;
}

.alert {
    border-radius: 6px;
    margin-bottom: 1rem;
    padding: .75rem;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.dashboard-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
    margin-top: 1rem;
}

.metric {
    padding: 1rem;
}

.metric strong {
    display: block;
    font-size: 1.5rem;
}

.notice {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    display: grid;
    gap: .6rem;
    margin-bottom: 1rem;
    padding: 1rem;
}

.notice code {
    background: #111827;
    border-radius: 6px;
    color: #ffffff;
    display: block;
    overflow-wrap: anywhere;
    padding: .75rem;
}

.section-panel {
    margin-top: 1rem;
    padding: 1rem;
}

.form-panel {
    margin-top: 1rem;
    padding: 1rem;
}

.form-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-top: 1rem;
}

h2 {
    font-size: 1.25rem;
    margin: 0 0 .5rem;
}

.table-wrap {
    margin-top: 1rem;
    overflow-x: auto;
}

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

th,
td {
    border-bottom: 1px solid #e5e7eb;
    padding: .8rem;
    text-align: left;
    vertical-align: middle;
}

th {
    background: #f9fafb;
    color: #374151;
    font-size: .8rem;
    text-transform: uppercase;
}

.badge {
    background: #eef2ff;
    border-radius: 999px;
    color: #3730a3;
    display: inline-flex;
    font-size: .8rem;
    font-weight: 700;
    padding: .25rem .55rem;
}

.inline-form {
    align-items: center;
    display: flex;
    gap: .5rem;
}

.compact {
    min-height: 38px;
    padding: .55rem .75rem;
}

.check-row {
    align-items: center;
    display: inline-flex;
    gap: .5rem;
    margin-bottom: 1rem;
}

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

.table-note {
    color: #6b7280;
    display: block;
    font-size: .85rem;
    margin-top: .25rem;
}

.menu-section {
    margin-top: 1.5rem;
}

.menu-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

.menu-item {
    display: grid;
    gap: .5rem;
    padding: 1rem;
}

.menu-item p {
    color: #4b5563;
    line-height: 1.5;
    margin: 0;
}

.menu-item span {
    color: var(--success);
    font-weight: 700;
}

@media (min-width: 768px) {
    .shell {
        padding: 1.5rem;
    }

    .login-wrap {
        grid-template-columns: 1.1fr .9fr;
        margin-top: 4rem;
    }

    .login-copy,
    .login-form {
        padding: 2rem;
    }

    .dashboard-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .auth-wrap {
        grid-template-columns: .9fr 1.1fr;
        margin-top: 4rem;
    }

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

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