/* =====================================================================
   CCIC · Sistema de Ruedas de Negocios — hoja de estilos
   Identidad CCIC: turquesa del logo, gris carbón y blanco (ajustables en :root)
   ===================================================================== */
:root {
  --brand: #00787D;      /* turquesa institucional (versión con contraste para texto y botones) */
  --brand-600: #006469;
  --brand-50: #E5F4F4;
  --accent: #009196;     /* turquesa del logo */
  --ink: #252525;        /* gris carbón del logo */
  --bg: #F3F6F6;
  --surface: #FFFFFF;
  --surface-2: #F8FAFC;
  --border: #DDE3EA;
  --border-strong: #C5CED9;
  --text: #0F172A;
  --text-2: #475569;
  --text-3: #64748B;
  --ok: #15803D;
  --warn: #B45309;
  --danger: #B91C1C;
  --info: #1D4ED8;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .06);
  --sidebar-w: 248px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-titulos: 'Montserrat', 'Inter', system-ui, sans-serif;  /* tipografía geométrica como la del logo */
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 14px; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
small, .muted { color: var(--text-3); }
.boot { display: grid; place-items: center; height: 100vh; color: var(--text-3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Layout administrativo ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar { background: var(--brand); color: #E3F1F1; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { display: flex; gap: 10px; align-items: center; padding: 18px 18px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar .brand b { color: #fff; font-size: 15px; display: block; }
.sidebar .brand small { color: #CDEBEC; font-size: 11px; }
.logo-mark { width: 36px; height: 36px; border-radius: 9px; background: #fff; color: var(--brand); display: grid; place-items: center; font-weight: 800; font-size: 12px; flex: none; position: relative; overflow: hidden; }
.logo-mark::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: var(--accent); }
.nav { padding: 10px 8px; display: flex; flex-direction: column; gap: 1px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; color: #E3F1F1; font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.nav a.active { background: #fff; color: var(--brand); }
.nav a.active .ico { color: var(--accent); }
.nav .sep { height: 1px; background: rgba(255,255,255,.08); margin: 8px 6px; }
.ico { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: middle; }
.sidebar .foot { margin-top: auto; padding: 14px 18px; font-size: 11px; color: #9FC9CB; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar .grow { flex: 1; }
.content { padding: 22px 24px 40px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--text-2); }
.menu-btn { display: none; }

/* ---------- Componentes ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.card-b { padding: 16px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.spacer { flex: 1; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-600); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { color: var(--danger); border-color: #F1C4C4; }
.btn.danger:hover { background: #FEF2F2; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.xs { height: 26px; padding: 0 8px; font-size: 12px; }
.btn.icon { width: 36px; padding: 0; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: 8px 0 0 8px; margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 8px 8px 0; }
.btn-group .btn.on { background: var(--brand); color: #fff; border-color: var(--brand); position: relative; z-index: 1; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); font: inherit; font-size: 13px; font-weight: 550; cursor: pointer; color: var(--text-2); }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }

label.f { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 550; color: var(--text-2); }
label.f .req { color: var(--accent); }
label.f small { font-weight: 400; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; padding: 0 10px; height: 36px; min-width: 0; width: 100%; }
textarea { padding: 8px 10px; height: auto; min-height: 72px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, .chip:focus-visible { outline: 2px solid color-mix(in srgb, var(--brand) 40%, transparent); outline-offset: 1px; border-color: var(--brand); }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: var(--brand); }
input[type=color] { padding: 2px; width: 52px; }
.check { display: inline-flex; gap: 8px; align-items: center; font-weight: 500; color: var(--text); cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.search { position: relative; }
.search input { padding-left: 32px; }
.search .ico { position: absolute; left: 9px; top: 9px; color: var(--text-3); }

table.t { width: 100%; border-collapse: separate; border-spacing: 0; }
table.t th { text-align: left; font-size: 12px; font-weight: 650; color: var(--text-2); text-transform: uppercase; letter-spacing: .02em; background: var(--surface-2);
  padding: 9px 12px; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 1; white-space: nowrap; }
table.t th.sortable { cursor: pointer; }
table.t td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.t tr:hover td { background: #FAFCFE; }
table.t tr.clickable { cursor: pointer; }
.table-wrap { overflow: auto; max-height: calc(100vh - 260px); border-radius: var(--radius); }
.num { text-align: right; font-variant-numeric: tabular-nums; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }
.badge.ok { background: #ECFDF3; color: var(--ok); border-color: #BBE5C8; }
.badge.warn { background: #FFF7E6; color: var(--warn); border-color: #F5D9A8; }
.badge.danger { background: #FEF2F2; color: var(--danger); border-color: #F5C2C2; }
.badge.info { background: #EFF4FF; color: var(--info); border-color: #C7D7FE; }
.badge.brand { background: var(--brand-50); color: var(--brand); border-color: #B3DFE0; }
.status { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 650; padding: 2px 8px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; }
.status .i { font-weight: 800; }

.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi .l { font-size: 12px; color: var(--text-3); font-weight: 550; text-transform: uppercase; letter-spacing: .03em; }
.kpi .v { font-size: 26px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; color: var(--brand); }
.kpi .s { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.kpi.accent .v { color: var(--accent); }
.kpi.ok .v { color: var(--ok); }
.kpi.warn .v { color: var(--warn); }

.alert { display: flex; gap: 10px; padding: 10px 14px; border-radius: 8px; border: 1px solid; font-size: 13px; }
.alert.warn { background: #FFFBEB; border-color: #F5D9A8; color: #7C4A03; }
.alert.info { background: #EFF4FF; border-color: #C7D7FE; color: #1E3A8A; }
.alert.danger { background: #FEF2F2; border-color: #F5C2C2; color: #7F1D1D; }
.alert.ok { background: #ECFDF3; border-color: #BBE5C8; color: #14532D; }
.alert details summary { cursor: pointer; font-weight: 600; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; font: inherit; font-weight: 600; color: var(--text-3); cursor: pointer; white-space: nowrap; }
.tabs button.on { color: var(--brand); border-bottom-color: var(--accent); }
.empty { padding: 36px 16px; text-align: center; color: var(--text-3); }
.empty b { display: block; color: var(--text-2); font-size: 15px; margin-bottom: 4px; }

.avatar { width: 36px; height: 36px; border-radius: 8px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; overflow: hidden; border: 1px solid var(--border); }
.avatar img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.avatar.lg { width: 64px; height: 64px; font-size: 20px; border-radius: 12px; }

/* ---------- Modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: grid; place-items: center; z-index: 100; padding: 16px; animation: fade .12s ease-out; }
.modal { background: var(--surface); border-radius: 14px; width: min(640px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(15,23,42,.3); }
.modal.wide { width: min(920px, 100%); }
.modal.narrow { width: min(460px, 100%); }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-h h2 { flex: 1; }
.modal-b { padding: 18px 20px; overflow-y: auto; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 14px 14px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }

#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 200; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: #0F172A; color: #fff; padding: 11px 14px; border-radius: 10px; box-shadow: var(--shadow); font-size: 13.5px; animation: fade .15s; display: flex; gap: 8px; }
.toast.error { background: #7F1D1D; }
.toast.ok { background: #14532D; }

.dl { display: grid; grid-template-columns: 170px 1fr; gap: 6px 14px; margin: 0; }
.dl dt { color: var(--text-3); font-weight: 550; }
.dl dd { margin: 0; word-break: break-word; }
.timeline { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.timeline li { border-left: 3px solid var(--brand-50); padding: 2px 0 2px 10px; font-size: 13px; }
.timeline li b { color: var(--brand); }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login .hero { background: linear-gradient(150deg, var(--brand) 0%, #1E2326 100%); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login .hero::after { content: ''; position: absolute; right: -80px; bottom: -80px; width: 320px; height: 320px; border-radius: 50%; border: 50px solid rgba(200,16,46,.35); }
.login .hero h1 { font-size: 34px; max-width: 460px; }
.login .hero p { color: #C7D5E7; max-width: 440px; font-size: 15px; line-height: 1.6; }
.login .panel { display: grid; place-items: center; padding: 32px 16px; }
.login form { width: min(380px, 100%); }

/* ---------- MATRIZ GENERAL ---------- */
.mx-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.mx-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-bottom: 12px; }
.mx-summary .kpi { padding: 10px 12px; }
.mx-summary .kpi .v { font-size: 20px; }
.mx-wrap { position: relative; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); height: calc(100vh - 330px); min-height: 380px; }
.mx-wrap.fs { position: fixed; inset: 0; z-index: 90; height: 100vh; border-radius: 0; }
.mx { border-collapse: separate; border-spacing: 0; font-size: calc(12.5px * var(--z, 1)); }
.mx th, .mx td { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.mx thead th { position: sticky; top: 0; z-index: 3; background: var(--brand); color: #fff; padding: 6px 8px; min-width: calc(150px * var(--z, 1)); max-width: calc(170px * var(--z, 1)); vertical-align: top; text-align: center; font-weight: 650; }
.mx thead th .n { display: inline-block; min-width: 20px; padding: 0 5px; border-radius: 5px; background: rgba(255,255,255,.18); font-size: .85em; margin-bottom: 3px; }
.mx thead th .nm { display: block; line-height: 1.2; text-transform: uppercase; letter-spacing: .01em; }
.mx thead th .ms { display: block; color: #CDEBEC; font-size: .85em; font-weight: 600; margin-top: 2px; }
.mx thead th img { width: 28px; height: 28px; object-fit: contain; background: #fff; border-radius: 5px; margin-bottom: 2px; }
.mx thead th.corner, .mx td.hr, .mx tfoot th { position: sticky; left: 0; z-index: 2; }
.mx thead th.corner { z-index: 4; min-width: calc(130px * var(--z, 1)); background: #005A5E; text-align: left; }
.mx td.hr { background: #F1F5F9; font-weight: 650; white-space: nowrap; padding: 4px 10px; color: var(--text); min-width: calc(130px * var(--z, 1)); }
.mx td.c { padding: 3px; height: calc(46px * var(--z, 1)); vertical-align: middle; background: #fff; }
.mx td.c.free { cursor: pointer; }
.mx td.c.free:hover { background: var(--brand-50); }
.mx td.c.free .av { color: #A0AEC0; font-size: .88em; font-style: italic; text-align: center; }
.mx td.c.free:hover .av { color: var(--brand); font-style: normal; }
.mx td.c.drop { background: #DBEAFE !important; outline: 2px dashed var(--info); outline-offset: -3px; }
.mx td.blk { background: repeating-linear-gradient(45deg, #E5E9EF, #E5E9EF 8px, #EEF1F5 8px, #EEF1F5 16px); text-align: center; font-weight: 800; letter-spacing: .25em; color: #475569; height: calc(30px * var(--z, 1)); }
.mx tr.day td { background: var(--brand-50); color: var(--brand); font-weight: 750; padding: 6px 10px; text-transform: uppercase; letter-spacing: .04em; position: sticky; left: 0; }
.mt { border-radius: 6px; padding: 4px 6px; border-left: 4px solid var(--c); background: color-mix(in srgb, var(--c) 12%, white); cursor: pointer; line-height: 1.2; height: 100%; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.mt:hover { box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 45%, transparent); }
.mt .b { font-weight: 650; color: var(--text); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mt .s { font-size: .82em; color: var(--c); font-weight: 650; display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.mt.dim { opacity: .25; }
.mt.hit { box-shadow: 0 0 0 3px #F59E0B; background: #FEF3C7; }
.mt.inc { background-image: linear-gradient(135deg, transparent 85%, var(--danger) 85%); }
.mt[draggable=true] { cursor: grab; }
.mx tfoot th { background: #F8FAFC; text-align: left; font-size: .85em; text-transform: uppercase; padding: 5px 10px; white-space: nowrap; color: var(--text-2); }
.mx tfoot td { text-align: center; font-weight: 700; padding: 5px; font-variant-numeric: tabular-nums; }
.mx tfoot tr.cf td { background: #ECFDF3; color: var(--ok); }
.mx tfoot tr.pc td { background: #FFF7E6; color: var(--warn); }
.mx tfoot tr.tt td { background: #EEF2FF; color: #3730A3; }
.mx tfoot tr.dp td { background: #F8FAFC; color: var(--text-2); }
.mx tfoot tr.oc td { background: var(--brand-50); color: var(--brand); }
.legend { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 12px; }
.zoom { display: inline-flex; align-items: center; gap: 6px; }
.zoom input { width: 110px; height: auto; padding: 0; border: 0; }

/* ---------- Agenda (vista previa imprimible) ---------- */
.agenda-doc { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 28px 32px; }
.agenda-doc .ah { display: grid; grid-template-columns: 120px 1fr 120px; gap: 16px; align-items: center; border-top: 5px solid var(--accent); padding-top: 14px; }
.agenda-doc .ah .lg { height: 60px; display: grid; place-items: center; border-radius: 8px; background: var(--brand); color: #fff; font-weight: 800; text-align: center; font-size: 12px; }
.agenda-doc .ah .lg img { max-height: 60px; max-width: 120px; object-fit: contain; }
.agenda-doc .ah h1 { text-align: center; color: var(--brand); letter-spacing: .04em; }
.agenda-doc .ah p { text-align: center; margin: 4px 0 0; color: var(--text-2); }
.agenda-doc .ai { display: grid; grid-template-columns: 140px 1fr; gap: 4px 12px; margin: 18px 0; }
.agenda-doc .ai dt { font-weight: 750; color: var(--brand); }
.agenda-doc .ai dd { margin: 0; }
.agenda-doc .ai-fila { display: flex; gap: 20px; align-items: center; margin: 18px 0; }
.agenda-doc .ai-fila .ai { margin: 0; flex: 1 1 auto; min-width: 0; }
.agenda-doc .bev { flex: 0 0 56%; aspect-ratio: 1400 / 300; display: grid; place-items: center; overflow: hidden; border-radius: 6px; }
.agenda-doc .bev img { width: 100%; height: 100%; object-fit: contain; }
.agenda-doc table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 18px; }
.agenda-doc th { background: var(--brand); color: #fff; padding: 7px 8px; text-align: left; font-size: 12px; }
.agenda-doc td { border: 1px solid var(--border); padding: 7px 8px; vertical-align: top; }
.agenda-doc td.hr { font-weight: 700; white-space: nowrap; }
.agenda-doc tr.blk td { background: #E5E7EB; text-align: center; font-weight: 750; letter-spacing: .15em; }
.agenda-doc .dayh { font-weight: 750; color: var(--brand); text-transform: uppercase; margin: 10px 0 6px; }
.join { display: inline-flex; align-items: center; gap: 4px; background: var(--info); color: #fff !important; padding: 3px 9px; border-radius: 6px; font-weight: 650; font-size: 12px; }
.join:hover { text-decoration: none; filter: brightness(1.1); }

/* ---------- Portal participantes ---------- */
.portal { min-height: 100vh; }
.portal-top { background: var(--brand); color: #fff; position: sticky; top: 0; z-index: 30; }
.portal-top .in { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 14px; padding: 10px 16px; }
.portal-top b { font-size: 15px; }
.portal-top small { color: #CDEBEC; display: block; }
.portal-nav { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 56px; z-index: 29; }
.portal-nav .in { max-width: 1180px; margin: 0 auto; display: flex; gap: 2px; padding: 0 12px; overflow-x: auto; }
.portal-nav a { padding: 12px 12px; color: var(--text-2); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.portal-nav a.active { color: var(--brand); border-bottom-color: var(--accent); }
.portal-nav a:hover { text-decoration: none; color: var(--brand); }
.portal-main { max-width: 1180px; margin: 0 auto; padding: 18px 16px 48px; }
.counter-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.counter-bar .cnt { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); color: #fff; border-radius: 999px; padding: 3px 10px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.counter-bar .cnt b { font-size: 14px; }
.rubro-h { display: flex; align-items: center; gap: 10px; margin: 22px 0 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--brand); font-size: 14px; font-weight: 800; }
.rubro-h::after { content: ''; flex: 1; height: 2px; background: linear-gradient(90deg, var(--accent), transparent); }
.prov { display: grid; grid-template-columns: 1fr 320px; gap: 0; overflow: hidden; }
.prov .info { padding: 18px; display: flex; gap: 14px; }
.prov .info ul { margin: 6px 0 0; padding-left: 18px; columns: 2; column-gap: 18px; color: var(--text-2); }
.prov .info ul li::marker { color: var(--accent); content: '▪  '; }
.prov .slots { background: var(--surface-2); border-left: 1px solid var(--border); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.prov .slots h4 { font-size: 12.5px; color: var(--text-2); font-weight: 650; }
.slot-list { display: flex; flex-direction: column; gap: 4px; max-height: 230px; overflow-y: auto; }
.slot-list label { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; border: 1px solid var(--border); background: #fff; cursor: pointer; font-size: 13px; font-weight: 500; }
.slot-list label:hover { border-color: var(--brand); }
.slot-list label.on { border-color: var(--brand); background: var(--brand-50); color: var(--brand); font-weight: 650; }
.slot-day { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); font-weight: 700; margin-top: 4px; }
.success { text-align: center; padding: 10px 0; }
.success .big { width: 64px; height: 64px; border-radius: 50%; background: #ECFDF3; color: var(--ok); display: grid; place-items: center; margin: 0 auto 12px; font-size: 32px; font-weight: 800; }
.cita-card { display: grid; grid-template-columns: 120px 1fr auto; gap: 14px; padding: 14px 16px; align-items: center; border-bottom: 1px solid var(--border); }
.cita-card:last-child { border-bottom: 0; }
.cita-card .h { font-weight: 750; color: var(--brand); }

/* ---------- Varios ---------- */
.drag-list { list-style: none; margin: 0; padding: 0; }
.drag-list li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border); background: #fff; }
.drag-list li.dragging { opacity: .4; }
.drag-list li.over { box-shadow: inset 0 3px 0 var(--info); }
.drag-handle { cursor: grab; color: var(--text-3); user-select: none; font-size: 16px; }
.img-up { display: flex; gap: 10px; align-items: center; }
.img-up .prev { width: 88px; height: 56px; border: 1px dashed var(--border-strong); border-radius: 8px; display: grid; place-items: center; overflow: hidden; background: var(--surface-2); color: var(--text-3); font-size: 11px; }
.img-up .prev img { max-width: 100%; max-height: 100%; object-fit: contain; }
.steps { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.steps span { padding: 6px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-weight: 600; font-size: 12.5px; color: var(--text-3); }
.steps span.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.steps span.done { background: var(--brand-50); color: var(--brand); }
.bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.bar > i { display: block; height: 100%; background: var(--brand); }
.hbars { display: flex; flex-direction: column; gap: 6px; }
.hbars .r { display: grid; grid-template-columns: 150px 1fr 40px; gap: 8px; align-items: center; font-size: 12.5px; }
.vbars { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding-top: 10px; }
.vbars .b { flex: 1; background: var(--brand); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.vbars .b:hover { background: var(--accent); }
.qa { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.qa .btn { height: auto; padding: 12px; flex-direction: column; gap: 6px; white-space: normal; text-align: center; font-size: 12.5px; }
.qa .btn .ico { width: 22px; height: 22px; color: var(--brand); }
.pill-state { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-weight: 650; font-size: 12px; background: var(--brand-50); color: var(--brand); }
.pill-state::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.cfgtable td, .cfgtable th { text-align: center; }
.cfgtable td:first-child, .cfgtable th:first-child { text-align: left; }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; border: 1px solid var(--border); font-size: 12.5px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 80; width: var(--sidebar-w); transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .menu-btn { display: inline-flex; }
  .g2, .g3, .g4, .form-grid { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; }
  .login .hero { padding: 32px 20px; min-height: 220px; }
  .login .hero h1 { font-size: 24px; }
  .content { padding: 16px; }
  .topbar { padding: 10px 16px; }
  .prov { grid-template-columns: 1fr; }
  .prov .slots { border-left: 0; border-top: 1px solid var(--border); }
  .prov .info ul { columns: 1; }
  .cita-card { grid-template-columns: 1fr; gap: 6px; }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dd { margin-bottom: 8px; }
  .agenda-doc { padding: 16px; overflow-x: auto; }
  .agenda-doc .ah { grid-template-columns: 1fr; }
  .agenda-doc .ah .lg { display: none; }
  .agenda-doc .ai-fila { flex-direction: column; align-items: stretch; }
  .agenda-doc .bev { flex-basis: auto; }
  .portal-top .counter-bar { display: none; }
}

/* ---------- Impresión ---------- */
@media print {
  .sidebar, .topbar, .no-print, .portal-top, .portal-nav, #toasts, .page-head .row { display: none !important; }
  .shell { display: block; }
  .content, .portal-main { padding: 0; }
  body { background: #fff; }
  .agenda-doc { border: 0; padding: 0; break-after: page; }
  .card { box-shadow: none; }
  .mx-wrap { height: auto; overflow: visible; border: 0; }
  .mx thead th, .mx td.hr { position: static; }
}

/* Matriz en pantalla completa */
.mx-page.fs { position: fixed; inset: 0; z-index: 90; background: var(--bg); padding: 12px 16px; display: flex; flex-direction: column; overflow: hidden; }
.mx-page.fs .mx-wrap { height: auto; flex: 1; }

/* Contadores del participante siempre visibles en móvil */
.counter-mobile { display: none; }
@media (max-width: 900px) {
  .counter-mobile { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
  .counter-mobile span { background: var(--brand-50); color: var(--brand); border: 1px solid #B3DFE0; border-radius: 999px; padding: 3px 10px; font-size: 12.5px; font-weight: 600; }
  .hide-sm { display: none !important; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi .v { font-size: 22px; }
  .topbar select { max-width: 60vw; }
}

/* Submenú de la Rueda de Negocios abierta */
.subnav { margin: 2px 0 6px 14px; padding-left: 8px; border-left: 2px solid rgba(255,255,255,.15); display: flex; flex-direction: column; gap: 1px; }
.subnav-t { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #CDEBEC; padding: 6px 8px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.subnav a { padding: 6px 10px; font-size: 13px; }
.evento-tabs { margin-top: -6px; }
@media (min-width: 901px) { .evento-tabs { display: none; } }

/* Formulario público: selección múltiple y barra para reservar al final */
.prov.prov-sel { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-50); }
.cart-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: #fff; border-top: 2px solid var(--brand); box-shadow: 0 -6px 20px rgba(15,23,42,.12); }
.cart-bar .in { max-width: 1180px; margin: 0 auto; padding: 12px 16px; display: flex; gap: 10px; align-items: center; }
.cart-bar small { display: block; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 600px) { .cart-bar .btn.ghost { display: none; } }
.prov > * { min-width: 0; }
.prov .info h3, .prov .info p { overflow-wrap: anywhere; }
@media (max-width: 900px) { .prov { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 420px) { .prov .info { flex-direction: column; } }
.plantilla-grid { grid-template-columns: 420px minmax(0, 1fr); }
@media (max-width: 1000px) { .plantilla-grid { grid-template-columns: minmax(0, 1fr); } }

/* Publicidad al final de la agenda: banners individuales, 3 por fila */
.ads { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0 6px; }
.ads > a, .ads > div { display: block; aspect-ratio: 2.6 / 1; border-radius: 6px; overflow: hidden; background: #fff; }
.ads img { width: 100%; height: 100%; object-fit: contain; display: block; }
@media print { .ads { break-inside: avoid; } }

/* Plantillas: vista previa siempre visible */
.plantilla-prev { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow: auto; border-radius: var(--radius); }
.plantilla-prev .agenda-doc { font-size: 12px; }
@media (max-width: 1000px) { .plantilla-prev { top: 60px; max-height: 46vh; z-index: 5; box-shadow: var(--shadow); order: -1; } }
.pub-list { display: flex; flex-direction: column; gap: 8px; }
.pub-item { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.pub-item img { width: 120px; aspect-ratio: 2.6 / 1; object-fit: contain; background: #fff; border-radius: 4px; display: block; }

/* Espacios de referencia en la vista previa de plantillas */
.ph { border: 2px dashed #94A3B8; border-radius: 8px; background: repeating-linear-gradient(45deg, #F8FAFC, #F8FAFC 8px, #EEF2F7 8px, #EEF2F7 16px);
  color: #475569; display: grid; place-items: center; text-align: center; font-size: 11px; font-weight: 650; line-height: 1.25; padding: 4px; }
.ph small { font-weight: 500; color: #64748B; font-size: 10px; }
.ads > .ph { aspect-ratio: 2.6 / 1; }
.agenda-doc .ah .ph.lg { background: repeating-linear-gradient(45deg, #F8FAFC, #F8FAFC 8px, #EEF2F7 8px, #EEF2F7 16px); color: #475569; font-size: 10px; }
.zona-on { outline: 3px solid var(--accent, #009196) !important; outline-offset: 3px; border-radius: 6px; transition: outline-color .15s; }
/* Banners laterales (franjas como en el PDF: ~3.5% del ancho de la página) */
.agenda-doc { position: relative; }
.agenda-doc.con-bandas { padding-left: calc(3.5% + 16px); padding-right: calc(3.5% + 16px); }
.agenda-doc .banda { position: absolute; top: 0; bottom: 0; width: 3.5%; overflow: hidden; }
.agenda-doc .banda.izq { left: 0; border-radius: 10px 0 0 10px; }
.agenda-doc .banda.der { right: 0; border-radius: 0 10px 10px 0; }
.agenda-doc .banda img { width: 100%; height: 100%; object-fit: cover; display: block; }
.agenda-doc .banda.ph span { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; }
.agenda-doc .ph.qr { float: right; width: 74px; height: 74px; margin: 6px 0 0 10px; }
/* Botón de guardar al final del formulario de plantillas (siempre visible al bajar) */
.save-bar { position: sticky; bottom: 0; z-index: 4; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  padding: 12px 16px; background: var(--surface-2); border-top: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); }
.subnav-g { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: #9FC9CB; padding: 8px 10px 2px; font-weight: 700; }

/* Resumen de la Rueda */
.resumen-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 16px 18px; margin-bottom: 16px; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12.5px; color: var(--text-2); font-weight: 550; }
.tag .ico { width: 14px; height: 14px; color: var(--brand); }
.stat-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.stat-card .l { font-size: 12px; color: var(--text-3); font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.stat-card .v { font-size: 34px; font-weight: 750; color: var(--brand); line-height: 1.1; margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.stat-row { padding: 5px 0; border-top: 1px solid var(--border); font-size: 13.5px; }
.stat-row b { font-variant-numeric: tabular-nums; }
.punto { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.stack-bar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); margin: 6px 0 10px; }
.stack-bar i { display: block; height: 100%; }
/* Franja compacta del formulario público */
.franja-publica { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.franja-publica input { flex: 1; min-width: 200px; height: 32px; background: var(--surface-2); font-size: 13px; }
.reportes-grid { grid-template-columns: 240px minmax(0, 1fr); }
@media (max-width: 900px) { .reportes-grid { grid-template-columns: minmax(0, 1fr); } }
/* Código de control documental (ISO) en la agenda */
.agenda-doc .doc-codigo { text-align: right; font-size: 11px; font-weight: 700; color: #475569; letter-spacing: .04em; margin: -14px 0 4px; }

/* =====================================================================
   Identidad gráfica CCIC
   ===================================================================== */
h1, h2, h3, .kpi .v, .stat-card .v, .login .hero h1, .agenda-doc .ah h1 { font-family: var(--font-titulos); letter-spacing: -.01em; }
h1 { color: var(--ink); }

/* Logo oficial (reemplaza el distintivo "CCIC" de texto en todas las cabeceras) */
.logo-mark { width: 78px; height: 40px; border-radius: 8px; background: #fff url(/img/ccic-logo.png) center / 84% no-repeat; color: transparent; font-size: 0; box-shadow: 0 0 0 1px rgba(0,0,0,.06); }
.logo-mark::after { display: none; }

/* Menú lateral claro, con el logo en su color original */
.sidebar { background: #fff; color: var(--text-2); border-right: 1px solid var(--border); }
.sidebar .brand { flex-direction: column; align-items: flex-start; gap: 8px; padding: 18px 18px 14px; border-bottom: 1px solid var(--border); }
.sidebar .brand .logo-mark { width: 150px; height: 77px; background-size: contain; box-shadow: none; border-radius: 0; }
.sidebar .brand b { color: var(--ink); font-family: var(--font-titulos); font-size: 14px; }
.sidebar .brand small { color: var(--text-3); display: none; }
.nav a { color: var(--text-2); }
.nav a .ico { color: var(--text-3); }
.nav a:hover { background: var(--brand-50); color: var(--brand); }
.nav a.active { background: var(--brand); color: #fff; box-shadow: 0 2px 8px rgba(0,120,125,.25); }
.nav a.active .ico { color: #fff; }
.nav .sep { background: var(--border); }
.subnav { border-left-color: var(--brand-50); }
.subnav-t { color: var(--brand); font-weight: 700; }
.subnav-g { color: var(--text-3); }
.sidebar .foot { color: var(--text-3); border-top: 1px solid var(--border); }
.topbar { box-shadow: 0 1px 0 rgba(0,0,0,.02); }

/* Botones */
.btn.primary { background: var(--brand); border-color: var(--brand); }
.btn.primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
.btn.peligro { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.peligro:hover { filter: brightness(1.08); background: var(--danger); }

/* Indicadores y detalles con el turquesa del logo */
.kpi .v, .stat-card .v { color: var(--ink); }
.kpi.accent .v { color: var(--accent); }
.page-head h1::after { content: ''; display: block; width: 36px; height: 4px; border-radius: 4px; background: var(--accent); margin-top: 6px; }
.tabs button.on { border-bottom-color: var(--accent); }
.rubro-h::after { background: linear-gradient(90deg, var(--accent), transparent); }

/* Inicio de sesión con la sede de la CCIC */
.login .hero { background: #1E4B4E; isolation: isolate; }
/* foto del edificio desenfocada detrás del degradado */
.login .hero::before { content: ""; position: absolute; inset: -24px; z-index: -1; background: linear-gradient(160deg, rgba(0,90,94,.78) 0%, rgba(30,35,38,.74) 100%), url(/img/ccic-edificio.jpg) center / cover no-repeat; filter: blur(6px); }
.login .hero > * { position: relative; z-index: 1; }
.login .hero, .login .hero h1, .login .hero p, .login .hero b, .login .hero small { color: #fff !important; }
.login .hero::after { border-color: rgba(0,145,150,.45); }
.login .hero .logo-mark { width: 120px; height: 62px; }
.login .panel form::before { content: ''; display: block; width: 190px; height: 98px; margin: 0 auto 6px; background: url(/img/ccic-logo.png) center / contain no-repeat; }

/* Portal de participantes y página pública */
.portal-top { background: linear-gradient(90deg, var(--brand) 0%, #005A5E 100%); }
.portal-nav a.active { border-bottom-color: var(--accent); }
.mx thead th.corner { background: var(--ink); }
input[type=range] { accent-color: var(--brand); }
.aviso-punto { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); } .btn.icon { position: relative; }
/* Datos de quien emite la agenda */
.agenda-doc .emisor { display: flex; gap: 14px; align-items: center; border: 1px solid #B3DFE0; border-radius: 8px; padding: 10px 12px; margin: 14px 0 6px; break-inside: avoid; }
.agenda-doc .emisor img { width: 70px; height: 70px; flex: none; }
.agenda-doc .emisor div { display: flex; flex-direction: column; gap: 2px; }
.agenda-doc .emisor small:first-child { font-size: 10px; font-weight: 700; color: var(--brand); letter-spacing: .05em; }
.agenda-doc .emisor b { font-size: 14px; color: var(--ink); }

/* Formulario público "Perfil empresarial" */
.perfil-sec { overflow: hidden; }
.perfil-sec-h { display: flex; gap: 12px; align-items: center; padding: 12px 16px; background: var(--brand); color: #fff; }
.perfil-sec-h span { width: 28px; height: 28px; border-radius: 50%; background: #fff; color: var(--brand); display: grid; place-items: center; font-weight: 800; flex: none; }
.perfil-sec-h h3 { color: #fff; text-transform: uppercase; letter-spacing: .03em; font-size: 14px; }
.perfil-sec-h small { color: #CDEBEC; }
.perfil-grupo { margin: 10px 0 -4px; color: var(--ink); font-family: var(--font-titulos); }
.perfil-tabla { display: flex; flex-direction: column; gap: 6px; }
.perfil-fila { display: grid; gap: 6px; align-items: center; }
@media (max-width: 700px) { .perfil-fila { grid-template-columns: 1fr 32px !important; } .perfil-fila input:not(:first-child) { grid-column: 1; } }
.elegir-lista { max-height: 240px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px; padding: 6px; }
.elegir-item { padding: 6px 8px; border-radius: 6px; align-items: flex-start; }
.elegir-item:hover { background: var(--surface-2); }
.elegir-item.on { background: var(--brand-50); }
@media (max-width: 700px) { .perfil-fila { border-bottom: 1px dashed var(--border-strong); padding-bottom: 8px; } .perfil-fila button { grid-column: 2; grid-row: 1; } }

/* =====================================================================
   Pulido v1.2 — detalles visuales, accesibilidad y diseño responsive
   ===================================================================== */
:root { --shadow-lg: 0 10px 30px rgba(15, 23, 42, .12); --ease: cubic-bezier(.2, .7, .3, 1); }
body { line-height: 1.45; text-rendering: optimizeLegibility; }
body.con-modal { overflow: hidden; }
::selection { background: color-mix(in srgb, var(--accent) 25%, transparent); }

/* Transiciones suaves y respuesta al clic */
.btn, .chip, .nav a, .tabs button, input, select, textarea, .card, .slot-list label, .elegir-item { transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s; }
.btn:active:not(:disabled), .chip:active { transform: translateY(1px); }
a:focus-visible, .nav a:focus-visible, .tabs button:focus-visible, .portal-nav a:focus-visible, tr.clickable:focus-visible { outline: 2px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; border-radius: 6px; }
select { appearance: none; padding-right: 30px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") right 10px center no-repeat; }
select:disabled, input:disabled, textarea:disabled { background-color: var(--surface-2); color: var(--text-3); cursor: not-allowed; }
input::placeholder, textarea::placeholder { color: #94A3B8; }
.card-h h3 { color: var(--ink); }
.cap { text-transform: capitalize; }
td.nowrap { white-space: nowrap; }

/* El botón de menú sólo existe en pantallas angostas (antes se veía también en escritorio) */
.btn.menu-btn { display: none; }
.sidebar-fondo { display: none; }
.topbar-user { gap: 6px; flex-wrap: nowrap; }
.topbar > b, .topbar > .row:not(.topbar-user) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex-wrap: nowrap; }

/* Cargando */
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--brand-50); border-top-color: var(--brand); animation: girar .7s linear infinite; display: inline-block; }
@keyframes girar { to { transform: rotate(360deg); } }
.cargando, .boot { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.boot { height: 100vh; }

/* Avisos: el texto con negritas o enlaces fluye en un solo párrafo */
.alert { display: block; position: relative; line-height: 1.5; }
.alert:has(> .ico:first-child) { padding-left: 40px; }
.alert > .ico:first-child { position: absolute; left: 14px; top: 11px; }
.alert.flex { display: flex; align-items: flex-start; gap: 10px; }
.alert.flex:has(> .ico:first-child) { padding-left: 14px; }
.alert.flex > .ico:first-child { position: static; margin-top: 1px; }
.alert.flex > .btn { margin-left: auto; }
.alert-accion { margin-left: auto; font-weight: 650; white-space: nowrap; }

/* Tablas */
table.t tbody tr:last-child td { border-bottom: 0; }
table.t tr.clickable:hover td { background: var(--brand-50); }
table.t th.sortable:hover { color: var(--brand); }
.card > .table-wrap:last-child { border-radius: 0 0 var(--radius) var(--radius); }

/* Modales: animación de entrada y hoja inferior en celular */
.overlay { backdrop-filter: blur(2px); }
.modal { animation: subir .18s var(--ease); }
@keyframes subir { from { opacity: 0; transform: translateY(12px) scale(.985); } }

/* Agendas: lista + vista previa */
.agendas-grid { grid-template-columns: 280px minmax(0, 1fr); align-items: start; }
.agendas-grid .agenda-doc { overflow-x: auto; }

/* Encabezado de página */
.page-head > div:first-child { min-width: 0; }
.page-head p { max-width: 760px; }

@media (max-width: 900px) {
  .btn.menu-btn { display: inline-flex; }
  .sidebar-fondo { display: block; position: fixed; inset: 0; z-index: 79; background: rgba(15, 23, 42, .45); animation: fade .15s; }
  .agendas-grid { grid-template-columns: minmax(0, 1fr); }
  .agendas-grid > .card:first-child > div:last-child { max-height: 220px !important; }
  /* Filtros a lo ancho y botones cómodos para el dedo */
  .card-b.row > select, .card-b.row > input, .card-b.row > .search, .mx-toolbar > select, .mx-toolbar > .search { width: 100% !important; max-width: none !important; flex: 1 1 100%; }
  .card-h { flex-wrap: wrap; }
  .card-h .search { min-width: 0 !important; max-width: none !important; flex: 1 1 100% !important; }
  .page-head { align-items: stretch; }
  .page-head > .row, .page-head > div:last-child:not(:first-child) { width: 100%; }
  .btn { min-height: 38px; }
  .btn.sm { min-height: 34px; } .btn.xs { min-height: 30px; }
  h1 { font-size: 20px; }
  .modal { width: 100% !important; max-height: calc(100vh - 24px); }
  .overlay { padding: 12px; }
  .resumen-head .row { width: 100%; }
  .resumen-head .row .btn { flex: 1; }
  .tabs { scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
}
@media (max-width: 560px) {
  .overlay { padding: 0; place-items: end stretch; }
  .modal { border-radius: 16px 16px 0 0; max-height: 92vh; animation: hoja .2s var(--ease); }
  .modal-f { border-radius: 0; }
  .modal-f .btn { flex: 1; }
  @keyframes hoja { from { transform: translateY(40px); opacity: 0; } }
  .kpis { gap: 8px; }
  .kpi { padding: 12px; }
  .stat-card .v { font-size: 28px; }
  .content { padding: 14px 12px 32px; }
  .topbar { padding: 8px 12px; gap: 8px; }
  .login .panel { padding: 24px 16px 40px; align-items: start; }
  .login .hero { min-height: 0; padding: 22px 18px; gap: 18px; }
  .login .hero h1 { font-size: 21px; }
  .login .hero p { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
.agenda-acciones { margin-left: auto; gap: 6px; }
@media (max-width: 900px) { .agenda-acciones { margin-left: 0; width: 100%; padding-top: 8px; border-top: 1px dashed var(--border); } }

/* Tablas de datos en celular: cada fila se muestra como una tarjeta con etiquetas */
@media (max-width: 700px) {
  table.t.resp thead { display: none; }
  table.t.resp, table.t.resp tbody, table.t.resp tr, table.t.resp td { display: block; width: 100%; }
  table.t.resp tr { padding: 10px 14px; border-bottom: 1px solid var(--border); }
  table.t.resp tbody tr:last-child { border-bottom: 0; }
  table.t.resp td { border: 0; padding: 3px 0 3px 112px; position: relative; text-align: left; min-height: 24px; overflow-wrap: anywhere; }
  table.t.resp td::before { content: attr(data-label); position: absolute; left: 0; top: 5px; width: 102px; font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .03em; color: var(--text-3); }
  table.t.resp td.sin-etiqueta, table.t.resp tr.vacio td { padding-left: 0; }
  table.t.resp td:empty { display: none; }
  table.t.resp td.sin-etiqueta::before { display: none; }
  table.t.resp td.nowrap { white-space: normal; }
  table.t.resp tr.vacio td { display: block; }
  table.t.resp tr.vacio td::before { display: none; }
  table.t.resp tr:hover td, table.t.resp tr.clickable:hover td { background: transparent; }
  table.t.resp tr.clickable:active { background: var(--brand-50); }
  .table-wrap { max-height: none !important; }
}
@media (max-width: 700px) {
  /* La primera columna (empresa, código, nombre) funciona como título de la tarjeta */
  table.t.resp td:first-child { padding-left: 0; margin-bottom: 4px; font-size: 15px; }
  table.t.resp td:first-child::before { display: none; }
}
/* Matriz en celular: columna de horario angosta para ver más oferentes */
@media (max-width: 700px) {
  .mx td.hr { white-space: normal; min-width: 82px; max-width: 82px; font-size: 11.5px; line-height: 1.25; padding: 4px 6px; }
  .mx thead th.corner { min-width: 82px; max-width: 82px; }
  .mx thead th { min-width: 128px; }
  .mx-wrap { height: 70vh; }
}
/* Inicio de sesión en celular: un solo logo y cabecera compacta */
@media (max-width: 900px) {
  .login .panel form::before { display: none; }
  .login .hero > small { display: none; }
  .login .panel { place-items: start center; }
}
.login form .btn.primary { font-size: 15px; }
.login .panel form { background: var(--surface); padding: 28px; border-radius: 16px; border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
@media (max-width: 560px) { .login .panel form { padding: 22px 18px; box-shadow: var(--shadow); } }
/* Avisos flotantes */
.toast { cursor: pointer; align-items: center; box-shadow: var(--shadow-lg); animation: entrar .2s var(--ease); line-height: 1.4; }
.toast::before { content: 'i'; flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: rgba(255,255,255,.18); }
.toast.ok::before { content: '✓'; } .toast.error::before { content: '!'; }
.toast.saliendo { opacity: 0; transform: translateX(16px); transition: opacity .18s, transform .18s; }
@keyframes entrar { from { opacity: 0; transform: translateY(8px); } }
@media (max-width: 560px) { #toasts { left: 12px; right: 12px; bottom: 12px; max-width: none; } }
/* Cabecera del portal y páginas públicas en celular: más compacta */
@media (max-width: 560px) {
  .portal-top .in { padding: 8px 12px; gap: 10px; }
  .portal-top .in .logo-mark { width: 64px; height: 34px; }
  .portal-top b { font-size: 14px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .portal-top small { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
  .portal-nav { position: static; }
  .portal-main { padding: 14px 12px 96px; }
}
/* Nueva Rueda: secciones numeradas, resumen del horario y campos obligatorios pendientes */
.nr-sec { display: flex; align-items: center; gap: 10px; margin: 18px 0 10px; padding-top: 14px; border-top: 1px solid var(--border); }
.nr-sec:first-of-type { margin-top: 4px; padding-top: 0; border-top: 0; }
.nr-sec span { width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 800; flex: none; }
.nr-sec h3 { font-size: 15px; }
.nr-resumen { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 10px 14px; border-radius: 8px; background: var(--brand-50); color: var(--brand-600); border: 1px solid #B3DFE0; font-size: 13px; line-height: 1.5; }
.nr-resumen .ico { margin-top: 2px; }
.campo-error { color: var(--danger); font-size: 12px; font-weight: 600; }
input.invalido, select.invalido { border-color: var(--danger); background: #FFF8F8; }
.req { color: var(--accent); font-weight: 700; }
/* Nueva Rueda: lista de fechas, cada una con su horario */
.nr-fechas { display: flex; flex-direction: column; gap: 6px; }
.nr-fecha { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) 36px; gap: 8px; align-items: center; }
.nr-fecha label { display: block; }
.nr-fecha-h span { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); }
.nr-fecha-msg { grid-column: 1 / -1; margin-top: -2px; }
@media (max-width: 560px) { .nr-fecha { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 36px; } .nr-fecha label:first-child { grid-column: 1 / -1; } .nr-fecha-h { display: none; } }
.almuerzo-campo { display: flex; flex-direction: column; gap: 8px; align-self: start; padding-top: 22px; }
@media (max-width: 900px) { .almuerzo-campo { padding-top: 0; } }
/* Días, horarios y bloqueos: barra para guardar todos los cambios juntos */
.save-bar.guardar-general { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: 0 -6px 20px rgba(15, 23, 42, .08); bottom: 12px; }
.campo-pendiente { color: var(--warn); font-weight: 650; }
.card.card-cambiada { border-color: #F5D9A8; box-shadow: 0 0 0 2px #FFF1D6; }
@media (max-width: 560px) { .save-bar.guardar-general .row { width: 100%; } .save-bar.guardar-general .btn.primary { flex: 1; } }
/* Matriz preliminar (sin horarios): calificación de los oferentes sobre los compradores */
.pre-compartir.on { border-color: #BBE5C8; background: #F6FDF8; }
.pre-wrap { height: auto; max-height: calc(100vh - 300px); min-height: 240px; }
.mx.pre td.pre-co { white-space: normal; min-width: 200px; max-width: 240px; line-height: 1.25; }
.mx.pre td.pre-co small { display: block; color: var(--text-3); font-weight: 500; font-size: .85em; margin-top: 2px; }
.mx.pre td.c { text-align: center; height: calc(40px * var(--z, 1)); }
.mx.pre th.pre-res, .mx.pre td.pre-res { min-width: 130px; background: #F8FAFC; color: var(--text-2); text-align: center; }
.pre-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700;
  border: 1px solid color-mix(in srgb, var(--c, #94A3B8) 45%, transparent); color: var(--c, #64748B); background: color-mix(in srgb, var(--c, #94A3B8) 10%, white); white-space: nowrap; }
.pre-chip.lleno { background: var(--c); color: #fff; border-color: var(--c); }
.pre-chip.lleno small { font-size: 9px; opacity: .85; font-weight: 700; letter-spacing: .04em; }
.pre-chip.vacio { --c: #CBD5E1; color: #94A3B8; background: transparent; }
.pre-botones { display: flex; gap: 6px; flex-wrap: wrap; }
.pre-btn { flex: 1 1 0; min-width: 84px; height: 36px; border-radius: 8px; border: 1.5px solid color-mix(in srgb, var(--c) 45%, transparent); background: #fff;
  color: var(--c); font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; transition: background-color .15s, color .15s; }
.pre-btn:hover:not(:disabled) { background: color-mix(in srgb, var(--c) 10%, white); }
.pre-btn.on { background: var(--c); color: #fff; border-color: var(--c); }
.pre-btn:disabled { opacity: .5; cursor: not-allowed; }
.pre-card.hecho { border-color: #BBE5C8; }
.pre-card textarea { min-height: 54px; }
/* Página del enlace personal al portal (sesión cerrada, enlace desactivado o Rueda archivada) */
.enlace-pagina { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--bg); }
.enlace-caja { max-width: 480px; width: 100%; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 32px 26px; box-shadow: var(--shadow-lg); }
.enlace-caja h1 { margin: 10px 0 8px; color: var(--brand); }
.enlace-caja p { color: var(--text-2); line-height: 1.55; margin: 0 0 18px; }
.enlace-logo { width: 170px; height: 86px; margin: 0 auto; background: url(/img/ccic-logo.png) center / contain no-repeat; }
/* Interruptor (activar / desactivar el enlace del portal) */
.interruptor { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; color: var(--text-3); cursor: pointer; white-space: nowrap; }
.interruptor input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.interruptor span { width: 32px; height: 18px; border-radius: 999px; background: #CBD5E1; position: relative; transition: background-color .15s; flex: none; }
.interruptor span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.interruptor.on { color: var(--ok); }
.interruptor.on span { background: var(--ok); }
.interruptor.on span::after { transform: translateX(14px); }
.interruptor input:focus-visible + span { outline: 2px solid color-mix(in srgb, var(--brand) 50%, transparent); outline-offset: 2px; }
.interruptor input:disabled + span { opacity: .5; }
/* Lista preliminar individual de cada oferente */
.mx.pre td.c.fuera { background: repeating-linear-gradient(45deg, #F8FAFC, #F8FAFC 6px, #F1F5F9 6px, #F1F5F9 12px); }
.mx.pre td.c.fuera:hover { background: var(--brand-50); }
.pre-chip.pendiente { --c: #64748B; background: #fff; border-style: dashed; color: #64748B; font-weight: 600; }
.pre-lista-btn { margin-top: 5px; border: 1px solid rgba(255,255,255,.45); background: rgba(255,255,255,.14); color: #fff; border-radius: 6px; padding: 2px 8px; font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }
.pre-lista-btn:hover { background: rgba(255,255,255,.28); }
/* Matriz General: celda de un par descartado en la matriz preliminar */
.mx td.c.desc { background: repeating-linear-gradient(45deg, #FEF2F2, #FEF2F2 6px, #FDE8E8 6px, #FDE8E8 12px); cursor: not-allowed; }
.mx td.c.desc .av { color: #B91C1C; font-style: normal; font-weight: 650; font-size: .85em; text-align: center; }
/* Cita existente entre un par descartado en la matriz preliminar */
.mt.descartada { box-shadow: inset 0 0 0 2px #DC2626; }
.mt .mt-desc { font-size: .72em; font-weight: 800; color: #B91C1C; letter-spacing: .01em; line-height: 1.1; }
.card.rapida { border-color: #B3DFE0; background: #F7FCFC; margin-bottom: 12px; }
.agenda-doc a.mapa { font-size: 11px; font-weight: 650; white-space: nowrap; }
/* Matriz: varias citas en la misma celda (cita doble autorizada) */
.mx td.c { position: relative; }
.mx td.c.doble { background: #FFF7E6; }
.mx td.c.doble .mt { height: auto; margin-bottom: 3px; }
.mt .mt-desc.doble { color: #B45309; }
.mt-mas { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--border-strong); background: #fff; color: var(--brand); font-weight: 800; line-height: 1; cursor: pointer; padding: 0; z-index: 2; box-shadow: 0 1px 2px rgba(15, 23, 42, .12); transition: background-color .15s, color .15s, border-color .15s; }
/* siempre visible (también en tableta y celular) para agendar una cita doble en ese horario */
.mt-mas:hover, .mt-mas:focus-visible { background: var(--brand); border-color: var(--brand); color: #fff; }
.mx td.c:has(.mt-mas) .mt { padding-right: 24px; }

/* =====================================================================
   Pulido v1.3 — pantallas nuevas (matriz preliminar, enlaces, agenda en celular)
   ===================================================================== */
.ag-tabla-wrap { overflow-x: auto; }

/* Agenda en celular: cada horario como tarjeta (la impresión y el PDF no cambian) */
@media screen and (max-width: 700px) {
  .agenda-doc { padding: 14px 12px; }
  .agenda-doc .ai { grid-template-columns: 110px 1fr; font-size: 13px; }
  .agenda-doc table.ag-tabla, .agenda-doc table.ag-tabla tbody, .agenda-doc table.ag-tabla tr, .agenda-doc table.ag-tabla td { display: block; width: 100%; }
  .agenda-doc table.ag-tabla thead { display: none; }
  .agenda-doc table.ag-tabla { font-size: 13px; margin-bottom: 10px; }
  .agenda-doc table.ag-tabla tr { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; overflow: hidden; background: #fff; }
  .agenda-doc table.ag-tabla td { border: 0; padding: 5px 12px; }
  .agenda-doc table.ag-tabla td.hr { background: var(--brand-50); color: var(--brand-600); font-size: 13px; padding: 7px 12px; }
  .agenda-doc table.ag-tabla td[data-l]::before { content: attr(data-l); display: block; font-size: 10px; font-weight: 700; letter-spacing: .05em; color: var(--text-3); }
  .agenda-doc table.ag-tabla td[data-l]:empty { display: none; }
  .agenda-doc table.ag-tabla td[colspan]:empty { display: none; }
  .agenda-doc table.ag-tabla tr:has(td[colspan]:empty) td.hr::after { content: ' · libre'; font-weight: 500; color: var(--text-3); }
  .agenda-doc table.ag-tabla tr.blk td { text-align: left; padding: 7px 12px; }
  .agenda-doc table.ag-tabla tr.blk td:first-child { background: #E5E7EB; color: var(--text-2); }
  .agenda-doc table.ag-tabla td[data-l] a { word-break: break-all; }
  .agenda-doc .ag-tabla-wrap { overflow: visible; }
  .agenda-doc .ads { grid-template-columns: 1fr; }
  .agenda-doc .emisor { flex-wrap: wrap; }
}

/* Matriz preliminar en celular: columna de comprador más angosta para ver más oferentes */
@media (max-width: 700px) {
  .mx.pre td.pre-co { min-width: 120px; max-width: 140px; font-size: 12px; }
  .mx.pre th.pre-res, .mx.pre td.pre-res { min-width: 96px; }
  .mx.pre thead th { min-width: 112px; }
}

/* Pies de ventanas con texto informativo: el texto va arriba en celular */
@media (max-width: 560px) {
  .modal-f > span, .modal-f > small { flex-basis: 100%; margin-right: 0 !important; text-align: center; }
}

/* Franjas de información con icono (enlaces del portal, reservas públicas) */
.franja-publica > .ico:first-child { align-self: flex-start; margin-top: 2px; color: var(--brand); }
@media screen and (max-width: 700px) {
  .agenda-doc table.ag-tabla tr.blk { display: flex; align-items: center; justify-content: space-between; background: #E5E7EB; }
  .agenda-doc table.ag-tabla tr.blk td { width: auto; background: transparent !important; padding: 7px 12px; letter-spacing: .08em; }
}

/* Envío de agendas por correo */
.correo-lista { list-style: none; margin: 6px 0 0; padding: 0; max-height: 220px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.correo-lista li { padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 13px; line-height: 1.45; }
.correo-lista li:last-child { border-bottom: 0; }
.correo-previa { white-space: pre-wrap; font: 13px/1.55 inherit; font-family: inherit; background: var(--bg, #f6f8f8); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin: 8px 0 0; max-height: 300px; overflow: auto; }

/* Matriz: elegir empresas para ver */
.ee-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ee-grupo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ee-lista { display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; padding: 6px 10px; }
.ee-lista .check { padding: 5px 0; }
@media (max-width: 700px) { .ee-grid { grid-template-columns: 1fr; } }

/* Configuración → Usuarios y roles: dos columnas en pantallas anchas, una en angostas */
.usr-grid { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
@media (max-width: 1100px) { .usr-grid { grid-template-columns: minmax(0, 1fr); } }

/* Encuesta de satisfacción (pública) */
.enc-preg.lista { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); }
.enc-t { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.enc-t > span { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.enc-t b { display: block; font-size: 15px; line-height: 1.35; }
.enc-t small { display: block; color: var(--text-3, #64748B); font-size: 12px; margin-top: 2px; }
.enc-ops { display: grid; gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.enc-ops.escala { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.enc-ops button { min-height: 46px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); font: inherit; font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 6px 4px; }
.enc-ops button:hover { border-color: var(--brand); color: var(--brand); }
.enc-ops button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.enc-ops .cara { font-size: 26px; line-height: 1; }
.enc-monto { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; font-size: 13px; }
.enc-monto input { max-width: 200px; }
@media (max-width: 520px) { .enc-ops.escala button span:not(.cara) { font-size: 10.5px; } .enc-ops .cara { font-size: 24px; } }

/* Encuesta: resumen para la CCIC */
.enc-barras { display: grid; gap: 6px; }
.enc-barra { display: grid; grid-template-columns: 110px minmax(0, 1fr) 70px; gap: 8px; align-items: center; font-size: 13px; }
.enc-barra .pista { height: 12px; border-radius: 6px; background: #EEF2F6; overflow: hidden; }
.enc-barra .pista i { display: block; height: 100%; background: var(--brand); border-radius: 6px; }
.enc-barra .n { text-align: right; color: var(--text-2); white-space: nowrap; }
.enc-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.enc-coment { border-left: 3px solid var(--brand); padding: 6px 10px; background: var(--brand-50); border-radius: 0 8px 8px 0; }
.enc-empresas { display: grid; gap: 10px; }
.enc-emp { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 14px; align-items: center; padding-top: 10px; border-top: 1px solid var(--border); }
.enc-emp:first-child { border-top: 0; padding-top: 0; }
.enc-emp-n b { display: block; font-size: 14px; }
.enc-emp-n small { color: var(--text-3); font-size: 12px; }
.enc-ops.escala.mini { grid-template-columns: repeat(5, 44px) auto; }
.enc-ops.mini button { min-height: 42px; padding: 4px; }
.enc-ops.mini .cara { font-size: 22px; }
.enc-ops.mini button.no { font-size: 11.5px; padding: 4px 8px; line-height: 1.15; }
@media (max-width: 620px) { .enc-emp { grid-template-columns: minmax(0, 1fr); } .enc-ops.escala.mini { grid-template-columns: repeat(5, minmax(0, 1fr)) minmax(0, 1.4fr); } }
/* Varios representantes por cita: uno por línea en la agenda */
.ag-tabla td[data-l="REPRESENTANTE"], .ag-tabla td[data-l="CARGO"], .ag-tabla td[data-l="CELULAR"], .ag-tabla td[data-l="CORREO"], .ag-tabla td[data-l="TELÉFONOS"], dl.ai dd { white-space: pre-line; }
/* Cita: representantes que asisten */
.asistentes { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); max-height: 160px; overflow: auto; }
.asistentes .check { align-items: flex-start; }
/* Registro rápido: varios representantes */
.rep-rapido { display: grid; grid-template-columns: 22px repeat(4, minmax(0, 1fr)) 28px; gap: 6px; align-items: center; }
.rep-rapido .rep-n { width: 22px; height: 22px; border-radius: 50%; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
@media (max-width: 760px) { .rep-rapido { grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1fr) 28px; } .rep-rapido input[type="email"], .rep-rapido input[type="tel"] { grid-column: 2 / span 1; } }
.asistentes { max-height: 240px; }
.asis-nuevo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 8px; border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--bg, #F8FAFC); }
.asis-nuevo .row { grid-column: 1 / -1; }

/* ---------------- Notificaciones de actividad (quién hizo qué) ---------------- */
.act-campana { position: relative; }
.act-campana > .btn { position: relative; }
.act-num { position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: #DC2626; color: #fff; font-size: 10.5px; font-weight: 800; display: grid; place-items: center; line-height: 1; }
.act-panel { position: absolute; right: 0; top: calc(100% + 8px); width: min(400px, calc(100vw - 24px)); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 60; overflow: hidden; }
.act-panel-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.act-sw { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); cursor: pointer; }
.act-sw input { width: auto; margin: 0; }
.act-panel-b { max-height: min(460px, 70vh); overflow: auto; }
.act-panel-b .act-item { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.act-panel-b .act-item:last-child { border-bottom: 0; }
.act-item { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.4; color: var(--text); }
.act-avatar { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: var(--brand-50); color: var(--brand); }
.act-item.empresa .act-avatar { background: #FEF3C7; color: #92400E; }
.act-txt { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.act-txt small { display: block; margin-top: 2px; color: var(--text-2); font-size: 11.5px; }
.act-avisos { position: fixed; top: 64px; right: 16px; z-index: 210; display: flex; flex-direction: column; gap: 8px; width: min(360px, calc(100vw - 32px)); pointer-events: none; }
.act-aviso { pointer-events: auto; cursor: pointer; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--brand); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 12px 12px 12px 12px; animation: act-entrar .25s ease-out; }
.act-aviso:has(.empresa) { border-left-color: #D97706; }
.act-cerrar { flex: none; border: 0; background: none; color: var(--text-2); font-size: 18px; line-height: 1; cursor: pointer; padding: 0 2px; }
@keyframes act-entrar { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@media (max-width: 560px) { .act-avisos { top: 60px; right: 12px; width: calc(100vw - 24px); } }
@media print { .act-avisos, .act-campana { display: none !important; } }
.mx.pre td.pre-co .pre-quitar { float: right; margin: -2px -4px 0 6px; width: 26px; height: 26px; border: 0; border-radius: 6px; background: none; color: var(--text-3); cursor: pointer; display: grid; place-items: center; opacity: .55; }
.mx.pre td.pre-co .pre-quitar svg { width: 15px; height: 15px; }
.mx.pre tr:hover .pre-quitar, .mx.pre td.pre-co .pre-quitar:focus-visible { opacity: 1; }
.mx.pre td.pre-co .pre-quitar:hover { background: #FEE2E2; color: #B91C1C; }
@media print { .pre-quitar { display: none !important; } }
.act-rueda { display: inline-block; max-width: 100%; margin-bottom: 3px; padding: 1px 8px; border-radius: 999px; background: var(--brand-50); color: var(--brand); font-size: 11px; font-weight: 750; letter-spacing: .02em; text-transform: uppercase; white-space: normal; line-height: 1.35; vertical-align: top; }
.act-rueda.general { background: var(--surface-2); color: var(--text-3); }
.act-det { margin: 4px 0 0; padding-left: 16px; color: var(--text-2); font-size: 12.5px; }
.act-det li { margin: 1px 0; }
.act-txt small a { font-weight: 650; }

/* Elemento al que se llega desde una notificación (?foco=…) */
@keyframes foco-flash { 0%, 60% { background-color: #FEF08A; } 100% { background-color: transparent; } }
.act-ir { display: inline-block; margin-top: 6px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--brand); color: var(--brand); font-size: 12px; font-weight: 700; text-decoration: none; }
.act-ir:hover { background: var(--brand); color: #fff; text-decoration: none; }
.act-item.con-enlace { cursor: pointer; }
.act-panel-b .act-item.con-enlace:hover { background: var(--surface-2); }
.act-aviso:hover { box-shadow: var(--shadow-lg), 0 0 0 2px var(--brand-50); }

/* Aviso de recordatorios (se acerca la Rueda) */
.rec-aviso { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.rec-aviso .btn { flex: none; }
.table-pie { padding: 8px 14px; font-size: 12px; border-top: 1px solid var(--border); }
/* Informe de resultados: pendientes y campo resaltado */
.inf-pendientes ul { margin: 6px 0 0; padding-left: 18px; }
.inf-pendientes li { margin: 2px 0; }
.inf-resaltar { box-shadow: 0 0 0 3px var(--warn) !important; transition: box-shadow .3s; }
.inf-listo { font-weight: 700; font-size: 13px; padding: 4px 10px; border: 1px solid var(--border-strong); border-radius: 999px; cursor: pointer; }
.inf-listo.on { background: #DCFCE7; border-color: #86EFAC; color: #166534; }
.inf-hecha { border-color: #86EFAC; }
.inf-oculta { opacity: .45; }
.inf-est td:first-child { white-space: nowrap; }
.inf-manual { width: 92px; padding: 4px 8px; font-size: 13px; }
.inf-manual.con-dato { border-color: var(--warn); background: #FFFBEB; font-weight: 700; }
.inf-formula { position: relative; display: inline-block; }
.inf-formula summary { list-style: none; cursor: pointer; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--border-strong); display: grid; place-items: center; font-size: 11px; font-weight: 800; color: var(--text-2); }
.inf-formula summary::-webkit-details-marker { display: none; }
.inf-formula[open] small { position: absolute; z-index: 20; left: 0; top: 22px; width: 280px; white-space: normal; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-lg); padding: 8px 10px; color: var(--text); font-size: 12px; }
.inf-est-wrap { overflow-x: auto; max-width: 100%; }
.grid.g2 > * { min-width: 0; }
