/* ═══════════════════════════════════════════════════════
   VENDAFÁCIL - SISTEMA DE GESTÃO DE VENDAS
   CSS Principal - Design System Moderno
═══════════════════════════════════════════════════════ */

/* ── CSS Variables (Light Theme) ── */
:root {
  --primary: #16a34a;
  --primary-dark: #15803d;
  --primary-light: #dcfce7;
  --accent: #0ea5e9;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --success: #10b981;
  --success-light: #d1fae5;
  --purple: #8b5cf6;
  --pink: #ec4899;

  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --bg-hover: #f0fdf4;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --border: #e2e8f0;
  --border-light: #f1f5f9;

  --sidebar-bg: #0f172a;
  --sidebar-text: #cbd5e1;
  --sidebar-active: #16a34a;
  --sidebar-hover: rgba(255,255,255,0.07);

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --sidebar-width: 260px;
  --topbar-height: 64px;
  --transition: 0.2s ease;
}

/* ── Dark Theme ── */
[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #273548;
  --bg-hover: #1a2e20;

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --border: #334155;
  --border-light: #1e293b;

  --sidebar-bg: #020617;
  --sidebar-hover: rgba(255,255,255,0.05);

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.3);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.35);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.4);
}

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

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; border: none; outline: none; }
input, select, textarea { font-family: inherit; outline: none; }
ul { list-style: none; }
img { max-width: 100%; }

.hidden { display: none !important; }

/* ═══════════════════════════════════════════════
   LOGIN SCREEN
═══════════════════════════════════════════════ */
.login-screen {
  position: fixed; inset: 0; z-index: 9999;
  background: linear-gradient(135deg, #0f172a 0%, #16213e 50%, #0d3b1e 100%);
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
}

.login-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.login-blob {
  position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.15;
  animation: float 6s ease-in-out infinite;
}
.blob1 { width: 400px; height: 400px; background: var(--primary); top: -100px; left: -100px; }
.blob2 { width: 350px; height: 350px; background: var(--accent); bottom: -100px; right: -50px; animation-delay: -2s; }
.blob3 { width: 250px; height: 250px; background: var(--purple); top: 40%; left: 40%; animation-delay: -4s; }

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-20px) scale(1.05); }
}

.login-card {
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  width: 100%; max-width: 420px;
  position: relative; z-index: 1;
  box-shadow: 0 32px 64px rgba(0,0,0,0.5);
}

.login-logo {
  text-align: center; margin-bottom: 36px;
}
.logo-icon {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  font-size: 28px; color: white;
  box-shadow: 0 8px 24px rgba(22,163,74,0.4);
}
.login-logo h1 { font-size: 28px; font-weight: 800; color: #fff; letter-spacing: -0.5px; }
.login-logo p { color: rgba(255,255,255,0.5); font-size: 14px; margin-top: 4px; }

.login-card .form-group { margin-bottom: 20px; }
.login-card label {
  display: block; color: rgba(255,255,255,0.7);
  font-size: 13px; font-weight: 500; margin-bottom: 8px;
}
.login-card input {
  width: 100%; padding: 12px 16px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius);
  color: #fff; font-size: 15px;
  transition: var(--transition);
}
.login-card input:focus {
  border-color: var(--primary);
  background: rgba(255,255,255,0.12);
  box-shadow: 0 0 0 3px rgba(22,163,74,0.2);
}
.login-card input::placeholder { color: rgba(255,255,255,0.3); }

.password-wrapper { position: relative; }
.toggle-pass {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; color: rgba(255,255,255,0.5); font-size: 15px;
  padding: 4px;
}
.toggle-pass:hover { color: #fff; }

.login-error {
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.3);
  color: #fca5a5;
  padding: 10px 14px; border-radius: var(--radius-sm);
  font-size: 13px; margin-bottom: 16px;
}

.btn-login {
  width: 100%; padding: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white; font-size: 16px; font-weight: 600;
  border-radius: var(--radius); border: none;
  cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 4px 16px rgba(22,163,74,0.4);
}
.btn-login:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(22,163,74,0.5); }
.btn-login:active { transform: none; }

.login-hint {
  text-align: center; margin-top: 20px;
  color: rgba(255,255,255,0.35); font-size: 12px;
}
.login-hint strong { color: rgba(255,255,255,0.6); }

/* ═══════════════════════════════════════════════
   APP LAYOUT
═══════════════════════════════════════════════ */
.app {
  display: flex; min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.sidebar-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.sidebar-logo {
  display: flex; align-items: center; gap: 12px;
}
.logo-icon-sm {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 15px;
}
.logo-text { font-size: 18px; font-weight: 700; color: #fff; letter-spacing: -0.3px; }
.sidebar-close { display: none; background: none; color: rgba(255,255,255,0.5); font-size: 18px; padding: 4px 8px; }

.sidebar-nav {
  flex: 1; overflow-y: auto; padding: 12px 12px;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.nav-section-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1.2px; color: rgba(255,255,255,0.25);
  padding: 12px 12px 6px;
  margin-top: 4px;
}

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius);
  color: var(--sidebar-text); font-size: 14px; font-weight: 500;
  transition: var(--transition); position: relative;
  margin-bottom: 2px; cursor: pointer;
}
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active {
  background: linear-gradient(135deg, rgba(22,163,74,0.25), rgba(22,163,74,0.15));
  color: #4ade80;
  border: 1px solid rgba(22,163,74,0.2);
}
.nav-item.active i { color: var(--primary); }
.nav-item i { width: 18px; text-align: center; font-size: 15px; }
.nav-badge {
  margin-left: auto;
  background: var(--primary); color: white;
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 20px;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}
.dark-mode-toggle {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius);
  color: var(--sidebar-text); font-size: 14px;
  margin-bottom: 8px;
}
.dark-mode-toggle i { font-size: 15px; }
.dark-mode-toggle span { flex: 1; }

.toggle-switch {
  position: relative; display: inline-block;
  width: 38px; height: 22px;
}
.toggle-switch input { display: none; }
.toggle-slider {
  position: absolute; inset: 0; cursor: pointer;
  background: rgba(255,255,255,0.15); border-radius: 11px;
  transition: var(--transition);
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 16px; height: 16px; border-radius: 50%;
  background: white; top: 3px; left: 3px;
  transition: var(--transition);
}
input:checked + .toggle-slider { background: var(--primary); }
input:checked + .toggle-slider::before { transform: translateX(16px); }

.btn-logout {
  width: 100%; padding: 10px 12px;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.15);
  color: #f87171; border-radius: var(--radius);
  font-size: 14px; font-weight: 500;
  display: flex; align-items: center; gap: 10px;
  transition: var(--transition);
}
.btn-logout:hover { background: rgba(239,68,68,0.2); color: #fca5a5; }

/* ── MAIN CONTENT ── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex; flex-direction: column;
  min-height: 100vh;
  transition: margin 0.3s;
}

/* ── TOPBAR ── */
.topbar {
  height: var(--topbar-height);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; gap: 16px;
  position: sticky; top: 0; z-index: 90;
  box-shadow: var(--shadow-sm);
}

.topbar-left { display: flex; align-items: center; gap: 16px; }
.menu-toggle {
  background: none; color: var(--text-secondary);
  font-size: 18px; padding: 6px; border-radius: var(--radius-sm);
  display: none;
}
.menu-toggle:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.breadcrumb { font-size: 16px; font-weight: 600; color: var(--text-primary); }

.topbar-right { display: flex; align-items: center; gap: 12px; }

.search-global {
  position: relative; display: flex; align-items: center;
}
.search-global i {
  position: absolute; left: 12px;
  color: var(--text-muted); font-size: 14px; pointer-events: none;
}
.search-global input {
  width: 240px; padding: 8px 12px 8px 36px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 14px;
  color: var(--text-primary); transition: var(--transition);
}
.search-global input:focus {
  width: 300px; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22,163,74,0.1);
  background: var(--bg-primary);
}

.search-results {
  position: absolute; top: 100%; left: 0; right: 0; margin-top: 4px;
  background: var(--bg-primary); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  max-height: 300px; overflow-y: auto; z-index: 200;
}
.search-result-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; cursor: pointer; transition: var(--transition);
}
.search-result-item:hover { background: var(--bg-secondary); }
.search-result-item img { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; }
.search-result-item .res-icon { width: 36px; height: 36px; background: var(--primary-light); border-radius: 6px; display: flex; align-items: center; justify-content: center; color: var(--primary); }
.search-result-item .res-name { font-size: 14px; font-weight: 500; }
.search-result-item .res-price { font-size: 12px; color: var(--text-muted); }

.notification-btn {
  position: relative; background: var(--bg-secondary);
  border: 1px solid var(--border); color: var(--text-secondary);
  width: 40px; height: 40px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; transition: var(--transition);
}
.notification-btn:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.notif-badge {
  position: absolute; top: -6px; right: -6px;
  background: var(--danger); color: white;
  font-size: 10px; font-weight: 700;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.notif-badge:empty, .notif-badge[data-count="0"] { display: none; }

.user-menu { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.user-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white; font-weight: 700; font-size: 15px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.user-name { font-size: 14px; font-weight: 500; color: var(--text-primary); }

/* NOTIFICATION PANEL */
.notification-panel {
  position: fixed; top: var(--topbar-height); right: 16px;
  width: 340px; background: var(--bg-primary);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); z-index: 200;
  overflow: hidden;
}
.notif-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: 15px;
}
.notif-header button { background: none; color: var(--primary); font-size: 13px; font-weight: 500; }
.notif-list { max-height: 400px; overflow-y: auto; }
.notif-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 20px; border-bottom: 1px solid var(--border-light);
  transition: var(--transition);
}
.notif-item:hover { background: var(--bg-secondary); }
.notif-item-icon { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 15px; }
.notif-item.warning .notif-item-icon { background: var(--warning-light); color: var(--warning); }
.notif-item.danger .notif-item-icon { background: var(--danger-light); color: var(--danger); }
.notif-item.success .notif-item-icon { background: var(--success-light); color: var(--success); }
.notif-item-body p { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.notif-item-body small { font-size: 12px; color: var(--text-muted); }

/* ── VIEW CONTAINER ── */
.view-container {
  flex: 1; padding: 24px;
  background: var(--bg-secondary);
}

.view { display: none; }
.view.active { display: block; animation: fadeIn 0.2s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.view-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.view-header h2 { font-size: 22px; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 10px; }
.view-header h2 i { color: var(--primary); }

.header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ═══════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: var(--radius);
  font-size: 14px; font-weight: 500;
  transition: var(--transition); cursor: pointer; border: none;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white; box-shadow: 0 2px 8px rgba(22,163,74,0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(22,163,74,0.4); }
.btn-outline {
  background: var(--bg-primary); color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-outline:hover { background: var(--bg-secondary); color: var(--text-primary); border-color: var(--primary); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-icon { padding: 8px; width: 36px; height: 36px; border-radius: var(--radius-sm); }
.btn-icon:hover { background: var(--bg-tertiary); }

/* ═══════════════════════════════════════════════
   DASHBOARD - KPI CARDS
═══════════════════════════════════════════════ */
.kpi-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-primary); border-radius: var(--radius-lg);
  padding: 24px; display: flex; align-items: center; gap: 16px;
  box-shadow: var(--shadow); transition: var(--transition);
  border: 1px solid var(--border);
  position: relative; overflow: hidden;
}
.kpi-card::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.kpi-sales::before { background: linear-gradient(90deg, var(--primary), #34d399); }
.kpi-profit::before { background: linear-gradient(90deg, var(--accent), #38bdf8); }
.kpi-products::before { background: linear-gradient(90deg, var(--purple), #a78bfa); }
.kpi-customers::before { background: linear-gradient(90deg, var(--pink), #f472b6); }

.kpi-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.kpi-sales .kpi-icon { background: var(--primary-light); color: var(--primary); }
.kpi-profit .kpi-icon { background: #e0f2fe; color: var(--accent); }
.kpi-products .kpi-icon { background: #ede9fe; color: var(--purple); }
.kpi-customers .kpi-icon { background: #fce7f3; color: var(--pink); }

[data-theme="dark"] .kpi-profit .kpi-icon { background: rgba(14,165,233,0.15); }
[data-theme="dark"] .kpi-products .kpi-icon { background: rgba(139,92,246,0.15); }
[data-theme="dark"] .kpi-customers .kpi-icon { background: rgba(236,72,153,0.15); }

.kpi-info { flex: 1; min-width: 0; }
.kpi-label { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 4px; }
.kpi-value { display: block; font-size: 24px; font-weight: 800; color: var(--text-primary); letter-spacing: -0.5px; }
.kpi-sub { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── Charts ── */
.charts-row {
  display: flex; gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}

.chart-card {
  background: var(--bg-primary); border-radius: var(--radius-lg);
  padding: 24px; box-shadow: var(--shadow); flex: 1; min-width: 280px;
  border: 1px solid var(--border);
}
.chart-main { flex: 2.5; }
.chart-side { flex: 1; }

.chart-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.chart-header h3 { font-size: 15px; font-weight: 600; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.chart-header h3 i { color: var(--primary); }

/* ── Bottom Row ── */
.bottom-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}

.table-card {
  background: var(--bg-primary); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); border: 1px solid var(--border); overflow: hidden;
}
.table-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 16px; border-bottom: 1px solid var(--border);
}
.table-card-header h3 { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.table-card-header h3 i { color: var(--primary); }

.top-products-list, .low-stock-list { padding: 8px 0; }

.top-product-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 24px; transition: var(--transition);
}
.top-product-item:hover { background: var(--bg-secondary); }
.top-product-rank {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.rank-1 { background: #fef3c7; color: #d97706; }
.rank-2 { background: #f1f5f9; color: #64748b; }
.rank-3 { background: #fff7ed; color: #c2410c; }
.rank-other { background: var(--bg-tertiary); color: var(--text-muted); }
.top-product-info { flex: 1; }
.top-product-info strong { display: block; font-size: 14px; font-weight: 500; }
.top-product-info small { font-size: 12px; color: var(--text-muted); }
.top-product-bar-wrap { flex: 1; max-width: 80px; }
.top-product-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.top-product-bar-fill { height: 100%; background: linear-gradient(90deg, var(--primary), #34d399); border-radius: 3px; transition: width 0.6s ease; }

.low-stock-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 24px; cursor: pointer; transition: var(--transition);
}
.low-stock-item:hover { background: var(--bg-secondary); }
.low-stock-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.low-stock-icon.out { background: var(--danger-light); color: var(--danger); }
.low-stock-icon.low { background: var(--warning-light); color: var(--warning); }
.low-stock-info { flex: 1; }
.low-stock-info strong { display: block; font-size: 14px; font-weight: 500; }
.low-stock-info small { font-size: 12px; color: var(--text-muted); }
.low-stock-qty { font-size: 20px; font-weight: 800; }
.low-stock-qty.out { color: var(--danger); }
.low-stock-qty.low { color: var(--warning); }

.empty-state-sm {
  text-align: center; padding: 32px;
  color: var(--text-muted); font-size: 14px;
}

/* ═══════════════════════════════════════════════
   FILTER BAR
═══════════════════════════════════════════════ */
.filter-bar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px; flex-wrap: wrap;
}

.search-input-wrap {
  position: relative; flex: 1; min-width: 200px;
}
.search-input-wrap i {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 14px; pointer-events: none;
}
.search-input-wrap input {
  width: 100%; padding: 9px 12px 9px 36px;
  background: var(--bg-primary); border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 14px; color: var(--text-primary);
  transition: var(--transition);
}
.search-input-wrap input:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(22,163,74,0.1);
}

.filter-bar select, .filter-bar input[type="date"], .period-select {
  padding: 9px 12px; background: var(--bg-primary);
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 14px; color: var(--text-primary);
  cursor: pointer; transition: var(--transition);
}
.filter-bar select:focus, .period-select:focus { border-color: var(--primary); }

.view-toggle { display: flex; gap: 4px; }
.view-btn {
  padding: 8px 12px; background: var(--bg-primary);
  border: 1px solid var(--border); color: var(--text-muted);
  border-radius: var(--radius-sm); font-size: 14px;
  transition: var(--transition);
}
.view-btn.active { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }

/* ═══════════════════════════════════════════════
   PRODUCTS GRID & LIST
═══════════════════════════════════════════════ */
.products-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px;
}
.products-list { display: flex; flex-direction: column; gap: 8px; }

.product-card {
  background: var(--bg-primary); border-radius: var(--radius-lg);
  border: 1px solid var(--border); overflow: hidden;
  box-shadow: var(--shadow-sm); transition: var(--transition);
  cursor: pointer; position: relative;
}
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--primary); }

.product-card-image {
  height: 160px; overflow: hidden; position: relative;
  background: var(--bg-tertiary);
}
.product-card-image img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.3s;
}
.product-card:hover .product-card-image img { transform: scale(1.05); }
.product-card-image .no-image {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--text-muted); gap: 8px; font-size: 13px;
}
.product-card-image .no-image i { font-size: 32px; }

.product-card-body { padding: 16px; }
.product-card-cat {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 6px;
}
.product-card-name { font-size: 15px; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; line-height: 1.3; }
.product-card-price { font-size: 20px; font-weight: 800; color: var(--primary); }
.product-card-cost { font-size: 12px; color: var(--text-muted); }

.product-card-stock {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border);
}
.stock-badge {
  font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 20px;
}
.stock-badge.ok { background: var(--success-light); color: #059669; }
.stock-badge.low { background: var(--warning-light); color: #d97706; }
.stock-badge.out { background: var(--danger-light); color: var(--danger); }

.product-card-actions {
  display: flex; gap: 6px; padding: 0 16px 16px;
}

.product-card-actions .btn {
  flex: 1; justify-content: center; padding: 7px 12px; font-size: 13px;
}

/* Product List View */
.product-list-item {
  background: var(--bg-primary); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: var(--shadow-sm); transition: var(--transition);
}
.product-list-item:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.product-list-thumb {
  width: 56px; height: 56px; border-radius: 10px; overflow: hidden;
  background: var(--bg-tertiary); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.product-list-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-list-thumb i { font-size: 20px; color: var(--text-muted); }
.product-list-info { flex: 1; }
.product-list-info strong { display: block; font-size: 15px; font-weight: 600; }
.product-list-info small { font-size: 13px; color: var(--text-muted); }
.product-list-price { text-align: right; }
.product-list-price .price { font-size: 18px; font-weight: 700; color: var(--primary); }
.product-list-price .cost { font-size: 12px; color: var(--text-muted); }
.product-list-actions { display: flex; gap: 6px; }

/* ═══════════════════════════════════════════════
   CATEGORIES
═══════════════════════════════════════════════ */
.categories-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px;
}

.category-card {
  background: var(--bg-primary); border-radius: var(--radius-lg);
  border: 1px solid var(--border); padding: 24px;
  box-shadow: var(--shadow-sm); transition: var(--transition);
  display: flex; align-items: flex-start; gap: 16px; position: relative;
}
.category-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.category-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0; color: white;
}
.category-info { flex: 1; }
.category-info h3 { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.category-info p { font-size: 13px; color: var(--text-muted); }
.category-count { font-size: 12px; font-weight: 600; color: var(--primary); margin-top: 8px; }
.category-actions { display: flex; gap: 6px; position: absolute; top: 16px; right: 16px; }

/* ═══════════════════════════════════════════════
   PDV - PONTO DE VENDA
═══════════════════════════════════════════════ */
.pdv-layout {
  display: flex; gap: 20px; height: calc(100vh - var(--topbar-height) - 100px);
}

.pdv-products {
  flex: 1; display: flex; flex-direction: column; gap: 12px; overflow: hidden;
}

.pdv-search-bar {
  background: var(--bg-primary); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow-sm);
}
.pdv-search-bar .search-input-wrap { margin-bottom: 12px; }
.pdv-search-bar .search-input-wrap input { font-size: 15px; }

.pdv-cat-filter {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px;
  scrollbar-width: none;
}
.pdv-cat-filter::-webkit-scrollbar { display: none; }
.cat-btn {
  padding: 6px 14px; border-radius: 20px;
  background: var(--bg-secondary); color: var(--text-secondary);
  border: 1px solid var(--border); font-size: 13px; font-weight: 500;
  white-space: nowrap; transition: var(--transition); cursor: pointer;
}
.cat-btn.active {
  background: var(--primary); color: white; border-color: var(--primary);
}

.pdv-product-grid {
  flex: 1; overflow-y: auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px;
  align-content: start;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.pdv-product-grid::-webkit-scrollbar { width: 6px; }
.pdv-product-grid::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.pdv-product-card {
  background: var(--bg-primary); border: 2px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  cursor: pointer; transition: var(--transition);
  display: flex; flex-direction: column;
}
.pdv-product-card:hover {
  border-color: var(--primary); transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(22,163,74,0.15);
}
.pdv-product-card.out-of-stock { opacity: 0.5; pointer-events: none; }
.pdv-product-card .pdv-img {
  height: 110px; overflow: hidden; background: var(--bg-tertiary);
  display: flex; align-items: center; justify-content: center; position: relative;
}
.pdv-product-card .pdv-img img { width: 100%; height: 100%; object-fit: cover; }
.pdv-product-card .pdv-img i { font-size: 28px; color: var(--text-muted); }
.pdv-product-card .pdv-img .out-badge {
  position: absolute; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 12px; font-weight: 700;
}
.pdv-product-card .pdv-body { padding: 10px 12px; flex: 1; }
.pdv-product-card .pdv-body .pdv-name { font-size: 13px; font-weight: 600; line-height: 1.3; margin-bottom: 4px; }
.pdv-product-card .pdv-body .pdv-price { font-size: 16px; font-weight: 800; color: var(--primary); }
.pdv-product-card .pdv-body .pdv-stock { font-size: 11px; color: var(--text-muted); }

/* CART */
.pdv-cart {
  width: 360px; flex-shrink: 0;
  background: var(--bg-primary); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden;
}

.cart-header {
  padding: 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.cart-header h3 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.cart-header h3 i { color: var(--primary); }
.cart-count { font-size: 13px; color: var(--text-muted); background: var(--bg-secondary); padding: 3px 10px; border-radius: 20px; }

.cart-customer {
  padding: 12px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.cart-customer label { font-size: 12px; font-weight: 600; color: var(--text-muted); display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.cart-customer select {
  width: 100%; padding: 8px 10px;
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 13px; color: var(--text-primary);
}

.cart-items {
  flex: 1; overflow-y: auto; padding: 8px;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.cart-items::-webkit-scrollbar { width: 4px; }
.cart-items::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.cart-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; color: var(--text-muted); gap: 12px; padding: 32px;
  text-align: center;
}
.cart-empty i { color: var(--border); }
.cart-empty p { font-size: 15px; font-weight: 500; }
.cart-empty small { font-size: 13px; }

.cart-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: var(--radius);
  background: var(--bg-secondary); margin-bottom: 6px;
  border: 1px solid var(--border);
  transition: var(--transition);
}
.cart-item:hover { border-color: var(--primary); }
.cart-item-img {
  width: 40px; height: 40px; border-radius: 8px; overflow: hidden;
  background: var(--bg-tertiary); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.cart-item-img img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-img i { font-size: 16px; color: var(--text-muted); }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-info .name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item-info .price { font-size: 13px; color: var(--primary); font-weight: 700; }
.cart-item-qty {
  display: flex; align-items: center; gap: 6px;
}
.qty-btn {
  width: 26px; height: 26px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--bg-primary);
  color: var(--text-secondary); font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: var(--transition);
}
.qty-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }
.qty-input {
  width: 36px; text-align: center;
  border: 1px solid var(--border); border-radius: 6px;
  padding: 4px; font-size: 13px; font-weight: 700;
  background: var(--bg-primary); color: var(--text-primary);
}
.cart-item-remove {
  background: none; color: var(--text-muted); font-size: 14px;
  padding: 4px; border-radius: 4px; transition: var(--transition);
}
.cart-item-remove:hover { color: var(--danger); background: var(--danger-light); }

/* Cart Totals */
.cart-totals {
  padding: 16px; border-top: 1px solid var(--border); flex-shrink: 0;
}
.total-row {
  display: flex; justify-content: space-between;
  font-size: 14px; padding: 4px 0;
}
.total-row.total-final {
  font-size: 20px; font-weight: 800;
  color: var(--primary); padding-top: 12px;
  border-top: 2px solid var(--border); margin-top: 8px;
}
.discount-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0;
}
.discount-row > span { font-size: 14px; color: var(--text-secondary); }
.discount-inputs { display: flex; gap: 6px; align-items: center; }
.discount-inputs select, .discount-inputs input {
  padding: 5px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; background: var(--bg-secondary); color: var(--text-primary);
}
.discount-inputs input { width: 70px; }

/* Payment */
.cart-payment { padding: 12px 16px; border-top: 1px solid var(--border); flex-shrink: 0; }
.cart-payment > label { font-size: 12px; font-weight: 600; color: var(--text-muted); display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.payment-methods { display: flex; gap: 8px; margin-bottom: 12px; }
.pay-btn {
  flex: 1; padding: 10px 8px; border-radius: var(--radius);
  border: 2px solid var(--border); background: var(--bg-secondary);
  color: var(--text-secondary); font-size: 12px; font-weight: 600;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  transition: var(--transition); cursor: pointer;
}
.pay-btn i { font-size: 18px; }
.pay-btn.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.pay-btn:hover { border-color: var(--primary); }

.cash-section { font-size: 13px; }
.cash-section label { font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; display: block; }
.cash-section input {
  width: 100%; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; background: var(--bg-secondary); color: var(--text-primary);
  margin-bottom: 8px;
}
.change-display {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--success-light); padding: 8px 12px; border-radius: var(--radius-sm);
}
.change-val { font-size: 16px; font-weight: 700; color: var(--success); }

.btn-finalize {
  width: 100%; padding: 16px; margin: 12px 16px 16px;
  width: calc(100% - 32px);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white; font-size: 16px; font-weight: 700;
  border-radius: var(--radius-lg); cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: var(--transition); box-shadow: 0 4px 14px rgba(22,163,74,0.35);
  flex-shrink: 0;
}
.btn-finalize:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(22,163,74,0.45); }
.btn-finalize:disabled { opacity: 0.5; pointer-events: none; }

/* ═══════════════════════════════════════════════
   STOCK
═══════════════════════════════════════════════ */
.stock-summary {
  display: flex; gap: 16px; margin-bottom: 20px;
}
.stock-kpi {
  flex: 1; background: var(--bg-primary); border-radius: var(--radius-lg);
  padding: 20px 24px; display: flex; align-items: center; gap: 16px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
}
.stock-kpi i { font-size: 22px; }
.stock-kpi.ok i { color: var(--success); }
.stock-kpi.low i { color: var(--warning); }
.stock-kpi.out i { color: var(--danger); }
.stock-kpi span { display: block; font-size: 28px; font-weight: 800; }
.stock-kpi small { font-size: 12px; color: var(--text-muted); font-weight: 500; }

.section-divider { margin: 28px 0 16px; }
.section-divider h3 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }

/* ═══════════════════════════════════════════════
   DATA TABLE
═══════════════════════════════════════════════ */
.table-responsive { overflow-x: auto; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }

.data-table {
  width: 100%; border-collapse: collapse;
  background: var(--bg-primary);
}
.data-table thead th {
  padding: 14px 16px; text-align: left;
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text-muted);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table tbody td {
  padding: 14px 16px; font-size: 14px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.data-table tbody tr:hover { background: var(--bg-secondary); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table .loading-state { text-align: center; padding: 32px; color: var(--text-muted); }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
}
.badge-success { background: var(--success-light); color: #059669; }
.badge-warning { background: var(--warning-light); color: #d97706; }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-secondary { background: var(--bg-tertiary); color: var(--text-secondary); }

.payment-icon { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.payment-icon i { width: 14px; }

/* ═══════════════════════════════════════════════
   CUSTOMERS
═══════════════════════════════════════════════ */
.customers-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px;
}

.customer-card {
  background: var(--bg-primary); border-radius: var(--radius-lg);
  border: 1px solid var(--border); padding: 20px;
  box-shadow: var(--shadow-sm); transition: var(--transition);
}
.customer-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--primary); }
.customer-card-header { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.customer-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white; font-weight: 700; font-size: 18px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.customer-info { flex: 1; }
.customer-info h3 { font-size: 16px; font-weight: 700; margin-bottom: 2px; }
.customer-info p { font-size: 13px; color: var(--text-muted); }
.customer-stats { display: flex; gap: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.customer-stat { flex: 1; text-align: center; }
.customer-stat span { display: block; font-size: 16px; font-weight: 700; color: var(--primary); }
.customer-stat small { font-size: 11px; color: var(--text-muted); }
.customer-card-footer { display: flex; gap: 8px; margin-top: 12px; }
.customer-card-footer .btn { flex: 1; justify-content: center; }

/* ═══════════════════════════════════════════════
   REPORTS
═══════════════════════════════════════════════ */
.report-kpis {
  display: flex; gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}
.rep-kpi {
  flex: 1; min-width: 160px;
  background: var(--bg-primary); border-radius: var(--radius-lg);
  padding: 20px 24px; display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
}
.rep-kpi i { font-size: 22px; color: var(--primary); width: 24px; }
.rep-kpi span { display: block; font-size: 22px; font-weight: 800; color: var(--text-primary); }
.rep-kpi small { font-size: 12px; color: var(--text-muted); }

/* ═══════════════════════════════════════════════
   MODALS
═══════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  animation: overlayIn 0.15s ease;
}

@keyframes overlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: var(--bg-primary); border-radius: var(--radius-xl);
  width: 100%; max-width: 500px;
  box-shadow: var(--shadow-lg);
  max-height: 90vh; display: flex; flex-direction: column;
  animation: modalIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal.large { max-width: 720px; }
.modal.receipt-modal { max-width: 420px; }

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to { opacity: 1; transform: none; }
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 24px 0; flex-shrink: 0;
}
.modal-header h3 { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.modal-header h3 i { color: var(--primary); }
.modal-close {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-secondary); color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; transition: var(--transition);
}
.modal-close:hover { background: var(--danger-light); color: var(--danger); }

.modal-body {
  padding: 24px; overflow-y: auto; flex: 1;
  scrollbar-width: thin;
}

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

/* ── FORMS ── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 14px;
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 14px; color: var(--text-primary);
  transition: var(--transition);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22,163,74,0.1);
  background: var(--bg-primary);
}
.form-group textarea { resize: vertical; }

.form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.form-grid .span-2 { grid-column: 1 / -1; }

.margin-preview {
  display: inline-block; padding: 4px 12px;
  border-radius: 20px; font-size: 12px; font-weight: 600;
  background: var(--success-light); color: var(--success);
}

/* Image Upload */
.image-upload-area {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 24px; text-align: center; cursor: pointer;
  transition: var(--transition); background: var(--bg-secondary);
  min-height: 120px; display: flex; align-items: center; justify-content: center;
}
.image-upload-area:hover { border-color: var(--primary); background: var(--bg-hover); }
#image-upload-placeholder { color: var(--text-muted); }
#image-upload-placeholder i { color: var(--primary); margin-bottom: 8px; }
#image-upload-placeholder p { font-size: 13px; font-weight: 500; }

/* Icon Picker */
.icon-picker { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.icon-picker input { flex: 1; }
.icon-preview {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0;
}
.icon-suggestions { display: flex; gap: 8px; flex-wrap: wrap; }
.icon-suggestions span {
  width: 36px; height: 36px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; color: var(--text-secondary); transition: var(--transition);
  background: var(--bg-secondary);
}
.icon-suggestions span:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

/* Color Picker */
.color-picker-row { display: flex; align-items: center; gap: 12px; }
.color-picker-row input[type="color"] { width: 48px; height: 40px; border-radius: var(--radius-sm); border: 1px solid var(--border); cursor: pointer; padding: 2px; }
.color-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 28px; height: 28px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: var(--transition); }
.swatch:hover { transform: scale(1.2); border-color: var(--text-primary); }

/* Radio Group */
.radio-group { display: flex; gap: 16px; flex-wrap: wrap; }
.radio-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.radio-label input { accent-color: var(--primary); }

/* RECEIPT */
.receipt-content {
  font-family: 'Courier New', monospace;
  background: #fff; color: #000;
  padding: 20px; border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: 13px; line-height: 1.8;
}
[data-theme="dark"] .receipt-content { background: #fff; color: #000; }
.receipt-title { text-align: center; font-weight: bold; font-size: 16px; margin-bottom: 4px; }
.receipt-divider { border-top: 1px dashed #999; margin: 8px 0; }
.receipt-row { display: flex; justify-content: space-between; }
.receipt-total { font-weight: bold; font-size: 15px; }

/* ═══════════════════════════════════════════════
   TOAST NOTIFICATIONS
═══════════════════════════════════════════════ */
.toast-container {
  position: fixed; bottom: 20px; right: 20px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 500;
  min-width: 280px; max-width: 380px;
  animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-left: 4px solid transparent;
}
.toast.success { background: #fff; border-left-color: var(--success); color: var(--text-primary); }
.toast.error { background: #fff; border-left-color: var(--danger); color: var(--text-primary); }
.toast.warning { background: #fff; border-left-color: var(--warning); color: var(--text-primary); }
.toast.info { background: #fff; border-left-color: var(--accent); color: var(--text-primary); }
[data-theme="dark"] .toast { background: var(--bg-secondary); }
.toast i { font-size: 18px; }
.toast.success i { color: var(--success); }
.toast.error i { color: var(--danger); }
.toast.warning i { color: var(--warning); }
.toast.info i { color: var(--accent); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: none; }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateX(100%); height: 0; padding: 0; margin: 0; }
}

/* ═══════════════════════════════════════════════
   LOADING & EMPTY STATES
═══════════════════════════════════════════════ */
.loading-state {
  text-align: center; padding: 48px 20px;
  color: var(--text-muted); font-size: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.loading-state i { font-size: 24px; color: var(--primary); }

.empty-state {
  text-align: center; padding: 64px 20px;
  color: var(--text-muted);
  background: var(--bg-primary); border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
.empty-state i { font-size: 48px; color: var(--border); margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: 14px; margin-bottom: 20px; }

/* ═══════════════════════════════════════════════
   SCROLLBAR GLOBAL
═══════════════════════════════════════════════ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

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

@media (max-width: 1024px) {
  :root { --sidebar-width: 0px; }
  .sidebar {
    width: 260px; transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: flex; }
  .sidebar-overlay { display: block; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 99; }
  .menu-toggle { display: flex; }
  .main-content { margin-left: 0; }

  .pdv-layout { flex-direction: column; height: auto; }
  .pdv-cart { width: 100%; }
  .pdv-products { height: 400px; }

  .search-global input { width: 180px; }
  .search-global input:focus { width: 220px; }
}

@media (max-width: 768px) {
  .view-container { padding: 16px; }
  .topbar { padding: 0 16px; }

  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .kpi-value { font-size: 20px; }

  .charts-row { flex-direction: column; }
  .chart-main, .chart-side { flex: none; }

  .report-kpis { flex-direction: column; }

  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: 1; }

  .products-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .customers-grid { grid-template-columns: 1fr; }
  .categories-grid { grid-template-columns: 1fr; }

  .stock-summary { flex-direction: column; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .view-toggle { align-self: flex-start; }

  .user-name { display: none; }
  .search-global { display: none; }

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

  .bottom-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .view-header { flex-direction: column; align-items: flex-start; }
  .header-actions { flex-wrap: wrap; }
  .payment-methods { gap: 6px; }
  .pay-btn { font-size: 11px; padding: 8px 4px; }
}

/* ═══════════════════════════════════════════════
   PRINT STYLES
═══════════════════════════════════════════════ */
@media print {
  .sidebar, .topbar, .header-actions, .modal-header, .modal-footer { display: none !important; }
  .modal-overlay { position: static; background: none; padding: 0; }
  .modal { box-shadow: none; max-height: none; }
  .receipt-content { border: none; }
}
