@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url(fonts/inter-latin.woff2) format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 300 700; font-display: swap; src: url(fonts/spacegrotesk-latin.woff2) format('woff2'); }

:root {
  --brand: oklch(58.3% .19 275.1);
  --brand-600: oklch(52% .2 275.1);
  --brand-10: oklch(58.3% .19 275.1 / .10);
  --brand-15: oklch(58.3% .19 275.1 / .15);
  --brand-25: oklch(58.3% .19 275.1 / .25);
  --accent: oklch(72% .113 175.2);
  --accent-ink: oklch(52% .1 175.2);
  --accent-10: oklch(72% .113 175.2 / .12);
  --ink: oklch(22.6% .063 273.2);
  --s300: #cbd5e1; --s400: #94a3b8; --s500: #64748b; --s600: #475569; --s700: #334155;
  --amber-bg: #fef3c7; --amber: #c2610c;
  --rose: #e11d48; --rose-bg: #ffe4e6;
  --line: rgb(148 163 184 / .18);
  --glass: rgb(255 255 255 / .55);
  --glass-strong: rgb(255 255 255 / .78);
  --glass-border: rgb(255 255 255 / .65);
  --shadow: 0 1px 3px rgb(0 0 0 / .08), 0 1px 2px -1px rgb(0 0 0 / .08);
  --shadow-lg: 0 24px 60px -12px rgb(30 27 75 / .28);
  --radius: 16px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Space Grotesk', var(--font);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: #fff; color: var(--ink);
  font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
svg.i { width: 16px; height: 16px; flex: none; }

.aurora { position: fixed; z-index: -1; border-radius: 50%; filter: blur(64px); pointer-events: none; }
.aurora.a1 { width: 440px; height: 440px; top: -140px; left: -110px; background: oklch(58.3% .19 275.1 / .25); }
.aurora.a2 { width: 400px; height: 400px; top: 160px; right: -40px; background: oklch(72% .113 175.2 / .2); }
.aurora.a3 { width: 380px; height: 380px; bottom: -60px; left: 33%; background: rgb(139 92 246 / .14); }

.wrap { max-width: 1640px; margin: 0 auto; padding: 24px 24px 48px; display: flex; flex-direction: column; gap: 16px; }
.card {
  background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--radius);
  box-shadow: var(--shadow); backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px);
}

/* ---------- Header ---------- */
.header { display: flex; align-items: center; gap: 14px; padding: 14px 20px; }
.logo {
  flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), oklch(62% .17 300)); color: #fff;
  font: 700 15px/1 var(--display); letter-spacing: .02em; box-shadow: 0 6px 16px -6px var(--brand);
}
.enc-switch { position: relative; min-width: 0; flex: 0 1 auto; }
.enc-btn { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 4px 8px 4px 4px; border-radius: 10px; text-align: left; min-width: 0; max-width: 100%; }
.enc-btn > div { overflow: hidden; }
.enc-btn:hover { background: rgb(255 255 255 / .6); }
.enc-btn .t { font: 600 16px/1.2 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.enc-btn .s { font-size: 12px; color: var(--s500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.enc-btn svg { flex: none; color: var(--s400); }
.header .spacer { flex: 1; }
.header .actions { display: flex; align-items: center; gap: 6px; flex: none; }
.pill { border: 0; background: rgb(255 255 255 / .6); border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 500; color: var(--s600); }
.pill:hover { background: #fff; color: var(--ink); }
.ro-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--amber); background: var(--amber-bg); border-radius: 999px; padding: 5px 10px; }

.menu {
  position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; min-width: 320px; max-width: 90vw; max-height: 70vh; overflow: auto;
  background: var(--glass-strong); border: 1px solid var(--glass-border); border-radius: 14px; box-shadow: var(--shadow-lg);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); padding: 6px;
}
.menu .mi { display: flex; width: 100%; align-items: center; gap: 10px; border: 0; background: none; text-align: left; padding: 9px 10px; border-radius: 9px; }
.menu .mi:hover, .menu .mi.on { background: var(--brand-10); }
.menu .mi .mt { font-weight: 600; font-size: 13.5px; }
.menu .mi .ms { font-size: 12px; color: var(--s500); }
.menu .mi .n { margin-left: auto; font: 600 13px var(--display); color: var(--brand); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }

/* ---------- Icon buttons ---------- */
.ib {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; flex: none;
  border: 1px solid transparent; background: rgb(255 255 255 / .6); color: var(--s600); transition: background .12s, color .12s, border-color .12s;
}
.ib:hover { background: #fff; color: var(--ink); }
.ib.sm { width: 30px; height: 30px; border-radius: 8px; }
.ib.edit { border-color: var(--brand-15); }
.ib.edit:hover { border-color: var(--brand-25); color: var(--brand); }
.ib.dup { background: var(--brand-10); color: var(--brand); }
.ib.dup:hover { background: var(--brand-15); }
.ib.primary { background: var(--brand); color: #fff; box-shadow: 0 6px 14px -6px var(--brand); }
.ib.primary:hover { background: var(--brand-600); color: #fff; }
.ib svg { width: 16px; height: 16px; }
.ib.primary svg { width: 18px; height: 18px; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.stat { padding: 18px 20px; min-width: 0; }
.stat .l { font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--s500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .v { font: 600 30px/1.1 var(--display); margin: 8px 0 6px; }
.stat .d { font-size: 12px; color: var(--s500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .d.acc { color: var(--accent-ink); }

/* ---------- Layout ---------- */
.main { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* ---------- Filters ---------- */
.filters { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.clear-top { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 500; color: var(--brand); text-decoration: none; padding: 5px 8px; border-radius: 8px; }
.clear-top:hover { background: var(--brand-10); }
.clear-top svg.i { width: 13px; height: 13px; }
.tab { border: 0; background: none; padding: 6px 12px; border-radius: 9px; color: var(--s600); font-size: 14px; font-weight: 500; }
.tab:hover { color: var(--ink); background: rgb(255 255 255 / .5); }
.tab.on { background: var(--brand-10); color: var(--brand); }
.frow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.frow .search { flex: 1 1 200px; position: relative; min-width: 160px; }
.frow .search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--s400); width: 15px; height: 15px; pointer-events: none; }
.frow .search input { padding-left: 33px; }
.frow select { flex: 1 1 180px; min-width: 150px; max-width: 280px; }

.inp, .frow input, .frow select, .field input, .field select, .field textarea {
  width: 100%; height: 38px; border: 1px solid rgb(148 163 184 / .22); background: rgb(255 255 255 / .75);
  border-radius: 10px; padding: 0 12px; outline: none; font-size: 14px; color: var(--ink); transition: border-color .12s, box-shadow .12s;
}
select { appearance: none; -webkit-appearance: none; padding-right: 32px !important; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important; background-position: right 10px center !important; }
.field textarea { height: auto; min-height: 64px; padding: 9px 12px; resize: vertical; line-height: 1.4; }
.inp:focus, .frow input:focus, .frow select:focus, .field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--brand-25); box-shadow: 0 0 0 3px var(--brand-10); background: #fff;
}
.field input:disabled, .field select:disabled, .field textarea:disabled { opacity: .6; cursor: not-allowed; }
.field input[readonly] { color: var(--s500); background: rgb(255 255 255 / .45); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 16px 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 0; background: var(--brand-10); color: var(--brand); border-radius: 999px; padding: 4px 6px 4px 11px; font-size: 12px; font-weight: 600; }
.chip svg { width: 14px; height: 14px; }
.chip:hover { background: var(--brand-15); }

/* ---------- List ---------- */
.list { overflow: hidden; }
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; min-width: 820px; border-collapse: separate; border-spacing: 0; }
.tbl th {
  font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--s500);
  text-align: left; vertical-align: bottom; padding: 12px 6px 10px; line-height: 1.25; border-bottom: 1px solid var(--line);
  white-space: normal;
}
.tbl th > span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tbl th:first-child, .tbl td:first-child { padding-left: 18px; }
.tbl th:first-child { min-width: 150px; }
.tbl th.th-fam, .tbl th.th-gv { min-width: 124px; }  /* que el encabezado entre en dos renglones aunque la columna esté vacía */
.tbl th:last-child, .tbl td:last-child { padding-right: 16px; text-align: right; }
.tbl td { padding: 9px 6px; vertical-align: middle; border-bottom: 1px solid var(--line); height: 60px; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: rgb(255 255 255 / .45); }
.tbl tbody tr.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0%, 30% { background: var(--brand-15); } 100% { background: transparent; } }
.tbl td.c-name { width: 100%; max-width: 0; }
.nm { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub { font-size: 12px; color: var(--s500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-date { white-space: nowrap; font-size: 12px; }
.c-date .d { font-weight: 500; color: var(--ink); }
.c-date .sub { max-width: 130px; }
.c-act { white-space: nowrap; }
.c-act .ib + .ib { margin-left: 4px; }
.dash { color: var(--s400); }

.badge {
  display: inline-block; max-width: 124px; vertical-align: middle; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-radius: 7px; padding: 3px 8px; font-size: 12px; font-weight: 500; line-height: 1.35;
}
.b-group { --h: 175; background: oklch(94.5% .045 var(--h)); color: oklch(44% .11 var(--h)); }
.b-none { background: rgb(148 163 184 / .12); color: var(--s400); }
.b-contratado { background: var(--brand-10); color: var(--brand); }
.b-propio { background: var(--amber-bg); color: var(--amber); }
.b-sin_pernocte { background: rgb(148 163 184 / .16); color: var(--s500); }
.c-hosp .sub { margin-top: 2px; max-width: 124px; }

.list-foot { display: flex; justify-content: space-between; gap: 12px; padding: 12px 20px; font-size: 12px; color: var(--s500); border-top: 1px solid var(--line); }
.empty { padding: 40px 20px; text-align: center; color: var(--s500); }

/* ---------- Side panels ---------- */
.panel { padding: 16px 18px; }
.ph { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; min-height: 28px; }
.ph h3 { margin: 0; font-size: 14px; font-weight: 600; flex: 1; }
.ph .link { border: 0; background: none; color: var(--brand); font-size: 12.5px; font-weight: 500; padding: 4px; }
.ph .link:hover { text-decoration: underline; }
.seg { display: inline-flex; gap: 2px; background: rgb(255 255 255 / .5); border-radius: 9px; padding: 2px; }
.seg button { border: 0; background: none; font-size: 12px; font-weight: 500; color: var(--s500); padding: 4px 9px; border-radius: 7px; }
.seg button.on { background: var(--brand-10); color: var(--brand); }
.seg.wide { display: flex; width: 100%; margin-bottom: 12px; }
.seg.wide button { flex: 1 1 auto; padding: 6px 6px; white-space: nowrap; }

.arr { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow: auto; margin: 0 -4px; padding: 0 4px; }
.arr-i { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 12px; background: rgb(255 255 255 / .5); border: 1px solid rgb(255 255 255 / .55); cursor: pointer; }
.arr-i:hover { background: rgb(255 255 255 / .8); }
.arr-d { flex: none; width: 44px; height: 44px; border-radius: 10px; background: var(--brand-10); color: var(--brand); display: grid; place-content: center; text-align: center; }
.arr-d b { font: 600 16px/1 var(--display); }
.arr-d small { font-size: 9px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; margin-top: 2px; }
.arr-i .ti { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arr-i .ti span { font-weight: 400; color: var(--s500); }
.arr-i .ss { font-size: 12px; color: var(--s500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arr-i > div:last-child { min-width: 0; }

.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 52px 1fr 28px; gap: 10px; align-items: center; cursor: pointer; border-radius: 8px; }
.bar-row:hover .track { background: rgb(148 163 184 / .28); }
.bar-row .k { font-weight: 600; font-size: 13px; }
.bar-row .n { text-align: right; font: 600 13px var(--display); color: var(--brand); }
.track { height: 9px; border-radius: 999px; background: rgb(148 163 184 / .2); overflow: hidden; }
.fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--accent)); min-width: 6px; }
.gbars { display: flex; flex-direction: column; gap: 11px; max-height: 460px; overflow: auto; padding-right: 2px; }
.gbar { cursor: pointer; }
.gbar .top { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; margin-bottom: 5px; }
.gbar .top span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--s700); }
.gbar .top span:last-child { color: var(--s500); }
.gbar:hover .top span:first-child { color: var(--brand); }
.gbar.muted .fill { background: var(--s300); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(54px, 1fr)); gap: 6px; margin-bottom: 14px; }
.tile { border-radius: 12px; padding: 10px 6px; text-align: center; cursor: pointer; border: 0; }
.tile b { display: block; font: 600 22px/1.1 var(--display); }
.tile small { display: block; font-size: 10.5px; line-height: 1.2; color: var(--s500); }
.tile.t-contratado { background: var(--brand-10); color: var(--brand); }
.tile.t-propio { background: var(--amber-bg); color: var(--amber); }
.tile.t-sin_pernocte, .tile.t-none { background: rgb(148 163 184 / .14); color: var(--s600); }
.kv { display: flex; flex-direction: column; }
.kv > div { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; padding: 5px 0; color: var(--s600); cursor: pointer; }
.kv > div:hover { color: var(--brand); }
.kv > div b { color: var(--ink); font-weight: 600; }
.kv > div small { color: var(--s400); font-weight: 400; margin-left: 4px; }

.rooms { display: flex; flex-direction: column; gap: 8px; max-height: 480px; overflow: auto; }
.room { padding: 9px 11px; border-radius: 10px; background: rgb(255 255 255 / .5); }
.room .top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 600; }
.room .top span:last-child { font: 600 12.5px var(--display); color: var(--brand); }
.room .top span.full { color: var(--accent-ink); }
.room .top span.over { color: var(--rose); }
.room .who { font-size: 12px; color: var(--s500); margin-top: 3px; }
.room .track { height: 5px; margin-top: 6px; }

table.meals { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.meals th { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--s500); padding: 4px 4px 8px; text-align: center; }
.meals th:first-child { text-align: left; }
.meals td { padding: 3px; text-align: center; }
.meals td:first-child { text-align: left; font-weight: 600; white-space: nowrap; padding-right: 8px; }
.meals .mc { display: block; width: 100%; border: 0; border-radius: 8px; padding: 6px 2px; background: var(--brand-10); color: var(--brand); font: 600 14px var(--display); }
.meals .mc:hover { background: var(--brand-15); }
.meals .mc.zero { background: rgb(148 163 184 / .1); color: var(--s400); }
.meals .na { color: var(--s300); }
.meals tfoot td { border-top: 1px solid var(--line); padding-top: 7px; color: var(--s500); font: 600 12.5px var(--display); }
.muted-note { font-size: 12px; color: var(--s500); }

.fams { display: flex; flex-direction: column; gap: 6px; max-height: 480px; overflow: auto; }
.fam { --h: 175; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: oklch(96% .03 var(--h) / .8); cursor: pointer; min-width: 0; }
.fam:hover { background: oklch(93% .05 var(--h)); }
.fam .dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: oklch(65% .13 var(--h)); }
.fam.sin { background: rgb(148 163 184 / .12); }
.fam.sin .dot { background: var(--s300); }
.fam .fn { flex: 1; min-width: 0; }
.fam .fn b { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fam .fn small { display: block; font-size: 11.5px; color: var(--s600); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fam .fc { font: 600 15px var(--display); color: var(--ink); }
.fam-people { display: flex; flex-direction: column; gap: 2px; padding: 2px 10px 4px 29px; }
.fam-people > div { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--s700); }
.fam-people > div span:first-child { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fam-people > div span:last-child { flex: none; color: var(--brand); font-weight: 500; }
.fam-people > div span.none { color: var(--amber); font-weight: 400; }

.rep-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; font-weight: 600; font-size: 13.5px; margin: 2px 0 6px; }
.rep-head span { font-weight: 400; color: var(--s500); font-size: 12px; }
.rep { margin-top: 18px; break-inside: avoid; }
.rep-t { display: flex; align-items: center; gap: 10px; margin-bottom: 2px; }
.rep-t h3 { margin: 0; font: 600 16px var(--display); }
.rep-n { margin-left: auto; font: 600 14px var(--display); color: var(--brand); }
table.rep-tbl { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 12.5px; background: rgb(255 255 255 / .7); border-radius: 10px; overflow: hidden; }
.rep-tbl th { text-align: left; font-size: 10.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--s500); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.rep-tbl td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.rep-tbl .n { text-align: center; font-weight: 600; width: 48px; }
.rep-tbl .nw { white-space: nowrap; }
.rep-tbl .badge { max-width: 220px; }
.rep-tbl tfoot td { font-weight: 700; border-bottom: 0; }

/* ---------- Modals ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 3vh 16px;
  background: rgb(30 27 75 / .22); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade .12s ease-out; overflow-y: auto;
}
.overlay.top { z-index: 120; align-items: center; }
@keyframes fade { from { opacity: 0; } }
.modal {
  width: 100%; max-width: 640px; background: rgb(248 248 252 / .96); border: 1px solid #fff; border-radius: 20px;
  box-shadow: var(--shadow-lg); animation: pop .14s ease-out; display: flex; flex-direction: column; max-height: 94vh;
}
.modal.wide { max-width: 860px; }
.modal.small { max-width: 420px; }
@keyframes pop { from { transform: translateY(8px) scale(.99); opacity: 0; } }
.mh { display: flex; align-items: center; gap: 10px; padding: 18px 22px 10px; }
.mh h2 { margin: 0; font: 600 17px/1.2 var(--display); flex: 1; }
.mh .x { border: 0; background: none; color: var(--s500); font-size: 13px; padding: 6px 8px; border-radius: 8px; }
.mh .x:hover { background: rgb(0 0 0 / .04); color: var(--ink); }
.mb { padding: 4px 22px 16px; overflow-y: auto; }
.mf { display: flex; align-items: center; gap: 8px; padding: 12px 22px 18px; border-top: 1px solid var(--line); }
.mf .grow { flex: 1; }
.btn { border: 0; border-radius: 10px; height: 38px; padding: 0 16px; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn.primary { background: var(--brand); color: #fff; box-shadow: 0 6px 14px -6px var(--brand); }
.btn.primary:hover { background: var(--brand-600); }
.btn.ghost { background: #fff; color: var(--s600); border: 1px solid rgb(148 163 184 / .25); font-weight: 500; }
.btn.ghost:hover { color: var(--ink); border-color: rgb(148 163 184 / .45); }
.btn.danger { background: none; color: var(--rose); font-weight: 500; padding: 0 10px; }
.btn.danger:hover { background: var(--rose-bg); }
.btn.danger-solid { background: var(--rose); color: #fff; }
.btn.sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn svg { width: 15px; height: 15px; }

.sec { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); margin: 16px 0 10px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.sec:first-child { margin-top: 6px; }
.sec label { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--s600); font-size: 12.5px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.grid2 .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; position: relative; }
.field > span { font-size: 10.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--s500); }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--s600); cursor: pointer; user-select: none; }
.check input { width: 15px; height: 15px; accent-color: var(--brand); margin: 0; cursor: pointer; }
.check.dis { opacity: .45; cursor: not-allowed; }
.check.dis input { cursor: not-allowed; }

.meal-grid { display: flex; flex-direction: column; gap: 6px; background: rgb(255 255 255 / .55); border-radius: 12px; padding: 10px 12px; }
.meal-day { display: flex; align-items: center; gap: 6px 16px; flex-wrap: wrap; }
.meal-day .dl { width: 76px; font-size: 12.5px; font-weight: 600; color: var(--s700); flex: none; }
.meal-day .check { font-size: 13px; min-width: 96px; }

.ac { position: absolute; z-index: 5; top: 100%; left: 0; right: 0; margin-top: 4px; background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); padding: 4px; max-height: 280px; overflow: auto; }
.ac .ai { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 8px; }
.ac .ai.on, .ac .ai:hover { background: var(--brand-10); }
.ac .ai b { font-size: 13.5px; font-weight: 600; }
.ac .ai small { display: block; font-size: 11.5px; color: var(--s500); }
.ac .ai[disabled] { opacity: .5; cursor: default; }
.ac .ah { font-size: 10.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--s400); padding: 6px 10px 4px; }
.hint { font-size: 11.5px; line-height: 1.35; color: var(--s500); min-height: 15px; }
.hint.warn { color: var(--amber); font-weight: 500; }
.linked { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--accent-ink); background: var(--accent-10); border-radius: 8px; padding: 5px 6px 5px 10px; margin-top: 6px; }
.linked button { margin-left: auto; border: 0; background: rgb(255 255 255 / .7); border-radius: 6px; font-size: 11.5px; padding: 3px 8px; color: var(--s600); }

/* Config */
.ctabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.ctab { border: 1px solid rgb(148 163 184 / .25); background: #fff; border-radius: 999px; padding: 5px 12px; font-size: 12.5px; font-weight: 500; color: var(--s600); }
.ctab:hover { color: var(--ink); }
.ctab.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.clist { display: flex; flex-direction: column; gap: 6px; }
.citem { display: flex; align-items: center; gap: 8px; padding: 9px 10px 9px 14px; background: rgb(255 255 255 / .75); border-radius: 12px; min-height: 52px; }
.citem .cn { flex: 1; min-width: 0; }
.citem .cn b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.citem .cn small { font-size: 11.5px; color: var(--s500); }
.citem.off .cn b { color: var(--s400); text-decoration: line-through; }
.citem select, .citem input.inp { height: 30px; font-size: 12.5px; border-radius: 8px; width: auto; }
.citem input.cap { width: 70px; }
.addrow { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.addrow .inp { flex: 1 1 180px; width: auto; }
.addrow select.inp { flex: 0 1 170px; }
.sub-list { margin: 2px 0 6px 22px; display: flex; flex-direction: column; gap: 5px; border-left: 2px solid var(--brand-15); padding-left: 12px; }
.sub-list .citem { min-height: 44px; background: rgb(255 255 255 / .6); }
.cols3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.cols3 h4 { margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--s500); }
.dayhead { font-size: 12px; font-weight: 700; color: var(--s600); margin: 12px 0 6px; }
.dayhead::first-letter { text-transform: uppercase; }
.clist.compact .citem { min-height: 44px; padding-top: 5px; padding-bottom: 5px; }
.note { font-size: 12.5px; color: var(--s500); background: rgb(255 255 255 / .55); border-radius: 10px; padding: 9px 12px; margin-bottom: 12px; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .card { width: 100%; max-width: 340px; padding: 24px; }
.login .brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.login .brand .t { font: 600 16px/1.2 var(--display); }
.login .brand .s { font-size: 12px; color: var(--s500); }
.login label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--s500); }
.login input { margin: 8px 0 12px; text-align: center; letter-spacing: .4em; font-size: 18px; height: 44px; }
.login .btn { width: 100%; justify-content: center; height: 42px; }
.login .err { color: var(--rose); font-size: 12.5px; text-align: center; margin-top: 10px; min-height: 18px; }
.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* Tooltip & toasts */
#tip {
  position: fixed; z-index: 300; pointer-events: none; background: var(--ink); color: #fff; font-size: 12px; font-weight: 500;
  padding: 5px 9px; border-radius: 7px; white-space: nowrap; box-shadow: 0 6px 16px -6px rgb(0 0 0 / .4); opacity: 0; transition: opacity .1s;
  max-width: 360px; overflow: hidden; text-overflow: ellipsis;
}
#tip.on { opacity: 1; }
#toasts { position: fixed; z-index: 400; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 12px; font-size: 13px; box-shadow: var(--shadow-lg); animation: pop .15s ease-out; max-width: 380px; }
.toast.err { background: var(--rose); }
.busy { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 500; background: linear-gradient(90deg, transparent, var(--brand), var(--accent), transparent); background-size: 50% 100%; animation: busy 1s linear infinite; }
@keyframes busy { from { background-position: -50% 0; } to { background-position: 150% 0; } }

/* ---------- Impresión (resumen por hospedaje) ---------- */
@media print {
  @page { margin: 12mm; }
  body { background: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .aurora, #app, #toasts, #tip, .busy, .overlay:not(.printable) { display: none !important; }
  .overlay.printable { position: static; display: block; padding: 0; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; overflow: visible; animation: none; }
  .overlay.printable .modal { max-width: none; max-height: none; box-shadow: none; border: 0; background: #fff; animation: none; }
  .overlay.printable .mb { overflow: visible; padding: 0; }
  .overlay.printable .mh { padding: 0 0 6px; }
  .overlay.printable .mh .x, .overlay.printable .mf { display: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1440px) {
  .main { grid-template-columns: minmax(0, 1fr) 300px; }
  .wrap { padding-left: 20px; padding-right: 20px; }
}
@media (max-width: 1000px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .main { grid-template-columns: minmax(0, 1fr); }
  .side { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
}
@media (max-width: 640px) {
  .wrap { padding: 12px 12px 32px; gap: 12px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 14px; }
  .stat .v { font-size: 24px; }
  .header { padding: 10px 12px; gap: 10px; }
  .header .logo { display: none; }
  .header .spacer { display: none; }
  .header .actions { margin-left: auto; gap: 4px; }
  .pill { padding: 7px 10px; }
  .stats > :last-child:nth-child(odd) { grid-column: span 2; }
  .tab { padding: 6px 9px; font-size: 13.5px; }
  .menu { position: fixed; left: 12px; right: 12px; top: 70px; min-width: 0; }
  .grid2, .cols3 { grid-template-columns: 1fr; }
  .modal { border-radius: 16px; }
  .mh, .mb, .mf { padding-left: 16px; padding-right: 16px; }
  .frow select { max-width: none; }
}
