/* ================================================================
   DISTRIBUYEAYUDA — Light Mode
   Diseño limpio, tranquilo, legible
   Elementos interactivos claramente identificables
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,300;0,14..32,400;0,14..32,500;0,14..32,600;0,14..32,700;1,14..32,400&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* ── Capas de superficie (claro) ── */
  --page:        #f0f0f0;      /* Fondo de la página */
  --surface:     #ffffff;      /* Cards y panel */
  --surface-2:   #f5f5f5;      /* Inputs, fondos secundarios */
  --surface-3:   #ebebeb;      /* Hover suave */

  /* ── Bordes ── */
  --border-light:  #e0e0e0;    /* Separadores sutiles */
  --border:        #c8c8c8;    /* Bordes normales */
  --border-strong: #a0a0a0;    /* Bordes de elementos interactivos */

  /* ── Texto ── */
  --t1: #111111;               /* Títulos */
  --t2: #444444;               /* Cuerpo */
  --t3: #888888;               /* Metadata / tiempo */
  --t4: #b0b0b0;               /* Placeholder / mudo */

  /* ── Colores de acento (solo donde hay significado) ── */
  --c-red:     #d93025;        /* Urgencias / peligro */
  --c-green:   #0a84ff;        /* Ayuda confirmada / resuelto / Centros (Ahora Azul) */
  --c-yellow:  #b45309;        /* Necesidad / atención */
  --c-blue:    #1a56db;        /* Links y acciones primarias */
  --c-gray:    #6b7280;

  /* ── Superficies de acento (tint muy suave) ── */
  --s-red:     rgba(217,48,37,0.07);
  --s-green:   rgba(10,132,255,0.08);
  --s-yellow:  rgba(180,83,9,0.08);
  --s-blue:    rgba(26,86,219,0.08);

  /* ── Tipografía ── */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;

  /* ── Geometría ── */
  --r-sm:  6px;
  --r-md:  10px;
  --r-lg:  14px;
  --r-xl:  18px;
  --r-2xl: 22px;
  --r-pill:100px;

  --sidebar-w: 370px;
  --transition: 140ms ease;
}

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--page);
  color: var(--t1);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ================================================================
   LAYOUT
   ================================================================ */
#app { display: flex; height: 100vh; width: 100vw; position: relative; }
#map { flex: 1; height: 100%; }

/* ================================================================
   SIDEBAR — Panel lateral blanco
   ================================================================ */
#sidebar {
  width: var(--sidebar-w);
  height: 100%;
  background: var(--surface);
  border-left: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 10;
  box-shadow: -2px 0 12px rgba(0,0,0,0.06);
}

/* ── Header ── */
#sidebar-header {
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
  background: var(--surface);
}

.logo {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 14px;
}

.logo-icon {
  width: 36px; height: 36px;
  background: var(--c-red);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.logo-text h1 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--t1);
  line-height: 1.1;
}
.logo-text span {
  font-size: 11px;
  color: var(--t3);
  letter-spacing: -0.1px;
}

/* ── Filtros: Segmented Control ── */
.filter-tabs {
  display: flex;
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: var(--r-md);
  padding: 3px;
  gap: 2px;
}

/* Cada tab es un botón claro con borde al activarse */
.filter-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 4px;
  border-radius: 7px;
  border: 1px solid transparent;        /* siempre reserva espacio del borde */
  background: transparent;
  color: var(--t3);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.filter-tab:hover {
  background: var(--surface-3);
  color: var(--t2);
}

/* Activo: fondo blanco + borde visible → affordance clara */
.filter-tab.active-all    { background: var(--surface); border-color: var(--border); color: var(--t1); font-weight: 600; }
.filter-tab.active-red    { background: var(--s-red);   border-color: var(--c-red);    color: var(--c-red);    font-weight: 600; }
.filter-tab.active-green  { background: var(--s-green); border-color: var(--c-green);  color: var(--c-green);  font-weight: 600; }
.filter-tab.active-yellow { background: var(--s-yellow);border-color: var(--c-yellow); color: var(--c-yellow); font-weight: 600; }

.filter-tab .dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.dot-red    { background: var(--c-red); }
.dot-green  { background: var(--c-green); }
.dot-yellow { background: var(--c-yellow); }

/* ================================================================
   BARRA DE ACCIONES — 3 botones de registro
   Bordes claros, tint de color, texto con color → affordance
   ================================================================ */
#action-bar {
  padding: 10px 14px;
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
  background: var(--surface);
}

.btn-action {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 4px;
  padding: 9px 6px;
  border-radius: var(--r-md);
  border: 1.5px solid;              /* borde siempre visible = se ve que es botón */
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.1px;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-action:active { transform: scale(0.97); }

.btn-danger  {
  background: var(--s-red);
  border-color: var(--c-red);
  color: var(--c-red);
}
.btn-success {
  background: var(--s-green);
  border-color: var(--c-green);
  color: var(--c-green);
}
.btn-warn {
  background: var(--s-yellow);
  border-color: var(--c-yellow);
  color: var(--c-yellow);
}

.btn-danger:hover  { background: var(--c-red);    color: #fff; }
.btn-success:hover { background: var(--c-green);  color: #fff; }
.btn-warn:hover    { background: var(--c-yellow); color: #fff; }

/* ================================================================
   VOLUNTARIO — Fila interactiva con borde
   ================================================================ */
#volunteer-bar {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
  background: var(--surface);
}

/* El botón de voluntario se ve como un panel clickeable */
.btn-volunteer {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--s-green);
  border: 1.5px solid var(--c-green);   /* borde = "puedo hacer clic aquí" */
  border-radius: var(--r-lg);
  cursor: pointer;
  font-family: var(--font);
  text-align: left;
  transition: all var(--transition);
}

.btn-volunteer:hover {
  background: rgba(26,127,75,0.14);
  border-color: #145f38;
}
.btn-volunteer:active { transform: scale(0.99); }

.btn-volunteer-icon {
  width: 32px; height: 32px;
  background: rgba(26,127,75,0.15);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.btn-volunteer-text { flex: 1; }

.btn-volunteer-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--c-green);
  line-height: 1.2;
}
.btn-volunteer-sub {
  font-size: 11px;
  color: var(--t3);
  margin-top: 1px;
}
.btn-volunteer-arrow {
  font-size: 16px;
  color: var(--c-green);
  opacity: 0.6;
}

/* ── Label de orden ── */
.feed-order-label {
  padding: 8px 16px 4px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1px;
  color: var(--t4);
  text-transform: uppercase;
  flex-shrink: 0;
  background: var(--surface);
}

/* ================================================================
   FEED — Tarjetas blancas con sombra
   Las tarjetas son claramente clicables (cursor, sombra, hover)
   ================================================================ */
#feed {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--page);
}

#feed::-webkit-scrollbar { width: 4px; }
#feed::-webkit-scrollbar-track { background: transparent; }
#feed::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* Tarjeta: sombra suave + borde + cursor pointer → el usuario sabe que puede hacer clic */
.feed-item {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  padding: 13px 14px;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.feed-item:hover {
  border-color: var(--border);
  box-shadow: 0 3px 10px rgba(0,0,0,0.09);
  transform: translateY(-1px);
}

.feed-item:active {
  transform: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.feed-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.feed-item-type {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.feed-item.type-red    .feed-item-type { color: var(--c-red); }
.feed-item.type-green  .feed-item-type { color: var(--c-green); }
.feed-item.type-yellow .feed-item-type { color: var(--c-yellow); }

.feed-item-time {
  font-size: 10px;
  color: var(--t4);
}

.feed-item-title {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.3px;
  color: var(--t1);
  line-height: 1.3;
  margin-bottom: 3px;
}

.feed-item-desc {
  font-size: 12.5px;
  color: var(--t2);
  line-height: 1.5;
  letter-spacing: -0.1px;
}

.feed-item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--border-light);
}

/* Estado — punto de color + texto neutral */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  color: var(--t3);
}

.status-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.status-open::before     { background: var(--c-red); }
.status-progress::before { background: var(--c-yellow); }
.status-resolved::before { background: var(--c-green); }

.feed-item-meta-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.feed-item-coords {
  font-size: 10px;
  color: var(--t4);
  font-variant-numeric: tabular-nums;
}

/* Badges */
.badge-sin-ayuda {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  background: var(--s-red);
  border: 1px solid rgba(217,48,37,0.2);
  border-radius: 20px;
  font-size: 9px;
  font-weight: 700;
  color: var(--c-red);
  letter-spacing: 0.2px;
  margin-left: 4px;
  text-transform: uppercase;
}

.badge-con-ayuda {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  background: var(--s-green);
  border: 1px solid rgba(26,127,75,0.2);
  border-radius: 20px;
  font-size: 9px;
  font-weight: 600;
  color: var(--c-green);
  margin-left: 4px;
}

/* Botón rápido — borde verde, claramente interactivo */
.btn-ofrecer-rapido {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  margin-top: 9px;
  padding: 8px;
  background: var(--s-green);
  border: 1.5px solid rgba(26,127,75,0.35);   /* borde = interactivo */
  border-radius: var(--r-sm);
  color: var(--c-green);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-ofrecer-rapido:hover {
  background: var(--c-green);
  border-color: var(--c-green);
  color: #fff;
}

/* ================================================================
   STATS BAR
   ================================================================ */
#stats-bar {
  padding: 12px 14px;
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-shrink: 0;
  background: var(--surface);
}

.stat-item { flex: 1; text-align: center; }

.stat-num {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.8px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat-lbl {
  font-size: 10px;
  color: var(--t4);
  margin-top: 3px;
}

.stat-red    .stat-num { color: var(--c-red); }
.stat-green  .stat-num { color: var(--c-green); }
.stat-yellow .stat-num { color: var(--c-yellow); }

/* ================================================================
   CONTROLES DEL MAPA — Botones blancos flotantes
   ================================================================ */
#map-controls {
  position: absolute;
  top: 16px; left: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 5;
}

/* Borde + fondo blanco = claramente botón */
.map-ctrl-btn {
  width: 38px; height: 38px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: all var(--transition);
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

.map-ctrl-btn:hover  { background: var(--surface-3); border-color: var(--border-strong); }
.map-ctrl-btn:active { transform: scale(0.93); }

/* Buscador */
#search-box {
  position: absolute;
  top: 16px; left: 50%;
  transform: translateX(-50%);
  z-index: 5;
}

#search-input {
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 12px 20px 12px 42px;
  color: var(--t1);
  font-family: var(--font);
  font-size: 15px;
  letter-spacing: -0.2px;
  width: 320px;
  outline: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: all var(--transition);
}

#search-input:focus {
  border-color: var(--c-blue);
  box-shadow: 0 0 0 3px rgba(26,86,219,0.12), 0 2px 8px rgba(0,0,0,0.1);
}

#search-input::placeholder { color: var(--t4); }

#search-icon {
  position: absolute; left: 16px; top: 50%;
  transform: translateY(-50%);
  color: var(--t4);
  font-size: 15px;
  pointer-events: none;
}

/* Animaciones de marcadores */
@keyframes pulse {
  0%   { transform: scale(1); opacity: 0.7; }
  50%  { transform: scale(1.6); opacity: 0; }
  100% { transform: scale(1); opacity: 0; }
}

/* ================================================================
   POPUP MAPBOX — Blanco con sombra
   ================================================================ */
.mapboxgl-popup-content {
  background: #ffffff !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--r-xl) !important;
  padding: 16px !important;
  color: var(--t1) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.14) !important;
  font-family: var(--font) !important;
  min-width: 230px; max-width: 290px;
}

.mapboxgl-popup-close-button {
  color: var(--t3) !important;
  font-size: 20px !important;
  right: 10px !important; top: 10px !important;
  background: var(--surface-2) !important;
  border: 1px solid var(--border-light) !important;
  border-radius: 50% !important;
  width: 24px !important; height: 24px !important;
  display: flex !important; align-items: center !important; justify-content: center !important;
  line-height: 1 !important;
  transition: all var(--transition) !important;
}
.mapboxgl-popup-close-button:hover {
  background: var(--surface-3) !important;
  color: var(--t1) !important;
}

.mapboxgl-popup-tip { display: none !important; }

.popup-type {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.35px; margin-bottom: 6px;
}

.popup-title  { font-size: 15px; font-weight: 700; letter-spacing: -0.4px; margin-bottom: 5px; color: var(--t1); }
.popup-desc   { font-size: 12px; color: var(--t2); margin-bottom: 12px; line-height: 1.5; }

.popup-meta {
  display: flex; flex-direction: column; gap: 4px;
  padding: 8px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: var(--r-sm);
  margin-bottom: 12px;
  font-size: 11px; color: var(--t2);
}

.popup-actions { display: flex; gap: 5px; flex-wrap: wrap; }

/* Botones del popup: bordes siempre visibles → claramente botones */
.popup-btn {
  flex: 1; padding: 7px 10px;
  border-radius: var(--r-sm);
  font-family: var(--font);
  font-size: 11px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: all var(--transition);
  border: 1.5px solid;             /* siempre tiene borde */
}

.popup-btn-progress { background: var(--s-yellow); border-color: var(--c-yellow); color: var(--c-yellow); }
.popup-btn-resolve  { background: var(--s-green);  border-color: var(--c-green);  color: var(--c-green); }
.popup-btn-primary  { background: var(--s-blue);   border-color: var(--c-blue);   color: var(--c-blue); }

.popup-btn-progress:hover { background: var(--c-yellow); color: #fff; }
.popup-btn-resolve:hover  { background: var(--c-green);  color: #fff; }
.popup-btn-primary:hover  { background: var(--c-blue);   color: #fff; }
.popup-btn:active { transform: scale(0.96); }

/* ================================================================
   MODAL — Blanco sobre overlay
   ================================================================ */
#modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  display: none; align-items: center; justify-content: center;
  padding: 16px;
}

#modal-overlay.open { display: flex; animation: _fade 0.15s ease; }

@keyframes _fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes _up   { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

#modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  width: 100%; max-width: 460px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 22px;
  animation: _up 0.2s cubic-bezier(0.25,1,0.5,1);
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
}

#modal::-webkit-scrollbar { width: 4px; }
#modal::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 18px;
}

.modal-title { font-size: 17px; font-weight: 700; letter-spacing: -0.5px; }

/* Botón X del modal: borde visible → es clickeable */
.modal-close {
  width: 28px; height: 28px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--t3);
  font-size: 14px;
  font-family: var(--font);
  transition: all var(--transition);
  line-height: 1;
}
.modal-close:hover { background: var(--surface-3); border-color: var(--border-strong); color: var(--t1); }

/* Tipo selector */
.type-selector {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 6px; margin-bottom: 18px;
}

/* Cada opción tiene borde visible → es seleccionable */
.type-option {
  padding: 13px 8px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer; text-align: center;
  transition: all var(--transition);
  user-select: none;
}

.type-option:hover  { background: var(--surface-2); border-color: var(--border-strong); }
.type-option:active { transform: scale(0.97); }

.type-option.selected-red    { border-color: var(--c-red);    background: var(--s-red); }
.type-option.selected-green  { border-color: var(--c-green);  background: var(--s-green); }
.type-option.selected-yellow { border-color: var(--c-yellow); background: var(--s-yellow); }

.type-option-icon  { font-size: 22px; margin-bottom: 5px; }
.type-option-label { font-size: 10.5px; font-weight: 600; color: var(--t3); line-height: 1.2; }
.type-option.selected-red    .type-option-label { color: var(--c-red); }
.type-option.selected-green  .type-option-label { color: var(--c-green); }
.type-option.selected-yellow .type-option-label { color: var(--c-yellow); }

/* Formulario */
.form-group { margin-bottom: 13px; }

.form-label {
  font-size: 11px; font-weight: 600;
  color: var(--t2);
  margin-bottom: 5px; display: block;
  text-transform: uppercase; letter-spacing: 0.2px;
}

.form-control {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);     /* borde claro en inputs */
  border-radius: var(--r-md);
  padding: 10px 12px;
  color: var(--t1);
  font-family: var(--font);
  font-size: 14px;
  letter-spacing: -0.2px;
  outline: none; resize: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus {
  border-color: var(--c-blue);
  box-shadow: 0 0 0 3px rgba(26,86,219,0.10);
}

.form-control::placeholder { color: var(--t4); }
select.form-control option { background: var(--surface); color: var(--t1); }

.location-row { display: flex; gap: 6px; }
.location-row .form-control { flex: 1; }

/* Botón GPS: borde azul → interactivo */
.btn-gps {
  padding: 10px 13px;
  background: var(--s-blue);
  border: 1.5px solid var(--c-blue);
  border-radius: var(--r-md);
  color: var(--c-blue);
  font-family: var(--font);
  font-size: 12px; font-weight: 700;
  cursor: pointer; white-space: nowrap;
  transition: all var(--transition);
  flex-shrink: 0;
}
.btn-gps:hover { background: var(--c-blue); color: #fff; }

/* Tags de inventario — bordes visibles */
.inventory-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }

.inv-tag {
  padding: 5px 11px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1.5px solid var(--border);   /* borde = puede ser seleccionado */
  font-family: var(--font);
  font-size: 12px; font-weight: 500;
  cursor: pointer; color: var(--t2);
  transition: all var(--transition);
}

.inv-tag:hover { border-color: var(--border-strong); color: var(--t1); }

.inv-tag.selected {
  background: var(--c-green);
  border-color: var(--c-green);
  color: #ffffff;
  font-weight: 700;
}

/* Info tip */
.info-tip {
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-size: 12px; color: var(--t3); line-height: 1.5;
  margin-bottom: 16px;
}

/* Botones submit */
.btn-submit {
  width: 100%; padding: 13px;
  border-radius: var(--r-md);
  border: none;
  font-family: var(--font);
  font-size: 15px; font-weight: 700;
  letter-spacing: -0.3px;
  cursor: pointer;
  margin-top: 6px;
  transition: all var(--transition);
}

.btn-submit:hover  { filter: brightness(1.06); }
.btn-submit:active { transform: scale(0.98); }
.btn-submit:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-submit.submit-red    { background: var(--c-red);    color: #fff; }
.btn-submit.submit-green  { background: var(--c-green);  color: #fff; }
.btn-submit.submit-yellow { background: var(--c-yellow); color: #fff; }

#modal-punto, #modal-voluntario { animation: none; }

#v-destino-info { font-size: 12px; color: var(--c-green); font-weight: 600; }

/* Voluntario panel verde suave */
.volunteer-tip {
  background: var(--s-green);
  border: 1px solid rgba(26,127,75,0.2);
  border-radius: var(--r-md);
  padding: 12px 14px;
  margin-bottom: 18px;
}
.volunteer-tip-title { font-size: 13px; font-weight: 700; color: var(--c-green); margin-bottom: 4px; }
.volunteer-tip-body  { font-size: 12px; color: var(--t2); line-height: 1.5; }

/* ================================================================
   TOAST
   ================================================================ */
#toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(60px);
  background: var(--t1);
  border-radius: var(--r-pill);
  padding: 10px 18px;
  font-family: var(--font);
  font-size: 13px; font-weight: 500; letter-spacing: -0.2px;
  color: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  z-index: 999;
  transition: transform 0.3s cubic-bezier(0.25,1,0.5,1), opacity 0.25s ease;
  opacity: 0; 
  display: flex; align-items: center; justify-content: center; gap: 7px;
  pointer-events: none;
  max-width: 90vw;
  text-align: center;
  word-wrap: break-word;
}

#toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ================================================================
   UTILIDADES
   ================================================================ */
.spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(0,0,0,0.12);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: _spin 0.6s linear infinite;
  display: inline-block; vertical-align: middle;
}
@keyframes _spin { to { transform: rotate(360deg); } }

.empty-state { text-align: center; padding: 36px 20px; color: var(--t4); }
.empty-state-icon { font-size: 30px; margin-bottom: 10px; opacity: 0.35; }
.empty-state-text { font-size: 13px; }

#sidebar-handle { display: none; }

/* ── Legacy ── */
.confirms-bar { display: flex; align-items: center; gap: 6px; }
.confirm-btn {
  background: var(--s-green); border: 1.5px solid rgba(26,127,75,0.3);
  border-radius: var(--r-pill); color: var(--c-green);
  padding: 3px 10px; font-size: 11px; font-weight: 700;
  cursor: pointer; font-family: var(--font); transition: all var(--transition);
}
.confirm-btn:hover { background: var(--c-green); color: #fff; border-color: var(--c-green); }

.offer-card {
  background: var(--surface); border: 1px solid var(--border-light);
  border-radius: var(--r-md); padding: 9px 12px;
  display: flex; align-items: center; gap: 9px;
  margin-top: 5px; transition: all var(--transition);
}
.offer-card:hover { border-color: var(--border); background: var(--surface-2); }
.offer-card-name { font-size: 13px; font-weight: 600; color: var(--t1); }
.offer-card-meta { font-size: 11px; color: var(--t3); }
.offer-status.pending   { font-size: 11px; font-weight: 600; color: var(--c-yellow); }
.offer-status.transit   { font-size: 11px; font-weight: 600; color: var(--c-blue); }
.offer-status.delivered { font-size: 11px; font-weight: 600; color: var(--c-green); }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  #sidebar {
    position: fixed; bottom: 0; left: 0; right: 0;
    width: 100%; height: 92vh; /* Altura máxima cuando esté abierto completo */
    border-left: none;
    border-top: 1px solid var(--border-light);
    border-radius: 18px 18px 0 0;
    transform: translateY(32vh); /* Por defecto: 92vh - 32vh = 60vh visibles (mitad) */
    z-index: 20;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s cubic-bezier(0.25,1,0.5,1);
  }

  #sidebar.full { transform: translateY(0); } /* Abierto completo */
  #sidebar.collapsed { transform: translateY(calc(92vh - 60px)); } /* Colapsado */

  #sidebar-handle {
    display: flex; justify-content: center;
    padding: 10px 0 6px; cursor: pointer; flex-shrink: 0;
  }

  #sidebar-handle::before {
    content: ''; width: 30px; height: 3px;
    background: var(--border); border-radius: 2px;
  }

  #map-controls { top: 72px; }
  #search-box   { top: 14px; left: 14px; transform: none; right: 62px; }
  #search-input { width: 100%; }
}
