/* ==================== Authentication Styles ==================== */
.auth-screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.auth-screen.active {
    display: flex;
}

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.auth-card h1 {
    color: #2563eb;
    margin-bottom: 10px;
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.auth-subtitle {
    color: #64748b;
    font-size: 16px;
    margin-bottom: 25px;
}

.auth-message {
    margin-bottom: 20px;
    padding: 12px;
    border-radius: 6px;
    display: none;
    font-size: 14px;
}

.auth-message.error {
    display: block;
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.auth-message.success {
    display: block;
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.auth-message.warning {
    display: block;
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

#authForm .form-group {
    margin-bottom: 20px;
}

#authForm input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 16px;
    text-align: center;
    letter-spacing: 2px;
}

#authForm input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-block {
    width: 100%;
}

.auth-attempts {
    margin-top: 15px;
    font-size: 12px;
    color: #64748b;
    min-height: 20px;
}

.auth-attempts.warning {
    color: #ef4444;
    font-weight: 600;
}

.auth-footer {
    margin-top: 30px;
    font-size: 12px;
    color: #cbd5e1;
}

/* ==================== Global Styles ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --light-bg: #f8fafc;
    --white: #ffffff;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-dark);
    line-height: 1.6;
}

body.dark-mode {
    --light-bg: #1e293b;
    --white: #0f172a;
    --text-dark: #f1f5f9;
    --text-light: #cbd5e1;
    --border-color: #334155;
    background-color: var(--light-bg);
}

/* ==================== Dashboard Layout ==================== */
.dashboard-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 250px;
    background-color: var(--white);
    box-shadow: var(--shadow);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h1 {
    font-size: 24px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--primary-color);
}

.nav-menu {
    list-style: none;
    padding: 10px 0;
    flex-grow: 1;
}

.nav-menu li {
    padding: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-dark);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.nav-link:hover {
    background-color: var(--light-bg);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.nav-link.active {
    background-color: var(--light-bg);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 600;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-bar {
    background-color: var(--white);
    padding: 15px 30px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.search-box {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.connection-indicator {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.connection-indicator.online {
    background-color: #dcfce7;
    color: #166534;
}

.connection-indicator.offline {
    background-color: #fee2e2;
    color: #991b1b;
}

.notification-bell {
    position: relative;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-dark);
}

.notification-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.notification-dropdown {
    display: none !important;
    position: absolute;
    top: calc(100% + 12px);
    right: -10px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    min-width: 300px;
    max-width: 360px;
    z-index: 1000;
    overflow: hidden;
}

.notification-bell.open .notification-dropdown {
    display: block !important;
}

.notification-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 14px;
}

.notification-dropdown-header button {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 13px;
    cursor: pointer;
    padding: 0;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    line-height: 1.4;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item i {
    color: var(--primary-color);
    margin-top: 2px;
    flex-shrink: 0;
}

.notification-item .notif-text {
    flex: 1;
    color: var(--text-dark);
}

.notification-item .notif-dismiss {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    flex-shrink: 0;
}

.notification-item .notif-dismiss:hover {
    color: var(--danger-color);
}

.no-notifications {
    padding: 16px;
    text-align: center;
    color: var(--text-light);
    font-size: 13px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    position: relative;
}

.user-profile img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.user-dropdown {
    display: none !important;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    z-index: 1000;
    overflow: hidden;
}

.user-dropdown a,
.user-dropdown button {
    display: block;
    width: 100%;
    padding: 12px 16px;
    text-align: left;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 14px;
    background: none;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.user-dropdown a:hover,
.user-dropdown button:hover {
    background: var(--light-bg);
}

.user-dropdown hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 4px 0;
}

.user-dropdown .sign-out {
    color: var(--danger-color);
    font-weight: 500;
}

.user-profile.open .user-dropdown {
    display: block !important;
}

.user-profile i.fa-caret-down {
    font-size: 12px;
    color: var(--text-light);
    transition: transform 0.2s;
}

.user-profile.open i.fa-caret-down {
    transform: rotate(180deg);
}

/* ==================== Section Styles ==================== */
.section {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-header h2 {
    font-size: 28px;
    color: var(--text-dark);
}

/* ==================== Stats Grid ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: var(--white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
}

.stat-content h3 {
    font-size: 28px;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.stat-content p {
    color: var(--text-light);
    font-size: 14px;
}

/* ==================== Dashboard Grid ==================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.card {
    background-color: var(--white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.card h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.activity-list,
.upcoming-list {
    list-style: none;
}

.activity-list li,
.upcoming-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-dark);
    font-size: 14px;
}

.activity-list li:last-child,
.upcoming-list li:last-child {
    border-bottom: none;
}

/* ==================== Buttons ==================== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #1d4ed8;
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #475569;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

/* ==================== Tables ==================== */
.table-responsive {
    overflow-x: auto;
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background-color: var(--light-bg);
    border-bottom: 2px solid var(--border-color);
}

.data-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 14px;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-dark);
}

.data-table tbody tr:hover {
    background-color: var(--light-bg);
}

/* ==================== Filters ==================== */
.filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-input {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-dark);
    background-color: var(--white);
}

.filter-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ==================== Forms ==================== */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-dark);
    background-color: var(--white);
    font-family: inherit;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ==================== Modals ==================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: var(--white);
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content h2 {
    margin-bottom: 20px;
    color: var(--text-dark);
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.3s ease;
}

.close:hover {
    color: var(--text-dark);
}

/* ==================== Appointments & Work Orders ==================== */
.appointments-container,
.work-orders-container,
.reviews-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.appointment-card,
.work-order-card,
.review-card {
    background-color: var(--white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.appointment-card:hover,
.work-order-card:hover,
.review-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.appointment-card h3,
.work-order-card h3,
.review-card h3 {
    margin-bottom: 10px;
    color: var(--primary-color);
}

.appointment-card p,
.work-order-card p,
.review-card p {
    margin-bottom: 8px;
    color: var(--text-dark);
    font-size: 14px;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 10px;
}

.status-badge.pending {
    background-color: #fef3c7;
    color: #92400e;
}

.status-badge.in-progress {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-badge.completed {
    background-color: #dcfce7;
    color: #166534;
}

.status-badge.scheduled {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-badge.cancelled {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-badge.draft {
    background-color: #e5e7eb;
    color: #374151;
}

.status-badge.sent {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-badge.paid {
    background-color: #dcfce7;
    color: #166534;
}

.status-badge.overdue {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-badge.accepted {
    background-color: #dcfce7;
    color: #166534;
}

.status-badge.rejected {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-badge.active {
    background-color: #dcfce7;
    color: #166534;
}

.status-badge.inactive {
    background-color: #e5e7eb;
    color: #374151;
}

/* ==================== Team Grid ==================== */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.team-card {
    background-color: var(--white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    text-align: center;
}

.team-card-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin: 0 auto 15px;
    background: linear-gradient(135deg, var(--primary-color), #3b82f6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
}

.team-card h3 {
    margin-bottom: 5px;
    color: var(--text-dark);
}

.team-card p {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 8px;
}

/* ==================== Settings ==================== */
.settings-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

.settings-section {
    background-color: var(--white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.settings-section h3 {
    margin-bottom: 20px;
    color: var(--text-dark);
}

.settings-section label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.settings-section input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

/* ==================== Star Rating ==================== */
.star-rating {
    display: flex;
    gap: 10px;
    font-size: 28px;
}

.star-rating i {
    cursor: pointer;
    color: #d1d5db;
    transition: color 0.3s ease;
}

.star-rating i:hover,
.star-rating i.active {
    color: #fbbf24;
}

/* ==================== Backup Section ==================== */
#backup-interval-group {
    margin-top: 10px;
    padding: 10px;
    background-color: rgba(37, 99, 235, 0.05);
    border-radius: 4px;
}

#backup-history-container {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: rgba(0, 0, 0, 0.02);
}

.backup-item {
    padding: 10px;
    margin-bottom: 8px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 12px;
}

.backup-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.backup-item-type {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    background-color: #dbeafe;
    color: #1e40af;
}

.backup-item-type.auto {
    background-color: #dbeafe;
    color: #1e40af;
}

.backup-item-type.manual {
    background-color: #dcfce7;
    color: #166534;
}

.backup-item-details {
    color: var(--text-light);
    font-size: 11px;
    line-height: 1.4;
}

.backup-item-actions {
    display: flex;
    gap: 5px;
    margin-top: 8px;
}

#backup-status {
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
}

#last-backup-info,
#backup-stats-info {
    margin: 5px 0;
    font-size: 12px;
    color: var(--text-dark);
    line-height: 1.5;
}

/* ==================== Action Buttons ==================== */
.action-buttons {
    display: flex;
    gap: 5px;
}

.action-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 16px;
    transition: color 0.3s ease;
    padding: 5px 10px;
}

.action-btn:hover {
    color: var(--text-dark);
}

.action-btn.delete {
    color: var(--danger-color);
}

/* ==================== Mobile Responsive ==================== */
@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .sidebar.open {
        max-height: 400px;
    }

    .hamburger {
        display: block;
    }

    .top-bar {
        padding: 10px 15px;
        flex-direction: row;
    }

    .search-box {
        min-width: 150px;
    }

    .main-content {
        height: calc(100vh - 60px);
    }

    .section {
        padding: 15px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .section-header h2 {
        font-size: 24px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .stat-card {
        padding: 15px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .table-responsive {
        overflow-x: auto;
    }

    .data-table th,
    .data-table td {
        padding: 10px 8px;
        font-size: 12px;
    }

    .filters {
        flex-direction: column;
    }

    .filter-input {
        width: 100%;
    }

    .appointments-container,
    .work-orders-container,
    .reviews-container {
        grid-template-columns: 1fr;
    }

    .team-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .settings-container {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        max-height: 95vh;
        padding: 20px;
    }

    .close {
        right: 15px;
        top: 15px;
    }

    .top-bar-right {
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .sidebar-header h1 {
        font-size: 18px;
    }

    .section-header h2 {
        font-size: 20px;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
    }

    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }

    .data-table th,
    .data-table td {
        padding: 8px 5px;
        font-size: 11px;
    }

    .btn {
        width: 100%;
        justify-content: center;
        padding: 12px;
    }

    .modal-content {
        padding: 15px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px;
    }

    .top-bar {
        flex-direction: column;
        gap: 10px;
    }

    .search-box {
        width: 100%;
    }

    .team-grid {
        grid-template-columns: 1fr;
    }
}




