/* =====================================================================
   ESTETIFLOW · Estilos del sistema
   Paleta: dorado, rosa suave y violeta · modo claro (sol) / oscuro (luna)
   Realizado por HASHEM Publicidad
   ===================================================================== */

:root {
  --bg: #fbf5f9;
  --bg-2: #f4eaf4;
  --surface: #ffffff;
  --surface-2: #fbf6fc;
  --border: #eddff0;
  --text: #2b2036;
  --muted: #7c6c89;
  --violet: #6b3fa8;
  --violet-2: #8d5fd8;
  --pink: #df7aa4;
  --pink-soft: #fbe4ee;
  --gold: #a98316;
  --gold-2: #d4af37;
  --gold-soft: #fbf2d6;
  --ok: #15803d;
  --ok-soft: #dcfce7;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --bad: #be123c;
  --bad-soft: #ffe4e6;
  --shadow: 0 10px 30px rgba(107, 63, 168, .09);
  --shadow-lg: 0 24px 60px rgba(60, 20, 90, .18);
  --radius: 16px;
  --grad: linear-gradient(135deg, #7b46c4 0%, #c56fa6 60%, #e3b04b 100%);
  --grad-gold: linear-gradient(135deg, #e7c766 0%, #c9a227 100%);
  --font-titulo: 'Playfair Display', Georgia, serif;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}

:root[data-tema="oscuro"] {
  --bg: #130c1c;
  --bg-2: #1a1226;
  --surface: #21172f;
  --surface-2: #291e3a;
  --border: #3a2c50;
  --text: #f6eefb;
  --muted: #b5a5c6;
  --violet: #b490f2;
  --violet-2: #c9adf7;
  --pink: #f3a6c6;
  --pink-soft: #3b2238;
  --gold: #ebca63;
  --gold-2: #f2d47e;
  --gold-soft: #3a3020;
  --ok: #4ade80;
  --ok-soft: #14321f;
  --warn: #fbbf24;
  --warn-soft: #3b2e12;
  --bad: #fb7185;
  --bad-soft: #3d1621;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  min-height: 100vh;
  transition: background-color .5s ease, color .3s ease;
  -webkit-font-smoothing: antialiased;
}

/* ---------------------------------------------------------------------
   Cielo de fondo: sol en modo claro, luna y estrellas en modo oscuro
   --------------------------------------------------------------------- */
.cielo { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.cielo .sol, .cielo .luna, .cielo .estrellas, .cielo .bruma { position: absolute; transition: opacity 1s ease, transform 1.2s ease; }
.cielo .bruma {
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 15% 100%, rgba(223, 122, 164, .14), transparent 70%),
    radial-gradient(ellipse 50% 35% at 90% 90%, rgba(107, 63, 168, .10), transparent 70%);
}
.cielo .sol {
  top: -140px; right: -120px; width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, #fff6d6 0%, #f8dc8a 30%, rgba(240, 196, 90, .45) 55%, rgba(240, 196, 90, 0) 72%);
  animation: latidoSol 7s ease-in-out infinite;
}
.cielo .luna {
  top: 40px; right: 70px; width: 120px; height: 120px; border-radius: 50%;
  box-shadow: inset -26px -6px 0 0 #f4e7b8, 0 0 60px rgba(244, 231, 184, .25);
  opacity: 0; transform: translateY(-40px) rotate(-20deg);
}
.cielo .estrellas {
  inset: 0; opacity: 0;
  background-image:
    radial-gradient(1.6px 1.6px at 12% 18%, #fff, transparent 60%),
    radial-gradient(1.2px 1.2px at 28% 62%, #f3e8ff, transparent 60%),
    radial-gradient(1.8px 1.8px at 46% 28%, #fff, transparent 60%),
    radial-gradient(1.2px 1.2px at 64% 74%, #fde68a, transparent 60%),
    radial-gradient(1.5px 1.5px at 78% 40%, #fff, transparent 60%),
    radial-gradient(1.1px 1.1px at 88% 82%, #f9a8d4, transparent 60%),
    radial-gradient(1.4px 1.4px at 6% 86%, #fff, transparent 60%),
    radial-gradient(1.2px 1.2px at 56% 8%, #fff, transparent 60%),
    radial-gradient(1px 1px at 36% 92%, #fff, transparent 60%),
    radial-gradient(1.3px 1.3px at 94% 12%, #fff, transparent 60%);
  animation: titilar 5s ease-in-out infinite alternate;
}
:root[data-tema="oscuro"] .cielo .sol { opacity: 0; transform: translateY(80px) scale(.6); }
:root[data-tema="oscuro"] .cielo .luna { opacity: 1; transform: none; }
:root[data-tema="oscuro"] .cielo .estrellas { opacity: .9; }
:root[data-tema="oscuro"] .cielo .bruma {
  background:
    radial-gradient(ellipse 60% 40% at 15% 100%, rgba(180, 144, 242, .13), transparent 70%),
    radial-gradient(ellipse 50% 35% at 90% 90%, rgba(243, 166, 198, .08), transparent 70%);
}
@keyframes latidoSol { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes titilar { from { opacity: .55; } to { opacity: 1; } }

/* ---------------------------------------------------------------------
   Interruptor sol / luna
   --------------------------------------------------------------------- */
.tema-switch {
  position: relative; width: 68px; height: 34px; border-radius: 99px; border: 1px solid var(--border);
  background: linear-gradient(135deg, #fde9a8, #f8c9dc); cursor: pointer; padding: 0; flex-shrink: 0;
  transition: background .5s ease; box-shadow: inset 0 2px 6px rgba(0, 0, 0, .08);
}
:root[data-tema="oscuro"] .tema-switch { background: linear-gradient(135deg, #2b1d47, #4b2a5c); }
.tema-switch .perilla {
  position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%;
  background: #fff8e0; display: grid; place-items: center; font-size: 15px;
  box-shadow: 0 2px 8px rgba(169, 131, 22, .45); transition: transform .45s cubic-bezier(.68, -.4, .3, 1.4), background .4s;
}
:root[data-tema="oscuro"] .tema-switch .perilla { transform: translateX(34px); background: #efe3ff; box-shadow: 0 2px 10px rgba(180, 144, 242, .6); }
.tema-switch .perilla::before { content: '☀️'; }
:root[data-tema="oscuro"] .tema-switch .perilla::before { content: '🌙'; }
.tema-switch:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; }

/* ---------------------------------------------------------------------
   Estructura general
   --------------------------------------------------------------------- */
.app { position: relative; z-index: 1; display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.lateral {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 18px 14px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(14px); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 4px;
}
.marca { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; text-decoration: none; color: var(--text); }
.marca img { width: 42px; height: 42px; }
.marca b { font-family: var(--font-titulo); font-size: 1.45rem; letter-spacing: .2px; }
.marca b span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.marca small { display: block; font-size: .7rem; color: var(--muted); letter-spacing: .6px; text-transform: uppercase; margin-top: -2px; }
.nav-titulo { font-size: .68rem; text-transform: uppercase; letter-spacing: 1.4px; color: var(--muted); padding: 14px 12px 6px; font-weight: 700; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 12px; text-decoration: none;
  color: var(--text); font-weight: 500; font-size: .94rem; transition: background .2s, color .2s;
}
.nav a .ico { width: 22px; text-align: center; font-size: 1.05rem; }
.nav a:hover { background: var(--surface-2); }
.nav a.activo { background: var(--grad); color: #fff; box-shadow: 0 6px 18px rgba(123, 70, 196, .28); }
.nav a .tag { margin-left: auto; font-size: .62rem; font-weight: 800; letter-spacing: .5px; padding: 2px 7px; border-radius: 99px; background: var(--gold-soft); color: var(--gold); }
.nav a.activo .tag { background: rgba(255, 255, 255, .25); color: #fff; }
.lateral .pie { margin-top: auto; padding-top: 14px; }
.yo { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.yo .avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; background: var(--grad); flex-shrink: 0; }
.yo b { display: block; font-size: .88rem; }
.yo small { color: var(--muted); font-size: .75rem; }
.yo a { margin-left: auto; color: var(--muted); text-decoration: none; font-size: 1.15rem; padding: 4px 6px; border-radius: 8px; }
.yo a:hover { color: var(--bad); background: var(--bad-soft); }
.creditos { text-align: center; font-size: .72rem; color: var(--muted); padding: 12px 0 2px; }
.creditos a { color: var(--gold); font-weight: 700; text-decoration: none; text-shadow: 0 0 10px rgba(212, 175, 55, .55); }

.principal { min-width: 0; display: flex; flex-direction: column; }
.barra {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 14px 28px;
  background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border);
}
.barra h1 { font-family: var(--font-titulo); font-size: 1.55rem; margin: 0; font-weight: 700; }
.barra .fecha-hoy { color: var(--muted); font-size: .85rem; }
.barra .acciones { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.burger { display: none; background: none; border: 0; font-size: 1.5rem; color: var(--text); cursor: pointer; padding: 4px 8px; }
.contenido { padding: 24px 28px 60px; }

/* ---------------------------------------------------------------------
   Componentes
   --------------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card h2, .card h3 { margin: 0 0 14px; font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.card h2 small, .card h3 small { margin-left: auto; font-weight: 500; color: var(--muted); font-size: .8rem; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.fila { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fila.entre { justify-content: space-between; }
.mt { margin-top: 18px; } .mb { margin-bottom: 18px; }
.muted { color: var(--muted); }
.chico { font-size: .82rem; }
.derecha { text-align: right; }
.vacio { text-align: center; color: var(--muted); padding: 30px 10px; }
.vacio .grande { font-size: 2.4rem; display: block; margin-bottom: 6px; }

.stat { position: relative; overflow: hidden; }
.stat .label { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .8px; font-weight: 600; }
.stat .num { font-family: var(--font-titulo); font-size: 2rem; font-weight: 700; margin-top: 4px; }
.stat .sub { font-size: .8rem; color: var(--muted); }
.stat .ico { position: absolute; right: 16px; top: 14px; font-size: 1.8rem; opacity: .9; }
.stat.dorado { background: linear-gradient(135deg, var(--gold-soft), var(--surface)); }
.stat.rosa { background: linear-gradient(135deg, var(--pink-soft), var(--surface)); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 18px; border-radius: 12px;
  border: 1px solid transparent; font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; text-decoration: none;
  transition: transform .15s, box-shadow .2s, background .2s, opacity .2s; white-space: nowrap; line-height: 1.2;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primario { background: var(--grad); color: #fff; box-shadow: 0 6px 18px rgba(123, 70, 196, .28); }
.btn-primario:hover { box-shadow: 0 8px 24px rgba(123, 70, 196, .4); }
.btn-dorado { background: var(--grad-gold); color: #2b1d0a; box-shadow: 0 6px 18px rgba(201, 162, 39, .3); }
.btn-suave { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-suave:hover { border-color: var(--violet-2); }
.btn-rosa { background: var(--pink-soft); color: var(--pink); border-color: transparent; }
.btn-peligro { background: var(--bad-soft); color: var(--bad); }
.btn-wa { background: #25d366; color: #fff; }
.btn-wa:hover { background: #1fb457; }
.btn-chico { padding: 6px 11px; font-size: .8rem; border-radius: 10px; }
.btn-icono { padding: 8px; width: 36px; height: 36px; }

label { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
input, select, textarea {
  width: 100%; font: inherit; font-size: .92rem; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 11px; padding: 10px 12px; transition: border .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--violet-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--violet-2) 22%, transparent); }
textarea { min-height: 80px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--violet); transform: scale(1.15); }
input[type="color"] { padding: 3px; height: 42px; }
.campo { margin-bottom: 14px; }
.check { display: flex; align-items: center; gap: 9px; font-size: .9rem; color: var(--text); font-weight: 500; cursor: pointer; margin: 6px 0; }

.tabla-wrap { overflow-x: auto; }
table.tabla { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tabla th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border); font-weight: 700; }
.tabla td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tabla tr:last-child td { border-bottom: 0; }
.tabla tbody tr { transition: background .15s; }
.tabla tbody tr.click { cursor: pointer; }
.tabla tbody tr.click:hover { background: var(--surface-2); }
.tabla .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: .74rem; font-weight: 700; background: var(--surface-2); border: 1px solid var(--border); white-space: nowrap; }
.chip .punto { width: 8px; height: 8px; border-radius: 50%; }
.estado-pendiente { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.estado-confirmado { background: color-mix(in srgb, var(--violet) 14%, transparent); color: var(--violet); border-color: transparent; }
.estado-en_curso { background: var(--pink-soft); color: var(--pink); border-color: transparent; }
.estado-finalizado { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.estado-ausente, .estado-cancelado { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.chip-dorado { background: var(--gold-soft); color: var(--gold); border-color: transparent; }
.chip-alerta { background: var(--warn-soft); color: var(--warn); border-color: transparent; }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs button { background: none; border: 0; font: inherit; font-weight: 600; font-size: .88rem; color: var(--muted); padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.activo { color: var(--violet); border-bottom-color: var(--violet); }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 3px; }
.seg button { border: 0; background: none; font: inherit; font-size: .84rem; font-weight: 600; padding: 7px 13px; border-radius: 9px; color: var(--muted); cursor: pointer; }
.seg button.activo { background: var(--surface); color: var(--violet); box-shadow: var(--shadow); }

/* Lista de próximos turnos y elementos */
.item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.item:last-child { border-bottom: 0; }
.item .hora { font-weight: 700; font-variant-numeric: tabular-nums; width: 52px; flex-shrink: 0; }
.item .barra-color { width: 4px; align-self: stretch; border-radius: 4px; flex-shrink: 0; }
.item .info { flex: 1; min-width: 0; }
.item .info b { display: block; font-size: .93rem; }
.item .info span { color: var(--muted); font-size: .82rem; }

/* Gráfico de barras simple */
.barras { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding-top: 10px; }
.barras .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.barras .b i { display: block; width: 100%; max-width: 46px; border-radius: 8px 8px 3px 3px; background: var(--grad); min-height: 3px; transition: height .6s ease; }
.barras .b small { font-size: .68rem; color: var(--muted); white-space: nowrap; }
.barras .b em { font-style: normal; font-size: .68rem; font-weight: 700; color: var(--text); white-space: nowrap; }
.hbar { display: grid; grid-template-columns: 140px 1fr auto; gap: 10px; align-items: center; margin: 9px 0; font-size: .86rem; }
.hbar .riel { height: 12px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.hbar .riel i { display: block; height: 100%; border-radius: 99px; }
.hbar .nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------------
   Modales y avisos
   --------------------------------------------------------------------- */
.modal-fondo {
  position: fixed; inset: 0; z-index: 100; background: rgba(25, 10, 40, .55); backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; animation: aparecer .2s ease;
}
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-lg); width: min(560px, 100%); animation: subir .25s ease; }
.modal.ancho { width: min(980px, 100%); }
.modal.medio { width: min(760px, 100%); }
.modal-cab { display: flex; align-items: center; gap: 10px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-cab h3 { margin: 0; font-family: var(--font-titulo); font-size: 1.3rem; }
.modal-cab .cerrar { margin-left: auto; background: var(--surface-2); border: 0; width: 34px; height: 34px; border-radius: 50%; font-size: 1.3rem; cursor: pointer; color: var(--text); }
.modal-cuerpo { padding: 20px 22px; }
.modal-pie { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 22px 20px; flex-wrap: wrap; }
@keyframes aparecer { from { opacity: 0; } to { opacity: 1; } }
@keyframes subir { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

#toasts { position: fixed; bottom: 22px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--ok); border-radius: 12px; padding: 12px 16px; box-shadow: var(--shadow-lg); font-size: .9rem; max-width: 360px; animation: subir .25s ease; white-space: pre-line; }
.toast.error { border-left-color: var(--bad); }

.aviso { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--warn-soft); color: var(--warn); font-size: .88rem; margin-bottom: 14px; }
.aviso.info { background: color-mix(in srgb, var(--violet) 10%, transparent); color: var(--violet); }
.aviso.ok { background: var(--ok-soft); color: var(--ok); }

/* ---------------------------------------------------------------------
   Agenda
   --------------------------------------------------------------------- */
.agenda-barra { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.agenda-barra .fecha-txt { font-family: var(--font-titulo); font-size: 1.25rem; font-weight: 700; min-width: 210px; }
.agenda-barra input[type="date"] { width: auto; }
.agenda-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: auto; max-height: calc(100vh - 210px); position: relative; }
.agenda { display: grid; position: relative; min-width: max-content; }
.agenda .cab { position: sticky; top: 0; z-index: 6; background: var(--surface); border-bottom: 1px solid var(--border); padding: 10px 8px; text-align: center; font-weight: 700; font-size: .85rem; }
.agenda .cab small { display: block; font-weight: 500; color: var(--muted); font-size: .72rem; }
.agenda .cab .punto { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.agenda .esquina { position: sticky; left: 0; top: 0; z-index: 8; background: var(--surface); border-bottom: 1px solid var(--border); }
.agenda .horas { position: sticky; left: 0; z-index: 5; background: var(--surface); border-right: 1px solid var(--border); }
.agenda .horas div { position: absolute; left: 0; right: 0; font-size: .72rem; color: var(--muted); text-align: right; padding-right: 8px; transform: translateY(-7px); font-variant-numeric: tabular-nums; }
.agenda .col { position: relative; border-right: 1px solid var(--border); min-width: 168px; }
.agenda .col:last-child { border-right: 0; }
.agenda .col.sobre { background: color-mix(in srgb, var(--violet) 7%, transparent); }
.agenda .linea { position: absolute; left: 0; right: 0; border-top: 1px solid var(--border); }
.agenda .linea.media { border-top-style: dashed; opacity: .55; }
.agenda .ahora { position: absolute; left: 0; right: 0; border-top: 2px solid var(--pink); z-index: 4; pointer-events: none; }
.agenda .ahora::before { content: ''; position: absolute; left: -5px; top: -6px; width: 10px; height: 10px; border-radius: 50%; background: var(--pink); }

.bloque {
  position: absolute; border-radius: 10px; padding: 5px 8px; font-size: .76rem; line-height: 1.25; overflow: hidden; cursor: pointer;
  background: color-mix(in srgb, var(--c) 18%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  border-left: 4px solid var(--c); color: var(--text); z-index: 2; transition: box-shadow .2s, transform .15s;
}
.bloque:hover { box-shadow: var(--shadow-lg); z-index: 3; transform: translateY(-1px); }
.bloque b { display: block; font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bloque .s { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.bloque .h { font-weight: 700; font-variant-numeric: tabular-nums; }
.bloque .iconos { position: absolute; right: 5px; top: 4px; display: flex; gap: 2px; font-size: .78rem; }
.bloque .pose {
  position: absolute; left: 0; right: 0; pointer-events: none; display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(45deg, transparent 0 6px, color-mix(in srgb, var(--c) 22%, transparent) 6px 12px);
  border-top: 1px dashed color-mix(in srgb, var(--c) 60%, transparent); border-bottom: 1px dashed color-mix(in srgb, var(--c) 60%, transparent);
  font-size: .66rem; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--muted);
}
.bloque.e-finalizado { opacity: .72; }
.bloque.e-ausente { opacity: .5; text-decoration: line-through; }
.bloque.e-en_curso { box-shadow: 0 0 0 2px var(--pink); }
.bloque.arrastrando { opacity: .4; }
.bloque[draggable="true"] { cursor: grab; }

.semana { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); gap: 10px; overflow-x: auto; }
.semana .dia { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 10px; min-height: 260px; box-shadow: var(--shadow); }
.semana .dia h4 { margin: 0 0 8px; font-size: .86rem; display: flex; justify-content: space-between; cursor: pointer; }
.semana .dia.hoy { border-color: var(--violet-2); box-shadow: 0 0 0 2px color-mix(in srgb, var(--violet-2) 30%, transparent); }
.semana .dia.cerrado { opacity: .55; }
.semana .mini { border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 12%, var(--surface)); border-radius: 8px; padding: 5px 7px; margin-bottom: 5px; font-size: .74rem; cursor: pointer; }
.semana .mini b { font-variant-numeric: tabular-nums; }

/* Armado de visita */
.servicios-elegidos .se { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 8px; background: var(--surface-2); }
.servicios-elegidos .se .n { width: 24px; height: 24px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-size: .75rem; font-weight: 700; flex-shrink: 0; }
.servicios-elegidos .se .nom { flex: 1; font-weight: 600; font-size: .9rem; min-width: 0; }
.servicios-elegidos .se select { width: 160px; padding: 6px 8px; font-size: .82rem; }
.servicios-elegidos .se button { background: none; border: 0; cursor: pointer; font-size: 1rem; color: var(--muted); padding: 2px 4px; }
.propuesta { margin-top: 16px; }
.propuesta .linea-p { display: grid; grid-template-columns: 112px 1fr 160px 150px; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.propuesta .linea-p input, .propuesta .linea-p select { padding: 6px 8px; font-size: .84rem; }
.gantt { position: relative; height: 0; margin: 16px 0 6px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.gantt .g { position: absolute; height: 26px; border-radius: 8px; font-size: .7rem; font-weight: 700; color: #fff; padding: 5px 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gantt .g .pz { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(45deg, rgba(255, 255, 255, .0) 0 5px, rgba(255, 255, 255, .45) 5px 10px); }
.gantt .reg { position: absolute; bottom: -18px; font-size: .66rem; color: var(--muted); transform: translateX(-50%); }

.buscador { position: relative; }
.buscador .resultados { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); max-height: 260px; overflow-y: auto; }
.buscador .resultados div { padding: 9px 12px; cursor: pointer; font-size: .9rem; }
.buscador .resultados div:hover, .buscador .resultados div.sel { background: var(--surface-2); }
.buscador .resultados small { color: var(--muted); margin-left: 6px; }

/* Ficha de clienta */
.ficha-cab { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.ficha-cab .avatar-xl { width: 64px; height: 64px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-size: 1.5rem; font-weight: 700; font-family: var(--font-titulo); }
.ficha-cab h2 { margin: 0; font-family: var(--font-titulo); font-size: 1.6rem; }
.fotos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.foto { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); aspect-ratio: 1; background: var(--surface-2); cursor: zoom-in; }
.foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.foto .et { position: absolute; left: 8px; top: 8px; }
.foto .pie-foto { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px; font-size: .72rem; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .6)); }
.visor { position: fixed; inset: 0; z-index: 300; background: rgba(10, 5, 20, .9); display: grid; place-items: center; padding: 20px; cursor: zoom-out; }
.visor img { max-width: 100%; max-height: 90vh; border-radius: 12px; }
.saldo-debe { color: var(--bad); font-weight: 700; }
.saldo-favor { color: var(--ok); font-weight: 700; }

/* Módulos "a pedido" */
.pedido-hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; align-items: center; }
.pedido-hero h2 { font-family: var(--font-titulo); font-size: 2rem; margin: 6px 0 10px; line-height: 1.15; }
.pedido-hero ul { padding-left: 0; list-style: none; margin: 16px 0 22px; }
.pedido-hero li { padding: 6px 0 6px 28px; position: relative; }
.pedido-hero li::before { content: '✦'; position: absolute; left: 4px; color: var(--gold-2); }
.muestra { position: relative; border-radius: 18px; border: 1px solid var(--border); background: var(--surface-2); padding: 18px; overflow: hidden; box-shadow: var(--shadow); }
.muestra::after { content: 'MUESTRA'; position: absolute; top: 18px; right: -34px; transform: rotate(35deg); background: var(--grad-gold); color: #2b1d0a; font-weight: 800; font-size: .7rem; letter-spacing: 2px; padding: 4px 40px; }
.muestra .falso { pointer-events: none; user-select: none; }
.pill-pedido { display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--gold); background: var(--gold-soft); padding: 5px 12px; border-radius: 99px; }

/* Mensaje "a pedido" dentro de otras pantallas */
.boton-pedido { display: inline-flex; align-items: center; gap: 8px; border: 1px dashed var(--gold-2); color: var(--gold); background: var(--gold-soft); border-radius: 12px; padding: 9px 14px; font-weight: 700; font-size: .85rem; cursor: pointer; font-family: inherit; }

/* ---------------------------------------------------------------------
   Login
   --------------------------------------------------------------------- */
.login { position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; padding: 30px 16px; }
.login-caja { width: min(920px, 100%); display: grid; grid-template-columns: 1fr 1fr; background: var(--surface); border: 1px solid var(--border); border-radius: 26px; box-shadow: var(--shadow-lg); overflow: hidden; }
.login-arte { background: var(--grad); color: #fff; padding: 44px 38px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-arte::before { content: ''; position: absolute; width: 340px; height: 340px; border-radius: 50%; background: rgba(255, 255, 255, .12); right: -120px; top: -100px; }
.login-arte h1 { font-family: var(--font-titulo); font-size: 2.6rem; margin: 18px 0 8px; position: relative; }
.login-arte p { opacity: .92; position: relative; }
.login-arte .lista { list-style: none; padding: 0; margin: 22px 0 0; position: relative; }
.login-arte .lista li { padding: 6px 0; font-weight: 500; }
.login-form { padding: 44px 38px; }
.login-form h2 { font-family: var(--font-titulo); font-size: 1.8rem; margin: 0 0 4px; }
.demo-usuarios { margin-top: 22px; padding: 14px; border-radius: 14px; background: var(--gold-soft); font-size: .84rem; }
.demo-usuarios b { color: var(--gold); }
.demo-usuarios button { margin: 6px 6px 0 0; }
.error-login { background: var(--bad-soft); color: var(--bad); padding: 10px 12px; border-radius: 10px; font-size: .88rem; margin-bottom: 14px; }

/* ---------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-2-1 { grid-template-columns: 1fr; }
  .pedido-hero { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .lateral { position: fixed; left: 0; top: 0; z-index: 90; width: 270px; transform: translateX(-105%); transition: transform .3s ease; box-shadow: var(--shadow-lg); background: var(--surface); }
  .lateral.abierto { transform: none; }
  .burger { display: block; }
  .barra { padding: 12px 16px; }
  .barra h1 { font-size: 1.25rem; }
  .barra .fecha-hoy { display: none; }
  .contenido { padding: 16px 16px 50px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .login-caja { grid-template-columns: 1fr; }
  .login-arte { padding: 30px 26px; }
  .login-arte .lista { display: none; }
  .login-form { padding: 30px 26px; }
  .propuesta .linea-p { grid-template-columns: 104px 1fr; }
  .hbar { grid-template-columns: 100px 1fr auto; }
  .modal-fondo { padding: 12px 8px; }
}
@media (max-width: 520px) {
  .g4 { grid-template-columns: 1fr; }
  .servicios-elegidos .se { flex-wrap: wrap; }
  .servicios-elegidos .se select { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .cielo, .lateral, .barra, .no-imprimir { display: none !important; }
  .app { display: block; }
  body { background: #fff; color: #000; }
}

@media (max-width: 860px) { .ocultar-movil { display: none; } }
