:root {
    --primary-color: #00BCD4;       /* AppSheet teal */
    --primary-dark:  #0097A7;
    --primary-light: #E0F7FA;
    --secondary-color: #424242;
    --background: #f5f5f5;
    --surface: #ffffff;
    --text-main: #212121;
    --text-muted: #757575;
    --border-color: #E0E0E0;
    --success: #4CAF50;
    --danger: #F44336;
    --warning: #FF9800;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.08);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.12);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.16);
}

/* Themes — all use same teal in AppSheet style */
body.theme-admin       { --primary-color:#00BCD4; --primary-dark:#0097A7; --primary-light:#E0F7FA; }
body.theme-receptionist{ --primary-color:#00BCD4; --primary-dark:#0097A7; --primary-light:#E0F7FA; }
body.theme-therapist   { --primary-color:#00BCD4; --primary-dark:#0097A7; --primary-light:#E0F7FA; }
body.theme-patient     { --primary-color:#00BCD4; --primary-dark:#0097A7; --primary-light:#E0F7FA; }
body.theme-referrer    { --primary-color:#00BCD4; --primary-dark:#0097A7; --primary-light:#E0F7FA; }

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', system-ui, -apple-system, sans-serif; }

body {
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 80px;
}

a { text-decoration: none; color: inherit; }

/* Typography */
h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 0.5rem; }
h2 { font-size: 1.125rem; font-weight: 600; margin-bottom: 0.4rem; }
h3 { font-size: 1rem; font-weight: 600; }

.text-muted    { color: var(--text-muted); }
.text-sm       { font-size: 0.875rem; }
.text-xs       { font-size: 0.75rem; }
.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }
.text-primary  { color: var(--primary-color); }
.text-success  { color: var(--success); }
.text-center   { text-align: center; }

/* Offline Mode Styles */
body.is-offline .app-header {
    background: #546e7a !important; /* Gris azulado para indicar desconexión */
}
body.is-offline::before {
    content: "Sin conexión - Modo lectura/offline";
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    background: #ff9800;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    text-align: center;
    padding: 2px;
    z-index: 99;
    text-transform: uppercase;
}

/* Layout */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 0;          /* no padding — AppSheet goes edge to edge */
}

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.mt-2  { margin-top: 0.5rem; }
.mt-4  { margin-top: 1rem; }
.mb-2  { margin-bottom: 0.5rem; }
.mb-4  { margin-bottom: 1rem; }
.mb-6  { margin-bottom: 1.5rem; }
.mb-8  { margin-bottom: 2rem; }
.py-4  { padding: 1rem 0; }
.px-4  { padding: 0 1rem; }
.pl-4  { padding-left: 1rem; }

/* ═══════════════════════════════════════
   HEADER — AppSheet teal bar
═══════════════════════════════════════ */
.app-header {
    background-color: var(--primary-color);
    padding: 0 1rem;
    height: 56px;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.app-header .logo {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.app-header .logo .material-icons-outlined { font-size: 1.6rem; }
.app-header .header-actions { display: flex; align-items: center; gap: 0.75rem; }
.app-header .header-actions a,
.app-header .header-actions span { color: rgba(255,255,255,0.9); cursor: pointer; display: flex; align-items: center; }
.app-header .header-actions .user-name { font-size: 0.85rem; font-weight: 600; color: #fff; }

/* ═══════════════════════════════════════
   MAIN CONTENT AREA
═══════════════════════════════════════ */
main.mt-4 { margin-top: 0 !important; }

/* ═══════════════════════════════════════
   TABLE ROWS — AppSheet list style
═══════════════════════════════════════ */
.table-header {
    display: grid;
    padding: 0.5rem 1rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    position: sticky;
    top: 56px;
    z-index: 5;
}

.table-row {
    display: grid;
    padding: 0.7rem 1rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
    color: var(--text-main);
}
.table-row:hover { background: #f9f9f9; }
.table-row:active { background: var(--primary-light); }

.table-cell-main  { font-size: 0.9rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table-cell-sub   { font-size: 0.8rem; color: var(--text-muted); }
.table-cell-money { font-size: 0.9rem; font-weight: 700; color: var(--text-main); }

/* Day group header (like AppSheet date groups) */
.day-group-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 1rem;
    background: #FAFAFA;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
}
.day-group-pill {
    background: var(--border-color);
    color: var(--text-main);
    font-weight: 700;
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 99px;
}

/* ═══════════════════════════════════════
   CARDS (para modales y formularios)
═══════════════════════════════════════ */
.card {
    background-color: var(--surface);
    margin: 0.75rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
}
.card-title { font-size: 1rem; font-weight: 600; margin: 0; }

/* ═══════════════════════════════════════
   PAGE HEADER (dentro del contenido)
═══════════════════════════════════════ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 56px;
    z-index: 9;
}
.page-title { font-size: 1rem; font-weight: 700; margin: 0; }

/* ═══════════════════════════════════════
   METRICS GRID
═══════════════════════════════════════ */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    border-bottom: 1px solid var(--border-color);
    background: var(--surface);
}
.metric-card {
    padding: 1rem;
    text-align: center;
    border-right: 1px solid var(--border-color);
    background: var(--surface);
}
.metric-card:last-child { border-right: none; }
.metric-value { font-size: 1.5rem; font-weight: 700; color: var(--primary-color); }
.metric-label { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; margin-top: 0.2rem; }

/* ═══════════════════════════════════════
   LIST ITEMS (legacy, kept for compat)
═══════════════════════════════════════ */
.list-group { display: flex; flex-direction: column; padding-bottom: 80px; }

.card .list-group {
    padding-bottom: 0;
}

.card-list-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.card-list-row:last-child {
    border-bottom: none;
}

.card-list-content {
    min-width: 0;
    flex: 1;
}

.card-list-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
}

.card-list-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.list-item {
    background-color: var(--surface);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: background 0.15s;
}
.list-item:hover { background: #f9f9f9; }

.list-item-icon {
    width: 40px; height: 40px;
    border-radius: var(--radius-full);
    background-color: var(--primary-light);
    color: var(--primary-color);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; font-weight: 700; flex-shrink: 0;
}
.list-item-content { flex-grow: 1; min-width: 0; }
.list-item-title { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item-subtitle { font-size: 0.78rem; color: var(--text-muted); }
.list-item-action { color: var(--primary-color); flex-shrink: 0; }

/* ═══════════════════════════════════════
   BADGES
═══════════════════════════════════════ */
.badge { display: inline-flex; align-items: center; padding: 0.2rem 0.6rem; border-radius: var(--radius-full); font-size: 0.72rem; font-weight: 600; }
.badge-outline  { border: 1px solid var(--primary-color); color: var(--primary-color); background: transparent; }
.badge-success  { background: #E8F5E9; color: #2E7D32; }
.badge-warning  { background: #FFF3E0; color: #E65100; }
.badge-danger   { background: #FFEBEE; color: #C62828; }
.badge-primary  { background: var(--primary-light); color: var(--primary-dark); }

/* ═══════════════════════════════════════
   QUICK ACCESS GRID
═══════════════════════════════════════ */
.quick-access-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 0.75rem; padding: 1rem; }
.quick-access-btn { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; background: none; border: none; cursor: pointer; color: var(--text-main); }
.quick-access-icon {
    width: 52px; height: 52px;
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--primary-color);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s, background 0.15s;
}
.quick-access-btn:hover .quick-access-icon { transform: translateY(-2px); background: var(--primary-light); }
.quick-access-label { font-size: 0.7rem; font-weight: 500; text-align: center; }

/* ═══════════════════════════════════════
   SEARCH BAR (AppSheet style)
═══════════════════════════════════════ */
.search-bar {
    padding: 0.5rem 1rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 56px;
    z-index: 8;
}
.search-input-wrap { position: relative; }
.search-input-wrap .material-icons-outlined {
    position: absolute; left: 0.6rem; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); font-size: 1.1rem; pointer-events: none;
}
.search-input {
    width: 100%; padding: 0.45rem 0.75rem 0.45rem 2.2rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    background: var(--background);
    font-family: inherit;
}
.search-input:focus { outline: none; border-color: var(--primary-color); }

/* ═══════════════════════════════════════
   BOTTOM NAVIGATION — AppSheet teal
═══════════════════════════════════════ */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--primary-color);    /* celeste igual al header */
    display: flex;
    justify-content: space-around;
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 160;          /* Asegura estar sobre las tarjetas y el FAB */
    max-width: 600px;
    margin: 0 auto;
    box-shadow: 0 -2px 6px rgba(0,0,0,0.18);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    color: rgba(255,255,255,0.6);
    flex: 1;
    padding: 0.55rem 0.25rem 0.5rem;
    cursor: pointer;
    position: relative;
    transition: color 0.15s;
    text-decoration: none;
}

.nav-item.active { color: #ffffff; }

/* Subrayado blanco en tab activo */
.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 0; left: 15%; right: 15%;
    height: 3px;
    background: #ffffff;
    border-radius: 2px 2px 0 0;
}

.nav-item:hover:not(.active) { color: rgba(255,255,255,0.9); }
.nav-item i { font-size: 1.3rem; }
.nav-label { font-size: 0.6rem; font-weight: 600; letter-spacing: 0.02em; white-space: nowrap; }

/* ═══════════════════════════════════════
   PROGRESS BARS
═══════════════════════════════════════ */
.progress-bar { height: 6px; background: var(--border-color); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary-color); border-radius: 99px; transition: width 0.5s ease-out; }

/* ═══════════════════════════════════════
   FAB — justo sobre el nav
═══════════════════════════════════════ */
.fab-container {
    position: fixed;
    bottom: 70px;          /* encima del nav (58px) + margen visual */
    right: 1rem;           /* pegado a la derecha en móvil */
    z-index: 150;          /* Aumentado para estar sobre las tarjetas (z-index 1) */
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    pointer-events: none; /* No bloquear clics en lo que está detrás */
}

/* En pantallas > 600px (escritorio), ajustar al container centrado */
@media (min-width: 601px) {
    .fab-container {
        right: calc(50% - 284px);  /* 300px - 16px = borde derecho del container */
    }
}

.fab {
    width: 56px; height: 56px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    box-shadow: 0 4px 14px rgba(0,188,212,0.5);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    z-index: 91;
    pointer-events: auto; /* Reactivar clics para el botón */
}
.fab .material-icons-outlined { font-size: 1.75rem; transition: transform 0.3s; }
.fab:hover { transform: scale(1.06); box-shadow: 0 6px 18px rgba(0,188,212,0.5); }

.fab-options {
    display: flex; flex-direction: column; align-items: flex-end;
    gap: 0.75rem; margin-bottom: 0.6rem;
    opacity: 0; visibility: hidden;
    transform: translateY(12px);    /* emerge de abajo hacia arriba */
    transition: all 0.25s cubic-bezier(0.175,0.885,0.32,1.275);
    pointer-events: none; /* No bloquear cuando está oculto */
}
.fab-options.active { 
    opacity: 1; 
    visibility: visible; 
    transform: translateY(0);
    pointer-events: auto; /* Reactivar clics cuando está abierto */
}

.fab-option { 
    display: flex; 
    align-items: center; 
    gap: 0.6rem; 
    cursor: pointer; 
    text-decoration: none; 
    pointer-events: auto;
}
.fab-label {
    background: var(--text-main);
    color: white;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    box-shadow: var(--shadow-md);
    white-space: nowrap;
}
.fab-icon {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-md);
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.15s;
}
.fab-option:hover .fab-icon { transform: scale(1.1); }

/* ═══════════════════════════════════════
   MODALS
═══════════════════════════════════════ */
.modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.45); z-index: 200;
    align-items: flex-end; justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal-sheet {
    background: var(--surface);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 1.25rem;
    width: 100%; max-width: 600px;
    max-height: 92vh; overflow-y: auto;
    animation: slideUp 0.3s ease-out;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; }
.modal-title { font-size: 1rem; font-weight: 700; margin: 0; }
.modal-close { background: none; border: none; cursor: pointer; color: var(--text-muted); display: flex; align-items: center; padding: 0.2rem; border-radius: var(--radius-sm); }

/* Forms */
.form-group { margin-bottom: 0.875rem; }
.form-group label { display: block; margin-bottom: 0.35rem; font-size: 0.82rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.form-control {
    width: 100%; padding: 0.65rem 0.75rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9rem; font-family: inherit;
    background: var(--surface); color: var(--text-main);
    transition: border-color 0.2s;
}
.form-control:focus { outline: none; border-color: var(--primary-color); }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23757575' d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.75rem center; padding-right: 2rem; }

.btn-primary {
    width: 100%; padding: 0.8rem;
    background: var(--primary-color); color: white;
    border: none; border-radius: var(--radius-md);
    font-size: 0.95rem; font-weight: 700;
    cursor: pointer; font-family: inherit;
    letter-spacing: 0.02em;
    transition: background 0.2s, transform 0.1s;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:active { transform: scale(0.99); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

/* ═══════════════════════════════════════
   TOAST
═══════════════════════════════════════ */
.toast {
    position: fixed; bottom: 76px; left: 50%;
    transform: translateX(-50%) translateY(16px);
    background: #323232; color: white;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem; font-weight: 500;
    z-index: 300; opacity: 0;
    transition: all 0.25s; pointer-events: none;
    white-space: nowrap; box-shadow: var(--shadow-md);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: #388E3C; }
.toast.error   { background: #D32F2F; }

/* ═══════════════════════════════════════
   ANIMATIONS
═══════════════════════════════════════ */
@keyframes fadeIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
.animate-fade-in { animation: fadeIn 0.3s ease-out forwards; }
.delay-100 { animation-delay: 0.08s; }
.delay-200 { animation-delay: 0.16s; }

/* ═══════════════════════════════════════
   UTILS & SPACING
═══════════════════════════════════════ */
.hidden-form { display: none !important; }
.hide-mobile { display: none; }
@media (min-width: 480px) { .hide-mobile { display: inline; } }

/* Padding general del contenido */
main > div, main > .animate-fade-in { padding: 0 0 1rem; }
.card { margin: 0.75rem; }
.card + .card { margin-top: 0; }

/* Botones de acción compactos - Rediseño premium */
.btn-action-sm {
    padding: 0 0.85rem;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    height: 34px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    text-transform: none; /* Menos agresivo que uppercase */
}

.btn-action-sm:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.12);
}

.btn-action-sm:active {
    transform: translateY(0) scale(0.98);
}

.btn-action-sm.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: white !important;
}

.btn-action-sm.btn-cancel {
    background: #f8f9fa !important;
    color: #6b7280 !important;
    border: 1px solid #e5e7eb !important;
}

.btn-action-sm.btn-cancel:hover {
    background: #f3f4f6 !important;
    color: #374151 !important;
}

.btn-whatsapp-sm {
    background: linear-gradient(135deg, #25D366 0%, #128c7e 100%) !important;
    color: white !important;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50% !important; /* Circular para destacar */
    border: none;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(37, 211, 102, 0.4);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto; /* Asegurar que reciba clics */
    position: relative;
    z-index: 10;
}

.btn-whatsapp-sm:hover {
    transform: translateY(-2px) rotate(10deg);
    box-shadow: 0 5px 12px rgba(37, 211, 102, 0.4);
}

.btn-whatsapp-sm:active {
    transform: scale(0.9);
}

.btn-whatsapp-sm i {
    font-size: 1.15rem !important;
}

.patient-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1rem;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    position: relative;
    z-index: 1; /* Bajo para no tapar el FAB (91) ni la nav */
}

.patient-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.patient-card:active {
    transform: translateY(-1px);
}

/* ══════════════ SEARCHABLE SELECT ══════════════ */
.searchable-select-container {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: white;
    transition: border-color 0.2s;
}

.searchable-select-container:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
}

.search-input-wrapper .search-icon {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-right: 0.5rem;
}

.search-input {
    flex: 1;
    border: none !important;
    background: transparent !important;
    height: 38px;
    font-size: 0.85rem;
    outline: none !important;
    box-shadow: none !important;
}

.select-results {
    border: none !important;
    border-radius: 0 !important;
    height: 42px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23475569'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    appearance: none;
    outline: none !important;
}

/* ══════════════ FORM STATES & SEARCH ══════════════ */
.search-results-floating {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 250px;
    overflow-y: auto;
    margin-top: 4px;
}

.search-result-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.2s;
    font-size: 0.85rem;
}

.search-result-item:hover {
    background: var(--primary-light);
}

.search-result-item:last-child {
    border-bottom: none;
}

.btn-status-toggle {
    background: white;
    border: 1px solid var(--border-color);
    padding: 0.75rem 0.4rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-status-toggle.active {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 0 0 1px var(--primary-color);
}

.time-helper-text {
    margin-top: 0.45rem;
    font-size: 0.74rem;
    color: var(--text-muted);
}

.time-slots-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    margin-top: 0.75rem;
    max-height: 220px;
    overflow-y: auto;
}

.time-slot-btn {
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-main);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
}

.time-slot-btn:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
    color: var(--primary-dark);
}

.time-slot-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 6px 14px rgba(0, 188, 212, 0.18);
}

.time-slot-btn:disabled {
    opacity: 0.42;
    cursor: not-allowed;
    background: #f8fafc;
    color: var(--text-muted);
}
