:root {
    --bg: #f4f7fb;
    --panel: #ffffff;
    --line: #e6ebf2;
    --text: #172033;
    --muted: #758198;

    --primary: #1769aa;
    --primary2: #0f5792;

    --side: #101827;
    --side2: #172238;

    --success: #16a36a;
    --danger: #dc3f4f;

    --shadow: 0 8px 28px rgba(17, 31, 55, .08);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: Tahoma, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

a {
    text-decoration: none;
    color: var(--primary);
}

button,
input,
select,
textarea {
    font: inherit;
}

/* =========================
   Main Layout
========================= */

.app-shell {
    min-height: 100vh;
}

/* =========================
   Sidebar
========================= */

.sidebar {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;

    width: 270px;

    background: linear-gradient(
        180deg,
        var(--side),
        var(--side2)
    );

    color: #fff;

    display: flex;
    flex-direction: column;

    z-index: 50;

    box-shadow: -8px 0 28px rgba(0, 0, 0, .12);
}

/* =========================
   Brand
========================= */

.brand {
    height: 78px;

    padding: 16px 18px;

    display: flex;
    align-items: center;

    gap: 12px;

    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.brand-mark {
    width: 42px;
    height: 42px;

    border-radius: 12px;

    background: #fff;
    color: var(--primary);

    display: grid;
    place-items: center;

    font-weight: 800;
    font-size: 21px;
}

.brand strong {
    display: block;
    font-size: 15px;
}

.brand small {
    display: block;

    color: #9fb0c8;

    margin-top: 4px;

    font-size: 11px;
}

.sidebar-close {
    display: none;

    margin-right: auto;

    background: none;
    border: 0;

    color: #fff;

    font-size: 25px;
}

/* =========================
   Sidebar Navigation
========================= */

.side-nav {
    padding: 14px 10px;

    overflow: auto;

    flex: 1;
}

.nav-label {
    font-size: 11px;

    color: #7f91aa;

    padding: 14px 12px 8px;
}

.side-nav a {
    display: flex;
    align-items: center;

    gap: 12px;

    color: #cbd5e4;

    padding: 12px 13px;

    border-radius: 10px;

    margin: 3px 0;

    font-size: 14px;

    transition: .15s;
}

.side-nav a span {
    width: 22px;

    text-align: center;

    font-size: 17px;
}

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

.side-nav a.active {
    box-shadow: inset -3px 0 0 #55aaf0;
}

.side-nav a.disabled {
    opacity: .45;
    cursor: default;
}

/* =========================
   Sidebar User
========================= */

.sidebar-user {
    padding: 14px;

    border-top: 1px solid rgba(255, 255, 255, .08);

    display: flex;
    align-items: center;

    gap: 10px;
}

.avatar {
    width: 38px;
    height: 38px;

    border-radius: 50%;

    display: grid;
    place-items: center;

    background: #2b75b1;

    font-weight: bold;
}

.user-meta {
    min-width: 0;

    flex: 1;
}

.user-meta strong,
.user-meta small {
    display: block;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-meta strong {
    font-size: 13px;
}

.user-meta small {
    font-size: 10px;

    color: #91a3bc;

    margin-top: 4px;
}

.logout-mini {
    color: #aebbd0;

    font-size: 21px;
}

/* =========================
   Main Area
========================= */

.main-area {
    margin-right: 270px;

    min-height: 100vh;

    display: flex;
    flex-direction: column;
}

/* =========================
   Header
========================= */

.topbar {
    height: 78px;

    background: #fff;

    border-bottom: 1px solid var(--line);

    display: flex;
    align-items: center;

    padding: 0 28px;

    gap: 16px;

    position: sticky;

    top: 0;

    z-index: 30;
}

.menu-btn {
    display: none;

    background: #f2f5f9;

    border: 0;

    border-radius: 9px;

    padding: 9px 12px;

    font-size: 20px;
}

.top-title {
    flex: 1;
}

.top-title h1 {
    font-size: 19px;

    margin: 0;
}

.breadcrumb {
    font-size: 11px;

    color: var(--muted);

    margin-top: 5px;
}

.top-actions {
    display: flex;
    align-items: center;

    gap: 9px;

    font-size: 13px;
}

.status-dot {
    width: 8px;
    height: 8px;

    border-radius: 50%;

    background: var(--success);
}

.logout-btn {
    padding: 8px 11px;

    border: 1px solid var(--line);

    border-radius: 8px;

    color: #48556a;
}

/* =========================
   Content
========================= */

.content {
    padding: 28px;

    flex: 1;

    max-width: 1600px;

    width: 100%;

    margin: 0 auto;
}

/* =========================
   Footer
========================= */

.footer {
    padding: 18px 28px;

    border-top: 1px solid var(--line);

    background: #fff;

    color: var(--muted);

    display: flex;
    justify-content: space-between;

    font-size: 11px;
}

/* =========================
   Page Header
========================= */

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    margin-bottom: 20px;
}

.page-head h2 {
    margin: 0;

    font-size: 21px;
}

.page-head p {
    margin: 5px 0 0;

    color: var(--muted);

    font-size: 13px;
}

/* =========================
   Buttons
========================= */

.button,
button.primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 7px;

    background: var(--primary);

    color: #fff;

    border: 0;

    border-radius: 9px;

    padding: 10px 15px;

    cursor: pointer;
}

.button:hover,
button.primary:hover {
    background: var(--primary2);
}

.button.secondary {
    background: #fff;

    color: #3e4a5e;

    border: 1px solid var(--line);
}

/* =========================
   Dashboard Cards
========================= */

.cards {
    display: grid;

    grid-template-columns: repeat(
        3,
        minmax(180px, 1fr)
    );

    gap: 18px;

    margin-bottom: 22px;
}

.stat-card {
    background: #fff;

    border: 1px solid var(--line);

    border-radius: 14px;

    padding: 20px;

    box-shadow: var(--shadow);

    position: relative;

    overflow: hidden;
}

.stat-card::after {
    content: "";

    position: absolute;

    right: 0;
    top: 0;
    bottom: 0;

    width: 4px;

    background: var(--primary);
}

.stat-card strong {
    display: block;

    font-size: 30px;

    margin-bottom: 8px;
}

.stat-card span {
    color: var(--muted);

    font-size: 13px;
}

/* =========================
   Panels
========================= */

.panel {
    background: #fff;

    border: 1px solid var(--line);

    border-radius: 14px;

    box-shadow: var(--shadow);

    overflow: hidden;

    margin-bottom: 20px;
}

.panel-head {
    padding: 17px 20px;

    border-bottom: 1px solid var(--line);

    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-head h3 {
    margin: 0;

    font-size: 15px;
}

.panel-body {
    padding: 20px;
}

/* =========================
   Tables
========================= */

.table-wrap {
    overflow: auto;
}

.table {
    width: 100%;

    border-collapse: collapse;

    background: #fff;
}

.table th,
.table td {
    padding: 14px 16px;

    border-bottom: 1px solid #edf1f5;

    text-align: right;

    white-space: nowrap;

    font-size: 13px;
}

.table th {
    background: #f8fafc;

    color: #68758b;

    font-size: 12px;
}

.table tr:last-child td {
    border-bottom: 0;
}

.table tr:hover td {
    background: #fbfdff;
}

/* =========================
   Badges
========================= */

.badge {
    display: inline-flex;

    padding: 5px 9px;

    border-radius: 999px;

    font-size: 11px;

    background: #eef3f8;

    color: #556277;
}

.badge.active {
    background: #e7f8f0;

    color: #137a51;
}

.badge.inactive {
    background: #fdecee;

    color: #b22e3d;
}

/* =========================
   Actions
========================= */

.actions {
    display: flex;

    gap: 7px;

    align-items: center;
}

.actions a {
    padding: 6px 9px;

    border: 1px solid var(--line);

    border-radius: 7px;

    font-size: 11px;

    background: #fff;
}

/* =========================
   Forms
========================= */

.form-grid {
    display: grid;

    grid-template-columns: repeat(
        2,
        minmax(0, 1fr)
    );

    gap: 16px;
}

.field {
    display: grid;

    gap: 7px;
}

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

.field label {
    font-size: 12px;

    color: #566278;
}

.field input,
.field select,
.field textarea,
input,
select,
textarea {
    width: 100%;

    padding: 11px 12px;

    border: 1px solid #d8e0ea;

    border-radius: 9px;

    background: #fff;

    outline: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
input:focus,
select:focus,
textarea:focus {
    border-color: #6ba6d5;

    box-shadow:
        0 0 0 3px rgba(23, 105, 170, .09);
}

.form-actions {
    display: flex;

    gap: 9px;

    margin-top: 18px;
}

/* =========================
   Alerts
========================= */

.notice,
.error {
    padding: 12px 14px;

    border-radius: 9px;

    margin-bottom: 15px;

    font-size: 13px;
}

.notice {
    background: #e9f8ef;

    color: #176c49;
}

.error {
    background: #fdeced;

    color: #a82d3a;
}

.empty {
    padding: 36px;

    text-align: center;

    color: var(--muted);
}

/* =========================
   Login
========================= */

.auth-page {
    min-height: 100vh;

    display: grid;
    place-items: center;

    padding: 20px;

    background:
        linear-gradient(
            135deg,
            #eef4fa,
            #f7f9fc
        );
}

.auth-card {
    width: min(430px, 100%);

    background: #fff;

    border: 1px solid var(--line);

    border-radius: 18px;

    padding: 30px;

    box-shadow:
        0 20px 60px rgba(24, 45, 75, .12);
}

.auth-logo {
    width: 52px;
    height: 52px;

    border-radius: 14px;

    background: var(--primary);

    color: #fff;

    display: grid;
    place-items: center;

    margin: 0 auto 15px;

    font-size: 24px;

    font-weight: bold;
}

.auth-card h1 {
    text-align: center;

    font-size: 21px;

    margin: 0 0 7px;
}

.auth-card .sub {
    text-align: center;

    color: var(--muted);

    font-size: 12px;

    margin-bottom: 22px;
}

.auth-card form {
    display: grid;

    gap: 12px;
}

/* =========================
   Mobile Overlay
========================= */

.overlay {
    display: none;
}

/* =========================
   Responsive
========================= */

@media (max-width: 900px) {

    .sidebar {
        transform: translateX(100%);

        transition: .2s;
    }

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

    .sidebar-close,
    .menu-btn {
        display: block;
    }

    .main-area {
        margin-right: 0;
    }

    .overlay.show {
        display: block;

        position: fixed;

        inset: 0;

        background: rgba(5, 12, 23, .45);

        z-index: 40;
    }

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

    .top-user {
        display: none;
    }

    .content {
        padding: 18px;
    }

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

    .footer {
        padding: 15px 18px;
    }

    .page-head {
        align-items: flex-start;

        flex-direction: column;
    }
}
