html[data-theme="light"] {
    color-scheme: light;
}

html[data-theme="dark"] {
    color-scheme: dark;
}

.topbar,
.topbar .top-navbar,
.topbar .navbar-header,
.topbar .navbar-collapse {
    background: #1e4db7 !important;
}

.topbar .nav-link,
.topbar .navbar-brand,
.topbar .logo-text {
    color: #ffffff !important;
}

.topbar .navbar-header {
    padding: 0 20px;
}

.topbar .navbar-brand,
.topbar .nav-link {
    display: flex;
    align-items: center;
}

.topbar .navbar-brand {
    gap: 8px;
    width: 100%;
    justify-content: flex-start;
    padding-left: 28px;
}

.app-brand-icon {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 30px;
    overflow: hidden;
    border-radius: 9px;
}

.app-brand-icon img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.app-logo-setting {
    display: flex;
    align-items: center;
    gap: 14px;
}

.app-logo-preview {
    width: 46px;
    height: 46px;
    padding: 8px;
    border: 1px solid #edf1f7;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 46px;
    background: #1e4db7;
}

.app-logo-preview img {
    width: 30px;
    height: 30px;
    display: block;
    border-radius: 9px;
    object-fit: cover;
}

.app-logo-cropper {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid #edf1f7;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 18px;
    background: #f8fbff;
}

.app-logo-cropper-stage {
    position: relative;
    width: 220px;
    height: 220px;
    flex: 0 0 220px;
    overflow: hidden;
    border: 2px solid #1e4db7;
    border-radius: 18px;
    background: #ddebff;
    cursor: grab;
    touch-action: none;
}

.app-logo-cropper-stage.is-dragging {
    cursor: grabbing;
}

.app-logo-cropper-stage::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: inset 0 0 0 999px rgba(30, 77, 183, 0.08);
    pointer-events: none;
}

.app-logo-cropper-stage img {
    position: absolute;
    top: 0;
    left: 0;
    max-width: none;
    user-select: none;
    pointer-events: none;
    transform-origin: top left;
}

.app-logo-cropper-tools {
    width: 100%;
    max-width: 280px;
}

.topbar .topbar-action {
    width: auto;
    height: 32px !important;
    min-height: 32px !important;
    line-height: 32px !important;
    margin: 0 2px !important;
    padding: 0 8px !important;
    border: 1px solid transparent;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.topbar .navbar-nav .nav-item {
    display: flex;
    align-items: center;
}

.topbar .topbar-action .fs-5 {
    font-size: 1.1rem !important;
    line-height: 1;
}

.topbar .topbar-action:hover,
.topbar .topbar-action:focus {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.24);
    box-shadow: none;
}

.topbar-user-icon,
.topbar-chevron-icon {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.topbar-user-icon svg,
.topbar-chevron-icon svg {
    width: 20px;
    height: 20px;
    display: block;
}

.topbar-chevron-icon {
    width: 16px;
    height: 16px;
}

.topbar-chevron-icon svg {
    width: 16px;
    height: 16px;
}

.topbar .user-menu-toggle::after {
    display: none;
}

.mobile-user-menu {
    display: none;
}

#main-wrapper[data-layout="vertical"] .left-sidebar {
    overflow: hidden;
}

#main-wrapper[data-layout="vertical"] .left-sidebar .scroll-sidebar {
    padding-top: 12px;
    height: calc(100vh - 70px) !important;
    max-height: calc(100vh - 70px);
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

#main-wrapper[data-layout="vertical"] .left-sidebar .sidebar-nav {
    height: auto;
    min-height: 0;
}

:root {
    --app-header-height: 70px;
}

html:has(#main-wrapper),
html:has(#main-wrapper) body {
    height: 100%;
    overflow: hidden;
}

body {
    overflow-x: hidden;
}

.app-loader {
    position: fixed;
    inset: 0;
    z-index: 20000;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: wait;
    pointer-events: auto;
}

.app-loader.d-none {
    display: none !important;
    pointer-events: none !important;
}

.app-loader-card {
    min-width: 190px;
    padding: 18px 22px;
    border: 1px solid #edf1f7;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 16px 35px rgba(17, 20, 45, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #11142d;
    font-weight: 600;
}

.appointment-icon-btn {
    width: 32px;
    height: 32px;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.appointment-icon-btn svg {
    width: 18px;
    height: 18px;
    display: block;
}

.filepond--root {
    font-family: inherit;
    margin-bottom: 0.5rem;
}

.filepond--panel-root {
    background-color: #f8fafc;
    border: 1px dashed #cfd7e6;
}

.select2-container--default .select2-selection--single {
    height: 38px;
    border: 1px solid #e9ecef;
    border-radius: 4px;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 36px;
    color: #3e5569;
    padding-left: 12px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px;
    right: 6px;
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: #5f76e8;
    box-shadow: 0 0 0 0.2rem rgba(95, 118, 232, 0.12);
}

.select2-dropdown {
    border-color: #e9ecef;
    box-shadow: 0 10px 24px rgba(17, 20, 45, 0.12);
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid #dfe5ef;
    border-radius: 4px;
    outline: none;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #5f76e8;
}

.is-invalid + .select2-container--default .select2-selection--single {
    border-color: #fa5838;
}

#main-wrapper[data-layout="vertical"] .page-wrapper {
    display: flex !important;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    overscroll-behavior: contain;
}

.page-wrapper {
    display: block !important;
}

.app-content {
    width: 100%;
    max-width: 100%;
}

#main-wrapper[data-layout="vertical"] .page-wrapper .app-page-header {
    flex: 0 0 auto;
}

#main-wrapper[data-layout="vertical"] .page-wrapper .app-content {
    flex: 1 1 auto;
    min-height: 0 !important;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.app-page-header {
    padding: 18px 24px 0;
}

.page-header-card {
    padding: 0 0 16px;
    border-bottom: 1px solid #edf1f7;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.page-eyebrow {
    display: inline-block;
    margin-bottom: 4px;
    color: #1e4db7;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.page-title {
    margin: 0;
    color: #11142d;
    font-size: 1.25rem;
    font-weight: 700;
}

.page-subtitle {
    max-width: 640px;
    margin: 5px 0 0;
    color: #6c757d;
    font-size: 0.88rem;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.sidebar-link {
    gap: 12px;
}

.sidebar-icon {
    width: 22px;
    min-width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: currentColor;
}

.sidebar-icon svg {
    width: 20px;
    height: 20px;
    display: block;
}

#main-wrapper .left-sidebar,
#main-wrapper .page-wrapper,
#main-wrapper .navbar-header {
    transition: all 0.2s ease;
}

#main-wrapper.mini-sidebar .left-sidebar {
    width: 70px;
}

#main-wrapper.mini-sidebar .page-wrapper {
    margin-left: 70px;
}

#main-wrapper.mini-sidebar .navbar-header {
    width: 70px;
    padding: 0;
    justify-content: center;
}

#main-wrapper.mini-sidebar .navbar-brand {
    justify-content: center;
    padding-left: 0;
}

#main-wrapper.mini-sidebar .logo-text,
#main-wrapper.mini-sidebar .hide-menu,
#main-wrapper.mini-sidebar .nav-small-cap {
    display: none !important;
}

#main-wrapper.mini-sidebar .sidebar-link {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

#main-wrapper.mini-sidebar .sidebar-icon {
    margin: 0 auto;
}

@media (min-width: 768px) {
    #main-wrapper[data-layout="vertical"][data-sidebartype="mini-sidebar"] .left-sidebar:hover {
        width: 70px !important;
    }

    #main-wrapper[data-layout="vertical"][data-sidebartype="mini-sidebar"] .left-sidebar:hover .scroll-sidebar {
        height: calc(100vh - 70px) !important;
        max-height: calc(100vh - 70px);
    }

    #main-wrapper[data-layout="vertical"][data-sidebartype="mini-sidebar"] .left-sidebar:hover .sidebar-nav .hide-menu,
    #main-wrapper[data-layout="vertical"][data-sidebartype="mini-sidebar"] .left-sidebar:hover .sidebar-nav .has-arrow:after,
    #main-wrapper[data-layout="vertical"][data-sidebartype="mini-sidebar"] .left-sidebar:hover .sidebar-nav .nav-small-cap,
    #main-wrapper[data-layout="vertical"][data-sidebartype="mini-sidebar"] .left-sidebar:hover .sidebar-footer {
        display: none !important;
    }

    #main-wrapper[data-layout="vertical"][data-sidebartype="mini-sidebar"] .left-sidebar:hover .sidebar-nav ul .sidebar-item .sidebar-link {
        justify-content: center !important;
        padding: 11px 0 !important;
    }

    #main-wrapper[data-layout="vertical"][data-sidebartype="mini-sidebar"] .left-sidebar:hover .sidebar-nav ul .sidebar-item .sidebar-link .feather,
    #main-wrapper[data-layout="vertical"][data-sidebartype="mini-sidebar"] .left-sidebar:hover .sidebar-nav ul .sidebar-item .sidebar-link i,
    #main-wrapper[data-layout="vertical"][data-sidebartype="mini-sidebar"] .left-sidebar:hover .sidebar-nav ul .sidebar-item .sidebar-link .sidebar-icon {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

.sidebar-backdrop {
    display: none;
}

.profile-summary-card {
    position: sticky;
    top: 16px;
}

.profile-avatar {
    width: 72px;
    height: 72px;
    margin-bottom: 18px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ddebff;
    color: #1e4db7;
    font-size: 1.7rem;
    font-weight: 700;
}

.profile-meta {
    display: grid;
    gap: 14px;
}

.profile-meta > div {
    padding-top: 14px;
    border-top: 1px solid #edf1f7;
}

.profile-meta-label {
    display: block;
    margin-bottom: 3px;
    color: #6c757d;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.profile-section-header {
    padding-bottom: 16px;
    border-bottom: 1px solid #edf1f7;
}

.profile-danger-card {
    background: #fffafa;
}

.patient-summary-card {
    position: sticky;
    top: 16px;
}

.patient-avatar {
    width: 72px;
    height: 72px;
    margin-bottom: 16px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ddebff;
    color: #1e4db7;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.patient-quick-line {
    color: #6c757d;
    font-size: 0.95rem;
    margin-bottom: 0;
}

.patient-contact-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.patient-contact-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.patient-contact-icon {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f4f8ff;
    color: #1e4db7;
    font-size: 1rem;
}

.patient-contact-label {
    display: block;
    color: #6c757d;
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.patient-contact-value {
    color: #2a3547;
    font-weight: 500;
    word-break: break-word;
}

.patient-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6c757d;
    margin-bottom: 14px;
}

.patient-activity-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0;
}

.patient-activity-list > li + li {
    border-top: 1px solid #edf1f7;
}

.patient-activity-item {
    display: block;
    padding: 14px 0;
    color: inherit;
    text-decoration: none;
}

.patient-activity-item:hover {
    color: #1e4db7;
}

.patient-activity-item strong {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}

.patient-activity-meta {
    color: #6c757d;
    font-size: 0.88rem;
}

.patient-empty-note {
    color: #6c757d;
    font-size: 0.92rem;
    margin: 0;
    padding: 8px 0 4px;
}

.patient-show .patient-activity-row {
    margin-top: 12px;
}

.patient-activity-card .card-body {
    padding: 18px;
}

.patient-activity-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.patient-activity-badge {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eef4ff;
    color: #1e4db7;
    font-size: 0.72rem;
    font-weight: 600;
}

.patient-activity-more {
    margin: 8px 0 0;
    padding-top: 10px;
    border-top: 1px dashed #dfe6f2;
    color: #6c757d;
    font-size: 0.82rem;
}

.patient-summary-main {
    min-width: 0;
}

.patient-activity-item {
    min-height: 48px;
    -webkit-tap-highlight-color: transparent;
}

.patient-activity-item strong {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    line-height: 1.35;
}

.patient-activity-meta .badge {
    vertical-align: middle;
}

@media (min-width: 576px) {
    .patient-show .patient-activity-row > [class*="col-"] {
        display: flex;
    }

    .patient-show .patient-activity-row .patient-activity-card {
        width: 100%;
    }
}

@media (max-width: 767.98px) {
    .patient-show .patient-activity-row {
        --bs-gutter-x: 0.5rem;
    }

    .patient-show .patient-activity-head {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .patient-show .patient-activity-head .btn {
        width: 100%;
    }

    .patient-show .patient-section-title {
        font-size: 0.7rem;
        letter-spacing: 0.03em;
    }

    .patient-show .patient-activity-badge {
        font-size: 0.68rem;
    }

    .patient-show .patient-activity-meta {
        font-size: 0.78rem;
        line-height: 1.35;
    }

    .patient-show .patient-activity-item strong {
        font-size: 0.88rem;
        -webkit-line-clamp: 3;
    }

    .patient-show .patient-empty-note,
    .patient-show .patient-activity-more {
        font-size: 0.8rem;
    }

    .patient-show .patient-summary-card .card-body {
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 16px;
    }

    .patient-show .patient-avatar {
        width: 56px;
        height: 56px;
        margin-bottom: 0;
        flex: 0 0 56px;
        font-size: 1.2rem;
        border-radius: 14px;
    }

    .patient-show .patient-summary-main .card-title {
        font-size: 1.05rem;
        line-height: 1.3;
    }

    .patient-show .patient-quick-line {
        font-size: 0.88rem;
    }

    .patient-show .patient-contact-list {
        gap: 14px;
    }

    .patient-show .patient-contact-icon {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }

    .patient-show .patient-activity-card .card-body {
        padding: 16px;
    }

    .patient-show .patient-activity-item {
        padding: 12px 2px;
    }

    .patient-show .patient-activity-head .btn {
        min-height: 36px;
    }
}

body[data-theme="dark"] .patient-contact-icon {
    background: rgba(30, 77, 183, 0.2);
    color: #b8ccff;
}

body[data-theme="dark"] .patient-contact-value {
    color: #e6e5e8;
}

body[data-theme="dark"] .patient-activity-list > li + li {
    border-top-color: #3c414c;
}

body[data-theme="dark"] .patient-quick-line,
body[data-theme="dark"] .patient-activity-meta,
body[data-theme="dark"] .patient-empty-note,
body[data-theme="dark"] .patient-section-title,
body[data-theme="dark"] .patient-contact-label {
    color: #a8adb8;
}

body[data-theme="dark"] .patient-avatar {
    background: rgba(30, 77, 183, 0.35);
    color: #b8ccff;
}

body[data-theme="dark"] .patient-activity-badge {
    background: rgba(30, 77, 183, 0.25);
    color: #b8ccff;
}

body[data-theme="dark"] .patient-activity-more {
    border-top-color: #4a5160;
    color: #a8adb8;
}

@media (max-width: 991.98px) {
    .patient-summary-card {
        position: static;
    }
}

@media (max-width: 767.98px) {
    :root {
        --app-header-height: 64px;
    }

    .topbar {
        position: fixed;
        inset: 0 0 auto 0;
        height: 64px;
        overflow: visible;
        z-index: 1035;
    }

    .topbar .top-navbar {
        display: flex;
        position: relative;
        align-items: center;
        width: 100%;
        height: 64px;
        min-height: 64px;
        padding: 0;
        flex-wrap: nowrap;
        overflow: visible;
    }

    .topbar .navbar-header {
        display: grid !important;
        grid-template-columns: 42px minmax(0, 1fr) 42px;
        column-gap: 14px;
        align-items: center;
        width: 100% !important;
        min-width: 0;
        max-width: none;
        height: 64px;
        padding: 0 12px;
        flex: 1 1 100%;
        border-right: 0 !important;
        justify-content: initial;
    }

    .topbar .nav-toggler {
        grid-column: 1;
    }

    .topbar .navbar-brand {
        min-width: 0;
        width: auto !important;
        grid-column: 2;
        justify-self: start;
        justify-content: flex-start !important;
        padding: 0 !important;
        margin-right: 0;
        margin-left: 0 !important;
    }

    .topbar .logo-text {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .topbar .navbar-collapse {
        display: none !important;
    }

    .mobile-user-menu {
        grid-column: 3;
        align-self: center;
        justify-self: end;
        z-index: 2;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-user-toggle {
        width: 42px !important;
        min-width: 42px !important;
        height: 42px !important;
        padding: 0 !important;
        margin: 0 !important;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        line-height: 1 !important;
    }

    .mobile-user-menu .dropdown-menu {
        min-width: 180px;
        margin-top: 6px !important;
        padding: 6px 0;
        border: 0;
        border-radius: 10px;
        box-shadow: 0 12px 24px rgba(17, 20, 45, 0.16);
    }

    .mobile-user-menu .dropdown-item,
    .mobile-user-menu .dropdown-item-text {
        min-height: auto;
        padding: 9px 16px;
        color: #67757c;
        font-size: 0.92rem;
        line-height: 1.3;
    }

    .mobile-user-menu .dropdown-divider {
        margin: 4px 0;
    }

    .topbar-user-icon {
        flex: 0 0 auto;
    }

    #main-wrapper .left-sidebar {
        position: fixed;
        top: 64px;
        left: 0;
        width: 260px;
        height: calc(100vh - 64px);
        z-index: 1030;
        transform: translateX(-100%);
        box-shadow: 0 14px 28px rgba(17, 20, 45, 0.18);
        transition: transform 0.2s ease;
        overflow: hidden;
    }

    #main-wrapper .left-sidebar .scroll-sidebar {
        height: 100% !important;
        max-height: 100%;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    #main-wrapper.show-sidebar .left-sidebar {
        transform: translateX(0);
    }

    #main-wrapper.mini-sidebar .left-sidebar {
        width: 260px;
    }

    #main-wrapper .page-wrapper {
        margin-left: 0 !important;
        padding-top: 64px;
        width: 100%;
        min-width: 0;
    }

    #main-wrapper.mini-sidebar .page-wrapper {
        margin-left: 0 !important;
    }

    #main-wrapper.mini-sidebar .logo-text,
    #main-wrapper.mini-sidebar .hide-menu {
        display: inline !important;
    }

    #main-wrapper.mini-sidebar .nav-small-cap {
        display: block !important;
    }

    .app-logo-setting,
    .app-logo-cropper {
        align-items: flex-start;
        flex-direction: column;
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 64px 0 0;
        z-index: 1025;
        display: block;
        pointer-events: none;
        background: rgba(17, 20, 45, 0);
        transition: background-color 0.2s ease;
    }

    #main-wrapper.show-sidebar .sidebar-backdrop {
        pointer-events: auto;
        background: rgba(17, 20, 45, 0.42);
    }

    .app-page-header {
        padding: 18px 16px 0;
    }

    .page-header-card {
        align-items: flex-start;
        flex-direction: column;
        padding-bottom: 14px;
    }

    .page-actions {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

    .page-actions .btn {
        width: 100%;
    }

    .app-content {
        padding: 16px;
    }

    .card-body {
        padding: 18px;
    }

    .profile-summary-card {
        position: static;
    }

    .profile-avatar {
        width: 58px;
        height: 58px;
        border-radius: 14px;
        font-size: 1.35rem;
    }

    .profile-form-actions {
        align-items: stretch !important;
        flex-direction: column;
    }
}

@media (max-width: 575.98px) {
    .page-title {
        font-size: 1.1rem;
    }

    .page-subtitle {
        font-size: 0.82rem;
    }

    .app-content {
        padding: 14px 12px;
    }

    .card-body {
        padding: 16px 14px;
    }
}

.theme-toggle-btn {
    border: 0;
    background: transparent;
    cursor: pointer;
}

.theme-icon-moon svg,
.theme-icon-sun svg {
    width: 20px;
    height: 20px;
    display: block;
}

.auth-theme-toggle {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 10;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid rgba(30, 77, 183, 0.18);
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #1e4db7;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 20px rgba(17, 20, 45, 0.08);
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.auth-theme-toggle:hover,
.auth-theme-toggle:focus {
    color: #163a8f;
    border-color: rgba(30, 77, 183, 0.32);
    background: #ffffff;
}

body[data-theme="dark"] .auth-wrapper {
    background: linear-gradient(135deg, #151c29, #282c34) !important;
}

body[data-theme="dark"] .auth-theme-toggle {
    color: #e6e5e8;
    border-color: rgba(230, 229, 232, 0.16);
    background: rgba(40, 44, 52, 0.92);
}

body[data-theme="dark"] .auth-theme-toggle:hover,
body[data-theme="dark"] .auth-theme-toggle:focus {
    color: #ffffff;
    border-color: rgba(230, 229, 232, 0.28);
    background: #323844;
}

body[data-theme="dark"] .app-loader {
    background: rgba(21, 28, 41, 0.78);
}

body[data-theme="dark"] .app-loader-card {
    color: #e6e5e8;
    border-color: #3c414c;
    background: #323844;
    box-shadow: 0 16px 35px rgba(0, 0, 0, 0.28);
}

body[data-theme="dark"] .page-header-card {
    border-bottom-color: #3c414c;
}

body[data-theme="dark"] .page-eyebrow {
    color: #8eb4ff;
}

body[data-theme="dark"] .page-title {
    color: #ecf0f2;
}

body[data-theme="dark"] .page-subtitle,
body[data-theme="dark"] .profile-meta-label {
    color: #a8adb8;
}

body[data-theme="dark"] .profile-meta > div {
    border-top-color: #3c414c;
}

body[data-theme="dark"] .profile-avatar {
    background: rgba(30, 77, 183, 0.35);
    color: #b8ccff;
}

body[data-theme="dark"] .app-logo-preview,
body[data-theme="dark"] .app-logo-cropper {
    border-color: #3c414c;
    background: #323844;
}

body[data-theme="dark"] .app-logo-cropper-stage {
    background: #252a33;
    border-color: #5f76e8;
}

body[data-theme="dark"] .select2-container--default .select2-selection--single {
    background-color: #3c414c;
    border-color: #4a5160;
}

body[data-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #e6e5e8;
}

body[data-theme="dark"] .select2-dropdown {
    background-color: #323844;
    border-color: #4a5160;
}

body[data-theme="dark"] .select2-container--default .select2-search--dropdown .select2-search__field {
    background-color: #3c414c;
    border-color: #4a5160;
    color: #e6e5e8;
}

body[data-theme="dark"] .select2-container--default .select2-results__option {
    color: #e6e5e8;
}

body[data-theme="dark"] .filepond--panel-root {
    background-color: #323844;
    border-color: #4a5160;
}

/* Sidebar (skin6 fuerza fondo claro; hay que sobreescribirlo en dark) */
body[data-theme="dark"] #main-wrapper[data-layout="vertical"] .left-sidebar[data-sidebarbg="skin6"],
body[data-theme="dark"] #main-wrapper[data-layout="vertical"] .left-sidebar[data-sidebarbg="skin6"] .sidebar-nav ul {
    background: #1f2430 !important;
}

body[data-theme="dark"] #main-wrapper[data-layout="vertical"] .left-sidebar[data-sidebarbg="skin6"] {
    border-right: 1px solid #3c414c;
    box-shadow: none;
}

body[data-theme="dark"] #main-wrapper[data-layout="vertical"] .left-sidebar[data-sidebarbg="skin6"] .sidebar-nav ul .nav-small-cap {
    color: #8b93a3 !important;
    opacity: 1;
}

body[data-theme="dark"] #main-wrapper[data-layout="vertical"] .left-sidebar[data-sidebarbg="skin6"] .sidebar-nav ul .nav-small-cap .nav-small-line {
    background-color: #4a5160 !important;
}

body[data-theme="dark"] #main-wrapper[data-layout="vertical"] .left-sidebar[data-sidebarbg="skin6"] .sidebar-nav ul .sidebar-item .sidebar-link {
    color: #c5cad3 !important;
    opacity: 1;
}

body[data-theme="dark"] #main-wrapper[data-layout="vertical"] .left-sidebar[data-sidebarbg="skin6"] .sidebar-nav ul .sidebar-item .sidebar-link .sidebar-icon,
body[data-theme="dark"] #main-wrapper[data-layout="vertical"] .left-sidebar[data-sidebarbg="skin6"] .sidebar-nav ul .sidebar-item .sidebar-link i,
body[data-theme="dark"] #main-wrapper[data-layout="vertical"] .left-sidebar[data-sidebarbg="skin6"] .sidebar-nav ul .sidebar-item .sidebar-link .feather {
    color: #9aa3b2 !important;
}

body[data-theme="dark"] #main-wrapper[data-layout="vertical"] .left-sidebar[data-sidebarbg="skin6"] .sidebar-nav ul .sidebar-item .sidebar-link:hover {
    color: #ecf0f2 !important;
    background-color: rgba(255, 255, 255, 0.06) !important;
}

body[data-theme="dark"] #main-wrapper[data-layout="vertical"] .left-sidebar[data-sidebarbg="skin6"] .sidebar-nav ul .sidebar-item .sidebar-link:hover .sidebar-icon,
body[data-theme="dark"] #main-wrapper[data-layout="vertical"] .left-sidebar[data-sidebarbg="skin6"] .sidebar-nav ul .sidebar-item .sidebar-link:hover i,
body[data-theme="dark"] #main-wrapper[data-layout="vertical"] .left-sidebar[data-sidebarbg="skin6"] .sidebar-nav ul .sidebar-item .sidebar-link:hover .feather {
    color: #ecf0f2 !important;
}

body[data-theme="dark"] #main-wrapper[data-layout="vertical"] .left-sidebar[data-sidebarbg="skin6"] .sidebar-nav ul .sidebar-item .sidebar-link.active,
body[data-theme="dark"] #main-wrapper[data-layout="vertical"] .left-sidebar[data-sidebarbg="skin6"] .sidebar-nav > ul > .sidebar-item > .sidebar-link.active,
body[data-theme="dark"] #main-wrapper[data-layout="vertical"] .left-sidebar[data-sidebarbg="skin6"] .sidebar-nav ul .sidebar-item.selected > .sidebar-link {
    color: #ffffff !important;
    background-color: #1e4db7 !important;
    opacity: 1;
}

body[data-theme="dark"] #main-wrapper[data-layout="vertical"] .left-sidebar[data-sidebarbg="skin6"] .sidebar-nav ul .sidebar-item .sidebar-link.active .sidebar-icon,
body[data-theme="dark"] #main-wrapper[data-layout="vertical"] .left-sidebar[data-sidebarbg="skin6"] .sidebar-nav ul .sidebar-item .sidebar-link.active i,
body[data-theme="dark"] #main-wrapper[data-layout="vertical"] .left-sidebar[data-sidebarbg="skin6"] .sidebar-nav ul .sidebar-item .sidebar-link.active .feather,
body[data-theme="dark"] #main-wrapper[data-layout="vertical"] .left-sidebar[data-sidebarbg="skin6"] .sidebar-nav > ul > .sidebar-item > .sidebar-link.active i {
    color: #ffffff !important;
}

body[data-theme="dark"] #main-wrapper[data-layout="vertical"] .left-sidebar[data-sidebarbg="skin6"] .sidebar-nav #sidebarnav > .sidebar-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

@media (max-width: 767.98px) {
    body[data-theme="dark"] #main-wrapper .left-sidebar {
        box-shadow: 0 14px 28px rgba(0, 0, 0, 0.45);
    }

    body[data-theme="dark"] #main-wrapper.show-sidebar .sidebar-backdrop {
        background: rgba(0, 0, 0, 0.55);
    }
}

/* Index tables: cards on mobile, table on desktop */
.index-table-wrap {
    overflow: visible;
}

.index-data-table thead th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6c757d;
    white-space: nowrap;
}

.index-pagination {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding-top: 4px;
}

.index-pagination-summary strong {
    color: #2a3547;
    font-weight: 600;
}

.index-pagination-nav .pagination,
.index-pagination-links .pagination {
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    margin-bottom: 0;
}

.index-pagination-nav {
    width: 100%;
}

.index-pagination-links .page-link {
    min-width: 2.25rem;
    text-align: center;
}

@media (min-width: 576px) {
    .index-pagination {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
    }

    .index-pagination-nav .pagination,
    .index-pagination-links .pagination {
        justify-content: flex-end;
    }
}

@media (max-width: 767.98px) {
    .index-table-wrap {
        margin-left: -4px;
        margin-right: -4px;
    }

    .index-data-table {
        border-collapse: separate;
        border-spacing: 0 10px;
    }

    .index-data-table thead {
        display: none;
    }

    .index-data-table tbody,
    .index-data-table tr,
    .index-data-table td {
        display: block;
        width: 100%;
    }

    .index-data-table tr {
        padding: 14px 16px;
        border: 1px solid #edf1f7;
        border-radius: 14px;
        background: #fff;
        box-shadow: 0 1px 2px rgba(42, 53, 71, 0.04);
    }

    .index-data-table tr:empty,
    .index-data-table tr td:only-child[colspan] {
        padding: 24px 16px;
        text-align: center;
        box-shadow: none;
    }

    .index-data-table td {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        padding: 8px 0;
        border: 0;
        text-align: right;
    }

    .index-data-table tbody tr > td:first-child {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding-top: 0;
        padding-bottom: 10px;
        margin-bottom: 2px;
        text-align: left;
        font-size: 1rem;
        font-weight: 600;
        line-height: 1.35;
        border-bottom: 1px solid #edf1f7;
    }

    .index-data-table tbody tr > td:first-child::before {
        display: none;
    }

    .index-data-table tbody tr > td:first-child a {
        font-weight: inherit;
        color: inherit;
    }

    .index-data-table td::before {
        content: attr(data-label);
        flex: 0 0 38%;
        max-width: 42%;
        font-size: 0.72rem;
        font-weight: 600;
        letter-spacing: 0.03em;
        text-transform: uppercase;
        color: #6c757d;
        text-align: left;
        line-height: 1.35;
    }

    .index-data-table td.index-table-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding-top: 12px;
        margin-top: 4px;
        border-top: 1px solid #edf1f7;
    }

    .index-data-table td.index-table-actions::before {
        content: attr(data-label);
        max-width: none;
        flex: none;
        margin-bottom: 2px;
    }

    .index-data-table td.index-table-actions > .d-flex {
        justify-content: stretch !important;
    }

    .index-data-table td.index-table-actions .btn {
        flex: 1 1 auto;
        min-height: 38px;
    }

    .index-data-table td[colspan] {
        display: block;
        text-align: center;
    }

    .index-data-table td[colspan]::before {
        display: none;
    }

    .index-pagination-nav .page-item .page-link,
    .index-pagination-links .page-item .page-link {
        padding: 0.4rem 0.65rem;
        font-size: 0.875rem;
    }
}

body[data-theme="dark"] .index-pagination-summary,
body[data-theme="dark"] .index-pagination-summary strong {
    color: #e6e5e8;
}

body[data-theme="dark"] .index-pagination-summary {
    color: #a8adb8 !important;
}

@media (max-width: 767.98px) {
    body[data-theme="dark"] .index-data-table tr {
        background: #2a3042;
        border-color: #3c414c;
        box-shadow: none;
    }

    body[data-theme="dark"] .index-data-table td.index-table-actions {
        border-top-color: #3c414c;
    }

    body[data-theme="dark"] .index-data-table td::before {
        color: #a8adb8;
    }

    body[data-theme="dark"] .index-data-table tbody tr > td:first-child {
        border-bottom-color: #3c414c;
        color: #e6e5e8;
    }
}
