/* =========================================================
   RAMOS UI ÚNICO · V1
   Generado desde todos los HTML principales.
   - Los estilos antiguos quedan escopados por página: body.ramos-page-...
   - El bloque común final unifica botones, topbar, cards, inputs, paneles, etc.
   - No modifica JavaScript, Firebase, Firestore, Storage ni lógica interna.
   ========================================================= */

/* ===== SKELETON LOADERS (global, todos los módulos) ===== */
@keyframes sk-shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}
.sk-line {
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    var(--soft, #f1f5f9) 25%,
    var(--line, #e2e8f0) 50%,
    var(--soft, #f1f5f9) 75%
  );
  background-size: 600px 100%;
  animation: sk-shimmer 1.5s ease-in-out infinite;
}
.sk-card {
  background: var(--card, #fff);
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 1rem;
  padding: 1rem 1.1rem;
}
.sk-card .sk-line { margin-bottom: 8px; height: 11px; }
.sk-card .sk-line:last-child { margin-bottom: 0; }

/* ===== UPDATE BANNER (global, todos los módulos) ===== */
/* ===== UPDATE MODAL (centrado, compatible con Dynamic Island) ===== */
#ramos-update-banner {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(0,0,0,.45);
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
#ramos-update-banner.ramos-update-visible {
  display: flex;
}
#ramos-update-banner .ramos-update-card {
  background: #fff;
  border-radius: 1.1rem;
  box-shadow: 0 8px 40px rgba(0,0,0,.22);
  padding: 1.75rem 1.5rem 1.4rem;
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  text-align: center;
}
#ramos-update-banner .ramos-update-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: #dbeafe;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
#ramos-update-banner .ramos-update-icon svg {
  width: 22px; height: 22px;
  stroke: #1d4ed8;
}
#ramos-update-banner .ramos-update-title {
  font-size: 1rem;
  font-weight: 800;
  color: #111;
  margin: 0;
}
#ramos-update-banner .ramos-update-body {
  font-size: .83rem;
  color: #555;
  margin: 0;
  line-height: 1.45;
}
#ramos-update-banner .ramos-update-actions {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  width: 100%;
  margin-top: .25rem;
}
#ramos-update-btn {
  width: 100%;
  padding: .7rem 1rem;
  border-radius: .6rem;
  border: none;
  background: #1d4ed8;
  color: #fff;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
#ramos-update-btn:hover { background: #1e40af; }
#ramos-update-dismiss {
  width: 100%;
  padding: .55rem 1rem;
  border-radius: .6rem;
  border: 1.5px solid #e5e7eb;
  background: transparent;
  color: #666;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
#ramos-update-dismiss:hover { background: #f3f4f6; }

/* ===== OFFLINE BANNER (global, todos los módulos) ===== */
#ramos-offline-banner {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 10000;
  background: #1e293b;
  color: #f8fafc;
  font-size: .85rem;
  font-weight: 500;
  text-align: center;
  padding: .55rem 1rem;
  gap: .5rem;
  align-items: center;
  justify-content: center;
  box-shadow: 0 -2px 12px rgba(0,0,0,.25);
}
#ramos-offline-banner.ramos-offline-visible {
  display: flex;
}
#ramos-offline-banner svg {
  flex-shrink: 0;
  width: 16px; height: 16px;
  stroke: #f8fafc;
}

/* ===== EMPTY STATE EN LISTAS (global) ===== */
.ramos-list-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  padding: 2.5rem 1rem;
  color: var(--muted, #94a3b8);
  font-size: .88rem;
  text-align: center;
}
.ramos-list-empty svg {
  width: 40px; height: 40px;
  stroke: var(--line, #cbd5e1);
  stroke-width: 1.5;
}
.ramos-list-empty p { margin: 0; line-height: 1.5; }

/* ===== ERROR STATE EN LISTAS (global) ===== */
.ramos-list-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  padding: 2.5rem 1rem;
  color: var(--muted, #64748b);
  font-size: .9rem;
  text-align: center;
}
.ramos-list-error svg {
  width: 36px; height: 36px;
  stroke: var(--muted, #94a3b8);
  stroke-width: 1.5;
}
.ramos-list-error p { margin: 0; line-height: 1.5; }
.ramos-list-error button {
  margin-top: .25rem;
  padding: .4rem 1.1rem;
  border-radius: .5rem;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--accent, #3b82f6);
  color: var(--accent, #3b82f6);
  background: transparent;
  transition: background .15s, color .15s;
}
.ramos-list-error button:hover {
  background: var(--accent, #3b82f6);
  color: #fff;
}

/* ===== RAMOS CONFIRM MODAL (global, todos los módulos) ===== */
#ramos-confirm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10100; /* Mayor que ppx-overlay (9999) para aparecer encima del modal de pedido */
  background: rgba(15, 23, 42, .52);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

#ramos-confirm-overlay.ramos-confirm-active {
  display: flex;
}

.ramos-confirm-card {
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--card, #fff);
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 1.5rem;
  padding: 1.5rem;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .22);
  animation: ramos-confirm-in .18s ease;
}

@keyframes ramos-confirm-in {
  from { opacity: 0; transform: scale(.93) translateY(8px); }
  to   { opacity: 1; transform: scale(1)  translateY(0);    }
}

.ramos-confirm-msg {
  font-size: .875rem;
  font-weight: 700;
  color: var(--text, #0f172a);
  line-height: 1.55;
  margin: 0 0 1.25rem;
  white-space: pre-wrap;
}

.ramos-confirm-btns {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.ramos-confirm-cancel {
  padding: .6rem 1.1rem;
  border: 1px solid var(--line, #e2e8f0);
  background: var(--soft, #f8fafc);
  color: var(--muted, #64748b);
  border-radius: 999px;
  font-family: inherit;
  font-size: .8rem;
  font-weight: 800;
  cursor: pointer;
  transition: background .12s;
}
.ramos-confirm-cancel:hover { background: var(--line, #e2e8f0); }

.ramos-confirm-ok {
  padding: .6rem 1.1rem;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: .8rem;
  font-weight: 800;
  cursor: pointer;
  color: #fff;
  transition: background .12s;
}

.ramos-confirm-danger          { background: #dc2626; }
.ramos-confirm-danger:hover    { background: #b91c1c; }
.ramos-confirm-primary         { background: #2563eb; }
.ramos-confirm-primary:hover   { background: #1d4ed8; }

/* Contenido extra del confirm (textarea, checkboxes, etc.) */
#ramos-confirm-extra textarea,
#ramos-confirm-extra input[type="text"],
#ramos-confirm-extra input[type="number"] {
  width: 100%;
  padding: .6rem .9rem;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: .75rem;
  background: var(--soft, #f8fafc);
  color: var(--text, #0f172a);
  font-family: inherit;
  font-size: .875rem;
  font-weight: 600;
  resize: none;
  outline: none;
  box-sizing: border-box;
}
#ramos-confirm-extra textarea:focus,
#ramos-confirm-extra input[type="text"]:focus {
  border-color: #94a3b8;
  background: #fff;
}
#ramos-confirm-extra label {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .8125rem;
  font-weight: 700;
  color: var(--text, #0f172a);
  cursor: pointer;
  user-select: none;
}
#ramos-confirm-extra input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: #f59e0b;
  cursor: pointer;
  flex-shrink: 0;
}


/* =========================================================
   ESTILOS ORIGINALES ESCOPADOS · CALIDAD
   ========================================================= */

:root {
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --soft: #f8fafc;
  --primary: #2563eb;
  --green: #16a34a;
  --amber: #d97706;
  --red: #dc2626;
  --shadow: 0 14px 34px rgba(15, 23, 42, .08);
}

body.ramos-page-calidad.dark {
  --bg: #0f172a;
  --card: #172033;
  --text: #eff6ff;
  --muted: #94a3b8;
  --line: rgba(255, 255, 255, .10);
  --soft: #111827;
  --primary: #38bdf8;
  --shadow: 0 14px 34px rgba(0, 0, 0, .24);
}

body.ramos-page-calidad * {
  box-sizing: border-box;
}

body.ramos-page-calidad {
  margin: 0;
  font-family: "Plus Jakarta Sans", sans-serif;
  background:
    radial-gradient(circle at 0% 0%, rgba(37, 99, 235, .12), transparent 32%),
    radial-gradient(circle at 100% 0%, rgba(37, 99, 235, .10), transparent 30%),
    var(--bg);
  color: var(--text);
  touch-action: manipulation;
}

@supports (padding: max(0px)) {
  body.ramos-page-calidad {
    padding-top: env(safe-area-inset-top);
  }
}

body.ramos-page-calidad .hidden {
  display: none !important;
}

body.ramos-page-calidad .loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

body.ramos-page-calidad.dark .loader {
  background: #0f172a;
}

body.ramos-page-calidad .spinner {
  width: 38px;
  height: 38px;
  border: 4px solid #2563eb;
  border-top-color: transparent;
  border-radius: 999px;
  animation: spin .75s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

body.ramos-page-calidad .glass {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(15, 23, 42, .06);
  box-shadow: 0 10px 30px rgba(15, 23, 42, .055);
}

body.ramos-page-calidad.dark .glass {
  background: rgba(15, 23, 42, .90);
  border-color: rgba(255, 255, 255, .08);
}

body.ramos-page-calidad .shell {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 0 16px;
}

body.ramos-page-calidad .topbar {
  min-height: 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

body.ramos-page-calidad .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

body.ramos-page-calidad .brand-logo {
  height: 36px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

body.ramos-page-calidad .back-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 950;
  flex-shrink: 0;
}

body.ramos-page-calidad.dark .back-btn {
  background: rgba(255, 255, 255, .08);
  color: #e2e8f0;
}

body.ramos-page-calidad .role-badge {
  font-size: 9px;
  font-weight: 950;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: .12em;
  margin: 0 0 2px;
}

body.ramos-page-calidad h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 950;
  letter-spacing: -.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.ramos-page-calidad .top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

body.ramos-page-calidad .main {
  padding: 10px 0 34px;
  display: grid;
  gap: 10px;
}

/* Header principal igualado al estilo de Reprocesos */
body.ramos-page-calidad .hero {
  background:
    radial-gradient(circle at 0% 0%, rgba(37, 99, 235, .22), transparent 36%),
    linear-gradient(135deg, #0f172a 0%, #1e293b 52%, #1d4ed8 100%);
  color: white;
  border-radius: 32px;
  padding: 20px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .18);
  position: relative;
  overflow: hidden;
}

body.ramos-page-calidad .hero:after {
  content: "";
  position: absolute;
  right: -80px;
  top: -90px;
  width: 230px;
  height: 230px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
}

body.ramos-page-calidad .hero>* {
  position: relative;
  z-index: 1;
}

body.ramos-page-calidad .hero-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: stretch;
  justify-content: space-between;
}

@media (min-width: 1200px) {
  body.ramos-page-calidad .hero-grid {
    flex-direction: row;
    align-items: center;
  }
}

body.ramos-page-calidad .hero-kicker {
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: #bfdbfe;
  margin: 0;
}

body.ramos-page-calidad .hero-title {
  font-size: clamp(24px, 3vw, 30px);
  line-height: 1.05;
  margin: 4px 0 8px;
  font-weight: 950;
  letter-spacing: -.045em;
}

body.ramos-page-calidad .hero-text {
  margin: 0;
  max-width: 760px;
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
}

body.ramos-page-calidad .kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: min(640px, 100%);
}

@media (min-width: 760px) {
  body.ramos-page-calidad .kpi-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

body.ramos-page-calidad .kpi-box {
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 18px;
  padding: 12px;
  min-width: 0;
}

body.ramos-page-calidad .kpi-label {
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .10em;
  color: #bfdbfe;
  margin: 0;
  line-height: 1.15;
  min-height: 22px;
}

body.ramos-page-calidad .kpi-value {
  font-size: 26px;
  font-weight: 950;
  letter-spacing: -.04em;
  margin: 4px 0 0;
  line-height: 1;
}

body.ramos-page-calidad .layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

body.ramos-page-calidad .sidebar {
  position: sticky;
  top: calc(env(safe-area-inset-top) + 84px);
  align-self: start;
}

body.ramos-page-calidad .side-card,
body.ramos-page-calidad .card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

body.ramos-page-calidad .side-card {
  padding: 14px;
}

body.ramos-page-calidad .side-title {
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin: 0 0 12px;
  padding: 0 4px;
}

body.ramos-page-calidad .side-nav {
  display: grid;
  gap: 8px;
}

body.ramos-page-calidad .side-btn {
  width: 100%;
  min-height: 58px;
  justify-content: flex-start;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
  cursor: pointer;
  font-family: inherit;
  transition: transform .12s ease, filter .12s ease, background .12s ease;
}

body.ramos-page-calidad .side-btn:hover {
  transform: translateY(-1px);
}

body.ramos-page-calidad .side-btn.active {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
}

body.ramos-page-calidad.dark .side-btn.active {
  background: #38bdf8;
  color: #0f172a;
  border-color: #38bdf8;
}

body.ramos-page-calidad .side-icon {
  width: 34px;
  height: 34px;
  border-radius: 14px;
  background: rgba(37, 99, 235, .10);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 15px;
}

body.ramos-page-calidad .side-btn.active .side-icon {
  background: rgba(255, 255, 255, .16);
}

body.ramos-page-calidad.dark .side-btn.active .side-icon {
  background: rgba(15, 23, 42, .12);
}

body.ramos-page-calidad .side-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

body.ramos-page-calidad .side-text strong {
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .05em;
  line-height: 1.1;
}

body.ramos-page-calidad .side-text small {
  font-size: 9px;
  font-weight: 850;
  color: var(--muted);
  text-transform: none;
  letter-spacing: .02em;
  line-height: 1.1;
}

body.ramos-page-calidad .side-btn.active small {
  color: inherit;
  opacity: .72;
}

body.ramos-page-calidad .section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 250, 252, .72);
}

body.ramos-page-calidad.dark .section-head {
  background: rgba(255, 255, 255, .03);
}

body.ramos-page-calidad .section-kicker {
  margin: 0;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--primary);
}

body.ramos-page-calidad .section-title {
  margin: 3px 0 0;
  font-size: 20px;
  font-weight: 950;
  letter-spacing: -.035em;
}

body.ramos-page-calidad .section-help {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

body.ramos-page-calidad .btn {
  border: 0;
  border-radius: 16px;
  padding: 13px 16px;
  min-height: 44px;
  font-family: inherit;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease, filter .12s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

body.ramos-page-calidad .btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

body.ramos-page-calidad .btn:active {
  transform: scale(.965);
  filter: brightness(.96);
}

body.ramos-page-calidad .btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
}

body.ramos-page-calidad .btn-primary {
  background: #2563eb;
  color: white;
  box-shadow: 0 10px 24px rgba(37, 99, 235, .18);
}

body.ramos-page-calidad .btn-dark {
  background: #0f172a;
  color: white;
}

body.ramos-page-calidad .btn-soft {
  background: var(--soft);
  color: var(--text);
  border: 1px solid var(--line);
}

body.ramos-page-calidad .btn-green {
  background: #16a34a;
  color: white;
}

body.ramos-page-calidad .btn-red {
  background: #dc2626;
  color: white;
}

body.ramos-page-calidad .toolbar {
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(150px, 190px));
  gap: 10px;
  align-items: end;
  border-bottom: 1px solid var(--line);
}

body.ramos-page-calidad label {
  display: grid;
  gap: 7px;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}

body.ramos-page-calidad .input,
body.ramos-page-calidad .select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--soft);
  border-radius: 16px;
  padding: 13px 14px;
  outline: none;
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  color: var(--text);
  min-height: 46px;
}

body.ramos-page-calidad .input:focus,
body.ramos-page-calidad .select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .10);
  background: var(--card);
}

body.ramos-page-calidad .content-pad {
  padding: 16px;
}

body.ramos-page-calidad .preventivo-group {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

body.ramos-page-calidad .preventivo-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  background: rgba(248, 250, 252, .72);
  border-radius: 18px;
  padding: 11px 14px;
  color: var(--text);
}

body.ramos-page-calidad.dark .preventivo-group-head {
  background: rgba(255, 255, 255, .035);
}

body.ramos-page-calidad .preventivo-group-title {
  margin: 0;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--primary);
}

body.ramos-page-calidad .preventivo-group-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  white-space: nowrap;
}

body.ramos-page-calidad.dark .preventivo-group-count {
  background: rgba(59, 130, 246, .16);
  color: #bfdbfe;
  border-color: rgba(59, 130, 246, .28);
}


body.ramos-page-calidad .equipment-list {
  display: grid;
  gap: 10px;
}


body.ramos-page-calidad .preventivo-group-row {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .045);
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 70px minmax(180px, 1.2fr) minmax(150px, .85fr) minmax(150px, .85fr) minmax(120px, .65fr) 120px;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  transition: transform .12s ease, filter .12s ease;
}

body.ramos-page-calidad .preventivo-group-row:hover {
  transform: translateY(-1px);
  filter: brightness(1.01);
}

body.ramos-page-calidad .preventivo-group-children {
  display: grid;
  gap: 10px;
  margin-left: 28px;
  padding-left: 14px;
  border-left: 2px solid var(--line);
}

body.ramos-page-calidad .preventivo-group-children .equipment-row {
  box-shadow: 0 6px 16px rgba(15, 23, 42, .035);
}

@media (max-width: 1180px) {
  body.ramos-page-calidad .preventivo-group-row {
    grid-template-columns: 60px minmax(180px, 1fr) minmax(140px, .8fr) minmax(140px, .8fr);
  }

  body.ramos-page-calidad .preventivo-group-row .hide-tablet {
    display: none;
  }
}

@media (max-width: 720px) {
  body.ramos-page-calidad .preventivo-group-row {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
  }

  body.ramos-page-calidad .preventivo-group-row .row-field,
  body.ramos-page-calidad .preventivo-group-row .row-actions {
    grid-column: 1 / -1;
  }

  body.ramos-page-calidad .preventivo-group-children {
    margin-left: 8px;
    padding-left: 10px;
  }
}

body.ramos-page-calidad .equipment-row {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .045);
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 70px minmax(180px, 1.2fr) minmax(150px, .85fr) minmax(150px, .85fr) minmax(120px, .65fr) 250px;
  gap: 12px;
  align-items: center;
  position: relative;
  overflow: hidden;
}

body.ramos-page-calidad .equipment-row.estado-caducado {
  border-left: 5px solid var(--red);
  background: linear-gradient(90deg, rgba(254, 226, 226, .92), var(--card) 30%);
}

body.ramos-page-calidad .equipment-row.estado-aviso {
  border-left: 5px solid var(--amber);
  background: linear-gradient(90deg, rgba(254, 243, 199, .92), var(--card) 30%);
}

body.ramos-page-calidad .equipment-row.estado-sin-fecha {
  border-left: 5px solid #64748b;
  background: linear-gradient(90deg, rgba(241, 245, 249, .92), var(--card) 30%);
}

body.ramos-page-calidad.dark .equipment-row.estado-caducado {
  background: linear-gradient(90deg, rgba(220, 38, 38, .16), var(--card) 35%);
}

body.ramos-page-calidad.dark .equipment-row.estado-aviso {
  background: linear-gradient(90deg, rgba(217, 119, 6, .16), var(--card) 35%);
}

body.ramos-page-calidad.dark .equipment-row.estado-sin-fecha {
  background: linear-gradient(90deg, rgba(100, 116, 139, .16), var(--card) 35%);
}

body.ramos-page-calidad .row-num {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: #0f172a;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 950;
}

body.ramos-page-calidad.dark .row-num {
  background: #38bdf8;
  color: #0f172a;
}

body.ramos-page-calidad .row-title {
  min-width: 0;
}

body.ramos-page-calidad .row-title strong {
  display: block;
  font-size: 16px;
  font-weight: 950;
  letter-spacing: -.03em;
  line-height: 1.08;
  color: var(--text);
}

body.ramos-page-calidad .row-title small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

body.ramos-page-calidad .row-field {
  min-width: 0;
}

body.ramos-page-calidad .row-field-label {
  font-size: 9px;
  font-weight: 950;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 4px;
}

body.ramos-page-calidad .row-field-value {
  font-size: 11px;
  font-weight: 950;
  color: var(--text);
  line-height: 1.18;
}

body.ramos-page-calidad .row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

body.ramos-page-calidad .row-actions .btn {
  min-height: 40px;
  padding: 10px 11px;
  font-size: 9px;
}

@media (max-width: 1180px) {
  body.ramos-page-calidad .equipment-row {
    grid-template-columns: 60px minmax(180px, 1fr) minmax(140px, .8fr) minmax(140px, .8fr);
  }

  body.ramos-page-calidad .equipment-row .hide-tablet {
    display: none;
  }

  body.ramos-page-calidad .row-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  body.ramos-page-calidad .row-actions .btn {
    flex: 1 1 130px;
  }
}

@media (max-width: 720px) {
  body.ramos-page-calidad .equipment-row {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
  }

  body.ramos-page-calidad .equipment-row .row-field {
    grid-column: 1 / -1;
  }

  body.ramos-page-calidad .row-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

body.ramos-page-calidad .equipment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 12px;
}

body.ramos-page-calidad .equipment-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .055);
  padding: 14px;
  position: relative;
  overflow: hidden;
}

body.ramos-page-calidad .equipment-card:before {
  content: "";
  position: absolute;
  right: -34px;
  top: -34px;
  width: 110px;
  height: 110px;
  border-radius: 999px;
  background: rgba(37, 99, 235, .08);
}

body.ramos-page-calidad .equipment-card.estado-caducado {
  border-left: 5px solid var(--red);
  background: linear-gradient(90deg, rgba(254, 226, 226, .92), var(--card) 30%);
}

body.ramos-page-calidad .equipment-card.estado-aviso {
  border-left: 5px solid var(--amber);
  background: linear-gradient(90deg, rgba(254, 243, 199, .92), var(--card) 30%);
}

body.ramos-page-calidad .equipment-card.estado-sin-fecha {
  border-left: 5px solid #64748b;
  background: linear-gradient(90deg, rgba(241, 245, 249, .92), var(--card) 30%);
}

body.ramos-page-calidad.dark .equipment-card.estado-caducado {
  background: linear-gradient(90deg, rgba(220, 38, 38, .16), var(--card) 35%);
}

body.ramos-page-calidad.dark .equipment-card.estado-aviso {
  background: linear-gradient(90deg, rgba(217, 119, 6, .16), var(--card) 35%);
}

body.ramos-page-calidad.dark .equipment-card.estado-sin-fecha {
  background: linear-gradient(90deg, rgba(100, 116, 139, .16), var(--card) 35%);
}

body.ramos-page-calidad .equipment-card>* {
  position: relative;
  z-index: 1;
}

body.ramos-page-calidad .equipment-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 12px;
}

body.ramos-page-calidad .equipment-number {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: #0f172a;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 950;
  flex-shrink: 0;
}

body.ramos-page-calidad.dark .equipment-number {
  background: #38bdf8;
  color: #0f172a;
}

body.ramos-page-calidad .equipment-name {
  margin: 0;
  font-size: 18px;
  font-weight: 950;
  letter-spacing: -.03em;
  line-height: 1.05;
}

body.ramos-page-calidad .equipment-meta {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
}

body.ramos-page-calidad .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
  border: 1px solid transparent;
}

body.ramos-page-calidad .badge-ok {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}

body.ramos-page-calidad .badge-aviso {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

body.ramos-page-calidad .badge-caducado {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

body.ramos-page-calidad .badge-sin {
  background: #f1f5f9;
  color: #334155;
  border-color: #e2e8f0;
}

body.ramos-page-calidad.dark .badge-sin {
  background: rgba(255, 255, 255, .08);
  color: #cbd5e1;
  border-color: rgba(255, 255, 255, .10);
}

body.ramos-page-calidad .info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0;
}

body.ramos-page-calidad .info-box {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  min-width: 0;
}

body.ramos-page-calidad .info-label {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
}

body.ramos-page-calidad .info-value {
  margin: 0;
  font-size: 11px;
  font-weight: 950;
  color: var(--text);
  line-height: 1.15;
}

body.ramos-page-calidad .card-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

body.ramos-page-calidad .card-actions.admin {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.ramos-page-calidad .empty {
  padding: 42px 16px;
  text-align: center;
  color: var(--muted);
}

body.ramos-page-calidad .empty h3 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  font-weight: 950;
}

body.ramos-page-calidad .empty p {
  margin: 6px 0 0;
  font-size: 11px;
  font-weight: 750;
}

body.ramos-page-calidad .modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 42, .68);
  display: none;
  align-items: flex-end;
  padding: 16px;
}

body.ramos-page-calidad .modal.active {
  display: flex;
}

@media (min-width: 900px) {
  body.ramos-page-calidad .modal {
    align-items: center;
  }
}



body.ramos-page-calidad .modal.drawer-left,
body.ramos-page-calidad .modal.drawer-right {
  align-items: stretch;
  padding: 0;
  background: rgba(15, 23, 42, .42);
}

body.ramos-page-calidad .modal.drawer-left {
  justify-content: flex-start;
}

body.ramos-page-calidad .modal.drawer-right {
  justify-content: flex-end;
}

body.ramos-page-calidad .drawer-card {
  width: min(560px, 94vw);
  min-height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  border-radius: 32px 0 0 32px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: -24px 0 70px rgba(0, 0, 0, .28);
  padding: 0 20px max(18px, env(safe-area-inset-bottom));
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

body.ramos-page-calidad .drawer-sticky-head {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 0 -20px 16px;
  padding: max(18px, env(safe-area-inset-top)) 20px 16px;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

body.ramos-page-calidad.dark .drawer-sticky-head {
  background: rgba(23, 32, 51, .94);
}

body.ramos-page-calidad .detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

body.ramos-page-calidad .detail-section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .055);
  padding: 14px;
  margin-top: 12px;
}

body.ramos-page-calidad .detail-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

body.ramos-page-calidad .collapsible-body {
  display: none;
}

body.ramos-page-calidad .collapsible-body.open {
  display: grid;
  gap: 8px;
}

body.ramos-page-calidad .timeline {
  border-left: 2px solid var(--line);
  padding-left: 14px;
  margin-left: 6px;
  position: relative;
}

body.ramos-page-calidad .timeline-dot {
  position: absolute;
  left: -6px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--primary);
}

body.ramos-page-calidad .native-file-input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

body.ramos-page-calidad .file-picker-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 14px;
  padding: 13px 14px;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .06em;
  cursor: pointer;
  user-select: none;
}

body.ramos-page-calidad.dark .file-picker-button {
  background: rgba(59, 130, 246, .14);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, .22);
}

body.ramos-page-calidad .detail-box {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  min-width: 0;
}

body.ramos-page-calidad .detail-box.full {
  grid-column: 1 / -1;
}

body.ramos-page-calidad .detail-label {
  margin: 0 0 5px;
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}

body.ramos-page-calidad .detail-value {
  margin: 0;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.35;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

body.ramos-page-calidad .equipment-row.clickable {
  cursor: pointer;
}

body.ramos-page-calidad .equipment-row.clickable:hover {
  transform: translateY(-1px);
  filter: brightness(1.01);
}

@media (max-width: 640px) {
  body.ramos-page-calidad .drawer-card {
    width: 100%;
    border-radius: 0;
  }

  body.ramos-page-calidad .detail-grid {
    grid-template-columns: 1fr;
  }
}



/* ===== FASE 1 · Plan automático preventivo ===== */
body.ramos-page-calidad .rules-list {
  display: grid;
  gap: 8px;
}

body.ramos-page-calidad .rule-card {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  display: grid;
  gap: 8px;
}

body.ramos-page-calidad .rule-card.inactive {
  opacity: .58;
  filter: grayscale(.25);
}

body.ramos-page-calidad .rule-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

body.ramos-page-calidad .rule-title {
  margin: 0;
  font-size: 11px;
  font-weight: 950;
  color: var(--text);
  line-height: 1.2;
}

body.ramos-page-calidad .rule-meta {
  margin: 4px 0 0;
  font-size: 10px;
  font-weight: 850;
  color: var(--muted);
  line-height: 1.35;
}

body.ramos-page-calidad .rule-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

body.ramos-page-calidad .rule-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  white-space: nowrap;
}

body.ramos-page-calidad .rule-chip.green {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}

body.ramos-page-calidad .rule-chip.amber {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

body.ramos-page-calidad .rule-chip.gray {
  background: #f1f5f9;
  color: #475569;
  border-color: #e2e8f0;
}

body.ramos-page-calidad.dark .rule-chip {
  background: rgba(59, 130, 246, .16);
  color: #bfdbfe;
  border-color: rgba(59, 130, 246, .28);
}

body.ramos-page-calidad.dark .rule-chip.green {
  background: rgba(34, 197, 94, .16);
  color: #bbf7d0;
  border-color: rgba(34, 197, 94, .28);
}

body.ramos-page-calidad.dark .rule-chip.amber {
  background: rgba(245, 158, 11, .16);
  color: #fde68a;
  border-color: rgba(245, 158, 11, .28);
}

body.ramos-page-calidad.dark .rule-chip.gray {
  background: rgba(148, 163, 184, .14);
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, .24);
}

body.ramos-page-calidad .month-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

body.ramos-page-calidad .month-check {
  min-height: 42px;
  border: 1px solid var(--line);
  background: var(--soft);
  border-radius: 14px;
  padding: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--text);
}

body.ramos-page-calidad .month-check input {
  width: 16px;
  height: 16px;
  accent-color: #2563eb;
}

@media (max-width: 640px) {
  body.ramos-page-calidad .month-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.ramos-page-calidad .rule-head {
    display: grid;
  }
}

/* ===== FASE 2 · Vista Mantenimientos preventivos ===== */
body.ramos-page-calidad .maintenance-grid {
  display: grid;
  gap: 10px;
}

body.ramos-page-calidad .maintenance-row {
  --machine-color: var(--green);
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 5px solid var(--machine-color);
  border-radius: 22px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .045);
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(130px, .7fr) minmax(130px, .7fr) minmax(130px, .7fr) 170px;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  transition: transform .12s ease, filter .12s ease;
}

body.ramos-page-calidad .maintenance-row:hover {
  transform: translateY(-1px);
  filter: brightness(1.01);
}

body.ramos-page-calidad .maintenance-row.estado-incidencia,
body.ramos-page-calidad .maintenance-row.estado-no-realizado {
  border-left: 5px solid var(--red);
  background: linear-gradient(90deg, rgba(254, 226, 226, .88), var(--card) 34%);
}

body.ramos-page-calidad .maintenance-row.estado-observacion {
  border-left: 5px solid var(--amber);
  background: linear-gradient(90deg, rgba(254, 243, 199, .88), var(--card) 34%);
}

body.ramos-page-calidad .maintenance-row.estado-ok {
  border-left-color: var(--machine-color);
}

body.ramos-page-calidad .maintenance-row.estado-produccion {
  --machine-color: #0ea5e9;
  border-left-color: #0ea5e9;
  background:
    linear-gradient(90deg, rgba(14, 165, 233, .18), rgba(79, 70, 229, .07), var(--card) 42%);
  box-shadow: 0 10px 26px rgba(14, 165, 233, .10);
}

body.ramos-page-calidad .maintenance-row.estado-produccion .maintenance-title::before {
  content: "📘";
  margin-right: 6px;
}

body.ramos-page-calidad.dark .maintenance-row.estado-incidencia,
body.ramos-page-calidad.dark .maintenance-row.estado-no-realizado {
  background: linear-gradient(90deg, rgba(220, 38, 38, .16), var(--card) 35%);
}

body.ramos-page-calidad.dark .maintenance-row.estado-observacion {
  background: linear-gradient(90deg, rgba(217, 119, 6, .16), var(--card) 35%);
}

body.ramos-page-calidad .maintenance-title {
  margin: 0;
  font-size: 15px;
  font-weight: 950;
  letter-spacing: -.025em;
  line-height: 1.15;
  color: var(--text);
}

body.ramos-page-calidad .maintenance-sub {
  margin: 5px 0 0;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  line-height: 1.35;
}

body.ramos-page-calidad .maintenance-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

body.ramos-page-calidad .maintenance-actions .btn {
  min-height: 38px;
  padding: 9px 10px;
  font-size: 9px;
}

@media (max-width: 980px) {
  body.ramos-page-calidad .maintenance-row {
    grid-template-columns: 1fr 1fr;
  }

  body.ramos-page-calidad .maintenance-row .maintenance-main {
    grid-column: 1 / -1;
  }

  body.ramos-page-calidad .maintenance-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  body.ramos-page-calidad .maintenance-actions .btn {
    flex: 1 1 120px;
  }
}

@media (max-width: 640px) {
  body.ramos-page-calidad .maintenance-row {
    grid-template-columns: 1fr;
  }
}

body.ramos-page-calidad .maintenance-extra-toolbar {
  margin: 16px;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(180px, 280px) minmax(180px, 260px) auto;
  gap: 12px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(248, 250, 252, .72);
  box-shadow: 0 8px 20px rgba(15, 23, 42, .035);
}

body.ramos-page-calidad.dark .maintenance-extra-toolbar {
  background: rgba(255, 255, 255, .035);
}

body.ramos-page-calidad .maintenance-view-title {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-bottom: 4px;
}

body.ramos-page-calidad .maintenance-view-title p {
  margin: 0;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .10em;
  color: var(--primary);
}

body.ramos-page-calidad .maintenance-view-title small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  line-height: 1.3;
}

body.ramos-page-calidad .maintenance-period-nav {
  display: flex;
  align-items: end;
  gap: 8px;
  min-height: 46px;
}

body.ramos-page-calidad .maintenance-period-nav .btn {
  min-width: 54px;
  min-height: 46px;
}

body.ramos-page-calidad .maintenance-summary {
  padding: 16px 16px 8px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  background: rgba(248, 250, 252, .52);
}

body.ramos-page-calidad.dark .maintenance-summary {
  background: rgba(255, 255, 255, .025);
}

body.ramos-page-calidad .maintenance-summary-box {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 14px;
  padding: 10px;
  min-width: 0;
}

body.ramos-page-calidad .maintenance-summary-label {
  margin: 0;
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}

body.ramos-page-calidad .maintenance-summary-value {
  margin: 4px 0 0;
  font-size: 20px;
  font-weight: 950;
  letter-spacing: -.035em;
  color: var(--text);
}

body.ramos-page-calidad .maintenance-calendar {
  display: grid;
  gap: 10px;
}

body.ramos-page-calidad .maintenance-calendar-head {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

body.ramos-page-calidad .maintenance-calendar-day-name {
  color: var(--muted);
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
  text-align: center;
}

body.ramos-page-calidad .maintenance-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

body.ramos-page-calidad .maintenance-day {
  min-height: 116px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  display: grid;
  align-content: start;
  gap: 7px;
  cursor: pointer;
}

body.ramos-page-calidad .maintenance-day:hover {
  transform: translateY(-1px);
  filter: brightness(1.01);
}

body.ramos-page-calidad .maintenance-day.muted {
  opacity: .42;
}

body.ramos-page-calidad .maintenance-day.has-items {
  border-color: rgba(37, 99, 235, .35);
  box-shadow: 0 8px 20px rgba(15, 23, 42, .045);
}

body.ramos-page-calidad .maintenance-day-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

body.ramos-page-calidad .maintenance-day-num {
  font-size: 11px;
  font-weight: 950;
  color: var(--text);
}

body.ramos-page-calidad .maintenance-count {
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-size: 10px;
  font-weight: 950;
}

body.ramos-page-calidad .maintenance-event-mini {
  --machine-color: var(--green);
  border-radius: 10px;
  padding: 5px 7px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-left: 4px solid var(--machine-color);
  font-size: 9px;
  font-weight: 900;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.ramos-page-calidad .maintenance-event-mini.estado-incidencia,
body.ramos-page-calidad .maintenance-event-mini.estado-no-realizado {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

body.ramos-page-calidad .maintenance-event-mini.estado-observacion {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

body.ramos-page-calidad .maintenance-event-mini.estado-ok {
  background: #f8fafc;
  color: #0f172a;
  border-color: #e2e8f0;
  border-left-color: var(--machine-color);
}

body.ramos-page-calidad .maintenance-event-mini.estado-produccion {
  --machine-color: #0ea5e9;
  border-left-color: #0ea5e9;
  background: linear-gradient(90deg, #e0f2fe, #eef2ff);
  color: #075985;
  border-color: #bae6fd;
  box-shadow: inset 0 0 0 1px rgba(14, 165, 233, .12);
}

body.ramos-page-calidad.dark .maintenance-event-mini.estado-ok {
  background: rgba(255, 255, 255, .045);
  color: #e2e8f0;
  border-color: rgba(255, 255, 255, .10);
  border-left-color: var(--machine-color);
}

body.ramos-page-calidad.dark .maintenance-event-mini.estado-produccion {
  background: linear-gradient(90deg, rgba(14, 165, 233, .18), rgba(99, 102, 241, .12));
  color: #bae6fd;
  border-color: rgba(14, 165, 233, .30);
  border-left-color: #38bdf8;
}

body.ramos-page-calidad .production-review-panel {
  border: 1px solid #bae6fd;
  background: linear-gradient(135deg, rgba(224, 242, 254, .92), rgba(238, 242, 255, .92));
  border-radius: 22px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

body.ramos-page-calidad.dark .production-review-panel {
  border-color: rgba(56, 189, 248, .24);
  background: linear-gradient(135deg, rgba(14, 165, 233, .10), rgba(99, 102, 241, .08));
}

body.ramos-page-calidad .production-review-mini-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

body.ramos-page-calidad .production-review-mini-box {
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(14, 165, 233, .18);
  border-radius: 14px;
  padding: 9px;
}

body.ramos-page-calidad.dark .production-review-mini-box {
  background: rgba(255, 255, 255, .045);
  border-color: rgba(56, 189, 248, .18);
}

body.ramos-page-calidad .production-review-list {
  display: grid;
  gap: 7px;
}

body.ramos-page-calidad .production-review-item {
  background: rgba(255, 255, 255, .78);
  border: 1px solid rgba(14, 165, 233, .16);
  border-radius: 14px;
  padding: 9px;
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

body.ramos-page-calidad.dark .production-review-item {
  background: rgba(255, 255, 255, .045);
  border-color: rgba(56, 189, 248, .16);
}

@media (max-width: 640px) {
  body.ramos-page-calidad .production-review-mini-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.ramos-page-calidad .production-review-item {
    grid-template-columns: 1fr;
  }
}

body.ramos-page-calidad .maintenance-more {
  font-size: 9px;
  font-weight: 950;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 980px) {
  body.ramos-page-calidad .maintenance-extra-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  body.ramos-page-calidad .maintenance-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.ramos-page-calidad .maintenance-calendar-grid,
  body.ramos-page-calidad .maintenance-calendar-head {
    gap: 5px;
  }

  body.ramos-page-calidad .maintenance-day {
    min-height: 94px;
    padding: 8px;
    border-radius: 14px;
  }

  body.ramos-page-calidad .maintenance-event-mini {
    display: none;
  }
}

@media (max-width: 640px) {
  body.ramos-page-calidad .maintenance-extra-toolbar {
    grid-template-columns: 1fr;
  }

  body.ramos-page-calidad .maintenance-period-nav {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
  }

  body.ramos-page-calidad .maintenance-period-nav .btn {
    min-width: 0;
    width: 100%;
  }

  body.ramos-page-calidad .maintenance-summary {
    grid-template-columns: 1fr 1fr;
  }
}

/* ===== Mantenimientos · selector de periodo tipo Turnos ===== */
body.ramos-page-calidad .compact-period-toolbar {
  grid-template-columns: minmax(360px, .82fr) minmax(330px, auto);
  align-items: center;
  gap: 12px;
  margin: 12px 16px 16px;
  padding: 12px;
  background: rgba(248, 250, 252, .86);
}

body.ramos-page-calidad .maintenance-period-card {
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
  display: grid;
  grid-template-columns: 46px 1fr 46px;
  align-items: center;
  gap: 6px;
  padding: 6px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .055);
}

body.ramos-page-calidad .period-arrow {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--soft);
  color: var(--text);
  font-family: inherit;
  font-size: 24px;
  font-weight: 950;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .12s ease, filter .12s ease;
}

body.ramos-page-calidad .period-arrow:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

body.ramos-page-calidad .period-arrow:active {
  transform: scale(.96);
}

body.ramos-page-calidad .period-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  align-items: center;
}

body.ramos-page-calidad .period-tab {
  min-height: 40px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .06em;
  cursor: pointer;
  transition: transform .12s ease, background .12s ease, color .12s ease;
}

body.ramos-page-calidad .period-tab:hover {
  transform: translateY(-1px);
  color: var(--text);
}

body.ramos-page-calidad .period-tab.active {
  background: #0f172a;
  color: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .16);
}

body.ramos-page-calidad.dark .period-tab.active {
  background: #38bdf8;
  color: #0f172a;
}

body.ramos-page-calidad .maintenance-period-side {
  display: grid;
  grid-template-columns: minmax(160px, 220px) auto auto;
  gap: 10px;
  align-items: end;
  justify-content: end;
}

body.ramos-page-calidad .maintenance-period-side .btn {
  min-height: 42px;
  padding: 11px 14px;
}

body.ramos-page-calidad.dark .maintenance-period-card {
  background: rgba(255, 255, 255, .035);
}

@media (max-width: 980px) {
  body.ramos-page-calidad .compact-period-toolbar {
    grid-template-columns: 1fr;
  }

  body.ramos-page-calidad .maintenance-period-side {
    grid-template-columns: 1fr 1fr 1fr;
    justify-content: stretch;
  }

  body.ramos-page-calidad .maintenance-period-side .btn {
    width: 100%;
  }
}

@media (max-width: 640px) {
  body.ramos-page-calidad .maintenance-period-card {
    grid-template-columns: 40px 1fr 40px;
    border-radius: 20px;
    min-height: 52px;
  }

  body.ramos-page-calidad .period-arrow {
    width: 36px;
    height: 36px;
    border-radius: 14px;
    font-size: 22px;
  }

  body.ramos-page-calidad .period-tabs {
    gap: 4px;
  }

  body.ramos-page-calidad .period-tab {
    min-height: 36px;
    font-size: 9px;
    border-radius: 12px;
  }

  body.ramos-page-calidad .maintenance-period-side {
    grid-template-columns: 1fr;
  }
}




/* Ajuste final: cabecera de mantenimientos más compacta */
body.ramos-page-calidad .compact-section-head {
  padding: 12px 16px;
  align-items: center;
}

body.ramos-page-calidad .compact-section-head .section-kicker {
  font-size: 9px;
  letter-spacing: .11em;
}

body.ramos-page-calidad .compact-section-head .section-title {
  font-size: 18px;
  margin-top: 2px;
  line-height: 1.08;
}

body.ramos-page-calidad .compact-section-head .section-help {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.3;
  max-width: 860px;
}

body.ramos-page-calidad .compact-section-head .btn {
  min-height: 40px;
  padding: 10px 14px;
  border-radius: 15px;
  font-size: 9px;
}

@media (max-width: 720px) {
  body.ramos-page-calidad .compact-section-head {
    display: grid;
    gap: 10px;
    padding: 12px;
  }

  body.ramos-page-calidad .compact-section-head .section-title {
    font-size: 17px;
  }

  body.ramos-page-calidad .compact-section-head .section-help {
    font-size: 10px;
  }

  body.ramos-page-calidad .compact-section-head .btn {
    width: 100%;
  }
}


body.ramos-page-calidad .modal-card {
  width: min(720px, 100%);
  margin: 0 auto;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 32px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .32);
  padding: 20px;
  max-height: calc(100vh - 40px);
  overflow: auto;
}

body.ramos-page-calidad .modal-head {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 16px;
}

body.ramos-page-calidad .modal-head > div {
  flex: 1 1 auto;
  min-width: 0;
}

body.ramos-page-calidad .close-btn {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border: 0;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 20px;
  font-weight: 950;
  cursor: pointer;
  flex-shrink: 0;
  align-self: flex-start; /* siempre arriba-derecha aunque el título sea muy largo */
}

body.ramos-page-calidad .form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

body.ramos-page-calidad .form-grid .full {
  grid-column: 1 / -1;
}

body.ramos-page-calidad textarea.input {
  min-height: 92px;
  resize: vertical;
}

body.ramos-page-calidad .pdf-list {
  display: grid;
  gap: 8px;
}

body.ramos-page-calidad .pdf-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--soft);
  border-radius: 16px;
  padding: 10px;
}

body.ramos-page-calidad .pdf-name {
  font-size: 11px;
  font-weight: 900;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.ramos-page-calidad .pdf-meta {
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
  margin-top: 2px;
}


@media (max-width: 1050px) {

  body.ramos-page-calidad .hero-grid,
  body.ramos-page-calidad .layout {
    grid-template-columns: 1fr;
  }

  body.ramos-page-calidad .sidebar {
    position: static;
  }

  body.ramos-page-calidad .side-title {
    display: none;
  }

  body.ramos-page-calidad .side-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.ramos-page-calidad .toolbar {
    grid-template-columns: 1fr 1fr;
  }

  body.ramos-page-calidad .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  body.ramos-page-calidad .shell {
    padding: 0 12px;
  }

  body.ramos-page-calidad .hero {
    margin: -16px -12px 0;
    border-radius: 0 0 32px 32px;
    padding: 20px 16px;
  }

  body.ramos-page-calidad .topbar {
    min-height: 62px;
  }

  body.ramos-page-calidad .brand-logo {
    height: 30px;
  }

  body.ramos-page-calidad h1 {
    font-size: 17px;
  }

  body.ramos-page-calidad .btn {
    padding: 11px 12px;
  }

  body.ramos-page-calidad .top-actions .btn {
    padding: 10px 11px;
  }

  body.ramos-page-calidad .toolbar {
    grid-template-columns: 1fr;
  }

  body.ramos-page-calidad .equipment-grid {
    grid-template-columns: 1fr;
  }

  body.ramos-page-calidad .info-grid {
    grid-template-columns: 1fr 1fr;
  }

  body.ramos-page-calidad .card-actions,
  body.ramos-page-calidad .card-actions.admin {
    grid-template-columns: 1fr 1fr;
  }

  body.ramos-page-calidad .kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  body.ramos-page-calidad .kpi-box {
    padding: 7px 5px;
    border-radius: 12px;
  }

  body.ramos-page-calidad .kpi-label {
    font-size: 7px;
    letter-spacing: .06em;
    min-height: 0;
  }

  body.ramos-page-calidad .kpi-value {
    font-size: 18px;
    margin: 2px 0 0;
  }

  body.ramos-page-calidad .form-grid {
    grid-template-columns: 1fr;
  }

  body.ramos-page-calidad .modal {
    padding: 10px;
  }

  body.ramos-page-calidad .modal-card {
    border-radius: 26px;
    padding: 16px;
  }

  body.ramos-page-calidad .side-nav {
    grid-template-columns: 1fr;
  }
}



/* ===== CALIDAD · Ajuste de margen igualado a Usuarios definitivo =====
       Solo separación visual: no toca Firebase, Auth, Firestore ni JS.
    */
body.ramos-page-calidad .shell {
  width: min(1480px, calc(100% - 64px)) !important;
  max-width: 1480px !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

body.ramos-page-calidad .main {
  padding-top: 16px !important;
  gap: 16px !important;
}

body.ramos-page-calidad .hero,
body.ramos-page-calidad .card,
body.ramos-page-calidad .side-card {
  max-width: 100%;
}

@media (max-width: 899px) {
  body.ramos-page-calidad .shell {
    width: calc(100% - 32px) !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  body.ramos-page-calidad .main {
    padding-top: 14px !important;
    gap: 14px !important;
  }

  body.ramos-page-calidad .hero {
    margin: 0 !important;
    border-radius: 28px !important;
  }
}

@media (max-width: 640px) {
  body.ramos-page-calidad .shell {
    width: calc(100% - 24px) !important;
  }

  body.ramos-page-calidad .hero {
    margin: 0 !important;
    border-radius: 24px !important;
    padding: 18px 16px !important;
  }
}



/* ===== FIX MÓVIL · Equipos preventivos / fichas sin desplazamiento lateral =====
       Solo CSS: evita que el drawer y sus contenidos empujen la pantalla en móvil.
    */
html,
body.ramos-page-calidad {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden !important;
  overscroll-behavior-x: none;
}

body.ramos-page-calidad {
  touch-action: pan-y;
}

body.ramos-page-calidad #view-app,
body.ramos-page-calidad .shell,
body.ramos-page-calidad .main,
body.ramos-page-calidad .layout,
body.ramos-page-calidad .content,
body.ramos-page-calidad .card,
body.ramos-page-calidad .side-card,
body.ramos-page-calidad .hero,
body.ramos-page-calidad .toolbar,
body.ramos-page-calidad .equipment-list,
body.ramos-page-calidad .equipment-row,
body.ramos-page-calidad .row-title,
body.ramos-page-calidad .row-field,
body.ramos-page-calidad .row-actions,
body.ramos-page-calidad .modal,
body.ramos-page-calidad .drawer-card,
body.ramos-page-calidad .drawer-sticky-head,
body.ramos-page-calidad .modal-head,
body.ramos-page-calidad .detail-grid,
body.ramos-page-calidad .detail-section,
body.ramos-page-calidad .detail-section-head,
body.ramos-page-calidad .detail-box,
body.ramos-page-calidad .pdf-list,
body.ramos-page-calidad .pdf-item,
body.ramos-page-calidad .rules-list,
body.ramos-page-calidad .rule-card,
body.ramos-page-calidad .rule-head,
body.ramos-page-calidad .rule-chips,
body.ramos-page-calidad .production-review-panel,
body.ramos-page-calidad .production-review-list,
body.ramos-page-calidad .production-review-item,
body.ramos-page-calidad #fichaPreventivoContenido,
body.ramos-page-calidad #fichaCalibracionContenido,
body.ramos-page-calidad #fichaMantenimientoContenido {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

body.ramos-page-calidad .modal.drawer-right,
body.ramos-page-calidad .modal.drawer-left {
  width: 100vw !important;
  max-width: 100vw !important;
  overflow-x: hidden !important;
  overscroll-behavior-x: none;
}

body.ramos-page-calidad .drawer-card {
  width: min(560px, 100vw) !important;
  max-width: 100vw !important;
  overflow-x: hidden !important;
  overscroll-behavior-x: contain;
  touch-action: pan-y;
}

body.ramos-page-calidad .drawer-card * {
  max-width: 100%;
}

body.ramos-page-calidad .detail-value,
body.ramos-page-calidad .pdf-name,
body.ramos-page-calidad .pdf-meta,
body.ramos-page-calidad .rule-title,
body.ramos-page-calidad .rule-meta,
body.ramos-page-calidad .section-title,
body.ramos-page-calidad .section-help,
body.ramos-page-calidad .equipment-name,
body.ramos-page-calidad .equipment-meta {
  overflow-wrap: anywhere;
  word-break: break-word;
}

body.ramos-page-calidad .detail-section-head,
body.ramos-page-calidad .modal-head,
body.ramos-page-calidad .rule-head {
  flex-wrap: wrap;
}

body.ramos-page-calidad .pdf-item {
  grid-template-columns: minmax(0, 1fr) auto;
}

body.ramos-page-calidad .pdf-item>div,
body.ramos-page-calidad .detail-box>div {
  min-width: 0 !important;
}

@media (max-width: 640px) {
  body.ramos-page-calidad .drawer-card {
    width: 100vw !important;
    max-width: 100vw !important;
    border-radius: 0 !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  body.ramos-page-calidad .drawer-sticky-head {
    margin-left: -16px !important;
    margin-right: -16px !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  body.ramos-page-calidad .detail-grid {
    grid-template-columns: 1fr !important;
  }

  body.ramos-page-calidad .detail-section-head {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  body.ramos-page-calidad .detail-section-head>div:last-child {
    justify-content: stretch !important;
  }

  body.ramos-page-calidad .detail-section-head .btn,
  body.ramos-page-calidad .detail-section .btn {
    max-width: 100%;
  }

  body.ramos-page-calidad .pdf-item {
    grid-template-columns: 1fr !important;
  }

  body.ramos-page-calidad .pdf-item .btn {
    width: 100%;
  }

  body.ramos-page-calidad #fichaPreventivoContenido [style*="grid-template-columns:1fr 1fr"],
  body.ramos-page-calidad #fichaCalibracionContenido [style*="grid-template-columns:1fr 1fr"],
  body.ramos-page-calidad #fichaMantenimientoContenido [style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}



/* ===== CALIDAD · FIX SCROLL DRAWERS MÓVIL v2 =====
       Objetivo: impedir que al llegar al final de la ficha el gesto arrastre
       la pantalla completa o haga desaparecer el drawer. Solo CSS.
    */
html,
body.ramos-page-calidad {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden !important;
  overscroll-behavior-x: none;
}

body.ramos-page-calidad {
  touch-action: pan-y;
}

body.ramos-page-calidad #view-app,
body.ramos-page-calidad .shell,
body.ramos-page-calidad .main,
body.ramos-page-calidad .layout,
body.ramos-page-calidad .content,
body.ramos-page-calidad .card,
body.ramos-page-calidad .side-card,
body.ramos-page-calidad .equipment-row,
body.ramos-page-calidad .equipment-card,
body.ramos-page-calidad .maintenance-row,
body.ramos-page-calidad .maintenance-calendar,
body.ramos-page-calidad .maintenance-calendar-grid {
  max-width: 100%;
  min-width: 0;
}

/* Cuando hay un modal/drawer abierto, el fondo no debe seguir haciendo scroll. */
body.ramos-page-calidad:has(.modal.active) {
  overflow: hidden !important;
  overscroll-behavior: none !important;
}

body.ramos-page-calidad .modal.active {
  position: fixed !important;
  inset: 0 !important;
  overflow: hidden !important;
  overscroll-behavior: none !important;
  touch-action: none;
}

body.ramos-page-calidad .modal.drawer-left.active,
body.ramos-page-calidad .modal.drawer-right.active {
  display: flex !important;
  align-items: stretch !important;
  overflow: hidden !important;
  overscroll-behavior: none !important;
  -webkit-overflow-scrolling: auto;
}

body.ramos-page-calidad .modal.drawer-right.active {
  justify-content: flex-end !important;
}

body.ramos-page-calidad .modal.drawer-left.active {
  justify-content: flex-start !important;
}

body.ramos-page-calidad .drawer-card {
  height: 100dvh !important;
  min-height: 0 !important;
  max-height: 100dvh !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  touch-action: pan-y !important;
  -webkit-overflow-scrolling: touch;
  transform: translateZ(0);
  contain: layout paint;
}

body.ramos-page-calidad .drawer-card *,
body.ramos-page-calidad .drawer-card *::before,
body.ramos-page-calidad .drawer-card *::after {
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

body.ramos-page-calidad .drawer-sticky-head {
  top: 0 !important;
  max-width: 100%;
}

body.ramos-page-calidad .detail-grid,
body.ramos-page-calidad .detail-section,
body.ramos-page-calidad .detail-box,
body.ramos-page-calidad .rules-list,
body.ramos-page-calidad .rule-card,
body.ramos-page-calidad .pdf-list,
body.ramos-page-calidad .pdf-item,
body.ramos-page-calidad .production-review-panel,
body.ramos-page-calidad .production-review-list,
body.ramos-page-calidad .production-review-item {
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

body.ramos-page-calidad .detail-value,
body.ramos-page-calidad .pdf-name,
body.ramos-page-calidad .pdf-meta,
body.ramos-page-calidad .rule-title,
body.ramos-page-calidad .rule-meta {
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
}

@media (max-width: 640px) {

  body.ramos-page-calidad .modal.drawer-left.active,
  body.ramos-page-calidad .modal.drawer-right.active {
    width: 100vw !important;
    max-width: 100vw !important;
  }

  body.ramos-page-calidad .drawer-card {
    width: 100vw !important;
    max-width: 100vw !important;
    border-radius: 0 !important;
    border-left: 0 !important;
    border-right: 0 !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
    padding-bottom: max(20px, env(safe-area-inset-bottom)) !important;
  }

  body.ramos-page-calidad .drawer-sticky-head {
    margin-left: -14px !important;
    margin-right: -14px !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  body.ramos-page-calidad .detail-grid,
  body.ramos-page-calidad .form-grid,
  body.ramos-page-calidad .production-review-mini-grid,
  body.ramos-page-calidad .production-review-item,
  body.ramos-page-calidad .pdf-item {
    grid-template-columns: 1fr !important;
  }

  body.ramos-page-calidad .detail-section-head,
  body.ramos-page-calidad .modal-head {
    align-items: flex-start;
    flex-wrap: nowrap;
  }
}



/* close-btn ya va primero en el DOM → la regla base .modal-head lo coloca a la izquierda */



/* ===== CALIDAD · FIX definitivo sobre último archivo: saltos de línea + cabecera drawer =====
       Mantiene los intros escritos en campos largos y cubre todo el ancho de la ficha lateral.
       Solo CSS: no modifica Firebase, Firestore, Storage ni lógica de datos.
    */
body.ramos-page-calidad .detail-box .detail-value:not([style*="nowrap"]),
body.ramos-page-calidad .detail-section .detail-value:not([style*="nowrap"]),
body.ramos-page-calidad .timeline p:not(.detail-label),
body.ramos-page-calidad .rule-card .rule-meta,
body.ramos-page-calidad .maintenance-sub,
body.ramos-page-calidad .production-review-item p,
body.ramos-page-calidad .production-review-panel p {
  white-space: pre-wrap !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
}

body.ramos-page-calidad .drawer-card>.drawer-sticky-head {
  width: calc(100% + 40px) !important;
  max-width: none !important;
  margin-left: -20px !important;
  margin-right: -20px !important;
  padding-left: 20px !important;
  padding-right: 20px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

body.ramos-page-calidad .drawer-card>.drawer-sticky-head::before {
  content: "";
  position: absolute;
  inset: 0;
  background: inherit;
  z-index: -1;
}

body.ramos-page-calidad .drawer-card>.drawer-sticky-head .modal-head,
body.ramos-page-calidad .drawer-card>.drawer-sticky-head>div {
  min-width: 0 !important;
}

@media (max-width: 640px) {
  body.ramos-page-calidad .drawer-card>.drawer-sticky-head {
    width: calc(100% + 28px) !important;
    max-width: none !important;
    margin-left: -14px !important;
    margin-right: -14px !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
  }
}



/* ===== CALIDAD · FIX apertura modal equipo preventivo =====
       Evita que el formulario se abra desplazado o demasiado arriba. Solo afecta al modal de equipo preventivo.
    */
body.ramos-page-calidad #modalPreventivo.active {
  align-items: center !important;
  justify-content: center !important;
  padding-top: max(12px, env(safe-area-inset-top)) !important;
  padding-bottom: max(12px, env(safe-area-inset-bottom)) !important;
  overflow: hidden !important;
}

body.ramos-page-calidad #modalPreventivo .modal-card {
  max-height: calc(100dvh - max(24px, env(safe-area-inset-top)) - max(24px, env(safe-area-inset-bottom))) !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: auto !important;
}

@media (max-width: 640px) {
  body.ramos-page-calidad #modalPreventivo.active {
    align-items: flex-start !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  body.ramos-page-calidad #modalPreventivo .modal-card {
    width: 100% !important;
    max-height: calc(100dvh - max(20px, env(safe-area-inset-top)) - max(20px, env(safe-area-inset-bottom))) !important;
    margin: 0 auto !important;
  }
}



/* ===== CALIDAD · Buscadores internos para usuarios y equipo en generación ===== */
body.ramos-page-calidad .autocomplete-wrap {
  position: relative;
  display: grid;
  gap: 6px;
}

body.ramos-page-calidad .autocomplete-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 120;
  display: none;
  max-height: 220px;
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 16px 34px rgba(15, 23, 42, .16);
  padding: 6px;
}

body.ramos-page-calidad .autocomplete-results.active {
  display: grid;
  gap: 5px;
}

body.ramos-page-calidad .autocomplete-item {
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  color: var(--text);
  padding: 10px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 3px;
}

body.ramos-page-calidad .autocomplete-item:hover {
  background: var(--soft);
  border-color: var(--line);
}

body.ramos-page-calidad .autocomplete-item strong {
  font-size: 11px;
  font-weight: 950;
  line-height: 1.15;
}

body.ramos-page-calidad .autocomplete-item small,
body.ramos-page-calidad .input-help {
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.25;
}



/* ===== MANTENIMIENTOS · carga bajo demanda y rango auditor ===== */
body.ramos-page-calidad .maintenance-period-card.has-actions {
  grid-template-rows: auto auto;
}

body.ramos-page-calidad .period-summary-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 0 4px 2px;
}

body.ramos-page-calidad .period-summary-actions .btn-mini {
  width: 100%;
  min-height: 34px;
  padding: 8px 9px;
  border-radius: 12px;
  font-size: 8px;
  letter-spacing: .06em;
}

body.ramos-page-calidad .maintenance-period-side-wide {
  grid-template-columns: repeat(3, minmax(108px, 140px)) repeat(3, minmax(64px, auto)) !important;
  justify-content: end;
  align-items: end;
  gap: 7px !important;
}

body.ramos-page-calidad .maintenance-period-side-wide label {
  gap: 4px;
}

body.ramos-page-calidad .maintenance-period-side-wide .input {
  min-height: 38px;
  padding: 9px 10px;
  border-radius: 13px;
  font-size: 10px;
}

body.ramos-page-calidad .maintenance-period-side-wide .btn-mini {
  min-height: 38px;
  padding: 9px 10px;
  border-radius: 13px;
  font-size: 8px;
  letter-spacing: .06em;
}

body.ramos-page-calidad .maintenance-load-note,
body.ramos-page-calidad .maintenance-info-note {
  border: 1px dashed var(--line);
  background: var(--soft);
  border-radius: 22px;
  padding: 18px;
  display: grid;
  gap: 10px;
}

body.ramos-page-calidad .maintenance-info-note {
  border-style: solid;
  background: rgba(248, 250, 252, .72);
}

body.ramos-page-calidad.dark .maintenance-info-note {
  background: rgba(255, 255, 255, .035);
}

body.ramos-page-calidad .maintenance-action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

body.ramos-page-calidad .maintenance-day-text-list {
  display: grid;
  gap: 8px;
}

body.ramos-page-calidad .maintenance-day-text-row {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 16px;
  padding: 11px 12px;
  display: grid;
  grid-template-columns: minmax(140px, .85fr) minmax(220px, 1.35fr) minmax(160px, .9fr) auto;
  gap: 10px;
  align-items: center;
}

body.ramos-page-calidad .maintenance-day-text-main {
  min-width: 0;
}

body.ramos-page-calidad .maintenance-day-text-title {
  margin: 0;
  font-size: 12px;
  font-weight: 950;
  color: var(--text);
  line-height: 1.2;
}

body.ramos-page-calidad .maintenance-day-text-sub {
  margin: 3px 0 0;
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
  line-height: 1.25;
}

body.ramos-page-calidad .maintenance-day-mode-note {
  border: 1px solid var(--line);
  background: rgba(248, 250, 252, .72);
  border-radius: 18px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

body.ramos-page-calidad .maintenance-day-total {
  border: 1px solid var(--line);
  background: var(--soft);
  border-radius: 12px;
  padding: 6px 7px;
  font-size: 10px;
  font-weight: 950;
  color: var(--text);
  line-height: 1.15;
}

body.ramos-page-calidad .maintenance-day-total strong {
  font-size: 14px;
}

body.ramos-page-calidad.dark .maintenance-day-mode-note {
  background: rgba(255, 255, 255, .035);
}


body.ramos-page-calidad .daily-pdf-panel {
  margin: 0 16px 14px;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(280px, 420px);
  gap: 14px;
  align-items: center;
  border: 1px solid #bfdbfe;
  border-radius: 24px;
  background:
    radial-gradient(circle at 0% 0%, rgba(37, 99, 235, .12), transparent 34%),
    var(--card);
  box-shadow: 0 10px 28px rgba(15, 23, 42, .055);
}

body.ramos-page-calidad.dark .daily-pdf-panel {
  border-color: rgba(56, 189, 248, .26);
  background:
    radial-gradient(circle at 0% 0%, rgba(56, 189, 248, .10), transparent 34%),
    var(--card);
}

body.ramos-page-calidad .daily-pdf-title {
  margin: 0;
  font-size: 15px;
  font-weight: 950;
  letter-spacing: -.025em;
  color: var(--text);
}

body.ramos-page-calidad .daily-pdf-text {
  margin: 5px 0 0;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.45;
  color: var(--muted);
}

body.ramos-page-calidad .daily-pdf-controls {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

body.ramos-page-calidad .daily-pdf-controls .btn {
  min-height: 46px;
  padding: 12px 14px;
}

body.ramos-page-calidad .daily-pdf-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 9px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 7px;
}

body.ramos-page-calidad.dark .daily-pdf-chip {
  background: rgba(59, 130, 246, .14);
  color: #bfdbfe;
  border-color: rgba(59, 130, 246, .26);
}

@media (max-width: 900px) {
  body.ramos-page-calidad .maintenance-day-text-row {
    grid-template-columns: 1fr;
  }

  body.ramos-page-calidad .maintenance-day-mode-note .btn {
    width: 100%;
  }

  body.ramos-page-calidad .daily-pdf-panel {
    grid-template-columns: 1fr;
  }

  body.ramos-page-calidad .daily-pdf-controls {
    grid-template-columns: 1fr 1fr !important;
  }
}

@media (max-width: 1320px) {
  body.ramos-page-calidad .compact-period-toolbar {
    grid-template-columns: 1fr !important;
  }

  body.ramos-page-calidad .maintenance-period-side-wide {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    justify-content: stretch;
  }

  body.ramos-page-calidad .maintenance-period-side-wide .btn-mini {
    width: 100%;
  }
}

@media (max-width: 640px) {
  body.ramos-page-calidad .maintenance-period-side-wide {
    grid-template-columns: 1fr !important;
  }

  body.ramos-page-calidad .daily-pdf-panel {
    margin: 0 12px 12px;
    padding: 12px;
    border-radius: 22px;
  }

  body.ramos-page-calidad .daily-pdf-controls {
    grid-template-columns: 1fr !important;
  }

  body.ramos-page-calidad .daily-pdf-controls .btn {
    width: 100%;
  }
}



/* close-btn ya va primero en el DOM en todos los modales */



/* ===== CALIDAD · FIX cabecera ficha mantenimiento =====
       Mantiene la X siempre arriba a la derecha aunque el título sea largo
       (por ejemplo SELLMAN · Selladoras manuales...). Solo afecta a esta ficha.
    */
body.ramos-page-calidad #modalFichaMantenimiento .drawer-sticky-head {
  position: sticky !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: flex-start !important;
  gap: 14px !important;
  flex-wrap: nowrap !important;
}

body.ramos-page-calidad #modalFichaMantenimiento .drawer-sticky-head>div:first-child {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  padding-right: 6px !important;
}

/* close-btn ya va primero en DOM, la regla base lo fija arriba-izquierda */



/* ===== INFORME DIARIO PDF · fila compacta día/rango ===== */
body.ramos-page-calidad .daily-pdf-panel {
  grid-template-columns: minmax(260px, .95fr) minmax(560px, 1.35fr) !important;
  align-items: center !important;
}

body.ramos-page-calidad #dailyPdfControls.daily-pdf-controls {
  grid-template-columns: minmax(145px, .9fr) minmax(165px, 1fr) minmax(145px, auto) !important;
  gap: 8px !important;
  align-items: end !important;
  width: 100% !important;
  min-width: 0 !important;
}

body.ramos-page-calidad #dailyPdfControls.daily-pdf-controls.rango-mode {
  grid-template-columns: minmax(135px, .8fr) minmax(145px, .85fr) minmax(145px, .85fr) minmax(135px, auto) !important;
}

body.ramos-page-calidad #dailyPdfControls label,
body.ramos-page-calidad #dailyPdfControls .input,
body.ramos-page-calidad #dailyPdfControls .select {
  min-width: 0 !important;
}

body.ramos-page-calidad #dailyPdfControls .btn {
  width: 100% !important;
  min-width: 124px !important;
  padding-left: 10px !important;
  padding-right: 10px !important;
  white-space: nowrap !important;
}

@media (max-width: 1180px) {
  body.ramos-page-calidad .daily-pdf-panel {
    grid-template-columns: 1fr !important;
  }

  body.ramos-page-calidad #dailyPdfControls.daily-pdf-controls,
  body.ramos-page-calidad #dailyPdfControls.daily-pdf-controls.rango-mode {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 820px) {

  body.ramos-page-calidad #dailyPdfControls.daily-pdf-controls,
  body.ramos-page-calidad #dailyPdfControls.daily-pdf-controls.rango-mode {
    grid-template-columns: 1fr 1fr !important;
  }
}

@media (max-width: 520px) {

  body.ramos-page-calidad #dailyPdfControls.daily-pdf-controls,
  body.ramos-page-calidad #dailyPdfControls.daily-pdf-controls.rango-mode {
    grid-template-columns: 1fr !important;
  }

  body.ramos-page-calidad #dailyPdfControls .btn {
    min-width: 0 !important;
  }
}



/* ===== CALIDAD · Control diario simplificado ===== */
body.ramos-page-calidad .daily-control-panel {
  margin: 16px;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 12px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(248, 250, 252, .78);
  box-shadow: 0 8px 20px rgba(15, 23, 42, .035);
}

body.ramos-page-calidad.dark .daily-control-panel {
  background: rgba(255, 255, 255, .035);
}

body.ramos-page-calidad .daily-control-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: end;
}

body.ramos-page-calidad .daily-control-actions .btn {
  min-height: 42px;
  padding: 11px 13px;
  font-size: 9px;
}

body.ramos-page-calidad .daily-control-status {
  margin: 0 16px 14px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 22px;
  padding: 14px;
  display: grid;
  gap: 12px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .035);
}

body.ramos-page-calidad .daily-control-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

body.ramos-page-calidad .daily-control-kpi {
  border: 1px solid var(--line);
  background: var(--soft);
  border-radius: 16px;
  padding: 10px;
  min-width: 0;
}

body.ramos-page-calidad .daily-control-kpi p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
}

body.ramos-page-calidad .daily-control-kpi strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
  font-weight: 950;
  color: var(--text);
  letter-spacing: -.035em;
}

body.ramos-page-calidad .daily-control-list {
  display: grid;
  gap: 8px;
}

body.ramos-page-calidad .daily-control-row {
  border: 1px solid var(--line);
  border-left: 5px solid var(--green);
  background: var(--card);
  border-radius: 18px;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(130px, .75fr) minmax(120px, .65fr) minmax(180px, 1.1fr) auto;
  gap: 10px;
  align-items: center;
}

body.ramos-page-calidad .daily-control-row.estado-incidencia,
body.ramos-page-calidad .daily-control-row.estado-no-realizado {
  border-left-color: var(--red);
  background: linear-gradient(90deg, rgba(254, 226, 226, .92), var(--card) 34%);
}

body.ramos-page-calidad .daily-control-row.estado-observacion {
  border-left-color: var(--amber);
  background: linear-gradient(90deg, rgba(254, 243, 199, .92), var(--card) 34%);
}

body.ramos-page-calidad.dark .daily-control-row.estado-incidencia,
body.ramos-page-calidad.dark .daily-control-row.estado-no-realizado {
  background: linear-gradient(90deg, rgba(220, 38, 38, .16), var(--card) 35%);
}

body.ramos-page-calidad.dark .daily-control-row.estado-observacion {
  background: linear-gradient(90deg, rgba(217, 119, 6, .16), var(--card) 35%);
}

body.ramos-page-calidad .daily-control-main h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 950;
  color: var(--text);
  line-height: 1.2;
}

body.ramos-page-calidad .daily-control-main p {
  margin: 4px 0 0;
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
  line-height: 1.3;
}

body.ramos-page-calidad .daily-control-field-label {
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: 3px;
}

body.ramos-page-calidad .daily-control-field-value {
  font-size: 11px;
  font-weight: 900;
  color: var(--text);
  line-height: 1.25;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

body.ramos-page-calidad .daily-control-row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

body.ramos-page-calidad .daily-control-row-actions .btn {
  min-height: 34px;
  padding: 8px 9px;
  font-size: 8px;
  border-radius: 12px;
}

body.ramos-page-calidad .daily-control-section {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

body.ramos-page-calidad .daily-control-section-head {
  border: 1px solid var(--line);
  background: rgba(248, 250, 252, .82);
  border-radius: 18px;
  padding: 11px 13px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

body.ramos-page-calidad.dark .daily-control-section-head {
  background: rgba(255, 255, 255, .035);
}

body.ramos-page-calidad .daily-control-section-title {
  margin: 0;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--primary);
}

body.ramos-page-calidad .daily-control-section-count {
  border-radius: 999px;
  padding: 5px 9px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
}

body.ramos-page-calidad .daily-control-row.control-produccion {
  border-left-color: #0ea5e9;
}

body.ramos-page-calidad .daily-control-row.control-produccion .daily-control-main h4::before {
  content: "📘 ";
}

body.ramos-page-calidad .daily-control-row.control-preventivo .daily-control-main h4::before {
  content: "🛠️ ";
}

@media (max-width: 980px) {
  body.ramos-page-calidad .daily-control-panel {
    grid-template-columns: 1fr;
    margin: 12px;
  }

  body.ramos-page-calidad .daily-control-actions {
    justify-content: stretch;
  }

  body.ramos-page-calidad .daily-control-actions .btn {
    flex: 1 1 130px;
  }

  body.ramos-page-calidad .daily-control-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.ramos-page-calidad .daily-control-row {
    grid-template-columns: 1fr 1fr;
  }

  body.ramos-page-calidad .daily-control-main,
  body.ramos-page-calidad .daily-control-row-actions {
    grid-column: 1/-1;
  }

  body.ramos-page-calidad .daily-control-row-actions {
    justify-content: stretch;
  }

  body.ramos-page-calidad .daily-control-row-actions .btn {
    flex: 1 1 110px;
  }
}

@media (max-width: 640px) {
  body.ramos-page-calidad .daily-control-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.ramos-page-calidad .daily-control-row {
    grid-template-columns: 1fr;
  }
}

/* ===== CONTROL DIARIO · detalle de línea / periodo ===== */
body.ramos-page-calidad .control-detail-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

body.ramos-page-calidad .control-detail-month-list {
  display: grid;
  gap: 8px;
}

body.ramos-page-calidad .control-detail-day-block {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 18px;
  padding: 12px;
  display: grid;
  gap: 8px;
}

body.ramos-page-calidad .control-detail-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

body.ramos-page-calidad .control-detail-day-title {
  margin: 0;
  font-size: 12px;
  font-weight: 950;
  color: var(--text);
  letter-spacing: -.02em;
}

body.ramos-page-calidad .control-detail-line {
  border: 1px solid var(--line);
  background: var(--soft);
  border-radius: 14px;
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(160px, 1.2fr) minmax(100px, .65fr) minmax(180px, 1fr);
  gap: 8px;
  align-items: start;
}

body.ramos-page-calidad .control-detail-line-title {
  margin: 0;
  font-size: 11px;
  font-weight: 950;
  color: var(--text);
  line-height: 1.2;
}

body.ramos-page-calidad .control-detail-line-sub {
  margin: 3px 0 0;
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
  line-height: 1.25;
}

@media (max-width: 720px) {
  body.ramos-page-calidad .control-detail-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.ramos-page-calidad .control-detail-line {
    grid-template-columns: 1fr;
  }
}




/* ===== CALIDAD · Guía de mantenimientos para auditoría ===== */
body.ramos-page-calidad .guide-panel {
  margin: 16px;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 12px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(248, 250, 252, .78);
  box-shadow: 0 8px 20px rgba(15, 23, 42, .035);
}

body.ramos-page-calidad.dark .guide-panel {
  background: rgba(255, 255, 255, .035);
}

body.ramos-page-calidad .guide-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: end;
}

body.ramos-page-calidad .guide-actions .btn {
  min-height: 42px;
  padding: 11px 13px;
  font-size: 9px;
}

body.ramos-page-calidad .guide-note {
  margin: 0 16px 14px;
  border: 1px solid #bfdbfe;
  background: linear-gradient(135deg, #eff6ff, rgba(248, 250, 252, .92));
  border-radius: 22px;
  padding: 14px;
  display: grid;
  gap: 6px;
}

body.ramos-page-calidad.dark .guide-note {
  background: rgba(56, 189, 248, .10);
  border-color: rgba(56, 189, 248, .24);
}

body.ramos-page-calidad .guide-note h4 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 950;
  letter-spacing: -.02em;
}

body.ramos-page-calidad .guide-note p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.45;
}

body.ramos-page-calidad .guide-summary {
  margin: 0 16px 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

body.ramos-page-calidad .guide-kpi {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 16px;
  padding: 11px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .035);
}

body.ramos-page-calidad .guide-kpi p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
}

body.ramos-page-calidad .guide-kpi strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 22px;
  font-weight: 950;
  letter-spacing: -.035em;
}

body.ramos-page-calidad .guide-content {
  padding: 0 16px 16px;
  display: grid;
  gap: 10px;
}

body.ramos-page-calidad .guide-day {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .035);
}

body.ramos-page-calidad .guide-day-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(248, 250, 252, .82);
  border-bottom: 1px solid var(--line);
}

body.ramos-page-calidad.dark .guide-day-head {
  background: rgba(255, 255, 255, .035);
}

body.ramos-page-calidad .guide-day-title {
  margin: 0;
  font-size: 13px;
  font-weight: 950;
  color: var(--text);
  letter-spacing: -.02em;
}

body.ramos-page-calidad .guide-day-count {
  border-radius: 999px;
  padding: 5px 9px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
}

body.ramos-page-calidad .guide-block {
  padding: 12px 14px;
  display: grid;
  gap: 8px;
}

body.ramos-page-calidad .guide-block+.guide-block {
  border-top: 1px solid var(--line);
}

body.ramos-page-calidad .guide-block-title {
  margin: 0;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--primary);
}

body.ramos-page-calidad .guide-line {
  border: 1px solid var(--line);
  border-left: 5px solid var(--green);
  background: var(--soft);
  border-radius: 16px;
  padding: 10px 11px;
  display: grid;
  grid-template-columns: minmax(160px, 1.1fr) minmax(130px, .75fr) minmax(180px, 1fr);
  gap: 9px;
  align-items: start;
}

body.ramos-page-calidad .guide-line.produccion {
  border-left-color: #0ea5e9;
  background: linear-gradient(90deg, rgba(224, 242, 254, .92), var(--soft) 40%);
}

body.ramos-page-calidad.dark .guide-line.produccion {
  background: linear-gradient(90deg, rgba(14, 165, 233, .16), var(--soft) 40%);
}

body.ramos-page-calidad .guide-line h5 {
  margin: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 950;
  line-height: 1.2;
}

body.ramos-page-calidad .guide-line p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.3;
}

body.ramos-page-calidad .guide-field-label {
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: 3px;
}

body.ramos-page-calidad .guide-field-value {
  font-size: 11px;
  font-weight: 900;
  color: var(--text);
  line-height: 1.25;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  body.ramos-page-calidad .guide-panel {
    grid-template-columns: 1fr;
    margin: 12px;
  }

  body.ramos-page-calidad .guide-actions {
    justify-content: stretch;
  }

  body.ramos-page-calidad .guide-actions .btn {
    flex: 1 1 130px;
  }

  body.ramos-page-calidad .guide-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0 12px 12px;
  }

  body.ramos-page-calidad .guide-content {
    padding: 0 12px 12px;
  }

  body.ramos-page-calidad .guide-note {
    margin: 0 12px 12px;
  }

  body.ramos-page-calidad .guide-line {
    grid-template-columns: 1fr;
  }
}

@media print {

  body.ramos-page-calidad .glass,
  body.ramos-page-calidad .sidebar,
  body.ramos-page-calidad .hero,
  body.ramos-page-calidad .guide-panel .guide-actions,
  body.ramos-page-calidad .top-actions {
    display: none !important;
  }

  body.ramos-page-calidad {
    background: white !important;
    color: #0f172a !important;
  }

  body.ramos-page-calidad .layout {
    display: block !important;
  }

  body.ramos-page-calidad .card,
  body.ramos-page-calidad .guide-day,
  body.ramos-page-calidad .guide-kpi,
  body.ramos-page-calidad .guide-note {
    box-shadow: none !important;
    break-inside: avoid;
  }

  body.ramos-page-calidad #view-guia-mantenimiento {
    display: block !important;
  }
}



/* ===== CALIDAD · Menú móvil en 2 columnas =====
       Solo afecta a la disposición visual del menú en móvil.
       No modifica permisos, Firebase ni lógica de botones.
    */
@media (max-width: 640px) {
  body.ramos-page-calidad .side-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  body.ramos-page-calidad .side-btn {
    min-height: 78px !important;
    align-items: flex-start !important;
    padding: 11px 10px !important;
    gap: 8px !important;
  }

  body.ramos-page-calidad .side-icon {
    width: 32px !important;
    height: 32px !important;
    border-radius: 13px !important;
    font-size: 14px !important;
  }

  body.ramos-page-calidad .side-text strong {
    font-size: 10px !important;
    line-height: 1.12 !important;
  }

  body.ramos-page-calidad .side-text small {
    font-size: 8px !important;
    line-height: 1.15 !important;
  }
}

@media (max-width: 360px) {
  body.ramos-page-calidad .side-nav {
    grid-template-columns: 1fr !important;
  }

  body.ramos-page-calidad .side-btn {
    min-height: 58px !important;
    align-items: center !important;
  }
}


/* =========================================================
   ESTILOS ORIGINALES ESCOPADOS · INCIDENCIAS
   ========================================================= */

body.ramos-page-incidencias.dark {
  --bg: #0f172a;
  --card: #172033;
  --text: #eff6ff;
  --muted: #94a3b8;
  --line: rgba(255, 255, 255, .10);
  --soft: #111827;
  --primary: #38bdf8;
  --shadow: 0 14px 34px rgba(0, 0, 0, .24);
}

body.ramos-page-incidencias * {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body.ramos-page-incidencias {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  font-size: 13px;
}

body.ramos-page-incidencias .hidden {
  display: none !important;
}

body.ramos-page-incidencias .glass {
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(15, 23, 42, .06);
}

body.ramos-page-incidencias.dark .glass {
  background: rgba(15, 23, 42, .90);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

body.ramos-page-incidencias .desktop-shell {
  max-width: 1400px;
  margin: 0 auto;
}

body.ramos-page-incidencias .app-logo {
  height: 34px;
  max-width: 140px;
  object-fit: contain;
  display: block;
}

@media (max-width:420px) {
  body.ramos-page-incidencias .app-logo {
    height: 28px;
    max-width: 110px;
  }
}

body.ramos-page-incidencias .card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1.45rem;
  box-shadow: var(--shadow);
}

body.ramos-page-incidencias .input-field,
body.ramos-page-incidencias .search-field,
body.ramos-page-incidencias .filter-select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--text);
  outline: none;
}

body.ramos-page-incidencias .input-field {
  border-radius: .85rem;
  padding: .72rem .85rem;
  font-size: 13px;
}

body.ramos-page-incidencias .search-field {
  border-radius: 1rem;
  padding: .85rem 1rem;
  font-weight: 800;
}

body.ramos-page-incidencias .filter-select {
  border-radius: .85rem;
  padding: .62rem;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--muted);
}

body.ramos-page-incidencias textarea.input-field {
  min-height: 110px;
  resize: vertical;
}

body.ramos-page-incidencias .label-tag {
  display: block;
  margin-bottom: .28rem;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}

body.ramos-page-incidencias .btn {
  border: 0;
  cursor: pointer;
  transition: transform .12s ease, opacity .15s ease, box-shadow .15s ease;
}

body.ramos-page-incidencias .btn:active {
  transform: scale(.97);
}

body.ramos-page-incidencias .btn[disabled] {
  opacity: .55;
  pointer-events: none;
}

body.ramos-page-incidencias .status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: .35rem .65rem;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}

body.ramos-page-incidencias .estado-proceso {
  background: #dbeafe;
  color: #1d4ed8;
}

body.ramos-page-incidencias .estado-solucionada {
  background: #dcfce7;
  color: #166534;
}

body.ramos-page-incidencias .estado-nosol {
  background: #fee2e2;
  color: #991b1b;
}

body.ramos-page-incidencias .prioridad-alta {
  background: #fee2e2;
  color: #991b1b;
}

body.ramos-page-incidencias .prioridad-normal {
  background: #f1f5f9;
  color: #475569;
}

body.ramos-page-incidencias.dark .prioridad-normal {
  background: rgba(255, 255, 255, .08);
  color: #cbd5e1;
}

body.ramos-page-incidencias .kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .75rem;
}

body.ramos-page-incidencias .kpi {
  padding: 1rem;
  border-radius: 1.35rem;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  min-height: 96px;
}

body.ramos-page-incidencias .kpi p {
  margin: 0;
}

body.ramos-page-incidencias .kpi-label {
  font-size: 10px;
  color: var(--muted);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}

body.ramos-page-incidencias .kpi-value {
  font-size: 30px;
  line-height: 1;
  font-weight: 900;
  margin-top: .45rem !important;
}

body.ramos-page-incidencias .kpi-help {
  font-size: 10px;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.3;
  margin-top: .5rem !important;
}

body.ramos-page-incidencias .mobile-view {
  display: block;
}

body.ramos-page-incidencias .desktop-view {
  display: none;
}

@media (min-width:900px) {
  body.ramos-page-incidencias {
    font-size: 14px;
  }

  body.ramos-page-incidencias .mobile-view {
    display: none;
  }

  body.ramos-page-incidencias .desktop-view {
    display: block;
  }
}

@media (max-width:720px) {
  body.ramos-page-incidencias .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  body.ramos-page-incidencias .kpi {
    min-height: 86px;
    padding: .85rem;
  }

  body.ramos-page-incidencias .kpi-value {
    font-size: 25px;
  }
}

body.ramos-page-incidencias .mobile-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 55%, #2563eb 100%);
  color: white;
  border-radius: 1.8rem;
  padding: 1.15rem;
  box-shadow: 0 14px 32px rgba(15, 23, 42, .18);
}

body.ramos-page-incidencias .mobile-stat {
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 1.15rem;
  padding: .72rem;
  backdrop-filter: blur(10px);
}

body.ramos-page-incidencias .inc-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  padding: 1rem;
  box-shadow: var(--shadow);
}

body.ramos-page-incidencias .inc-card.alta {
  border-color: #ef4444;
  box-shadow: 0 16px 34px rgba(239, 68, 68, .12);
}

body.ramos-page-incidencias .inc-title {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -.02em;
  line-height: 1.15;
  margin: 0;
}

body.ramos-page-incidencias .inc-meta {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
}

body.ramos-page-incidencias .desc-box {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  padding: .85rem;
}

body.ramos-page-incidencias .modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(15, 23, 42, .72);
  align-items: flex-end;
  padding: 1rem;
}

body.ramos-page-incidencias .modal.active {
  display: flex;
}

@media (min-width:900px) {
  body.ramos-page-incidencias .modal {
    align-items: center;
    justify-content: center;
  }
}

body.ramos-page-incidencias .modal-card {
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 1.8rem;
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

body.ramos-page-incidencias .table-row:hover {
  background: rgba(37, 99, 235, .06);
  cursor: pointer;
}

body.ramos-page-incidencias.dark .table-row:hover {
  background: rgba(255, 255, 255, .05);
}

body.ramos-page-incidencias .desktop-table-wrap {
  max-height: calc(100vh - 365px);
  overflow: auto;
}

body.ramos-page-incidencias .desktop-table thead th {
  position: sticky;
  top: 0;
  background: var(--soft);
  z-index: 5;
}

body.ramos-page-incidencias .side-panel {
  position: fixed;
  right: -500px;
  top: 0;
  width: 500px;
  max-width: 94vw;
  height: 100%;
  background: var(--card);
  color: var(--text);
  box-shadow: -10px 0 30px rgba(15, 23, 42, .22);
  transition: right .25s ease;
  z-index: 80;
  overflow-y: auto;
  border-left: 1px solid var(--line);
}

body.ramos-page-incidencias .side-panel.active {
  right: 0;
}

body.ramos-page-incidencias .panel-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .32);
  z-index: 70;
}

body.ramos-page-incidencias .panel-backdrop.active {
  display: block;
}

body.ramos-page-incidencias .timeline {
  border-left: 2px solid var(--line);
  padding-left: 14px;
  margin-left: 6px;
  position: relative;
}

body.ramos-page-incidencias .timeline-dot {
  position: absolute;
  left: -6px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #2563eb;
}


body.ramos-page-incidencias .collapsible-body {
  display: none;
}

body.ramos-page-incidencias .collapsible-body.open {
  display: block;
}


body.ramos-page-incidencias .truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== FIX: KPIs escritorio ocultos en móvil ===== */
@media (max-width: 899px) {
  body.ramos-page-incidencias .desktop-kpi-grid {
    display: none !important;
  }
}

@media (min-width: 900px) {
  body.ramos-page-incidencias .desktop-kpi-grid {
    display: grid !important;
  }
}


/* ===== PANEL DETALLE PRO iOS / APP REAL ===== */
body.ramos-page-incidencias .side-panel {
  height: 100dvh;
  max-height: 100dvh;
  transform: translateX(100%);
  right: 0 !important;
  transition: transform .28s cubic-bezier(.2, .8, .2, 1), box-shadow .28s ease;
  will-change: transform;
}

body.ramos-page-incidencias .side-panel.active {
  transform: translateX(0);
}

body.ramos-page-incidencias .panel-backdrop {
  opacity: 0;
  transition: opacity .22s ease;
  pointer-events: none;
}

body.ramos-page-incidencias .panel-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

body.ramos-page-incidencias .panel-sticky-head {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: -1.5rem -1.5rem 1.8rem -1.5rem;
  padding: calc(1rem + env(safe-area-inset-top)) 1.5rem 1rem 1.5rem;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

body.ramos-page-incidencias .panel-close-btn {
  position: sticky;
  top: calc(.75rem + env(safe-area-inset-top));
  z-index: 25;
  align-self: flex-start;
  flex-shrink: 0;
}

@supports (height: 100dvh) {
  body.ramos-page-incidencias .side-panel {
    height: 100dvh;
    max-height: 100dvh;
  }
}

@supports (padding: max(0px)) {
  body.ramos-page-incidencias .side-panel {
    padding-top: 0 !important;
    padding-bottom: max(20px, env(safe-area-inset-bottom)) !important;
    -webkit-overflow-scrolling: touch;
  }

  body.ramos-page-incidencias #panel-content {
    min-height: 100dvh;
    padding-top: 0 !important;
    padding-bottom: max(24px, env(safe-area-inset-bottom)) !important;
  }
}

/* ===== Ajustes seguros v6 ===== */
body.ramos-page-incidencias select.input-field,
body.ramos-page-incidencias select.filter-select {
  appearance: auto !important;
  -webkit-appearance: menulist !important;
  cursor: pointer;
  pointer-events: auto !important;
}

body.ramos-page-incidencias .priority-field-safe {
  display: none !important;
}

body.ramos-page-incidencias .inc-safe-hero {
  background: radial-gradient(circle at 0% 0%, rgba(37, 99, 235, .22), transparent 35%), linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #1d4ed8 100%);
  color: white;
  border-radius: 2rem;
  padding: 1.25rem;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .18);
}

@media (min-width:900px) {
  body.ramos-page-incidencias .desktop-shell {
    max-width: 1480px;
  }

  body.ramos-page-incidencias main.desktop-shell {
    max-width: 1480px;
  }

  body.ramos-page-incidencias .desktop-view .card,
  body.ramos-page-incidencias .kpi {
    border-radius: 1.55rem;
  }
}

/* ===== Incidencias PRO 2 columnas v9 seguro ===== */
body.ramos-page-incidencias .incidencias-two-col-shell {
  max-width: 1480px;
  margin: 0 auto;
}

body.ramos-page-incidencias .incidencias-two-col-layout {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

body.ramos-page-incidencias .incidencias-side-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

body.ramos-page-incidencias .incidencias-main-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

body.ramos-page-incidencias .inc-action-tile-safe {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1.45rem;
  padding: .95rem;
  text-align: left;
  display: flex;
  align-items: center;
  gap: .8rem;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .055);
  transition: .16s ease;
}

body.ramos-page-incidencias .inc-action-tile-safe:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(15, 23, 42, .08);
}

body.ramos-page-incidencias .inc-action-icon-safe {
  width: 42px;
  height: 42px;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 900;
  font-size: 18px;
  flex-shrink: 0;
}

body.ramos-page-incidencias .inc-action-tile-safe strong {
  display: block;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text);
}

body.ramos-page-incidencias .inc-action-tile-safe span {
  display: block;
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
  margin-top: .15rem;
  line-height: 1.2;
}



body.ramos-page-incidencias .inc-hist-filter-box {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 1.35rem;
  padding: .9rem;
}

body.ramos-page-incidencias .inc-hist-filter-check {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: .65rem .75rem;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text);
  cursor: pointer;
}

body.ramos-page-incidencias .inc-hist-filter-check input {
  width: 16px;
  height: 16px;
  accent-color: #2563eb;
}

body.ramos-page-incidencias .inc-list-pro-safe {
  border-radius: 1.65rem !important;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .055) !important;
}

body.ramos-page-incidencias .inc-list-pro-safe .desktop-table-wrap {
  max-height: calc(100vh - 390px);
}

@media (max-width:1199px) {
  body.ramos-page-incidencias .incidencias-two-col-shell {
    max-width: 980px
  }

  body.ramos-page-incidencias .incidencias-two-col-layout {
    grid-template-columns: 1fr
  }

  body.ramos-page-incidencias .incidencias-side-col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width:899px) {
  body.ramos-page-incidencias .incidencias-two-col-layout {
    display: none !important;
  }
}

/* ===== FIX ANDROID: select compacto + adjuntos en español ===== */
body.ramos-page-incidencias .area-picker-btn {
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 46px;
  font-weight: 800;
}

body.ramos-page-incidencias .area-picker-btn::after {
  content: "⌄";
  font-size: 16px;
  color: var(--muted);
  margin-left: .75rem;
}

body.ramos-page-incidencias .area-picker-menu {
  display: none;
  margin-top: .5rem;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 1rem;
  padding: .45rem;
  max-height: 230px;
  overflow-y: auto;
  box-shadow: var(--shadow);
  -webkit-overflow-scrolling: touch;
}

body.ramos-page-incidencias .area-picker-menu.open {
  display: grid;
  gap: .35rem;
}

body.ramos-page-incidencias .area-picker-option {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--text);
  border-radius: .85rem;
  padding: .75rem .85rem;
  text-align: left;
  font-size: 13px;
  font-weight: 900;
}

body.ramos-page-incidencias .file-real-input,
body.ramos-page-incidencias .native-file-input {
  position: fixed !important;
  left: 0 !important;
  bottom: 0 !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0.01 !important;
  overflow: hidden !important;
  z-index: -1 !important;
}

body.ramos-page-incidencias .file-picker-box {
  width: 100%;
}

body.ramos-page-incidencias .file-picker-btn,
body.ramos-page-incidencias .file-picker-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 1rem;
  padding: .95rem 1rem;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

body.ramos-page-incidencias .file-picker-btn:active,
body.ramos-page-incidencias .file-picker-button:active {
  transform: scale(.99);
}

body.ramos-page-incidencias.dark .file-picker-btn,
body.ramos-page-incidencias.dark .file-picker-button {
  background: rgba(59, 130, 246, .14) !important;
  color: #93c5fd !important;
  border-color: rgba(59, 130, 246, .22) !important;
}

@media (max-width:899px) {

  body.ramos-page-incidencias select.input-field,
  body.ramos-page-incidencias select.filter-select,
  body.ramos-page-incidencias input.input-field,
  body.ramos-page-incidencias textarea.input-field {
    font-size: 16px !important;
  }

  body.ramos-page-incidencias .modal-card {
    max-height: calc(92dvh - env(safe-area-inset-top));
  }
}


/* ===== DETALLE DERECHO IGUALADO A CALIDAD ===== */
body.ramos-page-incidencias .side-panel {
  width: min(560px, 94vw) !important;
  min-height: 100dvh;
  max-height: 100dvh;
  border-radius: 32px 0 0 32px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
  border-right: 0;
  box-shadow: -24px 0 70px rgba(0, 0, 0, .28);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body.ramos-page-incidencias .panel-backdrop {
  background: rgba(15, 23, 42, .42) !important;
}

body.ramos-page-incidencias .panel-sticky-head {
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

body.ramos-page-incidencias.dark .panel-sticky-head {
  background: rgba(23, 32, 51, .94);
}

@media (max-width: 640px) {
  body.ramos-page-incidencias .side-panel {
    width: 100% !important;
    max-width: 100vw !important;
    border-radius: 0;
  }
}



/* ===== INCIDENCIAS · Patrón Calidad V1 ===== */
html,
body.ramos-page-incidencias {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none;
}

body.ramos-page-incidencias {
  background:
    radial-gradient(circle at 0% 0%, rgba(37, 99, 235, .12), transparent 32%),
    radial-gradient(circle at 100% 0%, rgba(37, 99, 235, .10), transparent 30%),
    var(--bg) !important;
  touch-action: pan-y;
}

body.ramos-page-incidencias #view-app,
body.ramos-page-incidencias main,
body.ramos-page-incidencias .desktop-shell,
body.ramos-page-incidencias .incidencias-two-col-shell,
body.ramos-page-incidencias .incidencias-two-col-layout,
body.ramos-page-incidencias .incidencias-main-col,
body.ramos-page-incidencias .incidencias-side-col,
body.ramos-page-incidencias .card,
body.ramos-page-incidencias .inc-safe-hero,
body.ramos-page-incidencias .desktop-table-wrap {
  min-width: 0;
  max-width: 100%;
}

body.ramos-page-incidencias #view-app>header.glass {
  min-height: 56px;
  padding: 0 !important;
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, .88) !important;
  backdrop-filter: blur(18px) !important;
  -webkit-backdrop-filter: blur(18px) !important;
  border-bottom: 1px solid rgba(15, 23, 42, .06) !important;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .055) !important;
}

body.ramos-page-incidencias.dark #view-app>header.glass {
  background: rgba(15, 23, 42, .90) !important;
  border-color: rgba(255, 255, 255, .08) !important;
}

body.ramos-page-incidencias #view-app>header .desktop-shell {
  width: min(1480px, calc(100% - 64px));
  max-width: 1480px !important;
  min-height: 56px;
  padding: 0 !important;
  margin: 0 auto;
}

body.ramos-page-incidencias #view-app>header .app-logo {
  height: 36px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

body.ramos-page-incidencias #view-app>header a[href="index.html"] {
  width: 40px !important;
  height: 40px !important;
  border-radius: 999px !important;
  background: #f1f5f9 !important;
  color: #475569 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-decoration: none !important;
  font-weight: 950 !important;
  flex-shrink: 0;
}

body.ramos-page-incidencias.dark #view-app>header a[href="index.html"] {
  background: rgba(255, 255, 255, .08) !important;
  color: #e2e8f0 !important;
}

body.ramos-page-incidencias #user-role-badge {
  font-size: 9px !important;
  font-weight: 950 !important;
  color: var(--primary) !important;
  text-transform: uppercase !important;
  letter-spacing: .12em !important;
  margin: 0 0 2px !important;
}

body.ramos-page-incidencias #view-app>header h1 {
  margin: 0 !important;
  font-size: 20px !important;
  font-weight: 950 !important;
  letter-spacing: -.03em !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.ramos-page-incidencias #theme-btn,
body.ramos-page-incidencias #view-app>header button[onclick="auth.signOut()"] {
  border: 0 !important;
  border-radius: 16px !important;
  padding: 13px 16px !important;
  min-height: 44px !important;
  font-family: inherit !important;
  font-size: 10px !important;
  font-weight: 950 !important;
  text-transform: uppercase !important;
  letter-spacing: .08em !important;
  background: var(--soft) !important;
  color: var(--text) !important;
  border: 1px solid var(--line) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  white-space: nowrap;
}

body.ramos-page-incidencias .incidencias-two-col-shell {
  width: min(1480px, calc(100% - 64px)) !important;
  max-width: 1480px !important;
  padding: 16px 0 34px !important;
  margin: 0 auto !important;
}

body.ramos-page-incidencias .inc-hero-calidad {
  background:
    radial-gradient(circle at 0% 0%, rgba(37, 99, 235, .22), transparent 36%),
    linear-gradient(135deg, #0f172a 0%, #1e293b 52%, #1d4ed8 100%) !important;
  color: white;
  border-radius: 32px !important;
  padding: 20px !important;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .18) !important;
  position: relative;
  overflow: hidden;
}

body.ramos-page-incidencias .inc-hero-calidad:after {
  content: "";
  position: absolute;
  right: -80px;
  top: -90px;
  width: 230px;
  height: 230px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
}

body.ramos-page-incidencias .inc-hero-calidad>* {
  position: relative;
  z-index: 1;
}

body.ramos-page-incidencias .inc-hero-grid-calidad {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: stretch;
  justify-content: space-between;
}

@media (min-width: 1200px) {
  body.ramos-page-incidencias .inc-hero-grid-calidad {
    flex-direction: row;
    align-items: center;
  }
}

body.ramos-page-incidencias .inc-hero-kicker-calidad {
  font-size: 10px !important;
  font-weight: 950 !important;
  text-transform: uppercase !important;
  letter-spacing: .14em !important;
  color: #bfdbfe !important;
  margin: 0 !important;
}

body.ramos-page-incidencias .inc-hero-title-calidad {
  font-size: clamp(24px, 3vw, 30px) !important;
  line-height: 1.05 !important;
  margin: 4px 0 8px !important;
  font-weight: 950 !important;
  letter-spacing: -.045em !important;
  color: white !important;
}

body.ramos-page-incidencias .inc-hero-text-calidad {
  margin: 0 !important;
  max-width: 760px;
  color: #cbd5e1 !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1.45 !important;
}

body.ramos-page-incidencias .inc-hero-user-calidad {
  color: #bfdbfe !important;
  margin: 10px 0 0 !important;
  font-size: 11px !important;
  font-weight: 850 !important;
}

body.ramos-page-incidencias .inc-kpi-hero-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: min(650px, 100%);
}

@media (min-width: 760px) {
  body.ramos-page-incidencias .inc-kpi-hero-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

body.ramos-page-incidencias .inc-kpi-hero-box {
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 18px;
  padding: 12px;
  min-width: 0;
}

body.ramos-page-incidencias .inc-kpi-hero-label {
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .10em;
  color: #bfdbfe;
  margin: 0;
  line-height: 1.15;
  min-height: 22px;
}

body.ramos-page-incidencias .inc-kpi-hero-value {
  font-size: 26px;
  font-weight: 950;
  letter-spacing: -.04em;
  margin: 4px 0 0;
  line-height: 1;
  color: white;
}

body.ramos-page-incidencias .incidencias-two-col-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) !important;
  gap: 16px !important;
  align-items: start;
}

body.ramos-page-incidencias .incidencias-side-col {
  position: sticky;
  top: calc(env(safe-area-inset-top) + 84px);
  align-self: start;
  display: block !important;
}

body.ramos-page-incidencias .incidencias-side-col>.card {
  padding: 14px !important;
  border-radius: 24px !important;
  box-shadow: var(--shadow) !important;
}

body.ramos-page-incidencias .incidencias-side-col>.card>div:first-child p {
  font-size: 10px !important;
  font-weight: 950 !important;
  text-transform: uppercase !important;
  letter-spacing: .08em !important;
  color: var(--muted) !important;
  margin: 0 0 12px !important;
  padding: 0 4px !important;
}

body.ramos-page-incidencias .incidencias-side-col>.card>div:first-child h3 {
  display: none !important;
}

body.ramos-page-incidencias .inc-action-tile-safe {
  width: 100% !important;
  min-height: 58px !important;
  justify-content: flex-start !important;
  text-align: left !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  border-radius: 14px !important;
  padding: 12px 14px !important;
  background: var(--card) !important;
  color: var(--text) !important;
  border: 1px solid var(--line) !important;
  box-shadow: none !important;
  margin-top: 8px !important;
}

body.ramos-page-incidencias .inc-action-tile-safe:hover {
  transform: translateY(-1px);
}

body.ramos-page-incidencias .inc-action-icon-safe {
  width: 34px !important;
  height: 34px !important;
  border-radius: 14px !important;
  background: rgba(37, 99, 235, .10) !important;
  color: var(--primary) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  font-size: 15px !important;
}

body.ramos-page-incidencias .inc-action-tile-safe strong {
  font-size: 11px !important;
  font-weight: 950 !important;
  text-transform: uppercase !important;
  letter-spacing: .05em !important;
  line-height: 1.1 !important;
  color: var(--text) !important;
}

body.ramos-page-incidencias .inc-action-tile-safe span {
  font-size: 9px !important;
  font-weight: 850 !important;
  color: var(--muted) !important;
  letter-spacing: .02em !important;
  line-height: 1.1 !important;
}

body.ramos-page-incidencias #btn-vista-activas.ring-4,
body.ramos-page-incidencias #btn-vista-historico.ring-4 {
  background: #0f172a !important;
  color: #fff !important;
  border-color: #0f172a !important;
  box-shadow: none !important;
  outline: none !important;
}

body.ramos-page-incidencias #btn-vista-activas.ring-4 .inc-action-icon-safe,
body.ramos-page-incidencias #btn-vista-historico.ring-4 .inc-action-icon-safe {
  background: rgba(255, 255, 255, .16) !important;
  color: white !important;
}

body.ramos-page-incidencias #btn-vista-activas.ring-4 strong,
body.ramos-page-incidencias #btn-vista-historico.ring-4 strong,
body.ramos-page-incidencias #btn-vista-activas.ring-4 span,
body.ramos-page-incidencias #btn-vista-historico.ring-4 span {
  color: inherit !important;
  opacity: .95;
}

body.ramos-page-incidencias .inc-hist-filter-box {
  margin-top: 10px !important;
  border-radius: 18px !important;
  padding: 12px !important;
}

body.ramos-page-incidencias .inc-filters-card {
  padding: 16px !important;
  border-radius: 24px !important;
  box-shadow: var(--shadow) !important;
}

body.ramos-page-incidencias .inc-filters-toolbar {
  display: grid !important;
  grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(150px, 190px)) auto !important;
  gap: 10px !important;
  align-items: end !important;
}

body.ramos-page-incidencias .inc-field-label {
  display: grid !important;
  gap: 7px !important;
  font-size: 10px !important;
  font-weight: 950 !important;
  text-transform: uppercase !important;
  letter-spacing: .08em !important;
  color: var(--muted) !important;
  margin: 0 !important;
}

body.ramos-page-incidencias .inc-field-label .search-field,
body.ramos-page-incidencias .inc-field-label .filter-select {
  width: 100% !important;
  border: 1px solid var(--line) !important;
  background: var(--soft) !important;
  border-radius: 16px !important;
  padding: 13px 14px !important;
  outline: none !important;
  font-family: inherit !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  color: var(--text) !important;
  min-height: 46px !important;
  text-transform: none !important;
}

body.ramos-page-incidencias .inc-field-label .filter-select {
  text-transform: uppercase !important;
  letter-spacing: .04em !important;
  color: var(--muted) !important;
}

body.ramos-page-incidencias .inc-field-label .search-field:focus,
body.ramos-page-incidencias .inc-field-label .filter-select:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .10) !important;
  background: var(--card) !important;
}

body.ramos-page-incidencias .inc-filter-clear-btn {
  border: 0 !important;
  border-radius: 16px !important;
  padding: 13px 16px !important;
  min-height: 46px !important;
  font-family: inherit !important;
  font-size: 10px !important;
  font-weight: 950 !important;
  text-transform: uppercase !important;
  letter-spacing: .08em !important;
  cursor: pointer !important;
  background: var(--soft) !important;
  color: var(--text) !important;
  border: 1px solid var(--line) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
}

body.ramos-page-incidencias .inc-list-pro-safe {
  border-radius: 24px !important;
  box-shadow: var(--shadow) !important;
}

body.ramos-page-incidencias .inc-list-pro-safe>div:first-child {
  display: flex !important;
  justify-content: space-between !important;
  align-items: flex-end !important;
  gap: 12px !important;
  padding: 16px !important;
  border-bottom: 1px solid var(--line) !important;
  background: rgba(248, 250, 252, .72) !important;
}

body.ramos-page-incidencias.dark .inc-list-pro-safe>div:first-child {
  background: rgba(255, 255, 255, .03) !important;
}

body.ramos-page-incidencias .inc-list-pro-safe h3 {
  margin: 0 !important;
  font-size: 20px !important;
  font-weight: 950 !important;
  letter-spacing: -.035em !important;
  text-transform: none !important;
}

body.ramos-page-incidencias .inc-list-pro-safe #desktop-count,
body.ramos-page-incidencias .inc-list-pro-safe>div:first-child>p {
  font-size: 10px !important;
  font-weight: 950 !important;
  text-transform: uppercase !important;
  letter-spacing: .08em !important;
  color: var(--muted) !important;
}

body.ramos-page-incidencias .desktop-table-wrap {
  max-height: calc(100vh - 355px) !important;
}

body.ramos-page-incidencias .desktop-table thead th {
  background: var(--soft) !important;
  color: var(--muted) !important;
  font-weight: 950 !important;
}

body.ramos-page-incidencias .side-panel {
  width: min(560px, 94vw) !important;
  max-width: 94vw !important;
  min-height: 100dvh !important;
  max-height: 100dvh !important;
  margin: 0 !important;
  border-radius: 32px 0 0 32px !important;
  box-shadow: -24px 0 70px rgba(0, 0, 0, .28) !important;
  transform: translateX(100%) !important;
  right: 0 !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

body.ramos-page-incidencias .side-panel.active {
  transform: translateX(0) !important;
}

body.ramos-page-incidencias .panel-sticky-head {
  background: rgba(255, 255, 255, .94) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border-bottom: 1px solid var(--line) !important;
}

body.ramos-page-incidencias.dark .panel-sticky-head {
  background: rgba(23, 32, 51, .94) !important;
}

@media (max-width: 1199px) {
  body.ramos-page-incidencias .incidencias-two-col-layout {
    grid-template-columns: 1fr !important;
  }

  body.ramos-page-incidencias .incidencias-side-col {
    position: static !important;
    display: block !important;
  }
}

@media (max-width: 899px) {

  body.ramos-page-incidencias #view-app>header .desktop-shell,
  body.ramos-page-incidencias .incidencias-two-col-shell {
    width: calc(100% - 32px) !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  body.ramos-page-incidencias .incidencias-two-col-shell {
    padding-top: 14px !important;
  }

  body.ramos-page-incidencias .inc-safe-hero {
    border-radius: 28px !important;
  }
}

@media (max-width: 640px) {

  body.ramos-page-incidencias #view-app>header .desktop-shell,
  body.ramos-page-incidencias .incidencias-two-col-shell {
    width: calc(100% - 24px) !important;
  }

  body.ramos-page-incidencias #view-app>header .app-logo {
    height: 30px;
  }

  body.ramos-page-incidencias #view-app>header h1 {
    font-size: 17px !important;
  }

  body.ramos-page-incidencias #theme-btn,
  body.ramos-page-incidencias #view-app>header button[onclick="auth.signOut()"] {
    padding: 10px 11px !important;
  }

  body.ramos-page-incidencias .inc-safe-hero,
  body.ramos-page-incidencias .mobile-hero {
    margin: 0 !important;
    border-radius: 24px !important;
    padding: 18px 16px !important;
  }

  body.ramos-page-incidencias .side-panel {
    width: 100% !important;
    max-width: 100vw !important;
    border-radius: 0 !important;
  }
}




/* ===== iPhone notch safe area ===== */
@supports (padding: max(0px)) {
  body.ramos-page-incidencias {
    padding-top: env(safe-area-inset-top);
  }
}


/* ===== INCIDENCIAS · Buscador + listado unificado como Mediciones ===== */
body.ramos-page-incidencias .inc-unified-list-card {
  padding: 0 !important;
  overflow: hidden !important;
  border-radius: 24px !important;
  box-shadow: var(--shadow) !important;
}

body.ramos-page-incidencias .section-head-incidencias {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 250, 252, .72);
}

body.ramos-page-incidencias.dark .section-head-incidencias {
  background: rgba(255, 255, 255, .03);
}

body.ramos-page-incidencias .section-kicker-incidencias {
  margin: 0;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--primary);
}

body.ramos-page-incidencias .section-title-incidencias {
  margin: 3px 0 0;
  font-size: 20px;
  font-weight: 950;
  letter-spacing: -.035em;
  color: var(--text);
  text-transform: none;
}

body.ramos-page-incidencias .section-help-incidencias {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
  text-transform: none;
  letter-spacing: 0;
}

body.ramos-page-incidencias .inc-unified-list-card .inc-filters-toolbar {
  padding: 16px !important;
  display: grid !important;
  grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(150px, 190px)) auto !important;
  gap: 10px !important;
  align-items: end !important;
  border-bottom: 1px solid var(--line) !important;
}

body.ramos-page-incidencias .inc-list-unified {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  overflow: hidden !important;
}

body.ramos-page-incidencias .inc-list-head-unified {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 250, 252, .72);
}

body.ramos-page-incidencias.dark .inc-list-head-unified {
  background: rgba(255, 255, 255, .03);
}

body.ramos-page-incidencias .inc-list-head-unified h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 950;
  letter-spacing: -.035em;
  color: var(--text);
  text-transform: none;
}

body.ramos-page-incidencias .inc-list-head-unified #desktop-count,
body.ramos-page-incidencias .inc-list-head-unified>p {
  margin: 0;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}

body.ramos-page-incidencias .inc-unified-list-card .desktop-table-wrap {
  max-height: calc(100vh - 330px) !important;
}

@media (max-width: 1199px) {
  body.ramos-page-incidencias .inc-unified-list-card .inc-filters-toolbar {
    grid-template-columns: 1fr 1fr !important;
  }
}

@media (max-width: 720px) {

  body.ramos-page-incidencias .section-head-incidencias,
  body.ramos-page-incidencias .inc-list-head-unified {
    display: grid;
    gap: 10px;
  }

  body.ramos-page-incidencias .inc-unified-list-card .inc-filters-toolbar {
    grid-template-columns: 1fr !important;
  }

  body.ramos-page-incidencias .inc-filter-clear-btn {
    width: 100%;
  }
}


/* ===== INCIDENCIAS · Asignación admin al crear ===== */
body.ramos-page-incidencias .inc-admin-assign-box {
  border: 1px solid #bfdbfe;
  background: linear-gradient(135deg, #eff6ff, #f8fafc);
  border-radius: 1.25rem;
  padding: .95rem;
  display: grid;
  gap: .75rem;
}

body.ramos-page-incidencias .inc-admin-assign-head {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
}

body.ramos-page-incidencias .inc-admin-assign-icon {
  width: 38px;
  height: 38px;
  border-radius: 1rem;
  background: #2563eb;
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 950;
  flex-shrink: 0;
  box-shadow: 0 10px 22px rgba(37, 99, 235, .18);
}

body.ramos-page-incidencias .inc-admin-assign-title {
  margin: 0;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #1d4ed8;
}

body.ramos-page-incidencias .inc-admin-assign-help {
  margin: .15rem 0 0;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.35;
  color: #64748b;
}

body.ramos-page-incidencias .inc-admin-assign-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
}

body.ramos-page-incidencias .inc-admin-assign-option {
  border: 1px solid #dbeafe;
  background: rgba(255, 255, 255, .82);
  color: #0f172a;
  border-radius: 1rem;
  padding: .75rem .8rem;
  display: flex;
  align-items: center;
  gap: .55rem;
  text-align: left;
  cursor: pointer;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .05em;
}

body.ramos-page-incidencias .inc-admin-assign-option input {
  width: 16px;
  height: 16px;
  accent-color: #2563eb;
  flex-shrink: 0;
}

body.ramos-page-incidencias .inc-admin-assign-search {
  width: 100%;
  min-height: 46px;
  border-radius: 1rem;
  border: 1px solid #bfdbfe;
  background: white;
  color: #0f172a;
  padding: .75rem .85rem;
  font-size: 12px;
  font-weight: 900;
  outline: none;
}

body.ramos-page-incidencias .inc-admin-assign-search:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .10);
}

body.ramos-page-incidencias .inc-admin-assign-list {
  display: grid;
  gap: .45rem;
  max-height: 245px;
  overflow: auto;
  padding-right: .2rem;
}

body.ramos-page-incidencias .inc-admin-assign-user {
  width: 100%;
  border: 1px solid #dbeafe;
  background: rgba(255, 255, 255, .82);
  color: #0f172a;
  border-radius: 1rem;
  padding: .75rem .8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  text-align: left;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}

body.ramos-page-incidencias .inc-admin-assign-user:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(37, 99, 235, .08);
}

body.ramos-page-incidencias .inc-admin-assign-user.active {
  background: #0f172a;
  color: white;
  border-color: #0f172a;
}

body.ramos-page-incidencias .inc-admin-assign-user-main {
  min-width: 0;
}

body.ramos-page-incidencias .inc-admin-assign-user-name {
  display: block;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .035em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.ramos-page-incidencias .inc-admin-assign-user-email {
  display: block;
  margin-top: .15rem;
  font-size: 9px;
  font-weight: 800;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.ramos-page-incidencias .inc-admin-assign-user.active .inc-admin-assign-user-email {
  color: rgba(255, 255, 255, .72);
}

body.ramos-page-incidencias .inc-admin-assign-user-chip {
  flex-shrink: 0;
  border-radius: 999px;
  padding: .3rem .55rem;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-size: 8px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
}

body.ramos-page-incidencias .inc-admin-assign-user.active .inc-admin-assign-user-chip {
  background: rgba(255, 255, 255, .14);
  color: white;
  border-color: rgba(255, 255, 255, .18);
}

body.ramos-page-incidencias .inc-admin-assign-empty {
  border: 1px dashed #bfdbfe;
  background: rgba(255, 255, 255, .55);
  color: #64748b;
  border-radius: 1rem;
  padding: .85rem;
  font-size: 10px;
  font-weight: 850;
  line-height: 1.35;
  text-align: center;
}

body.ramos-page-incidencias.dark .inc-admin-assign-box {
  background: rgba(59, 130, 246, .12) !important;
  border-color: rgba(59, 130, 246, .24) !important;
}

body.ramos-page-incidencias.dark .inc-admin-assign-title {
  color: #93c5fd !important;
}

body.ramos-page-incidencias.dark .inc-admin-assign-help {
  color: var(--muted) !important;
}

body.ramos-page-incidencias.dark .inc-admin-assign-option,
body.ramos-page-incidencias.dark .inc-admin-assign-search,
body.ramos-page-incidencias.dark .inc-admin-assign-user,
body.ramos-page-incidencias.dark .inc-admin-assign-empty {
  background: var(--soft) !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
}

body.ramos-page-incidencias.dark .inc-admin-assign-user-email {
  color: var(--muted) !important;
}

body.ramos-page-incidencias.dark .inc-admin-assign-user.active {
  background: #38bdf8 !important;
  color: #0f172a !important;
  border-color: #38bdf8 !important;
}

body.ramos-page-incidencias.dark .inc-admin-assign-user.active .inc-admin-assign-user-email {
  color: rgba(15, 23, 42, .72) !important;
}

body.ramos-page-incidencias.dark .inc-admin-assign-user.active .inc-admin-assign-user-chip {
  background: rgba(15, 23, 42, .12) !important;
  color: #0f172a !important;
  border-color: rgba(15, 23, 42, .16) !important;
}

@media (max-width: 520px) {
  body.ramos-page-incidencias .inc-admin-assign-mode {
    grid-template-columns: 1fr;
  }
}



/* ===== INCIDENCIAS · Tipografía de buscador y cajas igual a Mediciones ===== */
body.ramos-page-incidencias .inc-unified-list-card .inc-filters-toolbar {
  grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(150px, 190px)) auto !important;
  gap: 10px !important;
  align-items: end !important;
}

body.ramos-page-incidencias .inc-field-label {
  display: grid !important;
  gap: 7px !important;
  margin: 0 !important;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif !important;
  font-size: 10px !important;
  font-weight: 950 !important;
  text-transform: uppercase !important;
  letter-spacing: .08em !important;
  color: var(--muted) !important;
  line-height: 1.2 !important;
}

body.ramos-page-incidencias .inc-field-label .search-field,
body.ramos-page-incidencias .inc-field-label .filter-select,
body.ramos-page-incidencias .inc-filter-clear-btn {
  width: 100% !important;
  min-height: 46px !important;
  border: 1px solid var(--line) !important;
  background: var(--soft) !important;
  color: var(--text) !important;
  border-radius: 16px !important;
  padding: 13px 14px !important;
  outline: none !important;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  box-shadow: none !important;
}

body.ramos-page-incidencias .inc-field-label .filter-select {
  font-size: 11px !important;
  font-weight: 800 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  color: var(--text) !important;
  appearance: auto !important;
  -webkit-appearance: menulist !important;
}

body.ramos-page-incidencias .inc-filter-clear-btn {
  font-size: 10px !important;
  font-weight: 950 !important;
  text-transform: uppercase !important;
  letter-spacing: .08em !important;
  justify-content: center !important;
  cursor: pointer !important;
  white-space: nowrap !important;
}

body.ramos-page-incidencias .inc-field-label .search-field::placeholder,
body.ramos-page-incidencias .inc-admin-assign-search::placeholder {
  color: var(--muted) !important;
  font-weight: 800 !important;
}

body.ramos-page-incidencias .inc-field-label .search-field:focus,
body.ramos-page-incidencias .inc-field-label .filter-select:focus,
body.ramos-page-incidencias .inc-admin-assign-search:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .10) !important;
  background: var(--card) !important;
}

body.ramos-page-incidencias .inc-admin-assign-search,
body.ramos-page-incidencias .inc-admin-assign-option,
body.ramos-page-incidencias .inc-admin-assign-user,
body.ramos-page-incidencias .area-picker-btn,
body.ramos-page-incidencias .area-picker-option,
body.ramos-page-incidencias .input-field,
body.ramos-page-incidencias .file-picker-button {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif !important;
}

body.ramos-page-incidencias .inc-admin-assign-search {
  min-height: 46px !important;
  border-radius: 16px !important;
  padding: 13px 14px !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  background: var(--soft) !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
}

body.ramos-page-incidencias.dark .inc-field-label .search-field,
body.ramos-page-incidencias.dark .inc-field-label .filter-select,
body.ramos-page-incidencias.dark .inc-filter-clear-btn,
body.ramos-page-incidencias.dark .inc-admin-assign-search {
  background: var(--soft) !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
}



/* ===== INCIDENCIAS · Buscador dentro de Área/Tipo ===== */
body.ramos-page-incidencias .area-picker-search {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--text);
  border-radius: .85rem;
  padding: .75rem .85rem;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 900;
  outline: none;
  margin-bottom: .35rem;
}

body.ramos-page-incidencias .area-picker-search:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .10);
  background: var(--card);
}

body.ramos-page-incidencias .area-picker-empty {
  border: 1px dashed var(--line);
  background: var(--soft);
  color: var(--muted);
  border-radius: .85rem;
  padding: .75rem .85rem;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}



/* ===== INCIDENCIAS · Exportación admin estilo Mediciones/Reprocesos ===== */
body.ramos-page-incidencias .inc-export-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

body.ramos-page-incidencias .inc-export-body {
  padding: 16px;
  display: grid;
  gap: 16px;
}

body.ramos-page-incidencias .inc-export-filter-panel {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: .9rem;
  align-items: end;
  border: 1px solid var(--line);
  background: var(--soft);
  border-radius: 1.5rem;
  padding: .9rem;
}

body.ramos-page-incidencias .inc-export-date-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: .75rem;
  align-items: end;
}

body.ramos-page-incidencias .inc-export-help-line {
  grid-column: 1 / -1;
  font-size: 11px;
  font-weight: 850;
  color: var(--muted);
  line-height: 1.35;
}

body.ramos-page-incidencias .inc-export-option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .75rem;
}

body.ramos-page-incidencias .inc-export-box {
  border: 1px solid var(--line);
  background: var(--soft);
  border-radius: 1.35rem;
  padding: .85rem;
}

body.ramos-page-incidencias .inc-export-status {
  border-radius: 1.15rem;
  padding: .9rem 1rem;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.45;
  white-space: pre-line;
  background: var(--soft);
  border: 1px solid var(--line);
  color: var(--muted);
}

body.ramos-page-incidencias .inc-export-primary-btn {
  border: 0;
  border-radius: 16px;
  padding: 13px 16px;
  min-height: 46px;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
  background: #2563eb;
  color: white;
  box-shadow: 0 10px 24px rgba(37, 99, 235, .18);
}

body.ramos-page-incidencias .inc-export-soft-btn {
  border-radius: 16px;
  padding: 13px 16px;
  min-height: 46px;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--soft);
  color: var(--text);
  border: 1px solid var(--line);
}

body.ramos-page-incidencias.dark .inc-export-box,
body.ramos-page-incidencias.dark .inc-export-filter-panel,
body.ramos-page-incidencias.dark .inc-export-status {
  background: var(--soft) !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
}

@media (max-width: 760px) {

  body.ramos-page-incidencias .inc-export-filter-panel,
  body.ramos-page-incidencias .inc-export-date-grid {
    grid-template-columns: 1fr;
  }
}


/* ===== INCIDENCIAS · Informe PDF igual que Mediciones ===== */
body.ramos-page-incidencias .inc-pdf-panel {
  border: 1px solid #bfdbfe;
  background:
    radial-gradient(circle at 0% 0%, rgba(37, 99, 235, .10), transparent 32%),
    var(--card);
  border-radius: 1.5rem;
  padding: 1rem;
  display: grid;
  gap: .9rem;
}

body.ramos-page-incidencias .inc-pdf-controls {
  display: grid;
  grid-template-columns: minmax(150px, .75fr) minmax(150px, .7fr) minmax(150px, .7fr) minmax(150px, auto);
  gap: .75rem;
  align-items: end;
}

body.ramos-page-incidencias .inc-pdf-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: .4rem .65rem;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .07em;
  width: fit-content;
}

body.ramos-page-incidencias .inc-pdf-controls label {
  min-width: 0;
}

body.ramos-page-incidencias .inc-pdf-controls .input-field,
body.ramos-page-incidencias .inc-pdf-controls .filter-select,
body.ramos-page-incidencias .inc-pdf-controls .inc-export-primary-btn {
  min-height: 46px;
  width: 100%;
}

@media (max-width: 1180px) {
  body.ramos-page-incidencias .inc-pdf-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  body.ramos-page-incidencias .inc-pdf-controls {
    grid-template-columns: 1fr;
  }
}


/* ===== INCIDENCIAS · PDF igualado visualmente a Mediciones ===== */
body.ramos-page-incidencias .section-head-calidad {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  padding: 16px !important;
  border-bottom: 1px solid var(--line) !important;
  background: rgba(248, 250, 252, .72);
}

body.ramos-page-incidencias.dark .section-head-calidad {
  background: rgba(255, 255, 255, .03);
}

body.ramos-page-incidencias .section-kicker-calidad {
  margin: 0;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--primary);
}

body.ramos-page-incidencias .section-title-calidad {
  margin: 3px 0 0 !important;
  font-size: 20px !important;
  font-weight: 950 !important;
  letter-spacing: -.035em !important;
  color: var(--text) !important;
}

body.ramos-page-incidencias .section-help-calidad {
  margin: 5px 0 0;
  color: var(--muted) !important;
  font-size: 12px !important;
  font-weight: 750 !important;
  line-height: 1.35;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

body.ramos-page-incidencias .btn-toolbar-calidad {
  border: 0;
  border-radius: 16px;
  padding: 13px 16px;
  min-height: 46px;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
  background: var(--soft);
  color: var(--text);
  border: 1px solid var(--line);
}

body.ramos-page-incidencias .med-pdf-panel {
  border: 1px solid #bfdbfe;
  background:
    radial-gradient(circle at 0% 0%, rgba(37, 99, 235, .10), transparent 32%),
    var(--card);
  border-radius: 1.5rem;
  padding: 1rem;
  display: grid;
  gap: .9rem;
}

body.ramos-page-incidencias .med-pdf-controls {
  display: grid;
  grid-template-columns: minmax(150px, .75fr) minmax(150px, .7fr) minmax(150px, .7fr) minmax(150px, auto);
  gap: .75rem;
  align-items: end;
}

body.ramos-page-incidencias .med-pdf-controls label {
  min-width: 0;
}

body.ramos-page-incidencias .med-pdf-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: .4rem .65rem;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .07em;
  width: fit-content;
}

body.ramos-page-incidencias .med-export-status {
  border-radius: 1.15rem;
  padding: .9rem 1rem;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.45;
  white-space: pre-line;
  background: var(--soft);
  border: 1px solid var(--line);
  color: var(--muted);
}

body.ramos-page-incidencias.dark .med-pdf-panel,
body.ramos-page-incidencias.dark .med-export-status {
  background: var(--soft) !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
}

@media (max-width:1180px) {
  body.ramos-page-incidencias .med-pdf-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width:640px) {
  body.ramos-page-incidencias .section-head-calidad {
    display: grid;
    gap: 12px;
  }

  body.ramos-page-incidencias .med-pdf-controls {
    grid-template-columns: 1fr;
  }
}




/* ===== INCIDENCIAS · Informe PDF comportamiento igual a Calidad ===== */
body.ramos-page-incidencias .inc-pdf-panel {
  margin: 0;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(260px, .95fr) minmax(560px, 1.35fr);
  gap: 14px;
  align-items: center;
  border: 1px solid #bfdbfe;
  border-radius: 24px;
  background:
    radial-gradient(circle at 0% 0%, rgba(37, 99, 235, .12), transparent 34%),
    var(--card);
  box-shadow: 0 10px 28px rgba(15, 23, 42, .055);
}

body.ramos-page-incidencias.dark .inc-pdf-panel {
  border-color: rgba(56, 189, 248, .26);
  background:
    radial-gradient(circle at 0% 0%, rgba(56, 189, 248, .10), transparent 34%),
    var(--card);
}

body.ramos-page-incidencias .inc-pdf-title {
  margin: 0;
  font-size: 15px;
  font-weight: 950;
  letter-spacing: -.025em;
  color: var(--text) !important;
}

body.ramos-page-incidencias .inc-pdf-text {
  margin: 5px 0 0;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.45;
  color: var(--muted) !important;
}

body.ramos-page-incidencias .inc-pdf-controls {
  display: grid;
  grid-template-columns: minmax(145px, .9fr) minmax(165px, 1fr) minmax(145px, auto);
  gap: 8px;
  align-items: end;
  width: 100%;
  min-width: 0;
}

body.ramos-page-incidencias .inc-pdf-controls.rango-mode {
  grid-template-columns: minmax(135px, .8fr) minmax(145px, .85fr) minmax(145px, .85fr) minmax(135px, auto);
}

body.ramos-page-incidencias .inc-pdf-controls label,
body.ramos-page-incidencias .inc-pdf-controls .input-field,
body.ramos-page-incidencias .inc-pdf-controls .btn-toolbar-calidad,
body.ramos-page-incidencias .inc-pdf-controls .inc-export-primary-btn,
body.ramos-page-incidencias .inc-pdf-controls .inc-export-soft-btn {
  min-width: 0 !important;
}

body.ramos-page-incidencias .inc-pdf-controls label {
  display: grid;
  gap: 7px;
  font-size: 10px;
  font-weight: 950 !important;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted) !important;
  margin: 0;
}

body.ramos-page-incidencias .inc-pdf-controls .btn-toolbar-calidad,
body.ramos-page-incidencias .inc-pdf-controls .inc-export-primary-btn {
  width: 100% !important;
  min-width: 124px !important;
  min-height: 46px !important;
  padding: 12px 10px !important;
  white-space: nowrap !important;
}

body.ramos-page-incidencias .inc-pdf-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 9px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 7px;
  width: fit-content;
}

body.ramos-page-incidencias.dark .inc-pdf-chip {
  background: rgba(59, 130, 246, .14);
  color: #bfdbfe;
  border-color: rgba(59, 130, 246, .26);
}

body.ramos-page-incidencias .inc-pdf-info-note {
  border: 1px solid var(--line);
  background: rgba(248, 250, 252, .72);
  border-radius: 18px;
  padding: 12px;
  display: grid;
  gap: 6px;
}

body.ramos-page-incidencias.dark .inc-pdf-info-note {
  background: rgba(255, 255, 255, .035);
}

body.ramos-page-incidencias .inc-pdf-info-title {
  margin: 0;
  color: var(--text) !important;
  font-size: 18px;
  font-weight: 950;
  letter-spacing: -.025em;
}

body.ramos-page-incidencias .inc-pdf-info-text {
  margin: 0;
  color: var(--muted) !important;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.45;
}

body.ramos-page-incidencias #pdfIncControls label.hidden,
body.ramos-page-incidencias #pdfIncControls button.hidden,
body.ramos-page-incidencias #pdfIncDiaWrap.hidden,
body.ramos-page-incidencias #pdfIncDesdeWrap.hidden,
body.ramos-page-incidencias #pdfIncHastaWrap.hidden,
body.ramos-page-incidencias #btnDescargarPdfIncidenciasDia.hidden,
body.ramos-page-incidencias #btnDescargarPdfIncidenciasZip.hidden {
  display: none !important;
}

@media (max-width: 1180px) {
  body.ramos-page-incidencias .inc-pdf-panel {
    grid-template-columns: 1fr !important;
  }

  body.ramos-page-incidencias .inc-pdf-controls,
  body.ramos-page-incidencias .inc-pdf-controls.rango-mode {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 820px) {

  body.ramos-page-incidencias .inc-pdf-controls,
  body.ramos-page-incidencias .inc-pdf-controls.rango-mode {
    grid-template-columns: 1fr 1fr !important;
  }
}

@media (max-width: 520px) {

  body.ramos-page-incidencias .inc-pdf-controls,
  body.ramos-page-incidencias .inc-pdf-controls.rango-mode {
    grid-template-columns: 1fr !important;
  }

  body.ramos-page-incidencias .inc-pdf-controls .btn-toolbar-calidad,
  body.ramos-page-incidencias .inc-pdf-controls .inc-export-primary-btn {
    min-width: 0 !important;
  }
}



/* ===== INCIDENCIAS · Gestión rápida visible en móvil ===== */
body.ramos-page-incidencias .mobile-quick-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 14px;
  display: grid;
  gap: 10px;
}

body.ramos-page-incidencias .mobile-quick-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
  padding: 0 2px 2px;
}

body.ramos-page-incidencias .mobile-quick-kicker {
  margin: 0;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .11em;
  color: var(--primary);
}

body.ramos-page-incidencias .mobile-quick-title {
  margin: 3px 0 0;
  font-size: 18px;
  line-height: 1.1;
  font-weight: 950;
  letter-spacing: -.035em;
  color: var(--text);
}

body.ramos-page-incidencias .mobile-quick-help {
  margin: 4px 0 0;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
  color: var(--muted);
}

body.ramos-page-incidencias .mobile-quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

body.ramos-page-incidencias .mobile-quick-btn {
  min-height: 78px;
  border: 1px solid rgba(37, 99, 235, .16);
  background:
    radial-gradient(circle at 0% 0%, rgba(37, 99, 235, .12), transparent 38%),
    linear-gradient(135deg, var(--card), var(--soft));
  color: var(--text);
  border-radius: 22px;
  padding: 12px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  justify-items: start;
  text-align: left;
  gap: 10px;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .055);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}

body.ramos-page-incidencias .mobile-quick-btn:active {
  transform: scale(.985);
}

body.ramos-page-incidencias .mobile-quick-btn strong {
  display: block;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .055em;
  line-height: 1.12;
}

body.ramos-page-incidencias .mobile-quick-btn span {
  display: block;
  font-size: 9px;
  font-weight: 850;
  color: var(--muted);
  line-height: 1.15;
}

body.ramos-page-incidencias .mobile-quick-icon {
  width: 40px;
  height: 40px;
  border-radius: 16px;
  background: #0f172a;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 950;
  box-shadow: 0 10px 22px rgba(15, 23, 42, .14);
}

body.ramos-page-incidencias .mobile-quick-btn.active {
  background: linear-gradient(135deg, #0f172a, #1d4ed8);
  color: #fff;
  border-color: rgba(37, 99, 235, .45);
  box-shadow: 0 16px 34px rgba(37, 99, 235, .18);
}

body.ramos-page-incidencias .mobile-quick-btn.active .mobile-quick-icon {
  background: rgba(255, 255, 255, .16);
  color: #fff;
}

body.ramos-page-incidencias .mobile-quick-btn.active span {
  color: rgba(255, 255, 255, .74);
}

body.ramos-page-incidencias.dark .mobile-quick-btn.active {
  background: #38bdf8;
  color: #0f172a;
  border-color: #38bdf8;
}

body.ramos-page-incidencias.dark .mobile-quick-btn.active .mobile-quick-icon {
  background: rgba(15, 23, 42, .12);
  color: #0f172a;
}

body.ramos-page-incidencias.dark .mobile-quick-btn.active span {
  color: rgba(15, 23, 42, .72);
}

body.ramos-page-incidencias .mobile-historico-panel {
  border: 1px solid var(--line);
  background: var(--soft);
  border-radius: 20px;
  padding: 12px;
  display: grid;
  gap: 9px;
}

body.ramos-page-incidencias .mobile-historico-panel.hidden {
  display: none !important;
}

body.ramos-page-incidencias .mobile-historico-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

body.ramos-page-incidencias .mobile-hist-action {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  border-radius: 15px;
  padding: 11px 12px;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .055em;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

body.ramos-page-incidencias .mobile-hist-check {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 15px;
  padding: 11px 12px;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .045em;
  color: var(--text);
}

body.ramos-page-incidencias .mobile-hist-check input {
  width: 17px;
  height: 17px;
  accent-color: #2563eb;
}

@media (max-width: 380px) {
  body.ramos-page-incidencias .mobile-quick-grid {
    grid-template-columns: 1fr;
  }

  body.ramos-page-incidencias .mobile-quick-btn {
    min-height: 64px;
  }

  body.ramos-page-incidencias .mobile-historico-grid {
    grid-template-columns: 1fr;
  }
}



/* ===== INCIDENCIAS · Gestión rápida móvil V3 · más legible ===== */
body.ramos-page-incidencias .mobile-quick-btn {
  border-color: #bfdbfe !important;
  background:
    radial-gradient(circle at 0% 0%, rgba(37, 99, 235, .10), transparent 36%),
    #ffffff !important;
  color: #0f172a !important;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .06) !important;
}

body.ramos-page-incidencias .mobile-quick-icon {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  border: 1px solid #bfdbfe !important;
  box-shadow: none !important;
}

body.ramos-page-incidencias .mobile-quick-btn strong {
  color: #0f172a !important;
}

body.ramos-page-incidencias .mobile-quick-btn span {
  color: #64748b !important;
}

body.ramos-page-incidencias .mobile-quick-btn.active {
  background:
    radial-gradient(circle at 0% 0%, rgba(37, 99, 235, .16), transparent 38%),
    #eff6ff !important;
  color: #0f172a !important;
  border-color: #2563eb !important;
  box-shadow: 0 12px 28px rgba(37, 99, 235, .14) !important;
  outline: 2px solid rgba(37, 99, 235, .10) !important;
}

body.ramos-page-incidencias .mobile-quick-btn.active .mobile-quick-icon {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #2563eb !important;
}

body.ramos-page-incidencias .mobile-quick-btn.active span,
body.ramos-page-incidencias .mobile-quick-btn.active strong {
  color: #0f172a !important;
}

body.ramos-page-incidencias .mobile-quick-btn.active>span>span {
  color: #475569 !important;
}

body.ramos-page-incidencias.dark .mobile-quick-btn {
  background: rgba(255, 255, 255, .045) !important;
  border-color: rgba(148, 163, 184, .22) !important;
  color: #eff6ff !important;
}

body.ramos-page-incidencias.dark .mobile-quick-icon {
  background: rgba(56, 189, 248, .14) !important;
  color: #93c5fd !important;
  border-color: rgba(56, 189, 248, .26) !important;
}

body.ramos-page-incidencias.dark .mobile-quick-btn strong {
  color: #eff6ff !important;
}

body.ramos-page-incidencias.dark .mobile-quick-btn span {
  color: #94a3b8 !important;
}

body.ramos-page-incidencias.dark .mobile-quick-btn.active {
  background: rgba(56, 189, 248, .16) !important;
  border-color: #38bdf8 !important;
  outline-color: rgba(56, 189, 248, .12) !important;
  box-shadow: 0 12px 28px rgba(56, 189, 248, .10) !important;
}

body.ramos-page-incidencias.dark .mobile-quick-btn.active .mobile-quick-icon {
  background: #38bdf8 !important;
  color: #0f172a !important;
  border-color: #38bdf8 !important;
}

body.ramos-page-incidencias.dark .mobile-quick-btn.active span,
body.ramos-page-incidencias.dark .mobile-quick-btn.active strong {
  color: #eff6ff !important;
}

body.ramos-page-incidencias.dark .mobile-quick-btn.active>span>span {
  color: #cbd5e1 !important;
}



/* ===== INCIDENCIAS · Iconos gestión rápida más limpios ===== */
body.ramos-page-incidencias .mobile-quick-icon svg,
body.ramos-page-incidencias .inc-action-icon-safe svg {
  display: block;
  stroke-width: 2.8;
}

body.ramos-page-incidencias .mobile-quick-icon {
  font-size: 0 !important;
}



/* ===== INCIDENCIAS · Iconos móviles igualados a Mediciones ===== */
body.ramos-page-incidencias .mobile-quick-icon {
  font-size: 18px !important;
  font-weight: 950 !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
}

body.ramos-page-incidencias .mobile-quick-icon svg {
  width: 18px !important;
  height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  display: block !important;
  overflow: visible !important;
}

body.ramos-page-incidencias .inc-action-icon-safe {
  font-size: 15px !important;
  font-weight: 950 !important;
  line-height: 1 !important;
  overflow: hidden !important;
}


/* =========================================================
   ESTILOS ORIGINALES ESCOPADOS · MEDICIONES
   ========================================================= */
body.ramos-page-mediciones.dark {
  --bg: #0f172a;
  --card: #172033;
  --text: #eff6ff;
  --muted: #94a3b8;
  --line: rgba(255, 255, 255, .10);
  --soft: #111827;
  --primary: #38bdf8;
  --shadow: 0 14px 34px rgba(0, 0, 0, .24);
}

body.ramos-page-mediciones {
  font-family: "Plus Jakarta Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
}

body.ramos-page-mediciones .glass {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}


body.ramos-page-mediciones .app-logo {
  height: 34px;
  max-width: 140px;
  object-fit: contain;
  display: block;
}

@media (max-width: 420px) {
  body.ramos-page-mediciones .app-logo {
    height: 28px;
    max-width: 110px;
  }
}

body.ramos-page-mediciones .input-field {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 0.75rem;
  padding: 0.6rem 0.8rem;
  width: 100%;
  outline: none;
  font-size: 13px;
}

body.ramos-page-mediciones .search-field {
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 1rem;
  padding: 0.8rem 1rem;
  width: 100%;
  outline: none;
  font-weight: 600;
}

body.ramos-page-mediciones .filter-select {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 0.5rem;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  color: #64748b;
  width: 100%;
}

body.ramos-page-mediciones .modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 42, 0.7);
  align-items: flex-end;
}

body.ramos-page-mediciones .modal.active {
  display: flex;
  animation: slideUp 0.2s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

body.ramos-page-mediciones .card {
  background: white;
  border-radius: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
  transition: all 0.3s;
}

body.ramos-page-mediciones .label-tag {
  font-weight: 800;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #94a3b8;
  display: block;
  margin-bottom: .25rem;
}

body.ramos-page-mediciones .status-badge {
  font-weight: 900;
  font-size: 9px;
  padding: 4px 8px;
  border-radius: 6px;
  color: black;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body.ramos-page-mediciones .btn-call {
  background: #22c55e;
  color: white;
  border-radius: 0.75rem;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

body.ramos-page-mediciones .btn-maps {
  background: #475569;
  color: white;
  border-radius: 0.6rem;
  padding: 4px 8px;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

@keyframes blink-red {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.6;
  }
}

body.ramos-page-mediciones .alerta-roja {
  border: 2.5px solid #ef4444 !important;
  background: #fef2f2 !important;
}

body.ramos-page-mediciones .badge-rojo {
  background: #ef4444;
  color: white;
  animation: blink-red 0.8s infinite;
}

body.ramos-page-mediciones .alerta-naranja {
  border: 2.5px solid #f59e0b !important;
  background: #fffbeb !important;
}

body.ramos-page-mediciones .badge-naranja {
  background: #f59e0b;
  color: white;
}


body.ramos-page-mediciones .admin-only {
  display: none !important;
}

/* ===== RESPONSIVE PRO ===== */
body.ramos-page-mediciones .desktop-view {
  display: none;
}

body.ramos-page-mediciones .mobile-view {
  display: block;
}

@media (min-width: 900px) {
  body.ramos-page-mediciones {
    font-size: 14px;
  }

  body.ramos-page-mediciones .desktop-view {
    display: block;
  }

  body.ramos-page-mediciones .mobile-view {
    display: none;
  }

  body.ramos-page-mediciones .modal {
    align-items: center;
  }
}

body.ramos-page-mediciones .desktop-shell {
  max-width: 1400px;
  margin: 0 auto;
}

body.ramos-page-mediciones .kpi-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 1.25rem;
  padding: 1rem;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .04);
}

body.ramos-page-mediciones .table-row:hover {
  background: #f8fafc;
  cursor: pointer;
}

body.ramos-page-mediciones .table-row.selected {
  background: #eff6ff;
}

body.ramos-page-mediciones .side-panel {
  position: fixed;
  right: -460px;
  top: 0;
  width: 460px;
  max-width: 92vw;
  height: 100%;
  background: white;
  box-shadow: -10px 0 30px rgba(15, 23, 42, .18);
  transition: right 0.25s ease;
  z-index: 70;
  overflow-y: auto;
  border-left: 1px solid #e2e8f0;
}

body.ramos-page-mediciones .side-panel.active {
  right: 0;
}

body.ramos-page-mediciones .panel-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .25);
  z-index: 60;
}

body.ramos-page-mediciones .panel-backdrop.active {
  display: block;
}

body.ramos-page-mediciones .desktop-table-wrap {
  max-height: calc(100vh - 290px);
  overflow: auto;
}

body.ramos-page-mediciones .desktop-table thead th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 5;
}

body.ramos-page-mediciones .history-line {
  border-left: 2px solid #e2e8f0;
  padding-left: 14px;
  margin-left: 6px;
  position: relative;
}

body.ramos-page-mediciones .history-dot {
  position: absolute;
  left: -6px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #3b82f6;
}

body.ramos-page-mediciones .descripcion-breve {
  max-width: 360px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}

body.ramos-page-mediciones .descripcion-vacia {
  color: #cbd5e1;
  font-style: italic;
}


/* ===== MOBILE PRO v1 ===== */
body.ramos-page-mediciones .mobile-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 55%, #2563eb 100%);
  color: white;
  border-radius: 1.8rem;
  padding: 1.15rem;
  box-shadow: 0 14px 32px rgba(15, 23, 42, .18);
}

body.ramos-page-mediciones .mobile-stat {
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 1.15rem;
  padding: .75rem;
  backdrop-filter: blur(10px);
}

body.ramos-page-mediciones .mobile-tabs {
  display: flex;
  gap: .5rem;
  overflow-x: auto;
  padding-bottom: .25rem;
  scrollbar-width: none;
}

body.ramos-page-mediciones .mobile-tabs::-webkit-scrollbar {
  display: none;
}

body.ramos-page-mediciones .mobile-tab {
  flex: 0 0 auto;
  border: 1px solid #e2e8f0;
  background: white;
  color: #64748b;
  border-radius: 999px;
  padding: .62rem .85rem;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
  box-shadow: 0 6px 16px rgba(15, 23, 42, .04);
}

body.ramos-page-mediciones .mobile-tab.active {
  background: #0f172a;
  color: white;
  border-color: #0f172a;
}

body.ramos-page-mediciones .mobile-card-pro {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 1.65rem;
  padding: 1rem;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .075);
  overflow: hidden;
  position: relative;
  transition: transform .18s ease;
}

body.ramos-page-mediciones .mobile-card-pro:active {
  transform: scale(.992);
}

body.ramos-page-mediciones .mobile-card-pro.urgente {
  border-color: #ef4444;
  border-left: 4px solid #dc2626;
  background: linear-gradient(90deg, rgba(254,226,226,.88) 0%, var(--card) 38%);
  box-shadow: 0 16px 34px rgba(239, 68, 68, .15);
}
body.dark.ramos-page-mediciones .mobile-card-pro.urgente {
  background: linear-gradient(90deg, rgba(220,38,38,.18) 0%, var(--card) 38%);
}

body.ramos-page-mediciones .mobile-card-pro.aviso {
  border-color: #f59e0b;
  box-shadow: 0 16px 34px rgba(245, 158, 11, .10);
}

body.ramos-page-mediciones .mobile-pill {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  border-radius: 999px;
  padding: .28rem .55rem;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}

body.ramos-page-mediciones .mobile-action {
  border-radius: 1rem;
  padding: .85rem .65rem;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  text-align: center;
}

body.ramos-page-mediciones .mobile-quick-actions {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex-shrink: 0;
}

body.ramos-page-mediciones .mobile-quick-btn {
  width: 42px;
  height: 42px;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 10px 22px rgba(15, 23, 42, .14);
  transition: transform .14s ease, box-shadow .14s ease;
}

body.ramos-page-mediciones .mobile-quick-btn:active {
  transform: scale(.94);
  box-shadow: 0 5px 12px rgba(15, 23, 42, .16);
}

body.ramos-page-mediciones .mobile-quick-btn.call {
  background: #22c55e;
}

body.ramos-page-mediciones .mobile-quick-btn.nav {
  background: #2563eb;
}

body.ramos-page-mediciones .mobile-quick-btn.disabled {
  background: #cbd5e1;
  pointer-events: none;
  opacity: .65;
}

body.ramos-page-mediciones .mobile-description {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 1.15rem;
  padding: .9rem;
}

body.ramos-page-mediciones .mobile-fab {
  position: fixed;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 45;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background: #2563eb;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 900;
  box-shadow: 0 16px 35px rgba(37, 99, 235, .34);
}

@media (min-width: 900px) {
  body.ramos-page-mediciones .mobile-fab {
    display: none;
  }
}

@media (min-width: 900px) {
  body.ramos-page-mediciones .top-new-btn {
    display: flex !important;
  }
}



body.ramos-page-mediciones .adjunto-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: .75rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  justify-content: space-between;
}

body.ramos-page-mediciones .adjunto-icon {
  width: 34px;
  height: 34px;
  border-radius: .85rem;
  background: #e0f2fe;
  color: #0369a1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  flex-shrink: 0;
}

body.ramos-page-mediciones .attach-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: 1rem;
  border-radius: 1.25rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  text-align: left;
  font-weight: 900;
  color: #0f172a;
}


body.ramos-page-mediciones .size-option {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 1.25rem;
  padding: 1rem;
  background: #f8fafc;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

body.ramos-page-mediciones .size-option:active {
  transform: scale(.99);
}

body.ramos-page-mediciones .size-option-title {
  font-size: 13px;
  font-weight: 900;
  color: #0f172a;
}

body.ramos-page-mediciones .size-option-desc {
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  margin-top: .15rem;
}



body.ramos-page-mediciones .dashboard-help {
  font-size: 10px;
  line-height: 1.35;
  color: #94a3b8;
  font-weight: 700;
  margin-top: .45rem;
}

body.ramos-page-mediciones .direction-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 48%, #1d4ed8 100%);
  color: white;
  border-radius: 1.65rem;
  padding: 1.25rem;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .16);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

body.ramos-page-mediciones .direction-summary {
  background: white;
  border: 1px solid #dbeafe;
  border-left: 6px solid #2563eb;
  border-radius: 1.35rem;
  padding: 1rem;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .045);
}

body.ramos-page-mediciones .direction-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 1.35rem;
  padding: 1rem;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .045);
}

body.ramos-page-mediciones .direction-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: 1rem;
}

body.ramos-page-mediciones .direction-eyebrow {
  font-size: 10px;
  font-weight: 900;
  color: #2563eb;
  text-transform: uppercase;
  letter-spacing: .08em;
}

body.ramos-page-mediciones .direction-title {
  font-size: 15px;
  font-weight: 900;
  color: #0f172a;
  margin-top: .15rem;
  line-height: 1.2;
}

body.ramos-page-mediciones .direction-note {
  font-size: 10px;
  line-height: 1.35;
  color: #94a3b8;
  font-weight: 800;
  max-width: 260px;
  text-align: right;
}

body.ramos-page-mediciones .direction-metric {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 1.15rem;
  padding: 1rem;
  min-height: 128px;
}

body.ramos-page-mediciones .direction-metric.compact {
  min-height: auto;
}

body.ramos-page-mediciones .direction-label {
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #64748b;
}

body.ramos-page-mediciones .direction-value {
  font-size: 30px;
  font-weight: 900;
  color: #0f172a;
  line-height: 1;
  margin-top: .45rem;
}

body.ramos-page-mediciones .direction-explain {
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  line-height: 1.35;
  margin-top: .55rem;
}

body.ramos-page-mediciones .direction-row {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 1rem;
  padding: .85rem;
}

body.ramos-page-mediciones .direction-row-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .75rem;
}

body.ramos-page-mediciones .direction-row-title {
  font-size: 12px;
  font-weight: 900;
  color: #334155;
}

body.ramos-page-mediciones .direction-row-value {
  font-size: 18px;
  font-weight: 900;
  color: #0f172a;
  white-space: nowrap;
}

body.ramos-page-mediciones .direction-bar {
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  margin-top: .55rem;
}

body.ramos-page-mediciones .direction-bar>span {
  display: block;
  height: 100%;
  background: #2563eb;
  border-radius: 999px;
}

body.ramos-page-mediciones .direction-status-good {
  color: #059669 !important;
}

body.ramos-page-mediciones .direction-status-warn {
  color: #d97706 !important;
}

body.ramos-page-mediciones .direction-status-bad {
  color: #dc2626 !important;
}

body.ramos-page-mediciones .direction-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: .35rem .6rem;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: #f1f5f9;
  color: #334155;
}

@media (max-width: 1100px) {

  body.ramos-page-mediciones .direction-hero,
  body.ramos-page-mediciones .direction-section-head {
    flex-direction: column;
  }

  body.ramos-page-mediciones .direction-note {
    text-align: left;
    max-width: none;
  }
}


/* ===== KPI RÁPIDOS ESCRITORIO: visible para admin y operario ===== */
body.ramos-page-mediciones .desktop-kpi-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
}

body.ramos-page-mediciones .desktop-kpi-summary-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 1.25rem;
  padding: 1rem;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .045);
  position: relative;
  overflow: hidden;
}

body.ramos-page-mediciones .desktop-kpi-summary-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: #cbd5e1;
}

body.ramos-page-mediciones .desktop-kpi-summary-card.pendientes::before {
  background: #f59e0b;
}

body.ramos-page-mediciones .desktop-kpi-summary-card.curso::before {
  background: #2563eb;
}

body.ramos-page-mediciones .desktop-kpi-summary-card.urgentes::before {
  background: #ef4444;
}

body.ramos-page-mediciones .desktop-kpi-summary-card.finalizadas::before {
  background: #10b981;
}

body.ramos-page-mediciones .desktop-kpi-summary-label {
  font-size: 10px;
  font-weight: 900;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .08em;
}

body.ramos-page-mediciones .desktop-kpi-summary-value {
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  margin-top: .35rem;
  color: #0f172a;
}

body.ramos-page-mediciones .desktop-kpi-summary-help {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  line-height: 1.35;
  margin-top: .45rem;
}

@media (max-width: 1100px) {
  body.ramos-page-mediciones .desktop-kpi-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ===== DASHBOARD ESCRITORIO v2 ===== */
body.ramos-page-mediciones .dashboard-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 1.35rem;
  padding: 1rem;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .045);
}

body.ramos-page-mediciones .dashboard-title {
  font-size: 10px;
  font-weight: 900;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .75rem;
}

body.ramos-page-mediciones .dashboard-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .45rem 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 12px;
  font-weight: 800;
  color: #334155;
}

body.ramos-page-mediciones .dashboard-line:last-child {
  border-bottom: 0;
}

body.ramos-page-mediciones .dashboard-muted {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 800;
}

body.ramos-page-mediciones .dashboard-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6rem;
  padding: .2rem .45rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  font-size: 10px;
  font-weight: 900;
}

body.ramos-page-mediciones .dashboard-critical {
  background: #fff1f2;
  border: 1px solid #ffe4e6;
  border-radius: 1rem;
  padding: .75rem;
  margin-bottom: .5rem;
}

body.ramos-page-mediciones .dashboard-critical:last-child {
  margin-bottom: 0;
}

body.ramos-page-mediciones .dashboard-bar {
  height: 7px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  margin-top: .35rem;
}

body.ramos-page-mediciones .dashboard-bar>span {
  display: block;
  height: 100%;
  background: #2563eb;
  border-radius: 999px;
}

body.ramos-page-mediciones .dashboard-hidden #dashboard-content {
  display: none;
}

body.ramos-page-mediciones .dashboard-kpi {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 1.35rem;
  padding: 1rem;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .045);
}

body.ramos-page-mediciones .dashboard-kpi-label {
  font-size: 10px;
  font-weight: 900;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .08em;
}

body.ramos-page-mediciones .dashboard-kpi-value {
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  margin-top: .35rem;
}

body.ramos-page-mediciones .dashboard-priority-scroll {
  max-height: 260px;
  overflow-y: auto;
  padding-right: .25rem;
}

body.ramos-page-mediciones .dashboard-priority-scroll::-webkit-scrollbar {
  width: 6px;
}

body.ramos-page-mediciones .dashboard-priority-scroll::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

body.ramos-page-mediciones.dark .glass {
  background: rgba(15, 23, 42, .90);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

body.ramos-page-mediciones.dark .card,
body.ramos-page-mediciones.dark .kpi-card,
body.ramos-page-mediciones.dark .dashboard-card,
body.ramos-page-mediciones.dark .dashboard-kpi,
body.ramos-page-mediciones.dark .direction-card,
body.ramos-page-mediciones.dark .desktop-kpi-summary-card,
body.ramos-page-mediciones.dark section.bg-white,
body.ramos-page-mediciones.dark .bg-white {
  background: var(--card) !important;
  color: var(--text);
  border-color: var(--line) !important;
  box-shadow: var(--shadow);
}

body.ramos-page-mediciones.dark .input-field,
body.ramos-page-mediciones.dark .search-field,
body.ramos-page-mediciones.dark .filter-select {
  background: var(--soft) !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
}

body.ramos-page-mediciones.dark .text-slate-900,
body.ramos-page-mediciones.dark .text-slate-800,
body.ramos-page-mediciones.dark .text-slate-700,
body.ramos-page-mediciones.dark .text-slate-600,
body.ramos-page-mediciones.dark .text-slate-500 {
  color: var(--text) !important;
}

body.ramos-page-mediciones.dark .text-slate-400 {
  color: var(--muted) !important;
}

body.ramos-page-mediciones.dark .bg-slate-50,
body.ramos-page-mediciones.dark .bg-slate-100,
body.ramos-page-mediciones.dark .mobile-description,
body.ramos-page-mediciones.dark .desc-box,
body.ramos-page-mediciones.dark .adjunto-item,
body.ramos-page-mediciones.dark .attach-option,
body.ramos-page-mediciones.dark .size-option,
body.ramos-page-mediciones.dark .direction-metric,
body.ramos-page-mediciones.dark .direction-row {
  background: var(--soft) !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
}

body.ramos-page-mediciones.dark .side-panel {
  background: var(--card);
  color: var(--text);
  border-left-color: var(--line);
}

body.ramos-page-mediciones.dark .desktop-table thead th {
  background: var(--soft);
}

body.ramos-page-mediciones.dark .table-row:hover {
  background: rgba(255, 255, 255, .05);
}

body.ramos-page-mediciones .collapsible-body {
  display: none;
}

body.ramos-page-mediciones .collapsible-body.open {
  display: block;
}

body.ramos-page-mediciones .desc-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 1.1rem;
  padding: .85rem;
}

body.ramos-page-mediciones .timeline {
  border-left: 2px solid var(--line);
  padding-left: 14px;
  margin-left: 6px;
  position: relative;
}

body.ramos-page-mediciones .timeline-dot {
  position: absolute;
  left: -6px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #2563eb;
}

/* ===== FIX: KPIs escritorio ocultos siempre en móvil ===== */
@media (max-width: 899px) {

  body.ramos-page-mediciones #desktop-kpi-summary,
  body.ramos-page-mediciones #desktop-kpi-summary.desktop-view,
  body.ramos-page-mediciones .desktop-kpi-summary,
  body.ramos-page-mediciones .desktop-kpi-summary-card {
    display: none !important;
  }
}

@media (min-width: 900px) {
  body.ramos-page-mediciones #desktop-kpi-summary.desktop-view {
    display: grid !important;
  }
}


/* ===== PANEL DETALLE · DRAWER ESTILO CALIDAD ===== */
body.ramos-page-mediciones .side-panel {
  right: 0 !important;
  top: 0;
  width: min(560px, 94vw);
  max-width: 94vw;
  height: 100dvh;
  max-height: 100dvh;
  min-height: 100dvh;
  margin: 0;
  border-radius: 32px 0 0 32px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
  border-right: 0;
  box-shadow: -24px 0 70px rgba(0, 0, 0, .28);
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.2, .8, .2, 1), box-shadow .28s ease;
  will-change: transform;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 80;
}

body.ramos-page-mediciones .side-panel.active {
  transform: translateX(0);
}

body.ramos-page-mediciones .panel-backdrop {
  display: block;
  opacity: 0;
  transition: opacity .22s ease;
  pointer-events: none;
  background: rgba(15, 23, 42, .42);
  z-index: 70;
}

body.ramos-page-mediciones .panel-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

body.ramos-page-mediciones .panel-sticky-head {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: -1.5rem -1.5rem 1.8rem -1.5rem;
  padding: max(18px, env(safe-area-inset-top)) 1.5rem 1rem 1.5rem;
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

body.ramos-page-mediciones.dark .panel-sticky-head {
  background: rgba(23, 32, 51, .94) !important;
}

body.ramos-page-mediciones .panel-close-btn {
  position: sticky;
  top: calc(.75rem + env(safe-area-inset-top));
  z-index: 25;
  align-self: flex-start;
  flex-shrink: 0;
}

@supports (height: 100dvh) {
  body.ramos-page-mediciones .side-panel {
    height: 100dvh;
    max-height: 100dvh;
  }
}

@supports (padding: max(0px)) {
  body.ramos-page-mediciones .side-panel {
    padding-top: 0 !important;
    padding-bottom: max(20px, env(safe-area-inset-bottom)) !important;
  }

  body.ramos-page-mediciones #panel-content {
    min-height: 100dvh;
    padding-top: 0 !important;
    padding-bottom: max(24px, env(safe-area-inset-bottom)) !important;
  }
}

@media (max-width: 640px) {
  body.ramos-page-mediciones .side-panel {
    width: 100%;
    max-width: 100%;
    border-radius: 0;
  }
}

/* ===== Mediciones PRO layout unificado ===== */
body.ramos-page-mediciones .mediciones-pro-shell {
  max-width: 1480px;
  margin: 0 auto;
}

body.ramos-page-mediciones .mediciones-pro-hero {
  background:
    radial-gradient(circle at 0% 0%, rgba(37, 99, 235, .22), transparent 35%),
    linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #1d4ed8 100%);
  color: white;
  border-radius: 2rem;
  padding: 1.25rem;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .18);
  overflow: hidden;
  position: relative;
}

body.ramos-page-mediciones .mediciones-pro-hero:after {
  content: "";
  position: absolute;
  right: -80px;
  top: -90px;
  width: 230px;
  height: 230px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
}

body.ramos-page-mediciones .mediciones-pro-hero>* {
  position: relative;
  z-index: 1;
}

body.ramos-page-mediciones .mediciones-pro-layout {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

body.ramos-page-mediciones .mediciones-pro-side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

body.ramos-page-mediciones .mediciones-pro-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

body.ramos-page-mediciones .med-action-tile {
  width: 100%;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 1.45rem;
  padding: .95rem;
  text-align: left;
  display: flex;
  align-items: center;
  gap: .8rem;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .055);
  transition: .16s ease;
}

body.ramos-page-mediciones .med-action-tile:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(15, 23, 42, .08);
}

body.ramos-page-mediciones .med-action-icon {
  width: 42px;
  height: 42px;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 900;
  font-size: 18px;
  flex-shrink: 0;
}

body.ramos-page-mediciones .med-action-tile strong {
  display: block;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #0f172a;
}

body.ramos-page-mediciones .med-action-tile span {
  display: block;
  font-size: 10px;
  font-weight: 800;
  color: #64748b;
  margin-top: .15rem;
  line-height: 1.2;
}

body.ramos-page-mediciones .med-section-head-pro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: .75rem;
  padding: 1rem 1rem .85rem;
  border-bottom: 1px solid #e2e8f0;
}

body.ramos-page-mediciones .med-section-head-pro h3 {
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: -.02em;
  color: #0f172a;
}

body.ramos-page-mediciones .med-section-head-pro p {
  font-size: 10px;
  font-weight: 900;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .08em;
}

body.ramos-page-mediciones .med-compact-help {
  font-size: 10px;
  line-height: 1.35;
  color: #64748b;
  font-weight: 800;
}

body.ramos-page-mediciones .mediciones-pro-list {
  border-radius: 1.65rem !important;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .055) !important;
}

body.ramos-page-mediciones .mediciones-pro-list .desktop-table-wrap {
  max-height: calc(100vh - 390px);
}

body.ramos-page-mediciones .desktop-kpi-summary-card {
  border-radius: 1.55rem;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .055);
}

@media (max-width: 1199px) {
  body.ramos-page-mediciones .mediciones-pro-shell {
    max-width: 980px;
  }

  body.ramos-page-mediciones .mediciones-pro-layout {
    grid-template-columns: 1fr;
  }

  body.ramos-page-mediciones .mediciones-pro-side {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.ramos-page-mediciones .mediciones-pro-side .card {
    min-height: 100%;
  }
}

@media (max-width: 899px) {
  body.ramos-page-mediciones .mediciones-pro-shell {
    max-width: 760px;
  }

  body.ramos-page-mediciones .mediciones-pro-hero,
  body.ramos-page-mediciones .mediciones-pro-layout,
  body.ramos-page-mediciones .mediciones-pro-side,
  body.ramos-page-mediciones .mediciones-pro-main {
    display: none !important;
  }
}

body.ramos-page-mediciones.dark .mediciones-pro-hero {
  box-shadow: 0 18px 45px rgba(0, 0, 0, .25);
}

body.ramos-page-mediciones.dark .med-action-tile {
  background: var(--card) !important;
  border-color: var(--line) !important;
  color: var(--text);
}

body.ramos-page-mediciones.dark .med-action-tile strong {
  color: var(--text);
}

body.ramos-page-mediciones.dark .med-action-tile span,
body.ramos-page-mediciones.dark .med-compact-help,
body.ramos-page-mediciones.dark .med-section-head-pro p {
  color: var(--muted);
}

body.ramos-page-mediciones.dark .med-section-head-pro,
body.ramos-page-mediciones.dark .med-section-head-pro h3 {
  color: var(--text);
  border-color: var(--line);
}


/* ===== DARK MODE UNIFICADO CON INCIDENCIAS · FIX MEDICIONES ===== */
body.ramos-page-mediciones.dark {
  --bg: #0f172a;
  --card: #172033;
  --text: #eff6ff;
  --muted: #94a3b8;
  --line: rgba(255, 255, 255, .10);
  --soft: #111827;
  --primary: #38bdf8;
  --shadow: 0 14px 34px rgba(0, 0, 0, .24);
}

body.ramos-page-mediciones.dark {
  background: var(--bg) !important;
  color: var(--text) !important;
}

body.ramos-page-mediciones.dark .glass {
  background: rgba(15, 23, 42, .90) !important;
  border-bottom: 1px solid rgba(255, 255, 255, .08) !important;
}

/* Cajas principales */
body.ramos-page-mediciones.dark .card,
body.ramos-page-mediciones.dark .kpi-card,
body.ramos-page-mediciones.dark .dashboard-card,
body.ramos-page-mediciones.dark .dashboard-kpi,
body.ramos-page-mediciones.dark .direction-card,
body.ramos-page-mediciones.dark .direction-summary,
body.ramos-page-mediciones.dark .desktop-kpi-summary-card,
body.ramos-page-mediciones.dark .dashboard-critical,
body.ramos-page-mediciones.dark .direction-metric,
body.ramos-page-mediciones.dark .direction-row,
body.ramos-page-mediciones.dark .mobile-card-pro,
body.ramos-page-mediciones.dark .mobile-description,
body.ramos-page-mediciones.dark .adjunto-item,
body.ramos-page-mediciones.dark .attach-option,
body.ramos-page-mediciones.dark .size-option,
body.ramos-page-mediciones.dark section.bg-white,
body.ramos-page-mediciones.dark div.bg-white,
body.ramos-page-mediciones.dark .bg-white {
  background: var(--card) !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
  box-shadow: var(--shadow) !important;
}

/* Subcajas interiores */
body.ramos-page-mediciones.dark .bg-slate-50,
body.ramos-page-mediciones.dark .bg-slate-100,
body.ramos-page-mediciones.dark .desc-box,
body.ramos-page-mediciones.dark .dashboard-line,
body.ramos-page-mediciones.dark .dashboard-bar,
body.ramos-page-mediciones.dark .direction-bar,
body.ramos-page-mediciones.dark .mobile-tab,
body.ramos-page-mediciones.dark .filter-select,
body.ramos-page-mediciones.dark .input-field,
body.ramos-page-mediciones.dark .search-field {
  background: var(--soft) !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
}

/* Inputs y selects */
body.ramos-page-mediciones.dark input,
body.ramos-page-mediciones.dark textarea,
body.ramos-page-mediciones.dark select,
body.ramos-page-mediciones.dark .input-field,
body.ramos-page-mediciones.dark .search-field,
body.ramos-page-mediciones.dark .filter-select {
  background: var(--soft) !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
}

body.ramos-page-mediciones.dark input::placeholder,
body.ramos-page-mediciones.dark textarea::placeholder,
body.ramos-page-mediciones.dark .search-field::placeholder {
  color: var(--muted) !important;
}

/* Tabla */
body.ramos-page-mediciones.dark .desktop-table thead th {
  background: var(--soft) !important;
  color: var(--muted) !important;
  border-color: var(--line) !important;
}

body.ramos-page-mediciones.dark .desktop-table tbody tr,
body.ramos-page-mediciones.dark .table-row {
  background: var(--card) !important;
  border-color: var(--line) !important;
}

body.ramos-page-mediciones.dark .table-row:hover,
body.ramos-page-mediciones.dark .table-row.selected {
  background: rgba(255, 255, 255, .05) !important;
}

/* Panel lateral y modales */
body.ramos-page-mediciones.dark .side-panel,
body.ramos-page-mediciones.dark .modal-card,
body.ramos-page-mediciones.dark #panel-content,
body.ramos-page-mediciones.dark #modal-registro>div,
body.ramos-page-mediciones.dark #modal-estado>div,
body.ramos-page-mediciones.dark #modal-observacion>div,
body.ramos-page-mediciones.dark #modal-adjunto>div,
body.ramos-page-mediciones.dark #modal-tamano-imagen>div,
body.ramos-page-mediciones.dark #modal-historial>div {
  background: var(--card) !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
}

body.ramos-page-mediciones.dark .panel-sticky-head {
  background: var(--card) !important;
  border-color: var(--line) !important;
}

body.ramos-page-mediciones.dark .panel-backdrop.active,
body.ramos-page-mediciones.dark .modal.active {
  background: rgba(2, 6, 23, .78) !important;
}

/* Textos */
body.ramos-page-mediciones.dark .text-slate-950,
body.ramos-page-mediciones.dark .text-slate-900,
body.ramos-page-mediciones.dark .text-slate-800,
body.ramos-page-mediciones.dark .text-slate-700,
body.ramos-page-mediciones.dark .text-slate-600,
body.ramos-page-mediciones.dark .text-slate-500,
body.ramos-page-mediciones.dark .direction-title,
body.ramos-page-mediciones.dark .direction-value,
body.ramos-page-mediciones.dark .direction-row-title,
body.ramos-page-mediciones.dark .direction-row-value,
body.ramos-page-mediciones.dark .dashboard-kpi-value,
body.ramos-page-mediciones.dark .desktop-kpi-summary-value,
body.ramos-page-mediciones.dark .size-option-title,
body.ramos-page-mediciones.dark .med-section-head-pro h3,
body.ramos-page-mediciones.dark .med-action-tile strong {
  color: var(--text) !important;
}

body.ramos-page-mediciones.dark .text-slate-400,
body.ramos-page-mediciones.dark .text-slate-300,
body.ramos-page-mediciones.dark .desktop-kpi-summary-label,
body.ramos-page-mediciones.dark .desktop-kpi-summary-help,
body.ramos-page-mediciones.dark .dashboard-help,
body.ramos-page-mediciones.dark .dashboard-muted,
body.ramos-page-mediciones.dark .direction-label,
body.ramos-page-mediciones.dark .direction-explain,
body.ramos-page-mediciones.dark .direction-note,
body.ramos-page-mediciones.dark .size-option-desc,
body.ramos-page-mediciones.dark .label-tag,
body.ramos-page-mediciones.dark .med-section-head-pro p,
body.ramos-page-mediciones.dark .med-action-tile span,
body.ramos-page-mediciones.dark .med-compact-help {
  color: var(--muted) !important;
}

/* Botones suaves */
body.ramos-page-mediciones.dark .bg-blue-50 {
  background: rgba(59, 130, 246, .14) !important;
  color: #93c5fd !important;
  border-color: rgba(59, 130, 246, .22) !important;
}

body.ramos-page-mediciones.dark .bg-green-50,
body.ramos-page-mediciones.dark .bg-emerald-50 {
  background: rgba(16, 185, 129, .14) !important;
  color: #6ee7b7 !important;
  border-color: rgba(16, 185, 129, .22) !important;
}

body.ramos-page-mediciones.dark .bg-red-50,
body.ramos-page-mediciones.dark .bg-rose-50 {
  background: rgba(239, 68, 68, .14) !important;
  color: #fca5a5 !important;
  border-color: rgba(239, 68, 68, .22) !important;
}

body.ramos-page-mediciones.dark .bg-amber-50 {
  background: rgba(245, 158, 11, .14) !important;
  color: #fcd34d !important;
  border-color: rgba(245, 158, 11, .22) !important;
}

/* Badges */
body.ramos-page-mediciones.dark .status-badge.bg-slate-100,
body.ramos-page-mediciones.dark .mobile-pill.bg-slate-100,
body.ramos-page-mediciones.dark .direction-chip,
body.ramos-page-mediciones.dark .dashboard-badge {
  background: rgba(255, 255, 255, .08) !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
}

body.ramos-page-mediciones.dark .status-badge.bg-amber-400 {
  background: #f59e0b !important;
  color: #111827 !important;
}

body.ramos-page-mediciones.dark .status-badge.bg-green-400 {
  background: #22c55e !important;
  color: #052e16 !important;
}

body.ramos-page-mediciones.dark .status-badge.bg-blue-400 {
  background: #60a5fa !important;
  color: #0f172a !important;
}

body.ramos-page-mediciones.dark .status-badge.bg-orange-300 {
  background: #fdba74 !important;
  color: #7c2d12 !important;
}

/* Alertas */
body.ramos-page-mediciones.dark .alerta-roja {
  background: rgba(239, 68, 68, .12) !important;
  border-color: #ef4444 !important;
}

body.ramos-page-mediciones.dark .alerta-naranja {
  background: rgba(245, 158, 11, .12) !important;
  border-color: #f59e0b !important;
}

/* Loader */
body.ramos-page-mediciones.dark #loader {
  background: var(--bg) !important;
  color: var(--text) !important;
}

/* Hero */
body.ramos-page-mediciones.dark .mediciones-pro-hero,
body.ramos-page-mediciones.dark .mobile-hero,
body.ramos-page-mediciones.dark .direction-hero {
  box-shadow: 0 18px 45px rgba(0, 0, 0, .25) !important;
}

/* Bordes */
body.ramos-page-mediciones.dark .border,
body.ramos-page-mediciones.dark .border-b,
body.ramos-page-mediciones.dark .border-slate-100,
body.ramos-page-mediciones.dark .border-slate-200 {
  border-color: var(--line) !important;
}


/* ===== FIX Android: select compacto y archivos sin botón nativo ===== */
body.ramos-page-mediciones .native-file-input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

body.ramos-page-mediciones .file-picker-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 1rem;
  padding: .95rem 1rem;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

body.ramos-page-mediciones .file-picker-button:active,
body.ramos-page-mediciones .attach-option:active,
body.ramos-page-mediciones .tipo-option:active {
  transform: scale(.99);
}

body.ramos-page-mediciones .tipo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .45rem;
}

body.ramos-page-mediciones .tipo-option {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  border-radius: .95rem;
  padding: .8rem .45rem;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .03em;
  text-align: center;
}

body.ramos-page-mediciones .tipo-option.active {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}

body.ramos-page-mediciones.dark .file-picker-button {
  background: rgba(59, 130, 246, .14) !important;
  color: #93c5fd !important;
  border-color: rgba(59, 130, 246, .22) !important;
}

body.ramos-page-mediciones.dark .tipo-option {
  background: var(--soft) !important;
  color: var(--muted) !important;
  border-color: var(--line) !important;
}

body.ramos-page-mediciones.dark .tipo-option.active {
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: #fff !important;
}



body.ramos-page-mediciones .detail-file-picker-box {
  border: 1px dashed #bfdbfe;
  background: #eff6ff;
  border-radius: 1.15rem;
  padding: .85rem;
  margin-top: .75rem;
}

body.ramos-page-mediciones .detail-file-picker-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 1rem;
  padding: .95rem 1rem;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

body.ramos-page-mediciones .detail-file-picker-button:active {
  transform: scale(.99);
}

body.ramos-page-mediciones.dark .detail-file-picker-box,
body.ramos-page-mediciones.dark .detail-file-picker-button {
  background: rgba(59, 130, 246, .14) !important;
  color: #93c5fd !important;
  border-color: rgba(59, 130, 246, .22) !important;
}



/* ===== Selector admin de asignación · patrón Calidad ===== */
body.ramos-page-mediciones .admin-assign-box {
  border: 1px solid #bfdbfe;
  background: linear-gradient(135deg, #eff6ff, #f8fafc);
  border-radius: 1.25rem;
  padding: .95rem;
  display: grid;
  gap: .75rem;
}

body.ramos-page-mediciones .admin-assign-head {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
}

body.ramos-page-mediciones .admin-assign-icon {
  width: 38px;
  height: 38px;
  border-radius: 1rem;
  background: #2563eb;
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 950;
  flex-shrink: 0;
  box-shadow: 0 10px 22px rgba(37, 99, 235, .18);
}

body.ramos-page-mediciones .admin-assign-title {
  margin: 0;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #1d4ed8;
}

body.ramos-page-mediciones .admin-assign-help {
  margin: .15rem 0 0;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.35;
  color: #64748b;
}

body.ramos-page-mediciones .admin-assign-search {
  width: 100%;
  min-height: 46px;
  border-radius: 1rem;
  border: 1px solid #bfdbfe;
  background: white;
  color: #0f172a;
  padding: .75rem .85rem;
  font-size: 12px;
  font-weight: 900;
  outline: none;
}

body.ramos-page-mediciones .admin-assign-search:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .10);
}

body.ramos-page-mediciones .admin-assign-list {
  display: grid;
  gap: .45rem;
  max-height: 245px;
  overflow: auto;
  padding-right: .2rem;
}

body.ramos-page-mediciones .admin-assign-option {
  width: 100%;
  border: 1px solid #dbeafe;
  background: rgba(255, 255, 255, .82);
  color: #0f172a;
  border-radius: 1rem;
  padding: .75rem .8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  text-align: left;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}

body.ramos-page-mediciones .admin-assign-option:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(37, 99, 235, .08);
}

body.ramos-page-mediciones .admin-assign-option.active {
  background: #0f172a;
  color: white;
  border-color: #0f172a;
}

body.ramos-page-mediciones .admin-assign-option-main {
  min-width: 0;
}

body.ramos-page-mediciones .admin-assign-option-name {
  display: block;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .035em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.ramos-page-mediciones .admin-assign-option-email {
  display: block;
  margin-top: .15rem;
  font-size: 9px;
  font-weight: 800;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.ramos-page-mediciones .admin-assign-option.active .admin-assign-option-email {
  color: rgba(255, 255, 255, .72);
}

body.ramos-page-mediciones .admin-assign-option-chip {
  flex-shrink: 0;
  border-radius: 999px;
  padding: .3rem .55rem;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-size: 8px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
}

body.ramos-page-mediciones .admin-assign-option.active .admin-assign-option-chip {
  background: rgba(255, 255, 255, .14);
  color: white;
  border-color: rgba(255, 255, 255, .18);
}

body.ramos-page-mediciones .admin-date-box {
  border: 1px solid var(--line);
  background: var(--soft);
  border-radius: 1.1rem;
  padding: .75rem;
  display: grid;
  gap: .55rem;
}


body.ramos-page-mediciones .admin-date-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .55rem;
}

body.ramos-page-mediciones .admin-date-label {
  display: grid;
  gap: .35rem;
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}

body.ramos-page-mediciones .admin-date-label .input-field {
  min-height: 44px;
  font-size: 12px;
  font-weight: 900;
}

@media (max-width: 520px) {
  body.ramos-page-mediciones .admin-date-grid {
    grid-template-columns: 1fr;
  }
}

body.ramos-page-mediciones .admin-date-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .45rem;
}

body.ramos-page-mediciones .admin-date-mini-btn {
  border: 1px solid var(--line);
  background: white;
  color: #334155;
  border-radius: .85rem;
  padding: .62rem .7rem;
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .06em;
  cursor: pointer;
}

body.ramos-page-mediciones.dark .admin-assign-box {
  background: rgba(59, 130, 246, .12) !important;
  border-color: rgba(59, 130, 246, .24) !important;
}

body.ramos-page-mediciones.dark .admin-assign-title {
  color: #93c5fd !important;
}

body.ramos-page-mediciones.dark .admin-assign-help {
  color: var(--muted) !important;
}

body.ramos-page-mediciones.dark .admin-assign-search,
body.ramos-page-mediciones.dark .admin-assign-option,
body.ramos-page-mediciones.dark .admin-date-mini-btn {
  background: var(--soft) !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
}

body.ramos-page-mediciones.dark .admin-assign-option-email {
  color: var(--muted) !important;
}

body.ramos-page-mediciones.dark .admin-assign-option.active {
  background: #38bdf8 !important;
  color: #0f172a !important;
  border-color: #38bdf8 !important;
}

body.ramos-page-mediciones.dark .admin-assign-option.active .admin-assign-option-email {
  color: rgba(15, 23, 42, .72) !important;
}

body.ramos-page-mediciones.dark .admin-assign-option.active .admin-assign-option-chip {
  background: rgba(15, 23, 42, .12) !important;
  color: #0f172a !important;
  border-color: rgba(15, 23, 42, .16) !important;
}

/* ===== BLOQUE SEPARADO DESDE mediciones.html ===== */

/* ===== iPhone notch safe area ===== */
@supports (padding: max(0px)) {
  body.ramos-page-mediciones {
    padding-top: env(safe-area-inset-top);
  }
}

/* ===== BLOQUE SEPARADO DESDE mediciones.html ===== */

/* ===== MEDICIONES · Patrón Calidad v1 ===== */
body.ramos-page-mediciones * {
  box-sizing: border-box;
}

html,
body.ramos-page-mediciones {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none;
}

body.ramos-page-mediciones {
  margin: 0;
  background:
    radial-gradient(circle at 0% 0%, rgba(37, 99, 235, .12), transparent 32%),
    radial-gradient(circle at 100% 0%, rgba(37, 99, 235, .10), transparent 30%),
    var(--bg) !important;
  color: var(--text);
  touch-action: pan-y;
}

body.ramos-page-mediciones .shell-calidad,
body.ramos-page-mediciones .desktop-shell,
body.ramos-page-mediciones .mediciones-pro-shell {
  width: min(1480px, calc(100% - 64px)) !important;
  max-width: 1480px !important;
  margin: 0 auto !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

body.ramos-page-mediciones .glass {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, .88) !important;
  backdrop-filter: blur(18px) !important;
  border-bottom: 1px solid rgba(15, 23, 42, .06) !important;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .055) !important;
}

body.ramos-page-mediciones.dark .glass {
  background: rgba(15, 23, 42, .90) !important;
  border-color: rgba(255, 255, 255, .08) !important;
}

body.ramos-page-mediciones .topbar-calidad {
  min-height: 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

body.ramos-page-mediciones .brand-calidad {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

body.ramos-page-mediciones .brand-logo-calidad {
  height: 36px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
  max-width: 140px;
}

body.ramos-page-mediciones .back-btn-calidad {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 950;
  flex-shrink: 0;
}

body.ramos-page-mediciones.dark .back-btn-calidad {
  background: rgba(255, 255, 255, .08);
  color: #e2e8f0;
}

body.ramos-page-mediciones .role-badge-calidad {
  font-size: 9px;
  font-weight: 950;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: .12em;
  margin: 0 0 2px;
}

body.ramos-page-mediciones .title-calidad {
  margin: 0;
  font-size: 20px;
  font-weight: 950;
  letter-spacing: -.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

body.ramos-page-mediciones .top-actions-calidad {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

body.ramos-page-mediciones .btn-calidad {
  border: 0;
  border-radius: 16px;
  padding: 13px 16px;
  min-height: 44px;
  font-family: inherit;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
}

body.ramos-page-mediciones .btn-soft-calidad {
  background: var(--soft);
  color: var(--text);
  border: 1px solid var(--line);
}

body.ramos-page-mediciones .mediciones-pro-shell {
  padding-top: 16px !important;
  padding-bottom: 34px !important;
  display: grid;
  gap: 16px;
}

body.ramos-page-mediciones .mediciones-pro-hero {
  background:
    radial-gradient(circle at 0% 0%, rgba(37, 99, 235, .22), transparent 36%),
    linear-gradient(135deg, #0f172a 0%, #1e293b 52%, #1d4ed8 100%) !important;
  color: white;
  border-radius: 32px !important;
  padding: 20px !important;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .18) !important;
  position: relative;
  overflow: hidden;
}

body.ramos-page-mediciones .mediciones-pro-hero:after {
  content: "";
  position: absolute;
  right: -80px;
  top: -90px;
  width: 230px;
  height: 230px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
}

body.ramos-page-mediciones .mediciones-pro-hero>* {
  position: relative;
  z-index: 1;
}

body.ramos-page-mediciones .hero-grid-calidad {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: stretch;
  justify-content: space-between;
}

@media (min-width:1200px) {
  body.ramos-page-mediciones .hero-grid-calidad {
    flex-direction: row;
    align-items: center;
  }
}

body.ramos-page-mediciones .hero-kicker-calidad {
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: #bfdbfe;
  margin: 0;
}

body.ramos-page-mediciones .hero-title-calidad {
  font-size: clamp(24px, 3vw, 30px);
  line-height: 1.05;
  margin: 4px 0 8px;
  font-weight: 950;
  letter-spacing: -.045em;
  color: white;
}

body.ramos-page-mediciones .hero-text-calidad {
  margin: 0;
  max-width: 760px;
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
}

body.ramos-page-mediciones .kpi-grid-calidad {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  min-width: min(640px, 100%);
}

@media (min-width:760px) {
  body.ramos-page-mediciones .kpi-grid-calidad {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width:1100px) {
  body.ramos-page-mediciones .kpi-grid-calidad {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
}

body.ramos-page-mediciones .kpi-box-calidad {
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 14px;
  padding: 8px 10px;
  min-width: 0;
}

body.ramos-page-mediciones .kpi-label-calidad {
  font-size: 8px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #bfdbfe;
  margin: 0;
  line-height: 1.2;
  min-height: 18px;
}

body.ramos-page-mediciones .kpi-value-calidad {
  font-size: 20px;
  font-weight: 950;
  letter-spacing: -.04em;
  margin: 3px 0 0;
  line-height: 1;
  color: white !important;
}

body.ramos-page-mediciones .mediciones-pro-layout {
  display: grid !important;
  grid-template-columns: 260px minmax(0, 1fr) !important;
  gap: 16px !important;
  align-items: start;
}

body.ramos-page-mediciones .mediciones-pro-side {
  position: sticky;
  top: calc(env(safe-area-inset-top) + 84px);
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

body.ramos-page-mediciones .mediciones-pro-main {
  min-width: 0;
  display: grid;
  gap: 16px;
}

body.ramos-page-mediciones .card,
body.ramos-page-mediciones .side-card-calidad,
body.ramos-page-mediciones .mediciones-pro-list {
  background: var(--card) !important;
  border: 1px solid var(--line) !important;
  border-radius: 24px !important;
  box-shadow: var(--shadow) !important;
  overflow: hidden;
}

body.ramos-page-mediciones .med-action-tile {
  width: 100%;
  min-height: 58px !important;
  justify-content: flex-start;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px !important;
  border-radius: 14px !important;
  padding: 12px 14px !important;
  background: var(--card) !important;
  color: var(--text) !important;
  border: 1px solid var(--line) !important;
  box-shadow: none !important;
  cursor: pointer;
  font-family: inherit;
  transition: transform .12s ease, filter .12s ease, background .12s ease;
}

body.ramos-page-mediciones .med-action-tile:hover {
  transform: translateY(-1px);
}

body.ramos-page-mediciones .med-action-tile.ring-2,
body.ramos-page-mediciones .med-action-tile.bg-blue-50 {
  background: #0f172a !important;
  color: #fff !important;
  border-color: #0f172a !important;
  box-shadow: none !important;
}

body.ramos-page-mediciones.dark .med-action-tile.ring-2,
body.ramos-page-mediciones.dark .med-action-tile.bg-blue-50 {
  background: #38bdf8 !important;
  color: #0f172a !important;
  border-color: #38bdf8 !important;
}

body.ramos-page-mediciones .med-action-icon {
  width: 34px !important;
  height: 34px !important;
  border-radius: 14px !important;
  background: rgba(37, 99, 235, .10) !important;
  color: #2563eb !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 15px !important;
  font-weight: 950;
}

body.ramos-page-mediciones .med-action-tile.ring-2 .med-action-icon,
body.ramos-page-mediciones .med-action-tile.bg-blue-50 .med-action-icon {
  background: rgba(255, 255, 255, .16) !important;
  color: #fff !important;
}

body.ramos-page-mediciones.dark .med-action-tile.ring-2 .med-action-icon,
body.ramos-page-mediciones.dark .med-action-tile.bg-blue-50 .med-action-icon {
  background: rgba(15, 23, 42, .12) !important;
  color: #0f172a !important;
}

body.ramos-page-mediciones .med-action-tile strong {
  display: block;
  font-size: 11px !important;
  font-weight: 950 !important;
  text-transform: uppercase;
  letter-spacing: .05em;
  line-height: 1.1;
  color: inherit !important;
}

body.ramos-page-mediciones .med-action-tile span {
  display: block;
  font-size: 9px !important;
  font-weight: 850 !important;
  color: var(--muted) !important;
  line-height: 1.1;
  margin-top: 2px !important;
}

body.ramos-page-mediciones .med-action-tile.ring-2 span,
body.ramos-page-mediciones .med-action-tile.bg-blue-50 span {
  color: inherit !important;
  opacity: .72;
}

body.ramos-page-mediciones .section-head-calidad,
body.ramos-page-mediciones .med-section-head-pro {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  padding: 16px !important;
  border-bottom: 1px solid var(--line) !important;
  background: rgba(248, 250, 252, .72);
}

body.ramos-page-mediciones.dark .section-head-calidad,
body.ramos-page-mediciones.dark .med-section-head-pro {
  background: rgba(255, 255, 255, .03);
}

body.ramos-page-mediciones .section-kicker-calidad {
  margin: 0;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--primary);
}

body.ramos-page-mediciones .section-title-calidad,
body.ramos-page-mediciones .med-section-head-pro h3 {
  margin: 3px 0 0 !important;
  font-size: 20px !important;
  font-weight: 950 !important;
  letter-spacing: -.035em !important;
  color: var(--text) !important;
}

body.ramos-page-mediciones .section-help-calidad,
body.ramos-page-mediciones .med-section-head-pro p {
  margin: 5px 0 0;
  color: var(--muted) !important;
  font-size: 12px !important;
  font-weight: 750 !important;
  line-height: 1.35;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

body.ramos-page-mediciones .toolbar-calidad {
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(150px, 190px)) auto;
  gap: 10px;
  align-items: end;
  border-bottom: 1px solid var(--line);
}

body.ramos-page-mediciones .toolbar-calidad label {
  display: grid;
  gap: 7px;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}

body.ramos-page-mediciones .input-calidad,
body.ramos-page-mediciones .select-calidad,
body.ramos-page-mediciones .search-field,
body.ramos-page-mediciones .filter-select,
body.ramos-page-mediciones .input-field {
  width: 100%;
  border: 1px solid var(--line) !important;
  background: var(--soft) !important;
  border-radius: 16px !important;
  padding: 13px 14px !important;
  outline: none;
  font-family: inherit;
  font-size: 11px !important;
  font-weight: 800 !important;
  color: var(--text) !important;
  min-height: 46px;
  text-transform: none;
  letter-spacing: 0;
}

body.ramos-page-mediciones .search-field:focus,
body.ramos-page-mediciones .filter-select:focus,
body.ramos-page-mediciones .input-field:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .10) !important;
  background: var(--card) !important;
}

body.ramos-page-mediciones .btn-toolbar-calidad {
  border: 0;
  border-radius: 16px;
  padding: 13px 16px;
  min-height: 46px;
  font-family: inherit;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
  background: var(--soft);
  color: var(--text);
  border: 1px solid var(--line);
}

body.ramos-page-mediciones .toolbar-clear-btn {
  align-self: end;
  width: 100%;
}

body.ramos-page-mediciones .mediciones-pro-list .desktop-table-wrap {
  max-height: calc(100vh - 330px) !important;
}

body.ramos-page-mediciones .desktop-table thead th {
  position: sticky;
  top: 0;
  background: var(--soft) !important;
  z-index: 5;
}

body.ramos-page-mediciones .table-row:hover {
  background: var(--soft) !important;
}

@media (max-width:1199px) {
  body.ramos-page-mediciones .mediciones-pro-layout {
    grid-template-columns: 1fr !important;
  }

  body.ramos-page-mediciones .mediciones-pro-side {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.ramos-page-mediciones .toolbar-calidad {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width:899px) {

  body.ramos-page-mediciones .shell-calidad,
  body.ramos-page-mediciones .desktop-shell,
  body.ramos-page-mediciones .mediciones-pro-shell {
    width: calc(100% - 32px) !important;
  }

  body.ramos-page-mediciones .mediciones-pro-shell {
    padding-top: 14px !important;
    gap: 14px !important;
  }

  body.ramos-page-mediciones .mobile-hero {
    border-radius: 24px !important;
    padding: 18px 16px !important;
  }

  body.ramos-page-mediciones .topbar-calidad {
    min-height: 62px;
  }

  body.ramos-page-mediciones .brand-logo-calidad {
    height: 30px;
  }

  body.ramos-page-mediciones .title-calidad {
    font-size: 17px;
  }
}

@media (max-width:640px) {

  body.ramos-page-mediciones .shell-calidad,
  body.ramos-page-mediciones .desktop-shell,
  body.ramos-page-mediciones .mediciones-pro-shell {
    width: calc(100% - 24px) !important;
  }

  body.ramos-page-mediciones .toolbar-calidad {
    grid-template-columns: 1fr;
  }
}


/* ===== MEDICIONES · Buscador y listado unidos como Calidad ===== */
body.ramos-page-mediciones .mediciones-filtros-card {
  border-radius: 24px !important;
  margin-bottom: 0 !important;
  overflow: hidden !important;
}

body.ramos-page-mediciones .mediciones-filtros-card .mediciones-pro-list {
  border-radius: 0 !important;
  border: 0 !important;
  border-top: 1px solid var(--line) !important;
  box-shadow: none !important;
  background: transparent !important;
}

body.ramos-page-mediciones .mediciones-filtros-card .med-section-head-pro {
  border-top: 0 !important;
  background: transparent !important;
}

body.ramos-page-mediciones .mediciones-filtros-card .desktop-table-wrap {
  max-height: calc(100vh - 390px) !important;
}

body.ramos-page-mediciones #dashboard-section:empty {
  display: none !important;
}

body.ramos-page-mediciones .mobile-stat {
  padding: .58rem !important;
}

body.ramos-page-mediciones .med-mob-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

@media (max-width: 360px) {
  body.ramos-page-mediciones .med-mob-kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 899px) {
  body.ramos-page-mediciones .mediciones-filtros-card {
    border-radius: 24px !important;
    margin-bottom: 0 !important;
    border: 1px solid var(--line) !important;
  }
}

/* ===== BLOQUE SEPARADO DESDE mediciones.html ===== */

/* ===== MEDICIONES · Fechas compactas en listado ===== */
body.ramos-page-mediciones .med-list-fechas {
  display: grid;
  gap: 3px;
  min-width: 96px;
}

body.ramos-page-mediciones .med-list-fecha-line {
  display: flex;
  align-items: baseline;
  gap: 5px;
  white-space: nowrap;
  line-height: 1.12;
}

body.ramos-page-mediciones .med-list-fecha-code {
  min-width: 16px;
  font-size: 8px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}

body.ramos-page-mediciones .med-list-fecha-value {
  font-size: 10px;
  font-weight: 850;
  color: var(--text);
}

body.ramos-page-mediciones .med-list-fecha-muted {
  color: var(--muted);
  opacity: .75;
}

/* ===== BLOQUE SEPARADO DESDE mediciones.html ===== */

/* ===== MEDICIONES · Filtros escritorio en una sola fila ===== */
@media (min-width: 1200px) {
  body.ramos-page-mediciones .toolbar-calidad {
    grid-template-columns:
      minmax(260px, 1.35fr) minmax(112px, .55fr) minmax(112px, .55fr) minmax(130px, .65fr) minmax(112px, auto) minmax(138px, auto) !important;
    gap: 8px !important;
    align-items: end !important;
  }

  body.ramos-page-mediciones .toolbar-calidad label {
    min-width: 0 !important;
  }

  body.ramos-page-mediciones .toolbar-calidad .search-field,
  body.ramos-page-mediciones .toolbar-calidad .filter-select {
    min-height: 42px !important;
    padding: 10px 11px !important;
    border-radius: 13px !important;
    font-size: 10px !important;
  }

  body.ramos-page-mediciones .toolbar-calidad .btn-toolbar-calidad {
    min-height: 42px !important;
    padding: 10px 11px !important;
    border-radius: 13px !important;
    font-size: 8.5px !important;
    letter-spacing: .055em !important;
    width: 100% !important;
  }

  body.ramos-page-mediciones .toolbar-clear-btn {
    width: 100% !important;
  }
}

@media (min-width: 1200px) and (max-width: 1320px) {
  body.ramos-page-mediciones .toolbar-calidad {
    grid-template-columns:
      minmax(220px, 1.2fr) minmax(98px, .5fr) minmax(98px, .5fr) minmax(118px, .6fr) minmax(96px, auto) minmax(118px, auto) !important;
    gap: 6px !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  body.ramos-page-mediciones .toolbar-calidad .btn-toolbar-calidad {
    font-size: 8px !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
  }
}

/* ===== BLOQUE SEPARADO DESDE mediciones.html ===== */

/* ===== MEDICIONES · listado con más filas visibles ===== */
@media (min-width: 900px) {
  body.ramos-page-mediciones .mediciones-filtros-card .desktop-table-wrap {
    max-height: min(760px, calc(100vh - 245px)) !important;
    min-height: min(660px, calc(100vh - 245px)) !important;
    overflow-y: auto !important;
  }
}

@media (min-width: 900px) and (max-height: 850px) {
  body.ramos-page-mediciones .mediciones-filtros-card .desktop-table-wrap {
    min-height: auto !important;
    max-height: calc(100vh - 245px) !important;
  }
}


/* ===== MEDICIONES · Histórico igual que Incidencias ===== */
body.ramos-page-mediciones .med-hist-filter-box {
  margin-top: 10px !important;
  background: var(--soft) !important;
  border: 1px solid var(--line) !important;
  border-radius: 18px !important;
  padding: 12px !important;
}

body.ramos-page-mediciones .med-hist-filter-check {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: .65rem !important;
  width: 100% !important;
  background: var(--card) !important;
  border: 1px solid var(--line) !important;
  border-radius: 1rem !important;
  padding: .65rem .75rem !important;
  font-size: 10px !important;
  font-weight: 900 !important;
  text-transform: uppercase !important;
  letter-spacing: .04em !important;
  color: var(--text) !important;
  cursor: pointer !important;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif !important;
  min-height: 42px !important;
}

body.ramos-page-mediciones .med-hist-filter-check input {
  width: 16px !important;
  height: 16px !important;
  accent-color: #2563eb !important;
  flex-shrink: 0 !important;
}

body.ramos-page-mediciones .med-hist-filter-check.active-period {
  background: #0f172a !important;
  color: #fff !important;
  border-color: #0f172a !important;
}

body.ramos-page-mediciones.dark .med-hist-filter-check.active-period {
  background: #38bdf8 !important;
  color: #0f172a !important;
  border-color: #38bdf8 !important;
}

/* ===== MEDICIONES · Exportación admin tipo Reprocesos ===== */
body.ramos-page-mediciones .med-excel-filter-panel {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: .9rem;
  align-items: end;
  border: 1px solid var(--line);
  background: var(--soft);
  border-radius: 1.5rem;
  padding: .9rem;
}

body.ramos-page-mediciones .med-excel-date-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: .75rem;
  align-items: end;
}

body.ramos-page-mediciones .med-excel-help-line {
  grid-column: 1 / -1;
  font-size: 11px;
  font-weight: 850;
  color: var(--muted);
  line-height: 1.35;
}

body.ramos-page-mediciones .med-export-option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .75rem;
}

body.ramos-page-mediciones .med-export-box {
  border: 1px solid var(--line);
  background: var(--soft);
  border-radius: 1.35rem;
  padding: .85rem;
}

body.ramos-page-mediciones .med-export-status {
  border-radius: 1.15rem;
  padding: .9rem 1rem;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.45;
  white-space: pre-line;
  background: var(--soft);
  border: 1px solid var(--line);
  color: var(--muted);
}

body.ramos-page-mediciones .med-days-lines {
  display: grid;
  gap: 3px;
  min-width: 96px;
}

body.ramos-page-mediciones .med-days-line {
  display: flex;
  align-items: baseline;
  gap: 5px;
  white-space: nowrap;
  line-height: 1.12;
}

body.ramos-page-mediciones .med-days-code {
  min-width: 30px;
  font-size: 8px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}

body.ramos-page-mediciones .med-days-value {
  font-size: 10px;
  font-weight: 850;
  color: var(--text);
}

body.ramos-page-mediciones .med-days-muted {
  color: var(--muted);
  opacity: .75;
}

@media (max-width: 760px) {

  body.ramos-page-mediciones .med-excel-filter-panel,
  body.ramos-page-mediciones .med-excel-date-grid {
    grid-template-columns: 1fr;
  }
}



/* ===== MEDICIONES · Informe diario PDF igualado a Calidad ===== */
body.ramos-page-mediciones .med-pdf-panel {
  margin: 0;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(260px, .95fr) minmax(560px, 1.35fr);
  gap: 14px;
  align-items: center;
  border: 1px solid #bfdbfe;
  border-radius: 24px;
  background:
    radial-gradient(circle at 0% 0%, rgba(37, 99, 235, .12), transparent 34%),
    var(--card);
  box-shadow: 0 10px 28px rgba(15, 23, 42, .055);
}

body.ramos-page-mediciones.dark .med-pdf-panel {
  border-color: rgba(56, 189, 248, .26);
  background:
    radial-gradient(circle at 0% 0%, rgba(56, 189, 248, .10), transparent 34%),
    var(--card);
}

body.ramos-page-mediciones .med-pdf-title {
  margin: 0;
  font-size: 15px;
  font-weight: 950;
  letter-spacing: -.025em;
  color: var(--text);
}

body.ramos-page-mediciones .med-pdf-text {
  margin: 5px 0 0;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.45;
  color: var(--muted);
}

body.ramos-page-mediciones .med-pdf-controls {
  display: grid;
  grid-template-columns: minmax(145px, .9fr) minmax(165px, 1fr) minmax(145px, auto);
  gap: 8px;
  align-items: end;
  width: 100%;
  min-width: 0;
}

body.ramos-page-mediciones .med-pdf-controls.rango-mode {
  grid-template-columns: minmax(135px, .8fr) minmax(145px, .85fr) minmax(145px, .85fr) minmax(135px, auto);
}

body.ramos-page-mediciones .med-pdf-controls label,
body.ramos-page-mediciones .med-pdf-controls .input-field,
body.ramos-page-mediciones .med-pdf-controls .btn-toolbar-calidad {
  min-width: 0 !important;
}

body.ramos-page-mediciones .med-pdf-controls label {
  display: grid;
  gap: 7px;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin: 0;
}

body.ramos-page-mediciones .med-pdf-controls .btn-toolbar-calidad {
  width: 100% !important;
  min-width: 124px !important;
  min-height: 46px !important;
  padding: 12px 10px !important;
  white-space: nowrap !important;
}

body.ramos-page-mediciones .med-pdf-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 9px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 7px;
  width: fit-content;
}

body.ramos-page-mediciones.dark .med-pdf-chip {
  background: rgba(59, 130, 246, .14);
  color: #bfdbfe;
  border-color: rgba(59, 130, 246, .26);
}

body.ramos-page-mediciones .med-pdf-info-note {
  border: 1px solid var(--line);
  background: rgba(248, 250, 252, .72);
  border-radius: 18px;
  padding: 12px;
  display: grid;
  gap: 6px;
}

body.ramos-page-mediciones.dark .med-pdf-info-note {
  background: rgba(255, 255, 255, .035);
}

body.ramos-page-mediciones .med-pdf-info-title {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 950;
  letter-spacing: -.025em;
}

body.ramos-page-mediciones .med-pdf-info-text {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.45;
}

@media (max-width: 1180px) {
  body.ramos-page-mediciones .med-pdf-panel {
    grid-template-columns: 1fr !important;
  }

  body.ramos-page-mediciones .med-pdf-controls,
  body.ramos-page-mediciones .med-pdf-controls.rango-mode {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 820px) {

  body.ramos-page-mediciones .med-pdf-controls,
  body.ramos-page-mediciones .med-pdf-controls.rango-mode {
    grid-template-columns: 1fr 1fr !important;
  }
}

@media (max-width: 520px) {

  body.ramos-page-mediciones .med-pdf-controls,
  body.ramos-page-mediciones .med-pdf-controls.rango-mode {
    grid-template-columns: 1fr !important;
  }

  body.ramos-page-mediciones .med-pdf-controls .btn-toolbar-calidad {
    min-width: 0 !important;
  }
}

/* ===== BLOQUE SEPARADO DESDE mediciones.html ===== */

/* ===== FIX modal Con cita / Estado: scroll completo ===== */
body.ramos-page-mediciones #modal-estado.modal {
  align-items: center !important;
  justify-content: center !important;
  overflow-y: auto !important;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)) !important;
}

body.ramos-page-mediciones #modal-estado .modal-estado-card {
  max-height: calc(100dvh - 32px) !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior: contain !important;
}

@media (max-width: 640px) {
  body.ramos-page-mediciones #modal-estado.modal {
    align-items: flex-end !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  body.ramos-page-mediciones #modal-estado .modal-estado-card {
    max-height: calc(100dvh - 24px) !important;
    border-radius: 28px !important;
  }
}

/* ===== BLOQUE SEPARADO DESDE mediciones.html ===== */

/* ===== FIX MEDICIONES · Informe PDF comportamiento igual a Calidad =====
       En esta zona, las reglas de grid de los labels pisaban la clase hidden.
       Forzamos que en modo "Un día" solo se vea Día del informe y en rango solo Desde/Hasta. */
body.ramos-page-mediciones #pdfMedControls label.hidden,
body.ramos-page-mediciones #pdfMedControls button.hidden,
body.ramos-page-mediciones #pdfMedDiaWrap.hidden,
body.ramos-page-mediciones #pdfMedDesdeWrap.hidden,
body.ramos-page-mediciones #pdfMedHastaWrap.hidden,
body.ramos-page-mediciones #btnDescargarPdfMedicionesDia.hidden,
body.ramos-page-mediciones #btnDescargarPdfMedicionesZip.hidden {
  display: none !important;
}

body.ramos-page-mediciones #pdfMedControls label {
  color: var(--muted) !important;
  font-weight: 950 !important;
}

body.ramos-page-mediciones .med-pdf-title {
  color: var(--text) !important;
  font-weight: 950 !important;
}

body.ramos-page-mediciones .med-pdf-info-title {
  color: var(--text) !important;
  font-weight: 950 !important;
}

body.ramos-page-mediciones .med-pdf-text,
body.ramos-page-mediciones .med-pdf-info-text {
  color: var(--muted) !important;
  font-weight: 800 !important;
}

/* ===== BLOQUE SEPARADO DESDE mediciones.html ===== */

/* ===== MEDICIONES · Gestión rápida móvil ===== */
body.ramos-page-mediciones .med-mobile-quick-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1.45rem;
  box-shadow: var(--shadow);
  padding: .95rem;
  display: grid;
  gap: .75rem;
}

body.ramos-page-mediciones .med-mobile-quick-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: .75rem;
}

body.ramos-page-mediciones .med-mobile-quick-kicker {
  margin: 0;
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--primary);
}

body.ramos-page-mediciones .med-mobile-quick-title {
  margin: 2px 0 0;
  font-size: 15px;
  font-weight: 950;
  letter-spacing: -.03em;
  color: var(--text);
}

body.ramos-page-mediciones .med-mobile-quick-help {
  margin: 0;
  font-size: 9px;
  font-weight: 850;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
}

body.ramos-page-mediciones .med-mobile-quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
}

body.ramos-page-mediciones .med-mobile-quick-btn {
  width: 100%;
  min-height: 72px;
  border: 1px solid #bfdbfe;
  background:
    radial-gradient(circle at 0% 0%, rgba(37, 99, 235, .08), transparent 34%),
    var(--card);
  color: var(--text);
  border-radius: 1.15rem;
  padding: .75rem;
  display: flex;
  align-items: center;
  gap: .65rem;
  text-align: left;
  box-shadow: 0 10px 22px rgba(15, 23, 42, .055);
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  cursor: pointer;
}

body.ramos-page-mediciones .med-mobile-quick-btn:active {
  transform: scale(.985);
}

body.ramos-page-mediciones .med-mobile-quick-icon {
  width: 34px;
  height: 34px;
  border-radius: .95rem;
  background: #eff6ff;
  color: #1d4ed8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 15px;
  font-weight: 950;
  border: 1px solid #bfdbfe;
}

body.ramos-page-mediciones .med-mobile-quick-btn strong {
  display: block;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .045em;
  color: var(--text);
  line-height: 1.05;
}

body.ramos-page-mediciones .med-mobile-quick-btn span:not(.med-mobile-quick-icon) {
  display: block;
  margin-top: .18rem;
  font-size: 8.5px;
  font-weight: 850;
  color: var(--muted);
  line-height: 1.12;
}

body.ramos-page-mediciones .med-mobile-quick-btn.ring-2,
body.ramos-page-mediciones .med-mobile-quick-btn.bg-blue-50 {
  background: linear-gradient(135deg, #eff6ff, #ffffff) !important;
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .10), 0 14px 26px rgba(37, 99, 235, .12) !important;
}

body.ramos-page-mediciones .med-mobile-quick-btn.ring-2 .med-mobile-quick-icon,
body.ramos-page-mediciones .med-mobile-quick-btn.bg-blue-50 .med-mobile-quick-icon {
  background: #2563eb !important;
  color: white !important;
  border-color: #2563eb !important;
}

body.ramos-page-mediciones .med-mobile-hist-box {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  padding: .8rem;
  display: grid;
  gap: .55rem;
}

body.ramos-page-mediciones .med-mobile-hist-title {
  margin: 0;
  font-size: 9px;
  font-weight: 950;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: .10em;
}

body.ramos-page-mediciones .med-mobile-hist-text {
  margin: .15rem 0 0;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--muted);
}

body.ramos-page-mediciones .med-mobile-hist-action {
  min-height: 42px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  border-radius: 1rem;
  padding: .65rem .75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
}

body.ramos-page-mediciones .med-mobile-hist-action.active-period {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  border-color: #2563eb !important;
}

body.ramos-page-mediciones .med-mobile-hist-check {
  min-height: 42px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  border-radius: 1rem;
  padding: .65rem .75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .04em;
}

body.ramos-page-mediciones .med-mobile-hist-check input {
  width: 16px;
  height: 16px;
  accent-color: #2563eb;
  flex-shrink: 0;
}

body.ramos-page-mediciones.dark .med-mobile-quick-btn {
  background: var(--card) !important;
  border-color: rgba(59, 130, 246, .22) !important;
  color: var(--text) !important;
}

body.ramos-page-mediciones.dark .med-mobile-quick-icon {
  background: rgba(59, 130, 246, .14) !important;
  color: #93c5fd !important;
  border-color: rgba(59, 130, 246, .24) !important;
}

body.ramos-page-mediciones.dark .med-mobile-quick-btn.ring-2,
body.ramos-page-mediciones.dark .med-mobile-quick-btn.bg-blue-50 {
  background: rgba(56, 189, 248, .13) !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, .10) !important;
}

body.ramos-page-mediciones.dark .med-mobile-quick-btn.ring-2 .med-mobile-quick-icon,
body.ramos-page-mediciones.dark .med-mobile-quick-btn.bg-blue-50 .med-mobile-quick-icon {
  background: #38bdf8 !important;
  color: #0f172a !important;
  border-color: #38bdf8 !important;
}

body.ramos-page-mediciones.dark .med-mobile-hist-action.active-period {
  background: rgba(56, 189, 248, .13) !important;
  color: #bfdbfe !important;
  border-color: #38bdf8 !important;
}

@media (max-width: 390px) {
  body.ramos-page-mediciones .med-mobile-quick-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== BLOQUE SEPARADO DESDE mediciones.html ===== */

/* ===== FIX MEDICIONES MÓVIL · evitar ensanche lateral ===== */
@media (max-width: 899px) {

  html,
  body.ramos-page-mediciones,
  body.ramos-page-mediciones #view-app {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  body.ramos-page-mediciones {
    position: relative;
  }

  body.ramos-page-mediciones .shell-calidad,
  body.ramos-page-mediciones .desktop-shell,
  body.ramos-page-mediciones .mediciones-pro-shell {
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
  }

  body.ramos-page-mediciones .mobile-view,
  body.ramos-page-mediciones .mobile-hero,
  body.ramos-page-mediciones .med-mobile-quick-panel,
  body.ramos-page-mediciones .med-mobile-hist-box,
  body.ramos-page-mediciones #lista-mediciones,
  body.ramos-page-mediciones .mobile-card-pro,
  body.ramos-page-mediciones .bg-white,
  body.ramos-page-mediciones .card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
  }

  body.ramos-page-mediciones .med-mobile-quick-head {
    min-width: 0 !important;
    align-items: flex-start !important;
  }

  body.ramos-page-mediciones .med-mobile-quick-head>div {
    min-width: 0 !important;
  }

  body.ramos-page-mediciones .med-mobile-quick-help {
    white-space: normal !important;
    text-align: right !important;
    max-width: 92px !important;
    line-height: 1.15 !important;
    flex-shrink: 1 !important;
  }

  body.ramos-page-mediciones .med-mobile-quick-grid,
  body.ramos-page-mediciones .med-mobile-hist-box .grid,
  body.ramos-page-mediciones .mobile-hero .grid,
  body.ramos-page-mediciones .grid {
    min-width: 0 !important;
  }

  body.ramos-page-mediciones .med-mobile-quick-btn,
  body.ramos-page-mediciones .med-mobile-hist-action,
  body.ramos-page-mediciones .med-mobile-hist-check {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }

  body.ramos-page-mediciones .med-mobile-quick-btn>span:not(.med-mobile-quick-icon),
  body.ramos-page-mediciones .med-mobile-quick-btn strong,
  body.ramos-page-mediciones .med-mobile-quick-btn span:not(.med-mobile-quick-icon) span {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
  }

  body.ramos-page-mediciones .med-mobile-quick-icon {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
  }

  body.ramos-page-mediciones .med-mobile-quick-btn.ring-2,
  body.ramos-page-mediciones .med-mobile-quick-btn.bg-blue-50 {
    box-shadow: inset 0 0 0 2px rgba(37, 99, 235, .25), 0 10px 22px rgba(37, 99, 235, .10) !important;
  }

  body.ramos-page-mediciones .topbar-calidad {
    width: 100% !important;
    min-width: 0 !important;
  }

  body.ramos-page-mediciones .brand-calidad {
    min-width: 0 !important;
    flex: 1 1 auto !important;
  }

  body.ramos-page-mediciones .top-actions-calidad {
    flex-shrink: 0 !important;
  }

  body.ramos-page-mediciones .btn-calidad {
    padding-left: 11px !important;
    padding-right: 11px !important;
    min-width: 42px !important;
  }

  body.ramos-page-mediciones .brand-logo-calidad {
    max-width: 104px !important;
  }

  body.ramos-page-mediciones .side-panel {
    width: 100vw !important;
    max-width: 100vw !important;
  }
}

@media (max-width: 390px) {
  body.ramos-page-mediciones .med-mobile-quick-grid {
    grid-template-columns: 1fr !important;
  }

  body.ramos-page-mediciones .mobile-hero .grid.grid-cols-6 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}


/* =========================================================
   ESTILOS ORIGINALES ESCOPADOS · LOGIN
   ========================================================= */

body.ramos-page-login {
  font-family: "Plus Jakarta Sans", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, .25), transparent 35%),
    linear-gradient(135deg, #020617 0%, #0f172a 55%, #1e293b 100%);
}

body.ramos-page-login .auth-card {
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, .5);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .28);
}

body.ramos-page-login .input-field {
  width: 100%;
  padding: 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  outline: none;
  font-weight: 800;
  font-size: .9rem;
  color: #0f172a;
}

body.ramos-page-login .input-field:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
  background: #fff;
}

body.ramos-page-login .primary-btn {
  width: 100%;
  padding: 1rem;
  background: #2563eb;
  color: white;
  border-radius: 1rem;
  font-weight: 900;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .12em;
  box-shadow: 0 14px 30px rgba(37, 99, 235, .22);
  transition: transform .15s ease;
}

body.ramos-page-login .primary-btn:active {
  transform: scale(.985);
}

body.ramos-page-login .secondary-btn {
  width: 100%;
  padding: .95rem;
  background: #f1f5f9;
  color: #334155;
  border-radius: 1rem;
  font-weight: 900;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: .08em;
}

body.ramos-page-login .link-btn {
  color: #2563eb;
  font-weight: 900;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

body.ramos-page-login .hidden-view {
  display: none;
}

body.ramos-page-login .logo {
  height: 58px;
  max-width: 190px;
  object-fit: contain;
  margin: 0 auto;
  display: block;
}

body.ramos-page-login .notice {
  border-radius: 1rem;
  padding: .85rem;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

/* =========================================================
   RAMOS UI UNIFICADO · LOGIN
   Solo estética: no toca Firebase/Auth/Firestore
   ========================================================= */
body.ramos-page-login.dark {
  --bg: #0f172a;
  --card: #172033;
  --text: #eff6ff;
  --muted: #94a3b8;
  --line: rgba(255, 255, 255, .10);
  --soft: #111827;
  --primary: #38bdf8;
  --shadow: 0 28px 80px rgba(0, 0, 0, .35);
}

/* Fondo igualado al resto del portal */
body.ramos-page-login {
  background:
    radial-gradient(circle at 0% 0%, rgba(37, 99, 235, .26), transparent 35%),
    radial-gradient(circle at 100% 0%, rgba(14, 165, 233, .14), transparent 32%),
    linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #1d4ed8 100%) !important;
  color: var(--text);
  position: relative;
  overflow-x: hidden;
}

body.ramos-page-login:before {
  content: "";
  position: fixed;
  right: -120px;
  top: -130px;
  width: 330px;
  height: 330px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
  pointer-events: none;
}

body.ramos-page-login:after {
  content: "";
  position: fixed;
  left: -110px;
  bottom: -130px;
  width: 300px;
  height: 300px;
  border-radius: 999px;
  background: rgba(56, 189, 248, .10);
  pointer-events: none;
}

/* Card principal */
body.ramos-page-login .auth-card {
  background: rgba(255, 255, 255, .94) !important;
  color: var(--text) !important;
  border: 1px solid rgba(255, 255, 255, .48) !important;
  box-shadow: var(--shadow) !important;
  backdrop-filter: blur(20px) !important;
  position: relative;
  overflow: hidden;
}

body.ramos-page-login .auth-card:before {
  content: "";
  position: absolute;
  right: -70px;
  top: -85px;
  width: 190px;
  height: 190px;
  border-radius: 999px;
  background: rgba(37, 99, 235, .08);
}

body.ramos-page-login .auth-card>* {
  position: relative;
  z-index: 1;
}

body.ramos-page-login.dark .auth-card {
  background: rgba(23, 32, 51, .94) !important;
  border-color: rgba(255, 255, 255, .10) !important;
}

body.ramos-page-login.dark .auth-card:before {
  background: rgba(56, 189, 248, .08);
}

/* Logo */
body.ramos-page-login .logo {
  height: 62px !important;
}

/* Textos */
body.ramos-page-login .auth-card h1 {
  color: var(--text) !important;
}

body.ramos-page-login #subtitle,
body.ramos-page-login .auth-card .text-slate-400,
body.ramos-page-login .auth-card p.text-slate-400 {
  color: var(--muted) !important;
}

body.ramos-page-login .auth-card .text-blue-600 {
  color: #2563eb !important;
}

body.ramos-page-login.dark .auth-card .text-blue-600 {
  color: #93c5fd !important;
}

/* Inputs */
body.ramos-page-login .input-field {
  background: var(--soft) !important;
  color: var(--text) !important;
  border: 1px solid var(--line) !important;
  border-radius: 1.05rem !important;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .035);
}

body.ramos-page-login .input-field::placeholder {
  color: var(--muted) !important;
}

body.ramos-page-login .input-field:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .13), 0 10px 24px rgba(15, 23, 42, .06) !important;
  background: #ffffff !important;
}

body.ramos-page-login.dark .input-field:focus {
  background: #111827 !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, .14) !important;
}

/* Botones */
body.ramos-page-login .primary-btn {
  background: #2563eb !important;
  color: white !important;
  border-radius: 1.05rem !important;
  box-shadow: 0 16px 34px rgba(37, 99, 235, .24) !important;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease !important;
}

body.ramos-page-login .primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 42px rgba(37, 99, 235, .30) !important;
}

body.ramos-page-login .primary-btn:active {
  transform: scale(.985) !important;
}

body.ramos-page-login .primary-btn[disabled] {
  opacity: .65;
  pointer-events: none;
}

body.ramos-page-login .secondary-btn {
  background: var(--soft) !important;
  color: var(--text) !important;
  border: 1px solid var(--line);
  border-radius: 1.05rem !important;
}

body.ramos-page-login .link-btn {
  color: #2563eb !important;
}

body.ramos-page-login.dark .link-btn {
  color: #93c5fd !important;
}

/* Cajas de aviso */
body.ramos-page-login .notice {
  border: 1px solid var(--line);
}

body.ramos-page-login .bg-amber-50,
body.ramos-page-login .bg-blue-50,
body.ramos-page-login .bg-red-50,
body.ramos-page-login .bg-emerald-50 {
  border-radius: 1.25rem !important;
}

body.ramos-page-login.dark .bg-amber-50 {
  background: rgba(245, 158, 11, .14) !important;
  color: #fde68a !important;
  border-color: rgba(245, 158, 11, .24) !important;
}

body.ramos-page-login.dark .bg-blue-50 {
  background: rgba(59, 130, 246, .14) !important;
  color: #bfdbfe !important;
  border-color: rgba(59, 130, 246, .24) !important;
}

body.ramos-page-login.dark .bg-red-50 {
  background: rgba(239, 68, 68, .14) !important;
  color: #fecaca !important;
  border-color: rgba(239, 68, 68, .24) !important;
}

body.ramos-page-login.dark .bg-emerald-50 {
  background: rgba(16, 185, 129, .14) !important;
  color: #a7f3d0 !important;
  border-color: rgba(16, 185, 129, .24) !important;
}

body.ramos-page-login.dark .text-amber-800,
body.ramos-page-login.dark .text-blue-800,
body.ramos-page-login.dark .text-red-700,
body.ramos-page-login.dark .text-emerald-700 {
  color: inherit !important;
}

/* Pie */
body.ramos-page-login .auth-card>p:last-child {
  color: var(--muted) !important;
}

/* Botón modo noche login */
body.ramos-page-login .login-theme-btn {
  position: fixed;
  right: calc(1rem + env(safe-area-inset-right));
  top: calc(1rem + env(safe-area-inset-top));
  z-index: 30;
  width: 42px;
  height: 42px;
  border-radius: 1rem;
  background: rgba(255, 255, 255, .14);
  color: white;
  border: 1px solid rgba(255, 255, 255, .18);
  backdrop-filter: blur(14px);
  font-weight: 900;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .18);
}

body.ramos-page-login.dark .login-theme-btn {
  background: rgba(15, 23, 42, .60);
  border-color: rgba(255, 255, 255, .10);
}

/* Responsive */
@media (max-width:480px) {

  html,
  body.ramos-page-login {
    min-height: 100dvh !important;
  }

  body.ramos-page-login {
    align-items: center !important;
    justify-content: center !important;
    padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom)) !important;
  }

  body.ramos-page-login .auth-card {
    border-radius: 2rem !important;
    padding: 1.5rem !important;
    max-width: 100% !important;
    margin: auto 0 !important;
  }

  body.ramos-page-login .logo {
    height: 54px !important;
  }

  body.ramos-page-login .auth-card h1 {
    font-size: 1.55rem !important;
  }
}

@media (max-width:480px) and (max-height:740px) {
  body.ramos-page-login {
    align-items: flex-start !important;
    justify-content: flex-start !important;
    padding-top: max(1rem, env(safe-area-inset-top)) !important;
  }

  body.ramos-page-login .auth-card {
    margin-top: .75rem !important;
    margin-bottom: .75rem !important;
  }
}



/* ===== iPhone notch safe area ===== */
@supports (padding: max(0px)) {
  body.ramos-page-login {
    padding-top: env(safe-area-inset-top);
  }
}


/* =========================================================
   ESTILOS ORIGINALES ESCOPADOS · INDEX
   ========================================================= */

body.ramos-page-index {
  font-family: "Plus Jakarta Sans", sans-serif;
  background: #f1f5f9;
  color: #0f172a;
}

body.ramos-page-index .brand-logo {
  object-fit: contain;
  display: block;
}

body.ramos-page-index .app-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 1.75rem;
  padding: 1rem;
  min-height: 164px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .06);
  transition: all .2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  overflow: hidden;
}

body.ramos-page-index .app-card:active {
  transform: scale(.98);
}

body.ramos-page-index .app-icon {
  width: 54px;
  height: 54px;
  border-radius: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.65rem;
  box-shadow: 0 10px 20px rgba(15, 23, 42, .12);
}

body.ramos-page-index .app-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #ef4444;
  color: white;
  min-width: 1.45rem;
  height: 1.45rem;
  padding: 0 .45rem;
  font-size: 10px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(239, 68, 68, .25);
}

body.ramos-page-index .app-badge-text {
  margin-top: .5rem;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #fee2e2;
  color: #991b1b;
  padding: .28rem .55rem;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
}

body.ramos-page-index .app-card-title {
  font-size: 0.95rem;
  line-height: 1.1;
}

body.ramos-page-index .app-card-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (min-width: 700px) {
  body.ramos-page-index #appsGrid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* =========================================================
   RAMOS UI UNIFICADO · INDEX / APP LAUNCHER
   Solo estética: no toca Firebase, permisos ni badges
   ========================================================= */
body.ramos-page-index {
  background:
    radial-gradient(circle at 0% 0%, rgba(37, 99, 235, .12), transparent 32%),
    radial-gradient(circle at 100% 0%, rgba(14, 165, 233, .10), transparent 30%),
    var(--bg) !important;
  color: var(--text) !important;
}

body.ramos-page-index.dark {
  --bg: #0f172a;
  --card: #172033;
  --text: #eff6ff;
  --muted: #94a3b8;
  --line: rgba(255, 255, 255, .10);
  --soft: #111827;
  --primary: #38bdf8;
  --shadow: 0 14px 34px rgba(0, 0, 0, .24);
  background:
    radial-gradient(circle at 0% 0%, rgba(56, 189, 248, .10), transparent 32%),
    radial-gradient(circle at 100% 0%, rgba(37, 99, 235, .10), transparent 30%),
    var(--bg) !important;
  color: var(--text) !important;
}

/* Header igualado al resto */
body.ramos-page-index #app>header {
  background: rgba(255, 255, 255, .86) !important;
  backdrop-filter: blur(18px) !important;
  border-bottom: 1px solid rgba(15, 23, 42, .06) !important;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .055);
}

body.ramos-page-index.dark #app>header {
  background: rgba(15, 23, 42, .88) !important;
  border-bottom: 1px solid rgba(255, 255, 255, .08) !important;
}

body.ramos-page-index #app>header .max-w-xl,
body.ramos-page-index main.max-w-xl {
  max-width: 980px !important;
}

body.ramos-page-index #roleBadge {
  color: #2563eb !important;
}

body.ramos-page-index.dark #roleBadge {
  color: #93c5fd !important;
}

body.ramos-page-index #userName {
  color: var(--text) !important;
}

body.ramos-page-index #btnSalir {
  color: var(--muted) !important;
}

/* Hero PRO azul */
body.ramos-page-index main>section.bg-slate-900 {
  background:
    radial-gradient(circle at 0% 0%, rgba(37, 99, 235, .22), transparent 35%),
    linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #1d4ed8 100%) !important;
  color: white !important;
  border-radius: 2rem !important;
  border: 1px solid rgba(255, 255, 255, .10);
  box-shadow: 0 18px 45px rgba(15, 23, 42, .18) !important;
  position: relative;
  overflow: hidden;
}

body.ramos-page-index main>section.bg-slate-900:after {
  content: "";
  position: absolute;
  right: -80px;
  top: -90px;
  width: 230px;
  height: 230px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
}

body.ramos-page-index main>section.bg-slate-900>* {
  position: relative;
  z-index: 1;
}

body.ramos-page-index main>section.bg-slate-900 p {
  color: #cbd5e1 !important;
}

body.ramos-page-index main>section.bg-slate-900 p.text-blue-300 {
  color: #bfdbfe !important;
}

body.ramos-page-index.dark main>section.bg-slate-900 {
  box-shadow: 0 18px 45px rgba(0, 0, 0, .25) !important;
}

/* Grid un poco más pro en escritorio */
body.ramos-page-index #appsGrid {
  gap: 1rem !important;
}

@media (min-width: 700px) {
  body.ramos-page-index #appsGrid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (min-width: 1024px) {
  body.ramos-page-index #appsGrid {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }
}

/* Cards módulos estilo unified */
body.ramos-page-index .app-card {
  background: var(--card) !important;
  color: var(--text) !important;
  border: 1px solid var(--line) !important;
  border-radius: 1.75rem !important;
  box-shadow: var(--shadow) !important;
  min-height: 174px !important;
  position: relative;
  overflow: hidden;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease !important;
}

body.ramos-page-index .app-card:before {
  content: "";
  position: absolute;
  right: -42px;
  top: -42px;
  width: 112px;
  height: 112px;
  border-radius: 999px;
  background: rgba(37, 99, 235, .08);
}

body.ramos-page-index .app-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 42px rgba(15, 23, 42, .11) !important;
  border-color: rgba(37, 99, 235, .28) !important;
}

body.ramos-page-index .app-card:active {
  transform: scale(.985) !important;
}

body.ramos-page-index.dark .app-card {
  background: var(--card) !important;
  border-color: var(--line) !important;
  box-shadow: var(--shadow) !important;
}

body.ramos-page-index.dark .app-card:before {
  background: rgba(56, 189, 248, .08);
}

body.ramos-page-index .app-card>* {
  position: relative;
  z-index: 1;
}

body.ramos-page-index .app-icon {
  border-radius: 1.15rem !important;
  box-shadow: 0 12px 24px rgba(15, 23, 42, .14) !important;
}

body.ramos-page-index .app-card-title {
  color: var(--text) !important;
  letter-spacing: -.02em;
}

body.ramos-page-index .app-card-desc {
  color: var(--muted) !important;
}

/* Flecha */
body.ramos-page-index .app-card .text-slate-300 {
  color: #94a3b8 !important;
}

body.ramos-page-index.dark .app-card .text-slate-300 {
  color: #64748b !important;
}

/* Badges de avisos */
body.ramos-page-index .app-badge {
  background: #dc2626 !important;
  color: white !important;
  border: 2px solid var(--card);
  box-shadow: 0 10px 20px rgba(220, 38, 38, .24) !important;
}

body.ramos-page-index .app-badge-text {
  background: rgba(239, 68, 68, .12) !important;
  color: #b91c1c !important;
  border: 1px solid rgba(239, 68, 68, .18);
}

body.ramos-page-index.dark .app-badge-text {
  background: rgba(239, 68, 68, .16) !important;
  color: #fecaca !important;
  border-color: rgba(248, 113, 113, .24);
}

/* Colores de iconos más coherentes con el resto */
body.ramos-page-index .app-icon.bg-emerald-600 {
  background: #2563eb !important;
}

body.ramos-page-index .app-icon.bg-slate-900 {
  background: #0f172a !important;
}

body.ramos-page-index.dark .app-icon.bg-slate-900 {
  background: #38bdf8 !important;
  color: #0f172a !important;
}

/* Sin apps */
body.ramos-page-index #noApps {
  background: var(--card) !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
  box-shadow: var(--shadow);
}

body.ramos-page-index #noApps p {
  color: var(--muted) !important;
}

/* Loader modo noche preparado */
body.ramos-page-index.dark #loader {
  background: var(--bg) !important;
  color: var(--text) !important;
}

body.ramos-page-index.dark #loader p {
  color: var(--muted) !important;
}

/* Botón tema opcional si se añade en futuro */
body.ramos-page-index .theme-btn {
  background: var(--soft);
  color: var(--text);
  border: 1px solid var(--line);
}

/* Móvil */
@media (max-width:699px) {
  body.ramos-page-index #app>header {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  body.ramos-page-index main.max-w-xl {
    padding: .95rem !important;
  }

  body.ramos-page-index .app-card {
    min-height: 166px !important;
    padding: .95rem !important;
  }

  body.ramos-page-index .app-icon {
    width: 50px !important;
    height: 50px !important;
    font-size: 1.45rem !important;
  }

  body.ramos-page-index main>section.bg-slate-900 {
    border-radius: 2rem !important;
  }
}


/* Botón modo noche */
body.ramos-page-index .theme-btn {
  background: var(--soft) !important;
  color: var(--text) !important;
  border: 1px solid var(--line) !important;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .055);
}

body.ramos-page-index.dark .theme-btn {
  background: #172033 !important;
  color: #eff6ff !important;
  border-color: rgba(255, 255, 255, .10) !important;
}



/* ===== iPhone notch safe area ===== */
@supports (padding: max(0px)) {
  body.ramos-page-index {
    padding-top: env(safe-area-inset-top);
  }
}



/* ===== INDEX · Botones topbar igualados a Calidad ===== */
body.ramos-page-index #app header #theme-btn,
body.ramos-page-index #app header #btnSalir {
  border: 1px solid var(--line) !important;
  border-radius: 16px !important;
  padding: 13px 16px !important;
  min-height: 44px !important;
  min-width: 44px !important;
  font-family: "Plus Jakarta Sans", sans-serif !important;
  font-size: 10px !important;
  font-weight: 950 !important;
  text-transform: uppercase !important;
  letter-spacing: .08em !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  white-space: nowrap !important;
  background: var(--soft) !important;
  color: var(--text) !important;
  box-shadow: none !important;
  transition: transform .12s ease, filter .12s ease, opacity .12s ease !important;
  -webkit-tap-highlight-color: transparent !important;
}

body.ramos-page-index #app header #theme-btn:hover,
body.ramos-page-index #app header #btnSalir:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

body.ramos-page-index #app header #theme-btn:active,
body.ramos-page-index #app header #btnSalir:active {
  transform: scale(.965);
  filter: brightness(.96);
}

body.ramos-page-index.dark #app header #theme-btn,
body.ramos-page-index.dark #app header #btnSalir {
  background: var(--soft) !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
}

@media (max-width: 640px) {

  body.ramos-page-index #app header #theme-btn,
  body.ramos-page-index #app header #btnSalir {
    padding: 10px 11px !important;
    min-height: 40px !important;
    border-radius: 14px !important;
  }
}


/* =========================================================
   ESTILOS ORIGINALES ESCOPADOS · REPROCESOS
   ========================================================= */

body.ramos-page-reprocesos.dark {
  --bg: #0f172a;
  --card: #172033;
  --text: #eff6ff;
  --muted: #94a3b8;
  --line: rgba(255, 255, 255, .10);
  --soft: #111827;
  --primary: #38bdf8;
  --shadow: 0 14px 34px rgba(0, 0, 0, .24);
}

body.ramos-page-reprocesos * {
  box-sizing: border-box;
}

body.ramos-page-reprocesos {
  margin: 0;
  font-family: "Plus Jakarta Sans", sans-serif;
  background:
    radial-gradient(circle at 0% 0%, rgba(37, 99, 235, .12), transparent 32%),
    radial-gradient(circle at 100% 0%, rgba(37, 99, 235, .10), transparent 30%),
    var(--bg);
  color: var(--text);
  touch-action: manipulation;
}

@supports (padding: max(0px)) {
  body.ramos-page-reprocesos {
    padding-top: env(safe-area-inset-top);
  }
}

body.ramos-page-reprocesos .glass {
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(15, 23, 42, .06);
  box-shadow: 0 10px 30px rgba(15, 23, 42, .055);
}

body.ramos-page-reprocesos.dark .glass {
  background: rgba(15, 23, 42, .90);
  border-color: rgba(255, 255, 255, .08);
}

body.ramos-page-reprocesos .shell {
  max-width: 1480px;
  margin: 0 auto;
}

body.ramos-page-reprocesos .reprocesos-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  transition: grid-template-columns .22s ease;
}

body.ramos-page-reprocesos .reprocesos-layout.sidebar-collapsed {
  grid-template-columns: 0 minmax(0, 1fr);
}

body.ramos-page-reprocesos .reprocesos-layout.sidebar-collapsed .reprocesos-sidebar {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-10px);
  overflow: hidden;
}

body.ramos-page-reprocesos .reprocesos-sidebar {
  position: sticky;
  top: calc(env(safe-area-inset-top) + 86px);
  align-self: start;
  transition: opacity .18s ease, transform .18s ease;
  min-width: 0;
}

body.ramos-page-reprocesos .side-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1.75rem;
  box-shadow: var(--shadow);
  padding: .9rem;
}

body.ramos-page-reprocesos .side-title {
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: .75rem;
  padding: 0 .25rem;
}

body.ramos-page-reprocesos .side-nav {
  display: grid;
  gap: .55rem;
}

body.ramos-page-reprocesos .side-nav .nav-btn {
  width: 100%;
  min-height: 58px;
  justify-content: flex-start;
  text-align: left;
  display: flex;
  align-items: center;
  gap: .65rem;
  border-radius: 1.15rem;
  padding: .8rem .9rem;
  box-shadow: none;
}

body.ramos-page-reprocesos .side-nav-icon {
  width: 34px;
  height: 34px;
  border-radius: .9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, .10);
  flex-shrink: 0;
  font-size: 15px;
}

body.ramos-page-reprocesos .side-nav-text {
  display: flex;
  flex-direction: column;
  gap: .1rem;
}

body.ramos-page-reprocesos .side-nav-text strong {
  font-size: 11px;
  line-height: 1.1;
}

body.ramos-page-reprocesos .side-nav-text small {
  font-size: 9px;
  font-weight: 900;
  color: var(--muted);
  letter-spacing: .04em;
  text-transform: none;
}

body.ramos-page-reprocesos .nav-btn.active .side-nav-icon {
  background: rgba(37, 99, 235, .14);
  color: #1d4ed8;
}

body.ramos-page-reprocesos.dark .nav-btn.active .side-nav-icon {
  background: rgba(56, 189, 248, .14);
  color: #38bdf8;
}

body.ramos-page-reprocesos .reprocesos-content {
  min-width: 0;
}

body.ramos-page-reprocesos .content-toolbar {
  display: flex;
  align-items: stretch;
  gap: .55rem;
  flex-wrap: wrap;
}

body.ramos-page-reprocesos .content-toolbar .views-toggle {
  min-width: 108px;
  background: var(--card);
  color: var(--text);
  border-color: var(--line);
  box-shadow: 0 8px 20px rgba(15, 23, 42, .05);
}

body.ramos-page-reprocesos .content-toolbar .views-toggle.active {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
}

body.ramos-page-reprocesos.dark .content-toolbar .views-toggle.active {
  background: #38bdf8;
  color: #0f172a;
  border-color: #38bdf8;
}

body.ramos-page-reprocesos .content-toolbar-tabs {
  flex: 1 1 520px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .55rem;
}

body.ramos-page-reprocesos .content-toolbar-tabs.hidden {
  display: none !important;
}


/* ===== Reprocesos · Vistas dentro de la columna izquierda ===== */
body.ramos-page-reprocesos .side-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .55rem;
  margin-bottom: .75rem;
  padding: 0 .25rem;
}

body.ramos-page-reprocesos .side-topline .side-title {
  margin: 0;
  padding: 0;
}

body.ramos-page-reprocesos .side-collapse-btn {
  min-height: 34px;
  border-radius: .95rem;
  padding: .55rem .7rem;
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: var(--soft);
  color: var(--muted);
  border: 1px solid var(--line);
  box-shadow: none;
  white-space: nowrap;
}

body.ramos-page-reprocesos .side-collapse-btn:hover {
  color: var(--text);
  transform: translateY(-1px);
}

body.ramos-page-reprocesos .views-open-toggle {
  display: none;
  min-height: 46px;
  background: #0f172a;
  color: #fff;
  border: 1px solid #0f172a;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .14);
}

body.ramos-page-reprocesos.dark .views-open-toggle {
  background: #38bdf8;
  color: #0f172a;
  border-color: #38bdf8;
}

body.ramos-page-reprocesos .reprocesos-layout.sidebar-collapsed .views-open-toggle {
  display: inline-flex;
}

body.ramos-page-reprocesos .content-toolbar.only-open-button {
  align-items: center;
}

@media (min-width: 1100px) {
  body.ramos-page-reprocesos .reprocesos-layout.sidebar-collapsed {
    column-gap: 0;
  }
}

@media (max-width: 1099px) {
  body.ramos-page-reprocesos .side-topline {
    margin-bottom: .55rem;
  }

  body.ramos-page-reprocesos .side-collapse-btn {
    min-height: 38px;
  }
}

@media (max-width: 640px) {
  body.ramos-page-reprocesos .side-topline {
    padding: 0;
  }

  body.ramos-page-reprocesos .views-open-toggle {
    width: 100%;
  }
}

@media (max-width: 1099px) {

  body.ramos-page-reprocesos .reprocesos-layout,
  body.ramos-page-reprocesos .reprocesos-layout.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  body.ramos-page-reprocesos .reprocesos-sidebar {
    position: static;
  }

  body.ramos-page-reprocesos .reprocesos-layout.sidebar-collapsed .reprocesos-sidebar {
    display: none;
  }

  body.ramos-page-reprocesos .side-card {
    padding: .65rem;
  }

  body.ramos-page-reprocesos .side-title {
    display: none;
  }

  body.ramos-page-reprocesos .side-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.ramos-page-reprocesos .side-nav .nav-btn {
    min-height: 54px;
  }

  body.ramos-page-reprocesos .side-nav-text small {
    display: none;
  }
}

@media (max-width: 640px) {
  body.ramos-page-reprocesos .side-nav {
    grid-template-columns: 1fr 1fr;
  }

  body.ramos-page-reprocesos .side-nav .nav-btn {
    padding: .7rem;
  }

  body.ramos-page-reprocesos .side-nav-icon {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }

  body.ramos-page-reprocesos .side-nav-text strong {
    font-size: 10px;
  }

  body.ramos-page-reprocesos .content-toolbar-tabs {
    grid-template-columns: 1fr;
    flex-basis: 100%;
  }

  body.ramos-page-reprocesos .content-toolbar .views-toggle {
    width: 100%;
  }
}



/* ===== Links rápidos de tablets ===== */
body.ramos-page-reprocesos .quick-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: .85rem;
}

body.ramos-page-reprocesos .quick-link-card {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 1.55rem;
  padding: 1rem;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .055);
  display: flex;
  flex-direction: column;
  gap: .75rem;
  min-height: 190px;
}

body.ramos-page-reprocesos .quick-link-icon {
  width: 44px;
  height: 44px;
  border-radius: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, .10);
  font-size: 20px;
}

body.ramos-page-reprocesos .quick-link-title {
  font-size: 17px;
  font-weight: 950;
  letter-spacing: -.03em;
  color: var(--text);
}

body.ramos-page-reprocesos .quick-link-desc {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  line-height: 1.35;
  flex: 1;
}

body.ramos-page-reprocesos .quick-link-url {
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--muted);
  border-radius: .95rem;
  padding: .65rem .75rem;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.25;
  word-break: break-all;
}

body.ramos-page-reprocesos .excel-filter-panel {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: .9rem;
  align-items: end;
  border: 1px solid var(--line);
  background: var(--soft);
  border-radius: 1.5rem;
  padding: .9rem;
}

body.ramos-page-reprocesos .excel-date-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: .75rem;
  align-items: end;
}

body.ramos-page-reprocesos .excel-help-line {
  grid-column: 1 / -1;
  font-size: 11px;
  font-weight: 850;
  color: var(--muted);
  line-height: 1.35;
}

@media (max-width: 760px) {

  body.ramos-page-reprocesos .excel-filter-panel,
  body.ramos-page-reprocesos .excel-date-grid {
    grid-template-columns: 1fr;
  }
}

body.ramos-page-reprocesos .export-option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .75rem;
}

body.ramos-page-reprocesos .export-box {
  border: 1px solid var(--line);
  background: var(--soft);
  border-radius: 1.35rem;
  padding: .85rem;
}

body.ramos-page-reprocesos .export-status {
  border-radius: 1.15rem;
  padding: .9rem 1rem;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.45;
  white-space: pre-line;
  background: var(--soft);
  border: 1px solid var(--line);
  color: var(--muted);
}

body.ramos-page-reprocesos .brand-logo {
  object-fit: contain;
  display: block;
}

body.ramos-page-reprocesos .hero {
  background:
    radial-gradient(circle at 0% 0%, rgba(37, 99, 235, .22), transparent 36%),
    linear-gradient(135deg, #0f172a 0%, #1e293b 52%, #1d4ed8 100%);
  color: white;
  border-radius: 2rem;
  padding: 1.25rem;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .18);
  position: relative;
  overflow: hidden;
}

body.ramos-page-reprocesos .hero:after {
  content: "";
  position: absolute;
  right: -80px;
  top: -90px;
  width: 230px;
  height: 230px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
}

body.ramos-page-reprocesos .hero>* {
  position: relative;
  z-index: 1;
}

body.ramos-page-reprocesos .card {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 1.65rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}

body.ramos-page-reprocesos .section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: .75rem;
  padding: .85rem;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 250, 252, .72);
}

body.ramos-page-reprocesos.dark .section-head {
  background: rgba(255, 255, 255, .03);
}

body.ramos-page-reprocesos .btn {
  border: 0;
  border-radius: 1rem;
  padding: .82rem 1rem;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease, filter .12s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

body.ramos-page-reprocesos .btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

body.ramos-page-reprocesos .btn:active,
body.ramos-page-reprocesos .btn.is-pressed {
  transform: scale(.965);
  filter: brightness(.96);
}

body.ramos-page-reprocesos .btn.is-loading {
  opacity: .82;
  pointer-events: none;
}

body.ramos-page-reprocesos .btn.is-success {
  background: #15803d !important;
  color: #fff !important;
  box-shadow: 0 10px 24px rgba(21, 128, 61, .22) !important;
}

body.ramos-page-reprocesos .record-row.action-done {
  opacity: .54;
  transform: translateY(-2px);
  filter: saturate(.75);
  transition: opacity .18s ease, transform .18s ease, filter .18s ease;
}

body.ramos-page-reprocesos .btn.is-loading:before {
  content: "";
  width: 13px;
  height: 13px;
  border-radius: 999px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: spin .75s linear infinite;
}

body.ramos-page-reprocesos .btn-primary {
  background: #2563eb;
  color: white;
  box-shadow: 0 10px 24px rgba(37, 99, 235, .18);
}

body.ramos-page-reprocesos .btn-dark {
  background: #0f172a;
  color: white;
}

body.ramos-page-reprocesos .btn-orange {
  background: #2563eb;
  color: white;
  box-shadow: 0 10px 24px rgba(37, 99, 235, .18);
}

body.ramos-page-reprocesos .btn-green {
  background: #16a34a;
  color: white;
  box-shadow: 0 10px 24px rgba(22, 163, 74, .18);
}

body.ramos-page-reprocesos .btn-red {
  background: #dc2626;
  color: white;
  box-shadow: 0 10px 24px rgba(220, 38, 38, .18);
}

body.ramos-page-reprocesos .btn-soft {
  background: var(--soft);
  color: var(--text);
  border: 1px solid var(--line);
}

/* Header acciones igualadas a Calidad: solo modo noche y salir */
body.ramos-page-reprocesos .top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

body.ramos-page-reprocesos .top-actions .btn {
  border-radius: 16px;
  padding: 13px 16px;
  min-height: 44px;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .08em;
  gap: 7px;
  box-shadow: none;
}

@media (max-width: 640px) {
  body.ramos-page-reprocesos .top-actions .btn {
    padding: 10px 11px;
  }
}

body.ramos-page-reprocesos .btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
}

body.ramos-page-reprocesos .nav-btn {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  padding: .85rem 1rem;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .05);
}

body.ramos-page-reprocesos .nav-btn.active {
  background: radial-gradient(circle at 0% 0%, rgba(37,99,235,.16), transparent 38%), #eff6ff;
  color: #0f172a;
  border-color: #2563eb;
  box-shadow: 0 12px 28px rgba(37,99,235,.14);
}

body.ramos-page-reprocesos.dark .nav-btn.active {
  background: radial-gradient(circle at 0% 0%, rgba(56,189,248,.18), transparent 38%), rgba(56,189,248,.09);
  color: var(--text);
  border-color: #38bdf8;
  box-shadow: 0 12px 28px rgba(56,189,248,.10);
}

body.ramos-page-reprocesos .subtab {
  background: var(--soft);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .7rem .9rem;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
}

body.ramos-page-reprocesos .subtab.active {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
}

body.ramos-page-reprocesos .stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1.45rem;
  padding: .85rem;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .06);
  position: relative;
  overflow: hidden;
}

body.ramos-page-reprocesos .stat-card:after {
  content: "";
  position: absolute;
  right: -32px;
  top: -32px;
  width: 92px;
  height: 92px;
  border-radius: 999px;
  background: rgba(37, 99, 235, .09);
}

body.ramos-page-reprocesos .stat-label {
  font-size: 12px;
  font-weight: 950;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}

body.ramos-page-reprocesos .form-block-title {
  font-size: 18px;
  font-weight: 950;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: .05em;
}

body.ramos-page-reprocesos .form-block-help {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  margin-top: .15rem;
}

body.ramos-page-reprocesos .stat-value {
  font-size: 1.85rem;
  font-weight: 900;
  letter-spacing: -.04em;
  margin-top: .2rem;
}

body.ramos-page-reprocesos .stat-sub {
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
  margin-top: .15rem;
}

body.ramos-page-reprocesos .chip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: .5rem;
}

body.ramos-page-reprocesos .chip {
  background: var(--soft);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 1rem;
  padding: .75rem .7rem;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
  cursor: pointer;
  transition: .14s ease;
  min-height: 42px;
}

body.ramos-page-reprocesos .chip.active {
  background: #2563eb !important;
  color: white !important;
  border-color: #2563eb !important;
  box-shadow: 0 12px 26px rgba(37, 99, 235, .24), 0 0 0 4px rgba(37, 99, 235, .12) !important;
  transform: translateY(-1px);
}

body.ramos-page-reprocesos .chip.orange.active {
  background: #2563eb !important;
  border-color: #2563eb !important;
}

body.ramos-page-reprocesos .chip:active,
body.ramos-page-reprocesos .chip.is-pressed {
  transform: scale(.955) !important;
  border-color: #2563eb !important;
  background: rgba(37, 99, 235, .12) !important;
  color: #1d4ed8 !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .13) !important;
}

body.ramos-page-reprocesos .chip.active:active,
body.ramos-page-reprocesos .chip.active.is-pressed {
  background: #1d4ed8 !important;
  color: #fff !important;
  box-shadow: 0 12px 26px rgba(37, 99, 235, .28), 0 0 0 5px rgba(37, 99, 235, .16) !important;
}

body.ramos-page-reprocesos .chip.active::after {
  content: "✓";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: .45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .22);
  color: #fff;
  font-size: 11px;
  font-weight: 950;
  vertical-align: middle;
}

body.ramos-page-reprocesos.dark .chip:active,
body.ramos-page-reprocesos.dark .chip.is-pressed {
  background: rgba(56, 189, 248, .16) !important;
  color: #bfdbfe !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, .14) !important;
}

body.ramos-page-reprocesos.dark .chip.active {
  background: #38bdf8 !important;
  color: #0f172a !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 12px 26px rgba(56, 189, 248, .20), 0 0 0 4px rgba(56, 189, 248, .13) !important;
}

body.ramos-page-reprocesos.dark .chip.active::after {
  background: rgba(15, 23, 42, .18);
  color: #0f172a;
}

body.ramos-page-reprocesos .input-field,
body.ramos-page-reprocesos .select-field {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--soft);
  border-radius: 1rem;
  padding: .9rem 1rem;
  outline: none;
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
}

body.ramos-page-reprocesos .input-field:focus,
body.ramos-page-reprocesos .select-field:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .10);
  background: var(--card);
}

body.ramos-page-reprocesos .record-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1.35rem;
  padding: .85rem;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .055);
  transition: .16s ease;
}

body.ramos-page-reprocesos .record-card.priority,
body.ramos-page-reprocesos .record-row.priority {
  background: linear-gradient(90deg, rgba(254, 226, 226, .92), var(--card) 32%);
  border-left: 5px solid #dc2626;
}

body.ramos-page-reprocesos.dark .record-card.priority,
body.ramos-page-reprocesos.dark .record-row.priority {
  background: linear-gradient(90deg, rgba(220, 38, 38, .18), var(--card) 36%);
}

body.ramos-page-reprocesos .record-list {
  display: flex;
  flex-direction: column;
  gap: .55rem;
}

body.ramos-page-reprocesos .record-row {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  padding: .72rem .85rem;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .045);
  display: grid;
  grid-template-columns: 78px minmax(190px, 1.15fr) minmax(120px, .7fr) minmax(150px, .8fr) minmax(150px, .8fr) 160px;
  gap: .75rem;
  align-items: center;
}

body.ramos-page-reprocesos .record-id {
  font-size: 18px;
  font-weight: 950;
  color: #1d4ed8;
}

body.ramos-page-reprocesos .record-material {
  font-size: 18px;
  font-weight: 950;
  line-height: 1.1;
  color: var(--text);
}

body.ramos-page-reprocesos .record-sub {
  font-size: 11px;
  font-weight: 850;
  color: var(--muted);
  margin-top: .18rem;
}

body.ramos-page-reprocesos .record-medidas {
  font-size: 15px;
  font-weight: 950;
  color: var(--text);
  margin-top: .25rem;
  line-height: 1.2;
}

body.ramos-page-reprocesos .record-field-label {
  font-size: 9px;
  font-weight: 950;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

body.ramos-page-reprocesos .record-field-value {
  font-size: 12px;
  font-weight: 950;
  color: var(--text);
  margin-top: .12rem;
  line-height: 1.15;
}

body.ramos-page-reprocesos .record-action .btn {
  width: 100%;
  min-height: 54px;
  font-size: 11px;
}

body.ramos-page-reprocesos .forma-link-badge {
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  border-radius: 999px;
  padding: .33rem .6rem;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
  background: #fee2e2;
  color: #b91c1c;
  cursor: pointer;
  transition: transform .12s ease, filter .12s ease;
}

body.ramos-page-reprocesos .forma-link-badge:hover {
  transform: translateY(-1px);
  filter: brightness(.98);
}

body.ramos-page-reprocesos .forma-link-badge:active {
  transform: scale(.96);
}

body.ramos-page-reprocesos .modal-forma-preview {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(15, 23, 42, .72);
  display: none;
  align-items: center;
  justify-content: center;
  padding: .85rem;
}

body.ramos-page-reprocesos .modal-forma-preview.active {
  display: flex;
}

body.ramos-page-reprocesos .forma-preview-card {
  width: min(320px, calc(100vw - 2rem));
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 1.75rem;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .32);
  padding: .85rem;
}

body.ramos-page-reprocesos .forma-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .65rem;
}

body.ramos-page-reprocesos .forma-preview-title {
  font-size: 16px;
  font-weight: 950;
  letter-spacing: -.02em;
}

body.ramos-page-reprocesos .forma-preview-sub {
  font-size: 11px;
  font-weight: 850;
  color: var(--muted);
  margin-top: .15rem;
}

body.ramos-page-reprocesos .forma-preview-img {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  border-radius: 1.2rem;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, .12);
  display: block;
}

body.ramos-page-reprocesos.dark .record-row {
  background: var(--card);
  border-color: var(--line);
}

@media (max-width: 1050px) {
  body.ramos-page-reprocesos .record-row {
    grid-template-columns: 70px minmax(170px, 1fr) minmax(125px, .75fr) 150px;
  }

  body.ramos-page-reprocesos .record-row .hide-tablet {
    display: none;
  }
}

@media (max-width: 760px) {
  body.ramos-page-reprocesos .record-row {
    grid-template-columns: 1fr;
    gap: .65rem;
    padding: .95rem;
  }

  body.ramos-page-reprocesos .record-action .btn {
    min-height: 58px;
  }
}

body.ramos-page-reprocesos .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  border-radius: 999px;
  padding: .33rem .6rem;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
}

body.ramos-page-reprocesos .badge-blue {
  background: #dbeafe;
  color: #1d4ed8;
}

body.ramos-page-reprocesos .badge-green {
  background: #dcfce7;
  color: #166534;
}

body.ramos-page-reprocesos .badge-orange {
  background: #dbeafe;
  color: #1d4ed8;
}

body.ramos-page-reprocesos .badge-red {
  background: #fee2e2;
  color: #b91c1c;
}

body.ramos-page-reprocesos .badge-slate {
  background: #f1f5f9;
  color: #334155;
}

body.ramos-page-reprocesos.dark .badge-slate {
  background: rgba(255, 255, 255, .08);
  color: #cbd5e1;
}

body.ramos-page-reprocesos .table-wrap {
  width: 100%;
  overflow-x: auto;
}

body.ramos-page-reprocesos table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 960px;
}

body.ramos-page-reprocesos th {
  position: sticky;
  top: 0;
  background: var(--soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
  text-align: left;
  padding: .85rem;
  border-bottom: 1px solid var(--line);
}

body.ramos-page-reprocesos td {
  padding: .8rem .85rem;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 750;
  vertical-align: middle;
}

body.ramos-page-reprocesos .empty {
  padding: 2.6rem 1rem;
  text-align: center;
  color: var(--muted);
}

body.ramos-page-reprocesos .empty h3 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--text);
  font-weight: 900;
}

body.ramos-page-reprocesos .empty p {
  margin: .35rem 0 0;
  font-size: .85rem;
  font-weight: 750;
}




body.ramos-page-reprocesos .catalog-action-btn {
  border: 0;
  border-radius: .9rem;
  padding: .72rem .95rem;
  min-width: 86px;
  background: #2563eb;
  color: #fff;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .07em;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(37, 99, 235, .18);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease, opacity .12s ease;
  -webkit-tap-highlight-color: transparent;
}

body.ramos-page-reprocesos .catalog-action-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

body.ramos-page-reprocesos .catalog-action-btn:active,
body.ramos-page-reprocesos .catalog-action-btn.is-pressed {
  transform: scale(.95);
  filter: brightness(.95);
}

body.ramos-page-reprocesos .catalog-action-btn.danger {
  background: #dc2626;
  box-shadow: 0 10px 22px rgba(220, 38, 38, .18);
}

body.ramos-page-reprocesos .catalog-table th,
body.ramos-page-reprocesos .catalog-table td {
  text-align: center;
  vertical-align: middle;
}

body.ramos-page-reprocesos .catalog-table th {
  font-size: 11px;
  font-weight: 950;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}

body.ramos-page-reprocesos .catalog-table td:first-child,
body.ramos-page-reprocesos .catalog-table td:nth-child(2) {
  font-weight: 950;
}

body.ramos-page-reprocesos .catalog-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .55rem;
  flex-wrap: wrap;
}

body.ramos-page-reprocesos .catalog-row {
  cursor: grab;
  transition: transform .14s ease, background .14s ease, box-shadow .14s ease, opacity .14s ease;
}

body.ramos-page-reprocesos .catalog-row:active {
  cursor: grabbing;
}

body.ramos-page-reprocesos .catalog-row.dragging {
  opacity: .48;
  transform: scale(.995);
  box-shadow: inset 4px 0 0 #2563eb;
}

body.ramos-page-reprocesos .catalog-row.drag-over {
  background: rgba(37, 99, 235, .08) !important;
  box-shadow: inset 0 3px 0 #2563eb;
}

body.ramos-page-reprocesos .drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: .75rem;
  background: var(--soft);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  font-weight: 950;
  margin-right: .35rem;
  user-select: none;
}

body.ramos-page-reprocesos .catalog-help {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: rgba(37, 99, 235, .08);
  border: 1px solid rgba(37, 99, 235, .16);
  color: #1d4ed8;
  border-radius: 999px;
  padding: .45rem .7rem;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
}

body.ramos-page-reprocesos.dark .catalog-help {
  color: #bfdbfe;
  background: rgba(56, 189, 248, .10);
  border-color: rgba(56, 189, 248, .18);
}

body.ramos-page-reprocesos .segmented-control {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr));
  gap: .35rem;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  padding: .35rem;
}

body.ramos-page-reprocesos .segmented-btn {
  border: 0;
  border-radius: .9rem;
  padding: .75rem .85rem;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .06em;
  cursor: pointer;
  transition: .12s ease;
  -webkit-tap-highlight-color: transparent;
}

body.ramos-page-reprocesos .segmented-btn.active {
  background: #0f172a;
  color: #fff;
  box-shadow: 0 10px 22px rgba(15, 23, 42, .14);
}

body.ramos-page-reprocesos.dark .segmented-btn.active {
  background: #38bdf8;
  color: #0f172a;
}

body.ramos-page-reprocesos .segmented-btn:active {
  transform: scale(.96);
}

@media (max-width: 760px) {
  body.ramos-page-reprocesos .segmented-control {
    width: 100%;
    grid-template-columns: 1fr;
  }
}



body.ramos-page-reprocesos .corte-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .65rem;
  flex-wrap: wrap;
}

body.ramos-page-reprocesos .corte-filter-inline {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(92px, 1fr));
  gap: .32rem;
  padding: .28rem;
  border-radius: 1.15rem;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .055);
}

body.ramos-page-reprocesos.dark .corte-filter-inline {
  background: var(--soft);
  border-color: var(--line);
}

body.ramos-page-reprocesos .corte-filter-btn {
  border: 0;
  border-radius: .9rem;
  min-height: 42px;
  padding: .68rem .8rem;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .06em;
  cursor: pointer;
  transition: transform .12s ease, background .12s ease, color .12s ease, box-shadow .12s ease, filter .12s ease;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

body.ramos-page-reprocesos .corte-filter-btn:hover {
  transform: translateY(-1px);
}

body.ramos-page-reprocesos .corte-filter-btn:active {
  transform: scale(.96);
  filter: brightness(.96);
}

body.ramos-page-reprocesos .corte-filter-btn.active {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 10px 22px rgba(37, 99, 235, .20);
}

body.ramos-page-reprocesos.dark .corte-filter-btn.active {
  background: #38bdf8;
  color: #0f172a;
  box-shadow: 0 10px 22px rgba(56, 189, 248, .16);
}

@media (max-width: 760px) {
  body.ramos-page-reprocesos .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  body.ramos-page-reprocesos .corte-header-actions {
    justify-content: stretch;
  }

  body.ramos-page-reprocesos .corte-filter-inline {
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.ramos-page-reprocesos .corte-header-actions .btn {
    width: 100%;
  }
}



/* ===== Nuevo reproceso · asistente tablet ===== */
body.ramos-page-reprocesos .wizard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1rem;
  align-items: start;
}

body.ramos-page-reprocesos .wizard-main,
body.ramos-page-reprocesos .wizard-summary {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 1.6rem;
  padding: .85rem;
}

body.ramos-page-reprocesos .wizard-main {
  order: 1;
  min-width: 0;
}

body.ramos-page-reprocesos .wizard-summary {
  order: 2;
  position: sticky;
  top: 92px;
  width: 100%;
}

body.ramos-page-reprocesos .wizard-step {
  display: none;
}

body.ramos-page-reprocesos .wizard-step.active {
  display: block;
}

body.ramos-page-reprocesos .wizard-kicker {
  font-size: 11px;
  font-weight: 950;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .35rem;
}

body.ramos-page-reprocesos .wizard-title {
  font-size: 1.6rem;
  font-weight: 950;
  letter-spacing: -.03em;
  line-height: 1.05;
  color: var(--text);
}

body.ramos-page-reprocesos .wizard-help {
  margin-top: .45rem;
  color: var(--muted);
  font-size: .92rem;
  font-weight: 800;
  line-height: 1.35;
}

body.ramos-page-reprocesos .wizard-nav {
  display: flex;
  justify-content: space-between;
  gap: .65rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

body.ramos-page-reprocesos .summary-title {
  font-size: 13px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}

body.ramos-page-reprocesos .summary-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  padding: .65rem 0;
  border-bottom: 1px solid var(--line);
}

body.ramos-page-reprocesos .summary-row:last-child {
  border-bottom: 0;
}

body.ramos-page-reprocesos .summary-label {
  font-size: 11px;
  font-weight: 950;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

body.ramos-page-reprocesos .summary-value {
  font-size: 14px;
  font-weight: 950;
  color: var(--text);
  text-align: right;
}



/* ===== Selector visual de formas ===== */
body.ramos-page-reprocesos .formas-selector-wrap {
  margin-top: 1rem;
  padding: .85rem;
  border: 1px solid var(--line);
  border-radius: 1.35rem;
  background: var(--card);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .045);
}

body.ramos-page-reprocesos .formas-topbar {
  display: grid;
  grid-template-columns: minmax(170px, .7fr) minmax(170px, .8fr) minmax(0, 1fr);
  gap: .75rem;
  align-items: end;
  margin-bottom: .9rem;
}

body.ramos-page-reprocesos .formas-selected-box {
  min-height: 54px;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: var(--soft);
  padding: .65rem .8rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .1rem;
}

body.ramos-page-reprocesos .formas-selected-box span {
  font-size: 9px;
  font-weight: 950;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .07em;
}

body.ramos-page-reprocesos .formas-selected-box strong {
  font-size: 15px;
  font-weight: 950;
  color: var(--text);
}

body.ramos-page-reprocesos .formas-help {
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
  color: var(--muted);
  padding-bottom: .35rem;
}

body.ramos-page-reprocesos .formas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
  gap: .65rem;
  max-height: 320px;
  overflow: auto;
  padding: .15rem .2rem .15rem 0;
  scroll-behavior: smooth;
}

body.ramos-page-reprocesos .forma-card {
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--soft);
  color: var(--text);
  overflow: hidden;
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease, background .12s ease;
  padding: 0;
  text-align: inherit;
  -webkit-tap-highlight-color: transparent;
}

body.ramos-page-reprocesos .forma-card:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, .45);
}

body.ramos-page-reprocesos .forma-card:active,
body.ramos-page-reprocesos .forma-card.is-pressed {
  transform: scale(.965);
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .14);
  background: rgba(37, 99, 235, .08);
}

body.ramos-page-reprocesos .forma-card.selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
  background: rgba(37, 99, 235, .06);
}

body.ramos-page-reprocesos.dark .forma-card.selected {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, .16);
  background: rgba(56, 189, 248, .08);
}

body.ramos-page-reprocesos .forma-thumb {
  aspect-ratio: 1 / 1;
  background: #102335;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .45rem;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

body.ramos-page-reprocesos .forma-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

body.ramos-page-reprocesos .forma-thumb-placeholder {
  width: 100%;
  height: 100%;
  border: 1px dashed rgba(255, 255, 255, .28);
  border-radius: .75rem;
  color: rgba(255, 255, 255, .72);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 950;
  background: rgba(255, 255, 255, .04);
}

body.ramos-page-reprocesos .forma-code {
  padding: .55rem .45rem;
  text-align: center;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .05em;
  background: var(--card);
  color: var(--text);
}

body.ramos-page-reprocesos .forma-preview-line {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: .7rem;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

body.ramos-page-reprocesos .forma-preview-mini {
  width: 46px;
  height: 46px;
  border-radius: .75rem;
  border: 1px solid var(--line);
  background: #102335;
  object-fit: contain;
  padding: .2rem;
  display: none;
}

@media (max-width: 760px) {
  body.ramos-page-reprocesos .formas-topbar {
    grid-template-columns: 1fr;
  }

  body.ramos-page-reprocesos .formas-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 430px;
  }
}

body.ramos-page-reprocesos .wizard-progress {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: .35rem;
  margin-bottom: 1rem;
}

body.ramos-page-reprocesos .wizard-dot {
  height: .42rem;
  border-radius: 999px;
  background: #cbd5e1;
  opacity: .7;
}

body.ramos-page-reprocesos .wizard-dot.active,
body.ramos-page-reprocesos .wizard-dot.done {
  background: var(--primary);
  opacity: 1;
}

@media (max-width: 860px) {
  body.ramos-page-reprocesos .wizard-layout {
    grid-template-columns: 1fr;
  }

  body.ramos-page-reprocesos .wizard-summary {
    position: static;
    order: 2;
  }

  body.ramos-page-reprocesos .wizard-main {
    order: 1;
  }

  body.ramos-page-reprocesos .wizard-title {
    font-size: 1.35rem;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

body.ramos-page-reprocesos .modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 42, .66);
  display: none;
  align-items: flex-end;
  padding: 1rem;
}

body.ramos-page-reprocesos .modal.active {
  display: flex;
}

@media (min-width: 900px) {
  body.ramos-page-reprocesos .modal {
    align-items: center;
  }
}

body.ramos-page-reprocesos .chart-card {
  min-height: 330px;
}

body.ramos-page-reprocesos .chart-wrap {
  height: 250px;
  position: relative;
}


/* UX tablet 9 pulgadas: botones grandes, lectura rápida y menos fricción */
@media (min-width: 700px) and (max-width: 1180px) {
  body.ramos-page-reprocesos .shell {
    max-width: 1060px;
  }

  body.ramos-page-reprocesos .chip-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .65rem;
  }

  body.ramos-page-reprocesos .chip {
    min-height: 56px;
    font-size: 12px;
    border-radius: 1.15rem;
  }

  body.ramos-page-reprocesos .subtab,
  body.ramos-page-reprocesos .nav-btn {
    min-height: 54px;
    font-size: 11px;
  }

  body.ramos-page-reprocesos .btn {
    min-height: 52px;
  }

  body.ramos-page-reprocesos .record-card {
    padding: 1.15rem;
  }

  body.ramos-page-reprocesos .input-field,
  body.ramos-page-reprocesos .select-field {
    min-height: 56px;
    font-size: 15px;
  }

  body.ramos-page-reprocesos #chipsCantidad {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

body.ramos-page-reprocesos .admin-only-inline {
  display: inline-flex;
}

body.ramos-page-reprocesos .hidden {
  display: none !important;
}



body.ramos-page-reprocesos .dashboard-period-btn {
  min-height: 44px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  border-radius: 1rem;
  padding: .75rem .95rem;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .055);
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}

body.ramos-page-reprocesos .dashboard-period-btn:hover {
  transform: translateY(-1px);
}

body.ramos-page-reprocesos .dashboard-period-btn:active {
  transform: scale(.96);
}

body.ramos-page-reprocesos .dashboard-period-btn.active {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
  box-shadow: 0 12px 24px rgba(37, 99, 235, .18);
}

body.ramos-page-reprocesos.dark .dashboard-period-btn.active {
  background: #38bdf8;
  color: #0f172a;
  border-color: #38bdf8;
}

@media (max-width: 899px) {
  body.ramos-page-reprocesos .hero {
    border-radius: 0 0 2rem 2rem;
    margin: -1rem -1rem 0;
  }

  body.ramos-page-reprocesos .shell {
    max-width: 760px;
  }

  body.ramos-page-reprocesos .desktop-only {
    display: none !important;
  }

  body.ramos-page-reprocesos .chip-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  body.ramos-page-reprocesos .mobile-only {
    display: none !important;
  }
}


/* =========================================================
   ESTILOS ORIGINALES ESCOPADOS · TURNOS
   ========================================================= */

body.ramos-page-turnos.dark {
  --bg: #0f172a;
  --card: #172033;
  --text: #eff6ff;
  --muted: #94a3b8;
  --line: rgba(255, 255, 255, .10);
  --soft: #111827;
  --primary: #38bdf8;
  --shadow: 0 14px 34px rgba(0, 0, 0, .24);
}

body.ramos-page-turnos {
  font-family: "Plus Jakarta Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  overflow-x: hidden;
}

body.ramos-page-turnos .glass {
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, .05);
}

body.ramos-page-turnos.dark .glass {
  background: rgba(15, 23, 42, .90);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

body.ramos-page-turnos .app-logo {
  height: 34px;
  max-width: 140px;
  object-fit: contain;
  display: block;
}

@media (max-width:420px) {
  body.ramos-page-turnos .app-logo {
    height: 28px;
    max-width: 110px;
  }
}

body.ramos-page-turnos .desktop-shell {
  max-width: 1400px;
  margin: 0 auto;
}

body.ramos-page-turnos .card {
  background: var(--card);
  border-radius: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, .05);
  border: 1px solid var(--line);
  transition: all .25s;
}

body.ramos-page-turnos .mobile-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 55%, #059669 100%);
  color: white;
  border-radius: 1.8rem;
  padding: 1.15rem;
  box-shadow: 0 14px 32px rgba(15, 23, 42, .18);
}

body.ramos-page-turnos .mobile-stat {
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 1.15rem;
  padding: .75rem;
  backdrop-filter: blur(10px);
}

body.ramos-page-turnos .mobile-tabs {
  display: flex;
  gap: .5rem;
  overflow-x: auto;
  padding-bottom: .25rem;
  scrollbar-width: none;
}

body.ramos-page-turnos .mobile-tabs::-webkit-scrollbar {
  display: none;
}

body.ramos-page-turnos .mobile-tab {
  flex: 0 0 auto;
  border: 1px solid #e2e8f0;
  background: white;
  color: #64748b;
  border-radius: 999px;
  padding: .62rem .85rem;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
  box-shadow: 0 6px 16px rgba(15, 23, 42, .04);
}

body.ramos-page-turnos .mobile-tab.active {
  background: #0f172a;
  color: white;
  border-color: #0f172a;
}

body.ramos-page-turnos .mobile-card-pro {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1.65rem;
  padding: 1rem;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .075);
  overflow: hidden;
  position: relative;
  transition: transform .18s ease;
}

body.ramos-page-turnos .mobile-card-pro:active {
  transform: scale(.992);
}

body.ramos-page-turnos .label-tag {
  font-weight: 900;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #94a3b8;
  display: block;
  margin-bottom: .25rem;
}

body.ramos-page-turnos .input-field {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: .75rem;
  padding: .65rem .8rem;
  width: 100%;
  outline: none;
  font-size: 13px;
  font-weight: 700;
}

body.ramos-page-turnos .filter-select {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: .75rem;
  padding: .55rem;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  color: #64748b;
  width: 100%;
}

body.ramos-page-turnos .search-field {
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 1rem;
  padding: .8rem 1rem;
  width: 100%;
  outline: none;
  font-weight: 700;
}

body.ramos-page-turnos .area-pill,
body.ramos-page-turnos .status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: .32rem .62rem;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}

body.ramos-page-turnos .area-linea {
  background: #dbeafe;
  color: #1d4ed8;
}

body.ramos-page-turnos .area-corte {
  background: #ffedd5;
  color: #c2410c;
}

body.ramos-page-turnos .area-taller {
  background: #f3e8ff;
  color: #7e22ce;
}

body.ramos-page-turnos .area-mantenimiento {
  background: #dcfce7;
  color: #15803d;
}

body.ramos-page-turnos .area-colocacion {
  background: #ccfbf1;
  color: #0f766e;
}

body.ramos-page-turnos .area-medicion {
  background: #e0f2fe;
  color: #0369a1;
}

body.ramos-page-turnos .area-comercial {
  background: #fef9c3;
  color: #a16207;
}

body.ramos-page-turnos .area-oficina {
  background: #f1f5f9;
  color: #475569;
}

body.ramos-page-turnos .area-chofer {
  background: #fae8ff;
  color: #a21caf;
}

body.ramos-page-turnos .area-expedicion {
  background: #e0f2fe;
  color: #0369a1;
}

body.ramos-page-turnos .area-produccion {
  background: #dbeafe;
  color: #1d4ed8;
}

body.ramos-page-turnos .area-noche {
  background: #1e293b;
  color: #e2e8f0;
}

body.ramos-page-turnos .status-borrador {
  background: #f1f5f9;
  color: #475569;
}

body.ramos-page-turnos .status-publicado {
  background: #dcfce7;
  color: #166534;
}

body.ramos-page-turnos .status-modificado {
  background: #fef3c7;
  color: #92400e;
}

body.ramos-page-turnos .status-cancelado {
  background: #fee2e2;
  color: #991b1b;
}

body.ramos-page-turnos .turno-card {
  border-radius: 1.25rem;
  padding: .85rem;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: 0 8px 18px rgba(15, 23, 42, .045);
  transition: transform .15s ease;
}

body.ramos-page-turnos .turno-card:active {
  transform: scale(.99);
}

body.ramos-page-turnos .calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}

body.ramos-page-turnos .calendar-mode-tabs {
  display: flex;
  gap: .4rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: .25rem;
}

body.ramos-page-turnos .calendar-mode-btn {
  border-radius: .75rem;
  padding: .55rem .8rem;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #64748b;
}

body.ramos-page-turnos .calendar-mode-btn.active {
  background: #0f172a;
  color: white;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .12);
}

body.ramos-page-turnos .calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: .55rem;
}

body.ramos-page-turnos .calendar-day {
  min-height: 112px;
  border-radius: 1.25rem;
  border: 1px solid var(--line);
  background: var(--card);
  padding: .7rem;
  overflow: hidden;
}

body.ramos-page-turnos .calendar-day.today {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, .12);
}

body.ramos-page-turnos .calendar-turno {
  margin-top: .45rem;
  border-radius: .8rem;
  padding: .45rem;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.2;
  cursor: pointer;
}

body.ramos-page-turnos .calendar-turno.linea {
  background: #dbeafe;
  color: #1d4ed8;
}

body.ramos-page-turnos .calendar-turno.corte {
  background: #ffedd5;
  color: #c2410c;
}

body.ramos-page-turnos .calendar-turno.taller {
  background: #f3e8ff;
  color: #7e22ce;
}

body.ramos-page-turnos .calendar-turno.mantenimiento {
  background: #dcfce7;
  color: #15803d;
}


body.ramos-page-turnos .calendar-area-group {
  margin-top: .45rem;
  border-radius: .9rem;
  padding: .55rem;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.2;
  cursor: pointer;
  border: 1px solid transparent;
  position: relative;
}

body.ramos-page-turnos .calendar-area-group.linea {
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

body.ramos-page-turnos .calendar-area-group.corte {
  background: #ffedd5;
  color: #c2410c;
  border-color: #fed7aa;
}

body.ramos-page-turnos .calendar-area-group.taller {
  background: #f3e8ff;
  color: #7e22ce;
  border-color: #e9d5ff;
}

body.ramos-page-turnos .calendar-area-group.mantenimiento {
  background: #dcfce7;
  color: #15803d;
  border-color: #bbf7d0;
}

body.ramos-page-turnos .calendar-area-group.colocacion {
  background: #ccfbf1;
  color: #0f766e;
  border-color: #99f6e4;
}

body.ramos-page-turnos .calendar-area-group.medicion {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #bae6fd;
}

body.ramos-page-turnos .calendar-area-group.comercial {
  background: #fef9c3;
  color: #a16207;
  border-color: #fde68a;
}

body.ramos-page-turnos .calendar-area-group.oficina {
  background: #f1f5f9;
  color: #475569;
  border-color: #cbd5e1;
}

body.ramos-page-turnos .calendar-area-group.chofer {
  background: #fae8ff;
  color: #a21caf;
  border-color: #f5d0fe;
}

body.ramos-page-turnos .calendar-area-group.sin_asignar {
  background: #f8fafc;
  color: #64748b;
  border-color: #cbd5e1;
}

body.ramos-page-turnos .calendar-area-group.produccion {
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

body.ramos-page-turnos .calendar-area-group.noche {
  background: #1e293b;
  color: #e2e8f0;
  border-color: #334155;
}

body.ramos-page-turnos .calendar-area-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .45rem;
}

body.ramos-page-turnos .calendar-area-count {
  background: rgba(255, 255, 255, .75);
  border-radius: 999px;
  padding: .15rem .42rem;
  font-size: 9px;
  font-weight: 900;
  white-space: nowrap;
}

body.ramos-page-turnos .calendar-area-detail {
  display: none;
  margin-top: .45rem;
  background: rgba(255, 255, 255, .58);
  border-radius: .75rem;
  padding: .45rem;
}

body.ramos-page-turnos .calendar-area-group.open .calendar-area-detail {
  display: block;
}

body.ramos-page-turnos .collapsible-body {
  display: none;
}

body.ramos-page-turnos .collapsible-body.open {
  display: block;
}

body.ramos-page-turnos .calendar-compact-day {
  cursor: pointer;
}

body.ramos-page-turnos .calendar-compact-day:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, .07);
}

body.ramos-page-turnos .desktop-day-summary {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .65rem;
}

body.ramos-page-turnos .desktop-day-summary .day-summary-chip {
  min-width: 2.35rem;
  padding: .34rem .45rem;
  font-size: 10px;
}


body.ramos-page-turnos .calendar-person-line {
  display: flex;
  justify-content: space-between;
  gap: .45rem;
  padding: .32rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, .45);
  font-size: 9.5px;
  cursor: pointer;
}

body.ramos-page-turnos .calendar-person-line:last-child {
  border-bottom: 0;
}

body.ramos-page-turnos .calendar-person-main {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.ramos-page-turnos .calendar-person-hour {
  white-space: nowrap;
  opacity: .78;
}

body.ramos-page-turnos .calendar-person-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .35rem;
}

body.ramos-page-turnos .calendar-person-chip {
  border: 1px solid rgba(255, 255, 255, .55);
  background: rgba(255, 255, 255, .62);
  border-radius: .75rem;
  padding: .38rem .45rem;
  font-size: 9px;
  font-weight: 900;
  line-height: 1.15;
  cursor: pointer;
  min-width: 0;
}

body.ramos-page-turnos .calendar-person-chip .name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.ramos-page-turnos .calendar-person-chip .meta {
  display: block;
  opacity: .72;
  font-size: 8px;
  margin-top: .12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Turnos cancelados en el calendario */
body.ramos-page-turnos .calendar-person-chip.cancelado {
  opacity: .55;
  background: rgba(254, 226, 226, .55) !important;
  border-color: rgba(239, 68, 68, .25) !important;
}

body.ramos-page-turnos .calendar-person-chip.cancelado .name {
  text-decoration: line-through;
  color: #b91c1c;
}

body.ramos-page-turnos .calendar-person-chip.cancelado .meta {
  text-decoration: line-through;
  opacity: .55;
}

body.ramos-page-turnos.dark .calendar-person-chip.cancelado {
  background: rgba(127, 29, 29, .35) !important;
  border-color: rgba(239, 68, 68, .20) !important;
}

body.ramos-page-turnos.dark .calendar-person-chip.cancelado .name {
  color: #fca5a5;
}

@media (min-width:1100px) {
  body.ramos-page-turnos .calendar-person-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width:520px) {
  body.ramos-page-turnos .calendar-person-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

body.ramos-page-turnos .mobile-admin-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}

body.ramos-page-turnos .mobile-admin-action {
  border-radius: 1.45rem;
  padding: 1rem;
  min-height: 104px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .075);
  border: 1px solid #e2e8f0;
  text-align: left;
}

body.ramos-page-turnos .mobile-admin-action strong {
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
}

body.ramos-page-turnos .mobile-admin-action span {
  font-size: 10px;
  font-weight: 800;
  opacity: .75;
  line-height: 1.25;
}

body.ramos-page-turnos .mobile-admin-icon {
  width: 38px;
  height: 38px;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 17px;
}

body.ramos-page-turnos .mobile-calendar-shell {
  display: grid;
  gap: .55rem;
}

body.ramos-page-turnos .mobile-calendar-shell.mode-semana,
body.ramos-page-turnos .mobile-calendar-shell.mode-mes {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

body.ramos-page-turnos .mobile-calendar-shell.mode-dia {
  grid-template-columns: 1fr;
}

body.ramos-page-turnos .mobile-calendar-day {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  padding: .55rem;
  min-height: 112px;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .045);
}

body.ramos-page-turnos .mobile-calendar-shell.mode-mes .mobile-calendar-day {
  min-height: 98px;
  padding: .42rem;
  border-radius: .95rem;
}

body.ramos-page-turnos .mobile-calendar-shell.mode-dia .mobile-calendar-day {
  min-height: 280px;
}

body.ramos-page-turnos .mobile-calendar-day.today {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, .12);
}

body.ramos-page-turnos .mobile-calendar-day.muted {
  opacity: .42;
}

body.ramos-page-turnos .mobile-calendar-day-name {
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.ramos-page-turnos .mobile-calendar-day-num {
  font-size: 16px;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
  margin-top: .1rem;
}



body.ramos-page-turnos .day-summary-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  margin-top: .45rem;
}

body.ramos-page-turnos .day-summary-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.85rem;
  border-radius: .55rem;
  padding: .22rem .34rem;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  border: 1px solid transparent;
}

body.ramos-page-turnos .day-summary-chip.linea {
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

body.ramos-page-turnos .day-summary-chip.corte {
  background: #ffedd5;
  color: #c2410c;
  border-color: #fed7aa;
}

body.ramos-page-turnos .day-summary-chip.taller {
  background: #f3e8ff;
  color: #7e22ce;
  border-color: #e9d5ff;
}

body.ramos-page-turnos .day-summary-chip.mantenimiento {
  background: #dcfce7;
  color: #15803d;
  border-color: #bbf7d0;
}

body.ramos-page-turnos .day-summary-chip.colocacion {
  background: #ccfbf1;
  color: #0f766e;
  border-color: #99f6e4;
}

body.ramos-page-turnos .day-summary-chip.medicion {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #bae6fd;
}

body.ramos-page-turnos .day-summary-chip.comercial {
  background: #fef9c3;
  color: #a16207;
  border-color: #fde68a;
}

body.ramos-page-turnos .day-summary-chip.oficina {
  background: #f1f5f9;
  color: #475569;
  border-color: #cbd5e1;
}

body.ramos-page-turnos .day-summary-chip.chofer {
  background: #fae8ff;
  color: #a21caf;
  border-color: #f5d0fe;
}

body.ramos-page-turnos .day-summary-chip.produccion {
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

body.ramos-page-turnos .day-summary-chip.noche {
  background: #1e293b;
  color: #e2e8f0;
  border-color: #334155;
}

/* Chip cancelado en resumen semana/mes */
body.ramos-page-turnos .day-summary-chip-cancelado {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.85rem;
  padding: .28rem .42rem;
  font-size: 9px;
  font-weight: 900;
  border-radius: .55rem;
  line-height: 1;
  border: 1px solid rgba(239, 68, 68, .35);
  background: rgba(254, 226, 226, .70);
  color: #b91c1c;
}

/* Ausencias en vista día del calendario */
body.ramos-page-turnos .calendar-day-ausencias {
  margin-bottom: .65rem;
  padding: .5rem .65rem;
  background: rgba(251, 191, 36, .12);
  border: 1px solid rgba(251, 191, 36, .30);
  border-radius: .85rem;
}

body.ramos-page-turnos .calendar-day-ausencias-label {
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #92400e;
  margin-bottom: .3rem;
}

body.ramos-page-turnos .calendar-ausencia-row {
  font-size: 9px;
  font-weight: 800;
  color: #78350f;
  padding: .15rem 0;
  line-height: 1.3;
}

body.ramos-page-turnos .calendar-ausencia-tipo {
  color: #b45309;
  font-weight: 900;
  text-transform: uppercase;
  font-size: 8px;
}

body.ramos-page-turnos .calendar-ausencia-row-clickable {
  cursor: pointer;
  border-radius: 4px;
  padding: .2rem .3rem;
  margin: .05rem -.3rem;
  display: flex;
  align-items: center;
  gap: .25rem;
  transition: background .12s;
}
body.ramos-page-turnos .calendar-ausencia-row-clickable:hover {
  background: rgba(251, 191, 36, .25);
}
body.ramos-page-turnos .calendar-ausencia-arrow {
  margin-left: auto;
  font-size: 11px;
  color: #b45309;
  font-weight: 900;
  line-height: 1;
}
body.ramos-page-turnos.dark .calendar-ausencia-row-clickable:hover {
  background: rgba(251, 191, 36, .15);
}

/* Turnos cancelados en vista día */
body.ramos-page-turnos .calendar-day-cancelados {
  margin-top: .4rem;
  padding-top: .4rem;
  border-top: 1px dashed rgba(239, 68, 68, .3);
}
body.ramos-page-turnos .calendar-day-cancelados-label {
  font-size: 8px;
  font-weight: 900;
  color: #ef4444;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .3rem;
}

body.ramos-page-turnos.dark .calendar-day-ausencias {
  background: rgba(120, 53, 15, .20);
  border-color: rgba(251, 191, 36, .20);
}

body.ramos-page-turnos.dark .calendar-day-ausencias-label,
body.ramos-page-turnos.dark .calendar-ausencia-row {
  color: #fde68a;
}

body.ramos-page-turnos.dark .calendar-ausencia-tipo {
  color: #fbbf24;
}

body.ramos-page-turnos .day-summary-total {
  font-size: 8px;
  font-weight: 900;
  color: #94a3b8;
  margin-top: .35rem;
  text-transform: uppercase;
  letter-spacing: .03em;
}

body.ramos-page-turnos .mobile-calendar-shell.mode-semana .calendar-area-group,
body.ramos-page-turnos .mobile-calendar-shell.mode-mes .calendar-area-group {
  display: none;
}

body.ramos-page-turnos .mobile-calendar-shell.mode-semana .mobile-calendar-day,
body.ramos-page-turnos .mobile-calendar-shell.mode-mes .mobile-calendar-day {
  cursor: pointer;
}

body.ramos-page-turnos .mobile-calendar-shell.mode-mes .calendar-area-group {
  padding: .38rem;
  border-radius: .7rem;
  font-size: 8px;
  margin-top: .35rem;
}

body.ramos-page-turnos .mobile-calendar-shell.mode-mes .calendar-area-detail {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 95;
  background: white;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .25);
  max-height: 46vh;
  overflow: auto;
  padding: .75rem;
}


body.ramos-page-turnos .calendar-day.month {
  min-height: 128px;
}

body.ramos-page-turnos .calendar-day.muted {
  opacity: .42;
}

body.ramos-page-turnos .selected-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  border-radius: 999px;
  padding: .35rem .6rem;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

body.ramos-page-turnos .multi-check {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 1rem;
  padding: .75rem;
  font-size: 12px;
  font-weight: 900;
}

body.ramos-page-turnos .multi-check input {
  width: 18px;
  height: 18px;
  accent-color: #059669;
}

body.ramos-page-turnos .selector-pro {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 1.25rem;
  padding: .8rem;
}

body.ramos-page-turnos .selector-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  min-height: 34px;
  align-items: center;
}

body.ramos-page-turnos .selector-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  border-radius: 999px;
  padding: .38rem .62rem;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

body.ramos-page-turnos .selector-chip button {
  font-size: 13px;
  line-height: 1;
  color: #065f46;
}

body.ramos-page-turnos .selector-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .45rem;
}

@media (min-width:640px) {
  body.ramos-page-turnos .selector-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

body.ramos-page-turnos .selector-action {
  border-radius: .9rem;
  padding: .65rem .45rem;
  background: white;
  border: 1px solid #e2e8f0;
  color: #334155;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
}

body.ramos-page-turnos .selector-list {
  max-height: 320px;
  overflow-y: auto;
  padding-right: .2rem;
}

/* Operarios en cuadrícula: 2 columnas en móvil, 3 en desktop */
body.ramos-page-turnos .selector-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .35rem;
}

@media (min-width: 1100px) {
  body.ramos-page-turnos .selector-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

body.ramos-page-turnos .selector-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  border: 1px solid #e2e8f0;
  background: white;
  border-radius: 1rem;
  padding: .75rem;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: .45rem;
}

body.ramos-page-turnos .selector-row.selected {
  border-color: #10b981;
  background: #ecfdf5;
}

body.ramos-page-turnos .date-pick-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: .35rem;
}

/* Touch targets más generosos en móvil */
@media (max-width: 1099px) {
  body.ramos-page-turnos .date-pick-grid {
    gap: .5rem;
  }
  body.ramos-page-turnos .date-pick-day {
    min-height: 52px !important;
    border-radius: 1rem !important;
  }
}

body.ramos-page-turnos .date-pick-day {
  border: 1px solid #e2e8f0;
  background: white;
  border-radius: .8rem;
  min-height: 42px;
  padding: .35rem;
  font-size: 10px;
  font-weight: 900;
  color: #334155;
}

body.ramos-page-turnos .date-pick-day.muted {
  opacity: .35;
}

body.ramos-page-turnos .date-pick-day.selected {
  background: #0f172a;
  color: white;
  border-color: #0f172a;
}

body.ramos-page-turnos .date-pick-day.has-conflict {
  box-shadow: 0 0 0 2px rgba(239, 68, 68, .18);
  border-color: #ef4444;
}

/* Fines de semana en el picker de ausencias */
body.ramos-page-turnos .date-pick-day.fds {
  background: #fef9f0;
  color: #94a3b8;
  border-color: #fde68a;
}

/* Hoy en el picker de ausencias */
body.ramos-page-turnos .date-pick-day.today:not(.selected) {
  border-color: #f59e0b;
  color: #b45309;
  font-weight: 900;
}

body.ramos-page-turnos .manual-date-body {
  display: none;
}

body.ramos-page-turnos .manual-date-body.open {
  display: block;
}

body.ramos-page-turnos .manual-mode-active {
  border-color: #10b981 !important;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, .12);
}

body.ramos-page-turnos .date-mode-note {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
  border-radius: 1rem;
  padding: .7rem;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
}

body.ramos-page-turnos .vacation-summary-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.35rem;
  border-radius: .55rem;
  padding: .22rem .34rem;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  border: 1px solid #fde68a;
  background: #fef3c7;
  color: #92400e;
}

body.ramos-page-turnos .vacation-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 1.25rem;
  padding: 1rem;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .045);
}

body.ramos-page-turnos .status-pendiente {
  background: #fef3c7;
  color: #92400e;
}

body.ramos-page-turnos .status-aprobada {
  background: #dcfce7;
  color: #166534;
}

body.ramos-page-turnos .status-rechazada {
  background: #fee2e2;
  color: #991b1b;
}

/* ── Ausencia card: indicador visual de estado ─────────────────── */
body.ramos-page-turnos .ausencia-card {
  border-left: 4px solid #e2e8f0;
  transition: border-color 0.15s, box-shadow 0.15s;
}
body.ramos-page-turnos .ausencia-card.ausencia-estado-pendiente {
  border-left-color: #f59e0b;
  background: linear-gradient(to right, #fffbeb 0%, white 48px);
}
body.ramos-page-turnos .ausencia-card.ausencia-estado-aprobada {
  border-left-color: #22c55e;
  background: linear-gradient(to right, #f0fdf4 0%, white 48px);
}
body.ramos-page-turnos .ausencia-card.ausencia-estado-rechazada {
  border-left-color: #ef4444;
  background: linear-gradient(to right, #fef2f2 0%, white 48px);
}
body.ramos-page-turnos .ausencia-card:hover {
  box-shadow: 0 8px 24px rgba(15, 23, 42, .09);
}

/* ── Filtro de solicitudes (panel inline admin) ─────────────────── */
body.ramos-page-turnos .ausencia-filtro-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .07em;
  background: #f1f5f9;
  color: #64748b;
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
body.ramos-page-turnos .ausencia-filtro-btn:hover {
  background: #e2e8f0;
  color: #334155;
}
body.ramos-page-turnos .ausencia-filtro-btn.active {
  background: #f59e0b;
  color: white;
}


body.ramos-page-turnos .desktop-view {
  display: none;
}

body.ramos-page-turnos .mobile-view {
  display: block;
}

@media (min-width:1100px) {
  body.ramos-page-turnos {
    font-size: 14px;
  }

  body.ramos-page-turnos .desktop-view {
    display: block;
  }

  body.ramos-page-turnos .mobile-view {
    display: none;
  }

  body.ramos-page-turnos .modal {
    align-items: center;
  }
}

body.ramos-page-turnos .kpi-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  padding: 1rem;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .045);
  position: relative;
  overflow: hidden;
}

body.ramos-page-turnos .kpi-card:before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: #cbd5e1;
}

body.ramos-page-turnos .kpi-card.green:before {
  background: #10b981;
}

body.ramos-page-turnos .kpi-card.blue:before {
  background: #2563eb;
}

body.ramos-page-turnos .kpi-card.orange:before {
  background: #f97316;
}

body.ramos-page-turnos .kpi-card.red:before {
  background: #ef4444;
}

body.ramos-page-turnos .table-row:hover {
  background: #f8fafc;
  cursor: pointer;
}

body.ramos-page-turnos .table-row.selected {
  background: #eff6ff;
}

body.ramos-page-turnos .desktop-table-wrap {
  max-height: calc(100vh - 340px);
  overflow: auto;
}

body.ramos-page-turnos .desktop-table thead th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 5;
}

body.ramos-page-turnos .modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 42, .7);
  align-items: flex-end;
}

body.ramos-page-turnos .modal.active {
  display: flex;
  animation: slideUp .2s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

body.ramos-page-turnos .side-panel {
  position: fixed;
  right: 0;
  top: 0;
  width: 460px;
  max-width: 92vw;
  height: 100dvh;
  max-height: 100dvh;
  background: var(--card);
  box-shadow: -10px 0 30px rgba(15, 23, 42, .18);
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.2, .8, .2, 1), box-shadow .28s ease;
  z-index: 70;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  -webkit-overflow-scrolling: touch;
}

body.ramos-page-turnos .side-panel.active {
  transform: translateX(0);
}

body.ramos-page-turnos .panel-backdrop {
  opacity: 0;
  transition: opacity .22s ease;
  pointer-events: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .25);
  z-index: 60;
}

body.ramos-page-turnos .panel-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

body.ramos-page-turnos .panel-sticky-head {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: -1.5rem -1.5rem 1.5rem -1.5rem;
  padding: calc(1rem + env(safe-area-inset-top)) 1.5rem 1rem 1.5rem;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

body.ramos-page-turnos.dark .bg-white,
body.ramos-page-turnos.dark .card,
body.ramos-page-turnos.dark .kpi-card,
body.ramos-page-turnos.dark .mobile-card-pro {
  background: var(--card) !important;
  color: var(--text);
  border-color: var(--line) !important;
  box-shadow: var(--shadow);
}

body.ramos-page-turnos.dark .input-field,
body.ramos-page-turnos.dark .search-field,
body.ramos-page-turnos.dark .filter-select {
  background: var(--soft) !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
}

body.ramos-page-turnos.dark .text-slate-900,
body.ramos-page-turnos.dark .text-slate-800,
body.ramos-page-turnos.dark .text-slate-700,
body.ramos-page-turnos.dark .text-slate-600,
body.ramos-page-turnos.dark .text-slate-500 {
  color: var(--text) !important;
}

body.ramos-page-turnos.dark .text-slate-400 {
  color: var(--muted) !important;
}

body.ramos-page-turnos.dark .bg-slate-50,
body.ramos-page-turnos.dark .bg-slate-100 {
  background: var(--soft) !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
}

body.ramos-page-turnos.dark .desktop-table thead th {
  background: var(--soft);
}

body.ramos-page-turnos.dark .table-row:hover {
  background: rgba(255, 255, 255, .05);
}



body.ramos-page-turnos .message-card.unread {
  border-color: #2563eb;
  box-shadow: 0 14px 34px rgba(37, 99, 235, .12);
}

body.ramos-page-turnos .read-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: .25rem .55rem;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: #eff6ff;
  color: #1d4ed8;
}

body.ramos-page-turnos .read-chip.ok {
  background: #dcfce7;
  color: #166534;
}

body.ramos-page-turnos .read-chip.pending {
  background: #fef3c7;
  color: #92400e;
}

body.ramos-page-turnos .mensaje-texto-pre {
  white-space: pre-line;
}

body.ramos-page-turnos .desktop-unread-badge {
  position: absolute;
  top: -.45rem;
  right: -.45rem;
  min-width: 1.45rem;
  height: 1.45rem;
  padding: 0 .45rem;
  border-radius: 999px;
  background: #dc2626;
  color: white;
  font-size: 10px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 20px rgba(220, 38, 38, .22);
  border: 2px solid white;
}

body.ramos-page-turnos .desktop-unread-badge.hidden {
  display: none !important;
}

body.ramos-page-turnos .calendar-sub-card {
  background: linear-gradient(135deg, #ecfdf5, #eff6ff);
  border: 1px solid #bfdbfe;
  border-radius: 1.35rem;
  padding: 1rem;
}

body.ramos-page-turnos .calendar-sub-url {
  word-break: break-all;
  font-size: 10px;
  font-weight: 800;
  color: #475569;
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(148, 163, 184, .25);
  border-radius: .9rem;
  padding: .65rem;
}



/* =========================================================
   UI PRO 2026 · Cristalería Ramos
   Mejora visual responsive sin tocar lógica Firestore/JS
   ========================================================= */
:root {
  --pro-bg: #eef3f8;
  --pro-ink: #0f172a;
  --pro-muted: #64748b;
  --pro-card: rgba(255, 255, 255, .94);
  --pro-line: rgba(226, 232, 240, .92);
  --pro-shadow: 0 18px 45px rgba(15, 23, 42, .085);
  --pro-shadow-soft: 0 12px 30px rgba(15, 23, 42, .055);
  --pro-radius: 1.75rem;
}

body.ramos-page-turnos {
  background:
    radial-gradient(circle at 0% 0%, rgba(16, 185, 129, .13), transparent 30%),
    radial-gradient(circle at 100% 0%, rgba(37, 99, 235, .11), transparent 30%),
    var(--pro-bg) !important;
}

body.ramos-page-turnos.dark {
  --pro-bg: #0f172a;
  --pro-card: rgba(23, 32, 51, .94);
  --pro-line: rgba(255, 255, 255, .10);
  --pro-shadow: 0 18px 45px rgba(0, 0, 0, .28);
  background:
    radial-gradient(circle at 0% 0%, rgba(16, 185, 129, .10), transparent 30%),
    radial-gradient(circle at 100% 0%, rgba(56, 189, 248, .10), transparent 30%),
    #0f172a !important;
}

/* Header tipo app moderna */
body.ramos-page-turnos #view-app>header.glass {
  top: 0;
  margin: 0;
  border-bottom: 0 !important;
  background: rgba(255, 255, 255, .82) !important;
  backdrop-filter: blur(18px) !important;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .06);
}

body.ramos-page-turnos.dark #view-app>header.glass {
  background: rgba(15, 23, 42, .86) !important;
}

body.ramos-page-turnos #view-app>header .desktop-shell {
  max-width: 1480px;
}

body.ramos-page-turnos #user-display-name {
  letter-spacing: -.03em;
}

body.ramos-page-turnos #user-role-badge {
  letter-spacing: .13em;
}

/* Cards generales */
body.ramos-page-turnos .card,
body.ramos-page-turnos .kpi-card,
body.ramos-page-turnos .mobile-card-pro,
body.ramos-page-turnos .turno-card,
body.ramos-page-turnos .vacation-card {
  border-radius: var(--pro-radius) !important;
  box-shadow: var(--pro-shadow-soft) !important;
  border-color: var(--pro-line) !important;
}

body.ramos-page-turnos .input-field,
body.ramos-page-turnos .search-field,
body.ramos-page-turnos .filter-select {
  border-radius: 1rem !important;
}

/* Botones superiores desktop como panel PRO */
@media (min-width:1100px) {
  body.ramos-page-turnos .desktop-shell {
    max-width: 1480px !important;
  }

  body.ramos-page-turnos main.desktop-shell {
    padding: 1.15rem !important;
  }

  body.ramos-page-turnos .desktop-view>.flex.flex-col.lg\:flex-row {
    background: var(--pro-card);
    border: 1px solid var(--pro-line);
    border-radius: 2rem;
    box-shadow: var(--pro-shadow);
    padding: 1rem;
    backdrop-filter: blur(18px);
    align-items: center !important;
  }

  body.ramos-page-turnos .desktop-view>.flex.flex-col.lg\:flex-row>.flex.flex-col.sm\:flex-row {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
    width: 100%;
    gap: .75rem !important;
  }

  body.ramos-page-turnos .desktop-view>.flex.flex-col.lg\:flex-row>.text-right {
    min-width: 180px;
    padding-right: .5rem;
  }

  body.ramos-page-turnos .desktop-view button[id^="desktop-btn"],
  body.ramos-page-turnos #desktop-btn-vacaciones,
  body.ramos-page-turnos #btn-publicar {
    border-radius: 1.45rem !important;
    min-height: 84px;
    transition: .18s ease;
  }

  body.ramos-page-turnos .desktop-view button[id^="desktop-btn"]:hover,
  body.ramos-page-turnos #desktop-btn-vacaciones:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 40px rgba(15, 23, 42, .11) !important;
  }

  body.ramos-page-turnos #admin-kpis {
    gap: .9rem !important;
  }

  body.ramos-page-turnos #admin-kpis .kpi-card {
    padding: 1.1rem !important;
    overflow: hidden;
    position: relative;
    background: var(--pro-card) !important;
  }

  body.ramos-page-turnos #admin-kpis .kpi-card:after {
    content: "";
    position: absolute;
    right: -38px;
    top: -38px;
    width: 106px;
    height: 106px;
    border-radius: 999px;
    background: rgba(16, 185, 129, .10);
  }

  body.ramos-page-turnos #admin-kpis .kpi-card.blue:after {
    background: rgba(37, 99, 235, .10);
  }

  body.ramos-page-turnos #admin-kpis .kpi-card.orange:after {
    background: rgba(249, 115, 22, .10);
  }

  body.ramos-page-turnos #admin-kpis .kpi-card.red:after {
    background: rgba(239, 68, 68, .10);
  }

  body.ramos-page-turnos .desktop-view>.bg-white.p-3.rounded-2xl {
    background: var(--pro-card) !important;
    border: 1px solid var(--pro-line) !important;
    border-radius: 1.75rem !important;
    box-shadow: var(--pro-shadow-soft);
    padding: 1rem !important;
  }

  body.ramos-page-turnos #desktop-admin-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }

  body.ramos-page-turnos #desktop-admin-content>section.card:first-child {
    border-radius: 2rem !important;
    padding: 1.15rem !important;
    background: var(--pro-card) !important;
    box-shadow: var(--pro-shadow) !important;
  }

  body.ramos-page-turnos #desktop-admin-content>section.bg-white {
    border-radius: 2rem !important;
    background: var(--pro-card) !important;
    box-shadow: var(--pro-shadow) !important;
    border-color: var(--pro-line) !important;
  }

  body.ramos-page-turnos .calendar-toolbar,
  body.ramos-page-turnos .calendar-mode-tabs {
    border-radius: 1.25rem !important;
  }

  body.ramos-page-turnos #desktop-calendar.calendar-grid {
    gap: .75rem !important;
  }

  body.ramos-page-turnos .calendar-day {
    min-height: 150px !important;
    border-radius: 1.55rem !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .045);
    transition: .18s ease;
  }

  body.ramos-page-turnos .calendar-day:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 38px rgba(15, 23, 42, .095);
    border-color: rgba(37, 99, 235, .25) !important;
  }

  body.ramos-page-turnos .calendar-day.today {
    background: #eff6ff !important;
    border-color: #2563eb !important;
  }

  body.ramos-page-turnos.dark .calendar-day.today {
    background: rgba(37, 99, 235, .14) !important;
  }

  body.ramos-page-turnos .calendar-area-group {
    border-radius: 1rem !important;
    padding: .62rem !important;
  }

  body.ramos-page-turnos .calendar-person-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  body.ramos-page-turnos .calendar-person-chip {
    border-radius: .9rem !important;
    background: rgba(255, 255, 255, .70) !important;
  }

  body.ramos-page-turnos .desktop-table-wrap {
    max-height: 520px !important;
  }

  body.ramos-page-turnos .desktop-table thead th {
    padding: 1rem !important;
    background: #f8fafc !important;
  }

  body.ramos-page-turnos.dark .desktop-table thead th {
    background: var(--soft) !important;
  }

  body.ramos-page-turnos .table-row td {
    padding: 1rem !important;
  }

  body.ramos-page-turnos .table-row {
    transition: .16s ease;
  }

  body.ramos-page-turnos .table-row:hover {
    background: #f8fafc !important;
  }
}

/* Mobile PRO: navegación inferior + hero más app */
@media (max-width:1099px) {
  body.ramos-page-turnos main.desktop-shell {
    padding: .9rem !important;
    padding-bottom: calc(7rem + env(safe-area-inset-bottom)) !important;
  }

  body.ramos-page-turnos .mobile-hero {
    border-radius: 2rem !important;
    padding: 1.15rem !important;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #047857 100%) !important;
    box-shadow: 0 20px 48px rgba(15, 23, 42, .22) !important;
    position: relative;
    overflow: hidden;
  }

  body.ramos-page-turnos .mobile-hero:after {
    content: "";
    position: absolute;
    right: -70px;
    top: -70px;
    width: 190px;
    height: 190px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
  }

  body.ramos-page-turnos .mobile-hero>* {
    position: relative;
    z-index: 1;
  }

  body.ramos-page-turnos .mobile-stat {
    border-radius: 1.2rem !important;
    background: rgba(255, 255, 255, .14) !important;
    border: 1px solid rgba(255, 255, 255, .16) !important;
    box-shadow: none !important;
  }

  body.ramos-page-turnos .mobile-tabs {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(.75rem + env(safe-area-inset-bottom));
    width: min(420px, calc(100% - 1.3rem));
    z-index: 120;
    background: rgba(255, 255, 255, .92);
    border: 1px solid rgba(226, 232, 240, .95);
    border-radius: 1.65rem;
    box-shadow: 0 18px 50px rgba(15, 23, 42, .20);
    backdrop-filter: blur(18px);
    padding: .45rem;
    display: grid !important;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    overflow: visible !important;
    gap: .25rem !important;
  }

  body.ramos-page-turnos.dark .mobile-tabs {
    background: rgba(15, 23, 42, .92);
  }


  /* Los paneles/modales móviles deben abrir por encima de la isla inferior */
  body.ramos-page-turnos .modal {
    z-index: 260 !important;
  }

  body.ramos-page-turnos .panel-backdrop {
    z-index: 240 !important;
  }

  body.ramos-page-turnos .side-panel {
    z-index: 250 !important;
  }



  body.ramos-page-turnos .mobile-tab {
    box-shadow: none !important;
    border: 0 !important;
    background: transparent !important;
    border-radius: 1.25rem !important;
    padding: .75rem .35rem !important;
    font-size: 8.5px !important;
    letter-spacing: .02em !important;
    color: #64748b !important;
    text-align: center !important;
    min-width: 0 !important;
  }

  body.ramos-page-turnos .mobile-tab.active {
    background: #0f172a !important;
    color: white !important;
  }

  body.ramos-page-turnos.dark .mobile-tab.active {
    background: #38bdf8 !important;
    color: #0f172a !important;
  }

  body.ramos-page-turnos .mobile-card-pro,
  body.ramos-page-turnos .turno-card,
  body.ramos-page-turnos .card {
    border-radius: 1.75rem !important;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .075) !important;
  }

  body.ramos-page-turnos .turno-card {
    padding: 1rem !important;
    position: relative;
    overflow: hidden;
  }

  body.ramos-page-turnos .turno-card:before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: #10b981;
  }

  body.ramos-page-turnos .mobile-calendar-day {
    border-radius: 1.25rem !important;
    box-shadow: 0 10px 22px rgba(15, 23, 42, .055) !important;
  }

  body.ramos-page-turnos .mobile-admin-actions {
    gap: .75rem !important;
  }

  body.ramos-page-turnos .mobile-admin-action {
    border-radius: 1.65rem !important;
    min-height: 118px !important;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .08) !important;
  }

  body.ramos-page-turnos .mobile-admin-icon {
    border-radius: 1.15rem !important;
    width: 42px !important;
    height: 42px !important;
  }

  body.ramos-page-turnos .side-panel {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 2rem 2rem 0 0;
    top: auto !important;
    bottom: 0 !important;
    height: 86dvh !important;
    transform: translateY(100%) !important;
    border-left: 0 !important;
    border-top: 1px solid var(--line);
  }

  body.ramos-page-turnos .side-panel.active {
    transform: translateY(0) !important;
  }

  body.ramos-page-turnos .panel-sticky-head {
    border-radius: 2rem 2rem 0 0;
  }

  body.ramos-page-turnos .modal {
    align-items: flex-end !important;
  }

  body.ramos-page-turnos .modal>.bg-white {
    border-radius: 2rem 2rem 0 0 !important;
    margin-bottom: 0 !important;
    max-height: 88dvh !important;
  }
}

/* Badges y chips algo más finos */
body.ramos-page-turnos .area-pill,
body.ramos-page-turnos .status-badge,
body.ramos-page-turnos .read-chip,
body.ramos-page-turnos .day-summary-chip,
body.ramos-page-turnos .vacation-summary-chip {
  border-radius: 999px !important;
  font-weight: 900 !important;
}

/* Selector de operarios más moderno */
body.ramos-page-turnos .selector-pro {
  border-radius: 1.5rem !important;
  background: #f8fafc !important;
}

body.ramos-page-turnos .selector-row,
body.ramos-page-turnos .multi-check,
body.ramos-page-turnos .selector-action,
body.ramos-page-turnos .selector-chip {
  border-radius: 1rem !important;
}

body.ramos-page-turnos.dark .selector-pro {
  background: var(--soft) !important;
}



/* Fix vista intermedia: los botones de vista superiores no deben heredar tamaño de acciones */
@media (min-width:1100px) {
  body.ramos-page-turnos .desktop-header-controls .desktop-top-view-button {
    min-height: auto !important;
    width: auto !important;
    padding: .72rem .95rem !important;
    border-radius: 1rem !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .05) !important;
  }

  body.ramos-page-turnos .desktop-header-controls .desktop-top-view-button h3,
  body.ramos-page-turnos .desktop-header-controls .desktop-top-view-button p {
    white-space: nowrap;
  }
}

@supports (padding:max(0px)) {
  body.ramos-page-turnos {
    padding-top: env(safe-area-inset-top);
  }

  body.ramos-page-turnos main {
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
  }
}

/* ===== Desktop PRO layout v5: responsive real sin vista intermedia rota ===== */
@media (min-width:1200px) {
  body.ramos-page-turnos .desktop-pro-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
  }

  body.ramos-page-turnos .desktop-pro-sidebar,
  body.ramos-page-turnos .desktop-pro-right {
    position: sticky;
    top: 86px;
    align-self: start;
  }

  body.ramos-page-turnos .desktop-pro-nav-card {
    border-radius: 1.35rem;
    padding: .95rem;
    display: flex;
    align-items: center;
    gap: .8rem;
    border: 1px solid var(--line);
    background: var(--card);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .045);
  }

  body.ramos-page-turnos .desktop-pro-nav-card.dark {
    background: #0f172a;
    color: white;
    border-color: #0f172a;
    box-shadow: 0 18px 34px rgba(15, 23, 42, .16);
  }

  body.ramos-page-turnos .desktop-pro-icon {
    width: 42px;
    height: 42px;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    flex-shrink: 0;
  }

  body.ramos-page-turnos .desktop-pro-action {
    width: 100%;
    border-radius: 1.35rem;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: .85rem;
    text-align: left;
    border: 1px solid var(--line);
    background: var(--card);
    box-shadow: 0 12px 28px rgba(15, 23, 42, .055);
    transition: transform .16s ease, box-shadow .16s ease;
  }

  body.ramos-page-turnos .desktop-pro-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 36px rgba(15, 23, 42, .08);
  }

  body.ramos-page-turnos .desktop-pro-action:active {
    transform: scale(.98);
  }

  body.ramos-page-turnos .desktop-pro-action.active {
    background: rgba(37, 99, 235, .08);
    border-color: rgba(37, 99, 235, .35);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12), 0 8px 20px rgba(37, 99, 235, .1);
  }

  body.ramos-page-turnos .desktop-pro-main-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 1.8rem;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .075);
    overflow: hidden;
  }

  body.ramos-page-turnos .desktop-pro-kpis {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .85rem;
  }

  body.ramos-page-turnos .desktop-pro-kpis .kpi-card {
    border-radius: 1.55rem;
  }

  body.ramos-page-turnos .desktop-pro-calendar-head {
    padding: 1.1rem;
    border-bottom: 1px solid var(--line);
  }

  body.ramos-page-turnos .desktop-pro-list-head {
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--line);
  }

  body.ramos-page-turnos .desktop-pro-layout.operario-mode {
    grid-template-columns: 320px minmax(0, 1fr);
  }

  body.ramos-page-turnos .desktop-pro-right.operario-hidden {
    display: none !important;
  }

  body.ramos-page-turnos .desktop-pro-action.operario-quick {
    background: #fff;
  }

  body.ramos-page-turnos .desktop-pro-right-section {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 1.6rem;
    padding: 1rem;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .055);
  }

  body.ramos-page-turnos .desktop-top-view-button {
    border-radius: 1.1rem;
    padding: .75rem .95rem;
    align-items: center;
    gap: .65rem;
    border: 1px solid var(--line);
    background: var(--card);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .05);
    text-align: left;
  }

  body.ramos-page-turnos .desktop-top-view-button .desktop-pro-icon {
    width: 36px;
    height: 36px;
    border-radius: .9rem;
  }

  body.ramos-page-turnos .desktop-top-view-button.dark {
    background: #0f172a;
    color: white;
    border-color: #0f172a;
  }

  body.ramos-page-turnos .desktop-header-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .55rem;
    flex-wrap: wrap;
  }

  /* Admin v8: control y comunicación pasan al header; calendario más ancho */
  body.ramos-page-turnos #desktop-pro-right-column {
    display: none !important;
  }

  body.ramos-page-turnos .desktop-admin-header-actions {
    display: flex;
    align-items: center;
    gap: .55rem;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  body.ramos-page-turnos .desktop-header-action {
    border-radius: 1rem;
    padding: .72rem .9rem;
    align-items: center;
    gap: .6rem;
    border: 1px solid var(--line);
    background: var(--card);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .05);
    text-align: left;
    min-height: auto !important;
    white-space: nowrap;
  }

  body.ramos-page-turnos .desktop-header-action h3 {
    font-size: .68rem;
    line-height: 1.1;
    white-space: nowrap;
  }

  body.ramos-page-turnos .desktop-header-action p {
    font-size: .52rem;
    line-height: 1.1;
    white-space: nowrap;
  }

  body.ramos-page-turnos .desktop-header-action .desktop-pro-icon {
    width: 34px;
    height: 34px;
    border-radius: .85rem;
  }


  /* Ajustes PRO v4 */
  body.ramos-page-turnos .desktop-pro-action h3 {
    white-space: nowrap;
    font-size: .72rem;
    line-height: 1.1;
  }

  body.ramos-page-turnos .desktop-pro-action p {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.ramos-page-turnos #btn-publicar {
    min-height: auto !important;
    width: auto !important;
    padding: .72rem 1rem !important;
    border-radius: 1rem !important;
    align-self: center !important;
    box-shadow: 0 10px 22px rgba(37, 99, 235, .14) !important;
  }

  body.ramos-page-turnos .mensaje-texto-pre {
    white-space: pre-line;
  }


}

@media (min-width:1100px) and (max-width:1199px) {
  body.ramos-page-turnos .desktop-pro-layout {
    display: block;
  }

  body.ramos-page-turnos .desktop-pro-sidebar {
    display: block;
    margin-bottom: 1rem;
  }

  body.ramos-page-turnos .desktop-pro-right {
    display: none;
  }

  body.ramos-page-turnos .desktop-pro-sidebar .desktop-pro-right-section {
    margin-bottom: 1rem;
  }

  body.ramos-page-turnos .desktop-pro-sidebar .space-y-3.mt-4 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
  }

  body.ramos-page-turnos .desktop-pro-kpis {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
  }

  body.ramos-page-turnos .desktop-header-controls {
    justify-content: flex-start;
    width: 100%;
    margin-top: .75rem;
  }

  body.ramos-page-turnos .desktop-view>.flex.flex-col.xl\:flex-row {
    align-items: flex-start !important;
  }

  body.ramos-page-turnos #btn-publicar {
    min-height: auto !important;
    padding: .7rem .95rem !important;
  }
}


/* =========================================================
   RAMOS UI UNIFICADO · TURNOS
   Cabecero azul + modo noche igual Incidencias/Mediciones
   Solo CSS: no toca lógica Firestore/JS
   ========================================================= */

:root {
  --ramos-blue: #1d4ed8;
  --ramos-blue-2: #2563eb;
  --ramos-hero-start: #0f172a;
  --ramos-hero-mid: #1e293b;
  --ramos-hero-end: #1d4ed8;
}

/* Fondo y variables igual que Incidencias */
body.ramos-page-turnos.dark {
  --bg: #0f172a;
  --card: #172033;
  --text: #eff6ff;
  --muted: #94a3b8;
  --line: rgba(255, 255, 255, .10);
  --soft: #111827;
  --primary: #38bdf8;
  --shadow: 0 14px 34px rgba(0, 0, 0, .24);
}

/* Cabeceros/hero en azul PRO, no verde */
body.ramos-page-turnos .mobile-hero,
body.ramos-page-turnos .inc-safe-hero,
body.ramos-page-turnos .desktop-view>.flex.flex-col.xl\:flex-row.xl\:items-center.xl\:justify-between,
body.ramos-page-turnos .desktop-view>.flex.flex-col.lg\:flex-row {
  background:
    radial-gradient(circle at 0% 0%, rgba(37, 99, 235, .22), transparent 35%),
    linear-gradient(135deg, var(--ramos-hero-start) 0%, var(--ramos-hero-mid) 50%, var(--ramos-hero-end) 100%) !important;
  color: white !important;
  border-color: rgba(255, 255, 255, .10) !important;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .18) !important;
}

body.ramos-page-turnos.dark .mobile-hero,
body.ramos-page-turnos.dark .inc-safe-hero,
body.ramos-page-turnos.dark .desktop-view>.flex.flex-col.xl\:flex-row.xl\:items-center.xl\:justify-between,
body.ramos-page-turnos.dark .desktop-view>.flex.flex-col.lg\:flex-row {
  box-shadow: 0 18px 45px rgba(0, 0, 0, .25) !important;
}

/* Textos del header principal dentro del hero */
body.ramos-page-turnos .desktop-view>.flex.flex-col.xl\:flex-row p,
body.ramos-page-turnos .desktop-view>.flex.flex-col.xl\:flex-row h1,
body.ramos-page-turnos .desktop-view>.flex.flex-col.xl\:flex-row h2,
body.ramos-page-turnos .mobile-hero p,
body.ramos-page-turnos .mobile-hero h1,
body.ramos-page-turnos .mobile-hero h2 {
  color: white !important;
}

body.ramos-page-turnos .desktop-view>.flex.flex-col.xl\:flex-row .text-slate-400,
body.ramos-page-turnos .desktop-view>.flex.flex-col.xl\:flex-row .text-slate-300,
body.ramos-page-turnos .mobile-hero .text-slate-200,
body.ramos-page-turnos .mobile-hero .text-slate-300 {
  color: #cbd5e1 !important;
}

body.ramos-page-turnos .desktop-view>.flex.flex-col.xl\:flex-row .text-blue-600,
body.ramos-page-turnos .desktop-view>.flex.flex-col.xl\:flex-row .text-emerald-600,
body.ramos-page-turnos .mobile-hero .text-blue-200,
body.ramos-page-turnos .mobile-hero .text-emerald-200 {
  color: #bfdbfe !important;
}

/* Botones de navegación del hero: legibles encima del azul */
body.ramos-page-turnos .desktop-header-controls>button,
body.ramos-page-turnos .desktop-header-controls .calendar-mode-tabs,
body.ramos-page-turnos .calendar-mode-tabs {
  background: rgba(255, 255, 255, .10) !important;
  border: 1px solid rgba(255, 255, 255, .16) !important;
  color: white !important;
}

body.ramos-page-turnos .desktop-header-controls>button,
body.ramos-page-turnos .calendar-mode-btn {
  color: #e2e8f0 !important;
}

body.ramos-page-turnos .calendar-mode-btn.active {
  background: white !important;
  color: #0f172a !important;
}

body.ramos-page-turnos.dark .calendar-mode-btn.active {
  background: #38bdf8 !important;
  color: #0f172a !important;
}

/* Cards principales en oscuro */
body.ramos-page-turnos.dark .ausencia-card.ausencia-estado-pendiente {
  background: linear-gradient(to right, rgba(245,158,11,.12) 0%, var(--card) 48px) !important;
  border-left-color: #f59e0b !important;
}
body.ramos-page-turnos.dark .ausencia-card.ausencia-estado-aprobada {
  background: linear-gradient(to right, rgba(34,197,94,.12) 0%, var(--card) 48px) !important;
  border-left-color: #22c55e !important;
}
body.ramos-page-turnos.dark .ausencia-card.ausencia-estado-rechazada {
  background: linear-gradient(to right, rgba(239,68,68,.12) 0%, var(--card) 48px) !important;
  border-left-color: #ef4444 !important;
}
body.ramos-page-turnos.dark .ausencia-filtro-btn {
  background: var(--card);
  color: var(--muted);
  border: 1px solid var(--line);
}
body.ramos-page-turnos.dark .ausencia-filtro-btn.active {
  background: #f59e0b;
  color: white;
  border-color: transparent;
}

body.ramos-page-turnos.dark .card,
body.ramos-page-turnos.dark .kpi-card,
body.ramos-page-turnos.dark .mobile-card-pro,
body.ramos-page-turnos.dark .turno-card,
body.ramos-page-turnos.dark .vacation-card,
body.ramos-page-turnos.dark .desktop-pro-main-card,
body.ramos-page-turnos.dark .desktop-pro-right-section,
body.ramos-page-turnos.dark .desktop-pro-action,
body.ramos-page-turnos.dark .desktop-header-action,
body.ramos-page-turnos.dark .desktop-top-view-button,
body.ramos-page-turnos.dark section.bg-white,
body.ramos-page-turnos.dark div.bg-white,
body.ramos-page-turnos.dark .bg-white {
  background: var(--card) !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
  box-shadow: var(--shadow) !important;
}

/* Subcajas interiores */
body.ramos-page-turnos.dark .bg-slate-50,
body.ramos-page-turnos.dark .bg-slate-100,
body.ramos-page-turnos.dark .selector-pro,
body.ramos-page-turnos.dark .selector-row,
body.ramos-page-turnos.dark .selector-action,
body.ramos-page-turnos.dark .multi-check,
body.ramos-page-turnos.dark .date-pick-day,
body.ramos-page-turnos.dark .calendar-day,
body.ramos-page-turnos.dark .mobile-calendar-day,
body.ramos-page-turnos.dark .calendar-area-detail,
body.ramos-page-turnos.dark .calendar-person-chip,
body.ramos-page-turnos.dark .calendar-sub-url,
body.ramos-page-turnos.dark .desc-box {
  background: var(--soft) !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
}

/* Inputs/selects/textareas */
body.ramos-page-turnos.dark input,
body.ramos-page-turnos.dark textarea,
body.ramos-page-turnos.dark select,
body.ramos-page-turnos.dark .input-field,
body.ramos-page-turnos.dark .search-field,
body.ramos-page-turnos.dark .filter-select {
  background: var(--soft) !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
}

body.ramos-page-turnos.dark input::placeholder,
body.ramos-page-turnos.dark textarea::placeholder,
body.ramos-page-turnos.dark .search-field::placeholder {
  color: var(--muted) !important;
}

/* Textos Tailwind que quedaban oscuros en cajas */
body.ramos-page-turnos.dark .text-slate-950,
body.ramos-page-turnos.dark .text-slate-900,
body.ramos-page-turnos.dark .text-slate-800,
body.ramos-page-turnos.dark .text-slate-700,
body.ramos-page-turnos.dark .text-slate-600,
body.ramos-page-turnos.dark .text-slate-500,
body.ramos-page-turnos.dark .desktop-pro-action h3,
body.ramos-page-turnos.dark .desktop-header-action h3,
body.ramos-page-turnos.dark .mobile-admin-action strong,
body.ramos-page-turnos.dark .selector-row .block.font-black,
body.ramos-page-turnos.dark .calendar-sub-card h3,
body.ramos-page-turnos.dark .date-pick-day,
body.ramos-page-turnos.dark .multi-check {
  color: var(--text) !important;
}

body.ramos-page-turnos.dark .text-slate-400,
body.ramos-page-turnos.dark .text-slate-300,
body.ramos-page-turnos.dark .label-tag,
body.ramos-page-turnos.dark .desktop-pro-action p,
body.ramos-page-turnos.dark .desktop-header-action p,
body.ramos-page-turnos.dark .mobile-admin-action span,
body.ramos-page-turnos.dark .calendar-sub-card p,
body.ramos-page-turnos.dark .day-summary-total,
body.ramos-page-turnos.dark .mobile-calendar-day-name {
  color: var(--muted) !important;
}

/* Modales y paneles */
body.ramos-page-turnos.dark .modal>div,
body.ramos-page-turnos.dark .side-panel,
body.ramos-page-turnos.dark #panel-content,
body.ramos-page-turnos.dark .panel-sticky-head {
  background: var(--card) !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
}

body.ramos-page-turnos.dark .modal.active {
  background: rgba(2, 6, 23, .78) !important;
}

body.ramos-page-turnos.dark .panel-backdrop.active {
  background: rgba(2, 6, 23, .55) !important;
}

/* Calendario personal / suscripción: legible en modo noche */
body.ramos-page-turnos .calendar-sub-card {
  background:
    radial-gradient(circle at 0% 0%, rgba(37, 99, 235, .14), transparent 35%),
    linear-gradient(135deg, #eff6ff, #ecfdf5) !important;
  border: 1px solid #bfdbfe !important;
  color: #0f172a !important;
}

body.ramos-page-turnos .calendar-sub-card h3,
body.ramos-page-turnos .calendar-sub-card p {
  color: #0f172a !important;
}

body.ramos-page-turnos .calendar-sub-card p {
  color: #475569 !important;
}

body.ramos-page-turnos.dark .calendar-sub-card {
  background:
    radial-gradient(circle at 0% 0%, rgba(56, 189, 248, .14), transparent 35%),
    linear-gradient(135deg, #172033, #111827) !important;
  border-color: rgba(56, 189, 248, .22) !important;
  color: var(--text) !important;
  box-shadow: var(--shadow) !important;
}

body.ramos-page-turnos.dark .calendar-sub-card h3,
body.ramos-page-turnos.dark .calendar-sub-card .text-slate-900 {
  color: var(--text) !important;
}

body.ramos-page-turnos.dark .calendar-sub-card p,
body.ramos-page-turnos.dark .calendar-sub-card .text-slate-500 {
  color: var(--muted) !important;
}

body.ramos-page-turnos.dark .calendar-sub-url {
  background: rgba(15, 23, 42, .72) !important;
  color: #dbeafe !important;
  border-color: rgba(148, 163, 184, .22) !important;
}

/* Opción recomendada / cajas de ayuda */
body.ramos-page-turnos.dark .bg-blue-50,
body.ramos-page-turnos.dark .bg-emerald-50,
body.ramos-page-turnos.dark .bg-green-50,
body.ramos-page-turnos.dark .bg-amber-50,
body.ramos-page-turnos.dark .bg-red-50,
body.ramos-page-turnos.dark .bg-rose-50 {
  border-color: var(--line) !important;
}

body.ramos-page-turnos.dark .bg-blue-50 {
  background: rgba(59, 130, 246, .14) !important;
  color: #bfdbfe !important;
}

body.ramos-page-turnos.dark .bg-emerald-50,
body.ramos-page-turnos.dark .bg-green-50 {
  background: rgba(16, 185, 129, .14) !important;
  color: #a7f3d0 !important;
}

body.ramos-page-turnos.dark .bg-amber-50 {
  background: rgba(245, 158, 11, .14) !important;
  color: #fde68a !important;
}

body.ramos-page-turnos.dark .bg-red-50,
body.ramos-page-turnos.dark .bg-rose-50 {
  background: rgba(239, 68, 68, .14) !important;
  color: #fecaca !important;
}

/* Textos dentro de cajas recomendadas */
body.ramos-page-turnos.dark .bg-blue-50 *,
body.ramos-page-turnos.dark .bg-emerald-50 *,
body.ramos-page-turnos.dark .bg-green-50 *,
body.ramos-page-turnos.dark .bg-amber-50 *,
body.ramos-page-turnos.dark .bg-red-50 *,
body.ramos-page-turnos.dark .bg-rose-50 * {
  color: inherit !important;
}

/* Días de la semana al añadir turno */
body.ramos-page-turnos.dark .multi-check {
  background: var(--soft) !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
}

body.ramos-page-turnos.dark .multi-check input {
  accent-color: #38bdf8 !important;
}

/* Selector manual de días */
body.ramos-page-turnos.dark .date-mode-note {
  background: rgba(56, 189, 248, .12) !important;
  color: #bfdbfe !important;
  border-color: rgba(56, 189, 248, .22) !important;
}

body.ramos-page-turnos.dark .date-pick-day.selected {
  background: #38bdf8 !important;
  color: #0f172a !important;
  border-color: #38bdf8 !important;
}

body.ramos-page-turnos.dark .date-pick-day.has-conflict {
  border-color: #f87171 !important;
  box-shadow: 0 0 0 2px rgba(248, 113, 113, .20) !important;
}

/* Selectores de operarios */
body.ramos-page-turnos.dark .selector-chip,
body.ramos-page-turnos.dark .selected-chip {
  background: rgba(56, 189, 248, .12) !important;
  color: #bfdbfe !important;
  border-color: rgba(56, 189, 248, .22) !important;
}

body.ramos-page-turnos.dark .selector-row.selected {
  background: rgba(16, 185, 129, .16) !important;
  border-color: rgba(16, 185, 129, .35) !important;
}

/* Calendarios y agrupaciones */
body.ramos-page-turnos.dark .calendar-day.today,
body.ramos-page-turnos.dark .mobile-calendar-day.today {
  background: rgba(37, 99, 235, .14) !important;
  border-color: #60a5fa !important;
}

body.ramos-page-turnos.dark .calendar-area-count {
  background: rgba(255, 255, 255, .10) !important;
  color: var(--text) !important;
}

/* Mantener chips de áreas legibles en oscuro */
body.ramos-page-turnos.dark .area-linea,
body.ramos-page-turnos.dark .calendar-area-group.linea,
body.ramos-page-turnos.dark .day-summary-chip.linea {
  background: rgba(59, 130, 246, .18) !important;
  color: #bfdbfe !important;
  border-color: rgba(59, 130, 246, .30) !important;
}

body.ramos-page-turnos.dark .area-corte,
body.ramos-page-turnos.dark .calendar-area-group.corte,
body.ramos-page-turnos.dark .day-summary-chip.corte {
  background: rgba(249, 115, 22, .18) !important;
  color: #fed7aa !important;
  border-color: rgba(249, 115, 22, .30) !important;
}

body.ramos-page-turnos.dark .area-taller,
body.ramos-page-turnos.dark .calendar-area-group.taller,
body.ramos-page-turnos.dark .day-summary-chip.taller {
  background: rgba(168, 85, 247, .18) !important;
  color: #e9d5ff !important;
  border-color: rgba(168, 85, 247, .30) !important;
}

body.ramos-page-turnos.dark .area-mantenimiento,
body.ramos-page-turnos.dark .calendar-area-group.mantenimiento,
body.ramos-page-turnos.dark .day-summary-chip.mantenimiento {
  background: rgba(34, 197, 94, .18) !important;
  color: #bbf7d0 !important;
  border-color: rgba(34, 197, 94, .30) !important;
}

body.ramos-page-turnos.dark .area-colocacion,
body.ramos-page-turnos.dark .calendar-area-group.colocacion,
body.ramos-page-turnos.dark .day-summary-chip.colocacion {
  background: rgba(20, 184, 166, .18) !important;
  color: #99f6e4 !important;
  border-color: rgba(20, 184, 166, .30) !important;
}

body.ramos-page-turnos.dark .area-expedicion,
body.ramos-page-turnos.dark .calendar-area-group.expedicion,
body.ramos-page-turnos.dark .day-summary-chip.expedicion {
  background: rgba(3, 105, 161, .18) !important;
  color: #bae6fd !important;
  border-color: rgba(3, 105, 161, .30) !important;
}

body.ramos-page-turnos.dark .area-medicion,
body.ramos-page-turnos.dark .calendar-area-group.medicion,
body.ramos-page-turnos.dark .day-summary-chip.medicion {
  background: rgba(14, 165, 233, .18) !important;
  color: #bae6fd !important;
  border-color: rgba(14, 165, 233, .30) !important;
}

body.ramos-page-turnos.dark .area-comercial,
body.ramos-page-turnos.dark .calendar-area-group.comercial,
body.ramos-page-turnos.dark .day-summary-chip.comercial {
  background: rgba(234, 179, 8, .18) !important;
  color: #fef08a !important;
  border-color: rgba(234, 179, 8, .30) !important;
}

body.ramos-page-turnos.dark .area-oficina,
body.ramos-page-turnos.dark .calendar-area-group.oficina,
body.ramos-page-turnos.dark .day-summary-chip.oficina,
body.ramos-page-turnos.dark .calendar-area-group.sin_asignar {
  background: rgba(148, 163, 184, .14) !important;
  color: #cbd5e1 !important;
  border-color: rgba(148, 163, 184, .24) !important;
}

body.ramos-page-turnos.dark .area-chofer,
body.ramos-page-turnos.dark .calendar-area-group.chofer,
body.ramos-page-turnos.dark .day-summary-chip.chofer {
  background: rgba(217, 70, 239, .18) !important;
  color: #f5d0fe !important;
  border-color: rgba(217, 70, 239, .30) !important;
}

/* Tablas */
body.ramos-page-turnos.dark .desktop-table thead th {
  background: var(--soft) !important;
  color: var(--muted) !important;
  border-color: var(--line) !important;
}

body.ramos-page-turnos.dark .table-row {
  background: var(--card) !important;
  border-color: var(--line) !important;
}

body.ramos-page-turnos.dark .table-row:hover,
body.ramos-page-turnos.dark .table-row.selected {
  background: rgba(255, 255, 255, .05) !important;
}

/* Loader dark */
body.ramos-page-turnos.dark #loader {
  background: var(--card) !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
}

/* Isla inferior móvil */
body.ramos-page-turnos.dark .mobile-tabs {
  background: rgba(15, 23, 42, .92) !important;
  border-color: rgba(255, 255, 255, .10) !important;
}

body.ramos-page-turnos.dark .mobile-tab {
  color: var(--muted) !important;
}

body.ramos-page-turnos.dark .mobile-tab.active {
  background: #38bdf8 !important;
  color: #0f172a !important;
}

/* Bordes genéricos */
body.ramos-page-turnos.dark .border,
body.ramos-page-turnos.dark .border-b,
body.ramos-page-turnos.dark .border-slate-100,
body.ramos-page-turnos.dark .border-slate-200 {
  border-color: var(--line) !important;
}

/* Botones principales coherentes */
body.ramos-page-turnos .bg-emerald-600 {
  background: #2563eb !important;
}

body.ramos-page-turnos .text-emerald-600,
body.ramos-page-turnos .text-emerald-700,
body.ramos-page-turnos .text-emerald-800 {
  color: #2563eb !important;
}

body.ramos-page-turnos.dark .text-emerald-600,
body.ramos-page-turnos.dark .text-emerald-700,
body.ramos-page-turnos.dark .text-emerald-800 {
  color: #93c5fd !important;
}


/* ===== FIX FINAL · Botones admin header escritorio legibles ===== */
@media (min-width:1100px) {
  body.ramos-page-turnos #desktop-admin-header-actions .desktop-header-action {
    background: rgba(255, 255, 255, .12) !important;
    border: 1px solid rgba(255, 255, 255, .18) !important;
    color: #ffffff !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .16) !important;
  }

  body.ramos-page-turnos #desktop-admin-header-actions .desktop-header-action h3,
  body.ramos-page-turnos #desktop-admin-header-actions .desktop-header-action p {
    color: #ffffff !important;
  }

  body.ramos-page-turnos #desktop-admin-header-actions .desktop-header-action p {
    opacity: .82 !important;
  }

  body.ramos-page-turnos #desktop-admin-header-actions .desktop-header-action .desktop-pro-icon {
    background: #2563eb !important;
    color: #ffffff !important;
  }

  body.ramos-page-turnos #desktop-admin-header-actions #desktop-btn-mensajes-admin {
    background: rgba(59, 130, 246, .18) !important;
    color: #ffffff !important;
    border-color: rgba(147, 197, 253, .26) !important;
  }

  body.ramos-page-turnos #desktop-admin-header-actions #desktop-btn-mensajes-admin h3,
  body.ramos-page-turnos #desktop-admin-header-actions #desktop-btn-mensajes-admin p {
    color: #ffffff !important;
  }

  body.ramos-page-turnos #desktop-admin-header-actions #desktop-btn-panel-vacaciones {
    background: rgba(239, 68, 68, .18) !important;
    color: #ffffff !important;
    border-color: rgba(252, 165, 165, .28) !important;
  }

  body.ramos-page-turnos #desktop-admin-header-actions #desktop-btn-panel-vacaciones h3,
  body.ramos-page-turnos #desktop-admin-header-actions #desktop-btn-panel-vacaciones p {
    color: #ffffff !important;
  }

  body.ramos-page-turnos.dark #desktop-admin-header-actions .desktop-header-action {
    background: rgba(255, 255, 255, .08) !important;
    border-color: rgba(255, 255, 255, .12) !important;
    color: #eff6ff !important;
  }

  body.ramos-page-turnos.dark #desktop-admin-header-actions .desktop-header-action h3 {
    color: #eff6ff !important;
  }

  body.ramos-page-turnos.dark #desktop-admin-header-actions .desktop-header-action p {
    color: #cbd5e1 !important;
  }
}

/* ===== Turnos v3 · navegación de periodo dentro del header del calendario ===== */
@media (min-width:1100px) {
  body.ramos-page-turnos .desktop-calendar-head-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .65rem;
    flex-wrap: wrap;
  }

  body.ramos-page-turnos .desktop-calendar-controls {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 1.25rem;
    padding: .35rem;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .055);
  }

  body.ramos-page-turnos .desktop-calendar-controls .calendar-mode-tabs {
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
  }

  body.ramos-page-turnos .desktop-calendar-controls .calendar-mode-btn {
    color: #64748b !important;
  }

  body.ramos-page-turnos .desktop-calendar-controls .calendar-mode-btn.active {
    background: #0f172a !important;
    color: #ffffff !important;
  }

  body.ramos-page-turnos .calendar-nav-btn {
    width: 2.65rem;
    height: 2.65rem;
    border-radius: 1rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #0f172a;
    font-weight: 900;
    font-size: 1.35rem;
    line-height: 1;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .055);
  }

  body.ramos-page-turnos .calendar-nav-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(15, 23, 42, .08);
  }

  body.ramos-page-turnos.dark .desktop-calendar-controls {
    background: var(--soft) !important;
    border-color: var(--line) !important;
    box-shadow: var(--shadow) !important;
  }

  body.ramos-page-turnos.dark .desktop-calendar-controls .calendar-mode-btn {
    color: var(--muted) !important;
  }

  body.ramos-page-turnos.dark .desktop-calendar-controls .calendar-mode-btn.active {
    background: #38bdf8 !important;
    color: #0f172a !important;
  }

  body.ramos-page-turnos.dark .calendar-nav-btn {
    background: #172033 !important;
    border-color: var(--line) !important;
    color: var(--text) !important;
  }

  body.ramos-page-turnos #btn-publicar {
    white-space: nowrap;
  }
}

@media (min-width:1100px) and (max-width:1250px) {
  body.ramos-page-turnos .desktop-calendar-head-actions {
    justify-content: flex-start;
  }
}


/* ===== Turnos v4 · Cuadrante admin por personas ===== */
@media (min-width:1100px) {
  body.ramos-page-turnos #desk-cal-cuadrante.hidden {
    display: none !important;
  }

  body.ramos-page-turnos .people-planner-wrap {
    width: 100%;
    overflow: auto;
    max-height: calc(100vh - 210px);
    border-radius: 1.45rem;
    border: 1px solid var(--line);
    background: var(--card);
    box-shadow: 0 12px 28px rgba(15, 23, 42, .055);
    scroll-behavior: smooth;
  }

  body.ramos-page-turnos .people-planner {
    display: grid;
    grid-template-columns: 270px repeat(7, minmax(128px, 1fr));
    min-width: 1166px;
  }

  body.ramos-page-turnos .people-planner-cell {
    min-height: 78px;
    padding: .75rem;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: var(--card);
  }

  body.ramos-page-turnos .people-planner-head {
    position: sticky;
    top: 0;
    z-index: 4;
    background: #f8fafc;
    min-height: 64px;
  }

  body.ramos-page-turnos .people-planner-person {
    position: sticky;
    left: 0;
    z-index: 3;
    background: #fff;
    display: flex;
    align-items: center;
    gap: .7rem;
  }

  body.ramos-page-turnos .people-planner-head.people-planner-person {
    z-index: 6;
    background: #f1f5f9;
  }

  body.ramos-page-turnos .people-avatar {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 900;
    flex-shrink: 0;
  }

  body.ramos-page-turnos .people-shift-chip,
  body.ramos-page-turnos .people-absence-chip {
    display: block;
    width: 100%;
    border-radius: .85rem;
    padding: .45rem .55rem;
    font-size: 9px;
    font-weight: 900;
    line-height: 1.25;
    margin-bottom: .35rem;
    border: 1px solid transparent;
    text-align: left;
  }

  body.ramos-page-turnos .people-shift-chip.linea {
    background: #dbeafe;
    color: #1d4ed8;
    border-color: #bfdbfe;
  }

  body.ramos-page-turnos .people-shift-chip.corte {
    background: #ffedd5;
    color: #c2410c;
    border-color: #fed7aa;
  }

  body.ramos-page-turnos .people-shift-chip.taller {
    background: #f3e8ff;
    color: #7e22ce;
    border-color: #e9d5ff;
  }

  body.ramos-page-turnos .people-shift-chip.mantenimiento {
    background: #dcfce7;
    color: #15803d;
    border-color: #bbf7d0;
  }

  body.ramos-page-turnos .people-shift-chip.colocacion {
    background: #ccfbf1;
    color: #0f766e;
    border-color: #99f6e4;
  }

  body.ramos-page-turnos .people-shift-chip.medicion {
    background: #e0f2fe;
    color: #0369a1;
    border-color: #bae6fd;
  }

  body.ramos-page-turnos .people-shift-chip.comercial {
    background: #fef9c3;
    color: #a16207;
    border-color: #fde68a;
  }

  body.ramos-page-turnos .people-shift-chip.oficina {
    background: #f1f5f9;
    color: #475569;
    border-color: #cbd5e1;
  }

  body.ramos-page-turnos .people-shift-chip.chofer {
    background: #fae8ff;
    color: #a21caf;
    border-color: #f5d0fe;
  }

  body.ramos-page-turnos .people-shift-chip.produccion {
    background: #dbeafe;
    color: #1d4ed8;
    border-color: #bfdbfe;
  }

  body.ramos-page-turnos .people-shift-chip.expedicion {
    background: #e0f2fe;
    color: #0369a1;
    border-color: #bae6fd;
  }

  body.ramos-page-turnos .people-shift-chip.noche {
    background: #e0f2fe;
    color: #0369a1;
    border-color: #bae6fd;
  }

  /* Turno cancelado en cuadrante */
  body.ramos-page-turnos .people-shift-chip.cancelado {
    background: rgba(254, 226, 226, .60) !important;
    color: #b91c1c !important;
    border-color: rgba(239, 68, 68, .30) !important;
    opacity: .65;
    text-decoration: line-through;
  }

  body.ramos-page-turnos .people-shift-chip.cancelado span {
    text-decoration: line-through;
  }

  body.ramos-page-turnos .people-absence-chip {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
  }

  body.ramos-page-turnos .people-absence-chip.baja {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
  }

  body.ramos-page-turnos .people-absence-chip.permiso {
    background: #f3e8ff;
    color: #7e22ce;
    border-color: #e9d5ff;
  }

  body.ramos-page-turnos .people-empty-cell {
    color: #cbd5e1;
    font-size: 16px;
    font-weight: 900;
    opacity: 0;
    transition: opacity .15s;
  }

  body.ramos-page-turnos .people-planner-cell-empty {
    cursor: pointer;
    transition: background .15s;
  }

  body.ramos-page-turnos .people-planner-cell-empty:hover {
    background: #f0fdf4 !important;
  }

  body.ramos-page-turnos .people-planner-cell-empty:hover .people-empty-cell {
    opacity: 1;
    color: #16a34a;
  }

  /* Separador de área: ocupa todas las columnas */
  body.ramos-page-turnos .people-planner-area-header {
    grid-column: 1 / -1;
    padding: .45rem 1rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--line);
    background: #f8fafc;
    position: sticky;
    left: 0;
  }

  body.ramos-page-turnos.dark .people-planner-area-header {
    background: #1a2332;
  }

  /* Avatares coloreados por área */
  body.ramos-page-turnos .people-avatar.produccion,
  body.ramos-page-turnos .people-avatar.linea,
  body.ramos-page-turnos .people-avatar.taller,
  body.ramos-page-turnos .people-avatar.perfiles,
  body.ramos-page-turnos .people-avatar.barrotillo { background: #dbeafe; color: #1d4ed8; }

  body.ramos-page-turnos .people-avatar.corte { background: #ffedd5; color: #c2410c; }
  body.ramos-page-turnos .people-avatar.mantenimiento { background: #dcfce7; color: #15803d; }
  body.ramos-page-turnos .people-avatar.colocacion { background: #ccfbf1; color: #0f766e; }
  body.ramos-page-turnos .people-avatar.medicion { background: #e0f2fe; color: #0369a1; }
  body.ramos-page-turnos .people-avatar.comercial { background: #fef9c3; color: #a16207; }
  body.ramos-page-turnos .people-avatar.oficina { background: #f1f5f9; color: #475569; }
  body.ramos-page-turnos .people-avatar.chofer { background: #fae8ff; color: #a21caf; }
  body.ramos-page-turnos .people-avatar.noche { background: #1e293b; color: #e2e8f0; }
  body.ramos-page-turnos .people-avatar.sin_asignar { background: #f1f5f9; color: #94a3b8; }

  body.ramos-page-turnos.dark .people-planner-wrap,
  body.ramos-page-turnos.dark .people-planner-cell {
    background: var(--card) !important;
    border-color: var(--line) !important;
  }

  body.ramos-page-turnos.dark .people-planner-head {
    background: var(--soft) !important;
  }

  body.ramos-page-turnos.dark .people-planner-person {
    background: #172033 !important;
  }

  body.ramos-page-turnos.dark .people-planner-head.people-planner-person {
    background: var(--soft) !important;
  }

  body.ramos-page-turnos.dark .people-empty-cell {
    color: rgba(148, 163, 184, .45);
  }
}


/* ===== Turnos v5.1 · Cuadrante + listado técnico admin plegado ===== */
@media (min-width:1100px) {
  body.ramos-page-turnos #btn-listado-tecnico {
    min-height: auto !important;
    width: auto !important;
    white-space: nowrap;
    border-radius: 1rem !important;
    box-shadow: 0 10px 22px rgba(15, 23, 42, .06) !important;
  }

  body.ramos-page-turnos #btn-listado-tecnico:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(15, 23, 42, .09) !important;
  }

  body.ramos-page-turnos.dark #btn-listado-tecnico {
    background: var(--soft) !important;
    color: var(--text) !important;
    border-color: var(--line) !important;
  }

  body.ramos-page-turnos #desktop-technical-list-section.hidden {
    display: none !important;
  }
}



/* ===== Turnos v5.3 · filtro específico de área para cuadrante admin ===== */
@media (min-width:1100px) {
  body.ramos-page-turnos .cuadrante-area-filter {
    flex: 0 0 auto;
    min-width: 165px;
    max-width: 210px;
    height: 2.45rem;
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #0f172a;
    padding: .55rem .8rem;
    font-size: 9px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .05em;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .055);
    outline: none;
  }

  body.ramos-page-turnos .cuadrante-area-filter:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
  }

  body.ramos-page-turnos.dark .cuadrante-area-filter {
    background: #172033 !important;
    border-color: var(--line) !important;
    color: var(--text) !important;
  }
}

/* ===== Turnos v5.2 · controles del calendario en una sola fila ===== */
@media (min-width:1100px) {
  body.ramos-page-turnos .desktop-calendar-head-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: .5rem !important;
    flex-wrap: nowrap !important;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    padding-bottom: .1rem;
  }

  body.ramos-page-turnos .desktop-calendar-head-actions::-webkit-scrollbar {
    display: none;
  }

  body.ramos-page-turnos .desktop-calendar-controls {
    flex: 0 0 auto !important;
    flex-wrap: nowrap !important;
    min-width: max-content;
  }

  body.ramos-page-turnos .desktop-calendar-controls .calendar-mode-tabs {
    flex-wrap: nowrap !important;
    min-width: max-content;
  }

  body.ramos-page-turnos .desktop-calendar-controls .calendar-mode-btn {
    white-space: nowrap !important;
    flex: 0 0 auto !important;
    padding: .55rem .68rem !important;
    font-size: 9px !important;
  }

  body.ramos-page-turnos .calendar-nav-btn {
    flex: 0 0 auto !important;
    width: 2.45rem !important;
    height: 2.45rem !important;
  }

  body.ramos-page-turnos #btn-publicar,
  body.ramos-page-turnos #btn-listado-tecnico {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
    min-height: auto !important;
    width: auto !important;
    padding: .7rem .85rem !important;
    font-size: 9px !important;
  }
}

/* En anchos intermedios mantenemos una sola fila; si no cabe, desliza horizontal dentro del header */
@media (min-width:1100px) and (max-width:1320px) {
  body.ramos-page-turnos .desktop-pro-calendar-head {
    align-items: flex-start !important;
  }

  body.ramos-page-turnos .desktop-calendar-head-actions {
    width: 100%;
    justify-content: flex-start !important;
  }
}



/* ===== DRAWER DETALLE IGUALADO A CALIDAD ===== */
body.ramos-page-turnos .side-panel {
  width: min(560px, 94vw) !important;
  max-width: 94vw !important;
  min-height: 100dvh !important;
  max-height: 100dvh !important;
  margin: 0 !important;
  border-radius: 32px 0 0 32px !important;
  background: var(--card) !important;
  color: var(--text) !important;
  border-left: 1px solid var(--line) !important;
  border-top: 0 !important;
  box-shadow: -24px 0 70px rgba(0, 0, 0, .28) !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  transform: translateX(100%) !important;
  transition: transform .28s cubic-bezier(.2, .8, .2, 1), box-shadow .28s ease !important;
}

body.ramos-page-turnos .side-panel.active {
  transform: translateX(0) !important;
}

body.ramos-page-turnos .panel-backdrop {
  background: rgba(15, 23, 42, .42) !important;
}

body.ramos-page-turnos .panel-sticky-head {
  margin: -1.5rem -1.5rem 1.8rem -1.5rem !important;
  padding: max(18px, env(safe-area-inset-top)) 1.5rem 1rem 1.5rem !important;
  background: rgba(255, 255, 255, .94) !important;
  backdrop-filter: blur(16px) !important;
  border-bottom: 1px solid var(--line) !important;
}

body.ramos-page-turnos.dark .panel-sticky-head {
  background: rgba(23, 32, 51, .94) !important;
}

@media (max-width: 1099px) {
  body.ramos-page-turnos .side-panel {
    top: 0 !important;
    right: 0 !important;
    bottom: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    border-left: 0 !important;
    border-top: 0 !important;
    transform: translateX(100%) !important;
  }

  body.ramos-page-turnos .side-panel.active {
    transform: translateX(0) !important;
  }

  body.ramos-page-turnos .panel-sticky-head {
    border-radius: 0 !important;
  }
}


/* =========================================================
       TURNOS · Patrón Calidad real
       - Topbar igual a Calidad
       - KPIs dentro del hero azul
       - Sidebar 260px y cards/controles homogéneos
       - Calendario visual tipo Calidad/Mantenimientos
       Solo estética/estructura: no toca Firebase, colecciones ni JS.
       ========================================================= */
body.ramos-page-turnos * {
  box-sizing: border-box;
}

html,
body.ramos-page-turnos {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none;
}

body.ramos-page-turnos {
  margin: 0;
  background:
    radial-gradient(circle at 0% 0%, rgba(37, 99, 235, .12), transparent 32%),
    radial-gradient(circle at 100% 0%, rgba(37, 99, 235, .10), transparent 30%),
    var(--bg) !important;
  color: var(--text);
  touch-action: pan-y;
}

body.ramos-page-turnos #view-app>header.glass,
body.ramos-page-turnos .glass {
  position: sticky !important;
  top: 0 !important;
  z-index: 40 !important;
  background: rgba(255, 255, 255, .88) !important;
  backdrop-filter: blur(18px) !important;
  border-bottom: 1px solid rgba(15, 23, 42, .06) !important;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .055) !important;
  padding: 0 !important;
}

body.ramos-page-turnos.dark #view-app>header.glass,
body.ramos-page-turnos.dark .glass {
  background: rgba(15, 23, 42, .90) !important;
  border-color: rgba(255, 255, 255, .08) !important;
}

body.ramos-page-turnos .desktop-shell {
  width: min(1480px, calc(100% - 64px)) !important;
  max-width: 1480px !important;
  margin: 0 auto !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

body.ramos-page-turnos .turnos-topbar {
  min-height: 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

body.ramos-page-turnos .turnos-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

body.ramos-page-turnos .app-logo {
  height: 36px !important;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  flex-shrink: 0;
}

body.ramos-page-turnos .turnos-back-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 950;
  flex-shrink: 0;
}

body.ramos-page-turnos.dark .turnos-back-btn {
  background: rgba(255, 255, 255, .08);
  color: #e2e8f0;
}

body.ramos-page-turnos .role-badge {
  font-size: 9px !important;
  font-weight: 950 !important;
  color: var(--primary) !important;
  text-transform: uppercase !important;
  letter-spacing: .12em !important;
  margin: 0 0 2px !important;
}

body.ramos-page-turnos #user-display-name {
  margin: 0;
  font-size: 20px !important;
  font-weight: 950 !important;
  letter-spacing: -.03em !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text) !important;
}

body.ramos-page-turnos .top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

body.ramos-page-turnos .btn {
  border: 0;
  border-radius: 16px !important;
  padding: 13px 16px !important;
  min-height: 44px;
  font-family: inherit;
  font-size: 10px !important;
  font-weight: 950 !important;
  text-transform: uppercase;
  letter-spacing: .08em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
}

body.ramos-page-turnos .btn-soft {
  background: var(--soft) !important;
  color: var(--text) !important;
  border: 1px solid var(--line) !important;
  box-shadow: none !important;
}

body.ramos-page-turnos main.desktop-shell {
  padding: 16px 0 34px !important;
  display: grid;
  gap: 16px;
}

body.ramos-page-turnos .desktop-view.space-y-4>*+* {
  margin-top: 16px !important;
}

body.ramos-page-turnos .turnos-hero,
body.ramos-page-turnos .mobile-hero {
  background:
    radial-gradient(circle at 0% 0%, rgba(37, 99, 235, .22), transparent 36%),
    linear-gradient(135deg, #0f172a 0%, #1e293b 52%, #1d4ed8 100%) !important;
  color: white !important;
  border-radius: 32px !important;
  padding: 20px !important;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .18) !important;
  position: relative;
  overflow: hidden;
  border: 0 !important;
}

body.ramos-page-turnos .turnos-hero:after,
body.ramos-page-turnos .mobile-hero:after {
  content: "";
  position: absolute;
  right: -80px;
  top: -90px;
  width: 230px;
  height: 230px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
}

body.ramos-page-turnos .turnos-hero>*,
body.ramos-page-turnos .mobile-hero>* {
  position: relative;
  z-index: 1;
}

body.ramos-page-turnos .turnos-hero-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: stretch;
  justify-content: space-between;
}

@media (min-width: 1200px) {
  body.ramos-page-turnos .turnos-hero-grid {
    flex-direction: row;
    align-items: center;
  }
}

body.ramos-page-turnos .hero-kicker {
  font-size: 10px !important;
  font-weight: 950 !important;
  text-transform: uppercase !important;
  letter-spacing: .14em !important;
  color: #bfdbfe !important;
  margin: 0 !important;
}

body.ramos-page-turnos .hero-title {
  font-size: clamp(24px, 3vw, 30px) !important;
  line-height: 1.05 !important;
  margin: 4px 0 8px !important;
  font-weight: 950 !important;
  letter-spacing: -.045em !important;
  color: #fff !important;
}

body.ramos-page-turnos .hero-text {
  margin: 0 !important;
  max-width: 760px;
  color: #cbd5e1 !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1.45 !important;
}

body.ramos-page-turnos .turnos-kpi-grid,
body.ramos-page-turnos .kpi-grid.turnos-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: min(520px, 100%);
}

@media (min-width: 760px) {

  body.ramos-page-turnos .turnos-kpi-grid,
  body.ramos-page-turnos .kpi-grid.turnos-kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

body.ramos-page-turnos .turnos-kpi-grid.hidden {
  display: none !important;
}

body.ramos-page-turnos .turnos-kpi-grid .kpi-box,
body.ramos-page-turnos .mobile-stat {
  background: rgba(255, 255, 255, .10) !important;
  border: 1px solid rgba(255, 255, 255, .10) !important;
  border-radius: 18px !important;
  padding: 12px !important;
  min-width: 0;
  box-shadow: none !important;
}

body.ramos-page-turnos .turnos-kpi-grid .kpi-label,
body.ramos-page-turnos .mobile-stat p:first-child {
  font-size: 9px !important;
  font-weight: 950 !important;
  text-transform: uppercase !important;
  letter-spacing: .10em !important;
  color: #bfdbfe !important;
  margin: 0 !important;
  line-height: 1.15 !important;
  min-height: 22px;
}

body.ramos-page-turnos .turnos-kpi-grid .kpi-value,
body.ramos-page-turnos .mobile-stat p:last-child {
  font-size: 26px !important;
  font-weight: 950 !important;
  letter-spacing: -.04em !important;
  margin: 4px 0 0 !important;
  line-height: 1 !important;
  color: #fff !important;
}

body.ramos-page-turnos .turnos-hero-actions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

body.ramos-page-turnos #desktop-admin-header-actions.desktop-admin-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

body.ramos-page-turnos #desktop-admin-header-actions.hidden {
  display: none !important;
}

body.ramos-page-turnos #desktop-admin-header-actions .desktop-header-action {
  min-height: 44px !important;
  border-radius: 16px !important;
  padding: 10px 12px !important;
  background: rgba(255, 255, 255, .10) !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, .16) !important;
  box-shadow: none !important;
}

body.ramos-page-turnos #desktop-admin-header-actions .desktop-header-action h3,
body.ramos-page-turnos #desktop-admin-header-actions .desktop-header-action p {
  color: #fff !important;
}

body.ramos-page-turnos #desktop-admin-header-actions .desktop-header-action p {
  opacity: .74 !important;
}

body.ramos-page-turnos #desktop-admin-header-actions .desktop-header-action .desktop-pro-icon {
  width: 34px !important;
  height: 34px !important;
  border-radius: 14px !important;
}

body.ramos-page-turnos .desktop-pro-layout {
  display: grid !important;
  grid-template-columns: 260px minmax(0, 1fr) !important;
  gap: 16px !important;
  align-items: start;
}

body.ramos-page-turnos .desktop-pro-layout.operario-mode {
  grid-template-columns: 260px minmax(0, 1fr) !important;
}

body.ramos-page-turnos .desktop-pro-sidebar {
  position: sticky !important;
  top: calc(env(safe-area-inset-top) + 84px) !important;
  align-self: start;
  min-width: 0;
}

body.ramos-page-turnos .desktop-pro-right-section,
body.ramos-page-turnos .desktop-pro-main-card,
body.ramos-page-turnos .card,
body.ramos-page-turnos .turno-card,
body.ramos-page-turnos .vacation-card,
body.ramos-page-turnos .mobile-card-pro {
  background: var(--card) !important;
  border: 1px solid var(--line) !important;
  border-radius: 24px !important;
  box-shadow: var(--shadow) !important;
  overflow: hidden;
}

body.ramos-page-turnos .desktop-pro-right-section {
  padding: 14px !important;
}

body.ramos-page-turnos .desktop-pro-right-section>p,
body.ramos-page-turnos .section-kicker,
body.ramos-page-turnos .desktop-pro-calendar-head p:first-child,
body.ramos-page-turnos .desktop-pro-list-head h3 {
  font-size: 10px !important;
  font-weight: 950 !important;
  text-transform: uppercase !important;
  letter-spacing: .12em !important;
  color: var(--primary) !important;
}

body.ramos-page-turnos .desktop-pro-right-section h2,
body.ramos-page-turnos .desktop-pro-right-section h3 {
  font-size: 18px !important;
  font-weight: 950 !important;
  letter-spacing: -.035em !important;
  color: var(--text) !important;
}

body.ramos-page-turnos .desktop-pro-action {
  width: 100%;
  min-height: 58px !important;
  justify-content: flex-start;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 14px !important;
  padding: 12px 14px !important;
  background: var(--card) !important;
  color: var(--text) !important;
  border: 1px solid var(--line) !important;
  box-shadow: none !important;
}

body.ramos-page-turnos .desktop-pro-action.hidden,
body.ramos-page-turnos .desktop-pro-action[hidden],
body.ramos-page-turnos #desktop-btn-nuevo.hidden,
body.ramos-page-turnos #desktop-btn-cuadrante.hidden {
  display: none !important;
}

body.ramos-page-turnos .desktop-pro-action .desktop-pro-icon {
  width: 34px !important;
  height: 34px !important;
  border-radius: 14px !important;
  background: rgba(37, 99, 235, .10) !important;
  color: var(--primary) !important;
  flex-shrink: 0;
}

body.ramos-page-turnos .desktop-pro-action h3 {
  font-size: 11px !important;
  font-weight: 950 !important;
  text-transform: uppercase !important;
  letter-spacing: .05em !important;
  line-height: 1.1 !important;
  color: var(--text) !important;
}

body.ramos-page-turnos .desktop-pro-action p {
  font-size: 9px !important;
  font-weight: 850 !important;
  color: var(--muted) !important;
  text-transform: none !important;
  letter-spacing: .02em !important;
  line-height: 1.1 !important;
}

body.ramos-page-turnos .search-field,
body.ramos-page-turnos .filter-select,
body.ramos-page-turnos .input-field,
body.ramos-page-turnos .cuadrante-area-filter {
  width: 100%;
  border: 1px solid var(--line) !important;
  background: var(--soft) !important;
  border-radius: 16px !important;
  padding: 13px 14px !important;
  outline: none;
  font-family: inherit;
  font-size: 11px !important;
  font-weight: 800 !important;
  color: var(--text) !important;
  min-height: 46px !important;
  box-shadow: none !important;
}

body.ramos-page-turnos .search-field:focus,
body.ramos-page-turnos .filter-select:focus,
body.ramos-page-turnos .input-field:focus,
body.ramos-page-turnos .cuadrante-area-filter:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .10) !important;
  background: var(--card) !important;
}

body.ramos-page-turnos .desktop-pro-calendar-head,
body.ramos-page-turnos .desktop-pro-list-head {
  display: flex !important;
  justify-content: space-between !important;
  align-items: flex-end !important;
  gap: 12px !important;
  padding: 16px !important;
  border-bottom: 1px solid var(--line) !important;
  background: rgba(248, 250, 252, .72) !important;
}

body.ramos-page-turnos.dark .desktop-pro-calendar-head,
body.ramos-page-turnos.dark .desktop-pro-list-head {
  background: rgba(255, 255, 255, .03) !important;
}

body.ramos-page-turnos #calendar-title {
  margin: 3px 0 0 !important;
  font-size: 20px !important;
  font-weight: 950 !important;
  letter-spacing: -.035em !important;
  color: var(--text) !important;
}

body.ramos-page-turnos #period-type-desk,
body.ramos-page-turnos #week-label-desk {
  color: var(--muted) !important;
}

body.ramos-page-turnos .desktop-calendar-head-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 10px !important;
  flex-wrap: wrap !important;
  overflow: visible !important;
}

body.ramos-page-turnos .desktop-calendar-controls {
  min-height: 56px !important;
  border: 1px solid var(--line) !important;
  border-radius: 24px !important;
  background: var(--card) !important;
  display: grid !important;
  grid-template-columns: 46px 1fr 46px !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 6px !important;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .055) !important;
}

body.ramos-page-turnos .calendar-nav-btn {
  width: 42px !important;
  height: 42px !important;
  border: 1px solid var(--line) !important;
  border-radius: 16px !important;
  background: var(--soft) !important;
  color: var(--text) !important;
  font-family: inherit;
  font-size: 24px !important;
  font-weight: 950 !important;
  box-shadow: none !important;
}

body.ramos-page-turnos .calendar-mode-tabs {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 6px !important;
  align-items: center !important;
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
}

body.ramos-page-turnos .calendar-mode-btn {
  min-height: 40px !important;
  border: 0 !important;
  border-radius: 14px !important;
  background: transparent !important;
  color: var(--muted) !important;
  font-family: inherit;
  font-size: 10px !important;
  font-weight: 950 !important;
  text-transform: uppercase !important;
  letter-spacing: .06em !important;
  padding: 8px 10px !important;
  box-shadow: none !important;
}

body.ramos-page-turnos .calendar-mode-btn.active {
  background: #0f172a !important;
  color: #fff !important;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .16) !important;
}

body.ramos-page-turnos.dark .calendar-mode-btn.active {
  background: #38bdf8 !important;
  color: #0f172a !important;
}

/* ===== TURNOS · Mobile calendar grid (modo Cal) ===== */
body.ramos-page-turnos .mob-cal-grid-wrap {
  border-radius: 14px;
  overflow: hidden;
  background: #f8fafc;
}
body.ramos-page-turnos .mob-cal-grid-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: #f1f5f9;
  margin-bottom: 2px;
}
body.ramos-page-turnos .mob-cal-grid-dh {
  text-align: center;
  font-size: 9px;
  font-weight: 900;
  color: #94a3b8;
  padding: 5px 0;
  text-transform: uppercase;
  letter-spacing: .05em;
}
body.ramos-page-turnos .mob-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
body.ramos-page-turnos .mob-cal-cell {
  position: relative;
  min-height: 66px;
  border-radius: 7px;
  padding: 4px 2px 3px;
  border: 1px solid transparent;
  background: #fff;
  cursor: pointer;
  box-sizing: border-box;
  transition: background .1s;
}
body.ramos-page-turnos .mob-cal-cell.empty {
  background: transparent;
  border-color: transparent;
  cursor: default;
}
body.ramos-page-turnos .mob-cal-cell.today {
  border-color: #3b82f6;
  background: #eff6ff;
}
body.ramos-page-turnos .mob-cal-day-num {
  display: block;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: #1e293b;
  line-height: 1;
}
body.ramos-page-turnos .mob-cal-cell.today .mob-cal-day-num {
  color: #1d4ed8;
  font-weight: 700;
}
body.ramos-page-turnos .mob-cal-cell.wknd .mob-cal-day-num {
  color: #94a3b8;
}
body.ramos-page-turnos .mob-cal-shift-chip {
  display: block;
  margin-top: 3px;
  border-radius: 3px;
  font-size: 8px;
  font-weight: 700;
  text-align: center;
  padding: 1px 2px;
  overflow: hidden;
  white-space: nowrap;
  line-height: 1.3;
}
body.ramos-page-turnos .mob-cal-shift-area {
  display: block;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: .03em;
  opacity: .8;
}
body.ramos-page-turnos .mob-cal-abs-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #f59e0b;
  border-radius: 6px 6px 0 0;
}
body.ramos-page-turnos .mob-cal-aus-chip {
  display: block;
  margin-top: 2px;
  border-radius: 3px;
  font-size: 8px;
  font-weight: 900;
  text-align: center;
  padding: 1px 2px;
  background: #fef3c7;
  color: #b45309;
  letter-spacing: .03em;
}
body.ramos-page-turnos .mob-cal-cell.wknd {
  background: #f8fafc;
}
body.ramos-page-turnos .mob-cal-cell.festivo {
  background: #f8fafc;
}
body.ramos-page-turnos .mob-cal-cell.festivo .mob-cal-day-num {
  color: #94a3b8;
}
body.ramos-page-turnos .mob-cal-cell.wknd.festivo {
  background: #f1f5f9;
}

body.ramos-page-turnos #btn-publicar,
body.ramos-page-turnos #btn-listado-tecnico {
  border-radius: 16px !important;
  min-height: 44px !important;
  padding: 13px 16px !important;
  font-size: 10px !important;
  font-weight: 950 !important;
  text-transform: uppercase;
  letter-spacing: .08em;
  box-shadow: none !important;
  width: auto !important;
}

body.ramos-page-turnos #btn-publicar {
  background: #2563eb !important;
  color: #fff !important;
}

body.ramos-page-turnos #btn-listado-tecnico {
  background: var(--soft) !important;
  color: var(--text) !important;
  border: 1px solid var(--line) !important;
}

body.ramos-page-turnos #desktop-calendar.calendar-grid {
  display: grid !important;
  gap: 8px !important;
  padding: 16px !important;
  background: transparent !important;
}

body.ramos-page-turnos .calendar-day {
  min-height: 116px !important;
  background: var(--card) !important;
  border: 1px solid var(--line) !important;
  border-radius: 14px !important;
  padding: 10px !important;
  display: grid;
  align-content: start;
  gap: 7px;
  cursor: pointer;
  box-shadow: none !important;
  transition: transform .12s ease, filter .12s ease, border-color .12s ease;
}

body.ramos-page-turnos .calendar-day:hover {
  transform: translateY(-1px);
  filter: brightness(1.01);
}

body.ramos-page-turnos .calendar-day.month {
  min-height: 116px !important;
}

body.ramos-page-turnos .calendar-day.today {
  border-color: rgba(37, 99, 235, .35) !important;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .045) !important;
  background: var(--card) !important;
}

body.ramos-page-turnos .calendar-day.muted {
  opacity: .42;
}
body.ramos-page-turnos .calendar-day.wknd-festivo {
  background: #f8fafc !important;
}
body.ramos-page-turnos .calendar-day.wknd-festivo .text-xl {
  color: #94a3b8;
}

body.ramos-page-turnos .desktop-day-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
}

body.ramos-page-turnos .day-summary-chip,
body.ramos-page-turnos .calendar-area-count {
  min-width: 22px;
  height: 22px;
  border-radius: 999px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px !important;
  font-weight: 950 !important;
}

body.ramos-page-turnos .calendar-area-group {
  margin-top: 7px !important;
  border-radius: 10px !important;
  padding: 5px 7px !important;
  background: var(--soft) !important;
  border: 1px solid var(--line) !important;
  border-left: 4px solid #2563eb !important;
  font-size: 9px !important;
  font-weight: 900 !important;
  color: var(--text) !important;
}

body.ramos-page-turnos .calendar-area-group.linea {
  border-left-color: #2563eb !important;
}

body.ramos-page-turnos .calendar-area-group.corte {
  border-left-color: #f97316 !important;
}

body.ramos-page-turnos .calendar-area-group.taller {
  border-left-color: #a855f7 !important;
}

body.ramos-page-turnos .calendar-area-group.mantenimiento {
  border-left-color: #16a34a !important;
}

body.ramos-page-turnos .calendar-area-group.colocacion {
  border-left-color: #14b8a6 !important;
}

body.ramos-page-turnos .calendar-area-group.medicion {
  border-left-color: #0ea5e9 !important;
}

body.ramos-page-turnos .calendar-area-group.comercial {
  border-left-color: #eab308 !important;
}

body.ramos-page-turnos .calendar-area-group.oficina {
  border-left-color: #64748b !important;
}

body.ramos-page-turnos .calendar-area-group.chofer {
  border-left-color: #d946ef !important;
}

body.ramos-page-turnos .people-planner {
  grid-template-columns: 260px repeat(7, minmax(128px, 1fr)) !important;
}

body.ramos-page-turnos .people-planner-wrap {
  border-radius: 24px !important;
  border: 1px solid var(--line) !important;
  background: var(--card) !important;
  box-shadow: var(--shadow) !important;
}

@media (max-width: 1199px) {

  body.ramos-page-turnos .desktop-pro-layout,
  body.ramos-page-turnos .desktop-pro-layout.operario-mode {
    grid-template-columns: 1fr !important;
  }

  body.ramos-page-turnos .desktop-pro-sidebar {
    position: static !important;
  }
}

@media (max-width: 899px) {
  body.ramos-page-turnos .desktop-shell {
    width: calc(100% - 32px) !important;
  }

  body.ramos-page-turnos main.desktop-shell {
    padding-top: 14px !important;
    gap: 14px !important;
  }

  body.ramos-page-turnos .turnos-hero,
  body.ramos-page-turnos .mobile-hero {
    margin: 0 !important;
    border-radius: 28px !important;
    padding: 18px 16px !important;
  }

  body.ramos-page-turnos .app-logo {
    height: 30px !important;
  }

  body.ramos-page-turnos #user-display-name {
    font-size: 17px !important;
  }

  body.ramos-page-turnos .top-actions .btn {
    padding: 10px 11px !important;
  }

  body.ramos-page-turnos .mobile-stat {
    padding: 8px 6px !important;
    border-radius: 14px !important;
  }

  body.ramos-page-turnos .mobile-stat p:first-child {
    font-size: 7px !important;
    min-height: 18px;
    letter-spacing: .06em !important;
  }

  body.ramos-page-turnos .mobile-stat p:last-child {
    font-size: 18px !important;
  }
}

@media (max-width: 640px) {
  body.ramos-page-turnos .desktop-shell {
    width: calc(100% - 24px) !important;
  }

  body.ramos-page-turnos .turnos-hero,
  body.ramos-page-turnos .mobile-hero {
    border-radius: 24px !important;
    padding: 18px 16px !important;
  }
}


/* ===== Turnos v6 · Header limpio + acciones/filtros como Calidad ===== */
body.ramos-page-turnos .turnos-hero {
  padding: 20px !important;
  display: block !important;
}

body.ramos-page-turnos .turnos-hero-actions {
  display: none !important;
}

body.ramos-page-turnos .turnos-sidebar-actions {
  display: grid !important;
  gap: 8px !important;
  margin-top: 0 !important;
  overflow: visible !important;
}
/* Badge dentro del borde del card para evitar clipping */
body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-unread-badge {
  top: 8px !important;
  right: 8px !important;
}

body.ramos-page-turnos .turnos-sidebar-actions.hidden {
  display: none !important;
}

body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-header-action,
body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-pro-action {
  width: 100% !important;
  min-height: 58px !important;
  justify-content: flex-start !important;
  text-align: left !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  border-radius: 1.35rem !important;
  padding: 12px 14px !important;
  background: var(--card) !important;
  color: var(--text) !important;
  border: 1px solid var(--line) !important;
  box-shadow: 0 12px 28px rgba(15,23,42,.055) !important;
  transition: transform .16s ease, box-shadow .16s ease !important;
}

body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-header-action h3,
body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-header-action p,
body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-pro-action h3,
body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-pro-action p {
  color: inherit !important;
}

body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-header-action.active,
body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-pro-action.active {
  background: rgba(37, 99, 235, .08) !important;
  border-color: rgba(37, 99, 235, .35) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12), 0 8px 20px rgba(37, 99, 235, .1) !important;
}

body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-header-action p,
body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-pro-action p {
  color: var(--muted) !important;
  opacity: 1 !important;
  font-size: 9px !important;
  font-weight: 850 !important;
  text-transform: none !important;
  letter-spacing: .02em !important;
  line-height: 1.1 !important;
}

body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-pro-icon {
  width: 34px !important;
  height: 34px !important;
  border-radius: 14px !important;
  background: rgba(37, 99, 235, .10) !important;
  color: var(--primary) !important;
  flex-shrink: 0;
}

body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions #desktop-btn-panel-vacaciones .desktop-pro-icon {
  background: rgba(220, 38, 38, .10) !important;
  color: #dc2626 !important;
}

body.ramos-page-turnos .turnos-toolbar,
body.ramos-page-turnos .toolbar.turnos-toolbar {
  padding: 16px !important;
  display: grid !important;
  grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(150px, 190px)) auto !important;
  gap: 10px !important;
  align-items: end !important;
  border-bottom: 1px solid var(--line) !important;
  background: transparent !important;
}

body.ramos-page-turnos .turnos-toolbar label {
  display: grid !important;
  gap: 7px !important;
  font-size: 10px !important;
  font-weight: 950 !important;
  text-transform: uppercase !important;
  letter-spacing: .08em !important;
  color: var(--muted) !important;
}

body.ramos-page-turnos .turnos-toolbar .search-field,
body.ramos-page-turnos .turnos-toolbar .filter-select,
body.ramos-page-turnos .turnos-toolbar .input,
body.ramos-page-turnos .turnos-toolbar .select {
  width: 100% !important;
  border: 1px solid var(--line) !important;
  background: var(--soft) !important;
  border-radius: 16px !important;
  padding: 13px 14px !important;
  outline: none !important;
  font-family: inherit !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  color: var(--text) !important;
  min-height: 46px !important;
  box-shadow: none !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

body.ramos-page-turnos .turnos-toolbar .search-field:focus,
body.ramos-page-turnos .turnos-toolbar .filter-select:focus,
body.ramos-page-turnos .turnos-toolbar .input:focus,
body.ramos-page-turnos .turnos-toolbar .select:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .10) !important;
  background: var(--card) !important;
}

body.ramos-page-turnos .desktop-pro-sidebar .desktop-pro-right-section:empty {
  display: none !important;
}

@media (max-width: 1099px) {

  body.ramos-page-turnos .turnos-toolbar,
  body.ramos-page-turnos .toolbar.turnos-toolbar {
    grid-template-columns: 1fr !important;
  }
}


/* ===== Turnos v3 · Ajuste fino pedido =====
       Filtros antes de controles calendario + acciones laterales uniformes como Calidad.
       Solo CSS/estructura visual; no cambia Firebase ni JS.
    */
@media (min-width: 1100px) {
  body.ramos-page-turnos .desktop-pro-main-card>.toolbar.turnos-toolbar {
    order: 1;
    border-bottom: 1px solid var(--line) !important;
    background: rgba(248, 250, 252, .72) !important;
  }

  body.ramos-page-turnos.dark .desktop-pro-main-card>.toolbar.turnos-toolbar {
    background: rgba(255, 255, 255, .03) !important;
  }

  body.ramos-page-turnos .desktop-pro-main-card>.desktop-pro-calendar-head {
    order: 2;
    border-bottom: 1px solid var(--line) !important;
    background: transparent !important;
  }

  body.ramos-page-turnos .desktop-pro-main-card>#desktop-calendar {
    order: 3;
  }

  body.ramos-page-turnos .desktop-pro-sidebar .desktop-pro-action,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-pro-action,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-header-action {
    width: 100% !important;
    min-height: 58px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    text-align: left !important;
    border-radius: 14px !important;
    padding: 12px 14px !important;
    background: var(--card) !important;
    color: var(--text) !important;
    border: 1px solid var(--line) !important;
    box-shadow: none !important;
    transition: transform .12s ease, filter .12s ease, background .12s ease !important;
  }

  body.ramos-page-turnos .desktop-pro-sidebar .desktop-pro-action:hover,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-pro-action:hover,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-header-action:hover {
    transform: translateY(-1px) !important;
    filter: brightness(1.01) !important;
  }

  body.ramos-page-turnos .desktop-pro-sidebar .desktop-pro-action .desktop-pro-icon,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-pro-icon {
    width: 34px !important;
    height: 34px !important;
    border-radius: 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    font-size: 15px !important;
  }

  body.ramos-page-turnos .desktop-pro-sidebar .desktop-pro-action h3,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-pro-action h3,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-header-action h3 {
    font-size: 11px !important;
    font-weight: 950 !important;
    text-transform: uppercase !important;
    letter-spacing: .05em !important;
    line-height: 1.1 !important;
    color: var(--text) !important;
    margin: 0 !important;
    white-space: normal !important;
  }

  body.ramos-page-turnos .desktop-pro-sidebar .desktop-pro-action p,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-pro-action p,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-header-action p {
    font-size: 9px !important;
    font-weight: 850 !important;
    color: var(--muted) !important;
    text-transform: none !important;
    letter-spacing: .02em !important;
    line-height: 1.1 !important;
    opacity: 1 !important;
    margin: 2px 0 0 !important;
    white-space: normal !important;
  }

  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions {
    display: grid !important;
    gap: 12px !important;
    margin: 0 !important;
    width: 100% !important;
  }

  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions.hidden {
    display: none !important;
  }
}


/* ===== Turnos v4 · columna izquierda ordenada y uniforme ===== */
@media (min-width:1100px) {
  body.ramos-page-turnos .turnos-actions-list {
    display: grid !important;
    gap: .75rem !important;
  }

  body.ramos-page-turnos .turnos-sidebar-actions {
    display: grid !important;
    gap: .75rem !important;
  }

  body.ramos-page-turnos .turnos-sidebar-actions.hidden {
    display: none !important;
  }

  body.ramos-page-turnos .turnos-action-card,
  body.ramos-page-turnos .turnos-sidebar-actions .turnos-action-card {
    width: 100% !important;
    min-height: 76px !important;
    padding: 1rem !important;
    border-radius: 1.35rem !important;
    display: flex !important;
    align-items: center !important;
    gap: .85rem !important;
    background: var(--card) !important;
    color: var(--text) !important;
    border: 1px solid var(--line) !important;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .055) !important;
    text-align: left !important;
  }

  body.ramos-page-turnos .turnos-action-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 36px rgba(15, 23, 42, .08) !important;
  }

  body.ramos-page-turnos .turnos-action-card .desktop-pro-icon {
    width: 42px !important;
    height: 42px !important;
    border-radius: 1rem !important;
    flex: 0 0 42px !important;
  }

  body.ramos-page-turnos .turnos-action-card h3 {
    font-size: .875rem !important;
    line-height: 1.1 !important;
    white-space: normal !important;
    color: var(--text) !important;
  }

  body.ramos-page-turnos .turnos-action-card p {
    font-size: 10px !important;
    line-height: 1.15 !important;
    color: var(--muted) !important;
    white-space: normal !important;
  }

  body.ramos-page-turnos.dark .turnos-action-card {
    background: var(--card) !important;
    color: var(--text) !important;
    border-color: var(--line) !important;
    box-shadow: var(--shadow) !important;
  }

  body.ramos-page-turnos.dark .turnos-action-card h3 {
    color: var(--text) !important;
  }

  body.ramos-page-turnos.dark .turnos-action-card p {
    color: var(--muted) !important;
  }
}


/* ===== Turnos v5 · Columna izquierda realmente uniforme =====
   Corrige la diferencia de ancho/color en Enviar mensaje, Mensajes enviados y Revisar ausencias.
   No toca Firebase ni funciones JS.
*/
@media (min-width:1100px) {
  body.ramos-page-turnos .turnos-actions-list {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    width: 100% !important;
    align-items: stretch !important;
  }

  body.ramos-page-turnos .turnos-actions-list>button {
    width: 100% !important;
    margin: 0 !important;
  }

  /* El contenedor de acciones admin no debe crear una subcolumna más estrecha */
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions:not(.hidden) {
    display: contents !important;
  }

  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions.hidden {
    display: none !important;
  }

  body.ramos-page-turnos .turnos-actions-list .turnos-action-card,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .turnos-action-card,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-header-action,
  body.ramos-page-turnos #desktop-admin-header-actions #desktop-btn-mensaje,
  body.ramos-page-turnos #desktop-admin-header-actions #desktop-btn-mensajes-admin,
  body.ramos-page-turnos #desktop-admin-header-actions #desktop-btn-panel-vacaciones {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 92px !important;
    height: auto !important;
    margin: 0 !important;
    padding: 18px 20px !important;
    border-radius: 28px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 18px !important;
    text-align: left !important;
    background: var(--card) !important;
    color: var(--text) !important;
    border: 1px solid var(--line) !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  body.ramos-page-turnos .turnos-actions-list .turnos-action-card:hover,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .turnos-action-card:hover {
    transform: translateY(-1px) !important;
    filter: brightness(1.01) !important;
  }

  body.ramos-page-turnos .turnos-actions-list .turnos-action-card .desktop-pro-icon,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .turnos-action-card .desktop-pro-icon,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-header-action .desktop-pro-icon,
  body.ramos-page-turnos #desktop-admin-header-actions #desktop-btn-mensaje .desktop-pro-icon,
  body.ramos-page-turnos #desktop-admin-header-actions #desktop-btn-mensajes-admin .desktop-pro-icon,
  body.ramos-page-turnos #desktop-admin-header-actions #desktop-btn-panel-vacaciones .desktop-pro-icon {
    width: 68px !important;
    height: 68px !important;
    min-width: 68px !important;
    flex: 0 0 68px !important;
    border-radius: 28px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #eef4ff !important;
    color: #2563eb !important;
    font-size: 22px !important;
    font-weight: 950 !important;
    box-shadow: none !important;
  }

  /* Revisar ausencias mantiene aviso en el icono, pero la caja es igual */
  body.ramos-page-turnos #desktop-admin-header-actions #desktop-btn-panel-vacaciones .desktop-pro-icon {
    background: #fee2e2 !important;
    color: #dc2626 !important;
  }

  body.ramos-page-turnos .turnos-actions-list .turnos-action-card>div:last-child,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .turnos-action-card>div:last-child {
    min-width: 0 !important;
    flex: 1 1 auto !important;
  }

  body.ramos-page-turnos .turnos-actions-list .turnos-action-card h3,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .turnos-action-card h3,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-header-action h3,
  body.ramos-page-turnos #desktop-admin-header-actions #desktop-btn-mensaje h3,
  body.ramos-page-turnos #desktop-admin-header-actions #desktop-btn-mensajes-admin h3,
  body.ramos-page-turnos #desktop-admin-header-actions #desktop-btn-panel-vacaciones h3 {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 22px !important;
    line-height: 1.05 !important;
    font-weight: 950 !important;
    letter-spacing: -.02em !important;
    text-transform: uppercase !important;
    color: var(--text) !important;
    white-space: normal !important;
  }

  body.ramos-page-turnos .turnos-actions-list .turnos-action-card p,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .turnos-action-card p,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-header-action p,
  body.ramos-page-turnos #desktop-admin-header-actions #desktop-btn-mensaje p,
  body.ramos-page-turnos #desktop-admin-header-actions #desktop-btn-mensajes-admin p,
  body.ramos-page-turnos #desktop-admin-header-actions #desktop-btn-panel-vacaciones p {
    margin: 4px 0 0 !important;
    padding: 0 !important;
    font-size: 15px !important;
    line-height: 1.15 !important;
    font-weight: 900 !important;
    letter-spacing: -.01em !important;
    text-transform: none !important;
    color: var(--muted) !important;
    opacity: 1 !important;
    white-space: normal !important;
  }

  body.ramos-page-turnos.dark .turnos-actions-list .turnos-action-card,
  body.ramos-page-turnos.dark #desktop-admin-header-actions.turnos-sidebar-actions .turnos-action-card,
  body.ramos-page-turnos.dark #desktop-admin-header-actions.turnos-sidebar-actions .desktop-header-action {
    background: var(--card) !important;
    color: var(--text) !important;
    border-color: var(--line) !important;
    box-shadow: var(--shadow) !important;
  }

  body.ramos-page-turnos.dark .turnos-actions-list .turnos-action-card h3,
  body.ramos-page-turnos.dark #desktop-admin-header-actions.turnos-sidebar-actions .turnos-action-card h3,
  body.ramos-page-turnos.dark #desktop-admin-header-actions.turnos-sidebar-actions .desktop-header-action h3 {
    color: var(--text) !important;
  }

  body.ramos-page-turnos.dark .turnos-actions-list .turnos-action-card p,
  body.ramos-page-turnos.dark #desktop-admin-header-actions.turnos-sidebar-actions .turnos-action-card p,
  body.ramos-page-turnos.dark #desktop-admin-header-actions.turnos-sidebar-actions .desktop-header-action p {
    color: var(--muted) !important;
  }
}



/* ===== Turnos v6 · columna izquierda igualada a Calidad (compacta) =====
   Corrige el tamaño excesivo de V5. Mantiene orden y lógica existente.
*/
@media (min-width:1100px) {
  body.ramos-page-turnos .desktop-pro-sidebar .desktop-pro-right-section {
    border-radius: 24px !important;
    padding: 14px !important;
    box-shadow: var(--shadow) !important;
    border: 1px solid var(--line) !important;
    background: var(--card) !important;
  }

  body.ramos-page-turnos .desktop-pro-sidebar .desktop-pro-right-section>p {
    font-size: 10px !important;
    font-weight: 950 !important;
    text-transform: uppercase !important;
    letter-spacing: .08em !important;
    color: var(--muted) !important;
    margin: 0 0 12px !important;
    padding: 0 4px !important;
  }

  body.ramos-page-turnos .desktop-pro-sidebar .desktop-pro-right-section>h2 {
    display: none !important;
  }

  body.ramos-page-turnos .turnos-actions-list {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    width: 100% !important;
    margin-top: 0 !important;
    align-items: stretch !important;
  }

  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions:not(.hidden) {
    display: contents !important;
  }

  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions.hidden {
    display: none !important;
  }

  body.ramos-page-turnos .turnos-actions-list .turnos-action-card,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .turnos-action-card,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-header-action,
  body.ramos-page-turnos #desktop-admin-header-actions #desktop-btn-mensaje,
  body.ramos-page-turnos #desktop-admin-header-actions #desktop-btn-mensajes-admin,
  body.ramos-page-turnos #desktop-admin-header-actions #desktop-btn-panel-vacaciones {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 58px !important;
    height: auto !important;
    margin: 0 !important;
    padding: 12px 14px !important;
    border-radius: 14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    text-align: left !important;
    background: var(--card) !important;
    color: var(--text) !important;
    border: 1px solid var(--line) !important;
    box-shadow: none !important;
    overflow: hidden !important;
    transform: none !important;
  }

  body.ramos-page-turnos .turnos-actions-list .turnos-action-card:hover,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .turnos-action-card:hover,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-header-action:hover {
    transform: translateY(-1px) !important;
    filter: brightness(1.01) !important;
    box-shadow: none !important;
  }

  body.ramos-page-turnos .turnos-actions-list .turnos-action-card .desktop-pro-icon,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .turnos-action-card .desktop-pro-icon,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-header-action .desktop-pro-icon,
  body.ramos-page-turnos #desktop-admin-header-actions #desktop-btn-mensaje .desktop-pro-icon,
  body.ramos-page-turnos #desktop-admin-header-actions #desktop-btn-mensajes-admin .desktop-pro-icon,
  body.ramos-page-turnos #desktop-admin-header-actions #desktop-btn-panel-vacaciones .desktop-pro-icon {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    flex: 0 0 34px !important;
    border-radius: 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(37, 99, 235, .10) !important;
    color: #2563eb !important;
    font-size: 15px !important;
    font-weight: 950 !important;
    box-shadow: none !important;
  }

  body.ramos-page-turnos #desktop-admin-header-actions #desktop-btn-panel-vacaciones .desktop-pro-icon {
    background: rgba(220, 38, 38, .10) !important;
    color: #dc2626 !important;
  }

  body.ramos-page-turnos .turnos-actions-list .turnos-action-card>div:last-child,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .turnos-action-card>div:last-child,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-header-action>div:last-child {
    min-width: 0 !important;
    flex: 1 1 auto !important;
  }

  body.ramos-page-turnos .turnos-actions-list .turnos-action-card h3,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .turnos-action-card h3,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-header-action h3,
  body.ramos-page-turnos #desktop-admin-header-actions #desktop-btn-mensaje h3,
  body.ramos-page-turnos #desktop-admin-header-actions #desktop-btn-mensajes-admin h3,
  body.ramos-page-turnos #desktop-admin-header-actions #desktop-btn-panel-vacaciones h3 {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 11px !important;
    line-height: 1.1 !important;
    font-weight: 950 !important;
    letter-spacing: .05em !important;
    text-transform: uppercase !important;
    color: var(--text) !important;
    white-space: normal !important;
  }

  body.ramos-page-turnos .turnos-actions-list .turnos-action-card p,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .turnos-action-card p,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-header-action p,
  body.ramos-page-turnos #desktop-admin-header-actions #desktop-btn-mensaje p,
  body.ramos-page-turnos #desktop-admin-header-actions #desktop-btn-mensajes-admin p,
  body.ramos-page-turnos #desktop-admin-header-actions #desktop-btn-panel-vacaciones p {
    margin: 2px 0 0 !important;
    padding: 0 !important;
    font-size: 9px !important;
    line-height: 1.1 !important;
    font-weight: 850 !important;
    letter-spacing: .02em !important;
    text-transform: none !important;
    color: var(--muted) !important;
    opacity: 1 !important;
    white-space: normal !important;
  }

  body.ramos-page-turnos.dark .turnos-actions-list .turnos-action-card,
  body.ramos-page-turnos.dark #desktop-admin-header-actions.turnos-sidebar-actions .turnos-action-card,
  body.ramos-page-turnos.dark #desktop-admin-header-actions.turnos-sidebar-actions .desktop-header-action {
    background: var(--card) !important;
    color: var(--text) !important;
    border-color: var(--line) !important;
    box-shadow: none !important;
  }

  body.ramos-page-turnos.dark .turnos-actions-list .turnos-action-card .desktop-pro-icon,
  body.ramos-page-turnos.dark #desktop-admin-header-actions.turnos-sidebar-actions .turnos-action-card .desktop-pro-icon,
  body.ramos-page-turnos.dark #desktop-admin-header-actions.turnos-sidebar-actions .desktop-header-action .desktop-pro-icon {
    background: rgba(56, 189, 248, .12) !important;
    color: #38bdf8 !important;
  }

  body.ramos-page-turnos.dark #desktop-admin-header-actions #desktop-btn-panel-vacaciones .desktop-pro-icon {
    background: rgba(248, 113, 113, .14) !important;
    color: #f87171 !important;
  }
}


/* =========================================================
   ESTILOS ORIGINALES ESCOPADOS · USUARIOS
   ========================================================= */

body.ramos-page-usuarios.dark {
  --bg: #0f172a;
  --card: #172033;
  --text: #eff6ff;
  --muted: #94a3b8;
  --line: rgba(255, 255, 255, .10);
  --soft: #111827;
  --primary: #38bdf8;
  --shadow: 0 14px 34px rgba(0, 0, 0, .24);
}

body.ramos-page-usuarios {
  font-family: "Plus Jakarta Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
}

body.ramos-page-usuarios .glass {
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(226, 232, 240, .9);
}

body.ramos-page-usuarios .app-logo {
  height: 34px;
  max-width: 140px;
  object-fit: contain;
  display: block;
}

body.ramos-page-usuarios .shell {
  max-width: 1180px;
  margin: 0 auto;
}

body.ramos-page-usuarios .card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1.5rem;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .045);
}

body.ramos-page-usuarios .input-field {
  width: 100%;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 1rem;
  padding: .85rem 1rem;
  outline: none;
  font-weight: 800;
  color: #0f172a;
}

body.ramos-page-usuarios .input-field:focus {
  background: white;
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .1);
}

body.ramos-page-usuarios .filter-select {
  width: 100%;
  border: 1px solid #e2e8f0;
  background: white;
  border-radius: .9rem;
  padding: .72rem .8rem;
  outline: none;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #64748b;
}

body.ramos-page-usuarios .switch {
  width: 46px;
  height: 26px;
  background: #cbd5e1;
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: .18s ease;
}

body.ramos-page-usuarios .switch::after {
  content: "";
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: .18s ease;
  box-shadow: 0 2px 7px rgba(15, 23, 42, .18);
}

body.ramos-page-usuarios .switch.active {
  background: #22c55e;
}

body.ramos-page-usuarios .switch.active::after {
  left: 23px;
}

body.ramos-page-usuarios .pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .28rem .55rem;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
}

body.ramos-page-usuarios .btn-primary {
  background: #2563eb;
  color: white;
  border-radius: 1rem;
  padding: .9rem 1rem;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
  box-shadow: 0 10px 24px rgba(37, 99, 235, .18);
}

body.ramos-page-usuarios .btn-dark {
  background: #0f172a;
  color: white;
  border-radius: 1rem;
  padding: .9rem 1rem;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}

body.ramos-page-usuarios .btn-soft {
  background: #f1f5f9;
  color: #334155;
  border-radius: 1rem;
  padding: .8rem .9rem;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
}

body.ramos-page-usuarios .btn-danger {
  background: #dc2626;
  color: white;
  border-radius: 1rem;
  padding: .9rem 1rem;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
  box-shadow: 0 10px 24px rgba(220, 38, 38, .18);
}

body.ramos-page-usuarios .btn-warning {
  background: #f97316;
  color: white;
  border-radius: 1rem;
  padding: .9rem 1rem;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
  box-shadow: 0 10px 24px rgba(249, 115, 22, .18);
}

body.ramos-page-usuarios .maintenance-result {
  white-space: pre-line;
  border-radius: 1rem;
  padding: .9rem 1rem;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.45;
}


body.ramos-page-usuarios .stat-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 1.35rem;
  padding: 1rem;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .045);
}

body.ramos-page-usuarios .user-row {
  transition: .15s ease;
}

body.ramos-page-usuarios .user-row:hover {
  background: #f8fafc;
}

body.ramos-page-usuarios .desktop-table-wrap {
  overflow: auto;
  max-height: calc(100vh - 330px);
}

body.ramos-page-usuarios .desktop-table thead th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 5;
}

body.ramos-page-usuarios .mobile-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 1.5rem;
  padding: 1rem;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .055);
}

body.ramos-page-usuarios .desktop-view {
  display: none;
}

body.ramos-page-usuarios .mobile-view {
  display: block;
}

@media (min-width: 900px) {
  body.ramos-page-usuarios {
    font-size: 14px;
  }

  body.ramos-page-usuarios .desktop-view {
    display: block;
  }

  body.ramos-page-usuarios .mobile-view {
    display: none;
  }
}

body.ramos-page-usuarios .modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 42, .66);
  align-items: flex-end;
  padding: 1rem;
}

body.ramos-page-usuarios .modal.active {
  display: flex;
}

@media (min-width: 900px) {
  body.ramos-page-usuarios .modal {
    align-items: center;
  }
}

body.ramos-page-usuarios.dark .glass {
  background: rgba(15, 23, 42, .90);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

body.ramos-page-usuarios.dark .card,
body.ramos-page-usuarios.dark .stat-card,
body.ramos-page-usuarios.dark .mobile-card,
body.ramos-page-usuarios.dark .bg-white {
  background: var(--card) !important;
  color: var(--text);
  border-color: var(--line) !important;
  box-shadow: var(--shadow);
}

body.ramos-page-usuarios.dark .input-field,
body.ramos-page-usuarios.dark .filter-select {
  background: var(--soft) !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
}

body.ramos-page-usuarios.dark .desktop-table thead th {
  background: var(--soft);
}

body.ramos-page-usuarios.dark .user-row:hover {
  background: rgba(255, 255, 255, .05);
}

body.ramos-page-usuarios.dark .text-slate-900,
body.ramos-page-usuarios.dark .text-slate-800,
body.ramos-page-usuarios.dark .text-slate-700,
body.ramos-page-usuarios.dark .text-slate-600,
body.ramos-page-usuarios.dark .text-slate-500,
body.ramos-page-usuarios.dark .text-slate-400 {
  color: var(--text) !important;
}

body.ramos-page-usuarios.dark .text-slate-300 {
  color: var(--muted) !important;
}

body.ramos-page-usuarios.dark .bg-slate-50,
body.ramos-page-usuarios.dark .bg-slate-100 {
  background: var(--soft) !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
}

body.ramos-page-usuarios.dark .border-slate-100,
body.ramos-page-usuarios.dark .border-slate-200 {
  border-color: var(--line) !important;
}

body.ramos-page-usuarios.dark .pill.bg-slate-100 {
  background: rgba(255, 255, 255, .08) !important;
  color: #cbd5e1 !important;
}

body.ramos-page-usuarios.dark #loader {
  background: var(--bg) !important;
  color: var(--text);
}

/* ===== Usuarios PRO layout ===== */
body.ramos-page-usuarios .usuarios-pro-shell {
  max-width: 1480px;
  margin: 0 auto;
}

body.ramos-page-usuarios .usuarios-pro-hero {
  background:
    radial-gradient(circle at 0% 0%, rgba(37, 99, 235, .22), transparent 34%),
    linear-gradient(135deg, #0f172a 0%, #1e293b 54%, #1d4ed8 100%);
  color: white;
  border-radius: 2rem;
  padding: 1.25rem;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .18);
  overflow: hidden;
  position: relative;
}

body.ramos-page-usuarios .usuarios-pro-hero:after {
  content: "";
  position: absolute;
  right: -80px;
  top: -90px;
  width: 230px;
  height: 230px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
}

body.ramos-page-usuarios .usuarios-pro-hero>* {
  position: relative;
  z-index: 1;
}

body.ramos-page-usuarios .usuarios-pro-layout {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

body.ramos-page-usuarios .usuarios-pro-side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

body.ramos-page-usuarios .usuarios-pro-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

body.ramos-page-usuarios .action-tile {
  width: 100%;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 1.45rem;
  padding: .95rem;
  text-align: left;
  display: flex;
  align-items: center;
  gap: .8rem;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .055);
  transition: .16s ease;
}

body.ramos-page-usuarios .action-tile:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(15, 23, 42, .08);
}

body.ramos-page-usuarios .action-icon {
  width: 42px;
  height: 42px;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 900;
  font-size: 18px;
  flex-shrink: 0;
}

body.ramos-page-usuarios .action-tile strong {
  display: block;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #0f172a;
}

body.ramos-page-usuarios .action-tile span {
  display: block;
  font-size: 10px;
  font-weight: 800;
  color: #64748b;
  margin-top: .15rem;
  line-height: 1.2;
}

body.ramos-page-usuarios .stat-card.pro {
  border-radius: 1.55rem;
  position: relative;
  overflow: hidden;
}

body.ramos-page-usuarios .stat-card.pro:after {
  content: "";
  position: absolute;
  right: -32px;
  top: -32px;
  width: 92px;
  height: 92px;
  border-radius: 999px;
  background: rgba(37, 99, 235, .09);
}

body.ramos-page-usuarios .stat-card.pro.green:after {
  background: rgba(16, 185, 129, .11);
}

body.ramos-page-usuarios .stat-card.pro.amber:after {
  background: rgba(245, 158, 11, .13);
}

body.ramos-page-usuarios .stat-card.pro.red:after {
  background: rgba(239, 68, 68, .10);
}

body.ramos-page-usuarios .section-head-pro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: .75rem;
  padding: 1rem 1rem .85rem;
  border-bottom: 1px solid #e2e8f0;
}

body.ramos-page-usuarios .section-head-pro h3 {
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: -.02em;
  color: #0f172a;
}

body.ramos-page-usuarios .section-head-pro p {
  font-size: 10px;
  font-weight: 900;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .08em;
}

body.ramos-page-usuarios .compact-help {
  font-size: 10px;
  line-height: 1.35;
  color: #64748b;
  font-weight: 800;
}

@media (max-width: 1099px) {
  body.ramos-page-usuarios .usuarios-pro-shell {
    max-width: 760px;
  }

  body.ramos-page-usuarios .usuarios-pro-layout {
    grid-template-columns: 1fr;
  }

  body.ramos-page-usuarios .usuarios-pro-side {
    order: 2;
  }

  body.ramos-page-usuarios .usuarios-pro-main {
    order: 1;
  }
}

@media (max-width: 899px) {
  body.ramos-page-usuarios .usuarios-pro-hero {
    border-radius: 0 0 2rem 2rem;
    margin: -1rem -1rem 0;
  }

  body.ramos-page-usuarios .usuarios-pro-side {
    display: none;
  }

  body.ramos-page-usuarios .usuarios-pro-layout {
    display: block;
  }

  body.ramos-page-usuarios .usuarios-pro-mobile-tools {
    display: grid !important;
  }
}

body.ramos-page-usuarios .usuarios-pro-mobile-tools {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: .65rem;
}

body.ramos-page-usuarios.dark .usuarios-pro-hero {
  box-shadow: 0 18px 45px rgba(0, 0, 0, .25);
}

body.ramos-page-usuarios.dark .action-tile {
  background: var(--card) !important;
  border-color: var(--line) !important;
  color: var(--text);
}

body.ramos-page-usuarios.dark .action-tile strong {
  color: var(--text);
}

body.ramos-page-usuarios.dark .action-tile span,
body.ramos-page-usuarios.dark .compact-help,
body.ramos-page-usuarios.dark .section-head-pro p {
  color: var(--muted);
}

body.ramos-page-usuarios.dark .section-head-pro,
body.ramos-page-usuarios.dark .section-head-pro h3 {
  color: var(--text);
  border-color: var(--line);
}

body.ramos-page-usuarios .users-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: .85rem;
  padding: 1rem;
}

body.ramos-page-usuarios .user-access-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 1.6rem;
  padding: 1rem;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .055);
  transition: .16s ease;
}

body.ramos-page-usuarios .user-access-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 38px rgba(15, 23, 42, .085);
}

body.ramos-page-usuarios .user-app-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
}

body.ramos-page-usuarios .user-app-perm {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: .55rem .65rem;
}

body.ramos-page-usuarios .user-app-perm span {
  font-size: 10px;
  font-weight: 900;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: .04em;
}

body.ramos-page-usuarios .mini-switch {
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: #cbd5e1;
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
  transition: .16s ease;
}

body.ramos-page-usuarios .mini-switch:after {
  content: "";
  position: absolute;
  width: 15px;
  height: 15px;
  top: 2.5px;
  left: 3px;
  border-radius: 999px;
  background: white;
  box-shadow: 0 2px 6px rgba(15, 23, 42, .22);
  transition: .16s ease;
}

body.ramos-page-usuarios .mini-switch.active {
  background: #22c55e;
}

body.ramos-page-usuarios .mini-switch.active:after {
  left: 16px;
}

body.ramos-page-usuarios.dark .user-access-card,
body.ramos-page-usuarios.dark .user-app-perm {
  background: var(--card) !important;
  border-color: var(--line) !important;
}

body.ramos-page-usuarios.dark .user-app-perm span {
  color: var(--text);
}



/* ===== iPhone notch safe area ===== */
@supports (padding: max(0px)) {
  body.ramos-page-usuarios {
    padding-top: env(safe-area-inset-top);
  }
}



/* USUARIOS · Patrón Calidad: solo estética/estructura visual */
body.ramos-page-usuarios * {
  box-sizing: border-box
}

html,
body.ramos-page-usuarios {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none
}

body.ramos-page-usuarios {
  margin: 0;
  background: radial-gradient(circle at 0% 0%, rgba(37, 99, 235, .12), transparent 32%), radial-gradient(circle at 100% 0%, rgba(37, 99, 235, .10), transparent 30%), var(--bg) !important;
  touch-action: pan-y
}

body.ramos-page-usuarios .shell,
body.ramos-page-usuarios .usuarios-pro-shell {
  width: min(1480px, 100%) !important;
  max-width: 1480px !important;
  margin: 0 auto !important;
  padding-left: 16px;
  padding-right: 16px
}

body.ramos-page-usuarios .glass {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, .88) !important;
  backdrop-filter: blur(18px) !important;
  border-bottom: 1px solid rgba(15, 23, 42, .06) !important;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .055) !important
}

body.ramos-page-usuarios.dark .glass {
  background: rgba(15, 23, 42, .90) !important;
  border-color: rgba(255, 255, 255, .08) !important
}

body.ramos-page-usuarios .usuarios-pro-hero {
  border-radius: 32px !important;
  padding: 20px !important;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .18) !important
}

body.ramos-page-usuarios .hero-grid,
body.ramos-page-usuarios .usuarios-hero-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: stretch;
  justify-content: space-between
}

@media (min-width:1200px) {

  body.ramos-page-usuarios .hero-grid,
  body.ramos-page-usuarios .usuarios-hero-grid {
    flex-direction: row;
    align-items: center
  }
}

body.ramos-page-usuarios .hero-kicker {
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: #bfdbfe;
  margin: 0
}

body.ramos-page-usuarios .hero-title {
  font-size: clamp(24px, 3vw, 30px);
  line-height: 1.05;
  margin: 4px 0 8px;
  font-weight: 950;
  letter-spacing: -.045em;
  color: #fff
}

body.ramos-page-usuarios .hero-text {
  margin: 0;
  max-width: 760px;
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45
}

body.ramos-page-usuarios .kpi-grid,
body.ramos-page-usuarios .usuarios-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: min(640px, 100%)
}

@media (min-width:760px) {

  body.ramos-page-usuarios .kpi-grid,
  body.ramos-page-usuarios .usuarios-kpi-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr))
  }
}

body.ramos-page-usuarios .kpi-box {
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 18px;
  padding: 10px 12px;
  min-width: 0
}

body.ramos-page-usuarios .kpi-label {
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .10em;
  color: #bfdbfe;
  margin: 0;
  line-height: 1.15;
  min-height: 22px
}

body.ramos-page-usuarios .kpi-value {
  font-size: 24px;
  font-weight: 950;
  letter-spacing: -.04em;
  margin: 4px 0 0;
  line-height: 1;
  color: #fff !important
}

body.ramos-page-usuarios .usuarios-pro-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) !important;
  gap: 16px !important;
  align-items: start
}

body.ramos-page-usuarios .usuarios-pro-side {
  position: sticky;
  top: calc(env(safe-area-inset-top) + 84px);
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0
}

body.ramos-page-usuarios .usuarios-pro-main {
  min-width: 0;
  display: grid;
  gap: 16px
}

body.ramos-page-usuarios .card,
body.ramos-page-usuarios .side-card {
  background: var(--card) !important;
  border: 1px solid var(--line) !important;
  border-radius: 24px !important;
  box-shadow: var(--shadow) !important;
  overflow: hidden
}

body.ramos-page-usuarios .section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 250, 252, .72)
}

body.ramos-page-usuarios.dark .section-head {
  background: rgba(255, 255, 255, .03)
}

body.ramos-page-usuarios .section-kicker {
  margin: 0;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--primary)
}

body.ramos-page-usuarios .section-title {
  margin: 3px 0 0;
  font-size: 20px;
  font-weight: 950;
  letter-spacing: -.035em;
  color: var(--text)
}

body.ramos-page-usuarios .section-help {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35
}

body.ramos-page-usuarios .toolbar.usuarios-toolbar {
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(150px, 190px));
  gap: 10px;
  align-items: end;
  border-bottom: 1px solid var(--line)
}

body.ramos-page-usuarios label {
  display: grid;
  gap: 7px;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted)
}

body.ramos-page-usuarios .input,
body.ramos-page-usuarios .select,
body.ramos-page-usuarios .input-field,
body.ramos-page-usuarios .filter-select {
  width: 100%;
  border: 1px solid var(--line) !important;
  background: var(--soft) !important;
  border-radius: 16px !important;
  padding: 13px 14px !important;
  outline: none;
  font-family: inherit;
  font-size: 11px !important;
  font-weight: 800 !important;
  color: var(--text) !important;
  min-height: 46px;
  text-transform: none;
  letter-spacing: 0
}

body.ramos-page-usuarios .input:focus,
body.ramos-page-usuarios .select:focus,
body.ramos-page-usuarios .input-field:focus,
body.ramos-page-usuarios .filter-select:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .10) !important;
  background: var(--card) !important
}

body.ramos-page-usuarios .btn,
body.ramos-page-usuarios .btn-primary,
body.ramos-page-usuarios .btn-dark,
body.ramos-page-usuarios .btn-soft,
body.ramos-page-usuarios .btn-danger,
body.ramos-page-usuarios .btn-warning {
  border: 0;
  border-radius: 16px !important;
  padding: 13px 16px;
  min-height: 44px;
  font-family: inherit;
  font-size: 10px !important;
  font-weight: 950 !important;
  text-transform: uppercase;
  letter-spacing: .08em !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap
}

body.ramos-page-usuarios .btn-primary {
  background: #2563eb !important;
  color: white !important;
  box-shadow: 0 10px 24px rgba(37, 99, 235, .18) !important
}

body.ramos-page-usuarios .btn-dark {
  background: #0f172a !important;
  color: white !important
}

body.ramos-page-usuarios .btn-soft {
  background: var(--soft) !important;
  color: var(--text) !important;
  border: 1px solid var(--line) !important
}

body.ramos-page-usuarios .btn-green {
  background: #16a34a !important;
  color: white !important
}

body.ramos-page-usuarios .users-row-list {
  display: grid;
  gap: 10px;
  padding: 16px
}

body.ramos-page-usuarios .user-row-pro {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .045);
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 58px minmax(230px, 1.25fr) minmax(100px, .45fr) minmax(150px, .60fr) minmax(360px, 1.25fr) 120px;
  gap: 12px;
  align-items: center;
  position: relative;
  overflow: hidden
}

body.ramos-page-usuarios .user-row-pro.pending {
  border-left: 5px solid #d97706;
  background: linear-gradient(90deg, rgba(254, 243, 199, .82), var(--card) 30%)
}

body.ramos-page-usuarios.dark .user-row-pro.pending {
  background: linear-gradient(90deg, rgba(217, 119, 6, .16), var(--card) 35%)
}

body.ramos-page-usuarios .user-avatar-pro {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: #0f172a;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 950
}

body.ramos-page-usuarios.dark .user-avatar-pro {
  background: #38bdf8;
  color: #0f172a
}

body.ramos-page-usuarios .row-title {
  min-width: 0
}

body.ramos-page-usuarios .row-title strong {
  display: block;
  font-size: 16px;
  font-weight: 950;
  letter-spacing: -.03em;
  line-height: 1.08;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

body.ramos-page-usuarios .row-title small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

body.ramos-page-usuarios .row-field {
  min-width: 0
}

body.ramos-page-usuarios .row-field-label {
  font-size: 9px;
  font-weight: 950;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 4px
}

body.ramos-page-usuarios .row-field-value {
  font-size: 11px;
  font-weight: 950;
  color: var(--text);
  line-height: 1.18
}

body.ramos-page-usuarios .row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap
}

body.ramos-page-usuarios .row-actions .btn {
  min-height: 40px;
  padding: 10px 11px;
  font-size: 9px !important
}

body.ramos-page-usuarios .user-row-badges {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 7px
}

body.ramos-page-usuarios .user-role-select {
  min-height: 40px;
  padding: 9px 10px !important;
  font-size: 10px !important;
  border-radius: 14px !important
}

body.ramos-page-usuarios .user-app-grid-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(66px, 1fr));
  gap: 6px
}

body.ramos-page-usuarios .user-app-grid-row .user-app-perm {
  background: var(--soft) !important;
  border: 1px solid var(--line) !important;
  border-radius: 14px !important;
  padding: 7px 8px !important;
  gap: 6px
}

body.ramos-page-usuarios .user-app-grid-row .user-app-perm span {
  font-size: 8px !important;
  letter-spacing: .03em;
  color: var(--muted) !important;
  max-width: 62px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

body.ramos-page-usuarios .user-app-grid-row .mini-switch {
  width: 30px;
  height: 18px
}

body.ramos-page-usuarios .user-app-grid-row .mini-switch:after {
  width: 13px;
  height: 13px;
  top: 2.5px;
  left: 3px
}

body.ramos-page-usuarios .user-app-grid-row .mini-switch.active:after {
  left: 14px
}

body.ramos-page-usuarios .pill,
body.ramos-page-usuarios .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
  border: 1px solid transparent
}

body.ramos-page-usuarios .badge-ok {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0
}

@media (max-width:1320px) {
  body.ramos-page-usuarios .user-row-pro {
    grid-template-columns: 58px minmax(220px, 1.3fr) minmax(100px, .55fr) minmax(145px, .7fr) minmax(260px, 1fr)
  }

  body.ramos-page-usuarios .user-row-actions {
    grid-column: 1/-1;
    justify-content: flex-end
  }
}

@media (max-width:1099px) {
  body.ramos-page-usuarios .usuarios-pro-layout {
    grid-template-columns: 1fr !important
  }

  body.ramos-page-usuarios .usuarios-pro-side {
    position: static
  }

  body.ramos-page-usuarios .toolbar.usuarios-toolbar {
    grid-template-columns: 1fr 1fr
  }
}

@media (max-width:899px) {
  body.ramos-page-usuarios .usuarios-pro-hero {
    border-radius: 0 0 32px 32px !important;
    margin: -16px -16px 0 !important;
    padding: 18px 16px !important
  }

  body.ramos-page-usuarios .usuarios-pro-side {
    display: none
  }

  body.ramos-page-usuarios .usuarios-kpi-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    min-width: 0
  }

  body.ramos-page-usuarios .kpi-box {
    padding: 8px 6px;
    border-radius: 14px
  }

  body.ramos-page-usuarios .kpi-label {
    font-size: 7px;
    min-height: 18px;
    letter-spacing: .06em
  }

  body.ramos-page-usuarios .kpi-value {
    font-size: 18px
  }

  body.ramos-page-usuarios .hero-title {
    font-size: 22px
  }

  body.ramos-page-usuarios .hero-text {
    font-size: 12px
  }

  body.ramos-page-usuarios .toolbar.usuarios-toolbar {
    grid-template-columns: 1fr
  }

  body.ramos-page-usuarios .shell,
  body.ramos-page-usuarios .usuarios-pro-shell {
    padding-left: 12px !important;
    padding-right: 12px !important
  }
}



/* ===== Ajuste solicitado: etiquetas visibles de permisos en filas ===== */
body.ramos-page-usuarios .user-app-grid-row {
  align-items: stretch;
}

body.ramos-page-usuarios .user-app-grid-row .user-app-perm {
  min-height: 54px;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  gap: 5px !important;
  padding: 7px 5px !important;
}

body.ramos-page-usuarios .user-app-grid-row .user-app-perm span {
  max-width: 100% !important;
  width: 100%;
  display: block;
  font-size: 7.5px !important;
  line-height: 1.05;
  letter-spacing: .045em !important;
  text-transform: uppercase;
  color: var(--muted) !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.ramos-page-usuarios .user-app-grid-row .mini-switch {
  margin: 0 auto;
}

@media (max-width: 1320px) {
  body.ramos-page-usuarios .user-app-grid-row .user-app-perm span {
    font-size: 7px !important;
  }
}



/* ===== Usuarios · Topbar igualada a Calidad ===== */
body.ramos-page-usuarios .topbar {
  min-height: 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

body.ramos-page-usuarios .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

body.ramos-page-usuarios .brand-logo {
  height: 36px;
  width: auto;
  max-width: none;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

body.ramos-page-usuarios .back-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 950;
  flex-shrink: 0;
}

body.ramos-page-usuarios.dark .back-btn {
  background: rgba(255, 255, 255, .08);
  color: #e2e8f0;
}

body.ramos-page-usuarios .role-badge {
  font-size: 9px;
  font-weight: 950;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: .12em;
  margin: 0 0 2px;
}

body.ramos-page-usuarios h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 950;
  letter-spacing: -.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.ramos-page-usuarios .top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  body.ramos-page-usuarios .topbar {
    min-height: 62px;
  }

  body.ramos-page-usuarios .brand-logo {
    height: 30px;
  }

  body.ramos-page-usuarios h1 {
    font-size: 17px;
  }

  body.ramos-page-usuarios .top-actions .btn {
    padding: 10px 11px;
  }
}



/* ===== USUARIOS · Gestión rápida móvil para crear usuarios ===== */
body.ramos-page-usuarios .usuarios-mobile-quick {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

body.ramos-page-usuarios .usuarios-mobile-action {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  border-radius: 22px;
  padding: 13px;
  min-height: 78px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .055);
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

body.ramos-page-usuarios .usuarios-mobile-action-icon {
  width: 40px;
  height: 40px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #2563eb;
  color: #fff;
  font-size: 20px;
  font-weight: 950;
  box-shadow: 0 10px 20px rgba(37, 99, 235, .18);
}

body.ramos-page-usuarios .usuarios-mobile-action strong {
  display: block;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .06em;
  line-height: 1.1;
}

body.ramos-page-usuarios .usuarios-mobile-action small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  line-height: 1.2;
  text-transform: none;
  letter-spacing: 0;
}

body.ramos-page-usuarios .usuarios-mobile-action.secondary .usuarios-mobile-action-icon {
  background: #0f172a;
}

body.ramos-page-usuarios.dark .usuarios-mobile-action.secondary .usuarios-mobile-action-icon {
  background: #38bdf8;
  color: #0f172a;
}

@media (max-width: 899px) {
  body.ramos-page-usuarios .usuarios-mobile-quick {
    display: grid;
  }

  body.ramos-page-usuarios #modal-crear.active {
    align-items: flex-start !important;
    padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom)) !important;
    overflow: hidden !important;
  }

  body.ramos-page-usuarios #modal-crear>div {
    width: 100% !important;
    max-width: 100% !important;
    max-height: calc(100dvh - max(20px, env(safe-area-inset-top)) - max(20px, env(safe-area-inset-bottom))) !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch;
    border-radius: 28px !important;
    padding: 16px !important;
  }

  body.ramos-page-usuarios #modal-crear .space-y-3>*+* {
    margin-top: 10px !important;
  }

  body.ramos-page-usuarios #modal-crear .btn-primary,
  body.ramos-page-usuarios #modal-crear .secondary-btn {
    min-height: 46px;
  }
}

@media (max-width: 380px) {
  body.ramos-page-usuarios .usuarios-mobile-quick {
    grid-template-columns: 1fr;
  }
}



/* ===== Usuarios · Ajustes móvil/desktop solicitados ===== */
body.ramos-page-usuarios .usuarios-create-centered {
  justify-content: center !important;
  text-align: center !important;
  flex-direction: column !important;
  align-items: center !important;
}

body.ramos-page-usuarios .usuarios-create-centered .action-icon,
body.ramos-page-usuarios .usuarios-create-centered .usuarios-mobile-action-icon {
  margin-left: 0;
  margin-right: 0;
}

body.ramos-page-usuarios .usuarios-create-centered>div:last-child,
body.ramos-page-usuarios .usuarios-create-centered>span:last-child {
  text-align: center !important;
}

body.ramos-page-usuarios .user-row-pro,
body.ramos-page-usuarios .mobile-card.user-clickable-card {
  cursor: pointer;
}

body.ramos-page-usuarios .user-row-pro:hover,
body.ramos-page-usuarios .mobile-card.user-clickable-card:hover {
  filter: brightness(1.01);
  transform: translateY(-1px);
}

body.ramos-page-usuarios .user-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .7rem;
}

body.ramos-page-usuarios .user-detail-box {
  border: 1px solid var(--line);
  background: var(--soft);
  border-radius: 1rem;
  padding: .85rem;
  min-width: 0;
}

body.ramos-page-usuarios .user-detail-box.full {
  grid-column: 1 / -1;
}

body.ramos-page-usuarios .user-detail-label {
  margin: 0 0 .3rem;
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}

body.ramos-page-usuarios .user-detail-value {
  margin: 0;
  font-size: 12px;
  font-weight: 850;
  color: var(--text);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

body.ramos-page-usuarios .user-detail-apps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
}

body.ramos-page-usuarios .user-detail-app {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 1rem;
  padding: .75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
}

body.ramos-page-usuarios .user-detail-app strong {
  font-size: 11px;
  font-weight: 950;
  color: var(--text);
}

body.ramos-page-usuarios .modal-card-usuarios {
  width: min(720px, 100%);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 899px) {
  body.ramos-page-usuarios #usuarios-buscador-card {
    display: none;
  }

  body.ramos-page-usuarios #usuarios-buscador-card.mobile-search-open {
    display: block;
  }

  body.ramos-page-usuarios .usuarios-mobile-quick {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {

  body.ramos-page-usuarios .user-detail-grid,
  body.ramos-page-usuarios .user-detail-apps {
    grid-template-columns: 1fr;
  }

  body.ramos-page-usuarios .modal-card-usuarios {
    max-height: calc(100dvh - 20px);
    border-radius: 1.6rem !important;
    padding: 1rem !important;
  }
}



/* ===== Usuarios · Ficha lateral derecha + móvil simplificado ===== */
body.ramos-page-usuarios #modal-ficha-usuario.modal {
  align-items: stretch !important;
  justify-content: flex-end !important;
  padding: 0 !important;
  background: rgba(15, 23, 42, .46) !important;
  overflow: hidden !important;
}

body.ramos-page-usuarios #modal-ficha-usuario .usuarios-detail-drawer {
  width: min(560px, 94vw) !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  margin: 0 !important;
  border-radius: 32px 0 0 32px !important;
  background: var(--card) !important;
  color: var(--text) !important;
  border: 1px solid var(--line) !important;
  box-shadow: -24px 0 70px rgba(0, 0, 0, .28) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain !important;
  -webkit-overflow-scrolling: touch;
  padding: 0 20px max(18px, env(safe-area-inset-bottom)) !important;
}

body.ramos-page-usuarios #modal-ficha-usuario .usuarios-detail-head {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 0 -20px 16px;
  padding: max(18px, env(safe-area-inset-top)) 20px 16px;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

body.ramos-page-usuarios.dark #modal-ficha-usuario .usuarios-detail-head {
  background: rgba(23, 32, 51, .94);
}

body.ramos-page-usuarios .user-detail-control-panel {
  border: 1px solid var(--line);
  background: var(--soft);
  border-radius: 18px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

body.ramos-page-usuarios .user-detail-control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 16px;
  padding: 10px 12px;
}

body.ramos-page-usuarios .user-detail-control-row strong {
  display: block;
  font-size: 11px;
  font-weight: 950;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: .05em;
}

body.ramos-page-usuarios .user-detail-control-row small {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
  line-height: 1.25;
}

body.ramos-page-usuarios .mobile-user-compact {
  padding: 13px 14px !important;
  border-radius: 20px !important;
}

body.ramos-page-usuarios .mobile-user-compact h3 {
  font-size: 15px !important;
  line-height: 1.15;
}

body.ramos-page-usuarios .mobile-user-compact .mobile-user-arrow {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--soft);
  color: var(--muted);
  font-weight: 950;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  body.ramos-page-usuarios #modal-ficha-usuario .usuarios-detail-drawer {
    width: min(94vw, 430px) !important;
    border-radius: 28px 0 0 28px !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  body.ramos-page-usuarios #modal-ficha-usuario .usuarios-detail-head {
    margin-left: -14px !important;
    margin-right: -14px !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
  }
}



/* ===== USUARIOS · Cabecera superior igualada al resto de módulos ===== */
body.ramos-page-usuarios header.glass .brand>div {
  display: grid !important;
  gap: 0 !important;
  align-content: center !important;
  min-width: 0 !important;
}

body.ramos-page-usuarios header.glass .brand .role-badge {
  font-family: "Plus Jakarta Sans", sans-serif !important;
  font-size: 9px !important;
  line-height: 1.1 !important;
  font-weight: 950 !important;
  color: var(--primary) !important;
  text-transform: uppercase !important;
  letter-spacing: .12em !important;
  margin: 0 0 2px !important;
}

body.ramos-page-usuarios header.glass .brand h1 {
  font-family: "Plus Jakarta Sans", sans-serif !important;
  margin: 0 !important;
  font-size: 20px !important;
  line-height: 1.1 !important;
  font-weight: 950 !important;
  letter-spacing: -.03em !important;
  color: var(--text) !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

@media (max-width: 640px) {
  body.ramos-page-usuarios header.glass .brand h1 {
    font-size: 17px !important;
    line-height: 1.08 !important;
  }

  body.ramos-page-usuarios header.glass .brand .role-badge {
    font-size: 9px !important;
  }
}



/* ===== FIX USUARIOS · Móvil sin ensanche lateral ===== */
@media (max-width: 899px) {

  html,
  body.ramos-page-usuarios {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  body.ramos-page-usuarios #view-app,
  body.ramos-page-usuarios main,
  body.ramos-page-usuarios .usuarios-pro-shell,
  body.ramos-page-usuarios .usuarios-pro-hero,
  body.ramos-page-usuarios .usuarios-mobile-quick,
  body.ramos-page-usuarios .usuarios-pro-layout,
  body.ramos-page-usuarios .usuarios-pro-main,
  body.ramos-page-usuarios .mobile-view,
  body.ramos-page-usuarios #lista-mobile {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }

  body.ramos-page-usuarios .usuarios-pro-shell {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  body.ramos-page-usuarios .usuarios-pro-hero {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  body.ramos-page-usuarios .usuarios-mobile-quick {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    align-items: stretch !important;
  }

  body.ramos-page-usuarios .usuarios-mobile-action {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 11px 8px !important;
    gap: 8px !important;
    overflow: hidden !important;
  }

  body.ramos-page-usuarios .usuarios-mobile-action>span:last-child,
  body.ramos-page-usuarios .usuarios-mobile-action>div:last-child {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }

  body.ramos-page-usuarios .usuarios-mobile-action strong,
  body.ramos-page-usuarios .usuarios-mobile-action small {
    max-width: 100% !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
  }

  body.ramos-page-usuarios .usuarios-mobile-action-icon {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    border-radius: 14px !important;
  }

  body.ramos-page-usuarios .usuarios-create-centered {
    min-width: 0 !important;
  }

  body.ramos-page-usuarios .usuarios-kpi-grid,
  body.ramos-page-usuarios .kpi-grid {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }

  body.ramos-page-usuarios .kpi-box {
    min-width: 0 !important;
    max-width: 100% !important;
    padding-left: 6px !important;
    padding-right: 6px !important;
    overflow: hidden !important;
  }

  body.ramos-page-usuarios .kpi-label,
  body.ramos-page-usuarios .kpi-value {
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body.ramos-page-usuarios .mobile-card,
  body.ramos-page-usuarios .user-access-card,
  body.ramos-page-usuarios .card,
  body.ramos-page-usuarios #usuarios-buscador-card {
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
  }

  body.ramos-page-usuarios .topbar,
  body.ramos-page-usuarios .brand,
  body.ramos-page-usuarios .top-actions {
    min-width: 0 !important;
  }

  body.ramos-page-usuarios .top-actions .btn {
    min-width: 0 !important;
    padding-left: 9px !important;
    padding-right: 9px !important;
  }
}

@media (max-width: 370px) {
  body.ramos-page-usuarios .usuarios-mobile-quick {
    grid-template-columns: 1fr !important;
  }
}


/* =========================================================
   BLOQUE COMÚN FINAL · CAMBIOS GLOBALES AQUÍ
   ========================================================= */
/* =========================================================
   RAMOS UI COMÚN · V1 CONSERVADORA
   Objetivo: unificar lo repetido sin tocar JavaScript ni lógica.
   Este archivo se carga al final del <head>, por eso prevalece sobre
   reglas antiguas equivalentes en cada HTML.
   ========================================================= */

:root {
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --soft: #f8fafc;
  --primary: #2563eb;
  --green: #16a34a;
  --amber: #d97706;
  --red: #dc2626;
  --shadow: 0 14px 34px rgba(15, 23, 42, .08);
}

body.dark {
  --bg: #0f172a;
  --card: #172033;
  --text: #eff6ff;
  --muted: #94a3b8;
  --line: rgba(255, 255, 255, .10);
  --soft: #111827;
  --primary: #38bdf8;
  --shadow: 0 14px 34px rgba(0, 0, 0, .24);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  background:
    radial-gradient(circle at 0% 0%, rgba(37, 99, 235, .12), transparent 32%),
    radial-gradient(circle at 100% 0%, rgba(14, 165, 233, .10), transparent 30%),
    var(--bg) !important;
  color: var(--text) !important;
}

@supports (padding: max(0px)) {
  body {
    padding-top: env(safe-area-inset-top);
  }
}

.hidden,
.hidden-view {
  display: none !important;
}

/* Header / topbar común */
.glass,
#app>header,
#view-app>header.glass {
  position: sticky !important;
  top: 0 !important;
  z-index: 40 !important;
  background: rgba(255, 255, 255, .88) !important;
  backdrop-filter: blur(18px) !important;
  -webkit-backdrop-filter: blur(18px) !important;
  border-bottom: 1px solid rgba(15, 23, 42, .06) !important;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .055) !important;
}

body.dark .glass,
body.dark #app>header,
body.dark #view-app>header.glass {
  background: rgba(15, 23, 42, .90) !important;
  border-color: rgba(255, 255, 255, .08) !important;
}

.shell,
.shell-calidad,
.desktop-shell,
.usuarios-pro-shell,
.mediciones-pro-shell,
.incidencias-two-col-shell {
  width: min(1480px, calc(100% - 64px)) !important;
  max-width: 1480px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  min-width: 0 !important;
}

.topbar,
.topbar-calidad {
  min-height: 56px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
}

.brand,
.brand-calidad {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  min-width: 0 !important;
}

.app-logo,
.brand-logo,
.brand-logo-calidad,
.logo-header {
  height: 36px !important;
  max-width: 140px !important;
  object-fit: contain !important;
  display: block !important;
  flex-shrink: 0 !important;
}

.back-btn,
.back-btn-calidad,
a[href="index.html"].back-btn,
#view-app>header a[href="index.html"] {
  width: 40px !important;
  height: 40px !important;
  border-radius: 999px !important;
  background: var(--soft) !important;
  color: var(--muted) !important;
  border: 1px solid var(--line) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-decoration: none !important;
  font-weight: 950 !important;
  flex-shrink: 0 !important;
}

body.dark .back-btn,
body.dark .back-btn-calidad,
body.dark #view-app>header a[href="index.html"] {
  color: var(--text) !important;
}

.role-badge,
.role-badge-calidad,
#roleBadge,
#user-role-badge {
  color: var(--primary) !important;
  font-size: 9px !important;
  font-weight: 950 !important;
  text-transform: uppercase !important;
  letter-spacing: .12em !important;
  margin: 0 0 2px !important;
}

.title-calidad,
#user-display-name,
#userName {
  color: var(--text) !important;
  font-weight: 950 !important;
  letter-spacing: -.03em !important;
}

.top-actions,
.top-actions-calidad {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-shrink: 0 !important;
}

/* Botones comunes */
.btn,
.btn-calidad,
.btn-toolbar-calidad,
.btn-soft,
.btn-primary,
.btn-dark,
.btn-danger,
.btn-warning,
.primary-btn,
.secondary-btn,
#theme-btn,
#btnSalir {
  border-radius: 16px !important;
  min-height: 44px !important;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif !important;
  font-size: 10px !important;
  font-weight: 950 !important;
  text-transform: uppercase !important;
  letter-spacing: .08em !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  white-space: nowrap !important;
  user-select: none !important;
  border: 1px solid transparent !important;
  transition: transform .12s ease, filter .12s ease, box-shadow .12s ease, opacity .12s ease !important;
}

.btn:hover,
.btn-calidad:hover,
.btn-toolbar-calidad:hover,
.primary-btn:hover,
.secondary-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

.btn:active,
.btn-calidad:active,
.btn-toolbar-calidad:active,
.primary-btn:active,
.secondary-btn:active {
  transform: scale(.965);
  filter: brightness(.96);
}

.btn:disabled,
.btn-calidad:disabled,
.btn-toolbar-calidad:disabled,
.primary-btn:disabled {
  opacity: .55 !important;
  pointer-events: none !important;
  transform: none !important;
}

.btn-primary,
.primary-btn,
.bg-blue-600[type="button"],
button.bg-blue-600 {
  background: #2563eb !important;
  color: #fff !important;
  box-shadow: 0 10px 24px rgba(37, 99, 235, .18) !important;
}

.btn-dark {
  background: #0f172a !important;
  color: #fff !important;
}

.btn-green {
  background: #16a34a !important;
  color: #fff !important;
}

.btn-red,
.btn-danger {
  background: #dc2626 !important;
  color: #fff !important;
}

.btn-warning {
  background: #f97316 !important;
  color: #fff !important;
}

.btn-soft,
.btn-soft-calidad,
.secondary-btn,
.btn-toolbar-calidad,
#theme-btn,
#btnSalir {
  background: var(--soft) !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
  box-shadow: none !important;
}

body.dark .btn-dark {
  background: #38bdf8 !important;
  color: #0f172a !important;
}

/* Cards / secciones */
.card,
.side-card,
.side-card-calidad,
.stat-card,
.kpi-card,
.mobile-card,
.mobile-card-pro,
.inc-card,
.user-access-card,
.equipment-card,
.equipment-row,
.record-card,
.turno-card,
.dashboard-card,
.dashboard-kpi,
.direction-card,
.direction-summary,
.desktop-kpi-summary-card,
.auth-card,
.app-card,
.bg-white {
  background: var(--card) !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
  box-shadow: var(--shadow) !important;
}

.card,
.side-card,
.side-card-calidad,
.stat-card,
.kpi-card,
.mobile-card,
.mobile-card-pro,
.inc-card,
.user-access-card,
.equipment-card,
.record-card,
.turno-card,
.dashboard-card,
.dashboard-kpi,
.direction-card,
.desktop-kpi-summary-card {
  border-radius: 24px !important;
  border: 1px solid var(--line) !important;
  overflow: hidden;
}

.section-head,
.section-head-calidad,
.section-head-pro,
.med-section-head-pro {
  background: rgba(248, 250, 252, .72) !important;
  border-bottom: 1px solid var(--line) !important;
  color: var(--text) !important;
}

body.dark .section-head,
body.dark .section-head-calidad,
body.dark .section-head-pro,
body.dark .med-section-head-pro {
  background: rgba(255, 255, 255, .03) !important;
}

.section-kicker,
.section-kicker-calidad,
.direction-eyebrow,
.med-mobile-quick-kicker {
  color: var(--primary) !important;
}

.section-title,
.section-title-calidad,
.section-head-pro h3,
.med-section-head-pro h3 {
  color: var(--text) !important;
}

.section-help,
.section-help-calidad,
.compact-help,
.med-compact-help {
  color: var(--muted) !important;
}

/* Formularios */
.input,
.select,
.input-field,
.search-field,
.filter-select,
.select-field,
.input-calidad,
.select-calidad,
textarea,
input,
select {
  color: var(--text) !important;
}

.input,
.select,
.input-field,
.search-field,
.filter-select,
.select-field,
.input-calidad,
.select-calidad {
  width: 100% !important;
  border: 1px solid var(--line) !important;
  background: var(--soft) !important;
  border-radius: 16px !important;
  outline: none !important;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif !important;
  font-weight: 800 !important;
  min-height: 46px !important;
}

.input-field,
.input,
.select,
.select-field,
.input-calidad,
.select-calidad {
  padding: 13px 14px !important;
  font-size: 12px !important;
}

.search-field {
  padding: 13px 14px !important;
  font-size: 12px !important;
  font-weight: 900 !important;
}

.filter-select {
  padding: 12px !important;
  font-size: 10px !important;
  text-transform: uppercase !important;
  letter-spacing: .04em !important;
  color: var(--muted) !important;
}

.input-field:focus,
.search-field:focus,
.filter-select:focus,
.input:focus,
.select:focus,
.select-field:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .10) !important;
  background: var(--card) !important;
}

body.dark .input-field,
body.dark .search-field,
body.dark .filter-select,
body.dark .select-field,
body.dark .input,
body.dark .select {
  background: var(--soft) !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
}

body.dark input::placeholder,
body.dark textarea::placeholder {
  color: var(--muted) !important;
}

.label-tag,
.detail-label,
.row-field-label,
.stat-label,
.kpi-label,
.dashboard-kpi-label,
.desktop-kpi-summary-label {
  color: var(--muted) !important;
}

/* Panel lateral / drawer */
.side-panel {
  right: 0 !important;
  top: 0 !important;
  width: min(560px, 94vw) !important;
  max-width: 94vw !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  background: var(--card) !important;
  color: var(--text) !important;
  border: 1px solid var(--line) !important;
  border-right: 0 !important;
  border-radius: 32px 0 0 32px !important;
  box-shadow: -24px 0 70px rgba(0, 0, 0, .28) !important;
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.2, .8, .2, 1), box-shadow .28s ease !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  z-index: 80 !important;
}

.side-panel.active {
  transform: translateX(0) !important;
}

.panel-backdrop {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(15, 23, 42, .42) !important;
  z-index: 70 !important;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease !important;
}

.panel-backdrop.active {
  opacity: 1 !important;
  pointer-events: auto !important;
  display: block !important;
}

.panel-sticky-head,
.drawer-sticky-head {
  background: rgba(255, 255, 255, .94) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border-bottom: 1px solid var(--line) !important;
}

body.dark .panel-sticky-head,
body.dark .drawer-sticky-head {
  background: rgba(23, 32, 51, .94) !important;
}

/* Modales */
.modal-card,
.drawer-card,
.modal>.bg-white,
#modal-registro>div,
#modal-estado>div,
#modal-observacion>div,
#modal-adjunto>div,
#modal-tamano-imagen>div,
#modal-historial>div {
  background: var(--card) !important;
  color: var(--text) !important;
  border: 1px solid var(--line) !important;
  box-shadow: var(--shadow) !important;
}

/* Adjuntos Android / file picker */
.native-file-input,
.file-real-input {
  position: fixed !important;
  left: 0 !important;
  bottom: 0 !important;
  width: 1px !important;
  height: 1px !important;
  opacity: .01 !important;
  overflow: hidden !important;
  z-index: -1 !important;
}

.file-picker-button,
.file-picker-btn,
.detail-file-picker-button,
.attach-option {
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: .55rem !important;
  border: 1px solid #bfdbfe !important;
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  border-radius: 1rem !important;
  padding: .95rem 1rem !important;
  font-size: 11px !important;
  font-weight: 950 !important;
  text-transform: uppercase !important;
  letter-spacing: .05em !important;
  cursor: pointer !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}

body.dark .file-picker-button,
body.dark .file-picker-btn,
body.dark .detail-file-picker-button,
body.dark .attach-option {
  background: rgba(59, 130, 246, .14) !important;
  color: #93c5fd !important;
  border-color: rgba(59, 130, 246, .22) !important;
}

/* Tablas */
.desktop-table-wrap {
  overflow: auto !important;
}

.desktop-table thead th {
  position: sticky !important;
  top: 0 !important;
  background: var(--soft) !important;
  z-index: 5 !important;
}

.table-row:hover,
.user-row:hover {
  background: var(--soft) !important;
  cursor: pointer;
}

body.dark .table-row:hover,
body.dark .user-row:hover {
  background: rgba(255, 255, 255, .05) !important;
}

/* ─── Toast unificado ─────────────────────────────────────────── */
.toast,
.app-toast {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 9999;
  background: var(--card, #1e293b);
  color: var(--text, #f8fafc);
  border: 1.5px solid transparent;
  border-radius: 1rem;
  padding: .9rem 1rem;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.4;
  white-space: pre-line;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .18);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  transform: translateY(8px);
}

.toast.show,
.app-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.success,
.app-toast.success {
  border-color: #22c55e;
}

.toast.error,
.app-toast.error {
  border-color: #ef4444;
}

.toast.info,
.app-toast.info {
  border-color: #2563eb;
}

.toast.warning,
.app-toast.warning {
  border-color: #d97706;
}
/* ────────────────────────────────────────────────────────────── */

/* Dark mode Tailwind overrides seguros */
body.dark .text-slate-950,
body.dark .text-slate-900,
body.dark .text-slate-800,
body.dark .text-slate-700,
body.dark .text-slate-600,
body.dark .text-slate-500 {
  color: var(--text) !important;
}

body.dark .text-slate-400,
body.dark .text-slate-300 {
  color: var(--muted) !important;
}

body.dark .bg-slate-50,
body.dark .bg-slate-100 {
  background: var(--soft) !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
}

body.dark .border-slate-100,
body.dark .border-slate-200 {
  border-color: var(--line) !important;
}

body.dark #loader,
body.dark .loader {
  background: var(--bg) !important;
  color: var(--text) !important;
}

@media (max-width: 899px) {

  .shell,
  .shell-calidad,
  .desktop-shell,
  .usuarios-pro-shell,
  .mediciones-pro-shell,
  .incidencias-two-col-shell {
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
  }

  .topbar,
  .topbar-calidad {
    min-height: 62px !important;
  }

  .app-logo,
  .brand-logo,
  .brand-logo-calidad {
    height: 30px !important;
    max-width: 108px !important;
  }

  .btn-calidad,
  .btn,
  .btn-toolbar-calidad,
  #theme-btn,
  #btnSalir {
    padding-left: 11px !important;
    padding-right: 11px !important;
    min-width: 42px !important;
  }

  .side-panel {
    width: 100vw !important;
    max-width: 100vw !important;
    border-radius: 0 !important;
  }

  select.input-field,
  select.filter-select,
  input.input-field,
  textarea.input-field {
    font-size: 16px !important;
  }
}


/* =========================================================
   RAMOS UI COMÚN · FASE 2
   Objetivo: empezar a usar un lenguaje visual común real.
   - No toca JS.
   - Mantiene compatibilidad con clases antiguas.
   - Permite empezar a usar clases .ramos-* en nuevos módulos.
   ========================================================= */

/* ===== 1) Variables y base común reforzada ===== */
:root {
  --ramos-bg: var(--bg, #f1f5f9);
  --ramos-card: var(--card, #ffffff);
  --ramos-text: var(--text, #0f172a);
  --ramos-muted: var(--muted, #64748b);
  --ramos-line: var(--line, #e2e8f0);
  --ramos-soft: var(--soft, #f8fafc);
  --ramos-primary: var(--primary, #2563eb);
  --ramos-radius-sm: 14px;
  --ramos-radius-md: 16px;
  --ramos-radius-lg: 24px;
  --ramos-radius-xl: 32px;
  --ramos-shadow: var(--shadow, 0 14px 34px rgba(15, 23, 42, .08));
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body[class*="ramos-page-"] {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, sans-serif !important;
  background:
    radial-gradient(circle at 0% 0%, rgba(37, 99, 235, .12), transparent 32%),
    radial-gradient(circle at 100% 0%, rgba(37, 99, 235, .10), transparent 30%),
    var(--bg) !important;
  color: var(--text) !important;
}

body[class*="ramos-page-"].dark {
  background:
    radial-gradient(circle at 0% 0%, rgba(56, 189, 248, .10), transparent 32%),
    radial-gradient(circle at 100% 0%, rgba(37, 99, 235, .10), transparent 30%),
    var(--bg) !important;
}

/* ===== 2) Shells / anchura común ===== */
.ramos-shell,
.shell,
.shell-calidad,
.desktop-shell,
.usuarios-pro-shell,
.mediciones-pro-shell,
.incidencias-two-col-shell,
.reprocesos-shell,
main.max-w-xl,
#app>header .max-w-xl {
  width: min(1480px, calc(100% - 64px)) !important;
  max-width: 1480px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  min-width: 0 !important;
}

/* Login e index no deben ocupar 1480 en todos los bloques */
body.ramos-page-login main.auth-card {
  width: 100% !important;
  max-width: 28rem !important;
}

body.ramos-page-index main.max-w-xl,
body.ramos-page-index #app>header .max-w-xl {
  max-width: 980px !important;
}

/* ===== 3) Topbar común ===== */
.ramos-glass,
.glass,
#app>header {
  position: sticky !important;
  top: 0 !important;
  z-index: 40 !important;
  background: rgba(255, 255, 255, .88) !important;
  backdrop-filter: blur(18px) !important;
  -webkit-backdrop-filter: blur(18px) !important;
  border-bottom: 1px solid rgba(15, 23, 42, .06) !important;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .055) !important;
}

body.dark .ramos-glass,
body.dark .glass,
body.dark #app>header {
  background: rgba(15, 23, 42, .90) !important;
  border-bottom-color: rgba(255, 255, 255, .08) !important;
}

.ramos-topbar,
.topbar,
.topbar-calidad,
#view-app>header .desktop-shell,
#app>header .max-w-xl>div {
  min-height: 56px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
}

.ramos-brand,
.brand,
.brand-calidad,
#view-app>header .desktop-shell>div:first-child,
#app>header .max-w-xl>div>div:first-child {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  min-width: 0 !important;
}

.ramos-logo,
.app-logo,
.brand-logo,
.brand-logo-calidad,
.logo {
  object-fit: contain !important;
  display: block !important;
  flex-shrink: 0 !important;
}

.ramos-logo,
.app-logo,
.brand-logo,
.brand-logo-calidad {
  height: 36px !important;
  max-width: 140px !important;
}

.ramos-back-btn,
.back-btn,
.back-btn-calidad,
a[href="index.html"].back-btn-calidad,
#view-app>header a[href="index.html"] {
  width: 40px !important;
  height: 40px !important;
  border-radius: 999px !important;
  background: var(--soft) !important;
  color: var(--muted) !important;
  border: 1px solid var(--line) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-decoration: none !important;
  font-weight: 950 !important;
  flex-shrink: 0 !important;
}

body.dark .ramos-back-btn,
body.dark .back-btn,
body.dark .back-btn-calidad,
body.dark #view-app>header a[href="index.html"] {
  color: var(--text) !important;
}

.ramos-role-badge,
.role-badge,
.role-badge-calidad,
#roleBadge,
#user-role-badge {
  font-size: 9px !important;
  font-weight: 950 !important;
  color: var(--primary) !important;
  text-transform: uppercase !important;
  letter-spacing: .12em !important;
  margin: 0 0 2px !important;
}

.ramos-title,
.title-calidad,
#user-display-name,
#userName,
.topbar h1,
.topbar-calidad h1 {
  margin: 0 !important;
  font-size: 20px !important;
  font-weight: 950 !important;
  letter-spacing: -.03em !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  color: var(--text) !important;
}

.ramos-top-actions,
.top-actions,
.top-actions-calidad,
#app header .flex.items-center.gap-2 {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-shrink: 0 !important;
}

/* ===== 4) Botones comunes ===== */
.ramos-btn,
.btn,
.btn-calidad,
.btn-toolbar-calidad,
.btn-primary,
.btn-dark,
.btn-soft,
.btn-danger,
.btn-warning,
.primary-btn,
.secondary-btn,
.nav-btn,
.subtab,
#theme-btn,
#btnSalir,
button[onclick="toggleTheme()"],
button[onclick*="signOut"],
button[onclick*="auth.signOut"] {
  border-radius: 16px !important;
  min-height: 44px !important;
  padding: 13px 16px !important;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif !important;
  font-size: 10px !important;
  font-weight: 950 !important;
  text-transform: uppercase !important;
  letter-spacing: .08em !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  white-space: nowrap !important;
  user-select: none !important;
  -webkit-tap-highlight-color: transparent !important;
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease, filter .12s ease !important;
  border: 1px solid transparent !important;
}

.ramos-btn:hover,
.btn:hover,
.btn-calidad:hover,
.btn-toolbar-calidad:hover,
.primary-btn:hover,
.secondary-btn:hover,
.nav-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

.ramos-btn:active,
.btn:active,
.btn-calidad:active,
.btn-toolbar-calidad:active,
.primary-btn:active,
.secondary-btn:active,
.nav-btn:active {
  transform: scale(.965);
  filter: brightness(.96);
}

.ramos-btn:disabled,
.btn:disabled,
.btn-calidad:disabled,
.btn-toolbar-calidad:disabled {
  opacity: .55 !important;
  cursor: not-allowed !important;
  transform: none !important;
}

.ramos-btn-primary,
.btn-primary,
.primary-btn,
.bg-blue-600 {
  background: #2563eb !important;
  color: #fff !important;
  box-shadow: 0 10px 24px rgba(37, 99, 235, .18) !important;
}

.ramos-btn-dark,
.btn-dark {
  background: #0f172a !important;
  color: #fff !important;
  border-color: #0f172a !important;
}

.ramos-btn-soft,
.btn-soft,
.btn-soft-calidad,
.secondary-btn,
.btn-toolbar-calidad,
#theme-btn,
#btnSalir,
button[onclick="toggleTheme()"],
button[onclick*="signOut"],
button[onclick*="auth.signOut"] {
  background: var(--soft) !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
  box-shadow: none !important;
}

.ramos-btn-danger,
.btn-danger,
.btn-red {
  background: #dc2626 !important;
  color: #fff !important;
  box-shadow: 0 10px 24px rgba(220, 38, 38, .18) !important;
}

.ramos-btn-success,
.btn-green {
  background: #16a34a !important;
  color: #fff !important;
  box-shadow: 0 10px 24px rgba(22, 163, 74, .18) !important;
}

body.dark .ramos-btn-dark,
body.dark .btn-dark {
  background: #38bdf8 !important;
  color: #0f172a !important;
  border-color: #38bdf8 !important;
}

/* ===== 5) Cards, secciones y héroes ===== */
.ramos-card,
.card,
.side-card,
.kpi,
.kpi-card,
.stat-card,
.mobile-card,
.mobile-card-pro,
.inc-card,
.record-card,
.quick-link-card,
.equipment-card,
.equipment-row,
.user-access-card,
.vacation-card,
.detail-section,
.detail-box,
.info-box,
.desc-box {
  background: var(--card) !important;
  color: var(--text) !important;
  border: 1px solid var(--line) !important;
  border-radius: 24px !important;
  box-shadow: var(--shadow) !important;
}

.ramos-section-head,
.section-head,
.section-head-calidad,
.section-head-pro,
.med-section-head-pro {
  display: flex !important;
  align-items: flex-end !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 16px !important;
  border-bottom: 1px solid var(--line) !important;
  background: rgba(248, 250, 252, .72) !important;
}

body.dark .ramos-section-head,
body.dark .section-head,
body.dark .section-head-calidad,
body.dark .section-head-pro,
body.dark .med-section-head-pro {
  background: rgba(255, 255, 255, .03) !important;
}

.ramos-hero,
.hero,
.mobile-hero,
.inc-safe-hero,
.mediciones-pro-hero,
.usuarios-pro-hero,
.direction-hero,
main>section.bg-slate-900 {
  background:
    radial-gradient(circle at 0% 0%, rgba(37, 99, 235, .22), transparent 36%),
    linear-gradient(135deg, #0f172a 0%, #1e293b 52%, #1d4ed8 100%) !important;
  color: #fff !important;
  border-radius: 32px !important;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .18) !important;
  position: relative !important;
  overflow: hidden !important;
}

/* ===== 6) Action tiles / navegación lateral ===== */
.ramos-action-tile,
.med-action-tile,
.inc-action-tile-safe,
.action-tile,
.side-btn,
.side-nav .nav-btn,
.med-mobile-quick-btn,
.mobile-admin-action,
.turnos-action-card {
  width: 100% !important;
  min-height: 58px !important;
  border-radius: 18px !important;
  padding: 12px 14px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  background: var(--card) !important;
  color: var(--text) !important;
  border: 1px solid var(--line) !important;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .055) !important;
  text-align: left !important;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif !important;
  cursor: pointer !important;
}

.ramos-action-tile:hover,
.med-action-tile:hover,
.inc-action-tile-safe:hover,
.action-tile:hover,
.side-btn:hover,
.side-nav .nav-btn:hover,
.turnos-action-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(15, 23, 42, .08) !important;
}

/* Estado activo unificado — mismo estilo que calidad */
.side-btn.active,
.side-nav .nav-btn.active,
.turnos-action-card.active {
  background:
    radial-gradient(circle at 0% 0%, rgba(37, 99, 235, .16), transparent 38%),
    #eff6ff !important;
  color: #0f172a !important;
  border-color: #2563eb !important;
  box-shadow: 0 12px 28px rgba(37, 99, 235, .14) !important;
}

body.dark .side-btn.active,
body.dark .side-nav .nav-btn.active,
body.dark .turnos-action-card.active {
  background:
    radial-gradient(circle at 0% 0%, rgba(56, 189, 248, .18), transparent 38%),
    rgba(56, 189, 248, .09) !important;
  color: var(--text) !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 12px 28px rgba(56, 189, 248, .10) !important;
}

/* Iconos dentro del botón activo */
.side-btn.active .side-icon,
.side-nav .nav-btn.active .side-nav-icon,
.turnos-action-card.active .desktop-pro-icon {
  background: rgba(37, 99, 235, .14) !important;
  color: #1d4ed8 !important;
}
body.dark .side-btn.active .side-icon,
body.dark .side-nav .nav-btn.active .side-nav-icon,
body.dark .turnos-action-card.active .desktop-pro-icon {
  background: rgba(56, 189, 248, .14) !important;
  color: #38bdf8 !important;
}

/* Turnos: override de mayor especificidad para asegurar el gradiente activo */
body.ramos-page-turnos .turnos-action-card.active,
body.ramos-page-turnos .turnos-actions-list .turnos-action-card.active,
body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .turnos-action-card.active {
  background:
    radial-gradient(circle at 0% 0%, rgba(37, 99, 235, .16), transparent 38%),
    #eff6ff !important;
  color: #0f172a !important;
  border-color: #2563eb !important;
  box-shadow: 0 12px 28px rgba(37, 99, 235, .14) !important;
}
body.ramos-page-turnos.dark .turnos-action-card.active,
body.ramos-page-turnos.dark .turnos-actions-list .turnos-action-card.active,
body.ramos-page-turnos.dark #desktop-admin-header-actions.turnos-sidebar-actions .turnos-action-card.active {
  background:
    radial-gradient(circle at 0% 0%, rgba(56, 189, 248, .18), transparent 38%),
    rgba(56, 189, 248, .09) !important;
  color: var(--text) !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 12px 28px rgba(56, 189, 248, .10) !important;
}
body.ramos-page-turnos .turnos-actions-list .turnos-action-card.active .desktop-pro-icon,
body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .turnos-action-card.active .desktop-pro-icon {
  background: rgba(37, 99, 235, .14) !important;
  color: #1d4ed8 !important;
}
body.ramos-page-turnos.dark .turnos-actions-list .turnos-action-card.active .desktop-pro-icon,
body.ramos-page-turnos.dark #desktop-admin-header-actions.turnos-sidebar-actions .turnos-action-card.active .desktop-pro-icon {
  background: rgba(56, 189, 248, .14) !important;
  color: #38bdf8 !important;
}

.ramos-action-icon,
.med-action-icon,
.inc-action-icon-safe,
.action-icon,
.side-icon,
.side-nav-icon,
.med-mobile-quick-icon,
.mobile-admin-icon,
.desktop-pro-icon {
  width: 38px !important;
  height: 38px !important;
  border-radius: 14px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

/* ===== 7) Formularios comunes ===== */
.ramos-input,
.ramos-select,
.ramos-search,
.input-field,
.search-field,
.filter-select,
.input,
.select,
.select-field,
.input-calidad,
.select-calidad,
.area-picker-btn {
  width: 100% !important;
  min-height: 46px !important;
  border: 1px solid var(--line) !important;
  background: var(--soft) !important;
  color: var(--text) !important;
  border-radius: 16px !important;
  padding: 13px 14px !important;
  outline: none !important;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif !important;
  font-size: 12px !important;
  font-weight: 850 !important;
}

.ramos-input:focus,
.ramos-select:focus,
.ramos-search:focus,
.input-field:focus,
.search-field:focus,
.filter-select:focus,
.input:focus,
.select:focus,
.select-field:focus,
.area-picker-btn:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .10) !important;
  background: var(--card) !important;
}

textarea.ramos-input,
textarea.input-field {
  min-height: 110px !important;
  resize: vertical;
}

.ramos-label,
.label-tag,
.detail-label,
.row-field-label,
.info-label,
.stat-label,
.kpi-label,
.dashboard-kpi-label {
  font-size: 9px !important;
  font-weight: 950 !important;
  text-transform: uppercase !important;
  letter-spacing: .08em !important;
  color: var(--muted) !important;
}

/* ===== 8) Panel lateral común ===== */
.ramos-side-panel,
.side-panel,
.drawer-card {
  right: 0 !important;
  top: 0 !important;
  width: min(560px, 94vw) !important;
  max-width: 94vw !important;
  min-height: 100dvh !important;
  max-height: 100dvh !important;
  background: var(--card) !important;
  color: var(--text) !important;
  border: 1px solid var(--line) !important;
  border-right: 0 !important;
  border-radius: 32px 0 0 32px !important;
  box-shadow: -24px 0 70px rgba(0, 0, 0, .28) !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

.ramos-panel-backdrop,
.panel-backdrop {
  background: rgba(15, 23, 42, .42) !important;
}

/* ===== 8b) Bloqueo de scroll de fondo con panel/drawer activo (global) =====
   Mientras un .modal/.side-panel/.ramos-side-panel está abierto, la página
   de fondo no debe poder hacer scroll (el panel ya tiene su propio scroll
   interno vía overflow-y:auto). */
html:has(.modal.active),
html:has(.side-panel.active),
html:has(.ramos-side-panel.active),
body:has(.modal.active),
body:has(.side-panel.active),
body:has(.ramos-side-panel.active) {
  overflow: hidden !important;
  overscroll-behavior: none !important;
}

.ramos-panel-head,
.panel-sticky-head,
.drawer-sticky-head {
  background: rgba(255, 255, 255, .94) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border-bottom: 1px solid var(--line) !important;
}

body.dark .ramos-panel-head,
body.dark .panel-sticky-head,
body.dark .drawer-sticky-head {
  background: rgba(23, 32, 51, .94) !important;
}

/* ===== 9) File picker común Android/iOS ===== */
.ramos-file-input,
.native-file-input,
.file-real-input {
  position: fixed !important;
  left: 0 !important;
  bottom: 0 !important;
  width: 1px !important;
  height: 1px !important;
  opacity: .01 !important;
  overflow: hidden !important;
  z-index: -1 !important;
}

.ramos-file-picker,
.file-picker-button,
.file-picker-btn,
.detail-file-picker-button,
.attach-option {
  width: 100% !important;
  min-height: 46px !important;
  border: 1px solid #bfdbfe !important;
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  border-radius: 16px !important;
  padding: .95rem 1rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: .55rem !important;
  font-size: 11px !important;
  font-weight: 950 !important;
  text-transform: uppercase !important;
  letter-spacing: .05em !important;
  cursor: pointer !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}

body.dark .ramos-file-picker,
body.dark .file-picker-button,
body.dark .file-picker-btn,
body.dark .detail-file-picker-button,
body.dark .attach-option {
  background: rgba(59, 130, 246, .14) !important;
  color: #93c5fd !important;
  border-color: rgba(59, 130, 246, .22) !important;
}

/* ===== 10) Tablas y listados ===== */
.ramos-table-wrap,
.desktop-table-wrap {
  overflow: auto !important;
}

.ramos-table thead th,
.desktop-table thead th {
  position: sticky !important;
  top: 0 !important;
  background: var(--soft) !important;
  z-index: 5 !important;
}

.ramos-row:hover,
.table-row:hover,
.user-row:hover {
  background: var(--soft) !important;
  cursor: pointer;
}

body.dark .ramos-row:hover,
body.dark .table-row:hover,
body.dark .user-row:hover {
  background: rgba(255, 255, 255, .05) !important;
}

/* ===== 11) Responsive común ===== */
@media (max-width: 899px) {

  .ramos-shell,
  .shell,
  .shell-calidad,
  .desktop-shell,
  .usuarios-pro-shell,
  .mediciones-pro-shell,
  .incidencias-two-col-shell,
  main.max-w-xl,
  #app>header .max-w-xl {
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
  }

  .ramos-topbar,
  .topbar,
  .topbar-calidad,
  #view-app>header .desktop-shell,
  #app>header .max-w-xl>div {
    min-height: 62px !important;
  }

  .ramos-logo,
  .app-logo,
  .brand-logo,
  .brand-logo-calidad {
    height: 30px !important;
    max-width: 108px !important;
  }

  .ramos-title,
  .title-calidad,
  #user-display-name,
  #userName {
    font-size: 17px !important;
  }

  .ramos-btn,
  .btn,
  .btn-calidad,
  .btn-toolbar-calidad,
  #theme-btn,
  #btnSalir,
  button[onclick="toggleTheme()"],
  button[onclick*="signOut"],
  button[onclick*="auth.signOut"] {
    padding-left: 11px !important;
    padding-right: 11px !important;
    min-width: 42px !important;
  }

  .ramos-side-panel,
  .side-panel,
  .drawer-card {
    width: 100vw !important;
    max-width: 100vw !important;
    border-radius: 0 !important;
  }

  select.input-field,
  select.filter-select,
  input.input-field,
  textarea.input-field,
  .ramos-input,
  .ramos-select {
    font-size: 16px !important;
  }
}


/* =========================================================
   FASE 3 · Ajustes móviles solicitados
   - Usuarios: botones de gestión rápida y buscador móvil alineados
   - Mediciones: creación desde gestión rápida, no desde hero/header móvil
   ========================================================= */

@media (max-width: 899px) {

  /* Usuarios: que Crear usuario y Buscar queden como tiles horizontales, no icono arriba/texto abajo */
  body.ramos-page-usuarios .usuarios-mobile-quick {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    align-items: stretch !important;
    margin-top: 12px !important;
  }

  body.ramos-page-usuarios .usuarios-mobile-action,
  body.ramos-page-usuarios .usuarios-create-centered {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    text-align: left !important;
    min-height: 72px !important;
    padding: 11px 10px !important;
    gap: 9px !important;
  }

  body.ramos-page-usuarios .usuarios-mobile-action-icon,
  body.ramos-page-usuarios .usuarios-create-centered .usuarios-mobile-action-icon {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    border-radius: 14px !important;
    margin: 0 !important;
  }

  body.ramos-page-usuarios .usuarios-mobile-action>span:last-child,
  body.ramos-page-usuarios .usuarios-create-centered>span:last-child,
  body.ramos-page-usuarios .usuarios-create-centered>div:last-child {
    min-width: 0 !important;
    max-width: 100% !important;
    text-align: left !important;
    overflow: hidden !important;
  }

  body.ramos-page-usuarios .usuarios-mobile-action strong,
  body.ramos-page-usuarios .usuarios-mobile-action small {
    text-align: left !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
  }

  /* Usuarios: el bloque de buscar, cuando se abre en móvil, queda como card completa y alineada */
  body.ramos-page-usuarios #usuarios-buscador-card.mobile-search-open {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-top: 0 !important;
  }

  body.ramos-page-usuarios #usuarios-buscador-card .section-head {
    align-items: flex-start !important;
  }

  body.ramos-page-usuarios #usuarios-buscador-card .section-head>div {
    min-width: 0 !important;
    text-align: left !important;
  }

  body.ramos-page-usuarios .toolbar.usuarios-toolbar {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  body.ramos-page-usuarios .toolbar.usuarios-toolbar label,
  body.ramos-page-usuarios #usuarios-buscador-card label {
    text-align: left !important;
    align-items: stretch !important;
  }

  body.ramos-page-usuarios #usuarios-buscador-card .input,
  body.ramos-page-usuarios #usuarios-buscador-card .select {
    width: 100% !important;
  }

  /* Mediciones: el alta pasa al panel de Gestión rápida móvil */
  body.ramos-page-mediciones .med-mobile-create-btn {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, #eff6ff, #ffffff) !important;
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .10), 0 14px 26px rgba(37, 99, 235, .12) !important;
  }

  body.ramos-page-mediciones .med-mobile-create-btn .med-mobile-quick-icon {
    background: #2563eb !important;
    color: #fff !important;
    border-color: #2563eb !important;
  }

  body.ramos-page-mediciones.dark .med-mobile-create-btn {
    background: rgba(56, 189, 248, .13) !important;
    border-color: #38bdf8 !important;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, .10) !important;
  }

  body.ramos-page-mediciones.dark .med-mobile-create-btn .med-mobile-quick-icon {
    background: #38bdf8 !important;
    color: #0f172a !important;
    border-color: #38bdf8 !important;
  }
}

@media (max-width: 390px) {
  body.ramos-page-usuarios .usuarios-mobile-quick {
    grid-template-columns: 1fr !important;
  }
}

/* =========================================================
   FASE 3B · Usuarios móvil: tiles Crear usuario / Buscar uniformes
   Corrige conflicto de .usuarios-create-centered que colocaba el + arriba
   ========================================================= */
body.ramos-page-usuarios .usuarios-mobile-quick>.usuarios-mobile-action,
body.ramos-page-usuarios .usuarios-mobile-quick>.usuarios-create-centered {
  display: grid !important;
  grid-template-columns: 42px minmax(0, 1fr) !important;
  align-items: center !important;
  justify-content: stretch !important;
  justify-items: stretch !important;
  text-align: left !important;
  gap: 11px !important;
  min-height: 82px !important;
  padding: 14px 16px !important;
  flex-direction: unset !important;
}

body.ramos-page-usuarios .usuarios-mobile-quick>.usuarios-mobile-action .usuarios-mobile-action-icon,
body.ramos-page-usuarios .usuarios-mobile-quick>.usuarios-create-centered .usuarios-mobile-action-icon {
  grid-column: 1 !important;
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  margin: 0 !important;
  align-self: center !important;
  justify-self: center !important;
}

body.ramos-page-usuarios .usuarios-mobile-quick>.usuarios-mobile-action>span:last-child,
body.ramos-page-usuarios .usuarios-mobile-quick>.usuarios-create-centered>span:last-child,
body.ramos-page-usuarios .usuarios-mobile-quick>.usuarios-create-centered>div:last-child {
  grid-column: 2 !important;
  min-width: 0 !important;
  max-width: 100% !important;
  text-align: left !important;
  align-self: center !important;
  justify-self: stretch !important;
  overflow: hidden !important;
}

body.ramos-page-usuarios .usuarios-mobile-quick>.usuarios-mobile-action strong,
body.ramos-page-usuarios .usuarios-mobile-quick>.usuarios-mobile-action small,
body.ramos-page-usuarios .usuarios-mobile-quick>.usuarios-create-centered strong,
body.ramos-page-usuarios .usuarios-mobile-quick>.usuarios-create-centered small {
  text-align: left !important;
  white-space: normal !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
}

@media (max-width: 420px) {
  body.ramos-page-usuarios .usuarios-mobile-quick {
    grid-template-columns: 1fr !important;
  }
}


/* =========================================================
   FASE 3C · Usuarios móvil: crear usuario usa botón móvil propio
   No reutiliza .usuarios-create-centered porque esa clase pertenece al
   botón desktop centrado y fuerza icono arriba/texto abajo.
   ========================================================= */
body.ramos-page-usuarios .usuarios-mobile-quick>.usuarios-mobile-create-action,
body.ramos-page-usuarios .usuarios-mobile-quick>.usuarios-mobile-action.secondary {
  display: grid !important;
  grid-template-columns: 42px minmax(0, 1fr) !important;
  align-items: center !important;
  justify-content: stretch !important;
  text-align: left !important;
  gap: 11px !important;
  min-height: 82px !important;
  padding: 14px 16px !important;
  flex-direction: row !important;
}

body.ramos-page-usuarios .usuarios-mobile-quick>.usuarios-mobile-create-action .usuarios-mobile-action-icon,
body.ramos-page-usuarios .usuarios-mobile-quick>.usuarios-mobile-action.secondary .usuarios-mobile-action-icon {
  grid-column: 1 !important;
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  margin: 0 !important;
  align-self: center !important;
  justify-self: center !important;
}

body.ramos-page-usuarios .usuarios-mobile-quick>.usuarios-mobile-create-action>span:last-child,
body.ramos-page-usuarios .usuarios-mobile-quick>.usuarios-mobile-action.secondary>span:last-child {
  grid-column: 2 !important;
  min-width: 0 !important;
  max-width: 100% !important;
  text-align: left !important;
  align-self: center !important;
  justify-self: stretch !important;
  overflow: hidden !important;
}

body.ramos-page-usuarios .usuarios-mobile-quick>.usuarios-mobile-create-action strong,
body.ramos-page-usuarios .usuarios-mobile-quick>.usuarios-mobile-create-action small,
body.ramos-page-usuarios .usuarios-mobile-quick>.usuarios-mobile-action.secondary strong,
body.ramos-page-usuarios .usuarios-mobile-quick>.usuarios-mobile-action.secondary small {
  text-align: left !important;
  white-space: normal !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
}

/* =========================================================
   FASE 3D · Usuarios móvil: centrar el grupo icono + texto
   Mantiene icono a la izquierda y texto a la derecha, pero el
   conjunto queda centrado dentro de cada tarjeta.
   ========================================================= */
@media (max-width: 899px) {

  body.ramos-page-usuarios .usuarios-mobile-quick>.usuarios-mobile-create-action,
  body.ramos-page-usuarios .usuarios-mobile-quick>.usuarios-mobile-action.secondary {
    grid-template-columns: 42px auto !important;
    justify-content: center !important;
    justify-items: start !important;
    text-align: left !important;
    padding-left: 18px !important;
    padding-right: 18px !important;
  }

  body.ramos-page-usuarios .usuarios-mobile-quick>.usuarios-mobile-create-action>span:last-child,
  body.ramos-page-usuarios .usuarios-mobile-quick>.usuarios-mobile-action.secondary>span:last-child {
    width: auto !important;
    max-width: 190px !important;
    justify-self: start !important;
  }

  body.ramos-page-usuarios .usuarios-mobile-quick>.usuarios-mobile-create-action .usuarios-mobile-action-icon,
  body.ramos-page-usuarios .usuarios-mobile-quick>.usuarios-mobile-action.secondary .usuarios-mobile-action-icon {
    justify-self: end !important;
  }
}

@media (max-width: 390px) {

  body.ramos-page-usuarios .usuarios-mobile-quick>.usuarios-mobile-create-action>span:last-child,
  body.ramos-page-usuarios .usuarios-mobile-quick>.usuarios-mobile-action.secondary>span:last-child {
    max-width: 150px !important;
  }
}


/* =========================================================
   FASE 7 · Selector de archivos común Android/iOS
   ========================================================= */
.file-picker-box,
.ramos-file-picker-box {
  width: 100%;
  min-width: 0;
}

.native-file-input,
.file-real-input,
.ramos-file-input {
  position: fixed !important;
  left: 0 !important;
  bottom: 0 !important;
  width: 1px !important;
  height: 1px !important;
  opacity: .01 !important;
  overflow: hidden !important;
  z-index: -1 !important;
}

.file-picker-button,
.detail-file-picker-button,
.ramos-file-picker-button {
  width: 100%;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 1rem;
  padding: .95rem 1rem;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .05em;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.file-picker-button:active,
.detail-file-picker-button:active,
.ramos-file-picker-button:active {
  transform: scale(.99);
}

body.dark .file-picker-button,
body.dark .detail-file-picker-button,
body.dark .ramos-file-picker-button {
  background: rgba(59, 130, 246, .14) !important;
  color: #93c5fd !important;
  border-color: rgba(59, 130, 246, .22) !important;
}

/* =========================================================
   BOTONES SEMÁNTICOS DE ACCIÓN — Portal Cristalería Ramos
   Usados en los paneles de detalle de todos los módulos.
   Layout helpers (w-full, col-span-2, mt-3) se añaden
   directamente en el HTML cuando se necesiten.
   ========================================================= */
.btn-avanzar,
.btn-neutro,
.btn-retroceder,
.btn-peligro,
.btn-exportar {
  display: block;
  width: 100%;
  padding: .75rem 1rem;
  border-radius: .75rem;
  border: none;
  font-family: inherit;
  font-weight: 900;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .06em;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: transform .12s ease, filter .12s ease;
}

.btn-avanzar:hover,
.btn-neutro:hover,
.btn-retroceder:hover,
.btn-peligro:hover,
.btn-exportar:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

/* Rejilla de 2 columnas para botones de acción (paneles de detalle, modales).
   Usar grid-column:1/-1 en un botón para que ocupe toda la fila. */
.btn-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.btn-avanzar:active,
.btn-neutro:active,
.btn-retroceder:active,
.btn-peligro:active,
.btn-exportar:active {
  transform: scale(.965);
  filter: brightness(.96);
}

.btn-avanzar:disabled,
.btn-neutro:disabled,
.btn-retroceder:disabled,
.btn-peligro:disabled,
.btn-exportar:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

/* Avanzar: progresa la medición/incidencia (Aceptar, Con cita, Finalizar, Solucionada, Aprobar...) */
.btn-avanzar {
  background: #2563eb;
  color: #ffffff;
}

/* Neutro: sin impacto en estado (Editar, Avisará cliente, Cambiar responsable, Adjuntar...) */
.btn-neutro {
  background: #f1f5f9;
  color: #334155;
}

/* Retroceder: revierte o cierra negativamente (Rechazar, Volver a pendiente, No solucionada...) */
.btn-retroceder {
  background: #fef3c7;
  color: #92400e;
}

/* Peligro: acción destructiva irreversible (Eliminar...) */
.btn-peligro {
  background: #fee2e2;
  color: #b91c1c;
}

/* Exportar: genera un documento o archivo (PDF, Excel...) */
.btn-exportar {
  background: #059669;
  color: #ffffff;
}

/* Modo oscuro */
body.dark .btn-neutro {
  background: #1e293b;
  color: #cbd5e1;
}

body.dark .btn-retroceder {
  background: #451a03;
  color: #fcd34d;
}

body.dark .btn-peligro {
  background: #450a0a;
  color: #fca5a5;
}


/* =========================================================
   INCIDENCIAS · ESTILO GLOBAL IGUALADO A CALIDAD · V3
   Objetivo: que Incidencias use la misma escala visual que Calidad
   en móvil y escritorio: formularios, filtros, cards, tabla, panel lateral,
   modales, badges, botones, textos auxiliares y listado móvil.
   No modifica JavaScript, Firebase, Firestore ni Storage.
   ========================================================= */

/* ---------- Base tipográfica del módulo ---------- */
body.ramos-page-incidencias {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif !important;
  font-size: 14px !important;
  color: var(--text) !important;
}

body.ramos-page-incidencias p,
body.ramos-page-incidencias span,
body.ramos-page-incidencias div,
body.ramos-page-incidencias button,
body.ramos-page-incidencias input,
body.ramos-page-incidencias select,
body.ramos-page-incidencias textarea,
body.ramos-page-incidencias table {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif !important;
}

/* ---------- Cabeceras de secciones igualadas a Calidad ---------- */
body.ramos-page-incidencias .section-kicker-incidencias,
body.ramos-page-incidencias .section-kicker-calidad,
body.ramos-page-incidencias .inc-hero-kicker-calidad,
body.ramos-page-incidencias .mobile-quick-kicker,
body.ramos-page-incidencias .kpi-label,
body.ramos-page-incidencias .inc-pdf-chip,
body.ramos-page-incidencias .med-pdf-chip {
  font-size: 10px !important;
  font-weight: 950 !important;
  text-transform: uppercase !important;
  letter-spacing: .12em !important;
  line-height: 1.15 !important;
}

body.ramos-page-incidencias .section-title-incidencias,
body.ramos-page-incidencias .section-title-calidad,
body.ramos-page-incidencias .inc-list-head-unified h3,
body.ramos-page-incidencias .mobile-quick-title {
  font-size: 20px !important;
  font-weight: 950 !important;
  letter-spacing: -.035em !important;
  line-height: 1.08 !important;
  color: var(--text) !important;
  text-transform: none !important;
}

body.ramos-page-incidencias .section-help-incidencias,
body.ramos-page-incidencias .section-help-calidad,
body.ramos-page-incidencias .inc-hero-text-calidad,
body.ramos-page-incidencias .mobile-quick-help,
body.ramos-page-incidencias .inc-pdf-text,
body.ramos-page-incidencias .inc-pdf-info-text {
  font-size: 12px !important;
  font-weight: 750 !important;
  line-height: 1.35 !important;
  color: var(--muted) !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

body.ramos-page-incidencias .inc-hero-title-calidad {
  font-size: clamp(24px, 3vw, 30px) !important;
  font-weight: 950 !important;
  letter-spacing: -.045em !important;
  line-height: 1.05 !important;
}

/* ---------- Formularios: labels, inputs, selects y textarea como Calidad ---------- */
body.ramos-page-incidencias label:not(.inc-admin-assign-option):not(.inc-hist-filter-check):not(.mobile-hist-check),
body.ramos-page-incidencias .label-tag,
body.ramos-page-incidencias .inc-field-label,
body.ramos-page-incidencias .inc-pdf-controls label,
body.ramos-page-incidencias .inc-export-date-grid label,
body.ramos-page-incidencias .inc-export-filter-panel label {
  display: grid !important;
  gap: 7px !important;
  margin: 0 0 .28rem !important;
  font-size: 10px !important;
  font-weight: 950 !important;
  text-transform: uppercase !important;
  letter-spacing: .08em !important;
  color: var(--muted) !important;
  line-height: 1.2 !important;
}

body.ramos-page-incidencias .input-field,
body.ramos-page-incidencias input.input-field,
body.ramos-page-incidencias select.input-field,
body.ramos-page-incidencias textarea.input-field,
body.ramos-page-incidencias .search-field,
body.ramos-page-incidencias .filter-select,
body.ramos-page-incidencias select.filter-select,
body.ramos-page-incidencias .area-picker-btn,
body.ramos-page-incidencias .area-picker-search,
body.ramos-page-incidencias .inc-admin-assign-search,
body.ramos-page-incidencias .inc-pdf-controls .input-field,
body.ramos-page-incidencias .inc-pdf-controls .filter-select,
body.ramos-page-incidencias .inc-export-filter-panel .input-field,
body.ramos-page-incidencias .inc-export-filter-panel .filter-select {
  width: 100% !important;
  min-height: 46px !important;
  border: 1px solid var(--line) !important;
  background: var(--soft) !important;
  color: var(--text) !important;
  border-radius: 16px !important;
  padding: 13px 14px !important;
  outline: none !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  box-shadow: none !important;
}

body.ramos-page-incidencias textarea.input-field {
  min-height: 92px !important;
  resize: vertical !important;
  line-height: 1.35 !important;
}

body.ramos-page-incidencias select.input-field,
body.ramos-page-incidencias select.filter-select,
body.ramos-page-incidencias .filter-select {
  appearance: auto !important;
  -webkit-appearance: menulist !important;
  cursor: pointer !important;
}

body.ramos-page-incidencias .input-field::placeholder,
body.ramos-page-incidencias .search-field::placeholder,
body.ramos-page-incidencias .area-picker-search::placeholder,
body.ramos-page-incidencias .inc-admin-assign-search::placeholder {
  color: var(--muted) !important;
  font-weight: 800 !important;
}

body.ramos-page-incidencias .input-field:focus,
body.ramos-page-incidencias input.input-field:focus,
body.ramos-page-incidencias select.input-field:focus,
body.ramos-page-incidencias textarea.input-field:focus,
body.ramos-page-incidencias .search-field:focus,
body.ramos-page-incidencias .filter-select:focus,
body.ramos-page-incidencias select.filter-select:focus,
body.ramos-page-incidencias .area-picker-btn:focus,
body.ramos-page-incidencias .area-picker-search:focus,
body.ramos-page-incidencias .inc-admin-assign-search:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .10) !important;
  background: var(--card) !important;
}

body.ramos-page-incidencias.dark .input-field,
body.ramos-page-incidencias.dark input.input-field,
body.ramos-page-incidencias.dark select.input-field,
body.ramos-page-incidencias.dark textarea.input-field,
body.ramos-page-incidencias.dark .search-field,
body.ramos-page-incidencias.dark .filter-select,
body.ramos-page-incidencias.dark .area-picker-btn,
body.ramos-page-incidencias.dark .area-picker-search,
body.ramos-page-incidencias.dark .inc-admin-assign-search {
  background: var(--soft) !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
}

/* ---------- Botones estilo Calidad ---------- */
body.ramos-page-incidencias .btn,
body.ramos-page-incidencias .modal-card .btn,
body.ramos-page-incidencias .inc-filter-clear-btn,
body.ramos-page-incidencias .btn-toolbar-calidad,
body.ramos-page-incidencias .inc-export-primary-btn,
body.ramos-page-incidencias .inc-export-soft-btn,
body.ramos-page-incidencias .file-picker-button,
body.ramos-page-incidencias .file-picker-btn {
  min-height: 44px !important;
  border-radius: 16px !important;
  padding: 13px 16px !important;
  font-size: 10px !important;
  font-weight: 950 !important;
  text-transform: uppercase !important;
  letter-spacing: .08em !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  white-space: nowrap !important;
}

body.ramos-page-incidencias .file-picker-button,
body.ramos-page-incidencias .file-picker-btn {
  width: 100% !important;
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  border: 1px solid #bfdbfe !important;
}

/* ---------- Modales y paneles laterales como Calidad ---------- */
body.ramos-page-incidencias .modal-card {
  width: min(720px, 100%) !important;
  max-width: 720px !important;
  background: var(--card) !important;
  color: var(--text) !important;
  border: 1px solid var(--line) !important;
  border-radius: 32px !important;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .32) !important;
  padding: 20px !important;
  max-height: calc(100dvh - 40px) !important;
  overflow: auto !important;
}

body.ramos-page-incidencias .modal-card h2,
body.ramos-page-incidencias #modal-title,
body.ramos-page-incidencias #estado-modal-title {
  font-size: 20px !important;
  font-weight: 950 !important;
  letter-spacing: -.035em !important;
  line-height: 1.08 !important;
  color: var(--text) !important;
}

body.ramos-page-incidencias .side-panel {
  width: min(560px, 94vw) !important;
  border-radius: 32px 0 0 32px !important;
  background: var(--card) !important;
  border: 1px solid var(--line) !important;
  border-right: 0 !important;
  box-shadow: -24px 0 70px rgba(0, 0, 0, .28) !important;
}

body.ramos-page-incidencias #panel-content,
body.ramos-page-incidencias .panel-sticky-head {
  font-size: 11px !important;
  line-height: 1.35 !important;
}

/* ---------- Gestión rápida / menú lateral como Calidad ---------- */
body.ramos-page-incidencias .inc-action-tile-safe {
  min-height: 58px !important;
  border-radius: 14px !important;
  padding: 12px 14px !important;
  gap: 10px !important;
  box-shadow: none !important;
}

body.ramos-page-incidencias .inc-action-icon-safe {
  width: 34px !important;
  height: 34px !important;
  border-radius: 14px !important;
  font-size: 15px !important;
}

body.ramos-page-incidencias .inc-action-tile-safe strong {
  font-size: 11px !important;
  font-weight: 950 !important;
  text-transform: uppercase !important;
  letter-spacing: .05em !important;
  line-height: 1.1 !important;
}

body.ramos-page-incidencias .inc-action-tile-safe span {
  font-size: 9px !important;
  font-weight: 850 !important;
  letter-spacing: .02em !important;
  line-height: 1.1 !important;
}

/* ---------- Tabla desktop igualada a escala Calidad ---------- */
body.ramos-page-incidencias .desktop-table {
  font-size: 11px !important;
  color: var(--text) !important;
}

body.ramos-page-incidencias .desktop-table thead th {
  font-size: 9px !important;
  font-weight: 950 !important;
  text-transform: uppercase !important;
  letter-spacing: .08em !important;
  color: var(--muted) !important;
  background: var(--soft) !important;
}

body.ramos-page-incidencias .desktop-table tbody td,
body.ramos-page-incidencias .table-row td {
  font-size: 11px !important;
  font-weight: 850 !important;
  line-height: 1.25 !important;
}

body.ramos-page-incidencias .inc-list-head-unified #desktop-count,
body.ramos-page-incidencias .inc-list-head-unified>p,
body.ramos-page-incidencias #desktop-count {
  font-size: 10px !important;
  font-weight: 950 !important;
  text-transform: uppercase !important;
  letter-spacing: .08em !important;
  color: var(--muted) !important;
}

/* ---------- Badges y microtextos ---------- */
body.ramos-page-incidencias .status-badge,
body.ramos-page-incidencias .prioridad-alta,
body.ramos-page-incidencias .prioridad-normal {
  font-size: 9px !important;
  font-weight: 950 !important;
  text-transform: uppercase !important;
  letter-spacing: .06em !important;
  padding: 6px 9px !important;
  border-radius: 999px !important;
}

body.ramos-page-incidencias .inc-meta,
body.ramos-page-incidencias .kpi-help,
body.ramos-page-incidencias .inc-export-help-line,
body.ramos-page-incidencias .inc-admin-assign-help {
  font-size: 11px !important;
  font-weight: 800 !important;
  line-height: 1.35 !important;
  color: var(--muted) !important;
}

/* ---------- Listado móvil de incidencias como cards de Calidad ---------- */
@media (max-width: 899px) {
  body.ramos-page-incidencias {
    font-size: 13px !important;
  }

  body.ramos-page-incidencias .modal-card {
    border-radius: 26px !important;
    padding: 16px !important;
    max-height: calc(92dvh - env(safe-area-inset-top)) !important;
  }

  body.ramos-page-incidencias #lista-mobile .inc-card,
  body.ramos-page-incidencias #lista-mobile .mobile-card-pro {
    border-radius: 24px !important;
    padding: 14px !important;
    background: var(--card) !important;
    border: 1px solid var(--line) !important;
    box-shadow: var(--shadow) !important;
  }

  body.ramos-page-incidencias #lista-mobile .inc-title {
    font-size: 16px !important;
    font-weight: 950 !important;
    letter-spacing: -.03em !important;
    line-height: 1.08 !important;
    color: var(--text) !important;
  }

  body.ramos-page-incidencias #lista-mobile .inc-meta {
    font-size: 11px !important;
    font-weight: 800 !important;
    line-height: 1.25 !important;
    color: var(--muted) !important;
  }

  body.ramos-page-incidencias #lista-mobile .desc-box {
    border-radius: 16px !important;
    padding: 10px !important;
    background: var(--soft) !important;
    border: 1px solid var(--line) !important;
  }

  body.ramos-page-incidencias #lista-mobile .desc-box p:first-child,
  body.ramos-page-incidencias #lista-mobile .desc-box .text-\[9px\] {
    font-size: 9px !important;
    font-weight: 950 !important;
    text-transform: uppercase !important;
    letter-spacing: .08em !important;
    color: var(--muted) !important;
    line-height: 1.15 !important;
  }

  body.ramos-page-incidencias #lista-mobile .desc-box p:not(:first-child),
  body.ramos-page-incidencias #lista-mobile .desc-box .text-sm,
  body.ramos-page-incidencias #lista-mobile .desc-box .text-xs {
    font-size: 11px !important;
    font-weight: 850 !important;
    line-height: 1.35 !important;
    color: var(--text) !important;
  }

  body.ramos-page-incidencias #lista-mobile .grid.grid-cols-3 .desc-box p:not(:first-child),
  body.ramos-page-incidencias #lista-mobile .grid.grid-cols-3 .desc-box .text-xs {
    font-size: 11px !important;
    font-weight: 950 !important;
    line-height: 1.15 !important;
  }

  body.ramos-page-incidencias #lista-mobile .status-badge {
    font-size: 9px !important;
    font-weight: 950 !important;
    letter-spacing: .06em !important;
    padding: 6px 9px !important;
    border-radius: 999px !important;
  }

  body.ramos-page-incidencias #lista-mobile .med-chevron-btn {
    width: 44px !important;
    height: 44px !important;
    border-radius: 16px !important;
  }

  body.ramos-page-incidencias .mobile-quick-btn strong {
    font-size: 10px !important;
    font-weight: 950 !important;
    line-height: 1.12 !important;
  }

  body.ramos-page-incidencias .mobile-quick-btn span {
    font-size: 8px !important;
    font-weight: 850 !important;
    line-height: 1.15 !important;
  }

  body.ramos-page-incidencias .mobile-quick-icon {
    width: 32px !important;
    height: 32px !important;
    border-radius: 13px !important;
    font-size: 14px !important;
  }

  body.ramos-page-incidencias .input-field,
  body.ramos-page-incidencias input.input-field,
  body.ramos-page-incidencias select.input-field,
  body.ramos-page-incidencias textarea.input-field,
  body.ramos-page-incidencias .search-field,
  body.ramos-page-incidencias .filter-select,
  body.ramos-page-incidencias select.filter-select,
  body.ramos-page-incidencias .area-picker-btn,
  body.ramos-page-incidencias .area-picker-search,
  body.ramos-page-incidencias .inc-admin-assign-search {
    font-size: 11px !important;
    min-height: 46px !important;
    padding: 13px 14px !important;
    border-radius: 16px !important;
  }

  body.ramos-page-incidencias label:not(.inc-admin-assign-option):not(.inc-hist-filter-check):not(.mobile-hist-check),
  body.ramos-page-incidencias .label-tag,
  body.ramos-page-incidencias .inc-field-label {
    font-size: 10px !important;
  }
}

@media (max-width: 420px) {
  body.ramos-page-incidencias #lista-mobile .inc-title {
    font-size: 15px !important;
  }

  body.ramos-page-incidencias #lista-mobile .inc-meta,
  body.ramos-page-incidencias #lista-mobile .desc-box p:not(:first-child),
  body.ramos-page-incidencias #lista-mobile .desc-box .text-sm,
  body.ramos-page-incidencias #lista-mobile .desc-box .text-xs {
    font-size: 11px !important;
  }
}


/* =========================================================
   INCIDENCIAS · DETALLE LATERAL IGUALADO A CALIDAD · V4
   Descripción / Qué se va a hacer / observaciones en ficha lateral.
   Escala común que usaremos como referencia para los siguientes módulos:
   etiquetas 9px y contenido principal 11px.
   ========================================================= */

body.ramos-page-incidencias #panel-content .desc-box p,
body.ramos-page-incidencias #panel-content .desc-box div,
body.ramos-page-incidencias #panel-content .desc-box span,
body.ramos-page-incidencias #panel-content .detail-value,
body.ramos-page-incidencias #panel-content .text-sm,
body.ramos-page-incidencias #panel-content .text-xs {
  font-size: 11px !important;
  font-weight: 850 !important;
  line-height: 1.35 !important;
}

body.ramos-page-incidencias #panel-content .label-tag,
body.ramos-page-incidencias #panel-content .kpi-label,
body.ramos-page-incidencias #panel-content .detail-label,
body.ramos-page-incidencias #panel-content .text-\[9px\],
body.ramos-page-incidencias #panel-content .text-\[10px\] {
  font-size: 9px !important;
  font-weight: 950 !important;
  text-transform: uppercase !important;
  letter-spacing: .08em !important;
  color: var(--muted) !important;
  line-height: 1.15 !important;
}

body.ramos-page-incidencias #panel-content .desc-box {
  border-radius: 16px !important;
  padding: 10px !important;
  background: var(--soft) !important;
  border: 1px solid var(--line) !important;
}

/* =========================================================
   MANTENIMIENTO · ESTILO CALIDAD GLOBAL · V1
   Objetivo: igualar Mantenimiento a la misma escala visual que Calidad
   en móvil y escritorio.
   - Formularios: labels 10px, inputs/selects/textareas 11px.
   - Detalle lateral: etiquetas 9px, contenido 11px.
   - Cards/listados/tablas: escala compacta tipo Calidad.
   - No toca JS, Firebase, Firestore, Storage ni lógica.
   ========================================================= */

body.ramos-page-mantenimiento {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif !important;
}

/* Formularios propios de mantenimiento */
body.ramos-page-mantenimiento .label-tag,
body.ramos-page-mantenimiento .inc-field-label,
body.ramos-page-mantenimiento .mant-form-grid label,
body.ramos-page-mantenimiento .mant-subsection label,
body.ramos-page-mantenimiento .mant-list-tools label,
body.ramos-page-mantenimiento .mant-repuesto-toolbar label,
body.ramos-page-mantenimiento .mant-history-toolbar label,
body.ramos-page-mantenimiento .modal-card label:not(.mant-chip) {
  display: grid !important;
  gap: 7px !important;
  margin: 0 0 0.28rem !important;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif !important;
  font-size: 10px !important;
  font-weight: 950 !important;
  text-transform: uppercase !important;
  letter-spacing: .08em !important;
  color: var(--muted) !important;
  line-height: 1.2 !important;
}

body.ramos-page-mantenimiento .input-field,
body.ramos-page-mantenimiento input.input-field,
body.ramos-page-mantenimiento select.input-field,
body.ramos-page-mantenimiento textarea.input-field,
body.ramos-page-mantenimiento .search-field,
body.ramos-page-mantenimiento .filter-select,
body.ramos-page-mantenimiento select.filter-select,
body.ramos-page-mantenimiento .hhmm-input,
body.ramos-page-mantenimiento .mant-filter-search,
body.ramos-page-mantenimiento .mant-filter-select,
body.ramos-page-mantenimiento .mant-search-wrap input,
body.ramos-page-mantenimiento .mant-repuesto-toolbar .input-field,
body.ramos-page-mantenimiento .mant-list-tools .input-field,
body.ramos-page-mantenimiento .mant-history-toolbar .search-field {
  width: 100% !important;
  min-height: 46px !important;
  border: 1px solid var(--line) !important;
  background: var(--soft) !important;
  color: var(--text) !important;
  border-radius: 16px !important;
  padding: 13px 14px !important;
  outline: none !important;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  box-shadow: none !important;
}

body.ramos-page-mantenimiento textarea.input-field {
  min-height: 92px !important;
  resize: vertical !important;
  line-height: 1.35 !important;
}

body.ramos-page-mantenimiento select.input-field,
body.ramos-page-mantenimiento select.filter-select,
body.ramos-page-mantenimiento .filter-select,
body.ramos-page-mantenimiento .mant-filter-select {
  appearance: auto !important;
  -webkit-appearance: menulist !important;
  cursor: pointer !important;
}

body.ramos-page-mantenimiento .input-field::placeholder,
body.ramos-page-mantenimiento .search-field::placeholder,
body.ramos-page-mantenimiento .mant-search-wrap input::placeholder {
  color: var(--muted) !important;
  font-weight: 800 !important;
}

body.ramos-page-mantenimiento .input-field:focus,
body.ramos-page-mantenimiento input.input-field:focus,
body.ramos-page-mantenimiento select.input-field:focus,
body.ramos-page-mantenimiento textarea.input-field:focus,
body.ramos-page-mantenimiento .search-field:focus,
body.ramos-page-mantenimiento .filter-select:focus,
body.ramos-page-mantenimiento .mant-search-wrap input:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .10) !important;
  background: var(--card) !important;
}

/* Subbloques de formulario */
body.ramos-page-mantenimiento .mant-subsection {
  border-radius: 20px !important;
  padding: 12px !important;
  gap: 10px !important;
}

body.ramos-page-mantenimiento .mant-subtitle,
body.ramos-page-mantenimiento .section-kicker-incidencias,
body.ramos-page-mantenimiento .section-kicker-calidad,
body.ramos-page-mantenimiento .kpi-label {
  font-size: 10px !important;
  font-weight: 950 !important;
  text-transform: uppercase !important;
  letter-spacing: .10em !important;
  line-height: 1.15 !important;
}

body.ramos-page-mantenimiento .section-title-incidencias,
body.ramos-page-mantenimiento .section-title-calidad {
  font-size: 20px !important;
  font-weight: 950 !important;
  letter-spacing: -.035em !important;
  line-height: 1.08 !important;
}

body.ramos-page-mantenimiento .section-help-incidencias,
body.ramos-page-mantenimiento .section-help-calidad,
body.ramos-page-mantenimiento .mant-side-note,
body.ramos-page-mantenimiento .mant-file-help,
body.ramos-page-mantenimiento .mant-module-help,
body.ramos-page-mantenimiento .mant-associated-note,
body.ramos-page-mantenimiento .mant-inline-alert {
  font-size: 11px !important;
  font-weight: 800 !important;
  line-height: 1.35 !important;
}

/* Botones */
body.ramos-page-mantenimiento .btn,
body.ramos-page-mantenimiento .btn-neutro,
body.ramos-page-mantenimiento .btn-avanzar,
body.ramos-page-mantenimiento .mant-file-picker,
body.ramos-page-mantenimiento .mant-filter-clear,
body.ramos-page-mantenimiento .mant-file-open,
body.ramos-page-mantenimiento .modal-card .btn {
  min-height: 44px !important;
  border-radius: 16px !important;
  padding: 13px 16px !important;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif !important;
  font-size: 10px !important;
  font-weight: 950 !important;
  text-transform: uppercase !important;
  letter-spacing: .08em !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  white-space: nowrap !important;
}

body.ramos-page-mantenimiento .mant-compact-actions .btn,
body.ramos-page-mantenimiento .mant-compact-actions .btn-neutro,
body.ramos-page-mantenimiento .mant-file-open {
  min-height: 34px !important;
  padding: 8px 10px !important;
  border-radius: 12px !important;
  font-size: 8.5px !important;
}

/* Chips / badges */
body.ramos-page-mantenimiento .mant-chip,
body.ramos-page-mantenimiento .status-badge {
  font-size: 9px !important;
  font-weight: 950 !important;
  letter-spacing: .06em !important;
  padding: 6px 9px !important;
  border-radius: 999px !important;
  line-height: 1 !important;
}

/* Cards y listados de equipos/medios */
body.ramos-page-mantenimiento .mant-title,
body.ramos-page-mantenimiento .mant-card .mant-title {
  font-size: 16px !important;
  font-weight: 950 !important;
  letter-spacing: -.03em !important;
  line-height: 1.08 !important;
}

body.ramos-page-mantenimiento .mant-meta,
body.ramos-page-mantenimiento .mant-card .mant-meta {
  font-size: 11px !important;
  font-weight: 800 !important;
  line-height: 1.25 !important;
}

body.ramos-page-mantenimiento .mant-row-name,
body.ramos-page-mantenimiento .mant-area-row-title,
body.ramos-page-mantenimiento .mant-compact-title strong,
body.ramos-page-mantenimiento .mant-cost-row strong {
  font-size: 12px !important;
  font-weight: 950 !important;
  line-height: 1.15 !important;
}

body.ramos-page-mantenimiento .mant-row-meta,
body.ramos-page-mantenimiento .mant-area-row-sub,
body.ramos-page-mantenimiento .mant-compact-title small,
body.ramos-page-mantenimiento .mant-cost-row span,
body.ramos-page-mantenimiento .mant-list-info {
  font-size: 10px !important;
  font-weight: 800 !important;
  line-height: 1.25 !important;
}

body.ramos-page-mantenimiento .mant-info-label,
body.ramos-page-mantenimiento .mant-row-label,
body.ramos-page-mantenimiento .mant-compact-label,
body.ramos-page-mantenimiento .mant-area-row-kpi p,
body.ramos-page-mantenimiento .mant-file-meta {
  font-size: 9px !important;
  font-weight: 950 !important;
  text-transform: uppercase !important;
  letter-spacing: .08em !important;
  color: var(--muted) !important;
  line-height: 1.15 !important;
}

body.ramos-page-mantenimiento .mant-info-value,
body.ramos-page-mantenimiento .mant-row-value,
body.ramos-page-mantenimiento .mant-compact-value,
body.ramos-page-mantenimiento .mant-file-name {
  font-size: 11px !important;
  font-weight: 950 !important;
  line-height: 1.18 !important;
}

body.ramos-page-mantenimiento .mant-empty h3 {
  font-size: 20px !important;
  font-weight: 950 !important;
}

body.ramos-page-mantenimiento .mant-empty p {
  font-size: 11px !important;
  font-weight: 800 !important;
}

/* Búsquedas desplegables */
body.ramos-page-mantenimiento .mant-search-option strong,
body.ramos-page-mantenimiento .mant-module-option strong {
  font-size: 11px !important;
  font-weight: 950 !important;
  line-height: 1.15 !important;
}

body.ramos-page-mantenimiento .mant-search-option small,
body.ramos-page-mantenimiento .mant-selected-box,
body.ramos-page-mantenimiento .mant-order-selected,
body.ramos-page-mantenimiento .mant-selected-item,
body.ramos-page-mantenimiento .mant-pedido-inline {
  font-size: 10px !important;
  font-weight: 850 !important;
  line-height: 1.25 !important;
}

body.ramos-page-mantenimiento .mant-module-option:after {
  font-size: 8px !important;
  font-weight: 950 !important;
}

/* Tabla / filas compactas */
body.ramos-page-mantenimiento .desktop-table,
body.ramos-page-mantenimiento .mant-table {
  font-size: 11px !important;
}

body.ramos-page-mantenimiento .desktop-table thead th,
body.ramos-page-mantenimiento .mant-table thead th {
  font-size: 9px !important;
  font-weight: 950 !important;
  text-transform: uppercase !important;
  letter-spacing: .08em !important;
}

body.ramos-page-mantenimiento .desktop-table tbody td,
body.ramos-page-mantenimiento .mant-table tbody td {
  font-size: 11px !important;
  font-weight: 850 !important;
  line-height: 1.25 !important;
}

/* Detalle lateral de mantenimiento: igual que Calidad */
body.ramos-page-mantenimiento #panel-content .label-tag,
body.ramos-page-mantenimiento #panel-content .kpi-label,
body.ramos-page-mantenimiento #panel-content .mant-info-label,
body.ramos-page-mantenimiento #panel-content .text-\[9px\],
body.ramos-page-mantenimiento #panel-content .text-\[10px\] {
  font-size: 9px !important;
  font-weight: 950 !important;
  text-transform: uppercase !important;
  letter-spacing: .08em !important;
  color: var(--muted) !important;
  line-height: 1.15 !important;
}

body.ramos-page-mantenimiento #panel-content .mant-info-value,
body.ramos-page-mantenimiento #panel-content .mant-side-note,
body.ramos-page-mantenimiento #panel-content .mant-inline-alert,
body.ramos-page-mantenimiento #panel-content .mant-file-name,
body.ramos-page-mantenimiento #panel-content .mant-row-value,
body.ramos-page-mantenimiento #panel-content .text-sm,
body.ramos-page-mantenimiento #panel-content .text-xs,
body.ramos-page-mantenimiento #panel-content p:not(.label-tag):not(.kpi-label):not(.mant-info-label) {
  font-size: 11px !important;
  font-weight: 850 !important;
  line-height: 1.35 !important;
}

body.ramos-page-mantenimiento #panel-content h2,
body.ramos-page-mantenimiento #panel-content .text-2xl {
  font-size: 22px !important;
  font-weight: 950 !important;
  line-height: 1.08 !important;
  letter-spacing: -.04em !important;
}

body.ramos-page-mantenimiento #panel-content .font-black.text-sm,
body.ramos-page-mantenimiento #panel-content .text-sm.font-black {
  font-size: 12px !important;
  font-weight: 950 !important;
  line-height: 1.15 !important;
}

/* Modales de mantenimiento */
body.ramos-page-mantenimiento .modal-card h2,
body.ramos-page-mantenimiento .modal-card .text-xl {
  font-size: 20px !important;
  font-weight: 950 !important;
  letter-spacing: -.035em !important;
  line-height: 1.08 !important;
}

body.ramos-page-mantenimiento .modal-close,
body.ramos-page-mantenimiento .panel-close-btn {
  width: 38px !important;
  height: 38px !important;
  min-height: 38px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  font-size: 20px !important;
  align-self: flex-start !important;
  flex-shrink: 0 !important;
}

/* Botonera móvil */
body.ramos-page-mantenimiento .mobile-quick-btn strong {
  font-size: 11px !important;
  font-weight: 950 !important;
  text-transform: uppercase !important;
  letter-spacing: .055em !important;
  line-height: 1.12 !important;
}

body.ramos-page-mantenimiento .mobile-quick-btn span span,
body.ramos-page-mantenimiento .mobile-quick-help {
  font-size: 9px !important;
  font-weight: 850 !important;
  line-height: 1.15 !important;
}

body.ramos-page-mantenimiento .mobile-quick-title {
  font-size: 18px !important;
  font-weight: 950 !important;
  letter-spacing: -.03em !important;
}

body.ramos-page-mantenimiento .mobile-quick-kicker {
  font-size: 9px !important;
  font-weight: 950 !important;
  text-transform: uppercase !important;
  letter-spacing: .08em !important;
}

/* Móvil: misma escala que Calidad, sin subir a 16px */
@media (max-width: 899px) {

  body.ramos-page-mantenimiento .input-field,
  body.ramos-page-mantenimiento input.input-field,
  body.ramos-page-mantenimiento select.input-field,
  body.ramos-page-mantenimiento textarea.input-field,
  body.ramos-page-mantenimiento .search-field,
  body.ramos-page-mantenimiento .filter-select,
  body.ramos-page-mantenimiento select.filter-select,
  body.ramos-page-mantenimiento .hhmm-input,
  body.ramos-page-mantenimiento .mant-search-wrap input {
    font-size: 11px !important;
    min-height: 46px !important;
    padding: 13px 14px !important;
    border-radius: 16px !important;
  }

  body.ramos-page-mantenimiento .label-tag,
  body.ramos-page-mantenimiento .inc-field-label,
  body.ramos-page-mantenimiento .mant-form-grid label,
  body.ramos-page-mantenimiento .mant-subsection label {
    font-size: 10px !important;
  }

  body.ramos-page-mantenimiento .mant-card {
    border-radius: 24px !important;
    padding: 14px !important;
  }

  body.ramos-page-mantenimiento .mant-title {
    font-size: 16px !important;
  }

  body.ramos-page-mantenimiento .mant-meta,
  body.ramos-page-mantenimiento .mant-info-value,
  body.ramos-page-mantenimiento .mant-row-value {
    font-size: 11px !important;
  }

  body.ramos-page-mantenimiento #panel-content h2,
  body.ramos-page-mantenimiento #panel-content .text-2xl {
    font-size: 20px !important;
  }
}

/* =========================================================
   MEDIOS · ESTILO CALIDAD GLOBAL · V6
   Igualación de escala visual con Calidad para móvil y escritorio.
   - Labels: 10px
   - Inputs/selects/textareas/buscadores: 11px
   - Detalle lateral: contenido 11px, etiquetas 9px
   - Cards/listados/badges/botones en la misma escala que Incidencias y Mantenimiento
   ========================================================= */

body.ramos-page-medios {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif !important;
}

/* Formularios, filtros y controles */
body.ramos-page-medios .label-tag,
body.ramos-page-medios .inc-field-label,
body.ramos-page-medios .medios-form-grid label,
body.ramos-page-medios .medios-subsection label,
body.ramos-page-medios .camion-height-check-field label,
body.ramos-page-medios .modal-card label:not(.flex),
body.ramos-page-medios #panel-content .label-tag {
  display: grid !important;
  gap: 7px !important;
  margin: 0 0 0.28rem !important;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif !important;
  font-size: 10px !important;
  font-weight: 950 !important;
  text-transform: uppercase !important;
  letter-spacing: .08em !important;
  color: var(--muted) !important;
  line-height: 1.2 !important;
}

body.ramos-page-medios .input-field,
body.ramos-page-medios input.input-field,
body.ramos-page-medios select.input-field,
body.ramos-page-medios textarea.input-field,
body.ramos-page-medios .search-field,
body.ramos-page-medios .filter-select,
body.ramos-page-medios select.filter-select,
body.ramos-page-medios .camion-height-check-field input {
  width: 100% !important;
  min-height: 46px !important;
  border: 1px solid var(--line) !important;
  background: var(--soft) !important;
  color: var(--text) !important;
  border-radius: 16px !important;
  padding: 13px 14px !important;
  outline: none !important;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  box-shadow: none !important;
}

body.ramos-page-medios textarea.input-field {
  min-height: 92px !important;
  resize: vertical !important;
  line-height: 1.35 !important;
}

body.ramos-page-medios select.input-field,
body.ramos-page-medios select.filter-select,
body.ramos-page-medios .filter-select {
  appearance: auto !important;
  -webkit-appearance: menulist !important;
  cursor: pointer !important;
}

body.ramos-page-medios .input-field::placeholder,
body.ramos-page-medios .search-field::placeholder,
body.ramos-page-medios .camion-height-check-field input::placeholder {
  color: var(--muted) !important;
  font-weight: 800 !important;
}

body.ramos-page-medios .input-field:focus,
body.ramos-page-medios input.input-field:focus,
body.ramos-page-medios select.input-field:focus,
body.ramos-page-medios textarea.input-field:focus,
body.ramos-page-medios .search-field:focus,
body.ramos-page-medios .filter-select:focus,
body.ramos-page-medios select.filter-select:focus,
body.ramos-page-medios .camion-height-check-field input:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .10) !important;
  background: var(--card) !important;
}

/* Secciones de formulario */
body.ramos-page-medios .medios-subsection {
  border-radius: 20px !important;
  padding: 12px !important;
  gap: 10px !important;
}

body.ramos-page-medios .medios-subtitle {
  margin: 0 !important;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif !important;
  font-size: 10px !important;
  font-weight: 950 !important;
  text-transform: uppercase !important;
  letter-spacing: .10em !important;
  line-height: 1.2 !important;
}

body.ramos-page-medios .medios-help-note,
body.ramos-page-medios .rev-alert,
body.ramos-page-medios .camion-height-check-help,
body.ramos-page-medios .camion-height-check-result,
body.ramos-page-medios .section-help-incidencias {
  font-size: 11px !important;
  font-weight: 800 !important;
  line-height: 1.35 !important;
}

/* Cards móviles y tarjetas de medios */
body.ramos-page-medios .medio-card {
  border-radius: 24px !important;
  padding: 14px !important;
}

body.ramos-page-medios .medio-title {
  margin: 0 !important;
  font-size: 16px !important;
  font-weight: 950 !important;
  letter-spacing: -.03em !important;
  line-height: 1.08 !important;
  color: var(--text) !important;
}

body.ramos-page-medios .medio-meta {
  margin: 5px 0 0 !important;
  color: var(--muted) !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  line-height: 1.35 !important;
}

body.ramos-page-medios .medio-info-box {
  border-radius: 16px !important;
  padding: 10px !important;
}

body.ramos-page-medios .medio-info-label {
  margin: 0 0 4px !important;
  color: var(--muted) !important;
  font-size: 9px !important;
  font-weight: 950 !important;
  text-transform: uppercase !important;
  letter-spacing: .08em !important;
  line-height: 1.15 !important;
}

body.ramos-page-medios .medio-info-value {
  margin: 0 !important;
  font-size: 11px !important;
  font-weight: 850 !important;
  color: var(--text) !important;
  line-height: 1.35 !important;
  overflow-wrap: anywhere !important;
}

/* Badges y chips */
body.ramos-page-medios .medios-type-chip,
body.ramos-page-medios .rev-chip,
body.ramos-page-medios .status-badge,
body.ramos-page-medios .camion-height-ok-chip {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif !important;
  font-size: 9px !important;
  font-weight: 950 !important;
  text-transform: uppercase !important;
  letter-spacing: .055em !important;
  line-height: 1 !important;
  border-radius: 999px !important;
  padding: 6px 9px !important;
}

/* Tabla desktop */
body.ramos-page-medios .desktop-table,
body.ramos-page-medios .medios-table {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif !important;
  font-size: 11px !important;
}

body.ramos-page-medios .desktop-table thead th,
body.ramos-page-medios .medios-table thead th,
body.ramos-page-medios .height-table th {
  font-size: 9px !important;
  font-weight: 950 !important;
  text-transform: uppercase !important;
  letter-spacing: .08em !important;
  color: var(--muted) !important;
}

body.ramos-page-medios .desktop-table tbody td,
body.ramos-page-medios .medios-table tbody td,
body.ramos-page-medios .height-table td {
  font-size: 11px !important;
  font-weight: 800 !important;
  line-height: 1.3 !important;
}

body.ramos-page-medios .desktop-table tbody td p.font-black,
body.ramos-page-medios .medios-table tbody td p.font-black {
  font-size: 12px !important;
  font-weight: 950 !important;
  line-height: 1.15 !important;
}

body.ramos-page-medios .desktop-table tbody td .text-\[10px\],
body.ramos-page-medios .medios-table tbody td .text-\[10px\] {
  font-size: 10px !important;
  font-weight: 800 !important;
}

/* Detalle lateral: mismo criterio que Calidad */
body.ramos-page-medios #panel-content h2,
body.ramos-page-medios #panel-content .text-2xl {
  font-size: 20px !important;
  font-weight: 950 !important;
  letter-spacing: -.035em !important;
  line-height: 1.08 !important;
}

body.ramos-page-medios #panel-content .card {
  border-radius: 22px !important;
}

body.ramos-page-medios #panel-content .label-tag,
body.ramos-page-medios #panel-content .medio-info-label,
body.ramos-page-medios #panel-content .text-\[9px\],
body.ramos-page-medios #panel-content .text-\[10px\] {
  font-size: 9px !important;
  font-weight: 950 !important;
  text-transform: uppercase !important;
  letter-spacing: .08em !important;
  color: var(--muted) !important;
  line-height: 1.15 !important;
}

body.ramos-page-medios #panel-content .medio-info-value,
body.ramos-page-medios #panel-content .rev-alert,
body.ramos-page-medios #panel-content .medios-help-note,
body.ramos-page-medios #panel-content .text-sm,
body.ramos-page-medios #panel-content .text-xs,
body.ramos-page-medios #panel-content p:not(.label-tag):not(.medio-info-label) {
  font-size: 11px !important;
  font-weight: 850 !important;
  line-height: 1.35 !important;
}

body.ramos-page-medios .medios-attach-name {
  font-size: 11px !important;
  font-weight: 950 !important;
  line-height: 1.15 !important;
}

body.ramos-page-medios .medios-attach-meta {
  font-size: 9px !important;
  font-weight: 800 !important;
  line-height: 1.25 !important;
}

/* Botones */
body.ramos-page-medios .modal-card .btn,
body.ramos-page-medios .inc-filter-clear-btn,
body.ramos-page-medios .btn-neutro,
body.ramos-page-medios .file-picker-button,
body.ramos-page-medios .camion-height-check-form .btn {
  min-height: 44px !important;
  border-radius: 16px !important;
  padding: 13px 16px !important;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif !important;
  font-size: 10px !important;
  font-weight: 950 !important;
  text-transform: uppercase !important;
  letter-spacing: .08em !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  white-space: nowrap !important;
}

body.ramos-page-medios .panel-close-btn,
body.ramos-page-medios .modal-card button[onclick*="cerrarModal"] {
  width: 38px !important;
  height: 38px !important;
  min-height: 38px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  font-size: 20px !important;
  align-self: flex-start !important;
  flex-shrink: 0 !important;
}

/* Botonera móvil */
body.ramos-page-medios .mobile-quick-btn strong {
  font-size: 11px !important;
  font-weight: 950 !important;
  text-transform: uppercase !important;
  letter-spacing: .055em !important;
  line-height: 1.12 !important;
}

body.ramos-page-medios .mobile-quick-btn span span,
body.ramos-page-medios .mobile-quick-help {
  font-size: 9px !important;
  font-weight: 850 !important;
  line-height: 1.15 !important;
}

body.ramos-page-medios .mobile-quick-title {
  font-size: 18px !important;
  font-weight: 950 !important;
  letter-spacing: -.03em !important;
}

body.ramos-page-medios .mobile-quick-kicker {
  font-size: 9px !important;
  font-weight: 950 !important;
  text-transform: uppercase !important;
  letter-spacing: .08em !important;
}

/* Comprobador altura camiones */
body.ramos-page-medios .camion-height-check-title {
  font-size: 12px !important;
  font-weight: 950 !important;
  letter-spacing: -.02em !important;
}

body.ramos-page-medios .camion-height-check-field {
  width: 150px !important;
}

/* Móvil: misma escala que Calidad, sin subir a 16px */
@media (max-width: 899px) {

  body.ramos-page-medios .input-field,
  body.ramos-page-medios input.input-field,
  body.ramos-page-medios select.input-field,
  body.ramos-page-medios textarea.input-field,
  body.ramos-page-medios .search-field,
  body.ramos-page-medios .filter-select,
  body.ramos-page-medios select.filter-select,
  body.ramos-page-medios .camion-height-check-field input {
    font-size: 11px !important;
    min-height: 46px !important;
    padding: 13px 14px !important;
    border-radius: 16px !important;
  }

  body.ramos-page-medios .label-tag,
  body.ramos-page-medios .inc-field-label,
  body.ramos-page-medios .medios-form-grid label,
  body.ramos-page-medios .medios-subsection label {
    font-size: 10px !important;
  }

  body.ramos-page-medios .medio-card {
    border-radius: 24px !important;
    padding: 14px !important;
  }

  body.ramos-page-medios .medio-title {
    font-size: 16px !important;
  }

  body.ramos-page-medios .medio-meta,
  body.ramos-page-medios .medio-info-value {
    font-size: 11px !important;
  }

  body.ramos-page-medios #panel-content h2,
  body.ramos-page-medios #panel-content .text-2xl {
    font-size: 20px !important;
  }

  body.ramos-page-medios .camion-height-check-field {
    width: 100% !important;
  }
}

/* =========================================================
   FIX FINAL · MENÚS DESKTOP MEDIOS + MANTENIMIENTO · SUAVE
   Objetivo:
   - Botones normales: claros, no oscuros.
   - Botón seleccionado: azul difuminado tipo Calidad/Reprocesos.
   - Cubre Medios: .active, .ring-4, .border-blue-300.
   - Cubre Mantenimiento: .active-tile y .active.
   - Solo CSS visual. No toca JS, Firebase ni lógica.
   ========================================================= */

@media (min-width: 900px) {

  /* Estado normal desktop: NO oscuro */
  body.ramos-page-medios .incidencias-side-col .inc-action-tile-safe,
  body.ramos-page-mantenimiento .incidencias-side-col .inc-action-tile-safe {
    background: var(--card) !important;
    color: var(--text) !important;
    border: 1px solid var(--line) !important;
    box-shadow: 0 10px 26px rgba(15, 23, 42, .055) !important;
    border-radius: 1.45rem !important;
  }

  body.ramos-page-medios .incidencias-side-col .inc-action-tile-safe strong,
  body.ramos-page-mantenimiento .incidencias-side-col .inc-action-tile-safe strong {
    color: var(--text) !important;
  }

  body.ramos-page-medios .incidencias-side-col .inc-action-tile-safe span,
  body.ramos-page-mantenimiento .incidencias-side-col .inc-action-tile-safe span {
    color: var(--muted) !important;
  }

  /* Icono normal: suave, aunque tenga clases Tailwind bg-blue-600/bg-red-600/etc. */
  body.ramos-page-medios .incidencias-side-col .inc-action-tile-safe .inc-action-icon-safe,
  body.ramos-page-mantenimiento .incidencias-side-col .inc-action-tile-safe .inc-action-icon-safe {
    background: rgba(37, 99, 235, .10) !important;
    color: #2563eb !important;
    box-shadow: none !important;
  }

  body.dark.ramos-page-medios .incidencias-side-col .inc-action-tile-safe .inc-action-icon-safe,
  body.dark.ramos-page-mantenimiento .incidencias-side-col .inc-action-tile-safe .inc-action-icon-safe {
    background: rgba(56, 189, 248, .12) !important;
    color: #38bdf8 !important;
  }

  /* Estado seleccionado desktop: azul difuminado, no azul oscuro */
  body.ramos-page-medios .incidencias-side-col .inc-action-tile-safe.active,
  body.ramos-page-medios .incidencias-side-col .inc-action-tile-safe.ring-4,
  body.ramos-page-medios .incidencias-side-col .inc-action-tile-safe.border-blue-300,
  body.ramos-page-mantenimiento .incidencias-side-col .inc-action-tile-safe.active,
  body.ramos-page-mantenimiento .incidencias-side-col .inc-action-tile-safe.active-tile {
    background:
      radial-gradient(circle at 0% 0%, rgba(37, 99, 235, .18), transparent 40%),
      linear-gradient(135deg, #eff6ff 0%, #ffffff 100%) !important;
    color: #0f172a !important;
    border-color: #2563eb !important;
    box-shadow: 0 12px 28px rgba(37, 99, 235, .14) !important;
  }

  body.ramos-page-medios .incidencias-side-col .inc-action-tile-safe.active strong,
  body.ramos-page-medios .incidencias-side-col .inc-action-tile-safe.ring-4 strong,
  body.ramos-page-medios .incidencias-side-col .inc-action-tile-safe.border-blue-300 strong,
  body.ramos-page-mantenimiento .incidencias-side-col .inc-action-tile-safe.active strong,
  body.ramos-page-mantenimiento .incidencias-side-col .inc-action-tile-safe.active-tile strong {
    color: #0f172a !important;
  }

  body.ramos-page-medios .incidencias-side-col .inc-action-tile-safe.active span,
  body.ramos-page-medios .incidencias-side-col .inc-action-tile-safe.ring-4 span,
  body.ramos-page-medios .incidencias-side-col .inc-action-tile-safe.border-blue-300 span,
  body.ramos-page-mantenimiento .incidencias-side-col .inc-action-tile-safe.active span,
  body.ramos-page-mantenimiento .incidencias-side-col .inc-action-tile-safe.active-tile span {
    color: #64748b !important;
  }

  body.ramos-page-medios .incidencias-side-col .inc-action-tile-safe.active .inc-action-icon-safe,
  body.ramos-page-medios .incidencias-side-col .inc-action-tile-safe.ring-4 .inc-action-icon-safe,
  body.ramos-page-medios .incidencias-side-col .inc-action-tile-safe.border-blue-300 .inc-action-icon-safe,
  body.ramos-page-mantenimiento .incidencias-side-col .inc-action-tile-safe.active .inc-action-icon-safe,
  body.ramos-page-mantenimiento .incidencias-side-col .inc-action-tile-safe.active-tile .inc-action-icon-safe {
    background: rgba(37, 99, 235, .14) !important;
    color: #1d4ed8 !important;
  }

  /* Modo oscuro: seleccionado suave azul, no negro */
  body.dark.ramos-page-medios .incidencias-side-col .inc-action-tile-safe.active,
  body.dark.ramos-page-medios .incidencias-side-col .inc-action-tile-safe.ring-4,
  body.dark.ramos-page-medios .incidencias-side-col .inc-action-tile-safe.border-blue-300,
  body.dark.ramos-page-mantenimiento .incidencias-side-col .inc-action-tile-safe.active,
  body.dark.ramos-page-mantenimiento .incidencias-side-col .inc-action-tile-safe.active-tile {
    background:
      radial-gradient(circle at 0% 0%, rgba(56, 189, 248, .20), transparent 42%),
      rgba(56, 189, 248, .08) !important;
    color: var(--text) !important;
    border-color: #38bdf8 !important;
    box-shadow: 0 12px 28px rgba(56, 189, 248, .10) !important;
  }

  body.dark.ramos-page-medios .incidencias-side-col .inc-action-tile-safe.active strong,
  body.dark.ramos-page-medios .incidencias-side-col .inc-action-tile-safe.ring-4 strong,
  body.dark.ramos-page-medios .incidencias-side-col .inc-action-tile-safe.border-blue-300 strong,
  body.dark.ramos-page-mantenimiento .incidencias-side-col .inc-action-tile-safe.active strong,
  body.dark.ramos-page-mantenimiento .incidencias-side-col .inc-action-tile-safe.active-tile strong {
    color: var(--text) !important;
  }

  body.dark.ramos-page-medios .incidencias-side-col .inc-action-tile-safe.active span,
  body.dark.ramos-page-medios .incidencias-side-col .inc-action-tile-safe.ring-4 span,
  body.dark.ramos-page-medios .incidencias-side-col .inc-action-tile-safe.border-blue-300 span,
  body.dark.ramos-page-mantenimiento .incidencias-side-col .inc-action-tile-safe.active span,
  body.dark.ramos-page-mantenimiento .incidencias-side-col .inc-action-tile-safe.active-tile span {
    color: var(--muted) !important;
  }

  body.dark.ramos-page-medios .incidencias-side-col .inc-action-tile-safe.active .inc-action-icon-safe,
  body.dark.ramos-page-medios .incidencias-side-col .inc-action-tile-safe.ring-4 .inc-action-icon-safe,
  body.dark.ramos-page-medios .incidencias-side-col .inc-action-tile-safe.border-blue-300 .inc-action-icon-safe,
  body.dark.ramos-page-mantenimiento .incidencias-side-col .inc-action-tile-safe.active .inc-action-icon-safe,
  body.dark.ramos-page-mantenimiento .incidencias-side-col .inc-action-tile-safe.active-tile .inc-action-icon-safe {
    background: rgba(56, 189, 248, .16) !important;
    color: #38bdf8 !important;
  }
}

/* =========================================================
   AJUSTE FINAL MENÚS · MEDICIONES / INCIDENCIAS / TURNOS
   - No toca Medios ni Mantenimiento: quedan excluidos explícitamente.
   - Sustituye el negro de los botones seleccionados por azul difuminado.
   - Turnos mantiene botones claros y marca seleccionados con el mismo difuminado.
   ========================================================= */

/* INCIDENCIAS: solo Incidencias real, no Medios/Mantenimiento que heredan esta clase */
body.ramos-page-incidencias:not(.ramos-page-medios):not(.ramos-page-mantenimiento) .incidencias-side-col .inc-action-tile-safe {
  background:
    radial-gradient(circle at 0% 0%, rgba(37, 99, 235, .06), transparent 36%),
    var(--card) !important;
  color: var(--text) !important;
  border: 1px solid var(--line) !important;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .045) !important;
}

body.ramos-page-incidencias:not(.ramos-page-medios):not(.ramos-page-mantenimiento) .incidencias-side-col .inc-action-tile-safe.ring-4,
body.ramos-page-incidencias:not(.ramos-page-medios):not(.ramos-page-mantenimiento) .incidencias-side-col .inc-action-tile-safe.active,
body.ramos-page-incidencias:not(.ramos-page-medios):not(.ramos-page-mantenimiento) #btn-vista-activas.ring-4,
body.ramos-page-incidencias:not(.ramos-page-medios):not(.ramos-page-mantenimiento) #btn-vista-historico.ring-4 {
  background:
    radial-gradient(circle at 0% 0%, rgba(37, 99, 235, .18), transparent 40%),
    linear-gradient(135deg, #eff6ff 0%, #ffffff 68%) !important;
  color: #0f172a !important;
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .10), 0 12px 28px rgba(37, 99, 235, .12) !important;
  outline: none !important;
}

body.ramos-page-incidencias:not(.ramos-page-medios):not(.ramos-page-mantenimiento) .incidencias-side-col .inc-action-tile-safe .inc-action-icon-safe,
body.ramos-page-incidencias:not(.ramos-page-medios):not(.ramos-page-mantenimiento) #btn-vista-activas .inc-action-icon-safe,
body.ramos-page-incidencias:not(.ramos-page-medios):not(.ramos-page-mantenimiento) #btn-vista-historico .inc-action-icon-safe {
  background: rgba(37, 99, 235, .10) !important;
  color: #1d4ed8 !important;
  border: 1px solid rgba(37, 99, 235, .14) !important;
}

body.ramos-page-incidencias:not(.ramos-page-medios):not(.ramos-page-mantenimiento) .incidencias-side-col .inc-action-tile-safe.ring-4 .inc-action-icon-safe,
body.ramos-page-incidencias:not(.ramos-page-medios):not(.ramos-page-mantenimiento) .incidencias-side-col .inc-action-tile-safe.active .inc-action-icon-safe,
body.ramos-page-incidencias:not(.ramos-page-medios):not(.ramos-page-mantenimiento) #btn-vista-activas.ring-4 .inc-action-icon-safe,
body.ramos-page-incidencias:not(.ramos-page-medios):not(.ramos-page-mantenimiento) #btn-vista-historico.ring-4 .inc-action-icon-safe {
  background: rgba(37, 99, 235, .14) !important;
  color: #1d4ed8 !important;
  border-color: rgba(37, 99, 235, .18) !important;
}

body.ramos-page-incidencias:not(.ramos-page-medios):not(.ramos-page-mantenimiento) .incidencias-side-col .inc-action-tile-safe.ring-4 strong,
body.ramos-page-incidencias:not(.ramos-page-medios):not(.ramos-page-mantenimiento) .incidencias-side-col .inc-action-tile-safe.active strong,
body.ramos-page-incidencias:not(.ramos-page-medios):not(.ramos-page-mantenimiento) #btn-vista-activas.ring-4 strong,
body.ramos-page-incidencias:not(.ramos-page-medios):not(.ramos-page-mantenimiento) #btn-vista-historico.ring-4 strong {
  color: #0f172a !important;
}

body.ramos-page-incidencias:not(.ramos-page-medios):not(.ramos-page-mantenimiento) .incidencias-side-col .inc-action-tile-safe.ring-4 span,
body.ramos-page-incidencias:not(.ramos-page-medios):not(.ramos-page-mantenimiento) .incidencias-side-col .inc-action-tile-safe.active span,
body.ramos-page-incidencias:not(.ramos-page-medios):not(.ramos-page-mantenimiento) #btn-vista-activas.ring-4 span,
body.ramos-page-incidencias:not(.ramos-page-medios):not(.ramos-page-mantenimiento) #btn-vista-historico.ring-4 span {
  color: #64748b !important;
  opacity: 1 !important;
}

body.dark.ramos-page-incidencias:not(.ramos-page-medios):not(.ramos-page-mantenimiento) .incidencias-side-col .inc-action-tile-safe.ring-4,
body.dark.ramos-page-incidencias:not(.ramos-page-medios):not(.ramos-page-mantenimiento) .incidencias-side-col .inc-action-tile-safe.active,
body.dark.ramos-page-incidencias:not(.ramos-page-medios):not(.ramos-page-mantenimiento) #btn-vista-activas.ring-4,
body.dark.ramos-page-incidencias:not(.ramos-page-medios):not(.ramos-page-mantenimiento) #btn-vista-historico.ring-4 {
  background:
    radial-gradient(circle at 0% 0%, rgba(56, 189, 248, .20), transparent 40%),
    rgba(56, 189, 248, .09) !important;
  color: var(--text) !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, .10), 0 12px 28px rgba(56, 189, 248, .10) !important;
}

body.dark.ramos-page-incidencias:not(.ramos-page-medios):not(.ramos-page-mantenimiento) .incidencias-side-col .inc-action-tile-safe.ring-4 strong,
body.dark.ramos-page-incidencias:not(.ramos-page-medios):not(.ramos-page-mantenimiento) .incidencias-side-col .inc-action-tile-safe.active strong,
body.dark.ramos-page-incidencias:not(.ramos-page-medios):not(.ramos-page-mantenimiento) #btn-vista-activas.ring-4 strong,
body.dark.ramos-page-incidencias:not(.ramos-page-medios):not(.ramos-page-mantenimiento) #btn-vista-historico.ring-4 strong {
  color: var(--text) !important;
}

body.dark.ramos-page-incidencias:not(.ramos-page-medios):not(.ramos-page-mantenimiento) .incidencias-side-col .inc-action-tile-safe.ring-4 span,
body.dark.ramos-page-incidencias:not(.ramos-page-medios):not(.ramos-page-mantenimiento) .incidencias-side-col .inc-action-tile-safe.active span,
body.dark.ramos-page-incidencias:not(.ramos-page-medios):not(.ramos-page-mantenimiento) #btn-vista-activas.ring-4 span,
body.dark.ramos-page-incidencias:not(.ramos-page-medios):not(.ramos-page-mantenimiento) #btn-vista-historico.ring-4 span {
  color: var(--muted) !important;
}

/* MEDICIONES: sustituye el negro de la opción seleccionada por el mismo azul difuminado */
body.ramos-page-mediciones .med-action-tile.ring-2,
body.ramos-page-mediciones .med-action-tile.bg-blue-50,
body.ramos-page-mediciones .med-action-tile.active {
  background:
    radial-gradient(circle at 0% 0%, rgba(37, 99, 235, .18), transparent 40%),
    linear-gradient(135deg, #eff6ff 0%, #ffffff 68%) !important;
  color: #0f172a !important;
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .10), 0 12px 28px rgba(37, 99, 235, .12) !important;
}

body.ramos-page-mediciones .med-action-tile.ring-2 .med-action-icon,
body.ramos-page-mediciones .med-action-tile.bg-blue-50 .med-action-icon,
body.ramos-page-mediciones .med-action-tile.active .med-action-icon {
  background: rgba(37, 99, 235, .14) !important;
  color: #1d4ed8 !important;
  border: 1px solid rgba(37, 99, 235, .18) !important;
}

body.ramos-page-mediciones .med-action-tile.ring-2 strong,
body.ramos-page-mediciones .med-action-tile.bg-blue-50 strong,
body.ramos-page-mediciones .med-action-tile.active strong {
  color: #0f172a !important;
}

body.ramos-page-mediciones .med-action-tile.ring-2 span,
body.ramos-page-mediciones .med-action-tile.bg-blue-50 span,
body.ramos-page-mediciones .med-action-tile.active span {
  color: #64748b !important;
  opacity: 1 !important;
}

body.ramos-page-mediciones.dark .med-action-tile.ring-2,
body.ramos-page-mediciones.dark .med-action-tile.bg-blue-50,
body.ramos-page-mediciones.dark .med-action-tile.active {
  background:
    radial-gradient(circle at 0% 0%, rgba(56, 189, 248, .20), transparent 40%),
    rgba(56, 189, 248, .09) !important;
  color: var(--text) !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, .10), 0 12px 28px rgba(56, 189, 248, .10) !important;
}

body.ramos-page-mediciones.dark .med-action-tile.ring-2 .med-action-icon,
body.ramos-page-mediciones.dark .med-action-tile.bg-blue-50 .med-action-icon,
body.ramos-page-mediciones.dark .med-action-tile.active .med-action-icon {
  background: rgba(56, 189, 248, .14) !important;
  color: #38bdf8 !important;
  border-color: rgba(56, 189, 248, .20) !important;
}

body.ramos-page-mediciones.dark .med-action-tile.ring-2 strong,
body.ramos-page-mediciones.dark .med-action-tile.bg-blue-50 strong,
body.ramos-page-mediciones.dark .med-action-tile.active strong {
  color: var(--text) !important;
}

body.ramos-page-mediciones.dark .med-action-tile.ring-2 span,
body.ramos-page-mediciones.dark .med-action-tile.bg-blue-50 span,
body.ramos-page-mediciones.dark .med-action-tile.active span {
  color: var(--muted) !important;
}

/* =========================================================
   MEDICIONES · LISTADO MÓVIL · TAMAÑOS IGUALADOS A INCIDENCIAS
   Las cards de mediciones usan clases Tailwind (text-lg, text-sm, text-xs)
   que ignoran el font-size del body. Se sobreescriben aquí para que
   se vean igual que las cards de incidencias en móvil.
   ========================================================= */
@media (max-width: 899px) {

  /* Nombre del cliente: equivale a inc-title (16px) */
  body.ramos-page-mediciones #lista-mediciones .text-lg {
    font-size: 16px !important;
    font-weight: 950 !important;
    letter-spacing: -.03em !important;
    line-height: 1.08 !important;
    color: var(--text) !important;
  }

  /* Descripción / notas: equivale a la descripción de incidencias */
  body.ramos-page-mediciones #lista-mediciones .text-sm {
    font-size: 11px !important;
    font-weight: 800 !important;
    line-height: 1.35 !important;
    color: var(--text) !important;
  }

  /* Dirección, teléfono, datos secundarios */
  body.ramos-page-mediciones #lista-mediciones .text-xs {
    font-size: 10px !important;
    font-weight: 800 !important;
    line-height: 1.3 !important;
    color: var(--muted) !important;
  }

  /* Labels de estado / pills */
  body.ramos-page-mediciones #lista-mediciones .mobile-pill {
    font-size: 9px !important;
    font-weight: 950 !important;
    letter-spacing: .06em !important;
    padding: 5px 9px !important;
    border-radius: 999px !important;
  }
}

@media (max-width: 420px) {

  /* Pantallas muy pequeñas: bajar un punto más, igual que incidencias */
  body.ramos-page-mediciones #lista-mediciones .text-lg {
    font-size: 15px !important;
  }

  body.ramos-page-mediciones #lista-mediciones .text-sm {
    font-size: 11px !important;
  }

  body.ramos-page-mediciones #lista-mediciones .text-xs {
    font-size: 10px !important;
  }
}

/* TURNOS: botones claros con toque azul y seleccionados con azul difuminado */
@media (min-width: 1100px) {

  body.ramos-page-turnos .desktop-pro-sidebar .desktop-pro-action,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-pro-action,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-header-action,
  body.ramos-page-turnos .desktop-top-view-button,
  body.ramos-page-turnos .desktop-pro-nav-card {
    background:
      radial-gradient(circle at 0% 0%, rgba(37, 99, 235, .06), transparent 36%),
      var(--card) !important;
    color: var(--text) !important;
    border-color: var(--line) !important;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .045) !important;
  }

  body.ramos-page-turnos .desktop-pro-action.dark,
  body.ramos-page-turnos .desktop-pro-action.active,
  body.ramos-page-turnos .desktop-pro-action.ring-2,
  body.ramos-page-turnos .desktop-pro-action.bg-blue-50,
  body.ramos-page-turnos .desktop-top-view-button.dark,
  body.ramos-page-turnos .desktop-top-view-button.active,
  body.ramos-page-turnos .desktop-top-view-button.ring-2,
  body.ramos-page-turnos .desktop-top-view-button.bg-blue-50,
  body.ramos-page-turnos .desktop-pro-nav-card.dark,
  body.ramos-page-turnos .desktop-pro-nav-card.active,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-header-action.dark,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-header-action.active,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-pro-action.dark,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-pro-action.active {
    background:
      radial-gradient(circle at 0% 0%, rgba(37, 99, 235, .18), transparent 40%),
      linear-gradient(135deg, #eff6ff 0%, #ffffff 68%) !important;
    color: #0f172a !important;
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .10), 0 12px 28px rgba(37, 99, 235, .12) !important;
  }

  body.ramos-page-turnos .desktop-pro-action .desktop-pro-icon,
  body.ramos-page-turnos .desktop-top-view-button .desktop-pro-icon,
  body.ramos-page-turnos .desktop-pro-nav-card .desktop-pro-icon,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-pro-icon {
    background: rgba(37, 99, 235, .10) !important;
    color: #1d4ed8 !important;
    border: 1px solid rgba(37, 99, 235, .14) !important;
  }

  body.ramos-page-turnos .desktop-pro-action.dark .desktop-pro-icon,
  body.ramos-page-turnos .desktop-pro-action.active .desktop-pro-icon,
  body.ramos-page-turnos .desktop-top-view-button.dark .desktop-pro-icon,
  body.ramos-page-turnos .desktop-top-view-button.active .desktop-pro-icon,
  body.ramos-page-turnos .desktop-pro-nav-card.dark .desktop-pro-icon,
  body.ramos-page-turnos .desktop-pro-nav-card.active .desktop-pro-icon,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-header-action.dark .desktop-pro-icon,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-header-action.active .desktop-pro-icon,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-pro-action.dark .desktop-pro-icon,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-pro-action.active .desktop-pro-icon {
    background: rgba(37, 99, 235, .14) !important;
    color: #1d4ed8 !important;
    border-color: rgba(37, 99, 235, .18) !important;
  }

  body.ramos-page-turnos .desktop-pro-action.dark h3,
  body.ramos-page-turnos .desktop-pro-action.active h3,
  body.ramos-page-turnos .desktop-top-view-button.dark h3,
  body.ramos-page-turnos .desktop-top-view-button.active h3,
  body.ramos-page-turnos .desktop-pro-nav-card.dark h3,
  body.ramos-page-turnos .desktop-pro-nav-card.active h3,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-header-action.dark h3,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-header-action.active h3,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-pro-action.dark h3,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-pro-action.active h3 {
    color: #0f172a !important;
  }

  body.ramos-page-turnos .desktop-pro-action.dark p,
  body.ramos-page-turnos .desktop-pro-action.active p,
  body.ramos-page-turnos .desktop-top-view-button.dark p,
  body.ramos-page-turnos .desktop-top-view-button.active p,
  body.ramos-page-turnos .desktop-pro-nav-card.dark p,
  body.ramos-page-turnos .desktop-pro-nav-card.active p,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-header-action.dark p,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-header-action.active p,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-pro-action.dark p,
  body.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-pro-action.active p {
    color: #64748b !important;
    opacity: 1 !important;
  }

  body.dark.ramos-page-turnos .desktop-pro-action.dark,
  body.dark.ramos-page-turnos .desktop-pro-action.active,
  body.dark.ramos-page-turnos .desktop-top-view-button.dark,
  body.dark.ramos-page-turnos .desktop-top-view-button.active,
  body.dark.ramos-page-turnos .desktop-pro-nav-card.dark,
  body.dark.ramos-page-turnos .desktop-pro-nav-card.active,
  body.dark.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-header-action.dark,
  body.dark.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-header-action.active,
  body.dark.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-pro-action.dark,
  body.dark.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-pro-action.active {
    background:
      radial-gradient(circle at 0% 0%, rgba(56, 189, 248, .20), transparent 40%),
      rgba(56, 189, 248, .09) !important;
    color: var(--text) !important;
    border-color: #38bdf8 !important;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, .10), 0 12px 28px rgba(56, 189, 248, .10) !important;
  }

  body.dark.ramos-page-turnos .desktop-pro-action.dark h3,
  body.dark.ramos-page-turnos .desktop-pro-action.active h3,
  body.dark.ramos-page-turnos .desktop-top-view-button.dark h3,
  body.dark.ramos-page-turnos .desktop-top-view-button.active h3,
  body.dark.ramos-page-turnos .desktop-pro-nav-card.dark h3,
  body.dark.ramos-page-turnos .desktop-pro-nav-card.active h3,
  body.dark.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-header-action.dark h3,
  body.dark.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-header-action.active h3,
  body.dark.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-pro-action.dark h3,
  body.dark.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-pro-action.active h3 {
    color: var(--text) !important;
  }

  body.dark.ramos-page-turnos .desktop-pro-action.dark p,
  body.dark.ramos-page-turnos .desktop-pro-action.active p,
  body.dark.ramos-page-turnos .desktop-top-view-button.dark p,
  body.dark.ramos-page-turnos .desktop-top-view-button.active p,
  body.dark.ramos-page-turnos .desktop-pro-nav-card.dark p,
  body.dark.ramos-page-turnos .desktop-pro-nav-card.active p,
  body.dark.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-header-action.dark p,
  body.dark.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-header-action.active p,
  body.dark.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-pro-action.dark p,
  body.dark.ramos-page-turnos #desktop-admin-header-actions.turnos-sidebar-actions .desktop-pro-action.active p {
    color: var(--muted) !important;
  }
}

/* ═══════════════════════════════════════════════════════
   TURNOS · Panel inline "Nuevo / Editar turno"
   ═══════════════════════════════════════════════════════ */

body.ramos-page-turnos .turno-panel-inline {
  padding: 1.5rem;
}

body.ramos-page-turnos .turno-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line, #e2e8f0);
}

body.ramos-page-turnos .turno-panel-section-label {
  font-size: 0.625rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #2563eb;
  margin-bottom: .5rem;
}

@media (min-width: 1100px) {
  body.ramos-page-turnos .turno-panel-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.75rem;
    margin-bottom: 1.5rem;
  }
}

body.ramos-page-turnos .turno-panel-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

body.ramos-page-turnos .turno-panel-footer {
  display: flex;
  gap: .75rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line, #e2e8f0);
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════ */

/* ========================================================
   MEDICIONES · CSS consolidado desde mediciones.html
   ======================================================== */

/* ===== MEDICIONES MÓVIL · Cards — semicírculo decorativo + botón chevron (igual que Incidencias) ===== */
    body.ramos-page-mediciones .med-inc-card {
      position: relative;
      overflow: hidden;
    }
    body.ramos-page-mediciones .med-inc-card::before {
      content: "";
      position: absolute;
      right: -42px;
      top: -42px;
      width: 120px;
      height: 120px;
      border-radius: 999px;
      background: rgba(37,99,235,.08);
      pointer-events: none;
      z-index: 0;
    }
    body.ramos-page-mediciones .med-inc-card > * {
      position: relative;
      z-index: 1;
    }
    body.ramos-page-mediciones .med-chevron-btn {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 44px;
      height: 44px;
      border-radius: 16px;
      background: #0f172a;
      color: #fff;
      border: none;
      cursor: pointer;
      flex-shrink: 0;
    }
    body.ramos-page-mediciones.dark .med-inc-card::before {
      background: rgba(56,189,248,.08);
    }
    body.ramos-page-mediciones.dark .med-chevron-btn {
      background: rgba(255,255,255,.12);
      color: #fff;
    }

/* ===== MEDICIONES MÓVIL · todos los botones de Gestión rápida igual tamaño ===== */
    @media (max-width: 899px) {
      .med-mobile-quick-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        align-items: stretch !important;
      }

      .med-mobile-quick-grid .med-mobile-quick-btn,
      .med-mobile-quick-grid .med-mobile-create-btn,
      .med-mobile-quick-grid [data-vista-rapida="historico"] {
        grid-column: auto !important;
        width: 100% !important;
        min-height: 72px !important;
        height: 100% !important;
        padding: .75rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        text-align: left !important;
      }

      .med-mobile-quick-grid .med-mobile-create-btn {
        background: var(--card) !important;
        border-color: #bfdbfe !important;
        box-shadow: 0 10px 22px rgba(15,23,42,.055) !important;
      }

      .med-mobile-quick-grid .med-mobile-create-btn .med-mobile-quick-icon {
        background: #eff6ff !important;
        color: #1d4ed8 !important;
        border-color: #bfdbfe !important;
      }

      body.dark .med-mobile-quick-grid .med-mobile-create-btn {
        background: var(--card) !important;
        border-color: rgba(59,130,246,.22) !important;
        box-shadow: 0 10px 22px rgba(0,0,0,.16) !important;
      }

      body.dark .med-mobile-quick-grid .med-mobile-create-btn .med-mobile-quick-icon {
        background: rgba(59,130,246,.14) !important;
        color: #93c5fd !important;
        border-color: rgba(59,130,246,.24) !important;
      }
    }

/* ===== MEDICIONES MÓVIL · tamaño uniforme definitivo Gestión rápida ===== */
    @media (max-width: 899px) {
      .med-mobile-quick-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: .55rem !important;
        align-items: stretch !important;
      }

      .med-mobile-quick-grid > .med-mobile-quick-btn,
      .med-mobile-quick-grid > .med-mobile-create-btn,
      .med-mobile-quick-grid > [data-vista-rapida] {
        grid-column: auto !important;
        width: 100% !important;
        min-width: 0 !important;
        min-height: 76px !important;
        height: 76px !important;
        max-height: 76px !important;
        padding: .72rem .68rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: .58rem !important;
        text-align: left !important;
        overflow: hidden !important;
      }

      .med-mobile-quick-grid > .med-mobile-quick-btn > span:not(.med-mobile-quick-icon),
      .med-mobile-quick-grid > .med-mobile-create-btn > span:not(.med-mobile-quick-icon) {
        min-width: 0 !important;
        flex: 1 1 auto !important;
        overflow: hidden !important;
      }

      .med-mobile-quick-grid > .med-mobile-quick-btn strong,
      .med-mobile-quick-grid > .med-mobile-create-btn strong {
        display: block !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        line-height: 1.08 !important;
      }

      .med-mobile-quick-grid > .med-mobile-quick-btn span:not(.med-mobile-quick-icon) span,
      .med-mobile-quick-grid > .med-mobile-create-btn span:not(.med-mobile-quick-icon) span {
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        line-height: 1.12 !important;
        margin-top: .18rem !important;
      }

      .med-mobile-quick-grid .med-mobile-quick-icon {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        max-width: 34px !important;
        flex: 0 0 34px !important;
      }

      .med-mobile-quick-grid > .med-mobile-create-btn {
        background: var(--card) !important;
        color: var(--text) !important;
      }
    }

/* ===== FIX DEFINITIVO · Nueva medición móvil ocupa 1 casilla ===== */
    @media (max-width: 899px) {
      #btn-nueva-medicion-mobile {
        grid-column: auto !important;
        grid-column-start: auto !important;
        grid-column-end: auto !important;
        width: 100% !important;
        min-width: 0 !important;
        height: 76px !important;
        min-height: 76px !important;
        max-height: 76px !important;
      }

      .med-mobile-quick-grid > #btn-nueva-medicion-mobile {
        grid-column: auto !important;
      }
    }

/* ===== PDF MEDICIONES · igualado visual definitivo a Incidencias/Calidad =====
       Solo presentación del panel PDF y helpers de cabecera/pie. No toca Firebase ni lógica. */
    body.ramos-page-mediciones #seccion-pdf-mediciones .section-head-calidad {
      display: flex !important;
      justify-content: space-between !important;
      align-items: flex-end !important;
      gap: 12px !important;
      padding: 16px !important;
      border-bottom: 1px solid var(--line) !important;
      background: rgba(248,250,252,.72) !important;
    }

    body.ramos-page-mediciones.dark #seccion-pdf-mediciones .section-head-calidad {
      background: rgba(255,255,255,.03) !important;
    }

    body.ramos-page-mediciones #seccion-pdf-mediciones .section-kicker-calidad {
      margin: 0 !important;
      font-size: 10px !important;
      font-weight: 950 !important;
      text-transform: uppercase !important;
      letter-spacing: .12em !important;
      color: var(--primary) !important;
    }

    body.ramos-page-mediciones #seccion-pdf-mediciones .section-title-calidad {
      margin: 3px 0 0 !important;
      font-size: 20px !important;
      font-weight: 950 !important;
      letter-spacing: -.035em !important;
      color: var(--text) !important;
    }

    body.ramos-page-mediciones #seccion-pdf-mediciones .section-help-calidad {
      margin: 5px 0 0 !important;
      color: var(--muted) !important;
      font-size: 12px !important;
      font-weight: 750 !important;
      line-height: 1.35 !important;
      text-transform: none !important;
      letter-spacing: 0 !important;
    }

    body.ramos-page-mediciones #seccion-pdf-mediciones .btn-toolbar-calidad {
      border-radius: 16px !important;
      padding: 13px 16px !important;
      min-height: 46px !important;
      font-family: 'Plus Jakarta Sans', system-ui, sans-serif !important;
      font-size: 10px !important;
      font-weight: 950 !important;
      text-transform: uppercase !important;
      letter-spacing: .08em !important;
      display: inline-flex !important;
      align-items: center !important;
      justify-content: center !important;
      gap: 7px !important;
      white-space: nowrap !important;
      background: var(--soft) !important;
      color: var(--text) !important;
      border: 1px solid var(--line) !important;
      box-shadow: none !important;
    }

    body.ramos-page-mediciones #seccion-pdf-mediciones .med-pdf-panel {
      margin: 0 !important;
      padding: 14px !important;
      display: grid !important;
      grid-template-columns: minmax(260px, .95fr) minmax(560px, 1.35fr) !important;
      gap: 14px !important;
      align-items: center !important;
      border: 1px solid #bfdbfe !important;
      border-radius: 24px !important;
      background: radial-gradient(circle at 0% 0%, rgba(37,99,235,.12), transparent 34%), var(--card) !important;
      box-shadow: 0 10px 28px rgba(15,23,42,.055) !important;
    }

    body.ramos-page-mediciones.dark #seccion-pdf-mediciones .med-pdf-panel {
      border-color: rgba(56,189,248,.26) !important;
      background: radial-gradient(circle at 0% 0%, rgba(56,189,248,.10), transparent 34%), var(--card) !important;
    }

    body.ramos-page-mediciones #seccion-pdf-mediciones .med-pdf-chip {
      display: inline-flex !important;
      align-items: center !important;
      justify-content: center !important;
      gap: 6px !important;
      border-radius: 999px !important;
      padding: 6px 9px !important;
      background: #eff6ff !important;
      color: #1d4ed8 !important;
      border: 1px solid #bfdbfe !important;
      font-size: 9px !important;
      font-weight: 950 !important;
      text-transform: uppercase !important;
      letter-spacing: .07em !important;
      margin-bottom: 7px !important;
      width: fit-content !important;
    }

    body.ramos-page-mediciones #seccion-pdf-mediciones .med-pdf-title {
      margin: 0 !important;
      font-size: 15px !important;
      font-weight: 950 !important;
      letter-spacing: -.025em !important;
      color: var(--text) !important;
    }

    body.ramos-page-mediciones #seccion-pdf-mediciones .med-pdf-text,
    body.ramos-page-mediciones #seccion-pdf-mediciones .med-pdf-info-text {
      margin: 5px 0 0 !important;
      font-size: 11px !important;
      font-weight: 800 !important;
      line-height: 1.45 !important;
      color: var(--muted) !important;
    }

    body.ramos-page-mediciones #seccion-pdf-mediciones .med-pdf-controls {
      display: grid !important;
      grid-template-columns: minmax(145px, .9fr) minmax(165px, 1fr) minmax(145px, auto) !important;
      gap: 8px !important;
      align-items: end !important;
      width: 100% !important;
      min-width: 0 !important;
    }

    body.ramos-page-mediciones #seccion-pdf-mediciones .med-pdf-controls.rango-mode {
      grid-template-columns: minmax(135px, .8fr) minmax(145px, .85fr) minmax(145px, .85fr) minmax(135px, auto) !important;
    }

    body.ramos-page-mediciones #seccion-pdf-mediciones .med-pdf-controls label {
      display: grid !important;
      gap: 7px !important;
      font-size: 10px !important;
      font-weight: 950 !important;
      text-transform: uppercase !important;
      letter-spacing: .08em !important;
      color: var(--muted) !important;
      margin: 0 !important;
      min-width: 0 !important;
    }

    body.ramos-page-mediciones #seccion-pdf-mediciones .med-pdf-controls .input-field,
    body.ramos-page-mediciones #seccion-pdf-mediciones .med-pdf-controls .btn-toolbar-calidad {
      width: 100% !important;
      min-width: 0 !important;
      min-height: 46px !important;
    }

    body.ramos-page-mediciones #seccion-pdf-mediciones .med-pdf-info-note {
      border: 1px solid var(--line) !important;
      background: rgba(248,250,252,.72) !important;
      border-radius: 18px !important;
      padding: 12px !important;
      display: grid !important;
      gap: 6px !important;
    }

    body.ramos-page-mediciones #seccion-pdf-mediciones .med-pdf-info-title {
      margin: 0 !important;
      color: var(--text) !important;
      font-size: 18px !important;
      font-weight: 950 !important;
      letter-spacing: -.025em !important;
    }

    body.ramos-page-mediciones #pdfMedControls label.hidden,
    body.ramos-page-mediciones #pdfMedControls button.hidden,
    body.ramos-page-mediciones #pdfMedDiaWrap.hidden,
    body.ramos-page-mediciones #pdfMedDesdeWrap.hidden,
    body.ramos-page-mediciones #pdfMedHastaWrap.hidden,
    body.ramos-page-mediciones #btnDescargarPdfMedicionesDia.hidden,
    body.ramos-page-mediciones #btnDescargarPdfMedicionesZip.hidden {
      display: none !important;
    }

    @media (max-width: 1180px) {
      body.ramos-page-mediciones #seccion-pdf-mediciones .med-pdf-panel { grid-template-columns: 1fr !important; }
      body.ramos-page-mediciones #seccion-pdf-mediciones .med-pdf-controls,
      body.ramos-page-mediciones #seccion-pdf-mediciones .med-pdf-controls.rango-mode { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
    }

    @media (max-width: 820px) {
      body.ramos-page-mediciones #seccion-pdf-mediciones .med-pdf-controls,
      body.ramos-page-mediciones #seccion-pdf-mediciones .med-pdf-controls.rango-mode { grid-template-columns: 1fr 1fr !important; }
    }

    @media (max-width: 520px) {
      body.ramos-page-mediciones #seccion-pdf-mediciones .section-head-calidad { display: grid !important; gap: 12px !important; }
      body.ramos-page-mediciones #seccion-pdf-mediciones .med-pdf-controls,
      body.ramos-page-mediciones #seccion-pdf-mediciones .med-pdf-controls.rango-mode { grid-template-columns: 1fr !important; }
    }

/* ===== MEDICIONES · DETALLE LATERAL IGUALADO A INCIDENCIAS =====
       Solo escala tipográfica del panel de detalle (móvil y escritorio).
       No toca JS, Firebase, Firestore, Storage ni lógica interna.
       Referencia: Incidencias usa etiquetas 9px y contenido principal 11px.
    */
    body.ramos-page-mediciones #panel-content,
    body.ramos-page-mediciones .panel-sticky-head {
      font-size: 11px !important;
      line-height: 1.35 !important;
    }

    body.ramos-page-mediciones #panel-content .desc-box p,
    body.ramos-page-mediciones #panel-content .desc-box div,
    body.ramos-page-mediciones #panel-content .desc-box span,
    body.ramos-page-mediciones #panel-content .detail-value,
    body.ramos-page-mediciones #panel-content .text-sm,
    body.ramos-page-mediciones #panel-content .text-xs {
      font-size: 11px !important;
      font-weight: 850 !important;
      line-height: 1.35 !important;
    }

    body.ramos-page-mediciones #panel-content .label-tag,
    body.ramos-page-mediciones #panel-content .kpi-label,
    body.ramos-page-mediciones #panel-content .detail-label,
    body.ramos-page-mediciones #panel-content .text-\[9px\],
    body.ramos-page-mediciones #panel-content .text-\[10px\] {
      font-size: 9px !important;
      font-weight: 950 !important;
      text-transform: uppercase !important;
      letter-spacing: .08em !important;
      color: var(--muted) !important;
      line-height: 1.15 !important;
    }

    body.ramos-page-mediciones #panel-content .desc-box {
      border-radius: 16px !important;
      padding: 10px !important;
      background: var(--soft) !important;
      border: 1px solid var(--line) !important;
    }


/* ===== ADMIN · PANEL LATERAL USUARIOS ===== */

body.ramos-page-admin .side-panel {
  position: fixed;
  right: 0;
  top: 0;
  width: min(520px, 94vw);
  max-width: 94vw;
  height: 100dvh;
  max-height: 100dvh;
  background: var(--card, #1e293b);
  color: var(--text, #f8fafc);
  border-left: 1px solid var(--line, rgba(255,255,255,.1));
  border-radius: 28px 0 0 28px;
  box-shadow: -8px 0 40px rgba(0,0,0,.28);
  z-index: 200;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.2,.8,.2,1), box-shadow .28s ease;
  will-change: transform;
  padding: 0;
}

body.ramos-page-admin .side-panel.active {
  transform: translateX(0);
  box-shadow: -12px 0 60px rgba(0,0,0,.35);
}

/* Panel head */
body.ramos-page-admin .panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--line, rgba(255,255,255,.08));
  position: sticky;
  top: 0;
  background: var(--card, #1e293b);
  z-index: 2;
}

body.ramos-page-admin .panel-head-info {
  min-width: 0;
}

body.ramos-page-admin .panel-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted, #94a3b8);
  margin: 0 0 4px;
}

body.ramos-page-admin .panel-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.ramos-page-admin .panel-sub {
  font-size: 0.8rem;
  color: var(--muted, #94a3b8);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.ramos-page-admin .panel-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--soft, rgba(255,255,255,.06));
  color: var(--text, #f8fafc);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}

body.ramos-page-admin .panel-close:hover {
  background: var(--line, rgba(255,255,255,.14));
}

/* Panel inner / body */
body.ramos-page-admin .panel-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}

body.ramos-page-admin .panel-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Botones de acción */
body.ramos-page-admin .panel-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--line, rgba(255,255,255,.08));
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  position: sticky;
  bottom: 0;
  background: var(--card, #1e293b);
  z-index: 2;
}

/* Mobile */
@media (max-width: 640px) {
  body.ramos-page-admin .side-panel {
    width: 100% !important;
    max-width: 100vw !important;
    border-radius: 0;
  }
}

@supports (padding: max(0px)) {
  body.ramos-page-admin .side-panel {
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }
  body.ramos-page-admin .panel-head {
    padding-top: max(24px, env(safe-area-inset-top));
  }
}
/* =========================================================
   MED-TOOLBAR · Selector de período compartido
   Usado en: admin.html (dashboard/export), mediciones.html (histórico)
   ========================================================= */
.med-toolbar {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(248,250,252,.76);
  border-radius: 24px;
}
body.dark .med-toolbar { background: rgba(255,255,255,.035); }

.med-nav-btn {
  width: 44px; height: 44px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-size: 24px; font-weight: 950;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.med-nav-btn:hover { background: var(--hover, #f1f5f9); }
.med-nav-btn:disabled { opacity: .3; cursor: default; }

.med-period-center {
  min-width: 0;
  display: grid;
  gap: 8px;
  text-align: center;
}
.med-period-label {
  margin: 0;
  font-size: 13px; font-weight: 950;
  color: var(--text);
  letter-spacing: -.02em;
}
.med-mode-tabs {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 5px;
  justify-content: center;
  align-items: center;
}
.med-tab {
  min-height: 35px;
  border: 0;
  border-radius: 13px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 9px; font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .06em;
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
}
.med-tab.active {
  background: #0f172a;
  color: #fff;
  box-shadow: 0 10px 24px rgba(15,23,42,.14);
}
body.dark .med-tab.active { background: #38bdf8; color: #0f172a; }

.med-range-panel {
  display: none;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 20px;
  padding: 12px;
}
.med-range-panel.active { display: grid; }

@media (max-width: 760px) {
  .med-toolbar { grid-template-columns: auto 1fr auto; }
  .med-mode-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: row; }
  .med-range-panel { grid-template-columns: 1fr; }
}

/* Urgente — fila tabla desktop */
body.ramos-page-mediciones .table-row.urgente {
  background: linear-gradient(90deg, rgba(254,226,226,.75) 0%, transparent 35%);
  border-left: 3px solid #dc2626;
}
body.dark.ramos-page-mediciones .table-row.urgente {
  background: linear-gradient(90deg, rgba(220,38,38,.15) 0%, transparent 36%);
}

/* =========================================================
   PEDIDO A PROVEEDOR — componente compartido (pedido-proveedor.js)
   Global, sin scope de página: usado desde Stock, EPIs,
   Mantenimiento y Proveedores.
   ========================================================= */
.ppx-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(15, 23, 42, .45);
  display: flex; align-items: stretch; justify-content: flex-end;
  padding: 0;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .2s ease;
}
.ppx-overlay.active { opacity: 1; visibility: visible; pointer-events: auto; }
body.ppx-lock { overflow: hidden; }

.ppx-modal {
  background: var(--card);
  color: var(--text);
  border-radius: 20px 0 0 20px;
  box-shadow: -4px 0 32px rgba(0,0,0,.18);
  width: 100%;
  max-width: 560px;
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateX(60px);
  transition: transform .2s ease;
}
.ppx-overlay.active .ppx-modal { transform: translateX(0); }

.ppx-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.ppx-head h3 { margin: 2px 0 0; font-size: 1.05rem; font-weight: 700; color: var(--text); }
.ppx-kicker {
  margin: 0; font-size: .7rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted);
}
.ppx-close {
  border: none; background: var(--soft); color: var(--muted);
  width: 32px; height: 32px; border-radius: 50%;
  font-size: 1.2rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ppx-close:hover { background: var(--line); color: var(--text); }

.ppx-body {
  padding: 16px 20px 20px;
  overflow-y: auto;
  flex: 1;
}

.ppx-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  margin-bottom: 4px;
}
.ppx-grid label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: .72rem; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em;
}
.ppx-grid label.full { grid-column: 1 / -1; }
.ppx-grid label input,
.ppx-grid label select,
.ppx-grid label textarea {
  text-transform: none; font-weight: 400; letter-spacing: normal;
  font-size: .92rem;
  width: 100%; min-width: 0; box-sizing: border-box;
}
/* Normalize select height to match inputs (especially Safari) */
.ppx-grid label select {
  height: 38px;
  padding: 0 8px;
  -webkit-appearance: auto; appearance: auto;
}
.ppx-grid label input[type="text"],
.ppx-grid label input[type="number"],
.ppx-grid label input:not([type]) {
  height: 38px;
  padding: 0 8px;
}
.ppx-estado-box { display: flex; align-items: center; min-height: 38px; }

.ppx-section-label {
  margin: 16px 0 8px;
  font-size: .72rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em;
}

.ppx-chip {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 999px;
  font-size: .72rem; font-weight: 700;
}

.ppx-help {
  margin: 0; padding: 12px; text-align: center;
  font-size: .85rem; color: var(--muted);
  border: 1px dashed var(--line); border-radius: 10px;
}

.ppx-linea {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; margin-bottom: 8px; background: var(--soft);
}
.ppx-linea-info { min-width: 0; }
.ppx-linea-nombre { margin: 0; font-weight: 700; font-size: .92rem; color: var(--text); }
.ppx-linea-meta { margin: 2px 0 0; font-size: .78rem; color: var(--muted); }
.ppx-linea-actions {
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
  flex-shrink: 0;
}

.ppx-obs textarea { min-height: 64px; resize: vertical; }

.ppx-adjuntos { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.ppx-adjunto {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 8px; font-size: .78rem;
  background: var(--soft); border: 1px solid var(--line);
  color: var(--primary); text-decoration: none;
}
.ppx-adjunto:hover { text-decoration: underline; }

.ppx-adjunto-pendiente {
  border-style: dashed;
  color: var(--text);
  cursor: default;
}
.ppx-adjunto-quitar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; margin-left: 2px;
  border: none; border-radius: 999px; background: var(--line);
  color: var(--text); font-size: .78rem; line-height: 1; font-weight: 700;
  cursor: pointer; padding: 0;
}
.ppx-adjunto-quitar:hover { background: #fecaca; color: #991b1b; }

.ppx-foot {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line);
}
.ppx-foot-full { grid-column: 1 / -1; }

/* Botón compacto para acciones secundarias dentro de tarjetas */
.btn-compact {
  display: inline-block !important;
  width: auto !important;
  padding: .28rem .7rem !important;
  font-size: .78rem !important;
}

@media (max-width: 640px) {
  .ppx-overlay { align-items: flex-end; justify-content: stretch; }
  .ppx-modal {
    border-radius: 20px 20px 0 0;
    height: auto; max-height: 92vh; max-width: 100%;
    transform: translateY(40px);
  }
  .ppx-overlay.active .ppx-modal { transform: translateY(0); }
  .ppx-grid { grid-template-columns: 1fr; }
  .ppx-foot { grid-template-columns: 1fr 1fr; }
}

/* ── Overlay acceso denegado (compartido por todos los módulos) ─────────── */
.ramos-acceso-overlay {
  position: fixed; inset: 0; z-index: 99999;
  background: var(--bg, #f8fafc);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 32px 20px; text-align: center;
}
.ramos-acceso-icon {
  width: 72px; height: 72px; border-radius: 20px;
  background: #fee2e2; color: #dc2626;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
}
body.dark .ramos-acceso-icon {
  background: rgba(248,113,113,.15); color: #f87171;
}
.ramos-acceso-kicker {
  font-size: 11px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: #dc2626; margin-bottom: 8px;
}
body.dark .ramos-acceso-kicker { color: #f87171; }
.ramos-acceso-titulo {
  font-size: 22px; font-weight: 950; color: var(--text, #0f172a);
  margin-bottom: 10px; line-height: 1.2;
}
.ramos-acceso-desc {
  font-size: 14px; color: var(--text-soft, #64748b);
  max-width: 320px; margin-bottom: 28px; line-height: 1.6;
}
.ramos-acceso-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--primary, #2563eb); color: #fff;
  border: none; border-radius: 12px;
  padding: 12px 24px; font-size: 14px; font-weight: 700;
  cursor: pointer; text-decoration: none;
}
