@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: #f8f9fe;
  color: #111827;
  font-size: 14px;
  line-height: 1.5;
  display: flex;
  min-height: 100vh;
}

.layout { display: flex; width: 100%; min-height: 100vh; }

/* ══════════════════════════════
   SIDEBAR
══════════════════════════════ */
.sidebar {
  width: 230px;
  background: #1e1b4b;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  overflow: hidden;
}

.sb-logo {
  padding: 26px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.sb-logomark { display: flex; align-items: center; gap: 10px; }

.sb-cube {
  width: 34px; height: 34px;
  background: #7c3aed;
  border-radius: 9px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px; padding: 7px;
  flex-shrink: 0;
}

.sb-cube-dot { background: rgba(255,255,255,0.9); border-radius: 2px; }
.sb-cube-dot:nth-child(3) { background: rgba(255,255,255,0.35); }

.sb-name { font-size: 15px; font-weight: 700; color: #fff; letter-spacing: -0.3px; }
.sb-tag { font-size: 9px; color: rgba(255,255,255,0.2); letter-spacing: 2.5px; margin-top: 10px; }

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

.sb-section-lbl {
  font-size: 9px; color: rgba(255,255,255,0.2);
  letter-spacing: 2.5px; padding: 0 8px;
  margin-bottom: 4px; font-weight: 600;
}

.sb-spacer { margin-top: 16px; margin-bottom: 4px; }

.nav-item {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 9px 10px; border-radius: 8px;
  cursor: pointer; margin-bottom: 2px;
  transition: all .12s; text-decoration: none;
}

.nav-item-left {
  display: flex; align-items: center; gap: 9px;
  font-size: 12px; color: rgba(255,255,255,0.4); font-weight: 500;
}

.nav-item svg { width: 15px; height: 15px; flex-shrink: 0; opacity: 0.7; stroke: currentColor; fill: none; stroke-width: 1.8; }

.nav-item:hover .nav-item-left { color: rgba(255,255,255,0.8); }
.nav-item:hover { background: rgba(255,255,255,0.05); }

.nav-item.active { background: #7c3aed; }
.nav-item.active .nav-item-left { color: #fff; }
.nav-item.active svg { opacity: 1; }

.nav-item.alert-nav .nav-item-left { color: rgba(251,146,60,0.8); }
.nav-item.alert-nav:hover .nav-item-left { color: #fdba74; }

.nav-pip { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,0.5); }

.nav-badge {
  font-size: 9px; font-weight: 700;
  padding: 2px 7px; border-radius: 20px;
}
.nav-badge.red   { background: rgba(239,68,68,0.25);   color: #fca5a5; }
.nav-badge.amber { background: rgba(251,146,60,0.2);   color: #fdba74; }
.nav-badge.blue  { background: rgba(124,58,237,0.3);   color: #c4b5fd; }

.sb-bottom {
  padding: 14px 12px 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.sb-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: 10px;
  background: rgba(255,255,255,0.05); cursor: pointer;
}

.sb-avatar {
  width: 34px; height: 34px; border-radius: 8px;
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0;
}

.sb-uname { font-size: 12px; color: rgba(255,255,255,0.9); font-weight: 600; }
.sb-urole { font-size: 9px; color: rgba(255,255,255,0.25); margin-top: 1px; letter-spacing: 0.5px; }
.sb-logout {
  font-size: 9px; color: rgba(255,255,255,0.2);
  margin-top: 3px; cursor: pointer; background: none;
  border: none; padding: 0; text-align: left; transition: color .15s;
}
.sb-logout:hover { color: #fca5a5; }

/* ══════════════════════════════
   MAIN
══════════════════════════════ */
.main { margin-left: 230px; flex: 1; display: flex; flex-direction: column; min-height: 100vh; }

/* TOPBAR */
.topbar {
  height: 62px; padding: 0 28px;
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; border-bottom: 1px solid #eef0f6;
  position: sticky; top: 0; z-index: 50;
}

.tb-left { display: flex; align-items: center; gap: 10px; }

.tb-page { font-size: 18px; font-weight: 700; color: #111827; letter-spacing: -0.4px; }

.tb-badge {
  font-size: 10px; background: #ede9fe; color: #7c3aed;
  padding: 3px 10px; border-radius: 20px; font-weight: 600;
}

.tb-right { display: flex; align-items: center; gap: 10px; }

.tb-date {
  font-size: 11px; color: #9ca3af;
  background: #f8f9fe; padding: 5px 12px;
  border-radius: 20px; border: 1px solid #eef0f6;
}

.tb-btn {
  width: 36px; height: 36px; border-radius: 9px;
  background: #f8f9fe; border: 1px solid #eef0f6;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; position: relative;
}

.tb-notif-dot {
  position: absolute; top: 7px; right: 7px;
  width: 6px; height: 6px; background: #ef4444;
  border-radius: 50%; border: 1.5px solid #fff;
}

.tb-avatar {
  width: 36px; height: 36px; border-radius: 9px;
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; cursor: pointer;
}

/* CONTENT */
.content { flex: 1; padding: 24px 28px; display: flex; flex-direction: column; gap: 20px; }

/* WELCOME */
.welcome h2 { font-size: 20px; font-weight: 700; color: #111827; letter-spacing: -0.4px; }
.welcome p  { font-size: 12px; color: #9ca3af; margin-top: 3px; }

/* PAGE HEADER */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; }
.page-title  { font-size: 20px; font-weight: 700; color: #111827; letter-spacing: -0.4px; }
.page-sub    { font-size: 12px; color: #9ca3af; margin-top: 3px; }

/* ══════════════════════════════
   KPI CARDS
══════════════════════════════ */
.kpi-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }

.kpi {
  background: #fff; border-radius: 14px;
  padding: 20px; border: 1px solid #eef0f6;
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 12px;
}

.kpi-body {}
.kpi-lbl  { font-size: 12px; color: #9ca3af; font-weight: 500; margin-bottom: 8px; }
.kpi-val  { font-size: 26px; font-weight: 700; color: #111827; letter-spacing: -1px; line-height: 1; }
.kpi-trend { font-size: 11px; margin-top: 6px; font-weight: 500; }
.kpi-trend.up { color: #059669; }
.kpi-trend.dn { color: #dc2626; }
.kpi-trend.nt { color: #9ca3af; }

.kpi-ico {
  width: 42px; height: 42px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.kpi-ico svg { width: 20px; height: 20px; stroke-width: 1.8; fill: none; }
.kpi-ico.purple { background: #ede9fe; } .kpi-ico.purple svg { stroke: #7c3aed; }
.kpi-ico.green  { background: #ecfdf5; } .kpi-ico.green  svg { stroke: #059669; }
.kpi-ico.amber  { background: #fefce8; } .kpi-ico.amber  svg { stroke: #ca8a04; }
.kpi-ico.red    { background: #fef2f2; } .kpi-ico.red    svg { stroke: #dc2626; }
.kpi-ico.blue   { background: #eff6ff; } .kpi-ico.blue   svg { stroke: #2563eb; }

/* ══════════════════════════════
   CARDS
══════════════════════════════ */
.card { background: #fff; border-radius: 14px; border: 1px solid #eef0f6; overflow: hidden; }
.card-header { padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #f3f4f6; }
.card-title  { font-size: 14px; font-weight: 700; color: #111827; }
.card-actions { display: flex; align-items: center; gap: 8px; }
.card-body   { padding: 20px; }

/* ══════════════════════════════
   TABLA
══════════════════════════════ */
table { width: 100%; border-collapse: collapse; }

thead th {
  font-size: 10px; color: #9ca3af; font-weight: 600;
  padding: 10px 20px; text-align: left; letter-spacing: 0.5px;
  border-top: 1px solid #f3f4f6; border-bottom: 1px solid #f3f4f6;
  background: #fafafa;
}

tbody td { font-size: 12px; color: #374151; padding: 14px 20px; border-bottom: 1px solid #f9fafb; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #fafbff; }

.orden-id { font-weight: 700; color: #111827; font-size: 12px; }

/* ══════════════════════════════
   PILLS
══════════════════════════════ */
.pill {
  display: inline-flex; align-items: center;
  font-size: 10px; padding: 4px 10px; border-radius: 6px;
  font-weight: 600; letter-spacing: 0.2px; white-space: nowrap;
}

.pill-SEA, .pill-sea   { background: #ede9fe; color: #7c3aed; }
.pill-AIR, .pill-air   { background: #f3e8ff; color: #9333ea; }
.pill-ADU, .pill-adu   { background: #fefce8; color: #ca8a04; }
.pill-SLI, .pill-sli   { background: #fdf4ff; color: #a21caf; }
.pill-TL,  .pill-tl    { background: #ecfdf5; color: #059669; }

.pill-en_curso         { background: #eff6ff; color: #2563eb; }
.pill-creada           { background: #f3f4f6; color: #6b7280; }
.pill-dam_numerada     { background: #f3e8ff; color: #9333ea; }
.pill-dam_pagada       { background: #fdf4ff; color: #a21caf; }
.pill-levante_otorgado { background: #ecfdf5; color: #059669; }
.pill-liquidada        { background: #ecfdf5; color: #059669; }
.pill-alerta           { background: #fef2f2; color: #dc2626; }
.pill-en_ruta          { background: #eff6ff; color: #2563eb; }

.pill-borrador  { background: #f3f4f6; color: #6b7280; }
.pill-enviada   { background: #fefce8; color: #ca8a04; }
.pill-aprobada  { background: #ecfdf5; color: #059669; }
.pill-rechazada { background: #fef2f2; color: #dc2626; }

.pill-importador { background: #ede9fe; color: #7c3aed; }
.pill-exportador { background: #ecfdf5; color: #059669; }
.pill-ambos      { background: #fefce8; color: #ca8a04; }

/* ══════════════════════════════
   BOTONES
══════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px; font-size: 12px;
  font-weight: 600; cursor: pointer; border: 1px solid;
  transition: all .12s; font-family: 'Inter', sans-serif;
  white-space: nowrap; text-decoration: none;
}

.btn-primary  { background: #7c3aed; color: #fff; border-color: #7c3aed; }
.btn-primary:hover { background: #6d28d9; border-color: #6d28d9; }

.btn-secondary { background: #fff; color: #6b7280; border-color: #e5e7eb; }
.btn-secondary:hover { background: #f9fafb; }

.btn-danger { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.btn-danger:hover { background: #fee2e2; }

.btn-ghost { background: transparent; color: #7c3aed; border-color: transparent; }
.btn-ghost:hover { background: #ede9fe; }

.btn-sm { padding: 6px 12px; font-size: 11px; border-radius: 7px; }
.btn-xs { padding: 4px 9px; font-size: 10px; border-radius: 6px; }

/* ══════════════════════════════
   FORMULARIOS
══════════════════════════════ */
.form-group { display: flex; flex-direction: column; gap: 5px; }

.form-label {
  font-size: 11px; font-weight: 600; color: #374151; letter-spacing: 0.2px;
}

.form-input, .form-select, .form-textarea {
  width: 100%; padding: 9px 12px;
  border: 1px solid #e5e7eb; border-radius: 8px;
  font-size: 13px; color: #111827; background: #fff;
  font-family: 'Inter', sans-serif; transition: all .12s; outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124,58,237,0.1);
}

.form-input::placeholder { color: #d1d5db; }
.form-textarea { resize: vertical; min-height: 80px; }

.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }

.form-section {
  background: #fff; border-radius: 14px;
  border: 1px solid #eef0f6; padding: 24px;
  display: flex; flex-direction: column; gap: 16px;
}

.form-section-title {
  font-size: 14px; font-weight: 700; color: #111827;
  padding-bottom: 14px; border-bottom: 1px solid #f3f4f6;
}

/* ══════════════════════════════
   FILTROS
══════════════════════════════ */
.filtros { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filtros .form-input, .filtros .form-select { width: auto; min-width: 160px; padding: 8px 12px; font-size: 12px; }
.filtro-busqueda { min-width: 240px !important; }

/* ══════════════════════════════
   PROGRESS BARS
══════════════════════════════ */
.prog-wrap { display: flex; align-items: center; gap: 8px; }
.prog-track { flex: 1; height: 5px; background: #f3f4f6; border-radius: 3px; overflow: hidden; min-width: 60px; }
.prog-fill  { height: 100%; border-radius: 3px; transition: width .3s ease; }
.prog-pct   { font-size: 10px; color: #9ca3af; min-width: 28px; text-align: right; font-weight: 600; }

/* ══════════════════════════════
   HITOS — TIMELINE HORIZONTAL
══════════════════════════════ */
.timeline-h {
  display: flex; align-items: flex-start;
  overflow-x: auto; padding: 24px 20px 20px;
  gap: 0; scrollbar-width: thin;
  scrollbar-color: #e5e7eb transparent;
}

.timeline-h::-webkit-scrollbar { height: 4px; }
.timeline-h::-webkit-scrollbar-track { background: transparent; }
.timeline-h::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 2px; }

.hito-h-item {
  display: flex; flex-direction: column;
  align-items: center; position: relative;
  min-width: 110px; max-width: 130px; flex-shrink: 0;
}

.hito-h-connector {
  position: absolute; top: 20px; left: 50%; right: -50%;
  height: 2px; background: #e5e7eb; z-index: 0;
}

.hito-h-connector.done { background: #7c3aed; }
.hito-h-item:last-child .hito-h-connector { display: none; }

.hito-h-icon-wrap {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #e5e7eb; background: #fff;
  position: relative; z-index: 1; cursor: pointer;
  transition: all .15s; flex-shrink: 0;
}

.hito-h-icon-wrap svg { width: 16px; height: 16px; stroke: #d1d5db; fill: none; stroke-width: 2; }

.hito-h-icon-wrap.done { background: #7c3aed; border-color: #7c3aed; }
.hito-h-icon-wrap.done svg { stroke: #fff; }

.hito-h-icon-wrap.actual {
  background: #fff; border-color: #7c3aed;
  box-shadow: 0 0 0 4px rgba(124,58,237,0.15);
}
.hito-h-icon-wrap.actual svg { stroke: #7c3aed; }

.hito-h-icon-wrap.alerta { border-color: #dc2626; }
.hito-h-icon-wrap.alerta svg { stroke: #dc2626; }

.hito-h-icon-wrap:hover { transform: scale(1.1); }

.hito-h-label {
  font-size: 10px; color: #9ca3af; font-weight: 500;
  text-align: center; margin-top: 8px; line-height: 1.3;
  max-width: 100px; padding: 0 4px;
}

.hito-h-label.done   { color: #374151; font-weight: 600; }
.hito-h-label.actual { color: #7c3aed; font-weight: 700; }

.hito-h-date {
  font-size: 9px; color: #d1d5db; margin-top: 3px;
  text-align: center;
}

.hito-h-date.done { color: #9ca3af; }

/* TOOLTIP de hito */
/* ── TOOLTIP HITO — posicionamiento fijo ── */
.hito-tooltip {
  position: fixed;
  background: #1e1b4b;
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 11px;
  z-index: 500;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  min-width: 180px;
  max-width: 240px;
  text-align: left;
  transform: translateX(-50%);
}

.hito-tooltip.visible {
  opacity: 1;
}

.hito-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1e1b4b;
}

.hito-tooltip-title { font-weight: 600; margin-bottom: 3px; font-size: 11px; }
.hito-tooltip-date  { font-size: 10px; color: rgba(255,255,255,0.5); }
.hito-tooltip-obs   { font-size: 10px; color: rgba(255,255,255,0.6); margin-top: 3px; }



/* ══════════════════════════════
   PROGRESO BARRA GRANDE
══════════════════════════════ */
.progreso-wrap {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border-radius: 12px;
  border: 1px solid #eef0f6; padding: 14px 20px;
}

.progreso-barra { flex: 1; height: 6px; background: #f3f4f6; border-radius: 3px; overflow: hidden; }
.progreso-fill  { height: 100%; background: #7c3aed; border-radius: 3px; transition: width .5s ease; }
.progreso-texto { font-size: 11px; color: #9ca3af; white-space: nowrap; font-weight: 500; }

/* ══════════════════════════════
   MODAL
══════════════════════════════ */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(17,24,39,0.4); z-index: 200;
  align-items: center; justify-content: center;
}

.modal-overlay.visible { display: flex; }

.modal {
  background: #fff; border-radius: 16px; padding: 28px;
  width: 100%; max-width: 440px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.modal-title { font-size: 16px; font-weight: 700; color: #111827; margin-bottom: 4px; }
.modal-sub   { font-size: 12px; color: #9ca3af; margin-bottom: 20px; }
.modal-footer { display: flex; gap: 8px; margin-top: 20px; }
.modal-footer .btn { flex: 1; justify-content: center; }

/* ══════════════════════════════
   ALERTAS
══════════════════════════════ */
.alert-card {
  display: flex; gap: 10px; padding: 12px;
  border-radius: 10px; border: 1px solid; margin-bottom: 8px;
}
.alert-card:last-child { margin-bottom: 0; }
.alert-card.red    { background: #fff5f5; border-color: #fecaca; }
.alert-card.amber  { background: #fffbf0; border-color: #fde68a; }
.alert-card.purple { background: #f5f3ff; border-color: #ddd6fe; }

.alert-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.alert-dot.red    { background: #ef4444; }
.alert-dot.amber  { background: #f59e0b; }
.alert-dot.purple { background: #7c3aed; }

.alert-title { font-size: 12px; font-weight: 600; color: #111827; }
.alert-desc  { font-size: 10px; color: #9ca3af; margin-top: 1px; }

/* ══════════════════════════════
   FINANZAS
══════════════════════════════ */
.profit-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }

.profit-card {
  background: #fff; border-radius: 14px;
  border: 1px solid #eef0f6; padding: 20px;
}

.profit-lbl { font-size: 11px; color: #9ca3af; font-weight: 500; margin-bottom: 8px; }
.profit-val { font-size: 24px; font-weight: 700; color: #111827; letter-spacing: -0.5px; }
.profit-val.positive { color: #059669; }
.profit-val.negative { color: #dc2626; }
.profit-val.neutral  { color: #7c3aed; }

.finanzas-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.finanza-item {
  display: flex; justify-content: space-between;
  align-items: center; padding: 11px 0;
  border-bottom: 1px solid #f9fafb;
}
.finanza-item:last-child { border-bottom: none; }

.finanza-concepto { font-size: 12px; font-weight: 500; color: #111827; }
.finanza-sub      { font-size: 10px; color: #9ca3af; margin-top: 2px; }
.finanza-monto    { font-size: 12px; font-weight: 600; white-space: nowrap; }
.finanza-monto.ingreso { color: #059669; }
.finanza-monto.costo   { color: #374151; }

/* ══════════════════════════════
   COTIZACIONES
══════════════════════════════ */
.item-cotizacion {
  display: flex; gap: 8px; align-items: flex-end;
  padding: 12px; background: #fafafa;
  border-radius: 10px; border: 1px solid #f3f4f6;
  margin-bottom: 8px; flex-wrap: wrap;
}

.item-concepto { flex: 2; min-width: 160px; }
.item-tipo     { flex: 1; min-width: 130px; }
.item-precio   { flex: 1; min-width: 100px; }
.item-cantidad { width: 70px; }

.item-total {
  min-width: 90px; font-size: 13px;
  font-weight: 600; color: #059669;
  padding-bottom: 9px;
}

.cot-totales {
  background: #fafafa; border-radius: 10px;
  border: 1px solid #f3f4f6; padding: 16px 20px;
  max-width: 300px; margin-left: auto;
}

.total-fila {
  display: flex; justify-content: space-between;
  font-size: 12px; color: #6b7280; padding: 4px 0;
}

.total-final {
  font-size: 15px; font-weight: 700; color: #111827;
  border-top: 1px solid #e5e7eb;
  padding-top: 10px; margin-top: 6px;
}

/* ══════════════════════════════
   FORM INLINE
══════════════════════════════ */
.form-inline {
  display: none; flex-direction: column; gap: 10px;
  padding: 16px; background: #fafafa;
  border-radius: 10px; border: 1px solid #f3f4f6; margin-top: 12px;
}

.form-inline.visible { display: flex; }
.form-inline .form-input, .form-inline .form-select { padding: 8px 10px; font-size: 12px; }

.form-inline-btns { display: flex; gap: 8px; margin-top: 4px; }
.form-inline-btns .btn { flex: 1; justify-content: center; }

/* ══════════════════════════════
   PANEL VACÍO
══════════════════════════════ */
.panel-vacio {
  text-align: center; padding: 64px 32px;
  color: #d1d5db; font-size: 13px;
  background: #fff; border-radius: 14px;
  border: 1px solid #eef0f6; font-weight: 500;
}

.panel-vacio-icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: #f3f4f6; display: flex;
  align-items: center; justify-content: center;
  margin: 0 auto 12px;
}

.panel-vacio-icon svg { width: 22px; height: 22px; stroke: #d1d5db; fill: none; stroke-width: 1.5; }
.panel-vacio p { font-size: 14px; font-weight: 600; color: #374151; margin-bottom: 4px; }
.panel-vacio span { font-size: 12px; color: #9ca3af; }

/* ══════════════════════════════
   ORDEN HEADER
══════════════════════════════ */
.orden-header {
  background: #fff; border-radius: 14px;
  border: 1px solid #eef0f6; padding: 18px 20px;
  display: flex; align-items: center; justify-content: space-between;
}

.orden-numero-display {
  font-size: 18px; font-weight: 700; color: #111827;
  letter-spacing: -0.3px; margin-right: 10px;
}

.orden-meta {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: #9ca3af;
}

/* ══════════════════════════════
   BADGE DOCS
══════════════════════════════ */
.badge-doc   { font-size: 9px; padding: 2px 8px; border-radius: 5px; background: #ede9fe; color: #7c3aed; font-weight: 600; }
.badge-alerta{ font-size: 9px; padding: 2px 8px; border-radius: 5px; background: #fef2f2; color: #dc2626; font-weight: 600; }

/* ══════════════════════════════
   CONTADOR
══════════════════════════════ */
.contador-texto { font-size: 11px; color: #9ca3af; }
.contador-texto span { color: #7c3aed; font-weight: 600; }

/* ══════════════════════════════
   SOLICITUDES DE PAGO
══════════════════════════════ */
.solicitud-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid #f9fafb;
}
.solicitud-item:last-child { border-bottom: none; }
.solicitud-concepto { font-size: 12px; font-weight: 600; color: #111827; }
.solicitud-sub      { font-size: 10px; color: #9ca3af; margin-top: 2px; }
.solicitud-monto    { font-size: 13px; font-weight: 700; color: #374151; }

.pill-pedido   { background: #fefce8; color: #ca8a04; }
.pill-aprobado { background: #ecfdf5; color: #059669; }
.pill-pagado   { background: #f3f4f6; color: #6b7280; }

/* ══════════════════════════════
   LOGIN
══════════════════════════════ */
body.login-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: #f8f9fe; margin-left: 0;
}

.login-wrap { width: 100%; max-width: 420px; padding: 24px; }

.login-logo { text-align: center; margin-bottom: 28px; }

.login-cube {
  width: 52px; height: 52px; background: #1e1b4b;
  border-radius: 14px; display: grid;
  grid-template-columns: 1fr 1fr; gap: 4px;
  padding: 10px; margin: 0 auto 16px;
}

.login-cube-dot { background: rgba(255,255,255,0.9); border-radius: 3px; }
.login-cube-dot:nth-child(3) { background: #7c3aed; }

.login-name { font-size: 24px; font-weight: 700; color: #111827; letter-spacing: -0.5px; }
.login-sub  { font-size: 12px; color: #9ca3af; margin-top: 4px; }

.login-card {
  background: #fff; border-radius: 16px;
  border: 1px solid #eef0f6; padding: 32px;
}

.login-error {
  background: #fef2f2; border: 1px solid #fecaca;
  color: #dc2626; padding: 10px 14px; border-radius: 8px;
  font-size: 12px; margin-bottom: 16px; display: none; font-weight: 500;
}

.login-error.visible { display: block; }
.login-btn { width: 100%; justify-content: center; padding: 11px; font-size: 13px; margin-top: 8px; }

/* ══════════════════════════════
   DASH GRID
══════════════════════════════ */
.dash-grid { display: grid; grid-template-columns: 1fr 300px; gap: 20px; }

/* ══════════════════════════════
   UTILIDADES
══════════════════════════════ */
.hidden  { display: none !important; }
.text-muted   { color: #9ca3af; }
.text-sm      { font-size: 12px; }
.text-xs      { font-size: 11px; }
.font-medium  { font-weight: 500; }
.font-semibold{ font-weight: 600; }
.font-bold    { font-weight: 700; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.gap-8 { gap: 8px; }
.gap-12{ gap: 12px; }
.w-full{ width: 100%; }
.flex  { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ══════════════════════════════
   RESPONSIVE
══════════════════════════════ */
@media (max-width: 1100px) {
  .kpi-row  { grid-template-columns: repeat(2,1fr); }
  .dash-grid{ grid-template-columns: 1fr; }
  .finanzas-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-230px); }
  .main    { margin-left: 0; }
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .profit-grid { grid-template-columns: 1fr; }
}

.fin-tab.active,
.fin-tab[data-tab].active {
  background: #7c3aed !important;
  color: #fff !important;
  border-color: #7c3aed !important;
}

/* ══════════════════════════════
   DIRECCIONAMIENTO
══════════════════════════════ */
.dir-card { background:#fff; border:1px solid #eef0f6; border-radius:12px; padding:16px; margin-bottom:10px; }
.dir-estado { font-size:10px; font-weight:600; padding:3px 9px; border-radius:5px; }
.dir-solicitado  { background:#fefce8; color:#ca8a04; }
.dir-realizado   { background:#eff6ff; color:#2563eb; }
.dir-ingresado   { background:#ecfdf5; color:#059669; }
.dir-entregado   { background:#ecfdf5; color:#059669; }
.dir-transferido { background:#f3f4f6; color:#6b7280; }

/* ══════════════════════════════
   STOCK LOTES
══════════════════════════════ */
.lote-card { background:#fff; border:1px solid #eef0f6; border-radius:14px; overflow:hidden; margin-bottom:14px; }
.lote-head { padding:16px 20px; border-bottom:1px solid #f3f4f6; display:flex; align-items:flex-start; justify-content:space-between; }
.lote-id   { font-size:15px; font-weight:700; color:#111827; font-family:monospace; }
.lote-actions { display:flex; gap:6px; flex-wrap:wrap; padding:12px 20px; border-top:1px solid #f3f4f6; background:#fafafa; }
.lote-stat { display:flex; flex-direction:column; gap:2px; }
.lote-stat-lbl { font-size:9px; color:#9ca3af; font-weight:600; text-transform:uppercase; }
.lote-stat-val { font-size:16px; font-weight:700; color:#111827; }

/* ══════════════════════════════
   SOLICITUDES DE PAGO
══════════════════════════════ */
.sol-card { background:#fff; border:1px solid #eef0f6; border-radius:12px; padding:16px; margin-bottom:10px; }
.sol-numero { font-size:11px; font-weight:700; color:#7c3aed; font-family:monospace; }
.pill-pendiente_aprobacion { background:#fefce8; color:#ca8a04; }
.pill-aprobada_sol { background:#ecfdf5; color:#059669; }
.pill-pagada_sol { background:#f3f4f6; color:#6b7280; }
.pill-rechazada_sol { background:#fef2f2; color:#dc2626; }

/* ══════════════════════════════
   NOTIFICACIONES
══════════════════════════════ */
.notif-badge { position:absolute; top:-4px; right:-4px; width:16px; height:16px; background:#dc2626; border-radius:50%; font-size:9px; font-weight:700; color:#fff; display:flex; align-items:center; justify-content:center; border:2px solid #1e1b4b; }
.notif-item { padding:10px 14px; border-bottom:1px solid #f3f4f6; cursor:pointer; transition:background .1s; }
.notif-item:hover { background:#fafbff; }
.notif-item.no-leida { background:#f5f3ff; border-left:3px solid #7c3aed; }
.notif-titulo { font-size:12px; font-weight:600; color:#111827; }
.notif-msg { font-size:11px; color:#6b7280; margin-top:2px; }
.notif-tiempo { font-size:10px; color:#d1d5db; margin-top:3px; }