:root {
    --background: #f5f2ed;
    --surface: #ffffff;
    --surface-dark: #171717;
    --text: #202020;
    --muted: #77716a;
    --border: #e4ded6;
    --accent: #a4372b;
    --accent-dark: #7e281f;
    --shadow: 0 18px 50px rgba(31, 24, 19, 0.10);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family:
        Inter,
        Montserrat,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

button,
input {
    font: inherit;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(
            circle at top right,
            rgba(164, 55, 43, 0.12),
            transparent 34%
        ),
        var(--background);
}

.login-card {
    width: min(100%, 430px);
    padding: 42px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.brand-mark {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    margin-bottom: 24px;
    border-radius: 16px;
    background: var(--surface-dark);
    color: white;
    font-weight: 800;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 12px;
    font-size: clamp(30px, 5vw, 44px);
    line-height: 1.05;
}

.intro {
    margin-bottom: 28px;
    color: var(--muted);
    line-height: 1.6;
}

label {
    display: block;
    margin: 18px 0 8px;
    font-size: 14px;
    font-weight: 700;
}

input {
    width: 100%;
    padding: 14px 15px;
    border: 1px solid var(--border);
    border-radius: 12px;
    outline: none;
    background: #fff;
}

input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(164, 55, 43, 0.10);
}

button,
.button-link {
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
}

.login-card form > button {
    width: 100%;
    margin-top: 24px;
    padding: 14px 18px;
    background: var(--accent);
    color: white;
    font-weight: 800;
}

.login-card form > button:hover {
    background: var(--accent-dark);
}

.alert {
    margin-bottom: 18px;
    padding: 13px 15px;
    border-radius: 10px;
    background: #fbe8e5;
    color: #842a20;
    font-size: 14px;
}

.button-link {
    display: inline-block;
    padding: 13px 18px;
    background: var(--accent);
    color: white;
    font-weight: 800;
}

.topbar {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 32px;
    background: var(--surface-dark);
    color: white;
}

.topbar .eyebrow {
    color: #d99a8f;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-user form {
    margin: 0;
}

.button-secondary {
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.10);
    color: white;
}

.container {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 46px 0 70px;
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 32px;
}

.page-heading p:last-child {
    margin-bottom: 0;
    color: var(--muted);
}

.button-primary {
    padding: 13px 18px;
    background: var(--accent);
    color: white;
    font-weight: 800;
}

.button-primary:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 26px;
}

.stat-card,
.panel {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: 0 10px 30px rgba(31, 24, 19, 0.05);
}

.stat-card {
    padding: 24px;
}

.stat-card span {
    display: block;
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.stat-card strong {
    font-size: 38px;
}

.panel {
    overflow: hidden;
}

.panel-header {
    padding: 24px 26px;
    border-bottom: 1px solid var(--border);
}

.panel-header h2 {
    margin-bottom: 0;
}

.empty-state {
    padding: 56px 26px;
    text-align: center;
}

.empty-state p {
    margin-bottom: 0;
    color: var(--muted);
}

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

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

th,
td {
    padding: 16px 22px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

th {
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

@media (max-width: 760px) {
    .topbar,
    .page-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar {
        padding: 18px 20px;
    }

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

    .login-card {
        padding: 30px 24px;
    }
}

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

    .container {
        width: min(100% - 24px, 1180px);
    }
}
