:root {
    --bg: #f5f2ea;
    --panel: #fffdf9;
    --ink: #1f1b16;
    --muted: #6b6256;
    --line: #ddd3c2;
    --accent: #bf5b2c;
    --accent-dark: #8b3c18;
    --success: #2d7a51;
    --warning: #9b6b1f;
    --danger: #ab2d2d;
    --shadow: 0 18px 40px rgba(31, 27, 22, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(191, 91, 44, 0.14), transparent 24%),
        linear-gradient(180deg, #f8f4ee 0%, var(--bg) 100%);
    color: var(--ink);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

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

.shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 290px 1fr;
}

.sidebar {
    background: #221c17;
    color: #f4ede4;
    padding: 28px 22px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.brand-kicker,
.eyebrow,
.meta,
.helper {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.72rem;
    color: var(--muted);
}

.brand h1 {
    margin: 8px 0 0;
    font-size: 1.35rem;
    line-height: 1.3;
}

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

.nav-link {
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    color: #e8d7c6;
}

.nav-link.is-active,
.nav-link:hover {
    background: rgba(191, 91, 44, 0.18);
    color: #fff4ea;
}

.sidebar-footer {
    margin-top: auto;
    display: grid;
    gap: 12px;
}

.content {
    padding: 30px;
}

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

.page-header h2 {
    margin: 6px 0 0;
    font-size: 2rem;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

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

.card {
    padding: 20px;
}

.card .count {
    font-size: 2rem;
    font-weight: 700;
    margin-top: 12px;
}

.panel {
    padding: 22px;
    margin-bottom: 20px;
}

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

.panel-header h3 {
    margin: 6px 0 0;
}

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

.grid.two {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.grid.three {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

label {
    display: grid;
    gap: 8px;
    font-weight: 600;
    color: var(--ink);
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    font: inherit;
}

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

.button,
button {
    appearance: none;
    border: 0;
    cursor: pointer;
    border-radius: 999px;
    padding: 12px 18px;
    font: inherit;
    font-weight: 700;
    background: var(--accent);
    color: #fff6ef;
}

.button:hover,
button:hover {
    background: var(--accent-dark);
}

.button.secondary,
button.secondary {
    background: #e5dbcc;
    color: var(--ink);
}

.button.ghost,
button.ghost {
    background: transparent;
    color: var(--accent-dark);
    border: 1px solid var(--line);
}

.button.danger,
button.danger {
    background: var(--danger);
    color: #fff;
}

.button.small,
button.small {
    padding: 8px 12px;
    font-size: 0.9rem;
}

.full-width {
    width: 100%;
    text-align: center;
}

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

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

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

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

.pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 700;
}

.pill.active {
    background: rgba(45, 122, 81, 0.14);
    color: var(--success);
}

.pill.suspended,
.pill.inactive {
    background: rgba(155, 107, 31, 0.12);
    color: var(--warning);
}

.pill.revoked,
.pill.blocked {
    background: rgba(171, 45, 45, 0.12);
    color: var(--danger);
}

.pill.deactivated {
    background: rgba(107, 98, 86, 0.12);
    color: var(--muted);
}

.flash {
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 16px;
    border: 1px solid transparent;
}

.flash.success {
    background: rgba(45, 122, 81, 0.12);
    color: var(--success);
    border-color: rgba(45, 122, 81, 0.18);
}

.flash.error {
    background: rgba(171, 45, 45, 0.12);
    color: var(--danger);
    border-color: rgba(171, 45, 45, 0.18);
}

.flash.info {
    background: rgba(191, 91, 44, 0.12);
    color: var(--accent-dark);
    border-color: rgba(191, 91, 44, 0.18);
}

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

.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.empty-state {
    padding: 16px;
    border: 1px dashed var(--line);
    border-radius: 14px;
    color: var(--muted);
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: min(100%, 480px);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 28px;
}

.login-card h1 {
    margin: 10px 0 8px;
}

code {
    background: #efe7db;
    padding: 2px 6px;
    border-radius: 6px;
}

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

    .sidebar {
        gap: 14px;
    }

    .content {
        padding: 20px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
