/* MaxTvscontrol — marco oscuro, panel principal con degradado pastel. */
:root {
  --ink: #0b0b0c;          /* marco */
  --rail: #151517;         /* barra de iconos */
  --dark: #1c1c1f;         /* tarjetas oscuras */
  --dark-2: #26262a;
  --on-dark: #f3f3f5;
  --on-dark-muted: #8e8e97;

  --sheet: #ffffff;        /* hoja blanca del área principal */
  --text: #16171b;
  --muted: #6c707b;
  --line: #ebebf0;
  --field: #f4f4f7;

  --lime: #e3f56e;
  --lavender: #b9adf6;
  --tint-lavender: #dcd5fb;
  --tint-mint: #d6e8e8;
  --tint-gray: #ececef;
  --tint-lime: #eef8b8;

  --ok: #22a95a;
  --off: #a2a5ad;
  --danger: #e0364a;
  --warn: #b26a00;
  --grad: linear-gradient(118deg, #e6f68e 0%, #e1f0d8 30%, #d7e6ee 62%, #d8d0f7 100%);
  --radius: 18px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--ink);
  color: var(--text);
  font: 14px/1.45 Manrope, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Estructura ---------- */
.shell {
  display: grid; grid-template-columns: 72px 270px minmax(0, 1fr); gap: 10px;
  height: 100vh; height: 100dvh; padding: 10px;
}
.rail {
  background: var(--rail); border-radius: 22px; padding: 10px 0;
  display: flex; flex-direction: column; align-items: center; gap: 10px; overflow-y: auto;
}
.rail-logo {
  width: 52px; height: 52px; border-radius: 16px; background: var(--lavender); color: #121214;
  display: grid; place-items: center; flex: none;
}
.rail-logo svg { width: 24px; height: 24px; stroke-width: 2.2; }
.rail-logo.big { width: 64px; height: 64px; border-radius: 20px; }
.rail-logo.big svg { width: 30px; height: 30px; }
.rail-sep { width: 32px; height: 1px; background: #2b2b30; margin: 4px 0; flex: none; }
.rail-spacer { flex: 1; }
.rail button {
  width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer; flex: none;
  background: var(--dark-2); color: var(--on-dark); display: grid; place-items: center;
  transition: background .15s, color .15s, transform .15s;
}
.rail button:hover { background: #33333a; }
.rail button.active { background: var(--lime); color: #111; }
.rail button span { display: none; }
.rail button[hidden] { display: none; }
.rail .rail-out { background: transparent; border: 1.5px dashed #3a3a41; color: var(--on-dark-muted); }

.side { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow-y: auto; color: var(--on-dark); }
.side-brand {
  background: var(--dark); border-radius: var(--radius); padding: 16px 18px;
  display: grid; gap: 10px;
}
.brand-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.me {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
  border: 0; border-radius: 12px; background: var(--dark-2); color: var(--on-dark); padding: 9px 12px; cursor: pointer; text-align: left;
}
.me[hidden] { display: none; }
.me:hover { background: #33333a; }
.me-name { font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-role { font-size: 11px; font-weight: 700; color: #111; background: var(--lime); padding: 2px 8px; border-radius: 99px; flex: none; }
.side-brand strong { font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.side-dyn { display: flex; flex-direction: column; gap: 10px; }
.side-card { background: var(--dark); border-radius: var(--radius); padding: 16px 18px; }
.side-date { font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.side-date::first-letter { text-transform: uppercase; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.kpi { background: var(--dark-2); border-radius: 12px; padding: 10px 8px; text-align: center; }
.kpi b { display: block; font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.kpi span { font-size: 11px; color: var(--on-dark-muted); }
.kpi.hl { background: var(--lime); color: #111; }
.kpi.hl span { color: #4b5320; }
.side-title {
  display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 15px;
  margin-bottom: 10px;
}
.side-title button { border: 0; background: none; color: var(--on-dark-muted); cursor: pointer; font-size: 18px; line-height: 1; padding: 2px 4px; }
.side-title button:hover { color: var(--on-dark); }
.side-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.side-list button {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 7px 8px; margin: 0 -8px; width: calc(100% + 16px);
  border: 0; background: none; border-radius: 10px; cursor: pointer; text-align: left; color: var(--on-dark); font-size: 13px;
}
.side-list button:hover { background: var(--dark-2); }
.side-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-code { font-size: 11px; color: var(--on-dark-muted); font-family: ui-monospace, Menlo, monospace; letter-spacing: .06em; }
.side-empty { margin: 0; color: var(--on-dark-muted); font-size: 13px; }
.bullet { width: 7px; height: 7px; border-radius: 50%; flex: none; }

.main {
  background: var(--grad); border-radius: 22px; min-width: 0; min-height: 0;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
main { padding: 22px 22px 28px; min-height: 100%; display: flex; flex-direction: column; }

/* Encabezado de cada sección (sobre el degradado) */
.head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.head h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.025em; }
.head p { margin: 2px 0 0; color: #4d5260; font-size: 13px; }
/* Hoja blanca con el contenido */
.sheet { background: var(--sheet); border-radius: var(--radius); padding: 18px; flex: 1; }

.live { display: flex; align-items: center; gap: 7px; color: var(--on-dark-muted); font-size: 12px; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--off); flex: none; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(34, 169, 90, .22); }

/* ---------- Botones y campos ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  border: 1px solid var(--line); background: var(--sheet); border-radius: 999px;
  padding: 8px 15px; cursor: pointer; font-weight: 600; white-space: nowrap; text-decoration: none; color: var(--text);
  transition: background .15s, transform .1s;
}
.btn:hover { background: var(--field); }
.btn:active { transform: scale(.98); }
.btn.primary { background: #0e0e10; border-color: #0e0e10; color: #fff; padding: 10px 20px; }
.btn.primary:hover { background: #26262b; }
.btn.lime { background: var(--lime); border-color: var(--lime); color: #111; }
.btn.lime:hover { filter: brightness(.96); }
.btn.danger { color: var(--danger); }
.btn.small { padding: 5px 11px; font-size: 12.5px; }
.btn.icon { padding: 5px 9px; }
.btn:disabled { opacity: .4; cursor: default; }
input[type=text], input[type=number], input[type=time], input[type=date], input[type=password], select {
  border: 1px solid transparent; background: var(--field); border-radius: 12px; padding: 8px 11px; min-width: 0;
}
select { cursor: pointer; }
input:focus, select:focus, .btn:focus-visible, .rail button:focus-visible {
  outline: 2px solid #8c7cf0; outline-offset: 1px;
}
label.field { display: grid; gap: 5px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
label.field > input, label.field > select { color: var(--text); font-size: 13.5px; font-weight: 500; }

.card { background: var(--sheet); border-radius: 16px; }
.empty { text-align: center; padding: 52px 20px; color: var(--muted); border: 1.5px dashed var(--line); border-radius: 16px; }
.empty strong { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }
.empty .btn { margin-top: 14px; }
.hint { color: var(--muted); font-size: 12px; }

/* Tintes pastel (como los bloques del calendario) */
.tint-0 { background: var(--tint-lavender); }
.tint-1 { background: var(--tint-mint); }
.tint-2 { background: var(--tint-gray); }
.tint-3 { background: var(--tint-lime); }
.tint-0 input, .tint-0 select, .tint-1 input, .tint-1 select,
.tint-2 input, .tint-2 select, .tint-3 input, .tint-3 select { background: rgba(255, 255, 255, .7); }

/* ---------- Pantallas ---------- */
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.screen { padding: 18px; display: grid; gap: 13px; border-radius: 16px; }
.screen-top { display: flex; align-items: flex-start; gap: 12px; }
.screen-top .names { flex: 1; min-width: 0; display: grid; gap: 1px; }
.inline-edit {
  border: 1px solid transparent !important; background: transparent !important; padding: 2px 6px !important;
  margin-left: -6px; border-radius: 8px !important; width: 100%;
}
.inline-edit:hover { border-color: rgba(0, 0, 0, .1) !important; }
.inline-edit:focus { background: rgba(255, 255, 255, .85) !important; }
.inline-edit.title { font-weight: 800; font-size: 17px; letter-spacing: -.01em; }
.inline-edit.sub { color: var(--muted); font-size: 12.5px; }
.code {
  font: 700 18px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .14em;
  background: #0e0e10; color: var(--lime); padding: 9px 11px 9px 13px; border-radius: 12px;
}
.status { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.status.on { color: #137a3d; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.row > .field { flex: 1; min-width: 110px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; padding-top: 2px; }
.actions .spacer { flex: 1; }
.stat-mini { font-size: 12.5px; color: var(--muted); }
.stat-mini b { color: var(--text); }
.orient { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.orient b { color: var(--text); font-weight: 700; }
.orient-icon { flex: none; border: 2px solid currentColor; border-radius: 3px; }
.orient-icon.h { width: 18px; height: 12px; }
.orient-icon.v { width: 12px; height: 18px; }
.orient-icon.sq { width: 14px; height: 14px; }
.warn { color: var(--warn); font-size: 12px; font-weight: 600; flex-basis: 100%; }

.howto { margin-top: 14px; padding: 18px 20px; background: var(--field); border-radius: 16px; }
.howto h2 { margin: 0 0 10px; font-size: 15px; font-weight: 800; }
.howto ol { margin: 0; padding-left: 20px; color: var(--muted); display: grid; gap: 6px; }
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text);
  background: var(--sheet); padding: 1px 7px; border-radius: 6px; border: 1px solid var(--line);
}

/* ---------- Anuncios ---------- */
.drop {
  border: 1.5px dashed #cfd0d8; border-radius: 16px; background: var(--field);
  padding: 26px; text-align: center; color: var(--muted); cursor: pointer; margin-bottom: 16px;
  transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: #8c7cf0; background: var(--tint-lavender); }
.drop strong { color: var(--text); }
.uploads { display: grid; gap: 8px; margin-bottom: 14px; }
.uploads:empty { display: none; }
.upload { display: grid; grid-template-columns: 1fr 160px 48px; gap: 12px; align-items: center; padding: 10px 14px; font-size: 13px; background: var(--field); }
.bar { height: 6px; background: #dfe0e6; border-radius: 3px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: #8c7cf0; width: 0; transition: width .2s; }
.media-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.media { overflow: hidden; display: flex; flex-direction: column; background: var(--field); }
.thumb { aspect-ratio: 16/9; background: #0e0e10; position: relative; margin: 8px 8px 0; border-radius: 12px; overflow: hidden; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: contain; display: block; }
.thumb-inner { width: 100%; height: 100%; }
.badge {
  position: absolute; top: 8px; left: 8px; background: rgba(255, 255, 255, .9); color: #111;
  font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .05em;
}
.media-body { padding: 10px 12px 12px; display: grid; gap: 7px; }
.media-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; align-items: center; }
.dur { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.dur input { width: 64px; padding: 5px 8px; background: var(--sheet); }

/* ---------- Listas ---------- */
.split { display: grid; grid-template-columns: 230px 1fr; gap: 14px; align-items: start; }
.pl-list { padding: 6px; display: grid; gap: 2px; background: var(--field); }
.pl-list button {
  text-align: left; border: 0; background: none; padding: 10px 12px; border-radius: 12px; cursor: pointer;
  display: flex; justify-content: space-between; gap: 8px; font-weight: 600;
}
.pl-list button:hover { background: var(--sheet); }
.pl-list button.active { background: #0e0e10; color: #fff; }
.pl-list .count { color: var(--muted); font-weight: 600; font-size: 12px; }
.pl-list button.active .count { color: var(--lime); }
.editor { padding: 4px 2px; }
.editor-head { display: flex; gap: 10px; align-items: center; margin-bottom: 4px; }
.editor-head .inline-edit { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.used-by { color: var(--muted); font-size: 12.5px; margin-bottom: 14px; }
.items { display: grid; gap: 8px; margin-bottom: 14px; }
.item { border-radius: 14px; }
.item-main { display: grid; grid-template-columns: 26px 92px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 9px 11px; }
.item .num { color: rgba(0, 0, 0, .45); font-weight: 800; text-align: center; }
.item .mini { width: 92px; aspect-ratio: 16/9; background: #0e0e10; border-radius: 9px; overflow: hidden; }
.item .mini img, .item .mini video { width: 100%; height: 100%; object-fit: cover; display: block; }
.item .iname { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .sched-sum { font-size: 12px; color: rgba(0, 0, 0, .55); }
.item .sched-sum.on { color: #5b45d6; font-weight: 600; }
.item .moves { display: flex; gap: 4px; }
.item .moves .btn { background: rgba(255, 255, 255, .7); border-color: transparent; }
.item details { border-top: 1px solid rgba(0, 0, 0, .06); }
.item summary { cursor: pointer; padding: 8px 12px; font-size: 12.5px; color: rgba(0, 0, 0, .55); list-style: none; font-weight: 600; }
.item summary::-webkit-details-marker { display: none; }
.item summary::before { content: "▸ "; }
.item details[open] summary::before { content: "▾ "; }
.sched { padding: 4px 12px 14px; display: grid; gap: 12px; }
.days { display: flex; gap: 5px; flex-wrap: wrap; }
.days label {
  border-radius: 999px; padding: 5px 11px; cursor: pointer; font-size: 12.5px; font-weight: 600;
  background: rgba(255, 255, 255, .7); user-select: none;
}
.days input { display: none; }
.days label:has(input:checked) { background: #0e0e10; color: var(--lime); }
.add-row { display: flex; gap: 8px; }
.add-row select { flex: 1; }

/* ---------- Reportes ---------- */
.tables { display: grid; gap: 14px; }
.tables .card { overflow: hidden; background: var(--field); }
.tables h2 { font-size: 15px; font-weight: 800; margin: 0; padding: 14px 16px 6px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 16px; border-bottom: 1px solid var(--line); }
th { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
td { background: var(--sheet); }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }

/* ---------- Inicio ---------- */
.dot.part { background: #e0a400; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.stat {
  display: grid; gap: 4px; text-align: left; padding: 14px 16px; border-radius: 16px; border: 0;
  background: var(--field); font: inherit; color: inherit;
}
button.stat { cursor: pointer; }
button.stat:hover { filter: brightness(.97); }
.stat span { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat b { font-size: 26px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.stat.lime { background: var(--lime); }
.stat.lime span { color: #4b5320; }
.stat.alert { background: #ffe3e3; }
.stat.alert b { color: #b4232f; }
.section-title { font-size: 16px; font-weight: 800; margin: 4px 0 10px; }
.region-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); margin-bottom: 18px; }
.region { padding: 16px; display: grid; gap: 10px; border-radius: 16px; }
.region-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.region-name { font-size: 14.5px; font-weight: 800; line-height: 1.25; }
.region-top .btn { background: rgba(255, 255, 255, .75); border-color: transparent; }
.meter { height: 7px; border-radius: 99px; background: rgba(0, 0, 0, .08); overflow: hidden; }
.meter span { display: block; height: 100%; background: #16171b; border-radius: 99px; }
.region-stats { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: rgba(0, 0, 0, .6); }
.region-stats b { color: var(--text); }
.alerts { padding: 16px 18px; background: var(--field); }
.alerts-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.alerts h2 { margin: 0; font-size: 15px; font-weight: 800; }
.alert-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.alert-list li { display: flex; align-items: center; gap: 10px; padding: 7px 10px; background: var(--sheet); border-radius: 10px; font-size: 13px; }
.alert-list .right { margin-left: auto; }
.alert-list .dot { background: var(--danger); }

/* ---------- Tablas y filtros ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filters input[type=search] { flex: 1 1 260px; border: 1px solid transparent; background: var(--field); border-radius: 12px; padding: 9px 12px; min-width: 0; }
.filters select { flex: 0 1 200px; }
.bulk {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 12px;
  background: #0e0e10; color: #fff; border-radius: 14px; position: sticky; top: 0; z-index: 3;
}
.bulk b { margin-right: 4px; color: var(--lime); }
.bulk select { background: #26262a; color: #fff; padding: 6px 10px; font-size: 12.5px; }
.bulk .btn { background: #26262a; border-color: #26262a; color: #fff; }
.bulk .btn:hover { background: #33333a; }
.bulk .btn.danger { color: #ff8a95; }
.bulk .btn.ghost { background: transparent; border-color: #3a3a41; }
.table-meta { font-size: 12px; color: var(--muted); margin: 0 0 6px 2px; font-weight: 600; }
.table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--line); }
table.data td, table.data th { padding: 9px 12px; vertical-align: middle; }
table.data th { background: var(--field); position: sticky; top: 0; }
table.data tbody tr:hover td { background: #fafafb; }
table.data tr.sel td { background: #f1eefe; }
table.data .chk { width: 36px; padding-right: 0; }
table.data input[type=checkbox] { width: 16px; height: 16px; accent-color: #0e0e10; cursor: pointer; }
.cell-main { display: flex; align-items: center; gap: 10px; }
.sub { font-size: 12px; color: var(--muted); }
.code-sm { font-family: ui-monospace, Menlo, monospace; letter-spacing: .08em; }
.link { border: 0; background: none; padding: 0; color: inherit; cursor: pointer; text-align: left; font: inherit; }
.link:hover { text-decoration: underline; }
.link.strong { font-weight: 700; }
.warn-dot { color: var(--warn); margin-left: 4px; }
.btn.more { display: block; margin: 12px auto 0; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions .btn + .btn { margin-left: 4px; }
select.compact { padding: 6px 9px; font-size: 12.5px; max-width: 220px; }
.inline-edit.cell { font-weight: 700; }
.chip { font-size: 11.5px; font-weight: 700; background: #0e0e10; color: var(--lime); padding: 3px 9px; border-radius: 99px; }

details.howto { margin-top: 16px; }
details.howto summary { cursor: pointer; font-weight: 800; list-style: none; }
details.howto summary::-webkit-details-marker { display: none; }
details.howto summary::before { content: "▸ "; }
details.howto[open] summary::before { content: "▾ "; }
details.howto ol { margin-top: 10px; }

/* Agencias por región */
.head-actions { display: flex; gap: 8px; }
.region-block { border-radius: 16px; overflow: hidden; margin-bottom: 10px; background: var(--field); }
.region-block > summary {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; cursor: pointer; list-style: none;
}
.region-block > summary::-webkit-details-marker { display: none; }
.region-block > summary::before { content: "▸"; font-size: 12px; }
.region-block[open] > summary::before { content: "▾"; }
.region-block > summary b { font-size: 14.5px; font-weight: 800; }
.region-body { padding: 12px; display: grid; gap: 12px; }
.region-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.region-tools .field { flex: 1 1 220px; }
.region-tools .inline-edit { background: var(--sheet) !important; padding: 8px 11px !important; margin: 0; }
.region-body .table-wrap { background: var(--sheet); }

/* Reportes */
.report-bar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px; }

/* ---------- Ventana modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 25; background: rgba(10, 10, 12, .55); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal-card {
  width: 100%; max-width: 560px; max-height: calc(100vh - 32px); display: flex; flex-direction: column;
  background: var(--sheet); border-radius: 22px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); overflow: hidden;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 8px; }
.modal-head h2 { margin: 0; font-size: 18px; font-weight: 800; }
.modal-body { padding: 8px 18px 16px; overflow-y: auto; display: grid; gap: 12px; }
.modal-foot { display: flex; gap: 8px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.modal-foot .spacer { flex: 1; }
.screen-edit { display: grid; gap: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.form-grid .field select, .form-grid .field input { width: 100%; }
.checklist { max-height: 320px; overflow-y: auto; border: 1px solid var(--line); border-radius: 14px; padding: 6px; display: grid; gap: 2px; margin-top: 12px; }
.check { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; cursor: pointer; font-size: 13px; }
.check:hover { background: var(--field); }
.check.all { border-bottom: 1px solid var(--line); border-radius: 0; margin-bottom: 4px; }
.check .sub { margin-left: auto; }
.check input { width: 16px; height: 16px; accent-color: #0e0e10; }
.add-summary { font-weight: 700; margin-top: 10px; }

/* ---------- Usuarios ---------- */
.role-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.role-card { border-radius: 14px; padding: 12px 14px; display: grid; gap: 4px; font-size: 12.5px; color: rgba(0, 0, 0, .65); }
.role-card b { color: var(--text); font-size: 14px; }
.chip.role-admin { background: #0e0e10; color: var(--lime); }
.chip.role-contenido { background: var(--tint-lavender); color: #3b2f8f; }
.chip.role-tecnico { background: var(--tint-mint); color: #1f5c5c; }
.chip.role-reportes { background: var(--tint-lime); color: #4b5320; }
table.data tr.muted td { opacity: .5; }
.pw-row { display: flex; gap: 6px; }
.pw-row input { flex: 1; font-family: ui-monospace, Menlo, monospace; }
.span-2 { grid-column: 1 / -1; }
.copy-box {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--field);
  font: 13px/1.5 ui-monospace, Menlo, monospace; resize: none; margin-top: 8px;
}
.account-top { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.title-text { font-size: 17px; font-weight: 800; }
select:disabled, input:disabled { opacity: .6; cursor: not-allowed; }

/* ---------- Inicio de sesión ---------- */
.login {
  position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center;
  background: var(--ink); padding: 16px;
}
.login[hidden] { display: none; }
.login-card {
  width: 100%; max-width: 360px; padding: 34px 28px; display: grid; gap: 12px; text-align: center; justify-items: center;
  background: var(--dark); border-radius: 24px; color: var(--on-dark);
}
.login-card h1 { margin: 6px 0 0; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.login-card p { margin: 0 0 6px; color: var(--on-dark-muted); }
.login-card input { width: 100%; padding: 12px 14px; background: var(--dark-2); color: var(--on-dark); }
.login-card input + input { margin-top: -4px; }
.login-card .btn { width: 100%; padding: 12px; }
.login-error { color: #ff8a95; min-height: 20px; font-size: 13px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0;
  background: #0e0e10; color: #fff; padding: 11px 18px; border-radius: 999px; font-weight: 600;
  transition: opacity .2s, transform .2s; pointer-events: none; max-width: calc(100% - 32px); z-index: 30;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Tamaños de pantalla ---------- */
/* iPad y laptops chicas: sin panel lateral */
@media (max-width: 1180px) {
  .shell { grid-template-columns: 72px minmax(0, 1fr); }
  .side { display: none; }
}
.split > * { min-width: 0; }
@media (max-width: 960px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .pl-list { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; }
}
/* Celular: barra de iconos abajo */
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; padding: 0; height: auto; min-height: 100vh; display: block; }
  .main { border-radius: 0; min-height: 100vh; overflow: visible; padding-bottom: 84px; }
  main { padding: 18px 14px 24px; padding-top: max(18px, env(safe-area-inset-top)); }
  .head h1 { font-size: 23px; }
  .sheet { padding: 14px; }
  .rail {
    position: fixed; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); z-index: 10;
    flex-direction: row; justify-content: space-around; padding: 8px; border-radius: 22px; overflow: visible;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .25);
  }
  .rail-logo, .rail-sep, .rail-spacer { display: none; }
  .rail button { width: 48px; height: 48px; }
  .grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat b { font-size: 21px; }
  .hide-sm { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .role-grid { grid-template-columns: 1fr 1fr; }
  .rail #logout { display: none; } /* en el celular "Salir" está dentro de Mi cuenta */
  .filters select { flex: 1 1 140px; }
  .rail button { width: 40px; height: 40px; flex: none; }
  .rail { gap: 4px; padding: 7px 6px; justify-content: space-between; }
  .rail button svg { width: 18px; height: 18px; }
  .modal { align-items: flex-end; padding: 0; }
  .modal-card { border-radius: 22px 22px 0 0; max-height: 92vh; }
  .item-main { grid-template-columns: 22px 64px minmax(0, 1fr) auto; }
  .item .mini { width: 64px; }
  .item .moves { grid-column: 1 / -1; justify-content: flex-end; }
  .upload { grid-template-columns: 1fr 80px 40px; }
  .toast { bottom: 96px; }
}
