* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
    background: #f8f9fa;
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

.header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 20px 30px;
    position: relative;
    overflow: hidden;
}

/* Surveying lines decoration (墨出し inspired) */
.header::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(52, 152, 219, 0.3) 15%,
        rgba(52, 152, 219, 0.3) 85%,
        transparent 100%);
    z-index: 0;
}

.header::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 30%;
    width: 1px;
    background: linear-gradient(180deg,
        transparent 0%,
        rgba(52, 152, 219, 0.2) 20%,
        rgba(52, 152, 219, 0.2) 80%,
        transparent 100%);
    z-index: 0;
}

.header-content {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Logo Container (wrapper for logo + lines around it) */
.logo-container {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo,
.logo-square {
    width: 60px;
    height: 60px;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #2c3e50;
    font-size: 18px;
    border: 3px solid #3498db;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
    position: relative;
    z-index: 2;
}

/* Header Logo Animated Lines (墨出し inspired) - AROUND the logo */
.header-logo-lines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    pointer-events: none;
}

.header-line {
    position: absolute;
    background: linear-gradient(90deg,
        transparent 0%,
        #3498db 20%,
        #3498db 80%,
        transparent 100%);
}

.header-line-h {
    height: 2px;
    left: 0;
    right: 0;
}

.header-line-v {
    width: 2px;
    top: 0;
    bottom: 0;
    background: linear-gradient(180deg,
        transparent 0%,
        #3498db 20%,
        #3498db 80%,
        transparent 100%);
}

.header-line-1 {
    top: 20%;
    animation: header-line-appear-h 3s ease-in-out infinite;
}

.header-line-2 {
    left: 50%;
    animation: header-line-appear-v 3s ease-in-out 1s infinite;
}

.header-line-3 {
    bottom: 20%;
    animation: header-line-appear-h 3s ease-in-out 2s infinite;
}

@keyframes header-line-appear-h {
    0%, 100% {
        opacity: 0;
        transform: scaleX(0);
    }
    20%, 80% {
        opacity: 1;
        transform: scaleX(1);
    }
}

@keyframes header-line-appear-v {
    0%, 100% {
        opacity: 0;
        transform: scaleY(0);
    }
    20%, 80% {
        opacity: 1;
        transform: scaleY(1);
    }
}

.header h1 {
    font-size: 2.2em;
    font-weight: 600;
    margin: 0;
}

.header .subtitle {
    font-size: 1.1em;
    opacity: 0.9;
    margin-top: 5px;
}

.admin-link {
    background: rgba(255,255,255,0.2);
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.admin-link:hover {
    background: rgba(255,255,255,0.3);
}

.main-container {
    padding: 30px;
}

.main-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    align-items: start;
}

.booking-section {
    background: white;
}

.info-panel {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

input, select, textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
    font-family: inherit;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52,152,219,0.1);
}

.calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background: #ecf0f1;
    border-radius: 8px;
}

/* Calendar navigation buttons for mobile - below calendar */
.calendar-nav-mobile {
    display: none;
    grid-template-columns: 1fr auto 1fr;
    gap: 10px;
    align-items: center;
    margin-top: 15px;
    padding: 10px;
    background: #ecf0f1;
    border-radius: 8px;
}

.nav-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: #2980b9;
}

.nav-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.calendar-container {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.calendar-header {
    background: #34495e;
    color: white;
    padding: 15px;
    text-align: center;
    font-weight: 600;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    outline: none;
}

/* Visual indicator when calendar receives focus after modal close */
.calendar-grid:focus {
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.3);
    border-radius: 4px;
}

.calendar-day-header {
    background: #ecf0f1;
    padding: 10px;
    text-align: center;
    font-weight: 600;
    color: #7f8c8d;
    font-size: 14px;
}

.calendar-day {
    padding: 15px 10px;
    text-align: center;
    border: 1px solid #ecf0f1;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    box-sizing: border-box;
    overflow: hidden;
}

.calendar-day.available:hover:not(.range-start):not(.range-middle):not(.range-end):not(.range-single) {
    background: #66bb6a;
    color: white;
}

.calendar-day.range-start {
    background: #2196f3 !important;
    color: white !important;
    border-radius: 6px 0 0 6px;
}

.calendar-day.range-middle {
    background: #42a5f5 !important;
    color: white !important;
}

.calendar-day.range-end {
    background: #2196f3 !important;
    color: white !important;
    border-radius: 0 6px 6px 0;
}

.calendar-day.range-single {
    background: #2196f3 !important;
    color: white !important;
    border-radius: 6px;
}

.calendar-day.available {
    background: #4caf50;
    color: white;
}

.calendar-day.available:hover {
    background: #66bb6a;
    color: white;
}

.calendar-day.unavailable {
    background: #f8f9fa;
    color: #bdc3c7;
    cursor: not-allowed;
}

.calendar-day.past {
    background: #f8f9fa;
    color: #bdc3c7;
    cursor: not-allowed;
}

.calendar-day.other-month {
    background: #f8f9fa;
    color: #d4d8db;
    cursor: not-allowed;
    opacity: 0.4;
    font-size: 13px;
}

/* Customer already-booked dates - purple with diagonal stripes */
.calendar-day.customer-booked {
    background: linear-gradient(
        135deg,
        #9c27b0 25%,
        transparent 25%,
        transparent 50%,
        #9c27b0 50%,
        #9c27b0 75%,
        transparent 75%,
        transparent
    );
    background-size: 20px 20px;
    background-color: #9c27b0;
    color: white;
    cursor: not-allowed;
    position: relative;
}

.calendar-day.customer-booked:hover {
    background-color: #7b1fa2; /* Darker purple on hover */
    background: linear-gradient(
        135deg,
        #7b1fa2 25%,
        transparent 25%,
        transparent 50%,
        #7b1fa2 50%,
        #7b1fa2 75%,
        transparent 75%,
        transparent
    );
    background-size: 20px 20px;
    background-color: #7b1fa2;
}

.customer-booked-label {
    display: block;
    font-size: 10px;
    font-weight: bold;
    margin-top: 3px;
    background: rgba(255, 255, 255, 0.95);
    color: #7b1fa2;
    padding: 3px 5px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    text-align: center;
    line-height: 1.2;
}

.calendar-day.today {
    position: relative;
    border: 2px solid #ff9800;
    background: #fff3e0;
    box-sizing: border-box;
}

.calendar-day.today.available {
    background: #66bb6a;
    border-color: #ff9800;
}

/* Today when blocked (same-day booking disabled) - keep orange frame and text */
.calendar-day.today.past {
    background: #f8f9fa;
    border: 2px solid #ff9800;
    color: #bdc3c7;
    cursor: not-allowed;
    box-sizing: border-box;
}

.today-label {
    display: block;
    font-size: 10px;
    color: #ff9800;
    font-weight: bold;
    margin-top: 2px;
}

.calendar-day.today.available .today-label {
    color: white;
}

.calendar-day-number {
    font-size: 16px;
    font-weight: 600;
}

/* HIGH PRIORITY FIX #2: Calendar disabled state during refresh */
.calendar-disabled {
    cursor: not-allowed !important;
    user-select: none;
}

.calendar-disabled .calendar-day {
    cursor: not-allowed !important;
}

.calendar-day.pending-booking {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    animation: pulse 1.5s ease-in-out infinite;
}

.calendar-day.pending-update {
    position: relative;
}

.calendar-day.pending-update::after {
    content: '⏳';
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 12px;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.calendar-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.checkbox-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.checkbox-item:hover {
    background: #e9ecef;
}

.checkbox-item input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.checkbox-item label {
    margin: 0;
    font-weight: normal;
    cursor: pointer;
}

.notice-box {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-left: 4px solid #2196f3;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #1565c0;
}

.welcome-box {
    background: #e8f5e8;
    border: 1px solid #c8e6c9;
    border-left: 4px solid #4caf50;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #2e7d32;
    display: none;
}

.customer-lookup-box {
    background: #fff3e0;
    border: 1px solid #ffcc02;
    border-left: 4px solid #ff9800;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #ef6c00;
}

.quick-booking-option {
    background: #f3e5f5;
    border: 1px solid #ce93d8;
    border-left: 4px solid #9c27b0;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.last-booking-summary {
    background: rgba(156, 39, 176, 0.1);
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
    font-size: 13px;
}

.btn {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 20px;
    font-weight: 600;
    font-family: inherit;
    display: block;
}

.btn.secondary {
    background: linear-gradient(135deg, #9c27b0 0%, #7b1fa2 100%);
}

.btn.small {
    padding: 10px 20px;
    font-size: 14px;
    width: auto;
    display: inline-block;
    margin: 5px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52,152,219,0.3);
}

.btn.secondary:hover {
    box-shadow: 0 4px 15px rgba(156,39,176,0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    z-index: 1000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: 300px;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: #27ae60;
}

.notification.error {
    background: #e74c3c;
}

.notification.info {
    background: #3498db;
}

.notification.warning {
    background: #ff9800;
}

.confirm-modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.confirm-modal-content {
    background: white;
    margin: 15% auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.confirm-modal h3 {
    color: #3498db;
    margin-bottom: 20px;
    font-size: 24px;
}

.confirm-modal .booking-summary {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: left;
    border-left: 4px solid #3498db;
}

.confirm-modal .modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}

.confirm-modal .modal-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    font-weight: 600;
    min-width: 100px;
    transition: all 0.3s ease;
}

.confirm-modal .modal-btn.cancel {
    background: #95a5a6;
    color: white;
}

.confirm-modal .modal-btn.cancel:hover {
    background: #7f8c8d;
}

.confirm-modal .modal-btn.confirm {
    background: #3498db;
    color: white;
}

.confirm-modal .modal-btn.confirm:hover {
    background: #2980b9;
}

.confirm-modal .modal-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    opacity: 0.7;
}

/* ===========================
   STANDARDIZED LOADING OVERLAYS
   =========================== */

/* Loading overlay - full screen centered */
.loading-overlay {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.loading-overlay.active,
.loading-overlay[style*="display: flex"],
.loading-overlay[style*="display: block"] {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.loading-overlay-content {
    background: white;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    min-width: 320px;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Processing overlay - inside modals/containers */
.processing-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    z-index: 1002;
    border-radius: 10px;
}

.processing-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* Spinner - used by both overlay types */
.processing-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #e3f2fd;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 24px auto;
}

/* Text styling - used by both overlay types */
.processing-text {
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
    width: 100%;
}

.processing-text strong {
    display: block;
    margin-bottom: 12px;
    font-size: 19px;
    color: #2c3e50;
    line-height: 1.4;
}

.processing-subtext {
    font-size: 14px;
    color: #7f8c8d;
    margin-top: 8px;
    font-weight: normal;
    line-height: 1.6;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .loading-overlay-content {
        min-width: 280px;
        max-width: 340px;
        padding: 32px 24px;
    }

    .processing-spinner {
        width: 50px;
        height: 50px;
        margin-bottom: 20px;
    }

    .processing-text {
        font-size: 16px;
    }

    .processing-text strong {
        font-size: 17px;
    }

    .processing-subtext {
        font-size: 13px;
        max-width: 240px;
    }
}

.validation-message {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
}

.form-validation {
    border: 2px solid #e74c3c !important;
    box-shadow: 0 0 0 4px rgba(231,76,60,0.2) !important;
    animation: validation-shake 0.4s ease;
}

/* Special styling for container elements (calendar, checkbox groups) */
.calendar-container.form-validation,
.checkbox-group.form-validation,
#siteSelectionContainer.form-validation {
    border: 3px solid #e74c3c !important;
    border-radius: 8px;
    padding: 12px;
    background: rgba(231, 76, 60, 0.05);
}

@keyframes validation-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

.info-text {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 5px;
    font-style: italic;
}

/* Offline Banner */
.offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #e74c3c;
    color: white;
    padding: 12px;
    text-align: center;
    z-index: 1000;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    display: none;
}

.offline-banner-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    max-width: 1200px;
    margin: 0 auto;
}

.offline-icon {
    font-size: 1.2em;
}

.offline-text {
    font-size: 14px;
}

/* Offline Warning */
.offline-warning {
    background: #fff3e0;
    border: 1px solid #ffcc02;
    border-left: 4px solid #ff9800;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
    color: #ef6c00;
    display: none;
}

.device-settings-panel {
    background: white; 
    padding: 15px; 
    border-radius: 8px; 
    margin-top: 15px;
    border: 1px solid #e9ecef;
}

.device-settings-panel h4 {
    color: #34495e; 
    margin-bottom: 10px;
}

.clear-data-btn {
    background: #e74c3c; 
    color: white; 
    border: none; 
    padding: 8px 12px; 
    border-radius: 4px; 
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-data-btn:hover {
    background: #c0392b;
}

.recognition-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 25px 0;
}

.recognition-option {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.recognition-option:hover {
    background: #e3f2fd;
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52,152,219,0.2);
}

.option-icon {
    font-size: 2em;
    margin-bottom: 5px;
}

.option-text {
    font-size: 14px;
}

.option-text strong {
    color: #2c3e50;
}

.option-text small {
    color: #7f8c8d;
}

.site-selection {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 10px;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 10px;
    background: #f8f9fa;
}

.site-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid #e9ecef;
}

.site-option:hover {
    background: #e3f2fd;
    border-color: #3498db;
}

.site-option.selected {
    background: #e3f2fd;
    border-color: #3498db;
    font-weight: 600;
}

.site-option.other-site {
    background: #fff3e0;
    border-color: #ff9800;
}

.site-option.other-site:hover {
    background: #ffe0b2;
}

.site-option input[type="radio"] {
    width: auto;
    margin: 0;
}

.site-option label {
    margin: 0;
    font-weight: normal;
    cursor: pointer;
    flex: 1;
    font-size: 14px;
}

.address-input-group {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.address-input-group label {
    font-size: 12px;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.address-input-group input {
    font-size: 14px;
    padding: 8px;
}

.phone-check-container {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.phone-check-container input {
    flex: 1;
}

.phone-check-btn {
    background: #ff9800;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
}

.phone-check-btn:hover {
    background: #f57c00;
}

.phone-check-info {
    font-size: 11px;
    color: #7f8c8d;
    margin-top: 5px;
    padding: 8px;
    background: #fff3e0;
    border-radius: 4px;
    line-height: 1.4;
}

.phone-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: stretch;
    margin-bottom: 0;
}

.phone-input-wrapper input {
    flex: 1;
    min-width: 0;
}

.send-login-link-btn {
    padding: 12px 16px;
    background: linear-gradient(135deg, #667eea 0%, #5568d3 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.send-login-link-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.send-login-link-btn:active {
    transform: translateY(0);
}

.send-login-link-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

/* Compact Loading Modal for Magic Link Request */
.compact-loading-modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.compact-loading-modal[style*="display: flex"],
.compact-loading-modal.active {
    display: flex !important;
}

.compact-modal-content {
    background: white;
    padding: 35px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    min-width: 300px;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Mobile responsive: Stack on small screens */
@media (max-width: 480px) {
    .phone-input-wrapper {
        flex-direction: column;
        gap: 8px;
    }

    .send-login-link-btn {
        width: 100%;
        justify-content: center;
    }
}

.site-info {
    font-size: 12px;
    color: #7f8c8d;
    margin-top: 2px;
}

.site-loading {
    text-align: center;
    padding: 20px;
    color: #7f8c8d;
    font-style: italic;
}

.no-sites {
    text-align: center;
    padding: 15px;
    color: #7f8c8d;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 6px;
    margin-top: 10px;
}

.phone-input-container {
    position: relative;
}

.phone-format-helper {
    font-size: 11px;
    color: #7f8c8d;
    margin-top: 5px;
}

.lookup-button {
    background: #ff9800;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 10px;
}

.lookup-button:hover {
    background: #f57c00;
}

.lookup-button:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    /* Hide top navigation on mobile */
    .calendar-nav {
        display: none;
    }
    
    /* Show bottom navigation on mobile */
    .calendar-nav-mobile {
        display: grid;
    }
    
    .calendar-container {
        touch-action: pan-y;
    }

    .header {
        padding: 15px 20px;
    }

    .header h1 {
        font-size: 1.6em;
    }

    .header-content {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .logo-section {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        width: 100%;
    }

    .main-container {
        padding: 20px;
    }

    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .calendar-grid {
        grid-template-columns: repeat(7, 1fr);
    }

    .calendar-day {
        height: 70px;
        padding: 8px 5px;
        font-size: 14px;
    }

    .calendar-day-number {
        font-size: 14px;
    }

    .confirm-modal-content {
        margin: 10% auto;
        padding: 20px;
    }

    .checkbox-group {
        grid-template-columns: 1fr;
    }
}

/* ===========================
   TASK 4.2: SERVICE WORKER STYLES
   =========================== */

/* Service Worker Update Notification */
.sw-update-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1003;
    max-width: 400px;
    animation: slideInRight 0.4s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(450px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Phone Call Button - positioned above reCAPTCHA badge */
.phone-button {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #3498db;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
    z-index: 1000;
    transition: all 0.3s ease;
    text-decoration: none;
}

.phone-button:hover {
    background: #2980b9;
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(52, 152, 219, 0.5);
}

.phone-button:active {
    transform: scale(0.95);
}

.phone-button svg {
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
}

@media (max-width: 768px) {
    .phone-button {
        width: 56px;
        height: 56px;
        bottom: 90px;
        right: 20px;
    }

    .phone-button svg {
        width: 22px;
        height: 22px;
    }
}

/* Service Worker Status Indicator */
.sw-status {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(52, 152, 219, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    z-index: 1002;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.sw-status.active::before {
    content: '●';
    color: #4caf50;
    font-size: 16px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Cache Info Display */
.sw-cache-info {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    font-size: 13px;
}

.sw-cache-info h4 {
    color: #34495e;
    margin-bottom: 10px;
    font-size: 14px;
}

.sw-cache-stat {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #f8f9fa;
}

.sw-cache-stat:last-child {
    border-bottom: none;
}

.sw-cache-label {
    color: #7f8c8d;
}

.sw-cache-value {
    color: #2c3e50;
    font-weight: 600;
}

/* Loading indicator for SW operations */
.sw-loading {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@media (max-width: 768px) {
    .sw-update-notification {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .sw-status {
        bottom: 10px;
        left: 10px;
    }
}

/* ===========================
   TASK 6.3: UNDO NOTIFICATION STYLES
   =========================== */

.undo-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #323232;
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    display: flex;
    gap: 16px;
    align-items: center;
    transition: transform 0.3s ease;
    z-index: 10000;
}

.undo-notification.show {
    transform: translateX(-50%) translateY(0);
}

.undo-notification .undo-btn {
    background: #ff9800;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
}

.undo-notification .undo-btn:hover {
    background: #f57c00;
}

/* ===========================
   TASK 6.4: ERROR RECOVERY STYLES
   =========================== */

.error-recovery-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.error-recovery-overlay.show {
    opacity: 1;
}

.error-recovery-modal {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    max-height: 80vh;
    overflow-y: auto;
}

.error-icon {
    font-size: 48px;
    text-align: center;
    margin-bottom: 15px;
}

.error-recovery-modal h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    text-align: center;
}

.error-message {
    color: #7f8c8d;
    text-align: center;
    margin-bottom: 20px;
}

.recovery-steps {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #ff9800;
}

.recovery-steps h4 {
    color: #2c3e50;
    margin-bottom: 12px;
    font-size: 16px;
}

.recovery-steps ul {
    list-style: none;
    padding: 0;
}

.recovery-steps li {
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
    color: #555;
}

.recovery-steps li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #4caf50;
    font-weight: bold;
}

.error-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.error-action-btn,
.error-close-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.error-action-btn {
    background: #3498db;
    color: white;
}

.error-action-btn:hover {
    background: #2980b9;
}

.error-close-btn {
    background: #95a5a6;
    color: white;
}

.error-close-btn:hover {
    background: #7f8c8d;
}

.error-help {
    margin-top: 20px;
    border-top: 1px solid #e9ecef;
    padding-top: 15px;
}

.error-help summary {
    cursor: pointer;
    color: #3498db;
    font-size: 14px;
    font-weight: 600;
}

.error-help summary:hover {
    color: #2980b9;
}

.help-content {
    margin-top: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.6;
    color: #555;
}

.help-content p {
    margin: 8px 0;
}

/* ===========================
   TASK 6.5: ACCESSIBILITY IMPROVEMENTS
   =========================== */

/* Skip to main content link */
.skip-to-main {
    position: absolute;
    top: -40px;
    left: 0;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-to-main:focus {
    top: 0;
}

/* Enhanced focus indicators */
*:focus {
    outline: 3px solid #3498db;
    outline-offset: 2px;
}

button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 3px solid #3498db;
    outline-offset: 2px;
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border-width: 0;
}

/* ARIA live region for announcements */
#aria-announcer {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ===========================
   TASK 6.6: MICRO-INTERACTIONS & VISUAL FEEDBACK
   =========================== */

/* Button ripple effect */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}

/* Calendar cell hover animation */
.calendar-day.available:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(76,175,80,0.3);
    z-index: 10;
}

/* Selection animation */
.calendar-day.range-start,
.calendar-day.range-end,
.calendar-day.range-single {
    animation: select-bounce 0.3s ease;
}

@keyframes select-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Form field success animation */
input.valid,
select.valid,
textarea.valid {
    animation: success-pulse 0.5s ease;
}

@keyframes success-pulse {
    0% { border-color: #e9ecef; }
    50% { border-color: #27ae60; box-shadow: 0 0 0 3px rgba(39,174,96,0.2); }
    100% { border-color: #e9ecef; }
}

/* Success flash animation */
.success-flash {
    animation: success-flash 0.6s ease;
}

@keyframes success-flash {
    0%, 100% { background: transparent; }
    50% { background: rgba(39,174,96,0.2); }
}

/* Loading state for buttons */
.btn.loading {
    pointer-events: none;
    opacity: 0.7;
    position: relative;
}

.btn.loading::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    left: 50%;
    top: 50%;
    margin-left: -8px;
    margin-top: -8px;
}

/* Tooltips */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

[data-tooltip]:hover::after {
    opacity: 1;
}

/* Smooth height transitions */
.smooth-height {
    transition: max-height 0.3s ease;
    overflow: hidden;
}

/* Mobile: Slightly smaller but still readable customer-booked label */
@media (max-width: 768px) {
    .customer-booked-label {
        font-size: 9px;
        padding: 2px 3px;
    }
}

/* Mobile touch feedback */
@media (hover: none) {
    .btn:active {
        transform: scale(0.98);
    }
    
    .calendar-day.available:active {
        transform: scale(0.95);
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
/* --- Remove focus outline from calendar days --- */
.calendar-day:focus {
    outline: none;
}

/* ==================== CREDENTIAL CHECK MODAL ==================== */
.credential-check-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.credential-check-modal.active {
    opacity: 1;
    visibility: visible;
}

.credential-check-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.credential-check-modal .modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    margin: 0 auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.credential-check-modal.active .modal-content {
    transform: scale(1);
}

.credential-check-modal .modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #e9ecef;
}

.credential-check-modal .modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
}

.credential-check-modal .modal-body {
    padding: 24px;
}

.credential-check-modal .modal-body p {
    margin: 0;
    line-height: 1.6;
    color: #555;
}

.credential-check-modal .modal-footer {
    padding: 16px 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.credential-check-modal .btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.credential-check-modal .btn-primary {
    background: #2c3e50;
    color: white;
}

.credential-check-modal .btn-primary:hover {
    background: #34495e;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.2);
}

.credential-check-modal .btn-secondary {
    background: #e9ecef;
    color: #495057;
}

.credential-check-modal .btn-secondary:hover {
    background: #dee2e6;
}

/* Mobile responsiveness */
@media (max-width: 600px) {
    .credential-check-modal .modal-content {
        width: 95%;
        max-width: none;
    }

    .credential-check-modal .modal-footer {
        flex-direction: column;
    }

    .credential-check-modal .btn {
        width: 100%;
    }
}