:root {
  --navy: #0B4C78;
  --blue: #0EA9D9;
  --orange: #F7941D;
  --orange-light: #FBB040;
  --ink: #1B1F2A;
  --muted: #6B7280;
  --line: #E5E7EB;
  --bg: #F5F6FA;
  --card: #FFFFFF;
  --good: #1E9E6B;
  --warn: #C98A1E;
  --bad: #D14343;
  --inv-teal: #2b6cb0;
  --inv-teal-dark: #1a4e85;
  --inv-border: #e0e0e0;
  --inv-muted: #757575;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); height: 100%; }
[hidden] { display: none !important; }

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ---------- Auth screen ---------- */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy), var(--blue) 70%, var(--orange-light));
}
.auth-card {
  background: var(--card);
  padding: 32px 40px 40px;
  border-radius: 16px;
  width: 340px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: center;
}
.auth-logo { width: 150px; margin: 0 auto 4px; }
.auth-sub { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.auth-card label { text-align: left; }
.auth-card .auth-error { text-align: left; }
.auth-card label { font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 6px; }
.auth-card input {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px;
}
.auth-error { color: var(--bad); font-size: 13px; min-height: 16px; margin: 4px 0 0; }
.ghost-link { background: none; border: none; color: var(--blue); font-size: 12.5px; padding: 0; margin-top: 12px; text-decoration: underline; }

/* ---------- App shell ---------- */
.app { display: flex; height: 100vh; height: 100dvh; }

.sidebar {
  width: 230px;
  background: var(--navy);
  color: #fff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.brand { padding: 18px; border-bottom: 1px solid rgba(255,255,255,.12); display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 34px; height: 34px; flex-shrink: 0; }
.brand-name { font-family: 'Exo', sans-serif; font-size: 15px; font-weight: 700; line-height: 1.2; }
.brand-name span { display: block; font-weight: 400; opacity: .75; font-size: 12px; }

.nav { display: flex; flex-direction: column; gap: 2px; padding: 12px; flex: 1; }
.nav-spacer { flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  background: none; border: none; color: rgba(255,255,255,.8);
  padding: 10px 12px; border-radius: 8px; text-align: left; font-size: 14px;
}
.nav-item:hover { background: rgba(255,255,255,.08); }
.nav-item.active { background: rgba(255,255,255,.16); color: #fff; font-weight: 600; }

.sidebar-foot { padding: 14px; border-top: 1px solid rgba(255,255,255,.12); }
.whoami { font-size: 12px; opacity: .7; margin-bottom: 8px; }
.ghost-btn {
  width: 100%; background: transparent; border: 1px solid rgba(255,255,255,.3);
  color: #fff; padding: 8px; border-radius: 8px; font-size: 13px;
}
.ghost-btn:hover { background: rgba(255,255,255,.1); }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 24px; background: var(--card); border-bottom: 1px solid var(--line);
}
@media (min-width: 861px) { .topbar { display: none; } }
.menu-toggle {
  display: none; background: none; border: none; font-size: 20px; line-height: 1;
  padding: 6px 8px; border-radius: 8px; color: var(--ink); flex-shrink: 0;
}
.menu-toggle:hover { background: var(--bg); }
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 55; }
.sidebar-backdrop.open { display: block; }
.primary-btn {
  background: var(--blue); color: #fff; border: none; padding: 9px 16px;
  border-radius: 8px; font-size: 14px; font-weight: 600;
}
.primary-btn:hover { background: var(--navy); }

.content { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 24px; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }

/* ---------- Tables / lists ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.table-scroll .data-table { box-shadow: none; min-width: 560px; }
.data-table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 10px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.data-table th, .data-table td { padding: 10px 14px; text-align: left; font-size: 14px; border-bottom: 1px solid var(--line); }
.data-table th { background: #FAFBFF; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #F8FAFF; cursor: pointer; }

.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-lead { background: #E9ECFB; color: var(--navy); }
.badge-contactado { background: #DFF6FA; color: #0E8A8A; }
.badge-cliente { background: #E4F7EC; color: var(--good); }
.badge-inactivo { background: #F1F2F4; color: var(--muted); }

.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.page-header h2 { margin: 0; font-size: 20px; }

/* ---------- Detail / timeline ---------- */
.detail-grid { display: grid; grid-template-columns: 320px 1fr; gap: 20px; align-items: start; }
.card { background: var(--card); border-radius: 10px; padding: 18px; box-shadow: 0 1px 3px rgba(0,0,0,.06); margin-bottom: 16px; }
.card h3 { margin: 0 0 12px; font-size: 15px; }
.field-row { display: flex; justify-content: space-between; font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.field-row:last-child { border-bottom: none; }
.field-row .label { color: var(--muted); }
.back-link { background: none; border: none; color: var(--blue); font-size: 13px; padding: 0; margin-bottom: 10px; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: none; }
.timeline .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); margin-top: 5px; flex-shrink: 0; }
.timeline li.type-llamada .dot { background: #eab308; }
.timeline li.type-whatsapp .dot { background: #25D366; }
.timeline li.type-email .dot { background: #8e44ad; }
.timeline li.type-reunion .dot { background: #16a085; }
.timeline li.type-nota .dot { background: #64748b; }
.timeline li.type-tarea .dot { background: #2980b9; }
.timeline li.type-informacion_confirmada .dot { background: #1e40af; }
.timeline li.type-cita_agendada .dot { background: #065f46; }
.timeline li.type-volver_a_llamar .dot { background: #065f46; }
.timeline li.type-sin_respuesta .dot { background: #94a3b8; }
.timeline li.type-otro .dot { background: #8b5cf6; }
.timeline .t-subject { font-size: 14px; font-weight: 600; }
.timeline .t-desc { font-size: 13px; color: var(--muted); }
.timeline .t-date { font-size: 12px; color: var(--muted); margin-left: auto; white-space: nowrap; }

.activity-form { display: flex; gap: 8px; margin-top: 12px; }
.activity-form select, .activity-form input { padding: 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; }
.activity-form input[type="text"] { flex: 1; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.4);
  display: none; align-items: center; justify-content: center; z-index: 50;
}
.modal-backdrop.open { display: flex; }
.modal { background: var(--card); border-radius: 12px; padding: 24px; width: 420px; max-width: 90vw; max-height: 85vh; max-height: 85dvh; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.modal.modal-report { width: 820px; max-width: 95vw; padding: 16px; background: #f8fafc; }
.modal.modal-wide { width: 640px; }
.modal.modal-fullmap { width: 96vw; max-width: 1100px; }
.expand-map-btn { background: none; border: 1px solid var(--line); border-radius: 6px; width: 26px; height: 26px; font-size: 14px; cursor: pointer; color: var(--navy); flex-shrink: 0; }
.expand-map-btn:hover { background: var(--bg); }
.modal h3 { margin-top: 0; }
.modal label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 10px 0 4px; }
.modal .row { display: flex; gap: 10px; }
.modal .row > div { flex: 1; }
.modal input, .modal select, .modal textarea {
  width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.secondary-btn { background: none; border: 1px solid var(--line); padding: 9px 16px; border-radius: 8px; font-size: 14px; }
.dictate-btn { background: none; border: 1px solid var(--line); border-radius: 50%; width: 26px; height: 26px; font-size: 13px; line-height: 1; cursor: pointer; padding: 0; }
.dictate-btn.dictating { background: #fde8e8; border-color: #c0392b; animation: dictate-pulse 1s ease-in-out infinite; }
@keyframes dictate-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }

/* ---------- Toasts ---------- */
.toast-stack { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 13px; box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.toast.error { background: var(--bad); }
.toast.success { background: var(--good); }

.empty-state { text-align: center; color: var(--muted); padding: 40px; font-size: 14px; }

/* ============================================================
   Cotizaciones / Facturas (formato fiscal RD, portado del
   Generador de Facturas original)
============================================================ */
.invoice-app { display: flex; gap: 24px; align-items: flex-start; max-width: 1400px; flex-wrap: wrap; }
.form-panel { flex: 1 1 420px; max-width: 480px; background: #fff; border-radius: 10px; padding: 20px 22px; box-shadow: 0 1px 4px rgba(0,0,0,.12); max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
.form-panel h2 { margin-top: 0; font-size: 18px; color: var(--inv-teal-dark); }
.form-panel fieldset { border: 1px solid var(--inv-border); border-radius: 8px; margin-bottom: 16px; padding: 12px 14px 16px; }
.form-panel legend { padding: 0 6px; font-weight: 600; font-size: 13px; color: var(--inv-teal-dark); text-transform: uppercase; letter-spacing: .03em; }
.form-panel label { display: block; font-size: 12px; color: var(--inv-muted); margin-bottom: 3px; }
.form-panel .row { display: flex; gap: 10px; margin-bottom: 10px; }
.form-panel .row > div { flex: 1; }
.form-panel input, .form-panel textarea, .form-panel select { width: 100%; padding: 7px 8px; border: 1px solid #ccc; border-radius: 5px; font-size: 13px; font-family: inherit; }
.form-panel input:focus, .form-panel textarea:focus, .form-panel select:focus { outline: none; border-color: var(--inv-teal); box-shadow: 0 0 0 2px rgba(43,108,176,.15); }
.form-panel textarea { resize: vertical; min-height: 64px; }
.form-panel input[type="checkbox"] { width: auto; }
.business-display div { font-size: 13px; color: #333; padding: 3px 0; line-height: 1.5; }
.item-row { display: grid; grid-template-columns: 2.2fr 0.8fr 1fr 1fr 30px; gap: 6px; margin-bottom: 6px; align-items: center; }
.item-row input { padding: 6px 6px; font-size: 12px; }
.item-split { grid-column: 1 / -1; font-size: 11px; color: var(--inv-muted); margin-top: -2px; }
.item-head { display: grid; grid-template-columns: 2.2fr 0.8fr 1fr 1fr 30px; gap: 6px; font-size: 11px; color: var(--inv-muted); margin-bottom: 4px; }
.btn { cursor: pointer; border: none; border-radius: 6px; padding: 9px 14px; font-size: 13px; font-weight: 600; color: #fff; background: var(--inv-teal); }
.btn:hover { background: var(--inv-teal-dark); }
.btn.secondary { background: #fff; color: var(--inv-teal-dark); border: 1px solid var(--inv-teal); }
.btn.secondary:hover { background: #e8f0fa; }
.btn.small { padding: 4px 8px; font-size: 12px; }
.btn.remove { background: #e05353; padding: 4px 6px; line-height: 1; }
.form-panel .actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.hint { font-size: 11px; color: var(--inv-muted); margin-top: -4px; margin-bottom: 8px; }
.disc-hint { font-size: 11px; color: var(--inv-muted); margin-top: -6px; }

.preview-wrap { flex: 1 1 640px; display: flex; flex-direction: column; align-items: center; }
.invoice-card { width: 800px; max-width: 100%; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #333; line-height: 1.425; background: #fff; padding: 38px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.header-table, .items-table { width: 100%; border-collapse: collapse; }
.header-table td { vertical-align: top; }
.logo-container { width: 150px; height: 136px; margin-bottom: 0; }
.invoice-title { font-size: 28px; font-weight: bold; color: #2b6cb0; text-align: right; margin: 0; }
.meta-text { text-align: right; font-size: 14px; color: #4a5568; }
.section-divider { border-bottom: 2px solid #e2e8f0; margin: 10px 0; }
.info-section { background-color: #f8fafc; border-radius: 6px; padding: 10px 15px; margin-bottom: 12px; }
.info-block h3 { font-size: 12px; text-transform: uppercase; color: #a0aec0; margin: 0 0 4.75px 0; letter-spacing: .475px; }
.info-block p { margin: 0; font-size: 14px; color: #2d3748; font-weight: 500; }
.items-table { margin-top: 9.5px; margin-bottom: 23.75px; }
.items-table th { background-color: #2b6cb0; color: #fff; font-size: 13px; font-weight: 600; text-transform: uppercase; padding: 9.5px 14.25px; text-align: left; }
.items-table th:nth-child(2), .items-table td:nth-child(2) { text-align: center; }
.items-table th:nth-child(3), .items-table td:nth-child(3),
.items-table th:nth-child(4), .items-table td:nth-child(4),
.items-table th:nth-child(5), .items-table td:nth-child(5) { text-align: right; }
.items-table td { padding: 11.4px 14.25px; border-bottom: 1px solid #e2e8f0; font-size: 14px; }
.includes-list { margin: 14.25px 0 0 0; padding-left: 19px; color: #4a5568; font-size: 13px; }
.includes-list li { margin-bottom: 2.85px; }
.invoice-cols { display: flex; align-items: stretch; margin-bottom: 19px; }
.incluye-col { width: 55%; padding-right: 19px; }
.totals-col { width: 45%; margin-left: auto; display: flex; flex-direction: column; }
.totals-col .bank-details { margin-top: auto; }
.summary-table { width: 300px; margin-left: auto; border-collapse: collapse; }
.summary-table td { padding: 5.7px 11.4px; font-size: 14px; }
.summary-table .label { color: #4a5568; text-align: right; }
.summary-table .value { text-align: right; font-weight: 500; }
.summary-table .total-row td { border-top: 2px solid #2b6cb0; font-size: 16px; font-weight: bold; color: #1a365d; padding-top: 9.5px; }
.bank-details { background-color: #ebf8ff; border-left: 4px solid #3182ce; padding: 14.25px; border-radius: 0 6px 6px 0; font-size: 13px; color: #2c5282; margin-top: 19px; }
.bank-details h4 { margin: 0 0 4.75px 0; font-size: 14px; }
.footer-extra { text-align: center; margin-top: 12px; padding-top: 10px; border-top: 1px dashed #cbd5e0; color: #718096; font-size: 12px; }
.footer-brand { text-align: center; margin-top: 6px; color: #718096; font-size: 12px; font-weight: bold; letter-spacing: 1.425px; }
.cotizacion-nota { text-align: center; margin-top: 10px; color: #a0aec0; font-size: 10px; line-height: 1.5; }
.pv-timestamp { text-align: right; margin-top: 8px; color: #cbd5e0; font-size: 9px; }

.invoice-card.mobile-export { width: 405px; padding: 20px; }
.invoice-card.mobile-export .logo-container { width: 100px; height: 91px; }
.invoice-card.mobile-export .invoice-title { font-size: 22px; }
.invoice-card.mobile-export .items-table th, .invoice-card.mobile-export .items-table td { padding: 7px 6px; font-size: 11.5px; }
.invoice-card.mobile-export .invoice-cols { flex-direction: column; }
.invoice-card.mobile-export .incluye-col { width: 100%; padding-right: 0; margin-bottom: 14px; }
.invoice-card.mobile-export .totals-col { width: 100%; margin-left: 0; }
.invoice-card.mobile-export .summary-table { width: 100%; max-width: 260px; margin-left: auto; }
.invoice-card.mobile-export .bank-details { margin-top: 19px; }

@media (max-width: 900px) {
  .invoice-app { flex-direction: column; align-items: stretch; }
  .invoice-app .form-panel, .invoice-app .preview-wrap { flex: none; width: 100%; }
  .form-panel { max-width: none; max-height: none; }
}

/* ============================================================
   Modo movil: sidebar como panel deslizable (app-like), no
   columna fija que le come el ancho a todo lo demas.
============================================================ */
@media (max-width: 860px) {
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; }

  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; width: 250px;
    transform: translateX(-100%); transition: transform .2s ease; z-index: 60;
  }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,.25); }

  .topbar { padding: 12px 14px; }
  .content { padding: 14px; }

  .table-scroll .data-table { min-width: 480px; }

  .detail-grid { grid-template-columns: 1fr; }

  .modal { width: 94vw; padding: 18px; }

  .page-header { flex-wrap: wrap; gap: 10px; }
}

/* ============================================================
   Perfil de Colegio / Empresa (portado de Perfil Colegio.html)
============================================================ */
.profile-card { max-width: 900px; margin: 0 auto; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.header-container { position: relative; display: flex; background-color: var(--navy); color: #fff; }
.header-photo-cell { width: 150px; aspect-ratio: 9/10; flex-shrink: 0; background-color: rgba(255,255,255,.15); display: flex; align-items: center; justify-content: center; padding: 3px; overflow: hidden; }
.header-photo-cell img { width: 100%; height: 100%; object-fit: cover; }
.header-photo-cell.is-logo { width: 220px; aspect-ratio: auto; align-self: stretch; padding: 12px; background-color: #fff; color: var(--navy); }
.header-photo-cell.is-logo img { width: auto; height: auto; max-width: 70%; max-height: 70%; object-fit: contain; }
.header-photo-cell.is-photo { width: 220px; aspect-ratio: auto; align-self: stretch; padding: 0; }
.header-photo-cell.is-photo img { width: 100%; height: 100%; object-fit: cover; }
.header-text-cell { flex: 1; min-width: 0; padding: 10px 16px; display: flex; flex-direction: column; justify-content: center; overflow-wrap: break-word; }
.header-text-cell h1 { font-size: 22px; font-weight: bold; margin: 0; }
.profile-age { font-size: 13px; font-weight: 400; color: rgba(255,255,255,.6); }
.header-subline { font-size: 13px; margin-top: 4px; color: rgba(255,255,255,.85); }
.nav-buttons { position: absolute; top: 10px; right: 14px; display: flex; gap: 12px; }
.nav-link { background: none; border: none; border-bottom: 2px solid transparent; color: rgba(255,255,255,.8); padding: 0; font-size: 13px; cursor: pointer; font-weight: 600; }
.nav-link:hover { color: #fff; border-bottom-color: rgba(255,255,255,.5); }

.profile-main-layout { display: flex; }
.profile-sidebar { width: 220px; flex-shrink: 0; background-color: #eef3f7; padding: 16px 12px; overflow-wrap: break-word; }
.profile-sidebar-section { margin-bottom: 18px; }
.profile-sidebar-title { font-size: 11px; font-weight: 700; color: var(--navy); letter-spacing: .5px; margin-bottom: 8px; text-transform: uppercase; }
.profile-sidebar-hr { border: none; border-top: 1px solid #c8d6de; margin: -4px 0 10px; }
.profile-contact-item { margin-bottom: 6px; font-size: 13px; }
.profile-contact-item i, .entity-card-sub i { color: var(--navy); width: 14px; text-align: center; margin-right: 2px; }
.profile-list { list-style: none; padding-left: 4px; }
.profile-list li { position: relative; padding-left: 12px; margin-bottom: 5px; font-size: 13px; }
.profile-list li::before { content: "•"; position: absolute; left: 0; color: var(--muted); }

@media (max-width: 860px) {
  .header-container { flex-direction: column; }
  .header-photo-cell { width: 100%; aspect-ratio: 16/9; }
  .header-photo-cell.is-logo { width: 100%; aspect-ratio: 16/9; }
  .profile-main-layout { flex-direction: column; }
  .profile-sidebar { width: 100%; }
  .nav-buttons { position: static; justify-content: flex-end; padding: 8px 12px 0; }
}

.dir-card { background: #fff; border-radius: 6px; padding: 8px 10px; margin-bottom: 6px; box-shadow: 0 1px 3px rgba(0,0,0,.05); font-size: 13px; }
.dir-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 5px; flex-wrap: wrap; }
.dir-name { font-weight: 700; color: var(--navy); }
.dir-tag { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 4px; white-space: nowrap; text-transform: uppercase; }
.tag-agencia { background: #E9ECFB; color: #3f51b5; }
.tag-contacto { background: #E4F7EC; color: #2e7d32; }
.tag-otro { background: #FEF9E7; color: #d35400; }
.dir-desc { color: var(--muted); font-size: 12px; }
.dir-phone { color: #3f51b5; font-weight: 700; font-size: 12px; }
.dir-wa-link { color: var(--muted); opacity: .55; margin-left: 4px; }
.dir-wa-link:hover { opacity: 1; color: #25D366; }

.profile-content { flex: 1; min-width: 0; padding: 18px; }
.profile-section-title { font-size: 14px; font-weight: 700; margin-bottom: 16px; text-transform: uppercase; letter-spacing: .3px; }
.profile-section-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.profile-section-title-row .profile-section-title { margin-bottom: 0; }
.profile-section-title-row .back-link { margin-bottom: 0; font-size: 12px; }

.profile-timeline { position: relative; padding-left: 22px; list-style: none; }
.profile-timeline::before { content: ''; position: absolute; left: 4px; top: 5px; bottom: 5px; width: 2px; background: var(--line); }
.profile-timeline-item { position: relative; margin-bottom: 22px; }
.profile-timeline-item::before { content: ''; position: absolute; left: -22px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: #b0bec5; border: 2px solid #fff; box-shadow: 0 0 0 2px #b0bec5; }
.profile-timeline-item.active::before { background: var(--blue); box-shadow: 0 0 0 2px var(--blue); }
.profile-timeline-date { font-size: 11px; font-weight: 700; color: #7986cb; text-transform: uppercase; margin-bottom: 2px; }
.profile-timeline-num { color: #b0bec5; font-weight: 600; margin-right: 5px; }
.profile-timeline-item.is-excursion::before { background: var(--blue); box-shadow: 0 0 0 2px var(--blue); }
.profile-timeline-item.is-excursion .profile-timeline-date { color: var(--blue); }
.profile-timeline-item.is-excursion .profile-timeline-loc { color: var(--navy); }
.profile-timeline-item.is-excursion { background: #eef3fc; border: 1px solid #dbe7f9; border-radius: 8px; padding: 10px 12px 10px 14px; }
.profile-timeline-item.is-excursion:has(+ .profile-timeline-item.is-excursion) { margin-bottom: 5px; }
.profile-timeline-year-count { font-weight: 600; color: var(--muted); text-transform: none; letter-spacing: 0; margin-left: 4px; }
.profile-section-title .profile-section-total { font-weight: 600; color: var(--muted); text-transform: none; letter-spacing: 0; }
.profile-timeline-year-sep { list-style: none; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin: 0 0 14px 0; padding-top: 6px; border-top: 1px dashed var(--line); }
.profile-timeline-item.is-interaccion .profile-timeline-loc { font-weight: 600; color: var(--ink); }
.profile-timeline-item.type-llamada::before { background: #eab308; box-shadow: 0 0 0 2px #eab308; }
.profile-timeline-item.type-llamada .profile-timeline-date { color: #b8860b; }
.profile-timeline-item.type-whatsapp::before { background: #25D366; box-shadow: 0 0 0 2px #25D366; }
.profile-timeline-item.type-whatsapp .profile-timeline-date { color: #1ea952; }
.profile-timeline-item.type-email::before { background: #8e44ad; box-shadow: 0 0 0 2px #8e44ad; }
.profile-timeline-item.type-email .profile-timeline-date { color: #8e44ad; }
.profile-timeline-item.type-reunion::before { background: #16a085; box-shadow: 0 0 0 2px #16a085; }
.profile-timeline-item.type-reunion .profile-timeline-date { color: #16a085; }
.profile-timeline-item.type-tarea::before { background: #2980b9; box-shadow: 0 0 0 2px #2980b9; }
.profile-timeline-item.type-tarea .profile-timeline-date { color: #2980b9; }
.profile-timeline-item.type-informacion_confirmada::before { background: #1e40af; box-shadow: 0 0 0 2px #1e40af; }
.profile-timeline-item.type-informacion_confirmada .profile-timeline-date { color: #1e40af; }
.profile-timeline-item.type-cita_agendada::before { background: #065f46; box-shadow: 0 0 0 2px #065f46; }
.profile-timeline-item.type-cita_agendada .profile-timeline-date { color: #065f46; }
.profile-timeline-item.type-volver_a_llamar::before { background: #065f46; box-shadow: 0 0 0 2px #065f46; }
.profile-timeline-item.type-volver_a_llamar .profile-timeline-date { color: #065f46; }
.profile-timeline-item.type-sin_respuesta::before { background: #94a3b8; box-shadow: 0 0 0 2px #94a3b8; }
.profile-timeline-item.type-sin_respuesta .profile-timeline-date { color: #64748b; }
.profile-timeline-item.type-otro::before { background: #8b5cf6; box-shadow: 0 0 0 2px #8b5cf6; }
.profile-timeline-item.type-otro .profile-timeline-date { color: #8b5cf6; }
.profile-timeline-badge { font-weight: 400; color: #e67e22; margin-left: 5px; text-transform: none; }
.profile-timeline-item.active .profile-timeline-date { color: var(--navy); }
.profile-timeline-loc { font-size: 14px; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.profile-timeline-courses { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 6px; text-transform: uppercase; }
.profile-timeline-details { font-size: 13px; color: var(--muted); }


.dynamic-item-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.dynamic-item-row input { flex: 1; }
.dyn-box { border: 1px dashed var(--line); border-radius: 8px; padding: 10px; margin-bottom: 10px; }
.dyn-box .row:last-of-type { margin-bottom: 8px; }

.list-toolbar-sticky { position: sticky; top: -24px; z-index: 4; background: var(--bg); margin: -24px -24px 14px; padding: 24px 24px 10px; border-bottom: 1px solid var(--line); }
.list-toolbar-sticky .page-header { margin-bottom: 12px; }
.list-toolbar-sticky .filters-bar { margin-bottom: 0; }
.list-count { font-size: 12.5px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.sub-tab-bar { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.sub-tab-btn { background: var(--card); border: 1px solid var(--line); color: var(--muted); font-weight: 600; font-size: 13px; padding: 8px 14px; border-radius: 20px; cursor: pointer; }
.sub-tab-btn:hover { border-color: var(--blue); color: var(--navy); }
.sub-tab-btn.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.filters-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filters-bar select { flex: 0 0 auto; }
.filters-bar input[type="text"], .filters-bar select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; font-family: inherit; background: var(--card); color: var(--ink); }
.search-clear-wrap { position: relative; flex: 1 1 220px; }
.search-clear-wrap input[type="text"] { width: 100%; padding-right: 30px; }
.search-clear-btn { display: none; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); background: none; border: none; font-size: 17px; line-height: 1; color: var(--muted); cursor: pointer; padding: 4px 6px; }
.search-clear-btn:hover { color: var(--ink); }
.search-clear-wrap.has-text .search-clear-btn { display: block; }

.multi-select { position: relative; }
.multi-select > summary { list-style: none; cursor: pointer; padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; background: var(--card); color: var(--ink); user-select: none; }
.multi-select > summary::-webkit-details-marker { display: none; }
.multi-select > summary::after { content: ' \25be'; color: var(--muted); }
.multi-select-panel { position: absolute; top: calc(100% + 4px); left: 0; z-index: 20; background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.14); padding: 8px; min-width: 190px; max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.multi-select-opt { display: flex; align-items: center; gap: 7px; font-size: 13px; padding: 5px 6px; border-radius: 4px; cursor: pointer; white-space: nowrap; }
.multi-select-opt:hover { background: var(--bg); }

.card-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
@media (max-width: 860px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .filters-bar { flex-direction: column; margin-bottom: 10px; }
  .filters-bar select { width: 100%; }
  .filters-bar input[type="text"], .filters-bar select { padding: 6px 8px; font-size: 12.5px; }
  .search-clear-wrap { flex: none; width: 100%; }
  .multi-select { width: 100%; }
  .multi-select > summary { width: 100%; }
  .modal .row, .form-panel .row { flex-direction: column; gap: 8px; }
  .list-toolbar-sticky { top: -14px; margin: -14px -14px 10px; padding: 14px 14px 8px; }
}
.entity-card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; transition: box-shadow .15s, transform .1s; min-width: 0; }
.entity-card:hover { box-shadow: 0 3px 10px rgba(0,0,0,.12); transform: translateY(-2px); }
.entity-card-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; overflow: hidden; flex-shrink: 0; }
.entity-card-avatar:has(img) { background: #fff; }
.entity-card-avatar img { width: 100%; height: 100%; object-fit: cover; }
.entity-card-name { font-weight: 600; font-size: 13.5px; color: var(--ink); line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 46px; }
.entity-card-age { font-weight: 400; font-size: 11.5px; color: var(--muted); }
.entity-card-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entity-card-badge { align-self: flex-start; }
.entity-card-corner-badge { position: absolute; top: 10px; right: 12px; font-size: 9.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: #a3adb8; }
.entity-card-corner { position: absolute; top: 10px; right: 12px; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.entity-card-corner-line { font-size: 9.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: #a3adb8; line-height: 1.3; }
.entity-card-actions { position: absolute; top: 46px; right: 12px; }
.entity-card-btnrow { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.entity-card-btnrow .entity-card-btn { flex: 1 1 auto; }
.entity-card-icons { display: flex; flex-direction: column; gap: 6px; }
.entity-card-icon-btn { width: 26px; height: 26px; border-radius: 8px; display: flex; align-items: center; justify-content: center; text-decoration: none; flex-shrink: 0; background: var(--navy); }
.entity-card-icon-btn.wa { background: #25D366; }
.entity-card-icon-btn.ig { background: linear-gradient(45deg,#f9ce34,#ee2a7b,#6228d7); }
.entity-card-icon-btn:hover { opacity: .85; }
.entity-card-btn { text-align: center; padding: 7px 10px; border-radius: 6px; font-size: 11px; font-weight: 600; text-decoration: none; color: #fff; border: none; cursor: pointer; background: var(--navy); }
.entity-card-btn.wa { background: #25D366; }
.entity-card-btn.ig { background: linear-gradient(45deg,#f9ce34,#ee2a7b,#6228d7); }
.entity-card-btn:hover { opacity: .88; }
.entity-card-actions-stack { position: absolute; top: 42px; right: 12px; display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.entity-card-btn-rect { text-align: center; padding: 5px 12px; border-radius: 6px; font-size: 10.5px; font-weight: 600; text-decoration: none; color: #fff; border: none; cursor: pointer; background: var(--navy); white-space: nowrap; }
.entity-card-btn-rect:hover { opacity: .88; }

.tag-checks { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 6px 0 4px; }
.tag-check { display: flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 400; color: var(--ink); }
.tag-check input { width: auto; margin: 0; }

.calc-results { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; text-align: center; }
.calc-box { background: #eefbff; padding: 10px; border: 1px solid var(--blue); border-radius: 6px; }
.calc-label { font-size: 11px; color: var(--navy); }
.calc-val { font-weight: 700; font-size: 14px; color: var(--navy); }
.calc-highlight { grid-column: span 3; background: var(--orange-light); border-color: var(--orange); padding: 12px; }
.calc-highlight .calc-val { font-size: 18px; }
.calc-note { font-size: 11px; color: rgba(0,0,0,.5); margin-top: 3px; }
@media (max-width: 600px) {
  .calc-results { grid-template-columns: 1fr 1fr; }
  .calc-highlight { grid-column: span 2; }
}

/* ============================================================
   ITINERARIO PREMIUM
============================================================ */
.itin-body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; font-size: 13px; color: #334155; }
.itin-control-panel { background: #fff; padding: 16px; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.itin-panel-title { margin: 0 0 12px; font-size: 15px; color: #1e293b; text-transform: uppercase; letter-spacing: .5px; border-bottom: 2px solid #e2e8f0; padding-bottom: 6px; font-weight: 700; }
.itin-form-control { width: 100%; padding: 7px 9px; border: 1px solid #cbd5e1; border-radius: 5px; font-size: 12.5px; color: #1e293b; background: #fff; }
.itin-form-control:focus { outline: none; border-color: #2b4c5e; }
.itin-selector-header { background: #e2e8f0; padding: 8px 12px; border-radius: 6px; font-weight: bold; margin: 10px 0; }
.itin-stops-list { display: flex; flex-direction: column; gap: 14px; margin-top: 10px; }
.itin-stop-card { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px; padding: 8px; border-left: 3px solid transparent; border-right: 3px solid transparent; }
.itin-order-actions { display: flex; gap: 4px; align-items: center; }
.itin-btn-order { padding: 4px 8px; font-size: 11px; font-weight: bold; cursor: pointer; background: #cbd5e1; border: none; border-radius: 3px; color: #334155; }
.itin-btn-order:hover { background: #94a3b8; }
.itin-export-actions { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; margin-top: 15px; border-top: 1px solid #e2e8f0; padding-top: 12px; }
.itin-btn-global { width: 100%; padding: 10px 8px; border: none; border-radius: 6px; font-weight: 700; font-size: 12px; cursor: pointer; text-align: center; color: #fff; }
.itin-btn-jpg { background: #00a4c5; }
.itin-btn-jpg:hover { background: #00819b; }
.itin-btn-save { background: #2b4c5e; }
.itin-btn-save:hover { background: #1c333f; }
.itin-preview-wrap { display: flex; justify-content: center; padding: 15px; background: #eaedf1; border-radius: 10px; }

.itin-card { position: relative; width: 100%; max-width: 460px; padding: 20px 15px; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,.08); background: #f9f9f9; }
.itin-header { text-align: center; margin-bottom: 15px; }
.itin-header h1 { margin: 0; font-size: 14px; text-transform: uppercase; letter-spacing: 2px; color: #64748b; font-weight: 400; }
.itin-header h2 { margin: 2px 0; font-size: 17px; text-transform: uppercase; letter-spacing: .5px; color: #2b4c5e; font-weight: 700; }
.itin-header h3 { margin: 0 0 10px; font-size: 11px; text-transform: uppercase; color: #64748b; font-weight: 600; }
.itin-color-bar { display: flex; width: 130px; height: 3px; margin: 0 auto; }
.itin-kpi-container { display: flex; gap: 4px; margin-bottom: 15px; justify-content: center; }
.itin-kpi-box { flex: 1; max-width: 100px; background: rgba(255,255,255,.9); padding: 5px 2px; border-radius: 4px; text-align: center; border: 1px solid #e2e8f0; }
.itin-kpi-label { font-size: 7px; font-weight: bold; color: #64748b; text-transform: uppercase; white-space: nowrap; }
.itin-kpi-val { font-size: 10px; font-weight: 700; color: #1e293b; margin-top: 1px; }
.itin-timeline-axis { position: relative; padding: 5px 0; margin-top: 10px; }
.itin-timeline-axis::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: #cbd5e1; transform: translateX(-50%); }
.itin-transit-badge { position: relative; text-align: center; margin: 4px 0; z-index: 2; }
.itin-transit-text { display: inline-block; background: #fffdf5; border: 1px dashed #f2a900; color: #b47e00; font-size: 8.5px; font-weight: 700; padding: 2px 6px; border-radius: 4px; }
.itin-block { position: relative; margin-bottom: 6px; width: 100%; display: flex; }
.itin-block-left { justify-content: flex-start; padding-left: 6%; }
.itin-block-right { justify-content: flex-end; padding-right: 6%; }
.itin-block-card { width: 42%; background: rgba(255,255,255,.93); padding: 6px 8px; border-radius: 5px; box-shadow: 0 2px 8px rgba(0,0,0,.12); position: relative; border: 1px solid #e8e9eb; border-top: 3px solid #2b4c5e; word-wrap: break-word; }
.itin-axis-pointer { position: absolute; left: 50%; top: 10px; width: 10px; height: 10px; background: #2b4c5e; border-radius: 50%; border: 2px solid #fff; transform: translateX(-50%); z-index: 3; }
.itin-card-arrow { position: absolute; top: 7px; font-size: 13px; color: #cbd5e1; font-weight: bold; }
.itin-block-left .itin-card-arrow { right: -11px; }
.itin-block-right .itin-card-arrow { left: -11px; }
.itin-card-time { font-size: 12px; font-weight: 700; color: #1e293b; }
.itin-card-title { font-weight: 700; text-transform: uppercase; font-size: 10px; margin: 2px 0; color: #2b4c5e; }
.itin-card-desc { margin: 2px 0 0; font-size: 9px; color: #64748b; }
.itin-summary-sep { border: 0; border-top: 1px solid #cbd5e1; margin: 20px 10px 10px; }
.itin-summary-row { display: flex; justify-content: space-around; align-items: center; padding: 5px 0; margin-top: 5px; flex-wrap: wrap; gap: 6px; }
.itin-summary-item { display: flex; align-items: center; gap: 5px; font-size: 9.5px; font-weight: 600; color: #475569; text-transform: uppercase; }
.itin-summary-circle { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.itin-total-box { background: rgba(255,255,255,.95); border: 1px solid #e2e8f0; border-radius: 6px; padding: 8px 10px; margin-top: 12px; text-align: center; }
.itin-total-label { font-size: 8.5px; text-transform: uppercase; color: #64748b; font-weight: 700; }
.itin-total-val { font-size: 19px; font-weight: 800; color: #1e293b; margin: 2px 0 6px; }
.itin-combined-row { font-size: 10.5px; font-weight: 600; color: #334155; border-top: 1px dashed #cbd5e1; padding-top: 5px; }
.itin-combined-row b { color: #00a4c5; font-weight: 800; }
.itin-efficiency-note { margin-top: 5px; font-size: 7.5px; color: #94a3b8; font-weight: 500; }
@media (max-width: 600px) {
  .itin-timeline-axis::before { left: 15px; transform: none; }
  .itin-block { justify-content: flex-end; padding-left: 0; padding-right: 0; }
  .itin-block-card { width: 88%; }
  .itin-axis-pointer { left: 15px; transform: none; }
  .itin-block-left .itin-card-arrow, .itin-block-right .itin-card-arrow { left: -11px; right: auto; transform: rotate(180deg); }
}

/* ============================================================
   PARTICIPANTES Y MAPA DE ASIENTOS
============================================================ */
.part-layout { display: grid; grid-template-columns: 1fr 420px; gap: 20px; align-items: start; }
@media (max-width: 1080px) { .part-layout { grid-template-columns: 1fr; } }
.part-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.part-table-wrap { overflow-x: auto; }
.part-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.part-table th, .part-table td { padding: 8px 6px; text-align: left; border-bottom: 1px solid var(--line); }
.part-table th { background: #FAFBFF; color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; }
.part-table input, .part-table select { width: 100%; padding: 5px 7px; border: 1px solid var(--line); border-radius: 5px; font-size: 12.5px; }
.part-table input[type="number"] { max-width: 90px; }
.part-sticky { position: sticky; top: 16px; }
.part-legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 11px; color: var(--muted); margin-bottom: 10px; }
.part-legend-item { display: flex; align-items: center; gap: 4px; }
.part-dot { width: 11px; height: 11px; border-radius: 3px; }
.part-seat-svg-wrap { width: 100%; overflow-x: auto; }
.part-seat-svg-wrap svg { display: block; width: 100%; height: auto; }
.part-seat { cursor: pointer; }
.part-summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.part-summary-box { background: #f8fafe; border: 1px solid #d8e4f8; border-radius: 10px; padding: 10px; text-align: center; }
.part-summary-box span { display: block; font-size: 10px; color: var(--muted); font-weight: 600; text-transform: uppercase; margin-bottom: 3px; }
.part-summary-box strong { font-size: 16px; color: var(--ink); }
.part-btn-remove { background: none; border: none; color: var(--bad); font-size: 15px; cursor: pointer; }

/* ============================================================
   REPORTE DE EXCURSIÓN (popup del historial de un colegio)
============================================================ */
.xrep-wrap { padding: 4px; }
.xrep-header { background: linear-gradient(135deg,#1e3a8a 0%,#2563eb 100%); color: #fff; padding: 16px 20px; border-radius: 12px; margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.xrep-header h3 { margin: 0; font-size: 15px; font-weight: 800; text-transform: uppercase; letter-spacing: -.3px; }
.xrep-subtitle { margin-top: 4px; font-size: 11.5px; color: #93c5fd; font-weight: 500; }
.xrep-badge { background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.25); color: #fff; padding: 5px 12px; border-radius: 20px; font-size: 10.5px; font-weight: 700; letter-spacing: .4px; white-space: nowrap; }
.xrep-grid { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 6px; }
.xrep-card { flex: 1 1 320px; background: #fff; border-radius: 10px; border: 1px solid #e2e8f0; padding: 14px 16px; box-shadow: 0 2px 4px rgba(0,0,0,.02); }
.xrep-card.full { flex-basis: 100%; }
.xrep-card-header { display: flex; align-items: center; gap: 8px; border-bottom: 2px solid #f1f5f9; padding-bottom: 8px; margin-bottom: 12px; }
.xrep-card-title { font-size: 11px; font-weight: 700; color: #1e3a8a; text-transform: uppercase; letter-spacing: .4px; margin: 0; }
.xrep-row { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 10px; }
.xrep-row:last-child { margin-bottom: 0; }
.xrep-field { flex: 1 1 120px; min-width: 0; }
.xrep-label { font-size: 9px; text-transform: uppercase; color: #64748b; font-weight: 700; letter-spacing: .3px; margin-bottom: 3px; }
.xrep-value { font-size: 12.5px; color: #0f172a; font-weight: 600; }
.xrep-value.empty { color: #94a3b8; font-style: italic; font-weight: 400; }
.xrep-badge-pill { display: inline-flex; background: #eff6ff; color: #1d4ed8; padding: 2px 8px; border-radius: 6px; font-weight: 600; font-size: 11px; border: 1px solid #dbeafe; }
.xrep-list { margin: 0; padding: 0; list-style: none; }
.xrep-list li { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: #f8fafc; border-radius: 6px; margin-bottom: 6px; border: 1px solid #f1f5f9; font-weight: 600; color: #334155; font-size: 12.5px; }
.xrep-list-num { background: #2563eb; color: #fff; width: 17px; height: 17px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 9px; font-weight: bold; flex-shrink: 0; }
.xrep-table { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; font-size: 11.5px; min-width: 560px; }
.xrep-table th { background: #f8fafc; color: #475569; font-size: 9px; text-transform: uppercase; letter-spacing: .4px; padding: 7px 8px; text-align: left; border-bottom: 1px solid #e2e8f0; }
.xrep-table td { padding: 7px 8px; border-bottom: 1px solid #f1f5f9; }
.xrep-table tr:last-child td { border-bottom: none; }
.xrep-table tr.total td { background: #f0fdf4; border-top: 2px solid #bbf7d0; font-weight: 700; color: #166534; }
.xrep-note { background: #fffbeb; border: 1px solid #fef3c7; border-left: 5px solid #f59e0b; }
.xrep-note .xrep-card-title { color: #b45309; }
.xrep-note-text { color: #78350f; font-size: 12px; line-height: 1.5; }
@media (max-width: 600px) {
  .xrep-card { flex-basis: 100%; }
  .xrep-header { padding: 12px 14px; }
}

/* ============================================================
   CALENDARIO
============================================================ */
.controls-panel { background-color: #f8f9fa; border: 1px solid var(--line); padding: 12px 16px; border-radius: 8px; margin-bottom: 14px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.controls-panel h4 { margin: 0; font-size: 13.5px; color: var(--muted); font-weight: 600; }
#calViewSelect { padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; background: var(--card); color: var(--ink); }
.fc-toolbar { flex-wrap: wrap; row-gap: 6px; }
.fc-toolbar-title { font-size: 16px !important; }
@media (max-width: 480px) {
  .fc-toolbar-title { font-size: 14px !important; }
  .fc-toolbar-chunk { display: flex; justify-content: center; width: 100%; }
  .fc-button { padding: 4px 8px !important; font-size: 12px !important; }
}
.day-checkboxes { display: flex; gap: 12px; flex-wrap: wrap; }
.day-checkboxes label { font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 5px; user-select: none; color: var(--ink); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 14px; }
.cal-legend-group { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 12px; }
.cal-legend-title { font-weight: 700; color: var(--muted); margin-right: 2px; }
.legend-item { display: flex; align-items: center; gap: 5px; }
.legend-color { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }
#calendar { max-width: 100%; }
.fc { font-family: inherit; }
.fc .fc-day-today { background-color: rgba(14,169,217,.08) !important; }
.fc-event { border: none !important; border-radius: 5px !important; padding: 1px 5px !important; font-size: 11.5px !important; cursor: pointer; }
.fc-event-main { color: #fff; font-weight: 500; }
@media (max-width: 860px) {
  .controls-panel { flex-direction: column; align-items: flex-start; }
  .cal-legend { gap: 12px; }
}

/* ============================================================
   BITÁCORA DE LLAMADAS
============================================================ */
.bit-callback-box { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; padding: 10px; margin: 10px 0; }
.bit-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.bit-count { font-size: 11px; background: var(--line); color: var(--ink); padding: 2px 8px; border-radius: 999px; font-weight: 700; }
#bitPrintSelect { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; background: var(--card); }
.bit-list { display: flex; flex-direction: column; gap: 8px; }
.bit-card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.bit-card.bit-overdue { border-color: #ef4444; animation: bit-pulse-red 1.2s infinite; }
@keyframes bit-pulse-red { 0%, 100% { background-color: #fef2f2; } 50% { background-color: #fee2e2; } }
.bit-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.bit-card-tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bit-school { font-weight: 700; color: var(--ink); }
.bit-badge { font-size: 10px; font-weight: 700; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; }
.bit-badge-cb { background: #d1fae5; color: #065f46; display: inline-flex; align-items: center; gap: 4px; }
.bit-badge-overdue { background: #dc2626; color: #fff; display: inline-flex; align-items: center; gap: 4px; }
.bit-card-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.bit-card-actions .secondary-btn { padding: 4px 10px; font-size: 11.5px; }
.bit-card-contact { color: var(--muted); font-size: 12px; margin-top: 6px; }
.bit-card-notes { font-size: 12.5px; margin-top: 4px; }
.bit-card-date { text-align: right; color: var(--muted); font-size: 11px; margin-top: 4px; }
.bit-month-sep { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; padding-top: 10px; margin-top: 4px; border-top: 1px dashed var(--line); }
.bit-month-sep:first-child { margin-top: 0; padding-top: 0; border-top: none; }

/* ============================================================
   RESERVAS DE EXCURSIONES
============================================================ */
.res-dashboard { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 14px; }
@media (max-width: 860px) { .res-dashboard { grid-template-columns: repeat(2, 1fr); } }
.res-stat-card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.res-stat-card h3 { font-size: 10px; color: var(--muted); text-transform: uppercase; font-weight: 700; margin: 0 0 2px; }
.res-stat-num { font-size: 20px; font-weight: 800; line-height: 1.1; }
.res-progress-bar-wrap { width: 100%; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.res-progress-bar { height: 100%; background: var(--good); }
.res-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.res-destinos { display: flex; flex-direction: column; gap: 10px; }
.destino-card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.destino-header { background: #eef1f5; padding: 8px 12px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.destino-title { font-weight: 700; color: var(--navy); font-size: 19px; }
.destino-body { padding: 10px 12px; display: grid; grid-template-columns: 180px 1fr; gap: 12px; }
@media (max-width: 860px) { .destino-body { grid-template-columns: 1fr; } }
.res-contact-panel { background: var(--bg); border-radius: 6px; border: 1px solid var(--line); padding: 8px 10px; }
.res-contact-panel h4 { font-size: 10.5px; color: var(--navy); text-transform: uppercase; margin: 0 0 6px; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.res-table th, .res-table td { font-size: 12.5px; }
.res-table input[type="text"], .res-table input[type="date"], .res-table input[type="time"] { width: 100%; padding: 4px 6px; border: 1px solid var(--line); border-radius: 4px; font-size: 12.5px; }
.status-badge { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; cursor: pointer; }
.badge-done { background: #dcfce7; color: #14532d; }
.badge-pending { background: #fef3c7; color: #78350f; }
.action-btn { background: none; border: none; color: #c0392b; cursor: pointer; padding: 2px 4px; }
.action-btn:hover { background: #fee2e2; border-radius: 4px; }
.res-paseo-lugares { max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; padding: 4px; background: var(--bg); margin-top: 4px; }
.res-paseo-item { display: flex; align-items: center; gap: 6px; font-size: 13px; padding: 4px 6px; border-radius: 4px; cursor: pointer; }
.res-paseo-item:hover { background: var(--card); }

@media print {
  .sidebar, .menu-toggle, .page-header button, .res-dashboard, .res-toolbar,
  .destino-header button, .action-btn, .res-table thead th:last-child, .res-table td:last-child {
    display: none !important;
  }
  .sidebar-backdrop, .modal-backdrop { display: none !important; }
  .content { padding: 0; overflow: visible; }
  .destino-card { break-inside: avoid; border: none; border-bottom: 1px dashed #666; border-radius: 0; margin-bottom: 14px; }
  .destino-header { background: none; }
  .destino-body { display: block; }
  .res-table input { border: none; background: none; padding: 0; }
}
