/* ========================================
   Appointments & Booking System - Styles
   Professional Calendar UI
   ======================================== */

/* CSS Variables */
:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: #dbeafe;

    --success-color: #22c55e;
    --success-hover: #16a34a;
    --success-light: #dcfce7;

    --warning-color: #f59e0b;
    --warning-hover: #d97706;
    --warning-light: #fef3c7;

    --danger-color: #ef4444;
    --danger-hover: #dc2626;
    --danger-light: #fee2e2;

    --info-color: #6366f1;
    --info-hover: #4f46e5;
    --info-light: #eef2ff;

    --purple-color: #8b5cf6;
    --purple-light: #ede9fe;

    --pink-color: #ec4899;
    --pink-light: #fce7f3;

    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;

    --bg-primary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-hover: #f8fafc;

    --border-color: #e2e8f0;
    --border-radius: 16px;
    --border-radius-sm: 10px;
    --border-radius-lg: 20px;
    --border-radius-full: 9999px;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
    --shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 24px -4px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 20px 40px -8px rgba(0, 0, 0, 0.15);

    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;

    /* Calendar specific */
    --hour-height: 60px;
    --time-column-width: 70px;
    --staff-column-min-width: 200px;

    /* Sidebar */
    --sidebar-width: 240px;
    --sidebar-collapsed-width: 70px;
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Touch action improvements */
html {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Prevent text selection on buttons */
button,
.nav-item,
.view-btn,
.quick-action-btn {
    -webkit-user-select: none;
    user-select: none;
}

/* Smooth scrolling on iOS */
.calendar-container,
.sidebar-content,
.modal-body,
.list-body,
.stats-bar,
.week-body {
    -webkit-overflow-scrolling: touch;
}

/* Prevent horizontal overflow globally */
html,
body {
    overflow-x: hidden;
    max-width: 100vw;
}

.app-container {
    overflow-x: hidden;
    max-width: 100vw;
}

/* ========================================
   Font Awesome Icon Styling
   ======================================== */
.logo-icon i,
.nav-icon i,
.stat-icon i,
.bottom-nav-icon i {
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon i {
    font-size: 18px;
}

.search-icon i {
    font-size: 14px;
}

.quick-action-btn i,
.detail-action-btn i {
    font-size: 16px;
}

/* ========================================
   Login Screen
   ======================================== */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-screen.hidden {
    display: none;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.login-header {
    text-align: center;
    padding: 40px 30px 30px;
    background: linear-gradient(135deg, var(--bg-primary) 0%, #e8f0fe 100%);
    border-bottom: 1px solid var(--border-color);
}

.login-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--info-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
}

.login-logo .logo-icon {
    font-size: 40px;
}

.login-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.login-body {
    padding: 30px;
    text-align: center;
}

.login-description {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.google-login-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.google-login-btn:hover {
    background: var(--bg-primary);
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
}

.google-login-btn .google-icon {
    width: 22px;
    height: 22px;
}

.login-footer {
    padding: 20px 30px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
}

.login-features {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--text-secondary);
}

.login-features span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* App Container Hidden State */
.app-container.hidden {
    display: none;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: "Rubik", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    direction: rtl;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ========================================
   Main Sidebar Navigation
   ======================================== */
/* Main Sidebar Overlay (for mobile) */
.main-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.main-sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.main-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-card);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo .logo-icon {
    font-size: 28px;
}

.sidebar-logo .logo-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.nav-menu {
    list-style: none;
    padding: 16px 12px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
    margin-bottom: 4px;
    color: var(--text-secondary);
}

.nav-item:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary-color);
    font-weight: 500;
}

.nav-icon {
    font-size: 20px;
}

.nav-text {
    font-size: 14px;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: var(--border-radius-sm);
    background: var(--bg-primary);
}

.user-info .user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-color), var(--info-color));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
}

.user-info .user-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 12px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--danger-color);
    background: var(--danger-light);
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
    font-family: inherit;
}

.logout-btn:hover {
    background: var(--danger-color);
    color: white;
}

/* ========================================
   Main Area
   ======================================== */
.main-area {
    flex: 1;
    margin-right: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* ========================================
   Header
   ======================================== */
.main-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.header-right,
.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-primary);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 18px;
}

.page-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    font-size: 28px;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Date Navigator */
.date-navigator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-primary);
    padding: 6px 10px;
    border-radius: var(--border-radius);
}

.nav-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-card);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.nav-btn:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}

.date-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.date-display:hover {
    border-color: var(--primary-color);
}

.date-icon {
    font-size: 18px;
}

.today-btn {
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.today-btn:hover {
    background: var(--primary-hover);
}

/* Google Sync */
.google-sync {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sync-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-primary);
    border-radius: var(--border-radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.sync-status:hover {
    background: var(--border-color);
}

.sync-status.connected .sync-indicator {
    width: 8px;
    height: 8px;
    background: var(--success-color);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.sync-status.disconnected .sync-indicator {
    width: 8px;
    height: 8px;
    background: var(--danger-color);
    border-radius: 50%;
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.sync-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-primary);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: var(--transition-fast);
}

.sync-btn:hover {
    background: var(--primary-light);
}

.sync-btn.syncing {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* User Menu */
.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    background: var(--bg-primary);
    border-radius: var(--border-radius-full);
    cursor: pointer;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-color), var(--info-color));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

/* Action Buttons */
.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    font-family: inherit;
}

.action-btn.primary {
    background: var(--primary-color);
    color: white;
}

.action-btn.primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.action-btn.secondary {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.action-btn.secondary:hover {
    background: var(--border-color);
}

.action-btn.success {
    background: var(--success-color);
    color: white;
}

.action-btn.success:hover {
    background: var(--success-hover);
}

.action-btn.danger {
    background: var(--danger-color);
    color: white;
}

.action-btn.danger:hover {
    background: var(--danger-hover);
}

/* ========================================
   Stats Bar
   ======================================== */
.stats-bar {
    display: flex;
    gap: 16px;
    padding: 16px 24px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    min-width: 140px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-card:active {
    transform: translateY(0);
}

.stat-card.highlight {
    background: linear-gradient(135deg, var(--primary-light), var(--info-light));
    border: 1px solid var(--primary-color);
}

.stat-card.filter-active {
    box-shadow: 0 0 0 2px var(--primary-color);
    background: var(--primary-light);
}

.stat-card.filter-active::after {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    top: -6px;
    left: -6px;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-card {
    position: relative;
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-icon.today {
    background: var(--primary-light);
}

.stat-icon.confirmed {
    background: var(--success-light);
}

.stat-icon.waiting {
    background: var(--warning-light);
}

.stat-icon.cancelled {
    background: var(--danger-light);
}

.stat-icon.next {
    background: var(--info-light);
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ========================================
   Toolbar
   ======================================== */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 24px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.view-toggle {
    display: flex;
    gap: 4px;
    background: var(--bg-primary);
    padding: 4px;
    border-radius: var(--border-radius-sm);
}

.view-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.view-btn:hover {
    color: var(--text-primary);
}

.view-btn.active {
    background: var(--bg-card);
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.filters {
    display: flex;
    gap: 16px;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-size: 13px;
    color: var(--text-secondary);
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 13px;
    font-family: inherit;
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    min-width: 120px;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    right: 12px;
    font-size: 14px;
    color: var(--text-muted);
}

.search-box input {
    padding: 10px 40px 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-family: inherit;
    width: 220px;
    transition: var(--transition-fast);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    width: 280px;
}

/* ========================================
   Main Content
   ======================================== */
.main-content {
    flex: 1;
    display: flex;
    overflow: hidden;
    min-height: 0;
}

.calendar-container {
    flex: 1;
    overflow: hidden;
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* ========================================
   Day View - Unified Scrolling Grid Layout
   ======================================== */
.day-view {
    display: none;
    height: 100%;
    flex-direction: column;
    overflow: hidden;
}

.day-view.active {
    display: flex;
}

/* Single scroll container for everything */
.day-view-scroll {
    flex: 1;
    overflow: auto;
    position: relative;
    -webkit-overflow-scrolling: touch;
}

/* Grid layout: corner | headers (row 1), times | body (row 2) */
.day-view-grid {
    display: grid;
    grid-template-columns: var(--time-column-width) 1fr;
    grid-template-rows: 50px 1fr;
    min-width: max-content;
}

/* Corner cell - sticky to top-right */
.grid-corner {
    position: sticky;
    top: 0;
    right: 0;
    z-index: 30;
    background: var(--bg-primary);
    border-left: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Staff headers row - sticky to top */
.grid-headers {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

/* Time column - sticky to right */
.grid-times {
    position: sticky;
    right: 0;
    z-index: 10;
    background: var(--bg-card);
    border-left: 1px solid var(--border-color);
}

/* Main body with staff columns */
.grid-body {
    display: flex;
    position: relative;
}

/* Individual time slot */
.time-slot {
    height: var(--hour-height);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    background: #fafbfc;
}

.time-slot.current-hour {
    color: var(--primary-color);
    font-weight: 600;
}

.time-slot.work-hour {
    background: var(--bg-card);
}

/* Staff column styles */
.staff-column {
    min-width: var(--staff-column-min-width);
    flex: 1;
    border-left: 1px solid var(--border-color);
    position: relative;
}

.staff-column:last-child {
    border-left: none;
}

/* Unified calendar view (Google Calendar style) */
.staff-column.unified-calendar {
    min-width: 100%;
    width: 100%;
    border-left: none;
}

/* Staff header cell */
.staff-header {
    min-width: var(--staff-column-min-width);
    flex: 1;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 16px;
    background: var(--bg-primary);
    border-left: 1px solid var(--border-color);
    box-sizing: border-box;
}

.staff-header:last-child {
    border-left: none;
}

.staff-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 600;
}

.staff-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.staff-role {
    font-size: 11px;
    color: var(--text-muted);
}

/* Staff body - contains hour rows and appointments */
.staff-body {
    position: relative;
    background: var(--bg-card);
}

.hour-row {
    height: var(--hour-height);
    border-bottom: 1px solid var(--border-color);
    position: relative;
    background: #fafbfc;
}

/* Work hours highlighted with active background */
.hour-row.work-hour {
    background: var(--bg-card);
}

.hour-row::after {
    content: "";
    position: absolute;
    bottom: 50%;
    left: 0;
    right: 0;
    border-bottom: 1px dashed #f0f0f0;
}

/* Appointment Cards */
.appointment-card {
    position: absolute;
    left: 4px;
    right: 4px;
    border-radius: var(--border-radius-sm);
    padding: 8px 10px;
    cursor: pointer;
    overflow: hidden;
    transition: var(--transition-fast);
    z-index: 1;
}

/* Overlapping events - narrower cards side by side */
.appointment-card.overlapping {
    /* Width and left position are set inline via JavaScript */
    /* This class provides additional styling for overlapping events */
    border-left-width: 3px;
}

.appointment-card.overlapping:hover {
    z-index: 3;
}

/* Adjust font sizes for overlapping events when they get narrow */
.appointment-card.overlapping .appointment-time {
    font-size: 10px;
}

.appointment-card.overlapping .appointment-info {
    font-size: 11px;
}

.appointment-card.overlapping .appointment-notes {
    display: none;
}

.appointment-card:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
    z-index: 2;
}

/* Touch feedback for mobile */
.appointment-card:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.appointment-card.dragging {
    opacity: 0.8;
    box-shadow: var(--shadow-xl);
    z-index: 100;
    cursor: grabbing;
}

.appointment-card .resize-handle {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 8px;
    cursor: ns-resize;
    background: transparent;
}

.appointment-card .resize-handle:hover {
    background: rgba(0, 0, 0, 0.1);
}

.appointment-card.resizing {
    opacity: 0.9;
    z-index: 100;
}

.appointment-card.confirmed {
    background: var(--success-light);
    border-right: 4px solid var(--success-color);
}

.appointment-card.pending {
    background: var(--warning-light);
    border-right: 4px solid var(--warning-color);
}

.appointment-card.waiting {
    background: var(--info-light);
    border-right: 4px solid var(--info-color);
}

.appointment-card.completed {
    background: var(--bg-primary);
    border-right: 4px solid var(--text-muted);
    opacity: 0.7;
}

.appointment-card.cancelled {
    background: var(--danger-light);
    border-right: 4px solid var(--danger-color);
    opacity: 0.6;
    text-decoration: line-through;
}

.appointment-card.noShow {
    background: var(--purple-light);
    border-right: 4px solid var(--purple-color);
    opacity: 0.6;
}

.appointment-time {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.appointment-info {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

/* Appointment notes - shown on separate line for events >= 45 min */
.appointment-notes {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-secondary);
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-style: italic;
}

/* Compact layout for short events (less than 45 min) */
.appointment-card.compact .appointment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    overflow: hidden;
}

.appointment-card.compact .appointment-time {
    margin-bottom: 0;
    flex-shrink: 0;
}

.appointment-card.compact .appointment-title {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
}

.appointment-icons {
    position: absolute;
    top: 6px;
    left: 8px;
    display: flex;
    gap: 4px;
    font-size: 12px;
}

.google-synced {
    color: var(--success-color);
}

.reminder-sent {
    color: var(--warning-color);
}

/* Current Time Line */
.current-time-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--danger-color);
    z-index: 3;
}

.current-time-line::before {
    content: "";
    position: absolute;
    right: -6px;
    top: -4px;
    width: 10px;
    height: 10px;
    background: var(--danger-color);
    border-radius: 50%;
}

/* ========================================
   Week View
   ======================================== */
.week-view {
    display: none;
    flex-direction: column;
    height: 100%;
}

.week-view.active {
    display: flex;
}

.week-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.week-day {
    padding: 16px;
    text-align: center;
    border-left: 1px solid var(--border-color);
}

.week-day:last-child {
    border-left: none;
}

.week-day-name {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.week-day-number {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 4px;
}

.week-day.today .week-day-number {
    background: var(--primary-color);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.week-day.inactive {
    opacity: 0.4;
}

.week-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    flex: 1;
    overflow-y: auto;
}

.week-column {
    border-left: 1px solid var(--border-color);
    padding: 8px;
    min-height: 200px;
    background: var(--bg-card);
}

.week-column:last-child {
    border-left: none;
}

.week-appointment {
    padding: 8px 10px;
    margin-bottom: 6px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
}

.week-appointment:hover {
    transform: translateX(-2px);
    box-shadow: var(--shadow);
}

/* ========================================
   List View
   ======================================== */
.list-view {
    display: none;
    flex-direction: column;
    background: var(--bg-card);
    height: 100%;
    max-height: 100%;
    overflow: hidden;
}

.list-view.active {
    display: flex;
}

.list-header {
    display: grid;
    grid-template-columns: 80px 1.5fr 1fr 1fr 120px 120px;
    gap: 16px;
    padding: 14px 24px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.list-body {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.list-item {
    display: grid;
    grid-template-columns: 80px 1.5fr 1fr 1fr 120px 120px;
    gap: 16px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    transition: var(--transition-fast);
    cursor: pointer;
}

.list-item:hover {
    background: var(--bg-hover);
}

.list-item:active {
    background: var(--primary-light);
}

.list-time {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.list-customer {
    display: flex;
    align-items: center;
    gap: 12px;
}

.list-customer-avatar {
    width: 36px;
    height: 36px;
    background: var(--primary-light);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
}

.list-customer-info {
    display: flex;
    flex-direction: column;
}

.list-customer-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.list-customer-phone {
    font-size: 12px;
    color: var(--text-muted);
}

.list-service {
    display: flex;
    align-items: center;
    gap: 8px;
}

.service-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.list-staff {
    display: flex;
    align-items: center;
    gap: 8px;
}

.list-staff-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    font-weight: 600;
}

.list-calendar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.calendar-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.list-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--border-radius-full);
    font-size: 12px;
    font-weight: 500;
}

.list-status.confirmed {
    background: var(--success-light);
    color: var(--success-color);
}

.list-status.pending {
    background: var(--warning-light);
    color: var(--warning-color);
}

.list-status.waiting {
    background: var(--info-light);
    color: var(--info-color);
}

.list-status.completed {
    background: var(--bg-primary);
    color: var(--text-muted);
}

.list-status.cancelled {
    background: var(--danger-light);
    color: var(--danger-color);
}
.list-status.noShow {
    background: var(--purple-light);
    color: var(--purple-color);
}

.list-actions {
    display: flex;
    gap: 8px;
}

.list-action-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-primary);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: var(--transition-fast);
}

.list-action-btn:hover {
    background: var(--primary-light);
}

/* ========================================
   Details Sidebar
   ======================================== */
.details-sidebar {
    width: 380px;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 200;
    box-shadow: var(--shadow-xl);
}

.details-sidebar.open {
    transform: translateX(0);
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 199;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.sidebar-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-primary);
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.sidebar-close:hover {
    background: var(--danger-light);
    color: var(--danger-color);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

/* Sidebar Appointment Details */
.appointment-detail-header {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.detail-customer-avatar {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary-color), var(--info-color));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 600;
    margin: 0 auto 12px;
}

.detail-customer-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.detail-customer-phone {
    font-size: 14px;
    color: var(--text-secondary);
}

.detail-section {
    margin-bottom: 24px;
}

.detail-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.detail-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.detail-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 20px;
}

.detail-actions.detail-actions-grid {
    grid-template-columns: repeat(2, 1fr);
}

.detail-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: var(--bg-card);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.detail-action-btn.full-width {
    grid-column: span 2;
}

.detail-action-btn.edit {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.detail-action-btn.edit:hover {
    background: var(--primary-color);
    color: white;
}

.detail-action-btn:hover {
    background: var(--bg-primary);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.detail-action-btn.whatsapp:hover {
    background: #dcfce7;
    border-color: #22c55e;
    color: #16a34a;
}

.detail-action-btn.call:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.detail-action-btn.danger {
    color: var(--danger-color);
    border-color: var(--danger-color);
}
.detail-action-btn.success {
    color: var(--success-color);
    border-color: var(--success-color);
}

.detail-action-btn.danger:hover {
    background: var(--danger-light);
    border-color: var(--danger-hover);
    color: var(--danger-hover);
}

.google-sync-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--success-light);
    border-radius: var(--border-radius-sm);
    margin-top: 16px;
}

.google-sync-status .icon {
    font-size: 20px;
}

.google-sync-status .text {
    font-size: 13px;
    color: var(--success-hover);
}

.google-sync-status.not-synced {
    background: var(--warning-light);
}

.google-sync-status.not-synced .text {
    color: var(--warning-hover);
}

/* ========================================
   Event History Timeline
   ======================================== */
.event-history-section {
    margin-top: 24px;
}

.history-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: var(--bg-card);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.history-toggle:hover {
    background: var(--bg-primary);
    border-color: var(--primary-color);
}

.history-toggle .toggle-icon {
    transition: transform 0.2s ease;
}

.history-toggle.open .toggle-icon {
    transform: rotate(180deg);
}

.history-container {
    display: none;
    margin-top: 12px;
}

.history-container.open {
    display: block;
}

.history-timeline {
    position: relative;
    padding-right: 24px;
}

.history-timeline::before {
    content: "";
    position: absolute;
    right: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.history-item {
    position: relative;
    padding: 12px 0;
    padding-right: 24px;
}

.history-item::before {
    content: "";
    position: absolute;
    right: 0;
    top: 16px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    z-index: 1;
}

.history-item.created::before {
    background: var(--success-color);
    border-color: var(--success-color);
}

.history-item.updated::before {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.history-item.status_changed::before {
    background: var(--info-color);
    border-color: var(--info-color);
}

.history-item.reminder_sent::before {
    background: var(--warning-color);
    border-color: var(--warning-color);
}

.history-item.reminder_failed::before {
    background: var(--danger-color);
    border-color: var(--danger-color);
}

.history-item.confirmed::before {
    background: var(--success-color);
    border-color: var(--success-color);
}

.history-item.cancelled::before,
.history-item.deleted::before {
    background: var(--danger-color);
    border-color: var(--danger-color);
}

.history-item.no_show::before {
    background: var(--purple-color);
    border-color: var(--purple-color);
}

.history-item.completed::before {
    background: var(--success-color);
    border-color: var(--success-color);
}

.history-content {
    background: var(--bg-primary);
    border-radius: var(--border-radius-sm);
    padding: 10px 12px;
}

.history-description {
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.history-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-muted);
}

.history-performer {
    display: flex;
    align-items: center;
    gap: 4px;
}

.history-performer-icon {
    font-size: 12px;
}

.history-loading {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 13px;
}

.history-empty {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 13px;
}

/* ========================================
   Modals
   ======================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: 1001;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.modal.modal-lg {
    max-width: 650px;
}

.modal.modal-sm {
    max-width: 400px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-primary);
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.modal-close:hover {
    background: var(--danger-light);
    color: var(--danger-color);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

/* Form Elements */
.form-section {
    margin-bottom: 24px;
}

.form-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-card);
    transition: var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

/* Customer Search */
.customer-search-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 16px;
}

.customer-search-wrapper .form-group {
    flex: 1;
    margin-bottom: 0;
}

.search-input-wrapper {
    position: relative;
}

.search-results {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-lg);
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
    display: none;
}

.search-results.active {
    display: block;
}

.search-result-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition-fast);
}

.search-result-item:hover {
    background: var(--bg-hover);
}

.search-result-item:last-child {
    border-bottom: none;
}

.or-divider {
    font-size: 13px;
    color: var(--text-muted);
    padding-bottom: 10px;
}

.customer-fields {
    display: none;
}

.customer-fields.active {
    display: block;
}

.selected-customer {
    margin-bottom: 16px;
}

.customer-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--primary-light);
    border: 1px solid var(--primary-color);
    border-radius: var(--border-radius-sm);
}

.customer-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.customer-info {
    flex: 1;
}

.customer-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.customer-phone {
    font-size: 12px;
    color: var(--text-secondary);
}

.remove-customer {
    width: 28px;
    height: 28px;
    border: none;
    background: var(--bg-card);
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-customer:hover {
    background: var(--danger-light);
    color: var(--danger-color);
}

/* Reminder Options */
.reminder-options {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
}

.checkbox-label input {
    display: none;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.checkbox-label input:checked + .checkbox-custom {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-label input:checked + .checkbox-custom::after {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    content: "\f00c";
    color: white;
    font-size: 10px;
}

/* Google Section */
.google-section {
    background: var(--bg-primary);
    border-radius: var(--border-radius-sm);
    padding: 16px;
    margin-bottom: 0;
}

.google-sync-option {
    display: flex;
    align-items: center;
}

.google-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.google-icon {
    width: 18px;
    height: 18px;
}

/* Quick Actions Modal */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-card);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.quick-action-btn span:first-child {
    font-size: 24px;
}

.quick-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.quick-action-btn.confirm:hover {
    background: var(--success-light);
    border-color: var(--success-color);
}

.quick-action-btn.waiting:hover {
    background: var(--info-light);
    border-color: var(--info-color);
}

.quick-action-btn.complete:hover {
    background: var(--success-light);
    border-color: var(--success-color);
}

.quick-action-btn.reschedule:hover {
    background: var(--warning-light);
    border-color: var(--warning-color);
}

.quick-action-btn.reminder:hover {
    background: var(--warning-light);
    border-color: var(--warning-color);
}

.quick-action-btn.cancel:hover {
    background: var(--danger-light);
    border-color: var(--danger-color);
}

.quick-action-btn.noshow:hover {
    background: var(--purple-light);
    border-color: var(--purple-color);
}

.quick-action-btn.whatsapp:hover {
    background: #dcfce7;
    border-color: #22c55e;
}

/* Reminder Modal */
.reminder-preview {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 16px;
    margin-bottom: 20px;
}

.preview-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.preview-message {
    background: var(--bg-card);
    border-radius: var(--border-radius-sm);
    padding: 16px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-primary);
}

.send-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Google Settings Modal */
.google-status-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--success-light);
    border-radius: var(--border-radius);
    margin-bottom: 24px;
}

.status-icon {
    font-size: 32px;
}

.status-info {
    flex: 1;
}

.status-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.status-email {
    font-size: 14px;
    color: var(--text-secondary);
}

.status-last-sync {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.settings-section {
    margin-bottom: 24px;
}

.settings-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.settings-section .checkbox-label {
    margin-bottom: 10px;
}

.action-buttons {
    display: flex;
    gap: 12px;
}

.action-buttons .action-btn {
    flex: 1;
}

/* ========================================
   Toast Notifications
   ======================================== */
.toast-container {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    min-width: 300px;
    pointer-events: auto;
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-icon {
    font-size: 20px;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
}

.toast-close {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
}

.toast.success {
    border-right: 4px solid var(--success-color);
}

.toast.error {
    border-right: 4px solid var(--danger-color);
}

.toast.warning {
    border-right: 4px solid var(--warning-color);
}

.toast.info {
    border-right: 4px solid var(--info-color);
}

/* ========================================
   Screens System
   ======================================== */
.screen {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: auto;
    min-height: 0;
}

.screen.active {
    display: flex;
}

/* Calendar screen needs internal scroll only */
#screenCalendar {
    overflow: hidden;
}

.screen-content {
    padding: 24px;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

/* ========================================
   Settings Cards
   ======================================== */
.settings-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    overflow: hidden;
}

.settings-card.large {
    max-width: 700px;
    margin: 0 auto 24px;
}

.card-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.card-header h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.card-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.card-body {
    padding: 24px;
}

/* ========================================
   Google Connect Screen
   ======================================== */
.connection-state {
    text-align: center;
    padding: 40px 20px;
}

.connection-state.hidden {
    display: none;
}

.connection-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.connection-icon.disconnected {
    background: var(--bg-primary);
    border: 2px dashed var(--border-color);
}

.connection-icon.disconnected .google-logo {
    width: 48px;
    height: 48px;
}

.connection-icon.connected {
    background: var(--success-light);
}

.connection-icon.connected span {
    font-size: 48px;
}

.connection-state h3 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.connection-state p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.connected-email {
    display: inline-block;
    padding: 8px 16px;
    background: var(--bg-primary);
    border-radius: var(--border-radius-full);
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 24px;
}

.connected-info {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--bg-primary);
    border-radius: var(--border-radius-sm);
}

.info-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.info-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.active-calendars {
    text-align: right;
    margin-bottom: 24px;
}

.active-calendar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-primary);
    border-radius: var(--border-radius-sm);
    margin-bottom: 8px;
}

.calendar-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.calendar-name {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
}

.calendar-id {
    font-size: 12px;
    color: var(--text-muted);
    direction: ltr;
}

.connection-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.action-btn.large {
    padding: 14px 28px;
    font-size: 16px;
}

.action-btn .btn-icon {
    width: 20px;
    height: 20px;
    margin-left: 8px;
}

/* ========================================
   Calendar Selection Screen
   ======================================== */
.warning-box {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    background: var(--warning-light);
    border: 1px solid var(--warning-color);
    border-radius: var(--border-radius);
}

.warning-box.hidden {
    display: none;
}

.warning-icon {
    font-size: 24px;
}

.warning-content h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.warning-content p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.calendars-list.hidden,
.calendars-list-settings.hidden {
    display: none;
}

.list-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.selection-count {
    font-size: 14px;
    color: var(--text-secondary);
}

.calendars-table {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

.calendar-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition-fast);
}

.calendar-row:last-child {
    border-bottom: none;
}

.calendar-row:hover {
    background: var(--bg-hover);
}

.calendar-row.selected {
    background: var(--primary-light);
}

.calendar-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.calendar-info {
    flex: 1;
}

.calendar-info .calendar-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.calendar-info .calendar-id {
    font-size: 12px;
    color: var(--text-muted);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

/* ========================================
   Reminders Settings Screen
   ======================================== */
.work-hours-form {
    max-width: 500px;
}

.work-hours-days {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.day-hours-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    transition: var(--transition-fast);
}

.day-hours-row:hover {
    border-color: var(--primary-color);
}

.day-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 100px;
    cursor: pointer;
}

.day-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.day-name {
    font-weight: 500;
    font-size: 14px;
}

.day-times {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: auto;
}

.day-times .time-input {
    width: 100px;
    padding: 8px 12px;
    font-size: 14px;
}

.day-times .time-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.time-range {
    display: flex;
    align-items: flex-end;
    gap: 16px;
}

.time-separator {
    font-size: 14px;
    color: var(--text-secondary);
    padding-bottom: 12px;
}

.time-input {
    width: 120px;
    text-align: center;
}

/* Services List */
.services-list {
    margin-bottom: 24px;
}

.service-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px 20px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
}

.service-item.disabled {
    opacity: 0.6;
}

.service-color-picker {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    padding: 0;
    overflow: hidden;
}

.service-color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}

.service-color-picker::-webkit-color-swatch {
    border: none;
    border-radius: var(--border-radius-sm);
}

.service-fields {
    flex: 1;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.service-name-input {
    flex: 2;
    min-width: 150px;
}

.service-duration-input {
    width: 100px;
}

.service-price-input {
    width: 100px;
}

.service-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.service-action-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-card);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: var(--transition-fast);
}

.service-action-btn:hover {
    background: var(--primary-light);
}

.service-action-btn.delete:hover {
    background: var(--danger-light);
    color: var(--danger-color);
}

.input-with-suffix {
    display: flex;
    align-items: center;
    gap: 4px;
}

.input-with-suffix .form-input {
    width: 80px;
}

.input-suffix {
    font-size: 13px;
    color: var(--text-muted);
}

.settings-save-actions {
    padding: 20px 0;
    display: flex;
    justify-content: center;
}

.settings-save-actions .action-btn {
    min-width: 200px;
    padding: 14px 32px;
    font-size: 16px;
}

/* Reminder Item */
.reminders-list {
    margin-bottom: 24px;
}

.reminder-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 16px;
    position: relative;
}

.reminder-item.disabled {
    opacity: 0.6;
}

.reminder-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.reminder-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.reminder-actions {
    display: flex;
    gap: 8px;
}

.reminder-action-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-card);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: var(--transition-fast);
}

.reminder-action-btn:hover {
    background: var(--primary-light);
}

.reminder-action-btn.delete:hover {
    background: var(--danger-light);
    color: var(--danger-color);
}

.reminder-body {
    display: grid;
    gap: 16px;
}

.reminder-row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.reminder-row .form-group {
    margin-bottom: 0;
}

.reminder-row .form-group.flex-1 {
    flex: 1;
}

.hours-select {
    width: 180px;
}

.custom-hours-input {
    width: 80px;
}

.message-textarea {
    width: 100%;
    min-height: 80px;
    resize: vertical;
}

/* Toggle Switch */
.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-switch {
    position: relative;
    width: 48px;
    height: 26px;
}

.toggle-switch input {
    display: none;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--border-color);
    border-radius: var(--border-radius-full);
    cursor: pointer;
    transition: var(--transition-fast);
}

.toggle-slider::before {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    top: 3px;
    right: 3px;
    transition: var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary-color);
}

.toggle-switch input:checked + .toggle-slider::before {
    right: 25px;
}

.toggle-label {
    font-size: 14px;
    color: var(--text-primary);
}

.confirmation-toggle {
    background: var(--bg-card);
    padding: 12px 16px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
}

.add-reminder-btn {
    width: 100%;
    justify-content: center;
    padding: 16px;
    border: 2px dashed var(--border-color);
    background: transparent;
}

.add-reminder-btn:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

/* Small button variant */
.action-btn.small {
    padding: 8px 14px;
    font-size: 13px;
}

/* ========================================
   Mobile Bottom Navigation
   ======================================== */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 4px 0;
    padding-bottom: max(4px, env(safe-area-inset-bottom));
    z-index: 100;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 10px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition-fast);
    font-family: inherit;
    border-radius: var(--border-radius-sm);
    min-width: 50px;
}

.bottom-nav-item:active {
    transform: scale(0.95);
}

.bottom-nav-item.active {
    color: var(--primary-color);
}

.bottom-nav-item.active .bottom-nav-icon {
    transform: scale(1.1);
}

.bottom-nav-icon {
    font-size: 18px;
    transition: var(--transition-fast);
    margin-top: 8px;
}

.bottom-nav-text {
    font-size: 9px;
    font-weight: 500;
}

.bottom-nav-item.add-btn {
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    padding: 0;
    min-width: auto;
}

.bottom-nav-item.add-btn .bottom-nav-icon {
    font-size: 24px;
}

.bottom-nav-item.add-btn:active {
    transform: scale(0.9);
}

/* ========================================
   Responsive - Complete Mobile Support
   ======================================== */

/* Touch-friendly defaults */
@media (pointer: coarse) {
    .nav-btn,
    .action-btn,
    .view-btn,
    .filter-select,
    .list-action-btn,
    .detail-action-btn,
    .quick-action-btn,
    .service-action-btn,
    .reminder-action-btn {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Large tablets */
@media (max-width: 1200px) {
    .filters {
        display: none;
    }

    .staff-column {
        min-width: 180px;
    }

    .stats-bar {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .stats-bar::-webkit-scrollbar {
        display: none;
    }
}

/* Tablets */
@media (max-width: 992px) {
    :root {
        --sidebar-width: 200px;
        --hour-height: 50px;
    }

    .sidebar-logo .logo-text {
        font-size: 16px;
    }

    .nav-item {
        padding: 12px 14px;
    }

    .page-title {
        font-size: 18px;
    }

    .week-header {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
    }

    .week-day {
        padding: 10px;
    }

    .week-day-number {
        font-size: 18px;
    }

    .modal {
        width: 95%;
    }

    .modal.modal-lg {
        max-width: 600px;
    }
}

/* Mobile Landscape & Small Tablets */
@media (max-width: 768px) {
    :root {
        --hour-height: 50px;
        --time-column-width: 50px;
        --staff-column-min-width: 140px;
    }

    /* Show bottom navigation on mobile */
    .mobile-bottom-nav {
        display: flex;
    }

    /* Add bottom padding to main area for bottom nav */
    .main-area {
        padding-bottom: 70px;
    }

    /* Keep menu toggle visible for additional options */
    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Hide sidebar by default on mobile */
    .main-sidebar {
        transform: translateX(100%);
        width: 280px;
        box-shadow: var(--shadow-xl);
    }

    .main-sidebar.open {
        transform: translateX(0);
    }

    .main-area {
        margin-right: 0;
        overflow-x: hidden;
        max-width: 100vw;
    }

    /* Main content - prevent overflow */
    .main-content {
        overflow-x: hidden;
        width: 100%;
    }

    /* ===== COMPACT HEADER FOR MOBILE ===== */

    /* Header - single compact row */
    .main-header {
        flex-wrap: nowrap;
        gap: 8px;
        padding: 8px 12px;
        min-height: auto;
    }

    .header-right {
        order: 1;
        flex-shrink: 0;
    }

    .header-left {
        order: 3;
        flex-shrink: 0;
    }

    /* Hide the "תור חדש" button text, show only icon */
    .header-left .action-btn span:not(.fa-plus):not([class*="fa-"]) {
        display: none;
    }

    .header-left .action-btn {
        padding: 8px 10px;
        font-size: 14px;
    }

    .header-center {
        order: 2;
        width: auto;
        flex: 1;
    }

    .page-title {
        display: none;
    }

    /* Date navigator - compact */
    .date-navigator {
        width: 100%;
        justify-content: center;
        padding: 2px 4px;
        gap: 4px;
    }

    .date-navigator .nav-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .date-display {
        padding: 4px 8px;
        font-size: 13px;
    }

    .today-btn {
        padding: 4px 10px;
        font-size: 12px;
    }

    /* Stats bar - horizontal scroll, smaller cards */
    .stats-bar {
        padding: 6px 12px;
        gap: 6px;
    }

    .stat-card {
        min-width: 90px;
        padding: 6px 10px;
        flex-shrink: 0;
    }

    .stat-icon {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .stat-value {
        font-size: 14px;
    }

    .stat-label {
        font-size: 10px;
    }

    /* Toolbar - single row, compact */
    .toolbar {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        padding: 8px 12px;
    }

    .view-toggle {
        width: auto;
        flex: 0 0 auto;
    }

    .view-btn {
        padding: 6px 10px;
        font-size: 12px;
        gap: 4px;
    }

    .view-btn i {
        font-size: 12px;
    }

    .view-btn span:not([class*="fa-"]) {
        display: inline;
    }

    .search-box {
        flex: 1;
        min-width: 120px;
    }

    .search-box input {
        width: 100%;
        padding: 6px 10px;
        font-size: 13px;
    }

    .search-box input:focus {
        width: 100%;
    }

    /* Details sidebar - full screen on mobile */
    .details-sidebar {
        width: 100%;
        max-width: 100%;
    }

    .sidebar-content {
        padding: 16px;
    }

    /* List view adjustments */
    .list-header,
    .list-item {
        grid-template-columns: 70px 1fr 100px;
        gap: 12px;
        padding: 12px 16px;
    }

    .col-service,
    .col-staff,
    .col-calendar,
    .list-service,
    .list-staff,
    .list-calendar {
        display: none;
    }

    .list-time {
        font-size: 14px;
    }

    .list-customer-avatar {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .list-customer-name {
        font-size: 13px;
    }

    .list-status {
        padding: 4px 8px;
        font-size: 11px;
    }

    /* Screen content */
    .screen-content {
        padding: 16px;
    }

    .connection-actions {
        flex-direction: column;
    }

    .action-btn.large {
        padding: 12px 20px;
        font-size: 15px;
    }

    /* Time settings */
    .time-range {
        flex-direction: column;
        align-items: stretch;
    }

    .time-separator {
        text-align: center;
        padding: 0;
    }

    .time-input {
        width: 100%;
    }

    /* Day hours */
    .day-hours-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .day-toggle {
        min-width: auto;
    }

    .day-times {
        margin-right: 0;
    }

    /* Reminders */
    .reminder-row {
        flex-direction: column;
    }

    .hours-select {
        width: 100%;
    }

    /* Modal */
    .modal {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        top: 0;
        left: 0;
        transform: none;
    }

    .modal.active {
        transform: none;
    }

    .modal-header {
        padding: 16px;
    }

    .modal-body {
        padding: 16px;
    }

    .modal-footer {
        padding: 12px 16px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    /* Quick actions */
    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .quick-action-btn {
        padding: 16px 12px;
    }

    /* Calendar container - prevent horizontal scroll for day view */
    .calendar-container {
        overflow: hidden;
        -webkit-overflow-scrolling: touch;
    }

    /* Day view - make it fit the screen */
    .day-view {
        flex-direction: column;
        width: 100%;
        overflow: hidden;
    }

    .day-view.active {
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    /* Day view scroll container */
    .day-view-scroll {
        flex: 1;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Grid adjustments for mobile */
    .day-view-grid {
        min-width: max-content;
    }

    .grid-body {
        min-width: max-content;
    }

    .grid-headers {
        min-width: max-content;
    }

    .staff-column {
        min-width: 200px;
    }

    .staff-header {
        min-width: 200px;
    }

    /* Week view - needs scroll */
    .week-view {
        overflow-x: auto;
    }

    .week-header {
        min-width: 700px;
    }

    .week-body {
        min-width: 700px;
    }

    .week-day {
        padding: 12px 8px;
    }

    .week-day-name {
        font-size: 10px;
    }

    .week-day-number {
        font-size: 16px;
    }

    /* Settings cards */
    .settings-card {
        border-radius: var(--border-radius);
    }

    .card-header {
        padding: 16px;
    }

    .card-header h2 {
        font-size: 18px;
    }

    .card-body {
        padding: 16px;
    }

    /* Connected info */
    .connected-info {
        flex-direction: column;
        gap: 12px;
    }

    /* Services */
    .service-item {
        flex-direction: column;
        gap: 12px;
    }

    .service-fields {
        width: 100%;
    }

    .service-name-input {
        width: 100%;
    }

    /* Toast */
    .toast-container {
        left: 16px;
        right: 16px;
        top: auto;
        bottom: 16px;
    }

    .toast {
        min-width: auto;
        width: 100%;
    }
}

/* Mobile Portrait */
@media (max-width: 480px) {
    :root {
        --hour-height: 45px;
        --time-column-width: 50px;
        --staff-column-min-width: 140px;
    }

    /* Login screen */
    .login-container {
        padding: 0;
    }

    .login-card {
        border-radius: 0;
        min-height: 100vh;
    }

    .login-header {
        padding: 30px 20px 24px;
    }

    .login-logo {
        width: 70px;
        height: 70px;
    }

    .login-logo .logo-icon {
        font-size: 36px;
    }

    .login-title {
        font-size: 24px;
    }

    .login-body {
        padding: 24px 20px;
    }

    .login-footer {
        padding: 16px 20px;
    }

    .login-features {
        flex-direction: column;
        gap: 8px;
    }

    /* Header */
    .main-header {
        padding: 10px 12px;
        gap: 10px;
    }

    .page-title {
        font-size: 15px;
        display: none;
    }

    .menu-toggle {
        width: 36px;
        height: 36px;
    }

    /* Date navigator */
    .date-navigator {
        flex-wrap: wrap;
        gap: 6px;
    }

    .nav-btn {
        width: 32px;
        height: 32px;
    }

    .date-display {
        flex: 1;
        justify-content: center;
        font-size: 13px;
        padding: 6px 10px;
    }

    .today-btn {
        width: 100%;
        margin-top: 4px;
    }

    /* New appointment button */
    .header-left .action-btn {
        padding: 8px;
        font-size: 0;
        display: none;
    }

    .header-left .action-btn span:first-child {
        font-size: 12px;
        margin: 0;
    }

    /* Stats bar - scrollable single row */
    .stats-bar {
        padding: 10px 12px;
        gap: 6px;
    }

    .stat-card {
        min-width: 100px;
        padding: 8px 12px;
        flex-shrink: 0;
    }

    .stat-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .stat-value {
        font-size: 16px;
    }

    .stat-label {
        font-size: 10px;
    }

    /* Toolbar */
    .toolbar {
        padding: 10px 12px;
        gap: 10px;
    }

    .view-btn {
        padding: 8px 10px;
        font-size: 12px;
    }

    .view-btn span:first-child {
        font-size: 14px;
    }

    /* Day view */
    .time-header {
        height: 40px;
        font-size: 11px;
    }

    .time-slot {
        font-size: 10px;
        padding-top: 4px;
    }

    .staff-header {
        height: 40px;
        padding: 0 8px;
        gap: 6px;
    }

    .staff-avatar {
        width: 26px;
        height: 26px;
        font-size: 10px;
    }

    .staff-name {
        font-size: 12px;
    }

    .staff-role {
        display: none;
    }

    /* Appointment cards */
    .appointment-card {
        padding: 6px 8px;
        left: 2px;
        right: 2px;
    }

    .appointment-time {
        font-size: 10px;
    }

    .appointment-info {
        font-size: 11px;
    }

    .appointment-icons {
        top: 4px;
        left: 4px;
        font-size: 10px;
    }

    /* List view */
    .list-header,
    .list-item {
        grid-template-columns: 60px 1fr 80px;
        gap: 8px;
        padding: 10px 12px;
    }

    .list-header {
        font-size: 10px;
    }

    .list-time {
        font-size: 13px;
    }

    .list-customer {
        gap: 8px;
    }

    .list-customer-avatar {
        width: 28px;
        height: 28px;
        font-size: 10px;
    }

    .list-customer-name {
        font-size: 12px;
    }

    .list-customer-phone {
        font-size: 10px;
    }

    .list-status {
        padding: 3px 6px;
        font-size: 10px;
    }

    /* Sidebar */
    .main-sidebar {
        width: 100%;
    }

    .sidebar-logo {
        padding: 16px;
    }

    .sidebar-logo .logo-icon {
        font-size: 24px;
    }

    .sidebar-logo .logo-text {
        font-size: 16px;
    }

    .nav-menu {
        padding: 12px;
    }

    .nav-item {
        padding: 14px 16px;
    }

    .sidebar-footer {
        padding: 12px;
    }

    /* Details sidebar */
    .sidebar-header {
        padding: 16px;
    }

    .sidebar-title {
        font-size: 16px;
    }

    .sidebar-content {
        padding: 12px;
    }

    .detail-customer-avatar {
        width: 56px;
        height: 56px;
        font-size: 20px;
    }

    .detail-customer-name {
        font-size: 18px;
    }

    .detail-section {
        margin-bottom: 16px;
    }

    .detail-actions {
        gap: 8px;
    }

    .detail-action-btn {
        padding: 10px;
        font-size: 12px;
    }

    /* Screen content */
    .screen-content {
        padding: 12px;
    }

    /* Settings cards */
    .settings-card {
        margin-bottom: 16px;
    }

    .card-header {
        padding: 14px;
    }

    .card-header h2 {
        font-size: 16px;
        gap: 8px;
    }

    .card-description {
        font-size: 13px;
    }

    .card-body {
        padding: 14px;
    }

    /* Connection state */
    .connection-state {
        padding: 24px 16px;
    }

    .connection-icon {
        width: 80px;
        height: 80px;
    }

    .connection-icon.connected span {
        font-size: 40px;
    }

    .connection-icon.disconnected .google-logo {
        width: 40px;
        height: 40px;
    }

    .connection-state h3 {
        font-size: 18px;
    }

    .connection-state p {
        font-size: 13px;
    }

    .connected-email {
        font-size: 13px;
        padding: 6px 12px;
    }

    /* Work hours */
    .day-hours-row {
        padding: 10px 12px;
    }

    .day-name {
        font-size: 13px;
    }

    .day-times .time-input {
        width: 100%;
        font-size: 14px;
    }

    /* Reminders */
    .reminder-item {
        padding: 14px;
    }

    .reminder-title {
        font-size: 14px;
    }

    .reminder-action-btn {
        width: 28px;
        height: 28px;
    }

    /* Services */
    .service-item {
        padding: 12px 14px;
    }

    .service-color-picker {
        width: 32px;
        height: 32px;
    }

    .service-fields {
        flex-direction: column;
    }

    .service-name-input,
    .service-duration-input,
    .service-price-input {
        width: 100%;
        min-width: auto;
    }

    /* Modal */
    .modal-title {
        font-size: 16px;
    }

    /* Form elements */
    .form-label {
        font-size: 12px;
    }

    .form-input,
    .form-select,
    .form-textarea {
        padding: 10px 12px;
        font-size: 14px;
    }

    /* Quick actions */
    .quick-actions-grid {
        gap: 8px;
    }

    .quick-action-btn {
        padding: 14px 10px;
        font-size: 12px;
    }

    .quick-action-btn span:first-child {
        font-size: 20px;
    }

    /* Profile */
    .profile-avatar-large {
        width: 80px;
        height: 80px;
        font-size: 28px;
    }

    .profile-field {
        padding: 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .profile-actions {
        flex-direction: column;
        width: 100%;
    }

    .profile-actions .action-btn {
        width: 100%;
    }

    /* Calendar selection */
    .calendar-row {
        padding: 12px;
        gap: 10px;
    }

    .calendar-info .calendar-name {
        font-size: 14px;
    }

    .calendar-info .calendar-id {
        font-size: 11px;
        word-break: break-all;
    }

    /* Active calendar item */
    .active-calendar-item {
        padding: 10px 12px;
    }

    .calendar-name {
        font-size: 13px;
    }
}

/* Extra small devices */
@media (max-width: 360px) {
    :root {
        --hour-height: 40px;
        --time-column-width: 45px;
        --staff-column-min-width: 120px;
    }

    .login-title {
        font-size: 22px;
    }

    .login-description {
        font-size: 13px;
    }

    .google-login-btn {
        padding: 12px 16px;
        font-size: 14px;
    }

    .stat-card {
        min-width: 90px;
        padding: 6px 10px;
    }

    .stat-icon {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .stat-value {
        font-size: 14px;
    }

    .view-btn {
        padding: 6px 8px;
        font-size: 11px;
    }

    .date-display {
        font-size: 12px;
    }

    .quick-action-btn {
        padding: 12px 8px;
        font-size: 11px;
    }
}

/* Landscape mode on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .main-header {
        padding: 8px 12px;
    }

    .header-center {
        order: 2;
        width: auto;
        flex: 1;
    }

    .date-navigator {
        justify-content: flex-start;
    }

    .today-btn {
        width: auto;
        margin-top: 0;
    }

    .stats-bar {
        padding: 8px 12px;
    }

    .stat-card {
        min-width: 90px;
        padding: 6px 10px;
    }

    .toolbar {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .view-toggle {
        width: auto;
    }

    .search-box {
        flex: 1;
        min-width: 150px;
    }

    .modal {
        height: 100vh;
        max-height: 100vh;
    }
}

/* Safe area insets for notched devices */
@supports (padding: max(0px)) {
    .main-header {
        padding-top: max(12px, env(safe-area-inset-top));
        padding-right: max(16px, env(safe-area-inset-right));
        padding-left: max(16px, env(safe-area-inset-left));
    }

    .main-sidebar {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }

    .modal-footer {
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }

    .toast-container {
        bottom: max(16px, env(safe-area-inset-bottom));
    }

    .sidebar-footer {
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
}

/* Confirm Modal */
.confirm-message {
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.confirm-warning {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ========================================
   Profile Screen
   ======================================== */
.profile-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 24px 0;
}

.profile-avatar-large {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--primary-color), var(--info-color));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 400px;
}

.profile-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-primary);
    border-radius: var(--border-radius-sm);
}

.profile-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.profile-value {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 500;
}

.profile-google-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-indicator.connected {
    background: var(--success-color);
    box-shadow: 0 0 8px var(--success-color);
}

.status-indicator.disconnected {
    background: var(--text-muted);
}

.profile-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    justify-content: center;
}

/* Hover effect for clickable user info */
.user-info:hover {
    background: var(--bg-hover);
    transform: translateY(-1px);
    transition: var(--transition-fast);
}

/* ========================================
   Credits System Styles
   ======================================== */
.credits-balance-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.credits-balance-box {
    display: flex;
    align-items: center;
    gap: 16px;
}

.balance-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.balance-info {
    color: white;
}

.balance-value {
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
}

.balance-label {
    font-size: 14px;
    opacity: 0.9;
    margin-top: 4px;
}

.credits-stats {
    display: flex;
    gap: 24px;
}

.credits-stats .stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
}

.credits-stats .stat-value {
    font-size: 20px;
    font-weight: 600;
}

.credits-stats .stat-label {
    font-size: 12px;
    opacity: 0.8;
}

.credits-warning {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--warning-light);
    border: 1px solid var(--warning-color);
    border-radius: var(--border-radius-sm);
    margin-bottom: 20px;
}

.credits-warning.hidden {
    display: none !important;
}

.credits-warning .warning-icon {
    color: var(--warning-color);
    font-size: 20px;
}

.credits-warning .warning-text {
    color: var(--text-primary);
    font-size: 14px;
}

.credits-packages-section {
    margin-bottom: 24px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pricing-info {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.pricing-tier {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-primary);
    border-radius: var(--border-radius-sm);
    flex: 1;
    min-width: 100px;
}

.pricing-tier.best {
    background: var(--success-light);
    border: 2px solid var(--success-color);
}

.tier-range {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.tier-price {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.pricing-tier.best .tier-price {
    color: var(--success-color);
}

.packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.package-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 16px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.package-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.package-card.popular {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.package-card.popular::before {
    content: "פופולרי";
    position: absolute;
    top: -10px;
    right: 10px;
    background: var(--primary-color);
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
}

.package-card {
    position: relative;
}

.package-quantity {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.package-unit {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.package-price {
    font-size: 16px;
    font-weight: 600;
    color: var(--success-color);
    margin-bottom: 4px;
}

.package-per-msg {
    font-size: 11px;
    color: var(--text-muted);
}

.credits-history-section {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-primary);
    border-radius: var(--border-radius-sm);
    margin-bottom: 8px;
}

.history-item-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.history-item-type {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.history-item-date {
    font-size: 12px;
    color: var(--text-secondary);
}

.history-item-amount {
    font-size: 16px;
    font-weight: 600;
}

.history-item-amount.positive {
    color: var(--success-color);
}

.history-item-amount.positive::before {
    content: "+";
}

.history-item-amount.negative {
    color: var(--danger-color);
}

.history-empty {
    text-align: center;
    padding: 32px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Responsive adjustments for credits */
@media (max-width: 768px) {
    .credits-balance-section {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .credits-stats {
        width: 100%;
        justify-content: center;
    }

    .pricing-info {
        flex-direction: column;
    }

    .packages-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========================================
   Custom Alert/Confirm Modal
   ======================================== */
.custom-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.custom-alert-overlay.active {
    opacity: 1;
    visibility: visible;
}

.custom-alert-modal {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-xl);
    transform: scale(0.9) translateY(-20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.custom-alert-overlay.active .custom-alert-modal {
    transform: scale(1) translateY(0);
}

.custom-alert-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 28px;
}

.custom-alert-icon.warning {
    background: var(--warning-light);
    color: var(--warning-color);
}

.custom-alert-icon.danger {
    background: var(--danger-light);
    color: var(--danger-color);
}

.custom-alert-icon.info {
    background: var(--info-light);
    color: var(--info-color);
}

.custom-alert-icon.success {
    background: var(--success-light);
    color: var(--success-color);
}

.custom-alert-icon.question {
    background: var(--primary-light);
    color: var(--primary-color);
}

.custom-alert-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.custom-alert-message {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 28px;
}

.custom-alert-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.custom-alert-buttons.single-button {
    justify-content: center;
}

.custom-alert-btn {
    padding: 12px 28px;
    border-radius: var(--border-radius-sm);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    min-width: 100px;
}

.custom-alert-btn.cancel {
    background: var(--bg-primary);
    color: var(--text-secondary);
}

.custom-alert-btn.cancel:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.custom-alert-btn.confirm {
    background: var(--primary-color);
    color: white;
}

.custom-alert-btn.confirm:hover {
    background: var(--primary-hover);
}

.custom-alert-btn.confirm.danger {
    background: var(--danger-color);
}

.custom-alert-btn.confirm.danger:hover {
    background: var(--danger-hover);
}

.custom-alert-btn.confirm.warning {
    background: var(--warning-color);
}

.custom-alert-btn.confirm.warning:hover {
    background: var(--warning-hover);
}

.custom-alert-btn.confirm.success {
    background: var(--success-color);
}

.custom-alert-btn.confirm.success:hover {
    background: var(--success-hover);
}

@media (max-width: 480px) {
    .custom-alert-modal {
        padding: 24px;
    }

    .custom-alert-icon {
        width: 56px;
        height: 56px;
        font-size: 24px;
    }

    .custom-alert-buttons {
        flex-direction: column-reverse;
    }

    .custom-alert-btn {
        width: 100%;
    }
}

/* ========================================
   Statistics Screen
   ======================================== */
.statistics-screen {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Period Selector */
.stats-period-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.period-btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--text-primary);
    font-family: inherit;
}

.period-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.period-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Custom Date Range */
.custom-date-range {
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.custom-date-range.hidden {
    display: none;
}

.date-range-inputs {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.date-range-inputs .form-group {
    flex: 1;
    min-width: 150px;
}

/* Stats Summary Grid */
.stats-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.stats-summary-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.stats-summary-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stats-card-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-sm);
    font-size: 22px;
}

.stats-summary-card.total .stats-card-icon {
    background: var(--primary-light);
    color: var(--primary-color);
}

.stats-summary-card.confirmed .stats-card-icon {
    background: var(--success-light);
    color: var(--success-color);
}

.stats-summary-card.cancelled .stats-card-icon {
    background: var(--danger-light);
    color: var(--danger-color);
}

.stats-summary-card.noshow .stats-card-icon {
    background: var(--warning-light);
    color: var(--warning-color);
}

.stats-summary-card.completed .stats-card-icon {
    background: var(--info-light);
    color: var(--info-color);
}

.stats-summary-card.revenue .stats-card-icon {
    background: var(--purple-light);
    color: var(--purple-color);
}

.stats-card-content {
    flex: 1;
}

.stats-card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stats-card-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Stats Charts Row */
.stats-charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.stats-chart-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.stats-chart-body {
    padding: 20px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stats-chart-body canvas {
    max-width: 100%;
    max-height: 100%;
}

/* Stats Details Grid */
.stats-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.stats-detail-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.stats-detail-header {
    padding: 16px 20px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

.stats-detail-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.stats-detail-header h3 i {
    color: var(--primary-color);
}

.stats-detail-body {
    padding: 16px 20px;
    max-height: 300px;
    overflow-y: auto;
}

.stats-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 30px;
    font-size: 14px;
}

/* Service Stats Item */
.stats-service-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.stats-service-item:last-child {
    border-bottom: none;
}

.service-stat-info {
    flex: 1;
}

.service-stat-name {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.service-stat-bar {
    height: 6px;
    background: var(--bg-primary);
    border-radius: 3px;
    overflow: hidden;
    max-width: 150px;
}

.service-stat-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.service-stat-count {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 40px;
    text-align: left;
}

.service-stat-revenue {
    font-size: 13px;
    color: var(--success-color);
    margin-right: 16px;
}

/* Status Chart */
.status-chart {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.status-bar-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-bar-label {
    width: 80px;
    font-size: 13px;
    color: var(--text-secondary);
}

.status-bar-track {
    flex: 1;
    height: 20px;
    background: var(--bg-primary);
    border-radius: 10px;
    overflow: hidden;
}

.status-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-left: 8px;
    min-width: fit-content;
}

.status-bar-fill span {
    font-size: 11px;
    font-weight: 600;
    color: white;
    padding: 0 8px;
}

.status-bar-fill.confirmed {
    background: var(--success-color);
}

.status-bar-fill.pending {
    background: var(--warning-color);
}

.status-bar-fill.cancelled {
    background: var(--danger-color);
}

.status-bar-fill.noShow {
    background: var(--text-muted);
}

.status-bar-fill.completed {
    background: var(--info-color);
}

.status-bar-fill.waiting {
    background: var(--purple-color);
}

/* Hours/Days Stats */
.stats-time-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.time-label {
    width: 60px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.time-bar-track {
    flex: 1;
    height: 8px;
    background: var(--bg-primary);
    border-radius: 4px;
    overflow: hidden;
}

.time-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--info-color));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.time-count {
    font-size: 13px;
    color: var(--text-secondary);
    min-width: 30px;
    text-align: left;
}

/* Rates List */
.stats-rate-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color);
}

.stats-rate-item:last-child {
    border-bottom: none;
}

.rate-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.rate-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Calendar Stats */
.stats-calendar-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.stats-calendar-item:last-child {
    border-bottom: none;
}

.calendar-stat-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-left: 10px;
}

.calendar-stat-name {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
}

.calendar-stat-count {
    font-weight: 600;
    color: var(--text-primary);
}

/* Activity Card */
.stats-activity-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.stats-activity-list {
    padding: 16px 20px;
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 14px;
    flex-shrink: 0;
}

.activity-icon.confirmed {
    background: var(--success-light);
    color: var(--success-color);
}

.activity-icon.cancelled {
    background: var(--danger-light);
    color: var(--danger-color);
}

.activity-icon.noShow {
    background: var(--warning-light);
    color: var(--warning-color);
}

.activity-icon.completed {
    background: var(--info-light);
    color: var(--info-color);
}

.activity-icon.pending {
    background: var(--purple-light);
    color: var(--purple-color);
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.activity-details {
    font-size: 13px;
    color: var(--text-secondary);
}

.activity-time {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Mobile Responsive for Statistics */
@media (max-width: 768px) {
    .statistics-screen {
        padding: 16px;
        gap: 16px;
    }

    .stats-period-selector {
        padding: 12px;
        gap: 6px;
    }

    .period-btn {
        padding: 8px 14px;
        font-size: 13px;
    }

    .stats-summary-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stats-summary-card {
        padding: 14px;
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .stats-card-icon {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    .stats-card-value {
        font-size: 22px;
    }

    .stats-details-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .date-range-inputs {
        flex-direction: column;
    }

    .date-range-inputs .form-group {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .stats-summary-grid {
        grid-template-columns: 1fr 1fr;
    }

    .stats-summary-card {
        padding: 12px;
    }

    .stats-card-value {
        font-size: 20px;
    }

    .stats-card-label {
        font-size: 11px;
    }

    .period-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* Statistics Loading State */
.statistics-screen.loading {
    position: relative;
    pointer-events: none;
}

.statistics-screen.loading::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    z-index: 100;
}

.statistics-screen.loading::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    z-index: 101;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Charts responsive */
@media (max-width: 768px) {
    .stats-charts-row {
        grid-template-columns: 1fr;
    }

    .stats-chart-body {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .stats-chart-body {
        height: 220px;
        padding: 12px;
    }
}
