/* LOBO antitermita OS — Estilos globales custom */

/* ── Variables ────────────────────────────────────── */
:root {
  --lbo-blue:       #1A56DB;
  --lbo-blue-dark:  #1245B8;
  --lbo-blue-light: #EBF2FF;
  --lbo-white:      #FFFFFF;
  --lbo-gray-50:    #F9FAFB;
  --lbo-gray-100:   #F3F4F6;
  --lbo-gray-200:   #E5E7EB;
  --lbo-gray-400:   #9CA3AF;
  --lbo-gray-600:   #4B5563;
  --lbo-gray-700:   #374151;
  --lbo-gray-800:   #1F2937;
  --lbo-gray-900:   #111827;
  --lbo-danger:     #EF4444;
  --lbo-sidebar-w:  256px;
  --lbo-topbar-h:   64px;
}

/* ── Reset / Base ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Roboto', sans-serif;
  background-color: var(--lbo-gray-50);
  color: var(--lbo-gray-700);
  margin: 0;
}

/* ── Sidebar ──────────────────────────────────────── */
.lbo-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--lbo-sidebar-w);
  height: 100vh;
  background-color: #003D6C;
  border-right: none;
  display: flex;
  flex-direction: column;
  z-index: 50;
  transition: transform 0.2s ease;
}

/* Área del logo — imagen de Lobomex */
.lbo-sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.lbo-sidebar-logo img {
  height: 42px;
  width: auto;
}

/* Ocultar el bloque de ícono/texto anterior si sigue en el HTML */
.lbo-sidebar-logo-icon { display: none; }
.lbo-sidebar-logo-text { display: none; }

.lbo-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.lbo-nav-section {
  padding: 8px 12px 4px;
}

.lbo-nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.38);
  padding: 0 8px;
  margin-bottom: 4px;
}

.lbo-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.72);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  user-select: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.lbo-nav-item:hover {
  background-color: rgba(255,255,255,0.08);
  color: #ffffff;
}

.lbo-nav-item.active {
  background-color: rgba(255,255,255,0.14);
  color: #ffffff;
  font-weight: 600;
}

.lbo-nav-item.active svg {
  color: #ffffff;
}

.lbo-nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: rgba(255,255,255,0.45);
  transition: color 0.15s;
}

.lbo-nav-item:hover svg {
  color: rgba(255,255,255,0.9);
}

.lbo-sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 12px;
  color: rgba(255,255,255,0.4);
}

/* ── Topbar ───────────────────────────────────────── */
.lbo-topbar {
  position: fixed;
  top: 0;
  left: var(--lbo-sidebar-w);
  right: 0;
  height: var(--lbo-topbar-h);
  background-color: var(--lbo-white);
  border-bottom: 1px solid var(--lbo-gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 40;
}

.lbo-search-wrapper {
  position: relative;
  width: 320px;
}

.lbo-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--lbo-gray-400);
  pointer-events: none;
}

.lbo-search-input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  border: 1px solid var(--lbo-gray-200);
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Roboto', sans-serif;
  background-color: var(--lbo-gray-50);
  color: var(--lbo-gray-700);
  outline: none;
  transition: border-color 0.15s;
}

.lbo-search-input:focus {
  border-color: var(--lbo-blue);
  background-color: var(--lbo-white);
}

.lbo-topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lbo-avatar {
  width: 34px;
  height: 34px;
  background-color: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--lbo-white);
  cursor: pointer;
}

/* Avatar en topbar (sobre fondo blanco) usa color de marca */
.lbo-topbar .lbo-avatar {
  background-color: var(--lbo-blue);
  border: none;
}

/* ── Main Content ─────────────────────────────────── */
.lbo-main {
  margin-left: var(--lbo-sidebar-w);
  margin-top: var(--lbo-topbar-h);
  min-height: calc(100vh - var(--lbo-topbar-h));
  padding: 28px 32px;
}

/* ── Cards ────────────────────────────────────────── */
.lbo-card {
  background-color: var(--lbo-white);
  border: 1px solid var(--lbo-gray-200);
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.lbo-kpi-card {
  background-color: var(--lbo-white);
  border: 1px solid var(--lbo-gray-200);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  position: relative;
  overflow: hidden;
}

.lbo-kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px;
  height: 100%;
  background-color: var(--lbo-blue);
}

/* ── Buttons ──────────────────────────────────────── */
.lbo-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  font-family: 'Roboto', sans-serif;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.lbo-btn-primary {
  background-color: var(--lbo-blue);
  color: var(--lbo-white);
  border-color: var(--lbo-blue);
}

.lbo-btn-primary:hover {
  background-color: var(--lbo-blue-dark);
  border-color: var(--lbo-blue-dark);
}

.lbo-btn-secondary {
  background-color: var(--lbo-white);
  color: var(--lbo-gray-700);
  border-color: var(--lbo-gray-200);
}

.lbo-btn-secondary:hover {
  background-color: var(--lbo-gray-100);
}

.lbo-btn-danger {
  background-color: #FEF2F2;
  color: #DC2626;
  border-color: #FECACA;
}

.lbo-btn-danger:hover {
  background-color: #FEE2E2;
}

.lbo-btn svg {
  width: 15px;
  height: 15px;
}

/* ── Page Header ──────────────────────────────────── */
.lbo-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.lbo-page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--lbo-gray-900);
  margin: 0;
}

.lbo-page-subtitle {
  font-size: 13px;
  color: var(--lbo-gray-400);
  margin: 2px 0 0;
}

/* ── Tables ───────────────────────────────────────── */
.lbo-table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--lbo-gray-200);
  background: var(--lbo-white);
}

.lbo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.lbo-table thead {
  background-color: var(--lbo-gray-50);
}

.lbo-table th {
  text-align: left;
  padding: 11px 16px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--lbo-gray-400);
  border-bottom: 1px solid var(--lbo-gray-200);
  white-space: nowrap;
}

.lbo-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--lbo-gray-100);
  color: var(--lbo-gray-700);
  vertical-align: middle;
}

.lbo-table tbody tr:last-child td { border-bottom: none; }

.lbo-table tbody tr:hover { background-color: var(--lbo-gray-50); }

/* ── Badges ───────────────────────────────────────── */
.lbo-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.lbo-badge-blue   { background: #EBF2FF; color: var(--lbo-blue); }
.lbo-badge-green  { background: #ECFDF5; color: #059669; }
.lbo-badge-yellow { background: #FFFBEB; color: #D97706; }
.lbo-badge-red    { background: #FEF2F2; color: #DC2626; }
.lbo-badge-gray   { background: var(--lbo-gray-100); color: var(--lbo-gray-600); }

/* ── Tabs de vista (Órdenes / Individuales) ────────── */
.lbo-tab {
  padding: 9px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--lbo-gray-600);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-family: 'Roboto', sans-serif;
  transition: color .15s, border-color .15s;
  display: inline-flex;
  align-items: center;
  margin-bottom: -2px;
}
.lbo-tab:hover { color: var(--lbo-blue); }
.lbo-tab-active {
  color: var(--lbo-blue) !important;
  border-bottom-color: var(--lbo-blue) !important;
  font-weight: 600;
}

/* ── Forms ────────────────────────────────────────── */
.lbo-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--lbo-gray-700);
  margin-bottom: 5px;
}

.lbo-label .required {
  color: #DC2626;
  margin-left: 2px;
}

.lbo-input, .lbo-select, .lbo-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--lbo-gray-200);
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Roboto', sans-serif;
  color: var(--lbo-gray-700);
  background-color: var(--lbo-white);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.lbo-input:focus, .lbo-select:focus, .lbo-textarea:focus {
  border-color: var(--lbo-blue);
  box-shadow: 0 0 0 3px rgba(26,86,219,0.1);
}

.lbo-input.error, .lbo-select.error {
  border-color: #DC2626;
}

.lbo-textarea { resize: vertical; min-height: 80px; }

.lbo-form-grid {
  display: grid;
  gap: 16px;
}

.lbo-form-grid-2 { grid-template-columns: 1fr 1fr; }
.lbo-form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }

/* ── Modal ────────────────────────────────────────── */
.lbo-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
  backdrop-filter: blur(2px);
}

.lbo-modal {
  background: var(--lbo-white);
  border-radius: 16px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.lbo-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--lbo-gray-200);
  position: sticky;
  top: 0;
  background: var(--lbo-white);
  border-radius: 16px 16px 0 0;
  z-index: 1;
}

.lbo-modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--lbo-gray-900);
  margin: 0;
}

.lbo-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--lbo-gray-400);
  transition: background 0.15s;
}

.lbo-modal-close:hover {
  background: var(--lbo-gray-100);
  color: var(--lbo-gray-700);
}

.lbo-modal-body { padding: 20px 24px; }

.lbo-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--lbo-gray-200);
  background: var(--lbo-gray-50);
  border-radius: 0 0 16px 16px;
  position: sticky;
  bottom: 0;
}

/* ── Collapsible ──────────────────────────────────── */
.lbo-collapsible-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 12px 0;
  user-select: none;
}

.lbo-collapsible-arrow {
  width: 16px;
  height: 16px;
  color: var(--lbo-gray-400);
  transition: transform 0.2s;
}

.lbo-collapsible-header.open .lbo-collapsible-arrow {
  transform: rotate(180deg);
}

.lbo-collapsible-body {
  display: none;
}

.lbo-collapsible-body.open {
  display: block;
}

/* ── Search Bar en vistas ─────────────────────────── */
.lbo-view-search {
  position: relative;
  width: 260px;
}

.lbo-view-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--lbo-gray-400);
  pointer-events: none;
}

.lbo-view-search input {
  width: 100%;
  padding: 8px 12px 8px 32px;
  border: 1px solid var(--lbo-gray-200);
  border-radius: 8px;
  font-size: 13px;
  font-family: 'Roboto', sans-serif;
  outline: none;
  background: var(--lbo-white);
  transition: border-color 0.15s;
}

.lbo-view-search input:focus {
  border-color: var(--lbo-blue);
}

/* ── Divider ──────────────────────────────────────── */
.lbo-divider {
  border: none;
  border-top: 1px solid var(--lbo-gray-200);
  margin: 16px 0;
}

/* ── Empty state ──────────────────────────────────── */
.lbo-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--lbo-gray-400);
}

.lbo-empty svg {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  opacity: 0.4;
}

.lbo-empty p {
  font-size: 14px;
  margin: 0;
}

/* ── Tooltip-like info chip ───────────────────────── */
.lbo-info-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--lbo-blue);
  background: var(--lbo-blue-light);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 500;
}

/* ── Hint / helper text ───────────────────────────── */
.lbo-hint {
  font-size: 12px;
  color: var(--lbo-gray-400);
  margin-top: 4px;
  line-height: 1.45;
}

/* ── Form section divider ─────────────────────────── */
.lbo-form-section {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--lbo-gray-200);
}

.lbo-form-section-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--lbo-blue);
  margin-bottom: 1rem;
}

.lbo-form-section-title svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ── Detail info block ────────────────────────────── */
.lbo-detail-section {
  background: var(--lbo-white);
  border: 1px solid var(--lbo-gray-200);
  border-radius: 12px;
  padding: 18px 22px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.lbo-detail-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--lbo-gray-400);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--lbo-gray-100);
}

.lbo-detail-field {
  margin-bottom: 12px;
}

.lbo-detail-field:last-child {
  margin-bottom: 0;
}

.lbo-detail-label {
  font-size: 11px;
  color: var(--lbo-gray-400);
  margin-bottom: 2px;
}

.lbo-detail-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--lbo-gray-700);
}

/* ── Scrollbar custom ─────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--lbo-gray-200); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--lbo-gray-400); }


/* ════════════════════════════════════════════════════
   RESPONSIVE — Mobile & Tablet
   Breakpoints:
     < 768px  → Móvil
     768–1023 → Tablet
     ≥ 1024px → Desktop (layout base, sin cambios)
═══════════════════════════════════════════════════════ */

/* ── Hamburger button ─────────────────────────────── */
.lbo-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 8px;
  color: var(--lbo-gray-600);
  transition: background 0.15s;
  flex-shrink: 0;
  margin-right: 4px;
}
.lbo-hamburger:hover { background: var(--lbo-gray-100); }
.lbo-hamburger svg { width: 22px; height: 22px; }

/* ── Sidebar overlay (fondo oscuro en móvil) ──────── */
.lbo-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 149;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.lbo-sidebar-overlay.open { display: block; }

/* ── Fecha dual (ISO + YYMMDD) ────────────────────── */
.lbo-fecha-dual {
  display: flex;
  gap: .5rem;
  align-items: center;
}
.lbo-fecha-dual input[type="date"] {
  flex: 1;
}
.lbo-input-mono {
  width: 80px;
  font-family: 'Roboto Mono', monospace;
  font-size: 13px;
  letter-spacing: .08em;
  text-align: center;
  border: 1px solid var(--lbo-gray-200);
  border-radius: 8px;
  padding: .45rem .6rem;
  color: var(--lbo-gray-800);
  background: var(--lbo-white);
  transition: border-color .15s;
}
.lbo-input-mono:focus {
  outline: none;
  border-color: var(--lbo-blue);
  box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}

/* ═══════════════════════════════════════════════════
   TABLET (768px – 1023px)
═══════════════════════════════════════════════════ */
@media (max-width: 1023px) {

  /* Sidebar se convierte en drawer lateral */
  .lbo-sidebar {
    transform: translateX(-100%);
    z-index: 300; /* encima de modales (z:200) y topbar (z:40) */
    box-shadow: none;
    transition: transform 0.25s cubic-bezier(.4,0,.2,1), box-shadow 0.25s;
  }
  .lbo-sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 32px rgba(0, 0, 0, 0.28);
  }

  /* Topbar ocupa el ancho completo */
  .lbo-topbar {
    left: 0;
  }

  /* Contenido sin margen de sidebar */
  .lbo-main {
    margin-left: 0;
    padding: 20px 24px;
  }

  /* Mostrar hamburger */
  .lbo-hamburger {
    display: flex;
  }

  /* Búsqueda un poco más compacta */
  .lbo-search-wrapper {
    width: 220px;
  }

  /* Grids de 3 columnas → 2 en tablet */
  .lbo-form-grid-3 {
    grid-template-columns: 1fr 1fr;
  }
}

/* ═══════════════════════════════════════════════════
   MÓVIL (< 768px)
═══════════════════════════════════════════════════ */
@media (max-width: 767px) {

  /* Topbar más compacto */
  :root {
    --lbo-topbar-h: 56px;
  }
  .lbo-topbar {
    padding: 0 14px;
  }

  /* Ocultar buscador en móvil (espacio insuficiente) */
  .lbo-search-wrapper {
    display: none;
  }

  /* Ocultar botón de notificaciones en móvil */
  .lbo-topbar-notif {
    display: none !important;
  }

  /* Topbar: logo/brand name junto al hamburger */
  .lbo-topbar-brand {
    display: flex;
    align-items: center;
    font-size: 15px;
    font-weight: 700;
    color: var(--lbo-gray-900);
    letter-spacing: -0.01em;
  }

  /* Título centrado en topbar — ajustar para no colisionar */
  #topbar-title {
    font-size: 14px;
    max-width: 50%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Contenido principal */
  .lbo-main {
    padding: 14px 14px 24px;
  }

  /* Page header en columna */
  .lbo-page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .lbo-page-header .lbo-btn {
    width: 100%;
    justify-content: center;
  }
  .lbo-page-title {
    font-size: 18px;
  }

  /* Cards con menos padding */
  .lbo-card {
    padding: 14px 16px;
  }
  .lbo-kpi-card {
    padding: 14px 16px;
  }

  /* Grids → 1 columna */
  .lbo-form-grid-2,
  .lbo-form-grid-3 {
    grid-template-columns: 1fr;
  }

  /* Modales: casi pantalla completa */
  .lbo-modal-overlay {
    padding: 0;
    align-items: flex-end; /* sube desde abajo como sheet */
  }
  .lbo-modal {
    max-width: 100%;
    max-height: 96vh;
    border-radius: 20px 20px 0 0;
  }
  .lbo-modal-header {
    padding: 16px 18px 12px;
    border-radius: 20px 20px 0 0;
  }
  .lbo-modal-body {
    padding: 16px 18px;
  }
  .lbo-modal-footer {
    padding: 12px 18px;
    border-radius: 0;
    flex-wrap: wrap;
    gap: 8px;
  }
  .lbo-modal-footer .lbo-btn {
    flex: 1;
    min-width: 120px;
    justify-content: center;
  }

  /* Tablas: scroll horizontal ya existe, reducir padding de celdas */
  .lbo-table th,
  .lbo-table td {
    padding: 10px 12px;
    font-size: 13px;
  }

  /* Barra de búsqueda en vistas */
  .lbo-view-search {
    width: 100%;
  }

  /* Stack botones en page-header de detalle */
  .lbo-page-header > div:last-child {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }
  .lbo-page-header > div:last-child .lbo-btn {
    flex: 1;
    min-width: 120px;
    justify-content: center;
  }

  /* Detail sections — 1 columna */
  .lbo-detail-grid-2 {
    grid-template-columns: 1fr !important;
  }

  /* Tabs de KPIs — scroll horizontal */
  .lbo-kpi-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  /* Filtro bars — wrap */
  .lbo-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  /* Evitar que el body haga scroll cuando el drawer está abierto */
  body.drawer-open {
    overflow: hidden;
  }
}

/* ════════════════════════════════════════════════════
   DASHBOARD EJECUTIVO — T-7.1.e
═══════════════════════════════════════════════════════ */

/* ── Selector de período ──────────────────────────── */
.lbo-periodo-select {
  padding: 7px 12px;
  border: 1px solid var(--lbo-gray-200);
  border-radius: 8px;
  font-size: 13px;
  font-family: 'Roboto', sans-serif;
  color: var(--lbo-gray-700);
  background: var(--lbo-white);
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.lbo-periodo-select:focus {
  border-color: var(--lbo-blue);
  box-shadow: 0 0 0 3px rgba(26,86,219,0.1);
}

/* ── Grid de 4 columnas para KPI cards ────────────── */
.dash-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

/* ── KPI card hover effect ────────────────────────── */
.dash-kpi-hover {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  cursor: pointer;
}
.dash-kpi-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26,86,219,0.10);
}

/* ── Ícono en KPI card ────────────────────────────── */
.dash-kpi-icon {
  width: 40px;
  height: 40px;
  background: var(--lbo-blue-light);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dash-kpi-icon svg {
  width: 20px;
  height: 20px;
  color: var(--lbo-blue);
}

/* ── Valores KPI ──────────────────────────────────── */
.lbo-kpi-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--lbo-blue);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.lbo-kpi-label {
  font-size: 13px;
  color: var(--lbo-gray-400);
  margin-top: 5px;
  font-weight: 400;
}
.lbo-kpi-delta-up {
  color: #059669;
  font-size: 12px;
  font-weight: 600;
}
.lbo-kpi-delta-down {
  color: #DC2626;
  font-size: 12px;
  font-weight: 600;
}
.lbo-kpi-delta-flat {
  color: var(--lbo-gray-400);
  font-size: 12px;
  font-weight: 400;
}
.lbo-kpi-sub {
  font-size: 11px;
  color: var(--lbo-gray-400);
  margin-top: 4px;
}

/* ── Autocompletado de direcciones (CP + Photon) ──────────────────────────── */
.lbo-ac-wrapper { position: relative; }
.lbo-ac-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--lbo-gray-200);
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  z-index: 9999;
  max-height: 240px;
  overflow-y: auto;
}
.lbo-ac-item {
  padding: 0.6rem 0.85rem;
  cursor: pointer;
  font-size: 14px;
  color: var(--lbo-gray-700, #374151);
  border-bottom: 1px solid var(--lbo-gray-100);
}
.lbo-ac-item:last-child { border-bottom: none; }
.lbo-ac-item:hover,
.lbo-ac-item.active { background: var(--lbo-gray-50); }
.lbo-ac-empty {
  padding: 0.6rem 0.85rem;
  font-size: 13px;
  color: var(--lbo-gray-400);
}
/* Pista visual de que un campo se autollenó */
.lbo-input.lbo-autofilled { background: #F0FDF4; border-color: #86EFAC; }

/* ── Badges de antigüedad de OC ──────────────────── */
.lbo-badge-antig-verde {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: #ECFDF5;
  color: #059669;
}
.lbo-badge-antig-amarillo {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: #FFFBEB;
  color: #D97706;
}
.lbo-badge-antig-rojo {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: #FEF2F2;
  color: #DC2626;
}

/* ── Skeleton loader ──────────────────────────────── */
@keyframes lbo-shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}
.lbo-skeleton {
  background: linear-gradient(
    90deg,
    var(--lbo-gray-100) 25%,
    var(--lbo-gray-200) 50%,
    var(--lbo-gray-100) 75%
  );
  background-size: 600px 100%;
  animation: lbo-shimmer 1.4s ease-in-out infinite;
  border-radius: 8px;
}

/* ── Spin animation (botón refresh) ──────────────── */
@keyframes dash-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.dash-spin {
  animation: dash-spin 0.8s linear infinite;
}

/* ── Overlay de carga global (mutaciones API) ─────── */
/* Se muestra mientras se guarda/edita/elimina/sube información. */
.lbo-api-loading {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.35);
  display: none;            /* JS lo activa con style.display = 'flex' */
  align-items: center;
  justify-content: center;
  z-index: 11000;           /* por encima de modales (200) y SweetAlert */
}
.lbo-api-loading-box {
  background: #fff;
  border-radius: 14px;
  padding: 1.5rem 2.25rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}
.lbo-api-spinner {
  width: 38px;
  height: 38px;
  border: 4px solid var(--lbo-gray-200, #e5e7eb);
  border-top-color: var(--lbo-blue, #1A56DB);
  border-radius: 50%;
  animation: dash-spin 0.8s linear infinite;
}
.lbo-api-loading-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--lbo-gray-700, #374151);
  font-family: Roboto, sans-serif;
}

/* ── Dashboard responsive ─────────────────────────── */
@media (max-width: 1199px) {
  .dash-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 767px) {
  .dash-grid-4 {
    grid-template-columns: 1fr;
  }
  .lbo-kpi-value {
    font-size: 22px;
  }
}

/* ── Permisos por rol: ocultar acciones de escritura para Técnicos ───────────
   El Técnico (fumigador) tiene acceso de SOLO LECTURA a Proyectos PRE y a
   Clientes. Los botones de crear/editar/eliminar/pagar se ocultan; "Ver" y
   "Actualizar ubicación" permanecen (lo único que el técnico puede editar).
   (El backend también bloquea la escritura; esto es solo limpieza visual.) */
body.rol-tecnico #btn-nuevo-frac,
body.rol-tecnico #btn-editar-frac-det,
body.rol-tecnico #btn-nuevo-proy,
body.rol-tecnico #btn-editar-proy-det,
body.rol-tecnico #btn-nuevo-contrato,
body.rol-tecnico #btn-editar-ct-det,
body.rol-tecnico #btn-nueva-oc,
body.rol-tecnico #btn-nuevo-conj,
body.rol-tecnico #btn-agregar-doc,
body.rol-tecnico .btn-editar-frac,
body.rol-tecnico .btn-editar-proy,
body.rol-tecnico .btn-editar-ct,
body.rol-tecnico .btn-editar-oc,
body.rol-tecnico .btn-pagar-oc,
body.rol-tecnico .btn-eliminar-oc,
body.rol-tecnico .btn-editar-conj,
body.rol-tecnico .btn-editar-frente,
/* Clientes — escritura solo Admin (el técnico solo ve y actualiza ubicación) */
body.rol-tecnico #btn-nuevo-cliente,
body.rol-tecnico .btn-editar-cliente,
body.rol-tecnico #btn-editar-detalle,
body.rol-tecnico #btn-agregar-nota,
body.rol-tecnico .btn-eliminar-nota,
body.rol-tecnico #btn-agregar-sede,
body.rol-tecnico .btn-editar-sede,
body.rol-tecnico .btn-eliminar-sede,
body.rol-tecnico #btn-agregar-subempresa,
body.rol-tecnico .btn-editar-subempresa {
  display: none !important;
}
