:root {
    --ink: #111111;
    --muted: #5f6572;
    --border: rgba(17, 17, 17, 0.16);
    --yellow: #ffd766;
    --yellow-strong: #f0c84b;
    --paper: rgba(255, 255, 255, 0.92);
    --surface: #ffffff;
    --bg-a: #fbf7ea;
    --bg-b: #f4f0e4;
}

* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    color: var(--ink);
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 12% 16%, rgba(255, 215, 102, 0.22), transparent 30%),
        radial-gradient(circle at 88% 12%, rgba(17, 17, 17, 0.07), transparent 26%),
        linear-gradient(135deg, #fffdf7 0%, var(--bg-a) 45%, var(--bg-b) 100%);
}

a {
    color: inherit;
}

.shell,
.login-wrap {
    width: min(1320px, calc(100% - 40px));
    margin: 0 auto;
    padding: 24px 0 40px;
}

.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
}

.login-card {
    width: min(460px, 100%);
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 24px 70px rgba(17, 17, 17, 0.12);
    padding: 24px;
}

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

.dashboard-page .topbar {
    position: relative;
}

.brand-row {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.brand-logo {
    width: 58px;
    height: auto;
    object-fit: contain;
    flex: 0 0 auto;
}

.login-page .brand-row {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
}

.login-page .brand-logo {
    width: 130px;
    height: auto;
}

.dashboard-page .brand-logo {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 130px;
    height: auto;
}

.eyebrow {
    margin: 0 0 10px;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.22em;
}

h1,
h2 {
    margin: 0;
}

h1 {
    font-size: 28px;
    line-height: 1.15;
    font-weight: 900;
}

.muted {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.45;
}

.notice {
    margin: 18px 0 0;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    font-weight: 700;
}

.notice.error {
    background: #fff0f0;
    border-color: rgba(196, 72, 72, 0.22);
    color: #8c1f1f;
}

.notice.success {
    background: #fff9df;
    border-color: rgba(224, 175, 32, 0.22);
}

.stack-form {
    display: grid;
    gap: 18px;
    margin-top: 18px;
}

.two-col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.field {
    display: grid;
    gap: 8px;
}

.field.full {
    grid-column: 1 / -1;
}

label {
    font-size: 14px;
    font-weight: 900;
    color: var(--ink);
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid rgba(17, 17, 17, 0.42);
    background: #fff;
    color: var(--ink);
    font: inherit;
    outline: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

textarea {
    min-height: 118px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--ink);
    box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.12);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 156px;
    min-height: 48px;
    padding: 0 24px;
    border: 1px solid var(--yellow);
    border-radius: 8px;
    background: var(--yellow);
    color: var(--ink);
    font: inherit;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(217, 170, 50, 0.22);
    transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.btn:hover {
    background: var(--yellow-strong);
    border-color: var(--yellow-strong);
}

.btn:active {
    transform: translateY(1px);
}

.btn.secondary {
    background: #fff;
    border-color: var(--border);
    box-shadow: none;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card,
.panel {
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 20px 54px rgba(17, 17, 17, 0.08);
}

.stat-card {
    padding: 18px 18px 20px;
}

.stat-card p {
    margin: 0 0 12px;
    color: #67728d;
    font-size: 14px;
    font-weight: 800;
}

.stat-card strong {
    font-size: 30px;
    line-height: 1;
    font-weight: 900;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.table-stack {
    display: grid;
    gap: 16px;
}

.panel {
    padding: 18px;
}

.panel h2 {
    margin-bottom: 18px;
    font-size: 22px;
    font-weight: 900;
}

.table-panel {
    padding: 20px 18px 10px;
}

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

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

th,
td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid rgba(17, 17, 17, 0.08);
    vertical-align: top;
    white-space: nowrap;
}

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

.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: #111111;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.empty-state {
    color: var(--muted);
    text-align: center;
    padding: 24px 10px;
}

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

@media (max-width: 760px) {
    .shell,
    .login-wrap {
        width: min(100%, calc(100% - 24px));
        padding-top: 16px;
    }

    .topbar,
    .brand-row {
        flex-direction: column;
    }

    .dashboard-page .topbar {
        padding-top: 70px;
    }

    .stats-grid,
    .dashboard-grid,
    .two-col {
        grid-template-columns: 1fr;
    }

    .btn {
        width: 100%;
    }
}
