/* ==========================================================================
   Comedor CLAROS — Sistema de diseño
   Paleta de marca (naranja + gris) · tipografía grande · alto contraste
   Pensado para una usuaria mayor: cómodo, claro y profesional.
   ========================================================================== */

:root {
  --brand:#E9820E; --brand-strong:#BE5D08; --brand-soft:#FBE7CE;
  --ink:#2A2520; --ink-soft:#6B6157; --muted:#8C8378;
  --line:#EBE3D6; --bg:#FBF7F1; --surface:#FFFFFF; --surface-2:#FBF8F2;
  --grey:#9A938B;
  --dorado:#A9781A; --dorado-bg:#F6EACC; --dorado-line:#E4C98A;
  --verde:#2F7D4F; --verde-bg:#E0F0E6; --verde-line:#AEDABF;
  --libre:#476487; --libre-bg:#E7EDF4; --libre-line:#BFD0E2;
  --danger:#B0432C; --danger-soft:#F6E2DC;
  --disabled:#D3CBBE;
  --shadow-sm:0 2px 6px rgba(74,48,12,.08);
  --shadow:0 14px 40px rgba(74,48,12,.13);
  --radius:20px; --radius-sm:12px;
  --font:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}

@media (prefers-color-scheme:dark) {
  :root {
    --brand:#F49A34; --brand-strong:#F49A34; --brand-soft:#3A2A16;
    --ink:#F4ECE0; --ink-soft:#C4B9A9; --muted:#9A8F80;
    --line:#3A3227; --bg:#17130E; --surface:#221C15; --surface-2:#2A2318;
    --dorado:#E6C270; --dorado-bg:#3A2F16; --dorado-line:#5C4A22;
    --verde:#8FD3A6; --verde-bg:#16301F; --verde-line:#2C4E38;
    --libre:#9DBBDD; --libre-bg:#182636; --libre-line:#2E455F;
    --danger:#E68467; --danger-soft:#301A13;
    --disabled:#4A4234;
    --shadow-sm:0 2px 6px rgba(0,0,0,.3);
    --shadow:0 14px 40px rgba(0,0,0,.5);
  }
}
:root[data-theme="light"] {
  --brand:#E9820E; --brand-strong:#BE5D08; --brand-soft:#FBE7CE;
  --ink:#2A2520; --ink-soft:#6B6157; --muted:#8C8378;
  --line:#EBE3D6; --bg:#FBF7F1; --surface:#FFFFFF; --surface-2:#FBF8F2;
  --dorado:#A9781A; --dorado-bg:#F6EACC; --dorado-line:#E4C98A;
  --verde:#2F7D4F; --verde-bg:#E0F0E6; --verde-line:#AEDABF;
  --libre:#476487; --libre-bg:#E7EDF4; --libre-line:#BFD0E2;
  --danger:#B0432C; --danger-soft:#F6E2DC; --disabled:#D3CBBE;
  --shadow-sm:0 2px 6px rgba(74,48,12,.08); --shadow:0 14px 40px rgba(74,48,12,.13);
}
:root[data-theme="dark"] {
  --brand:#F49A34; --brand-strong:#F49A34; --brand-soft:#3A2A16;
  --ink:#F4ECE0; --ink-soft:#C4B9A9; --muted:#9A8F80;
  --line:#3A3227; --bg:#17130E; --surface:#221C15; --surface-2:#2A2318;
  --dorado:#E6C270; --dorado-bg:#3A2F16; --dorado-line:#5C4A22;
  --verde:#8FD3A6; --verde-bg:#16301F; --verde-line:#2C4E38;
  --libre:#9DBBDD; --libre-bg:#182636; --libre-line:#2E455F;
  --danger:#E68467; --danger-soft:#301A13; --disabled:#4A4234;
  --shadow-sm:0 2px 6px rgba(0,0,0,.3); --shadow:0 14px 40px rgba(0,0,0,.5);
}

* { box-sizing:border-box; }
html { -webkit-text-size-adjust:100%; }
body {
  margin:0; font-family:var(--font); font-size:18px; line-height:1.5;
  background:var(--bg); color:var(--ink); -webkit-font-smoothing:antialiased;
}
h1,h2,h3 { text-wrap:balance; letter-spacing:-.01em; }
a { color:var(--brand-strong); }
img { max-width:100%; }

/* ---- Layout general ---- */
.app-main { padding:28px 20px 64px; }
.container { max-width:1000px; margin:0 auto; }

/* ---- Barra superior ---- */
.topbar {
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  padding:12px 20px; background:var(--surface); border-bottom:1px solid var(--line);
  position:sticky; top:0; z-index:10;
}
.brandplate { background:#fff; border-radius:12px; padding:8px 14px; box-shadow:var(--shadow-sm); line-height:0; display:inline-block; }
.brandplate img { height:32px; width:auto; display:block; }
.userchip { display:flex; align-items:center; gap:12px; }
.userchip .who { display:flex; flex-direction:column; line-height:1.15; text-align:right; }
.userchip .who b { font-size:16px; }
.userchip .who span { font-size:13px; color:var(--muted); }
.avatar { width:42px; height:42px; border-radius:50%; background:var(--brand-soft); color:var(--brand-strong);
  display:flex; align-items:center; justify-content:center; font-weight:800; font-size:18px; }
.logout-form { margin:0; }
.textbtn { border:none; background:none; color:var(--brand-strong); font-weight:700; font-size:16px; cursor:pointer; font-family:inherit; padding:8px; }
.textbtn:hover { text-decoration:underline; }

/* ---- Botones ---- */
.btn { border:none; border-radius:14px; padding:16px 22px; font-size:19px; font-weight:800; cursor:pointer;
  font-family:inherit; display:inline-flex; align-items:center; justify-content:center; gap:10px; text-decoration:none; }
.btn-primary { background:var(--brand-strong); color:#fff; box-shadow:0 6px 16px rgba(190,93,8,.26); }
.btn-primary:hover { filter:brightness(1.05); }
.btn-ghost { background:var(--surface-2); color:var(--ink); border:2px solid var(--line); }
.btn-danger { background:var(--danger); color:#fff; }
.btn-block { width:100%; }

/* ---- Formularios ---- */
.field { display:flex; flex-direction:column; gap:8px; }
.field label { font-size:15px; font-weight:700; color:var(--ink); }
.input {
  border:2px solid var(--line); background:var(--surface); border-radius:14px; padding:15px 18px;
  font-size:19px; color:var(--ink); font-family:inherit; width:100%;
}
.input:focus { outline:none; border-color:var(--brand); box-shadow:0 0 0 4px var(--brand-soft); }

/* ---- Avisos ---- */
.alert { border-radius:14px; padding:14px 18px; font-size:17px; font-weight:600; border:1px solid transparent; }
.alert-error { background:var(--danger-soft); color:var(--danger); border-color:var(--danger); }
.alert-info { background:var(--brand-soft); color:var(--brand-strong); border-color:var(--brand); }
.alert-ok { background:var(--verde-bg); color:var(--verde); border-color:var(--verde-line); }

/* ---- Login ---- */
.screen-plain { background:var(--bg); min-height:100vh; display:flex; }
.login-body { position:relative; overflow:hidden; flex:1; display:flex; align-items:center; justify-content:center; padding:40px 20px 90px; }
.login-card { position:relative; z-index:2; background:var(--surface); border:1px solid var(--line);
  border-radius:24px; box-shadow:var(--shadow); padding:34px 28px; width:100%; max-width:440px;
  display:flex; flex-direction:column; gap:20px; }
.login-card .plate { align-self:center; background:#fff; border-radius:16px; padding:14px 20px; box-shadow:var(--shadow-sm); line-height:0; }
.login-card .plate img { height:44px; }
.login-head { text-align:center; display:flex; flex-direction:column; gap:6px; }
.login-head h1 { margin:0; font-size:26px; }
.login-head p { margin:0; color:var(--ink-soft); font-size:17px; }
.login-help { text-align:center; font-size:15px; color:var(--muted); margin:0; }
.wave { position:absolute; left:0; right:0; bottom:-2px; z-index:1; opacity:.5; }

/* ---- Campo de contraseña con ojo ---- */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 52px; }
.pw-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border: none; background: transparent; color: var(--muted);
  cursor: pointer; display: flex; align-items: center; justify-content: center; border-radius: 8px; }
.pw-toggle:hover { color: var(--ink); background: rgba(0, 0, 0, .06); }
.pw-toggle:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

/* ---- Login (diseño "Bloques editorial") ----
   Look propio y comprometido: izquierda cálida clara, derecha oscura elegante.
   Se mantiene idéntico en claro/oscuro a propósito. */
.auth { min-height: 100vh; width: 100%; flex: 1; display: grid; grid-template-columns: 1fr 1fr; }

.auth-left {
  position: relative; overflow: hidden; background: #FBF3E8; color: #2A2520;
  padding: 52px 46px; display: flex; flex-direction: column; align-items: center;
  justify-content: space-between; text-align: center; gap: 24px;
}
.auth-band { position: absolute; left: 0; top: 0; bottom: 0; width: 14px; background: linear-gradient(#F59B32, #BE5D08); }
.auth-brand { background: #fff; border-radius: 18px; padding: 16px 26px; box-shadow: 0 12px 28px rgba(120, 60, 6, .16); line-height: 0; }
.auth-brand img { height: 80px; width: auto; display: block; }
.auth-hero { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.auth-hey { font-size: 17px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: #BE5D08; }
.auth-title { margin: 0; font-size: clamp(46px, 5.6vw, 70px); line-height: 1.02; letter-spacing: -.01em; font-weight: 900; text-transform: uppercase; color: #2A2520; }
.auth-title .ge { color: #2A2520; }
.auth-title .cl { background: linear-gradient(180deg, #F7A63E 0%, #E9820E 45%, #B85708 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: #BE5D08; }
.auth-rule { display: block; width: 72px; height: 4px; border-radius: 99px; background: linear-gradient(90deg, #F7A63E, #BE5D08); }
.auth-sub { margin: 0; font-size: 21px; font-style: italic; line-height: 1.5; color: #6B6157; letter-spacing: .01em; max-width: 26ch; }
.auth-art { width: clamp(140px, 22vh, 188px); height: auto; color: #E9820E; opacity: .85; margin-top: 8px; }
.auth-foot { font-size: 14px; font-weight: 700; letter-spacing: .04em; color: #A06A34; }

.auth-right {
  position: relative; overflow: hidden; padding: 52px 44px;
  background: linear-gradient(160deg, #2A2520, #3A2E22);
  display: flex; align-items: center; justify-content: center;
}
.auth-blob { position: absolute; width: 460px; height: 460px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #F59B32, #B85708); filter: blur(12px); opacity: .35; right: -140px; top: -120px; }
.auth-form { position: relative; z-index: 2; width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 18px; }
.auth-form h2 { margin: 0 0 4px; color: #fff; font-size: 26px; text-align: center; }
.auth-field { display: flex; flex-direction: column; gap: 8px; }
.auth-field label { font-size: 15px; font-weight: 700; color: rgba(255,255,255,.9); }
.auth-input { border: 2px solid transparent; background: rgba(255,255,255,.97); border-radius: 14px;
  padding: 16px 18px; font-size: 19px; color: #2A2520; font-family: inherit; width: 100%; }
.auth-input:focus { outline: none; border-color: #F59B32; box-shadow: 0 0 0 4px rgba(245,155,50,.4); }
.auth-btn { border: none; border-radius: 14px; padding: 18px; font-size: 20px; font-weight: 800;
  background: #BE5D08; color: #fff; cursor: pointer; font-family: inherit; box-shadow: 0 10px 24px rgba(0,0,0,.3); }
.auth-btn:hover { filter: brightness(1.08); }
.auth-help { text-align: center; font-size: 15px; color: rgba(255,255,255,.75); margin: 2px 0 0; }
.auth-alert { background: #FCE9E3; color: #8E2F1B; border: 1px solid #E0876F; border-radius: 12px;
  padding: 12px 16px; font-size: 16px; font-weight: 600; }

@media (max-width: 820px) {
  .auth { grid-template-columns: 1fr; }
  .auth-left { padding: 38px 24px 32px; gap: 18px; justify-content: center; }
  .auth-right { padding: 34px 22px 46px; }
  .auth-title { font-size: 42px; }
  .auth-sub { font-size: 18px; }
  .auth-brand img { height: 60px; }
  .auth-art { width: 128px; }
  .auth-blob { width: 300px; height: 300px; right: -120px; }
}

/* ---- Panel de inicio ---- */
.hello { display:flex; flex-direction:column; gap:4px; margin-bottom:24px; }
.hello h1 { margin:0; font-size:30px; }
.hello p { margin:0; color:var(--ink-soft); font-size:17px; text-transform:capitalize; }
.tiles { display:grid; grid-template-columns:repeat(2,1fr); gap:18px; }
.tile { display:flex; gap:16px; align-items:flex-start; padding:22px; border-radius:18px;
  border:2px solid var(--line); background:var(--surface); text-decoration:none; color:inherit; }
.tile:hover { border-color:var(--brand); transform:translateY(-2px); }
.tile:focus-visible { outline:3px solid var(--brand); outline-offset:2px; }
.tile.hero { grid-column:1/-1; background:linear-gradient(100deg,var(--brand-soft),var(--surface)); border-color:var(--brand); }
.tile .ic { flex:0 0 auto; width:54px; height:54px; border-radius:14px; background:var(--surface-2);
  border:1px solid var(--line); display:flex; align-items:center; justify-content:center; color:var(--brand-strong); }
.tile.hero .ic { background:var(--brand-strong); color:#fff; border-color:var(--brand-strong); }
.tile .tx { display:flex; flex-direction:column; gap:3px; }
.tile .tx b { font-size:20px; }
.tile .tx span { font-size:15px; color:var(--ink-soft); }
.tile .tag { margin-left:auto; align-self:center; font-size:12px; font-weight:700; letter-spacing:.05em;
  text-transform:uppercase; color:var(--muted); border:1px solid var(--line); padding:5px 9px; border-radius:999px; white-space:nowrap; }

/* ---- Encabezado de página + navegación ---- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { margin: 4px 0 0; font-size: 28px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--brand-strong); font-weight: 700; font-size: 16px; text-decoration: none; }
.back:hover { text-decoration: underline; }
.ficha-tags { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }

/* ---- Barra de búsqueda y filtros ---- */
.toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.search { display: flex; align-items: center; gap: 12px; flex: 1 1 300px; }
.search > svg { color: var(--muted); flex: 0 0 auto; }
.search input { flex: 1; min-width: 0; border: 2px solid var(--line); background: var(--surface); border-radius: 14px;
  padding: 14px 16px; font-size: 18px; color: var(--ink); font-family: inherit; }
.search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.search .btn { padding: 14px 18px; font-size: 17px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; }
.filter { display: inline-flex; align-items: center; padding: 12px 16px; border-radius: 999px; border: 2px solid var(--line);
  background: var(--surface); color: var(--ink-soft); text-decoration: none; font-weight: 700; font-size: 15px; }
.filter:hover { border-color: var(--brand); }
.filter.active { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-strong); }

/* ---- Listado de comensales ---- */
.list { display: flex; flex-direction: column; gap: 12px; }
.rowcard { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border: 2px solid var(--line);
  border-radius: 16px; background: var(--surface); text-decoration: none; color: inherit; }
.rowcard:hover { border-color: var(--brand); transform: translateY(-1px); }
.rowcard-nm { font-size: 20px; font-weight: 700; }
.rowcard.is-baja .rowcard-nm { color: var(--muted); }
.rowcard-meta { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.rowcard-arrow { color: var(--muted); flex: 0 0 auto; }
.empty { text-align: center; padding: 50px 20px; color: var(--ink-soft); display: flex; flex-direction: column; align-items: center; gap: 16px; }

/* ---- Chips de categoría y badges ---- */
.chip { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; padding: 7px 13px; border-radius: 999px; white-space: nowrap; }
.chip .dot { width: 11px; height: 11px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.chip-dorado { background: var(--dorado-bg); color: var(--dorado); border: 1px solid var(--dorado-line); }
.chip-verde { background: var(--verde-bg); color: var(--verde); border: 1px solid var(--verde-line); }
.chip-libre { background: var(--libre-bg); color: var(--libre); border: 1px solid var(--libre-line); }
.chip-none { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.badge { display: inline-flex; align-items: center; font-size: 13px; font-weight: 800; padding: 5px 11px; border-radius: 999px; letter-spacing: .02em; }
.badge-baja { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.badge-activo { background: var(--verde-bg); color: var(--verde); border: 1px solid var(--verde-line); }
.badge-soon { background: var(--brand-soft); color: var(--brand-strong); border: 1px solid var(--brand); }

/* ---- Tarjetas / ficha / formularios ---- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 24px; box-shadow: var(--shadow-sm); }
.card h3 { margin: 0 0 14px; font-size: 19px; }
.card-soft { background: var(--surface-2); }
.form-card { max-width: 560px; display: flex; flex-direction: column; gap: 18px; }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 6px; }
.opt { color: var(--muted); font-weight: 400; font-size: 14px; }
.ficha-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.datalist { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; margin: 0; }
.datalist dt { font-weight: 700; color: var(--ink-soft); font-size: 15px; }
.datalist dd { margin: 0; font-size: 17px; }
.card-actions { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.card-actions form { margin: 0; }
.muted-text { color: var(--ink-soft); margin: 0 0 14px; }

@media (max-width: 680px) {
  .ficha-grid { grid-template-columns: 1fr; }
  .page-head { align-items: flex-start; }
  .search { flex-basis: 100%; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .btn { width: 100%; }
}

/* ---- Calendario de comidas ---- */
.cal-card { padding: 22px 24px 24px; }
.cal-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.monthbar { display: flex; align-items: center; gap: 14px; }
.mbtn { width: 48px; height: 48px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface);
  color: var(--ink); font-size: 22px; cursor: pointer; display: flex; align-items: center; justify-content: center; text-decoration: none; }
.mbtn:hover { border-color: var(--brand); color: var(--brand-strong); }
.mlabel { font-size: 20px; font-weight: 800; min-width: 190px; text-align: center; text-transform: capitalize; }
.counter { display: flex; align-items: center; gap: 12px; background: var(--brand-soft); border: 1px solid var(--brand); border-radius: 14px; padding: 10px 16px; }
.counter .big { font-size: 30px; font-weight: 800; color: var(--brand-strong); font-variant-numeric: tabular-nums; line-height: 1; }
.counter .lbl { font-size: 14px; color: var(--ink-soft); line-height: 1.2; }

.cal { display: flex; flex-direction: column; gap: 8px; }
.cal .dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cal .dow span { text-align: center; font-size: 13px; font-weight: 800; letter-spacing: .04em; color: var(--muted); text-transform: uppercase; }
.cal .grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.day { aspect-ratio: 1 / 1; border-radius: 12px; border: 2px solid var(--line); background: var(--surface);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; position: relative; font-family: inherit; padding: 0; }
button.day { cursor: pointer; }
.day .n { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.day .chk { display: none; font-size: 15px; font-weight: 900; line-height: 1; }
.day.empty { border: none; background: none; }
button.day:hover { border-color: var(--brand); transform: translateY(-1px); }
button.day:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
button.day:disabled { opacity: .6; cursor: wait; }
.day.comio { background: var(--brand); border-color: var(--brand); }
.day.comio .n { color: #3A2409; }
.day.comio .chk { display: block; color: #3A2409; }
.day.today { outline: 3px solid var(--brand); outline-offset: 2px; }
.day.wknd, .day.festivo { background: repeating-linear-gradient(-45deg, var(--surface-2), var(--surface-2) 6px, transparent 6px, transparent 12px);
  border-color: transparent; cursor: not-allowed; }
.day.wknd .n, .day.festivo .n { color: var(--muted); opacity: .7; }
.day.festivo .ftag { font-size: 10px; font-weight: 800; color: var(--danger); text-transform: uppercase; }

.legend { display: flex; flex-wrap: wrap; gap: 14px 22px; padding-top: 16px; }
.legend .li { display: flex; align-items: center; gap: 9px; font-size: 15px; color: var(--ink-soft); }
.sw { width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--line); flex: 0 0 auto; }
.sw.comio { background: var(--brand); border-color: var(--brand); }
.sw.today { border: 3px solid var(--brand); background: var(--surface); }
.sw.wknd { background: repeating-linear-gradient(-45deg, var(--surface-2), var(--surface-2) 5px, transparent 5px, transparent 10px); border-color: transparent; }

/* ---- Selector de categoría (ficha) ---- */
.cat-select { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.cat-select-label { font-weight: 700; color: var(--ink-soft); font-size: 16px; margin-right: 2px; }
.pill { border: 2px solid var(--line); background: var(--surface); color: var(--ink-soft); border-radius: 999px;
  padding: 10px 18px; font-size: 16px; font-weight: 700; cursor: pointer; font-family: inherit; }
.pill:hover { border-color: var(--brand); }
.pill.on.pill-dorado { background: var(--dorado-bg); color: var(--dorado); border-color: var(--dorado-line); }
.pill.on.pill-verde { background: var(--verde-bg); color: var(--verde); border-color: var(--verde-line); }
.pill.on.pill-libre { background: var(--libre-bg); color: var(--libre); border-color: var(--libre-line); }
.pill.on.pill-none { background: var(--surface-2); color: var(--ink); border-color: var(--muted); }
.cat-help { font-size: 14px; color: var(--ink-soft); margin: -6px 0 16px; line-height: 1.45; }
.field-help { font-size: 14px; color: var(--ink-soft); margin: 6px 0 0; }

/* ---- Modal de confirmación ---- */
.modal-scrim { position: fixed; inset: 0; background: rgba(30, 20, 6, .45); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50; }
.modal-scrim[hidden] { display: none; }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
  max-width: 420px; width: 100%; padding: 28px; text-align: center; display: flex; flex-direction: column; gap: 10px; }
.modal .mic { width: 56px; height: 56px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-strong);
  font-size: 30px; font-weight: 800; display: flex; align-items: center; justify-content: center; margin: 0 auto 4px; }
.modal h4 { margin: 0; font-size: 22px; }
.modal p { margin: 0; color: var(--ink-soft); font-size: 17px; }
.modal .acts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.modal .acts .btn { width: 100%; }

@media (max-width: 680px) {
  .day .n { font-size: 16px; }
  .cal .grid, .cal .dow { gap: 6px; }
  .mlabel { min-width: 0; font-size: 18px; }
  .cal-top { gap: 12px; }
}

/* ---- Días festivos ---- */
.festivos-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 18px; align-items: start; }
@media (max-width: 820px) { .festivos-grid { grid-template-columns: 1fr; } }
.festivos-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.festivo-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px;
  border: 1px solid transparent; border-left: 6px solid var(--danger); border-radius: 12px; background: var(--danger-soft); }
.festivo-row form { margin: 0; }
.festivo-info { display: flex; flex-direction: column; gap: 2px; }
.festivo-fecha { font-size: 17px; font-weight: 800; text-transform: capitalize; color: var(--danger); }
.festivo-desc { font-size: 14px; color: var(--ink-soft); }
.btn-sm { padding: 10px 16px; font-size: 16px; }

/* Selector de fecha grande (calendario integrado) */
.datepicker { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--surface-2); }
.datepicker .cal-top { justify-content: center; margin-bottom: 12px; }
.day.sel { background: var(--brand); border-color: var(--brand); }
.day.sel .n { color: #3A2409; }
.dp-selected { margin: 12px 0 0; font-size: 16px; color: var(--ink-soft); }
.dp-selected strong { color: var(--ink); }

/* ---- Usuarios ---- */
.user-handle { color: var(--muted); font-weight: 600; font-size: 15px; }
.badge-rol-admin { background: var(--brand-soft); color: var(--brand-strong); border: 1px solid var(--brand); }
.badge-rol-resp { background: var(--surface-2); color: var(--ink-soft); border: 1px solid var(--line); }

/* ---- Exportar listados ---- */
.export-controls { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.export-controls .field { gap: 6px; }
.export-controls select { min-width: 160px; }
.export-go { justify-content: flex-end; }
.export-cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.export-cat { display: flex; flex-direction: column; gap: 12px; }
.export-cat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.export-nota { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.export-count { margin: 0; font-size: 17px; color: var(--ink-soft); }
.export-count strong { color: var(--ink); }
.export-btns { display: flex; gap: 10px; margin-top: auto; flex-wrap: wrap; }
.btn.is-disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }

/* ---- Página de error ---- */
.errorbox { text-align:center; padding:60px 20px; display:flex; flex-direction:column; align-items:center; gap:12px; }
.errorcode { font-size:64px; font-weight:800; color:var(--brand); line-height:1; }
.errorbox h1 { margin:0; font-size:26px; }
.errorbox p { margin:0 0 12px; color:var(--ink-soft); font-size:18px; max-width:44ch; }

/* ---- Accesibilidad / responsive ---- */
:focus-visible { outline:3px solid var(--brand); outline-offset:2px; border-radius:6px; }
.tile,.btn { transition:transform .15s ease, border-color .15s ease, filter .15s ease; }

@media (max-width:680px) {
  body { font-size:17px; }
  .app-main { padding:22px 14px 54px; }
  .tiles { grid-template-columns:1fr; }
  .hello h1 { font-size:26px; }
  .userchip .who { display:none; }
}
@media (prefers-reduced-motion:reduce) { * { transition:none !important; } }
