/* Orkia OS · LOBO antitermita — Sistema de diseño Orkia con el azul de LOBO
   Fondo claro y limpio, tinta navy y el azul brillante metálico de LOBO
   (#0A5F98 → #0C84CC → #4FB0E6) como único acento: lo eligió el cliente en oct-2026.
   Tipografía: Google Sans Flex (redondeada). */

/* ── Variables ────────────────────────────────────── */
:root {
  --lbo-font:       'Google Sans Flex', 'Google Sans', system-ui, -apple-system, sans-serif;
  --lbo-font-mono:  'Google Sans Code', ui-monospace, monospace;

  /* Azul LOBO (los nombres --lbo-blue* se conservan porque los usan los módulos JS) */
  --lbo-blue:       #0C84CC;
  --lbo-blue-dark:  #0A6CA8;
  --lbo-blue-light: #E3F2FB;
  --lbo-violet:     #4FB0E6;
  --lbo-violet-soft:#EEF7FC;
  --lbo-gradient:   linear-gradient(120deg, #0A5F98 0%, #0C84CC 55%, #4FB0E6 100%);

  /* Neutros (gris azulado Orkia) */
  --lbo-white:      #FFFFFF;
  --lbo-bg:         #F8F9FC;
  --lbo-gray-50:    #F9FAFC;
  --lbo-gray-100:   #F2F3F8;
  --lbo-gray-200:   #E8EAF1;
  --lbo-gray-300:   #D9DCE7;
  --lbo-gray-400:   #9AA1B2;
  --lbo-gray-500:   #7A8194;
  --lbo-gray-600:   #5A6172;
  --lbo-gray-700:   #3A4154;
  --lbo-gray-800:   #232A3F;
  --lbo-gray-900:   #131A2E;
  --lbo-text-muted: #7A8194;

  --lbo-danger:     #DC2626;
  --lbo-success:    #16A34A;
  --lbo-warning:    #D97706;

  --lbo-shadow-sm:  0 1px 2px rgba(19, 26, 46, .05);
  --lbo-shadow-md:  0 4px 16px rgba(19, 26, 46, .07);
  --lbo-shadow-lg:  0 24px 60px -24px rgba(19, 26, 46, .28);
  --lbo-ring:       0 0 0 4px rgba(12, 132, 204, .12);

  --lbo-sidebar-w:  256px;
  --lbo-topbar-h:   64px;
}

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

body {
  font-family: var(--lbo-font);
  background-color: var(--lbo-bg);
  color: var(--lbo-gray-700);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

/* Tailwind trae preflight apagado: heredar la fuente en controles */
button, input, select, textarea { font-family: inherit; }

/* ── Sidebar (blanco, estilo Orkia) ───────────────── */
.lbo-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--lbo-sidebar-w);
  height: 100vh;
  /* dvh = alto visible real: en Chrome de iPhone 100vh incluye la barra de abajo del
     navegador y tapaba el pie del menú (usuario y Cerrar sesión). */
  height: 100dvh;
  background-color: var(--lbo-white);
  border-right: 1px solid var(--lbo-gray-200);
  display: flex;
  flex-direction: column;
  z-index: 50;
  transition: transform 0.2s ease;
}

.lbo-sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
}
.lbo-sidebar-logo img {
  width: 38px;
  height: 38px;
}
.lbo-sidebar-brand-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--lbo-gray-900);
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.lbo-sidebar-brand-sub {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--lbo-gray-400);
}

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

.lbo-nav-section {
  padding: 10px 12px 2px;
}

.lbo-nav-section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lbo-gray-400);
  padding: 0 10px;
  margin-bottom: 6px;
}

.lbo-nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--lbo-gray-600);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  user-select: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  margin-bottom: 2px;
}

.lbo-nav-item:hover {
  background-color: var(--lbo-gray-100);
  color: var(--lbo-gray-900);
}

.lbo-nav-item.active {
  background-color: var(--lbo-blue-light);
  color: var(--lbo-blue);
  font-weight: 600;
}

.lbo-nav-item svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  color: var(--lbo-gray-400);
  transition: color 0.15s;
}

.lbo-nav-item:hover svg { color: var(--lbo-gray-700); }
.lbo-nav-item.active svg { color: var(--lbo-blue); }

.lbo-sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--lbo-gray-200);
  font-size: 12px;
  color: var(--lbo-gray-400);
}

.lbo-user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  margin-bottom: 8px;
}
.lbo-user-chip-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--lbo-gray-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lbo-user-chip-rol {
  font-size: 12px;
  color: var(--lbo-gray-400);
  margin-top: 1px;
}

.lbo-btn-logout {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 12px;
  background: var(--lbo-white);
  border: 1px solid var(--lbo-gray-200);
  border-radius: 10px;
  cursor: pointer;
  color: var(--lbo-gray-600);
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  transition: background .15s, color .15s, border-color .15s;
}
.lbo-btn-logout:hover {
  background: #FEF2F2;
  border-color: #FECACA;
  color: var(--lbo-danger);
}
.lbo-btn-logout svg { width: 17px; height: 17px; }

.lbo-firma-orkia {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--lbo-gray-400);
}
.lbo-firma-orkia img { height: 15px; width: auto; }

/* ── Topbar ───────────────────────────────────────── */
.lbo-topbar {
  position: fixed;
  top: 0;
  left: var(--lbo-sidebar-w);
  right: 0;
  height: var(--lbo-topbar-h);
  background-color: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--lbo-gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  z-index: 40;
}

.lbo-topbar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--lbo-gray-900);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

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

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

.lbo-search-input {
  width: 100%;
  height: 40px;
  padding: 0 14px 0 38px;
  border: 1px solid var(--lbo-gray-200);
  border-radius: 10px;
  font-size: 14px;
  background-color: var(--lbo-gray-50);
  color: var(--lbo-gray-700);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

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

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

.lbo-topbar-notif {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--lbo-gray-200);
  background: var(--lbo-white);
  cursor: pointer;
  color: var(--lbo-gray-600);
  transition: background .15s, color .15s;
}
.lbo-topbar-notif:hover { background: var(--lbo-gray-100); color: var(--lbo-gray-900); }

/* Avatar con el gradiente de marca */
.lbo-avatar {
  width: 36px;
  height: 36px;
  background: var(--lbo-gradient);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--lbo-white);
  cursor: pointer;
}

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

/* ── Cards ────────────────────────────────────────── */
.lbo-card {
  background-color: var(--lbo-white);
  border: 1px solid var(--lbo-gray-200);
  border-radius: 16px;
  padding: 22px 24px;
  box-shadow: var(--lbo-shadow-sm);
}

.lbo-kpi-card {
  background-color: var(--lbo-white);
  border: 1px solid var(--lbo-gray-200);
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: var(--lbo-shadow-sm);
  position: relative;
  overflow: hidden;
}

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

/* ── Buttons ──────────────────────────────────────── */
.lbo-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s, filter 0.15s, box-shadow 0.15s;
}

.lbo-btn-primary {
  background: var(--lbo-gradient);
  color: var(--lbo-white);
  border-color: transparent;
  box-shadow: 0 6px 16px -8px rgba(12, 132, 204, .6);
}

.lbo-btn-primary:hover {
  filter: brightness(1.06);
  box-shadow: 0 8px 20px -8px rgba(12, 132, 204, .7);
}

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

.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: 16px;
  height: 16px;
}

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

.lbo-page-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--lbo-gray-900);
  margin: 0;
}

.lbo-page-subtitle {
  font-size: 14px;
  color: var(--lbo-gray-500);
  margin: 4px 0 0;
}

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

.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: 12px 18px;
  font-size: 11.5px;
  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: 14px 18px;
  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: #F3F9FD; }

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

.lbo-badge-blue   { background: var(--lbo-blue-light); color: var(--lbo-blue); }
.lbo-badge-green  { background: #E8F7EE; color: #15803D; }
.lbo-badge-yellow { background: #FDF3E2; color: #B45309; }
.lbo-badge-red    { background: #FDEAEA; 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;
  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: 13.5px;
  font-weight: 600;
  color: var(--lbo-gray-800);
  margin-bottom: 6px;
}

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

.lbo-input, .lbo-select, .lbo-textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--lbo-gray-200);
  border-radius: 10px;
  font-size: 14.5px;
  color: var(--lbo-gray-900);
  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: var(--lbo-ring);
}

.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(19, 26, 46, 0.45);
  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: 20px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--lbo-shadow-lg);
}

.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: 20px 20px 0 0;
  z-index: 1;
}

.lbo-modal-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--lbo-gray-900);
  margin: 0;
}

.lbo-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  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 20px 20px;
  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: 9px 12px 9px 34px;
  border: 1.5px solid var(--lbo-gray-200);
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  background: var(--lbo-white);
  transition: border-color 0.15s, box-shadow 0.15s;
}

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

/* ── 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: 12.5px;
  color: var(--lbo-gray-500);
  margin-top: 5px;
  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: 16px;
  padding: 20px 22px;
  box-shadow: var(--lbo-shadow-sm);
}

.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: 12px;
  color: var(--lbo-gray-500);
  margin-bottom: 3px;
}

.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-300); 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(19, 26, 46, 0.45);
  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: var(--lbo-font-mono);
  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: var(--lbo-ring);
}

/* ═══════════════════════════════════════════════════
   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 {
    /* Espacio final para que la burbuja de Orki (abajo a la derecha) no tape lo último de la pantalla. */
    padding: 14px 14px calc(150px + env(safe-area-inset-bottom));
    /* Red de seguridad: nada mueve la página a lo ancho (clip no rompe position: sticky). */
    overflow-x: clip;
  }

  /* 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: 10px;
  font-size: 13.5px;
  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: var(--lbo-ring);
}

/* ── 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: var(--lbo-shadow-md);
}

/* ── Í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: 30px;
  font-weight: 700;
  color: var(--lbo-gray-900);
  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 + Google Places) ──────────────────────────── */
.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);
  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(19, 26, 46, 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: 18px;
  padding: 1.5rem 2.25rem;
  box-shadow: var(--lbo-shadow-lg);
  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);
  border-top-color: var(--lbo-blue);
  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);
}

/* ── 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;
}

/* ════════════════════════════════════════════════════
   SWEETALERT2 — alertas con la identidad Orkia
═══════════════════════════════════════════════════════ */
.swal2-popup {
  font-family: var(--lbo-font) !important;
  border-radius: 20px !important;
  padding: 1.75rem 1.5rem 1.5rem !important;
  box-shadow: var(--lbo-shadow-lg) !important;
}
.swal2-title {
  font-size: 21px !important;
  font-weight: 700 !important;
  letter-spacing: -0.01em;
  color: var(--lbo-gray-900) !important;
}
.swal2-html-container {
  font-size: 15px !important;
  color: var(--lbo-gray-600) !important;
  line-height: 1.5 !important;
}
.swal2-actions { gap: 8px; }
.swal2-styled {
  border-radius: 10px !important;
  font-weight: 600 !important;
  font-size: 14.5px !important;
  padding: 10px 22px !important;
  margin: 0 !important;
}
.swal2-styled:focus { box-shadow: var(--lbo-ring) !important; }
.swal2-styled.swal2-confirm[style*="rgb(12, 132, 204)"] {
  background: var(--lbo-gradient) !important;
}
.swal2-styled.swal2-cancel {
  background: var(--lbo-white) !important;
  color: var(--lbo-gray-800) !important;
  border: 1px solid var(--lbo-gray-300) !important;
}
.swal2-input, .swal2-textarea, .swal2-select {
  border-radius: 10px !important;
  border: 1.5px solid var(--lbo-gray-200) !important;
  font-size: 15px !important;
  box-shadow: none !important;
}
.swal2-input:focus, .swal2-textarea:focus {
  border-color: var(--lbo-blue) !important;
  box-shadow: var(--lbo-ring) !important;
}
div:where(.swal2-container) div:where(.swal2-loader) { border-color: var(--lbo-blue) transparent var(--lbo-blue) transparent; }

/* Aviso en lugar del mapa cuando Google Maps no cargó (sin internet o sin llave). */
.lbo-mapa-aviso { height: 100%; min-height: 140px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 1rem; font-size: 14px; line-height: 1.5; color: var(--lbo-gray-500, #5A5F73); background: #F8F9FC; }
/* En el celular el campo con buscador (calle) ocupa todo el ancho del formulario: a
   media columna cada sugerencia de Google ocupaba 4 renglones y casi no se leía. */
@media (max-width: 640px) {
  div:has(> .lbo-ac-wrapper), div:has(> label + .lbo-ac-wrapper) { grid-column: 1 / -1; }
}
/* Ventanas y controles de Google con la tipografía del sistema. */
.gm-style .gm-style-iw, .gm-style button { font-family: var(--lbo-font); }
/* Confirmaciones sin color propio: gradiente de marca (las de peligro traen su rojo inline) */
.swal2-styled.swal2-confirm:not([style*="background-color"]) {
  background: var(--lbo-gradient) !important;
}

/* Tablet: el buscador ocupa el centro; el título centrado se encimaba (QA F1). */
@media (min-width: 768px) and (max-width: 1100px) {
  .lbo-topbar-title { display: none; }
}
