/* ============================
   MELISSA BUSINESS — STYLE.CSS
   ============================ */

:root {
  --primary: #1a237e;
  --primary-light: #283593;
  --primary-dark: #0d1757;
  --gold: #ffd700;
  --gold-dark: #f0c000;
  --accent: #3949ab;
  --white: #ffffff;
  --bg: #f0f2f8;
  --bg2: #e8ecf4;
  --card: #ffffff;
  --border: #dde3f0;
  --text: #1a1f36;
  --text-light: #6b7280;
  --text-muted: #9ca3af;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --purple: #8b5cf6;
  --sidebar-w: 260px;
  --header-h: 64px;
  --radius: 12px;
  --shadow: 0 2px 16px rgba(26,35,126,0.10);
  --shadow-hover: 0 8px 32px rgba(26,35,126,0.18);
  --transition: 0.25s cubic-bezier(.4,0,.2,1);
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

/* ===========================
   SCROLLBAR
   =========================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: 4px; }

/* ===========================
   LOGIN PAGE
   =========================== */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 45%, var(--accent) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
}

.login-page::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -15%;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: rgba(255,215,0,0.06);
}

.login-container {
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 1;
  animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
  from { opacity:0; transform:translateY(30px); }
  to { opacity:1; transform:translateY(0); }
}

.login-brand {
  text-align: center;
  margin-bottom: 24px;
}

.login-logo {
  width: 80px; height: 80px;
  background: var(--gold);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 8px 32px rgba(255,215,0,0.35);
}

.login-logo i { font-size: 36px; color: var(--primary-dark); }

.login-brand h1 {
  color: white;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 1px;
}

.login-brand p {
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  margin-top: 4px;
}

.login-card {
  background: white;
  border-radius: 20px;
  padding: 36px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.25);
}

.login-card h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--primary);
}

.login-card h2 i { margin-right: 8px; }

.alert-error {
  background: #fee2e2;
  color: #dc2626;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 13px;
  border-left: 4px solid #dc2626;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group label i { margin-right: 6px; color: var(--primary); }

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: #fafbff;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,35,126,0.1);
  background: white;
}

.input-pass {
  position: relative;
}

.input-pass input { padding-right: 44px; }

.eye-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-light);
  padding: 4px;
}

.btn-login {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: 4px;
  letter-spacing: 0.5px;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(26,35,126,0.35);
}

.login-demo {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.login-demo p {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 10px;
  text-align: center;
}

.demo-accounts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.demo-btn {
  flex: 1;
  min-width: 80px;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.demo-btn.super { background: #fee2e2; color: #dc2626; }
.demo-btn.admin { background: #dbeafe; color: #1d4ed8; }
.demo-btn.vendeur { background: #d1fae5; color: #059669; }
.demo-btn:hover { transform: translateY(-1px); filter: brightness(0.95); }

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

.login-footer a { color: var(--gold); text-decoration: none; font-weight: 600; }

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

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 100%);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 1000;
  transition: width var(--transition);
  overflow: hidden;
}

.sidebar.collapsed { width: 68px; }
.sidebar.collapsed .sidebar-title,
.sidebar.collapsed .user-info,
.sidebar.collapsed .nav-link span,
.sidebar.collapsed .btn-logout span { display: none; }
.sidebar.collapsed .sidebar-user { justify-content: center; }
.sidebar.collapsed .user-avatar { margin-right: 0; }
.sidebar.collapsed .sidebar-header { justify-content: center; padding: 16px 12px; }

.sidebar-header {
  display: flex;
  align-items: center;
  padding: 18px 20px;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  justify-content: space-between;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo i {
  font-size: 24px;
  color: var(--gold);
  min-width: 28px;
}

.sidebar-title {
  font-size: 16px;
  font-weight: 800;
  color: white;
  line-height: 1.2;
  white-space: nowrap;
}

.sidebar-title small {
  font-size: 10px;
  font-weight: 400;
  color: rgba(255,255,255,0.6);
  display: block;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: all var(--transition);
}

.sidebar-toggle:hover { background: rgba(255,255,255,0.1); color: white; }

.sidebar-user {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  background: rgba(0,0,0,0.15);
}

.user-avatar i {
  font-size: 32px;
  color: var(--gold);
  min-width: 32px;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: white;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.user-role {
  font-size: 10px;
  color: var(--gold);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.sidebar-nav ul { list-style: none; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--transition);
  border-left: 3px solid transparent;
  white-space: nowrap;
}

.nav-link i {
  font-size: 16px;
  min-width: 20px;
  text-align: center;
}

.nav-link:hover {
  color: white;
  background: rgba(255,255,255,0.1);
  border-left-color: rgba(255,215,0,0.5);
}

.nav-link.active {
  color: white;
  background: rgba(255,255,255,0.15);
  border-left-color: var(--gold);
  font-weight: 600;
}

.nav-link.active i { color: var(--gold); }

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: rgba(239,68,68,0.15);
  color: #fca5a5;
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-logout:hover {
  background: rgba(239,68,68,0.35);
  color: white;
}

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

.main-content.expanded { margin-left: 68px; }

/* TOP HEADER */
.top-header {
  height: var(--header-h);
  background: white;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.header-left { display: flex; align-items: center; gap: 16px; }

.menu-toggle {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 18px;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all var(--transition);
}

.menu-toggle:hover { background: var(--bg); color: var(--primary); }

.page-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-date {
  font-size: 12px;
  color: var(--text-light);
  display: none;
}

@media (min-width: 768px) { .header-date { display: block; } }

.notif-wrapper { position: relative; }

.notif-btn {
  background: none;
  border: none;
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 18px;
  color: var(--text-light);
  transition: all var(--transition);
  position: relative;
}

.notif-btn:hover { background: var(--bg); color: var(--primary); }

.notif-badge {
  position: absolute;
  top: 4px; right: 4px;
  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;
  border: 2px solid white;
}

.notif-panel {
  position: absolute;
  top: 50px; right: 0;
  width: 320px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  z-index: 200;
  animation: fadeInDown 0.2s ease;
}

@keyframes fadeInDown {
  from { opacity:0; transform:translateY(-10px); }
  to { opacity:1; transform:translateY(0); }
}

.notif-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 13px;
}

.clear-notif {
  font-size: 11px;
  color: var(--danger);
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 500;
}

.notif-list { max-height: 300px; overflow-y: auto; }

.notif-item {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--bg);
  align-items: flex-start;
  font-size: 12px;
}

.notif-item i {
  font-size: 14px;
  margin-top: 2px;
}

.notif-item.warning i { color: var(--warning); }
.notif-item.danger i { color: var(--danger); }
.notif-item.info i { color: var(--info); }

.notif-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--bg);
}

.header-user i { font-size: 20px; color: var(--primary); }

/* CONTENT AREA */
.content-area {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

.section { display: none; animation: fadeInUp 0.3s ease; }
.section.active { display: block; }

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-header h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

.section-header h3 i { margin-right: 10px; }

.section-date {
  font-size: 12px;
  color: var(--text-light);
  background: var(--bg);
  padding: 6px 12px;
  border-radius: 20px;
}

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

/* ===========================
   BUTTONS
   =========================== */
.btn-primary, .btn-secondary, .btn-success, .btn-warning, .btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-light); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(26,35,126,0.3); }

.btn-secondary { background: var(--bg2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); transform: translateY(-1px); }

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(16,185,129,0.3); }

.btn-warning { background: var(--warning); color: white; }
.btn-warning:hover { background: #d97706; transform: translateY(-1px); }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; transform: translateY(-1px); }

.btn-sm { padding: 5px 12px; font-size: 12px; }
.w-full { width: 100%; justify-content: center; }
.mb-2 { margin-bottom: 10px; }

/* ===========================
   STATS GRID
   =========================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  border-left: 4px solid transparent;
}

.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }

.stat-card.blue { border-left-color: var(--info); }
.stat-card.green { border-left-color: var(--success); }
.stat-card.orange { border-left-color: var(--warning); }
.stat-card.purple { border-left-color: var(--purple); }

.stat-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}

.stat-card.blue .stat-icon { background: #dbeafe; color: var(--info); }
.stat-card.green .stat-icon { background: #d1fae5; color: var(--success); }
.stat-card.orange .stat-icon { background: #fef3c7; color: var(--warning); }
.stat-card.purple .stat-icon { background: #ede9fe; color: var(--purple); }

.stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  display: block;
}

/* ===========================
   CHARTS
   =========================== */
.charts-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.chart-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.chart-card.large { /* default */ }

.chart-card-header {
  margin-bottom: 16px;
}

.chart-card-header h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
}

.chart-card-header h4 i { margin-right: 8px; color: var(--gold-dark); }

/* ===========================
   DASHBOARD BOTTOM
   =========================== */
.dashboard-bottom {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

.recent-sales-card, .alerts-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.card-header-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
}

.card-header-title i { margin-right: 8px; color: var(--gold-dark); }

.mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.mini-table th {
  padding: 8px 10px;
  text-align: left;
  background: var(--bg);
  color: var(--text-light);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
}

.mini-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--bg);
  color: var(--text);
}

.mini-table tr:hover td { background: #f8f9ff; }

.stock-alert-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 12px;
}

.stock-alert-item.danger { background: #fee2e2; color: #dc2626; }
.stock-alert-item.warning { background: #fef3c7; color: #d97706; }

.stock-alert-item .alert-name { font-weight: 600; }
.stock-alert-item .alert-qty { font-weight: 700; }

/* ===========================
   POS
   =========================== */
.pos-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
  height: calc(100vh - 180px);
  min-height: 600px;
}

.pos-products-panel {
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pos-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
}

.pos-search-bar i { color: var(--text-light); }

.pos-search-bar input {
  flex: 1;
  border: none;
  background: none;
  font-size: 14px;
  outline: none;
  color: var(--text);
}

.pos-cat-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.cat-filter-btn {
  padding: 5px 12px;
  border: 2px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  background: white;
  color: var(--text);
}

.cat-filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.cat-filter-btn:hover:not(.active) { border-color: var(--primary); color: var(--primary); }

.pos-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  overflow-y: auto;
  flex: 1;
  padding: 4px;
  align-content: start;
}

.product-card {
  background: var(--bg);
  border-radius: 10px;
  padding: 14px 10px;
  cursor: pointer;
  text-align: center;
  transition: all var(--transition);
  border: 2px solid transparent;
  position: relative;
}

.product-card:hover {
  background: #e8ecff;
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(26,35,126,0.12);
}

.product-card.out-of-stock {
  opacity: 0.5;
  cursor: not-allowed;
}

.product-card .prod-icon {
  font-size: 28px;
  margin-bottom: 8px;
  display: block;
}

.product-card .prod-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.3;
  display: block;
}

.product-card .prod-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  display: block;
}

.product-card .prod-stock {
  font-size: 10px;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

.stock-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 3px;
}

.stock-dot.green { background: var(--success); }
.stock-dot.orange { background: var(--warning); }
.stock-dot.red { background: var(--danger); }

/* CART PANEL */
.pos-cart-panel {
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--bg);
}

.cart-header h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
}

.btn-clear-cart {
  background: #fee2e2;
  color: var(--danger);
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 13px;
  transition: all var(--transition);
}

.btn-clear-cart:hover { background: var(--danger); color: white; }

.cart-items {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 12px;
}

.cart-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 20px;
  font-size: 13px;
  line-height: 2;
}

.cart-empty i { font-size: 40px; opacity: 0.3; }

.cart-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--bg);
  animation: fadeInUp 0.2s ease;
}

.cart-item-info { flex: 1; min-width: 0; }

.cart-item-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-price {
  font-size: 11px;
  color: var(--text-light);
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 5px;
}

.qty-btn {
  width: 24px; height: 24px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 5px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
  transition: all var(--transition);
}

.qty-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }

.qty-val {
  width: 30px;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
}

.cart-item-total {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  min-width: 60px;
  text-align: right;
}

.cart-item-remove {
  background: none;
  border: none;
  color: #fca5a5;
  cursor: pointer;
  padding: 4px;
  font-size: 13px;
  transition: color var(--transition);
}

.cart-item-remove:hover { color: var(--danger); }

.cart-totals {
  border-top: 2px solid var(--bg);
  padding-top: 10px;
  margin-bottom: 12px;
}

.total-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 13px;
  color: var(--text-light);
}

.total-final {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary);
  padding-top: 8px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.payment-modes {
  margin-bottom: 10px;
}

.payment-modes label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  display: block;
  margin-bottom: 8px;
}

.pay-btns { display: flex; gap: 8px; }

.pay-btn {
  flex: 1;
  padding: 9px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.pay-btn.active {
  border-color: var(--primary);
  background: #e8ecff;
  color: var(--primary);
}

.pay-btn:hover:not(.active) { border-color: var(--primary); }

.cash-given-row {
  margin-bottom: 10px;
}

.cash-given-row label {
  font-size: 12px;
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

.cash-given-row input {
  width: 100%;
  padding: 9px 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}

.cash-given-row input:focus { border-color: var(--primary); }

.change-display {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--success);
}

.btn-validate {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--success), #059669);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-validate:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(16,185,129,0.3);
}

/* ===========================
   TABLES
   =========================== */
.table-container {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table thead tr {
  background: var(--primary);
  color: white;
}

.data-table th {
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--bg);
  color: var(--text);
  vertical-align: middle;
}

.data-table tbody tr:hover td { background: #f8f9ff; }
.data-table tbody tr:last-child td { border-bottom: none; }

/* STOCK 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: #d1fae5; color: #059669; }
.badge-warning { background: #fef3c7; color: #d97706; }
.badge-danger { background: #fee2e2; color: #dc2626; }
.badge-info { background: #dbeafe; color: #1d4ed8; }
.badge-purple { background: #ede9fe; color: #7c3aed; }
.badge-gray { background: var(--bg2); color: var(--text-light); }

/* FILTERS */
.filters-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.filters-bar input,
.filters-bar select {
  padding: 9px 14px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  background: white;
  transition: border-color var(--transition);
}

.filters-bar input { flex: 1; min-width: 150px; }
.filters-bar input:focus,
.filters-bar select:focus { border-color: var(--primary); }

/* PAGINATION */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.page-btn {
  width: 36px; height: 36px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition);
  display: flex; align-items: center; justify-content: center;
}

.page-btn.active { background: var(--primary); border-color: var(--primary); color: white; }
.page-btn:hover:not(.active) { border-color: var(--primary); color: var(--primary); }

/* ===========================
   ARRIVALS
   =========================== */
.arrivals-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 20px;
}

.arrival-form-card {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.arrival-form-card h4, .arrivals-history h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 20px;
}

.arrival-form-card h4 i, .arrivals-history h4 i {
  margin-right: 8px;
  color: var(--gold-dark);
}

.arrivals-history {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* ===========================
   INVENTORY
   =========================== */
.inventory-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.inv-sum-card {
  background: white;
  border-radius: 10px;
  padding: 16px;
  box-shadow: var(--shadow);
  text-align: center;
}

.inv-sum-card .inv-val {
  font-size: 28px;
  font-weight: 800;
  display: block;
}

.inv-sum-card .inv-label {
  font-size: 11px;
  color: var(--text-light);
  text-transform: uppercase;
  font-weight: 600;
}

.inv-sum-card.blue .inv-val { color: var(--info); }
.inv-sum-card.green .inv-val { color: var(--success); }
.inv-sum-card.orange .inv-val { color: var(--warning); }
.inv-sum-card.red .inv-val { color: var(--danger); }

.inv-real-input {
  width: 80px;
  padding: 5px 8px;
  border: 2px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  text-align: center;
  outline: none;
}

.inv-real-input:focus { border-color: var(--primary); }

.ecart-positive { color: var(--success); font-weight: 700; }
.ecart-negative { color: var(--danger); font-weight: 700; }
.ecart-zero { color: var(--text-muted); }

/* ===========================
   REPORTS
   =========================== */
.report-filters {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 24px;
  flex-wrap: wrap;
  background: white;
  padding: 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.report-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.report-stat-card {
  background: white;
  border-radius: 10px;
  padding: 18px;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--primary);
  text-align: center;
}

.report-stat-val {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
  display: block;
}

.report-stat-label {
  font-size: 11px;
  color: var(--text-light);
  text-transform: uppercase;
  font-weight: 600;
  margin-top: 4px;
  display: block;
}

.report-table-section {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.report-table-section h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
}

.report-table-section h4 i { margin-right: 8px; color: var(--gold-dark); }

/* ===========================
   USERS & LOGS
   =========================== */
.logs-section {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-top: 24px;
}

.logs-section h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
}

.logs-section h4 i { margin-right: 8px; color: var(--gold-dark); }

/* ===========================
   SETTINGS
   =========================== */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.settings-card {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.settings-card h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--bg);
}

.settings-card h4 i { margin-right: 8px; color: var(--gold-dark); }

.data-actions { display: flex; flex-direction: column; }

/* ===========================
   MODALS
   =========================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

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

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(3px);
}

.modal-box {
  background: white;
  border-radius: 16px;
  padding: 0;
  width: 100%;
  max-width: 560px;
  position: relative;
  z-index: 1;
  box-shadow: 0 24px 64px rgba(0,0,0,0.25);
  animation: slideInUp 0.3s ease;
  overflow: hidden;
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes slideInUp {
  from { opacity:0; transform:translateY(40px) scale(0.96); }
  to { opacity:1; transform:translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.modal-header h3 i { margin-right: 8px; }

.modal-close {
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  width: 32px; height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}

.modal-close:hover { background: rgba(255,255,255,0.35); }

.modal-box form {
  padding: 24px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 8px;
}

/* ===========================
   TOAST NOTIFICATIONS
   =========================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: white;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  animation: slideInRight 0.3s ease;
  pointer-events: all;
  min-width: 280px;
  max-width: 400px;
}

@keyframes slideInRight {
  from { opacity:0; transform:translateX(40px); }
  to { opacity:1; transform:translateX(0); }
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }
.toast.info { background: var(--info); }

.toast i { font-size: 16px; flex-shrink: 0; }

/* ===========================
   APP FOOTER
   =========================== */
.app-footer {
  text-align: center;
  padding: 14px 24px;
  background: white;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-light);
}

.app-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.app-footer a:hover { color: var(--gold-dark); text-decoration: underline; }

/* ===========================
   PRINT STYLES
   =========================== */
@media print {
  body > *:not(#printArea) { display: none !important; }
  #printArea { display: block !important; }

  .receipt {
    width: 80mm;
    margin: 0 auto;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #000;
  }

  .receipt-header { text-align: center; margin-bottom: 10px; border-bottom: 1px dashed #000; padding-bottom: 8px; }
  .receipt-title { font-size: 14px; font-weight: bold; }
  .receipt-sub { font-size: 10px; margin-top: 2px; }
  .receipt-line { border-top: 1px dashed #000; margin: 6px 0; }
  .receipt-items { width: 100%; border-collapse: collapse; margin-bottom: 6px; }
  .receipt-items th, .receipt-items td { text-align: left; padding: 2px 0; font-size: 10px; }
  .receipt-items td:last-child, .receipt-items th:last-child { text-align: right; }
  .receipt-total { font-weight: bold; font-size: 12px; }
  .receipt-footer { text-align: center; margin-top: 10px; font-size: 10px; border-top: 1px dashed #000; padding-top: 8px; }
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 1024px) {
  .charts-row { grid-template-columns: 1fr; }
  .dashboard-bottom { grid-template-columns: 1fr; }
  .arrivals-layout { grid-template-columns: 1fr; }
  .pos-layout { grid-template-columns: 1fr; height: auto; }
  .pos-cart-panel { min-height: 400px; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar {
    transform: translateX(-100%);
    width: 260px !important;
    transition: transform var(--transition);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .main-content { margin-left: 0 !important; }
  .content-area { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .section-header { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .charts-row { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .demo-accounts { flex-direction: column; }
}

/* Inventory input in table */
td .inv-real-input { width: 70px; }

/* Sale detail table */
.sale-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 16px 0;
}

.sale-detail-table th {
  background: var(--bg);
  padding: 8px 12px;
  text-align: left;
  font-weight: 600;
  color: var(--text-light);
  font-size: 11px;
  text-transform: uppercase;
}

.sale-detail-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--bg);
}

.sale-detail-info {
  padding: 16px 24px;
}

.sale-info-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--bg);
}

.sale-info-row .label { color: var(--text-light); font-weight: 500; }
.sale-info-row .value { font-weight: 600; color: var(--text); }

/* Action btns in table */
.action-btns { display: flex; gap: 6px; align-items: center; }
