:root {
  --bg: #0B0709;
  --surface: #160b10;
  --surface-2: #211017;
  --wine: #7A1128;
  --wine-deep: #4A0E1C;
  --red: #E8505B;
  --chrome: #FF8A92;
  --text: #F6F1EC;
  --muted: #b9a9ad;
  --line: rgba(246, 241, 236, .10);
  --ok: #6fcf9f;
  --warn: #f0b95f;
  --bad: #ff6b76;
  --radius: 14px;
  --serif: 'DM Serif Display', Georgia, serif;
  --script: 'Pinyon Script', cursive;
  --sans: 'Inter', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 15px; line-height: 1.5; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.center { justify-content: center; }

/* Logo: serif pesada + script (juego tipografico) */
.logo { font-size: 26px; line-height: 1; white-space: nowrap; }
.logo b { font-family: var(--serif); font-weight: 400; letter-spacing: .5px; }
.logo i { font-family: var(--script); font-style: normal; color: var(--red); font-size: 1.25em; margin-left: 2px; }
.logo.big { font-size: 56px; text-align: center; margin-bottom: 6px; }
.script { font-family: var(--script); color: var(--chrome); font-size: 26px; display: block; line-height: 1; }

/* Pantallas con telon */
.screen { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.curtain {
  --fondo: url(../img/fondo/telon-a.jpg);
  background-color: #2a0610;
  background-image:
    radial-gradient(ellipse at 50% 46%, rgba(0, 0, 0, .10) 0%, rgba(0, 0, 0, .55) 80%),   /* oscurece los bordes para que el recuadro se lea */
    var(--fondo);
  background-size: cover; background-position: center; background-repeat: no-repeat; background-attachment: fixed;
  position: relative; isolation: isolate; overflow: hidden;
}
/* veladura vinotinto sobre la foto */
.curtain::before {
  content: ''; position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background: linear-gradient(180deg, rgba(96, 10, 34, .62), rgba(58, 6, 22, .74));
}
/* destello redondo en el centro: encima de la veladura y debajo del recuadro */
.curtain::after {
  content: ''; position: absolute; left: 50%; top: 50%; z-index: -1; pointer-events: none;
  width: min(1100px, 140vw); aspect-ratio: 1; border-radius: 50%; transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 196, 202, .80) 0%, rgba(250, 120, 134, .55) 16%, rgba(236, 84, 98, .30) 34%, rgba(232, 80, 91, .12) 52%, transparent 70%);
  mix-blend-mode: screen; animation: destello 5s ease-in-out infinite;
}
@keyframes destello { 0%, 100% { opacity: .78; transform: translate(-50%, -50%) scale(.96); } 50% { opacity: 1; transform: translate(-50%, -50%) scale(1.04); } }
@media (prefers-reduced-motion: reduce) { .curtain::after { animation: none; } }
.curtain > * { position: relative; z-index: 1; }
.gate-card {
  width: min(440px, 100%); background: rgba(11, 7, 9, .88); border: 1px solid var(--line);
  border-radius: 22px; padding: 32px 28px; display: grid; gap: 14px; backdrop-filter: blur(6px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
.gate-title { font-family: var(--serif); font-size: 24px; text-align: center; margin: 0; }
.gate-card p { margin: 0; text-align: center; }

/* Botones e inputs */
.btn { border: 1px solid var(--line); background: var(--surface-2); color: var(--text); padding: 9px 16px; border-radius: 999px; cursor: pointer; font: inherit; font-weight: 500; transition: .15s; display: inline-flex; gap: 6px; align-items: center; }
.btn:hover { border-color: var(--red); }
.btn.primary { background: linear-gradient(135deg, var(--wine), var(--red)); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.12); }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 12px; font-size: 13px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; filter: none; }
label { display: grid; gap: 5px; font-size: 13px; color: var(--muted); }
input, select, textarea {
  background: #0f0709; color: var(--text); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font: inherit; width: 100%;
}
input:focus, select:focus { outline: 2px solid var(--red); outline-offset: 1px; }
select option { background: #1a0b10; }

/* Layout */
#app { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 22px 16px; display: flex; flex-direction: column; gap: 26px; position: sticky; top: 0; height: 100vh; }
.side nav { display: grid; gap: 4px; }
.side nav a { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; color: var(--muted); }
.side nav a:hover { background: var(--surface-2); color: var(--text); }
.side nav a.on { background: linear-gradient(90deg, var(--wine-deep), transparent); color: var(--text); box-shadow: inset 3px 0 var(--red); }
.side nav em { background: var(--red); color: #fff; font-style: normal; font-size: 11px; padding: 1px 7px; border-radius: 99px; margin-left: 6px; }
.side-foot { margin-top: auto; display: grid; gap: 8px; }
.main { padding: 26px 32px 90px; min-width: 0; }
.top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.top h1 { font-size: 40px; line-height: 1.05; }
.view { display: grid; gap: 18px; }

/* Tarjetas */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.card {
  background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; display: grid; gap: 8px; align-content: start;
}
.card.click { cursor: pointer; transition: .15s; }
.card.click:hover { border-color: var(--red); transform: translateY(-2px); }
.card h3 { font-size: 21px; }
.card .meta { display: flex; gap: 6px; flex-wrap: wrap; }
.day { font-family: var(--serif); font-size: 22px; text-transform: capitalize; margin-top: 8px; display: flex; gap: 10px; align-items: baseline; }
.day small { font-family: var(--sans); color: var(--muted); font-size: 12px; }
.price { font-family: var(--serif); font-size: 22px; color: var(--chrome); }

/* Etiquetas */
.tag { font-size: 11.5px; padding: 2px 9px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.tag.ok { color: var(--ok); border-color: rgba(111, 207, 159, .4); }
.tag.warn { color: var(--warn); border-color: rgba(240, 185, 95, .4); }
.tag.bad { color: var(--bad); border-color: rgba(255, 107, 118, .45); }
.tag.wine { color: var(--chrome); border-color: rgba(255, 138, 146, .4); }
.stars { color: var(--warn); letter-spacing: 1px; font-size: 13px; }

.msg { font-size: 13.5px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); margin: 0; }
.msg.bad { color: var(--bad); border-color: rgba(255, 107, 118, .45); background: rgba(255, 107, 118, .07); }
.msg.warn { color: var(--warn); border-color: rgba(240, 185, 95, .4); background: rgba(240, 185, 95, .06); }
.msg.ok { color: var(--ok); border-color: rgba(111, 207, 159, .4); background: rgba(111, 207, 159, .06); }

/* Filtros y tablas */
.filters { display: flex; gap: 10px; flex-wrap: wrap; }
.filters > * { width: auto; min-width: 150px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-weight: 500; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; background: var(--surface); }
tr:last-child td { border-bottom: 0; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; font-size: 14px; }
.kv span { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .72); display: grid; place-items: center; padding: 16px; z-index: 50; overflow-y: auto; }
.modal-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; width: min(640px, 100%); max-height: 92vh; overflow-y: auto; padding: 24px; display: grid; gap: 14px; }
.modal-card h2 { font-size: 28px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.x { background: none; border: 0; color: var(--muted); font-size: 24px; cursor: pointer; }
.stack { display: grid; gap: 8px; }

/* Agente (placeholder Fase 4) */
.orb { position: fixed; right: 22px; bottom: 22px; width: 58px; height: 58px; border-radius: 50%; border: 0; cursor: pointer; z-index: 20;
  background: radial-gradient(circle at 30% 30%, #ffb3b8, var(--red) 45%, var(--wine) 100%); box-shadow: 0 0 28px rgba(232, 80, 91, .55); animation: pulse 3s ease-in-out infinite; }
.orb span { display: block; width: 100%; height: 100%; border-radius: 50%; }
@keyframes pulse { 50% { transform: scale(1.07); box-shadow: 0 0 44px rgba(232, 80, 91, .8); } }
.agent { position: fixed; right: 22px; bottom: 96px; width: min(410px, calc(100vw - 44px)); height: min(580px, calc(100vh - 130px)); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; z-index: 20; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); }
.agent[hidden] { display: none; }
.agent-head { display: flex; justify-content: space-between; align-items: center; font-family: var(--serif); font-size: 20px; }
.agent p { margin: 0; }

.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: var(--wine); color: #fff; padding: 10px 18px; border-radius: 999px; z-index: 60; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.toast.bad { background: #7a1620; }

/* Telefono: la barra lateral pasa abajo */
@media (max-width: 800px) {
  #app { grid-template-columns: 1fr; }
  .side { position: fixed; inset: auto 0 0 0; height: auto; flex-direction: row; padding: 6px; z-index: 30; border-right: 0; border-top: 1px solid var(--line); }
  .side .logo, .side-foot { display: none; }
  .side nav { grid-auto-flow: column; width: 100%; grid-auto-columns: 1fr; }
  .side nav a { flex-direction: column; gap: 0; font-size: 11px; text-align: center; padding: 6px 2px; }
  .side nav a.on { box-shadow: inset 0 3px var(--red); background: var(--surface-2); }
  .main { padding: 18px 16px 110px; }
  .top h1 { font-size: 32px; }
  .orb { bottom: 78px; right: 14px; width: 50px; height: 50px; }
  .agent { bottom: 140px; right: 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .logo.big { font-size: 44px; }
}

/* ---------------- Calendario ---------------- */
.cal-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cal-title { font-size: 30px; flex: 1; text-align: center; min-width: 180px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.seg button { background: transparent; border: 0; color: var(--muted); padding: 7px 16px; font: inherit; cursor: pointer; }
.seg button.on { background: linear-gradient(135deg, var(--wine), var(--red)); color: #fff; }

.plus { background: none; border: 1px dashed rgba(246, 241, 236, .3); color: var(--text); width: 26px; height: 26px; border-radius: 8px; font-size: 18px; line-height: 1; cursor: pointer; opacity: .28; transition: .15s; padding: 0; flex: none; }
.plus:hover { opacity: 1; background: var(--wine); border-color: var(--red); }

.month { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.dow { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--surface-2); }
.dow span { padding: 8px; text-align: center; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.cells { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cell { min-height: 118px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.cell:nth-child(7n + 1) { border-left: 0; }
.cell.otro { opacity: .42; }
.cell.hoy { background: rgba(232, 80, 91, .08); box-shadow: inset 0 0 0 1px var(--red); }
.cell:hover .plus, .wday:hover .plus { opacity: .85; }
.cell-h { display: flex; justify-content: space-between; align-items: center; }
.num { background: none; border: 0; color: var(--text); font: inherit; font-weight: 500; cursor: pointer; border-radius: 8px; padding: 2px 7px; }
.num:hover { background: var(--surface-2); }
.hoy .num { background: var(--red); color: #fff; }

.chip { display: flex; gap: 5px; align-items: center; width: 100%; text-align: left; background: var(--surface-2); border: 0; border-left: 3px solid var(--wine); border-radius: 6px; color: var(--text); padding: 3px 6px; font: inherit; font-size: 12px; cursor: pointer; overflow: hidden; }
.chip b { font-weight: 600; color: var(--chrome); flex: none; }
.chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip:hover { background: var(--wine-deep); }
.chip.noc { border-left-color: var(--chrome); }
.chip.warn { border-left-color: var(--wine); }   /* los avisos ya no se pintan de amarillo */
.chip.bad { border-left-color: var(--bad); background: rgba(255, 107, 118, .12); }
.mas { background: none; border: 0; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; text-align: left; padding: 2px 6px; }
.mas:hover { color: var(--text); }

.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; align-items: start; }
.wday { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; display: grid; gap: 8px; align-content: start; min-height: 220px; }
.wday.hoy { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.wday header { display: flex; justify-content: space-between; align-items: center; }
.wday header small { display: block; color: var(--muted); text-transform: uppercase; font-size: 11px; letter-spacing: .08em; }
.wday header b { font-family: var(--serif); font-weight: 400; font-size: 26px; line-height: 1; }
.wcard { width: 100%; min-width: 0; overflow: hidden; text-align: left; background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); border-left: 3px solid var(--wine); border-radius: 10px; color: var(--text); padding: 9px 10px; font: inherit; cursor: pointer; display: grid; gap: 3px; }
.wcard:hover { border-color: var(--red); }
.wcard.warn { border-left-color: var(--wine); }
.wcard.bad { border-left-color: var(--bad); }
.wtime { font-size: 12px; color: var(--chrome); font-weight: 600; }
.wset { font-family: var(--serif); font-size: 17px; line-height: 1.15; }
.wnames { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.wcard .meta { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.wprice { font-family: var(--serif); color: var(--chrome); font-size: 16px; }
.vacio { color: var(--muted); font-size: 12.5px; text-align: center; margin: 14px 0; opacity: .6; }

@media (max-width: 1100px) { .week { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 800px) {
  .cell { min-height: 74px; padding: 3px; overflow: hidden; }
  .cell .plus { width: 19px; height: 19px; font-size: 14px; border-radius: 6px; }
  .cell .num { padding: 2px 3px; }
  .chip span { display: none; }
  .chip { justify-content: center; padding: 2px; }
  .cal-title { font-size: 24px; order: -1; flex-basis: 100%; }
  .week { grid-template-columns: 1fr; }
}

/* ---------------- Fotos / avatares ---------------- */
.avatar { --c1: #7A1128; --c2: #E8505B; position: relative; flex: none; display: grid; place-items: center; overflow: hidden; color: #fff; font-family: var(--serif); background: linear-gradient(135deg, var(--c1), var(--c2)); }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 34px; height: 34px; border-radius: 50%; font-size: 13px; }
.avatar.md { width: 62px; height: 62px; border-radius: 16px; font-size: 22px; }
.avatar.lg { width: 104px; height: 104px; border-radius: 22px; font-size: 36px; }
.tcard-h { display: flex; gap: 12px; align-items: center; }
.tcard-t { display: grid; gap: 1px; min-width: 0; }
.tcard-t h3 { overflow-wrap: anywhere; }

.field { display: grid; gap: 5px; font-size: 13px; color: var(--muted); }
.picker { position: relative; }
.picker-btn { width: 100%; display: flex; gap: 10px; align-items: center; text-align: left; background: #0f0709; color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; font: inherit; cursor: pointer; min-height: 48px; }
.picker-btn:hover { border-color: var(--red); }
.pk-name { display: grid; line-height: 1.2; min-width: 0; flex: 1; }
.pk-name b { font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pk-name small { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.caret { color: var(--muted); margin-left: auto; }
.picker-list { position: absolute; z-index: 10; top: calc(100% + 4px); left: 0; right: 0; max-height: 300px; overflow-y: auto; background: var(--surface-2); border: 1px solid var(--red); border-radius: 12px; padding: 6px; display: grid; gap: 2px; box-shadow: 0 18px 40px rgba(0, 0, 0, .6); }
.picker-list[hidden] { display: none; }
.picker-q { margin-bottom: 4px; }
.picker-item { display: flex; gap: 10px; align-items: center; text-align: left; background: transparent; border: 0; color: var(--text); border-radius: 8px; padding: 6px 8px; font: inherit; cursor: pointer; width: 100%; }
.picker-item:hover { background: var(--wine-deep); }
.picker-item[hidden] { display: none; }

/* ---------------- Cuadricula de talento (foto grande) ---------------- */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.pcard { position: relative; display: block; aspect-ratio: 3 / 4; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); transition: .2s; }
.pcard:hover { transform: translateY(-3px); border-color: var(--red); box-shadow: 0 14px 34px rgba(0, 0, 0, .5); }
.avatar.cover { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 0; font-size: 88px; }
.pcard::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(11, 7, 9, .96) 0%, rgba(11, 7, 9, .72) 26%, rgba(11, 7, 9, 0) 60%); pointer-events: none; }
.pcard-info { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 14px 15px 16px; display: grid; gap: 3px; }
.pcard-info h3 { font-size: 23px; line-height: 1.1; }
.pcard-info .stars small { color: var(--muted); font-size: 12px; letter-spacing: 0; }
.pcard-meta { color: #e8dcdf; font-size: 13px; }

/* ---------------- Subpaginas de perfil ---------------- */
.profile { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 24px; align-items: start; }
.portrait { position: sticky; top: 20px; aspect-ratio: 3 / 4; border-radius: 22px; overflow: hidden; border: 1px solid var(--line); }
.portrait .avatar.cover { font-size: 110px; }
.rlist { display: grid; gap: 6px; }
.rrow { display: flex; gap: 12px; align-items: center; justify-content: space-between; text-align: left; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--wine); border-radius: 10px; color: var(--text); padding: 9px 12px; font: inherit; cursor: pointer; }
.rrow:hover { border-color: var(--red); }
.rrow.warn { border-left-color: var(--wine); }
.rrow.bad { border-left-color: var(--bad); }
.rrow b { font-weight: 500; }
.rrow span { color: var(--muted); flex: 1; }
.rrow em { font-style: normal; font-family: var(--serif); color: var(--chrome); }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--surface-2); }

@media (max-width: 800px) {
  .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pcard-info h3 { font-size: 18px; }
  .pcard-meta { font-size: 11.5px; }
  .avatar.cover { font-size: 60px; }
  .profile { grid-template-columns: 1fr; }
  .portrait { position: relative; top: 0; max-width: 240px; }
}

.pcard .avatar.cover { place-items: start center; padding-top: 18%; }

/* ---------------- Nuevo rodaje: pop-up ancho con fotos grandes ---------------- */
.modal-card.wide { width: min(1120px, 100%); }
.nr-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.slots { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.slot { position: relative; display: grid; gap: 6px; align-content: start; font-size: 13px; color: var(--muted); }
.slot-card { position: relative; width: 100%; aspect-ratio: 3 / 4; border-radius: 18px; overflow: hidden; border: 2px solid var(--line); background: var(--surface-2); padding: 0; cursor: pointer; color: var(--text); text-align: left; font: inherit; display: block; transition: .15s; }
.slot-card:hover { border-color: var(--red); }
.slot-card .avatar.cover { font-size: 70px; }
.slot-card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(11, 7, 9, .96) 0%, rgba(11, 7, 9, .7) 28%, rgba(11, 7, 9, 0) 58%); pointer-events: none; }
.slot-info { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 12px 14px 14px; display: grid; gap: 2px; }
.slot-info h3 { font-size: 22px; line-height: 1.1; }
.slot-meta { color: #e8dcdf; font-size: 12.5px; }
.slot-change { position: absolute; top: 10px; right: 10px; z-index: 2; background: rgba(11, 7, 9, .7); border: 1px solid var(--line); border-radius: 99px; padding: 3px 10px; font-size: 12px; color: var(--text); }
.slot-empty { display: grid; place-items: center; height: 100%; color: var(--muted); }
.slot-flag { position: absolute; top: 10px; left: 10px; z-index: 2; background: var(--warn); color: #1a0b10; border-radius: 99px; padding: 3px 10px; font-size: 12px; font-weight: 600; }
.slot-flag.bad { background: var(--bad); color: #fff; }
.slot.err .slot-card { border-color: var(--bad); box-shadow: 0 0 0 4px rgba(255, 107, 118, .28), 0 0 28px rgba(255, 107, 118, .25); }
.slot.err .lbl { color: var(--bad); }
.slot.warn .slot-card { border-color: var(--warn); box-shadow: 0 0 0 3px rgba(240, 185, 95, .22); }
.slot-list { top: 26px; max-height: min(420px, 70vh); }
.picker-item.incompat { background: rgba(255, 107, 118, .12); box-shadow: inset 3px 0 var(--bad); }
.picker-item.incompat .pk-flag, .picker-item.incompat .pk-name b { color: var(--bad); }
.picker-item.dup { opacity: .45; }
.pk-flag { margin-left: auto; font-size: 11.5px; color: var(--muted); white-space: nowrap; }

.nr-side { display: grid; gap: 14px; align-content: start; }
.nr-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.nr-fields .span3 { grid-column: 1 / -1; }
.nr-fields label.err { color: var(--bad); }
.nr-fields label.err input, .nr-fields label.err select { border-color: var(--bad); background: rgba(255, 107, 118, .09); box-shadow: 0 0 0 3px rgba(255, 107, 118, .2); }
.nr-fields label.warn input, .nr-fields label.warn select { border-color: var(--warn); }

@media (max-width: 900px) {
  .nr-grid { grid-template-columns: 1fr; }
  .slot-info h3 { font-size: 17px; }
  .slot-card .avatar.cover { font-size: 46px; }
}

/* ---------------- Detalle de rodaje reservado ---------------- */
.kv-people { grid-template-columns: 1fr auto; align-items: center; }
.linkbtn { display: inline-flex; gap: 8px; align-items: center; justify-content: flex-end; background: none; border: 0; color: var(--text); font: inherit; cursor: pointer; padding: 2px 0; }
.linkbtn b { font-weight: 500; }
.linkbtn:hover b { color: var(--chrome); text-decoration: underline; }
.linkbtn .avatar.sm { width: 28px; height: 28px; font-size: 11px; }

/* ---------------- Equipo de grabacion ---------------- */
.eq { display: grid; gap: 8px; background: rgba(255, 255, 255, .02); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.eq h3 { font-size: 19px; }
.eq-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.eq-row.err { border-color: var(--bad); background: rgba(255, 107, 118, .08); box-shadow: 0 0 0 3px rgba(255, 107, 118, .15); }
.eq-name { display: grid; gap: 4px; min-width: 0; }
.eq-name .tag { justify-self: start; }
.eq-name select { padding: 6px 8px; font-size: 13.5px; }
.eq-qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.eq-qty button { background: var(--surface-2); border: 0; color: var(--text); width: 28px; height: 32px; cursor: pointer; font-size: 16px; }
.eq-qty button:hover { background: var(--wine-deep); }
.eq-n { width: 46px; text-align: center; border: 0; border-radius: 0; padding: 6px 2px; -moz-appearance: textfield; }
.eq-n::-webkit-outer-spin-button, .eq-n::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.eq-disp { font-size: 12.5px; color: var(--muted); }
.eq-row.err .eq-disp { color: var(--bad); font-weight: 600; }
.eq-cat { display: grid; gap: 6px; max-height: 260px; overflow-y: auto; padding: 8px; border: 1px dashed rgba(246, 241, 236, .25); border-radius: 12px; }
.eq-cat-item { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 8px; }
.eq-cat-item:hover { background: var(--surface-2); }
.eq-cat-item small { display: block; color: var(--muted); font-size: 11.5px; }
.eq-cat-item.none { opacity: .5; }
.eq-badge { font-size: 12px; color: var(--ok); border: 1px solid rgba(111, 207, 159, .4); border-radius: 99px; padding: 2px 10px; white-space: nowrap; }
.eq-cat-item.none .eq-badge { color: var(--bad); border-color: rgba(255, 107, 118, .45); }
.eq-view { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 14px; }
.eq-view li b { color: var(--chrome); font-weight: 600; }
.eq-view small { color: var(--muted); margin-left: 6px; }


.eq-row .eq-disp { grid-column: 1 / -1; order: 5; margin-top: -2px; }

/* ---------------- Nuevo rodaje: 3 bloques + barra inferior fija ---------------- */
.modal-card.wide { width: min(1180px, 100%); }
.nr3 { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .68fr) minmax(0, 1.1fr); gap: 22px 26px; align-items: start; }
.nr-col { min-width: 0; }
.nr-h { margin: 0 0 10px; display: flex; gap: 8px; align-items: center; font-family: var(--sans); font-weight: 600; font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.nr-h span { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--wine); color: #fff; font-size: 11px; letter-spacing: 0; }
.nr3 .slots { gap: 12px; }
.nr3 .slot-info h3 { font-size: 19px; }
.nr3 .slot-meta { font-size: 11.5px; }
.nr3 .slot-card .avatar.cover { font-size: 56px; }
.nr3 .slot .lbl { display: none; }
.nr3 .nr-fields { grid-template-columns: 1fr 1fr; }
.nr3 .eq { padding: 10px; }
.nr3 .eq > .row h3 { font-size: 17px; }
.nr-foot { grid-column: 1 / -1; position: sticky; bottom: -24px; z-index: 5; margin: 0 -24px -24px; padding: 14px 24px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center; background: linear-gradient(180deg, rgba(22, 11, 16, .92), var(--surface) 30%); border-top: 1px solid var(--line); backdrop-filter: blur(6px); border-radius: 0 0 20px 20px; }
.nr-foot #resultado { max-height: 104px; overflow-y: auto; gap: 6px; }
.nr-foot .msg { padding: 6px 12px; font-size: 13px; }
.nr-actions { display: flex; gap: 12px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.nr-cost { display: grid; text-align: right; margin-right: 6px; line-height: 1.1; }
.nr-cost small { color: var(--muted); font-size: 11.5px; }
.nr-cost .price { font-size: 26px; }

@media (max-width: 1100px) {
  .nr3 { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
  .nr-gear { grid-column: 1 / -1; }
}
@media (max-width: 800px) {
  .nr3 { grid-template-columns: 1fr; }
  .nr-foot { grid-template-columns: 1fr; position: sticky; }
  .nr-actions { justify-content: space-between; }
  .nr-cost { text-align: left; }
}
.nr3 .slot.err .slot-change, .nr3 .slot.warn .slot-change { display: none; }
.nr3 .slot-flag { max-width: calc(100% - 20px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------- Alertas ---------------- */
.alert-sum { display: flex; gap: 10px; flex-wrap: wrap; }
.sum { border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 13.5px; color: var(--muted); background: var(--surface); }
.sum b { color: var(--text); font-size: 16px; margin-right: 4px; }
.sum.bad { border-color: rgba(255, 107, 118, .5); color: var(--bad); }
.sum.bad b { color: var(--bad); }
.sum.warn { border-color: rgba(240, 185, 95, .5); color: var(--warn); }
.sum.warn b { color: var(--warn); }
.a-title { font-size: 26px; margin-top: 10px; }
.a-title small { font-family: var(--sans); font-size: 13px; }
.agrupo { display: grid; gap: 10px; }
.agrupo h3, .agrupo summary { font-size: 20px; display: flex; gap: 10px; align-items: center; cursor: default; }
.agrupo summary { cursor: pointer; font-family: var(--serif); }
.agrupo em { font-style: normal; font-family: var(--sans); font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 1px 9px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.bad { background: var(--bad); box-shadow: 0 0 10px var(--bad); }
.dot.warn { background: var(--warn); }
.dot.ok { background: var(--ok); }
.pgrid-alert { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.prueba { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-left: 4px solid var(--ok); border-radius: var(--radius); background: linear-gradient(180deg, var(--surface-2), var(--surface)); }
.prueba.vencida { border-left-color: var(--bad); background: linear-gradient(180deg, rgba(255, 107, 118, .09), var(--surface)); }
.prueba.proxima { border-left-color: var(--warn); background: linear-gradient(180deg, rgba(240, 185, 95, .07), var(--surface)); }
.prueba-who { display: flex; gap: 12px; align-items: center; }
.prueba-who b { display: block; font-family: var(--serif); font-weight: 400; font-size: 20px; line-height: 1.1; }
.prueba-who small { color: var(--muted); }
.prueba-who .avatar.md { width: 52px; height: 52px; font-size: 18px; }
.prueba-badge { display: inline-block; font-weight: 600; font-size: 13.5px; padding: 3px 12px; border-radius: 99px; margin-bottom: 4px; }
.prueba-badge.vencida { background: var(--bad); color: #fff; }
.prueba-badge.proxima { background: var(--warn); color: #1a0b10; }
.prueba-rod { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.prueba-rod small { width: 100%; color: var(--muted); font-size: 12px; }
.chip-r { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; color: var(--text); font: inherit; font-size: 12.5px; padding: 3px 10px; cursor: pointer; }
.chip-r::first-letter { text-transform: uppercase; }
.chip-r:hover { border-color: var(--red); }
.alist { display: grid; gap: 8px; }
.arow { display: grid; grid-template-columns: 124px 1fr; gap: 14px; align-items: center; text-align: left; width: 100%; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--warn); border-radius: 12px; color: var(--text); padding: 10px 14px; font: inherit; cursor: pointer; }
.arow.bad { border-left-color: var(--bad); background: linear-gradient(90deg, rgba(255, 107, 118, .07), var(--surface) 40%); }
.arow:hover { border-color: var(--red); }
.arow-when { display: grid; line-height: 1.15; }
.arow-when b { font-weight: 500; white-space: nowrap; }
.arow-when b::first-letter { text-transform: uppercase; }
.arow-when span { font-family: var(--serif); font-size: 22px; color: var(--chrome); }
.arow-body p { margin: 4px 0 0; font-size: 14px; }
@media (max-width: 800px) { .pgrid-alert { grid-template-columns: 1fr; } .arow { grid-template-columns: 70px 1fr; } }

/* ---------------- Fotos de sets ---------------- */
.simg { position: relative; aspect-ratio: 3 / 2; overflow: hidden; background: linear-gradient(135deg, var(--wine-deep), var(--wine)); }
.simg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.simg::after { content: ''; position: absolute; inset: 0; z-index: 1; background: linear-gradient(to top, rgba(11, 7, 9, .94) 0%, rgba(11, 7, 9, .5) 32%, rgba(11, 7, 9, 0) 62%); pointer-events: none; }
.sgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.scard { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--surface); display: grid; transition: .2s; }
.scard:hover { border-color: var(--red); transform: translateY(-3px); box-shadow: 0 14px 34px rgba(0, 0, 0, .5); }
.simg-wrap { position: relative; }
.scard-info { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 14px 16px; display: grid; gap: 6px; }
.scard-info h3 { font-size: 24px; line-height: 1.1; }
.scard-foot { padding: 12px 16px 14px; display: grid; gap: 4px; }
.set-banner, .set-preview { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.set-banner .simg, .set-preview .simg { aspect-ratio: 3 / 1; }
.set-preview { margin-top: 6px; }
.set-banner-info { position: absolute; left: 14px; bottom: 10px; z-index: 2; display: flex; gap: 10px; align-items: baseline; }
.set-banner-info b { font-family: var(--serif); font-weight: 400; font-size: 22px; color: var(--text); }
.set-banner-info span { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 1px 9px; }
@media (max-width: 800px) { .sgrid { grid-template-columns: 1fr; } }

.nr3 .set-preview .simg { aspect-ratio: 5 / 2; }
.nr3 .set-preview .set-banner-info b { font-size: 26px; }

/* ---------------- Iconos (SVG) ---------------- */
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: color .15s; }
.side nav a:hover .ico { color: var(--chrome); }
.side nav a.on .ico { color: var(--red); }
.btn .ico { width: 16px; height: 16px; }
@media (max-width: 800px) { .side nav a .ico { width: 22px; height: 22px; } }

/* ---------------- Mi agenda (cuentas por rol) ---------------- */
.agrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-bottom: 8px; }
.mcard { text-align: left; padding: 0; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; display: grid; transition: .2s; }
.mcard:hover { border-color: var(--red); transform: translateY(-3px); }
.mcard.hoy { border-color: var(--red); box-shadow: 0 0 0 1px var(--red), 0 10px 28px rgba(232, 80, 91, .18); }
.mc-img { position: relative; }
.mc-img .simg { aspect-ratio: 16 / 7; }
.mc-info { position: absolute; left: 14px; right: 14px; bottom: 10px; z-index: 2; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.mc-info b { font-family: var(--serif); font-weight: 400; font-size: 21px; }
.mc-info span { font-family: var(--serif); color: var(--chrome); font-size: 20px; white-space: nowrap; }
.mc-foot { padding: 10px 14px 12px; display: grid; gap: 6px; }
.mc-people { display: flex; flex-wrap: wrap; gap: 8px; }
.mp-chip { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; }
.mp-chip .avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.mpeople { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.mp { display: flex; gap: 12px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.mp b { display: block; font-weight: 500; }
.mp small { color: var(--muted); }
.mp .avatar.md { width: 48px; height: 48px; font-size: 17px; }

/* ---- Avisos */
#aviso-count { font-style: normal; background: var(--red); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 11px; margin-left: 6px; }
.aviso { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--warn); border-radius: 12px; padding: 10px 14px; display: grid; gap: 6px; }
.aviso.t-SALUD, .aviso.t-AUSENCIA { border-left-color: var(--bad); }
.aviso.nuevo { background: linear-gradient(90deg, rgba(210, 40, 70, .12), var(--surface) 50%); border-color: var(--red); }
.aviso p { margin: 0; font-size: 14px; }
.aviso-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.avisos-panel, .avisos-rod, .aviso-box { display: grid; gap: 10px; margin: 14px 0; }
.avisos-panel h3, .avisos-rod h3, .aviso-box h3 { margin: 0; }
.avisos-panel h3 em, .avisos-rod h3 em { font-style: normal; }
.aviso-form { display: grid; grid-template-columns: minmax(170px, 220px) 1fr auto; gap: 8px; align-items: start; }
.aviso-form textarea { resize: vertical; min-height: 42px; }
.alist { display: grid; gap: 8px; }
@media (max-width: 800px) { .aviso-form { grid-template-columns: 1fr; } }

/* ---- Perfil y documentos */
#doc-count, #perfil-badge { font-style: normal; background: var(--red); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 11px; margin-left: 6px; }
.who-line { font-family: var(--serif); font-size: 24px; font-weight: 500; }
.fstack { display: grid; gap: 12px; }
.fgrid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 700px) { .fgrid2 { grid-template-columns: 1fr; } }
.recordatorio { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); margin-bottom: 14px; }
.recordatorio.info { border-color: rgba(255, 138, 146, .4); }
.recordatorio.warn { border-color: rgba(240, 185, 95, .5); background: rgba(240, 185, 95, .07); color: var(--warn); }
.recordatorio.bad { border-color: rgba(255, 107, 118, .5); background: rgba(255, 107, 118, .08); color: var(--bad); }
.docs-hist { display: grid; gap: 8px; margin-top: 6px; }
.docrow { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.docadm { gap: 10px; }

/* ---- Chat de La Goulue */
.agent-tools { display: flex; gap: 6px; align-items: center; }
.ag-btn { background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 3px 11px; font: inherit; font-size: 12px; cursor: pointer; }
.ag-btn.on { color: #fff; border-color: var(--red); background: rgba(210, 40, 70, .25); }
.ag-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 2px 2px 6px; }
.ag-msg { max-width: 88%; padding: 8px 12px; border-radius: 14px; font-size: 14px; line-height: 1.4; white-space: pre-wrap; word-wrap: break-word; }
.ag-msg.bot { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.ag-msg.yo { align-self: flex-end; background: linear-gradient(135deg, var(--wine), var(--red)); color: #fff; border-bottom-right-radius: 4px; }
.ag-msg.err { align-self: stretch; max-width: 100%; color: var(--bad); border: 1px solid rgba(255, 107, 118, .45); background: rgba(255, 107, 118, .07); border-radius: 10px; }
.ag-msg.pensando { color: var(--muted); font-style: italic; }
.ag-prop { align-self: stretch; border: 1px solid rgba(240, 185, 95, .5); background: rgba(240, 185, 95, .06); border-radius: 12px; padding: 10px 12px; display: grid; gap: 8px; font-size: 13.5px; }
.ag-prop b { color: var(--warn); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.ag-prop.hecha { border-color: rgba(111, 207, 159, .5); background: rgba(111, 207, 159, .06); }
.ag-prop.hecha b { color: var(--ok); }
.ag-form { display: flex; gap: 8px; align-items: center; }
.ag-form input { flex: 1; min-width: 0; }
.ag-mic { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); display: grid; place-items: center; cursor: pointer; }
.ag-mic .ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ag-mic.escuchando { background: var(--red); border-color: var(--red); color: #fff; animation: pulse 1.2s ease-in-out infinite; }
@media (max-width: 700px) { .agent { right: 10px; bottom: 140px; height: min(520px, calc(100vh - 170px)); width: calc(100vw - 20px); } }

/* ---- Produccion y carpetas de archivos */
.prodseg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.prodseg button { background: transparent; border: 0; color: var(--muted); padding: 6px 13px; font: inherit; font-size: 13px; cursor: pointer; }
.prodseg button.on { background: linear-gradient(135deg, var(--wine), var(--red)); color: #fff; }
.prodseg button:not(.on):hover { color: var(--text); }
.prodbox { display: grid; gap: 8px; margin: 12px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.prodbox h3 { margin: 0; }
.prodsum { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.prodsum .sum { cursor: pointer; font: inherit; }
.prodsum .sum.sel { border-color: var(--red); background: rgba(210, 40, 70, .18); }
.fmes, .fdia, .frod { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.fmes { margin-bottom: 10px; }
.fdia, .frod { margin: 8px 12px; background: var(--surface-2); }
.fmes > summary, .fdia > summary, .frod > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 11px 14px; }
.fmes > summary::-webkit-details-marker, .fdia > summary::-webkit-details-marker, .frod > summary::-webkit-details-marker { display: none; }
.fmes > summary b { font-family: var(--serif); font-size: 20px; font-weight: 500; }
.fdia > summary b { font-weight: 500; }
.fmes > summary .ico, .fdia > summary .ico { width: 20px; height: 20px; fill: none; stroke: var(--chrome); stroke-width: 1.6; }
.fcount { margin-left: auto; font-style: normal; font-size: 12px; color: var(--muted); }
.fh { font-family: var(--serif); font-size: 18px; color: var(--chrome); min-width: 46px; }
.fbody { display: grid; gap: 10px; padding: 4px 14px 14px; }
.farchs { display: grid; gap: 6px; }
.farch { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.farch-n { display: grid; gap: 2px; min-width: 0; }
.farch-n b { font-weight: 500; overflow-wrap: anywhere; }
.fup { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.fup label { flex: 1; min-width: 180px; }

/* icono de condon (informativo, no cambia el color del rodaje) */
.ico.condon { width: 15px; height: 15px; flex: none; margin-left: auto; fill: none; stroke: var(--chrome); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.chip .ico.condon { width: 14px; height: 14px; }
.wtime { display: flex; align-items: center; gap: 6px; }
