:root{--bg:#0b1220;--text:#e5e7eb;--card:#0f172a;--border:rgba(255,255,255,.06);--muted:#94a3b8;--btn:#1f2937;--input-bg:#0b1020;--accent:#6366f1;--primary:#4f46e5;--danger:#7f1d1d;--orange-start:#f97316;--orange-end:#ea580c}
[data-theme="light"]{--bg:#f8fafc;--text:#0b1220;--card:#ffffff;--border:rgba(0,0,0,.08);--muted:#334155;--btn:#f1f5f9;--input-bg:#ffffff;--accent:#4f46e5;--primary:#4f46e5;--danger:#b91c1c;--orange-start:#fb923c;--orange-end:#f97316}
*{box-sizing:border-box}html,body{height:100%}body{margin:0;font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;background:var(--bg);color:var(--text)}
.app{display:grid;grid-template-columns:260px 1fr;min-height:100vh;transition:all .2s ease}
.sidebar{background:var(--card);border-right:1px solid var(--border);padding:20px;display:flex;flex-direction:column;gap:16px;transition:transform .2s ease}
.brand{font-weight:800;font-size:22px;color:#a5b4fc}
/* Sidebar buttons - estilo por defecto blanco/gris */
.nav-btn{background:#f8fafc;border:1px solid #e5e7eb;color:#374151;opacity:1;padding:10px 12px;border-radius:10px;margin-bottom:8px;text-align:left;cursor:pointer;transition:.2s;display:flex;align-items:center;gap:8px}
/* Hover con estilo gris */
.nav-btn:hover{border-color:#d1d5db;opacity:1;background:#f1f5f9;color:#1f2937;box-shadow:0 2px 4px rgba(0,0,0,.1);transform:translateY(-1px)}
/* Activo con estilo gris por defecto */
.nav-btn.active{background:#6b7280;border-color:#6b7280;color:white;box-shadow:0 2px 4px rgba(0,0,0,.2)}
/* Estilo especial solo para POS cuando está activo */
.nav-btn.active[href*="posventas"]{background:linear-gradient(135deg,var(--orange-start),var(--orange-end));border-color:#f59e0b;color:#0b1220;box-shadow:0 8px 22px rgba(245,158,11,.45);transform:translateY(-1px)}
.nav-btn.active[href*="posventas"]:hover{background:linear-gradient(135deg,#e66a00,#e68500);box-shadow:0 6px 12px rgba(255,123,0,.4);transform:translateY(-2px)}
.content{padding:24px}
.header{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}
.actions{display:flex;gap:8px}
.input{background:var(--input-bg);border:1px solid var(--border);color:var(--text);padding:10px 12px;border-radius:10px;outline:none}
.input:focus{border-color:var(--accent)}
.btn{background:var(--btn);border:1px solid var(--border);color:var(--text);padding:10px 14px;border-radius:10px;cursor:pointer;transition:all .2s ease;box-shadow:0 2px 4px rgba(0,0,0,.12)}
.btn:hover{transform:translateY(-1px);box-shadow:0 6px 14px rgba(0,0,0,.18)}
/* Tamaño pequeño usado ampliamente en vistas */
.btn.btn-sm,.btn.small{padding:6px 10px;font-size:12px}
/* Variantes modernas y coloridas - soporta ambas nomenclaturas */
.btn.primary,.btn.btn-primary{background:linear-gradient(135deg,#6366f1,#4f46e5);color:#fff;border-color:transparent}
.btn.secondary,.btn.btn-secondary{background:linear-gradient(135deg,#94a3b8,#64748b);color:#fff;border-color:transparent}
.btn.info,.btn.btn-info{background:linear-gradient(135deg,#38bdf8,#0ea5e9);color:#072b36;border-color:transparent}
.btn.warning,.btn.btn-warning{background:linear-gradient(135deg,#f59e0b,#d97706);color:#3b2300;border-color:transparent}
.btn.success,.btn.btn-success{background:linear-gradient(135deg,#34d399,#10b981);color:#053a2d;border-color:transparent}
.btn.danger,.btn.btn-danger{background:linear-gradient(135deg,#ef4444,#dc2626);color:#fff;border-color:transparent}
/* Fin variantes */
.table-wrapper{background:var(--card);border:1px solid var(--border);border-radius:12px;overflow:auto}
.table{width:100%;border-collapse:collapse}
th,td{border-bottom:1px solid var(--border);padding:12px;text-align:left;font-size:14px;color:var(--text);opacity:.9}
th{position:sticky;top:0;background:var(--card)}
.empty{padding:24px;color:var(--muted)}
.modal{position:fixed;inset:0;background:rgba(0,0,0,.6);display:flex;align-items:center;justify-content:center}
.modal-content{background:var(--card);border:1px solid var(--border);padding:20px;border-radius:12px;min-width:520px}
.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.form-control label{display:block;margin-bottom:6px;color:var(--muted);font-size:12px}
.form-control .input{width:100%}
.modal-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}
/* Pedido Details Styles */
.pedido-details .header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid #e5e7eb;
}

.pedido-details .status {
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.875rem;
}

.pedido-details .status.pendiente {
  background: #fef3c7;
  color: #92400e;
}

.pedido-details .status.completado {
  background: #d1fae5;
  color: #065f46;
}

.pedido-details .status.pagado {
  background: #dbeafe;
  color: #1e40af;
}

.pedido-details .info-card {
  background: #f9fafb;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 24px;
}

.pedido-details .info-card h3 {
  margin: 0 0 16px 0;
  color: #374151;
  font-size: 1.125rem;
}

.pedido-details .info-card p {
  margin: 8px 0;
  color: #6b7280;
}

.pedido-details .items-section h3 {
  margin: 0 0 16px 0;
  color: #374151;
  font-size: 1.125rem;
}

.pedido-details .items-table {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.pedido-details .table-header,
.pedido-details .table-row,
.pedido-details .table-footer {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 16px;
  padding: 16px;
  align-items: center;
}

.pedido-details .table-header {
  background: #f3f4f6;
  font-weight: 600;
  color: #374151;
  border-bottom: 1px solid #e5e7eb;
}

.pedido-details .table-row {
  border-bottom: 1px solid #f3f4f6;
}

.pedido-details .table-row:last-of-type {
  border-bottom: none;
}

.pedido-details .table-footer {
  background: #f9fafb;
  border-top: 2px solid #e5e7eb;
  font-weight: 600;
}

.pedido-details .product-info strong {
  display: block;
  color: #111827;
  margin-bottom: 4px;
}

.pedido-details .product-info small {
  color: #6b7280;
  font-size: 0.875rem;
}

.pedido-details .empty {
  text-align: center;
  color: #6b7280;
  padding: 40px;
  background: #f9fafb;
  border-radius: 8px;
}

@media (max-width:900px){.app{grid-template-columns:1fr}.sidebar{display:none}.modal-content{min-width:auto;width:92%}.grid{grid-template-columns:1fr}
  
  .pedido-details .table-header,
  .pedido-details .table-row,
  .pedido-details .table-footer {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .pedido-details .table-header > div:not(:first-child),
  .pedido-details .table-row > div:not(:first-child),
  .pedido-details .table-footer > div:not(:first-child) {
    display: none;
  }
  
  /* Central Menu Responsive */
  .brand-header h1{font-size:2rem}
  .brand-header p{font-size:1rem}
  .modules-grid{grid-template-columns:1fr;gap:20px;padding:0 10px}
  .module-card{padding:20px}
  .module-icon{font-size:3rem}
  .module-card h3{font-size:1.3rem}
  .central-menu{padding:20px 10px}
}

/* Modern Tables and Module Views */
.header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px 0;
    border-bottom: 2px solid #e9ecef;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-back:hover {
    background: linear-gradient(135deg, #495057, #343a40);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    color: white;
    text-decoration: none;
}

.search-section {
    margin-bottom: 25px;
}

.search-form {
    display: flex;
    justify-content: center;
}

.search-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
    max-width: 400px;
    width: 100%;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    margin-bottom: 25px;
}

.modern-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.modern-table thead {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
}

.modern-table th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modern-table tbody tr {
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s ease;
}

.modern-table tbody tr:hover {
    background-color: #f8f9fa;
}

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

.modern-table td {
    padding: 16px 20px;
    vertical-align: middle;
    font-size: 14px;
}

.name-cell {
    font-weight: 600;
    color: #2c3e50;
}

.actions-cell {
    width: 150px;
}

.action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-view {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
}

.btn-view:hover {
    background: linear-gradient(135deg, #138496, #117a8b);
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
}

.btn-edit {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    color: white;
}

.btn-edit:hover {
    background: linear-gradient(135deg, #e0a800, #d39e00);
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
}

.btn-delete {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
}

.btn-delete:hover {
    background: linear-gradient(135deg, #c82333, #bd2130);
    transform: translateY(-1px);
    color: white;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 20px 0;
}

.pagination span {
    font-weight: 600;
    color: #495057;
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #5a6268, #495057);
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
}

/* Status badges for pedidos */
.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: capitalize;
}

.status-pendiente {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-en-proceso {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.status-completado {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-cancelado {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Ventas y Reportes Styles */
.filters-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    border: 1px solid #e9ecef;
}

.date-filter-form {
    display: flex;
    align-items: end;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.summary-card:hover {
    transform: translateY(-5px);
}

.summary-card:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.summary-card:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.summary-card:nth-child(4) {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.card-icon {
    font-size: 2.5rem;
    opacity: 0.8;
}

.card-content h3 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
}

.card-content p {
    margin: 5px 0 0 0;
    opacity: 0.9;
    font-size: 14px;
}

.payment-methods {
    background: white;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.payment-methods h3 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.payment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.payment-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.payment-label {
    font-weight: 600;
    color: #2c3e50;
}

.payment-count {
    font-size: 14px;
    color: #7f8c8d;
}

.payment-amount {
    font-size: 1.2rem;
    font-weight: 700;
    color: #27ae60;
}

.payment-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.payment-efectivo {
    background: #d4edda;
    color: #155724;
}

.payment-tarjeta {
    background: #cce5ff;
    color: #004085;
}

.payment-transferencia {
    background: #fff3cd;
    color: #856404;
}

.total-cell {
    font-weight: 700;
    color: #27ae60;
    font-size: 1.1rem;
}

.date-display {
    background: #3498db;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
}

/* Reporte Diario Styles */
.daily-summary {
    background: white;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.daily-summary h2 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    border-bottom: 2px solid #e74c3c;
    padding-bottom: 10px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.summary-item {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-top: 4px solid #e74c3c;
}

.summary-label {
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 8px;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
}

.payment-analysis {
    background: white;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.payment-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.payment-method {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #9b59b6;
}

.payment-method h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.method-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #ecf0f1;
}

.hourly-sales {
    background: white;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.hourly-chart {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hour-bar {
    display: grid;
    grid-template-columns: 80px 150px 1fr;
    align-items: center;
    gap: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
}

.hour-label {
    font-weight: 600;
    color: #2c3e50;
}

.hour-stats {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hour-count {
    font-size: 12px;
    color: #7f8c8d;
}

.hour-total {
    font-weight: 600;
    color: #27ae60;
}

.hour-visual {
    background: #ecf0f1;
    height: 20px;
    border-radius: 10px;
    overflow: hidden;
}

.hour-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2980b9);
    transition: width 0.3s ease;
}

.detailed-sales {
    background: white;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.compact-table {
    font-size: 14px;
}

.compact-table th,
.compact-table td {
    padding: 8px 12px;
}

.no-data {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.no-data-icon {
    font-size: 4rem;
    color: #bdc3c7;
    margin-bottom: 20px;
}

.no-data h3 {
    color: #7f8c8d;
    margin-bottom: 10px;
}

.no-data p {
    color: #95a5a6;
}

/* Responsive Tables */
@media (max-width: 768px) {
    .header-section {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .search-input-group {
        flex-direction: column;
        max-width: 100%;
    }
    
    .modern-table {
        font-size: 12px;
    }
    
    .modern-table th,
    .modern-table td {
        padding: 12px 8px;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 4px;
    }
    
    .btn-action {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    .status-badge {
        font-size: 11px;
        padding: 3px 6px;
    }
    
    .date-filter-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
    }
    
    .payment-grid,
    .summary-grid,
    .payment-breakdown {
        grid-template-columns: 1fr;
    }
    
    .hour-bar {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}
/* Nuevos estilos */
.app.sidebarHidden .sidebar{transform:translateX(-100%)}
.btn.ghost{background:transparent;border-color:transparent}
.hamburger{font-size:20px}
.toolbar{display:flex;gap:8px;align-items:center;padding:12px;border-bottom:1px solid var(--border)}
.pagination{display:flex;gap:10px;align-items:center;justify-content:flex-end;padding:12px}
.card{background:var(--card);border:1px solid var(--border);border-radius:12px;padding:20px}
.auth{display:flex;align-items:center;justify-content:center;min-height:60vh}
.auth-card{min-width:360px}

/* Central ERP Menu Styles */
.app-central{display:flex;flex-direction:column;min-height:100vh}
.central-menu{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px 20px;background:linear-gradient(135deg,#667eea 0%,#764ba2 100%)}
.brand-header{text-align:center;margin-bottom:60px;color:white}
.brand-header h1{font-size:3rem;margin:0 0 10px 0;font-weight:800;text-shadow:0 2px 4px rgba(0,0,0,0.3)}
.brand-header p{font-size:1.2rem;opacity:0.9;margin:0}
.modules-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:30px;max-width:1200px;width:100%}
.module-card{background:white;border-radius:20px;padding:30px;text-align:center;box-shadow:0 10px 30px rgba(0,0,0,0.2);transition:all 0.3s ease;cursor:pointer;text-decoration:none;color:inherit;position:relative;overflow:hidden}
.module-card:hover{transform:translateY(-8px);box-shadow:0 20px 40px rgba(0,0,0,0.3)}
.module-card.active{border:3px solid #667eea;box-shadow:0 0 0 4px rgba(102,126,234,0.2)}
.module-icon{font-size:4rem;margin-bottom:20px;display:block}
.module-card h3{margin:0 0 15px 0;font-size:1.5rem;font-weight:700;color:#333}
.module-card p{margin:0;color:#666;font-size:1rem}
.sub-modules{margin-top:20px;display:flex;flex-direction:column;gap:8px}
.sub-modules a{padding:8px 16px;background:#f8f9fa;border-radius:8px;text-decoration:none;color:#555;font-size:0.9rem;transition:all 0.2s ease}
.sub-modules a:hover{background:#e9ecef;color:#333}
.sub-modules a.active{background:#667eea;color:white}
.pos-module{background:linear-gradient(135deg,#ff9a9e 0%,#fecfef 100%)}
.sales-module{background:linear-gradient(135deg,#a8edea 0%,#fed6e3 100%)}
.admin-module{background:linear-gradient(135deg,#ffecd2 0%,#fcb69f 100%)}
.contacts-module{background:linear-gradient(135deg,#d299c2 0%,#fef9d7 100%)}
.inventory-module{background:linear-gradient(135deg,#89f7fe 0%,#66a6ff 100%)}
.restaurant-module{background:linear-gradient(135deg,#fdbb2d 0%,#22c1c3 100%)}
.content-full{flex:1;display:flex;flex-direction:column}
.back-btn{color:#667eea;text-decoration:none;font-weight:600;padding:8px 16px;border-radius:8px;transition:all 0.2s ease}
.back-btn:hover{background:#f0f2ff;color:#5a67d8}
.user-info{color:#666;margin-right:16px;font-size:0.9rem}

/* Switch de tema */
.theme-switch{display:inline-flex;align-items:center;gap:8px}
.switch{position:relative;width:46px;height:26px;background:var(--border);border-radius:26px;cursor:pointer;transition:background .2s}
.switch .knob{position:absolute;top:3px;left:3px;width:20px;height:20px;background:#fff;border-radius:20px;transition:left .2s}
[data-theme="light"] .switch{background:#c7d2fe}
[data-theme="light"] .switch .knob{left:23px}

/* POS Ventas */
.pos{display:grid;grid-template-columns:260px 1fr 360px;gap:16px}
.pos .panel{background:var(--card);border:1px solid var(--border);border-radius:12px;overflow:hidden}
.pos .panel header{padding:12px 16px;border-bottom:1px solid var(--border);display:flex;justify-content:space-between;align-items:center}
.pos .cats{display:flex;flex-direction:column;padding:8px}
.pos .cats .cat{padding:10px;border-radius:8px;cursor:pointer;color:var(--text);opacity:.9}
.pos .cats .cat.active,.pos .cats .cat:hover{background:rgba(99,102,241,.12);opacity:1}
.pos .searchbar{padding:12px;border-bottom:1px solid var(--border)}
.pos .searchbar .input{width:100%}
.pos .products{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:16px;padding:16px}
.pos .card-item{border:1px solid var(--border);background:var(--card);border-radius:16px;overflow:hidden;transition:all .3s ease;cursor:pointer;box-shadow:0 2px 8px rgba(0,0,0,.08)}
.pos .card-item:hover{transform:translateY(-4px);box-shadow:0 8px 25px rgba(0,0,0,.15);border-color:var(--accent)}
.pos .card-item img{width:100%;height:140px;object-fit:cover;background:linear-gradient(135deg,#f1f5f9,#e2e8f0);border-bottom:1px solid var(--border)}
.pos .card-item .info{padding:14px}
.pos .card-item .name{font-weight:600;font-size:14px;margin-bottom:8px;color:var(--text);line-height:1.3}
.pos .card-item .price{color:#10b981;font-weight:700;font-size:16px}
.pos .card-item .actions{display:flex;justify-content:space-between;align-items:center;margin-top:12px}
.pos .card-item .btn{padding:6px 12px;font-size:12px;border-radius:8px;font-weight:600}
.pos .order{padding:0}
.pos .order .items{max-height:340px;overflow:auto}
.pos .order .item{display:grid;grid-template-columns:1fr 70px 30px 80px;gap:8px;align-items:center;padding:10px 12px;border-bottom:1px solid var(--border)}
.pos .order .qty{display:inline-flex;align-items:center;gap:6px}
.pos .order .summary{padding:12px;border-top:1px solid var(--border)}
.pos .order .summary .row{display:flex;justify-content:space-between;padding:4px 0}
.pos .order .pay{padding:12px;border-top:1px solid var(--border);display:flex;gap:8px;align-items:center;justify-content:space-between}
.pos .pill{padding:4px 8px;border:1px solid var(--border);border-radius:9999px;cursor:pointer}
.pos .pill.active{background:#fde68a;color:#92400e;border-color:#f59e0b}

/* Estilos mejorados para POS */
.pos-container {
    display: flex;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.products-section {
    flex: 2;
    padding: 20px;
    overflow-y: auto;
    background: rgba(255,255,255,0.95);
    margin: 10px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.order-section {
    flex: 1;
    background: white;
    padding: 20px;
    margin: 10px 10px 10px 0;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

/* Filtros y búsqueda mejorada */
.filtros-container {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.search-box {
    position: relative;
    margin-bottom: 15px;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    z-index: 1;
}

.search-box input {
    width: 100%;
    padding: 12px 45px 12px 45px;
    border: 2px solid #e1e5e9;
    border-radius: 25px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.search-box button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    transition: background 0.3s;
}

.search-box button:hover {
    background: #c82333;
}

.filtros-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 15px;
    align-items: end;
}

.filtro-grupo {
    display: flex;
    flex-direction: column;
}

.filtro-grupo label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filtro-grupo select {
    padding: 10px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.filtro-grupo select:focus {
    outline: none;
    border-color: #007bff;
}

.btn-reset {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-reset:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* Descuentos */
.discount-controls {
    display: flex;
    align-items: center;
    gap: 5px;
}

.discount-controls input {
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
}

.discount-controls .btn {
    padding: 5px 10px;
    font-size: 12px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.discount-controls .btn:hover {
    background: #218838;
}
.nav-btn{display:flex;align-items:center;gap:8px}
.nav-btn .icon{width:18px;height:18px;display:inline-flex;align-items:center}
.nav-btn .label{flex:1}

/* Order Details Styles */
.order-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 24px;
  border-radius: 12px 12px 0 0;
  margin-bottom: 0;
}

.order-header h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
}

.status-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  margin-top: 8px;
}

.status-badge.pendiente {
  background: #fef3c7;
  color: #92400e;
}

.status-badge.completado {
  background: #d1fae5;
  color: #065f46;
}

.status-badge.pagado {
  background: #dbeafe;
  color: #1e40af;
}

.order-info {
  background: white;
  padding: 24px;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  margin-bottom: 24px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.info-card {
  background: #f8fafc;
  padding: 16px;
  border-radius: 8px;
  border-left: 4px solid #667eea;
}

.info-card h4 {
  margin: 0 0 8px 0;
  color: #374151;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-card p {
  margin: 0;
  color: #1f2937;
  font-size: 16px;
  font-weight: 500;
}

.items-section {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.items-section h3 {
  background: #f8fafc;
  margin: 0;
  padding: 20px 24px;
  color: #374151;
  font-size: 18px;
  font-weight: 600;
  border-bottom: 1px solid #e5e7eb;
}

.items-table {
  width: 100%;
  border-collapse: collapse;
}

.items-table th,
.items-table td {
  padding: 16px 24px;
  text-align: left;
  border-bottom: 1px solid #f3f4f6;
}

.items-table th {
  background: #f9fafb;
  color: #374151;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.items-table td {
  color: #1f2937;
}

.items-table tr:hover {
  background: #f8fafc;
}

.total-row {
  background: #f0f9ff !important;
  font-weight: 600;
  font-size: 16px;
}

.total-row td {
  border-bottom: none;
  color: #1e40af;
}

/* Action Buttons */
.btn-secondary {
  background: #6b7280;
  color: white;
}

.btn-secondary:hover {
  background: #4b5563;
}

.btn-primary {
  background: #3b82f6;
  color: white;
}

.btn-primary:hover {
  background: #2563eb;
}

.btn-warning {
  background: #f59e0b;
  color: white;
}

.btn-warning:hover {
  background: #d97706;
}

.btn-success {
  background: #10b981;
  color: white;
}

.btn-success:hover {
  background: #059669;
}

.btn-danger {
  background: #ef4444;
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.management-section h4 {
  margin: 0 0 12px 0;
  color: #374151;
  font-size: 16px;
  font-weight: 600;
}

@media (max-width: 768px) {
  .order-header {
    padding: 16px;
  }
  
  .order-header h1 {
    font-size: 24px;
  }
  
  .order-info {
    padding: 16px;
  }
  
  .info-grid {
    grid-template-columns: 1fr;
  }
  
  .items-table th,
  .items-table td {
    padding: 12px 16px;
  }
  
  .items-table {
    font-size: 14px;
  }
  
  .action-buttons {
    flex-direction: column;
    gap: 8px;
  }
  
  .action-buttons > div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .management-section > div {
    grid-template-columns: 1fr !important;
  }
}