/**
 * Design Enhancements - Modern UI Overhaul v3
 * Premium Enterprise Design System
 * Date: 2026-04-01
 *
 * COLOR PALETTE:
 * Primary:   #2563eb (Blue 600)     → #1d4ed8 (Blue 700)
 * Secondary: #7c3aed (Violet 600)   → #6d28d9 (Violet 700)
 * Success:   #16a34a (Green 600)    → #15803d (Green 700)
 * Danger:    #dc2626 (Red 600)      → #b91c1c (Red 700)
 * Warning:   #ea580c (Orange 600)   → #c2410c (Orange 700)
 * Info:      #0891b2 (Cyan 600)     → #0e7490 (Cyan 700)
 * Neutral:   Slate scale
 */

/* ============================================
   1. CSS VARIABLES
   ============================================ */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-darker: #1e40af;
    --primary-light: #60a5fa;
    --primary-lighter: #93bbfd;
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-ring: rgba(37, 99, 235, 0.18);

    --secondary: #7c3aed;
    --secondary-dark: #6d28d9;

    --success: #16a34a;
    --success-dark: #15803d;
    --success-light: #22c55e;
    --success-50: #f0fdf4;

    --danger: #dc2626;
    --danger-dark: #b91c1c;
    --danger-light: #ef4444;
    --danger-50: #fef2f2;

    --warning: #ea580c;
    --warning-dark: #c2410c;
    --warning-light: #f97316;
    --warning-50: #fff7ed;

    --info: #0891b2;
    --info-dark: #0e7490;
    --info-light: #06b6d4;
    --info-50: #ecfeff;

    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --text-lighter: #cbd5e1;

    --border: #e2e8f0;
    --border-dark: #cbd5e1;
    --border-light: #f1f5f9;
    --bg-page: #f1f5f9;
    --bg-subtle: #f8fafc;
    --bg-muted: #f1f5f9;
    --bg-white: #ffffff;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 6px 12px -2px rgba(0, 0, 0, 0.08), 0 3px 7px -3px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 12px 24px -4px rgba(0, 0, 0, 0.1), 0 4px 8px -4px rgba(0, 0, 0, 0.06);
    --shadow-xl: 0 20px 40px -8px rgba(0, 0, 0, 0.12), 0 8px 16px -6px rgba(0, 0, 0, 0.06);

    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius: 8px;
    --radius-md: 10px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 20px;
    --radius-full: 9999px;

    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   2. GLOBAL TYPOGRAPHY & BASE
   ============================================ */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

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

a:hover {
    color: var(--primary-dark);
}

::selection {
    background: var(--primary-100);
    color: var(--primary-darker);
}

/* ============================================
   3. SIDEBAR - PREMIUM DARK THEME
   ============================================ */

/* Sidebar full-height fix */
.tw-flex.thetop {
    min-height: 100vh;
    height: 100vh;
}

.side-bar {
    height: 100vh !important;
    min-height: 100vh !important;
    position: sticky;
    top: 0;
    background: aliceblue !important;
    overflow-y: auto;
    overflow-x: hidden;
}

.side-bar > a:first-child {
    border-right-color: rgba(255, 255, 255, 0.06) !important;
}

/* Sidebar menu scroll container */
.side-bar #side-bar {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Sidebar scrollbar */
.side-bar::-webkit-scrollbar,
.side-bar #side-bar::-webkit-scrollbar {
    width: 3px;
}
.side-bar::-webkit-scrollbar-thumb,
.side-bar #side-bar::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
    border-radius: 10px;
}
.side-bar::-webkit-scrollbar-track,
.side-bar #side-bar::-webkit-scrollbar-track {
    background: transparent;
}

.main-sidebar {
    background: aliceblue !important;
    border-right: 1px solid #dbeafe !important;
    box-shadow: 1px 0 4px rgba(0, 0, 0, 0.04);
}

.main-sidebar .sidebar {
    padding-top: 4px;
}

/* Sidebar logo/brand area */
.main-header .logo,
.skin-blue .main-header .logo {
    background: transparent !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
    color: #fff !important;
    font-weight: 700;
    letter-spacing: -0.01em;
    font-size: 15px;
}

.main-header .logo:hover,
.skin-blue .main-header .logo:hover {
    background: rgba(255, 255, 255, 0.03) !important;
}

.main-header .logo .logo-mini,
.main-header .logo .logo-lg {
    color: #fff !important;
}

/* Sidebar menu items */
.sidebar-menu > li > a {
    color: #334155 !important;
    padding: 9px 14px !important;
    margin: 1px 10px !important;
    border-radius: var(--radius-sm) !important;
    font-size: 13.5px;
    font-weight: 400;
    transition: all var(--transition-fast) !important;
    border-left: 2px solid transparent !important;
    letter-spacing: 0.005em;
}

.sidebar-menu > li > a > .fa,
.sidebar-menu > li > a > .ion,
.sidebar-menu > li > a > .glyphicon {
    color: #64748b !important;
    width: 20px;
    font-size: 14px;
    margin-right: 10px;
    transition: color var(--transition-fast);
    text-align: center;
}

.sidebar-menu > li > a:hover,
.skin-blue .sidebar-menu > li > a:hover {
    background: rgba(37, 99, 235, 0.08) !important;
    color: #1e40af !important;
    border-left-color: var(--primary) !important;
}

.sidebar-menu > li > a:hover > .fa,
.sidebar-menu > li > a:hover > .ion,
.sidebar-menu > li > a:hover > .glyphicon {
    color: var(--primary) !important;
}

.sidebar-menu > li.active > a,
.skin-blue .sidebar-menu > li.active > a {
    background: rgba(37, 99, 235, 0.12) !important;
    color: #1d4ed8 !important;
    border-left-color: var(--primary) !important;
    font-weight: 600;
}

.sidebar-menu > li.active > a > .fa,
.sidebar-menu > li.active > a > .ion,
.sidebar-menu > li.active > a > .glyphicon {
    color: var(--primary) !important;
}

/* Sidebar sub-menu (treeview) */
.sidebar-menu .treeview-menu {
    background: rgba(37, 99, 235, 0.04) !important;
    padding: 2px 0 4px !important;
    margin: 0 10px 2px !important;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm) !important;
    border-left: 2px solid rgba(37, 99, 235, 0.2) !important;
    margin-left: 22px !important;
}

.sidebar-menu .treeview-menu > li > a {
    color: #475569 !important;
    padding: 7px 12px 7px 14px !important;
    font-size: 13px;
    transition: all var(--transition-fast) !important;
    font-weight: 400;
}

.sidebar-menu .treeview-menu > li > a:hover,
.skin-blue .sidebar-menu .treeview-menu > li > a:hover {
    color: #1e40af !important;
    background: rgba(37, 99, 235, 0.08) !important;
}

.sidebar-menu .treeview-menu > li.active > a,
.skin-blue .sidebar-menu .treeview-menu > li.active > a {
    color: var(--primary-dark) !important;
    background: rgba(37, 99, 235, 0.1) !important;
    font-weight: 500;
}

/* Sidebar section headers */
.sidebar-menu > li.header {
    color: #94a3b8 !important;
    background: transparent !important;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 20px 14px 6px !important;
    font-weight: 600;
}

/* Sidebar user panel */
.user-panel {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
    padding: 12px 14px !important;
}

.user-panel .info {
    color: #334155 !important;
    font-size: 13px;
}

/* Sidebar scrollbar */
.sidebar::-webkit-scrollbar {
    width: 3px;
}
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
    border-radius: 10px;
}

/* Sidebar arrow for treeview */
.sidebar-menu .treeview > a > .fa-angle-left,
.sidebar-menu .treeview > a > .pull-right-container {
    color: #94a3b8 !important;
    transition: transform var(--transition-fast);
}

/* ============================================
   4. TOP NAVBAR - CLEAN HEADER
   ============================================ */
.main-header .navbar,
.skin-blue .main-header .navbar {
    background: var(--bg-white) !important;
    border-bottom: 1px solid var(--border) !important;
    box-shadow: none !important;
    min-height: 50px;
}

.main-header .navbar .nav > li > a,
.skin-blue .main-header .navbar .nav > li > a {
    color: var(--text-muted) !important;
    transition: all var(--transition-fast);
    font-size: 14px;
}

.main-header .navbar .nav > li > a:hover,
.skin-blue .main-header .navbar .nav > li > a:hover {
    color: var(--primary) !important;
    background: var(--primary-50) !important;
}

.main-header .navbar .nav > li > a > .fa,
.main-header .navbar .nav > li > a > .ion {
    font-size: 15px;
}

/* Sidebar toggle */
.main-header .sidebar-toggle,
.skin-blue .main-header .navbar .sidebar-toggle {
    color: var(--text-muted) !important;
    padding: 15px 18px !important;
}

.main-header .sidebar-toggle:hover,
.skin-blue .main-header .navbar .sidebar-toggle:hover {
    color: var(--primary) !important;
    background: var(--primary-50) !important;
}

/* Header notification badges */
.main-header .navbar .nav > li > a > .label {
    background: var(--danger) !important;
    border-radius: var(--radius-full);
    font-size: 9px;
    padding: 2px 5px;
    font-weight: 700;
    min-width: 16px;
    text-align: center;
    line-height: 1.2;
}

/* Header dropdown menus */
.navbar-custom-menu .dropdown-menu,
.main-header .navbar .dropdown-menu {
    border-radius: var(--radius-lg) !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow-lg) !important;
    padding: 6px !important;
    margin-top: 2px !important;
}

/* ============================================
   5. FORM CONTROLS - PREMIUM INPUTS
   ============================================ */
.form-control {
    height: 38px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 6px 12px;
    font-size: 13.5px;
    font-weight: 400;
    color: var(--text-primary);
    background-color: var(--bg-white);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    letter-spacing: 0.005em;
}

.form-control:hover {
    border-color: var(--border-dark);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-ring);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-light);
    font-weight: 400;
}

.form-control:disabled,
.form-control[readonly] {
    background-color: var(--bg-muted);
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.7;
}

textarea.form-control {
    min-height: 90px;
    resize: vertical;
    line-height: 1.5;
}

/* ---- Select2 - Full Premium Styling ---- */

/* Single select */
.select2-container--default .select2-selection--single {
    height: 38px !important;
    border: 1.5px solid var(--border) !important;
    border-radius: var(--radius) !important;
    padding: 0 12px !important;
    background: var(--bg-white) !important;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.select2-container--default .select2-selection--single:hover {
    border-color: var(--border-dark) !important;
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px var(--primary-ring) !important;
    outline: none;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 34px !important;
    color: var(--text-primary) !important;
    font-size: 13.5px;
    padding-left: 0 !important;
    padding-right: 24px !important;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--text-light) !important;
    font-weight: 400;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px !important;
    right: 8px !important;
    top: 0 !important;
    width: 22px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: var(--text-muted) transparent transparent transparent !important;
    border-width: 5px 4px 0 4px !important;
    margin-left: -4px !important;
    margin-top: -2px !important;
}

.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: var(--primary) transparent transparent transparent !important;
}

/* Clear button */
.select2-container--default .select2-selection--single .select2-selection__clear {
    color: var(--text-light) !important;
    font-size: 18px;
    font-weight: 300;
    margin-right: 4px;
    cursor: pointer;
}

.select2-container--default .select2-selection--single .select2-selection__clear:hover {
    color: var(--danger) !important;
}

/* Multiple select */
.select2-container--default .select2-selection--multiple {
    border: 1.5px solid var(--border) !important;
    border-radius: var(--radius) !important;
    min-height: 38px !important;
    padding: 3px 8px 0 !important;
    background: var(--bg-white) !important;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    cursor: text;
}

.select2-container--default .select2-selection--multiple:hover {
    border-color: var(--border-dark) !important;
}

.select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px var(--primary-ring) !important;
    outline: none;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: var(--primary-50) !important;
    border: 1px solid var(--primary-100) !important;
    border-radius: var(--radius-sm) !important;
    color: var(--primary-dark) !important;
    font-size: 12px;
    padding: 3px 8px 3px 6px !important;
    font-weight: 500;
    margin: 2px 4px 2px 0 !important;
    line-height: 1.4;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: var(--primary) !important;
    font-weight: 600;
    margin-right: 4px;
    font-size: 14px;
    border-right: none !important;
    padding: 0 2px !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: var(--danger) !important;
    background: transparent !important;
}

.select2-container--default .select2-selection--multiple .select2-search--inline .select2-search__field {
    font-size: 13.5px;
    color: var(--text-primary);
    margin-top: 3px;
}

.select2-container--default .select2-selection--multiple .select2-search--inline .select2-search__field::placeholder {
    color: var(--text-light);
}

/* Dropdown panel */
.select2-dropdown {
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-lg) !important;
    background: var(--bg-white);
    z-index: 9999;
}

.select2-dropdown--above {
    border-radius: var(--radius-lg) !important;
    margin-bottom: 4px;
}

.select2-dropdown--below {
    border-radius: var(--radius-lg) !important;
    margin-top: 4px;
}

/* Search inside dropdown */
.select2-search--dropdown {
    padding: 8px !important;
}

.select2-search--dropdown .select2-search__field {
    border: 1.5px solid var(--border) !important;
    border-radius: var(--radius) !important;
    padding: 8px 12px !important;
    font-size: 13.5px;
    color: var(--text-primary);
    background: var(--bg-white);
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.select2-search--dropdown .select2-search__field:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px var(--primary-ring);
}

/* Results list */
.select2-results__options {
    padding: 4px !important;
    max-height: 280px;
}

.select2-results__option {
    padding: 8px 12px !important;
    font-size: 13.5px;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    margin: 1px 0;
    transition: all var(--transition-fast);
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: var(--primary) !important;
    color: #fff !important;
    border-radius: var(--radius-sm);
}

.select2-container--default .select2-results__option[aria-selected="true"] {
    background: var(--primary-50) !important;
    color: var(--primary-dark) !important;
    font-weight: 500;
}

.select2-container--default .select2-results__option[aria-selected="true"]:hover {
    background: var(--primary-100) !important;
    color: var(--primary-dark) !important;
}

/* Option group */
.select2-results__group {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted) !important;
    font-weight: 600;
    padding: 10px 12px 4px !important;
}

/* No results / loading */
.select2-results__message {
    color: var(--text-muted) !important;
    font-size: 13px;
    padding: 10px 12px !important;
    text-align: center;
    font-style: italic;
}

/* Disabled */
.select2-container--disabled .select2-selection--single,
.select2-container--disabled .select2-selection--multiple {
    background: var(--bg-muted) !important;
    opacity: 0.65;
    cursor: not-allowed !important;
}

/* ---- Native select styling ---- */
select.form-control {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M2.5 4.5L6 8l3.5-3.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 32px;
    cursor: pointer;
}

select.form-control:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%232563eb' d='M2.5 4.5L6 8l3.5-3.5'/%3E%3C/svg%3E");
}

[dir="rtl"] select.form-control {
    background-position: left 12px center;
    padding-right: 12px;
    padding-left: 32px;
}

/* Input groups */
.input-group .form-control {
    border-radius: var(--radius);
}

.input-group .form-control:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group .form-control:last-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.input-group .input-group-btn:last-child > .btn,
.input-group .input-group-addon:last-child {
    border-radius: 0 var(--radius) var(--radius) 0;
}

.input-group .input-group-btn:first-child > .btn,
.input-group .input-group-addon:first-child {
    border-radius: var(--radius) 0 0 var(--radius);
}

.input-group-addon {
    border: 1.5px solid var(--border);
    background-color: var(--bg-subtle);
    color: var(--text-muted);
    font-size: 13px;
    padding: 6px 12px;
}

/* Labels */
label, .control-label {
    font-weight: 500;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 5px;
    letter-spacing: 0.005em;
}

/* Form groups spacing */
.form-group {
    margin-bottom: 16px;
}

/* Validation states */
.has-error .form-control {
    border-color: var(--danger) !important;
}

.has-error .form-control:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.has-error .control-label,
.has-error .help-block {
    color: var(--danger);
}

.has-success .form-control {
    border-color: var(--success) !important;
}

.has-success .form-control:focus {
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}

/* ============================================
   6. BUTTONS - REFINED STYLE
   ============================================ */
.btn {
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 13.5px;
    padding: 7px 16px;
    transition: all var(--transition-fast);
    border: 1.5px solid transparent;
    outline: none;
    letter-spacing: 0.01em;
    line-height: 1.5;
    cursor: pointer;
    position: relative;
}

.btn:focus {
    box-shadow: 0 0 0 3px var(--primary-ring);
}

.btn:active {
    transform: translateY(0.5px);
}

/* Primary */
.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover, .btn-primary:focus {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
    box-shadow: 0 3px 8px rgba(37, 99, 235, 0.3);
}

.btn-primary:active {
    background: var(--primary-darker);
    border-color: var(--primary-darker);
    color: #fff;
}

/* Success */
.btn-success {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
    box-shadow: 0 1px 2px rgba(22, 163, 74, 0.2);
}

.btn-success:hover, .btn-success:focus {
    background: var(--success-dark);
    border-color: var(--success-dark);
    color: #fff;
    box-shadow: 0 3px 8px rgba(22, 163, 74, 0.3);
}

/* Danger */
.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
    box-shadow: 0 1px 2px rgba(220, 38, 38, 0.2);
}

.btn-danger:hover, .btn-danger:focus {
    background: var(--danger-dark);
    border-color: var(--danger-dark);
    color: #fff;
    box-shadow: 0 3px 8px rgba(220, 38, 38, 0.3);
}

.btn-danger:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

/* Warning */
.btn-warning {
    background: var(--warning);
    color: #fff;
    border-color: var(--warning);
    box-shadow: 0 1px 2px rgba(234, 88, 12, 0.2);
}

.btn-warning:hover, .btn-warning:focus {
    background: var(--warning-dark);
    border-color: var(--warning-dark);
    color: #fff;
    box-shadow: 0 3px 8px rgba(234, 88, 12, 0.3);
}

.btn-warning:focus {
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.15);
}

/* Info */
.btn-info {
    background: var(--info);
    color: #fff;
    border-color: var(--info);
    box-shadow: 0 1px 2px rgba(8, 145, 178, 0.2);
}

.btn-info:hover, .btn-info:focus {
    background: var(--info-dark);
    border-color: var(--info-dark);
    color: #fff;
    box-shadow: 0 3px 8px rgba(8, 145, 178, 0.3);
}

.btn-info:focus {
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.15);
}

/* Default / Secondary */
.btn-default {
    background: var(--bg-white);
    border: 1.5px solid var(--border);
    color: var(--text-secondary);
    box-shadow: var(--shadow-xs);
}

.btn-default:hover {
    background: var(--bg-subtle);
    border-color: var(--border-dark);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.btn-default:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-ring);
}

/* Button sizes */
.btn-lg {
    padding: 10px 24px;
    font-size: 15px;
    border-radius: var(--radius-md);
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12.5px;
    border-radius: var(--radius-sm);
}

.btn-xs {
    padding: 3px 8px;
    font-size: 11.5px;
    border-radius: var(--radius-xs);
}

/* Block buttons */
.btn-block {
    border-radius: var(--radius);
}

/* Button group */
.btn-group > .btn {
    border-radius: 0;
}

.btn-group > .btn:first-child {
    border-radius: var(--radius) 0 0 var(--radius);
}

.btn-group > .btn:last-child,
.btn-group > .dropdown-toggle {
    border-radius: 0 var(--radius) var(--radius) 0;
}

.btn-group > .btn + .btn {
    margin-left: -1px;
}

/* ============================================
   7. CARDS & WIDGETS - CLEAN BOXES
   ============================================ */
.box {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
    margin-bottom: 20px;
    background: var(--bg-white);
    overflow: visible;
    transition: box-shadow var(--transition);
}

.box:hover {
    box-shadow: var(--shadow-sm);
}

.box-header {
    border-bottom: 1px solid var(--border-light);
    padding: 14px 20px;
    background: transparent;
}

.box-header > h3,
.box-header .box-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.01em;
}

.box-header.tw-flex .box-tools {
    float: none !important;
    position: static;
    margin: 0;
}

.box-header.tw-flex .box-tools .pull-right {
    float: none !important;
}

.box-header.tw-flex .box-tools .btn,
.box-header.tw-flex .box-tools a {
    white-space: nowrap;
}

.box-body {
    padding: 20px;
}

.box-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-subtle);
}

/* Box color accents - left border style */
.box-primary {
    border-top: 3px solid var(--primary);
}

.box-success {
    border-top: 3px solid var(--success);
}

.box-warning {
    border-top: 3px solid var(--warning);
}

.box-danger {
    border-top: 3px solid var(--danger);
}

.box-info {
    border-top: 3px solid var(--info);
}

/* ============================================
   8. TABLES - PROFESSIONAL DATATABLES
   ============================================ */
.table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

.table > thead > tr > th {
    background: var(--bg-subtle);
    border-bottom: 1.5px solid var(--border) !important;
    border-top: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 10px 14px;
    white-space: nowrap;
    position: relative;
}

.table > thead > tr > th:first-child {
    border-radius: var(--radius) 0 0 0;
}

.table > thead > tr > th:last-child {
    border-radius: 0 var(--radius) 0 0;
}

.table > tbody > tr > td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-size: 13.5px;
    vertical-align: middle;
    transition: background var(--transition-fast);
}

.table > tbody > tr:last-child > td {
    border-bottom: none;
}

.table > tbody > tr:hover > td {
    background-color: var(--primary-50);
}

.table-striped > tbody > tr:nth-of-type(odd) > td {
    background-color: var(--bg-subtle);
}

.table-striped > tbody > tr:nth-of-type(odd):hover > td {
    background-color: var(--primary-50);
}

/* Table action buttons */
.table .btn-xs {
    padding: 3px 7px;
    font-size: 11px;
}

.table .btn-group .btn-xs {
    border-radius: 0;
}

.table .btn-group .btn-xs:first-child {
    border-radius: var(--radius-xs) 0 0 var(--radius-xs);
}

.table .btn-group .btn-xs:last-child {
    border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
}

/* Table containers - horizontal scroll only when needed */
.table-responsive {
    overflow-x: auto;
    overflow-y: visible;
}

/* DataTables wrapper - clearfix to contain floated pagination/info */
.dataTables_wrapper {
    position: relative;
}

.dataTables_wrapper::after {
    content: '';
    display: table;
    clear: both;
}

/* Action dropdown menus inside tables - escape with high z-index */
.table .btn-group .dropdown-menu,
.dataTables_wrapper .dropdown-menu,
.btn-group.open .dropdown-menu {
    z-index: 1050;
}

/* DataTables wrapper - filter/search */
.dataTables_wrapper .dataTables_filter input {
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 6px 12px;
    font-size: 13px;
    outline: none;
    transition: all var(--transition-fast);
    background: var(--bg-white);
    min-width: 200px;
}

.dataTables_wrapper .dataTables_filter input:hover {
    border-color: var(--border-dark);
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-ring);
}

.dataTables_wrapper .dataTables_length select {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 5px 8px;
    font-size: 13px;
    background: var(--bg-white);
    color: var(--text-secondary);
    cursor: pointer;
}

.dataTables_wrapper .dataTables_info {
    font-size: 12.5px;
    color: var(--text-muted);
    padding-top: 12px;
    font-weight: 400;
}

/* DataTables pagination */
.dataTables_wrapper .dataTables_paginate {
    padding-top: 12px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: var(--radius-sm) !important;
    border: 1.5px solid var(--border) !important;
    padding: 5px 11px !important;
    margin: 0 2px !important;
    font-size: 12.5px;
    font-weight: 500;
    transition: all var(--transition-fast);
    background: var(--bg-white) !important;
    color: var(--text-secondary) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--primary-50) !important;
    color: var(--primary) !important;
    border-color: var(--primary-100) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary) !important;
    color: #fff !important;
    border-color: var(--primary) !important;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--primary-dark) !important;
    color: #fff !important;
    border-color: var(--primary-dark) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ============================================
   9. MODALS - MODERN STYLE
   ============================================ */
.modal-content {
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.modal-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 18px 24px;
}

.modal-header .close {
    opacity: 0.4;
    font-size: 20px;
    font-weight: 300;
    color: var(--text-secondary);
    transition: opacity var(--transition-fast);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: -4px -8px;
}

.modal-header .close:hover {
    opacity: 1;
    background: var(--bg-muted);
}

.modal-title {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 14px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-subtle);
}

.modal-footer .btn + .btn {
    margin-left: 8px;
}

/* Modal backdrop */
.modal-backdrop.in {
    opacity: 0.4;
}

/* ============================================
   10. ALERTS - REFINED STYLE
   ============================================ */
.alert {
    border-radius: var(--radius);
    border: 1px solid transparent;
    padding: 12px 16px;
    font-size: 13.5px;
    font-weight: 450;
    line-height: 1.5;
    position: relative;
}

.alert-success {
    background: var(--success-50);
    color: #15803d;
    border-color: #bbf7d0;
}

.alert-danger {
    background: var(--danger-50);
    color: #b91c1c;
    border-color: #fecaca;
}

.alert-warning {
    background: var(--warning-50);
    color: #c2410c;
    border-color: #fed7aa;
}

.alert-info {
    background: var(--info-50);
    color: #0e7490;
    border-color: #a5f3fc;
}

.alert .close {
    opacity: 0.5;
    font-weight: 300;
    font-size: 18px;
}

.alert .close:hover {
    opacity: 1;
}

/* ============================================
   11. TABS - CLEAN NAVIGATION
   ============================================ */
.nav-tabs {
    border-bottom: 1.5px solid var(--border);
    padding: 0;
}

.nav-tabs > li {
    margin-bottom: -1.5px;
}

.nav-tabs > li > a {
    border: none !important;
    border-radius: 0;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 13.5px;
    padding: 10px 16px;
    transition: color var(--transition-fast);
    border-bottom: 2px solid transparent !important;
    letter-spacing: 0.005em;
}

.nav-tabs > li > a:hover {
    background: transparent;
    color: var(--primary);
    border-bottom-color: var(--primary-light) !important;
}

.nav-tabs > li.active > a,
.nav-tabs > li.active > a:hover,
.nav-tabs > li.active > a:focus {
    color: var(--primary);
    background: transparent;
    border: none !important;
    border-bottom: 2px solid var(--primary) !important;
    font-weight: 600;
}

.tab-content {
    padding: 20px 0;
}

/* ============================================
   12. DASHBOARD WIDGETS
   ============================================ */
.info-box {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border);
    min-height: 80px;
    overflow: hidden;
    transition: box-shadow var(--transition);
}

.info-box:hover {
    box-shadow: var(--shadow-sm);
}

.info-box-icon {
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    width: 70px;
    font-size: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Info-box icon colors */
.info-box-icon.bg-aqua,
.info-box-icon.bg-info {
    background: var(--info) !important;
}

.info-box-icon.bg-green,
.info-box-icon.bg-success {
    background: var(--success) !important;
}

.info-box-icon.bg-red,
.info-box-icon.bg-danger {
    background: var(--danger) !important;
}

.info-box-icon.bg-yellow,
.info-box-icon.bg-warning {
    background: var(--warning) !important;
}

.info-box-icon.bg-purple {
    background: var(--secondary) !important;
}

.info-box-icon.bg-blue,
.info-box-icon.bg-primary {
    background: var(--primary) !important;
}

.info-box-text {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 500;
    margin-bottom: 2px;
}

.info-box-number {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.small-box {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    transition: box-shadow var(--transition);
}

.small-box:hover {
    box-shadow: var(--shadow);
}

.small-box .inner h3 {
    font-weight: 700;
    font-size: 28px;
    letter-spacing: -0.02em;
}

.small-box .inner p {
    font-size: 13px;
}

.small-box > .small-box-footer {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    font-size: 12.5px;
    padding: 4px 0;
}

/* Small-box colors */
.small-box.bg-aqua {
    background: var(--info) !important;
}

.small-box.bg-green {
    background: var(--success) !important;
}

.small-box.bg-red {
    background: var(--danger) !important;
}

.small-box.bg-yellow {
    background: var(--warning) !important;
}

.small-box.bg-purple {
    background: var(--secondary) !important;
}

.small-box.bg-blue {
    background: var(--primary) !important;
}

/* ============================================
   13. CONTENT HEADER & BREADCRUMBS
   ============================================ */
.content-header {
    padding: 14px 0 10px;
}

.content-header > h1 {
    font-weight: 700;
    font-size: 20px;
    color: var(--text-primary);
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.content-header > h1 small {
    display: block;
    margin-top: 2px;
    font-weight: 400;
    color: var(--text-muted);
    font-size: 13px;
    letter-spacing: 0;
}

.content-header > .breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
    font-size: 12.5px;
}

.content-header > .breadcrumb > li > a {
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.content-header > .breadcrumb > li > a:hover {
    color: var(--primary);
}

.content-header > .breadcrumb > .active {
    color: var(--text-secondary);
    font-weight: 500;
}

/* ============================================
   14. BADGES & LABELS
   ============================================ */
.label {
    border-radius: var(--radius-xs);
    font-weight: 500;
    font-size: 11px;
    padding: 3px 8px;
    letter-spacing: 0.02em;
    line-height: 1.4;
    display: inline-block;
}

.badge {
    border-radius: var(--radius-full);
    font-weight: 600;
    padding: 3px 9px;
    font-size: 11px;
}

.label-primary, .badge-primary {
    background-color: var(--primary) !important;
    color: #fff !important;
}

.label-success, .badge-success {
    background-color: var(--success) !important;
    color: #fff !important;
}

.label-danger, .badge-danger {
    background-color: var(--danger) !important;
    color: #fff !important;
}

.label-warning, .badge-warning {
    background-color: var(--warning) !important;
    color: #fff !important;
}

.label-info, .badge-info {
    background-color: var(--info) !important;
    color: #fff !important;
}

.label-default, .badge-default {
    background-color: var(--bg-muted) !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border);
}

/* Soft label variants (light bg + dark text) */
.label-primary-soft {
    background-color: var(--primary-50) !important;
    color: var(--primary-dark) !important;
}

.label-success-soft {
    background-color: var(--success-50) !important;
    color: var(--success-dark) !important;
}

.label-danger-soft {
    background-color: var(--danger-50) !important;
    color: var(--danger-dark) !important;
}

.label-warning-soft {
    background-color: var(--warning-50) !important;
    color: var(--warning-dark) !important;
}

.label-info-soft {
    background-color: var(--info-50) !important;
    color: var(--info-dark) !important;
}

/* ============================================
   15. DROPDOWNS - PREMIUM MENUS
   ============================================ */
.dropdown-menu {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    min-width: 180px;
    background: var(--bg-white);
    animation: dropdownSlide 150ms ease-out;
    z-index: 1050;
}

@keyframes dropdownSlide {
    from { opacity: 0; transform: translateY(-6px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.dropdown-menu > li > a {
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus {
    background: var(--primary-50);
    color: var(--primary-dark);
    text-decoration: none;
}

.dropdown-menu > li.active > a,
.dropdown-menu > li.active > a:hover {
    background: var(--primary) !important;
    color: #fff !important;
    border-radius: var(--radius-sm);
}

/* Action icons in dropdown */
.dropdown-menu > li > a > .fa,
.dropdown-menu > li > a > .glyphicon,
.dropdown-menu > li > a > .ion,
.dropdown-menu > li > a > i {
    width: 18px;
    text-align: center;
    font-size: 13px;
    color: var(--text-light);
    flex-shrink: 0;
}

.dropdown-menu > li > a:hover > .fa,
.dropdown-menu > li > a:hover > .glyphicon,
.dropdown-menu > li > a:hover > .ion,
.dropdown-menu > li > a:hover > i {
    color: var(--primary);
}

/* Danger actions in dropdown (delete, etc) */
.dropdown-menu > li > a.text-danger,
.dropdown-menu > li > a.delete-link,
.dropdown-menu > li > a[class*="delete"] {
    color: var(--danger);
}

.dropdown-menu > li > a.text-danger:hover,
.dropdown-menu > li > a.delete-link:hover,
.dropdown-menu > li > a[class*="delete"]:hover {
    background: var(--danger-50);
    color: var(--danger-dark);
}

.dropdown-menu > li > a.text-danger > i,
.dropdown-menu > li > a.delete-link > i {
    color: var(--danger-light);
}

.dropdown-menu .divider {
    margin: 4px 8px;
    background-color: var(--border);
    height: 1px;
    border: none;
}

.dropdown-header {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
    padding: 10px 12px 4px;
}

/* Dropdown button toggle */
.btn-group > .btn + .dropdown-toggle {
    padding-left: 10px;
    padding-right: 10px;
}

/* Table action dropdowns */
.table .dropdown-menu {
    min-width: 160px;
    font-size: 13px;
}

.table .btn-group > .btn {
    font-size: 12px;
    padding: 4px 8px;
}

/* Open state */
.open > .dropdown-menu {
    display: block;
}

.open > .btn-default.dropdown-toggle {
    background: var(--bg-muted);
    border-color: var(--border-dark);
}

/* ============================================
   16. PAGINATION
   ============================================ */
.pagination > li > a,
.pagination > li > span {
    border-radius: var(--radius-sm) !important;
    margin: 0 2px;
    border: 1.5px solid var(--border);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    padding: 5px 11px;
    transition: all var(--transition-fast);
    background: var(--bg-white);
}

.pagination > li > a:hover {
    background: var(--primary-50);
    color: var(--primary);
    border-color: var(--primary-100);
}

.pagination > .active > a,
.pagination > .active > span,
.pagination > .active > a:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
}

.pagination > .disabled > a,
.pagination > .disabled > span {
    opacity: 0.4;
}

/* ============================================
   17. PROGRESS BARS
   ============================================ */
.progress {
    border-radius: var(--radius-full);
    height: 6px;
    background: var(--bg-muted);
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.progress-bar {
    border-radius: var(--radius-full);
    transition: width 0.6s ease;
}

.progress-bar-primary,
.progress-bar-info {
    background: var(--primary);
}

.progress-bar-success {
    background: var(--success);
}

.progress-bar-danger {
    background: var(--danger);
}

.progress-bar-warning {
    background: var(--warning);
}

/* ============================================
   18. TOOLTIPS & POPOVERS
   ============================================ */
.tooltip-inner {
    border-radius: var(--radius-sm);
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 500;
    background: var(--text-primary);
    max-width: 250px;
    letter-spacing: 0.005em;
}

.popover {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}

.popover-title {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 13px;
    padding: 10px 14px;
}

/* ============================================
   19. SCROLLBAR STYLING
   ============================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--text-lighter);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* ============================================
   20. CHECKBOXES & RADIOS
   ============================================ */
.icheckbox_square-blue,
.iradio_square-blue {
    border-radius: var(--radius-xs);
}

input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--primary);
}

/* ============================================
   21. HELP TEXT & MISC
   ============================================ */
.help-block {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.4;
}

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

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

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

.text-danger, .text-red {
    color: var(--danger) !important;
}

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

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

/* ============================================
   22. PANELS
   ============================================ */
.panel {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border);
}

.panel-heading {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 12px 18px;
    font-weight: 600;
    font-size: 14px;
}

.panel-body {
    padding: 18px;
}

.panel-footer {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    background: var(--bg-subtle);
    border-top: 1px solid var(--border);
    padding: 12px 18px;
}

.panel-primary .panel-heading {
    background: var(--primary);
    border-color: var(--primary);
}

.panel-success .panel-heading {
    background: var(--success-50);
    color: var(--success-dark);
    border-color: #bbf7d0;
}

.panel-danger .panel-heading {
    background: var(--danger-50);
    color: var(--danger-dark);
    border-color: #fecaca;
}

.panel-warning .panel-heading {
    background: var(--warning-50);
    color: var(--warning-dark);
    border-color: #fed7aa;
}

.panel-info .panel-heading {
    background: var(--info-50);
    color: var(--info-dark);
    border-color: #a5f3fc;
}

/* ============================================
   23. WELLS & CALLOUTS
   ============================================ */
.well {
    border-radius: var(--radius-lg);
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    box-shadow: none;
    padding: 18px;
}

.callout {
    border-radius: var(--radius);
    border-left: 4px solid;
    padding: 14px 18px;
    margin-bottom: 16px;
    background: var(--bg-white);
}

.callout-info {
    border-left-color: var(--info);
    background: var(--info-50);
}

.callout-success {
    border-left-color: var(--success);
    background: var(--success-50);
}

.callout-danger {
    border-left-color: var(--danger);
    background: var(--danger-50);
}

.callout-warning {
    border-left-color: var(--warning);
    background: var(--warning-50);
}

/* ============================================
   24. GENERAL SPACING & LAYOUT
   ============================================ */
.content {
    padding: 16px;
}

.box + .box {
    margin-top: 0;
}

/* Smooth transitions globally */
a, .btn, .form-control, .nav-tabs > li > a,
.box, .info-box, .small-box {
    transition: all var(--transition);
}

/* Content wrapper background */
.content-wrapper,
.right-side {
    background: var(--bg-page) !important;
}

/* ============================================
   25. BACKGROUND & TEXT COLOR UTILITIES
   ============================================ */

/* Background colors */
.bg-aqua, .bg-info {
    background-color: var(--info) !important;
    color: #fff !important;
}

.bg-green, .bg-success {
    background-color: var(--success) !important;
    color: #fff !important;
}

.bg-red, .bg-danger {
    background-color: var(--danger) !important;
    color: #fff !important;
}

.bg-yellow, .bg-warning {
    background-color: var(--warning) !important;
    color: #fff !important;
}

.bg-blue, .bg-primary {
    background-color: var(--primary) !important;
    color: #fff !important;
}

.bg-purple {
    background-color: var(--secondary) !important;
    color: #fff !important;
}

.bg-light-blue {
    background-color: var(--primary-50) !important;
    color: var(--primary-dark) !important;
}

.bg-light-green {
    background-color: var(--success-50) !important;
    color: var(--success-dark) !important;
}

.bg-light-red {
    background-color: var(--danger-50) !important;
    color: var(--danger-dark) !important;
}

.bg-light-yellow {
    background-color: var(--warning-50) !important;
    color: var(--warning-dark) !important;
}

/* Link colors on bg utilities */
.bg-aqua a, .bg-green a, .bg-red a, .bg-yellow a,
.bg-blue a, .bg-purple a, .bg-info a, .bg-success a,
.bg-danger a, .bg-warning a, .bg-primary a {
    color: rgba(255, 255, 255, 0.85);
}

.bg-aqua a:hover, .bg-green a:hover, .bg-red a:hover, .bg-yellow a:hover,
.bg-blue a:hover, .bg-purple a:hover, .bg-info a:hover, .bg-success a:hover,
.bg-danger a:hover, .bg-warning a:hover, .bg-primary a:hover {
    color: #fff;
}

/* Text colors */
.text-primary {
    color: var(--primary) !important;
}

.text-success, .text-green {
    color: var(--success) !important;
}

.text-danger, .text-red {
    color: var(--danger) !important;
}

.text-warning, .text-yellow, .text-orange {
    color: var(--warning) !important;
}

.text-info, .text-aqua {
    color: var(--info) !important;
}

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

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

/* ============================================
   26. SKIN BLUE OVERRIDES (AdminLTE)
   ============================================ */
.skin-blue .main-header .navbar .nav > li > a:hover,
.skin-blue .main-header .navbar .nav > li > a:active,
.skin-blue .main-header .navbar .nav > li > a:focus,
.skin-blue .main-header .navbar .nav .open > a,
.skin-blue .main-header .navbar .nav .open > a:hover,
.skin-blue .main-header .navbar .nav .open > a:focus {
    background: var(--primary-50) !important;
    color: var(--primary) !important;
}

.skin-blue .main-header li.user-header {
    background: var(--primary) !important;
}

.skin-blue .main-header li.user-header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
}

.skin-blue .main-sidebar,
.skin-blue .left-side {
    background: aliceblue !important;
}

/* AdminLTE component color overrides */
.skin-blue .main-header .navbar {
    background: var(--bg-white) !important;
}

.skin-blue .main-header .logo {
    background: transparent !important;
    border-bottom-color: rgba(255, 255, 255, 0.06) !important;
}

/* Direct chat */
.direct-chat-msg .direct-chat-text {
    border-radius: var(--radius-lg);
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 13px;
}

/* Timeline */
.timeline > li > .timeline-item {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
}

.timeline > li > .fa,
.timeline > li > .glyphicon,
.timeline > li > .ion {
    background: var(--primary);
}

/* Mailbox */
.mailbox-messages .table > tbody > tr:hover > td {
    background: var(--primary-50);
}

/* Todo list */
.todo-list > li {
    border-radius: var(--radius);
    border-left: 3px solid var(--primary);
    margin-bottom: 4px;
    padding: 8px 12px;
}

/* ============================================
   27. LIST GROUPS
   ============================================ */
.list-group {
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.list-group-item {
    border-color: var(--border-light);
    padding: 10px 16px;
    font-size: 13.5px;
    color: var(--text-secondary);
    transition: background var(--transition-fast);
}

.list-group-item:first-child {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.list-group-item:last-child {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.list-group-item:hover {
    background: var(--bg-subtle);
}

.list-group-item.active,
.list-group-item.active:hover {
    background: var(--primary);
    border-color: var(--primary);
}

/* ============================================
   28. NAVS (PILLS)
   ============================================ */
.nav-pills > li > a {
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 13.5px;
    padding: 8px 16px;
    transition: all var(--transition-fast);
}

.nav-pills > li > a:hover {
    background: var(--primary-50);
    color: var(--primary);
}

.nav-pills > li.active > a,
.nav-pills > li.active > a:hover,
.nav-pills > li.active > a:focus {
    background: var(--primary);
    color: #fff;
}

/* ============================================
   29. MODERN FORM DESIGN - SYSTEM-WIDE
   ============================================ */

/* ---- Form Section Cards ---- */
.product_form .box-primary,
.contact_form .box-primary,
form .box-primary {
    border-top: none;
}

/* ---- Enhanced Form Layout ---- */
.product_form .form-group,
.contact_form .form-group {
    margin-bottom: 20px;
    position: relative;
}

/* ---- Modern Labels with subtle icon-like left accent ---- */
.product_form label,
.contact_form label,
.modal-body label {
    font-weight: 600;
    font-size: 12.5px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
    display: inline-block;
}

/* ---- Enhanced Input Focus Animation ---- */
.form-control {
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
}

.form-control:focus {
    background-color: #fafbff;
}

/* ---- Modern Textarea ---- */
textarea.form-control {
    min-height: 100px;
    padding: 12px;
    line-height: 1.6;
}

/* ---- Modern File Upload Area ---- */
input[type="file"].upload-element,
.product_form input[type="file"],
.contact_form input[type="file"],
.modal-body input[type="file"] {
    display: block;
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-subtle);
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

input[type="file"].upload-element:hover,
.product_form input[type="file"]:hover,
.contact_form input[type="file"]:hover,
.modal-body input[type="file"]:hover {
    border-color: var(--primary);
    background: var(--primary-50);
    color: var(--primary);
}

input[type="file"].upload-element:focus,
.product_form input[type="file"]:focus,
.contact_form input[type="file"]:focus,
.modal-body input[type="file"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-ring);
}

input[type="file"]::-webkit-file-upload-button {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 6px 16px;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    margin-right: 12px;
    transition: background var(--transition-fast);
}

input[type="file"]::-webkit-file-upload-button:hover {
    background: var(--primary-dark);
}

/* Firefox */
input[type="file"]::file-selector-button {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 6px 16px;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    margin-right: 12px;
    transition: background var(--transition-fast);
}

input[type="file"]::file-selector-button:hover {
    background: var(--primary-dark);
}

/* ---- Modern Checkbox / Toggle Switches ---- */
.input-icheck,
input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--primary);
}

.product_form .checkbox label,
.product_form label > .input-icheck + strong,
.contact_form .checkbox label {
    font-size: 13.5px;
    text-transform: none;
    letter-spacing: normal;
    font-weight: 500;
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ---- Enhanced Help Text ---- */
.help-block {
    font-size: 12px !important;
    color: var(--text-light) !important;
    margin-top: 4px;
    line-height: 1.5;
    font-style: italic;
}

.help-block i {
    font-style: italic;
}

/* ---- Modern Content Header ---- */
.content-header {
    padding: 20px 15px 10px;
    position: relative;
}

.content-header > h1 {
    font-size: 22px !important;
    font-weight: 700 !important;
    color: var(--text-primary) !important;
    letter-spacing: -0.02em;
    margin: 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-100);
    display: inline-block;
}

/* ---- Modern Form Action Buttons Area ---- */
.product_form > .row:last-child,
.contact_form > .row:last-child {
    margin-top: 8px;
}

.product_form > .row:last-child .text-center,
.contact_form > .row:last-child .text-center {
    padding: 20px 0;
    border-top: 1px solid var(--border-light);
    margin-top: 4px;
}

.product_form .btn-group .submit_product_form,
.contact_form .btn-group > button,
.product_form > .row:last-child .btn-group > button {
    margin: 0 4px;
    border-radius: var(--radius) !important;
    padding: 10px 24px;
    font-weight: 600;
    font-size: 13.5px;
    letter-spacing: 0.01em;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-xs);
}

.product_form .btn-group .submit_product_form:hover,
.contact_form .btn-group > button:hover,
.product_form > .row:last-child .btn-group > button:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.product_form .btn-group .submit_product_form:active,
.contact_form .btn-group > button:active,
.product_form > .row:last-child .btn-group > button:active {
    transform: translateY(0);
}

/* ---- Form Row Spacing ---- */
.product_form .row,
.contact_form .row {
    margin-left: -10px;
    margin-right: -10px;
}

.product_form .row > [class*="col-"],
.contact_form .row > [class*="col-"] {
    padding-left: 10px;
    padding-right: 10px;
}

/* ---- Modern Input Group Buttons ---- */
.input-group .input-group-btn > .btn {
    height: 38px;
    border: 1.5px solid var(--border);
    background: var(--bg-white);
    color: var(--primary);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-group .input-group-btn > .btn:hover {
    background: var(--primary-50);
    border-color: var(--primary);
    color: var(--primary-dark);
}

.input-group .input-group-btn > .btn .fa {
    font-size: 16px;
}

/* ---- Modern Modal Forms ---- */
.modal-content {
    border-radius: var(--radius-xl) !important;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xl) !important;
    overflow: hidden;
}

.modal-header {
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
}

.modal-header .modal-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.modal-header .close {
    font-size: 22px;
    opacity: 0.5;
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    margin: -4px -4px -4px 0;
}

.modal-header .close:hover {
    opacity: 1;
    background: var(--danger-50);
    color: var(--danger);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    background: var(--bg-subtle);
    border-top: 1px solid var(--border);
    padding: 14px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ---- Tooltip Icons Enhancement ---- */
.fa.fa-info-circle {
    color: var(--text-light);
    font-size: 13px;
    margin-left: 4px;
    cursor: help;
    transition: color var(--transition-fast);
}

.fa.fa-info-circle:hover {
    color: var(--primary);
}

/* ---- Enhanced Required Field Indicator ---- */
label:has(+ .form-control[required]),
label:has(+ .input-group .form-control[required]) {
    position: relative;
}

/* ---- Multi-input (like expiry) ---- */
.multi-input {
    display: flex;
    gap: 0;
}

.multi-input .form-control:first-of-type {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.multi-input .form-control:last-of-type,
.multi-input .select2-container:last-of-type .select2-selection {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-left: none !important;
}

/* ---- Product Description Enhanced ---- */
.product-description-label,
.image-label {
    margin-bottom: 0;
}

/* ---- Section Dividers within forms ---- */
.product_form .clearfix + .col-md-12 > h4,
.contact_form .clearfix + .col-md-12 > h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-100);
    margin-bottom: 16px;
    margin-top: 8px;
}

/* ---- DataTables within forms ---- */
.product_form table.dataTable,
.product_form .table {
    border-radius: var(--radius);
    overflow: hidden;
}

/* ---- Pricing Table (Single Product) ---- */
#product_form_part .table {
    margin-bottom: 0;
}

#product_form_part .table th {
    background: var(--bg-subtle);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    color: var(--text-muted);
    padding: 10px 12px;
    white-space: nowrap;
    border-bottom: 2px solid var(--border);
}

#product_form_part .table td {
    padding: 10px 12px;
    vertical-align: middle;
}

#product_form_part .table .form-control {
    font-size: 13px;
    font-weight: 500;
}

/* ---- Variation Table Enhancement ---- */
.variation_row .table th {
    background: var(--primary-50);
    color: var(--primary-dark);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ---- Responsive Form Improvements ---- */
@media (max-width: 768px) {
    .content-header > h1 {
        font-size: 18px !important;
    }

    .product_form .btn-group {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .product_form .btn-group .submit_product_form {
        margin: 0 !important;
        width: 100%;
    }

    .modal-body {
        padding: 15px;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }

    textarea.form-control {
        min-height: 80px;
    }
}

@media (max-width: 480px) {
    .content-header {
        padding: 15px 10px 8px;
    }

    .product_form .form-group,
    .contact_form .form-group {
        margin-bottom: 14px;
    }
}

/* ---- RTL Form Support ---- */
/* Input groups handled in rtl-fixes.css */

[dir="rtl"] .modal-header .close {
    margin: -4px 0 -4px -4px;
    float: left;
}

[dir="rtl"] .modal-footer {
    justify-content: flex-start;
}

[dir="rtl"] input[type="file"]::-webkit-file-upload-button {
    margin-right: 0;
    margin-left: 12px;
}

[dir="rtl"] input[type="file"]::file-selector-button {
    margin-right: 0;
    margin-left: 12px;
}

/* ---- iCheck Plugin Modern Override ---- */
.icheckbox_square-blue,
.iradio_square-blue {
    border-radius: var(--radius-xs) !important;
}

.icheckbox_square-blue.checked {
    border-color: var(--primary) !important;
}

/* ---- Empty State in Dropdowns ---- */
.select2-results__message {
    padding: 16px !important;
    font-size: 13px;
    color: var(--text-light) !important;
}

/* ============================================
   30. PRINT STYLES
   ============================================ */
@media print {
    .box {
        border: none;
        box-shadow: none;
        border-radius: 0;
    }
    .btn {
        border-radius: 0;
        box-shadow: none;
    }
    .main-sidebar {
        display: none !important;
    }
    .content-wrapper {
        margin-left: 0 !important;
        background: #fff !important;
    }
}
