#loader-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 9999;
  opacity: 1;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

#loader-overlay.hide {
  opacity: 0;
}


/* ---------- Design tokens ---------- */
:root{
  --bg:#f5f7fa;
  --panel:#ffffff;
  --text:#1E1E1E;
  --muted:#6b7280;
  --primary:#3A7AFE;
  --intense:#1e57ca;
  --success:#10b981;
  --danger:#ef4444;
  --radius:14px;
  --shadow:0 8px 20px rgba(0,0,0,.08);
  --dur:360ms;
  --ease: cubic-bezier(.2,.8,.2,1);
}

*{box-sizing:border-box}
html,body{
  height:100dvh;
  width:100dvw;
  height:100vh;
  width:100vw;
  overflow:hidden;
  padding:0!important;
  margin:0!important;
}

body{
  margin:0; font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:var(--bg); color:var(--text);
}

header {
  z-index:10;
  margin: 0;
  padding: 20px;
}

section {
  margin: 0;
  padding: 0;
}


/* ---------- App container ---------- */
#app{
  width:100%; max-width:420px; margin:auto; height:100vh; position:relative;
  overflow:hidden; background:var(--panel); box-shadow: var(--shadow);
  border-radius: 18px;
}

/* ---------- Screens + route transitions ---------- */
.screen{
  position:absolute; inset:0; padding:24px 24px 28px; overflow:auto; 
  opacity:0; 
  /* transform: translateX(25px); */
  pointer-events:none;
}

.screen.active{
  opacity:1; 
  /* transform: none; */
  pointer-events:auto;
  
  margin: 0;
  padding: 0;
  overflow: visible;
}

.nopadding .screen.active {
  padding-top:0px!important;
}

.material-symbols-outlined {
  margin: -2px -4px -4px -4px;
  font-size: 20px!important;
}
.big {
    font-size: 28px !important;
    margin-top: 4px !important;
}

.icon-btn {
  width:36px;
  height:36px;
}

/* enter/exit states controlled via JS classes */
.screen.enter-forward{ animation: slideInLeft var(--dur) var(--ease) both; }
.screen.exit-forward{ animation: slideOutLeft var(--dur) var(--ease) both; }
.screen.enter-back{ animation: slideInRight var(--dur) var(--ease) both; }
.screen.exit-back{ animation: slideOutRight var(--dur) var(--ease) both; }
.screen.enter-fade{ animation: fadeInUp var(--dur) var(--ease) both; }
.screen.exit-fade{ animation: fadeOutDown var(--dur) var(--ease) both; }

@keyframes slideInLeft{ from{opacity:0; transform:translateX(40px)} to{opacity:1; transform:none} }
@keyframes slideOutLeft{ from{opacity:1; transform:none} to{opacity:0; transform:translateX(-40px)} }
@keyframes slideInRight{ from{opacity:0; transform:translateX(-40px)} to{opacity:1; transform:none} }
@keyframes slideOutRight{ from{opacity:1; transform:none} to{opacity:0; transform:translateX(40px)} }
@keyframes fadeInUp{ from{opacity:0; transform: translateY(16px)} to{opacity:1; transform:none} }
@keyframes fadeOutDown{ from{opacity:1; transform:none} to{opacity:0; transform: translateY(16px)} }

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce){
  .screen.enter-forward, .screen.exit-forward,
  .screen.enter-back, .screen.exit-back,
  .screen.enter-fade, .screen.exit-fade { animation-duration: 0.001ms; }
}

/* ---------- Common UI ---------- */
.center{ display:grid; place-items:center; text-align:center; height:100% }
.logo{ margin-bottom:18px }
h1,h2,h3{ 
  margin:12px 0 8px;
}
h2 {
  font-size: 20px;
  font-weight: 500;
}
h3 {
  font-size: 18px;
  font-weight: 500;
  margin-top:0;
}
.subtitle{ color:var(--muted); margin:0 0 24px }
.link{ margin-top:16px }
.link a{ color:var(--primary); text-decoration:none }

.topbar{
  display:grid; grid-template-columns: auto 1fr auto; align-items:center;
  gap:12px; padding-bottom:8px; position:sticky; top:0; background:var(--panel);
}
.icon-btn{
  appearance:none; border:0; background:#f1f5f9; padding:10px 12px; border-radius:12px;
  cursor:pointer; transition: transform 120ms var(--ease);
}
.icon-btn:active{ transform: scale(.96) }

.content{
  padding: 0 20px 70px 20px;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.list { 
  animation: listFloat 900ms var(--ease); 
}

.packed {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

@keyframes listFloat{ 
  from{ opacity:0; transform: translateY(8px)} 
  to{ opacity:1; transform:none } 
}

/* Inputs */
.field{ display:grid; gap:6px; margin:14px 0 }
.field input{
  padding:14px 12px; border:1px solid #e5e7eb; border-radius:12px; font-size:16px;
    min-width: 0;
}
.segmented{
  display:grid; 
  grid-template-columns:1fr 1fr; 
  gap:8px; 
  background:#eef2ff;
  padding:6px; 
  border-radius:12px; 
  margin:20px 0 20px;
}
.seg{
  appearance:none; border:0; padding:10px 12px; border-radius:10px; cursor:pointer; background:transparent;
}
.seg.active{ background:#fff; box-shadow:0 1px 0 rgba(0,0,0,.05) inset; }

/* Cards */
.card{
  background:#fff; border-radius:14px; padding:16px 14px; box-shadow: var(--shadow);
  margin:12px 0; transform-origin:center; transition: transform 160ms var(--ease), box-shadow 160ms var(--ease);
}
.card .time{ float:right; color:var(--muted); font-weight:600 }
.card.tap:active{ transform: scale(.98) }
.card:hover{ box-shadow: 0 10px 26px rgba(0,0,0,.10) }

/* Buttons + ripple */
.btn{
  --ripple: rgba(255,255,255,.65);
  position:relative; overflow:hidden;
  appearance:none; border:0; width:100%; padding:14px 16px; border-radius:12px;
  background:var(--primary); color:#fff; font-weight:600; cursor:pointer;
  box-shadow: 0 6px 14px rgba(58,122,254,.25); transition: transform 120ms var(--ease), filter 200ms var(--ease);
}

.btn.bottom {
  position: absolute;
  bottom: 20px;
  width: calc(100vw - 40px);
}

.btn:hover{ filter: brightness(1.03) }
.btn:active{ transform: translateY(1px) }
.btn.ghost{ background:#eef2ff; color:#1e293b; box-shadow:none }

.btn .ripple{
  position:absolute; border-radius:50%; transform: scale(0);
  background: var(--ripple); animation: ripple 600ms ease-out;
  pointer-events:none; inset:auto;
}
@keyframes ripple{ to{ transform: scale(14); opacity:0 } }

/* Modal bottom sheet */
.modal{
  position:absolute; inset:0; background: rgba(15,23,42,.36); display:none;
  align-items:end; justify-content:center; padding:16px;
  z-index:99;
  backdrop-filter: blur(2px);
}
.modal.show{ display:flex; animation: fadeIn 240ms var(--ease) both }
@keyframes fadeIn{ from{ opacity:0 } to{ opacity:1 } }

.sheet{
  width:100%; max-width:420px; background: #fff; border-radius: 18px 18px 14px 14px;
  padding:16px; box-shadow: 0 -8px 24px rgba(0,0,0,.18);
  animation: springIn 320ms var(--ease) both;
}
@keyframes springIn{ 
  0%{ transform: translateY(24px) scale(.98); opacity:.5 }
  60%{ transform: translateY(-3px) scale(1.005); opacity:1 }
  100%{ transform: translateY(0) scale(1) }
}
.grab{ width:44px; height:5px; background:#e5e7eb; border-radius:999px; margin:6px auto 10px }

/* Chips grid */
.grid3{ display:grid; grid-template-columns: repeat(3,1fr); gap:10px; margin:12px 0 6px }
.chip{
  appearance:none; border:1px solid #e5e7eb; background:#fff; padding:12px; border-radius:12px; cursor:pointer;
  transition: transform 120ms var(--ease), background 120ms var(--ease);
}
.chip:active{ transform: scale(.97) }
.row{ display:grid; grid-template-columns: 1fr 1fr; gap:10px }

/* Timeline */
.summary{
  background:#fff; border-radius:12px; padding:14px; box-shadow: var(--shadow); margin:8px 0 16px;
}
.status.ontime{ color:#059669 }
.status.delayed{ color:#f59e0b }
.timeline{ list-style:none; padding:0; margin:8px 0 18px; position:relative }
.timeline .step{
  display:grid; grid-template-columns: 24px 1fr; gap:10px; align-items:flex-start; padding:10px 4px;
}
.timeline .step .dot{
  width:14px; height:14px; border-radius:50%; background:#cbd5e1; margin-top:4px; position:relative;
}
.timeline .step.active .dot{ background: var(--primary); box-shadow: 0 0 0 6px rgba(58,122,254,.12) }
.timeline .step.done .dot{ background: #a7f3d0 }
.timeline .info small{ color:var(--muted) }

/* Released */
.check{ font-size:76px; color:var(--success); margin-bottom:10px }

/* ---------- Helpers ---------- */
.spacer{ width:28px; height:28px; display:inline-block }



/* ----------------------------------------------------
   🌙 DARK MODE — prefers-color-scheme
----------------------------------------------------- */

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --panel: #1e293b;
    --text: #f1f5f9;
    --muted: #94a3b8;
    --primary: #3b82f6;
    --success: #22c55e;
    --radius: 14px;
    --shadow: 0 8px 24px rgba(0, 0, 0, .5);
  }

  body {
    background: var(--bg);
    color: var(--text);
  }

  #app {
    background: var(--panel);
    box-shadow: var(--shadow);
  }

  .screen {
    background: var(--panel);
    
    margin: 0;
    padding: 0;
  }

  .topbar {
    background: var(--panel);
    color: var(--text);
  }

  .subtitle {
    color: var(--muted);
  }

  .field input {
    background: #0f172a;
    border: 1px solid #334155;
    color: var(--text);
  }

  .segmented {
    background: #334155;
  }

  .seg {
    color: var(--text);
  }

  .seg.active {
    background: #1e293b;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
  }

  .card {
    background: #1e293b;
    box-shadow: var(--shadow);
  }

  .timeline .step .dot {
    background: #475569;
  }

  .timeline .step.active .dot {
    background: var(--primary);
    box-shadow: 0 0 0 6px rgba(59, 130, 246, .3);
  }

  .timeline .step.done .dot {
    background: #22c55e;
  }

  .summary {
    background: #1e293b;
    color: var(--text);
  }

  .modal {
    background: rgba(15, 23, 42, .6);
  }

  .sheet {
    background: #1e293b;
    color: var(--text);
  }

  .chip {
    background: #0f172a;
    border-color: #334155;
    color: var(--text);
  }

  .chip:active {
    background: #1e293b;
  }

  .btn {
    background: var(--primary);
    color: white;
  }

  .btn.ghost {
    background: #334155;
    color: #e2e8f0;
  }

  .icon-btn {
    background: #334155;
    color: var(--text);
  }

  .check {
    color: var(--success);
  }
}


/* ----------------------------------------------------
   🌙 DARK MODE — ANIMAZIONI
----------------------------------------------------- */

:root { color-scheme: light dark; }

/* Riduzione movimento: annulla le animazioni */
@media (prefers-reduced-motion: reduce) {
  .btn, .timeline .step.active .dot, svg.logo path, .sheet, .card {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (prefers-color-scheme: dark) {
  /* Pulsazione soft per i bottoni principali */
  .btn {
    animation: btnGlow 3.2s ease-in-out infinite alternate;
  }

  /* Dot attivo della timeline che pulsa (stato corrente) */
  .timeline .step.active .dot {
    animation: dotPulse 2.2s ease-in-out infinite;
  }

  /* Disegno continuo del logo (line-draw) nello splash */
  svg.logo path {
    stroke-dasharray: 120;
    stroke-dashoffset: 120;
    animation: logoDraw 3.5s var(--ease) infinite;
  }

  /* “Breath” leggero dei pannelli/card in hover/focus */
  .card:hover {
    box-shadow: 0 0 0 0 rgba(59,130,246,.0),
                0 10px 26px rgba(0,0,0,.24),
                0 0 24px rgba(59,130,246,.18);
    animation: cardBreath 4.5s ease-in-out infinite;
  }

  /* Bottom sheet con micro-breath dell’outline */
  .sheet {
    box-shadow: 0 -10px 28px rgba(0,0,0,.28), 0 0 0 1px rgba(148,163,184,.12) inset;
    animation: sheetBreath 6s ease-in-out infinite;
  }

  /* Pulsazione soft dello status “Delayed” */
  .status.delayed {
    animation: textGlow 2.8s ease-in-out infinite;
  }
}

/* ---------- Keyframes ---------- */
@keyframes btnGlow {
  0%   { box-shadow: 0 6px 14px rgba(59,130,246,.25), 0 0 0 rgba(59,130,246,0); }
  100% { box-shadow: 0 8px 18px rgba(59,130,246,.35), 0 0 24px rgba(59,130,246,.22); }
}

@keyframes dotPulse {
  0%,100% { transform: scale(1); box-shadow: 0 0 0 6px rgba(59,130,246,.18); }
  50%     { transform: scale(1.12); box-shadow: 0 0 0 9px rgba(59,130,246,.12); }
}

@keyframes logoDraw {
  0%   { stroke-dashoffset: 120; opacity:.9 }
  60%  { stroke-dashoffset: 0;   opacity:1 }
  100% { stroke-dashoffset: 0;   opacity:.95 }
}

@keyframes cardBreath {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-1px); }
}

@keyframes sheetBreath {
  0%,100% { box-shadow: 0 -10px 28px rgba(0,0,0,.28), 0 0 0 1px rgba(148,163,184,.12) inset; }
  50%     { box-shadow: 0 -12px 34px rgba(0,0,0,.34), 0 0 0 1px rgba(148,163,184,.18) inset; }
}

@keyframes textGlow {
  0%,100% { text-shadow: 0 0 0 rgba(245,158,11,0); }
  50%     { text-shadow: 0 0 8px rgba(245,158,11,.35); }
}


/* ----------------------------------------------------
   🎛️ THEME TOGGLE + POPOVER
----------------------------------------------------- */

:root {
  /* transizione morbida tra temi */
  --theme-transition: 220ms ease;
}

/* Applica transizioni ai principali layer quando cambia tema */
body, #app, .screen, .card, .summary, .sheet, .btn, .icon-btn, .chip, .field input, .topbar {
  transition: background-color var(--theme-transition), color var(--theme-transition), box-shadow var(--theme-transition), border-color var(--theme-transition);
}

@media (prefers-reduced-motion: reduce) {
  body, #app, .screen, .card, .summary, .sheet, .btn, .icon-btn, .chip, .field input, .topbar {
    transition: none !important;
  }
}

/* Floating Action Button per il tema */
.fab{
  position: absolute;
  right: 16px; bottom: 16px; z-index: 60;
  width: 48px; height: 48px; border-radius: 999px;
  display:grid; place-items:center; font-size: 20px;
  border:0; cursor:pointer; 
  background: var(--primary); color:#fff; 
  box-shadow: 0 10px 24px rgba(58,122,254,.28);
  transition: transform 120ms var(--ease), filter 180ms var(--ease), background-color var(--theme-transition);
}
.fab:active{ transform: translateY(1px) }
.fab:hover{ filter: brightness(1.05) }

/* Popover */
.popover{
  position: absolute; right: 16px; bottom: 76px; z-index: 70;
  width: 210px; border-radius: 14px; overflow: hidden;
  background: var(--panel); color: var(--text);
  box-shadow: 0 14px 38px rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.04);
  animation: popEnter 160ms var(--ease) both;
}
.popover[hidden]{ display:none !important; }

.popover-inner{ padding: 12px; }
.popover-title{ margin:2px 2px 10px; font-size: 14px; color: var(--muted); }

.opt{
  display:flex; align-items:center; gap:10px;
  padding: 10px 8px; border-radius: 10px; cursor:pointer;
}
.opt:hover{ background: rgba(59,130,246,.07) }
.opt input{ accent-color: var(--primary); }

/* Animazione popover */
@keyframes popEnter{
  from{ opacity:0; transform: translateY(6px) scale(.98) }
  to{ opacity:1; transform: none }
}

/* Tema forzato via attributo (override su media query) */
:root[data-theme="light"] {
  color-scheme: light;
  --bg:#f5f7fa;
  --panel:#ffffff;
  --text:#1E1E1E;
  --muted:#6b7280;
  --primary:#3A7AFE;
  --success:#10b981;
  --shadow:0 8px 20px rgba(0,0,0,.08);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f172a;
  --panel: #1e293b;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --primary: #3b82f6;
  --success: #22c55e;
  --shadow: 0 8px 24px rgba(0, 0, 0, .5);
}

/* Se data-theme non è definito → segue il sistema (già gestito dalla tua @media dark) */
/* Nessuna regola aggiuntiva necessaria qui */

/* ----------------------------------------------------
   📁 SIDE MENU — Layout + Animazioni
----------------------------------------------------- */

.menu-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.4);
  opacity: 0;
  pointer-events: none;
  z-index: 80;
  transition: opacity 260ms var(--ease);
}

.menu-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.side-menu {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: 260px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 4px 0 22px rgba(0,0,0,.18);
  transform: translateX(-100%);
  transition: transform 300ms var(--ease), background-color var(--theme-transition), color var(--theme-transition);
  z-index: 90;
  padding: 20px 0;
}

.side-menu.open {
  transform: translateX(0);
}

.menu-header {
  padding: 0 22px 12px;
  border-bottom: 1px solid rgba(0,0,0,.07);
  font-size: 20px;
}

.menu-list {
  list-style: none;
  padding: 10px 0 0 0;
  margin: 0;
}

.menu-item {
  width: 100%;
  background: none;
  border: none;
  padding: 14px 26px;
  text-align: left;
  cursor: pointer;
  font-size: 16px;
  color: var(--text);
  display: block;
  position: relative;
  transition: background-color 140ms ease, color var(--theme-transition);

  display: inline-flex;
  align-items: self-end;
  gap: 6px;
}

.menu-item:hover {
  background: rgba(59,130,246,.12);
}

.menu-item.danger {
  color: #ef4444;
}

.menu-item.danger:hover {
  background: rgba(239,68,68,.15);
}

/* Ripple effect */
.menu-item .ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  animation: ripple 500ms linear;
  background: rgba(255,255,255,.35);
  pointer-events: none;
}

@keyframes ripple {
  to { transform: scale(12); opacity: 0; }
}

/* Dark mode overrides */
@media (prefers-color-scheme: dark) {
  .side-menu {
    background: var(--panel);
    color: var(--text);
    box-shadow: 4px 0 24px rgba(0,0,0,.5);
  }
  .menu-item:hover {
    background: rgba(59,130,246,.2);
  }
}




/* ✅ Se siamo in AUTH, il menu NON deve apparire */

body.auth-mode #sideMenu,
body.auth-mode #sideMenuOverlay {
  display: none !important;
}

body.auth-mode {
  padding-left: 0 !important;
}

body.auth-mode #app {
  margin: auto !important;
  width: 100% !important;
  max-width: 420px !important;
  left: 0 !important;
  border-radius: 18px !important;
  box-shadow: var(--shadow);
}

body.customer-mode #sideMenu,
body.customer-mode #sideMenuOverlay {
  display: none !important;
}


/* ==========================================================
   ✅ AUTH MODE — Form centrato, non full-width
========================================================== */
body.auth-mode .screen,
body.customer-mode .screen {
  /* display: flex !important; */
  justify-content: center !important;
  align-items: flex-start !important;
  padding-top: 60px !important; /* un bel respiro */
  
}

body.auth-mode .screen > .auth-wrapper {
  width: 100%;
  max-width: 420px;       /* ✅ larghezza ideale per il form */
  padding: 20px;
}



/* ======================================================
   ✅ DESKTOP / TABLET LANDSCAPE — SOLO PER PAGINE NON-AUTH
====================================================== */
@media (min-width: 900px) and (orientation: landscape) {
  #hoursList {
    gap: 20px;
  }

  .btn.bottom {
    width: 40vw;
  }

  .hours-card {
    margin: unset!important;
  }

  .btn.bottom {
    width: calc(100vw - 300px);
  }

  .service-card {
    margin: 0 0!important;
  }

	body.auth-mode .screen {
	  /* display: flex !important; */
	  justify-content: center !important;
	  align-items: flex-start !important;
	  padding-top: 60px !important; /* un bel respiro */
	  
	  padding-left: calc((100vw - 480px) / 2);
	  padding-right: calc((100vw - 480px) / 2);
	}

  /* ✅ sidebar attiva SOLO se NON siamo in auth-mode */
  body:not(.auth-mode) #sideMenu {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    width: 260px !important;
    height: 100vh !important;
    transform: none !important;
    display: block !important;
    box-shadow: none !important;
    border-right: 1px solid rgba(0,0,0,0.08);
    z-index: 100 !important;
  }

  .auth-mode.nopadding .screen .btn {
    max-width:440px!important;
  }
  

  /* ✅ overlay disattivato in desktop */
  body:not(.auth-mode) #sideMenuOverlay,
  body:not(.auth-mode) .menu-overlay {
    display: none !important;
  }

  /* ✅ contenuto espanso a FULL WIDTH solo se NON auth */
  body:not(.auth-mode) #app {
    position: relative !important;
    margin: 0 !important;
    left: 260px !important;
    width: calc(100vw - 260px) !important;
    max-width: none !important;
    height: 100vh !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  /* ✅ scroll normale */
  body:not(.auth-mode) .screen {
   /* overflow-y: auto !important; */
    height: 100%;
  }
  
  
	body:not(.auth-mode) .icon-btn {
	  display: none !important;
	}

  
  
/* Se siamo in auth-mode → niente menu, app full-screen */
  body.auth-mode #app {
    width: 100vw !important;
    max-width: none !important;
    margin: 0 !important;
    left: 0 !important;
    border-radius: 0 !important;
    height: 100vh !important;
    box-shadow: none !important;
  }

}





/* Placeholder styling */
.placeholder {
  text-align:center;
  padding:40px 0;
  font-size:20px;
  opacity:0.8;
}

.placeholder-sub {
  text-align:center;
  font-size:14px;
  color:var(--muted);
  margin-top:10px;

  width:80%;
  margin: 0% 10%;
  text-align: -webkit-center;
}


/* Appointment cards */
.appt-card {
  background: var(--panel);
  border-radius: 14px;
  padding: 16px 14px;
  box-shadow: var(--shadow);
  margin: 20px 0;
  position: relative;
}

.appt-title {
  font-size: 17px;
  font-weight: 600;
}

.appt-time {
  color: var(--muted);
  margin-top: 4px;
}

.appt-actions {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  gap: 24px;
  margin-top: 6px;
  margin-right: 8px;
}

.appt-icon {
  cursor: pointer;
  font-size: 24px!important;
  opacity: .7;
  transition: opacity .2s;
  border: unset;
  background: none;
  /* color: var(--intense); */
  transition: transform 140ms cubic-bezier(.2, .8, .2, 1), box-shadow 160ms cubic-bezier(.2, .8, .2, 1), filter 160ms cubic-bezier(.2, .8, .2, 1);
  will-change: transform, box-shadow;
}

.appt-icon:hover {
  opacity: 1;
}


.disabled-slot {
  opacity: 0.4;
  cursor: not-allowed!important;
}

.appt-icon[disabled] {
  opacity: 0.3;
  cursor: not-allowed;
}


.appt-slot {
  background: var(--panel);
  border: 2px dashed var(--muted);
  padding: 12px 16px;
  border-radius: 12px;
  margin: 20px 0;
  cursor: pointer;
  font-size: 15px;
  color: var(--muted);
  transition: all .15s ease;
}

.appt-slot:hover:not(.disabled-slot) {
  background: color-mix(in oklab, var(--panel) 80%, var(--primary) 10%);
  border-color: var(--primary);
  color: var(--brand);
}



#dashboard {
    display: flex;
    flex-direction: column;
    height: 100vh; /* o 100% se già in un container */
}

#dashboard .topbar {
    flex: 0 0 auto; /* altezza naturale */
}

#dashboardList {
    flex: 1 1 auto;
    overflow-y: auto;
    padding-top: 0;     /* assicurati che non ci sia padding inutile */
    margin-top: 0;      /* evita spazi indesiderati */
    
    overflow: auto;
}


#appointments {
    display: flex;
    flex-direction: column;
    height: 100vh; /* tutta la schermata */
}

#appointments .topbar {
    flex: 0 0 auto;     /* header prende solo la sua altezza */
}

#appointments .content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    overflow: auto;
}

/* ✅ Solo la lista scorre */
#apptList {
    flex: 1 1 auto;
    overflow-y: auto;
    padding-bottom: 80px; /* opzionale: spazio per non coprire pulsanti */

    overflow: auto;
    padding: 10px;
    margin-bottom:20px;
}


/* --- LAYOUT GENERALE DELLA SCREEN --- */
#workingHours {
    display: flex;
    flex-direction: column;
    height: 100vh; /* schermo intero */
}

#workingHours .topbar {
    flex: 0 0 auto; /* altezza naturale dell’header */
}

/* --- CONTENUTO: NON DEVE SCROLLARE --- */
#workingHours .content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* evita lo scroll dell’intero contenuto */
    
    overflow: auto;
    margin-bottom: 80px;
}

/* --- SOLO LA LISTA È SCROLLABILE --- */
#hoursList {
    /* flex: 1 1 auto; */
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    
    overflow: visible;
    
    margin-bottom:20px;
}

/* --- LAYOUT GENERALE PER LA SCREEN --- */
#operators {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

#operators .topbar {
    flex: 0 0 auto;
}


/* --- IL CONTENUTO NON DEVE SCROLLARE --- */
#operators .content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    overflow: auto;
    margin-bottom: 80px;
}

/* --- SOLO LA LISTA SCROLLA --- */
#operatorsList, .operatorList {
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    overflow: visible;
    /* margin-bottom: 20px; */
    gap: 20px;
}


#services .content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    overflow: auto;
    max-height: calc(100dvh - 150px - 70px);
}

#serviceList, .serviceList {
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, 100%);
    overflow: visible;
    
    gap: 20px;
}


#profile {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

#profile .topbar {
    flex: 0 0 auto;
}

/* --- IL CONTENUTO NON DEVE SCROLLARE --- */
#profile .content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    overflow: auto;
}

#analytics {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

#analytics .topbar {
    flex: 0 0 auto;
}

/* --- IL CONTENUTO NON DEVE SCROLLARE --- */
#analytics .content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    overflow: auto;
}

/* --- SOLO LA LISTA SCROLLA --- */
#kpiList {
    flex: 1 1 auto;
    overflow-y: auto;
    padding-bottom: 100px; /* evita che l’ultimo elemento finisca sotto il pulsante */
    overflow: auto;
    padding-left: 10px;
    padding-right: 10px;
}


.week-nav {
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin:10px 0;
}

.week-btn {
  background:var(--panel);
  color:var(--text);
  border:1px solid rgba(0,0,0,.1);
  padding:0px 8px;
  border-radius:10px;
  cursor:pointer;
}

.week-days {
  display:flex;
  justify-content:space-between;
  margin-bottom:12px;
}

.week-day {
  padding:6px 10px;
  border-radius:10px;
  cursor:pointer;
  background:var(--panel);
  border:1px solid rgba(0,0,0,.08);
  font-size:14px;
  text-align:center;
  flex:1;
  margin:0 3px;
}

.week-day.active {
  background:var(--primary);
  color:white;
  border-color:var(--primary);
}

.week-search-panel {
  padding:12px;
  border-radius: 12px;
  background: #eef2ff; /* var(--card-bg-2, #f8f8f8); */
}



.service-card {
  background: var(--panel);
  border-radius: 14px;
  padding: 16px 14px;
  box-shadow: var(--shadow);
  /* margin: 20px 0; */
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding-left: 40px;
  position: relative;
}

.service-drag {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: grab;
  opacity: .5;
  font-size: 18px;
  user-select: none;
}

.service-card.dragging {
  opacity: 0.7;
  transform: scale(0.98);
  box-shadow: 0 10px 30px rgba(0,0,0,.2);
}

.service-placeholder {
  height: 60px;
  border: 2px dashed var(--primary);
  border-radius: 12px;
  margin: 12px 0;
}


.service-title {
  font-size: 17px;
  font-weight: 600;
}

.service-duration,
.service-cost {
  color: var(--muted);
  margin-top: 4px;
}

.service-cost {
  margin-left: auto; /* spinge a destra */
  text-align: right;
}

.service-actions {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  gap: 24px;
  margin-top: 6px;
  margin-right:8px;
}

.service-icon {
  cursor: pointer;
  font-size: 24px!important;
  opacity: .7;
  transition: opacity .2s;
  /* color: var(--intense); */
  transition: transform 140ms cubic-bezier(.2, .8, .2, 1), box-shadow 160ms cubic-bezier(.2, .8, .2, 1), filter 160ms cubic-bezier(.2, .8, .2, 1);
  will-change: transform, box-shadow;
}

.service-icon:hover {
  opacity: 1;
}


/* ----------------------------------------------------
   🎨 SELECT (Service Dropdown) — Mobile-friendly
----------------------------------------------------- */

#apptService {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.15);
  background: var(--panel);
  color: var(--text);
  appearance: none;       /* remove native arrow */
  -webkit-appearance: none;
  position: relative;
  box-shadow: var(--shadow);
  /* margin-top: 12px; */
}

/* Custom arrow */
#apptService {
  background-image: url("data:image/svg+xml,%3Csvg width='14' height='10' xmlns='https://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%23667' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 14px;
}

#apptService:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(58,122,254,.25);
}

/* Options formatting */
#apptService option {
  padding: 10px;
  font-size: 16px;
}

/* ----------------------------------------------------
   🌙 DARK MODE — nicer select styling
----------------------------------------------------- */
@media (prefers-color-scheme: dark) {
  #apptService {
    background: #0f172a;
    border: 1px solid #334155;
    color: var(--text);
  }

  #apptService {
    background-image: url("data:image/svg+xml,%3Csvg width='14' height='10' xmlns='https://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%23cbd5e1' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  }

  #apptService:focus {
    box-shadow: 0 0 0 3px rgba(59,130,246,.4);
  }

  #apptService option {
    background: #1e293b;
    color: var(--text);
  }
}


/* ----------------------------------------------------
   🟦 BUTTON PRESS ANIMATION (Bootstrap-like)
----------------------------------------------------- */

.btn,
.icon-btn,
.menu-item,
.week-btn,
.week-day,
.salon-appt,
.chip {
  transition: transform 120ms var(--ease), filter 120ms var(--ease);
}

/* Compressione stile Bootstrap quando premuto */
.btn:active,
.icon-btn:active,
.menu-item:active,
.week-btn:active,
.week-day:active,
.salon-appt:active,
.chip:active {
  transform: scale(0.96);
  filter: brightness(0.95);
}

/* Hover leggero per desktop (non invasivo su mobile) */
@media (hover: hover) {
  .btn:hover,
  .icon-btn:hover,
  .menu-item:hover,
  .week-btn:hover,
  .week-day:hover,
  .salon-appt:hover,
  .chip:hover {
    filter: brightness(1.03);
  }
}


/* --------------------------------------------------
🟧 LIFT ON HOVER (Desktop) — Versione robusta
----------------------------------------------------- */

@media (hover: hover) {

  .btn,
  .icon-btn,
  .menu-item,
  .week-btn,
  .week-day,
  .salon-appt,
  .chip {
    transition:
      transform 140ms cubic-bezier(.2,.8,.2,1),
      box-shadow 160ms cubic-bezier(.2,.8,.2,1),
      filter 160ms cubic-bezier(.2,.8,.2,1);
    will-change: transform, box-shadow;
  }

  /* Lift effect (sollevamento leggero) */
  .btn:hover:not(:active),
  .icon-btn:hover:not(:active),
  .menu-item:hover:not(:active),
  .week-btn:hover:not(:active),
  .week-day:hover:not(:active),
  .salon-appt:hover:not(:active),
  .chip:hover:not(:active) {
    transform: translateY(-2px) scale(1.01) !important;
    box-shadow:
      0 6px 14px rgba(0,0,0,.12),
      0 0 0 1px rgba(0,0,0,.05);
    filter: brightness(1.04);
  }
}

/* Press effect — funziona anche con il lift */
.btn:active,
.icon-btn:active,
.menu-item:active,
.week-btn:active,
.week-day:active,
.salon-appt:active,
.chip:active {
  transform: scale(.96) !important;
  filter: brightness(.95);
  box-shadow: none !important;
}


/* Pointer-based reorder */
.service-card.reordering {
  z-index: 99;
  box-shadow: 0 12px 32px rgba(0,0,0,.22);
  cursor: grabbing;
}

.service-placeholder {
  height: 58px;
  border: 2px dashed var(--primary);
  border-radius: 12px;
  margin: 12px 0;
}

#serviceSearch {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.15);
  background: var(--panel);
  color: var(--text);
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}



.hours-card {
  background: var(--panel);
  border-radius: 14px;
  padding: 16px 14px;
  box-shadow: var(--shadow);
  margin: 12px 0;
  position: relative;
}

.hours-day {
  font-size: 17px;
  font-weight: 600;
}

.hours-time {
  color: var(--muted);
  margin-top: 4px;
}

.hours-actions {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  gap: 24px;
  margin-top: 6px;
  margin-right:8px;
}

.hours-icon {
  cursor: pointer;
  font-size: 24px!important;
  opacity: .7;
  transition: opacity .2s;
  /* color: var(--intense); */
  transition: transform 140ms cubic-bezier(.2, .8, .2, 1), box-shadow 160ms cubic-bezier(.2, .8, .2, 1), filter 160ms cubic-bezier(.2, .8, .2, 1);
  will-change: transform, box-shadow;
}

.hours-icon:hover {
  opacity: 1;
}


/* ----------------------------------------------------
   🟦 UNIFIED SELECT STYLE  (services + working hours)
----------------------------------------------------- */

select {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.15);
  background: var(--panel);
  color: var(--text);
  /* margin-top: 12px; */
  box-shadow: var(--shadow);
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  background-image: url("data:image/svg+xml,%3Csvg width='14' height='10' xmlns='https://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%23667' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 14px;
}

select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(58,122,254,.25);
}

select option {
  padding: 10px;
  font-size: 16px;
}

/* ----------------------------------------------------
   🌙 DARK MODE
----------------------------------------------------- */
@media (prefers-color-scheme: dark) {
  select {
    background: #0f172a;
    border: 1px solid #334155;
    color: var(--text);
    background-image: url("data:image/svg+xml,%3Csvg width='14' height='10' xmlns='https://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%23cbd5e1' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  }

  select option {
    background: #1e293b;
    color: var(--text);
  }

  select:focus {
    box-shadow: 0 0 0 3px rgba(59,130,246,.4);
  }
}




input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="number"] {
  box-shadow: var(--shadow);
}

input::placeholder {
  color: rgb(165,165,165);
}



/* ----------------------------------------------------
   TIME PICKER — STABILE (scroll + click)
----------------------------------------------------- */

.custom-time-picker {
  display: flex;
  justify-content: center;
  gap: 16px;
  /* margin: 16px 0 12px; */
  align-items: center;
}

.ctp-column {
  width: 90px;
  height: 150px;               /* 3 items × 50px */
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: y proximity; /* NON mandatory */
  position: relative;
  box-sizing: content-box;
  background: var(--panel);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.ctp-column::-webkit-scrollbar { display: none; }

.ctp-option
 {
  height: 50px;
  line-height: 50px;
  padding: 0;
  margin: 0;
  text-align: center;
  font-size: 20px;
  user-select: none;
  scroll-snap-align: center;
  color: var(--text);
}

/* Evidenziazione dell’ora/minuto selezionato */
.ctp-option.selected {
  background: rgba(58,122,254,.20);
  color: var(--primary);
  border-radius: 6px;
}

.ctp-highlight {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 50px;
  width: 100%;
  pointer-events: none;
/*  border-top: 2px solid var(--primary);
  border-bottom: 2px solid var(--primary);
  background: rgba(58,122,254,0.10);
*/
}

/* Spaziatore per permettere la centratura del primo/ultimo elemento */
.ctp-spacer {
  height: 50px;  /* deve combaciare con ITEM_HEIGHT nel JS */
  flex: 0 0 50px;
}

/* --- Time picker: disabled state for out-of-hours --- */
.ctp-option.disabled {
  opacity: .45;
  color: var(--muted);
  pointer-events: none;          /* click disabilitato sugli elementi non validi */
}

.ctp-option.disabled.selected {  /* sicurezza: se mai capitasse */
  background: none;
  color: var(--muted);
}



.form-error {
  margin-top: 8px;
  color: #ef4444;      /* rosso "error" */
  font-size: 14px;
}


/* ----------------------------------------------------
   CLEAR ("X") per campi di ricerca
----------------------------------------------------- */

.clearable {
  position: relative; /* per posizionare il bottone dentro al wrapper */
}

.clear-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  translate: 0 -50%;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  outline: none;
  background: rgba(148,163,184,.25); /* slate-400/25 */
  color: var(--text);
  display: none;             /* di base nascosto, lo attiva JS quando c’è testo */
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s ease, opacity .15s ease;
}

.clear-btn:hover { background: rgba(148,163,184,.35); }
.clear-btn:active { background: rgba(148,163,184,.45); transform: scale(.96); }
.clear-btn svg { width: 14px; height: 14px; }

/* Dark mode */
@media (prefers-color-scheme: dark) {
  .clear-btn { background: rgba(100,116,139,.28); }
  .clear-btn:hover { background: rgba(100,116,139,.38); }
}

/* per input con padding interno, evitiamo che il testo si sovrapponga alla X */
.input-with-clear {
  padding-right: 42px !important; /* spazio per il bottone a destra */
  box-shadow: var(--shadow);
}


/* Ritardo Appointments */
.appt-time-original {
  color: var(--muted);
  margin-left: 4px;
  font-size: 0.95em;
}


.delay-badge, .anticipated-badge, .was-badge, .badge {
  display:inline-block;
  margin-left:6px;
  margin-bottom:4px;
  padding:2px 6px;
  font-size:12px;
  border-radius:999px;
  background:rgba(239,68,68,.12);
  color:#ef4444;
  vertical-align:middle;
}

.badge {
  font-weight: 600;
}

.anticipated-badge {
  color:#004f1c;
  background:rgba(108, 239, 68, 0.12);
}
.was-badge {
  color:#024987;
  background:rgb(210, 226, 255);
}

.appt-time-original {
  color:var(--muted);
  margin-left:4px;
  font-size:.95em;
}


.appt-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}


/* La card in APPOINTMENTS non è cliccabile */
#appointments .appt-card { cursor: default; }

/* Le icone sono cliccabili */
#appointments .appt-actions .appt-icon { cursor: pointer; }


/* === Analytics: KPI === */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0 8px;
  
  padding-left: 10px;
  padding-right: 10px;
}
.kpi {
  background: var(--panel);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 12px;
}
.kpi-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.kpi-value {
  font-size: 18px;
  font-weight: 600;
}

/* === Analytics: chart container === */
.chart {
  width: 100%;
  min-height: 180px;
}

/* Bar chart semplice */
.chart svg {
  width: 100%;
  height: 220px;
  display: block;
}
.chart .bar {
  fill: #3A7AFE;
  opacity: .85;
  rx: 4;
}
.chart .bar:hover {
  opacity: 1;
}
.chart .axis text {
  fill: var(--muted);
  font-size: 11px;
}
.chart .label {
  fill: var(--text);
  font-size: 11px;
  text-anchor: middle;
}
@media (max-width: 768px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* === Analytics: line chart (trend) === */
.chart .line {
  fill: none;
  stroke: #3A7AFE !important; /* rosso */
  stroke-width: 2!important;
}
.chart .dot {
  fill: #ef4444;
}
.chart .axis path {
  stroke: var(--muted);
  stroke-width: 1;
  fill: none;
}

/* === Analytics: assi e griglie === */
.chart .y-grid line {
  stroke: rgba(148,163,184,.35); /* slate-400/35, visibile in light & dark */
  stroke-width: 1;
  shape-rendering: crispEdges;
}

.chart .axis path {
  stroke: var(--muted);
  stroke-width: 1;
  fill: none;
  shape-rendering: crispEdges;
}

.chart .y-label {
  fill: var(--muted);
  font-size: 11px;
  dominant-baseline: middle;
  text-anchor: end;
}





/* Profile: messaggi salvataggio */
#profMsg.ok { color: #16a34a; }     /* verde */
#profMsg.err { color: #ef4444; }    /* rosso */


#sideMenuOverlay {
  opacity: 0 !important;
  pointer-events: none !important;
}

.side-menu:not(.open) {
  transform: translateX(-100%) !important;
  box-shadow: none !important;
}

.side-menu.open {
    box-shadow: 0px 0px 18px rgba(0,0,0,0.15);
}

.side-menu {
    transform: translateX(-100%) !important;
}

.side-menu.open {
    transform: translateX(0) !important;
}

input[type="text"] {
  box-shadow: var(--shadow);
}


.salon-view {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.salon-col {
  background: var(--panel);
  border-radius: 14px;
  padding: 10px 14px;
  box-shadow: var(--shadow);
}

.salon-col h3 {
  margin: 0 0 10px 0;
  font-size: 18px;
  font-weight: 500;
}

.salon-appt {
  background: var(--panel);
  border-left: 4px solid var(--primary);
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 10px;
  font-size: 15px;
  box-shadow: var(--shadow);
}
.salon-appt:active {
  transform: scale(0.97);
  box-shadow: 0 3px 8px rgba(0,0,0,0.10);
}

.disabled {
  /* color: var(--muted)!important; */
  opacity: 0.5;
  cursor: not-allowed!important;
}





/* SCROLL ORIZZONTALE */
.slot-scroll {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 10px;
  padding: 6px 2px;
  scroll-snap-type: x mandatory;
}

.slot-scroll::-webkit-scrollbar {
  display: none; /* opzionale: barra invisibile */
}

/* SLOT-PILL */
.slotList {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: repeat(auto, 1);
    gap: 8px;
    /* overflow: auto; */
    padding: 4px 2px;
    scroll-snap-type: y mandatory;
    max-height: calc(100dvh - 550px - 70px);
    min-height: 100px;
    padding-bottom: 20px;
    
    scroll-snap-type: x mandatory;
    overflow-x: auto;
    justify-content: left;
}


.slot-btn {
  padding: 8px 12px;
  font-size: 0.9rem;
  border-radius: 8px;
  background: var(--card-bg-2, #eee);
  border: 1px solid var(--border-color, #ccc);
  white-space: nowrap;
  cursor: pointer;
  scroll-snap-align: start;
  
  display: grid;
  justify-content: center;
  width:80px;
  font-size: 22px;
  font-weight: 600;
  justify-content: center;
  text-align: -webkit-center;
  transition: 0.15s;
  justify-content: center;
  text-align: -webkit-center;

  box-shadow: var(--shadow);
}

.sub {
  padding-top: 24px;
}

.slot-btn.active {
  background: var(--primary, #3b82f6);
  color: white;
  border-color: var(--primary);
}

.slot-btn.disabled-slot {
  opacity: 0.35;
  cursor: not-allowed;
  background: #ddd;
  border-color: #ccc;
}




/* spacing per la modale operatori */
#operatorModal .sheet {
  padding: 24px;
  gap: 20px;
  display: flex;
  flex-direction: column;
}

#operatorModal .modal-title {
  margin-bottom: 10px;
  margin-top: -12px;
}

#operatorModal .field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#operatorModal .field-label {
  font-size: 0.9rem;
  opacity: 0.7;
}

#operatorModal input[type="text"],
#operatorModal input[type="color"] {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border-color, #ccc);
}

#operatorModal input[type="color"] {
  height: 55px;
}

#operatorModal .modal-actions.spaced {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 10px;
}


.operator-line {
  margin-top: 16px;
  margin-bottom:0px;
  opacity: 0.85;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
}

.operator-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}


.salon-view {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-top: 0;
}

.salon-col {
  min-width: 220px;
  background: var(--card-bg, #fff);
  border-radius: 12px;
  padding: 12px;
  box-shadow: var(--shadow-sm);
}

.salon-col h3 {
  margin: 0 0 10px 0;
  font-size: 1.1rem;
}

.salon-appt {
  background: var(--card-bg-2, #f8f8f8);
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 10px;
  border-left: 5px solid #3b82f6;
  cursor: pointer;
}

.salon-appt strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.95rem;
}





/* ----------------------------------------------------
   DARK MODE — missing components fix pack
----------------------------------------------------- */
@media (prefers-color-scheme: dark) {

  /* MENU BUTTON */
  body .icon-btn {
    background:#334155 !important;
    color: var(--text) !important;
    border: 1px solid #475569 !important;
  }

  /* PLACEHOLDERS */
  .placeholder {
    color:#cbd5e1 !important;
  }
  .placeholder-sub {
    color:#94a3b8 !important;
  }

  /* SEGMENT CONTROL */
  .segmented {
    background:#334155 !important;
    border:1px solid #475569 !important;
  }
  .seg {
    color: var(--text) !important;
  }
  .seg.active {
    background:#1e293b !important;
    color: var(--primary) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08) !important;
  }

  /* WEEKDAY SELECTOR */
  .week-day {
    background:#1e293b !important;
    border-color:#334155 !important;
    color: var(--text) !important;
  }
  .week-day.active {
    background: var(--primary) !important;
    color:white !important;
  }

  /* APPOINTMENT SLOTS */
  .appt-slot {
    background:#1e293b;
    border-color:#334155;
    color: var(--muted);
  }
  .appt-slot:hover {
    background: rgba(59,130,246,.12) !important;
    border-color: var(--primary) !important;
    color: var(--primary) !important;
  }

  /* MODALE */
  .sheet h2,
  .sheet h3,
  .sheet label,
  .sheet span {
    color: var(--text) !important;
  }

  .grab {
    background:#475569 !important;
  }

  .btn.ghost {
    background:#334155 !important;
    border:1px solid #475569 !important;
    color:#e2e8f0 !important;
  }

  /* TIME PICKER */
  .ctp-column {
    background:#0f172a !important;
    border:1px solid #334155 !important;
  }
  .ctp-option {
    color: var(--text) !important;
  }
  .ctp-option.selected {
    background: rgba(59,130,246,.20) !important;
    color: var(--primary) !important;
  }

  /* SELECT */
  #apptService {
    background:#0f172a !important;
    border:1px solid #334155 !important;
    color: var(--text) !important;
  }
  #apptService option {
    background:#1e293b !important;
    color: var(--text) !important;
  }

}






.confirmDialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .36);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
  z-index: 100;

  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}


.confirmDialog {
  background: var(--panel);
  color: var(--text);
  width: min(90%, 380px);
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(0,0,0,.25);
  transform: translateY(20px);
  opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
}

.confirmDialog-backdrop.show .confirmDialog {
  opacity: 1;
  transform: translateY(0);
}

.confirmDialog-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}


.confirmDialog h2 {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 600;
}

.confirmDialog p {
  margin: 0 0 24px;
  font-size: 15px;
  line-height: 1.4;
}

.confirmDialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.btn-text {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 15px;
  padding: 8px 12px;
  cursor: pointer;
}

.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
}





/* Container */
.my-switch {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

/* Nascondo l’input nativo */
.my-switch input {
  display: none;
}

/* Track */
.switch-track {
  width: 42px;
  height: 24px;
  background: var(--md-sys-color-surface-variant, #e7e0ec);
  border-radius: 16px;
  position: relative;
  transition: background 180ms ease;
}

/* Thumb */
.switch-thumb {
  width: 16px;
  height: 16px;
  background: var(--md-sys-color-outline, #6f6f6f);
  border-radius: 50%;
  position: absolute;
  top: 4px;
  left: 3px;
  transition: all 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Stato ON */
.my-switch input:checked + .switch-track {
  background: var(--md-sys-color-primary, #3A7AFE);
}

.my-switch input:checked + .switch-track .switch-thumb {
  background: var(--md-sys-color-on-primary, #ffffff);
  transform: translateX(20px);
}

/* Label */
.switch-label {
  font-size: 16px;
  color: var(--md-sys-color-on-surface, #1c1b1f);
}

/* Input quota */
.my-input {
  width: 120px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--md-sys-color-outline, #6f6f6f);
  font-size: 16px;
  transition: 0.2s ease;
}

.my-input:disabled {
  opacity: 0.4;
  background: #f0f0f0;
}




.card-element {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--md-sys-color-outline, #6f6f6f);
  background: var(--md-sys-color-surface, #fff);
  margin-top: 6px;
}

.card-errors {
  color: #b00020;
  font-size: 14px;
  margin-top: 6px;
  min-height: 18px;
}

button.loading {
  pointer-events: none;
  opacity: 0.7;
  position: relative;
}

button.loading::after {
  content: "";
  width: 18px;
  height: 18px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
}

@keyframes spin {
  to { transform: translateY(-50%) rotate(360deg); }
}


button.success {
  pointer-events: none;
  position: relative;
}

button.success::after {
  content: "";
  width: 16px;
  height: 8px;
  border-left: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  position: absolute;
  right: 12px;
  top: 40%;
  transform: translateY(-50%) rotate(-45deg) scale(0.2);
  opacity: 0;
  animation: checkmark-pop 0.25s ease-out forwards;
}

@keyframes checkmark-pop {
  0%   { transform: translateY(-50%) rotate(-45deg) scale(0.2); opacity: 0; }
  80%  { transform: translateY(-50%) rotate(-45deg) scale(1.2); opacity: 1; }
  100% { transform: translateY(-50%) rotate(-45deg) scale(1); opacity: 1; }
}


button.error {
  pointer-events: none;
  position: relative;
}

button.error::before,
button.error::after {
  content: "";
  width: 16px;
  height: 3px;
  background-color: currentColor;
  position: absolute;
  right: 12px;
  top: 50%;
  transform-origin: center;
  opacity: 0;
}

/* Linea 1 (45°) */
button.error::before {
  transform: translateY(-50%) rotate(45deg) scaleX(0.2);
  animation: cross-pop-1 0.25s ease-out forwards;
}

/* Linea 2 (-45°) */
button.error::after {
  transform: translateY(-50%) rotate(-45deg) scaleX(0.2);
  animation: cross-pop-2 0.25s ease-out forwards;
}

/* Animazioni separate che NON toccano la rotazione */
@keyframes cross-pop-1 {
  0%   { opacity: 0; transform: translateY(-50%) rotate(45deg) scaleX(0.2); }
  80%  { opacity: 1; transform: translateY(-50%) rotate(45deg) scaleX(1.2); }
  100% { opacity: 1; transform: translateY(-50%) rotate(45deg) scaleX(1); }
}

@keyframes cross-pop-2 {
  0%   { opacity: 0; transform: translateY(-50%) rotate(-45deg) scaleX(0.2); }
  80%  { opacity: 1; transform: translateY(-50%) rotate(-45deg) scaleX(1.2); }
  100% { opacity: 1; transform: translateY(-50%) rotate(-45deg) scaleX(1); }
}
