/* styles/panels.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --background-color: #f1f5f9;
    --card-background: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --sidebar-width: 280px;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
}

/* Panel Layout */
.panel-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header i {
    font-size: 28px;
    color: var(--primary-color);
}

.sidebar-header span {
    font-size: 20px;
    font-weight: 600;
}

.sidebar-nav {
    flex: 1;
    padding: 24px 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.sidebar-nav a.active {
    background: rgba(37, 99, 235, 0.2);
    color: white;
    border-left-color: var(--primary-color);
}

.sidebar-nav a i {
    width: 20px;
    font-size: 18px;
}

.sidebar-footer {
    padding: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.user-info i {
    font-size: 32px;
    color: var(--primary-color);
}

.user-info span {
    font-size: 14px;
    font-weight: 500;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    margin-bottom: 16px;
}

.status-indicator.available i {
    color: var(--success-color);
}

.status-indicator.busy i {
    color: var(--warning-color);
}

.status-indicator.offline i {
    color: var(--secondary-color);
}

.btn-logout {
    width: 100%;
    padding: 10px;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 30px;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.section-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

.section-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.section-header-actions .btn-primary,
.section-header-actions .btn-secondary {
    white-space: nowrap;
}

/* Dashboard Actions */
.dashboard-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.dashboard-action-btn {
    border: 1px solid #dbe5f0;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    color: #0f172a;
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 600;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.dashboard-action-btn i {
    font-size: 16px;
    color: var(--primary-color);
}

.dashboard-action-btn:hover {
    transform: translateY(-1px);
    border-color: #bfdbfe;
    box-shadow: 0 10px 18px rgba(37, 99, 235, 0.16);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card-background);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stat-card i {
    font-size: 40px;
    color: var(--primary-color);
    background: rgba(37, 99, 235, 0.1);
    padding: 12px;
    border-radius: 12px;
}

.stat-info h3 {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.stat-info p {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Buttons */
.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s;
}

.btn-success {
    background: var(--success-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
    font-size: 16px;
    transition: color 0.3s;
}

.btn-icon:hover {
    color: var(--primary-color);
}

/* Tables */
.table-container {
    background: var(--card-background);
    border-radius: 12px;
    overflow-x: auto;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 16px;
    background: #f8fafc;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
}

td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

tr:hover {
    background: #f8fafc;
}

/* Status Badges */
.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.pending {
    background: #fff3cd;
    color: #856404;
}

.status-badge.assigned {
    background: #cce5ff;
    color: #004085;
}

.status-badge.in-progress {
    background: #d4edda;
    color: #155724;
}

.status-badge.completed {
    background: #d1e7dd;
    color: #0f5132;
}

.status-badge.cancelled {
    background: #f8d7da;
    color: #721c24;
}

.status-badge.draft {
    background: #e2e8f0;
    color: #334155;
}

.status-badge.approved {
    background: #dcfce7;
    color: #166534;
}

.status-badge.rejected {
    background: #fee2e2;
    color: #991b1b;
}

.status-badge.sent {
    background: #dbeafe;
    color: #1e40af;
}

.empty-row {
    text-align: center;
    color: #64748b;
    font-style: italic;
}

.loading-row > td {
    background: #ffffff;
}

.section-loader {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 72px;
    padding: 12px;
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
}

.section-message {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 72px;
    padding: 12px;
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
}

.inline-spinner,
.metric-loader {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #cbd5e1;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spinLoader 0.8s linear infinite;
}

.metric-loader {
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

@keyframes spinLoader {
    to {
        transform: rotate(360deg);
    }
}

.priority-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.priority-badge.low {
    background: #e2e3e5;
    color: #383d41;
}

.priority-badge.medium {
    background: #fff3cd;
    color: #856404;
}

.priority-badge.high {
    background: #f8d7da;
    color: #721c24;
}

.priority-badge.urgent {
    background: #dc3545;
    color: white;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    overflow-y: auto;
}

.modal-content {
    background: var(--card-background);
    margin: 50px auto;
    padding: 30px;
    border-radius: 12px;
    max-width: 500px;
    position: relative;
    animation: slideIn 0.3s;
}

.modal-content.large {
    max-width: 800px;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-secondary);
    cursor: pointer;
}

.close:hover {
    color: var(--text-primary);
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

input, select, textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Technician Grid */
.technician-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.technician-card {
    background: var(--card-background);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tech-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.tech-header i {
    font-size: 48px;
    color: var(--primary-color);
}

.tech-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.tech-details p {
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.tech-details i {
    width: 20px;
    margin-right: 8px;
    color: var(--primary-color);
}

.tech-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    margin: 16px 0;
}

.tech-status.available {
    background: #d4edda;
    color: #155724;
}

.tech-status.busy {
    background: #fff3cd;
    color: #856404;
}

.tech-status.offline {
    background: #e2e3e5;
    color: #383d41;
}

.tech-actions {
    display: flex;
    gap: 10px;
}

/* Job Grid */
.job-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.job-card {
    background: var(--card-background);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.job-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.job-header h3 {
    font-size: 16px;
    font-weight: 600;
}

/* Current Job Card */
.current-job-card {
    background: var(--card-background);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.current-job-card h2 {
    font-size: 18px;
    margin-bottom: 16px;
}

/* Filters */
.filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filters input,
.filters select {
    width: auto;
    min-width: 200px;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 10px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
    }
    
    .sidebar-header span,
    .sidebar-nav a span,
    .user-info span,
    .status-indicator span {
        display: none;
    }
    
    .sidebar-nav a {
        justify-content: center;
        padding: 15px;
    }
    
    .sidebar-nav a i {
        margin: 0;
    }
    
    .main-content {
        margin-left: 80px;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .filters {
        flex-direction: column;
    }
    
    .filters input,
    .filters select {
        width: 100%;
    }
}
/* Add these styles to your existing panels.css */

/* Clients Grid */
.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.client-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    border: 1px solid transparent;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.client-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.client-card.selected {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2), 0 10px 22px rgba(15, 23, 42, 0.16);
}

.client-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.client-header i {
    font-size: 24px;
    color: #2196F3;
}

.client-header h3 {
    margin: 0;
    font-size: 18px;
}

.client-details {
    margin-bottom: 15px;
}

.client-details p {
    margin: 5px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #666;
}

.client-details i {
    width: 20px;
    color: #999;
}

.client-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.client-card-hint {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #dbe3ee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    color: #64748b;
    font-size: 12px;
}

.client-card-hint i {
    margin-right: 6px;
}

.mobile-long-press-hint {
    display: none;
}

.client-selection-bar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    background: #0f172a;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 14px;
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.35);
    padding: 10px;
    display: none;
    gap: 8px;
    z-index: 2100;
}

.client-selection-bar.show {
    display: flex;
}

.client-selection-bar .btn-small {
    flex: 1 1 0;
    justify-content: center;
}

/* Technician Cards Enhancements */
.technician-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.technician-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.tech-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.tech-avatar i {
    font-size: 40px;
    color: #2196F3;
}

.tech-info h3 {
    margin: 0;
    font-size: 18px;
}

.tech-info p {
    margin: 5px 0 0;
    color: #666;
    font-size: 14px;
}

.tech-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    margin: 10px 0;
}

.tech-status.available {
    background: #e8f5e9;
    color: #4caf50;
}

.tech-status.busy {
    background: #fff3e0;
    color: #ff9800;
}

.tech-status.offline {
    background: #ffebee;
    color: #f44336;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.tech-status.available .status-indicator {
    background: #4caf50;
}

.tech-status.busy .status-indicator {
    background: #ff9800;
}

.tech-status.offline .status-indicator {
    background: #f44336;
}

.tech-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* Action Buttons */
.btn-small {
    padding: 5px 10px;
    font-size: 12px;
}

.actions-cell {
    display: flex;
    gap: 5px;
}

.btn-icon {
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    color: #666;
    border-radius: 3px;
}

.btn-icon:hover {
    background: #f5f5f5;
    color: #2196F3;
}

/* Modals */
.modal-content.large {
    max-width: 800px;
    width: 90%;
}

/* Job Details Modal */
.job-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 20px 0;
}

.detail-section {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
}

.detail-section h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
    font-size: 16px;
}

.detail-section.full-width {
    grid-column: span 2;
}

.history-timeline {
    max-height: 200px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.history-item .date {
    min-width: 150px;
    color: #666;
}

.history-item .status {
    min-width: 100px;
    font-weight: 500;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* Schedule Modal */
.schedule-list {
    max-height: 400px;
    overflow-y: auto;
}

.schedule-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.schedule-time {
    min-width: 150px;
    color: #666;
}

.schedule-details {
    flex: 1;
}

.schedule-details strong {
    display: block;
    margin-bottom: 5px;
}

.schedule-details .location {
    display: block;
    color: #999;
    font-size: 12px;
    margin-top: 5px;
}

/* Invoice Preview */
.invoice-preview {
    padding: 20px;
    background: white;
}

.invoice-header {
    text-align: center;
    margin-bottom: 30px;
}

.invoice-client, .invoice-job {
    margin-bottom: 20px;
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.invoice-table th {
    background: #f5f5f5;
    padding: 10px;
    text-align: left;
}

.invoice-table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.invoice-summary {
    width: 300px;
    margin-left: auto;
    margin-top: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
}

.summary-row.total {
    font-size: 18px;
    font-weight: bold;
    border-top: 2px solid #333;
    padding-top: 10px;
    margin-top: 10px;
}

/* Reports */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.report-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.report-card.full-width {
    grid-column: 1 / -1;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

/* Chart */
.chart-container {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    height: 200px;
    padding: 20px 0;
}

.chart-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.bar {
    width: 100%;
    background: #2196F3;
    border-radius: 5px 5px 0 0;
    transition: height 0.3s;
    min-height: 20px;
}

.bar-label {
    margin-top: 10px;
    font-size: 12px;
    color: #666;
}

.bar-value {
    font-size: 12px;
    font-weight: bold;
    color: #333;
}

/* Settings */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.settings-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.settings-card h3 {
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #2196F3;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

/* Client History */
.client-info-summary {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 5px;
    margin: 15px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.history-tabs {
    margin-top: 20px;
}

.tab-buttons {
    display: flex;
    gap: 10px;
    border-bottom: 2px solid #eee;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    position: relative;
}

.tab-btn.active {
    color: #2196F3;
    font-weight: 500;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #2196F3;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.history-job-item {
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 5px;
    margin-bottom: 10px;
}

.job-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.job-meta {
    display: flex;
    gap: 20px;
    color: #666;
    font-size: 13px;
}

.job-meta i {
    margin-right: 5px;
}

.timeline {
    max-height: 400px;
    overflow-y: auto;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    background: white;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateX(400px);
    transition: transform 0.3s;
    z-index: 1000;
    max-width: 400px;
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    border-left: 4px solid #4caf50;
}

.notification-error {
    border-left: 4px solid #f44336;
}

.notification-info {
    border-left: 4px solid #2196F3;
}

.notification i {
    font-size: 20px;
}

.notification-success i {
    color: #4caf50;
}

.notification-error i {
    color: #f44336;
}

.notification-info i {
    color: #2196F3;
}

/* Responsive */
@media (max-width: 768px) {
    .job-details-grid {
        grid-template-columns: 1fr;
    }
    
    .detail-section.full-width {
        grid-column: span 1;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .schedule-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .invoice-summary {
        width: 100%;
    }
    
    .client-info-summary {
        flex-direction: column;
        gap: 10px;
    }
}

/* Owner panel responsive + professional card enhancements */

.table-container {
    -webkit-overflow-scrolling: touch;
}

.tech-job-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}

.job-stat {
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: #f8fafc;
    padding: 4px 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.job-stat span {
    font-size: 11px;
    color: var(--text-secondary);
}

.job-stat strong {
    font-size: 12px;
    line-height: 1.1;
    color: var(--text-primary);
}

.job-stat.pending {
    background: #fffbeb;
    border-color: #fde68a;
}

.job-stat.assigned {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.job-stat.in-progress {
    background: #ecfeff;
    border-color: #a5f3fc;
}

.job-stat.completed {
    background: #ecfdf5;
    border-color: #86efac;
}

.tech-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.tech-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.tech-status.available .tech-status-dot {
    background: #16a34a;
}

.tech-status.busy .tech-status-dot {
    background: #f59e0b;
}

.tech-status.offline .tech-status-dot {
    background: #ef4444;
}

.mobile-header {
    display: none;
}

.sidebar-overlay {
    display: none;
}

.mobile-nav-toggle {
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    cursor: pointer;
}

@media (max-width: 900px) {
    body {
        background: #e9eff6;
    }

    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: calc(58px + env(safe-area-inset-top, 0px));
        padding: 0 14px;
        padding-top: env(safe-area-inset-top, 0px);
        background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
        color: #fff;
        z-index: 1201;
        box-shadow: 0 8px 18px rgba(15, 23, 42, 0.26);
    }

    .mobile-header span {
        font-size: 15px;
        font-weight: 600;
    }

    .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.55);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
        z-index: 1190;
    }

    .sidebar {
        width: min(82vw, 300px);
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 1200;
    }

    .sidebar-header span,
    .user-info span {
        display: block;
    }

    .sidebar-nav a {
        justify-content: flex-start;
        padding: 12px 24px;
    }

    body.mobile-sidebar-open .sidebar {
        transform: translateX(0);
    }

    body.mobile-sidebar-open .sidebar-overlay {
        opacity: 1;
        pointer-events: auto;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: calc(72px + env(safe-area-inset-top, 0px)) 12px calc(16px + env(safe-area-inset-bottom, 0px));
    }

    .table-container table {
        min-width: 860px;
    }

    .section-header {
        gap: 10px;
        align-items: flex-start;
        margin-bottom: 14px;
        padding: 14px;
        background: #ffffff;
        border: 1px solid #dbe5f0;
        border-radius: 16px;
        box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
    }

    .section-header h1 {
        font-size: 20px;
    }

    .section-header-actions {
        width: 100%;
        gap: 8px;
    }

    .section-header-actions .btn-primary,
    .section-header-actions .btn-secondary {
        flex: 1 1 calc(50% - 4px);
        justify-content: center;
    }

    .section-header-actions .btn-primary {
        flex-basis: 100%;
    }

    .dashboard-actions {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 14px;
    }

    .dashboard-action-btn {
        justify-content: flex-start;
        padding: 12px 14px;
        border-radius: 14px;
    }

    .date-range {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .date-range input,
    .date-range button {
        flex: 1 1 120px;
    }

    th,
    td {
        padding: 12px 10px;
        font-size: 13px;
    }

    .modal-content,
    .modal-content.large {
        width: calc(100% - 20px);
        max-width: 100%;
        margin: 22px auto;
        padding: 18px;
        border-radius: 10px;
    }

    .close {
        top: 12px;
        right: 14px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .technician-grid,
    .clients-grid,
    .reports-grid,
    .settings-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .client-card,
    .technician-card {
        border-radius: 16px;
        border: 1px solid #dbe5f0;
        box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
        background: #ffffff;
        overflow: hidden;
    }

    .client-details p,
    .tech-details p {
        word-break: break-word;
    }

    .client-card-hint {
        flex-direction: column;
        align-items: flex-start;
    }

    .mobile-long-press-hint {
        display: inline-flex;
        align-items: center;
    }

    .client-actions,
    .tech-actions {
        border-top: 1px solid #e5edf6;
        margin-top: 12px;
        padding-top: 12px;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .client-actions .btn-small,
    .tech-actions .btn-small {
        flex: 1 1 calc(50% - 6px);
        justify-content: center;
    }

    .tech-job-stats {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .job-stat {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        border-radius: 10px;
        padding: 8px 10px;
        gap: 4px;
    }

    .job-stat strong {
        font-size: 15px;
    }

    .notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

@media (max-width: 520px) {
    .mobile-header {
        height: calc(54px + env(safe-area-inset-top, 0px));
        padding: 0 12px;
    }

    .main-content {
        padding: calc(66px + env(safe-area-inset-top, 0px)) 10px calc(14px + env(safe-area-inset-bottom, 0px));
    }

    .stats-grid {
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
        gap: 12px;
    }

    .stat-card i {
        font-size: 26px;
        padding: 10px;
    }

    .stat-info p {
        font-size: 24px;
    }

    .dashboard-action-btn {
        font-size: 13px;
        gap: 8px;
    }

    .dashboard-action-btn i {
        font-size: 15px;
    }

    .section-header-actions .btn-primary,
    .section-header-actions .btn-secondary {
        flex: 1 1 100%;
    }

    .client-actions,
    .tech-actions {
        flex-direction: column;
    }

    .client-actions .btn-small,
    .tech-actions .btn-small {
        width: 100%;
        flex: 1 1 auto;
    }
}


