/* =============================================================
   Support Services Management Hub - Clean Light Mode Stylesheet
   ============================================================= */

:root {
    --bg-primary: #f8fafc; /* Slate 50 */
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --border-card: #e2e8f0; /* Slate 200 */
    --border-focus: #4f46e5; /* Indigo 600 */
    
    --text-primary: #0f172a; /* Slate 900 */
    --text-secondary: #334155; /* Slate 700 */
    --text-muted: #64748b; /* Slate 500 */
    
    --primary: #4f46e5; /* Indigo 600 */
    --primary-hover: #4338ca;
    --primary-glow: rgba(79, 70, 229, 0.08);
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    
    --secondary: #0d9488; /* Teal */
    --secondary-hover: #0f766e;
    --secondary-glow: rgba(13, 148, 136, 0.12);
    
    --success: #10b981; /* Emerald */
    --warning: #f59e0b; /* Amber */
    --danger: #ef4444; /* Rose */
    --info: #0ea5e9; /* Sky Blue */
    
    /* Priority Colors */
    --priority-low: #10b981;
    --priority-medium: #f59e0b;
    --priority-high: #f97316;
    --priority-critical: #ef4444;
    
    /* Status Colors */
    --status-new: #2563eb; /* Blue */
    --status-progress: #ea580c; /* Orange */
    --status-pending: #a855f7; /* Purple */
    --status-resolved: #10b981; /* Emerald */
    --status-closed: #64748b; /* Slate */
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --sidebar-width: 280px;
    --header-height: 80px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
}

body {
    background-color: var(--bg-primary);
    background-image: 
        radial-gradient(at 0% 0%, rgba(37, 99, 235, 0.04) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(13, 148, 136, 0.03) 0px, transparent 50%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* App Container Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-card);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    box-shadow: 2px 0 8px rgba(15, 23, 42, 0.02);
}

.sidebar-logo {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 12px;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.text-accent {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.role-badge-container {
    padding: 0 24px 16px 24px;
}

.role-badge {
    background: var(--primary-gradient);
    color: white;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 6px 14px;
    border-radius: 30px;
    text-align: center;
    box-shadow: 0 4px 12px var(--primary-glow);
    transition: var(--transition-smooth);
}

.sidebar-nav {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
}

.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-item-btn {
    width: 100%;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    text-align: left;
    transition: var(--transition-smooth);
}

.nav-item-btn svg {
    color: var(--text-muted);
    transition: var(--transition-smooth);
}

.nav-item-btn:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.nav-item-btn:hover svg {
    transform: translateX(3px);
    color: var(--primary);
}

.nav-item-btn.active {
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary);
    border-left: 3px solid var(--primary);
    padding-left: 13px;
}

.nav-item-btn.active svg {
    color: var(--primary);
}

.nav-item-btn.highlight-btn {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 12px var(--primary-glow);
    margin-top: 12px;
}

.nav-item-btn.highlight-btn svg {
    color: white;
}

.nav-item-btn.highlight-btn:hover {
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
    transform: translateY(-1px);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-card);
    background: #f8fafc;
}

.user-profile-summary {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    font-family: var(--font-heading);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.user-role-label {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Main Content Area */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styling */
.app-header {
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-card);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.01);
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

#global-search {
    background: #f1f5f9;
    border: 1px solid var(--border-card);
    padding: 10px 16px 10px 44px;
    border-radius: 30px;
    color: var(--text-primary);
    font-size: 14px;
    width: 320px;
    transition: var(--transition-smooth);
}

#global-search:focus {
    width: 420px;
    background: var(--bg-secondary);
    border-color: var(--border-focus);
    box-shadow: 0 0 12px rgba(37, 99, 235, 0.08);
    outline: none;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 24px;
}

.role-switcher-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(37, 99, 235, 0.05);
    padding: 6px 14px;
    border-radius: 30px;
    border: 1px dashed rgba(37, 99, 235, 0.25);
}

.role-switcher-wrapper label {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
}

.role-select {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-card);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: var(--transition-smooth);
}

.role-select:focus {
    border-color: var(--primary);
}

.notification-btn {
    position: relative;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    background: #f1f5f9;
    border: 1px solid var(--border-card);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.notification-btn:hover {
    background: #e2e8f0;
}

.notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
}

/* Notifications Dropdown */
.notif-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 320px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: var(--transition-smooth);
    z-index: 200;
}

.notif-dropdown.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.notif-header {
    padding: 12px 16px;
    font-weight: 700;
    border-bottom: 1px solid var(--border-card);
    font-size: 14px;
    color: var(--text-primary);
}

.notif-list {
    max-height: 250px;
    overflow-y: auto;
}

.notif-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.notif-item:hover {
    background: #f8fafc;
    color: var(--text-primary);
}

.notif-item.unread {
    background: rgba(37, 99, 235, 0.03);
    border-left: 3px solid var(--primary);
    color: var(--text-primary);
    font-weight: 600;
}

.notif-time {
    display: block;
    color: var(--text-muted);
    font-size: 11px;
    margin-top: 4px;
}

/* Content Body */
.content-body {
    padding: 32px;
    flex: 1;
    overflow-y: auto;
}

/* Typography and Page Titles */
.page-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-title {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Clean Dashboard Cards */
.glass-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.01), 0 2px 4px -1px rgba(0, 0, 0, 0.01);
    transition: var(--transition-smooth);
}

.glass-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

/* Grid Systems */
.grid-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.grid-dashboard-charts {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

@media (max-width: 1024px) {
    .grid-dashboard-charts {
        grid-template-columns: 1fr;
    }
}

/* KPI Card Custom Styling */
.kpi-card {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.kpi-card.clickable {
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card.clickable:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.08);
}

.kpi-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpi-icon.indigo { background: rgba(37, 99, 235, 0.08); border: 1px solid rgba(37, 99, 235, 0.2); color: var(--primary); }
.kpi-icon.teal { background: rgba(13, 148, 136, 0.08); border: 1px solid rgba(13, 148, 136, 0.2); color: var(--secondary); }
.kpi-icon.amber { background: rgba(245, 158, 11, 0.08); border: 1px solid rgba(245, 158, 11, 0.2); color: var(--warning); }
.kpi-icon.rose { background: rgba(239, 68, 68, 0.08); border: 1px solid rgba(239, 68, 68, 0.2); color: var(--danger); }

.kpi-details {
    display: flex;
    flex-direction: column;
}

.kpi-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
}

.kpi-value {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 700;
    margin-top: 4px;
    color: var(--text-primary);
}

.kpi-trend {
    font-size: 11px;
    margin-top: 4px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}

.kpi-trend.positive { color: #059669; }
.kpi-trend.neutral { color: var(--text-secondary); }
.kpi-trend.negative { color: var(--danger); }

/* Buttons & Badges */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    outline: none;
    transition: var(--transition-smooth);
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-primary:hover {
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #ffffff;
    color: var(--text-primary);
    border: 1px solid #cbd5e1;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02);
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.btn-excel {
    background: #107c41;
    color: white;
    border: 1px solid #0e6c38;
    box-shadow: 0 4px 12px rgba(16, 124, 65, 0.15);
}

.btn-excel:hover {
    background: #0e6c38;
    box-shadow: 0 6px 16px rgba(16, 124, 65, 0.25);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Badges styling */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 30px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-low { background: #e8f5e9; color: #1b5e20; border: 1px solid #c8e6c9; }
.badge-medium { background: #fffde7; color: #f57f17; border: 1px solid #fff9c4; }
.badge-high { background: #fff3e0; color: #e65100; border: 1px solid #ffe0b2; }
.badge-critical { background: #ffebee; color: #b71c1c; border: 1px solid #ffcdd2; animation: pulse-red 2s infinite; }

.badge-new { background: #e3f2fd; color: #0d47a1; border: 1px solid #bbdefb; }
.badge-progress { background: #fff3e0; color: #e65100; border: 1px solid #ffe0b2; }
.badge-pending { background: #f3e5f5; color: #4a148c; border: 1px solid #e1bee7; }
.badge-resolved { background: #e8f5e9; color: #1b5e20; border: 1px solid #c8e6c9; }
.badge-closed { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }

/* SVG Charts & SVG Elements */
.chart-container {
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.legend-item.clickable {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.legend-item.clickable:hover {
    background-color: var(--bg-primary);
    color: var(--primary);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

/* Custom SVG Donut Chart */
.svg-donut {
    width: 200px;
    height: 200px;
    transform: rotate(-90deg);
}

.donut-segment {
    fill: none;
    stroke-width: 14;
    stroke-linecap: round;
    transition: var(--transition-smooth);
}

.donut-segment.clickable {
    cursor: pointer;
    transition: stroke-width 0.2s ease, opacity 0.2s ease;
}

.donut-segment.clickable:hover {
    stroke-width: 17;
    opacity: 0.9;
}

.donut-hole {
    fill: var(--bg-secondary);
}

.donut-center-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.donut-center-num {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
}

.donut-center-lbl {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
    font-weight: 600;
}

/* Custom SVG Bar Chart */
.svg-bar-chart {
    width: 100%;
    height: 240px;
}

.chart-bar {
    fill: url(#bar-grad);
    rx: 6;
    transition: var(--transition-smooth);
}

.chart-bar:hover {
    fill: url(#bar-grad-hover);
    filter: drop-shadow(0px 2px 4px rgba(37, 99, 235, 0.15));
}

.chart-axis-line {
    stroke: #e2e8f0;
    stroke-width: 1.5;
}

.chart-grid-line {
    stroke: #f1f5f9;
    stroke-width: 1;
    stroke-dasharray: 4;
}

.chart-text {
    fill: var(--text-secondary);
    font-size: 10px;
    font-family: var(--font-body);
    font-weight: 500;
}

.chart-text.bar-label {
    fill: var(--text-primary);
    font-size: 11px;
    font-weight: 600;
}

/* SLA Monitoring Gauges */
.sla-performance-box {
    margin-top: 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    padding: 16px;
}

.sla-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.sla-item-row:last-child {
    margin-bottom: 0;
}

.sla-customer-name {
    font-size: 13px;
    font-weight: 700;
}

.sla-bar-container {
    width: 120px;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.sla-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1s ease-out;
}

.sla-pct-label {
    font-size: 12px;
    font-weight: 700;
    min-width: 36px;
    text-align: right;
    color: var(--text-primary);
}

/* Contracts Timeline widget */
.contract-timeline-widget {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contract-progress-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 14px;
    border-radius: var(--radius-sm);
    transition: var(--transition-smooth);
}

.contract-progress-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.contract-progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.contract-progress-days {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 6px;
    text-align: right;
}

/* Clean Slate Table View */
.table-container {
    overflow-x: auto;
    margin-top: 16px;
}

.support-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.support-table th {
    padding: 14px 18px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    border-bottom: 1px solid var(--border-card);
    background: #f8fafc;
}

.support-table td {
    padding: 16px 18px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    color: var(--text-secondary);
    transition: var(--transition-smooth);
}

.support-table tbody tr {
    cursor: pointer;
    transition: var(--transition-smooth);
}

.support-table tbody tr:hover td {
    background: rgba(37, 99, 235, 0.02);
    color: var(--text-primary);
}

.ticket-row-title-area {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ticket-row-id {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 700;
    font-family: var(--font-heading);
}

.ticket-row-subject {
    font-weight: 700;
    color: var(--text-primary);
}

.sla-breached-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--danger);
    font-size: 11px;
    font-weight: 700;
    animation: flash-red 1.5s infinite;
}

.sla-normal-indicator {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 600;
}

.filters-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 16px;
    flex-wrap: wrap;
}

.filters-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-select {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.01);
    transition: var(--transition-smooth);
}

.filter-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 8px rgba(37, 99, 235, 0.08);
}

/* Detail Slider Drawer */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(4px);
    z-index: 990;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
}

.drawer-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.detail-drawer {
    position: fixed;
    top: 0;
    right: -560px;
    width: 540px;
    height: 100vh;
    background: #ffffff;
    border-left: 1px solid var(--border-card);
    box-shadow: -10px 0 40px rgba(15, 23, 42, 0.06);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.detail-drawer.show {
    right: 0;
}

.drawer-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-card);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.drawer-ticket-id {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    display: block;
}

.drawer-title {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 4px;
    line-height: 1.4;
}

.close-drawer-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: var(--transition-smooth);
    display: flex;
}

.close-drawer-btn:hover {
    background: #f1f5f9;
    color: var(--text-primary);
}

.drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.drawer-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    background: #f8fafc;
    padding: 16px;
    border-radius: var(--radius-sm);
    border: 1px solid #e2e8f0;
    margin-bottom: 24px;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.grid-span-2 {
    grid-column: span 2;
}

.meta-label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
}

.meta-value {
    font-size: 13px;
    font-weight: 600;
}

.meta-select-status {
    background: #ffffff;
    color: var(--text-primary);
    border: 1px solid #cbd5e1;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    outline: none;
    cursor: pointer;
}

.meta-select-agent {
    background: #ffffff;
    color: var(--text-primary);
    border: 1px solid #cbd5e1;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    width: 100%;
}

.sla-monitor-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 24px;
}

.sla-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.sla-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

.sla-time {
    font-size: 13px;
    font-weight: 700;
}

.sla-progress-bar {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.sla-progress-fill {
    height: 100%;
    background: var(--success);
    border-radius: 3px;
    transition: width 0.5s ease-out;
}

.sla-status-text {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}

.drawer-section {
    margin-bottom: 24px;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
    border-left: 3px solid var(--primary);
    padding-left: 8px;
}

.description-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    padding: 14px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    white-space: pre-wrap;
}

/* Action Tab Body */
.action-tab-header {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-card);
    margin-bottom: 14px;
}

.action-tab {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition-smooth);
}

.action-tab:hover {
    color: var(--primary);
}

.action-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.action-textarea {
    width: 100%;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    padding: 12px;
    color: var(--text-primary);
    font-size: 13px;
    resize: vertical;
    outline: none;
    min-height: 80px;
    margin-bottom: 12px;
    transition: var(--transition-smooth);
}

.action-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 8px rgba(37, 99, 235, 0.08);
}

.action-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Timeline ui */
.timeline {
    position: relative;
    padding-left: 20px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: #e2e8f0;
}

.timeline-item {
    position: relative;
    padding-bottom: 20px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -20px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-muted);
    border: 2px solid #ffffff;
}

.timeline-dot.new { background: var(--status-new); }
.timeline-dot.comment { background: var(--primary); }
.timeline-dot.note { background: var(--status-pending); }
.timeline-dot.resolve { background: var(--status-resolved); }

.timeline-content {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 13px;
}

.timeline-meta {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 11px;
    margin-bottom: 6px;
    font-weight: 600;
}

.timeline-actor {
    color: var(--text-primary);
    font-weight: 700;
}

.timeline-msg {
    color: var(--text-secondary);
    line-height: 1.5;
}

.timeline-msg.internal-note-text {
    color: #6b21a8;
    background: #f3e8ff;
    padding: 6px 10px;
    border-radius: 4px;
    border-left: 3px solid var(--status-pending);
    margin-top: 4px;
}

/* Modals General */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: #ffffff;
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    width: 580px;
    max-width: 90%;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.1);
    transform: scale(0.95);
    transition: var(--transition-smooth);
    overflow: hidden;
}

.modal-overlay.show .modal-card {
    transform: scale(1);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-card);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
}

.modal-header h2 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.close-modal-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    transition: var(--transition-smooth);
}

.close-modal-btn:hover {
    background: #e2e8f0;
    color: var(--text-primary);
}

/* Form Styling */
form {
    padding: 24px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
    width: 100%;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: var(--transition-smooth);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 8px rgba(37, 99, 235, 0.08);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    border-top: 1px solid var(--border-card);
    padding-top: 20px;
}

/* Animations */
@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.2);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

@keyframes flash-red {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-out forwards;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-heading {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-heading::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
}

/* Empty State Styling */
.empty-state {
    padding: 48px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.empty-state svg {
    margin-bottom: 16px;
    color: var(--text-muted);
}

.empty-state h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.empty-state p {
    font-size: 13px;
    max-width: 320px;
    margin: 0 auto;
}

/* Workload Bar elements style */
.workload-stat-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.workload-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.workload-info {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
}

.workload-name {
    font-weight: 700;
    color: var(--text-primary);
}

.workload-count {
    font-weight: 600;
}

.workload-track {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.workload-fill {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 4px;
    width: 0;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* File Upload Styles */
.file-upload-wrapper {
    position: relative;
    margin-top: 6px;
}

.file-list-preview {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-preview-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.file-preview-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.file-preview-info svg {
    color: var(--text-muted);
}

.file-preview-name {
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.file-preview-size {
    font-size: 11px;
    color: var(--text-secondary);
}

.btn-remove-file {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    display: flex;
    padding: 4px;
    border-radius: 50%;
    transition: var(--transition-smooth);
}

.btn-remove-file:hover {
    background: rgba(239, 68, 68, 0.08);
}

/* Attachments Display in Drawer */
.attachments-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.attachment-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--transition-smooth);
    position: relative;
}

.attachment-card:hover {
    border-color: #cbd5e1;
    background: #f1f5f9;
}

.attachment-preview-img {
    height: 90px;
    width: 100%;
    object-fit: cover;
    cursor: pointer;
    background: #f1f5f9;
}

.attachment-file-icon {
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: var(--text-muted);
    border-bottom: 1px solid #e2e8f0;
}

.attachment-info {
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.attachment-name {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2px;
}

.btn-attachment-action {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    transition: var(--transition-smooth);
}

.btn-attachment-action:hover {
    background: rgba(37, 99, 235, 0.08);
}

/* Log View Pre/Code Block */
.log-preview-block {
    grid-column: span 2;
    margin-top: 10px;
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: var(--radius-sm);
    padding: 12px;
    position: relative;
    max-height: 240px;
    overflow-y: auto;
}

.log-preview-block pre {
    margin: 0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    color: #38bdf8;
    white-space: pre-wrap;
    word-break: break-all;
}

.log-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 6px;
}

.log-preview-title {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
}

/* Lightbox Overlay */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
}

.lightbox-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-overlay img {
    max-width: 90%;
    max-height: 90%;
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    transform: scale(0.95);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lightbox-overlay.show img {
    transform: scale(1);
}

/* =============================================================
   Interactive Work & Task Calendar Styles
   ============================================================= */
.calendar-view-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.calendar-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    padding: 16px 24px;
    border-radius: var(--radius-md);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.02);
}

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.calendar-month-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    min-width: 180px;
    text-align: center;
    color: var(--text-primary);
}

.calendar-grid-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.01), 0 2px 4px -1px rgba(0, 0, 0, 0.01);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 700;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-card);
    padding-bottom: 12px;
    margin-bottom: 8px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: minmax(110px, auto);
    gap: 8px;
}

.calendar-day-cell {
    border: 1px solid #f1f5f9;
    border-radius: var(--radius-sm);
    padding: 8px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: var(--transition-smooth);
    min-height: 110px;
    position: relative;
}

.calendar-day-cell:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.calendar-day-number {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 4px;
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    border-radius: 50%;
}

.calendar-day-cell.today .calendar-day-number {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 2px 6px var(--primary-glow);
}

.calendar-day-cell.today {
    background: rgba(79, 70, 229, 0.02);
    border-color: rgba(79, 70, 229, 0.2);
}

.calendar-day-cell.other-month {
    background: #f8fafc;
    border-color: #f1f5f9;
}

.calendar-day-cell.other-month .calendar-day-number {
    color: var(--text-muted);
}

.calendar-events-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    max-height: 80px;
}

.calendar-event-capsule {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
}

.calendar-event-capsule:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.06);
}

/* Event capsule colors based on ticket attributes */
.event-low {
    background: rgba(16, 185, 129, 0.08);
    color: #065f46;
    border-color: rgba(16, 185, 129, 0.2);
}

.event-medium {
    background: rgba(245, 158, 11, 0.08);
    color: #92400e;
    border-color: rgba(245, 158, 11, 0.2);
}

.event-high {
    background: rgba(249, 115, 22, 0.08);
    color: #9a3412;
    border-color: rgba(249, 115, 22, 0.2);
}

.event-critical {
    background: rgba(239, 68, 68, 0.08);
    color: #991b1b;
    border-color: rgba(239, 68, 68, 0.25);
    animation: pulse-red-border 2s infinite;
}

.event-sla-deadline {
    background: rgba(168, 85, 247, 0.08);
    color: #6b21a8;
    border-color: rgba(168, 85, 247, 0.2);
    border-style: dashed;
}

@keyframes pulse-red-border {
    0% { border-color: rgba(239, 68, 68, 0.25); }
    50% { border-color: rgba(239, 68, 68, 0.6); }
    100% { border-color: rgba(239, 68, 68, 0.25); }
}

/* =============================================================
   Login Screen & Session Styles
   ============================================================= */
.login-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #f8fafc; /* Slate 50 */
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(13, 148, 136, 0.04) 0px, transparent 50%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000;
}

.login-card {
    background: #ffffff;
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    width: 440px;
    max-width: 90%;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
    animation: fadeIn 0.4s ease-out forwards;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
}

.login-title {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 24px;
}

.logout-btn:hover {
    background: #f1f5f9;
    color: var(--danger) !important;
}

#change-password-btn:hover {
    background: #f1f5f9;
    color: var(--primary) !important;
}

#forgot-password-link:hover {
    color: #4338ca !important;
    text-decoration: underline !important;
}


