:root {
    --ink: #151720;
    --ink-soft: #242838;
    --panel: #ffffff;
    --canvas: #f5f6f1;
    --line: #dde1d9;
    --muted: #697386;
    --gold: #b8842c;
    --teal: #0f766e;
    --wine: #9f334d;
    --blue: #315f8c;
    --shadow: 0 18px 45px rgba(21, 23, 32, .10);
}

* {
    letter-spacing: 0;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--canvas);
    color: var(--ink);
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

a {
    text-decoration: none;
}

.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1040;
    width: 278px;
    background: var(--ink);
    color: #fff;
    padding: 24px 18px;
    transform: translateX(0);
    transition: transform .2s ease;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    margin-bottom: 28px;
}

.brand:hover {
    color: #fff;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: var(--gold);
    color: #111;
    font-weight: 800;
}

.brand strong,
.brand small {
    display: block;
    line-height: 1.05;
}

.brand small {
    color: rgba(255, 255, 255, .65);
}

.sidebar-nav {
    display: grid;
    gap: 5px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 8px;
    color: rgba(255, 255, 255, .76);
    transition: background .15s ease, color .15s ease;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(255, 255, 255, .10);
    color: #fff;
}

.sidebar-nav i {
    width: 22px;
    color: var(--gold);
}

.nav-caption {
    margin: 18px 12px 6px;
    color: rgba(255, 255, 255, .48);
    font-size: .77rem;
    font-weight: 700;
    text-transform: uppercase;
}

.main-content {
    flex: 1;
    margin-left: 278px;
    min-width: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 86px;
    padding: 18px 32px;
    background: rgba(245, 246, 241, .92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
}

.title-block span {
    display: block;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 700;
}

.title-block h1 {
    margin: 0;
    font-size: 1.55rem;
    line-height: 1.2;
    font-weight: 800;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(21, 23, 32, .05);
}

.topbar-user small {
    display: block;
    color: var(--muted);
    line-height: 1.1;
}

.avatar {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--teal);
    color: #fff;
    font-weight: 800;
}

.content-wrap {
    padding: 28px 32px 42px;
}

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

.lux-panel {
    padding: 22px;
}

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

.panel-header h2 {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 800;
}

.form-label {
    color: var(--ink);
    font-weight: 700;
}

.form-control,
.form-select {
    min-height: 44px;
    border-color: #ccd3cc;
    border-radius: 8px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 .2rem rgba(184, 132, 44, .18);
}

.btn {
    border-radius: 8px;
    font-weight: 700;
}

.btn-primary {
    background: var(--ink);
    border-color: var(--ink);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--ink-soft);
    border-color: var(--ink-soft);
}

.btn-gold {
    background: var(--gold);
    border-color: var(--gold);
    color: #111;
}

.btn-gold:hover,
.btn-gold:focus {
    background: #a77525;
    border-color: #a77525;
    color: #111;
}

.icon-button {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--ink);
}

.action-row {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.table {
    vertical-align: middle;
}

.table thead th {
    color: var(--muted);
    font-size: .82rem;
    text-transform: uppercase;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.stat-panel {
    padding: 20px;
    min-height: 126px;
    border-top: 4px solid var(--gold);
}

.stat-panel:nth-child(2) {
    border-top-color: var(--teal);
}

.stat-panel:nth-child(3) {
    border-top-color: var(--blue);
}

.stat-panel:nth-child(4) {
    border-top-color: var(--wine);
}

.stat-panel span {
    color: var(--muted);
    font-weight: 700;
}

.stat-panel strong {
    display: block;
    margin-top: 12px;
    font-size: 2rem;
    line-height: 1;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 800;
}

.status-active {
    background: rgba(15, 118, 110, .12);
    color: #0d5f59;
}

.status-pending {
    background: rgba(184, 132, 44, .16);
    color: #865d1c;
}

.photo-thumb {
    width: 62px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
}

.detail-photo {
    width: 100%;
    max-height: 330px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
}

.detail-list {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 12px 18px;
}

.detail-list dt {
    color: var(--muted);
    font-weight: 800;
}

.detail-list dd {
    margin: 0;
}

.login-body {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 26px;
    background:
        linear-gradient(120deg, rgba(21, 23, 32, .95), rgba(49, 95, 140, .82)),
        var(--ink);
}

.login-panel {
    width: min(100%, 980px);
    display: grid;
    grid-template-columns: .9fr 1.1fr;
    overflow: hidden;
    background: var(--panel);
    border-radius: 8px;
    box-shadow: 0 28px 90px rgba(0, 0, 0, .30);
}

.login-art {
    padding: 42px;
    background: var(--ink);
    color: #fff;
}

.login-art .brand-mark {
    margin-bottom: 26px;
}

.login-art h1 {
    margin: 0 0 18px;
    font-size: 2.2rem;
    line-height: 1.06;
    font-weight: 900;
}

.login-art p {
    color: rgba(255, 255, 255, .72);
}

.login-form {
    padding: 42px;
}

.mobile-backdrop {
    display: none;
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .mobile-backdrop.show {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1030;
        background: rgba(0, 0, 0, .45);
    }

    .main-content {
        margin-left: 0;
    }

    .topbar {
        gap: 14px;
        padding: 16px;
    }

    .topbar-user {
        display: none;
    }

    .content-wrap {
        padding: 18px 16px 32px;
    }

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

@media (max-width: 640px) {
    .login-panel {
        grid-template-columns: 1fr;
    }

    .login-art {
        padding: 28px;
    }

    .login-form {
        padding: 28px;
    }

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

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

    .detail-list {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}
