/* ==========================================================================
   CAU CrewCore — Design System
   Professional ITSM Dark Theme
   ========================================================================== */

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

/* ---------- CSS Custom Properties ---------- */
:root {
    /* Colors */
    --bg-primary: #0b0e14;
    --bg-secondary: #111827;
    --bg-tertiary: #1f2937;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);

    /* Glass */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);

    /* Accent */
    --accent: #0ea5e9;
    --accent-hover: #38bdf8;
    --accent-glow: rgba(14, 165, 233, 0.15);
    --accent-secondary: #6366f1;
    --accent-gradient: linear-gradient(135deg, #0ea5e9, #6366f1);

    /* Text */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #475569;

    /* Borders */
    --border-color: rgba(255, 255, 255, 0.06);
    --border-active: rgba(14, 165, 233, 0.4);

    /* Status Colors */
    --status-new: #3b82f6;
    --status-open: #f59e0b;
    --status-progress: #8b5cf6;
    --status-waiting: #ec4899;
    --status-resolved: #10b981;
    --status-closed: #6b7280;

    /* Priority Colors */
    --priority-low: #6b7280;
    --priority-medium: #f59e0b;
    --priority-high: #ef4444;
    --priority-critical: #dc2626;

    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    --topbar-height: 60px;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-display: 'Outfit', 'Inter', sans-serif;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transitions */
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a:hover {
    color: var(--accent-hover);
}

/* ---------- App Shell ---------- */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    z-index: 1000;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.app-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

/* ---------- Sidebar ---------- */
.sidebar-brand {
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand-icon {
    width: 36px;
    height: 36px;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sidebar-brand-text {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.sidebar-brand-text small {
    display: block;
    font-family: var(--font-sans);
    font-size: 0.65rem;
    font-weight: 500;
    -webkit-text-fill-color: var(--text-muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-top: 2px;
}

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

.sidebar-section {
    padding: 8px 16px 4px;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-top: 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    border-left: 3px solid transparent;
    position: relative;
}

.sidebar-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.sidebar-link.active {
    color: var(--accent);
    background: var(--accent-glow);
    border-left-color: var(--accent);
}

.sidebar-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-badge {
    margin-left: auto;
    background: var(--accent);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.sidebar-user {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ---------- Top Bar ---------- */
.app-topbar {
    height: var(--topbar-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 900;
    gap: 16px;
}

.topbar-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: none;
}

.topbar-toggle:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.topbar-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
}

.topbar-spacer {
    flex: 1;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-btn {
    position: relative;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.topbar-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.topbar-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    background: #ef4444;
    border-radius: 50%;
    font-size: 0.55rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-secondary);
}

/* ---------- Main Content ---------- */
.app-content {
    flex: 1;
    padding: 24px;
}

.page-header {
    margin-bottom: 24px;
}

.page-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0;
}

/* ---------- Cards ---------- */
.card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: var(--transition);
}

.card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.1);
}

.card-body {
    padding: 20px;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* ---------- KPI Cards ---------- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--kpi-color, var(--accent));
    border-radius: 3px 3px 0 0;
}

.kpi-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.kpi-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 14px;
    background: var(--kpi-color, var(--accent));
    color: #fff;
    opacity: 0.9;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
    font-variant-numeric: tabular-nums;
}

.kpi-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.kpi-delta {
    font-size: 0.7rem;
    font-weight: 600;
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
}

.kpi-delta.up {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.kpi-delta.down {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* ---------- Tables ---------- */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.table thead th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

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

.table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.table tbody td {
    padding: 12px 16px;
    color: var(--text-primary);
    vertical-align: middle;
}

/* ---------- Badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-status {
    background: rgba(var(--badge-rgb, 107, 114, 128), 0.15);
    color: var(--badge-color, #6b7280);
}

.badge-new {
    --badge-color: #3b82f6;
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
}

.badge-open {
    --badge-color: #f59e0b;
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}

.badge-in_progress {
    --badge-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.12);
    color: #8b5cf6;
}

.badge-waiting {
    --badge-color: #ec4899;
    background: rgba(236, 72, 153, 0.12);
    color: #ec4899;
}

.badge-resolved {
    --badge-color: #10b981;
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}

.badge-closed {
    --badge-color: #6b7280;
    background: rgba(107, 114, 128, 0.12);
    color: #6b7280;
}

.badge-low {
    background: rgba(107, 114, 128, 0.12);
    color: #6b7280;
}

.badge-medium {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}

.badge-high {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.badge-critical {
    background: rgba(220, 38, 38, 0.15);
    color: #dc2626;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.35);
    color: #fff;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.78rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 0.95rem;
}

.btn-icon {
    padding: 8px;
}

/* ---------- Forms ---------- */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--border-active);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

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

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8.825L1.175 4 2.238 2.938 6 6.7 9.763 2.938 10.825 4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* ---------- Notification Dropdown ---------- */
.notification-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 380px;
    max-height: 440px;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: none;
    overflow: hidden;
}

.notification-dropdown.show {
    display: block;
}

.notification-dropdown-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 0.9rem;
}

.notification-list {
    max-height: 360px;
    overflow-y: auto;
}

.notification-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    gap: 12px;
}

.notification-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.notification-item.unread {
    background: rgba(14, 165, 233, 0.04);
    border-left: 3px solid var(--accent);
}

.notification-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
    background: rgba(14, 165, 233, 0.1);
    color: var(--accent);
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-weight: 600;
    font-size: 0.82rem;
    margin-bottom: 2px;
}

.notification-body {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-time {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ---------- Alerts ---------- */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.15);
    color: #fb7185;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.alert-info {
    background: rgba(14, 165, 233, 0.08);
    border: 1px solid rgba(14, 165, 233, 0.15);
    color: #38bdf8;
}

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

.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state h3 {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.85rem;
}

/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: center;
    margin-top: 20px;
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: var(--transition);
}

.pagination a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.pagination .active {
    background: var(--accent);
    color: #fff;
}

/* ---------- Ticket Timeline ---------- */
.timeline {
    position: relative;
    padding-left: 24px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

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

.timeline-dot {
    position: absolute;
    left: -24px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg-primary);
}

.timeline-dot.comment {
    background: #3b82f6;
}

.timeline-dot.status {
    background: #f59e0b;
}

.timeline-dot.assignment {
    background: #8b5cf6;
}

.timeline-dot.internal {
    background: #6b7280;
}

.timeline-content {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
}

.timeline-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.82rem;
}

.timeline-author {
    font-weight: 600;
    color: var(--text-primary);
}

.timeline-time {
    color: var(--text-muted);
    font-size: 0.72rem;
}

.timeline-body {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ---------- Search & Filters ---------- */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.search-input {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.search-input input {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 14px 10px 38px;
    color: var(--text-primary);
    font-size: 0.85rem;
    transition: var(--transition);
}

.search-input input:focus {
    outline: none;
    border-color: var(--border-active);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-input i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.filter-select {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 32px 10px 14px;
    color: var(--text-primary);
    font-size: 0.85rem;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8.825L1.175 4 2.238 2.938 6 6.7 9.763 2.938 10.825 4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
    transition: var(--transition);
}

.filter-select:focus {
    outline: none;
    border-color: var(--border-active);
}

/* ---------- Responsive ---------- */

/* ---- Tablet & Small Desktop (≤1024) ---- */
@media (max-width: 1024px) {
    .app-sidebar {
        transform: translateX(-100%);
    }

    .app-sidebar.open {
        transform: translateX(0);
        box-shadow: 0 0 60px rgba(0, 0, 0, 0.5);
    }

    .app-main {
        margin-left: 0;
    }

    .topbar-toggle {
        display: block;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .sidebar-overlay.show {
        display: block;
    }

    /* Charts grid stack on tablet */
    .chart-grid {
        grid-template-columns: 1fr;
    }
}

/* ---- Phones & Small Tablets (≤768) ---- */
@media (max-width: 768px) {

    /* Content padding */
    .app-content {
        padding: 12px;
    }

    /* KPI grid: 2 columns */
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    /* KPI cards smaller */
    .kpi-card {
        padding: 14px 12px;
    }

    .kpi-value {
        font-size: 1.4rem;
    }

    .kpi-label {
        font-size: 0.68rem;
    }

    /* Filters stack */
    .filter-bar {
        flex-direction: column;
        gap: 8px;
    }

    .search-input {
        min-width: 100%;
    }

    /* Page title smaller */
    .page-title {
        font-size: 1.2rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px !important;
    }

    /* Notification dropdown */
    .notification-dropdown {
        width: calc(100vw - 32px);
        right: -60px;
    }

    /* Tables: horizontal scroll */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-wrapper table {
        min-width: 600px;
    }

    .table th,
    .table td {
        padding: 8px 10px;
        font-size: 0.78rem;
        white-space: nowrap;
    }

    /* Cards */
    .card-body {
        padding: 14px;
    }

    .card-header {
        padding: 12px 14px;
        font-size: 0.82rem;
    }

    /* Form grids stack */
    .form-group+.form-group {
        margin-top: 10px;
    }

    /* Ticket view 2-col → 1-col */
    .ticket-detail-grid,
    .ticket-main-grid {
        grid-template-columns: 1fr !important;
    }

    /* Timeline adjustments */
    .timeline-item {
        padding-left: 20px;
    }

    .timeline-content {
        padding: 10px 12px;
    }

    /* Topbar */
    .app-topbar {
        padding: 0 12px;
    }

    .topbar-search {
        display: none;
    }

    /* Modals full-width */
    .modal-content,
    .modal-dialog {
        width: calc(100vw - 24px) !important;
        max-width: 100% !important;
        margin: 12px auto !important;
    }

    /* Toasts */
    .toast-container {
        right: 12px;
        left: 12px;
    }

    .toast {
        min-width: auto;
        max-width: 100%;
    }

    /* Chart cards */
    .chart-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .chart-card {
        padding: 14px;
    }
}

/* ---- Small Phones (≤480) ---- */
@media (max-width: 480px) {
    .kpi-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .app-content {
        padding: 10px;
    }

    /* Buttons shrink */
    .btn {
        padding: 8px 12px;
        font-size: 0.78rem;
    }

    .btn-sm {
        padding: 5px 10px;
        font-size: 0.72rem;
    }

    /* Badge shrink */
    .badge {
        font-size: 0.62rem;
        padding: 2px 6px;
    }

    /* Forms stack into single column */
    form div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    /* Page subtitle */
    .page-subtitle {
        font-size: 0.78rem;
    }

    /* Empty state */
    .empty-state i {
        font-size: 2rem;
    }

    .empty-state h3 {
        font-size: 1rem;
    }

    /* Sidebar user footer */
    .sidebar-user {
        padding: 10px 14px;
    }
}

/* ---------- Scrollbar ---------- */
::-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);
}

/* ---------- Animations ---------- */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

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

.animate-fadeInUp {
    animation: fadeInUp 0.4s ease-out;
}

/* ---------- Toasts ---------- */
.toast-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    min-width: 300px;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: fadeInUp 0.3s ease-out;
}

.toast-success {
    border-left: 3px solid #10b981;
}

.toast-error {
    border-left: 3px solid #ef4444;
}

.toast-info {
    border-left: 3px solid #3b82f6;
}

.toast-warning {
    border-left: 3px solid #f59e0b;
}

.toast-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.toast-body {
    flex: 1;
    font-size: 0.85rem;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
}

/* ---------- SLA Indicator ---------- */
.sla-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.sla-indicator.ok {
    color: #10b981;
}

.sla-indicator.warning {
    color: #f59e0b;
}

.sla-indicator.breached {
    color: #ef4444;
}

.sla-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.sla-indicator.breached .sla-dot {
    animation: pulse 1s infinite;
}

/* ---------- Chart Card ---------- */
.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.chart-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.chart-card-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 16px;
}