/* ========================================
   SPY TECH - CCTV Service Management App
   Premium Dark Navy + Red Design System
   ======================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    /* SPY TECH Brand Colors */
    --primary: #1B1464;
    --primary-dark: #0D0B2E;
    --primary-light: #2D2580;
    --primary-lightest: #E8E6F5;
    --accent: #E8192C;
    --accent-dark: #C41420;
    --accent-light: #FF3D50;

    /* Semantic Colors */
    --success: #10B981;
    --success-light: #D1FAE5;
    --danger: #EF4444;
    --danger-light: #FEE2E2;
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    --info: #3B82F6;
    --info-light: #DBEAFE;

    /* Neutrals */
    --white: #FFFFFF;
    --light-bg: #F1F3F8;
    --gray-50: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1E293B;
    --gray-900: #0F172A;
    --text-dark: #0F172A;
    --text-muted: #64748B;
    --border-color: #E2E8F0;

    /* Layout */
    --sidebar-width: 260px;
    --header-height: 60px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #1B1464, #2D2580);
    --gradient-accent: linear-gradient(135deg, #E8192C, #FF3D50);
    --gradient-dark: linear-gradient(180deg, #0D0B2E, #1B1464);
    --gradient-hero: linear-gradient(135deg, #0D0B2E 0%, #1B1464 50%, #2D2580 100%);

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
    --transition-slow: 0.4s ease;
}

/* ============================
   RESET & BASE
   ============================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 14px; height: 100%; scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-dark);
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 { margin-bottom: 0.5rem; font-weight: 700; color: var(--text-dark); line-height: 1.3; }
h1 { font-size: 1.85rem; letter-spacing: -0.02em; }
h2 { font-size: 1.5rem; letter-spacing: -0.01em; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }
h5 { font-size: 1rem; }
p { margin-bottom: 0.75rem; line-height: 1.7; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--primary-light); }

/* ============================
   SIDEBAR
   ============================ */
.sidebar {
    position: fixed; top: 0; left: 0;
    width: var(--sidebar-width); height: 100vh;
    background: var(--gradient-dark);
    display: flex; flex-direction: column;
    z-index: 200; overflow-y: auto;
    transition: transform var(--transition-base);
    border-right: 1px solid rgba(255,255,255,0.05);
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.sidebar-logo {
    padding: 1.25rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: var(--header-height);
    letter-spacing: 0.5px;
}
.sidebar-logo i { color: var(--accent); font-size: 1.4rem; }
.sidebar-logo .logo-spy { color: var(--accent); font-weight: 800; }
.sidebar-logo .logo-tech { color: #fff; font-weight: 800; }

.sidebar-nav { flex: 1; padding: 0.75rem 0; }
.sidebar-nav-item {
    display: flex; align-items: center; gap: 0.85rem;
    padding: 0.8rem 1.5rem;
    color: rgba(255,255,255,0.55);
    font-size: 0.9rem; font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    border-left: 3px solid transparent;
    position: relative;
}
.sidebar-nav-item:hover {
    color: #fff;
    background: rgba(255,255,255,0.06);
    border-left-color: var(--accent);
}
.sidebar-nav-item.active {
    color: #fff;
    background: rgba(232, 25, 44, 0.12);
    border-left-color: var(--accent);
    font-weight: 600;
}
.sidebar-nav-item.active::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--accent);
    border-radius: 3px 0 0 3px;
}
.sidebar-nav-item i { width: 20px; font-size: 1rem; text-align: center; }

.sidebar-section-title {
    padding: 1.25rem 1.5rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(255,255,255,0.25);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.sidebar-footer a {
    display: flex; align-items: center; gap: 0.6rem;
    color: rgba(255,255,255,0.4);
    font-size: 0.85rem;
    transition: color var(--transition-fast);
    font-weight: 500;
}
.sidebar-footer a:hover { color: var(--accent); }

/* ============================
   MOBILE HEADER
   ============================ */
.mobile-header {
    background-color: var(--white);
    border-bottom: 1px solid var(--border-color);
    padding: 0 1rem;
    position: fixed;
    top: 0; left: 0; right: 0; z-index: 150;
    height: var(--header-height);
    display: none;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
}
.mobile-header .logo {
    font-size: 1.1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.mobile-header .logo .logo-spy { color: var(--accent); }
.mobile-header .logo .logo-tech { color: var(--primary); }
.mobile-header-actions { display: flex; align-items: center; gap: 1.2rem; }
.hamburger-btn {
    background: none; border: none;
    font-size: 1.25rem; color: var(--text-dark);
    cursor: pointer; padding: 0.4rem;
    transition: color var(--transition-fast);
}
.hamburger-btn:hover { color: var(--accent); }

.notification-icon {
    position: relative;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--gray-500);
    transition: color var(--transition-fast);
}
.notification-icon:hover { color: var(--primary); }
.notification-badge {
    position: absolute; top: -6px; right: -8px;
    background: var(--accent);
    color: var(--white);
    border-radius: var(--radius-full);
    width: 18px; height: 18px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.65rem; font-weight: 700;
    border: 2px solid var(--white);
    animation: pulse-badge 2s infinite;
}
@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ============================
   BOTTOM NAV (Mobile)
   ============================ */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    background-color: var(--white);
    border-top: 1px solid var(--border-color);
    display: none;
    justify-content: space-around;
    padding: 0.3rem 0;
    z-index: 99;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.06);
}
.bottom-nav-item {
    flex: 1; text-align: center;
    padding: 0.5rem 0.4rem;
    color: var(--gray-400);
    font-size: 0.7rem; font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    display: flex; flex-direction: column;
    align-items: center; gap: 0.15rem;
    position: relative;
}
.bottom-nav-item:hover,
.bottom-nav-item.active {
    color: var(--accent);
}
.bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: var(--accent);
    border-radius: 0 0 3px 3px;
}
.bottom-nav-item i { font-size: 1.2rem; }

/* Overlay for mobile sidebar */
.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 190;
}
.sidebar-overlay.active { display: block; }

/* ============================
   MAIN CONTENT
   ============================ */
.main-content {
    padding: 1.5rem;
    min-height: 100vh;
}

/* ============================
   RESPONSIVE BREAKPOINTS
   ============================ */
/* Desktop ≥1024px */
@media (min-width: 1024px) {
    .mobile-header { display: none !important; }
    .bottom-nav { display: none !important; }
    .main-content { margin-left: var(--sidebar-width); padding: 2rem 2.5rem; }
    .desktop-only { display: block !important; }
    .mobile-only { display: none !important; }
    .stats-container { grid-template-columns: repeat(4, 1fr); }
    .login-card { max-width: 440px; }
    .btn { width: auto; }
    .btn-block { width: 100%; }
    .modal.show { align-items: center; justify-content: center; }
    .modal-content { max-width: 600px; border-radius: var(--radius-lg); width: 90%; }
    .quick-actions-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 0.75rem; }
    .quick-actions-grid .btn { margin-bottom: 0; }
    .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.5rem; }
}

/* Tablet 768px–1023px */
@media (min-width: 768px) and (max-width: 1023px) {
    :root { --sidebar-width: 220px; }
    .mobile-header { display: none !important; }
    .bottom-nav { display: none !important; }
    .main-content { margin-left: var(--sidebar-width); padding: 1.5rem; }
    .desktop-only { display: block !important; }
    .mobile-only { display: none !important; }
    .stats-container { grid-template-columns: repeat(3, 1fr); }
    .sidebar-logo { font-size: 1rem; }
    .sidebar-nav-item { font-size: 0.85rem; padding: 0.75rem 1.25rem; }
    .login-card { max-width: 400px; }
    .btn { width: auto; }
    .btn-block { width: 100%; }
    .modal.show { align-items: center; justify-content: center; }
    .modal-content { max-width: 540px; border-radius: var(--radius-lg); width: 90%; }
}

/* Mobile <768px */
@media (max-width: 767px) {
    .sidebar { transform: translateX(-100%); z-index: 210; }
    .sidebar.open { transform: translateX(0); }
    .mobile-header { display: flex !important; }
    .bottom-nav { display: flex !important; }
    .main-content {
        margin-left: 0; padding: 1rem;
        padding-top: calc(var(--header-height) + 1rem);
        padding-bottom: 5rem;
    }
    .desktop-only { display: none !important; }
    .mobile-only { display: block !important; }
    .stats-container { grid-template-columns: 1fr 1fr; }
    .table thead { display: none; }
    .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
    .table tr {
        margin-bottom: 1rem;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        overflow: hidden;
        box-shadow: var(--shadow-sm);
    }
    .table td {
        padding-left: 50%;
        position: relative;
        border: none;
        border-bottom: 1px solid var(--gray-100);
    }
    .table td:before {
        content: attr(data-label);
        position: absolute; left: 0; width: 50%;
        padding: 0.75rem;
        font-weight: 600;
        background-color: var(--gray-50);
        color: var(--gray-600);
        font-size: 0.85rem;
    }
    .login-card { max-width: 100%; }
    .btn { width: 100%; }
    .btn-sm, .btn-outline { width: auto; }
}

@media (max-width: 480px) {
    html { font-size: 13px; }
    h1 { font-size: 1.5rem; } h2 { font-size: 1.3rem; }
}

/* ============================
   CARDS
   ============================ */
.card {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow var(--transition-base);
}
.card:hover {
    box-shadow: var(--shadow-md);
}
.card-header {
    background-color: var(--white);
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--primary);
}
.card-header i {
    color: var(--accent);
    font-size: 0.9rem;
}
.card-body { padding: 1.25rem; }
.card-footer {
    background-color: var(--gray-50);
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
}

/* ============================
   PAGE HEADER
   ============================ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.page-header h1, .page-header h2 {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}
.page-header h1 i, .page-header h2 i {
    color: var(--accent);
    font-size: 0.9em;
}

/* ============================
   FORMS
   ============================ */
.form-group { margin-bottom: 1.25rem; }
.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--gray-700);
    font-size: 0.9rem;
}
.form-control {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    background: var(--white);
    color: var(--text-dark);
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(27, 20, 100, 0.1);
}
.form-control::placeholder { color: var(--gray-400); }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { cursor: pointer; }

/* ============================
   BUTTONS
   ============================ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.7rem 1.4rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem; font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: 0.01em;
    position: relative;
    overflow: hidden;
}
.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.btn:active {
    transform: translateY(0);
}
.btn-primary {
    background: var(--gradient-primary);
    color: var(--white);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #2D2580, #3D35A0);
}
.btn-accent {
    background: var(--gradient-accent);
    color: var(--white);
}
.btn-success {
    background: var(--success);
    color: var(--white);
}
.btn-success:hover { background: #059669; }
.btn-danger {
    background: var(--danger);
    color: var(--white);
}
.btn-danger:hover { background: #DC2626; }
.btn-warning {
    background: var(--warning);
    color: var(--gray-900);
}
.btn-warning:hover { background: #D97706; }
.btn-info {
    background: var(--info);
    color: var(--white);
}
.btn-info:hover { background: #2563EB; }
.btn-secondary {
    background: var(--gray-500);
    color: var(--white);
}
.btn-secondary:hover { background: var(--gray-600); }
.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border-color);
    color: var(--gray-600);
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-lightest);
}
.btn-sm {
    padding: 0.35rem 0.85rem;
    font-size: 0.82rem;
    border-radius: var(--radius-sm);
}
.btn-block {
    width: 100%;
    margin-bottom: 0.5rem;
}
.btn-icon {
    width: 36px; height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
}

/* ============================
   BADGES
   ============================ */
.badge {
    display: inline-flex; align-items: center;
    padding: 0.2rem 0.7rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.badge-success { background-color: var(--success-light); color: #065F46; }
.badge-danger { background-color: var(--danger-light); color: #991B1B; }
.badge-warning { background-color: var(--warning-light); color: #92400E; }
.badge-info { background-color: var(--info-light); color: #1E40AF; }
.badge-primary { background-color: var(--primary-lightest); color: var(--primary); }
.badge-accent { background-color: #FEE2E2; color: var(--accent); }

.status-badge {
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.status-badge::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    display: inline-block;
}
.status-open { background-color: #FEE2E2; color: #DC2626; }
.status-open::before { background: #DC2626; }
.status-pending { background-color: #FEF3C7; color: #D97706; }
.status-pending::before { background: #D97706; }
.status-assigned { background-color: var(--warning-light); color: #92400E; }
.status-assigned::before { background: #D97706; }
.status-accepted { background-color: var(--info-light); color: #1E40AF; }
.status-accepted::before { background: #3B82F6; }
.status-in_progress { background-color: var(--primary-lightest); color: var(--primary); }
.status-in_progress::before { background: var(--primary); }
.status-completed { background-color: var(--success-light); color: #065F46; }
.status-completed::before { background: #10B981; }
.status-partial { background-color: var(--warning-light); color: #92400E; }
.status-partial::before { background: #F59E0B; }
.status-paid { background-color: var(--success-light); color: #065F46; }
.status-paid::before { background: #10B981; }
.status-active { background-color: var(--success-light); color: #065F46; }
.status-active::before { background: #10B981; }
.status-inactive { background-color: var(--gray-100); color: var(--gray-500); }
.status-inactive::before { background: var(--gray-400); }
.status-expired { background-color: var(--danger-light); color: #991B1B; }
.status-expired::before { background: #EF4444; }

/* ============================
   ALERTS
   ============================ */
.alert {
    padding: 0.85rem 1.1rem;
    margin-bottom: 1rem;
    border-radius: var(--radius-md);
    border-left: 4px solid transparent;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
.alert-success { background-color: var(--success-light); color: #065F46; border-left-color: var(--success); }
.alert-danger { background-color: var(--danger-light); color: #991B1B; border-left-color: var(--danger); }
.alert-warning { background-color: var(--warning-light); color: #92400E; border-left-color: var(--warning); }
.alert-info { background-color: var(--info-light); color: #1E40AF; border-left-color: var(--info); }

/* ============================
   LIST ITEMS
   ============================ */
.list-group { list-style: none; }
.list-item {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    padding: 1rem 1.15rem;
    margin-bottom: 0.6rem;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all var(--transition-fast);
}
.list-item:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--gray-300);
    transform: translateY(-1px);
}
.list-item-primary {
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.3rem;
    font-size: 0.95rem;
}
.list-item-secondary {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* ============================
   TABLE
   ============================ */
.table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--white);
}
.table thead {
    background: var(--gray-50);
    border-bottom: 2px solid var(--border-color);
}
.table th {
    padding: 0.85rem 1rem;
    text-align: left;
    font-weight: 700;
    color: var(--gray-600);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.9rem;
}
.table tbody tr:hover { background-color: var(--gray-50); }
.table-responsive { overflow-x: auto; border-radius: var(--radius-md); }

/* ============================
   MODAL
   ============================ */
.modal {
    display: none;
    position: fixed; z-index: 1000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}
.modal.show { display: flex; align-items: flex-end; }
.modal-content {
    background-color: var(--white);
    width: 100%;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    animation: slideUp 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h3 { color: var(--primary); margin: 0; }
.modal-body { padding: 1.25rem; }
.modal-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}
.close-modal {
    background: none; border: none;
    font-size: 1.5rem; cursor: pointer;
    color: var(--gray-400);
    transition: color var(--transition-fast);
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
}
.close-modal:hover { color: var(--gray-700); background: var(--gray-100); }

/* ============================
   STATS CARDS
   ============================ */
.stats-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.75rem;
}
.stat-card {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    border-left: 4px solid var(--primary);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}
.stat-card::after {
    content: '';
    position: absolute;
    top: -20px; right: -20px;
    width: 80px; height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(27,20,100,0.04), rgba(27,20,100,0.01));
}
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}
.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-dark);
    letter-spacing: -0.03em;
    line-height: 1.2;
}
.stat-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
    font-weight: 500;
}
.stat-icon {
    position: absolute;
    top: 1rem; right: 1rem;
    width: 40px; height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--white);
}

/* ============================
   SPINNER
   ============================ */
.spinner {
    border: 3px solid var(--gray-200);
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    width: 36px; height: 36px;
    animation: spin 0.8s linear infinite;
    margin: 2rem auto;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* ============================
   NO DATA
   ============================ */
.no-data {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray-400);
}
.no-data i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
    display: block;
    color: var(--gray-300);
}
.no-data p { color: var(--gray-400); font-weight: 500; }

/* ============================
   PRIORITY BADGES
   ============================ */
.priority-low { color: var(--info); font-weight: 600; }
.priority-medium { color: var(--warning); font-weight: 600; }
.priority-high { color: #EA580C; font-weight: 700; }
.priority-critical { color: var(--danger); font-weight: 800; }

/* ============================
   LOGIN PAGE
   ============================ */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--gradient-hero);
    padding: 1rem;
    position: relative;
    overflow: hidden;
}
.login-container::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(ellipse at center, rgba(232,25,44,0.08) 0%, transparent 60%);
    animation: loginGlow 8s ease-in-out infinite;
}
@keyframes loginGlow {
    0%, 100% { transform: scale(1) translate(0, 0); }
    50% { transform: scale(1.1) translate(5%, 5%); }
}
.login-card {
    background-color: var(--white);
    border-radius: var(--radius-xl);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-xl);
    position: relative;
    z-index: 1;
}
.login-logo {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 2.5rem;
    color: var(--accent);
}
.login-title {
    text-align: center;
    margin-bottom: 1.75rem;
    color: var(--primary);
    font-weight: 700;
}

/* ============================
   TOPBAR BUTTON
   ============================ */
.topbar-btn {
    width: 34px; height: 34px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}
.topbar-btn:hover {
    background: var(--gray-100);
    color: var(--accent);
    border-color: var(--accent);
}

/* ============================
   UTILITY CLASSES
   ============================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-info { color: var(--info); }
.text-accent { color: var(--accent); }
.text-primary { color: var(--primary); }
.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.p-1 { padding: 0.5rem; } .p-2 { padding: 1rem; } .p-3 { padding: 1.5rem; }
.d-flex { display: flex; } .gap-1 { gap: 0.5rem; } .gap-2 { gap: 1rem; }
.flex-wrap { flex-wrap: wrap; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }

/* Legacy compat */
.desktop-only { display: none; }
.mobile-only { display: block; }

/* ============================
   ENHANCED COMPONENTS
   ============================ */

/* Filter tabs */
.filter-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.filter-tab {
    padding: 0.45rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 600;
    background: var(--gray-100);
    color: var(--gray-600);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
    border: 1.5px solid transparent;
}
.filter-tab:hover {
    background: var(--primary-lightest);
    color: var(--primary);
}
.filter-tab.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* Report cards */
.report-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
}
.report-card-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}
.report-card-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-dark);
}

/* Detail rows (for job details etc) */
.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.9rem;
}
.detail-row:last-child { border-bottom: none; }
.detail-label {
    color: var(--gray-500);
    font-weight: 600;
    min-width: 110px;
    font-size: 0.85rem;
}
.detail-value {
    text-align: right;
    color: var(--text-dark);
    font-weight: 500;
    word-break: break-word;
    max-width: 60%;
}

/* Section icons */
.section-icon {
    width: 32px; height: 32px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: var(--white);
}
.icon-complaint { background: var(--gradient-accent); }
.icon-customer { background: var(--gradient-primary); }
.icon-install { background: linear-gradient(135deg, #10B981, #34D399); }
.icon-assignment { background: linear-gradient(135deg, #F59E0B, #FBBF24); }
.icon-report { background: linear-gradient(135deg, #8B5CF6, #A78BFA); }
.icon-payment { background: linear-gradient(135deg, #059669, #10B981); }

/* Warranty badge */
.warranty-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}
.warranty-active { background-color: var(--success-light); color: #065F46; }
.warranty-expired { background-color: var(--danger-light); color: #991B1B; }

/* Back button */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.back-btn:hover { color: var(--accent); }

/* Description box */
.description-box {
    background: var(--gray-50);
    padding: 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--text-dark);
    line-height: 1.6;
    margin-top: 0.5rem;
    border: 1px solid var(--gray-100);
}

/* Phone link */
.phone-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.phone-link:hover { color: var(--accent); }

/* Action buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.action-buttons .btn { flex: 1; min-width: 120px; }

/* Notification list */
.notif-item {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    gap: 0.75rem;
    transition: background var(--transition-fast);
    cursor: pointer;
}
.notif-item:hover { background: var(--gray-50); }
.notif-item.unread { background: rgba(27,20,100,0.03); border-left: 3px solid var(--accent); }
.notif-icon {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.notif-content { flex: 1; }
.notif-title { font-weight: 600; font-size: 0.9rem; color: var(--text-dark); }
.notif-message { font-size: 0.82rem; color: var(--gray-500); margin-top: 0.15rem; }
.notif-time { font-size: 0.75rem; color: var(--gray-400); margin-top: 0.25rem; }

/* Complaint image */
.complaint-image {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-top: 0.5rem;
    border: 1px solid var(--border-color);
}

/* Report section textarea */
.report-section textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(27, 20, 100, 0.1);
}

/* Time input group */
.time-input-group { display: flex; gap: 0.5rem; }
.time-input-group input { flex: 1; }

/* Payment summary card */
.payment-summary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    color: var(--white);
    margin-bottom: 1.25rem;
}
.payment-summary .amount {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.payment-summary .label {
    font-size: 0.82rem;
    opacity: 0.8;
    margin-top: 0.25rem;
}
.payment-summary .divider {
    border-top: 1px solid rgba(255,255,255,0.15);
    margin: 1rem 0;
}
.payment-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.3rem 0;
    font-size: 0.9rem;
}

/* Floating action button */
.fab {
    position: fixed;
    bottom: 5.5rem;
    right: 1.25rem;
    width: 52px; height: 52px;
    border-radius: 50%;
    background: var(--gradient-accent);
    color: var(--white);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(232,25,44,0.4);
    cursor: pointer;
    z-index: 50;
    transition: all var(--transition-base);
}
.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(232,25,44,0.5);
}

.logo-preview { max-width: 150px; border-radius: var(--radius-md); border: 1px solid var(--border-color); padding: 0.5rem; background: #fff; margin-bottom: 0.5rem; }

@media (min-width: 1024px) {
    .fab { bottom: 2rem; right: 2rem; }
}
