/* =========================================================
   STYLE.CSS (COMPLETO) - RESPONSIVE / SIN DESBORDE
   - Elimina conflictos: .app-footer estaba duplicado y se pisaba
   - Header y nav sin overflow, wrap correcto
   - Grids/formularios 100% responsive
   ========================================================= */

/* -----------------------------
   RESET + BASE (ANTI-DESBORDE)
   ----------------------------- */
:root {
  --bg: #e6e8ea;
  --card: #eaecf1;
  --muted: #94a3b8;
  --border: #fdfdfd;
  --text: #000000;
  --primary: #0e553f;
  --primary-ink: #eaf1f1;
  --accent: #0e553f;
  --danger: #ef4444;
  --header-grad-1: #0e553f;
  --header-grad-2: #0e553f;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  font-family: Inter, system-ui, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Medios no deben empujar el layout */
img, video, canvas, svg { max-width: 100%; height: auto; }

/* Formularios: nunca forzar ancho mayor al contenedor */
input, select, textarea, button { max-width: 100%; }

/* -----------------------------
   HEADER / APPBAR
   ----------------------------- */
.header, header {
  width: 100%;
  max-width: 100%;
}

/* Appbar */
.appbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(90deg, var(--header-grad-1), var(--header-grad-2));
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .15);
  flex-wrap: wrap; /* clave: evita overflow cuando nav es grande */
}

/* Nav del header (reemplaza inline styles) */
.appbar-nav {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;          /* si no cabe, baja */
  justify-content: flex-end;
  min-width: 0;
}

/* Variante: header convertido en imagen */
.appbar-img { padding: 0; background: none; box-shadow: none; }

.header-banner {
  width: 100%;
  height: auto;
  display: block;
  max-height: 56px;         /* evita que el header se infle */
  object-fit: contain;
}

@media (max-width: 600px) {
  .header-banner { max-height: 44px; }
}

.appbar .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 320px;
}

.appbar .title {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  min-width: 0;
  width: 100%;
}

.appbar .title b { font-size: 18px; }
.appbar .title small { color: var(--muted); }

/* -----------------------------
   CONTENEDOR PRINCIPAL
   ----------------------------- */
.main, .page, .container, .form-wrapper {
  width: 100%;
  max-width: 1100px;
  margin: 24px auto;
  padding: 0 16px;
  display: grid;
  gap: 16px;
  flex: 1 0 auto;
  min-width: 0;
}

.login-screen .container {
  margin: 0 auto;
  padding: 0 16px;
  display: grid;
  gap: 16px;
}

/* -----------------------------
   CARDS / TIPOGRAFÍA
   ----------------------------- */
.card, .panel, .box {
  width: 100%;
  max-width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  min-width: 0;
}

h2 { margin: 0 0 12px 0; font-size: 18px; }
h3 { margin: 0; }

/* -----------------------------
   GRIDS / FORM
   ----------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  min-width: 0;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  min-width: 0;
}

input, textarea, select {
  background: #f7f7f8;
  color: var(--text);
  border: 1px solid #0a0a0a;
  border-radius: 12px;
  padding: 10px;
  width: 100%;
  min-width: 0;
}

textarea { resize: vertical; }

/* Row utilitaria */
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
  min-width: 0;
}

.muted { color: var(--muted); }

.list { display: grid; gap: 8px; }

.item, .rowline {
  background: #f7f7f7;
  border: 1px solid #ffffff;
  border-radius: 12px;
  padding: 10px;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

/* -----------------------------
   BOTONES / LINKS
   ----------------------------- */
.btn {
  background: var(--primary);
  border: none;
  color: var(--primary-ink);
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
}

.btn.secondary {
  background: var(--accent);
  color: #ffffff;
}

.btn.danger {
  background: var(--danger);
  color: #ffffff;
}

.btn.small { padding: 6px 10px; font-size: 12px; }

.btn:disabled { opacity: .5; cursor: not-allowed; }

.link {
  color: #000000;
  text-decoration: none;
}

#btn-install {
  color: #fff !important;
  font-weight: 700;
}

/* -----------------------------
   FIRMA
   ----------------------------- */
.sig-wrap { margin-top: 12px; }

.sig-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 12px;
  flex-wrap: wrap;
}

#sig-canvas {
  width: 100%;
  max-width: 100%;
  border: 1px dashed #0c0c0c;
  border-radius: 12px;
  background: #ffffff;
  touch-action: none;
}

/* -----------------------------
   BADGES / USUARIO
   ----------------------------- */
.badge {
  padding: 4px 8px;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  white-space: nowrap;
}

.user-pill {
  padding: 6px 10px;
  border-radius: 999px;
  background: #00695c;
  color: #e0f2f1;
  font-size: 13px;
  max-width: 220px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

/* ===== MENÚ DE USUARIO (PROFILE DROPDOWN) ===== */
.user-menu { position: relative; font-size: 14px; }

.user-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 999px;
  border: none;
  padding: 6px 10px;
  cursor: pointer;
  color: #e5f5ef;
  max-width: 100%;
}

.user-menu-trigger:hover { background: rgba(0, 0, 0, 0.26); }

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #0e553f;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: #ffffff;
  flex: 0 0 auto;
}

.user-name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.user-caret { font-size: 11px; opacity: 0.85; }

.user-dropdown {
  position: absolute;
  right: 0;
  top: 120%;
  min-width: 170px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.25);
  padding: 4px 0;
  z-index: 30;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.user-dropdown.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.user-dropdown-item {
  width: 100%;
  padding: 8px 14px;
  background: transparent;
  border: none;
  text-align: left;
  font-size: 13px;
  cursor: pointer;
  color: #111827;
}

.user-dropdown-item:hover { background: #f3f4f6; }

.user-dropdown-item.user-logout {
  color: #b91c1c;
  font-weight: 700;
}

.user-dropdown-item.user-logout:hover { background: #fee2e2; }

#net-status { background: #fdfdfd; }

/* -----------------------------
   FOOTER (UNIFICADO)
   - Soporta 2 variantes:
     A) .app-footer > .wrap  (index)
     B) .app-footer > .footer-wrap (home/solicitud)
   ----------------------------- */
.app-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: #0f5132;
  color: #ffffff;
  padding: 20px 0;
}

/* Variante A: index.html */
.app-footer .wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.app-footer small { color: #d1fae5; }
.app-footer small.muted, .app-footer .muted { color: #bbf7d0; opacity: 0.9; }

.app-footer .links {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.app-footer .logos {
  display: flex;
  gap: 12px;
  align-items: center;
  opacity: .95;
}

.app-footer .logos img { height: 28px; }

/* Variante B: home.html y solicitud_viveres.html */
.footer-wrap {
  max-width: 1200px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 0 20px;
  flex-wrap: wrap;
}

.footer-left small { display: block; opacity: 0.9; }

.footer-center .link { color: #d1f5e0; }

.footer-right {
  display: flex;
  justify-content: center;
  align-items: center;
}

.gov-logo {
  height: 50px;
  width: auto;
  object-fit: contain;
  display: block;
}

/* -----------------------------
   FORM GRID / SECCIONES
   ----------------------------- */
.form-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.section-title {
  font-size: 1rem;
  font-weight: 700;
  margin-top: 1rem;
  margin-bottom: 0.25rem;
}

.section-body {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: #f7f7f9;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.grid-2 {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  min-width: 0;
}

.grid-4 {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  min-width: 0;
}

.question-text {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  line-height: 1.3;
}

/* Bloque preguntas */
.bloque-preguntas {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  background: #f7f7f9;
  padding: 1rem;
  border-radius: 10px;
  align-items: start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.pregunta {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: #ffffff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 0.8rem 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  width: 100%;
  min-width: 0;
}

.pregunta p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.3rem;
  color: #333;
}

.pregunta select {
  margin-top: auto;
  padding: 0.45rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.9rem;
  background-color: #fff;
  min-height: 36px;
  width: 100%;
  min-width: 0;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.6rem;
  margin-top: 0.8rem;
  width: 100%;
  min-width: 0;
}

.preview-grid img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #ccc;
}

/* -----------------------------
   ADMIN FORM
   ----------------------------- */
.admin-form-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  align-items: flex-end;
  min-width: 0;
}

.admin-form-grid label { margin: 0; }

.admin-form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* -----------------------------
   LOGIN A DOS COLUMNAS
   ----------------------------- */
.login-screen {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 120px);
  padding: 2rem 1rem;
}

.login-layout {
  display: flex;
  max-width: 1100px;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: #f3f4f6;
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.18);
  min-width: 0;
}

.login-hero {
  flex: 1;
  background: #ffffff;
  color: #0f172a;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1.5rem 2.5rem;
  text-align: center;
  min-width: 0;
}

.login-hero-logo {
  width: 100%;
  max-width: 1000px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.login-card {
  flex: 1;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
  background: #ffffff;
  padding: 2.5rem 2.75rem;
  min-width: 0;
}

.login-card h2 { margin-bottom: 1.5rem; }

/* -----------------------------
   HOME CARDS
   ----------------------------- */
.home-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
  margin-top: 1.5rem;
  min-width: 0;
}

.form-card {
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.10);
  transition: transform .2s ease, box-shadow .25s ease;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.form-card:hover {
  transform: translateY(-4px);
  box-shadow: 0px 10px 18px rgba(0, 0, 0, 0.20);
}

.form-card-img { width: 100%; height: 240px; object-fit: cover; }

.form-card-body {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.form-card-body p {
  margin: 0;
  font-weight: 700;
  font-size: 0.95rem;
  color: #0e553f;
}

/* HOME ACTIONS */
.home-actions-row,
#sec-home .home-actions-row {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  max-width: 1100px;
  margin: 20px auto 0 auto;
  flex-wrap: wrap;
  min-width: 0;
}

.home-action {
  flex: 1 1 260px;
  width: auto;
  max-width: 100%;
  padding: 14px 18px;
  background: #064e3b;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
}

.home-action:hover { background: #046c4e; }

@media (min-width: 1200px) {
  #sec-home .home-actions-row .btn { max-width: 260px; }
}

/* -----------------------------
   TABLAS / DESPACHO
   ----------------------------- */
.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 12px;
  background: #fff;
}

.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
  font-size: 13px;
}

.table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f6f7f9;
  border-bottom: 1px solid rgba(0, 0, 0, .12);
  padding: 10px 10px;
  text-align: left;
  white-space: nowrap;
}

.table td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(0, 0, 0, .06);
  vertical-align: middle;
}

.table tbody tr:nth-child(even) { background: rgba(0, 0, 0, .02); }
.table tbody tr:hover { background: rgba(0, 0, 0, .04); }

.t-right { text-align: right; font-variant-numeric: tabular-nums; }
.t-center { text-align: center; }
.nowrap { white-space: nowrap; }

.badge-mini {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .06);
  font-size: 12px;
  white-space: nowrap;
}

.col-producto {
  max-width: 360px;
  white-space: normal;
  line-height: 1.2;
}

.table-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 10px 0 8px;
  flex-wrap: wrap;
}

.table-summary .muted { font-size: 12px; }

/* -----------------------------
   CAMPOS ESPECIALES (GESTIÓN CONTRACTUAL)
   ----------------------------- */
.input-readonly {
  background-color: #eaecf1;
  color: #0e553f;
  font-weight: 800;
  border: 1px solid #ced4da;
  cursor: not-allowed;
  pointer-events: none;
}

.input-total {
  width: 100%;
  font-size: 1.4rem;
  padding: 15px;
  background-color: #e8f5e9;
  border: 2px solid #0e553f;
  color: #0e553f;
  font-weight: 900;
  text-align: right;
  border-radius: 12px;
  margin-top: 8px;
}

.label-total {
  font-size: 1.1em;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 5px;
  display: block;
}

/* -----------------------------
   RESPONSIVE (MÓVIL / TABLET)
   ----------------------------- */
@media (max-width: 900px) {
  .home-actions-row,
  #sec-home .home-actions-row {
    gap: 12px;
    justify-content: center;
  }

  .home-action { flex: 1 1 45%; }
}

@media (max-width: 768px) {
  .main, .page, .container, .form-wrapper {
    max-width: 100%;
    margin: 12px auto;
    padding: 0 10px;
  }

  .card { padding: 12px; border-radius: 12px; }

  .grid,
  .grid-2,
  .grid-4 { grid-template-columns: 1fr; }

  .bloque-preguntas { grid-template-columns: 1fr; padding: 0.75rem; }

  .row {
    flex-direction: column;
    align-items: stretch;
  }

  .row .btn { width: 100%; text-align: center; }

  /* Footer variante A */
  .app-footer .wrap {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .app-footer .links { justify-content: flex-start; }

  /* Footer variante B */
  .footer-wrap { flex-direction: column; text-align: center; }
  .gov-logo { height: 40px; }

  /* Login */
  .login-layout { flex-direction: column; }
  .login-hero { padding: 2rem 1.5rem; }
  .login-card { padding: 2rem 1.5rem 2.5rem; }
}

@media (max-width: 480px) {
  .login-hero-logo {
    max-width: 100%;
    max-height: 160px;
    object-fit: contain;
  }
}

@media (max-width: 400px) {
  .appbar .title b { font-size: 16px; }
  .appbar .title small { font-size: 11px; }
}

@media (max-width: 640px) {
  .table { font-size: 12px; min-width: 760px; }
  .col-producto { max-width: 260px; }
}

/* =========================================================
   FIX ESPECÍFICO: SOLICITUD DE VÍVERES
   - Evita overflow horizontal (inputs cortados)
   - Fuerza grid-2 en 2 columnas reales
   - Permite encoger columnas sin desbordar (minmax(0,1fr))
   ========================================================= */

body[data-page="solicitud-viveres"] .container,
body[data-page="solicitud-viveres"] .card,
body[data-page="solicitud-viveres"] .section-body,
body[data-page="solicitud-viveres"] form {
  min-width: 0;
  max-width: 100%;
}

/* Evita que algún grid/elemento empuje horizontalmente */
body[data-page="solicitud-viveres"] .card {
  overflow-x: hidden;
}

/* IMPORTANTE:
   En esta vista, grid-2 debe ser 2 columnas SIEMPRE.
   Si hay 3 campos dentro, el tercero baja a la siguiente fila
   (en vez de intentar 3 columnas y desbordar).
*/
body[data-page="solicitud-viveres"] .grid-2 {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

/* Asegura que los hijos puedan encoger (clave en grids/flex) */
body[data-page="solicitud-viveres"] .grid-2 > * {
  min-width: 0;
}

body[data-page="solicitud-viveres"] label,
body[data-page="solicitud-viveres"] input,
body[data-page="solicitud-viveres"] select,
body[data-page="solicitud-viveres"] textarea {
  min-width: 0;
  width: 100%;
}

/* Row de botón + status (Calcular despacho) */
body[data-page="solicitud-viveres"] .calc-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
  justify-content: flex-start;
  min-width: 0;
}

body[data-page="solicitud-viveres"] .calc-row .btn {
  flex: 0 0 auto;
}

body[data-page="solicitud-viveres"] .calc-row .muted {
  flex: 1 1 220px;
  min-width: 0;
}

/* En pantallas pequeñas: 1 columna */
@media (max-width: 900px) {
  body[data-page="solicitud-viveres"] .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* Si el header nav te produce overflow, asegúralo también */
body[data-page="solicitud-viveres"] .appbar nav {
  flex-wrap: wrap;
  min-width: 0;
}

/* =========================================================
   CALENDARIO (selección de días PUBLICADOS)
   - Acorde a paleta #0e553f
   - Estados: hover, selected, disabled, today
   - Responsive
   ========================================================= */

:root{
  --cal-bg: #f7f7f9;                 /* igual que section-body */
  --cal-surface: #ffffff;            /* tarjetas internas */
  --cal-border: rgba(0,0,0,.10);
  --cal-muted: var(--muted);
  --cal-primary: var(--primary);
  --cal-primary-ink: var(--primary-ink);
  --cal-primary-soft: rgba(14,85,63,.14);
  --cal-hover: rgba(14,85,63,.08);
}

/* Contenedor calendario */
.calendar-wrap{
  width: 100%;
  background: var(--cal-bg);
  border: 1px solid var(--cal-border);
  border-radius: 12px;
  padding: 10px;
}

/* Toolbar */
.calendar-toolbar{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  justify-content:space-between;
  margin-bottom:10px;
}

/* El título se ve como “badge” centrado */
.calendar-title{
  font-weight: 800;
  flex: 1 1 220px;
  text-align: center;
  min-width: 180px;
  padding: 6px 10px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid var(--cal-border);
}

/* Acciones derecha */
.calendar-actions{
  display:flex;
  gap:8px;
  justify-content:flex-end;
  flex-wrap:wrap;
}

/* Grilla 7 columnas */
.calendar-grid{
  display:grid;
  grid-template-columns: repeat(7, minmax(38px, 1fr));
  gap:8px;
}

/* Encabezado días */
.cal-dow{
  font-size: 12px;
  text-align: center;
  opacity: .85;
  padding: 6px 0;
  font-weight: 700;
  color: #0f172a;
}

/* Celda */
.cal-cell{
  border: 1px solid var(--cal-border);
  border-radius: 12px;
  padding: 8px 8px 7px;
  min-height: 62px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  cursor:pointer;
  user-select:none;
  background: var(--cal-surface);
  transition: transform .08s ease, background .12s ease, border-color .12s ease, box-shadow .12s ease;
  overflow: hidden;
}

.cal-cell:hover{
  background: var(--cal-hover);
}

/* Día (número) */
.cal-daynum{
  font-weight: 900;
  font-size: 14px;
  color: #0f172a;
}

/* etiqueta menú */
.cal-label{
  font-size: 11px;
  opacity: .85;
  line-height: 1.15;
  margin-top: 4px;
  color: #0f172a;
}

/* Deshabilitado */
.cal-cell.disabled{
  opacity: .40;
  cursor: not-allowed;
  background: rgba(0,0,0,.03);
}

.cal-cell.disabled:hover{
  background: rgba(0,0,0,.03);
  transform: none;
}

/* Seleccionado */
.cal-cell.selected{
  border-color: rgba(14,85,63,.55);
  background: var(--cal-primary-soft);
  box-shadow: 0 0 0 2px rgba(14,85,63,.18) inset;
}

/* Hoy (si el día existe en el mes) */
.cal-cell.today{
  border-color: rgba(14,85,63,.35);
  box-shadow: 0 0 0 1px rgba(14,85,63,.18) inset;
}

/* Badge mini dentro del día (opcional si luego lo usas) */
.cal-badge{
  display:inline-block;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(14,85,63,.12);
  color: var(--cal-primary);
  margin-top: 4px;
}

/* Info debajo */
#semanas-info{
  margin-top: 10px !important;
  font-size: 12px;
}

/* Responsive */
@media (max-width: 520px){
  .calendar-grid{ gap:6px; }
  .cal-cell{ min-height: 56px; padding: 7px; }
  .calendar-title{ flex: 1 1 100%; }
}

#tabla-items td.t-right,
#tabla-items th.t-right {
  text-align: center !important;
}

/* ===== VCT checklist estilo VEV Sede ===== */
.vct-checklist{
  display:grid;
  grid-template-columns:1fr;
  gap:14px;
}

.vct-item{
  display:grid;
  grid-template-columns:auto 1fr;
  gap:14px;
  align-items:start;
  padding:14px 16px;
  border:1px solid #d8dde6;
  border-radius:16px;
  background:#fff;
  box-shadow:0 1px 3px rgba(0,0,0,.04);
}

.vct-badge{
  width:34px;
  height:34px;
  border-radius:999px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#0f7c7a;
  color:#fff;
  font-weight:700;
  font-size:.95rem;
  flex-shrink:0;
  margin-top:2px;
}

.vct-content h4{
  margin:0 0 10px 0;
  font-size:1rem;
  line-height:1.45;
  font-weight:700;
  color:#0f172a;
}

.vct-answer label{
  display:block;
  margin-bottom:6px;
  font-size:.82rem;
  color:#334155;
}

.vct-answer select{
  width:100%;
}

@media (max-width: 768px){
  .vct-item{
    grid-template-columns:1fr;
  }

  .vct-badge{
    margin-bottom:4px;
  }
}


.preview-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(140px, 1fr));
  gap:12px;
  margin-top:12px;
}

.preview-item{
  background:#fff;
  border:1px solid #d8dde6;
  border-radius:12px;
  padding:10px;
}

/* Contenedor de botones del home */
.home-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  margin-top: 24px;
}

/* Todos los botones verdes iguales */
.home-actions .btn,
.home-actions button {
  width: 230px;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-sizing: border-box;
}

/* ===== FIX MOBILE VEV SEDE ===== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

#form-vev-sede,
#vev_items_wrap,
.vev-check-card,
.vev-check-body,
.vev-check-head,
.grid-2,
.vev-anexo-box,
.vev-anexo-table-wrap {
  min-width: 0;
}

#vev_items_wrap {
  width: 100%;
}

.vev-check-card {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border-radius: 14px;
}

.vev-check-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
}

.vev-check-num {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vev-check-title {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.vev-check-body {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
}

.grid-2 > label,
.grid-2 > div {
  min-width: 0;
  width: 100%;
}

.vev-check-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
}

#form-vev-sede input,
#form-vev-sede select,
#form-vev-sede textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 10px 12px;
  font-size: 16px;
  line-height: 1.2;
  border-radius: 10px;
}

.vev-anexo-box {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.vev-anexo-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.vev-anexo-table {
  min-width: 720px;
  border-collapse: collapse;
}

.vev-anexo-table input,
.vev-anexo-table select,
.vev-anexo-table textarea {
  min-width: 90px;
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {
  #form-vev-sede {
    padding-left: 10px;
    padding-right: 10px;
  }

  .vev-check-card {
    padding: 12px;
  }

  .vev-check-head {
    gap: 8px;
  }

  .vev-check-num {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    min-width: 28px;
    font-size: 13px;
  }

  .vev-check-title {
    font-size: 14px;
    line-height: 1.35;
  }

  .grid-2 {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .vev-check-label {
    font-size: 12px;
  }

  #form-vev-sede input,
  #form-vev-sede select,
  #form-vev-sede textarea {
    font-size: 16px;
  }

  .vev-anexo-box {
    margin-top: 10px;
  }
}

@media (max-width: 480px) {
  #form-vev-sede {
    padding-left: 8px;
    padding-right: 8px;
  }

  .vev-check-card {
    padding: 10px;
    border-radius: 12px;
  }

  .vev-check-title {
    font-size: 13px;
  }

  .vev-check-num {
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    min-width: 26px;
    font-size: 12px;
  }
}