/* ============================================
   ServicePro SaaS - Complete Design System
   Mobile-First | Modern | Professional
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
    --primary: #4361ee;
    --primary-dark: #3a56d4;
    --primary-light: #eef0ff;
    --secondary: #6c757d;
    --success: #2ec4b6;
    --success-dark: #25a99d;
    --danger: #e63946;
    --warning: #ff9f1c;
    --info: #4cc9f0;
    --dark: #1a1d29;
    --body-bg: #f0f2f8;
    --card-bg: #ffffff;
    --text-primary: #1a1d29;
    --text-secondary: #6c757d;
    --text-muted: #9ca3af;
    --border-color: #e5e7eb;
    --sidebar-bg: #1a1d29;
    --sidebar-width: 230px;
    --header-height: 52px;
    --radius: 10px;
    --radius-sm: 7px;
    --shadow: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.07);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.1);
    --font: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --transition: all 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--body-bg); color: var(--text-primary); line-height: 1.5; overflow-x: hidden; min-height: 100vh; }
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; }

h1, h2, h3, h4, h5, h6 { font-weight: 600; line-height: 1.3; color: var(--text-primary); }
h1 { font-size: 1.75rem; } h2 { font-size: 1.5rem; } h3 { font-size: 1.25rem; } h4 { font-size: 1.1rem; }
.text-muted { color: var(--text-muted) !important; } .text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; } .text-warning { color: var(--warning) !important; }
.text-primary { color: var(--primary) !important; } .text-center { text-align: center; }
.text-right { text-align: right; } .text-sm { font-size: 0.85rem; } .text-xs { font-size: 0.75rem; }

.app-wrapper { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar { width: var(--sidebar-width); background: linear-gradient(180deg, #1a1d29 0%, #111318 100%); position: fixed; top: 0; left: 0; bottom: 0; z-index: 1000; overflow-y: auto; transform: translateX(-100%); transition: transform 0.3s ease; }
.sidebar.active { transform: translateX(0); }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,0.06); background: linear-gradient(135deg, rgba(67,97,238,0.15), rgba(67,97,238,0.05)); }
.sidebar-brand .brand-icon { width: 34px; height: 34px; background: linear-gradient(135deg, #4361ee, #3a56d4); border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 0.95rem; color: #fff; font-weight: 700; box-shadow: 0 2px 8px rgba(67,97,238,0.3); }
.sidebar-brand .brand-name { color: #fff; font-size: 0.95rem; font-weight: 600; }
.sidebar-brand .brand-name small { display: block; font-size: 0.65rem; color: rgba(255,255,255,0.35); font-weight: 400; }
.sidebar-nav { padding: 8px 0; }
.nav-section { padding: 8px 16px 3px; font-size: 0.6rem; text-transform: uppercase; letter-spacing: 1.5px; color: rgba(255,255,255,0.25); font-weight: 600; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 16px; color: rgba(255,255,255,0.55); font-size: 0.82rem; transition: var(--transition); border-left: 3px solid transparent; cursor: pointer; }
.nav-item:hover { background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.9); }
.nav-item.active { background: rgba(67,97,238,0.12); color: #fff; border-left-color: var(--primary); }
.nav-item .nav-icon { width: 18px; text-align: center; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.nav-item .nav-icon svg { width: 16px; height: 16px; }
.nav-item .nav-badge { margin-left: auto; background: var(--danger); color: #fff; font-size: 0.6rem; padding: 2px 6px; border-radius: 10px; font-weight: 600; }

/* ---------- Main Content ---------- */
.main-content { flex: 1; margin-left: 0; min-height: 100vh; display: flex; flex-direction: column; width: 100%; transition: margin-left 0.3s ease; }

/* ---------- Header ---------- */
.header { height: var(--header-height); background: var(--card-bg); border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; padding: 0 14px; position: sticky; top: 0; z-index: 500; box-shadow: 0 1px 3px rgba(0,0,0,0.03); width: 100%; }
.header-left { display: flex; align-items: center; gap: 10px; }
.header-right { display: flex; align-items: center; gap: 8px; }
.menu-toggle { width: 36px; height: 36px; border: none; background: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 8px; border-radius: var(--radius-sm); }
.menu-toggle:hover { background: var(--body-bg); }
.menu-toggle span { width: 18px; height: 2px; background: var(--text-primary); border-radius: 2px; transition: var(--transition); }
.page-title { font-size: 1rem; font-weight: 600; }
.header-btn { width: 34px; height: 34px; border: none; background: var(--body-bg); border-radius: var(--radius-sm); cursor: pointer; display: flex; align-items: center; justify-content: center; position: relative; color: var(--text-secondary); font-size: 1rem; transition: var(--transition); }
.header-btn:hover { background: var(--primary-light); color: var(--primary); }
.header-btn .badge-dot { position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; background: var(--danger); border-radius: 50%; border: 2px solid var(--card-bg); }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #4361ee, #6c63ff); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 0.78rem; cursor: pointer; }

.content { padding: 14px; flex: 1; width: 100%; max-width: 100%; }

/* ---------- Cards ---------- */
.card { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 12px; overflow: hidden; width: 100%; }
.card-header { padding: 12px 14px; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.card-header h3 { font-size: 0.92rem; margin: 0; }
.card-body { padding: 14px; }
.card-footer { padding: 10px 14px; border-top: 1px solid var(--border-color); background: #fafbfc; }

/* ---------- Stats ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.stat-card { background: var(--card-bg); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 10px; transition: var(--transition); color: inherit; text-decoration: none; }
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); color: inherit; }
.stat-card.clickable { cursor: pointer; }
.stat-card.clickable:hover { border-left: 3px solid var(--primary); }
a.stat-card { text-decoration: none; color: inherit; }
.stat-icon { width: 38px; height: 38px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-icon.blue { background: linear-gradient(135deg, #eef0ff, #dde3ff); color: var(--primary); }
.stat-icon.green { background: linear-gradient(135deg, #e8f8f5, #ccf0ea); color: var(--success); }
.stat-icon.orange { background: linear-gradient(135deg, #fff4e6, #ffe8c6); color: var(--warning); }
.stat-icon.red { background: linear-gradient(135deg, #fde8ea, #fcd0d4); color: var(--danger); }
.stat-icon.purple { background: linear-gradient(135deg, #f0e6ff, #e0d0ff); color: #7c3aed; }
.stat-icon.teal { background: linear-gradient(135deg, #e6f9ff, #c6f0ff); color: #0891b2; }
.stat-icon svg { width: 20px; height: 20px; }
.stat-info h4 { font-size: 1.2rem; font-weight: 700; margin-bottom: 1px; line-height: 1.2; }
.stat-info p { font-size: 0.7rem; color: var(--text-muted); margin: 0; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 5px; padding: 7px 14px; border: none; border-radius: var(--radius-sm); font-size: 0.82rem; font-weight: 500; cursor: pointer; transition: var(--transition); font-family: var(--font); text-decoration: none; line-height: 1.4; white-space: nowrap; }
.btn-primary { background: linear-gradient(135deg, #4361ee, #3a56d4); color: #fff; } .btn-primary:hover { background: linear-gradient(135deg, #3a56d4, #2d46b9); color: #fff; box-shadow: 0 3px 10px rgba(67,97,238,0.25); }
.btn-success { background: linear-gradient(135deg, #2ec4b6, #25a99d); color: #fff; } .btn-success:hover { background: linear-gradient(135deg, #25a99d, #1f8e84); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; } .btn-danger:hover { background: #cc2936; color: #fff; }
.btn-warning { background: var(--warning); color: #fff; } .btn-secondary { background: var(--secondary); color: #fff; }
.btn-outline { background: transparent; border: 1.5px solid var(--border-color); color: var(--text-primary); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 5px 10px; font-size: 0.75rem; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }
.btn-block { display: flex; width: 100%; justify-content: center; }
.btn-icon { width: 36px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); }
.btn-fab { position: fixed; bottom: 24px; right: 24px; width: 56px; height: 56px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 1.5rem; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-lg); z-index: 100; border: none; cursor: pointer; }
.btn-fab:hover { transform: scale(1.05); }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 0.78rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 4px; }
.form-control { width: 100%; padding: 8px 12px; border: 1.5px solid var(--border-color); border-radius: var(--radius-sm); font-size: 0.85rem; font-family: var(--font); transition: var(--transition); background: var(--card-bg); color: var(--text-primary); }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(67,97,238,0.12); }
.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 24 24' fill='none' stroke='%236c757d' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
textarea.form-control { min-height: 80px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.form-check input[type="checkbox"], .form-check input[type="radio"] { width: 18px; height: 18px; accent-color: var(--primary); }
.form-text { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }
.input-icon-wrapper { position: relative; }
.input-icon-wrapper .form-control { padding-left: 40px; }
.input-icon-wrapper .input-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }

/* ---------- Table ---------- */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); }
.table-responsive::-webkit-scrollbar { height: 4px; }
.table-responsive::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }
.table { width: 100%; border-collapse: collapse; font-size: 0.85rem; table-layout: auto; }
.table th { background: #f8f9fb; padding: 12px 16px; text-align: left; font-weight: 600; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-secondary); border-bottom: 2px solid var(--border-color); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border-color); vertical-align: middle; word-wrap: break-word; }
.table tr:hover td { background: #f8f9fb; }
.table-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.card .table th:first-child, .card .table td:first-child { padding-left: 20px; }
.card .table th:last-child, .card .table td:last-child { padding-right: 20px; }
.table .form-control { padding: 8px 10px; font-size: 0.82rem; min-width: 60px; }

/* ---------- Mobile Card List ---------- */
.mobile-card-list { display: none; }
.mobile-card { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; margin-bottom: 8px; width: 100%; }
.mobile-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; }
.mobile-card-header h4 { font-size: 0.88rem; font-weight: 600; }
.mobile-card-row { display: flex; justify-content: space-between; padding: 3px 0; font-size: 0.78rem; }
.mobile-card-row .label { color: var(--text-muted); }
.mobile-card-row .value { font-weight: 500; text-align: right; }
.mobile-card-actions { display: flex; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border-color); }
.mobile-card-actions .btn { flex: 1; justify-content: center; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.3px; }
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: #e8f8f5; color: #1a9a84; }
.badge-danger { background: #fde8ea; color: var(--danger); }
.badge-warning { background: #fff4e6; color: #d4800a; }
.badge-info { background: #e6f9ff; color: #0891b2; }
.badge-secondary { background: #f1f3f5; color: var(--secondary); }

/* ---------- Modal ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: flex-end; justify-content: center; z-index: 2000; opacity: 0; visibility: hidden; transition: var(--transition); }
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal { background: var(--card-bg); width: 100%; max-width: 560px; max-height: 90vh; border-radius: var(--radius) var(--radius) 0 0; overflow-y: auto; transform: translateY(100%); transition: transform 0.3s ease; }
.modal-overlay.active .modal { transform: translateY(0); }
.modal-header { padding: 16px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; background: var(--card-bg); z-index: 1; }
.modal-header h3 { font-size: 1.05rem; }
.modal-close { width: 32px; height: 32px; border: none; background: var(--body-bg); border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; color: var(--text-secondary); }
.modal-body { padding: 16px; }
.modal-footer { padding: 12px 16px; border-top: 1px solid var(--border-color); display: flex; gap: 8px; justify-content: flex-end; }

/* ---------- Flash ---------- */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 0.85rem; display: flex; align-items: center; gap: 10px; }
.alert-success { background: #e8f8f5; color: #1a9a84; border-left: 3px solid var(--success); }
.alert-error, .alert-danger { background: #fde8ea; color: var(--danger); border-left: 3px solid var(--danger); }
.alert-warning { background: #fff4e6; color: #d4800a; border-left: 3px solid var(--warning); }
.alert-info { background: #e6f9ff; color: #0891b2; border-left: 3px solid var(--info); }

/* ---------- Auth ---------- */
.auth-wrapper { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(135deg, #1a1d29 0%, #2d3150 100%); }
.auth-card { width: 100%; max-width: 420px; background: var(--card-bg); border-radius: var(--radius); padding: 32px 24px; box-shadow: var(--shadow-lg); }
.auth-logo { text-align: center; margin-bottom: 24px; }
.auth-logo .logo-icon { width: 56px; height: 56px; background: var(--primary); border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.5rem; color: #fff; font-weight: 700; margin-bottom: 12px; }
.auth-logo h2 { font-size: 1.3rem; margin-bottom: 4px; }
.auth-logo p { color: var(--text-muted); font-size: 0.85rem; }

/* ---------- Filter / Search ---------- */
.filter-bar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-bar .form-control { flex: 1; min-width: 0; }
.search-box { position: relative; flex: 1; }
.search-box input { padding-left: 38px; }
.search-box .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }

/* ---------- Tabs ---------- */
.tabs { display: flex; border-bottom: 2px solid var(--border-color); -webkit-overflow-scrolling: touch; gap: 0; margin-bottom: 16px; }
.tab { padding: 10px 18px; font-size: 0.85rem; font-weight: 500; color: var(--text-secondary); border-bottom: 2px solid transparent; margin-bottom: -2px; white-space: nowrap; cursor: pointer; transition: var(--transition); }
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ---------- Quick Actions ---------- */
.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.quick-action { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); cursor: pointer; transition: var(--transition); text-decoration: none; color: var(--text-primary); }
.quick-action:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); color: var(--text-primary); }
.quick-action .qa-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.quick-action span { font-size: 0.72rem; font-weight: 500; text-align: center; }

/* ---------- Activity ---------- */
.activity-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-color); }
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.activity-content { flex: 1; }
.activity-content p { font-size: 0.85rem; margin-bottom: 2px; }
.activity-content .time { font-size: 0.72rem; color: var(--text-muted); }

/* ---------- Empty State ---------- */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 12px; opacity: 0.3; }
.empty-state h4 { margin-bottom: 6px; color: var(--text-secondary); }
.empty-state p { font-size: 0.85rem; margin-bottom: 16px; }

/* ---------- Dropdown ---------- */
.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: 100%; min-width: 200px; background: var(--card-bg); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); border: 1px solid var(--border-color); z-index: 1000; display: none; padding: 6px; }
.dropdown-menu.show { display: block; }
.dropdown-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; font-size: 0.85rem; color: var(--text-primary); border-radius: 6px; cursor: pointer; transition: var(--transition); }
.dropdown-item:hover { background: var(--body-bg); }
.dropdown-divider { height: 1px; background: var(--border-color); margin: 4px 0; }

.sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 999; display: none; }
.sidebar-overlay.active { display: block; }

/* ---------- Notification Panel ---------- */
.notification-panel { position: fixed; right: -100%; top: 0; bottom: 0; width: 100%; max-width: 380px; background: var(--card-bg); z-index: 2000; box-shadow: var(--shadow-lg); transition: right 0.3s ease; display: flex; flex-direction: column; }
.notification-panel.active { right: 0; }
.notification-header { padding: 16px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.notification-list { flex: 1; overflow-y: auto; }
.notification-item { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border-color); cursor: pointer; transition: var(--transition); }
.notification-item:hover { background: #f8f9fb; }
.notification-item.unread { background: var(--primary-light); }
.notif-icon { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 0.85rem; }
.notif-content { flex: 1; }
.notif-content h5 { font-size: 0.85rem; font-weight: 500; margin-bottom: 2px; }
.notif-content p { font-size: 0.78rem; color: var(--text-muted); margin: 0; }
.notif-content .notif-time { font-size: 0.7rem; color: var(--text-muted); margin-top: 4px; }

/* ---------- Invoice Print ---------- */
.invoice-print { max-width: 800px; margin: 0 auto; }
.invoice-header-row { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
.invoice-details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }

.spinner { width: 40px; height: 40px; border: 3px solid var(--border-color); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.pagination-nav { display: flex; justify-content: center; margin-top: 16px; }
.pagination { display: flex; list-style: none; gap: 4px; }
.pagination li a { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--radius-sm); font-size: 0.85rem; color: var(--text-secondary); background: var(--card-bg); box-shadow: var(--shadow); transition: var(--transition); }
.pagination li a:hover, .pagination li.active a { background: var(--primary); color: #fff; }

/* ---------- Tech Portal ---------- */
.tech-job-card { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px; border-left: 4px solid var(--border-color); transition: var(--transition); }
.tech-job-card.priority-high { border-left-color: var(--warning); }
.tech-job-card.priority-urgent { border-left-color: var(--danger); }
.tech-job-card.priority-medium { border-left-color: var(--info); }
.tech-job-card.priority-low { border-left-color: var(--secondary); }
.tech-job-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.tech-job-header h4 { font-size: 0.95rem; }
.tech-job-info { display: grid; gap: 6px; margin-bottom: 12px; }
.tech-job-info .info-row { display: flex; gap: 8px; font-size: 0.82rem; align-items: flex-start; }
.tech-job-info .info-row .icon { color: var(--text-muted); width: 16px; text-align: center; flex-shrink: 0; margin-top: 2px; }
.tech-job-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.call-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; background: var(--success); color: #fff; border-radius: var(--radius-sm); font-size: 0.82rem; font-weight: 500; text-decoration: none; }
.call-btn:hover { background: var(--success-dark); color: #fff; }

.chart-container { position: relative; height: 200px; }

/* ============================================
   RESPONSIVE — 2 MODES ONLY: Mobile + Desktop
   ============================================ */

@media (min-width: 768px) {
    .sidebar { transform: translateX(0); }
    .main-content { margin-left: var(--sidebar-width); width: calc(100% - var(--sidebar-width)); }
    .menu-toggle { display: none; }
    .sidebar-overlay { display: none !important; }
    .content { padding: 16px 20px; }
    .header { padding: 0 20px; }
    .stats-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; }
    .stat-card { padding: 12px 14px; }
    .stat-info h4, .stat-value { font-size: 1.15rem; }
    .modal { border-radius: var(--radius); max-width: 580px; }
    .modal-overlay { align-items: center; }
    .mobile-card-list { display: none; }
    .table-responsive { display: block; }
    .cards-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .quick-actions { grid-template-columns: repeat(4, 1fr); gap: 8px; }
    .quick-action, .quick-action-btn { padding: 10px 8px; font-size: 0.72rem; }
    .quick-action .qa-icon { width: 34px; height: 34px; }
    .card-header { padding: 10px 14px; }
    .card-body { padding: 14px; }
    .form-row { grid-template-columns: 1fr 1fr; }
    .mobile-card { padding: 12px 14px; }
    .mobile-card-actions .btn { font-size: 0.75rem; padding: 5px 10px; }
    .cards-grid .mobile-card, .cards-grid .tech-job-card { margin-bottom: 0; }
    .invoice-items-wrap { overflow-x: auto; }
    .fab, .btn-fab { display: none; }
    .filter-bar { flex-direction: row; }
    .filter-bar .btn { width: auto; }
    .form-actions { flex-direction: row; }
    .dashboard-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .table { font-size: 0.82rem; }
    .table th { padding: 10px 14px; }
    .table td { padding: 10px 14px; }
}

@media (max-width: 767px) {
    .table-responsive.desktop-only { display: none; }
    .mobile-card-list { display: block; }
    .form-row { grid-template-columns: 1fr; }
    .invoice-details-grid { grid-template-columns: 1fr; }
    .filter-bar { flex-direction: column; }
    .filter-bar .btn { width: 100%; justify-content: center; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .mobile-card-actions { flex-wrap: wrap; }
    .mobile-card-actions .btn { font-size: 0.76rem; padding: 6px 10px; }
    .form-actions { flex-direction: column; }
    .form-actions .btn { width: 100%; justify-content: center; }
    .header { padding: 0 12px; }
    .page-title { font-size: 1rem; }
    .modal { border-radius: var(--radius) var(--radius) 0 0; max-height: 90vh; }
    .modal-overlay { align-items: flex-end; }
    .dashboard-grid { grid-template-columns: 1fr; }
}

@media print {
    .sidebar, .header, .btn, .btn-fab, .filter-bar, .no-print { display: none !important; }
    .main-content { margin: 0 !important; }
    .content { padding: 0 !important; }
    .card { box-shadow: none; border: 1px solid #ddd; }
    body { background: #fff; }
}

/* ---------- Dark Mode ---------- */
[data-theme="dark"] {
    --body-bg: #0f1117;
    --card-bg: #1a1d29;
    --text-primary: #e4e6eb;
    --text-secondary: #9ca3af;
    --text-muted: #6c757d;
    --border-color: #2d3140;
    --sidebar-bg: #111318;
    --dark: #e4e6eb;
    --shadow: 0 1px 3px rgba(0,0,0,0.2), 0 1px 2px rgba(0,0,0,0.15);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.25);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.3);
}
[data-theme="dark"] .sidebar { background: linear-gradient(180deg, #111318 0%, #0a0c10 100%); }
[data-theme="dark"] .header { background: #1a1d29; border-color: #2d3140; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
[data-theme="dark"] .menu-toggle span { background: #e4e6eb; }
[data-theme="dark"] .header-btn { background: #252836; color: #9ca3af; }
[data-theme="dark"] .header-btn:hover { background: rgba(67,97,238,0.15); color: var(--primary); }
[data-theme="dark"] .form-control { background: #252836; border-color: #2d3140; color: #e4e6eb; }
[data-theme="dark"] .form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(67,97,238,0.2); }
[data-theme="dark"] select.form-control { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }
[data-theme="dark"] .btn-outline { border-color: #2d3140; color: #e4e6eb; }
[data-theme="dark"] .btn-outline:hover { border-color: var(--primary); color: var(--primary); }
[data-theme="dark"] .table th { background: #252836; color: #9ca3af; border-color: #2d3140; }
[data-theme="dark"] .table td { border-color: #2d3140; }
[data-theme="dark"] .table tr:hover td { background: #252836; }
[data-theme="dark"] .card-footer { background: #151821; }
[data-theme="dark"] .badge { opacity: 0.9; }
[data-theme="dark"] .stat-icon.blue { background: rgba(67,97,238,0.15); }
[data-theme="dark"] .stat-icon.green { background: rgba(46,196,182,0.15); }
[data-theme="dark"] .stat-icon.orange { background: rgba(255,159,28,0.15); }
[data-theme="dark"] .stat-icon.red { background: rgba(230,57,70,0.15); }
[data-theme="dark"] .stat-icon.purple { background: rgba(124,58,237,0.15); }
[data-theme="dark"] .stat-icon.teal { background: rgba(8,145,178,0.15); }
[data-theme="dark"] .dropdown-menu { background: #1a1d29; border-color: #2d3140; }
[data-theme="dark"] .dropdown-item { color: #e4e6eb; }
[data-theme="dark"] .dropdown-item:hover { background: #252836; }
[data-theme="dark"] .dropdown-divider { border-color: #2d3140; }
[data-theme="dark"] .modal { background: #1a1d29; }
[data-theme="dark"] .modal-header { border-color: #2d3140; }
[data-theme="dark"] .modal-footer { border-color: #2d3140; background: #151821; }
[data-theme="dark"] .tabs .tab { color: #9ca3af; }
[data-theme="dark"] .tabs .tab.active { color: var(--primary); border-color: var(--primary); }
[data-theme="dark"] .notification-panel { background: #1a1d29; border-color: #2d3140; }
[data-theme="dark"] .empty-state { color: #6c757d; }
[data-theme="dark"] .hover-card:hover { background: #252836; }
[data-theme="dark"] .content-card { background: #1a1d29; }
[data-theme="dark"] .alert-info { background: rgba(67,97,238,0.1); border-color: rgba(67,97,238,0.2); color: #7b93f5; }
[data-theme="dark"] .alert-success { background: rgba(46,196,182,0.1); border-color: rgba(46,196,182,0.2); color: #5dd8cc; }
[data-theme="dark"] .alert-danger { background: rgba(230,57,70,0.1); border-color: rgba(230,57,70,0.2); color: #f07078; }
[data-theme="dark"] .alert-warning { background: rgba(255,159,28,0.1); border-color: rgba(255,159,28,0.2); color: #ffb84d; }
[data-theme="dark"] .quick-action-btn { background: #1a1d29; color: #e4e6eb; }
[data-theme="dark"] .quick-action-btn:hover { color: var(--primary); }
[data-theme="dark"] .user-avatar { background: linear-gradient(135deg, #4361ee, #6c63ff); }
[data-theme="dark"] .info-box { background: #151821; border-color: #2d3140; }
[data-theme="dark"] code { background: #252836; color: #7b93f5; }
[data-theme="dark"] .auth-wrapper { background: linear-gradient(135deg, #0a0c10 0%, #111627 100%); }
[data-theme="dark"] .auth-card { background: #1a1d29; box-shadow: 0 10px 30px rgba(0,0,0,0.4); }
[data-theme="dark"] .sidebar-brand { background: linear-gradient(135deg, rgba(67,97,238,0.1), rgba(67,97,238,0.03)); }

/* Theme toggle button */
.theme-toggle { width: 34px; height: 34px; border: none; background: var(--body-bg); border-radius: var(--radius-sm); cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text-secondary); transition: var(--transition); }
.theme-toggle:hover { background: var(--primary-light); color: var(--primary); }
[data-theme="dark"] .theme-toggle { background: #252836; color: #fbbf24; }
[data-theme="dark"] .theme-toggle:hover { background: rgba(251,191,36,0.15); }

/* ---------- Utilities ---------- */
.d-flex { display: flex; } .align-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; } .p-16 { padding: 16px; }
.w-full { width: 100%; } .flex-1 { flex: 1; } .hidden { display: none; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Additional ---------- */
.content-card { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 12px; overflow: hidden; width: 100%; }
.fab { position: fixed; bottom: 20px; right: 20px; width: 50px; height: 50px; border-radius: 50%; background: linear-gradient(135deg, #4361ee, #3a56d4); color: #fff; font-size: 1.3rem; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 15px rgba(67,97,238,0.35); z-index: 100; border: none; cursor: pointer; text-decoration: none; transition: var(--transition); }
.fab:hover { transform: scale(1.08); color: #fff; background: linear-gradient(135deg, #3a56d4, #2d46b9); }
.stat-value { font-size: 1.2rem; font-weight: 700; line-height: 1.2; margin-bottom: 1px; }
.stat-label { font-size: 0.7rem; color: var(--text-muted); }
.quick-action-btn { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 6px; background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); cursor: pointer; transition: var(--transition); text-decoration: none; color: var(--text-primary); font-size: 0.72rem; font-weight: 500; text-align: center; border: none; }
.quick-action-btn:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); color: var(--primary); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-color); }
.hover-card { cursor: pointer; transition: background 0.15s; }
.hover-card:hover { background: #f8f9fb; }
.activity-time { font-size: 0.72rem; color: var(--text-muted); }
.activity-text { font-size: 0.85rem; }

/* ---------- Invoice Responsive ---------- */
.invoice-totals-section { margin-left: auto; }
@media (min-width: 768px) { .invoice-totals-section { max-width: 380px; } }
@media (max-width: 767px) { .invoice-totals-section { max-width: 100%; } }
.invoice-table-desktop { overflow-x: auto; }
.invoice-items-mobile { display: none; padding: 12px; }
.inv-item-card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; }
.inv-item-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border-color); }
.inv-item-num { font-size: 0.78rem; font-weight: 700; color: var(--primary); background: var(--primary-light); padding: 2px 10px; border-radius: 6px; }
.inv-item-card .form-group label { font-size: 0.72rem; margin-bottom: 4px; }
.inv-item-card .form-control { padding: 8px 10px; font-size: 0.85rem; }
@media (max-width: 767px) { .invoice-table-desktop { display: none !important; } .invoice-items-mobile { display: block !important; } }
@media (min-width: 768px) { .invoice-table-desktop { display: block; } .invoice-items-mobile { display: none !important; } }
.invoice-calc-row { display: flex; gap: 8px; align-items: center; padding: 6px 0; }
.invoice-calc-row label { font-size: 0.82rem; white-space: nowrap; margin: 0; min-width: 60px; font-weight: 500; color: var(--text-secondary); }
.invoice-calc-row .form-control { width: 80px; padding: 8px 10px; font-size: 0.85rem; flex-shrink: 0; }
.invoice-calc-result { font-size: 0.85rem; white-space: nowrap; font-weight: 600; min-width: 70px; text-align: right; }
@media (max-width: 767px) { .invoice-calc-row { flex-wrap: wrap; gap: 6px; } .invoice-calc-row label { width: 100%; min-width: 100%; margin-bottom: 2px; } .invoice-calc-row .form-control { flex: 1; width: auto; min-width: 60px; } .invoice-calc-result { width: 100%; text-align: right; } }

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

/* ---------- WhatsApp ---------- */
.whatsapp-share-btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 24px; background: #25d366; color: #fff; border-radius: var(--radius-sm); font-size: 0.88rem; font-weight: 600; text-decoration: none; transition: var(--transition); border: none; cursor: pointer; }
.whatsapp-share-btn:hover { background: #1da851; color: #fff; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(37,211,102,0.35); }
.whatsapp-share-btn svg { width: 20px; height: 20px; fill: currentColor; }

/* ---------- Public Enquiry Form ---------- */
.public-form-wrapper { min-height: 100vh; background: linear-gradient(135deg, #f0f2f8 0%, #eef0ff 50%, #f5f3ff 100%); padding: 20px; display: flex; align-items: flex-start; justify-content: center; }
.public-form-card { width: 100%; max-width: 540px; background: var(--card-bg); border-radius: 20px; padding: 0; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.08); margin-top: 20px; }
.public-form-header { background: linear-gradient(135deg, var(--primary), #3a56d4); color: #fff; padding: 32px 28px; text-align: center; position: relative; overflow: hidden; }
.public-form-header::before { content: ''; position: absolute; width: 200px; height: 200px; background: rgba(255,255,255,0.08); border-radius: 50%; top: -100px; right: -60px; }
.public-form-header h1 { font-size: 1.4rem; font-weight: 700; margin-bottom: 4px; }
.public-form-header p { opacity: 0.8; font-size: 0.88rem; }
.public-form-body { padding: 28px 24px 32px; }
.public-form-footer { padding: 18px 24px; background: #fafbfc; text-align: center; border-top: 1px solid var(--border-color); font-size: 0.75rem; color: var(--text-muted); }

/* ---------- View Toggle (Table/Card) ---------- */
.view-toggle { display: inline-flex; background: var(--body-bg); border: 1px solid var(--border-color); border-radius: var(--radius-sm); overflow: hidden; }
.vt-btn { border: none; background: transparent; padding: 6px 10px; cursor: pointer; color: var(--text-muted); display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.vt-btn:hover { color: var(--text-primary); background: rgba(0,0,0,0.03); }
.vt-btn.active { background: var(--primary); color: #fff; box-shadow: 0 1px 4px rgba(67,97,238,0.25); }
[data-theme="dark"] .view-toggle { background: #252836; border-color: #2d3140; }
[data-theme="dark"] .vt-btn:hover { background: rgba(255,255,255,0.05); }
[data-theme="dark"] .vt-btn.active { background: var(--primary); }

/* View toggle states */
.data-view[data-active="table"] .mobile-card-list { display: none !important; }
.data-view[data-active="table"] .table-responsive { display: block !important; }
.data-view[data-active="cards"] .mobile-card-list { display: block !important; }
.data-view[data-active="cards"] .table-responsive { display: none !important; }

/* Enterprise data-dense table */
.table { border-collapse: separate; border-spacing: 0; }
.table thead th { background: linear-gradient(180deg, #f8f9fb, #f0f2f5); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); font-weight: 600; position: sticky; top: 0; z-index: 2; }
[data-theme="dark"] .table thead th { background: linear-gradient(180deg, #252836, #1f2230); }
.table tbody tr { transition: background 0.15s; }
.table tbody tr:hover td { background: rgba(67,97,238,0.03); }
[data-theme="dark"] .table tbody tr:hover td { background: rgba(67,97,238,0.06); }
.table td a { font-weight: 500; }

/* Enterprise filter bar */
.filter-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.filter-bar .search-box { flex: 1; min-width: 200px; position: relative; }
.filter-bar .search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.filter-bar .search-input { padding-left: 34px; }

/* Quick actions enterprise */
.quick-action { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px; background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); cursor: pointer; transition: var(--transition); text-decoration: none; color: var(--text-primary); }
.quick-action:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); color: var(--text-primary); }
.quick-action .qa-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.quick-action span { font-size: 0.7rem; font-weight: 500; text-align: center; }
[data-theme="dark"] .quick-action { background: var(--card-bg); }

/* Enterprise cards-grid (overridden by data-view JS) */

/* ---------- Toast Notifications ---------- */
.toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 400px;
    width: calc(100% - 32px);
    pointer-events: none;
}
.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 10px;
    background: var(--card-bg);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    pointer-events: all;
    cursor: pointer;
    transition: opacity 0.3s, transform 0.3s;
    animation: toastSlideIn 0.35s ease;
    border-left: 4px solid var(--border-color);
}
.toast-success { border-left-color: var(--success); }
.toast-success .toast-icon { color: var(--success); }
.toast-danger { border-left-color: var(--danger); }
.toast-danger .toast-icon { color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info { border-left-color: var(--info); }
.toast-info .toast-icon { color: var(--info); }

.toast-icon { flex-shrink: 0; display: flex; }
.toast-msg { flex: 1; line-height: 1.4; }
.toast-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    flex-shrink: 0;
}
.toast-close:hover { color: var(--text-primary); }

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 767px) {
    .toast-container { top: 10px; right: 10px; left: 10px; max-width: 100%; width: auto; }
}
