/* ===== CSS Variables ===== */
:root {
    --primary: #0066FF;
    --primary-dark: #0052CC;
    --primary-light: #3385FF;
    --secondary: #FF6B35;
    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;
    --background: #F8F9FA;
    --surface: #FFFFFF;
    --text: #1F2937;
    --text-secondary: #6B7280;
    --text-light: #9CA3AF;
    --border: #E5E7EB;
    --shadow: rgba(0, 0, 0, 0.1);
    --sidebar-width: 260px;
}

/* ===== Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
}

/* ===== Login Page ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header i {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 16px;
}

.login-header h1 {
    font-size: 28px;
    color: var(--text);
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.alert-error {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.login-form {
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text);
    font-size: 14px;
}

.form-group label i {
    color: var(--text-secondary);
    width: 16px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

.login-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    color: var(--text-light);
    font-size: 12px;
}

.login-footer i {
    margin-right: 4px;
}

/* ===== Buttons ===== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.3);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: none;
    background: var(--background);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s;
}

.btn-icon:hover {
    background: var(--border);
    color: var(--text);
}

.btn-icon-sm {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.btn-icon-sm:hover {
    background: var(--background);
    color: var(--primary);
}

.badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--error);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* ===== Sidebar ===== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-header i {
    font-size: 28px;
    color: var(--primary);
}

.sidebar-header h2 {
    font-size: 20px;
    color: var(--text);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: var(--background);
    color: var(--text);
}

.nav-item.active {
    background: rgba(0, 102, 255, 0.1);
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 500;
}

.nav-item i {
    width: 20px;
    text-align: center;
}

.nav-item.logout {
    color: var(--error);
}

.nav-item.logout:hover {
    background: rgba(239, 68, 68, 0.1);
}

.sidebar-footer {
    padding: 16px 0;
    border-top: 1px solid var(--border);
}

/* ===== Main Content ===== */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 24px;
    min-height: 100vh;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-left h1 {
    font-size: 32px;
    color: var(--text);
    margin-bottom: 4px;
}

.header-left p {
    color: var(--text-secondary);
    font-size: 14px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-actions {
    display: flex;
    gap: 8px;
}

/* ===== Stats Grid ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 2px 8px var(--shadow);
    transition: all 0.3s;
    border: 1px solid var(--border);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.stat-icon {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    flex-shrink: 0;
}

.stat-icon.customers {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-icon.technicians {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-icon.bookings {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-icon.pending {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.stat-icon.completed {
    background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

.stat-icon.revenue {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: var(--text);
}

.stat-content {
    flex: 1;
}

.stat-content h3 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.stat-content p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 8px;
}

.stat-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 500;
}

.stat-change.positive {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.stat-change.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

/* ===== Content Cards ===== */
.content-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 24px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.card-header h2 {
    font-size: 20px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header h2 i {
    color: var(--primary);
}

/* ===== Tables ===== */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--background);
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
}

.data-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.data-table tbody tr:hover {
    background: var(--background);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

code {
    background: var(--background);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--primary);
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: capitalize;
}

.status-pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.status-accepted {
    background: rgba(0, 102, 255, 0.1);
    color: var(--primary);
}

.status-in-progress {
    background: rgba(59, 130, 246, 0.1);
    color: #3B82F6;
}

.status-completed {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status-cancelled {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-light);
}

/* ===== Forms ===== */
.filters-form {
    margin: 0;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-group label i {
    color: var(--text-secondary);
    width: 16px;
}

.form-input,
.form-select {
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
    background: var(--surface);
    color: var(--text);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

.btn-secondary {
    background: var(--background);
    color: var(--text);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
    transform: translateY(-2px);
}

/* ===== Action Buttons ===== */
.action-buttons {
    display: flex;
    gap: 4px;
}

/* ===== Badges ===== */
.badge-number {
    display: inline-block;
    padding: 4px 10px;
    background: var(--background);
    border-radius: 12px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
}

.badge-number.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.badge-urgent {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    margin-top: 4px;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.pagination-info {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ===== Rating Display ===== */
.rating-display {
    display: flex;
    align-items: center;
}

.rating-display .fa-star.filled {
    color: var(--warning);
}

/* ===== Rating Distribution ===== */
.rating-distribution {
    padding: 20px 0;
}

.rating-bar-item {
    display: grid;
    grid-template-columns: 80px 1fr 60px;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}

.rating-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    font-size: 14px;
}

.rating-bar {
    height: 24px;
    background: var(--background);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.rating-bar-fill {
    height: 100%;
    border-radius: 12px;
    transition: width 0.5s;
}

.rating-percentage {
    text-align: right;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ===== Modals ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s;
    padding: 20px;
}

.modal-overlay.show {
    opacity: 1;
}

.modal {
    background: var(--surface);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.modal-overlay.show .modal {
    transform: scale(1);
}

.modal-small {
    width: 400px;
}

.modal-medium {
    width: 600px;
}

.modal-large {
    width: 800px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 20px;
    color: var(--text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

/* ===== Detail View ===== */
.detail-view {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.detail-section {
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.detail-section:last-child {
    border-bottom: none;
}

.detail-section h4 {
    font-size: 16px;
    color: var(--text);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-section h4 i {
    color: var(--primary);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-item label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-item div {
    font-size: 14px;
    color: var(--text);
}

.service-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.service-tag {
    display: inline-block;
    padding: 6px 12px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text);
}

/* ===== Notifications ===== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--surface);
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10001;
    min-width: 300px;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification i {
    font-size: 20px;
}

.notification-success {
    border-left: 4px solid var(--success);
}

.notification-success i {
    color: var(--success);
}

.notification-error {
    border-left: 4px solid var(--error);
}

.notification-error i {
    color: var(--error);
}

.notification-info {
    border-left: 4px solid var(--primary);
}

.notification-info i {
    color: var(--primary);
}

/* ===== Notifications Panel ===== */
.notifications-panel {
    max-height: 600px;
    display: flex;
    flex-direction: column;
}

.notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.notifications-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
}

.notifications-list {
    max-height: 500px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    border: 1px solid transparent;
}

.notification-item:hover {
    background: var(--background);
    border-color: var(--border);
}

.notification-item.read {
    opacity: 0.7;
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    font-size: 14px;
}

.notification-message {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 4px;
    line-height: 1.4;
}

.notification-time {
    color: var(--text-light);
    font-size: 11px;
}

.notification-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    position: absolute;
    top: 12px;
    right: 12px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
}

/* ===== Settings Panel ===== */
.settings-panel {
    max-height: 600px;
    overflow-y: auto;
}

.settings-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.settings-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.settings-section h4 {
    font-size: 16px;
    color: var(--text);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-section h4 i {
    color: var(--primary);
}

.settings-item {
    margin-bottom: 16px;
}

.settings-item:last-child {
    margin-bottom: 0;
}

.settings-item label {
    display: block;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 8px;
    font-size: 14px;
}

.settings-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* ===== Badge in Header ===== */
.btn-icon {
    position: relative;
}

.btn-icon .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--error);
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
    line-height: 1.4;
}

/* ===== Mobile Menu Toggle Button ===== */
.mobile-menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: none;
    background: var(--background);
    color: var(--text-secondary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s;
}

.mobile-menu-toggle:hover {
    background: var(--border);
    color: var(--text);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .header {
        flex-direction: row;
        gap: 16px;
        align-items: center;
    }
    
    .header-left {
        flex: 1;
        gap: 12px;
    }
    
    .header-left > div {
        flex: 1;
    }
    
    .header-left h1 {
        font-size: 24px;
    }
    
    .header-left p {
        font-size: 12px;
    }
    
    .modal {
        width: 95vw !important;
        max-height: 95vh;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

