/* ===================================================================
   Sistema de diseño — App de Mantenimiento Fongascal
   Paleta corporativa navy + gold, look de herramienta interna sobria.
   =================================================================== */
:root {
  --navy: #1B3A5C;
  --navy-700: #234b74;
  --navy-800: #14293f;
  --gold: #E8A020;
  --gold-600: #c9871a;
  --bg: #eef1f6;
  --card: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --line: #e4e9f0;
  --line-2: #d6dde5;
  --ok: #1f7a54;
  --err: #c0392b;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(16, 42, 67, 0.06);
  --shadow: 0 1px 2px rgba(16, 42, 67, 0.05), 0 6px 20px rgba(16, 42, 67, 0.07);
  --shadow-lg: 0 10px 40px rgba(16, 42, 67, 0.16);
  --font-display: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-body: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Consolas", "SF Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

/* Los controles de formulario, como ítems de grid/flex, tienen min-width:auto
   por defecto: un <select> con opciones largas (p. ej. "Alameda 38 - Torre
   Central…") o un input fuerza su ancho de contenido y se "sale" de la tarjeta
   en móvil. Con min-width:0 + max-width:100%, width:100% los mantiene dentro. */
input, select, textarea { min-width: 0; max-width: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---- Login ---- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(232,160,32,0.14), transparent 60%),
    linear-gradient(160deg, var(--navy) 0%, var(--navy-800) 100%);
  padding: 20px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  padding: 38px 34px 32px;
}
.brand { text-align: center; margin-bottom: 26px; }
.brand img { height: 46px; width: auto; }
.brand h1 {
  font-family: var(--font-display);
  color: var(--navy);
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: 0.5px;
}
.brand .sub { color: var(--muted); font-size: 0.85rem; margin-top: 8px; }
.brand .bar { height: 3px; width: 48px; background: var(--gold); border-radius: 4px; margin: 16px auto 0; }

/* Inputs base (login usa estos; el resto de la app usa .campo) */
label { display: block; font-size: 0.85rem; color: var(--muted); margin: 16px 0 6px; font-weight: 500; }
input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: var(--font-body);
  color: var(--text);
}
input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(27,58,92,0.14); }

button.primary {
  width: 100%;
  margin-top: 24px;
  padding: 13px;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
button.primary:hover { background: var(--navy-800); }
button.primary:disabled { opacity: 0.6; cursor: default; }

.msg { margin-top: 14px; font-size: 0.88rem; min-height: 1.2em; }
.msg.error { color: var(--err); }
.msg.ok { color: var(--ok); }

/* ---- Dashboard (placeholder) ---- */
.topbar {
  background: var(--navy);
  color: #fff;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar .title { font-family: var(--font-display); font-weight: 600; }
.topbar .title .accent { color: var(--gold); }
.topbar button {
  background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.4);
  border-radius: 6px; padding: 6px 12px; cursor: pointer;
}
.container { max-width: 900px; margin: 28px auto; padding: 0 20px; }
.container--ancho { max-width: 1180px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 22px 24px;
  margin-bottom: 18px;
}
.card > h2:first-child, .card > h3:first-child {
  margin-top: 0;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.card > h2:first-child::before, .card > h3:first-child::before {
  content: "";
  display: inline-block;
  width: 4px; height: 0.95em;
  background: var(--gold);
  border-radius: 2px;
  margin-right: 10px;
  vertical-align: -2px;
}
.card h2, .card h3 { color: var(--navy); font-family: var(--font-display); font-weight: 650; }
.mono { font-family: var(--font-mono); }

/* Cabecera de página (título + acciones) */
.page-header {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin: 4px 0 20px;
}
.page-header h1 {
  margin: 0; color: var(--navy); font-family: var(--font-display);
  font-size: 1.5rem; font-weight: 700; letter-spacing: -0.01em;
}
.page-header .sub { color: var(--muted); font-size: 0.92rem; margin: 4px 0 0; }
.page-header .spacer { margin-left: auto; }

/* Estado vacío / texto atenuado */
.empty { color: var(--muted); text-align: center; padding: 26px 12px; font-size: 0.92rem; }
.txt-muted { color: var(--muted); }

/* Icono en línea (SVG stroke) */
.ico { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; flex-shrink: 0; }
.ico-lg { width: 26px; height: 26px; }

/* Pill base */
.pill {
  display: inline-block; padding: 3px 11px; border-radius: 999px;
  font-size: 0.76rem; font-weight: 600; letter-spacing: 0.01em;
  background: rgba(232,160,32,0.16); color: #8a5b00;
}

/* Logo dentro de la barra de navegación */
.topnav-marca img { height: 28px; width: auto; display: block; }

/* =======================================================================
   COMPONENTES COMPARTIDOS (usados por todas las páginas de la app)
   ======================================================================= */

/* ---- Barra de navegación superior (nav.js) ---- */
.topnav {
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 24px;
  min-height: 60px;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--gold);
  box-shadow: var(--shadow-sm);
}
.topnav-marca {
  font-family: var(--font-display);
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  margin-right: 22px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}
.topnav-marca .accent { color: var(--gold); }
.topnav-toggle {
  display: none;
  margin-left: auto;
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 6px;
  font-size: 1.1rem;
  line-height: 1;
  padding: 6px 10px;
  cursor: pointer;
}
.topnav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.nav-link {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.92rem;
  transition: background 0.15s, color 0.15s;
}
.nav-link:hover { background: rgba(255,255,255,0.12); color: #fff; }
.nav-link.activo {
  color: #fff;
  font-weight: 600;
  box-shadow: inset 0 -3px 0 var(--gold);
}
.btn-salir {
  margin-left: 10px;
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 6px;
  padding: 7px 14px;
  cursor: pointer;
  font-size: 0.9rem;
}
.btn-salir:hover { background: rgba(255,255,255,0.12); }

/* ---- Botones reutilizables ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
  background: #eef2f6;
  color: var(--navy);
}
.btn:hover { background: #e2e9f0; }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-800); }
.btn-danger { background: var(--err); color: #fff; }
.btn-danger:hover { background: #a2301f; }
.btn-ghost {
  background: transparent;
  color: var(--navy);
  border-color: #cdd7e1;
}
.btn-ghost:hover { background: #eef2f6; }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; border-radius: 6px; }

/* ---- Tabla ---- */
.tabla {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  font-size: 0.9rem;
}
.tabla thead th {
  background: var(--navy);
  color: #fff;
  text-align: left;
  font-weight: 600;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 11px 14px;
  white-space: nowrap;
}
.tabla thead th:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.tabla tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}
.tabla tbody tr:nth-child(even) { background: #fafbfd; }
.tabla tbody tr:hover { background: #eef3f9; }
.tabla tbody tr:last-child td { border-bottom: none; }

/* ---- Formularios ---- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 16px;
}
.form-grid .campo-full { grid-column: 1 / -1; }
.campo { display: flex; flex-direction: column; min-width: 0; }
.campo label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0 0 6px;
}
.campo input,
.campo select,
.campo textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d6dde5;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: var(--font-body);
  background: #fff;
  color: var(--text);
}
.campo textarea { min-height: 84px; resize: vertical; }
.campo input:focus,
.campo select:focus,
.campo textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(27,58,92,0.12);
}

/* ---- Pestañas ---- */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid #e2e9f0;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.tab {
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  font-family: var(--font-body);
}
.tab:hover { color: var(--navy); }
.tab.activo { color: var(--navy); border-bottom-color: var(--gold); }

/* ---- Tarjeta con barra lateral (variante gold) ---- */
.card--gold { border-left: 4px solid var(--gold); }

/* ---- Pills por estado de parte ---- */
.pill-agendado           { background: rgba(107,120,133,0.16); color: #4a5560; }
.pill-en_curso           { background: rgba(52,120,208,0.16);  color: #1f5fa8; }
.pill-pendiente_revision { background: rgba(232,160,32,0.20);  color: #8a5b00; }
.pill-aprobado           { background: rgba(46,125,91,0.16);   color: #1f6b48; }
.pill-rechazado          { background: rgba(192,57,43,0.15);   color: #a2301f; }

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20,41,63,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}
.modal {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
}
.modal h2, .modal h3 { margin-top: 0; color: var(--navy); font-family: var(--font-display); }

/* ---- Mensajes ---- */
.mensaje {
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin: 12px 0;
}
.mensaje-error { background: rgba(192,57,43,0.10); color: var(--err); border: 1px solid rgba(192,57,43,0.30); }
.mensaje-ok    { background: rgba(46,125,91,0.10); color: var(--ok);  border: 1px solid rgba(46,125,91,0.30); }

/* ---- Botón flotante (acción principal en móvil) ---- */
.fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy-800);
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  box-shadow: 0 6px 20px rgba(27,58,92,0.30);
  cursor: pointer;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fab:hover { filter: brightness(1.05); }

/* =======================================================================
   CALENDARIO (calendario.html / calendario.js)
   ======================================================================= */

/* Contenedor más ancho para que quepa la rejilla del mes. */
.container--ancho { max-width: 1100px; }

/* Cabecera: navegación de mes + título. */
.cal-cabecera {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.cal-titulo {
  margin: 0;
  color: var(--navy);
  font-family: var(--font-display);
  font-size: 1.35rem;
  min-width: 200px;
}
.cal-cabecera #cal-hoy { margin-left: auto; }

/* Rejilla del mes (vista escritorio). */
.cal-rejilla-wrap {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.cal-cabecera-dias,
.cal-rejilla {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}
.cal-cabecera-dias { background: var(--navy); }
.cal-dia-cab {
  color: #fff;
  font-weight: 600;
  font-size: 0.82rem;
  text-align: center;
  padding: 9px 4px;
}
.cal-celda {
  border-right: 1px solid #e7ecf1;
  border-bottom: 1px solid #e7ecf1;
  min-height: 108px;
  padding: 5px 6px 7px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
/* Última columna y última fila sin borde sobrante. */
.cal-rejilla .cal-celda:nth-child(7n) { border-right: none; }
.cal-celda--vacia { background: #fafbfc; }
.cal-celda--hoy { background: rgba(232,160,32,0.10); }
.cal-celda-num {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  align-self: flex-end;
}
.cal-celda--hoy .cal-celda-num {
  color: var(--navy);
  background: var(--gold);
  border-radius: 999px;
  min-width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}
.cal-celda-partes {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}

/* Etiqueta (chip) de un parte, clicable. */
.cal-parte {
  display: block;
  text-decoration: none;
  background: #f4f6f9;
  border: 1px solid #e2e9f0;
  border-left: 3px solid var(--navy);
  border-radius: 6px;
  padding: 4px 6px;
  transition: background 0.12s, border-color 0.12s;
}
.cal-parte:hover { background: #eaeff5; border-left-color: var(--gold); }
.cal-parte .pill { font-size: 0.68rem; padding: 1px 7px; }
.cal-parte-cod {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-parte-hora { color: var(--muted); font-weight: 600; }
.cal-parte-ubic {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Lista por día (solo móvil). */
.cal-lista { display: none; }
.cal-lista-dia { padding: 14px 16px; margin-bottom: 12px; }
.cal-lista-dia-cab {
  font-weight: 600;
  color: var(--navy);
  font-family: var(--font-display);
  margin-bottom: 10px;
  text-transform: capitalize;
}
.cal-hoy-etq {
  background: var(--gold);
  color: var(--navy-800);
  border-radius: 999px;
  padding: 1px 9px;
  font-size: 0.72rem;
  font-weight: 600;
  margin-left: 6px;
}
.cal-lista-items { display: flex; flex-direction: column; gap: 8px; }
.cal-lista-items .cal-parte { padding: 8px 10px; }

/* Partes sin fecha. */
.cal-sin-fecha { margin-top: 18px; }
.cal-sin-fecha h2 { margin-top: 0; color: var(--navy); font-family: var(--font-display); }

/* ---- Responsive (móvil primero para operarios) ---- */
@media (max-width: 640px) {
  .topnav-toggle { display: inline-block; }
  .topnav-links {
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    margin-left: 0;
    padding-bottom: 8px;
  }
  .topnav-links.abierto { display: flex; }
  .nav-link { padding: 10px 12px; }
  .btn-salir { margin: 8px 0 0; width: 100%; }
  .form-grid { grid-template-columns: 1fr; }

  /* Menos margen lateral desperdiciado + tarjetas más compactas. */
  .container { margin: 14px auto; padding: 0 14px; }
  .card { padding: 16px 14px; }

  /* Inputs a 16px: evita el zoom automático de iOS al enfocar un campo (la
     causa más habitual de que un formulario "se vea raro" en el móvil). */
  input, select, textarea { font-size: 16px !important; }

  .tabla { font-size: 0.86rem; }
  .tabla thead th, .tabla tbody td { padding: 8px 9px; }

  /* Cabecera de página y títulos de sección más contenidos (menos "zoom"). */
  .page-header { margin: 2px 0 14px; }
  .page-header h1 { font-size: 1.25rem; }
  .page-header .sub { font-size: 0.88rem; }
  .card > h2:first-child, .card > h3:first-child { font-size: 1.08rem; margin-bottom: 12px; padding-bottom: 10px; }
  .cab-seccion h2, .cab-seccion h3 { font-size: 1.05rem; }
  label, .campo label { margin-top: 10px; }

  /* Áreas de toque más cómodas con el dedo. */
  .btn-sm { padding: 9px 14px; font-size: 0.9rem; }
  .link-accion { display: inline-block; padding: 5px 3px; }
  .acciones-parte .btn, .detalle-acciones .btn { flex: 1 1 46%; }

  /* Modal casi a pantalla completa (más sitio para formularios). */
  .modal-overlay { padding: 10px; }
  .modal { padding: 18px; max-height: 94vh; }

  /* En móvil la rejilla es incómoda: mostramos lista por día. */
  .cal-rejilla-wrap { display: none; }
  .cal-lista { display: block; }
  .cal-titulo { font-size: 1.15rem; min-width: 0; }
  .cal-cabecera #cal-hoy { margin-left: 0; }
}

/* =======================================================================
   GESTIÓN (gestion.html / gestion.js) — clases de apoyo, aditivas.
   Reutiliza .container--ancho, .tabs, .tabla, .form-grid, .modal, .pill…
   ======================================================================= */
.cab-seccion {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.cab-seccion h2, .cab-seccion h3 {
  margin: 0;
  color: var(--navy);
  font-family: var(--font-display);
  margin-right: auto;
}

.filtros {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.filtros .campo { min-width: 200px; flex: 1 1 200px; }
.filtros select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d6dde5;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: var(--font-body);
  background: #fff;
  color: var(--text);
}
.filtros select:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(27,58,92,0.12);
}

.tabla-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); }

.celda-vacia { color: var(--muted); text-align: center; padding: 22px 12px; }

.acc-fila { display: flex; gap: 6px; flex-wrap: wrap; }

.modal-acciones {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.ayuda { color: var(--muted); font-size: 0.85rem; margin: 4px 0 12px; }

/* ---- Detalle (modal de solo lectura) ---- */
.det-datos {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px 18px;
  margin-bottom: 6px;
}
.det-fila { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.det-k { color: var(--muted); }
.det-v { color: var(--text); font-weight: 500; text-align: right; }
.det-h {
  color: var(--navy); font-family: var(--font-display); font-size: 0.95rem;
  margin: 18px 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--gold); display: inline-block;
}
.det-sub { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.det-sub strong { color: var(--navy); }
.det-lista { margin: 8px 0 0; padding-left: 18px; }
.det-lista li { font-size: 0.9rem; margin: 2px 0; }
.det-tabla { box-shadow: none; border: 1px solid var(--line); margin-bottom: 6px; }
@media (max-width: 640px) { .det-datos { grid-template-columns: 1fr; } }

/* =======================================================================
   GESTIÓN v2 — dashboard, subnav, switch, cliente/ubicación
   ======================================================================= */
.gestion-subnav {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin: 4px 0 20px; padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.gsub-link {
  text-decoration: none; color: var(--muted); font-weight: 600; font-size: 0.92rem;
  padding: 8px 16px; border-radius: 8px;
}
.gsub-link:hover { background: #eef2f6; color: var(--navy); }
.gsub-link.activo { background: var(--navy); color: #fff; }
.gsub-sep { flex: 1; }
.gsub-volver { color: var(--navy); text-decoration: none; font-weight: 600; font-size: 0.9rem; padding: 8px 4px; }
.gsub-volver:hover { text-decoration: underline; }

/* Tarjetas de acceso del dashboard de gestión */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 8px; }
.dash-card {
  display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--gold);
  border-radius: 12px; padding: 18px 20px; box-shadow: var(--shadow-sm);
  transition: transform .12s, box-shadow .12s;
}
.dash-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.dash-card .ico { width: 26px; height: 26px; stroke: var(--navy); }
.dash-card .dc-t { font-family: var(--font-display); font-weight: 650; color: var(--navy); font-size: 1.05rem; }
.dash-card .dc-s { color: var(--muted); font-size: 0.85rem; }

/* Switch activo/inactivo (verde/rojo) */
.switch { position: relative; display: inline-block; width: 46px; height: 24px; vertical-align: middle; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; cursor: pointer; inset: 0; background: var(--err); border-radius: 999px; transition: .18s; }
.switch .slider::before { content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .18s; }
.switch input:checked + .slider { background: var(--ok); }
.switch input:checked + .slider::before { transform: translateX(22px); }
.switch-txt { font-size: 0.82rem; font-weight: 600; margin-left: 8px; vertical-align: middle; }

/* Fila de cliente clicable */
.fila-click { cursor: pointer; }
.fila-click td.nombre-cel { color: var(--navy); font-weight: 600; }

/* Cabecera de cliente / empleado */
.entidad-cab { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 4px; }
.entidad-cab .avatar {
  width: 46px; height: 46px; border-radius: 12px; background: rgba(27,58,92,0.10); color: var(--navy);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.05rem; flex-shrink: 0;
}
.entidad-cab h1 { margin: 0; }

/* Selector de ubicaciones (chips) */
.ubi-selector { display: flex; flex-wrap: wrap; gap: 8px; }
.ubi-chip {
  border: 1px solid var(--line-2); background: #fff; color: var(--navy);
  border-radius: 999px; padding: 8px 16px; font-size: 0.9rem; font-weight: 600; cursor: pointer;
}
.ubi-chip:hover { background: #eef2f6; }
.ubi-chip.activo { background: var(--navy); color: #fff; border-color: var(--navy); }

/* Avisos del dashboard */
.aviso { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.aviso:last-child { border-bottom: none; }
.aviso .num { min-width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.aviso .num.warn { background: rgba(232,160,32,.18); color: #8a5b00; }
.aviso .num.err { background: rgba(192,57,43,.14); color: var(--err); }

/* Enlaces de acción en tablas de partes */
.link-accion { color: var(--navy); font-weight: 600; text-decoration: none; cursor: pointer; }
.link-accion:hover { text-decoration: underline; }

/* Línea de próximo preventivo */
.prev-linea { margin-top: 12px; font-size: 0.95rem; color: var(--text); }

.campo-check label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 0.92rem;
  margin: 0;
}
.campo-check input { width: auto; }

.ubi-revision {
  border: 1px solid #e2e9f0;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}

/* Equipos detectados en la revisión del contrato: cada uno en su tarjeta, numerado. */
#ex-equipos { counter-reset: eq-count; margin-top: 8px; }
.eq-revision {
  border: 1px solid #e2e9f0;
  border-radius: 8px;
  padding: 12px 14px 6px;
  margin-bottom: 14px;
  background: #f9fbfd;
  counter-increment: eq-count;
}
.eq-revision::before {
  content: "Equipo " counter(eq-count);
  display: block;
  font-weight: 700;
  color: var(--navy);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}
.eq-revision .form-grid { gap: 10px 16px; }

.items-card { margin-top: 20px; }

/* =======================================================================
   CALENDARIO SEMANAL (calendario.html / calendario.js)
   ======================================================================= */
.cal-nav { display: flex; gap: 8px; align-items: center; }

.cal-semana {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}
.cal-dia {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  min-height: 320px;
  overflow: hidden;
}
.cal-dia--hoy { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), var(--shadow-sm); }
.cal-dia-cab {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: #f7f9fc;
  position: relative;
}
.cal-dia--hoy .cal-dia-cab { background: rgba(232,160,32,0.12); }
.cal-dia-nom { font-weight: 700; color: var(--navy); font-size: 0.82rem; font-family: var(--font-display); }
.cal-dia-num { font-size: 0.74rem; color: var(--muted); }
.cal-dia-cont {
  position: absolute; top: 8px; right: 9px;
  background: var(--navy); color: #fff;
  font-size: 0.68rem; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 5px;
}
.cal-dia-body {
  padding: 8px;
  display: flex; flex-direction: column; gap: 7px;
  overflow-y: auto;
  max-height: 62vh;
  flex: 1;
}
.cal-dia-vacio { color: #cbd4de; text-align: center; padding: 8px 0; font-size: 0.9rem; }

/* Chip de parte (compartido con la lista sin fecha) */
.cal-parte {
  display: block; text-decoration: none;
  background: #f4f6f9; border: 1px solid var(--line);
  border-left: 3px solid var(--navy);
  border-radius: 6px; padding: 6px 8px;
  transition: background 0.12s, border-color 0.12s, transform 0.12s;
}
.cal-parte:hover { background: #eaeff5; border-left-color: var(--gold); transform: translateY(-1px); }
.cal-parte .pill { font-size: 0.66rem; padding: 1px 8px; }
.cal-parte-cod {
  display: block; font-family: var(--font-mono); font-size: 0.76rem;
  color: var(--text); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-parte-hora { color: var(--navy); font-weight: 700; }
.cal-parte-ubic {
  display: block; font-size: 0.72rem; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-sin-fecha { margin-top: 18px; }
.cal-sinfecha-items { display: flex; flex-wrap: wrap; gap: 8px; }
.cal-sinfecha-items .cal-parte { flex: 1 1 220px; max-width: 300px; }

@media (max-width: 900px) {
  .cal-semana { grid-template-columns: 1fr; gap: 8px; }
  .cal-dia { min-height: 0; }
  .cal-dia-body { max-height: none; }
}

@media (max-width: 640px) {
  .filtros { flex-direction: column; }
  .filtros .campo { min-width: 0; }
}
