/*
 * IT Ticketing System — Premium Theme
 * Custom CSS on top of Bootstrap 5
 * Color palette: Deep slate + Indigo/Purple accents
 */

/* ═══════════════════════════════════════════════
   CSS VARIABLES / DESIGN TOKENS
   ═══════════════════════════════════════════════ */
:root {
    /* Primary palette — Indigo/Purple */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.12);
    --primary-glow: rgba(99, 102, 241, 0.25);

    /* Accent */
    --accent: #8b5cf6;
    --accent-light: rgba(139, 92, 246, 0.12);

    /* Surface / Background */
    --bg-body: #0f1117;
    --bg-surface: #1a1d28;
    --bg-card: #1e2130;
    --bg-card-hover: #252840;
    --bg-input: #252840;
    --bg-sidebar: #13151e;
    --bg-navbar: #0d0f16;

    /* Borders */
    --border-color: rgba(255, 255, 255, 0.06);
    --border-subtle: rgba(255, 255, 255, 0.04);

    /* Text */
    --text-primary: #e8eaf0;
    --text-secondary: #9ca3b4;
    --text-muted: #6b7280;
    --text-on-primary: #ffffff;

    /* Status colors */
    --status-new: #6366f1;
    --status-assigned: #38bdf8;
    --status-progress: #f59e0b;
    --status-pending: #a855f7;
    --status-approved: #14b8a6;
    --status-rejected: #ef4444;
    --status-resolved: #22c55e;
    --status-closed: #6b7280;
    --status-reopened: #1e293b;

    /* Priority colors */
    --priority-low: #22c55e;
    --priority-medium: #f59e0b;
    --priority-high: #f97316;
    --priority-critical: #ef4444;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 20px var(--primary-glow);

    /* Layout */
    --sidebar-width: 260px;
    --navbar-height: 60px;
    --border-radius: 10px;
    --border-radius-sm: 6px;
    --border-radius-lg: 16px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}


/* ═══════════════════════════════════════════════
   BASE / RESET
   ═══════════════════════════════════════════════ */
* {
    box-sizing: border-box;
}

html {
    color-scheme: dark;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Bootstrap's utility classes derive from --bs-secondary-color / --bs-tertiary-color,
   which only follow data-bs-theme. Pin them to our own tokens so contrast stays
   correct even if a component doesn't pick up the theme attribute. */
.text-muted {
    color: var(--text-muted) !important;
}
.text-secondary {
    color: var(--text-secondary) !important;
}
.text-body-secondary {
    color: var(--text-secondary) !important;
}
.form-text {
    color: var(--text-muted);
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.2);
}

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


/* ═══════════════════════════════════════════════
   TOP NAVBAR
   ═══════════════════════════════════════════════ */
.top-navbar {
    background: var(--bg-navbar);
    border-bottom: 1px solid var(--border-color);
    height: var(--navbar-height);
    backdrop-filter: blur(12px);
    z-index: 1040;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #fff;
    box-shadow: var(--shadow-glow);
}

.brand-text {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.nav-search .form-control {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 20px;
    padding-left: 0;
    font-size: 0.85rem;
    width: 220px;
    transition: all var(--transition-normal);
}
.nav-search .form-control:focus {
    background: rgba(255,255,255,0.1);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    width: 300px;
}
.nav-search .input-group-text {
    border: none;
}

.user-avatar {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #fff;
}

.notif-badge {
    font-size: 0.6rem;
    padding: 0.2em 0.45em;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}


/* ═══════════════════════════════════════════════
   NOTIFICATION DROPDOWN
   ═══════════════════════════════════════════════ */
.notification-dropdown {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
}
.notification-dropdown .border-bottom,
.notification-dropdown .border-top {
    border-color: var(--border-color) !important;
}

.notif-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    transition: background var(--transition-fast);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}
.notif-item:hover {
    background: var(--bg-card-hover);
    color: inherit;
}
.notif-item.unread {
    background: var(--primary-light);
}
.notif-item .notif-dot {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 6px;
}


/* ═══════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════ */
.sidebar {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--navbar-height));
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    z-index: 1030;
    transition: transform var(--transition-slow);
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 20px 0;
}

.sidebar-nav {
    flex: 1;
}

.nav-section-title {
    padding: 16px 24px 6px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 450;
    border-radius: 0;
    position: relative;
    transition: all var(--transition-fast);
}
.sidebar-nav .nav-link i {
    font-size: 1.05rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}
.sidebar-nav .nav-link:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.04);
}
.sidebar-nav .nav-link.active {
    color: var(--primary);
    background: var(--primary-light);
    font-weight: 600;
}
.sidebar-nav .nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 3px;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
}

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}


/* ═══════════════════════════════════════════════
   SIDEBAR OVERLAY (MOBILE)
   ═══════════════════════════════════════════════ */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 1025;
}
.sidebar-overlay.show {
    display: block;
}


/* ═══════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════ */
.page-wrapper {
    padding-top: var(--navbar-height);
}

.main-content {
    margin-left: var(--sidebar-width);
    min-height: calc(100vh - var(--navbar-height));
    transition: margin-left var(--transition-slow);
}

.content-wrapper {
    padding: 28px 32px;
    max-width: 1400px;
}


/* ═══════════════════════════════════════════════
   PAGE HEADER
   ═══════════════════════════════════════════════ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 28px;
}
.page-header h1 {
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.02em;
}
.page-header .breadcrumb {
    font-size: 0.8rem;
    margin: 0;
}
.page-header .breadcrumb-item a {
    color: var(--text-muted);
}
.page-header .breadcrumb-item.active {
    color: var(--text-secondary);
}


/* ═══════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}
.card:hover {
    border-color: rgba(255,255,255,0.1);
}
.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 16px 20px;
    font-weight: 600;
    font-size: 0.95rem;
}
.card-body {
    padding: 20px;
}


/* ═══════════════════════════════════════════════
   STAT CARDS (Dashboard)
   ═══════════════════════════════════════════════ */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 22px;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(255,255,255,0.1);
}
.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 16px;
}
.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
    letter-spacing: -0.03em;
}
.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}
.stat-card .stat-trend {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 8px;
}
.stat-card .stat-trend.up { color: #22c55e; }
.stat-card .stat-trend.down { color: #ef4444; }

.stat-card::after {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    opacity: 0.06;
}

.stat-card.stat-primary .stat-icon { background: var(--primary-light); color: var(--primary); }
.stat-card.stat-primary::after { background: var(--primary); }

.stat-card.stat-success .stat-icon { background: rgba(34,197,94,0.12); color: #22c55e; }
.stat-card.stat-success::after { background: #22c55e; }

.stat-card.stat-warning .stat-icon { background: rgba(245,158,11,0.12); color: #f59e0b; }
.stat-card.stat-warning::after { background: #f59e0b; }

.stat-card.stat-danger .stat-icon { background: rgba(239,68,68,0.12); color: #ef4444; }
.stat-card.stat-danger::after { background: #ef4444; }

.stat-card.stat-info .stat-icon { background: rgba(56,189,248,0.12); color: #38bdf8; }
.stat-card.stat-info::after { background: #38bdf8; }

.stat-card.stat-purple .stat-icon { background: var(--accent-light); color: var(--accent); }
.stat-card.stat-purple::after { background: var(--accent); }


/* ═══════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════ */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-primary);
    --bs-table-border-color: var(--border-color);
    --bs-table-hover-bg: rgba(255,255,255,0.03);
    --bs-table-striped-bg: rgba(255,255,255,0.015);
    font-size: 0.875rem;
}
.table thead th {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom-width: 1px;
    padding: 12px 16px;
    white-space: nowrap;
}
.table tbody td {
    padding: 14px 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-subtle);
}
.table tbody tr {
    transition: background var(--transition-fast);
}
.table tbody tr:hover {
    background: var(--bg-card-hover) !important;
}

.ticket-row {
    cursor: pointer;
}
.ticket-row .ticket-id {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary);
}
.ticket-row .ticket-title {
    font-weight: 500;
    color: var(--text-primary);
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* ═══════════════════════════════════════════════
   BADGES — Status & Priority
   ═══════════════════════════════════════════════ */
.badge {
    font-weight: 600;
    font-size: 0.72rem;
    padding: 0.35em 0.7em;
    border-radius: 5px;
    letter-spacing: 0.02em;
}

.bg-purple { background-color: var(--status-pending) !important; color: #fff; }
.bg-teal { background-color: var(--status-approved) !important; color: #fff; }

.priority-low { background: rgba(34,197,94,0.15); color: #22c55e; }
.priority-medium { background: rgba(245,158,11,0.15); color: #f59e0b; }
.priority-high { background: rgba(249,115,22,0.15); color: #f97316; }
.priority-critical { background: rgba(239,68,68,0.15); color: #ef4444; border: 1px solid rgba(239,68,68,0.3); }


/* ═══════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════ */
.form-control,
.form-select {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    padding: 0.55rem 0.85rem;
    transition: all var(--transition-fast);
}
.form-control:focus,
.form-select:focus {
    background-color: var(--bg-input);
    color: var(--text-primary);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.form-control::placeholder {
    color: var(--text-muted);
}
/* color-scheme: dark (set on <html>) makes most browsers render the native
   <select> popup dark automatically, but Firefox/older Chromium need the
   <option> background/color set explicitly or the text stays unreadable. */
.form-select option {
    background-color: var(--bg-input);
    color: var(--text-primary);
}
.form-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-check-input {
    background-color: var(--bg-input);
    border-color: var(--border-color);
}
.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}
.form-check-input:focus {
    box-shadow: 0 0 0 3px var(--primary-light);
}

.input-group-text {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.875rem;
}


/* ═══════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════ */
.btn {
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    padding: 0.5rem 1.15rem;
    transition: all var(--transition-fast);
    letter-spacing: 0.01em;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border: none;
    color: #fff;
    box-shadow: 0 2px 8px var(--primary-glow);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover), #7c3aed);
    box-shadow: 0 4px 16px var(--primary-glow);
    transform: translateY(-1px);
}

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

.btn-outline-light {
    border-color: var(--border-color);
    color: var(--text-secondary);
}
.btn-outline-light:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.15);
    color: var(--text-primary);
}

.btn-success {
    background: #22c55e;
    border: none;
}
.btn-success:hover {
    background: #16a34a;
}

.btn-danger {
    background: #ef4444;
    border: none;
}
.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 0.35rem 0.8rem;
    font-size: 0.78rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-sm);
}


/* ═══════════════════════════════════════════════
   ALERTS / TOASTS
   ═══════════════════════════════════════════════ */
.alert {
    border-radius: var(--border-radius-sm);
    border: none;
    font-size: 0.875rem;
    backdrop-filter: blur(8px);
}
.alert-success {
    background: rgba(34,197,94,0.12);
    color: #22c55e;
    border-left: 3px solid #22c55e;
}
.alert-danger {
    background: rgba(239,68,68,0.12);
    color: #ef4444;
    border-left: 3px solid #ef4444;
}
.alert-warning {
    background: rgba(245,158,11,0.12);
    color: #f59e0b;
    border-left: 3px solid #f59e0b;
}
.alert-info {
    background: rgba(56,189,248,0.12);
    color: #38bdf8;
    border-left: 3px solid #38bdf8;
}


/* ═══════════════════════════════════════════════
   DROPDOWN MENUS
   ═══════════════════════════════════════════════ */
.dropdown-menu {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 6px;
}
.dropdown-item {
    color: var(--text-secondary);
    border-radius: var(--border-radius-sm);
    padding: 8px 14px;
    font-size: 0.85rem;
    transition: all var(--transition-fast);
}
.dropdown-item:hover {
    background: var(--primary-light);
    color: var(--primary);
}
.dropdown-divider {
    border-color: var(--border-color);
}


/* ═══════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════ */
.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
}
.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 18px 24px;
}
.modal-header .btn-close {
    filter: invert(1);
}
.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 14px 24px;
}
.modal-title {
    font-weight: 700;
    font-size: 1.1rem;
}


/* ═══════════════════════════════════════════════
   TICKET DETAIL
   ═══════════════════════════════════════════════ */
.ticket-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}
.ticket-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255,255,255,0.01);
}
.meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.meta-item .meta-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}
.meta-item .meta-value {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Activity Timeline */
.activity-timeline {
    padding: 20px 24px;
}
.timeline-item {
    display: flex;
    gap: 16px;
    position: relative;
    padding-bottom: 24px;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: 17px;
    top: 40px;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}
.timeline-item:last-child::before {
    display: none;
}
.timeline-item:last-child {
    padding-bottom: 0;
}
.timeline-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
}
.timeline-dot.comment { background: var(--primary-light); color: var(--primary); }
.timeline-dot.status { background: rgba(245,158,11,0.12); color: #f59e0b; }
.timeline-dot.assign { background: rgba(56,189,248,0.12); color: #38bdf8; }
.timeline-dot.approval { background: rgba(139,92,246,0.12); color: var(--accent); }
.timeline-dot.internal { background: rgba(107,114,128,0.15); color: var(--text-muted); }

.timeline-content {
    flex: 1;
    min-width: 0;
}
.timeline-content .timeline-author {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
}
.timeline-content .timeline-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.timeline-content .timeline-body {
    margin-top: 8px;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-secondary);
}
.timeline-content .timeline-body.internal-note {
    background: rgba(245,158,11,0.06);
    border: 1px solid rgba(245,158,11,0.15);
    border-radius: var(--border-radius-sm);
    padding: 12px 16px;
}


/* ═══════════════════════════════════════════════
   COMMENT BOX
   ═══════════════════════════════════════════════ */
.comment-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
}
.comment-box .ql-toolbar {
    border-color: var(--border-color);
    border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
}
.comment-box .ql-container {
    border-color: var(--border-color);
    border-radius: 0 0 var(--border-radius-sm) var(--border-radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    color: var(--text-primary);
    min-height: 100px;
}
.comment-box .ql-editor {
    background: var(--bg-input);
}
.comment-box .ql-editor.ql-blank::before {
    color: var(--text-muted);
    font-style: normal;
}


/* ═══════════════════════════════════════════════
   FILTER BAR
   ═══════════════════════════════════════════════ */
.filter-bar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: end;
}
.filter-bar .form-group {
    flex: 1;
    min-width: 150px;
}
.filter-bar .form-group label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 5px;
}
.filter-bar .form-control,
.filter-bar .form-select {
    font-size: 0.82rem;
    padding: 0.45rem 0.75rem;
}


/* ═══════════════════════════════════════════════
   CHARTS
   ═══════════════════════════════════════════════ */
.chart-container {
    position: relative;
    padding: 16px;
}


/* ═══════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}
.empty-state i {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    display: block;
    opacity: 0.5;
}
.empty-state h5 {
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 8px;
}
.empty-state p {
    color: var(--text-muted);
    font-size: 0.875rem;
}


/* ═══════════════════════════════════════════════
   LOADING SPINNER
   ═══════════════════════════════════════════════ */
.spinner-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15,17,23,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: var(--border-radius);
}
.spinner-overlay .spinner-border {
    color: var(--primary);
}


/* ═══════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-body);
    position: relative;
    overflow: hidden;
}
.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(99,102,241,0.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(139,92,246,0.06) 0%, transparent 50%);
    animation: bgFloat 20s ease-in-out infinite;
}
@keyframes bgFloat {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(-20px, 10px); }
    66% { transform: translate(20px, -10px); }
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
}
.login-card .login-brand {
    text-align: center;
    margin-bottom: 32px;
}
.login-card .login-brand .brand-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    font-size: 1.6rem;
}
.login-card .login-brand h1 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.login-card .login-brand p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 4px;
}


/* ═══════════════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════════════ */
.pagination .page-link {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-secondary);
    font-size: 0.8rem;
    padding: 6px 12px;
}
.pagination .page-link:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
    color: var(--primary);
}
.pagination .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.pagination .page-item.disabled .page-link {
    background: var(--bg-surface);
    border-color: var(--border-color);
    color: var(--text-muted);
}


/* ═══════════════════════════════════════════════
   Quill editor dark theme overrides
   ═══════════════════════════════════════════════ */
.ql-toolbar.ql-snow {
    background: var(--bg-surface);
}
.ql-toolbar .ql-stroke {
    stroke: var(--text-secondary) !important;
}
.ql-toolbar .ql-fill {
    fill: var(--text-secondary) !important;
}
.ql-toolbar .ql-picker-label {
    color: var(--text-secondary) !important;
}
.ql-toolbar button:hover .ql-stroke,
.ql-toolbar .ql-picker-label:hover .ql-stroke {
    stroke: var(--primary) !important;
}
.ql-toolbar button:hover .ql-fill {
    fill: var(--primary) !important;
}
.ql-toolbar .ql-picker-options {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
}
.ql-snow .ql-picker-options .ql-picker-item {
    color: var(--text-secondary);
}


/* ═══════════════════════════════════════════════
   SLA PROGRESS BAR
   ═══════════════════════════════════════════════ */
.sla-progress {
    height: 4px;
    background: rgba(255,255,255,0.06);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 6px;
}
.sla-progress .sla-bar {
    height: 100%;
    border-radius: 2px;
    transition: width var(--transition-slow);
}
.sla-bar.on-track { background: #22c55e; }
.sla-bar.warning { background: #f59e0b; }
.sla-bar.breached { background: #ef4444; }


/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .content-wrapper {
        padding: 20px 16px;
    }
}

@media (max-width: 575.98px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .filter-bar {
        flex-direction: column;
    }
    .filter-bar .form-group {
        min-width: 100%;
    }
    .login-card {
        margin: 16px;
        padding: 28px 24px;
    }
    .stat-card .stat-value {
        font-size: 1.4rem;
    }
}


/* ═══════════════════════════════════════════════
   UTILITY HELPERS
   ═══════════════════════════════════════════════ */
.text-primary-custom { color: var(--primary) !important; }
.bg-primary-subtle { background: var(--primary-light) !important; }
.border-primary-subtle { border-color: rgba(99,102,241,0.3) !important; }
.glass-card {
    background: rgba(30, 33, 48, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
}
.fade-in {
    animation: fadeIn 0.4s ease-in;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.slide-up {
    animation: slideUp 0.5s var(--transition-slow);
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
