/* Sistema POS - Kiosco */
* { box-sizing: border-box; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #f3f4f6;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 3px; }
::-webkit-scrollbar-thumb { background: #9ca3af; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #6b7280; }

/* Animations */
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.fade-in { animation: fadeIn 0.3s ease; }
.slide-in { animation: slideIn 0.3s ease; }

/* Login */
.login-bg {
  background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 50%, #2563eb 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Sidebar */
.sidebar {
  width: 240px;
  min-height: 100vh;
  background: linear-gradient(180deg, #1e3a8a 0%, #1d4ed8 100%);
  position: fixed;
  left: 0; top: 0;
  z-index: 40;
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: rgba(255,255,255,0.75);
  cursor: pointer;
  border-radius: 8px;
  margin: 2px 8px;
  transition: all 0.2s;
  font-size: 14px;
  font-weight: 500;
}

.sidebar-item:hover { background: rgba(255,255,255,0.15); color: white; }
.sidebar-item.active { background: rgba(255,255,255,0.25); color: white; }
.sidebar-item i { width: 20px; text-align: center; font-size: 16px; }

.main-content {
  margin-left: 240px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Cards */
.stat-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: box-shadow 0.2s, transform 0.2s;
}
.stat-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.15); transform: translateY(-2px); }

/* POS */
.pos-product-btn {
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.pos-product-btn:hover { border-color: #3b82f6; background: #eff6ff; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(59,130,246,0.2); }
.pos-product-btn.out-of-stock { opacity: 0.4; cursor: not-allowed; }

/* Cart */
.cart-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid #f3f4f6;
  animation: fadeIn 0.2s ease;
}
.cart-item:last-child { border-bottom: none; }

/* Badge */
.badge { display: inline-flex; align-items: center; justify-content: center; border-radius: 9999px; font-size: 11px; font-weight: 700; }
.badge-danger { background: #fee2e2; color: #dc2626; padding: 2px 8px; }
.badge-success { background: #dcfce7; color: #16a34a; padding: 2px 8px; }
.badge-warning { background: #fef3c7; color: #d97706; padding: 2px 8px; }
.badge-info { background: #dbeafe; color: #2563eb; padding: 2px 8px; }

/* Notification bell */
.notif-dot {
  position: absolute;
  top: -4px; right: -4px;
  background: #ef4444;
  color: white;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse 2s infinite;
}

/* Modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}
.modal-box {
  background: white;
  border-radius: 20px;
  padding: 28px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  animation: fadeIn 0.3s ease;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-box.lg { max-width: 700px; }

/* Inputs */
input, select, textarea {
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  transition: border-color 0.2s;
  outline: none;
  width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: #3b82f6; }

/* Buttons */
.btn {
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: #2563eb; color: white; }
.btn-primary:hover { background: #1d4ed8; }
.btn-success { background: #16a34a; color: white; }
.btn-success:hover { background: #15803d; }
.btn-danger { background: #dc2626; color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-warning { background: #d97706; color: white; }
.btn-warning:hover { background: #b45309; }
.btn-gray { background: #6b7280; color: white; }
.btn-gray:hover { background: #4b5563; }
.btn-outline { background: transparent; border: 2px solid #e5e7eb; color: #374151; }
.btn-outline:hover { border-color: #9ca3af; background: #f9fafb; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }

/* Toast */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 14px 20px;
  border-radius: 12px;
  color: white;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  animation: slideIn 0.3s ease;
  min-width: 280px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast-success { background: linear-gradient(135deg, #16a34a, #15803d); }
.toast-error { background: linear-gradient(135deg, #dc2626, #b91c1c); }
.toast-warning { background: linear-gradient(135deg, #d97706, #b45309); }
.toast-info { background: linear-gradient(135deg, #2563eb, #1d4ed8); }

/* Table */
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { background: #f8fafc; color: #6b7280; font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: 0.05em; padding: 12px 16px; text-align: left; border-bottom: 2px solid #e5e7eb; }
.data-table td { padding: 12px 16px; border-bottom: 1px solid #f3f4f6; color: #374151; }
.data-table tr:hover td { background: #f8fafc; }

/* Barcode input highlight */
.barcode-input {
  font-size: 20px !important;
  font-family: monospace;
  background: #eff6ff;
  border-color: #3b82f6 !important;
  text-align: center;
  letter-spacing: 2px;
}

/* POS layout */
.pos-grid { display: grid; grid-template-columns: 1fr 380px; gap: 20px; height: calc(100vh - 70px); }
.pos-left { overflow-y: auto; padding: 16px; }
.pos-right { display: flex; flex-direction: column; border-left: 2px solid #e5e7eb; background: white; }

/* Number display */
.total-display {
  font-size: 48px;
  font-weight: 800;
  color: #1e3a8a;
  text-align: center;
  padding: 16px;
  background: #eff6ff;
  border-radius: 12px;
  font-family: monospace;
  letter-spacing: -1px;
}

/* Loading */
.spinner {
  width: 40px; height: 40px;
  border: 4px solid #e5e7eb;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Audit log */
.audit-action-CREATE { color: #16a34a; }
.audit-action-UPDATE { color: #d97706; }
.audit-action-DELETE { color: #dc2626; font-weight: 700; }
.audit-action-SALE { color: #2563eb; }
.audit-action-LOGIN { color: #6b7280; }
.audit-action-LOGOUT { color: #9ca3af; }
.audit-action-STOCK_ADJUST { color: #7c3aed; }

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .pos-grid { grid-template-columns: 1fr; }
  .pos-right { min-height: 400px; }
}
