/* ============================================
   IT HELPDESK - Modern Minimalist Theme 2025
   ============================================ */

/* ===== CSS Design Tokens ===== */
:root {
    /* -- Brand / Primary -- */
    --primary:          #2563eb;
    --primary-dark:     #1d4ed8;
    --primary-darker:   #1e40af;
    --primary-light:    #dbeafe;
    --primary-glow:     rgba(37, 99, 235, 0.15);

    /* Legacy aliases – keep all components working */
    --primary-color:  var(--primary);
    --primary-hover:  var(--primary-dark);

    /* -- Sidebar (dark navy) -- */
    --sidebar-bg:           #0f1923;
    --sidebar-border:       rgba(255, 255, 255, 0.06);
    --sidebar-text:         #8b9db8;
    --sidebar-text-hover:   #e2e8f0;
    --sidebar-icon:         #566479;
    --sidebar-icon-hover:   #93c5fd;
    --sidebar-active-bg:    rgba(37, 99, 235, 0.14);
    --sidebar-active-text:  #93c5fd;
    --sidebar-active-icon:  #60a5fa;
    --sidebar-header-text:  #3e4f68;
    --sidebar-hover-bg:     rgba(255, 255, 255, 0.04);

    /* -- Surface / Layout -- */
    --bg-primary:   #f0f4f8;
    --bg-secondary: #ffffff;
    --bg-tertiary:  #f8fafc;

    /* -- Typography -- */
    --text-primary:   #111827;
    --text-secondary: #374151;
    --text-muted:     #9ca3af;

    /* -- Borders -- */
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;

    /* -- Semantic Colors -- */
    --success-color:   #059669;
    --success-light:   #ecfdf5;
    --warning-color:   #d97706;
    --warning-light:   #fffbeb;
    --danger-color:    #dc2626;
    --danger-light:    #fef2f2;
    --info-color:      #0284c7;
    --info-light:      #e0f2fe;

    --secondary-color: #6b7280;
    --secondary-hover: #4b5563;

    /* -- Shadows -- */
    --shadow-sm:      0 1px 3px rgba(0, 0, 0, 0.07);
    --shadow-md:      0 4px 6px -1px rgba(0, 0, 0, 0.09), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
    --shadow-lg:      0 10px 15px -3px rgba(0, 0, 0, 0.09), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --shadow-xl:      0 20px 25px -5px rgba(0, 0, 0, 0.11), 0 8px 10px -6px rgba(0, 0, 0, 0.06);
    --shadow-sidebar: 4px 0 24px rgba(0, 0, 0, 0.30);

    /* -- Radius -- */
    --radius-sm:   5px;
    --radius-md:   8px;
    --radius-lg:   12px;
    --radius-xl:   20px;
    --radius-full: 9999px;

    /* -- Transitions -- */
    --transition-fast:  150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base:  200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow:  300ms cubic-bezier(0.4, 0, 0.2, 1);

    /* -- Spacing -- */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
}

/* ===== AdminLTE Skin Overrides ===== */
/* Force dark sidebar regardless of selected skin */
.skin-blue .main-sidebar,
.skin-blue .left-side,
.skin-blue-light .main-sidebar,
.skin-blue-light .left-side,
.skin-black .main-sidebar,
.skin-black .left-side,
.skin-purple .main-sidebar,
.skin-purple .left-side,
[class*="skin-"] .main-sidebar {
    background-color: var(--sidebar-bg) !important;
}

/* Ensure content wrapper background is correct */
.skin-blue .content-wrapper,
.skin-blue .right-side,
.skin-blue .main-footer,
[class*="skin-"] .content-wrapper,
[class*="skin-"] .right-side {
    background-color: var(--bg-primary) !important;
}

/* ===== Base Styles ===== */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Import Inter font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ===== Scrollbar Styling ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* ===== Header / Navbar ===== */
.main-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 0 var(--border-color), 0 2px 10px rgba(0, 0, 0, 0.06);
    position: relative;
}

/* Top accent stripe */
.main-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, #60a5fa 60%, #a78bfa 100%);
    z-index: 500;
    pointer-events: none;
}

.main-header .logo {
    background: var(--sidebar-bg);
    border-bottom: 1px solid var(--sidebar-border);
    font-weight: 700;
    font-size: 15px;
    letter-spacing: -0.3px;
    color: #fff !important;
    padding-top: 3px;
    transition: background var(--transition-fast);
}

.main-header .logo:hover {
    background: #162030;
}

.logo-mini b i {
    color: #60a5fa !important;
}

.logo-lg {
    color: #ffffff !important;
}

.main-header .navbar {
    background: var(--bg-secondary);
}

.navbar-nav > li > a {
    color: var(--text-secondary) !important;
    transition: var(--transition-fast);
    border-radius: var(--radius-sm);
    margin: 8px 4px;
    padding: 8px 12px !important;
    font-size: 14px;
}

.navbar-nav > li > a:hover {
    background: var(--bg-tertiary) !important;
    color: var(--primary) !important;
}

.sidebar-toggle {
    color: var(--text-secondary) !important;
    padding: 15px 20px !important;
    transition: var(--transition-fast);
}

.sidebar-toggle:hover {
    background: var(--bg-tertiary) !important;
    color: var(--primary) !important;
}

/* ===== Sidebar ===== */
.main-sidebar {
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    box-shadow: var(--shadow-sidebar);
}

/* -- Menu Items -- */
.sidebar-menu > li > a {
    color: var(--sidebar-text);
    padding: 11px 18px;
    margin: 2px 10px;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    font-weight: 500;
    font-size: 13.5px;
    border-left: 2px solid transparent;
    display: flex;
    align-items: center;
    gap: 2px;
}

.sidebar-menu > li > a:hover {
    background: var(--sidebar-hover-bg);
    color: var(--sidebar-text-hover);
}

.sidebar-menu > li.active > a {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    font-weight: 600;
    border-left: 2px solid var(--primary);
    box-shadow: none;
}

.sidebar-menu > li.active > a:hover {
    background: var(--sidebar-active-bg);
}

/* -- Icons -- */
.sidebar-menu > li > a > .fa,
.sidebar-menu > li > a > .ion {
    width: 22px;
    font-size: 15px;
    color: var(--sidebar-icon);
    transition: color var(--transition-fast);
    text-align: center;
}

.sidebar-menu > li:hover > a > .fa,
.sidebar-menu > li:hover > a > .ion {
    color: var(--sidebar-icon-hover);
}

.sidebar-menu > li.active > a > .fa,
.sidebar-menu > li.active > a > .ion {
    color: var(--sidebar-active-icon);
}

/* -- Section Headers -- */
.sidebar-menu .header {
    color: var(--sidebar-header-text);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding: 20px 22px 8px;
}

/* -- Treeview Submenu -- */
.treeview-menu {
    background: rgba(0, 0, 0, 0.15);
    padding: 4px 0 6px;
    margin: 0 10px;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    border: 1px solid var(--sidebar-border);
    border-top: none;
}

.treeview-menu > li > a {
    color: var(--sidebar-text);
    padding: 9px 18px 9px 38px;
    font-size: 13px;
    display: block;
    transition: var(--transition-fast);
}

.treeview-menu > li > a:hover {
    color: var(--sidebar-text-hover);
    background: rgba(255, 255, 255, 0.05);
}

.treeview-menu > li.active > a {
    color: var(--sidebar-active-text);
    font-weight: 600;
    background: rgba(37, 99, 235, 0.12);
}

/* Treeview toggle arrow */
.treeview > a > .pull-right-container > .fa-angle-left,
.treeview > a > .fa-angle-left {
    color: var(--sidebar-icon) !important;
}

.treeview.active > a > .pull-right-container > .fa-angle-left,
.treeview.active > a > .fa-angle-left {
    color: var(--sidebar-active-icon) !important;
}

/* Ticket count badges in sidebar */
.sidebar-menu .label,
.sidebar-menu .badge {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    font-weight: 700;
    letter-spacing: 0;
}

/* -- User Panel -- */
.user-panel {
    padding: 16px 20px;
    border-bottom: 1px solid var(--sidebar-border);
    background: rgba(0, 0, 0, 0.15);
}

.user-panel .image img {
    border-radius: var(--radius-full);
    border: 2px solid rgba(255, 255, 255, 0.12);
}

.user-panel .info {
    color: var(--sidebar-text-hover);
}

.user-panel .info p {
    font-weight: 600;
    margin-bottom: 2px;
    font-size: 13px;
    color: #e2e8f0;
}

.user-panel .info a,
.user-panel .info a i {
    color: var(--sidebar-text) !important;
    font-size: 12px;
}

.user-panel .info a:hover {
    color: var(--sidebar-active-text) !important;
    text-decoration: none;
}

/* -- Sidebar Search -- */
.sidebar-form {
    padding: 10px 12px 6px;
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-form input {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 9px 14px;
    color: var(--sidebar-text-hover);
    transition: var(--transition-fast);
    font-size: 13px;
}

.sidebar-form input::placeholder {
    color: var(--sidebar-header-text);
}

.sidebar-form input:focus {
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(37, 99, 235, 0.50);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    outline: none;
    color: #f1f5f9;
}

.sidebar-form .input-group-btn .btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--sidebar-text);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.sidebar-form .input-group-btn .btn:hover {
    background: rgba(255, 255, 255, 0.10);
    color: var(--sidebar-text-hover);
}

/* ===== Content Area ===== */
.content-wrapper,
.right-side {
    background: var(--bg-primary);
    min-height: calc(100vh - 50px);
}

.content-header {
    padding: 24px 24px 16px;
    background: transparent;
}

.content-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.content-header h1 small {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 14px;
    margin-left: 8px;
}

.content {
    padding: 0 24px 24px;
}

/* Breadcrumb */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
}

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

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

.breadcrumb > .active {
    color: var(--text-secondary);
}

/* ===== Cards / Boxes ===== */
.box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--spacing-lg);
    overflow: hidden;
    transition: box-shadow var(--transition-base);
}

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

/* Colored top-border box variants */
.box.box-primary   { border-top: 3px solid var(--primary); }
.box.box-success   { border-top: 3px solid var(--success-color); }
.box.box-warning   { border-top: 3px solid var(--warning-color); }
.box.box-danger    { border-top: 3px solid var(--danger-color); }
.box.box-info      { border-top: 3px solid var(--info-color); }

.box-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.box-header.with-border {
    border-bottom: 1px solid var(--border-color);
}

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

.box-body {
    padding: 24px;
}

.box-footer {
    padding: 16px 24px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
}

/* Box Variants — accent borders defined above in .box.box-* rules */
.box-primary > .box-header,
.box-info > .box-header,
.box-success > .box-header,
.box-warning > .box-header,
.box-danger > .box-header {
    background: transparent;
}

/* Small Boxes (Stats) */
.small-box {
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transition: var(--transition-base);
    position: relative;
}

.small-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.small-box > .inner {
    padding: 22px 24px;
}

.small-box h3 {
    font-size: 34px;
    font-weight: 800;
    margin: 0 0 4px;
    letter-spacing: -1px;
    line-height: 1;
}

.small-box p {
    font-size: 13.5px;
    font-weight: 500;
    opacity: 0.85;
    margin: 0;
}

.small-box > .small-box-footer {
    padding: 10px 24px;
    background: rgba(0, 0, 0, 0.12);
    font-weight: 500;
    font-size: 12.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.small-box .icon {
    font-size: 68px;
    opacity: 0.15;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* Background Colors */
.bg-blue, .bg-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
}

.bg-green, .bg-success {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
}

.bg-yellow, .bg-warning {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
}

.bg-red, .bg-danger {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
}

.bg-purple {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%) !important;
}

.bg-teal {
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%) !important;
}

.bg-navy {
    background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%) !important;
}

.bg-orange {
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%) !important;
}

.bg-gray {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%) !important;
}

.bg-aqua {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
}

/* ===== Buttons ===== */
.btn {
    font-weight: 500;
    border-radius: var(--radius-md);
    padding: 10px 20px;
    font-size: 14px;
    transition: var(--transition-fast);
    border: none;
    cursor: pointer;
}

.btn-flat {
    border-radius: var(--radius-md);
}

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

.btn-xs {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 5px rgba(37, 99, 235, 0.30);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--primary-dark);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.40);
}

.btn-success {
    background: var(--success-color);
    color: white;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.btn-success:hover,
.btn-success:focus {
    background: #059669;
    color: white;
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover,
.btn-danger:focus {
    background: #dc2626;
    color: white;
    transform: translateY(-1px);
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-warning:hover,
.btn-warning:focus {
    background: #d97706;
    color: white;
}

.btn-info {
    background: var(--info-color);
    color: white;
}

.btn-info:hover,
.btn-info:focus {
    background: #0284c7;
    color: white;
}

.btn-default {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-default:hover,
.btn-default:focus {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

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

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

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

.btn-group .btn:only-child {
    border-radius: var(--radius-md);
}

/* ===== Tables ===== */
.table {
    margin-bottom: 0;
}

.table > thead > tr > th {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 13px 16px;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.table > tbody > tr > td,
.table > tbody > tr > th,
.table > tfoot > tr > td,
.table > tfoot > tr > th {
    padding: 16px;
    vertical-align: middle;
    border-top: 1px solid var(--border-light);
    color: var(--text-primary);
}

.table > tbody > tr:hover {
    background: var(--bg-tertiary);
}

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

.table-striped > tbody > tr:nth-of-type(even) {
    background: var(--bg-tertiary);
}

.table-striped > tbody > tr:hover {
    background: #eff6ff;
}

.table-bordered {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.table-bordered > thead > tr > th,
.table-bordered > thead > tr > td {
    border-bottom-width: 1px;
}

.table-responsive {
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

/* DataTables Styling */
.dataTables_wrapper {
    padding: 0;
}

.dataTables_filter input {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px 16px;
    margin-left: 8px;
    transition: var(--transition-fast);
}

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

.dataTables_length select {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
}

.dataTables_info {
    color: var(--text-muted);
    font-size: 13px;
}

.dataTables_paginate .paginate_button {
    border-radius: var(--radius-sm) !important;
    margin: 0 2px;
    padding: 6px 12px !important;
    border: 1px solid var(--border-color) !important;
    background: var(--bg-secondary) !important;
    color: var(--text-secondary) !important;
    transition: var(--transition-fast);
}

.dataTables_paginate .paginate_button:hover {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

.dataTables_paginate .paginate_button.current {
    background: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
}

/* ===== Forms ===== */
.form-control {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-secondary);
    transition: var(--transition-fast);
    box-shadow: none;
}

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

.form-control::placeholder {
    color: var(--text-muted);
}

.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 14px;
}

/* Select2 Modern Styling */
.select2-container--default .select2-selection--single {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    height: 42px;
    padding: 6px 12px;
    background: var(--bg-secondary);
    transition: var(--transition-fast);
}

.select2-container--default .select2-selection--single:focus,
.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 28px;
    color: var(--text-primary);
    padding-left: 0;
}

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

.select2-dropdown {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

/* Select2 Search Input - Fix for modals */
.select2-container--default .select2-search--dropdown {
    padding: 8px;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 14px;
    outline: none;
    width: 100%;
    box-sizing: border-box;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Ensure Select2 dropdown appears above modal */
.select2-container--open .select2-dropdown {
    z-index: 10060;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: var(--primary);
}

.select2-container--default .select2-selection--multiple {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    min-height: 42px;
    padding: 4px 8px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: var(--primary-light);
    border: none;
    color: var(--primary);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    font-weight: 500;
}

/* Checkbox & Radio */
.checkbox label,
.radio label {
    font-weight: 400;
    color: var(--text-secondary);
}

input[type="checkbox"],
input[type="radio"] {
    margin-right: 8px;
}

/* File Input */
.fileinput {
    padding: 8px 0;
}

/* ===== Badges & Labels ===== */
.badge,
.label {
    font-weight: 500;
    font-size: 12px;
    padding: 5px 10px;
    border-radius: var(--radius-full);
    letter-spacing: 0.3px;
}

.badge-primary,
.label-primary {
    background: var(--primary-color);
}

.badge-success,
.label-success {
    background: var(--success-color);
}

.badge-warning,
.label-warning {
    background: var(--warning-color);
}

.badge-danger,
.label-danger {
    background: var(--danger-color);
}

.badge-info,
.label-info {
    background: var(--info-color);
}

/* Light variants */
.label-lite-blue {
    background: var(--info-light);
    color: var(--info-color);
    border: none;
}

.label-lite-green {
    background: var(--success-light);
    color: var(--success-color);
    border: none;
}

.label-lite-yellow {
    background: var(--warning-light);
    color: var(--warning-color);
    border: none;
}

.label-lite-purple {
    background: #ede9fe;
    color: #7c3aed;
    border: none;
}

.label-lite-red {
    background: var(--danger-light);
    color: var(--danger-color);
    border: none;
}

.label-lite-gray {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: none;
}

/* ===== Alerts ===== */
.alert {
    border: none;
    border-radius: var(--radius-md);
    padding: 16px 20px;
    font-weight: 500;
}

.alert-success {
    background: var(--success-light);
    color: #065f46;
}

.alert-info {
    background: var(--info-light);
    color: #075985;
}

.alert-warning {
    background: var(--warning-light);
    color: #92400e;
}

.alert-danger {
    background: var(--danger-light);
    color: #991b1b;
}

/* ===== Modals ===== */
.modal-content {
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

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

.modal-title {
    font-weight: 600;
    font-size: 18px;
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    background: var(--bg-secondary);
}

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

.close {
    opacity: 0.5;
    font-size: 24px;
    font-weight: 300;
    transition: var(--transition-fast);
}

.close:hover {
    opacity: 1;
}

@media (min-width: 767px) {
    .modal-dialog {
        width: 600px;
    }
}

@media (min-width: 992px) {
    .modal-dialog {
        width: 720px;
    }
}

/* ===== Timeline ===== */
.timeline {
    margin: 0;
    padding: 0;
}

.timeline > li > .timeline-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-left: 60px;
    margin-right: 0;
    margin-bottom: 16px;
    padding: 0;
    overflow: hidden;
}

.timeline > li > .timeline-item > .timeline-header {
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 16px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 13px;
}

.timeline > li > .timeline-item > .timeline-body {
    padding: 16px;
    color: var(--text-primary);
}

.timeline > li > .timeline-item > .timeline-footer {
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
}

.timeline > li > .fa {
    width: 32px;
    height: 32px;
    font-size: 14px;
    line-height: 32px;
    border-radius: var(--radius-full);
}

/* ===== To-Do List ===== */
.todo-list {
    list-style: none;
    margin: 0;
    padding: 0;
    min-height: 40px;
}

.todo-list > li {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    transition: var(--transition-fast);
}

.todo-list > li:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
}

.todo-list > li .text {
    flex: 1;
    color: var(--text-primary);
    font-weight: 500;
}

.todo-list > li .tools {
    display: flex;
    gap: 8px;
}

.todo-list > li .tools a {
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.todo-list > li .tools a:hover {
    color: var(--text-primary);
}

/* ===== Callout ===== */
.callout {
    border-radius: var(--radius-md);
    border: none;
    border-left: 4px solid;
    padding: 16px 20px;
    margin-bottom: 16px;
    background: var(--bg-secondary);
    box-shadow: var(--shadow-sm);
}

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

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

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

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

.callout-gray {
    border-left-color: var(--secondary-color);
    background: var(--bg-tertiary);
}

/* ===== Tabs ===== */
.nav-tabs-custom {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.nav-tabs-custom > .nav-tabs {
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    margin: 0;
    padding: 8px 8px 0;
}

.nav-tabs-custom > .nav-tabs > li {
    margin-bottom: 0;
    margin-right: 4px;
}

.nav-tabs-custom > .nav-tabs > li > a {
    color: var(--text-secondary);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    padding: 12px 20px;
    font-weight: 500;
    border: none;
    transition: var(--transition-fast);
}

.nav-tabs-custom > .nav-tabs > li > a:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.nav-tabs-custom > .nav-tabs > li.active > a {
    background: var(--bg-secondary);
    color: var(--primary);
    font-weight: 600;
    border: none;
    border-bottom: 2px solid var(--primary);
}

.nav-tabs-custom > .tab-content {
    padding: 24px;
    background: var(--bg-secondary);
}

/* ===== Progress Bars ===== */
.progress {
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    overflow: hidden;
    box-shadow: none;
}

.progress-bar {
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
}

.progress-bar-success {
    background: linear-gradient(90deg, var(--success-color), #059669);
}

.progress-bar-warning {
    background: linear-gradient(90deg, var(--warning-color), #d97706);
}

.progress-bar-danger {
    background: linear-gradient(90deg, var(--danger-color), #dc2626);
}

/* ===== Footer ===== */
.main-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 16px 24px;
    color: var(--text-muted);
    font-size: 13px;
}

/* ===== Utility Classes ===== */
.text-dark {
    color: var(--text-primary);
}

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

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

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

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

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

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

.notopborder {
    border-top: 0 !important;
}

.whitetext {
    color: #FFF;
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

/* ===== Loading State ===== */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 16px;
    margin: 0;
}

/* ===== Products List ===== */
.products-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.products-list > .item {
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

.products-list > .item:last-child {
    border-bottom: none;
}

.products-list .product-img {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-right: 16px;
    color: var(--text-muted);
}

.products-list .product-info {
    flex: 1;
}

.products-list .product-title {
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    margin-bottom: 4px;
}

.products-list .product-description {
    color: var(--text-muted);
    font-size: 13px;
}

/* ===== Chart Legend ===== */
.chart-legend ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
}

.chart-legend li {
    padding: 4px 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.chart-legend li span {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 8px;
    border-radius: var(--radius-full);
}

/* ===== DataTables Buttons ===== */
.dt-buttons {
    margin-bottom: 16px;
}

.dt-buttons .btn-default {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    font-size: 13px;
    border-radius: var(--radius-md);
    font-weight: 500;
}

.dt-buttons .btn-default:hover {
    background: var(--bg-tertiary);
}

/* ===== Dropdown Menus ===== */
.dropdown-menu {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 8px;
}

.dropdown-menu > li > a {
    padding: 10px 16px;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.dropdown-menu > li > a:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* ===== Issues List ===== */
.issues-list .text {
    display: inline !important;
}

.issue-more {
    margin: 5px 5px;
}

/* ===== DatePicker Fix ===== */
.datepicker {
    z-index: 9999 !important;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

/* ===== Button Group in Tables ===== */
td .btn-group {
    display: flex;
    gap: 4px;
}

td .btn-group .btn {
    border-radius: var(--radius-sm) !important;
}

/* ===== Login Page ===== */
.fullboby-bg {
    background: linear-gradient(160deg, #0f1923 0%, #162744 40%, #1d3461 100%);
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.fullboby-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 50%, rgba(37, 99, 235, 0.20) 0%, transparent 60%),
                radial-gradient(ellipse at 80% 20%, rgba(96, 165, 250, 0.10) 0%, transparent 50%);
    pointer-events: none;
}

.fullboby-bg a {
    color: rgba(255, 255, 255, 0.9);
}

.fullboby-bg .login-logo {
    color: #FFF;
    font-weight: 700;
    letter-spacing: -1px;
}

.login-box {
    margin-top: 5%;
}

.login-box-body {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.40);
    padding: 36px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.login-logo {
    color: #ffffff !important;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

/* ===== Roles Page ===== */
.roles h4 {
    padding-top: 12px;
    padding-bottom: 0;
    margin-bottom: 0;
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 768px) {
    .content-header {
        padding: 16px;
    }
    
    .content {
        padding: 0 16px 16px;
    }
    
    .box-body {
        padding: 16px;
    }
    
    .content-header h1 {
        font-size: 20px;
    }
    
    .small-box > .inner {
        padding: 16px;
    }
    
    .small-box h3 {
        font-size: 24px;
    }
}

/* ===== Print Styles ===== */
@media print {
    .main-sidebar,
    .main-header,
    .main-footer,
    .btn,
    .no-print {
        display: none !important;
    }
    
    .content-wrapper {
        margin-left: 0 !important;
    }
    
    .box {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ===== Server-Side DataTables Loading ===== */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    color: var(--primary);
    font-weight: 500;
}

.loading-spinner i {
    color: var(--primary);
}

.dataTables_processing {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-lg) !important;
    padding: 16px 24px !important;
    z-index: 100 !important;
}

/* Improve DataTables server-side appearance */
#ticketsTableServerSide_wrapper .dataTables_processing {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
}

/* ===== Additional Enhancements ===== */

/* Dropdown notification menu polish */
.dropdown-menu > .header {
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.navbar-custom-menu .dropdown-menu {
    min-width: 240px;
    border-radius: var(--radius-lg);
}

/* User menu header styling */
.user-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
}

/* Navbar user image */
.navbar-nav > .user-menu > .dropdown-toggle > .user-image {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-full);
}

/* Content header accent */
.content-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

/* Box header tool buttons */
.box-header .btn-box-tool {
    color: var(--text-muted);
    padding: 5px 8px;
    font-size: 13px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.box-header .btn-box-tool:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Link color */
a {
    color: var(--primary);
    transition: color var(--transition-fast);
}

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

/* Breadcrumb active color */
.breadcrumb > li + li::before {
    color: var(--text-muted);
}

/* Callout header */
.callout h4 {
    font-weight: 600;
    margin: 0 0 6px;
}

/* Footer clean up */
.main-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 14px 24px;
    color: var(--text-muted);
    font-size: 12.5px;
}

/* Smooth sidebar transition */
.main-sidebar,
.left-side {
    transition: transform var(--transition-slow), width var(--transition-slow);
}

/* Dark Mode Stub (ready to activate) */
[data-theme="dark"] {
    --bg-primary:   #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary:  #334155;
    --text-primary:   #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted:     #64748b;
    --border-color: #334155;
    --border-light: #1e293b;
}
