/* Gestión RST Granada · F1a · barra superior con mega-menú por categorías */
.erp-top { position: sticky; top: 0; z-index: 50; padding: .55rem 1.2rem; gap: .8rem; flex-wrap: nowrap; }
.erp-top .brand { flex: 0 0 auto; font-size: 1.12rem; }
.erp-top .brand .crest { height: 2.3rem; }
.mm { flex: 1 1 auto; min-width: 0; }
.mm-tabs { list-style: none; display: flex; gap: .15rem; margin: 0; padding: 0; flex-wrap: wrap; }
.mm-tab { position: static; }
.mm-tab-btn { background: transparent; color: var(--cream-2); border-radius: 10px; padding: .5rem .8rem; font-weight: 600; font-size: .95rem; display: inline-flex; align-items: center; gap: .35rem; }
.mm-tab-btn:hover, .mm-tab.open > .mm-tab-btn, .mm-tab-btn:focus-visible { background: rgba(200,176,122,.22); color: #fff; outline: none; }
.mm-tab.on > .mm-tab-btn { box-shadow: inset 0 -3px 0 var(--rst-gold); color: #fff; }
.mm-badge { background: #c0392b; color: #fff; border-radius: 999px; font-size: .7rem; padding: 0 .38rem; line-height: 1.25rem; min-width: 1.25rem; text-align: center; }
.mm-sup { background: var(--rst-gold); color: var(--rst-green); border-radius: 6px; font-size: .65rem; padding: 0 .3rem; }
.mm-panel { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #fbfaf5; border-top: 3px solid var(--rst-gold); box-shadow: 0 18px 40px rgba(0,0,0,.25); padding: 1.1rem 1.6rem 1.3rem; gap: 1.6rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); z-index: 60; }
.mm-tab.open > .mm-panel { display: grid; }
.mm-panel-small { left: auto; right: auto; min-width: 260px; max-width: 420px; grid-template-columns: 1fr; border-radius: 0 0 12px 12px; }
.mm-tabs .mm-panel-small { margin-left: 1rem; }
.mm-panel-right { left: auto; right: 1rem; }
.erp-who .mm-panel-right:not(.mm-panel-small) { left: 0; right: 0; }
.mm-col h3 { font-family: system-ui, sans-serif; font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; color: #8a7a4f; margin: 0 0 .5rem; border-bottom: 1px solid #e6dfc9; padding-bottom: .35rem; }
.mm-col a { display: block; color: var(--rst-green); text-decoration: none; padding: .32rem .4rem; border-radius: 8px; font-size: .94rem; }
.mm-col a:hover, .mm-col a:focus-visible, .mm-col a.on { background: #efe8d3; outline: none; }
.mm-col form { margin: .5rem 0 0; }
.mm-soon { display: block; color: #a39f90; padding: .32rem .4rem; font-size: .9rem; cursor: default; }
.mm-soon em { font-style: normal; font-size: .66rem; background: #ece9df; color: #8b8676; border-radius: 6px; padding: 0 .3rem; margin-left: .2rem; }
.erp-who { flex: 0 0 auto; display: flex; align-items: center; gap: .3rem; flex-wrap: nowrap; }
.erp-who .mm-tab-btn { padding: .45rem .6rem; }
.mm-gear .mm-tab-btn { font-size: 1.15rem; }
.mm-icon { color: var(--cream-2); text-decoration: none; padding: .35rem .45rem; border-radius: 10px; position: relative; }
.mm-icon .mm-badge { position: absolute; top: -2px; right: -4px; }
.mm-search input { width: 190px; padding: .38rem .7rem; border-radius: 999px; border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.12); color: #fff; }
.mm-search input::placeholder { color: rgba(255,255,255,.7); }
.mm-burger { display: none; background: transparent; color: #fff; font-size: 1.4rem; padding: .2rem .6rem; }

.subbar { position: sticky; top: 3.4rem; z-index: 40; background: rgba(251,250,245,.97); border-bottom: 1px solid #e0d8c0; padding: .35rem 1.3rem 0; box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.crumbs { font-size: .8rem; color: #6c6a5c; padding-bottom: .25rem; }
.crumbs a { color: #6c6a5c; }
.subtabs { display: flex; gap: .2rem; overflow-x: auto; }
.subtabs a { white-space: nowrap; text-decoration: none; color: var(--rst-green); padding: .4rem .75rem; border-radius: 8px 8px 0 0; font-size: .9rem; border-bottom: 3px solid transparent; }
.subtabs a:hover { background: #f1ecdc; }
.subtabs a.on { border-bottom-color: var(--rst-gold); font-weight: 700; }

@media (max-width: 1100px) {
  .mm-search input { width: 130px; }
  .mm-tab-btn { padding: .45rem .55rem; font-size: .9rem; }
}
@media (max-width: 900px) {
  .erp-top { flex-wrap: wrap; }
  .mm-burger { display: inline-block; margin-left: auto; }
  .mm { order: 5; flex-basis: 100%; display: none; }
  .mm.mobile-open { display: block; }
  .mm-tabs { flex-direction: column; }
  .mm-panel, .mm-panel-small { position: static; box-shadow: none; border-top: 0; border-radius: 10px; margin: .2rem 0 .5rem; max-width: none; grid-template-columns: 1fr; padding: .7rem 1rem; }
  .mm-search { display: none; }
  .subbar { top: 0; position: relative; }
}

/* Componentes de las pantallas de F1a */
.erp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.erp-head h1 { margin: 0; display: inline-block; padding: .4rem 1rem; background: var(--cream-2); border-radius: 16px; box-shadow: var(--shadow); }
.erp-head .actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .7rem; margin-bottom: 1rem; }
.kpi { background: var(--cream-2); border-radius: 14px; padding: .7rem .9rem; box-shadow: var(--shadow); border-left: 4px solid var(--rst-gold); }
.kpi b { display: block; font-size: 1.5rem; color: var(--rst-green); font-family: Palatino, Georgia, serif; }
.kpi span { font-size: .82rem; color: #5d6754; }
.kpi.warn { border-left-color: #c0392b; }
.kpi.ok { border-left-color: #3f6a32; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.tbl-wrap { overflow-x: auto; }
table.erp td, table.erp th { padding: .42rem .45rem; font-size: .9rem; vertical-align: middle; }
table.erp tr:hover td { background: rgba(200,176,122,.12); }
table.erp .num { text-align: right; font-variant-numeric: tabular-nums; }
.st { display: inline-block; border-radius: 999px; padding: .08rem .55rem; font-size: .78rem; font-weight: 600; background: #e4ebc4; color: var(--olive-deep); white-space: nowrap; }
.st-solicitante, .st-pendiente, .st-borrador, .st-registrada { background: #fff2cc; color: #7a5b00; }
.st-activo, .st-cumplido, .st-validada, .st-aprobado, .st-convocada, .st-congelado, .st-cerrada { background: #dcefd2; color: #2f5a22; }
.st-suspendido, .st-bloqueado, .st-rechazada, .st-rechazado, .st-devuelta, .st-anulada { background: #f8d7d4; color: #8d2f2f; }
.st-baja, .st-fallecido, .st-revocada, .st-anulado, .st-no_aplica { background: #e5e5e5; color: #555; }
.st-baja_temporal, .st-en_curso, .st-publicado, .st-celebrada { background: #d7eef5; color: #1f5468; }
.tabs-local { display: flex; gap: .3rem; flex-wrap: wrap; margin: 0 0 .8rem; }
.tabs-local a { text-decoration: none; padding: .4rem .8rem; border-radius: 999px; background: rgba(251,250,245,.85); color: var(--rst-green); font-size: .9rem; }
.tabs-local a.on { background: var(--rst-gold); font-weight: 700; }
.field-row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; }
.field-row label.field { flex: 1 1 180px; margin-bottom: .3rem; }
.inline { display: inline; }
.inline-form { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; margin: 0; }
.inline-form select, .inline-form input { width: auto; padding: .3rem .45rem; font-size: .88rem; }
.btn.small, button.small { padding: .28rem .65rem; font-size: .82rem; }
.btn.danger, button.danger { background: #b0413e; color: #fff; }
.help { font-size: .82rem; color: #6c6a5c; margin: .15rem 0 .4rem; }
.art { font-size: .72rem; background: #eef1e2; color: #4f6240; padding: 0 .35rem; border-radius: 6px; margin-left: .3rem; white-space: nowrap; }
.warnbox { background: #fff4e0; border: 1px solid #e8c88f; border-radius: 12px; padding: .65rem .9rem; margin-bottom: .8rem; }
.okbox { background: #e7f0d4; border: 1px solid #b7c98a; border-radius: 12px; padding: .65rem .9rem; margin-bottom: .8rem; }
.dangerbox { background: #fdecec; border: 1px solid #e7b8b8; border-radius: 12px; padding: .65rem .9rem; margin-bottom: .8rem; }
.matrix th.rot { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; font-size: .78rem; padding: .4rem .2rem; }
.matrix td.cell { text-align: center; font-weight: 700; font-family: ui-monospace, monospace; }
.matrix td.c-T { background: #cfe6c1; } .matrix td.c-G { background: #e1efc9; } .matrix td.c-A { background: #fde7b0; }
.matrix td.c-I { background: #e2d9f3; } .matrix td.c-V { background: #e8f1f6; } .matrix td.c-P { background: #f3ecd9; }
.perm-grid select { padding: .2rem .3rem; font-size: .8rem; width: auto; }
.perm-grid td { text-align: center; }
.perm-grid td:first-child { text-align: left; }
.fees td.fee { text-align: center; font-family: ui-monospace, monospace; font-size: .82rem; padding: .25rem; min-width: 2.2rem; }
.fees td.fee a { text-decoration: none; display: block; border-radius: 6px; padding: .15rem 0; color: inherit; }
.f-pendiente { background: #fffbe8; } .f-emitida { background: #fff2cc; } .f-remesada { background: #d7eef5; }
.f-cobrada, .f-pagada_recepcion { background: #cfe6c1; } .f-devuelta { background: #f4c7c3; font-weight: 700; } .f-reintentada { background: #f8dcb8; }
.f-exenta { background: #ece9df; } .f-anulada { background: #e5e5e5; color: #777; } .f-no_aplica { background: transparent; color: #bbb; }
.f-debt { outline: 2px solid #c0392b; outline-offset: -2px; }
.legend-fees span { display: inline-block; padding: .1rem .45rem; border-radius: 6px; margin: 0 .2rem .2rem 0; font-size: .78rem; }
.photo { width: 120px; height: 150px; object-fit: cover; border-radius: 10px; background: #e9e6da; display: flex; align-items: center; justify-content: center; color: #9b977f; font-size: 2.5rem; }
.ficha-head { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.ficha-head .meta { flex: 1; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: .25rem .9rem; margin: 0; font-size: .92rem; }
dl.kv dt { color: #6c6a5c; } dl.kv dd { margin: 0; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { border-left: 3px solid var(--rst-gold); padding: .25rem 0 .55rem .8rem; position: relative; font-size: .9rem; }
.timeline li small { color: #6c6a5c; }
.quorum { font-size: 1.1rem; }
.bar { height: 10px; background: #e6e2d3; border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--rst-green-2); }
@media print {
  .erp-top, .subbar, .court, .no-print, .flash { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 0; }
  .wrap { padding: 0; }
}

/* ===== Fase 1a+ / 1b: registro, cloud, IA ===== */
.st-registrado, .st-propuesta { background: #fff2cc; color: #7a5b00; }
.st-en_tramite { background: #d7eef5; color: #1f5468; }
.st-respondido, .st-archivado, .st-ejecutada { background: #dcefd2; color: #2f5a22; }
.st-descartada { background: #e5e5e5; color: #555; }
.st-error { background: #f8d7d4; color: #8d2f2f; }
.lvl { display: inline-block; min-width: 2.1em; text-align: center; border-radius: 4px; padding: 0 .35rem; font-size: .75rem; font-weight: 700; letter-spacing: .02em; border: 1px solid transparent; }
.lvl-0 { background: #eef3e3; color: #4f6240; border-color: #c9d3b4; }
.lvl-1 { background: #dcefd2; color: #2f5a22; }
.lvl-2 { background: #d7eef5; color: #1f5468; }
.lvl-3 { background: #fff2cc; color: #7a5b00; }
.lvl-4 { background: #f8d7d4; color: #8d2f2f; }
.lvl-5 { background: #3b2020; color: #fff; }
.ficha-dl { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; margin: .5rem 0 1rem; }
.ficha-dl dt { font-weight: 600; color: var(--olive-deep); }
.ficha-dl dd { margin: 0; }
ul.plain { list-style: none; padding: 0; margin: .3rem 0; }
ul.plain li { padding: .25rem 0; border-bottom: 1px dashed var(--line); }
ul.plain li.on { font-weight: 700; }
form.inline { display: inline; }
.ai-out:empty { display: none; }
.ai-out { margin-top: .7rem; padding: .8rem 1rem; border-left: 4px solid var(--ball); background: #fbfbf4; border-radius: 6px; }
.ai-out.loading::after { content: 'Pensando…'; color: #777; font-style: italic; }
.ai-out .ai-apply { margin-top: .5rem; }
.ai-layout { display: grid; grid-template-columns: 260px 1fr; gap: 1rem; align-items: start; }
.ai-side { max-height: 75vh; overflow: auto; }
.ai-chat { display: flex; flex-direction: column; min-height: 60vh; }
.ai-msgs { flex: 1; display: flex; flex-direction: column; gap: .7rem; max-height: 62vh; overflow: auto; padding: .3rem; }
.ai-msg { padding: .6rem .9rem; border-radius: 10px; max-width: 88%; line-height: 1.5; }
.ai-msg.me { align-self: flex-end; background: var(--court-light); }
.ai-msg.bot { align-self: flex-start; background: #f4f5ee; border: 1px solid var(--line); }
.ai-msg.bot p:first-child { margin-top: 0; } .ai-msg.bot p:last-child { margin-bottom: 0; }
.ai-msg.bot table { border-collapse: collapse; } .ai-msg.bot td, .ai-msg.bot th { border: 1px solid var(--line); padding: .2rem .4rem; }
.ai-msg.err { align-self: stretch; background: #f8d7d4; color: #8d2f2f; }
.ai-meta { display: block; margin-top: .4rem; font-size: .72rem; }
.ai-action { margin-top: .5rem; padding: .5rem .7rem; border-radius: 6px; border: 1px dashed var(--olive); }
.ai-form textarea { width: 100%; box-sizing: border-box; }
.ai-form .actions { display: flex; gap: .5rem; margin-top: .4rem; }
.ai-empty { color: #444; }
.ai-form.sending button[type=submit], .ai-form.sending button:not([form]) { opacity: .6; pointer-events: none; }
@media (max-width: 800px) { .ai-layout { grid-template-columns: 1fr; } .ai-msg { max-width: 100%; } }
.ai-prov fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.ai-prov label.field input:not([type=checkbox]), .ai-prov label.field select { width: 100%; box-sizing: border-box; }
.ai-prov label.field > span { display: flex; align-items: center; gap: .35rem; padding-bottom: .45rem; }
.subtabs { display: flex; gap: .3rem; flex-wrap: wrap; align-items: center; margin: 0 0 .8rem; }
.subtabs > a { text-decoration: none; padding: .4rem .8rem; border-radius: 999px; background: rgba(251,250,245,.9); color: var(--rst-green); font-size: .9rem; }
.subtabs > a.on { background: var(--rst-gold); font-weight: 700; }
.subtabs .inline-form { display: flex; gap: .3rem; }
.subtabs ~ p.crumbs, .subtabs ~ p.muted, .subtabs ~ p.help, .erp-head ~ p.help { background: rgba(251,250,245,.92); padding: .45rem .8rem; border-radius: 8px; margin: 0 0 .6rem; }
.subtabs ~ p.crumbs a { color: var(--link); }
/* F3 · cuadro de pistas estilo Playtomic */
.board-wrap { overflow-x: auto; }
.board { border-collapse: separate; border-spacing: 3px; min-width: 100%; font-size: .82rem; }
.board th { position: sticky; top: 0; background: #fbfaf5; font-weight: 600; padding: .3rem .4rem; white-space: nowrap; }
.board th.court { text-align: left; left: 0; z-index: 2; min-width: 120px; }
.board td { height: 2.4rem; min-width: 64px; border-radius: 8px; padding: 0; text-align: center; vertical-align: middle; }
.board td.free { background: #eef5e4; }
.board td.free a { display: block; height: 100%; line-height: 2.4rem; color: #3f6212; text-decoration: none; font-weight: 600; }
.board td.free a:hover { background: #cfe3b5; border-radius: 8px; }
.board td.past { background: #f1f0eb; }
.board td.reserva { background: #1f5468; color: #fff; }
.board td.reserva a { color: #fff; text-decoration: none; display: block; padding: .15rem; }
.board td.reserva.prov { background: #b98a1d; }
.board td.reserva.open { background: #6a3d8f; }
.board td.bloqueo { background: repeating-linear-gradient(45deg, #e9d6b0, #e9d6b0 6px, #f3e6c8 6px, #f3e6c8 12px); color: #6b4e12; }
.board td.playtomic { background: #222; color: #ccff00; }
.board td.off { background: #e5e5e5; color: #777; }
.board small { display: block; font-size: .7rem; opacity: .85; }
.legend span { display: inline-block; padding: .1rem .5rem; border-radius: 6px; margin-right: .3rem; font-size: .78rem; }
.st-confirmada, .st-jugada, .st-pagado, .st-cobrada, .st-aprobada, .st-entregado, .st-resuelta, .st-ok, .st-enlazado, .st-coincide, .st-alta, .st-pagada { background: #dcefd2; color: #2f5a22; }
.st-provisional, .st-recibo, .st-solicitada, .st-custodia, .st-abierta, .st-asignada, .st-dudoso, .st-a_devolver, .st-parcial { background: #fff2cc; color: #7a5b00; }
.st-cancelada, .st-no_show, .st-fallido, .st-error, .st-desplazada, .st-urgente, .st-sin_socio { background: #f8d7d4; color: #8d2f2f; }
.st-devuelto, .st-gratis, .st-ignorado, .st-donado, .st-desechado, .st-caducado { background: #e5e5e5; color: #555; }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }
/* F6 · Manual y asistente de la Junta */
.manual-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .8rem; margin: 1rem 0; }
.manual-card { display: block; color: inherit; text-decoration: none; }
.manual-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.manual-card h3 { margin: 0 0 .3rem; font-size: 1rem; }
.manual-card p { margin: 0 0 .4rem; font-size: .9rem; }
.manual-layout { display: grid; grid-template-columns: 240px 1fr; gap: 1rem; align-items: start; }
.manual-side { position: sticky; top: 1rem; max-height: 85vh; overflow: auto; }
.manual-side li.on a { font-weight: 700; }
.manual-screen { scroll-margin-top: 1rem; }
.manual-screen:target { outline: 2px solid #e8c88f; }
.manual-body ol, .manual-body ul { padding-left: 1.3rem; }
.manual-hit { border-bottom: 1px solid #eee; padding: .5rem 0; }
.manual-hit h3 { margin: 0; font-size: 1rem; }
.manual-msgs { max-height: 50vh; }
.kn-stats { display: flex; gap: .6rem; flex-wrap: wrap; font-size: .85rem; }
@media (max-width: 800px) { .manual-layout { grid-template-columns: 1fr; } .manual-side { position: static; } }
/* Histórico de conversaciones IA (ayuda del manual y asistente de la Junta) */
.ai-history tr.on td { background: rgba(200,176,122,.18); }
.ai-history td small.muted { display: inline-block; max-width: 60ch; }
.ai-rename { display: inline-block; margin-left: .3rem; }
.ai-rename form { margin-top: .25rem; }
.ai-rename input[name=title] { min-width: 18rem; }
.ai-conv-head { margin-bottom: .6rem; padding-bottom: .4rem; border-bottom: 1px solid rgba(0,0,0,.08); }
.manual-help .erp-head { margin-bottom: .3rem; }
.manual-help .erp-head h2 { margin: 0; }

/* «⤢ Ampliar» genérico (public/js/erp.js) */
.erp-amp-bar { display: flex; justify-content: flex-end; margin: .15rem 0 .1rem; }
.erp-amp-bar[hidden] { display: none; }
.erp-amp-btn { font: inherit; font-size: .78rem; line-height: 1.2; padding: .12rem .55rem; border-radius: 999px; border: 1px solid #c9c6b4; background: #fbfaf4; color: #2f4a2f; cursor: pointer; }
.erp-amp-btn:hover, .erp-amp-btn:focus-visible { background: #2f4a2f; color: #fff; border-color: #2f4a2f; }
textarea.erp-amp-on { overflow: hidden !important; max-height: none !important; resize: vertical; }
.erp-amp-on:not(textarea) { max-height: none !important; height: auto !important; overflow: visible !important; }

/* ===== Contraste sobre fondo oscuro (13/10/2026) =====
   Franjas de enlaces, textos de ayuda y filtros que van directamente sobre la foto
   del fondo: panel crema translúcido, enlaces azules y textos grises (WCAG AA). */
:root { --strip-bg: rgba(250,248,240,.93); --strip-link: #1f5fa8; --strip-link-h: #123f75; --strip-text: #555; }
main.wrap nav.tabs, main.wrap > nav, .wrap > nav.tabs {
  background: var(--strip-bg); border: 1px solid #e0d8c0; border-radius: 12px; padding: .45rem .7rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.12); gap: .2rem .3rem; }
main.wrap nav.tabs a, main.wrap > nav a { color: var(--strip-link); text-decoration: none; padding: .2rem .55rem; border-radius: 999px; font-weight: 500; }
main.wrap nav.tabs a:hover, main.wrap nav.tabs a:focus-visible, main.wrap > nav a:hover { color: var(--strip-link-h); text-decoration: underline; background: #e9eef6; }
main.wrap nav.tabs a.active, main.wrap nav.tabs a.on, main.wrap nav.tabs a[aria-current] { background: var(--strip-link); color: #fff; font-weight: 700; text-decoration: none; }
/* Párrafos, ayudas, títulos sueltos y filtros que cuelgan directamente del contenido */
main.wrap > p, main.wrap > p.muted, main.wrap > p.help, main.wrap > h2, main.wrap > h3,
main.wrap > form.field-row, main.wrap > form.inline-form, main.wrap > form.no-print:not([class*="card"]),
main.wrap > .cal-tools, main.wrap > div > .cal-tools {
  background: var(--strip-bg); border-radius: 10px; padding: .45rem .8rem; color: #333; width: fit-content; max-width: 100%; box-sizing: border-box; }
main.wrap > form.field-row, main.wrap > form.no-print { padding: .5rem .8rem; }
main.wrap > p.muted, main.wrap > p.muted small, main.wrap > p.help, main.wrap > form label, main.wrap > form.field-row label.field { color: var(--strip-text); }
main.wrap > p a, main.wrap > p.muted a { color: var(--strip-link); }
main.wrap > p.muted code { background: #ece8dc; color: #333; border-radius: 4px; padding: 0 .25rem; }
.crumbs, .crumbs a { color: #555; }
/* Botones fantasma sobre el fondo: que no sean transparentes */
main.wrap .erp-head .btn.ghost, main.wrap > .actions .btn.ghost, main.wrap .actions > .btn.ghost, main.wrap form.inline > .btn.ghost {
  background: rgba(250,248,240,.95); color: #234a2a; border-color: #b9b39b; }
.lead-light { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.75); }
@media print { main.wrap > p, main.wrap > h2, main.wrap nav.tabs { background: none; box-shadow: none; border: 0; } }

/* Cabecera: entre 901 y 1500 px el menú pasa a una segunda fila completa (una sola línea) */
.mm-tab-btn { white-space: nowrap; }
@media (min-width: 901px) and (max-width: 1500px) {
  .erp-top { flex-wrap: wrap; row-gap: .15rem; padding-top: .4rem; padding-bottom: .25rem; }
  .erp-top .mm { order: 10; flex: 1 1 100%; }
  .mm-tabs { flex-wrap: wrap; justify-content: flex-start; gap: .1rem; }
  .mm-tab-btn { padding: .38rem .62rem; font-size: .92rem; }
  .erp-top .erp-who, .erp-top > :not(.brand):not(.mm) { margin-left: auto; }
  .subbar { top: var(--erp-top-h, 5.05rem); }
}

/* Paginación (marcado Bootstrap 5 de Laravel, sin Bootstrap cargado) */
nav .pagination, ul.pagination { display:flex; flex-wrap:wrap; gap:.3rem; list-style:none; padding:0; margin:1rem 0 .4rem; }
.pagination .page-item { margin:0; }
.pagination .page-link { display:inline-block; min-width:2.1rem; padding:.3rem .65rem; border:1px solid #c9d8e6; border-radius:8px; background:#fff; color:#1f5fa8; text-decoration:none; text-align:center; font-size:.9rem; line-height:1.3; }
.pagination a.page-link:hover { background:#eaf2fa; color:#123f75; }
.pagination .page-item.active .page-link { background:#eaf2fa; border-color:#1f5fa8; color:#123f75; font-weight:700; }
.pagination .page-item.disabled .page-link { color:#8a96a3; background:#f5f7f9; border-color:#e1e6eb; }
nav:has(.pagination) > .d-sm-none { display:none; }
nav:has(.pagination) > .d-sm-flex { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:.5rem; }
nav:has(.pagination) .small.text-muted, nav:has(.pagination) p.small { color:#5f6b76; font-size:.85rem; margin:.2rem 0; }
nav:has(.pagination) .fw-semibold { font-weight:600; color:#24303a; }
.pagination svg, nav[role=navigation] svg { width:1rem; height:1rem; }

/* Subgrupo dentro de una columna del mega-menú */
.mm-col h3.mm-sub { margin-top: 1rem; }

/* Mega-menús más anchos que altos: hasta 5 columnas equilibradas, nunca más altos que la ventana (scroll interno) */
@media (min-width: 901px) {
  .mm-tab.open > .mm-panel:not(.mm-panel-small) { display: block; column-count: var(--mm-cols, 4); column-gap: 1.8rem; column-fill: balance; max-height: calc(100vh - 7rem); overflow-y: auto; overscroll-behavior: contain; }
  .mm-panel:not(.mm-panel-small) .mm-col { break-inside: auto; margin-bottom: 1rem; }
  .mm-panel .mm-col h3 { break-after: avoid; break-inside: avoid; }
  .mm-panel .mm-col a, .mm-panel .mm-soon { break-inside: avoid; }
  .mm-tab.open > .mm-panel-small { max-height: calc(100vh - 7rem); overflow-y: auto; }
}
@media (min-width: 901px) and (max-width: 1500px) {
  .mm-tab.open > .mm-panel:not(.mm-panel-small) { column-count: min(var(--mm-cols, 4), 4); padding: .9rem 1.2rem 1rem; }
  .mm-col a { padding: .26rem .4rem; font-size: .9rem; }
}
@media (min-width: 901px) and (max-width: 1100px) {
  .mm-tab.open > .mm-panel:not(.mm-panel-small) { column-count: min(var(--mm-cols, 3), 3); }
}
@media (max-width: 900px) {
  .mm-tab.open > .mm-panel { display: block; column-count: 1; max-height: none; }
}
@media (min-width: 600px) and (max-width: 900px) {
  .mm-tab.open > .mm-panel:not(.mm-panel-small) { column-count: 2; column-gap: 1.2rem; }
}
/* Mega-menú a todo el ancho de la ventana (escritorio) */
@media (min-width: 901px) {
  .mm-tab.open > .mm-panel:not(.mm-panel-small) { position: fixed; left: 1rem; right: 1rem; top: var(--mm-top, 4.6rem); width: auto; }
}
/* Listados: sin scroll vertical interno; solo el de la página. Cabecera fija respecto a la página. */
@media (min-width: 901px) {
  .tbl-wrap { overflow: visible; }
  table.erp thead th, .pend-table thead th { position: sticky; top: 0; z-index: 2; }
  table.erp thead th { background: #fbfaf5; }
}
@media (min-width: 901px) { table.erp thead th, .pend-table thead th { top: var(--erp-hdr-h, 0px); } }

/* Enlace «Ver todo» del desplegable (página de sección) */
.mm-panel .mm-all{display:block;break-before:column-avoid;break-inside:avoid;margin:.8rem 0 0;padding:.55rem .9rem;border-radius:10px;background:#1f5a3a;color:#fff!important;font-weight:700;text-align:center;text-decoration:none;column-span:all}
.mm-panel .mm-all:hover{background:#174630}

/* El desplegable siempre debajo de su pestaña; la barra del menú por encima del panel */
.erp-top{position:relative;z-index:80}
.mm-tab > .mm-tab-btn{position:relative;z-index:2}
@media (min-width: 901px) {
  .mm-tab.open > .mm-panel:not(.mm-panel-small){top:var(--mm-top, 100%);z-index:1}
  .mm-tab.open > .mm-panel-small{top:100%}
}
/* Migas de pan y franja de subpestañas: estáticas bajo el menú, nunca sticky/fixed (tapaban el contenido al hacer scroll) */
.subbar, .crumbs, p.crumbs { position: static !important; top: auto !important; }

/* Desplegable del buscador global (menú + resultados) */
.mm-search { position: relative; }
.mm-suggest { position: absolute; right: 0; top: calc(100% + .35rem); width: 380px; max-width: 92vw; max-height: 70vh; overflow-y: auto; background: #fffdf7; color: #1d2a1d; border: 1px solid #e0d8c0; border-radius: 12px; box-shadow: 0 10px 28px rgba(0,0,0,.25); z-index: 1200; padding: .3rem 0; text-align: left; }
.mm-sg-group { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #8a6d1f; padding: .45rem .9rem .2rem; }
.mm-sg-item { display: flex; gap: .6rem; align-items: center; padding: .4rem .9rem; color: inherit; text-decoration: none; }
.mm-sg-item:hover, .mm-sg-item.on { background: #f1ead2; }
.mm-sg-ico { width: 1.4rem; text-align: center; flex: none; }
.mm-sg-txt { display: flex; flex-direction: column; min-width: 0; }
.mm-sg-txt b { font-weight: 600; font-size: .92rem; }
.mm-sg-txt small { color: #6c6a5c; font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mm-sg-all { border-top: 1px solid #ece4cc; margin-top: .25rem; font-size: .82rem; color: #1e568f; }
.mm-sg-empty { padding: .5rem .9rem; color: #6c6a5c; font-size: .85rem; }
.search-menu-item { display: flex; gap: .55rem; align-items: baseline; padding: .2rem 0; }
.search-menu-item small { color: #6c6a5c; }
.erp-top .mm-search .mm-suggest a.mm-sg-item, .erp-top .mm-search .mm-suggest a.mm-sg-item b { color: #1d2a1d; }
.erp-top .mm-search .mm-suggest a.mm-sg-item small { color: #6c6a5c; }
.erp-top .mm-search .mm-suggest a.mm-sg-all { color: #1e568f; }

/* Buscador/filtros a ancho completo: rejilla responsive (Campañas, Estadísticas de envío, Eventos…) */
.filter-grid, form.filter-grid, .card.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .6rem .9rem; align-items: end; width: 100%; box-sizing: border-box; }
.filter-grid label.field { margin: 0; min-width: 0; }
.filter-grid label.field input, .filter-grid label.field select { width: 100%; box-sizing: border-box; }
.filter-grid .filter-wide { grid-column: span 2; }
.filter-grid .filter-actions { display: flex; gap: .5rem; align-items: center; justify-content: flex-end; flex-wrap: wrap; grid-column: 1 / -1; }
.filter-grid .filter-note { grid-column: 1 / -1; margin: 0; }
@media (max-width: 640px) { .filter-grid .filter-wide { grid-column: auto; } }
