/* ============================================================
   INVERSIONES ACHAHUANCO — Sistema POS/ERP
   Design: MODO APPLE CLARO (Cupertino Clean & Modern Aesthetic)
   Palette: Signature Apple Light Gray (#f5f5f7), Pure White (#ffffff),
            Emerald Green (#10b981 / #059669), Coral Flame (#f97316 / #ea580c),
            Deep Apple Graphite (#1d1d1f) y Slate (#86868b).
   Font: SF Pro Display / -apple-system / Inter
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&family=Inter:wght@400;500;600;700;800&display=swap');

/* ---- Variables de Diseño: Modo Apple Claro ---- */
:root {
  --bg-dark:       #f5f5f7;  /* Canvas gris claro icónico de Apple */
  --bg-surface:    #ffffff;  /* Superficie blanca pura */
  --bg-card:       #ffffff;  /* Tarjetas blancas elevadas */
  --bg-sidebar:    #ffffff;  /* Sidebar blanco puro macOS */
  --bg-hover:      #f5f5f7;  /* Hover suave */
  
  /* Acentos de Marca Inversiones Achahuanco */
  --accent:        #059669;  /* Verde Esmeralda institucional */
  --accent-light:  #10b981;  /* Esmeralda vibrante */
  --accent-dark:   #047857;  /* Verde bosque */
  --accent-2:      #ea580c;  /* Naranja Coral Flame del logo */
  --accent-2-light:#f97316;  /* Naranja brillante */
  --accent-2-dark: #c2410c;  /* Coral profundo */
  --accent-warn:   #d97706;  /* Ámbar cálido */
  --accent-danger: #e11d48;  /* Rojo Apple */
  --accent-success:#10b981;  /* Verde Apple */
  --accent-info:   #0284c7;  /* Azul Apple */

  /* Tipografía Apple de Alto Contraste */
  --text-primary:  #1d1d1f;  /* Graphite oscuro Apple */
  --text-secondary:#4b5563;  /* Pizarra medio */
  --text-muted:    #86868b;  /* Gris secundario Apple */
  
  /* Bordes y Sombras Apple */
  --border:        rgba(0, 0, 0, 0.07);
  --border-light:  rgba(0, 0, 0, 0.12);
  --glass-bg:      rgba(255, 255, 255, 0.88);
  --glass-border:  rgba(0, 0, 0, 0.06);
  
  --shadow-sm:     0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-md:     0 4px 16px -2px rgba(0, 0, 0, 0.06), 0 2px 6px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg:     0 12px 36px -4px rgba(0, 0, 0, 0.09), 0 4px 12px -2px rgba(0, 0, 0, 0.04);
  
  --brand-gradient: linear-gradient(135deg, #10b981 0%, #0284c7 45%, #f97316 100%);
  --brand-gradient-hover: linear-gradient(135deg, #34d399 0%, #38bdf8 45%, #fb923c 100%);
  
  --radius-sm:     10px;
  --radius-md:     14px;
  --radius-lg:     18px;
  --radius-xl:     24px;
  --sidebar-w:     254px;
  --header-h:      66px;
  --trans:         all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Reset & Base Apple ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body, body.apple-light-mode {
  font-family: -apple-system, BlinkMacSystemFont, "Plus Jakarta Sans", "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif !important;
  background: #f5f5f7 !important;
  color: #1d1d1f !important;
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--accent); text-decoration: none; font-weight: 600; }
a:hover { color: var(--accent-dark); }
img { max-width: 100%; }

/* ---- Scrollbar Estilo macOS ---- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.15); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.25); }

/* ============================================================
   LAYOUT (MODO APPLE CLARO)
   ============================================================ */

.app-wrapper {
  display: flex;
  min-height: 100vh;
  background: #f5f5f7;
}

/* ---- Sidebar Blanco Puro macOS ---- */
.sidebar {
  width: var(--sidebar-w);
  background: #ffffff !important;
  border-right: 1px solid rgba(0, 0, 0, 0.08) !important;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  box-shadow: 2px 0 16px rgba(0, 0, 0, 0.02);
  transition: transform .3s ease;
}

/* Logo Oficial en Fondo Blanco */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  text-decoration: none;
  background: #ffffff !important;
  transition: var(--trans);
}
.sidebar-brand:hover {
  background: #fafafa !important;
}
.sidebar-brand .brand-icon {
  width: 44px; height: 44px;
  background: #ffffff !important;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  padding: 3px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.sidebar-brand .brand-icon img {
  width: 100%; height: 100%;
  object-fit: contain;
  background: #ffffff;
}
.sidebar-brand .brand-text { line-height: 1.22; min-width: 0; overflow: hidden; }
.sidebar-brand .brand-name {
  font-weight: 800;
  font-size: 13.5px;
  color: #0b1b33 !important; /* Azul Marino Oficial */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.2px;
}
.sidebar-brand .brand-sub {
  font-size: 11px;
  color: #059669 !important;
  font-weight: 700;
  letter-spacing: 0.2px;
}

/* Menú macOS con Pills Suaves */
.sidebar-nav { flex: 1; overflow-y: auto; padding: 14px 10px; }
.nav-section { margin-bottom: 16px; }
.nav-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.8px;
  text-transform: uppercase; color: #9ca3af;
  padding: 4px 12px 6px; display: block;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 10px !important;
  color: #4b5563 !important; font-size: 13.5px; font-weight: 600;
  transition: var(--trans); cursor: pointer; margin-bottom: 3px;
  text-decoration: none;
}
.nav-item i { font-size: 16px; width: 20px; text-align: center; color: #6b7280; transition: var(--trans); }
.nav-item:hover {
  background: rgba(0, 0, 0, 0.04) !important;
  color: #111827 !important;
}
.nav-item:hover i { color: #059669; }
.nav-item.active {
  background: #ecfdf5 !important;
  color: #047857 !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 3px rgba(16, 185, 129, 0.12) !important;
  border-left: none !important;
}
.nav-item.active i { color: #059669 !important; }
.nav-item .badge-mini {
  margin-left: auto;
  background: #fee2e2;
  color: #b91c1c; font-size: 10.5px; font-weight: 700;
  padding: 1px 7px; border-radius: 99px;
}

/* Pie de Sidebar */
.sidebar-footer {
  padding: 14px 16px; border-top: 1px solid rgba(0, 0, 0, 0.06);
  background: #ffffff;
}
.sidebar-footer .user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 12px;
  background: #f9fafb;
  border: 1px solid rgba(0, 0, 0, 0.05);
}
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #f97316);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13.5px; flex-shrink: 0;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
}
.user-info .user-name { font-size: 13px; font-weight: 700; color: #111827; }
.user-info .user-role { font-size: 11px; color: #6b7280; font-weight: 500; }
.sidebar-footer .logout-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; margin-top: 8px;
  border-radius: 10px; color: #dc2626;
  font-size: 12.5px; font-weight: 600; transition: var(--trans);
  text-decoration: none;
}
.sidebar-footer .logout-btn:hover { background: #fee2e2; }

/* ---- Área Principal ---- */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: #f5f5f7 !important;
}

/* ---- Topbar Acrílica Estilo Apple ---- */
.topbar {
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: saturate(180%) blur(20px) !important;
  -webkit-backdrop-filter: saturate(180%) blur(20px) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07) !important;
  display: flex; align-items: center;
  padding: 0 32px;
  gap: 16px;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
}
.topbar .page-title { font-size: 18px; font-weight: 800; color: #111827; letter-spacing: -0.3px; }
.topbar .topbar-right { margin-left: auto; display: flex; gap: 12px; align-items: center; }
.topbar .caja-badge {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 14px; border-radius: 99px;
  font-size: 12px; font-weight: 700;
}
.caja-badge.open   { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.caja-badge.closed { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }

/* Contenido Principal */
.content {
  padding: 28px 32px;
  flex: 1;
}

/* ============================================================
   TARJETAS Y COMPONENTES APPLE CLARO
   ============================================================ */

/* Tarjetas Blancas Elevadas */
.card, .glass-card {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
  border-radius: var(--radius-lg) !important;
  padding: 22px 24px;
  box-shadow: var(--shadow-sm) !important;
  transition: var(--trans);
}
.card:hover, .glass-card:hover {
  box-shadow: var(--shadow-md) !important;
}
.card-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 18px; padding-bottom: 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.card-header h3 { font-size: 15px; font-weight: 800; color: #111827; letter-spacing: -0.2px; }
.card-header .card-actions { margin-left: auto; }

/* ---- KPI CARDS (WIDGETS APPLE iOS) ---- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
  border-radius: 18px !important;
  padding: 20px;
  display: flex; gap: 16px; align-items: flex-start;
  position: relative; overflow: hidden;
  transition: var(--trans);
  box-shadow: var(--shadow-sm) !important;
}
.kpi-card::before { display: none !important; }
.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -4px rgba(0, 0, 0, 0.08) !important;
}

/* Squircles Iconos iOS */
.kpi-icon {
  width: 48px !important; height: 48px !important;
  border-radius: 14px !important; /* Squircle Apple */
  display: flex !important; align-items: center !important; justify-content: center !important;
  font-size: 22px !important; color: #ffffff !important;
  flex-shrink: 0;
  transition: var(--trans);
}
.kpi-card:hover .kpi-icon { transform: scale(1.06); }
.kpi-icon.green  { background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important; box-shadow: 0 4px 12px rgba(16, 185, 129, 0.28) !important; }
.kpi-icon.blue   { background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%) !important; box-shadow: 0 4px 12px rgba(2, 132, 199, 0.28) !important; }
.kpi-icon.purple { background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%) !important; box-shadow: 0 4px 12px rgba(99, 102, 241, 0.28) !important; }
.kpi-icon.orange { background: linear-gradient(135deg, #f97316 0%, #ea580c 100%) !important; box-shadow: 0 4px 12px rgba(234, 88, 12, 0.28) !important; }
.kpi-icon.yellow { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important; box-shadow: 0 4px 12px rgba(217, 119, 6, 0.28) !important; }
.kpi-icon.red    { background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%) !important; box-shadow: 0 4px 12px rgba(225, 29, 72, 0.28) !important; }

.kpi-body .kpi-label { font-size: 11.5px; color: #6b7280; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; }
.kpi-body .kpi-value { font-size: 26px; font-weight: 900; line-height: 1.15; margin: 4px 0 2px; color: #111827; letter-spacing: -0.6px; }
.kpi-body .kpi-sub   { font-size: 12px; color: #6b7280; display: flex; align-items: center; gap: 4px; font-weight: 500; }

/* ---- HERO BANNER APPLE ---- */
.dashboard-hero {
  background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 65%, #fff7ed 100%) !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
  border-radius: 20px !important;
  padding: 26px 30px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03) !important;
}
.hero-content { max-width: 580px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.6px; background: #ecfdf5;
  color: #059669; border: 1px solid #bbf7d0;
  padding: 3px 11px; border-radius: 99px; margin-bottom: 10px;
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #10b981;
  animation: pulse-live 1.8s infinite;
}
@keyframes pulse-live {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
  70% { transform: scale(1.15); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.hero-title { font-size: 24px; font-weight: 900; color: #111827; margin-bottom: 4px; letter-spacing: -0.6px; }
.hero-sub { color: #6b7280; font-size: 13.5px; line-height: 1.5; font-weight: 500; }
.hero-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hero-btn { font-size: 13.5px; font-weight: 700; border-radius: 12px !important; }

/* ---- BOTONES ESTILO APPLE ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: 12px !important;
  font-size: 13.5px; font-weight: 700; border: none; cursor: pointer;
  transition: var(--trans); white-space: nowrap; text-decoration: none;
  position: relative; outline: none; user-select: none;
}
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}
.btn:active:not(:disabled) { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.28) !important;
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #34d399 0%, #059669 100%) !important;
  box-shadow: 0 6px 20px rgba(5, 150, 105, 0.38) !important;
  color: #ffffff !important;
}
.btn-brand, .btn-coral {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.28) !important;
}
.btn-brand:hover:not(:disabled), .btn-coral:hover:not(:disabled) {
  background: linear-gradient(135deg, #fb923c 0%, #ea580c 100%) !important;
  box-shadow: 0 6px 20px rgba(234, 88, 12, 0.38) !important;
  color: #ffffff !important;
}
.btn-secondary {
  background: #ffffff !important;
  color: #111827 !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}
.btn-secondary:hover:not(:disabled) {
  background: #f9fafb !important;
  border-color: rgba(0, 0, 0, 0.18) !important;
}
.btn-danger {
  background: #fee2e2 !important; color: #b91c1c !important;
  border: 1px solid #fecaca !important;
}
.btn-danger:hover:not(:disabled) {
  background: #e11d48 !important; color: #ffffff !important;
}
.btn-success {
  background: #dcfce7 !important; color: #15803d !important;
  border: 1px solid #bbf7d0 !important;
}
.btn-success:hover:not(:disabled) {
  background: #059669 !important; color: #ffffff !important;
}
.btn-warning {
  background: #fef3c7 !important; color: #b45309 !important;
  border: 1px solid #fde68a !important;
}
.btn-warning:hover:not(:disabled) {
  background: #d97706 !important; color: #ffffff !important;
}
.btn-sm { padding: 6px 14px; font-size: 12px; border-radius: 8px !important; }
.btn-lg { padding: 12px 26px; font-size: 15px; border-radius: 14px !important; }
.btn-block { width: 100%; justify-content: center; }

/* ---- FORMULARIOS APPLE ---- */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 12.5px; font-weight: 700;
  color: #374151; margin-bottom: 6px;
}
.form-control, .form-select {
  width: 100%; padding: 10px 14px;
  background: #ffffff !important; border: 1px solid rgba(0, 0, 0, 0.12) !important;
  border-radius: 10px !important; color: #111827 !important;
  font-size: 14px; font-family: inherit;
  transition: var(--trans); outline: none;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}
.form-control:focus, .form-select:focus {
  border-color: #10b981 !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.16) !important;
}
.form-control::placeholder { color: #9ca3af; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }

/* ---- TABLAS APPLE ---- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  background: #ffffff;
}
table { width: 100%; border-collapse: collapse; }
thead th {
  background: #f9fafb !important; color: #4b5563 !important;
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .6px; padding: 12px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  transition: var(--trans);
  background: #ffffff !important;
}
tbody tr:hover { background: #f9fafb !important; }
tbody td { padding: 12px 16px; font-size: 13.5px; color: #1f2937 !important; }
tbody tr:last-child { border-bottom: none; }

/* ---- BADGES APPLE ---- */
.badge {
  display: inline-block; padding: 3px 10px;
  border-radius: 99px; font-size: 11.5px; font-weight: 700;
}
.badge-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.badge-danger  { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.badge-warning { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.badge-info    { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }

/* ---- MODALES BLANCOS APPLE ---- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 200;
  display: none; align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #ffffff !important; border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-radius: 22px !important; padding: 28px;
  width: min(580px, 95vw); box-shadow: var(--shadow-lg) !important;
  animation: appleSlideUp .25s ease;
}
@keyframes appleSlideUp {
  from { transform: translateY(16px) scale(0.98); opacity: 0; }
  to   { transform: translateY(0) scale(1);      opacity: 1; }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.modal-title { font-size: 17px; font-weight: 800; color: #111827; }
.modal-close { background: none; border: none; color: #9ca3af; cursor: pointer; font-size: 18px; }
.modal-close:hover { color: #e11d48; }

/* ============================================================
   PUNTO DE VENTA (POS) APPLE CLARO
   ============================================================ */

.pos-layout {
  display: grid;
  grid-template-columns: 1fr 390px;
  gap: 20px;
  height: calc(100vh - var(--header-h) - 48px);
}
.pos-left { display: flex; flex-direction: column; gap: 14px; overflow: hidden; }
.pos-right { display: flex; flex-direction: column; overflow: hidden; }

/* Buscador de Código de Barras */
.barcode-search { display: flex; gap: 8px; align-items: center; }
.barcode-input {
  flex: 1; padding: 12px 18px;
  background: #ffffff !important; border: 2px solid #10b981 !important;
  border-radius: 14px !important; color: #111827 !important;
  font-size: 15px; font-weight: 700; font-family: inherit; outline: none;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.12) !important;
}
.barcode-input::placeholder { color: #9ca3af; font-weight: 400; }

.search-results {
  background: #ffffff !important; border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-radius: 14px !important; overflow-y: auto; max-height: 260px;
  box-shadow: var(--shadow-lg) !important;
}
.search-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; cursor: pointer;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  transition: var(--trans);
}
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: #f9fafb !important; }
.search-item .item-name  { font-size: 14px; font-weight: 700; color: #111827; }
.search-item .item-meta  { font-size: 11px; color: #6b7280; }
.search-item .item-price { margin-left: auto; font-weight: 800; color: #059669; white-space: nowrap; }

/* Panel del Carrito */
.cart-panel {
  background: #ffffff !important; border: 1px solid rgba(0, 0, 0, 0.06) !important;
  border-radius: 20px !important; display: flex; flex-direction: column;
  overflow: hidden; height: 100%; box-shadow: var(--shadow-sm) !important;
}
.cart-header {
  padding: 16px 20px; border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  display: flex; align-items: center; justify-content: space-between;
  background: #ffffff !important;
}
.cart-header h3 { font-size: 15px; font-weight: 800; color: #111827; }
.cart-items { flex: 1; overflow-y: auto; padding: 12px; background: #ffffff !important; }
.cart-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  transition: var(--trans);
}
.cart-item:last-child { border-bottom: none; }
.cart-item:hover { background: #f9fafb !important; }
.cart-item-name  { font-size: 13px; font-weight: 700; color: #111827; flex: 1; }
.cart-item-meta  { font-size: 11px; color: #6b7280; margin-top: 2px; }
.qty-btn {
  width: 26px; height: 26px; border-radius: 8px !important;
  background: #f3f4f6 !important; border: 1px solid rgba(0, 0, 0, 0.08) !important;
  color: #111827 !important; cursor: pointer; font-size: 14px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  transition: var(--trans);
}
.qty-btn:hover { background: #10b981 !important; color: #ffffff !important; border-color: #10b981 !important; }
.qty-display { width: 36px; text-align: center; font-size: 13.5px; font-weight: 800; color: #111827; }
.cart-item-price { font-size: 14px; font-weight: 800; color: #059669; text-align: right; }

.cart-totals {
  padding: 16px 20px; border-top: 1px solid rgba(0, 0, 0, 0.06);
  background: #fafafa !important;
}
.total-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 3px 0; font-size: 13.5px;
}
.total-row.grand {
  font-size: 21px; font-weight: 900; color: #059669;
  padding-top: 10px; border-top: 2px dashed rgba(0, 0, 0, 0.1); margin-top: 8px;
}

.pay-section { padding: 16px 20px; background: #ffffff !important; border-top: 1px solid rgba(0, 0, 0, 0.05); }
.pay-methods { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.pay-method-btn {
  flex: 1; min-width: 65px; padding: 8px 6px; border-radius: 10px !important;
  background: #ffffff !important; border: 1px solid rgba(0, 0, 0, 0.1) !important;
  color: #4b5563; font-size: 12px; font-weight: 700;
  cursor: pointer; text-align: center; transition: var(--trans);
}
.pay-method-btn.active {
  background: #ecfdf5 !important; border-color: #10b981 !important; color: #059669 !important;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15) !important;
}
.pay-input-row { display: flex; gap: 8px; margin-bottom: 10px; }
.pay-input {
  flex: 1; padding: 10px 14px; font-size: 17px; font-weight: 800;
  background: #ffffff !important; border: 1px solid rgba(0, 0, 0, 0.12) !important;
  border-radius: 10px !important; color: #111827 !important; outline: none;
}
.pay-input:focus { border-color: #10b981 !important; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15) !important; }
.vuelto-display {
  background: #f0fdf4 !important; border: 1px solid #bbf7d0 !important;
  border-radius: 10px !important; padding: 9px 14px;
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px;
}
.vuelto-display .vuelto-label { font-size: 12px; font-weight: 700; color: #166534; }
.vuelto-display .vuelto-val   { font-size: 17px; font-weight: 900; color: #059669; }

/* Selector de Comprobante en POS */
.comprobante-selector {
  display: flex; gap: 6px; margin-bottom: 12px;
  background: #f3f4f6 !important; padding: 4px;
  border-radius: 12px !important; border: 1px solid rgba(0, 0, 0, 0.05) !important;
}
.comp-option {
  flex: 1; text-align: center; padding: 8px 6px;
  border-radius: 8px !important; cursor: pointer;
  font-size: 11px; font-weight: 700; color: #6b7280;
  border: 1px solid transparent; transition: var(--trans);
}
.comp-option.active {
  background: #ffffff !important; color: #059669 !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04) !important;
}

/* Pastillas de Categorías en POS */
.category-pills {
  display: flex; gap: 6px; overflow-x: auto;
  padding: 4px 0; margin-bottom: 10px; scrollbar-width: none;
}
.category-pills::-webkit-scrollbar { display: none; }
.category-pill {
  padding: 7px 16px; border-radius: 99px !important;
  background: #ffffff !important; border: 1px solid rgba(0, 0, 0, 0.08) !important;
  color: #4b5563 !important; font-size: 12px; font-weight: 700;
  cursor: pointer; white-space: nowrap; transition: var(--trans);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.category-pill:hover, .category-pill.active {
  background: #ecfdf5 !important; border-color: #10b981 !important; color: #059669 !important;
}

/* ============================================================
   WIDGETS & GRÁFICOS APPLE DASHBOARD
   ============================================================ */

/* Payment Pills List */
.payment-pills-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.payment-pill-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; background: #f9fafb !important;
  border: 1px solid rgba(0, 0, 0, 0.05) !important;
  border-radius: 12px !important; font-size: 13px; transition: var(--trans);
}
.payment-pill-item:hover { background: #f3f4f6 !important; }
.pill-dot { width: 10px; height: 10px; border-radius: 50%; }
.pill-dot.efectivo { background: #10b981; }
.pill-dot.tarjeta  { background: #0ea5e9; }
.pill-dot.yape     { background: #8b5cf6; }
.pill-dot.plin     { background: #06b6d4; }
.pill-dot.otros    { background: #f97316; }
.pill-name { font-weight: 600; color: #374151; flex: 1; }
.pill-val  { color: #059669; font-weight: 800; }

/* Top 5 Productos */
.top-products-list { display: flex; flex-direction: column; gap: 10px; }
.top-product-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; background: #f9fafb !important;
  border: 1px solid rgba(0, 0, 0, 0.05) !important;
  border-radius: 12px !important; transition: var(--trans);
}
.top-product-row:hover {
  background: #ffffff !important; border-color: rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04) !important;
  transform: translateX(3px);
}
.rank-badge {
  width: 26px; height: 26px; border-radius: 8px !important;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
  background: #e5e7eb; color: #4b5563;
}
.rank-badge.rank-1 { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; }
.rank-badge.rank-2 { background: linear-gradient(135deg, #9ca3af, #6b7280); color: #fff; }
.rank-badge.rank-3 { background: linear-gradient(135deg, #f97316, #ea580c); color: #fff; }
.prod-info { flex: 1; min-width: 0; }
.prod-name { display: block; font-size: 13px; font-weight: 700; color: #111827; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.prod-qty  { font-size: 11px; color: #6b7280; font-weight: 500; }
.prod-monto { font-size: 13px; font-weight: 800; color: #059669; white-space: nowrap; }

/* Live Activity Feed */
.live-activity-feed { display: flex; flex-direction: column; gap: 12px; }
.activity-feed-item { display: flex; align-items: flex-start; gap: 12px; font-size: 12.5px; }
.activity-bullet { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.activity-bullet.create { background: #10b981; }
.activity-bullet.update { background: #0284c7; }
.activity-bullet.delete { background: #e11d48; }
.activity-bullet.cancel { background: #ea580c; }
.activity-content { flex: 1; min-width: 0; }
.activity-title { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.activity-title strong { font-size: 12px; color: #111827; }
.activity-title .badge-mini { font-size: 10px; padding: 2px 7px; border-radius: 99px; font-weight: 700; }
.activity-title .badge-mini.create { background: #dcfce7; color: #15803d; }
.activity-title .badge-mini.update { background: #e0f2fe; color: #0369a1; }
.activity-title .badge-mini.delete { background: #fee2e2; color: #b91c1c; }
.activity-title .badge-mini.cancel { background: #ffedd5; color: #c2410c; }
.activity-desc { font-size: 11.5px; color: #4b5563; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-time { font-size: 11px; color: #9ca3af; }

/* Panel de Alerta de Stock */
.stock-alert-panel { border-left: 4px solid #f59e0b !important; }
.stock-cards-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px;
}
.stock-alert-card {
  background: #fffbeb !important; border: 1px solid #fde68a !important;
  border-radius: 12px !important; padding: 14px;
  display: flex; flex-direction: column; gap: 8px; transition: var(--trans);
}
.stock-alert-card:hover {
  background: #fef3c7 !important; border-color: #f59e0b !important; transform: translateY(-2px);
}
.stock-card-top { display: flex; justify-content: space-between; align-items: center; }
.stock-cat-pill { font-size: 10px; color: #92400e; text-transform: uppercase; font-weight: 700; }
.stock-warning-pill { font-size: 11px; font-weight: 800; color: #b45309; background: #ffffff; padding: 2px 8px; border-radius: 99px; border: 1px solid #fde68a; }
.stock-card-name { font-size: 13px; font-weight: 700; color: #111827; }
.stock-card-actions { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
.stock-price { font-size: 14px; font-weight: 800; color: #059669; }

/* ============================================================
   BOLETA Y TICKET DE IMPRESIÓN (BLANCO PURO)
   ============================================================ */

.boleta-ticket {
  width: 80mm;
  margin: 16px auto;
  background: #ffffff !important;
  color: #000000 !important;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  padding: 12px 10px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}
.boleta-ticket .ticket-header { text-align: center; margin-bottom: 8px; }
.boleta-ticket .ticket-title  { font-size: 15px; font-weight: bold; margin-bottom: 2px; }
.boleta-ticket .ticket-line   { border-top: 1px dashed #000; margin: 6px 0; }
.boleta-ticket table { width: 100%; font-size: 11px; }
.boleta-ticket td { padding: 2px 0; }
.boleta-ticket .text-right { text-align: right; }
.boleta-ticket .text-center { text-align: center; }
.boleta-ticket .total-row-ticket { font-weight: bold; font-size: 14px; }

@media print {
  .no-print { display: none !important; }
  body { background: #fff !important; color: #000 !important; padding: 0 !important; }
  .boleta-ticket { box-shadow: none !important; border: none !important; width: 80mm !important; }
  .boleta-ticket img { filter: grayscale(100%) contrast(140%) !important; -webkit-print-color-adjust: exact; }
  @page { size: 80mm auto; margin: 0; }
}

/* Responsive */
@media (max-width: 1100px) {
  .pos-layout { grid-template-columns: 1fr; height: auto; }
  .pos-right { height: 500px; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .content { padding: 18px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
}

/* 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; }
.mt-1 { margin-top: 4px; }
.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-xs   { font-size: 11px; }
.text-muted { color: #86868b; }
.text-accent { color: var(--accent); }
.text-danger { color: var(--accent-danger); }
.text-success { color: var(--accent-success); }
.font-bold { font-weight: 700; }
.w-full { width: 100%; }
.hidden { display: none; }
.empty-state { text-align: center; padding: 40px 20px; color: #9ca3af; }
.empty-state i { font-size: 40px; margin-bottom: 12px; opacity: .5; color: #cbd5e1; }
