/* Dashboard Design System — Figma Community DS tokens & components */

:root {
    --ds-primary: #6941C6;
    --ds-primary-hover: #53389E;
    --ds-primary-light: #F4EBFF;
    --ds-secondary: #475467;
    --ds-success: #12B76A;
    --ds-success-light: #ECFDF3;
    --ds-warning: #F79009;
    --ds-warning-light: #FFFAEB;
    --ds-danger: #F04438;
    --ds-danger-light: #FEF3F2;
    --ds-info: #2E90FA;
    --ds-info-light: #EFF8FF;
    --ds-bg: #F9FAFB;
    --ds-surface: #FFFFFF;
    --ds-border: #EAECF0;
    --ds-border-light: #F2F4F7;
    --ds-text: #101828;
    --ds-text-secondary: #667085;
    --ds-text-muted: #98A2B3;
    --ds-sidebar-width: 184px;
    --ds-radius-sm: 6px;
    --ds-radius: 8px;
    --ds-radius-lg: 12px;
    --ds-radius-xl: 16px;
    --ds-shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
    --ds-shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.1), 0 1px 2px rgba(16, 24, 40, 0.06);
    --ds-shadow-md: 0 4px 8px -2px rgba(16, 24, 40, 0.1), 0 2px 4px -2px rgba(16, 24, 40, 0.06);
    --ds-shadow-lg: 0 12px 16px -4px rgba(16, 24, 40, 0.08), 0 4px 6px -2px rgba(16, 24, 40, 0.03);
    --ds-font: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --ds-transition: 0.2s ease;
}

body.ds-theme {
    font-family: var(--ds-font) !important;
    background-color: var(--ds-bg) !important;
    color: var(--ds-text);
}

/* ─── Layout ─── */
body.ds-theme .main-sidebar,
body.ds-theme .main-sidebar::before {
    width: var(--ds-sidebar-width);
    background: var(--ds-surface) !important;
    border-right: 1px solid var(--ds-border);
    box-shadow: none;
}

body.ds-theme.sidebar-mini .main-sidebar,
body.ds-theme.sidebar-mini .main-sidebar::before {
    width: var(--ds-sidebar-width);
}

@media (min-width: 992px) {
    body.ds-theme .content-wrapper,
    body.ds-theme .main-footer,
    body.ds-theme .main-header {
        margin-left: var(--ds-sidebar-width);
    }
}

body.ds-theme .content-wrapper {
    background: #FFFFFF;
    min-height: calc(100vh - 57px);
}

body.ds-theme .wrapper {
    background: #FFFFFF;
}

body.ds-theme .content-wrapper > .content {
    padding: 0 24px 28px;
}

/* ─── Sidebar ─── */
body.ds-theme .brand-link {
    border-bottom: 0 !important;
    min-height: 64px;
    padding: 18px 22px 10px !important;
    background: var(--ds-surface) !important;
    display: flex;
    align-items: center;
}

body.ds-theme .brand-link .brand-text {
    color: var(--ds-text) !important;
    font-weight: 600 !important;
    font-size: 0.84rem;
}

body.ds-theme .brand-link .brand-image {
    max-height: 24px;
    opacity: 1;
}

body.ds-theme .sidebar {
    height: calc(100vh - 126px);
    overflow-y: auto;
    padding: 10px 14px 12px;
}

body.ds-theme .nav-sidebar > .nav-item > .nav-link {
    border-radius: 9px;
    margin-bottom: 3px;
    padding: 8px 10px;
    color: #1F2937;
    font-size: 0.76rem;
    font-weight: 500;
    transition: background var(--ds-transition), color var(--ds-transition);
}

body.ds-theme .nav-sidebar > .nav-item > .nav-link:hover {
    background: #F7F7F8;
    color: var(--ds-text);
}

body.ds-theme .nav-sidebar > .nav-item > .nav-link.active {
    background: #F5F5F5 !important;
    color: #111827 !important;
    box-shadow: none;
}

body.ds-theme .nav-sidebar > .nav-item > .nav-link.active .nav-icon {
    color: #111827 !important;
}

body.ds-theme .nav-sidebar .nav-icon {
    color: #6B7280;
    font-size: 0.84rem;
    margin-right: 7px;
}

body.ds-theme .nav-header {
    color: #9CA3AF !important;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    padding: 14px 10px 8px;
}

body.ds-theme .nav-treeview > .nav-item > .nav-link {
    padding-left: 2.1rem !important;
    font-size: 0.73rem;
}

body.ds-theme .nav-sidebar .nav-link p {
    margin: 0;
}

body.ds-theme .nav-sidebar .right {
    top: 0.72rem;
}

body.ds-theme .ds-sidebar-brandmark {
    align-items: center;
    bottom: 18px;
    color: #60A5FA;
    display: flex;
    font-size: 0.78rem;
    font-weight: 600;
    gap: 5px;
    left: 24px;
    position: absolute;
}

body.ds-theme .badge-danger {
    background: var(--ds-primary-light) !important;
    color: var(--ds-primary) !important;
    font-weight: 600;
    font-size: 0.65rem;
    border-radius: 100px;
    padding: 2px 8px;
}

/* ─── Header ─── */
body.ds-theme .main-header {
    background: var(--ds-surface) !important;
    border-bottom: 1px solid #F3F4F6 !important;
    box-shadow: none;
    min-height: 64px;
    padding: 0 18px;
}

body.ds-theme .main-header .nav-link {
    color: #111827;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: var(--ds-radius);
    padding: 8px 12px;
}

body.ds-theme .ds-top-breadcrumb {
    align-items: center;
    color: #9CA3AF;
    font-size: 0.72rem;
    gap: 12px;
    margin-left: 8px;
}

body.ds-theme .ds-top-breadcrumb a,
body.ds-theme .ds-top-breadcrumb strong {
    color: #9CA3AF;
    font-weight: 500;
}

body.ds-theme .ds-top-breadcrumb strong {
    color: #111827;
}

body.ds-theme .main-header .nav-link:hover {
    color: var(--ds-text);
    background: var(--ds-border-light);
}

body.ds-theme .main-header .navbar-nav .dropdown-menu {
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    box-shadow: var(--ds-shadow-lg);
    padding: 6px;
    margin-top: 8px;
}

body.ds-theme .main-header .dropdown-item {
    border-radius: var(--ds-radius-sm);
    font-size: 0.875rem;
    padding: 8px 12px;
}

body.ds-theme .main-header .dropdown-item:hover {
    background: var(--ds-border-light);
}

body.ds-theme .main-header .brand-image {
    width: 32px;
    height: 32px;
    object-fit: cover;
}

/* ─── Page header / Breadcrumb ─── */
body.ds-theme .content-header,
body.ds-theme .ds-page-header {
    background: transparent;
    padding: 20px 0 14px;
    border: none;
}

body.ds-theme .ds-page-header__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

body.ds-theme .ds-page-header__title h1,
body.ds-theme .content-header h1 {
    color: var(--ds-text);
    font-size: 0.86rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}

body.ds-theme .ds-page-header__subtitle {
    color: var(--ds-text-secondary);
    font-size: 0.875rem;
    margin: 4px 0 0;
}

body.ds-theme .ds-page-header__action {
    color: #111827;
    font-size: 0.72rem;
    font-weight: 500;
    padding-top: 2px;
}

body.ds-theme .breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
    font-size: 0.8125rem;
}

body.ds-theme .breadcrumb-item,
body.ds-theme .breadcrumb-item a {
    color: var(--ds-text-secondary);
}

body.ds-theme .breadcrumb-item.active {
    color: var(--ds-text);
    font-weight: 500;
}

body.ds-theme .breadcrumb-item + .breadcrumb-item::before {
    color: var(--ds-text-muted);
}

/* ─── Stat cards ─── */
.ds-stat-card {
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    box-shadow: var(--ds-shadow-xs);
    overflow: hidden;
    height: 100%;
    transition: box-shadow var(--ds-transition), transform var(--ds-transition);
}

.ds-stat-card:hover {
    box-shadow: var(--ds-shadow-md);
    transform: translateY(-1px);
}

.ds-stat-card__body {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 20px 16px;
}

.ds-stat-card__icon {
    width: 48px;
    height: 48px;
    border-radius: var(--ds-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.25rem;
}

.ds-stat-card--primary .ds-stat-card__icon { background: var(--ds-primary-light); color: var(--ds-primary); }
.ds-stat-card--success .ds-stat-card__icon { background: var(--ds-success-light); color: var(--ds-success); }
.ds-stat-card--warning .ds-stat-card__icon { background: var(--ds-warning-light); color: var(--ds-warning); }
.ds-stat-card--danger .ds-stat-card__icon { background: var(--ds-danger-light); color: var(--ds-danger); }
.ds-stat-card--info .ds-stat-card__icon { background: var(--ds-info-light); color: var(--ds-info); }

.ds-stat-card__value {
    display: block;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--ds-text);
    line-height: 1.2;
}

.ds-stat-card__label {
    display: block;
    font-size: 0.875rem;
    color: var(--ds-text-secondary);
    margin-top: 4px;
}

.ds-stat-card__subtitle {
    display: block;
    font-size: 0.75rem;
    color: var(--ds-text-muted);
    margin-top: 2px;
}

.ds-stat-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-top: 1px solid var(--ds-border-light);
    color: var(--ds-primary);
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    transition: background var(--ds-transition);
}

.ds-stat-card__footer:hover {
    background: var(--ds-primary-light);
    color: var(--ds-primary-hover);
    text-decoration: none;
}

/* ─── Cards ─── */
body.ds-theme .card,
body.ds-theme .ds-card {
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    box-shadow: var(--ds-shadow-xs);
}

body.ds-theme .card-header,
body.ds-theme .ds-card__header {
    background: var(--ds-surface);
    border-bottom: 1px solid var(--ds-border-light);
    padding: 16px 20px;
}

body.ds-theme .card-header .card-title,
body.ds-theme .ds-card__title {
    color: var(--ds-text);
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

body.ds-theme .card-body {
    padding: 20px;
}

body.ds-theme .card-footer {
    background: var(--ds-surface);
    border-top: 1px solid var(--ds-border-light);
}

body.ds-theme .card-header.no-border {
    border-bottom: 1px solid var(--ds-border-light);
}

/* ─── Buttons ─── */
body.ds-theme .btn {
    border-radius: var(--ds-radius);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 8px 16px;
    transition: all var(--ds-transition);
    border-width: 1px;
}

body.ds-theme .btn-primary,
body.ds-theme .btn-info {
    background: var(--ds-primary) !important;
    border-color: var(--ds-primary) !important;
    color: #fff !important;
}

body.ds-theme .btn-primary:hover,
body.ds-theme .btn-info:hover {
    background: var(--ds-primary-hover) !important;
    border-color: var(--ds-primary-hover) !important;
}

body.ds-theme .btn-success {
    background: var(--ds-success) !important;
    border-color: var(--ds-success) !important;
}

body.ds-theme .btn-danger {
    background: var(--ds-danger) !important;
    border-color: var(--ds-danger) !important;
}

body.ds-theme .btn-warning {
    background: var(--ds-warning) !important;
    border-color: var(--ds-warning) !important;
    color: #fff !important;
}

body.ds-theme .btn-default,
body.ds-theme .btn-secondary {
    background: var(--ds-surface) !important;
    border-color: var(--ds-border) !important;
    color: var(--ds-text) !important;
}

body.ds-theme .btn-default:hover,
body.ds-theme .btn-secondary:hover {
    background: var(--ds-border-light) !important;
}

body.ds-theme .btn-outline-primary {
    color: var(--ds-primary);
    border-color: var(--ds-primary);
}

body.ds-theme .btn-outline-primary:hover {
    background: var(--ds-primary-light);
    color: var(--ds-primary-hover);
}

body.ds-theme .btn-sm {
    padding: 6px 12px;
    font-size: 0.8125rem;
}

body.ds-theme .btn-lg {
    padding: 10px 20px;
    font-size: 1rem;
}

/* ─── Tables ─── */
body.ds-theme .table {
    color: var(--ds-text);
    font-size: 0.875rem;
}

body.ds-theme .table thead th {
    background: var(--ds-bg);
    color: var(--ds-text-secondary);
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--ds-border);
    border-top: none;
    padding: 12px 16px;
}

body.ds-theme .table td {
    padding: 14px 16px;
    border-top: 1px solid var(--ds-border-light);
    vertical-align: middle;
}

body.ds-theme .table-striped tbody tr:nth-of-type(odd) {
    background: var(--ds-bg);
}

body.ds-theme .table-striped tbody tr:hover {
    background: var(--ds-primary-light);
}

body.ds-theme .table-valign-middle td {
    vertical-align: middle;
}

body.ds-theme table.dataTable {
    border-collapse: separate !important;
    border-spacing: 0;
}

body.ds-theme .dataTables_wrapper .dataTables_filter input {
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius);
    padding: 8px 12px;
}

/* SnowUI inner CRUD pages */
body.ds-theme .content:not(.ds-overview-page) > .card.ds-card {
    border-radius: 12px;
    overflow: hidden;
}

body.ds-theme .content:not(.ds-overview-page) > .card.ds-card > .card-header {
    background: var(--ds-surface);
    border-bottom: 1px solid var(--ds-border-light);
    padding: 0;
}

body.ds-theme .content:not(.ds-overview-page) > .card.ds-card > .card-body {
    padding: 18px;
}

body.ds-theme .content:not(.ds-overview-page) .card-header-tabs {
    align-items: center !important;
    border-bottom: 0;
    gap: 6px;
    min-height: 62px;
    padding: 12px 16px;
}

body.ds-theme .content:not(.ds-overview-page) .card-header-tabs .nav-item {
    margin: 0;
}

body.ds-theme .content:not(.ds-overview-page) .card-header-tabs .nav-link {
    align-items: center;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--ds-text-secondary);
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 500;
    gap: 6px;
    line-height: 1;
    margin: 0;
    min-height: 34px;
    padding: 9px 11px;
}

body.ds-theme .content:not(.ds-overview-page) .card-header-tabs .nav-link i {
    font-size: 0.78rem;
    margin-right: 0 !important;
}

body.ds-theme .content:not(.ds-overview-page) .card-header-tabs .nav-link:hover {
    background: #F9FAFB;
    color: var(--ds-text);
}

body.ds-theme .content:not(.ds-overview-page) .card-header-tabs .nav-link.active {
    background: var(--ds-primary-light);
    border-color: #E9D7FE;
    color: var(--ds-primary);
}

body.ds-theme .content:not(.ds-overview-page) .card-header-tabs .ml-auto {
    align-items: center;
    display: inline-flex !important;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

body.ds-theme .content:not(.ds-overview-page) .card-header-tabs .ml-auto .nav-link,
body.ds-theme .content:not(.ds-overview-page) .card-header-tabs .ml-auto .dropdown-toggle {
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    color: var(--ds-text-secondary);
    min-height: 32px;
    padding: 8px 10px;
}

body.ds-theme .content:not(.ds-overview-page) .card-header-tabs .ml-auto .nav-link:hover,
body.ds-theme .content:not(.ds-overview-page) .card-header-tabs .ml-auto .dropdown-toggle:hover {
    background: var(--ds-primary-light);
    border-color: #E9D7FE;
    color: var(--ds-primary);
}

body.ds-theme .content:not(.ds-overview-page) .dataTables_wrapper {
    color: var(--ds-text-secondary);
    font-size: 0.78rem;
}

body.ds-theme .content:not(.ds-overview-page) .dataTables_wrapper > .row:first-child {
    align-items: center;
    margin-bottom: 14px;
}

body.ds-theme .content:not(.ds-overview-page) .dataTables_length label,
body.ds-theme .content:not(.ds-overview-page) .dataTables_filter label {
    color: var(--ds-text-secondary);
    font-size: 0.78rem;
    font-weight: 500;
    margin-bottom: 0;
}

body.ds-theme .content:not(.ds-overview-page) .dataTables_length select {
    background-color: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: 8px;
    color: var(--ds-text);
    font-size: 0.78rem;
    height: 34px;
    margin: 0 6px;
    min-width: 62px;
    padding: 4px 24px 4px 9px;
}

body.ds-theme .content:not(.ds-overview-page) .dataTables_filter .input-group {
    min-width: 240px;
}

body.ds-theme .content:not(.ds-overview-page) .dataTables_filter .form-control {
    border-color: var(--ds-border);
    border-radius: 8px 0 0 8px;
    font-size: 0.78rem;
    min-height: 36px;
    padding: 8px 12px;
}

body.ds-theme .content:not(.ds-overview-page) .dataTables_filter .input-group-text {
    background: #F9FAFB;
    border-color: var(--ds-border);
    border-radius: 0 8px 8px 0;
    color: var(--ds-text-muted);
}

body.ds-theme .content:not(.ds-overview-page) .table-responsive,
body.ds-theme .content:not(.ds-overview-page) .dataTables_wrapper {
    width: 100%;
}

body.ds-theme .content:not(.ds-overview-page) table.dataTable {
    border: 1px solid var(--ds-border-light);
    border-collapse: separate !important;
    border-radius: 10px;
    border-spacing: 0;
    overflow: hidden;
    width: 100% !important;
}

body.ds-theme .content:not(.ds-overview-page) table.dataTable thead th {
    background: #FCFCFD;
    border-bottom: 1px solid var(--ds-border-light);
    color: var(--ds-text-muted);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.25;
    padding: 12px 14px;
    text-transform: uppercase;
    white-space: nowrap;
}

body.ds-theme .content:not(.ds-overview-page) table.dataTable tbody td {
    background: var(--ds-surface);
    border-top: 1px solid var(--ds-border-light);
    color: var(--ds-text);
    font-size: 0.78rem;
    line-height: 1.35;
    padding: 14px;
    vertical-align: middle;
}

body.ds-theme .content:not(.ds-overview-page) table.dataTable tbody tr:first-child td {
    border-top: 0;
}

body.ds-theme .content:not(.ds-overview-page) table.dataTable tbody tr:hover td {
    background: #FAFAFF;
}

body.ds-theme .content:not(.ds-overview-page) table.dataTable img,
body.ds-theme .content:not(.ds-overview-page) table.dataTable .img-size-32 {
    border-radius: 8px;
    height: 44px;
    object-fit: cover;
    width: 44px;
}

body.ds-theme .content:not(.ds-overview-page) table.dataTable .btn-link,
body.ds-theme .content:not(.ds-overview-page) table.dataTable a.btn-link,
body.ds-theme .content:not(.ds-overview-page) table.dataTable td a:not(.btn):not(.badge):not(.ds-status) {
    border-radius: 7px;
    color: var(--ds-text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    min-width: 28px;
}

body.ds-theme .content:not(.ds-overview-page) table.dataTable td a:not(.btn):not(.badge):not(.ds-status):hover {
    background: var(--ds-primary-light);
    color: var(--ds-primary);
    text-decoration: none;
}

body.ds-theme .content:not(.ds-overview-page) .dataTables_info {
    color: var(--ds-text-muted);
    font-size: 0.76rem;
    padding-top: 16px;
}

body.ds-theme .content:not(.ds-overview-page) .dataTables_paginate {
    padding-top: 12px;
}

/* ─── Badges / Labels ─── */
body.ds-theme .badge,
body.ds-theme .ds-badge {
    border-radius: 100px;
    font-weight: 500;
    font-size: 0.75rem;
    padding: 2px 10px;
}

body.ds-theme .badge-success,
body.ds-theme .ds-badge--success { background: var(--ds-success-light) !important; color: var(--ds-success) !important; }
body.ds-theme .badge-warning,
body.ds-theme .ds-badge--warning { background: var(--ds-warning-light) !important; color: var(--ds-warning) !important; }
body.ds-theme .badge-danger,
body.ds-theme .ds-badge--danger { background: var(--ds-danger-light) !important; color: var(--ds-danger) !important; }
body.ds-theme .badge-info,
body.ds-theme .ds-badge--info { background: var(--ds-info-light) !important; color: var(--ds-info) !important; }
body.ds-theme .badge-primary,
body.ds-theme .ds-badge--primary { background: var(--ds-primary-light) !important; color: var(--ds-primary) !important; }

/* ─── Forms ─── */
body.ds-theme .form-control {
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius);
    color: var(--ds-text);
    font-size: 0.875rem;
    padding: 10px 14px;
    height: auto;
    transition: border-color var(--ds-transition), box-shadow var(--ds-transition);
}

body.ds-theme .form-control:focus {
    border-color: var(--ds-primary);
    box-shadow: 0 0 0 3px rgba(105, 65, 198, 0.12);
}

body.ds-theme .form-group label,
body.ds-theme label {
    color: var(--ds-text);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 6px;
}

body.ds-theme .form-text {
    color: var(--ds-text-muted);
}

body.ds-theme .select2-container--default .select2-selection--single {
    border: 1px solid var(--ds-border) !important;
    border-radius: var(--ds-radius) !important;
    height: 42px !important;
}

body.ds-theme .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 40px !important;
    color: var(--ds-text);
}

body.ds-theme .input-group-text {
    border: 1px solid var(--ds-border);
    background: var(--ds-bg);
    color: var(--ds-text-secondary);
    border-radius: var(--ds-radius);
}

/* ─── Alerts ─── */
body.ds-theme .alert {
    border-radius: var(--ds-radius-lg);
    border: 1px solid transparent;
    font-size: 0.875rem;
}

body.ds-theme .alert-success { background: var(--ds-success-light); border-color: #A6F4C5; color: #027A48; }
body.ds-theme .alert-danger { background: var(--ds-danger-light); border-color: #FECDCA; color: #B42318; }
body.ds-theme .alert-warning { background: var(--ds-warning-light); border-color: #FEDF89; color: #B54708; }
body.ds-theme .alert-info { background: var(--ds-info-light); border-color: #B2DDFF; color: #175CD3; }

/* ─── Tabs ─── */
body.ds-theme .nav-tabs {
    border-bottom: 1px solid var(--ds-border);
}

body.ds-theme .nav-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--ds-text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 10px 16px;
    border-radius: 0;
    margin-bottom: -1px;
}

body.ds-theme .nav-tabs .nav-link:hover {
    color: var(--ds-text);
    border-color: transparent;
}

body.ds-theme .nav-tabs .nav-link.active {
    color: var(--ds-primary);
    border-bottom-color: var(--ds-primary);
    background: transparent;
}

body.ds-theme .card-header-tabs {
    margin: 0;
}

/* ─── Pagination ─── */
body.ds-theme .pagination > li > a,
body.ds-theme .pagination > li > span {
    border: 1px solid var(--ds-border) !important;
    border-radius: var(--ds-radius) !important;
    color: var(--ds-text-secondary);
    font-size: 0.8125rem;
    margin: 0 2px;
    width: 36px;
    height: 36px;
    padding: 8px;
    line-height: 1.2;
}

body.ds-theme .pagination > .active > a,
body.ds-theme .pagination > .active > span {
    background: var(--ds-primary-light) !important;
    border-color: var(--ds-primary) !important;
    color: var(--ds-primary) !important;
}

/* ─── Avatar ─── */
body.ds-theme .ds-avatar,
body.ds-theme .img-circle {
    border-radius: 50%;
    object-fit: cover;
}

body.ds-theme .ds-avatar--sm { width: 32px; height: 32px; }
body.ds-theme .ds-avatar--md { width: 40px; height: 40px; }
body.ds-theme .ds-avatar--lg { width: 48px; height: 48px; }

body.ds-theme .img-size-32 {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

/* ─── Footer ─── */
body.ds-theme .main-footer {
    display: none;
}

/* ─── Small box override (legacy pages) ─── */
body.ds-theme .small-box {
    border-radius: var(--ds-radius-lg);
    box-shadow: var(--ds-shadow-xs);
    overflow: hidden;
}

body.ds-theme .small-box .inner h3 {
    font-weight: 600;
    font-size: 1.75rem;
}

body.ds-theme .small-box .inner p {
    font-size: 0.875rem;
}

body.ds-theme .small-box .icon i {
    font-size: 64px !important;
    opacity: 0.15;
}

body.ds-theme .small-box-footer {
    font-size: 0.8125rem;
    font-weight: 500;
}

body.ds-theme .bg-info { background: var(--ds-info) !important; }
body.ds-theme .bg-success { background: var(--ds-success) !important; }
body.ds-theme .bg-warning { background: var(--ds-warning) !important; }
body.ds-theme .bg-danger { background: var(--ds-danger) !important; }

/* ─── Chart card ─── */
.ds-chart-card__summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.ds-chart-card__metric-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--ds-text);
}

.ds-chart-card__metric-label {
    font-size: 0.875rem;
    color: var(--ds-text-secondary);
}

.ds-chart-card__metric-secondary {
    text-align: right;
}

.ds-chart-card__legend {
    display: flex;
    gap: 16px;
    font-size: 0.8125rem;
    color: var(--ds-text-secondary);
}

.ds-chart-card__legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    margin-right: 6px;
    vertical-align: middle;
}

.ds-chart-card__legend-dot--primary {
    background: var(--ds-primary);
}

/* ─── Empty state ─── */
.ds-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--ds-text-muted);
}

.ds-empty-state i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.4;
}

/* ─── Featured icon ─── */
.ds-featured-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--ds-radius-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.ds-featured-icon--primary { background: var(--ds-primary-light); color: var(--ds-primary); }
.ds-featured-icon--success { background: var(--ds-success-light); color: var(--ds-success); }

/* ─── Link card header action ─── */
.ds-card__link {
    color: var(--ds-primary);
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
}

.ds-card__link:hover {
    color: var(--ds-primary-hover);
    text-decoration: none;
}

/* ─── SweetAlert / Flash ─── */
body.ds-theme .alert-dismissible .close {
    padding: 12px 16px;
}

body.ds-theme .page-item.active .page-link,
body.ds-theme .select2-container--default .select2-selection--multiple .select2-selection__choice {
    color: #ffffff !important;
    background-color: var(--ds-primary) !important;
    border-color: var(--ds-primary) !important;
}

body.ds-theme .form-group a:not(.btn),
body.ds-theme footer a:not(.btn),
body.ds-theme .breadcrumb-item > a,
body.ds-theme .page-link {
    color: var(--ds-primary) !important;
}

body.ds-theme .form-group a:not(.btn):hover,
body.ds-theme footer a:not(.btn):hover,
body.ds-theme .breadcrumb-item > a:hover,
body.ds-theme .page-link:hover {
    color: var(--ds-primary-hover) !important;
}

body.ds-theme .select2-container--default .select2-results__option--highlighted[aria-selected],
body.ds-theme .card .nav-pills .nav-link.active,
body.ds-theme .dropdown-menu > a.dropdown-item.active,
body.ds-theme .dropdown-menu > a.dropdown-item:active {
    background-color: var(--ds-primary) !important;
    color: #fff !important;
}

body.ds-theme .page-link:focus {
    box-shadow: 0 0 0 3px rgba(105, 65, 198, 0.12);
}

body.ds-theme .nav-pills .nav-link.active {
    background: var(--ds-primary-light) !important;
    color: var(--ds-primary) !important;
}

body.ds-theme .sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link.active,
body.ds-theme .sidebar-light-primary .nav-sidebar > .nav-item > .nav-link.active {
    background: var(--ds-primary-light) !important;
    color: var(--ds-primary) !important;
}

/* ─── Global page headers (all admin pages) ─── */
body.ds-theme .content-header .row,
body.ds-theme .ds-page-header .row {
    align-items: flex-start;
}

body.ds-theme .content-header h1,
body.ds-theme .ds-page-header h1 {
    color: var(--ds-text) !important;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.3;
}

body.ds-theme .content-header h1 small.ml-3,
body.ds-theme .content-header h1 small.mr-3,
body.ds-theme .content-header h1 small.ml-3.mr-3 {
    display: none !important;
}

body.ds-theme .content-header h1 small:not(.ml-3):not(.mr-3),
body.ds-theme .ds-page-header__subtitle {
    display: block;
    font-size: 0.875rem;
    color: var(--ds-text-secondary);
    font-weight: 400;
    margin-top: 4px;
}

body.ds-theme .content-header .text-dark {
    color: var(--ds-text) !important;
}

/* ─── Content area spacing ─── */
body.ds-theme .content > .clearfix:first-child {
    display: none;
}

body.ds-theme .content .alert {
    margin-bottom: 16px;
}

/* ─── Card variants ─── */
body.ds-theme .card-info > .card-header,
body.ds-theme .card-primary > .card-header,
body.ds-theme .card-success > .card-header,
body.ds-theme .card-warning > .card-header,
body.ds-theme .card-danger > .card-header {
    background: var(--ds-surface);
    color: var(--ds-text);
    border-bottom: 1px solid var(--ds-border-light);
}

body.ds-theme .card-info,
body.ds-theme .card-primary,
body.ds-theme .card-success,
body.ds-theme .card-warning,
body.ds-theme .card-danger {
    border: 1px solid var(--ds-border);
    border-top: 3px solid var(--ds-primary);
}

body.ds-theme .card-success { border-top-color: var(--ds-success); }
body.ds-theme .card-warning { border-top-color: var(--ds-warning); }
body.ds-theme .card-danger { border-top-color: var(--ds-danger); }
body.ds-theme .card-info { border-top-color: var(--ds-info); }

body.ds-theme .card-tools .btn-tool {
    color: var(--ds-text-secondary);
    border-radius: var(--ds-radius-sm);
}

body.ds-theme .card-tools .btn-tool:hover {
    color: var(--ds-text);
    background: var(--ds-border-light);
}

body.ds-theme .collapsed-card .card-header {
    border-bottom: none;
}

/* ─── Card header tabs + datatable toolbar ─── */
body.ds-theme .card-header-tabs {
    border-bottom: none;
    margin-bottom: -1px;
}

body.ds-theme .card-header-tabs .nav-link {
    border-bottom: 2px solid transparent;
    color: var(--ds-text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 8px 14px;
    margin-right: 4px;
}

body.ds-theme .card-header-tabs .nav-link.active {
    color: var(--ds-primary);
    border-bottom-color: var(--ds-primary);
    background: transparent;
}

body.ds-theme .card-header-tabs .nav-link:hover:not(.active) {
    color: var(--ds-text);
    background: var(--ds-border-light);
    border-radius: var(--ds-radius-sm);
}

body.ds-theme .card-header-tabs .ml-auto .nav-link,
body.ds-theme .card-header-tabs .ml-auto .dropdown-toggle {
    font-size: 0.8125rem;
    color: var(--ds-text-secondary);
}

body.ds-theme .card-header-tabs .dropdown-menu {
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    box-shadow: var(--ds-shadow-lg);
    padding: 6px;
}

body.ds-theme .card-header-tabs .dropdown-item {
    border-radius: var(--ds-radius-sm);
    font-size: 0.8125rem;
    padding: 8px 12px;
}

/* ─── Settings sidebar menu ─── */
body.ds-theme .content .col-md-3 .card .nav-pills .nav-link {
    border-radius: var(--ds-radius);
    color: var(--ds-text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 10px 16px;
    margin: 2px 8px;
}

body.ds-theme .content .col-md-3 .card .nav-pills .nav-link:hover {
    background: var(--ds-border-light);
    color: var(--ds-text);
}

body.ds-theme .content .col-md-3 .card .nav-pills .nav-link.selected,
body.ds-theme .content .col-md-3 .card .nav-pills .nav-link.active {
    background: var(--ds-primary-light) !important;
    color: var(--ds-primary) !important;
}

body.ds-theme .content .col-md-3 > .card {
    margin-bottom: 16px;
}

body.ds-theme .content .col-md-3 .card .card-header {
    padding: 14px 16px;
}

body.ds-theme .content .col-md-3 .card .card-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ds-text);
}

/* ─── DataTables ─── */
body.ds-theme .dataTables_wrapper .dataTables_length select {
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius);
    padding: 6px 10px;
    font-size: 0.8125rem;
}

body.ds-theme .dataTables_wrapper .dataTables_info {
    color: var(--ds-text-secondary);
    font-size: 0.8125rem;
}

body.ds-theme .dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: var(--ds-radius) !important;
}

body.ds-theme table.dataTable thead .sorting,
body.ds-theme table.dataTable thead .sorting_asc,
body.ds-theme table.dataTable thead .sorting_desc {
    color: var(--ds-text-secondary);
}

body.ds-theme .btn-group-sm > .btn,
body.ds-theme .btn-group-sm > .btn-link {
    padding: 4px 8px;
    border-radius: var(--ds-radius-sm);
    color: var(--ds-text-secondary);
}

body.ds-theme .btn-group-sm > .btn-link:hover {
    background: var(--ds-border-light);
    color: var(--ds-primary);
    text-decoration: none;
}

body.ds-theme .btn-group-sm > .btn-link.text-danger:hover {
    background: var(--ds-danger-light);
    color: var(--ds-danger) !important;
}

/* ─── Forms (create/edit pages) ─── */
body.ds-theme .card-body .form-group {
    margin-bottom: 1.25rem;
}

body.ds-theme .card-body .form-group.col-12.text-right {
    border-top: 1px solid var(--ds-border-light);
    padding-top: 20px;
    margin-top: 8px;
}

body.ds-theme .custom-control-label {
    color: var(--ds-text);
    font-size: 0.875rem;
}

body.ds-theme .custom-switch .custom-control-label::before {
    border-radius: 100px;
    border-color: var(--ds-border);
}

body.ds-theme .custom-control-input:checked ~ .custom-control-label::before {
    background-color: var(--ds-primary);
    border-color: var(--ds-primary);
}

body.ds-theme textarea.form-control {
    min-height: 100px;
}

body.ds-theme .input-group .form-control {
    border-radius: var(--ds-radius);
}

/* ─── Show pages ─── */
body.ds-theme .card-body .row .form-group strong,
body.ds-theme .card-body dl dt {
    color: var(--ds-text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

body.ds-theme .card-body .row .form-group p,
body.ds-theme .card-body dl dd {
    color: var(--ds-text);
    font-size: 0.9375rem;
    margin-bottom: 0;
}

/* ─── Modals ─── */
body.ds-theme .modal-content {
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-xl);
    box-shadow: var(--ds-shadow-lg);
}

body.ds-theme .modal-header {
    border-bottom: 1px solid var(--ds-border-light);
    padding: 16px 20px;
}

body.ds-theme .modal-footer {
    border-top: 1px solid var(--ds-border-light);
    padding: 12px 20px;
}

body.ds-theme .modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--ds-text);
}

/* ─── Media modal ─── */
body.ds-theme #mediaModal .modal-body {
    background: var(--ds-bg);
}

body.ds-theme #mediaModal .card {
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
}

/* ─── SweetAlert ─── */
body.ds-theme .sweet-alert {
    border-radius: var(--ds-radius-xl);
    box-shadow: var(--ds-shadow-lg);
}

body.ds-theme .sweet-alert h2 {
    font-family: var(--ds-font);
    color: var(--ds-text);
}

/* ─── Login page ─── */
body.ds-theme.login-page {
    background: var(--ds-bg) !important;
}

body.ds-theme .login-box,
body.ds-theme .register-box {
    width: 420px;
}

body.ds-theme .login-box .card,
body.ds-theme .register-box .card {
    border-radius: var(--ds-radius-xl);
    box-shadow: var(--ds-shadow-lg);
}

body.ds-theme .login-box .login-logo img {
    max-height: 72px;
}

body.ds-theme .login-page .btn-primary {
    background: var(--ds-primary) !important;
    border-color: var(--ds-primary) !important;
}

/* ─── Misc overrides ─── */
body.ds-theme .text-muted {
    color: var(--ds-text-muted) !important;
}

body.ds-theme .text-success {
    color: var(--ds-success) !important;
}

body.ds-theme .text-danger {
    color: var(--ds-danger) !important;
}

body.ds-theme .text-warning {
    color: var(--ds-warning) !important;
}

body.ds-theme .text-info {
    color: var(--ds-info) !important;
}

body.ds-theme .bg-primary {
    background-color: var(--ds-primary) !important;
}

body.ds-theme .bg-secondary {
    background-color: var(--ds-secondary) !important;
}

body.ds-theme hr {
    border-color: var(--ds-border-light);
}

body.ds-theme .dropdown-divider {
    border-color: var(--ds-border-light);
}

body.ds-theme .note-editor.note-frame {
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
}

body.ds-theme .dropzone {
    border: 2px dashed var(--ds-border) !important;
    border-radius: var(--ds-radius-lg) !important;
    background: var(--ds-bg) !important;
}

body.ds-theme .dropzone:hover {
    border-color: var(--ds-primary) !important;
    background: var(--ds-primary-light) !important;
}

body.ds-theme .progress {
    border-radius: 100px;
    background: var(--ds-border-light);
    height: 8px;
}

body.ds-theme .progress-bar {
    background: var(--ds-primary);
    border-radius: 100px;
}

body.ds-theme .callout {
    border-radius: var(--ds-radius-lg);
    border-left-width: 4px;
}

body.ds-theme .info-box {
    border-radius: var(--ds-radius-lg);
    box-shadow: var(--ds-shadow-xs);
    border: 1px solid var(--ds-border);
}

body.ds-theme .info-box-icon {
    border-radius: var(--ds-radius-lg) 0 0 var(--ds-radius-lg);
}

body.ds-theme .direct-chat-messages,
body.ds-theme .timeline {
    color: var(--ds-text);
}

body.ds-theme .timeline > div > .timeline-item {
    border-radius: var(--ds-radius-lg);
    box-shadow: var(--ds-shadow-xs);
    border: 1px solid var(--ds-border);
}

body.ds-theme .content-headerfixed-top {
    margin-top: 64px;
}

/* ═══════════════════════════════════════════
   SnowUI — Page Examples layout
   ═══════════════════════════════════════════ */

body.ds-theme .ds-content-wrapper {
    background: #F5F5F5;
}

body.ds-theme .ds-page-layout {
    display: flex;
    align-items: flex-start;
    gap: 0;
    min-height: calc(100vh - 120px);
}

body.ds-theme .ds-page-main {
    flex: 1;
    min-width: 0;
}

body.ds-theme.ds-right-panel-hidden .ds-right-panel {
    display: none !important;
}

body.ds-theme.ds-datatable-page .ds-right-panel {
    display: none !important;
}

/* Header search */
body.ds-theme .ds-header-search {
    max-width: 220px;
    margin: 0 18px 0 auto;
    position: relative;
    align-items: center;
}

body.ds-theme .ds-header-search__icon {
    position: absolute;
    left: 14px;
    color: var(--ds-text-muted);
    font-size: 0.875rem;
    z-index: 1;
}

body.ds-theme .ds-header-search__input {
    width: 100%;
    border: 0;
    border-radius: 8px;
    background: #F7F7F8;
    padding: 8px 14px 8px 36px;
    font-size: 0.76rem;
    color: var(--ds-text);
    transition: border-color var(--ds-transition), box-shadow var(--ds-transition);
}

body.ds-theme .ds-header-search__input:focus {
    outline: none;
    border-color: var(--ds-primary);
    box-shadow: 0 0 0 3px rgba(105, 65, 198, 0.1);
    background: var(--ds-surface);
}

/* Right panel */
.ds-right-panel {
    width: 208px;
    flex-shrink: 0;
    background: var(--ds-surface);
    border-left: 1px solid #F3F4F6;
    padding: 20px 16px;
    position: sticky;
    top: 64px;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
}

.ds-panel-block {
    margin-bottom: 22px;
}

.ds-panel-block__title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ds-text);
    margin: 0 0 12px;
}

.ds-panel-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ds-panel-list__item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 0;
}

.ds-panel-list__item:last-child {
    border-bottom: none;
}

.ds-panel-list__item--empty {
    color: var(--ds-text-muted);
    font-size: 0.8125rem;
}

.ds-panel-list__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ds-primary);
    margin-top: 6px;
    flex-shrink: 0;
}

.ds-panel-list__content {
    flex: 1;
    min-width: 0;
}

.ds-panel-list__text {
    display: block;
    font-size: 0.72rem;
    color: var(--ds-text);
    line-height: 1.28;
}

.ds-panel-list__meta {
    display: block;
    font-size: 0.66rem;
    color: #9CA3AF;
    margin-top: 2px;
}

.ds-panel-list__icon {
    align-items: center;
    border: 1px solid #E5E7EB;
    border-radius: 50%;
    color: #111827;
    display: inline-flex;
    flex: 0 0 auto;
    height: 22px;
    justify-content: center;
    width: 22px;
}

.ds-panel-list__icon i {
    font-size: 0.68rem;
}

.ds-panel-contacts {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ds-panel-contacts__item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 0;
}

.ds-panel-contacts__avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
}

.ds-panel-contacts__name {
    font-size: 0.72rem;
    color: var(--ds-text);
    font-weight: 500;
}

/* KPI cards — SnowUI Overview */
.ds-kpi-card {
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    padding: 20px;
    height: 100%;
    box-shadow: var(--ds-shadow-xs);
}

.ds-kpi-card__label {
    font-size: 0.875rem;
    color: var(--ds-text-secondary);
    margin-bottom: 8px;
}

.ds-kpi-card__row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

.ds-kpi-card__value {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--ds-text);
    line-height: 1.1;
}

.ds-kpi-card__trend {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 100px;
    white-space: nowrap;
}

.ds-kpi-card__trend--up {
    background: var(--ds-success-light);
    color: var(--ds-success);
}

.ds-kpi-card__trend--down {
    background: var(--ds-danger-light);
    color: var(--ds-danger);
}

.ds-kpi-card__link {
    display: inline-block;
    margin-top: 12px;
    font-size: 0.75rem;
    color: var(--ds-primary);
    font-weight: 500;
}

.ds-kpi-card__link:hover {
    color: var(--ds-primary-hover);
    text-decoration: none;
}

/* Traffic list widget */
.ds-traffic-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ds-traffic-list__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--ds-border-light);
}

.ds-traffic-list__item:last-child {
    border-bottom: none;
}

.ds-traffic-list__label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.875rem;
    color: var(--ds-text);
    min-width: 0;
}

.ds-traffic-list__label span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Chart legend inline */
.ds-chart-legend-inline {
    font-size: 0.8125rem;
    color: var(--ds-text-secondary);
}

.ds-legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

.ds-legend-dot--solid {
    background: var(--ds-primary);
}

/* Order List page */
.ds-order-list-page .card-header-tabs {
    border-top: 1px solid var(--ds-border-light);
    padding-top: 12px;
}

.ds-order-list-card__header {
    flex-direction: column;
    align-items: stretch !important;
}

.ds-order-list-card__title-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Status badges — SnowUI Order List */
.ds-status,
body.ds-theme .ds-status {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.5;
}

.ds-status--default,
body.ds-theme .badge:not([class*="badge-"]) {
    background: var(--ds-info-light);
    color: var(--ds-info);
}

body.ds-theme .ds-order-table .badge-success,
body.ds-theme .ds-order-table .ds-status--complete {
    background: var(--ds-success-light) !important;
    color: var(--ds-success) !important;
}

body.ds-theme .ds-order-table .badge-warning,
body.ds-theme .ds-order-table .ds-status--pending {
    background: var(--ds-warning-light) !important;
    color: var(--ds-warning) !important;
}

body.ds-theme .ds-order-table .badge-danger,
body.ds-theme .ds-order-table .ds-status--rejected {
    background: var(--ds-danger-light) !important;
    color: var(--ds-danger) !important;
}

body.ds-theme .ds-order-table .badge-info,
body.ds-theme .ds-order-table .ds-status--progress {
    background: var(--ds-info-light) !important;
    color: var(--ds-info) !important;
}

body.ds-theme .ds-order-table thead th {
    background: var(--ds-surface);
}

body.ds-theme table.dataTable.ds-order-table,
body.ds-theme .ds-order-list-card table.dataTable {
    border: none;
}

body.ds-theme .ds-order-list-card .dataTables_wrapper {
    padding: 0 4px 12px;
}

/* SnowUI Overview page */
body.ds-theme .ds-overview-page {
    padding: 0 24px 32px;
}

body.ds-theme .ds-overview-grid {
    display: grid;
    gap: 24px;
    margin-bottom: 24px;
}

body.ds-theme .ds-overview-grid--stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.ds-theme .ds-overview-grid--analytics {
    grid-template-columns: minmax(0, 2.25fr) minmax(180px, 0.75fr);
}

body.ds-theme .ds-overview-grid--traffic {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

body.ds-theme .ds-overview-stat,
body.ds-theme .ds-overview-card {
    background: #F7F7F8;
    border: 0;
    border-radius: 14px;
    box-shadow: none;
}

body.ds-theme .ds-overview-stat {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    min-height: 74px;
    padding: 16px 18px;
    color: var(--ds-text);
    text-decoration: none;
    transition: border-color var(--ds-transition), box-shadow var(--ds-transition), transform var(--ds-transition);
}

body.ds-theme .ds-overview-stat:hover {
    border-color: transparent;
    box-shadow: none;
    color: var(--ds-text);
    text-decoration: none;
    transform: translateY(-1px);
}

body.ds-theme .ds-overview-stat--blue {
    background: #EAF3FF;
}

body.ds-theme .ds-overview-stat--violet {
    background: #F0EFFF;
}

body.ds-theme .ds-overview-stat__icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--ds-primary-light);
    color: var(--ds-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-size: 0.95rem;
}

body.ds-theme .ds-overview-stat__content {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
}

body.ds-theme .ds-overview-stat__label {
    color: #111827;
    font-size: 0.72rem;
    font-weight: 500;
    margin-bottom: 8px;
}

body.ds-theme .ds-overview-stat__value {
    color: var(--ds-text);
    font-size: 1.28rem;
    font-weight: 600;
    line-height: 1.05;
}

body.ds-theme .ds-overview-stat__trend {
    align-items: center;
    align-self: center;
    background: transparent !important;
    border-radius: 0;
    color: #111827 !important;
    display: inline-flex;
    font-size: 0.58rem;
    font-weight: 600;
    gap: 5px;
    line-height: 1;
    padding: 0;
    white-space: nowrap;
}

body.ds-theme .ds-overview-stat__trend--up {
    background: var(--ds-success-light);
    color: var(--ds-success);
}

body.ds-theme .ds-overview-stat__trend--down {
    background: var(--ds-danger-light);
    color: var(--ds-danger);
}

body.ds-theme .ds-overview-card {
    overflow: hidden;
    min-height: 100%;
}

body.ds-theme .ds-overview-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    min-height: 58px;
    padding: 20px 20px 8px;
    border-bottom: 0;
}

body.ds-theme .ds-overview-card__header h3 {
    color: var(--ds-text);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.25;
    margin: 0;
}

body.ds-theme .ds-overview-card__header p {
    color: var(--ds-text-secondary);
    font-size: 0.68rem;
    margin: 4px 0 0;
}

body.ds-theme .ds-overview-tabs {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 0;
    color: #9CA3AF;
    display: inline-flex;
    font-size: 0.68rem;
    gap: 18px;
    padding: 0;
    white-space: nowrap;
}

body.ds-theme .ds-overview-tabs span {
    border-radius: 0;
    padding: 0;
}

body.ds-theme .ds-overview-tabs .active {
    background: transparent;
    color: var(--ds-text);
    box-shadow: none;
}

body.ds-theme .ds-overview-chart {
    height: 218px;
    padding: 0 18px 18px;
}

body.ds-theme .ds-mini-chart {
    height: 218px;
    padding: 0 18px 18px;
}

body.ds-theme .ds-website-list {
    padding: 6px 20px 20px;
}

body.ds-theme .ds-website-list__item {
    align-items: center;
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 14px;
    min-height: 30px;
}

body.ds-theme .ds-website-list__item span {
    color: #111827;
    font-size: 0.66rem;
    font-weight: 500;
}

body.ds-theme .ds-website-list__spark {
    background: transparent;
    height: 8px;
    overflow: hidden;
    position: relative;
}

body.ds-theme .ds-website-list__spark::after {
    background: #D1D5DB;
    content: "";
    display: block;
    height: 1px;
    left: 32px;
    position: absolute;
    top: 4px;
    width: 34px;
}

body.ds-theme .ds-website-list__spark i {
    background: #111827;
    border-radius: 999px;
    display: block;
    height: 2px;
    margin-top: 3px;
    max-width: 52px;
}

body.ds-theme .ds-location-summary {
    align-items: center;
    display: flex;
    gap: 28px;
    min-height: 174px;
    padding: 0 28px 22px;
}

body.ds-theme .ds-donut-chart {
    height: 126px;
    width: 126px;
    flex: 0 0 126px;
}

body.ds-theme .ds-location-list,
body.ds-theme .ds-store-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

body.ds-theme .ds-location-list {
    flex: 1;
}

body.ds-theme .ds-location-list li {
    align-items: center;
    color: #111827;
    display: flex;
    font-size: 0.66rem;
    gap: 8px;
    justify-content: space-between;
    padding: 6px 0;
}

body.ds-theme .ds-location-list strong {
    color: var(--ds-text);
    font-weight: 600;
}

body.ds-theme .ds-location-list li span {
    align-items: center;
    display: inline-flex;
    gap: 6px;
}

body.ds-theme .ds-device-bars {
    align-items: end;
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    height: 174px;
    padding: 6px 28px 22px;
}

body.ds-theme .ds-device-bars__item {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
    justify-content: end;
}

body.ds-theme .ds-device-bars__bar {
    border-radius: 9px;
    display: block;
    max-height: 118px;
    width: 20px;
}

body.ds-theme .ds-device-bars__bar--blue { background: #8FB8EA; }
body.ds-theme .ds-device-bars__bar--mint { background: #5DE1D0; }
body.ds-theme .ds-device-bars__bar--black { background: #050505; }
body.ds-theme .ds-device-bars__bar--sky { background: #76B7F4; }
body.ds-theme .ds-device-bars__bar--violet { background: #A98BE7; }
body.ds-theme .ds-device-bars__bar--green { background: #72D994; }

body.ds-theme .ds-device-bars small {
    color: #9CA3AF;
    font-size: 0.64rem;
}

body.ds-theme .ds-legend-dot--primary {
    background: var(--ds-primary);
}

body.ds-theme .ds-legend-dot--teal {
    background: #12B76A;
}

body.ds-theme .ds-legend-dot--violet {
    background: #9E77ED;
}

body.ds-theme .ds-location-list li:nth-child(1) .ds-legend-dot { background: #111111; }
body.ds-theme .ds-location-list li:nth-child(2) .ds-legend-dot { background: #80BDF5; }
body.ds-theme .ds-location-list li:nth-child(3) .ds-legend-dot { background: #67E8C9; }
body.ds-theme .ds-location-list li:nth-child(4) .ds-legend-dot { background: #A78BFA; }

body.ds-theme .ds-store-list {
    padding: 0 20px 14px;
}

body.ds-theme .ds-store-list li {
    align-items: center;
    border-bottom: 1px solid var(--ds-border-light);
    color: var(--ds-text);
    display: flex;
    gap: 10px;
    min-height: 42px;
    padding: 6px 0;
}

body.ds-theme .ds-store-list li:last-child {
    border-bottom: 0;
}

body.ds-theme .ds-store-list span {
    flex: 1;
    font-size: 0.78rem;
    font-weight: 500;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.ds-theme .ds-store-list a {
    color: var(--ds-text-muted);
}

body.ds-theme .ds-overview-card--table {
    margin-bottom: 0;
    min-height: 170px;
}

body.ds-theme .ds-overview-table thead th {
    background: var(--ds-surface);
    border-bottom: 1px solid var(--ds-border-light);
    color: var(--ds-text-muted);
    font-size: 0.7rem;
    letter-spacing: 0;
    padding: 11px 20px;
    text-transform: none;
}

body.ds-theme .ds-overview-table td {
    background: var(--ds-surface);
    border-top: 1px solid var(--ds-border-light);
    color: var(--ds-text-secondary);
    font-size: 0.78rem;
    padding: 13px 20px;
}

body.ds-theme .ds-overview-table td:first-child {
    color: var(--ds-text);
    font-weight: 500;
}

body.ds-theme .ds-overview-table .ds-status--complete {
    background: var(--ds-success-light);
    color: var(--ds-success);
}

body.ds-theme .ds-overview-table .ds-status--pending {
    background: var(--ds-warning-light);
    color: var(--ds-warning);
}

@media (max-width: 1199px) {
    body.ds-theme .ds-page-layout {
        display: block;
    }

    .ds-right-panel {
        display: none !important;
    }

    body.ds-theme .ds-overview-grid--stats,
    body.ds-theme .ds-overview-grid--analytics,
    body.ds-theme .ds-overview-grid--traffic {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.ds-theme .ds-overview-card--statistics {
        grid-column: 1 / -1;
    }
}

@media (max-width: 1439px) {
    body.ds-theme .content:not(.ds-overview-page) + .ds-right-panel,
    body.ds-theme .ds-page-layout:has(.dataTables_wrapper) .ds-right-panel {
        display: none !important;
    }
}

@media (min-width: 992px) {
    body.ds-theme:not(.sidebar-collapse) .ds-content-wrapper {
        margin-left: var(--ds-sidebar-width);
    }
}

@media (max-width: 767px) {
    body.ds-theme .ds-overview-page {
        padding: 0 16px 24px;
    }

    body.ds-theme .ds-overview-grid--stats,
    body.ds-theme .ds-overview-grid--analytics,
    body.ds-theme .ds-overview-grid--traffic {
        grid-template-columns: 1fr;
    }

    body.ds-theme .ds-overview-card__header,
    body.ds-theme .ds-location-summary {
        flex-direction: column;
    }

    body.ds-theme .ds-overview-tabs {
        width: 100%;
        justify-content: space-between;
    }
}
