:root {
    --app-bg: #eef3f8;
    --app-bg-2: #f8fafc;
    --surface: rgba(255, 255, 255, 0.82);
    --surface-solid: #ffffff;
    --surface-soft: #f1f5f9;
    --surface-strong: #0f172a;
    --text: #0f172a;
    --muted: #64748b;
    --primary: #14b8a6;
    --primary-dark: #0f766e;
    --accent: #f59e0b;
    --accent-dark: #d97706;
    --border: rgba(15, 23, 42, 0.08);
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 16px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    font-family: "Plus Jakarta Sans", sans-serif;
    background: radial-gradient(circle at top left, rgba(20, 184, 166, 0.08), transparent 32%),
        radial-gradient(circle at right center, rgba(245, 158, 11, 0.08), transparent 36%),
        linear-gradient(180deg, var(--app-bg), var(--app-bg-2));
    color: var(--text);
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6,
.hero-title,
.section-title,
.topbar__title {
    font-family: "Space Grotesk", sans-serif;
    letter-spacing: -0.02em;
}

a {
    text-decoration: none;
}

.app-shell {
    position: relative;
}

.app-shell__bg,
.app-shell__pattern,
.auth-shell__bg,
.auth-shell__pattern {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.app-shell__bg,
.auth-shell__bg {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.02), rgba(20, 184, 166, 0.02));
}

.app-shell__pattern,
.auth-shell__pattern {
    background-image: radial-gradient(rgba(15, 23, 42, 0.04) 1px, transparent 1px);
    background-size: 26px 26px;
    opacity: 0.3;
}

.sidebar {
    width: 300px;
    min-width: 300px;
    background: linear-gradient(180deg, #0b1220 0%, #111827 100%);
    color: #e2e8f0;
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 24px 18px 18px;
    z-index: 10;
    box-shadow: 18px 0 45px rgba(15, 23, 42, 0.22);
    transition: width 0.28s ease, min-width 0.28s ease, padding 0.28s ease;
    overflow: hidden;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar__brand-copy {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
}

.sidebar__toggle {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 12px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    transition: 0.2s ease;
}

.sidebar__toggle:hover,
.sidebar__toggle:focus {
    background: rgba(20, 184, 166, 0.18);
    border-color: rgba(20, 184, 166, 0.32);
}

.brand__logo,
.auth-brand__logo {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    display: block;
    object-fit: cover;
    box-shadow: 0 12px 30px rgba(20, 184, 166, 0.28);
    flex: 0 0 auto;
}

.brand__title {
    font-weight: 800;
    font-size: 1.02rem;
    line-height: 1.2;
}

.brand__sub {
    color: rgba(226, 232, 240, 0.72);
    font-size: 0.82rem;
}

.sidebar__scroll {
    margin-top: 18px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
}

.sidebar__footer {
    padding: 14px 16px;
    margin-top: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(226, 232, 240, 0.84);
}

.sidebar__footer .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.24);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.sidebar__footer .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.32);
    color: #fff;
}

.sidebar-nav {
    margin: 0;
    display: grid;
    gap: 8px;
}

.sidebar-nav__item {
    position: relative;
}

.sidebar-nav__link {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border-radius: 16px;
    color: rgba(226, 232, 240, 0.88);
    font-weight: 600;
    border: 1px solid transparent;
    transition: 0.2s ease;
    background: transparent;
}

.sidebar-nav__link:hover,
.sidebar-nav__link:focus,
.sidebar-nav__item.is-active > .sidebar-nav__link,
.sidebar-nav__item.mm-active > .sidebar-nav__link {
    background: rgba(20, 184, 166, 0.16);
    color: #ffffff;
    border-color: rgba(20, 184, 166, 0.22);
    transform: translateX(2px);
}

.sidebar-nav__link i {
    width: 18px;
    text-align: center;
    opacity: 0.95;
}

.sidebar-nav__label {
    display: inline-block;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    transition: max-width 0.28s ease, opacity 0.2s ease, transform 0.2s ease;
    max-width: 220px;
}

.sidebar__logout-label {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    transition: max-width 0.28s ease, opacity 0.2s ease, transform 0.2s ease;
    max-width: 120px;
}

.sidebar-nav .mm-collapse {
    margin-left: 14px;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    padding-left: 12px;
}

.sidebar-nav .mm-collapse {
    animation: sidebarMenuReveal 0.2s ease;
}

.sidebar-nav .mm-collapse .sidebar-nav__item {
    margin-left: 0;
}

.sidebar-nav__sub {
    display: grid;
    gap: 6px;
    padding-top: 8px;
}

.sidebar-nav .mm-collapse .sidebar-nav__link {
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 0.95rem;
    color: rgba(226, 232, 240, 0.78);
}

@keyframes sidebarMenuReveal {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-wrap {
    position: relative;
    padding: 22px 22px 28px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    position: relative;
    z-index: 20;
    padding: 18px 22px;
    border-radius: 24px;
    background: var(--surface);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.55);
    margin-bottom: 22px;
}

.topbar__eyebrow,
.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--primary-dark);
}

.topbar__title,
.section-title,
.hero-title {
    color: var(--surface-strong);
}

.topbar__title {
    font-size: 1.35rem;
}

.topbar__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar__search {
    min-width: 320px;
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 999px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar__search input {
    border: none;
    background: transparent;
    box-shadow: none;
    padding-left: 0;
    padding-right: 0;
}

.topbar__search input:focus {
    box-shadow: none;
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    margin-right: 10px;
    background: linear-gradient(135deg, var(--primary), #22c55e);
    color: #fff;
    font-weight: 800;
    font-size: 0.85rem;
}

.avatar--image {
    overflow: hidden;
    background: #e2e8f0;
}

.avatar--image img,
.profile-photo-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-photo-preview {
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.12), rgba(245, 158, 11, 0.12));
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
}

.profile-photo-preview--hero {
    width: 88px;
    height: 88px;
    border: 4px solid rgba(255, 255, 255, 0.72);
}

.profile-photo-preview--thumb {
    width: 116px;
    height: 116px;
}

.profile-photo-preview--square {
    width: 100%;
    height: 220px;
    border-radius: 24px;
}

.profile-hero__card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 16px 35px rgba(15, 23, 42, 0.08);
}

.profile-upload {
    display: flex;
    gap: 18px;
    align-items: center;
    padding: 18px;
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.03);
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.profile-upload.is-compressing {
    border-color: rgba(20, 184, 166, 0.35);
    box-shadow: inset 0 0 0 1px rgba(20, 184, 166, 0.18);
}

.profile-upload__media {
    flex: 0 0 auto;
}

.profile-upload__body {
    flex: 1 1 auto;
}

.profile-tips {
    color: var(--muted);
    display: grid;
    gap: 10px;
    padding-left: 1.1rem;
    margin-bottom: 0;
}

.profile-photo-note {
    margin-top: 20px;
    padding: 18px;
    border-radius: 24px;
    background: rgba(20, 184, 166, 0.08);
    border: 1px solid rgba(20, 184, 166, 0.14);
}

.btn-soft-light {
    background: rgba(15, 23, 42, 0.05);
    border: 1px solid rgba(15, 23, 42, 0.06);
    color: var(--surface-strong);
}

.btn-soft-light:hover {
    background: rgba(15, 23, 42, 0.08);
    color: var(--surface-strong);
}

.content-area {
    padding-bottom: 12px;
}

.page-stack {
    display: grid;
    gap: 22px;
}

.page-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

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

.widget-card {
    border-radius: 24px;
    overflow: hidden;
    background: var(--surface);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.58);
}

.widget-card--live {
    position: relative;
}

.widget-card--live .card-body {
    display: grid;
    gap: 10px;
}

.widget-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.16), rgba(245, 158, 11, 0.16));
    color: var(--primary-dark);
    font-size: 1.1rem;
}

.widget-label {
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.widget-value {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1;
    color: var(--surface-strong);
}

.page-hero,
.chart-card,
.card {
    border-radius: var(--radius-xl);
}

.page-hero {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.64));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.64);
}

.hero-title {
    font-size: clamp(1.8rem, 2vw, 2.8rem);
    max-width: 12ch;
}

.card {
    background: var(--surface);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.58);
}

.bg-soft {
    background: rgba(15, 23, 42, 0.03);
}

.bg-soft-subtle {
    background: rgba(20, 184, 166, 0.08);
}

.chart-card {
    min-height: 100%;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    border-bottom-width: 1px !important;
}

.table tbody tr {
    transition: background 0.18s ease;
}

.table tbody tr:hover {
    background: rgba(20, 184, 166, 0.04);
}

.table-skeleton,
.chart-skeleton {
    min-height: 220px;
    padding: 1rem;
    display: grid;
    place-items: center;
}

.chart-skeleton {
    min-height: 240px;
}

.chart-skeleton--sm {
    min-height: 200px;
}

.chart-skeleton::before,
.table-skeleton::before {
    content: "";
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 18px;
    background:
        linear-gradient(100deg, rgba(148, 163, 184, 0.08) 8%, rgba(148, 163, 184, 0.16) 18%, rgba(148, 163, 184, 0.08) 33%);
    background-size: 200% 100%;
    animation: shimmer 1.6s infinite linear;
}

@keyframes shimmer {
    from {
        background-position: 200% 0;
    }
    to {
        background-position: -200% 0;
    }
}

.modal-content {
    border-radius: 28px;
}

.crud-modal .modal-content {
    max-height: calc(100vh - 2rem);
    overflow: hidden;
}

.crud-modal form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.crud-modal .modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
}

.modal-header,
.modal-footer {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.form-control,
.form-select,
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    min-height: 48px;
    border-radius: 14px;
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: none;
}

.form-control:focus,
.form-select:focus,
.select2-container--default .select2-selection--single:focus,
.select2-container--default .select2-selection--multiple:focus {
    border-color: rgba(20, 184, 166, 0.55);
    box-shadow: 0 0 0 0.2rem rgba(20, 184, 166, 0.08);
}

.select2-container {
    width: 100% !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered,
.select2-container--default .select2-selection--multiple .select2-selection__rendered {
    line-height: 46px;
    padding-left: 14px;
    padding-right: 14px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 46px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    border-radius: 999px;
    background: rgba(20, 184, 166, 0.12);
    border: 1px solid rgba(20, 184, 166, 0.18);
    color: var(--primary-dark);
    padding: 6px 10px;
}

.select2-container .select2-selection--multiple .select2-search__field {
    margin-top: 8px;
}

.flatpickr-input[readonly] {
    background: #fff;
}

.invalid-feedback {
    display: block;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #22c55e);
    border-color: transparent;
    box-shadow: 0 14px 30px rgba(20, 184, 166, 0.22);
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, var(--primary-dark), #16a34a);
    border-color: transparent;
}

.btn-outline-primary {
    border-color: rgba(20, 184, 166, 0.28);
    color: var(--primary-dark);
}

.btn-outline-primary:hover {
    background: rgba(20, 184, 166, 0.12);
    border-color: rgba(20, 184, 166, 0.34);
    color: var(--primary-dark);
}

.btn-light {
    background: rgba(15, 23, 42, 0.04);
    border-color: rgba(15, 23, 42, 0.06);
}

.btn-light:hover {
    background: rgba(15, 23, 42, 0.08);
}

.btn-soft-primary {
    background: rgba(20, 184, 166, 0.12);
    color: var(--primary-dark);
    border: 1px solid rgba(20, 184, 166, 0.18);
}

.btn-soft-primary:hover {
    background: rgba(20, 184, 166, 0.18);
}

.sidebar-offcanvas {
    background: #0f172a;
    color: #fff;
    width: min(84vw, 300px);
}

.sidebar-offcanvas .offcanvas-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-offcanvas__close {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
}

.topbar .dropdown-menu {
    z-index: 1080;
}

.theme-toggle--floating {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 30;
    box-shadow: var(--shadow);
}

html.sidebar-collapsed .sidebar {
    width: 92px;
    min-width: 92px;
    padding-left: 12px;
    padding-right: 12px;
}

html.sidebar-collapsed .sidebar:hover {
    width: 300px;
    min-width: 300px;
}

html.sidebar-collapsed .sidebar__brand {
    justify-content: center;
    padding-left: 10px;
    padding-right: 10px;
}

html.sidebar-collapsed .sidebar__brand-copy,
html.sidebar-collapsed .sidebar .sidebar-nav__label,
html.sidebar-collapsed .sidebar .sidebar__logout-label {
    max-width: 0;
    opacity: 0;
    transform: translateX(-8px);
}

html.sidebar-collapsed .sidebar:hover .sidebar__brand-copy,
html.sidebar-collapsed .sidebar:hover .sidebar-nav__label,
html.sidebar-collapsed .sidebar:hover .sidebar__logout-label {
    max-width: 240px;
    opacity: 1;
    transform: translateX(0);
}

html.sidebar-collapsed .sidebar:hover .sidebar__brand {
    justify-content: space-between;
    display: flex;
}

html.sidebar-collapsed .sidebar .sidebar-nav__link {
    justify-content: center;
    gap: 0;
    padding-left: 0;
    padding-right: 0;
}

html.sidebar-collapsed .sidebar:hover .sidebar-nav__link {
    justify-content: flex-start;
    gap: 12px;
    padding-left: 14px;
    padding-right: 14px;
}

html.sidebar-collapsed .sidebar .sidebar-nav__link i {
    width: 24px;
}

html.sidebar-collapsed .sidebar:hover .sidebar-nav__link i {
    width: 18px;
}

html.sidebar-collapsed .sidebar .has-arrow::after {
    opacity: 0;
}

html.sidebar-collapsed .sidebar:hover .has-arrow::after {
    opacity: 1;
}

html.sidebar-collapsed .sidebar .sidebar-nav .mm-collapse {
    display: none !important;
}

html.sidebar-collapsed .sidebar:hover .sidebar-nav .mm-collapse {
    display: block !important;
}

html.sidebar-collapsed .sidebar__logout-btn {
    justify-content: center;
}

.auth-page {
    min-height: 100vh;
    background: linear-gradient(180deg, #eef3f8 0%, #f8fafc 100%);
}

body.auth-page .auth-shell__bg,
body.auth-page .auth-shell__pattern {
    display: none;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 16px;
    position: relative;
}

.auth-card {
    width: min(1140px, 100%);
    position: relative;
    z-index: 2;
    overflow: hidden;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
}

.auth-grid {
    display: grid;
    grid-template-columns: 1.28fr 0.92fr;
    gap: 24px;
    align-items: stretch;
}

.auth-grid__brand {
    border-radius: 24px;
    padding: 22px;
    background: linear-gradient(145deg, rgba(15, 23, 42, 1), rgba(20, 184, 166, 0.92));
    color: #fff;
    min-height: 100%;
}

.brand-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    font-weight: 700;
}

.brand-pill--logo {
    padding: 8px 16px 8px 8px;
}

.brand-pill--logo .auth-brand__logo {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    box-shadow: none;
}

.auth-title {
    font-size: clamp(1.7rem, 2.45vw, 2.6rem);
    line-height: 1;
    margin-bottom: 12px;
}

.auth-text {
    color: rgba(255, 255, 255, 0.84);
    max-width: 52ch;
    font-size: 0.96rem;
    line-height: 1.45;
}

.auth-features {
    display: grid;
    gap: 8px;
    margin-top: 18px;
}

.auth-features div {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.92rem;
}

.auth-grid__form {
    padding: 8px 8px 8px 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.section-title {
    font-size: 1.35rem;
}

.page-toolbar .section-title {
    margin-bottom: 0;
}

.offcanvas .sidebar-nav__link {
    color: rgba(226, 232, 240, 0.9);
}

.offcanvas .sidebar-nav__link:hover,
.offcanvas .sidebar-nav__item.is-active > .sidebar-nav__link,
.offcanvas .sidebar-nav__item.mm-active > .sidebar-nav__link {
    background: rgba(20, 184, 166, 0.18);
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: rgba(20, 184, 166, 0.16);
    color: var(--surface-strong);
}

.select2-container--default .select2-results__option[aria-selected=true] {
    background: rgba(20, 184, 166, 0.08);
}

.swal2-container {
    z-index: 20000;
}

.placeholder {
    background-color: rgba(148, 163, 184, 0.2);
    border-radius: 999px;
}

.text-muted {
    color: var(--muted) !important;
}

html[data-bs-theme='dark'] {
    color-scheme: dark;
    --app-bg: #050816;
    --app-bg-2: #0f172a;
    --surface: rgba(15, 23, 42, 0.88);
    --surface-solid: #0f172a;
    --surface-soft: rgba(255, 255, 255, 0.05);
    --surface-strong: #f8fafc;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --border: rgba(148, 163, 184, 0.16);
    --shadow: 0 18px 45px rgba(2, 6, 23, 0.45);
}

html[data-bs-theme='dark'] body {
    background:
        radial-gradient(circle at top left, rgba(20, 184, 166, 0.12), transparent 30%),
        radial-gradient(circle at right center, rgba(245, 158, 11, 0.08), transparent 34%),
        linear-gradient(180deg, #050816 0%, #0f172a 100%);
    color: var(--text);
}

html[data-bs-theme='dark'] body.auth-page {
    background: linear-gradient(180deg, #050816 0%, #0f172a 100%);
}

html[data-bs-theme='dark'] .app-shell__bg,
html[data-bs-theme='dark'] .auth-shell__bg {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.72), rgba(20, 184, 166, 0.06));
}

html[data-bs-theme='dark'] .app-shell__pattern,
html[data-bs-theme='dark'] .auth-shell__pattern {
    opacity: 0.12;
}

html[data-bs-theme='dark'] .topbar,
html[data-bs-theme='dark'] .card,
html[data-bs-theme='dark'] .widget-card,
html[data-bs-theme='dark'] .page-hero,
html[data-bs-theme='dark'] .auth-card,
html[data-bs-theme='dark'] .profile-hero__card,
html[data-bs-theme='dark'] .profile-upload,
html[data-bs-theme='dark'] .dropdown-menu,
html[data-bs-theme='dark'] .modal-content {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

html[data-bs-theme='dark'] .sidebar {
    background: linear-gradient(180deg, #030712 0%, #0b1220 100%);
    box-shadow: 18px 0 45px rgba(2, 6, 23, 0.35);
}

html[data-bs-theme='dark'] .sidebar__brand,
html[data-bs-theme='dark'] .sidebar__footer {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(148, 163, 184, 0.12);
}

html[data-bs-theme='dark'] .brand__sub {
    color: rgba(226, 232, 240, 0.72);
}

html[data-bs-theme='dark'] .topbar__search,
html[data-bs-theme='dark'] .btn-soft-light,
html[data-bs-theme='dark'] .btn-light {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

html[data-bs-theme='dark'] .btn-soft-light:hover,
html[data-bs-theme='dark'] .btn-light:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

html[data-bs-theme='dark'] .sidebar-nav__link {
    color: rgba(226, 232, 240, 0.9);
}

html[data-bs-theme='dark'] .sidebar-nav__link:hover,
html[data-bs-theme='dark'] .sidebar-nav__item.mm-active > .sidebar-nav__link,
html[data-bs-theme='dark'] .sidebar-nav__item.is-active > .sidebar-nav__link {
    background: rgba(20, 184, 166, 0.18);
    border-color: rgba(20, 184, 166, 0.22);
}

html[data-bs-theme='dark'] .sidebar-nav .mm-collapse {
    border-left-color: rgba(255, 255, 255, 0.12);
}

html[data-bs-theme='dark'] .form-control,
html[data-bs-theme='dark'] .form-select,
html[data-bs-theme='dark'] .select2-container--default .select2-selection--single,
html[data-bs-theme='dark'] .select2-container--default .select2-selection--multiple {
    background: rgba(15, 23, 42, 0.72);
    border-color: rgba(148, 163, 184, 0.2);
    color: var(--text);
}

html[data-bs-theme='dark'] .form-control::placeholder {
    color: rgba(148, 163, 184, 0.72);
}

html[data-bs-theme='dark'] .select2-container--default .select2-selection--single .select2-selection__rendered,
html[data-bs-theme='dark'] .select2-container--default .select2-selection--multiple .select2-selection__rendered {
    color: var(--text);
}

html[data-bs-theme='dark'] .select2-container--default .select2-dropdown {
    background: #0f172a;
    border-color: rgba(148, 163, 184, 0.18);
}

html[data-bs-theme='dark'] .select2-container--default .select2-results__option {
    color: var(--text);
}

html[data-bs-theme='dark'] .select2-container--default .select2-results__option--highlighted[aria-selected],
html[data-bs-theme='dark'] .select2-container--default .select2-results__option[aria-selected=true] {
    background: rgba(20, 184, 166, 0.18);
    color: #fff;
}

html[data-bs-theme='dark'] .table thead th {
    color: var(--muted);
}

html[data-bs-theme='dark'] .table tbody tr:hover {
    background: rgba(20, 184, 166, 0.08);
}

html[data-bs-theme='dark'] .placeholder {
    background-color: rgba(148, 163, 184, 0.24);
}

html[data-bs-theme='dark'] .swal2-popup {
    background: #0f172a;
    color: var(--text);
}

html[data-bs-theme='dark'] .swal2-title,
html[data-bs-theme='dark'] .swal2-html-container {
    color: var(--text);
}

html[data-bs-theme='dark'] .sidebar-offcanvas {
    background: #050816;
    color: var(--text);
}

html[data-bs-theme='dark'] .sidebar-offcanvas .offcanvas-header {
    border-bottom-color: rgba(148, 163, 184, 0.12);
}

html[data-bs-theme='dark'] .theme-toggle--floating {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(148, 163, 184, 0.18);
}

@media (max-width: 1399.98px) {
    .widget-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

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

    .auth-grid__form {
        padding: 0;
    }
}

@media (max-width: 991.98px) {
    .content-wrap {
        padding: 18px 16px 24px;
    }

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

    .topbar {
        padding: 16px;
    }
}

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

    .crud-modal .modal-dialog {
        margin: 0.5rem;
    }

    .crud-modal .modal-content {
        max-height: calc(100vh - 1rem);
    }

    .crud-modal .modal-header,
    .crud-modal .modal-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .crud-modal .modal-body {
        padding: 1rem;
    }

    .page-toolbar {
        align-items: start;
    }

    .topbar__actions {
        width: 100%;
        justify-content: space-between;
    }

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

    .auth-shell {
        padding: 12px;
    }

    .profile-hero__card,
    .profile-upload {
        flex-direction: column;
        align-items: flex-start;
    }

    .profile-photo-preview--square {
        height: 180px;
    }
}
