/* ============================================================
   style.css  —  Pasanaku App
   Optimizado para móvil (380-430px) y funcional en desktop
============================================================ */

/* ── Reset & variables ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green:        #1D9E75;
  --green-dk:     #0F6E52;
  --green-lt:     #E1F5EE;
  --green-txt:    #0A5540;
  --amber:        #BA7517;
  --amber-lt:     #FEF3DC;
  --amber-txt:    #7A4A06;
  --red:          #D94040;
  --red-lt:       #FCEBEB;
  --red-txt:      #8B1A1A;
  --blue:         #2776C8;
  --blue-lt:      #E6F2FB;
  --blue-txt:     #14508A;
  --bg:           #F5F4F0;
  --bg-card:      #FFFFFF;
  --bg-input:     #FAFAF8;
  --border:       #E2E0D8;
  --border-focus: #1D9E75;
  --text:         #1A1916;
  --text-2:       #5A5855;
  --text-3:       #9A9894;
  --radius-sm:    6px;
  --radius-md:    10px;
  --radius-lg:    14px;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.08);
  --shadow-md:    0 4px 16px rgba(0,0,0,.12);
  --font:         -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html { font-size: 15px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overscroll-behavior: none;
}

/* ── Header ─────────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--green);
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 600px;
  margin: 0 auto;
  padding: 0 14px;
  height: 52px;
}
.header-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #fff;
  opacity: .85;
}
.brand-name {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  letter-spacing: .2px;
}
.header-actions { display: flex; gap: 6px; }
.icon-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.4);
  background: rgba(255,255,255,.15);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.icon-btn:hover { background: rgba(255,255,255,.28); }

/* ── Selector de pasanaku ───────────────────────────────── */
.ps-selector {
  background: var(--green-dk);
  padding: 8px 14px;
}
/* ── Selectores principales: Pasanaku y Canastón ─────── */

#selectPs,
#selectCanaston {
  width: 100%;
  max-width: 600px;
  min-height: 42px;

  display: block;
  margin: 0 auto;
  padding: 8px 34px 8px 12px;

  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius-md);

  background-color: rgba(255, 255, 255, 0.12);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23fff' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 12px;

  color: #ffffff;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.2;

  appearance: none;
  -webkit-appearance: none;

  cursor: pointer;

  transition:
    border-color 0.15s ease,
    background-color 0.15s ease,
    box-shadow 0.15s ease;
}

#selectPs:hover,
#selectCanaston:hover {
  background-color: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.42);
}

#selectPs:focus,
#selectCanaston:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.65);
  background-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12);
}

#selectPs option,
#selectCanaston option {
  background-color: #1a5a42;
  color: #ffffff;
}

/* ── Tab nav ─────────────────────────────────────────────── */
.tab-nav {
  display: flex;
  overflow-x: auto;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  max-width: 600px;
  margin: 0 auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar { display: none; }
.tab-btn {
  flex-shrink: 0;
  padding: 10px 14px;
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  border-bottom: 2.5px solid transparent;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.tab-btn.active {
  color: var(--green);
  border-bottom-color: var(--green);
}
.tab-btn:hover:not(.active) { color: var(--text); }

/* ── Main / panels ───────────────────────────────────────── */
.main {
  max-width: 600px;
  margin: 0 auto;
  padding: 14px 12px 80px;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.card-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 10px;
}
.danger-zone { border-color: #f5c6c6; }

/* ── Stats grid ──────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}
.stat-label { font-size: 11px; color: var(--text-3); margin-bottom: 4px; }
.stat-val   { font-size: 22px; font-weight: 600; color: var(--text); }
.stat-val.green { color: var(--green); }
.stat-val.amber { color: var(--amber); }
.stat-val.red   { color: var(--red); }

/* ── Progress ────────────────────────────────────────────── */
.progress-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.progress-bar {
  flex: 1;
  height: 7px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--green);
  border-radius: 4px;
  transition: width .4s ease;
}
.progress-label { font-size: 12px; color: var(--text-3); white-space: nowrap; }

/* ── Turno card ──────────────────────────────────────────── */
.turno-nombre { font-size: 16px; font-weight: 600; margin-bottom: 3px; }
.turno-meta   { font-size: 13px; color: var(--text-2); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  margin-bottom: 8px;
  transition: background .12s, transform .08s;
  -webkit-tap-highlight-color: transparent;
}
.btn:last-child { margin-bottom: 0; }
.btn:active { transform: scale(.97); }
.btn.primary {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}
.btn.primary:hover { background: var(--green-dk); border-color: var(--green-dk); }
.btn.outline { background: transparent; }
.btn.outline:hover { background: var(--bg); }
.btn.warning {
  background: var(--amber);
  color: #fff;
  border-color: var(--amber);
}
.btn.danger {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.btn.sm   { padding: 6px 12px; font-size: 12px; width: auto; margin-bottom: 0; }
.btn.full { width: 100%; }

/* ── Forms ───────────────────────────────────────────────── */
label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 4px;
  margin-top: 10px;
}
label:first-child { margin-top: 0; }
input[type="text"],
input[type="number"],
input[type="tel"],
input[type="date"],
input[type="file"],
select,
textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  margin-bottom: 4px;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  background: #fff;
}

input[type="file"] { padding: 7px 10px; font-size: 13px; }
textarea { resize: vertical; min-height: 100px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hint       { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.hint-inline{ font-size: 11px; color: var(--text-3); font-weight: 400; }

/* ── Number selector (sorteo / participante) ─────────────── */
.num-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  max-height: 170px;
  overflow-y: auto;
  margin-bottom: 4px;
}
.nball {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background .1s, border-color .1s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.nball:hover:not(.taken) { border-color: var(--green); color: var(--green); }
.nball.sel   { background: var(--green); color: #fff; border-color: var(--green); }
.nball.taken { background: var(--bg); color: var(--text-3); cursor: default; border-style: dashed; }
.num-sel-info { font-size: 11px; color: var(--text-3); margin-bottom: 6px; min-height: 16px; }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge.green { background: var(--green-lt); color: var(--green-txt); }
.badge.amber { background: var(--amber-lt); color: var(--amber-txt); }
.badge.red   { background: var(--red-lt);   color: var(--red-txt); }
.badge.blue  { background: var(--blue-lt);  color: var(--blue-txt); }
.badge.gray  { background: #F0EEE8;         color: var(--text-2); }

/* mini badges en participante row */
.nnum {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  margin: 2px;
}
.nnum.paid    { background: var(--green-lt); color: var(--green-txt); border-color: #8DDBC0; }
.nnum.pending { background: var(--amber-lt); color: var(--amber-txt); border-color: #FBCC6E; }
.nnum.late    { background: var(--red-lt);   color: var(--red-txt);   border-color: #F0A0A0; }
.nnum.current { background: var(--blue-lt);  color: var(--blue-txt);  border-color: #8EC8F0; font-weight:700; }

/* ── Participante row ────────────────────────────────────── */
.part-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.part-row:last-child { border-bottom: none; }
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #9FE1CB;
  color: #085041;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.part-info { flex: 1; min-width: 0; }
.part-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.part-meta { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.part-nums { display: flex; flex-wrap: wrap; margin-top: 4px; }
.part-multa { font-size: 11px; color: var(--red); margin-top: 3px; }
.part-actions { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }

/* ── Alertas ─────────────────────────────────────────────── */
.notif {
  padding: 9px 12px;
  border-radius: var(--radius-md);
  font-size: 12px;
  margin-bottom: 7px;
  border-left: 3px solid;
  line-height: 1.5;
}
.notif.warn { background: var(--amber-lt); color: var(--amber-txt); border-color: var(--amber); }
.notif.info { background: var(--blue-lt);  color: var(--blue-txt);  border-color: var(--blue); }
.notif.ok   { background: var(--green-lt); color: var(--green-txt); border-color: var(--green); }

/* ── Calendario ──────────────────────────────────────────── */
.cal-head, .cal-row {
  display: grid;
  grid-template-columns: 32px 1fr 95px 56px;
  gap: 4px;
  align-items: center;
  padding: 6px 2px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.cal-head { font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .4px; }
.cal-row:last-child { border-bottom: none; }
.cal-row.done { opacity: .5; }
.cal-row.curr {
  background: var(--blue-lt);
  border-radius: var(--radius-sm);
  padding: 6px 6px;
  margin: 0 -6px;
}
.cal-num { font-weight: 700; color: var(--text-2); }
.cal-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-date { font-size: 12px; color: var(--text-2); }
.cal-foot { font-size: 11px; color: var(--text-3); margin-top: 10px; text-align: right; }

/* ── Pagos ───────────────────────────────────────────────── */
.pago-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.pago-row:last-child { border-bottom: none; }
.pago-info { flex: 1; min-width: 0; }
.pago-name { font-size: 13px; font-weight: 600; }
.pago-meta { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.pago-multa { font-size: 11px; color: var(--red); margin-top: 2px; }

/* ── Multa info en modal pago ────────────────────────────── */
.multa-info {
  padding: 8px 10px;
  border-radius: var(--radius-md);
  font-size: 12px;
  margin-bottom: 6px;
}
.multa-info.warn { background: var(--amber-lt); color: var(--amber-txt); }
.multa-info.ok   { background: var(--green-lt); color: var(--green-txt); }

/* ── Export box ──────────────────────────────────────────── */
.export-box {
  width: 100%;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.65;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  color: var(--text);
  resize: none;
  min-height: 160px;
  margin-bottom: 8px;
}

/* ── Config info ─────────────────────────────────────────── */
.cfg-info { font-size: 13px; color: var(--text-2); line-height: 1.7; }

/* ── Historial ───────────────────────────────────────────── */
.hist-row {
  padding: 7px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
}
.hist-row:last-child { border-bottom: none; }

/* ── Foto preview ────────────────────────────────────────── */
.foto-preview {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-top: 6px;
  margin-bottom: 4px;
}

/* ── Preview box ─────────────────────────────────────────── */
.preview-box {
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  font-size: 12px;
  color: var(--text-2);
  min-height: 36px;
  margin-bottom: 8px;
  line-height: 1.6;
}

/* ── Panel header ────────────────────────────────────────── */
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.panel-header h2 { font-size: 17px; font-weight: 600; }

/* ── Empty states ────────────────────────────────────────── */
.empty-ps {
  text-align: center;
  padding: 40px 20px;
}
.empty-icon {
  font-size: 36px;
  color: var(--text-3);
  margin-bottom: 12px;
}
.empty-ps p { font-size: 15px; font-weight: 500; margin-bottom: 4px; }
.empty-ps .sub { font-size: 13px; color: var(--text-3); margin-bottom: 20px; }
.empty-btns { display: flex; flex-direction: column; gap: 8px; max-width: 240px; margin: 0 auto; }
.empty-msg {
  text-align: center;
  padding: 18px 10px;
  font-size: 13px;
  color: var(--text-3);
}

/* ── Modales ─────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 100;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 18px 16px 28px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp .22s ease;
}
.modal-lg { max-height: 92vh; }
@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.modal-title { font-size: 16px; font-weight: 600; }
.close-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  color: var(--text-2);
  font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.close-btn:hover { background: var(--border); }
.modal-footer {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.modal-footer .btn { margin-bottom: 0; }

/* ── Sorteo lista ────────────────────────────────────────── */
.sorteo-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.sorteo-item:last-child { border-bottom: none; }
.sorteo-num {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.sorteo-name { flex: 1; font-weight: 500; }
.sorteo-fecha { font-size: 11px; color: var(--text-3); }

/* ── Deudas wrap ─────────────────────────────────────────── */
.deuda-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.deuda-row:last-child { border-bottom: none; }

/* ── Toast ───────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1a1a1a;
  color: #fff;
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  z-index: 200;
  opacity: 0;
  transition: transform .25s ease, opacity .25s ease;
  pointer-events: none;
  max-width: 320px;
  text-align: center;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.toast.green { background: var(--green); }
.toast.red   { background: var(--red); }

.num-selector div {
  display: inline-block;
  padding: 8px;
  margin: 4px;
  border: 1px solid #ccc;
  cursor: pointer;
}

.num-selector div.selected {
  background: #1D9E75;
  color: white;
}
.num-selector div.ocupado {
  background: #ddd;
  color: #888;
  cursor: not-allowed;
  opacity: 0.6;
}
#calPanel table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

#calPanel th,
#calPanel td {
  padding: 8px 6px;
  border-bottom: 1px solid #eee;
  text-align: left;
  white-space: nowrap;
}

#calPanel th {
  font-weight: 700;
}

#calPanel td:nth-child(4) {
  white-space: normal;
}

.deuda-item {
  background: #fff3f3;
  border-left: 4px solid #d9534f;
  padding: 10px;
  margin-bottom: 8px;
  border-radius: 8px;
  font-size: 14px;
}
input[type="time"] {
  width: 100%;
  padding: 12px;
  border: 1px solid #dedad2;
  border-radius: 12px;
  background: #fff;
  font-size: 16px;
  color: #1f2933;
  box-sizing: border-box;
}
.time-input:focus {
  outline: none !important;
  border-color: #1D9E75 !important;
  box-shadow: 0 0 0 3px rgba(29, 158, 117, 0.15) !important;
}

/* Estados calendario */
.estado {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  display: inline-block;
}

.estado.pendiente {
  background: #f0f0f0;
  color: #555;
}

.estado.pagado {
  background: #d4f8e8;
  color: #0a7f5a;
}

.estado.turno {
  background: #fff3cd;
  color: #856404;
}

.estado.entregado {
  background: #e0e7ff;
  color: #3730a3;
}

.estado.atrasado {
  background: #ffe3e3;
  color: #b91c1c;
}

.num-item {
  display: inline-block;
  padding: 10px;
  margin: 5px;
  border-radius: 8px;
  border: 1px solid #ccc;
  cursor: pointer;
  min-width: 40px;
  text-align: center;
  font-weight: 600;
}

.num-item:hover {
  background: #f0f0f0;
}

.num-item.selected {
  background: #1D9E75;
  color: white;
  border-color: #1D9E75;
}

.deuda-item {
  background: #fff3f3;
  border-left: 5px solid #e53935;
  padding: 10px;
  margin-bottom: 8px;
  border-radius: 8px;
  font-size: 14px;
}

.cal-img-box {
  width: 980px;
  background: white;
  padding: 10px;
  font-family: Arial, sans-serif;
}

.cal-img-title {
  background: #155f58;
  color: white;
  font-weight: 800;
  text-align: center;
  padding: 8px;
  font-size: 18px;
  border: 2px solid #000;
}

.cal-img-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.cal-img-table th {
  background: #2fa79c;
  color: white;
  border: 2px solid #000;
  padding: 6px;
}

.cal-img-table td {
  border: 2px solid #000;
  padding: 5px;
  text-align: center;
}

.cal-img-table td:nth-child(3),
.cal-img-table td:nth-child(6) {
  text-align: left;
}

#calendarioImagen,
#calendarioCanastonImagen,
#controlBolosCanastonImagen {
  width: 980px;
  overflow: visible !important;
}

.cal-img-table {
  table-layout: fixed;
}

.cal-img-table th:nth-child(1),
.cal-img-table td:nth-child(1),
.cal-img-table th:nth-child(4),
.cal-img-table td:nth-child(4) {
  width: 45px;
}

.cal-img-table th:nth-child(2),
.cal-img-table td:nth-child(2),
.cal-img-table th:nth-child(5),
.cal-img-table td:nth-child(5) {
  width: 210px;
}

.cal-img-table th:nth-child(3),
.cal-img-table td:nth-child(3),
.cal-img-table th:nth-child(6),
.cal-img-table td:nth-child(6) {
  width: 150px;
}

.cal-img-table td.turno-img-actual {
  background: #fff176 !important;
  color: #000 !important;
  font-weight: 800;
}

.cal-img-box.una-columna {
  width: 430px;
}

.cal-img-box.una-columna .cal-img-table th:nth-child(1),
.cal-img-box.una-columna .cal-img-table td:nth-child(1) {
  width: 45px;
}

.cal-img-box.una-columna .cal-img-table th:nth-child(2),
.cal-img-box.una-columna .cal-img-table td:nth-child(2) {
  width: 220px;
}

.cal-img-box.una-columna .cal-img-table th:nth-child(3),
.cal-img-box.una-columna .cal-img-table td:nth-child(3) {
  width: 160px;
}

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ── Responsive desktop ──────────────────────────────────── */
@media (min-width: 520px) {
  .modal-overlay { align-items: center; padding: 16px; }
  .modal {
    border-radius: var(--radius-lg);
    padding: 22px 22px 22px;
  }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
}
/* =========================
   SELECTOR DE MÓDULOS
========================= */
#selectorModulos {
  background: var(--green-dk);
  padding: 10px 14px;
}

#selectorModulos > div {
  max-width: 600px;
  margin: 0 auto;
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

#selectorModulos .btn {
  height: 40px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  justify-content: center;
}

/* =========================
   CANASTÓN COMO PASANAKU
========================= */
#canastonSelector {
  background: var(--green-dk);
  padding: 8px 14px;
}

.canaston-tab-panel {
  display: none;
}

.canaston-tab-panel.active {
  display: block;
}

/* =========================
   PRODUCTOS CANASTÓN
========================= */

.productos-canaston-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.productos-canaston-columna {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.producto-canaston-item {
  background: #fff;
  border: 1px solid #ddd8cf;
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.producto-canaston-item label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #444;
}

.producto-canaston-item select {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 8px 12px;
  border: 1px solid #ddd8cf;
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
}

/* Pantallas pequeñas */
@media (max-width: 700px) {
  .productos-canaston-grid {
    grid-template-columns: 1fr;
  }
}

.producto-canaston-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
  align-items: center;
}

.btn-editar-producto-canaston {
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--green);
  border-radius: 10px;
  background: #fff;
  color: var(--green-dk);
  font-size: 20px;
  cursor: pointer;
}

.btn-editar-producto-canaston:hover {
  background: var(--green);
  color: #fff;
}

/* =========================
   CALENDARIO CANASTÓN
========================= */

.calendario-canaston-grid {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.calendario-canaston-item {
  border: 1px solid #ddd8cf;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.calendario-canaston-item.actual {
  border: 2px solid var(--green);
  background: #effaf6;
}

.calendario-canaston-item.completado {
  background: #f2f8f5;
}

.calendario-canaston-numero {
  font-size: 13px;
  font-weight: 700;
  color: var(--green-dk);
}

.calendario-canaston-recibe {
  margin-top: 5px;
  font-size: 15px;
  font-weight: 600;
}

.calendario-canaston-fecha {
  margin-top: 4px;
  font-size: 13px;
  color: #777;
}

.calendario-canaston-estado {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 8px;
  border-radius: 20px;
  background: #eee;
  font-size: 11px;
  font-weight: 600;
}

.calendario-canaston-item.actual
.calendario-canaston-estado {
  background: var(--green);
  color: #fff;
}

.calendario-canaston-item.completado
.calendario-canaston-estado {
  background: #d8eee4;
  color: var(--green-dk);
}

@media (max-width: 700px) {
  .calendario-canaston-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================
   CONTROL DE BOLOS CANASTÓN
========================= */

.control-bolos-subtitulo {
  padding: 8px 12px;
  background: #e9f5f2;
  color: #145a52;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  border-left: 1px solid #145a52;
  border-right: 1px solid #145a52;
}

.control-bolos-table {
  font-size: 11px;
}

.control-bolos-table th {
  background: #2fafa3;
  color: #ffffff;
}

.control-bolo-producto {
  text-align: left;
  font-size: 10px;
}

.control-bolo-pendiente {
  color: #b42318;
  background: #fff2f0;
  font-weight: 700;
}

/* =========================
   FILTRO DE ENTREGAS
========================= */

.filtro-entregas-canaston {
  background: #f7faf8;
  border-color: #d4d1ca;
}

.filtro-entregas-canaston label {
  color: var(--green-dk);
  font-size: 14px;
}

.filtro-entregas-canaston-controles {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.filtro-entregas-canaston-controles input {
  width: 100%;
  margin: 0;
}

.oculto-por-filtro {
  display: none !important;
}

#resumenFiltroCanaston {
  margin-top: 7px;
}

#sinResultadosFiltroCanaston {
  margin-top: 10px;
}

@media (max-width: 650px) {
  .filtro-entregas-canaston-controles {
    grid-template-columns: 1fr 1fr;
  }

  .filtro-entregas-canaston-controles input {
    grid-column: 1 / -1;
  }
}

/* =========================
   BOLOS INICIALES
========================= */

.resumen-bolos-iniciales {
  margin: 14px 0;
  padding: 12px;
  border-radius: 10px;
  background: #f4f7f6;
  font-size: 13px;
}

.bolo-resumen-completo {
  color: #0a7f5a;
  font-weight: 700;
}

.bolo-resumen-pendiente {
  color: #9a6700;
  font-weight: 700;
}

.lista-bolos-iniciales {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.bolo-inicial-item {
  display: grid;
  grid-template-columns: minmax(170px, 0.8fr)
                         minmax(240px, 1.2fr);
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid #dedbd5;
  border-radius: 12px;
  background: #ffffff;
}

.bolo-inicial-participante {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bolo-inicial-numero {
  color: #145a52;
  font-size: 12px;
  font-weight: 700;
}

.bolo-inicial-selector label {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  font-weight: 600;
}

.bolo-inicial-selector select {
  width: 100%;
  margin: 0;
}

@media (max-width: 650px) {
  .bolo-inicial-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* =========================
   FILTROS DE ESTADO
========================= */

.filtros-estado-canaston {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.filtro-estado-btn {
  min-height: 48px;
  padding: 8px;
  border: 1px solid #d8d5cf;
  border-radius: 12px;
  background: #ffffff;
  color: #555;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.filtro-estado-btn span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  margin-left: 4px;
  padding: 0 6px;
  border-radius: 12px;
  background: #eeeeee;
  font-size: 12px;
}

.filtro-estado-btn.active {
  border-color: #1d9e75;
  background: #1d9e75;
  color: #ffffff;
}

.filtro-estado-btn.active span {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

/* Tarjeta pendiente */
.estado-card-pendiente {
  border-left: 5px solid #d9a400;
}

/* Entregó pero no sacó bolo */
.estado-card-entregado_falta_bolo {
  border-left: 5px solid #e67e22;
  background: #fffaf2;
}

/* Completado */
.estado-card-completado {
  border-left: 5px solid #1d9e75;
  background: #f1faf7;
}

.estado.pendiente {
  background: #fff3cd;
  color: #856404;
}

.estado.entregado_falta_bolo {
  background: #ffe0b2;
  color: #9a4d00;
}

.estado.completado {
  background: #d4f8e8;
  color: #087452;
}


html.auth-checking body {
  visibility: hidden;
}

html.auth-ready body {
  visibility: visible;
}

/* =========================
   BUSCADOR DE ENTREGAS
========================= */

#buscarEntregaCanaston {
  width: 100%;
  min-height: 44px;
  margin: 0;

  padding:
    10px 14px
    10px 38px;

  border:
    1.5px solid
    #c9c6bf;

  border-radius: 12px;

  background-color:
    #ffffff;

  color: #1a1916;

  font-size: 15px;
  font-family: var(--font);

  appearance: none;
  -webkit-appearance: none;

  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%235A5855' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");

  background-repeat:
    no-repeat;

  background-position:
    12px center;

  background-size:
    18px 18px;
}

#buscarEntregaCanaston::placeholder {
  color: #85817b;
  opacity: 1;
}

#buscarEntregaCanaston:focus {
  outline: none;

  border-color:
    var(--green);

  background-color:
    #ffffff;

  box-shadow:
    0 0 0 3px
    rgba(29, 158, 117, 0.15);
}

/* Quitar decoración propia de Safari */
#buscarEntregaCanaston::-webkit-search-decoration {
  display: none;
}

#buscarEntregaCanaston::-webkit-search-cancel-button {
  cursor: pointer;
}

/* =========================
   OCULTAMIENTO POR PERMISOS
========================= */

[hidden] {
  display: none !important;
}

input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.78;
  background: #f1f1ef;
  color: #555;
}