/* ===================== BASE / TOKENS ===================== */
:root {
  --navy-900: #0f1b2d;
  --navy-800: #16253c;
  --navy-700: #1e3350;

  --bg: #f2f4f7;
  --surface: #ffffff;
  --border: #e2e6ec;
  --text: #1b2430;
  --text-muted: #5c6b7a;

  --primary: #d62828;
  --primary-dark: #b21f1f;
  --primary-soft: #fdeaea;

  --info: #2563eb;
  --info-soft: #e8f0fe;

  --good: #1a8a5f;
  --good-soft: #e5f6ee;

  --warning: #c77700;
  --warning-soft: #fdf1de;

  --danger: #c81e3a;
  --danger-soft: #fbe4e9;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 27, 45, 0.06), 0 1px 8px rgba(15, 27, 45, 0.05);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

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

h1, h2, h3 { margin: 0; color: var(--navy-900); }

/* ===================== APP SHELL (desktop-first) ===================== */
.app-shell {
  display: grid;
  grid-template-columns: 264px 1fr;
  min-height: 100vh;
  width: 100%;
}

.sidebar {
  background: var(--navy-900);
  color: #dbe3ee;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
}

.sidebar-logos {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 6px 18px;
  gap: 10px;
}

.logo-chip {
  background: #ffffff;
  border-radius: 10px;
  padding: 5px 9px;
  display: flex;
  align-items: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.logo-chip img { display: block; height: 32px; width: auto; }

.logo-chip-hero {
  width: 100%;
  justify-content: center;
  padding: 16px 12px;
}
.logo-chip-hero img { height: 96px; width: auto; }

.logo-collaborators-strip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.logo-collaborators-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #7c8aa0;
  white-space: nowrap;
}
.logo-collaborators-slot {
  width: 100%;
  min-height: 44px;
  border: 1.5px dashed rgba(219, 227, 238, 0.25);
  border-radius: 10px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 6px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 20px;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.3; }
.brand-text strong { color: #fff; font-size: 15px; }
.brand-text small { color: #93a2b8; font-size: 12px; }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: none;
  color: #b7c2d3;
  text-align: left;
  padding: 11px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14.5px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.nav-icon { font-size: 14px; width: 16px; text-align: center; opacity: 0.85; }

.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; }

.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 16px;
  margin-top: 16px;
}

.emergency-title {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #7c8aa0;
  margin: 0 0 8px;
}

.emergency-line { margin: 0 0 4px; font-size: 13.5px; color: #dbe3ee; }
.emergency-line strong { color: #fff; }

.emergency-note {
  font-size: 11.5px;
  color: #7c8aa0;
  margin-top: 10px;
  line-height: 1.5;
}

.sidebar-credits {
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: 14px;
  padding-top: 12px;
}
.credits-dev { font-size: 12px; color: #dbe3ee; margin: 0 0 7px; }
.credits-dev strong { color: #fff; }
.credits-contact { font-size: 11.5px; margin: 0 0 5px; }
.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #93a2b8;
  text-decoration: none;
}
.contact-link:hover { color: #fff; }
.contact-link:hover .icon-whatsapp { color: #25d366; }
.contact-link:hover .icon-mail { color: #fff; }
.contact-icon { width: 14px; height: 14px; flex-shrink: 0; color: #7c8aa0; }
.icon-whatsapp { color: #25d366; }

.app-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar-actions { display: flex; gap: 10px; }

.content {
  padding: 32px 40px 60px;
  width: 100%;
}

/* ===================== BUTTONS ===================== */
.btn {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 16px;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  transition: filter 0.15s, background 0.15s;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-large { padding: 12px 26px; font-size: 15px; }
.btn-small { padding: 6px 12px; font-size: 12.5px; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-install {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--good-soft);
  border-color: var(--good);
  color: var(--good);
}
.btn-install:hover { background: var(--good); color: #fff; }
.btn-install svg { width: 16px; height: 16px; }

/* ===================== STAT GRID ===================== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 36px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--navy-700);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-value { font-size: 30px; font-weight: 700; color: var(--navy-900); }
.stat-label { font-size: 12.5px; color: var(--text-muted); font-weight: 500; }

.stat-good { border-left-color: var(--good); }
.stat-warning { border-left-color: var(--warning); }
.stat-info { border-left-color: var(--info); }
.stat-danger { border-left-color: var(--danger); }

/* ===================== CHARTS (PMU) ===================== */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-bottom: 40px;
}
.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}
.chart-card h3 { font-size: 13.5px; font-weight: 700; color: var(--navy-900); margin-bottom: 16px; }
.bar-chart { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 108px 1fr 26px; align-items: center; gap: 10px; }
.bar-label { font-size: 12px; color: var(--text-muted); }
.bar-track { height: 10px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; transition: width 0.4s ease; min-width: 2px; }
.bar-count { font-size: 12.5px; font-weight: 700; color: var(--navy-900); text-align: right; }
.chart-empty { font-size: 12.5px; color: var(--text-muted); }

/* ===================== SECTIONS ===================== */
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 8px 0 16px;
  flex-wrap: wrap;
  gap: 10px;
}
.section-heading h2 { font-size: 19px; }
.section-hint { font-size: 12.5px; color: var(--text-muted); }

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.empty-state {
  color: var(--text-muted);
  font-size: 13.5px;
  padding: 20px 4px;
  grid-column: 1 / -1;
}

/* Alert / professional cards */
.alert-card, .pro-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* "Callcenter": botones de contacto sin mostrar el numero como texto */
.contact-actions { display: flex; gap: 8px; margin-top: 2px; }
.btn-contact {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-muted);
  text-decoration: none;
}
.btn-contact svg { width: 15px; height: 15px; }
.btn-contact.call { color: var(--info); border-color: var(--info-soft); }
.btn-contact.call:hover { background: var(--info-soft); }
.btn-contact.whatsapp { color: #25d366; border-color: #c8f0d9; }
.btn-contact.whatsapp:hover { background: #e5f6ee; }
.btn-contact.mail:hover { background: var(--bg); }

.badge-row { display: flex; gap: 6px; flex-wrap: wrap; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-urgencia-alta { background: var(--danger-soft); color: var(--danger); }
.badge-urgencia-media { background: var(--warning-soft); color: var(--warning); }
.badge-urgencia-baja { background: var(--good-soft); color: var(--good); }

.badge-status-pendiente { background: var(--warning-soft); color: var(--warning); }
.badge-status-asignado { background: var(--info-soft); color: var(--info); }
.badge-status-atendido { background: var(--good-soft); color: var(--good); }
.badge-status-cerrado { background: #e9ecef; color: #6b7684; }

.badge-prostatus-disponible { background: var(--good-soft); color: var(--good); }
.badge-prostatus-ocupado { background: var(--warning-soft); color: var(--warning); }
.badge-prostatus-atendiendo_emergencia { background: var(--info-soft); color: var(--info); }
.badge-prostatus-no_disponible { background: #e9ecef; color: #6b7684; }

.pro-card-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.pro-status-select { flex: 1; min-width: 150px; padding: 7px 10px; font-size: 12.5px; }

.badge-type { background: var(--navy-800); color: #fff; }
.badge-outline { background: transparent; border: 1px solid var(--border); color: var(--text-muted); text-transform: none; letter-spacing: 0; }

.alert-card h4, .pro-card h4 { margin: 0; font-size: 15px; color: var(--navy-900); }
.alert-meta, .pro-meta { font-size: 12.5px; color: var(--text-muted); }
.alert-desc { font-size: 13.5px; color: var(--text); line-height: 1.5; }
.alert-resources {
  font-size: 12.5px;
  background: var(--bg);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--text);
}

.map-wrap { position: relative; margin-bottom: 36px; }

.colombia-map {
  width: 100%;
  height: 520px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: #dbe8f0;
}

.map-reset-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 1000;
  background: #fff;
  box-shadow: var(--shadow);
}

/* Croquis: departamentos como formas planas, sin relieve ni mapa base */
.colombia-map .leaflet-interactive {
  transition: fill-opacity 0.15s ease, fill 0.15s ease;
  cursor: pointer;
  outline: none;
}
.colombia-map .leaflet-control-attribution {
  font-size: 10px;
  background: rgba(255,255,255,0.75);
}
.colombia-map .leaflet-tooltip {
  background: var(--navy-900);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 9px;
  box-shadow: var(--shadow);
}
.colombia-map .leaflet-tooltip-top:before { border-top-color: var(--navy-900); }

.map-popup h4 { margin: 0 0 6px; font-size: 14px; color: var(--navy-900); }
.map-popup p { margin: 0 0 4px; font-size: 12.5px; color: var(--text); }
.map-popup .map-popup-list { margin: 6px 0 0; padding: 0; list-style: none; font-size: 12px; color: var(--text-muted); }
.map-popup .map-popup-list li { display: flex; justify-content: space-between; padding: 2px 0; }

.available-hint { font-size: 12.5px; color: var(--text-muted); margin: -10px 0 18px; }
.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--primary);
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
}

.cta-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}
.cta-card {
  background: var(--navy-900);
  color: #dbe3ee;
  border-radius: var(--radius);
  padding: 26px 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cta-card h3 { color: #fff; font-size: 17px; }
.cta-card p { margin: 0; font-size: 13.5px; color: #aab7c8; line-height: 1.55; }
.cta-card .btn { align-self: flex-start; margin-top: 6px; }
.cta-card .btn-outline {
  background: transparent;
  border-color: rgba(255,255,255,0.4);
  color: #fff;
}
.cta-card .btn-outline:hover { background: rgba(255,255,255,0.1); border-color: #fff; }

/* ===================== VIDEOLLAMADA (Jitsi) ===================== */
.videocall-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 32px;
  margin-bottom: 40px;
}
.videocall-card form { display: flex; flex-direction: column; gap: 18px; }

.chat-mascot-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 4px 14px;
}
.chat-mascot {
  width: 56px;
  height: 80px;
  flex-shrink: 0;
  background-image: url('/img/mascota_avatar.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}
.chat-mascot.talking {
  background-image: url('/img/mascota_talk_strip.png');
  background-size: 296px 108px;
  background-position: 0 0;
  animation: mascot-talk 0.9s steps(4) infinite;
}
@keyframes mascot-talk {
  from { background-position-x: 0px; }
  to { background-position-x: -296px; }
}
.chat-mascot-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.chat-mascot-title strong { font-size: 14.5px; color: var(--text); }
.chat-mascot-title span { font-size: 12px; color: var(--text-muted); }

.videocall-chat-messages {
  height: 360px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 6px 4px 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.chat-bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.5;
  white-space: pre-wrap;
}
.chat-bubble-assistant {
  align-self: flex-start;
  background: var(--bg);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.chat-bubble-user {
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-confirm-buttons {
  align-self: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 90%;
}
.chat-typing { display: flex; gap: 4px; align-items: center; padding: 13px 16px; }
.chat-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: chat-typing-bounce 1.2s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes chat-typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

#videocall-chat-form.videocall-chat-input-row { flex-direction: row; }
.videocall-chat-input-row { display: flex; gap: 10px; }
.videocall-chat-input-row input { flex: 1; min-width: 0; }
.videocall-chat-input-row .btn { flex-shrink: 0; }

.videocall-chat-footer { text-align: center; margin: 14px 0 0; font-size: 12.5px; }

.videocall-waiting {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 30px 20px;
  gap: 10px;
}
.videocall-waiting h3 { font-size: 17px; color: var(--navy-900); }
.videocall-waiting p { font-size: 13.5px; color: var(--text-muted); max-width: 440px; margin: 0 0 8px; }
.waiting-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: waiting-spin 0.9s linear infinite;
  margin-bottom: 6px;
}
@keyframes waiting-spin { to { transform: rotate(360deg); } }

.videocall-active-header { margin-bottom: 14px; }
.videocall-jitsi {
  width: 100%;
  height: 540px;
  border-radius: var(--radius);
  overflow: hidden;
  background: #1a1a1a;
}

.form-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 36px;
  align-items: start;
}

.pro-tabs { display: flex; gap: 8px; margin-bottom: 28px; border-bottom: 1px solid var(--border); }
.pro-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 4px;
  margin-bottom: -1px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
}
.pro-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.pro-tab:not(.active):hover { color: var(--text); }

.pro-dashboard-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 32px;
  max-width: 640px;
}
.pro-dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 10px;
}
.pro-dashboard-header h2 { font-size: 20px; margin-bottom: 4px; }
.pro-dashboard-hint { color: var(--text-muted); font-size: 13.5px; margin: 10px 0 22px; line-height: 1.55; }

.pro-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.pro-status-btn {
  border: 1.5px solid var(--border);
  background: #fff;
  border-radius: 10px;
  padding: 14px 12px;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text);
  cursor: pointer;
  text-align: center;
}
.pro-status-btn:hover { background: var(--bg); }
.pro-status-btn.active[data-status="disponible"] { background: var(--good); border-color: var(--good); color: #fff; }
.pro-status-btn.active[data-status="ocupado"] { background: var(--warning); border-color: var(--warning); color: #fff; }
.pro-status-btn.active[data-status="atendiendo_emergencia"] { background: var(--info); border-color: var(--info); color: #fff; }
.pro-status-btn.active[data-status="no_disponible"] { background: #6b7684; border-color: #6b7684; color: #fff; }

.pro-google-notice {
  margin-top: 20px;
  max-width: 640px;
  background: var(--info-soft);
  border: 1px solid var(--info);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text);
}
.pro-google-notice strong { color: var(--navy-900); }
.pro-google-notice .btn { flex-shrink: 0; white-space: nowrap; }

.pro-call-alert {
  margin-top: 20px;
  background: var(--primary-soft);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  animation: pro-call-alert-pulse 1.6s ease-in-out infinite;
}
@keyframes pro-call-alert-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(214, 40, 40, 0.25); }
  50% { box-shadow: 0 0 0 8px rgba(214, 40, 40, 0); }
}
.pro-call-alert-info strong { color: var(--primary-dark); font-size: 14.5px; }
.pro-call-alert-info p { margin: 4px 0 0; font-size: 13px; color: var(--text); }
.pro-call-alert-actions { display: flex; gap: 10px; }

.triage-meta { display: block; font-size: 12.5px; color: var(--text-muted); font-weight: 600; margin-top: 4px; }
.triage-summary { margin: 4px 0 0; font-size: 13px; color: var(--text); line-height: 1.45; }
.triage-risk-badge { display: inline-block; margin-top: 6px; }
.pro-queue-item-risk { border-color: var(--danger); border-left: 4px solid var(--danger); }
.pro-queue-item-time { margin: 6px 0 0; font-size: 11.5px; color: var(--text-muted); }

#pro-active-call-section, #pro-queue-section { margin-top: 32px; max-width: 640px; }

.pro-queue-list { display: flex; flex-direction: column; gap: 10px; }
.pro-queue-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.pro-queue-item-info strong { font-size: 13.5px; color: var(--navy-900); }
.pro-queue-item-info p { margin: 3px 0 0; font-size: 12.5px; color: var(--text-muted); }

.form-intro h2 { font-size: 21px; margin-bottom: 10px; }
.form-intro p { color: var(--text-muted); font-size: 14px; line-height: 1.6; }
.intro-note {
  margin-top: 16px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
}

.card-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px 20px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy-800);
}
label.full-width { grid-column: 1 / -1; }

input, select, textarea {
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 10px 12px;
  font-weight: 400;
  color: var(--text);
  background: #fff;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
textarea { resize: vertical; }

.form-actions { display: flex; justify-content: flex-end; }
.form-error { color: var(--danger); font-size: 13px; min-height: 18px; }

/* ===================== COORDINACIÓN ===================== */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filter-bar select { padding: 7px 10px; }

.requests-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 40px;
}

.request-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--navy-700);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 20px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
}
.request-row.urgencia-alta { border-left-color: var(--danger); }
.request-row.urgencia-media { border-left-color: var(--warning); }
.request-row.urgencia-baja { border-left-color: var(--good); }

.request-main h4 { font-size: 15px; margin-bottom: 4px; }
.request-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.request-actions .btn { width: 100%; }
.assigned-to { font-size: 12px; color: var(--info); font-weight: 600; }

/* Lock screen for coordination */
.lock-screen {
  display: flex;
  justify-content: center;
  padding: 60px 20px;
}
.lock-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 36px;
  max-width: 420px;
  width: 100%;
  text-align: left;
}
.lock-card h2 { font-size: 18px; margin-bottom: 8px; }
.lock-card p { font-size: 13.5px; color: var(--text-muted); margin-bottom: 18px; }
#coord-auth-form { display: flex; flex-direction: column; gap: 10px; }
#coord-auth-form button { align-self: stretch; }

.coord-topbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 18px;
}
.coord-user-menu { position: relative; }
.coord-user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px 6px 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  box-shadow: var(--shadow);
}
.coord-user-btn:hover { background: var(--bg); }
.coord-user-btn .caret { color: var(--text-muted); font-size: 11px; }
.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--navy-900);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.coord-user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  min-width: 170px;
  overflow: hidden;
  z-index: 30;
}
.dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 11px 16px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--danger);
}
.dropdown-item:hover { background: var(--danger-soft); }
.dropdown-item-neutral { color: var(--text); }
.dropdown-item-neutral:hover { background: var(--bg); }

.pro-session-indicator { position: relative; }
.pro-session-indicator .coord-user-dropdown { min-width: 150px; }

.hidden { display: none !important; }

/* ===================== MODAL / TOAST ===================== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15,27,45,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 26px 28px;
  width: 100%;
  max-width: 420px;
}
.modal-card h3 { margin-bottom: 8px; }
.modal-card p { font-size: 13.5px; color: var(--text-muted); margin-bottom: 14px; }
.modal-card select { margin-bottom: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

.toast {
  position: fixed;
  top: 18px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast-item {
  background: var(--navy-900);
  color: #fff;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 13.5px;
  box-shadow: var(--shadow);
  min-width: 240px;
  animation: toast-in 0.2s ease-out;
}
.toast-item.error { background: var(--danger); }
.toast-item.success { background: var(--good); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===================== PWA: iOS install banner ===================== */
.ios-install-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 150;
  background: var(--navy-900);
  color: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 420px;
  animation: toast-in 0.25s ease-out;
}
.ios-banner-icon { width: 40px; height: 40px; border-radius: 9px; flex-shrink: 0; }
.ios-banner-text strong { display: block; font-size: 13.5px; margin-bottom: 3px; }
.ios-banner-text p { margin: 0; font-size: 12.5px; color: #b7c2d3; line-height: 1.4; }
.ios-banner-close {
  background: none;
  border: none;
  color: #93a2b8;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
  align-self: flex-start;
}
.ios-banner-close svg { width: 16px; height: 16px; display: block; }
.ios-banner-close:hover { color: #fff; }

/* ===================== VIEWS ===================== */
.view { display: none; }
.view.active { display: block; }

/* ===================== RESPONSIVE (collapse for narrower screens) ===================== */
@media (max-width: 1080px) {
  .form-layout { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: auto;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 10px 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.18);
  }
  .sidebar-logos { flex-direction: row; padding: 0; margin-right: 10px; gap: 6px; flex-shrink: 0; }
  .logo-chip img { height: 24px; }
  .logo-chip-hero { width: auto; padding: 4px 8px; }
  .logo-chip-hero img { height: 26px; }
  .logo-collaborators-strip { display: none; }
  .sidebar-brand { display: none; }
  .sidebar-nav { flex-direction: row; flex-shrink: 0; }
  .nav-item span.nav-icon { display: none; }
  .nav-item { padding: 8px 12px; font-size: 13px; white-space: nowrap; }
  .sidebar-footer { display: none; }
  .content { padding: 20px 16px 50px; }
  .topbar {
    position: static;
    padding: 14px 16px;
    flex-wrap: wrap;
    gap: 12px;
  }
  #view-title { font-size: 17px; }
  .stat-grid, .charts-grid, .cards-grid { grid-template-columns: 1fr; }
  .map-wrap { margin-bottom: 24px; }
  .colombia-map { height: 340px; }
  .colombia-map .leaflet-control-zoom a {
    width: 36px;
    height: 36px;
    line-height: 36px;
    font-size: 18px;
  }
}

@media (max-width: 560px) {
  .topbar-actions { width: 100%; }
  .topbar-actions .btn { flex: 1; }
  .card-form { padding: 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .request-row { grid-template-columns: 1fr; }
  .request-actions { align-items: stretch; }
  .videocall-card { padding: 20px 16px; }
  .videocall-jitsi { height: 62vh; min-height: 300px; }
  .chat-mascot { width: 46px; height: 66px; }
  .chat-mascot-header { gap: 10px; padding-bottom: 10px; }
  .videocall-chat-messages { height: 300px; }
  .pro-call-alert { padding: 14px 16px; }
  .pro-call-alert-actions { width: 100%; }
  .pro-call-alert-actions .btn { flex: 1; }
  .colombia-map { height: 280px; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar select { width: 100%; }
  .pro-status-grid { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 76px 1fr 24px; gap: 6px; }
  .bar-label { font-size: 11px; }
}
