/* ============================================================
   CMM-gs PDV System - Global Styles
   ============================================================ */

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

:root {
  --primary: #6C63FF;
  --primary-dark: #5a52d5;
  --primary-light: #8b83ff;
  --secondary: #FF6584;
  --accent: #43E97B;
  --accent2: #00B4D8;
  --bg-dark: #0F0F1A;
  --bg-card: rgba(255,255,255,0.05);
  --bg-card-hover: rgba(255,255,255,0.08);
  --glass: rgba(255,255,255,0.07);
  --glass-border: rgba(255,255,255,0.12);
  --text-primary: #F0F0FF;
  --text-secondary: #9E9EBB;
  --text-muted: #6B6B8A;
  --success: #43E97B;
  --warning: #F7C59F;
  --danger: #FF6B6B;
  --info: #00B4D8;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-lg: 0 16px 64px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 20px rgba(108,99,255,0.3);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-width: 260px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

.mobile-nav { display: none; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

body.light-mode {
  --bg-dark: #F0F2FF;
  --bg-card: rgba(255,255,255,0.95);
  --glass: rgba(255,255,255,0.8);
  --glass-border: rgba(108,99,255,0.15);
  --text-primary: #1a1a2e;
  --text-secondary: #4a4a6a;
  --text-muted: #8888aa;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }

/* ============================================================
   AUTH PAGES (login/register)
   ============================================================ */
.auth-body {
  background: linear-gradient(135deg, #0F0F1A 0%, #1a1040 50%, #0d1a35 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 20px;
  position: relative;
  overflow-y: auto;
}

.auth-body::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(108,99,255,0.15) 0%, transparent 70%);
  top: -200px; left: -200px;
  border-radius: 50%;
}
.auth-body::after {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(255,101,132,0.1) 0%, transparent 70%);
  bottom: -150px; right: -150px;
  border-radius: 50%;
}

.auth-card {
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg), 0 0 60px rgba(108,99,255,0.1);
  position: relative;
  z-index: 1;
  animation: fadeInUp 0.6s ease;
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}
.auth-logo img {
  width: 70px; height: 70px;
  border-radius: 50%;
  border: 3px solid var(--primary);
  padding: 8px;
  background: rgba(108,99,255,0.15);
  object-fit: contain;
}
.auth-logo .brand {
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-light), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
  display: block;
  margin-top: 10px;
}
.auth-logo .tagline {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.auth-tabs {
  display: flex;
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 28px;
  gap: 4px;
}
.auth-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
}
.auth-tab.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(108,99,255,0.4);
}
.auth-tab:hover:not(.active) {
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
}

.auth-form { display: none; }
.auth-form.active { display: block; animation: fadeIn 0.3s ease; }

.form-group {
  margin-bottom: 18px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.form-control {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(108,99,255,0.08);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.15);
}
.form-control::placeholder { color: var(--text-muted); }
select.form-control option { background: #1a1040; color: var(--text-primary); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  opacity: 0;
  transition: opacity 0.2s;
}
.btn:hover::after { opacity: 1; }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 4px 16px rgba(108,99,255,0.4);
}
.btn-primary:hover { box-shadow: 0 6px 24px rgba(108,99,255,0.5); transform: translateY(-1px); }

.btn-success {
  background: linear-gradient(135deg, #43E97B, #38f9d7);
  color: #000;
  box-shadow: 0 4px 16px rgba(67,233,123,0.3);
}
.btn-danger {
  background: linear-gradient(135deg, #FF6B6B, #ee0979);
  color: #fff;
  box-shadow: 0 4px 16px rgba(255,107,107,0.3);
}
.btn-warning {
  background: linear-gradient(135deg, #f7c59f, #ef703c);
  color: #fff;
}
.btn-info {
  background: linear-gradient(135deg, var(--info), #0077b6);
  color: #fff;
}
.btn-secondary {
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
}
.btn-secondary:hover { background: rgba(255,255,255,0.14); }
.btn-sm { padding: 8px 14px; font-size: 12px; }
.btn-xs { padding: 4px 8px; font-size: 10px; font-weight: 700; text-transform: uppercase; border-radius: 6px; }
.btn-lg { padding: 16px 32px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: var(--radius-sm); }

/* ============================================================
   LAYOUT - SIDEBAR
   ============================================================ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: rgba(255,255,255,0.03);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 100;
  transition: var(--transition);
  overflow: hidden;
}
.sidebar.collapsed { width: 70px; }
.sidebar.mobile-open { transform: translateX(0); width: 260px; }

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 90;
  display: none;
  animation: fadeIn 0.3s ease;
}
.sidebar-overlay.open { display: block; }

.sidebar-header {
  padding: 20px 16px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-logo {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(108,99,255,0.4);
}
.sidebar-brand {
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-light), #fff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 8px;
  overflow-y: auto;
}
.nav-section {
  margin-bottom: 24px;
}
.nav-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: 0 8px 8px;
  white-space: nowrap;
  overflow: hidden;
  transition: var(--transition);
}
.sidebar.collapsed .nav-section-title { opacity: 0; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
  white-space: nowrap;
  overflow: hidden;
  margin-bottom: 2px;
}
.nav-link i { font-size: 18px; flex-shrink: 0; width: 22px; text-align: center; }
.nav-link:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}
.nav-link.active {
  background: rgba(108,99,255,0.15);
  color: var(--primary-light);
  border-left: 3px solid var(--primary);
}
.nav-link .badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  border-radius: 10px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--glass-border);
}
.user-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--glass);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  overflow: hidden;
}
.user-mini:hover { background: var(--bg-card-hover); }
.user-avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text-muted); }

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

.topbar {
  height: 64px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
}
.topbar-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 20px;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.topbar-toggle:hover { background: var(--glass); color: var(--text-primary); }

.page-title {
  font-size: 18px;
  font-weight: 700;
  flex: 1;
}
.topbar-actions { display: flex; gap: 10px; align-items: center; }

.page-content {
  padding: 24px;
  flex: 1;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(10px);
  transition: var(--transition);
}
.card:hover { border-color: rgba(108,99,255,0.3); }
.card-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title { font-size: 15px; font-weight: 600; }
.card-body { padding: 20px; }

/* STAT CARDS */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.stat-card.purple::before { background: linear-gradient(90deg, var(--primary), var(--primary-light)); }
.stat-card.green::before  { background: linear-gradient(90deg, var(--success), #38f9d7); }
.stat-card.red::before    { background: linear-gradient(90deg, var(--danger), var(--secondary)); }
.stat-card.blue::before   { background: linear-gradient(90deg, var(--info), #48cae4); }

.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 12px;
}
.stat-icon.purple { background: rgba(108,99,255,0.15); color: var(--primary-light); }
.stat-icon.green  { background: rgba(67,233,123,0.15); color: var(--success); }
.stat-icon.red    { background: rgba(255,107,107,0.15); color: var(--danger); }
.stat-icon.blue   { background: rgba(0,180,216,0.15);  color: var(--info); }

.stat-value { font-size: 24px; font-weight: 800; margin-bottom: 4px; }
.stat-label { font-size: 13px; color: var(--text-secondary); }
.stat-change { font-size: 12px; margin-top: 4px; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-md); }
table { width: 100%; border-collapse: collapse; }
thead th {
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.03);
  text-align: left;
  border-bottom: 1px solid var(--glass-border);
}
tbody td {
  padding: 13px 16px;
  font-size: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: var(--transition);
}
tbody tr:hover td { background: var(--bg-card-hover); }
tbody tr:last-child td { border-bottom: none; }

/* STATUS BADGES */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.badge-success { background: rgba(67,233,123,0.1); color: var(--success); border: 1px solid rgba(67,233,123,0.2); }
.badge-danger  { background: rgba(255,107,107,0.1); color: var(--danger);  border: 1px solid rgba(255,107,107,0.2); }
.badge-warning { background: rgba(247,197,159,0.1); color: var(--warning); border: 1px solid rgba(247,197,159,0.2); }
.badge-info    { background: rgba(0,180,216,0.1);   color: var(--info);    border: 1px solid rgba(0,180,216,0.2); }
.badge-primary { background: rgba(108,99,255,0.1);  color: var(--primary-light); border: 1px solid rgba(108,99,255,0.2); }
.badge-muted   { background: rgba(255,255,255,0.05); color: var(--text-muted); border: 1px solid var(--glass-border); }

/* ============================================================
   PDV SPECIFIC
   ============================================================ */
.pdv-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
  height: calc(100vh - 64px - 48px);
}
.pdv-left, .pdv-right { display: flex; flex-direction: column; gap: 16px; }
.pdv-right { min-height: 0; }

.search-bar {
  display: flex;
  gap: 10px;
  align-items: center;
}
.search-input {
  flex: 1;
  padding: 14px 20px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
}
.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.15);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  overflow-y: auto;
  padding-right: 4px;
  flex: 1;
}
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.product-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}
.product-card:active { transform: scale(0.96); }
.product-card img {
  width: 60px; height: 60px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.product-card .p-icon {
  width: 60px; height: 60px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin: 0 auto 8px;
}
.product-card .p-name {
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 2px;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}
.product-card .p-barcode {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.product-card .p-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}
.product-card .p-stock {
  font-size: 10px;
  color: var(--text-muted);
}
.product-card.out-of-stock { opacity: 0.5; cursor: not-allowed; }

/* CART */
.cart-container {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.cart-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--glass-border);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.cart-items {
  height: 45vh;
  min-height: 300px;
  overflow-y: auto;
  padding: 8px;
  flex: none;
}
.cart-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: var(--transition);
}
.cart-item:hover { background: var(--bg-card-hover); }
.cart-item-icon {
  width: 36px; height: 36px;
  background: rgba(108,99,255,0.15);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item-price { font-size: 12px; color: var(--text-secondary); }
.cart-item-controls { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.qty-btn {
  width: 26px; height: 26px;
  border: none;
  border-radius: 6px;
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;align-items:center;justify-content:center;
  font-size: 14px;
  transition: var(--transition);
}
.qty-btn:hover { background: var(--primary); }
.qty-val { font-size: 13px; font-weight: 600; min-width: 24px; text-align: center; }
.cart-item-subtotal { font-size: 13px; font-weight: 700; color: var(--accent); min-width: 60px; text-align: right; }
.cart-item-remove { color: var(--danger); cursor: pointer; font-size: 16px; background: none; border: none; padding: 4px; transition: var(--transition); }
.cart-item-remove:hover { transform: scale(1.2); }

.cart-footer {
  border-top: 1px solid var(--glass-border);
  padding: 14px 16px;
  flex-shrink: 0;
}
.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}
.cart-total-row.final {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--glass-border);
}
.cart-total-value { font-weight: 700; color: var(--accent); }

/* PAYMENT MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; animation: fadeIn 0.2s ease; }
.modal {
  background: #1a1040;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.modal-title { font-size: 18px; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text-secondary); cursor: pointer; font-size: 22px; transition: var(--transition); }
.modal-close:hover { color: var(--danger); transform: rotate(90deg); }

/* PAYMENT METHODS */
.payment-methods {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.pay-method {
  padding: 14px;
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: center;
  transition: var(--transition);
  font-size: 13px;
  font-weight: 500;
  background: transparent;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
}
.pay-method i { display: block; font-size: 22px; margin-bottom: 6px; }
.pay-method:hover, .pay-method.selected {
  border-color: var(--primary);
  background: rgba(108,99,255,0.1);
  color: var(--primary-light);
}

/* PIX QR */
.pix-container {
  text-align: center;
  padding: 20px;
}
.pix-qr {
  width: 180px; height: 180px;
  background: #fff;
  border-radius: var(--radius-md);
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  box-shadow: var(--shadow-md);
}
.pix-qr img { width: 100%; height: 100%; object-fit: contain; }
.pix-copy {
  background: rgba(255,255,255,0.05);
  border: 1px dashed var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12px;
  word-break: break-all;
  color: var(--text-secondary);
  margin-bottom: 12px;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}
.pix-copy:hover { border-color: var(--primary); color: var(--text-primary); }

/* ============================================================
   RECEIPT / NOTINHA
   ============================================================ */
.receipt-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 10002;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}
.receipt-overlay.open { display: flex; }
.receipt-wrapper { background: #fff; color: #000; width: 100%; max-width: 380px; border-radius: 4px; font-family: 'Courier New', monospace; box-shadow: 0 0 20px rgba(0,0,0,0.5); }
.receipt-actions { display: flex; gap: 10px; justify-content: center; margin-top: 20px; width: 100%; max-width: 380px; }
.receipt-actions .btn { flex: 1; }

@media print {
  * { visibility: hidden !important; }
  .receipt-wrapper, .receipt-wrapper * { visibility: visible !important; }
  .receipt-wrapper { position: fixed; top: 0; left: 50%; transform: translateX(-50%) !important; }
}

/* ============================================================
   FORMS (product/client)
   ============================================================ */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

/* ============================================================
   DASHBOARD CHARTS
   ============================================================ */
.chart-container {
  position: relative;
  height: 280px;
}

/* ============================================================
   ALERTS & TOASTS
   ============================================================ */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 350px;
  width: calc(100% - 40px);
}
.toast {
  padding: 15px 20px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: #fff;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: slideIn 0.3s ease forwards;
  backdrop-filter: blur(10px);
  min-width: 250px;
}
.toast-success { border-left: 4px solid var(--success); }
.toast-error   { border-left: 4px solid var(--danger); }
.toast-info    { background: rgba(0,180,216,0.1); border-left: 4px solid var(--info); }
.toast-warning { background: rgba(247,197,159,0.1); border-left: 4px solid var(--warning); }

/* ============================================================
   LOADING
   ============================================================ */
.spinner {
  width: 24px; height: 24px;
  border: 3px solid rgba(108,99,255,0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ============================================================
   LICENSE BANNER
   ============================================================ */
.license-banner {
  background: linear-gradient(90deg, rgba(247,197,159,0.1), rgba(238,9,121,0.1));
  border: 1px solid rgba(247,197,159,0.2);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 13px;
  color: var(--warning);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .pdv-grid { grid-template-columns: 1fr; height: auto; }
  .pdv-right { order: -1; }
  .products-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); max-height: 300px; }
}

@media (max-width: 768px) {
  .sidebar { width: 70px; }
  .sidebar .sidebar-brand,
  .sidebar .nav-link span,
  .sidebar .nav-section-title,
  .sidebar .user-name,
  .sidebar .user-role { display: none; }
  .main-content { margin-left: 70px; }
  .page-content { padding: 16px; }
  .form-grid.cols-3 { grid-template-columns: 1fr; }
  .payment-methods { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  body { padding-bottom: 70px; } /* Space for bottom nav */
  .sidebar { transform: translateX(-100%); width: 260px; transition: transform 0.3s ease; }
  .sidebar.mobile-open { transform: translateX(0) !important; box-shadow: 10px 0 30px rgba(0,0,0,0.5); }
  .main-content { margin-left: 0 !important; }
  .topbar-toggle { display: flex; }
  .page-content { padding: 12px; }
  
  /* Make things BIGGER on mobile */
  body { font-size: 16px; }
  .page-title { font-size: 20px; }
  .nav-link { padding: 14px 16px; font-size: 16px; }
  .nav-link i { font-size: 20px; }
  
  /* Mobile Nav Bar */
  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 65px;
    background: #1a1040;
    border-top: 1px solid var(--glass-border);
    backdrop-filter: blur(15px);
    z-index: 1000;
    justify-content: flex-start; /* Alinha no início para o scroll funcionar */
    padding: 5px 10px;
    overflow-x: auto; /* Habilita scroll horizontal */
    white-space: nowrap; /* Impede quebra de linha */
    scrollbar-width: none; /* Esconde scrollbar no Firefox */
  }
  .mobile-nav::-webkit-scrollbar { display: none; } /* Esconde scrollbar no Chrome/Safari */

  .mobile-nav-link {
    display: inline-flex; /* Necessário para white-space: nowrap */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    gap: 4px;
    min-width: 75px; /* Tamanho fixo para garantir o scroll */
    padding: 0 5px;
  }
  .mobile-nav-link i { font-size: 20px; }
  .mobile-nav-link.active { color: var(--primary-light); }
  
  /* PDV Mobile Optimizations */
  .pdv-grid { grid-template-columns: 1fr; height: auto; gap: 10px; }
  .pdv-left { order: 2; }
  .pdv-right { order: 1; position: sticky; top: 64px; z-index: 40; }
  .cart-container { max-height: 60vh; }
  .cart-items { height: auto; max-height: 40vh; min-height: 150px; }
  .products-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .product-card { padding: 8px; }
  .product-card img, .product-card .p-icon { width: 45px; height: 45px; font-size: 16px; margin-bottom: 4px; }
  .product-card .p-name { font-size: 10px; display: -webkit-box; -webkit-line-clamp: 1; line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
  .product-card .p-barcode { font-size: 9px; margin-bottom: 2px; display: block; } /* Show barcode on mobile */
  .product-card .p-price { font-size: 11px; }
  
  .search-input { padding: 12px 18px; font-size: 15px; border-radius: 12px; }
  .btn-lg { padding: 15px 25px; font-size: 16px; border-radius: 14px; }
  .btn-sm { padding: 10px 15px; font-size: 13px; }
  
  /* Modal optimization for mobile */
  .modal { padding: 24px 16px; border-radius: 16px; }
  .modal-title { font-size: 16px; }
  
  /* Grid optimization */
  .stats-grid { gap: 10px; grid-template-columns: 1fr 1fr; }
  .dashboard-main-grid { grid-template-columns: 1fr !important; }
  
  /* Toolbar optimization */
  .topbar-actions { flex-direction: column; align-items: stretch; width: 100%; gap: 8px; }
  .topbar-actions .btn { width: 100%; justify-content: flex-start; }
  .card-header { flex-direction: column; align-items: stretch; gap: 12px; }
  
  /* Table adjustments */
  thead th, tbody td { padding: 8px 6px; font-size: 11px; }
  .badge { padding: 2px 4px; font-size: 9px; }
  
  /* Card refinements */
  .card-body { padding: 12px; }
  .stat-card { padding: 15px; }
  .stat-value { font-size: 20px; }
  
  /* Form optimization */
  .form-grid { grid-template-columns: 1fr !important; gap: 10px; }
  .search-bar { flex-direction: column; align-items: stretch; gap: 8px; }
  .search-bar form { flex-direction: column; width: 100%; }
}

/* Base style for mobile nav (hidden by default) - MOVED TO TOP */

/* UTILITY CLASSES */
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-info { color: var(--info); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }
.hr { border: none; border-top: 1px solid var(--glass-border); margin: 16px 0; }
.hidden { display: none !important; }
.w-100 { width: 100%; }

/* --- TOAST NOTIFICATIONS --- */
.toast-container {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-left: 4px solid var(--info);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  max-width: 380px;
  pointer-events: auto;
  animation: slideInLeft 0.3s ease;
}
.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }
@keyframes slideInLeft {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* --- ANA AI ASSISTANT STYLES --- */
:root {
    --ana-neon: #00ffff;
    --ana-accent: #ff00ff;
    --ana-glass: rgba(15, 10, 30, 0.9);
    --ana-border: rgba(0, 255, 255, 0.3);
}

#ana-chat-trigger {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: var(--ana-glass);
    border: 1px solid var(--ana-neon);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ana-neon);
    font-size: 24px;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#ana-chat-trigger:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 0 25px rgba(0, 255, 255, 0.6);
}

#ana-chat-window {
    position: fixed;
    bottom: 150px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: var(--ana-glass);
    border: 1px solid var(--ana-border);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    z-index: 9998;
    backdrop-filter: blur(15px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

#ana-chat-window {
    position: fixed;
    right: -450px;
    bottom: 120px; /* Mais longe do canto */
    width: 400px;
    height: 600px;
    background: rgba(2, 2, 2, 0.95);
    border: 1px solid var(--ana-neon);
    border-radius: 25px;
    z-index: 10001; /* Garante que fique acima de tudo */
    display: flex;
    flex-direction: column;
    transition: 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(25px);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.2);
    font-family: 'Rajdhani', sans-serif;
    pointer-events: none;
    opacity: 0;
}
#ana-chat-window.open {
    right: 30px;
    opacity: 1;
    pointer-events: all;
}
#ana-chat-window.open ~ #ana-chat-trigger {
    display: none; /* Esconde o botão quando aberto */
}
.ana-header {
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid rgba(0, 255, 255, 0.2);
    font-family: 'Orbitron', sans-serif;
    color: var(--ana-neon);
    font-size: 0.8rem;
    letter-spacing: 2px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    background: rgba(0, 255, 255, 0.05);
}
#ana-close {
    position: absolute;
    right: 15px;
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0.7;
    color: var(--ana-neon);
}
#ana-close:hover { opacity: 1; }

#ana-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-width: thin;
    scrollbar-color: var(--ana-border) transparent;
}

.ana-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.ana-msg.ana {
    align-self: flex-start;
    background: rgba(0, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 255, 0.2);
    color: #fff;
    border-bottom-left-radius: 2px;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.1);
}

.ana-msg.user {
    align-self: flex-end;
    background: rgba(255, 0, 255, 0.1);
    border: 1px solid rgba(255, 0, 255, 0.4);
    color: #fff;
    border-bottom-right-radius: 2px;
    box-shadow: 0 0 10px rgba(255, 0, 255, 0.1);
}

.ana-input-area {
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--ana-border);
    display: flex;
    gap: 10px;
}

#ana-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--ana-border);
    border-radius: 10px;
    padding: 8px 12px;
    color: white;
    font-size: 14px;
    outline: none;
    transition: border 0.3s;
}

#ana-input:focus {
    border-color: var(--ana-neon);
}

#ana-send, #ana-mic {
    width: 38px;
    height: 38px;
    background: var(--ana-neon);
    color: #000;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

#ana-send:hover, #ana-mic:hover {
    background: #fff;
    box-shadow: 0 0 10px var(--ana-neon);
}

#ana-mic.recording {
    background: #ff0000;
    color: #fff;
    animation: mic-pulse 1s infinite;
    box-shadow: 0 0 15px #ff0000;
}

@keyframes mic-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.ana-loading {
    display: flex;
    gap: 4px;
    padding: 10px;
}

.ana-loading span {
    width: 6px;
    height: 6px;
    background: var(--ana-neon);
    border-radius: 50%;
    animation: ana-bounce 1.4s infinite ease-in-out both;
}

.ana-loading span:nth-child(1) { animation-delay: -0.32s; }
.ana-loading span:nth-child(2) { animation-delay: -0.16s; }

@keyframes ana-bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

@media (max-width: 600px) {
    #ana-chat-window {
        width: calc(100% - 40px);
        bottom: 100px; /* Mais longe da barra inferior */
        right: 20px;
        height: 60vh;
        z-index: 10001;
    }
    #ana-chat-trigger {
        bottom: 55%;
        right: 20px;
        transform: translateY(50%);
        z-index: 10000;
    }
    #ana-chat-trigger:hover {
        transform: translateY(50%) scale(1.1);
    }
    .sidebar { display: none !important; }
    .topbar-toggle { display: none !important; }
    .sidebar-overlay { display: none !important; }
    .main-content { margin-left: 0 !important; width: 100% !important; padding-bottom: 70px; }
}

#ana-activation-overlay {
    position: absolute;
    inset: 0;
    background: rgba(2, 2, 2, 0.98);
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    border-radius: 25px;
}
.ana-glitch-wrapper { margin-bottom: 20px; }
.ana-glitch {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.2rem;
    color: var(--ana-neon);
    text-shadow: 0 0 15px var(--ana-neon);
    animation: ana-pulse 2s infinite;
}
@keyframes ana-pulse {
    0% { opacity: 0.8; }
    50% { opacity: 1; text-shadow: 0 0 25px var(--ana-neon); }
    100% { opacity: 0.8; }
}
#ana-status {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    color: var(--ana-neon);
    opacity: 0.7;
    margin-bottom: 30px;
    letter-spacing: 3px;
}
#ana-activate-btn {
    background: var(--ana-neon);
    color: #000;
    padding: 15px 30px;
    border: none;
    border-radius: 12px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 0 20px var(--ana-neon);
}
#ana-activate-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px var(--ana-neon);
}

/* NF-e Toggle and Receipt Styles */
.nf-toggle-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    border: 1px solid var(--glass-border);
}

.nf-toggle-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255,255,255,0.1);
    transition: .4s;
    border-radius: 34px;
    border: 1px solid var(--glass-border);
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 4px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary);
    border-color: var(--primary-light);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

.receipt-nf-spacer {
    height: 30px;
    width: 100%;
}



