/* ── Yolo Nails Spa — Brand Styles ──────────────────────────── */

/* ── Custom Properties ───────────────────────────────────── */
:root {
    --accent:       #b5838d;
    --accent-dark:  #9c6b76;
    --accent-light: #e8c8ce;
    --cream:        #fdf8f4;
    --cream-dark:   #f5ebe3;
    --blush:        #f7e1d7;
    --mocha:        #6d4c41;
    --status-confirmed: #059669;
    --status-completed: #2563eb;
    --status-noshow:    #d97706;
    --status-cancelled: #dc2626;
}

/* ── Base & Utility ─────────────────────────────────────── */
html { scroll-behavior: smooth; }
body { font-family: 'Poppins', sans-serif; }

.accent-bg     { background-color: var(--accent); }
.accent-text   { color: var(--accent); }
.accent-border { border-color: var(--accent); }
.secondary-bg  { background-color: var(--cream-dark); }

/* ── Hero Entrance Animation ────────────────────────────── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}
.animate-fade-in {
    animation: fadeInUp 0.8s ease-out both;
}
.animate-fade-in-delay {
    animation: fadeInUp 0.8s ease-out 0.15s both;
}
.animate-fade-in-delay-2 {
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

/* ── Smooth hover lifts ─────────────────────────────────── */
.hover-lift {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

/* ── View Toggle ────────────────────────────────────────── */
.view-toggle-btn {
    padding: 4px 14px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    color: #6b7280;
    transition: all 0.15s ease;
    cursor: pointer;
    border: none;
    background: transparent;
    font-family: 'Poppins', sans-serif;
}
.view-toggle-btn:hover {
    color: #374151;
}
.view-toggle-btn.active {
    background: white;
    color: #1f2937;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    font-weight: 600;
}

/* ── Tech Filter Chips ──────────────────────────────────── */
#techFilterRow {
    transition: max-height 0.3s ease, opacity 0.2s ease, margin 0.3s ease, padding 0.3s ease;
    max-height: 200px;
    opacity: 1;
    overflow: hidden;
}
#techFilterRow.tech-row-collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-top-color: transparent !important;
}

/* Corner dot grid (tech filter indicators in calendar top-left) */
.corner-dot-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    justify-content: center;
    align-items: center;
    padding: 4px 3px;
    pointer-events: none;
}
.corner-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    pointer-events: none;
    transition: opacity 0.15s ease;
    flex-shrink: 0;
}
.corner-clickable {
    cursor: pointer;
}
.corner-clickable:hover {
    background: #f9fafb !important;
}
.tech-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1.5px solid;
    user-select: none;
}
.tech-chip.active {
    color: white;
}
.tech-chip:not(.active) {
    opacity: 0.4;
    filter: grayscale(0.5);
}
.tech-chip .chip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* ── Search Dropdown ────────────────────────────────────── */
.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-top: 4px;
    max-height: 280px;
    overflow-y: auto;
    box-shadow: 0 12px 24px rgba(0,0,0,0.12);
    z-index: 100;
}
.search-dropdown.hidden { display: none; }
.search-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.1s;
    border-bottom: 1px solid #f3f4f6;
    font-size: 13px;
}
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: #fdf8f4; }
.search-item .search-name { font-weight: 600; color: #1f2937; }
.search-item .search-meta { color: #9ca3af; font-size: 11px; }

/* ── Client Autocomplete ────────────────────────────────── */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-top: 2px;
    max-height: 160px;
    overflow-y: auto;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    z-index: 110;
}
.autocomplete-dropdown.hidden { display: none; }
.autocomplete-item {
    padding: 8px 14px;
    cursor: pointer;
    font-size: 13px;
    border-bottom: 1px solid #f9fafb;
    transition: background 0.1s;
}
.autocomplete-item:hover { background: #fdf8f4; }
.autocomplete-item .ac-name { font-weight: 600; }
.autocomplete-item .ac-phone { color: #9ca3af; margin-left: 8px; font-size: 12px; }

/* ── Admin App Styles ───────────────────────────────────── */

/* Calendar grid */
.calendar-grid {
    display: grid;
    gap: 0;
    position: relative;
}
.time-slot {
    min-height: 20px;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}
.time-slot.hour-line {
    border-bottom: 1px solid #e5e7eb;
}

/* Appointment blocks — status colors */
.appointment-block {
    position: absolute;
    left: 2px;
    right: 2px;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 11px;
    line-height: 1.3;
    cursor: pointer;
    overflow: hidden;
    z-index: 10;
    transition: box-shadow 0.15s ease, transform 0.1s ease;
    border-left: 3px solid rgba(0, 0, 0, 0.15);
    user-select: none;
}
.appointment-block.status-confirmed {
    background: rgba(5, 150, 105, 0.12);
    border-left-color: var(--status-confirmed);
}
.appointment-block.status-completed {
    background: rgba(37, 99, 235, 0.10);
    border-left-color: var(--status-completed);
}
.appointment-block.status-no-show {
    background: rgba(217, 119, 6, 0.12);
    border-left-color: var(--status-noshow);
}
.appointment-block.status-cancelled {
    background: rgba(220, 38, 38, 0.08);
    border-left-color: var(--status-cancelled);
    opacity: 0.5;
}
.appointment-block:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: scale(1.01);
    z-index: 20;
}
.appointment-block.search-highlight {
    z-index: 50;
    animation: searchPulse 0.6s ease-in-out 3;
    box-shadow: 0 0 0 3px var(--accent), 0 0 16px rgba(194, 120, 62, 0.5);
}
@keyframes searchPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 3px var(--accent), 0 0 16px rgba(194, 120, 62, 0.5); }
    50% { transform: scale(1.04); box-shadow: 0 0 0 5px var(--accent), 0 0 24px rgba(194, 120, 62, 0.7); }
}

.today-btn-active {
    background: var(--accent) !important;
    color: white !important;
    pointer-events: auto;
}
.appointment-block.dragging {
    opacity: 0.7;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 100;
}
.appt-status-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 3px;
    vertical-align: middle;
}

/* Resize handle */
.resize-handle {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 6px;
    cursor: ns-resize;
    border-radius: 0 0 4px 4px;
    background: linear-gradient(transparent, rgba(0,0,0,0.08));
}

/* Technician columns */
.tech-column {
    min-width: 140px;
    position: relative;
    border-right: 1px solid #e5e7eb;
}
.tech-column:last-child {
    border-right: none;
}
.tech-column.filtered-out {
    display: none;
}
.tech-header {
    padding: 10px 12px;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    background: white;
    border-bottom: 2px solid;
    position: sticky;
    top: 0;
    z-index: 30;
}
.tech-header.filtered-out {
    display: none;
}

/* Week view headers */
.week-date-header {
    padding: 8px 6px;
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    background: white;
    border-bottom: 2px solid #e5e7eb;
    flex: 1;
    min-width: 100px;
    border-right: 1px solid #e5e7eb;
    cursor: pointer;
    transition: background 0.15s, border-bottom-color 0.15s;
}
.week-date-header:hover {
    background: #fdf8f4;
    border-bottom-color: var(--accent);
}
.week-date-header:hover .date-num {
    color: var(--accent);
}
.week-date-header:last-child { border-right: none; }
.week-date-header.is-today {
    background: #fdf8f4;
    border-bottom-color: var(--accent);
}
.week-date-header .date-num {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.2;
}
.week-date-header.is-today .date-num {
    color: var(--accent);
}
.week-date-header .date-day {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    color: #9ca3af;
    letter-spacing: 0.5px;
}

/* Week column */
.week-column {
    flex: 1;
    min-width: 100px;
    position: relative;
    border-right: 1px solid #e5e7eb;
}
.week-column:last-child { border-right: none; }
.week-column .appointment-block {
    font-size: 10px;
    padding: 2px 4px;
    border-left-width: 4px;
}

/* Blocked time indicators on calendar */
.blocked-overlay {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 5;
    pointer-events: none;
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 4px,
        rgba(220, 38, 38, 0.06) 4px,
        rgba(220, 38, 38, 0.06) 8px
    );
    border: 1px dashed rgba(220, 38, 38, 0.2);
    border-radius: 4px;
}
.blocked-label {
    position: absolute;
    top: 2px;
    left: 4px;
    font-size: 9px;
    color: #dc2626;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    opacity: 0.7;
    pointer-events: none;
}

/* Week-view blocked-time pill (compact, per-tech) */
.blocked-pill {
    position: absolute;
    left: 3px;
    right: 3px;
    z-index: 6;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    font-size: 9px;
    font-weight: 600;
    color: #991b1b;
    background: rgba(254, 226, 226, 0.85);
    border: 1px dashed rgba(220, 38, 38, 0.3);
    border-left: 3px solid #dc2626;
    border-radius: 3px;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.blocked-pill-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}
.modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.15);
    transform: scale(0.95) translateY(10px);
    transition: transform 0.2s ease;
}
.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

/* Drop target highlight */
.drop-target {
    background: rgba(181, 131, 141, 0.08) !important;
}

/* Collision indicators */
.appointment-block.has-collision {
    outline: 2px dashed #ef4444;
    outline-offset: -1px;
    animation: collision-pulse 2s ease-in-out infinite;
}
@keyframes collision-pulse {
    0%, 100% { outline-color: #ef4444; }
    50% { outline-color: #fca5a5; }
}
.collision-indicator {
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 12px;
    line-height: 1;
    cursor: help;
    z-index: 5;
}

/* Hover time tooltip */
.slot-tooltip {
    position: absolute;
    left: 4px;
    padding: 2px 8px;
    background: #1f2937;
    color: white;
    font-size: 10px;
    font-weight: 600;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.1s ease;
    z-index: 15;
    white-space: nowrap;
    transform: translateY(-50%);
}
.slot-tooltip.visible {
    opacity: 1;
}

/* Slot hover highlight */
.time-slot:hover {
    background: rgba(181, 131, 141, 0.06);
}

/* Mobile two-tap highlight */
.tap-highlight {
    position: absolute;
    left: 0;
    right: 0;
    background: rgba(181, 131, 141, 0.15);
    border: 1.5px solid var(--accent);
    border-radius: 4px;
    z-index: 10;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: tap-pulse 0.3s ease;
}
.tap-highlight-time {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    background: white;
    padding: 1px 8px;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    white-space: nowrap;
}
@keyframes tap-pulse {
    0% { opacity: 0; transform: scaleY(0.8); }
    100% { opacity: 1; transform: scaleY(1); }
}

/* Time labels */
.time-label {
    font-size: 11px;
    color: #9ca3af;
    width: 52px;
    text-align: right;
    padding-right: 8px;
    flex-shrink: 0;
}

/* Now indicator */
.now-indicator {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: #ef4444;
    z-index: 25;
    pointer-events: none;
}
.now-indicator::before {
    content: '';
    position: absolute;
    left: -4px;
    top: -3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
}

/* Scrollbar styling */
.calendar-scroll::-webkit-scrollbar {
    width: 6px;
}
.calendar-scroll::-webkit-scrollbar-track {
    background: transparent;
}
.calendar-scroll::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}
.calendar-scroll::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Status badge */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.status-badge.confirmed { background: #d1fae5; color: #065f46; }
.status-badge.cancelled { background: #fee2e2; color: #991b1b; }
.status-badge.completed { background: #dbeafe; color: #1e40af; }
.status-badge.no-show   { background: #fef3c7; color: #92400e; }

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    z-index: 2000;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 360px;
}
.toast.show {
    transform: translateY(0);
    opacity: 1;
}
.toast.success { background: #065f46; color: white; }
.toast.error   { background: #991b1b; color: white; }
.toast.info    { background: #1e40af; color: white; }

/* Form inputs in modal */
.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    background: #fafafa;
    color: #1f2937;
}
.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(181, 131, 141, 0.15);
    background: white;
}

/* Custom modifier dropdown */
.mod-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    text-align: left;
}
.mod-toggle-open {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(181, 131, 141, 0.15);
    background: white;
}
.mod-toggle-open .mod-chevron {
    transform: rotate(180deg);
}
.mod-chevron {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #9ca3af;
    transition: transform 0.2s ease;
}
.mod-label {
    font-size: 14px;
    color: #1f2937;
}
.mod-label-empty {
    color: #9ca3af;
}
.mod-dropdown {
    background: white;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    max-height: 200px;
    overflow-y: auto;
    margin-top: 4px;
    padding: 4px;
}
.mod-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.15s;
}
.mod-item:hover {
    background: #f3f4f6;
}
.mod-item input[type="checkbox"] {
    accent-color: var(--accent);
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    cursor: pointer;
}
.mod-item-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mod-item-price {
    color: #9ca3af;
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}
.mod-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}
.mod-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--accent-light);
    color: var(--accent-dark);
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 999px;
}
.mod-pill-x {
    background: none;
    border: none;
    color: var(--accent-dark);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0 1px;
    opacity: 0.6;
}
.mod-pill-x:hover {
    opacity: 1;
}

/* Busy technician options */
.form-input option.tech-busy {
    color: #9ca3af;
    background: #fef2f2;
}
.form-input option:disabled {
    color: #d1d5db;
}
.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

/* Block list items */
.block-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: #fef2f2;
    border-radius: 8px;
    font-size: 12px;
}
.block-item .block-info {
    display: flex;
    align-items: center;
    gap: 6px;
}
.block-item .block-remove {
    color: #ef4444;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.1s;
}
.block-item .block-remove:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* ── Mobile Responsive ──────────────────────────────────── */

/* --- Small screens (phones) --- */
@media (max-width: 1024px) {
    /* Prevent any horizontal overflow */
    html, body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }

    /* Header must stay within viewport */
    header {
        max-width: 100vw !important;
        overflow-x: hidden !important;
        overflow-y: visible !important;
        box-sizing: border-box !important;
    }

    /* Header: single row, no wrapping */
    header > .flex.items-center {
        flex-wrap: nowrap !important;
        gap: 4px;
        max-width: 100%;
        overflow-x: hidden;
        overflow-y: visible;
    }

    /* Top bar left group (brand + toggle + overflow menu) */
    .mobile-row-1 {
        display: flex;
        align-items: center;
        min-width: 0;
        overflow: visible;
        flex-shrink: 0;
    }

    /* Date nav group */
    .mobile-row-2 {
        display: flex;
        align-items: center;
        gap: 2px !important;
        min-width: 0;
        flex: 1;
        justify-content: center;
    }

    /* Desktop action row: hidden on mobile */
    .mobile-hide-row {
        display: none !important;
    }

    /* Date display shorter */
    #dateDisplay {
        min-width: 0 !important;
        font-size: 13px !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: none;
    }

    /* Date picker narrower */
    #datePicker {
        font-size: 12px !important;
    }

    /* Site link hidden on mobile */
    .site-link-desktop {
        display: none !important;
    }

    /* Tech filter bar: horizontal scroll */
    #techFilterBar {
        overflow-x: auto;
        flex-wrap: nowrap !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
    }
    #techFilterBar::-webkit-scrollbar {
        display: none;
    }
    .tech-chip {
        flex-shrink: 0;
    }

    /* Second header row */
    header .flex.items-center.justify-between:nth-child(2) {
        flex-wrap: nowrap;
        gap: 8px;
        max-width: 100%;
        overflow: hidden;
    }

    /* ── Sticky time gutter ── */
    #timeLabels {
        width: 36px !important;
        position: sticky !important;
        left: 0 !important;
        z-index: 5 !important;
        background: white !important;
        flex-shrink: 0 !important;
        border-right: 1px solid #e5e7eb;
    }
    .time-label {
        width: 36px !important;
        font-size: 9px !important;
        padding-right: 4px !important;
    }
    /* Header spacer matches width but scrolls normally with tech names */
    #techHeaders > div:first-child,
    .mobile-time-gutter {
        width: 36px !important;
        flex-shrink: 0 !important;
    }

    /* Calendar layout for sticky time gutter */
    #calendarContainer {
        max-width: 100vw;
        overflow: hidden;
    }
    #calendarBody {
        min-width: max-content;
        display: flex !important;
    }
    #techHeaders {
        overflow-x: auto;
        scrollbar-width: none;
        display: flex !important;
        min-width: 0;
    }
    #techHeaders::-webkit-scrollbar {
        display: none;
    }
    #calendarScroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .tech-column {
        min-width: 120px;
    }
    .tech-header {
        padding: 6px 8px;
        font-size: 11px;
        min-width: 120px;
        flex: none;
    }

    /* Week columns */
    .week-column {
        min-width: 80px;
    }
    .week-date-header {
        min-width: 80px;
        padding: 4px 3px;
        font-size: 10px;
        flex: none;
    }
    .week-date-header .date-num {
        font-size: 14px;
    }
    .week-date-header .date-day {
        font-size: 8px;
    }

    /* Appointment blocks: larger tap targets on mobile */
    .appointment-block {
        font-size: 11px;
        padding: 3px 6px;
        border-left-width: 3px;
        min-height: 22px;
    }
    .week-column .appointment-block {
        font-size: 9px;
        padding: 2px 3px;
        min-height: 18px;
    }

    /* Modal: full-screen on mobile */
    .modal-content {
        max-width: 100% !important;
        width: 100% !important;
        max-height: 100vh !important;
        height: 100%;
        border-radius: 0 !important;
        padding: 16px !important;
    }
    .modal-overlay {
        align-items: stretch !important;
    }

    /* Form grids: stack on small screens */
    .modal-content .grid.grid-cols-2 {
        grid-template-columns: 1fr !important;
    }
    .modal-content .grid.grid-cols-3 {
        grid-template-columns: 1fr 1fr !important;
    }

    /* Form inputs: larger tap targets */
    .form-input {
        padding: 12px 14px !important;
        font-size: 16px !important; /* prevents iOS zoom */
    }
    select.form-input {
        font-size: 16px !important;
    }

    /* Toasts: above floating FAB */
    .toast {
        left: 12px;
        right: 12px;
        bottom: 80px;
        max-width: none;
    }

    /* Block list in modal */
    #blockList {
        max-height: 120px;
    }

    /* Blocked pills */
    .blocked-pill {
        font-size: 7px;
        padding: 1px 3px;
        gap: 2px;
    }
    .blocked-pill-dot {
        width: 4px;
        height: 4px;
    }

    /* Search results dropdown */
    .search-dropdown {
        position: fixed;
        left: 8px;
        right: 8px;
        top: auto;
        max-height: 50vh;
        border-radius: 12px;
    }

    /* Floating action button */
    #newApptBtn {
        box-shadow: 0 4px 14px rgba(0,0,0,0.25);
    }
}



/* --- Portrait phones: wrap header to 2 lines --- */
@media (max-width: 640px) {
    header > .flex.items-center {
        flex-wrap: wrap !important;
    }
    /* Show brand on portrait */
    .mobile-row-1 {
        display: flex !important;
        flex-shrink: 0 !important;
    }
    /* Row 1: Day/Week toggle centered between brand and actions */
    .mobile-view-toggle {
        order: 1 !important;
        flex: 1 !important;
        display: flex !important;
        justify-content: center !important;
    }
    /* Row 1: action buttons on right */
    .mobile-actions {
        order: 2 !important;
        margin-left: auto !important;
    }
    /* Row 2: date nav, full width, spread */
    .mobile-row-2 {
        order: 3 !important;
        flex: 0 0 100% !important;
        width: 100% !important;
        justify-content: flex-start !important;
    }
    .mobile-row-2 #dateDisplay {
        margin-left: auto;
    }
}

/* --- Very small screens (< 480px) --- */
@media (max-width: 480px) {
    /* Even more compact date nav */
    #datePicker {
        width: 110px;
    }

    /* Modal form 3-col grid goes full single column */
    .modal-content .grid.grid-cols-3 {
        grid-template-columns: 1fr !important;
    }
}

/* --- Medium screens (tablets) --- */
@media (min-width: 769px) and (max-width: 1024px) {
    .tech-column {
        min-width: 120px;
    }
    .week-column {
        min-width: 90px;
    }
    #searchInput {
        width: 160px;
    }
    #searchInput:focus {
        width: 200px;
    }
}

/* --- Touch-friendly enhancements --- */
@media (hover: none) and (pointer: coarse) {
    /* Larger tap targets */
    .view-toggle-btn {
        padding: 6px 16px;
        font-size: 14px;
    }
    .tech-chip {
        padding: 5px 12px;
        font-size: 13px;
    }

    /* Disable drag on touch (handled differently) */
    .appointment-block {
        cursor: pointer;
    }
    .resize-handle {
        display: none;
    }

    /* Bigger close buttons */
    #closeModal, #closeBlockModal {
        padding: 8px !important;
    }
    #closeModal svg, #closeBlockModal svg {
        width: 28px;
        height: 28px;
    }

    /* Slot tooltips off on touch */
    .slot-tooltip {
        display: none !important;
    }
}

/* ── Print Styles ───────────────────────────────────────── */
.print-sheet {
    display: none;
}

@media print {
    body > *:not(.print-sheet) {
        display: none !important;
    }
    .print-sheet {
        display: block !important;
        padding: 20px;
        font-family: 'Poppins', Arial, sans-serif;
        font-size: 12px;
        color: #1f2937;
    }
    .print-sheet h1 {
        font-size: 18px;
        font-weight: 700;
        margin-bottom: 4px;
    }
    .print-sheet .print-date {
        font-size: 14px;
        color: #6b7280;
        margin-bottom: 16px;
    }
    .print-sheet table {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 16px;
    }
    .print-sheet th {
        text-align: left;
        padding: 6px 8px;
        border-bottom: 2px solid #1f2937;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: #6b7280;
    }
    .print-sheet td {
        padding: 6px 8px;
        border-bottom: 1px solid #e5e7eb;
    }
    .print-sheet .print-summary {
        margin-top: 16px;
        padding-top: 12px;
        border-top: 2px solid #1f2937;
        font-weight: 600;
    }
}
