:root {
    --ink: #172033;
    --muted: #637083;
    --line: #dce2ea;
    --surface: #ffffff;
    --soft: #f4f6fa;
    --nav: #182333;
    --brand: #2f6fdb;
    --green: #2f9d83;
    --gold: #f1b94e;
    --red: #d75050;
    --shadow: 0 18px 38px rgba(23, 32, 51, 0.09);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--soft);
    color: var(--ink);
    font-family: Inter, Segoe UI, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

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

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

.app-shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    background: var(--nav);
    color: #eaf0f7;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 22px;
}

.brand {
    align-items: center;
    display: flex;
    gap: 12px;
    min-height: 48px;
}

.brand-mark,
.avatar {
    align-items: center;
    background: var(--gold);
    border-radius: 8px;
    color: #1b2535;
    display: inline-flex;
    flex: 0 0 auto;
    font-weight: 800;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.brand small,
.profile-strip small {
    color: #aeb9c7;
    display: block;
    font-size: 12px;
}

.nav {
    display: grid;
    gap: 6px;
}

.nav a,
.logout-link {
    align-items: center;
    border-radius: 8px;
    color: #c9d3df;
    display: flex;
    gap: 10px;
    padding: 10px 12px;
}

.nav a span {
    align-items: center;
    background: rgba(255, 255, 255, 0.09);
    border-radius: 6px;
    display: inline-flex;
    font-size: 12px;
    height: 24px;
    justify-content: center;
    width: 24px;
}

.nav a.active,
.nav a:hover,
.logout-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.profile-strip {
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    gap: 10px;
    margin-top: auto;
    padding-top: 16px;
}

.avatar {
    background: #dff3ee;
    color: #12614f;
    height: 38px;
    width: 38px;
}

.main {
    min-width: 0;
    padding: 28px;
}

.topbar {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 18px;
}

.topbar p {
    color: var(--muted);
    margin: 0 0 2px;
}

.topbar h1 {
    font-size: 28px;
    line-height: 1.2;
    margin: 0;
}

.grid {
    display: grid;
    gap: 18px;
}

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

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

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

.panel {
    padding: 20px;
}

.panel-header {
    align-items: flex-start;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 16px;
}

.panel h2,
.panel h3 {
    font-size: 18px;
    line-height: 1.3;
    margin: 0;
}

.panel p {
    color: var(--muted);
    margin: 4px 0 0;
}

.metric {
    border-left: 5px solid var(--brand);
    padding: 18px;
}

.metric.green {
    border-left-color: var(--green);
}

.metric.gold {
    border-left-color: var(--gold);
}

.metric.red {
    border-left-color: var(--red);
}

.metric span {
    color: var(--muted);
    display: block;
}

.metric strong {
    display: block;
    font-size: 30px;
    line-height: 1.1;
    margin-top: 4px;
}

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

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

.field label {
    color: #334056;
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
}

.field input,
.field select,
.field textarea {
    background: #ffffff;
    border: 1px solid #cfd8e3;
    border-radius: 6px;
    color: var(--ink);
    min-height: 42px;
    padding: 9px 11px;
    width: 100%;
}

.field textarea {
    min-height: 96px;
    resize: vertical;
}

.actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.btn {
    align-items: center;
    background: var(--brand);
    border: 1px solid var(--brand);
    border-radius: 6px;
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    font-weight: 800;
    gap: 8px;
    justify-content: center;
    min-height: 40px;
    padding: 9px 14px;
}

.btn.secondary {
    background: #ffffff;
    color: var(--ink);
    border-color: #cfd8e3;
}

.btn.green {
    background: var(--green);
    border-color: var(--green);
}

.btn.red {
    background: var(--red);
    border-color: var(--red);
}

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

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

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

th {
    color: #46546a;
    font-size: 13px;
}

.badge {
    border-radius: 999px;
    display: inline-flex;
    font-size: 12px;
    font-weight: 800;
    padding: 4px 9px;
    text-transform: capitalize;
}

.badge.active,
.badge.scheduled {
    background: #e7f5f1;
    color: #12614f;
}

.badge.inactive,
.badge.cancelled {
    background: #faeaea;
    color: #963535;
}

.badge.archived,
.badge.completed {
    background: #eef1f5;
    color: #566273;
}

.alert {
    border-radius: 8px;
    font-weight: 700;
    margin-bottom: 16px;
    padding: 12px 14px;
}

.alert.success {
    background: #e7f5f1;
    color: #12614f;
}

.alert.error {
    background: #faeaea;
    color: #963535;
}

.empty {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    color: var(--muted);
    padding: 18px;
}

.auth-main {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.auth-card {
    max-width: 460px;
    padding: 28px;
    width: 100%;
}

.auth-card .brand {
    color: var(--ink);
    margin-bottom: 22px;
}

.auth-card .brand small {
    color: var(--muted);
}

.auth-card h1 {
    font-size: 26px;
    line-height: 1.2;
    margin: 0 0 8px;
}

.auth-card p {
    color: var(--muted);
    margin: 0 0 20px;
}

.hint {
    color: var(--muted);
    font-size: 13px;
}

.split-line {
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

@media (max-width: 900px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

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

    .grid.two,
    .grid.three,
    .form-grid.two {
        grid-template-columns: 1fr;
    }

    .main {
        padding: 20px;
    }
}

@media (max-width: 560px) {
    .nav {
        grid-template-columns: 1fr;
    }

    .topbar {
        display: block;
    }

    .panel-header {
        display: block;
    }

    .actions {
        align-items: stretch;
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}
