/* ============================================================
   Sistema de Despachos — Estilos Admin
   Diseño: moderno, minimalista, femenino
   ============================================================ */

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

/* ---- Variables ---- */
:root {
  --primary:        #D4A0B5;
  --primary-light:  #EDD5E0;
  --primary-dark:   #B8799A;
  --primary-grad:   linear-gradient(135deg, #E8B4C8 0%, #C9A9D4 100%);
  --secondary:      #C9A9D4;
  --accent:         #F7CAD4;

  --bg:             #FAF8FB;
  --surface:        #FFFFFF;
  --surface-2:      #F7F3F7;
  --border:         #EDE5ED;
  --border-light:   #F5F0F5;

  --text:           #2D2438;
  --text-2:         #7B6B85;
  --text-muted:     #B0A0BA;

  --sidebar-w:      260px;
  --topbar-h:       64px;

  --shadow-xs: 0 1px 3px rgba(180,140,170,.07);
  --shadow-sm: 0 2px 8px rgba(180,140,170,.10);
  --shadow:    0 4px 16px rgba(180,140,170,.14);
  --shadow-lg: 0 8px 32px rgba(180,140,170,.18);

  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --t: .2s ease;
  --t-slow: .35s ease;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; }
button { cursor: pointer; font-family: inherit; }

/* ---- Layout ---- */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform var(--t-slow);
  overflow: hidden;
}

/* Franja decorativa lateral */
.sidebar::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px;
  height: 100%;
  background: var(--primary-grad);
}

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo-icon {
  width: 38px; height: 38px;
  background: var(--primary-grad);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 18px;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-family: 'Playfair Display', serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

.sidebar-logo-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
  font-family: 'Inter', sans-serif;
}

.sidebar-section {
  padding: 8px 12px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 8px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  transition: var(--t);
  margin-bottom: 2px;
  position: relative;
  cursor: pointer;
}

.nav-item:hover {
  background: var(--surface-2);
  color: var(--primary-dark);
}

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

.nav-item .nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--primary-grad);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 99px;
  min-width: 20px;
  text-align: center;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border-light);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  transition: var(--t);
  cursor: pointer;
}

.sidebar-user:hover { background: var(--surface-2); }

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--primary-grad);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name  { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role  { font-size: 11px; color: var(--text-muted); }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---- Topbar ---- */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 90;
}

.topbar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}

.topbar-sub {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}

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

.topbar-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius);
  background: transparent;
  border: none;
  color: var(--text-2);
  display: grid;
  place-items: center;
  font-size: 16px;
  transition: var(--t);
}

.topbar-btn:hover {
  background: var(--surface-2);
  color: var(--primary-dark);
}

.hamburger { display: none; }

/* ---- Page body ---- */
.page-body {
  flex: 1;
  padding: 24px;
}

/* ---- Breadcrumb ---- */
.breadcrumb-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--text-muted);
}

.breadcrumb-bar a { color: var(--text-muted); transition: var(--t); }
.breadcrumb-bar a:hover { color: var(--primary-dark); }
.breadcrumb-bar .sep { font-size: 11px; }
.breadcrumb-bar .current { color: var(--text-2); font-weight: 500; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: box-shadow var(--t);
}

.card:hover { box-shadow: var(--shadow-sm); }

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.card-body { padding: 20px; }

/* ============================================================
   KPI CARDS
   ============================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--t), transform var(--t);
  cursor: default;
}

.kpi-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}

.kpi-card.kpi-total::before    { background: var(--primary-grad); }
.kpi-card.kpi-pendiente::before{ background: linear-gradient(90deg,#FCD34D,#F59E0B); }
.kpi-card.kpi-enviado::before  { background: linear-gradient(90deg,#86EFAC,#22C55E); }
.kpi-card.kpi-entregado::before{ background: linear-gradient(90deg,#6EE7B7,#059669); }
.kpi-card.kpi-observado::before{ background: linear-gradient(90deg,#FCA5A5,#EF4444); }
.kpi-card.kpi-pago::before     { background: linear-gradient(90deg,#93C5FD,#3B82F6); }

.kpi-icon {
  width: 42px; height: 42px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  font-size: 20px;
  margin-bottom: 14px;
}

.kpi-card.kpi-total    .kpi-icon { background: var(--primary-light);          color: var(--primary-dark); }
.kpi-card.kpi-pendiente .kpi-icon{ background: #FEF3C7;                        color: #B45309; }
.kpi-card.kpi-enviado   .kpi-icon{ background: #DCFCE7;                        color: #15803D; }
.kpi-card.kpi-entregado .kpi-icon{ background: #D1FAE5;                        color: #065F46; }
.kpi-card.kpi-observado .kpi-icon{ background: #FEE2E2;                        color: #B91C1C; }
.kpi-card.kpi-pago      .kpi-icon{ background: #DBEAFE;                        color: #1D4ED8; }

.kpi-value {
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
  margin-bottom: 4px;
}

.kpi-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ============================================================
   BADGES / STATUS
   ============================================================ */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-warning  { background: #FEF3C7; color: #B45309; }
.badge-info     { background: #DBEAFE; color: #1D4ED8; }
.badge-success  { background: #DCFCE7; color: #15803D; }
.badge-teal     { background: #D1FAE5; color: #065F46; }
.badge-danger   { background: #FEE2E2; color: #B91C1C; }
.badge-secondary{ background: var(--surface-2); color: var(--text-2); }
.badge-pink     { background: var(--primary-light); color: var(--primary-dark); }

.badge-impresion {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 500;
}
.badge-impresion.impreso  { background: #DCFCE7; color: #15803D; }
.badge-impresion.pendiente{ background: #F5F3FF; color: #6D28D9; }

/* ============================================================
   BOTONES
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--t);
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary-grad);
  color: #fff;
  box-shadow: 0 2px 8px rgba(212,160,181,.35);
}
.btn-primary:hover {
  filter: brightness(1.07);
  box-shadow: 0 4px 14px rgba(212,160,181,.45);
  transform: translateY(-1px);
  color: #fff;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--primary-light);
}

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

.btn-success {
  background: #DCFCE7;
  color: #15803D;
}
.btn-success:hover { background: #BBF7D0; }

.btn-sm  { padding: 5px 10px; font-size: 12.5px; border-radius: var(--radius-sm); }
.btn-lg  { padding: 11px 22px; font-size: 15px; }
.btn-icon{ width: 34px; height: 34px; padding: 0; border-radius: var(--radius); justify-content: center; }

/* ============================================================
   FORMULARIOS
   ============================================================ */
.form-group    { margin-bottom: 16px; }
.form-label    { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.form-required { color: var(--primary-dark); }

.form-control {
  display: block;
  width: 100%;
  padding: 9px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 13.5px;
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--t), box-shadow var(--t);
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(212,160,181,.15);
}

.form-control::placeholder { color: var(--text-muted); }

select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath fill='%237B6B85' d='M8 10.5L3 5h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

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

.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-error{ font-size: 12px; color: #B91C1C; margin-top: 4px; }

/* ============================================================
   TABLAS
   ============================================================ */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.data-table thead th {
  padding: 12px 16px;
  background: var(--surface-2);
  color: var(--text-2);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  text-align: left;
}

.data-table tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: background var(--t);
}

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

.data-table tbody tr:hover {
  background: rgba(237,213,224,.15);
}

.data-table td {
  padding: 13px 16px;
  color: var(--text);
  vertical-align: middle;
}

.data-table .col-codigo { font-family: monospace; font-size: 12.5px; font-weight: 600; color: var(--primary-dark); }
.data-table .col-actions { white-space: nowrap; }

/* ============================================================
   FILTROS
   ============================================================ */
.filtros-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 20px;
}

.filtro-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 500;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  color: var(--text-2);
  cursor: pointer;
  transition: var(--t);
}

.filtro-chip:hover { border-color: var(--primary); color: var(--primary-dark); background: var(--primary-light); }
.filtro-chip.active{ background: var(--primary-light); border-color: var(--primary); color: var(--primary-dark); }

/* ============================================================
   MODALES
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(44,35,54,.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-slow);
}

.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal-box {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(.96);
  transition: transform var(--t-slow);
}

.modal-overlay.open .modal-box {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title { font-size: 15px; font-weight: 700; color: var(--text); }

.modal-close {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  background: none;
  border: none;
  color: var(--text-muted);
  display: grid;
  place-items: center;
  font-size: 18px;
  cursor: pointer;
  transition: var(--t);
}

.modal-close:hover { background: var(--surface-2); color: var(--text); }

.modal-body   { padding: 20px 22px; }
.modal-footer { padding: 14px 22px; border-top: 1px solid var(--border-light); display: flex; gap: 10px; justify-content: flex-end; }

/* ============================================================
   FLOATING BUTTONS
   ============================================================ */
.floating-group {
  position: fixed;
  bottom: 28px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
  z-index: 200;
}

.float-btn {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  font-size: 20px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: var(--t);
  display: grid;
  place-items: center;
  padding: 0;
}

.float-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.float-btn.fb-primary { background: var(--primary-grad); color: #fff; }
.float-btn.fb-success  { background: #16A34A; color: #fff; }
.float-btn.fb-warning  { background: #F59E0B; color: #fff; }
.float-btn.fb-info     { background: #2563EB; color: #fff; }
.float-btn.fb-danger   { background: #DC2626; color: #fff; }

.float-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #EF4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  padding: 0 3px;
  border: 2px solid #fff;
  line-height: 1;
}

/* Popover "Tipos hoy" */
.tipos-popover {
  position: fixed;
  width: 300px;
  background: var(--surface, #fff);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  z-index: 400;
  padding: 16px;
  display: none;
  animation: fadeInUp .18s ease;
}
.tipos-popover.open { display: block; }
.tipos-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.tipos-popover-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text, #2D2438);
}
.tipos-popover-close {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-muted, #B0A0BA);
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

/* ============================================================
   DETAIL VIEW — Ver Pedido
   ============================================================ */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 768px) { .detail-grid { grid-template-columns: 1fr; } }

.info-group { margin-bottom: 16px; }
.info-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: 3px; }
.info-value { font-size: 14px; color: var(--text); font-weight: 500; }

.timeline {
  position: relative;
  padding-left: 24px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px; top: 0; bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: 16px;
}

.timeline-dot {
  position: absolute;
  left: -21px; top: 2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.timeline-date { font-size: 11px; color: var(--text-muted); }
.timeline-text { font-size: 13px; color: var(--text); margin-top: 1px; }

/* ============================================================
   ESTADO SELECTOR
   ============================================================ */
.estado-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: var(--t);
  margin-bottom: 8px;
}

.estado-option:hover { border-color: var(--primary); background: var(--primary-light); }
.estado-option.selected { border-color: var(--primary-dark); background: var(--primary-light); }
.estado-option input { accent-color: var(--primary-dark); }

/* ============================================================
   PRINT TOGGLE
   ============================================================ */
.impresion-selector {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.imp-opt {
  flex: 1;
  min-width: 120px;
  padding: 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
  transition: var(--t);
}

.imp-opt:hover, .imp-opt.active {
  border-color: var(--primary);
  background: var(--primary-light);
}

.imp-opt .imp-icon { font-size: 24px; display: block; margin-bottom: 6px; }
.imp-opt .imp-label { font-size: 13px; font-weight: 600; }
.imp-opt .imp-sub   { font-size: 11px; color: var(--text-muted); }

/* ============================================================
   IMAGEN DE PAGO
   ============================================================ */
.pago-img-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--t);
}

.pago-img-wrap:hover { box-shadow: var(--shadow); transform: scale(1.01); }
.pago-img-wrap img { display: block; width: 100%; }

/* ============================================================
   MAP / GPS
   ============================================================ */
.gps-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: var(--radius);
}

.gps-card .gps-icon { font-size: 24px; color: #2563EB; }
.gps-coords { font-size: 12.5px; color: #1E40AF; font-weight: 500; }
.gps-precision { font-size: 11px; color: #93C5FD; }
.gps-link { font-size: 12px; color: #2563EB; font-weight: 600; }

/* ============================================================
   ALERTAS
   ============================================================ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 500;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}

.alert-success { background: #DCFCE7; color: #15803D; border: 1px solid #BBF7D0; }
.alert-warning { background: #FEF3C7; color: #B45309; border: 1px solid #FDE68A; }
.alert-danger  { background: #FEE2E2; color: #B91C1C; border: 1px solid #FECACA; }
.alert-info    { background: #DBEAFE; color: #1D4ED8; border: 1px solid #BFDBFE; }

/* ============================================================
   LINK CARD (generar link)
   ============================================================ */
.link-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.link-url {
  flex: 1;
  font-family: monospace;
  font-size: 12.5px;
  color: var(--primary-dark);
  word-break: break-all;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; opacity: .5; }
.empty-state .empty-title { font-size: 16px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.empty-state .empty-sub { font-size: 13.5px; }

/* ============================================================
   CHARTS
   ============================================================ */
.chart-wrap {
  position: relative;
  height: 220px;
}

/* ============================================================
   SPINNER
   ============================================================ */
.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2.5px solid rgba(212,160,181,.3);
  border-top-color: var(--primary-dark);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

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

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 992px) {
  .sidebar {
    transform: translateX(calc(-1 * var(--sidebar-w)));
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }

  .main-content { margin-left: 0; }

  .hamburger { display: grid; }

  .kpi-grid { grid-template-columns: repeat(2, 1fr); }

  .floating-group { bottom: 20px; right: 16px; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .page-body { padding: 16px; }
  .topbar { padding: 0 16px; }
}

/* ============================================================
   UTILIDADES
   ============================================================ */
.flex   { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.text-sm { font-size: 12.5px; }
.text-muted { color: var(--text-muted); }
.font-mono { font-family: monospace; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Overlay para mobile sidebar */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(44,35,54,.35);
  z-index: 99;
}
.sidebar-overlay.visible { display: block; }
