/* =========================================================
   ROOT
========================================================= */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-2: #f8fafc;

    --text: #172033;
    --text-muted: #64748b;
    --border: #e5e7eb;

    --sidebar-width: 270px;

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;

    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);

    --transition: 0.25s ease;
}


/* =========================================================
   DARK MODE
========================================================= */

[data-theme="dark"] {
    --bg: #0b1120;
    --surface: #111827;
    --surface-2: #172033;

    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #243044;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.35);
}


/* =========================================================
   RESET
========================================================= */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

html,
body {
    width: 100%;
    min-height: 100%;
}

body {
    font-family:
        "Yekan",
        "Vazirmatn",
        Tahoma,
        Arial,
        sans-serif;

    direction: rtl;

    background:
        radial-gradient(
            circle at top right,
            rgba(99, 102, 241, 0.08),
            transparent 35%
        ),
        var(--bg);

    color: var(--text);
    min-height: 100vh;

    transition:
        background var(--transition),
        color var(--transition);

    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

button {
    cursor: pointer;
    border: none;
}

img {
    max-width: 100%;
}

ul {
    list-style: none;
}


/* =========================================================
   APP
========================================================= */

.app,
.app-wrapper {
    min-height: 100vh;
    width: 100%;
}


/* =========================================================
   SIDEBAR
========================================================= */

.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;

    width: var(--sidebar-width);
    height: 100dvh;

    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.98),
            rgba(248, 250, 252, 0.98)
        );

    border-left: 1px solid var(--border);

    z-index: 1000;

    display: flex;
    flex-direction: column;

    transform: translateX(0);

    transition:
        transform var(--transition),
        background var(--transition);

    overflow: hidden;
    overscroll-behavior: contain;
}

[data-theme="dark"] .sidebar {
    background:
        linear-gradient(
            180deg,
            #111827,
            #0f172a
        );
}


/* =========================================================
   SIDEBAR BRAND
========================================================= */

.sidebar-brand {
    min-height: 82px;

    display: flex;
    align-items: center;

    padding: 0 20px;

    border-bottom: 1px solid var(--border);

    flex-shrink: 0;
}

.brand-logo {
    width: 44px;
    height: 44px;

    flex: 0 0 44px;

    border-radius: 14px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: white;
    font-size: 21px;

    background:
        linear-gradient(
            135deg,
            var(--primary),
            var(--secondary)
        );

    box-shadow:
        0 8px 20px rgba(99, 102, 241, 0.25);
}

.brand-info {
    margin-right: 12px;
    min-width: 0;
}

.brand-title {
    font-size: 17px;
    font-weight: 900;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-subtitle {
    font-size: 11px;
    color: var(--text-muted);

    margin-top: 2px;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* =========================================================
   SIDEBAR MENU
========================================================= */

.sidebar-menu {
    padding: 18px 10px;

    overflow-y: auto;
    overflow-x: hidden;

    flex: 1;
    min-height: 0;

    scrollbar-width: thin;
    overscroll-behavior: contain;
}

.menu-title {
    font-size: 11px;
    color: var(--text-muted);

    padding: 10px 13px 8px;

    font-weight: 700;
}

.menu-item {
    margin-bottom: 4px;
}

.menu-link {
    display: flex;
    align-items: center;

    gap: 11px;

    min-height: 46px;

    padding: 10px 13px;

    border-radius: 13px;

    color: var(--text-muted);

    font-size: 14px;

    transition:
        color var(--transition),
        background var(--transition),
        transform var(--transition);
}

.menu-link:hover {
    color: var(--primary);

    background:
        rgba(99, 102, 241, 0.08);

    transform: translateX(-3px);
}

.menu-link.active {
    color: white;

    background:
        linear-gradient(
            135deg,
            var(--primary),
            var(--primary-dark)
        );

    box-shadow:
        0 8px 18px rgba(79, 70, 229, 0.22);
}

.menu-icon {
    width: 22px;
    flex: 0 0 22px;

    text-align: center;
    font-size: 18px;
}

.menu-text {
    flex: 1;
    min-width: 0;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.menu-arrow,
.menu-lock {
    flex: 0 0 auto;
}


/* =========================================================
   DISABLED MENU
========================================================= */

.menu-link.disabled,
.menu-link[aria-disabled="true"] {
    color: #a8b0bd;

    background: transparent;

    cursor: not-allowed;

    opacity: 0.65;

    pointer-events: none;

    filter: grayscale(1);
}

[data-theme="dark"] .menu-link.disabled,
[data-theme="dark"] .menu-link[aria-disabled="true"] {
    color: #64748b;
}


/* =========================================================
   SIDEBAR FOOTER
========================================================= */

.sidebar-footer {
    padding: 12px;

    border-top: 1px solid var(--border);

    flex-shrink: 0;
}

.sidebar-user {
    display: flex;
    align-items: center;

    padding: 9px;

    border-radius: 15px;

    background: var(--surface-2);

    min-width: 0;
}

.avatar {
    width: 40px;
    height: 40px;

    flex: 0 0 40px;

    border-radius: 50%;

    object-fit: cover;

    background:
        linear-gradient(
            135deg,
            var(--primary),
            var(--secondary)
        );

    display: flex;
    align-items: center;
    justify-content: center;

    color: white;

    font-weight: 800;
}

.user-info {
    margin-right: 10px;

    min-width: 0;
    overflow: hidden;
}

.user-name {
    font-size: 13px;
    font-weight: 800;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    color: var(--text-muted);

    font-size: 11px;

    margin-top: 2px;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* =========================================================
   MAIN
========================================================= */

.main,
.main-content {
    margin-right: var(--sidebar-width);

    min-height: 100vh;

    width: auto;
    min-width: 0;

    transition:
        margin var(--transition);
}

.main-content-full {
    margin-right: 0;
}


/* =========================================================
   HEADER
========================================================= */

.header,
.main-navbar {
    min-height: 82px;

    position: sticky;
    top: 0;

    z-index: 900;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    padding: 12px 28px;

    background:
        rgba(255, 255, 255, 0.86);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);

    border-bottom: 1px solid var(--border);

    transition:
        background var(--transition),
        border-color var(--transition);
}

[data-theme="dark"] .header,
[data-theme="dark"] .main-navbar {
    background:
        rgba(17, 24, 39, 0.86);
}

.header-right,
.header-left {
    display: flex;
    align-items: center;

    min-width: 0;
}

.header-right {
    flex: 1;
}

.header-right > div:last-child {
    min-width: 0;
}

.header-title {
    font-size: 20px;
    font-weight: 900;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-subtitle {
    color: var(--text-muted);

    font-size: 12px;

    margin-top: 3px;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-left {
    gap: 10px;
    flex-shrink: 0;
}


/* =========================================================
   ICON BUTTON
========================================================= */

.icon-btn {
    width: 42px;
    height: 42px;

    flex: 0 0 42px;

    border-radius: 13px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: var(--text);

    background: var(--surface);

    border: 1px solid var(--border);

    transition:
        color var(--transition),
        background var(--transition),
        transform var(--transition),
        box-shadow var(--transition);
}

.icon-btn:hover {
    color: var(--primary);

    transform: translateY(-2px);

    box-shadow:
        var(--shadow-sm);
}


/* =========================================================
   MOBILE MENU
========================================================= */

.mobile-menu-btn {
    display: none;
    flex-shrink: 0;
}


/* =========================================================
   NOTIFICATION
========================================================= */

.notification {
    position: relative;
}

.notification-badge {
    position: absolute;

    top: -3px;
    left: -3px;

    min-width: 18px;
    height: 18px;

    padding: 0 4px;

    border-radius: 50%;

    background: var(--danger);

    color: white;

    font-size: 9px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 2px solid var(--surface);
}


/* =========================================================
   DROPDOWN
========================================================= */

.dropdown {
    position: absolute;

    top: calc(100% + 10px);
    left: 20px;

    min-width: 220px;
    max-width: calc(100vw - 30px);

    padding: 8px;

    border-radius: 15px;

    background: var(--surface);

    border: 1px solid var(--border);

    box-shadow: var(--shadow-md);

    opacity: 0;
    visibility: hidden;

    transform: translateY(-8px);

    transition:
        opacity var(--transition),
        visibility var(--transition),
        transform var(--transition);

    z-index: 1100;
}

.dropdown.active {
    opacity: 1;
    visibility: visible;

    transform: translateY(0);
}

.user-dropdown {
    direction: rtl;
}

.dropdown-header {
    padding: 10px;

    display: flex;
    flex-direction: column;

    gap: 4px;
}

.dropdown-header strong {
    font-size: 13px;
}

.dropdown-header small {
    font-size: 11px;
    color: var(--text-muted);
}

.dropdown-divider {
    height: 1px;

    background: var(--border);

    margin: 5px 0;
}

.dropdown-item {
    width: 100%;

    min-height: 40px;

    padding: 8px 10px;

    border-radius: 10px;

    display: flex;
    align-items: center;

    gap: 9px;

    color: var(--text);

    background: transparent;

    font-size: 12px;

    text-align: right;
}

.dropdown-item:hover {
    background: var(--surface-2);
    color: var(--primary);
}

.dropdown-danger {
    color: var(--danger);
}


/* =========================================================
   CONTENT
========================================================= */

.content,
.page-content {
    width: 100%;
    max-width: 100%;
    min-width: 0;

    padding: 30px;
}


/* =========================================================
   PAGE HEADER
========================================================= */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 25px;

    min-width: 0;
}

.page-header > * {
    min-width: 0;
}

.page-title {
    font-size: 25px;
    font-weight: 900;

    overflow-wrap: anywhere;
}

.page-description {
    margin-top: 5px;

    color: var(--text-muted);

    font-size: 13px;

    overflow-wrap: anywhere;
}


/* =========================================================
   CARDS
========================================================= */

.card {
    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: var(--radius-lg);

    box-shadow: var(--shadow-sm);

    transition:
        transform var(--transition),
        box-shadow var(--transition),
        background var(--transition),
        border-color var(--transition);

    overflow: hidden;

    min-width: 0;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 18px 22px;

    border-bottom: 1px solid var(--border);

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    min-width: 0;
}

.card-title {
    font-size: 15px;
    font-weight: 900;

    min-width: 0;

    overflow-wrap: anywhere;
}

.card-body {
    padding: 22px;

    min-width: 0;
}


/* =========================================================
   STAT CARDS
========================================================= */

.stats-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 18px;

    margin-bottom: 25px;

    min-width: 0;
}

.stat-card {
    position: relative;

    overflow: hidden;

    padding: 22px;

    min-height: 145px;
    min-width: 0;
}

.stat-card::after {
    content: "";

    position: absolute;

    width: 100px;
    height: 100px;

    left: -35px;
    bottom: -35px;

    border-radius: 50%;

    background:
        rgba(99, 102, 241, 0.08);

    pointer-events: none;
}

.stat-icon {
    width: 45px;
    height: 45px;

    border-radius: 14px;

    display: flex;
    align-items: center;
    justify-content: center;

    background:
        rgba(99, 102, 241, 0.1);

    color: var(--primary);

    font-size: 20px;
}

.stat-label {
    margin-top: 18px;

    color: var(--text-muted);

    font-size: 12px;
}

.stat-value {
    margin-top: 4px;

    font-size: 26px;

    font-weight: 900;
}


/* =========================================================
   BUTTONS
========================================================= */

.btn {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 8px;

    min-height: 43px;

    padding: 0 17px;

    border-radius: 12px;

    font-size: 13px;

    font-weight: 800;

    transition: all var(--transition);

    white-space: nowrap;

    max-width: 100%;
}

.btn-primary {
    color: white;

    background:
        linear-gradient(
            135deg,
            var(--primary),
            var(--primary-dark)
        );

    box-shadow:
        0 7px 18px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);

    box-shadow:
        0 12px 25px rgba(79, 70, 229, 0.3);
}

.btn-secondary {
    color: var(--text);

    background: var(--surface-2);

    border: 1px solid var(--border);
}

.btn-danger {
    color: white;

    background: var(--danger);
}


/* =========================================================
   FORMS
========================================================= */

.form-group {
    margin-bottom: 18px;

    min-width: 0;
}

.form-label {
    display: block;

    margin-bottom: 7px;

    font-size: 12px;

    font-weight: 800;
}

.form-control {
    width: 100%;

    min-height: 45px;

    padding: 0 14px;

    border: 1px solid var(--border);

    border-radius: 12px;

    outline: none;

    background: var(--surface);

    color: var(--text);

    font-size: 13px;

    transition:
        border var(--transition),
        box-shadow var(--transition),
        background var(--transition),
        color var(--transition);

    max-width: 100%;
}

textarea.form-control {
    padding-top: 12px;
    padding-bottom: 12px;

    min-height: 110px;

    resize: vertical;
}

.form-control:focus {
    border-color: var(--primary);

    box-shadow:
        0 0 0 4px
        rgba(99, 102, 241, 0.1);
}


/* =========================================================
   TABLE
========================================================= */

.table-wrapper {
    width: 100%;
    max-width: 100%;

    overflow-x: auto;
    overflow-y: hidden;

    -webkit-overflow-scrolling: touch;

    scrollbar-width: thin;
}

.table {
    width: 100%;

    min-width: 650px;

    border-collapse: collapse;

    font-size: 13px;
}

.table th {
    text-align: right;

    padding: 14px;

    background: var(--surface-2);

    color: var(--text-muted);

    font-size: 11px;

    font-weight: 900;

    white-space: nowrap;
}

.table td {
    padding: 15px 14px;

    border-top: 1px solid var(--border);

    white-space: nowrap;
}

.table tbody tr {
    transition: background var(--transition);
}

.table tbody tr:hover {
    background:
        rgba(99, 102, 241, 0.04);
}


/* =========================================================
   BADGES
========================================================= */

.badge {
    display: inline-flex;

    align-items: center;

    min-height: 27px;

    padding: 0 10px;

    border-radius: 999px;

    font-size: 10px;

    font-weight: 900;

    white-space: nowrap;
}

.badge-success {
    color: #047857;
    background: #d1fae5;
}

.badge-warning {
    color: #92400e;
    background: #fef3c7;
}

.badge-danger {
    color: #991b1b;
    background: #fee2e2;
}

.badge-info {
    color: #155e75;
    background: #cffafe;
}


/* =========================================================
   SCORE
========================================================= */

.score {
    font-size: 20px;
    font-weight: 900;
}

.score-positive {
    color: var(--success);
}

.score-warning {
    color: var(--warning);
}

.score-danger {
    color: var(--danger);
}


/* =========================================================
   PROGRESS
========================================================= */

.progress {
    width: 100%;

    height: 8px;

    overflow: hidden;

    border-radius: 999px;

    background: var(--surface-2);
}

.progress-bar {
    height: 100%;

    border-radius: inherit;

    background:
        linear-gradient(
            90deg,
            var(--primary),
            var(--secondary)
        );

    transition:
        width 0.6s ease;
}


/* =========================================================
   ALERT
========================================================= */

.alert {
    padding: 14px 16px;

    border-radius: 13px;

    margin-bottom: 18px;

    font-size: 13px;

    border: 1px solid transparent;

    overflow-wrap: anywhere;
}

.alert-success {
    color: #047857;

    background: #ecfdf5;

    border-color: #a7f3d0;
}

.alert-danger {
    color: #991b1b;

    background: #fef2f2;

    border-color: #fecaca;
}

.alert-warning {
    color: #92400e;

    background: #fffbeb;

    border-color: #fde68a;
}

.alert-info {
    color: #155e75;

    background: #ecfeff;

    border-color: #a5f3fc;
}


/* =========================================================
   LOGIN
========================================================= */

.auth-page {
    min-height: 100dvh;

    display: flex;

    align-items: center;
    justify-content: center;

    padding: 25px;

    background:
        radial-gradient(
            circle at 15% 20%,
            rgba(99, 102, 241, 0.22),
            transparent 30%
        ),
        radial-gradient(
            circle at 85% 80%,
            rgba(6, 182, 212, 0.18),
            transparent 30%
        ),
        var(--bg);
}

.auth-card {
    width: 100%;

    max-width: 430px;

    padding: 35px;

    border-radius: 28px;

    background:
        rgba(255, 255, 255, 0.82);

    border:
        1px solid rgba(255, 255, 255, 0.5);

    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);

    box-shadow:
        0 25px 70px
        rgba(15, 23, 42, 0.12);
}

[data-theme="dark"] .auth-card {
    background:
        rgba(17, 24, 39, 0.85);

    border-color: var(--border);
}

.auth-logo {
    width: 65px;
    height: 65px;

    margin: 0 auto 20px;

    border-radius: 20px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: white;

    font-size: 28px;

    background:
        linear-gradient(
            135deg,
            var(--primary),
            var(--secondary)
        );

    box-shadow:
        0 15px 30px
        rgba(99, 102, 241, 0.3);
}

.auth-title {
    text-align: center;

    font-size: 25px;

    font-weight: 900;
}

.auth-description {
    text-align: center;

    color: var(--text-muted);

    font-size: 12px;

    margin-top: 7px;

    margin-bottom: 28px;
}


/* =========================================================
   FOOTER
========================================================= */

.main-footer {
    display: flex;

    justify-content: space-between;
    align-items: center;

    gap: 15px;

    padding: 20px 30px;

    color: var(--text-muted);

    font-size: 11px;
}


/* =========================================================
   SIDEBAR OVERLAY
========================================================= */

.sidebar-overlay {
    display: none;

    position: fixed;

    inset: 0;

    background:
        rgba(15, 23, 42, 0.45);

    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);

    z-index: 999;

    touch-action: none;
}

.sidebar-overlay.active {
    display: block;
}


/* =========================================================
   LARGE TABLET
   1200px
========================================================= */

@media (max-width: 1200px) {
    .content,
    .page-content {
        padding: 25px;
    }

    .stats-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}


/* =========================================================
   TABLET
   992px
========================================================= */

@media (max-width: 991.98px) {
    :root {
        --sidebar-width: 270px;
    }

    /* -------------------------
       SIDEBAR
    ------------------------- */

    .sidebar {
        transform: translateX(100%);

        box-shadow:
            -15px 0 40px
            rgba(15, 23, 42, 0.15);

        will-change: transform;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    /* -------------------------
       MAIN
    ------------------------- */

    .main,
    .main-content {
        margin-right: 0;

        width: 100%;
        max-width: 100%;
    }

    /* -------------------------
       HEADER
    ------------------------- */

    .mobile-menu-btn {
        display: flex;
    }

    .header,
    .main-navbar {
        min-height: 70px;

        padding: 10px 20px;
    }

    /* -------------------------
       CONTENT
    ------------------------- */

    .content,
    .page-content {
        padding: 22px;
    }
}


/* =========================================================
   MOBILE
   768px
========================================================= */

@media (max-width: 767.98px) {
    body {
        font-size: 14px;
        overflow-x: hidden;
    }

    /* =====================================================
       SIDEBAR
    ===================================================== */

    .sidebar {
        width: min(300px, 88vw);

        max-width: 300px;

        right: 0;

        height: 100dvh;

        border-left: 1px solid var(--border);

        border-radius: 0;

        z-index: 1001;

        transform: translate3d(100%, 0, 0);
    }

    .sidebar.open {
        transform: translate3d(0, 0, 0);
    }

    /* =====================================================
       HEADER
    ===================================================== */

    .header,
    .main-navbar {
        min-height: 64px;

        height: auto;

        padding: 8px 14px;

        gap: 7px;

        width: 100%;
    }

    .header-right {
        min-width: 0;

        flex: 1;

        overflow: hidden;
    }

    .header-right > div:last-child {
        min-width: 0;

        max-width: 100%;
    }

    .header-left {
        gap: 6px;

        flex-shrink: 0;
    }

    .header-title {
        font-size: 16px;

        white-space: nowrap;

        overflow: hidden;

        text-overflow: ellipsis;
    }

    .header-subtitle {
        display: none;
    }

    /* =====================================================
       ICONS
    ===================================================== */

    .icon-btn {
        width: 38px;
        height: 38px;

        flex-basis: 38px;

        border-radius: 11px;

        flex-shrink: 0;
    }

    .mobile-menu-btn {
        display: flex;

        margin-left: 7px;
    }

    /* =====================================================
       DROPDOWN
    ===================================================== */

    .dropdown {
        position: fixed;

        top: 58px;

        left: 10px;
        right: 10px;

        width: auto;

        min-width: 0;

        max-width: none;
    }

    /* =====================================================
       CONTENT
    ===================================================== */

    .content,
    .page-content {
        padding: 16px 13px;

        width: 100%;

        max-width: 100%;

        overflow-x: hidden;
    }

    /* =====================================================
       PAGE HEADER
    ===================================================== */

    .page-header {
        align-items: stretch;

        flex-direction: column;

        gap: 12px;

        margin-bottom: 18px;
    }

    .page-title {
        font-size: 20px;
    }

    .page-description {
        font-size: 12px;
    }

    .page-header .btn {
        width: 100%;
    }

    /* =====================================================
       STATS
    ===================================================== */

    .stats-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 10px;

        margin-bottom: 18px;
    }

    .stat-card {
        min-height: 125px;

        padding: 15px;
    }

    .stat-icon {
        width: 38px;
        height: 38px;

        border-radius: 11px;

        font-size: 17px;
    }

    .stat-label {
        margin-top: 13px;

        font-size: 11px;
    }

    .stat-value {
        font-size: 20px;
    }

    /* =====================================================
       CARDS
    ===================================================== */

    .card {
        border-radius: 17px;

        width: 100%;

        max-width: 100%;
    }

    .card-header {
        padding: 14px 15px;

        gap: 10px;
    }

    .card-body {
        padding: 15px;
    }

    .card-title {
        font-size: 14px;
    }

    /* =====================================================
       BUTTONS
    ===================================================== */

    .btn {
        min-height: 41px;

        padding: 0 13px;

        font-size: 12px;
    }

    /* =====================================================
       FORMS
    ===================================================== */

    .form-group {
        margin-bottom: 14px;
    }

    .form-label {
        font-size: 11px;
    }

    .form-control {
        min-height: 44px;

        font-size: 13px;
    }

    /* =====================================================
       TABLE
    ===================================================== */

    .table-wrapper {
        margin-left: -15px;

        margin-right: -15px;

        width: calc(100% + 30px);

        max-width: calc(100% + 30px);
    }

    /* =====================================================
       FOOTER
    ===================================================== */

    .main-footer {
        padding: 15px;

        flex-direction: column;

        text-align: center;
    }
}


/* =========================================================
   SMALL MOBILE
   576px
========================================================= */

@media (max-width: 575.98px) {
    /* =====================================================
       SIDEBAR
    ===================================================== */

    .sidebar {
        width: min(310px, 90vw);

        max-width: 310px;
    }

    .sidebar-brand {
        min-height: 74px;

        padding: 0 15px;
    }

    .brand-logo {
        width: 40px;
        height: 40px;

        flex-basis: 40px;

        border-radius: 12px;

        font-size: 19px;
    }

    .brand-info {
        margin-right: 9px;
    }

    .brand-title {
        font-size: 15px;
    }

    .brand-subtitle {
        font-size: 10px;
    }

    .sidebar-menu {
        padding: 12px 8px;
    }

    .menu-title {
        padding: 9px 11px 7px;

        font-size: 10px;
    }

    .menu-link {
        min-height: 44px;

        padding: 9px 11px;

        gap: 9px;

        font-size: 13px;
    }

    .menu-icon {
        width: 21px;

        flex-basis: 21px;

        font-size: 17px;
    }

    .sidebar-footer {
        padding: 9px;
    }

    /* =====================================================
       LOGIN
    ===================================================== */

    .auth-page {
        padding: 14px;
    }

    .auth-card {
        max-width: 100%;

        padding: 26px 18px;

        border-radius: 21px;
    }

    .auth-logo {
        width: 58px;
        height: 58px;

        border-radius: 17px;

        font-size: 24px;

        margin-bottom: 16px;
    }

    .auth-title {
        font-size: 21px;
    }

    .auth-description {
        margin-bottom: 21px;
    }

    /* =====================================================
       STATS
    ===================================================== */

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        min-height: 110px;

        display: grid;

        grid-template-columns:
            auto 1fr;

        column-gap: 13px;

        align-items: center;
    }

    .stat-label {
        margin-top: 0;
    }

    .stat-value {
        margin-top: 2px;
    }

    .stat-icon {
        grid-row: span 2;
    }

    /* =====================================================
       CARD
    ===================================================== */

    .card-header {
        align-items: flex-start;

        flex-direction: column;
    }

    .card-header .btn {
        width: 100%;
    }

    /* =====================================================
       HEADER
    ===================================================== */

    .header-left {
        gap: 5px;
    }

    .header-left .icon-btn {
        width: 36px;
        height: 36px;

        flex-basis: 36px;
    }
}


/* =========================================================
   VERY SMALL MOBILE
   400px
========================================================= */

@media (max-width: 400px) {
    /* =====================================================
       SIDEBAR
    ===================================================== */

    .sidebar {
        width: 92vw;

        max-width: 300px;
    }

    /* =====================================================
       HEADER
    ===================================================== */

    .header,
    .main-navbar {
        padding: 7px 9px;

        gap: 5px;
    }

    .header-right {
        gap: 4px;
    }

    .header-title {
        font-size: 14px;
    }

    .mobile-menu-btn {
        margin-left: 4px;
    }

    .icon-btn {
        width: 35px;
        height: 35px;

        flex-basis: 35px;
    }

    .header-left {
        gap: 4px;
    }

    /* =====================================================
       CONTENT
    ===================================================== */

    .content,
    .page-content {
        padding: 13px 10px;
    }

    /* =====================================================
       PAGE
    ===================================================== */

    .page-title {
        font-size: 18px;
    }

    /* =====================================================
       CARD
    ===================================================== */

    .card-header {
        padding: 13px;
    }

    .card-body {
        padding: 13px;
    }

    /* =====================================================
       BUTTON
    ===================================================== */

    .btn {
        min-height: 40px;

        padding: 0 11px;
    }
}


/* =========================================================
   ULTRA SMALL
   360px
========================================================= */

@media (max-width: 359.98px) {
    /* =====================================================
       SIDEBAR
    ===================================================== */

    .sidebar {
        width: 94vw;

        max-width: 290px;
    }

    .sidebar-brand {
        min-height: 68px;

        padding: 0 12px;
    }

    .brand-logo {
        width: 37px;
        height: 37px;

        flex-basis: 37px;

        border-radius: 11px;

        font-size: 17px;
    }

    .brand-title {
        font-size: 14px;
    }

    .brand-subtitle {
        font-size: 9px;
    }

    .menu-link {
        min-height: 42px;

        padding: 8px 10px;

        font-size: 12px;
    }

    /* =====================================================
       CONTENT
    ===================================================== */

    .content,
    .page-content {
        padding: 10px 8px;
    }

    /* =====================================================
       HEADER
    ===================================================== */

    .header,
    .main-navbar {
        padding: 6px 7px;
    }

    .header-title {
        font-size: 13px;
    }

    .icon-btn {
        width: 34px;
        height: 34px;

        flex-basis: 34px;

        border-radius: 10px;
    }

    .mobile-menu-btn {
        margin-left: 2px;
    }

    /* =====================================================
       STATS
    ===================================================== */

    .stats-grid {
        gap: 8px;
    }

    .stat-card {
        padding: 13px;
    }

    /* =====================================================
       LOGIN
    ===================================================== */

    .auth-page {
        padding: 8px;
    }

    .auth-card {
        padding: 21px 13px;

        border-radius: 18px;
    }
}


/* =========================================================
   LANDSCAPE MOBILE
========================================================= */

@media (max-height: 600px) and (max-width: 991.98px) {
    .sidebar-brand {
        min-height: 65px;
    }

    .sidebar-menu {
        padding-top: 8px;

        padding-bottom: 8px;
    }

    .menu-link {
        min-height: 40px;

        padding: 7px 11px;
    }

    .sidebar-footer {
        padding: 7px;
    }

    .auth-page {
        align-items: flex-start;

        padding-top: 15px;
        padding-bottom: 15px;

        overflow-y: auto;
    }
}


/* =========================================================
   ANIMATIONS
========================================================= */

.fade-in {
    animation:
        fadeIn 0.45s ease both;
}

@keyframes fadeIn {
    from {
        opacity: 0;

        transform:
            translateY(8px);
    }

    to {
        opacity: 1;

        transform:
            translateY(0);
    }
}

.slide-up {
    animation:
        slideUp 0.5s ease both;
}

@keyframes slideUp {
    from {
        opacity: 0;

        transform:
            translateY(20px);
    }

    to {
        opacity: 1;

        transform:
            translateY(0);
    }
}


/* =========================================================
   LOADING
========================================================= */

.loading-spinner {
    width: 16px;
    height: 16px;

    border:
        2px solid currentColor;

    border-left-color:
        transparent;

    border-radius: 50%;

    display: inline-block;

    animation:
        spin 0.7s linear infinite;
}

@keyframes spin {
    to {
        transform:
            rotate(360deg);
    }
}


/* =========================================================
   SCROLLBAR
========================================================= */

::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

::-webkit-scrollbar-track {
    background:
        transparent;
}

::-webkit-scrollbar-thumb {
    background:
        #cbd5e1;

    border-radius:
        999px;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background:
        #334155;
}


/* =========================================================
   TOUCH DEVICES
========================================================= */

@media (hover: none) and (pointer: coarse) {
    .menu-link:hover,
    .icon-btn:hover,
    .btn-primary:hover {
        transform: none;
    }
}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;

        animation-duration:
            0.01ms !important;

        animation-iteration-count:
            1 !important;

        transition-duration:
            0.01ms !important;
    }
}