:root {
    color-scheme: light;
    --bg: #eef3f7;
    --paper: #ffffff;
    --paper-soft: #f7fafc;
    --ink: #15324b;
    --muted: #63788c;
    --line: #d5dee7;
    --brand: #0f766e;
    --brand-strong: #0b5cab;
    --accent: #ed6a2c;
    --success: #1f8f56;
    --warning: #b16a00;
    --danger: #b42318;
    --shadow: 0 24px 48px rgba(20, 50, 75, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Trebuchet MS", "Gill Sans", "Segoe UI", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.18), transparent 28%),
        radial-gradient(circle at top right, rgba(11, 92, 171, 0.16), transparent 26%),
        linear-gradient(180deg, #f9fbfd 0%, var(--bg) 100%);
}

body.auth-view {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.page-frame {
    width: 100%;
    min-height: 100vh;
}

.page-shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px 18px 40px;
}

.topbar {
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px 18px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-mark {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-strong) 100%);
    color: #fff;
    font-weight: 800;
    letter-spacing: 0.06em;
    box-shadow: 0 16px 30px rgba(15, 118, 110, 0.25);
}

.brand-kicker,
.eyebrow,
.mini-label {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 12px;
    color: var(--muted);
    font-weight: 700;
}

.brand-title {
    margin: 3px 0 0;
    font-size: 24px;
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.topbar-nav a,
.topbar-nav .link-button {
    color: var(--ink);
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
}

.user-chip {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(11, 92, 171, 0.08);
    font-size: 14px;
    font-weight: 700;
}

.link-button {
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0;
}

.hero-card,
.panel-card,
.table-card,
.auth-card {
    background: var(--paper);
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.hero-card {
    overflow: hidden;
    margin-bottom: 24px;
}

.hero-band {
    padding: 30px;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(15, 118, 110, 0.98), rgba(11, 92, 171, 0.92)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent);
}

.hero-band h2 {
    margin: 10px 0 12px;
    font-size: clamp(30px, 4vw, 44px);
    line-height: 1.05;
}

.hero-band p {
    margin: 0;
    max-width: 700px;
    line-height: 1.6;
    font-size: 17px;
    opacity: 0.92;
}

.hero-meta {
    padding: 22px 30px 28px;
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    background: linear-gradient(180deg, rgba(247, 250, 252, 0.92), #ffffff);
}

.stat-box {
    padding: 18px 20px;
    border-radius: 20px;
    background: var(--paper-soft);
    border: 1px solid var(--line);
}

.stat-box strong {
    display: block;
    margin-top: 8px;
    font-size: 30px;
}

.tile-grid,
.panel-grid,
.form-grid,
.auth-grid,
.detail-grid {
    display: grid;
    gap: 18px;
}

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

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

.tile,
.panel-card,
.table-card {
    padding: 22px;
}

.tile {
    display: flex;
    flex-direction: column;
    gap: 14px;
    text-decoration: none;
    color: inherit;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 252, 0.98));
    border: 1px solid var(--line);
    box-shadow: 0 18px 34px rgba(20, 50, 75, 0.08);
    min-height: 220px;
}

.tile-icon {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 118, 110, 0.12);
    color: var(--brand);
    font-size: 24px;
    font-weight: 800;
}

.tile h3,
.panel-card h3,
.table-card h3,
.auth-card h2 {
    margin: 0;
    font-size: 24px;
}

.tile p,
.panel-card p,
.auth-card p,
.table-card p {
    margin: 0;
    line-height: 1.6;
    color: var(--muted);
}

.inline-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.button,
button,
input[type="submit"] {
    border: 0;
    border-radius: 16px;
    padding: 14px 18px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.button-primary,
button,
input[type="submit"] {
    color: #fff;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-strong) 100%);
}

.button-secondary {
    color: var(--ink);
    background: #edf3f8;
    border: 1px solid var(--line);
}

.button-ghost {
    color: var(--brand-strong);
    background: rgba(11, 92, 171, 0.08);
}

.button-danger {
    color: #fff;
    background: linear-gradient(135deg, #bf3d31 0%, #9c1f15 100%);
}

.flash {
    margin-bottom: 18px;
    padding: 16px 18px;
    border-radius: 18px;
    font-weight: 700;
    line-height: 1.5;
}

.flash-success {
    background: #e6f8ee;
    color: var(--success);
}

.flash-warning {
    background: #fff3de;
    color: var(--warning);
}

.flash-danger {
    background: #fee8e7;
    color: var(--danger);
}

.flash-info {
    background: #e5f0fd;
    color: var(--brand-strong);
}

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

.field,
.field-wide {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

label {
    font-size: 14px;
    font-weight: 800;
}

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

input:focus,
select:focus {
    outline: 2px solid rgba(11, 92, 171, 0.18);
    border-color: rgba(11, 92, 171, 0.5);
}

.table-card {
    margin-top: 24px;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 14px;
}

thead th {
    text-align: left;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
}

tbody td {
    padding: 16px 12px;
    border-bottom: 1px solid #ebf0f5;
    vertical-align: top;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.badge-admin {
    background: #e5f0fd;
    color: var(--brand-strong);
}

.badge-user {
    background: #eef5ee;
    color: var(--success);
}

.badge-active {
    background: #e6f8ee;
    color: var(--success);
}

.badge-inactive {
    background: #eef2f6;
    color: var(--muted);
}

.note-box {
    padding: 18px 20px;
    border-radius: 20px;
    background: #fff8ec;
    border: 1px solid #f6ddaf;
}

.muted {
    color: var(--muted);
}

.auth-card {
    width: min(1080px, 100%);
    overflow: hidden;
}

.auth-grid {
    grid-template-columns: 1.1fr 0.9fr;
}

.auth-hero {
    padding: 34px;
    min-height: 100%;
    color: #fff;
    background:
        linear-gradient(160deg, rgba(15, 118, 110, 0.98), rgba(11, 92, 171, 0.94)),
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.14), transparent 36%);
}

.auth-hero h2 {
    margin: 10px 0 14px;
    font-size: clamp(32px, 4vw, 46px);
    line-height: 1.05;
}

.auth-hero p,
.auth-hero li {
    line-height: 1.7;
    opacity: 0.92;
}

.auth-hero ul {
    margin: 18px 0 0;
    padding-left: 18px;
}

.auth-form {
    padding: 34px;
    background: linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.footer-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.small {
    font-size: 13px;
}

@media (max-width: 940px) {
    .hero-meta,
    .tile-grid,
    .panel-grid,
    .detail-grid,
    .auth-grid {
        grid-template-columns: 1fr;
    }
}

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

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

    .hero-band,
    .hero-meta,
    .panel-card,
    .table-card,
    .tile,
    .auth-hero,
    .auth-form {
        padding: 22px;
    }
}
