:root {
    --bg: #f5f1e9;
    --panel: #ffffff;
    --panel-soft: #faf7f1;

    --text: #30261d;
    --muted: #776b5f;

    --brown: #6f451e;
    --brown-dark: #4e2f15;
    --brown-soft: #eee0cc;

    --gold: #d5a855;

    --green: #287948;
    --green-soft: #eaf6ee;

    --red: #a93535;
    --red-soft: #fff0f0;

    --border: #e5ddd2;

    --shadow:
        0 14px 42px
        rgba(56, 38, 20, .08);

    --radius: 17px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    min-height: 100vh;

    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background: var(--bg);
    color: var(--text);
}

a {
    color: inherit;
}

button,
input,
select {
    font: inherit;
}

.auth-page {
    min-height: 100vh;

    display: grid;
    place-items: center;

    padding: 22px;

    background:
        radial-gradient(
            circle at top,
            #fff9ed 0%,
            #f5ead4 50%,
            #e7d5b8 100%
        );
}

.auth-card {
    width: min(440px, 100%);

    padding: 38px;

    border-radius: 24px;

    background:
        rgba(255,255,255,.96);

    border:
        1px solid
        rgba(100,70,35,.14);

    box-shadow:
        0 25px 70px
        rgba(69,43,18,.13);
}

.brand {
    text-align: center;

    margin-bottom: 30px;
}

.brand-logo {
    font-size: 54px;
}

.brand h1 {
    margin: 8px 0 5px;

    font-size: 31px;

    letter-spacing: -1px;
}

.brand p {
    margin: 0;

    color: var(--muted);
}

.field {
    margin-bottom: 18px;
}

.field label {
    display: block;

    margin-bottom: 7px;

    font-size: 14px;

    font-weight: 750;
}

.input {
    width: 100%;

    min-height: 46px;

    padding: 12px 14px;

    border:
        1px solid
        var(--border);

    border-radius: 11px;

    background: white;

    color: var(--text);

    outline: none;
}

.input:focus {
    border-color: var(--brown);

    box-shadow:
        0 0 0 3px
        rgba(111,69,30,.10);
}

.button {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-height: 44px;

    padding: 11px 18px;

    border: 0;

    border-radius: 11px;

    cursor: pointer;

    text-decoration: none;

    font-weight: 800;
}

.button-primary {
    background: var(--brown);
    color: white;
}

.button-primary:hover {
    background: var(--brown-dark);
}

.button-block {
    width: 100%;
}

.alert {
    padding: 12px 14px;

    margin-bottom: 18px;

    border-radius: 11px;

    font-size: 14px;
}

.alert-error {
    background: var(--red-soft);

    border: 1px solid #efcaca;

    color: var(--red);
}

.app-shell {
    min-height: 100vh;

    display: grid;

    grid-template-columns:
        260px
        minmax(0, 1fr);
}

.sidebar {
    padding: 22px 17px;

    background:
        linear-gradient(
            180deg,
            #31251b,
            #241b14
        );

    color: white;
}

.sidebar-brand {
    display: flex;

    gap: 10px;

    align-items: center;

    padding:
        4px
        9px
        25px;

    font-size: 17px;

    font-weight: 850;
}

.menu {
    display: grid;

    gap: 6px;
}

.menu a {
    display: block;

    padding: 11px 13px;

    border-radius: 10px;

    color: #e9ded2;

    text-decoration: none;

    font-size: 14px;
}

.menu a:hover,
.menu a.active {
    background:
        rgba(255,255,255,.10);

    color: white;
}

.app-main {
    min-width: 0;
}

.topbar {
    min-height: 70px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

    padding: 13px 27px;

    background: white;

    border-bottom:
        1px solid
        var(--border);
}

.topbar-user {
    color: var(--muted);

    font-size: 14px;
}

.logout-form {
    display: inline;

    margin: 0 0 0 14px;
}

.logout {
    padding: 0;

    border: 0;

    background: transparent;

    color: var(--brown);

    cursor: pointer;

    font-weight: 800;
}

.content {
    padding: 28px;
}

.page-title {
    margin: 0;

    font-size: 29px;

    letter-spacing: -.7px;
}

.page-subtitle {
    margin: 7px 0 25px;

    color: var(--muted);
}

.cards {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(200px,1fr)
        );

    gap: 17px;
}

.card {
    padding: 21px;

    background: white;

    border:
        1px solid
        var(--border);

    border-radius:
        var(--radius);

    box-shadow: var(--shadow);
}

.card-label {
    color: var(--muted);

    font-size: 12px;

    font-weight: 800;

    text-transform: uppercase;

    letter-spacing: .6px;
}

.card-value {
    margin-top: 6px;

    font-size: 31px;

    font-weight: 850;
}

.role-chip {
    display: inline-flex;

    padding: 5px 9px;

    border-radius: 999px;

    background:
        var(--brown-soft);

    color: var(--brown);

    font-size: 12px;

    font-weight: 850;
}

.table-wrap {
    overflow-x: auto;

    background: white;

    border:
        1px solid
        var(--border);

    border-radius:
        var(--radius);

    box-shadow:
        var(--shadow);
}

.table {
    width: 100%;

    border-collapse: collapse;

    font-size: 14px;
}

.table th,
.table td {
    padding: 12px 14px;

    text-align: left;

    border-bottom:
        1px solid
        var(--border);

    vertical-align: top;
}

.table th {
    background:
        var(--panel-soft);

    color: var(--muted);

    font-size: 12px;

    text-transform: uppercase;

    letter-spacing: .4px;
}

.table tr:last-child td {
    border-bottom: 0;
}

.empty {
    padding: 35px;

    text-align: center;

    color: var(--muted);
}

@media (max-width: 800px) {

    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    .content {
        padding: 19px;
    }

    .topbar {
        padding: 13px 19px;
    }
}
