:root {
    --bg: #f3efe7;
    --surface: #fffaf3;
    --surface-strong: #fff;
    --text: #1d1b19;
    --muted: #6a6257;
    --line: #ded2c0;
    --primary: #0f766e;
    --primary-dark: #0b3d3a;
    --accent: #d97706;
    --danger: #b91c1c;
    --success: #15803d;
    --shadow: 0 14px 30px rgba(36, 28, 21, 0.08);
    --radius: 20px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    background:
        radial-gradient(circle at top left, rgba(217, 119, 6, 0.12), transparent 28%),
        linear-gradient(180deg, #f8f4ec 0%, #f1eadf 100%);
    color: var(--text);
}

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

code {
    background: #f2e8d8;
    padding: 0.1rem 0.35rem;
    border-radius: 6px;
}

label {
    display: block;
    margin-bottom: 0.45rem;
    font-weight: 700;
}

input,
select,
textarea,
button {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-strong);
}

textarea {
    resize: vertical;
}

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

.sidebar {
    width: 280px;
    background: rgba(11, 61, 58, 0.96);
    color: #f6eee1;
    padding: 2rem 1.35rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand strong {
    display: block;
    font-size: 1.1rem;
}

.brand p,
.muted {
    margin: 0.25rem 0 0;
    color: var(--muted);
}

.sidebar .muted {
    color: rgba(246, 238, 225, 0.62);
}

.brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #f59e0b, #fb7185);
    color: #22170d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.nav {
    display: grid;
    gap: 0.4rem;
}

.nav-link {
    padding: 0.9rem 1rem;
    border-radius: 14px;
    color: #fff9ee;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.04);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.12);
}

.sidebar-footer {
    margin-top: auto;
}

.logout-form {
    margin-top: 1rem;
}

.main {
    flex: 1;
    padding: 2.4rem;
}

.main-auth {
    display: grid;
    place-items: center;
    padding: 2rem;
}

.auth-card {
    width: min(1080px, 100%);
    display: grid;
    grid-template-columns: 1.2fr 0.9fr;
    gap: 1.5rem;
    align-items: stretch;
}

.hero-copy,
.panel,
.metric,
.status-card {
    background: rgba(255, 250, 243, 0.86);
    border: 1px solid rgba(222, 210, 192, 0.8);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow);
    border-radius: var(--radius);
}

.hero-copy {
    padding: 2.4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-copy h1,
.page-header h1 {
    font-size: clamp(2.1rem, 4vw, 3.4rem);
    line-height: 1.05;
    margin: 0.4rem 0 1rem;
}

.hero-copy p,
.page-header p,
.panel p {
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.6;
}

.panel {
    padding: 1.4rem;
}

.page-header,
.panel-header,
.grid-split,
.stat-grid,
.button-row,
.grid-two {
    display: grid;
    gap: 1rem;
}

.page-header {
    grid-template-columns: 1fr auto;
    align-items: start;
    margin-bottom: 1.4rem;
}

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

.grid-split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 1.4rem;
}

.stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 1.4rem;
}

.metric {
    padding: 1.4rem;
}

.metric span,
.label,
.eyebrow,
.section-heading {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.74rem;
    color: var(--muted);
}

.metric strong,
.status-card strong {
    display: block;
    margin-top: 0.8rem;
    font-size: 2rem;
}

.status-card {
    padding: 1.2rem 1.3rem;
    min-width: 240px;
}

.form-stack {
    display: grid;
    gap: 1rem;
}

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

.button,
.link-button {
    border: 0;
    cursor: pointer;
    border-radius: 999px;
    padding: 0.9rem 1.2rem;
    background: linear-gradient(135deg, var(--primary), #0ea5a4);
    color: #fff;
    text-decoration: none;
    text-align: center;
}

.button-secondary {
    background: #efe5d7;
    color: #3b3128;
}

.button-dark {
    background: linear-gradient(135deg, #1f2937, #111827);
    color: #fff;
}

.button-full {
    width: 100%;
}

.link-button {
    background: transparent;
    color: var(--danger);
    padding: 0;
}

.radio-group,
.checkbox-list {
    display: grid;
    gap: 0.7rem;
}

.checkbox-list {
    max-height: 220px;
    overflow: auto;
    border: 1px solid var(--line);
    padding: 1rem;
    border-radius: 14px;
    background: var(--surface-strong);
}

.checkbox-list label,
.radio-group label {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin: 0;
    font-weight: 500;
}

.checkbox-list input,
.radio-group input {
    width: auto;
}

.alert {
    padding: 1rem 1.15rem;
    border-radius: 14px;
    margin-bottom: 1.1rem;
}

.alert-success {
    background: rgba(21, 128, 61, 0.12);
    color: var(--success);
}

.alert-error {
    background: rgba(185, 28, 28, 0.1);
    color: var(--danger);
}

.pill {
    display: inline-flex;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: #efe5d7;
    color: #45392f;
}

.table-wrap {
    overflow: auto;
}

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

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

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

@media (max-width: 1080px) {
    .auth-card,
    .grid-split,
    .stat-grid,
    .button-row,
    .grid-two,
    .page-header {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .shell {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .main {
        padding: 1.1rem;
    }
}
