/* ═══════════════════════════════════════════════════════════
   GESTRM — style.css
   Créé par INASTECH +212661777702
════════════════════════════════════════════════════════════ */

/* ─── CSS VARIABLES ─────────────────────────────────────── */
:root {
  --green-50:  #f0fdf4;
  --green-100: #dcfce7;
  --green-200: #bbf7d0;
  --green-400: #4ade80;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-700: #15803d;
  --green-800: #166534;
  --green-900: #14532d;

  --primary:   #16a34a;
  --primary-h: #15803d;
  --primary-light: #dcfce7;
  --accent:    #f59e0b;
  --danger:    #ef4444;
  --danger-h:  #dc2626;
  --info:      #3b82f6;
  --warning:   #f59e0b;
  --purple:    #8b5cf6;

  --bg:        #f8fafc;
  --bg2:       #ffffff;
  --bg3:       #f1f5f9;
  --border:    #e2e8f0;
  --text:      #0f172a;
  --text-2:    #475569;
  --text-3:    #94a3b8;
  --sidebar-bg:#ffffff;
  --sidebar-w: 260px;
  --sidebar-w-collapsed: 68px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow:    0 4px 16px rgba(0,0,0,.10);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.14);
  --radius:    12px;
  --radius-sm: 8px;
  --radius-lg: 18px;

  --font-body: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --transition: 0.22s cubic-bezier(.4,0,.2,1);
}

[data-theme="dark"] {
  --bg:        #0d1117;
  --bg2:       #161b22;
  --bg3:       #1c2128;
  --border:    #30363d;
  --text:      #e6edf3;
  --text-2:    #8b949e;
  --text-3:    #6e7681;
  --sidebar-bg:#161b22;
  --primary-light: #1a3a2a;
  --shadow:    0 4px 16px rgba(0,0,0,.4);
}

/* ─── RESET & BASE ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}
a { text-decoration: none; color: inherit; cursor: pointer; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: var(--text);
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.9rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22,163,74,.15);
}
.hidden { display: none !important; }

/* ─── SCROLLBAR ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ══════════════════════════════════════════════════════════
   LOGIN
═════════════════════════════════════════════════════════════ */
.login-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--green-800) 0%, var(--green-600) 50%, var(--green-400) 100%);
  z-index: 1000;
}
.login-bg-pattern {
  position: absolute; inset: 0; opacity: 0.07;
  background-image: repeating-linear-gradient(45deg, white 0, white 1px, transparent 0, transparent 50%);
  background-size: 24px 24px;
}
.login-card {
  background: var(--bg2);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2.2rem;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg);
  position: relative; z-index: 1;
  animation: slideUp .4s ease;
}
@keyframes slideUp { from { transform:translateY(20px); opacity:0; } to { transform:none; opacity:1; } }
.login-logo { text-align: center; margin-bottom: 2rem; }
.logo-icon {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--green-600), var(--green-400));
  border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.8rem; color: white; margin-bottom: .8rem;
  box-shadow: 0 4px 20px rgba(22,163,74,.4);
}
.login-logo h1 { font-size: 2rem; font-weight: 800; color: var(--primary); letter-spacing: 3px; }
.login-logo p { color: var(--text-2); font-size: .9rem; margin-top: .2rem; }
.login-form .form-group { margin-bottom: 1.2rem; }
.login-form label { display: block; font-size: .85rem; font-weight: 600; color: var(--text-2); margin-bottom: .4rem; }
.login-form label i { margin-right: .4rem; color: var(--primary); }
.login-form input { width: 100%; }
.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 2.8rem; }
.toggle-pass {
  position: absolute; right: .7rem; top: 50%; transform: translateY(-50%);
  color: var(--text-3); font-size: .9rem; padding: .2rem;
}
.toggle-pass:hover { color: var(--primary); }
.login-error {
  background: #fef2f2; border: 1px solid #fecaca;
  color: #dc2626; padding: .6rem .9rem; border-radius: var(--radius-sm);
  font-size: .85rem; margin-bottom: 1rem;
}
.btn-login {
  width: 100%; padding: .8rem; background: linear-gradient(135deg, var(--green-600), var(--green-500));
  color: white; border-radius: var(--radius-sm); font-size: 1rem; font-weight: 700;
  letter-spacing: .5px; transition: all var(--transition);
  box-shadow: 0 4px 14px rgba(22,163,74,.35);
}
.btn-login:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(22,163,74,.45); }
.btn-login:active { transform: translateY(0); }
.login-footer { text-align: center; font-size: .75rem; color: var(--text-3); margin-top: 1.5rem; }

/* ══════════════════════════════════════════════════════════
   APP SHELL
═════════════════════════════════════════════════════════════ */
.app-shell { display: flex; height: 100vh; overflow: hidden; }

/* ─── SIDEBAR ──────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1.5px solid var(--border);
  display: flex; flex-direction: column;
  transition: width var(--transition);
  overflow: hidden; flex-shrink: 0;
  z-index: 100;
}
.sidebar.collapsed { width: var(--sidebar-w-collapsed); }
.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.2rem 1rem; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.brand { display: flex; align-items: center; gap: .7rem; overflow: hidden; }
.brand-icon {
  width: 36px; height: 36px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--green-600), var(--green-400));
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  color: white; font-size: 1.1rem;
}
.brand-name { font-size: 1.2rem; font-weight: 800; color: var(--primary); letter-spacing: 2px; white-space: nowrap; }
.sidebar-toggle {
  color: var(--text-2); padding: .4rem; border-radius: 6px;
  transition: all var(--transition); flex-shrink: 0;
}
.sidebar-toggle:hover { background: var(--bg3); color: var(--primary); }

.sidebar-user {
  padding: 1rem; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.sidebar-user-inner { display: flex; align-items: center; gap: .7rem; overflow: hidden; }
.sidebar-user .avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--green-400));
  display: flex; align-items: center; justify-content: center; color: white; font-weight: 700;
}
.sidebar-user .user-info { overflow: hidden; }
.sidebar-user .user-name { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .user-role { font-size: .75rem; color: var(--text-3); white-space: nowrap; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: .5rem 0; }
.nav-section { margin-bottom: .3rem; }
.nav-label {
  display: block; padding: .5rem 1rem .3rem;
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-3); white-space: nowrap; overflow: hidden;
}
.nav-item {
  display: flex; align-items: center; gap: .8rem;
  padding: .6rem 1rem; margin: .1rem .5rem;
  border-radius: var(--radius-sm); cursor: pointer;
  transition: all var(--transition); color: var(--text-2); font-size: .9rem;
  white-space: nowrap; overflow: hidden;
}
.nav-item i { font-size: 1rem; flex-shrink: 0; width: 20px; text-align: center; }
.nav-item span { overflow: hidden; text-overflow: ellipsis; }
.nav-item:hover { background: var(--primary-light); color: var(--primary); }
.nav-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.sidebar.collapsed .nav-label,
.sidebar.collapsed .brand-name,
.sidebar.collapsed .user-info,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .sidebar-bottom span { display: none; }
.sidebar.collapsed .sidebar-user-inner { justify-content: center; }

.sidebar-bottom { border-top: 1px solid var(--border); padding: .7rem .5rem; flex-shrink: 0; }
.theme-toggle, .btn-logout {
  display: flex; align-items: center; gap: .8rem;
  padding: .6rem 1rem; border-radius: var(--radius-sm);
  width: 100%; color: var(--text-2); font-size: .9rem;
  transition: all var(--transition); white-space: nowrap;
}
.theme-toggle:hover { background: var(--bg3); color: var(--primary); }
.btn-logout:hover { background: #fef2f2; color: var(--danger); }
.btn-logout i { color: var(--danger); }

/* ─── MAIN CONTENT ─────────────────────────────────────── */
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* ─── TOPBAR ───────────────────────────────────────────── */
.topbar {
  height: 62px; background: var(--bg2);
  border-bottom: 1.5px solid var(--border);
  display: flex; align-items: center;
  justify-content: space-between; padding: 0 1.5rem;
  flex-shrink: 0; gap: 1rem;
  box-shadow: var(--shadow-sm);
}
.topbar-left { display: flex; align-items: center; gap: 1rem; }
.mob-menu-btn { display: none; color: var(--text-2); padding: .4rem; font-size: 1.2rem; }
.page-title { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.topbar-right { display: flex; align-items: center; gap: .8rem; }

.search-global { position: relative; }
.search-global i { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: .85rem; }
.search-global input { padding-left: 2.2rem; width: 220px; background: var(--bg3); border-color: transparent; border-radius: 20px; font-size: .85rem; }
.search-global input:focus { background: var(--bg2); border-color: var(--primary); width: 260px; }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--bg2); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  max-height: 300px; overflow-y: auto; z-index: 200;
}
.search-result-item { padding: .7rem 1rem; cursor: pointer; border-bottom: 1px solid var(--border); transition: background var(--transition); }
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg3); }
.search-result-item .sr-label { font-weight: 600; font-size: .85rem; }
.search-result-item .sr-sub { font-size: .75rem; color: var(--text-3); margin-top: .15rem; }

.notif-btn { position: relative; color: var(--text-2); padding: .5rem; font-size: 1.1rem; border-radius: 8px; transition: all var(--transition); }
.notif-btn:hover { background: var(--bg3); color: var(--primary); }
.notif-badge {
  position: absolute; top: 2px; right: 2px;
  background: var(--danger); color: white;
  font-size: .6rem; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px; line-height: 1;
}
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--green-400));
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; cursor: pointer;
  font-size: .95rem; flex-shrink: 0;
}

/* NOTIFICATIONS PANEL */
.notif-panel {
  position: absolute; top: 62px; right: 1.5rem; z-index: 300;
  background: var(--bg2); border: 1.5px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  width: 320px; max-height: 400px; overflow: hidden;
  display: flex; flex-direction: column;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:none; } }
.notif-header { display: flex; align-items: center; justify-content: space-between; padding: .8rem 1rem; border-bottom: 1px solid var(--border); font-weight: 600; }
.notif-header button { font-size: .78rem; color: var(--text-3); }
.notif-header button:hover { color: var(--danger); }
.notif-list { overflow-y: auto; flex: 1; }
.notif-item { padding: .7rem 1rem; border-bottom: 1px solid var(--border); cursor: pointer; transition: background var(--transition); }
.notif-item:hover { background: var(--bg3); }
.notif-item .notif-msg { font-size: .85rem; }
.notif-item .notif-time { font-size: .72rem; color: var(--text-3); margin-top: .2rem; }
.notif-item.danger .notif-msg { color: var(--danger); }
.notif-item.warning .notif-msg { color: var(--warning); }

/* ─── PAGE CONTAINER ───────────────────────────────────── */
.page-container { flex: 1; overflow-y: auto; padding: 1.5rem; position: relative; }
.page { display: none; }
.page.active { display: block; animation: fadeIn .25s ease; }

/* ─── PAGE ACTIONS BAR ─────────────────────────────────── */
.page-actions {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .8rem; margin-bottom: 1.2rem;
}
.filter-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; flex: 1; }
.action-btns { display: flex; gap: .6rem; flex-wrap: wrap; }
.search-input { min-width: 200px; flex: 1; max-width: 320px; }
.select-filter { padding: .55rem .75rem; }

/* ─── BUTTONS ──────────────────────────────────────────── */
.btn-primary {
  background: linear-gradient(135deg, var(--green-600), var(--green-500));
  color: white; padding: .55rem 1.1rem;
  border-radius: var(--radius-sm); font-weight: 600; font-size: .88rem;
  display: inline-flex; align-items: center; gap: .45rem;
  transition: all var(--transition); box-shadow: 0 2px 8px rgba(22,163,74,.25);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--green-700), var(--green-600)); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(22,163,74,.35); }
.btn-secondary {
  background: var(--bg3); color: var(--text-2);
  padding: .55rem 1.1rem; border-radius: var(--radius-sm); font-weight: 600; font-size: .88rem;
  display: inline-flex; align-items: center; gap: .45rem;
  border: 1.5px solid var(--border); transition: all var(--transition);
}
.btn-secondary:hover { background: var(--border); color: var(--text); }
.btn-danger {
  background: var(--danger); color: white;
  padding: .55rem 1.1rem; border-radius: var(--radius-sm); font-weight: 600; font-size: .88rem;
  display: inline-flex; align-items: center; gap: .45rem;
  transition: all var(--transition); box-shadow: 0 2px 8px rgba(239,68,68,.2);
}
.btn-danger:hover { background: var(--danger-h); transform: translateY(-1px); }
.btn-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all var(--transition); font-size: .9rem; color: var(--text-2);
}
.btn-icon:hover { background: var(--bg3); color: var(--primary); }
.btn-icon.edit:hover { color: var(--info); }
.btn-icon.delete:hover { color: var(--danger); }

/* ─── TABLE ────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); background: var(--bg2); box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.data-table { width: 100%; border-collapse: collapse; min-width: 600px; }
.data-table th {
  background: var(--bg3); padding: .75rem 1rem;
  font-size: .78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--text-2); border-bottom: 1.5px solid var(--border);
  white-space: nowrap;
}
.data-table td { padding: .75rem 1rem; border-bottom: 1px solid var(--border); font-size: .88rem; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg3); }
.data-table .actions { display: flex; gap: .3rem; align-items: center; }

/* Badges */
.badge {
  padding: .25rem .65rem; border-radius: 20px;
  font-size: .72rem; font-weight: 700; white-space: nowrap;
  display: inline-flex; align-items: center; gap: .3rem;
}
.badge-green  { background: var(--green-100); color: var(--green-700); }
.badge-red    { background: #fef2f2; color: #dc2626; }
.badge-yellow { background: #fffbeb; color: #92400e; }
.badge-blue   { background: #eff6ff; color: #1d4ed8; }
.badge-gray   { background: var(--bg3); color: var(--text-2); }
.badge-purple { background: #f5f3ff; color: #6d28d9; }

/* Product thumbnail */
.prod-thumb {
  width: 36px; height: 36px; border-radius: 8px;
  object-fit: cover; background: var(--bg3);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); font-size: .8rem;
}

/* ─── PAGINATION ───────────────────────────────────────── */
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: .4rem; margin-top: 1rem; flex-wrap: wrap; }
.page-btn {
  min-width: 32px; height: 32px; border-radius: 8px;
  background: var(--bg2); border: 1.5px solid var(--border);
  color: var(--text-2); font-size: .82rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition); cursor: pointer; padding: 0 .5rem;
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: white; }
.page-btn:disabled { opacity: .4; cursor: default; }

/* ══════════════════════════════════════════════════════════
   DASHBOARD
═════════════════════════════════════════════════════════════ */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card {
  background: var(--bg2); border-radius: var(--radius); padding: 1.2rem;
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 1rem;
  transition: all var(--transition); cursor: default;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; flex-shrink: 0;
}
.stat-icon.green  { background: var(--green-100); color: var(--green-600); }
.stat-icon.blue   { background: #eff6ff; color: #2563eb; }
.stat-icon.orange { background: #fff7ed; color: #ea580c; }
.stat-icon.red    { background: #fef2f2; color: #dc2626; }
.stat-icon.purple { background: #f5f3ff; color: #7c3aed; }
.stat-icon.teal   { background: #f0fdfa; color: #0d9488; }
.stat-body {}
.stat-value { font-size: 1.55rem; font-weight: 800; color: var(--text); line-height: 1; }
.stat-label { font-size: .8rem; color: var(--text-2); margin-top: .25rem; }
.stat-change { font-size: .72rem; font-weight: 600; margin-top: .2rem; }
.stat-change.up { color: var(--green-600); }
.stat-change.down { color: var(--danger); }

.charts-row { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
.chart-card {
  background: var(--bg2); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 1.2rem;
  box-shadow: var(--shadow-sm);
}
.chart-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.chart-header h3 { font-size: .95rem; font-weight: 700; }

.dash-bottom { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; }
.dash-card {
  background: var(--bg2); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 1.2rem;
  box-shadow: var(--shadow-sm);
}
.dash-card h3 { font-size: .9rem; font-weight: 700; margin-bottom: 1rem; display: flex; align-items: center; gap: .5rem; }
.dash-card h3 i { color: var(--primary); }
.rank-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: .5rem 0; border-bottom: 1px solid var(--border);
  font-size: .85rem;
}
.rank-item:last-child { border-bottom: none; }
.rank-item .rank-name { font-weight: 600; }
.rank-item .rank-val { color: var(--text-2); font-weight: 600; }
.alert-item { display: flex; align-items: center; gap: .6rem; padding: .5rem 0; border-bottom: 1px solid var(--border); font-size: .85rem; }
.alert-item:last-child { border-bottom: none; }
.alert-item i { flex-shrink: 0; }
.alert-item.danger i { color: var(--danger); }
.alert-item.warning i { color: var(--warning); }

/* ══════════════════════════════════════════════════════════
   SCANNER
═════════════════════════════════════════════════════════════ */
.scanner-wrap { max-width: 680px; margin: 0 auto; }
.scanner-card {
  background: var(--bg2); border-radius: var(--radius); padding: 2rem;
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.scanner-card h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 1.5rem; display: flex; align-items: center; gap: .5rem; }
.scan-input-row { display: flex; gap: .7rem; }
.scan-input { flex: 1; font-size: 1rem; padding: .7rem 1rem; }
.scan-result {
  margin-top: 1.5rem; background: var(--bg3);
  border-radius: var(--radius-sm); padding: 1.2rem;
  border: 1px solid var(--border);
}
.scan-product-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: .8rem 1.5rem; margin-top: .8rem; }
.scan-field label { font-size: .72rem; font-weight: 700; text-transform: uppercase; color: var(--text-3); display: block; }
.scan-field span { font-size: .95rem; font-weight: 600; }

/* ══════════════════════════════════════════════════════════
   USERS GRID
═════════════════════════════════════════════════════════════ */
.users-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 1rem; }
.user-card {
  background: var(--bg2); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 1.3rem;
  box-shadow: var(--shadow-sm); transition: all var(--transition);
}
.user-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.user-card-header { display: flex; align-items: center; gap: .8rem; margin-bottom: 1rem; }
.user-card-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--green-400));
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 1.2rem; font-weight: 700; flex-shrink: 0;
}
.user-card-info .uc-name { font-weight: 700; font-size: .95rem; }
.user-card-info .uc-role { font-size: .78rem; color: var(--text-3); }
.user-card-details { font-size: .82rem; color: var(--text-2); display: flex; flex-direction: column; gap: .3rem; }
.user-card-details span i { width: 14px; margin-right: .4rem; color: var(--primary); }
.user-card-actions { margin-top: 1rem; display: flex; justify-content: flex-end; gap: .4rem; }
.perms-grid { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .6rem; }
.perm-badge { background: var(--primary-light); color: var(--primary); font-size: .67rem; font-weight: 600; padding: .15rem .45rem; border-radius: 4px; }

/* ══════════════════════════════════════════════════════════
   BACKUP
═════════════════════════════════════════════════════════════ */
.backup-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: 1rem; }
.backup-card {
  background: var(--bg2); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 1.5rem;
  box-shadow: var(--shadow-sm); text-align: center;
}
.backup-icon { font-size: 2.5rem; color: var(--primary); margin-bottom: .8rem; }
.backup-card h3 { font-weight: 700; margin-bottom: .4rem; }
.backup-card p { font-size: .84rem; color: var(--text-2); margin-bottom: 1.2rem; }
.sys-info { text-align: left; font-size: .82rem; color: var(--text-2); display: flex; flex-direction: column; gap: .5rem; }
.sys-info span { display: flex; justify-content: space-between; border-bottom: 1px solid var(--border); padding-bottom: .3rem; }
.sys-info span:last-child { border-bottom: none; }
.sys-info strong { color: var(--text); }

/* ══════════════════════════════════════════════════════════
   MODALS
═════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  z-index: 500; display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  animation: fadeIn .2s ease;
}
.modal-box {
  background: var(--bg2); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); width: 100%; max-width: 680px;
  max-height: 90vh; display: flex; flex-direction: column;
  border: 1px solid var(--border);
  animation: slideUp .25s ease;
}
.confirm-box { max-width: 400px; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.2rem 1.5rem; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.modal-head h2 { font-size: 1rem; font-weight: 700; }
.modal-close { color: var(--text-3); font-size: 1.1rem; padding: .3rem; border-radius: 6px; transition: all var(--transition); }
.modal-close:hover { background: var(--bg3); color: var(--danger); }
.modal-body { padding: 1.5rem; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 1rem 1.5rem; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: .7rem; flex-shrink: 0;
}

/* Form layout inside modals */
.form-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: .9rem 1.2rem; }
.form-grid .full { grid-column: 1 / -1; }
.form-group-modal { display: flex; flex-direction: column; gap: .3rem; }
.form-group-modal label { font-size: .8rem; font-weight: 700; color: var(--text-2); }
.form-group-modal input,
.form-group-modal select,
.form-group-modal textarea { width: 100%; }
.form-group-modal textarea { resize: vertical; min-height: 70px; }

.section-divider { grid-column:1/-1; border-top:1.5px solid var(--border); padding-top:.5rem; margin-top:.3rem; font-size:.78rem; font-weight:700; text-transform:uppercase; color:var(--text-3); letter-spacing:.5px; }

/* Line items in invoice/quote */
.line-items-table { width: 100%; border-collapse: collapse; margin-bottom: .8rem; }
.line-items-table th { font-size: .72rem; font-weight: 700; text-transform: uppercase; color: var(--text-3); padding: .4rem .5rem; border-bottom: 1.5px solid var(--border); }
.line-items-table td { padding: .35rem .4rem; border-bottom: 1px solid var(--border); }
.line-items-table input, .line-items-table select { padding: .3rem .5rem; font-size: .84rem; }
.line-items-table .btn-icon { width: 26px; height: 26px; }
.totals-box { display: flex; flex-direction: column; align-items: flex-end; gap: .3rem; font-size: .88rem; }
.totals-box .total-row { display: flex; gap: 2rem; justify-content: flex-end; }
.totals-box .total-label { color: var(--text-2); min-width: 80px; text-align: right; }
.totals-box .total-val { font-weight: 700; min-width: 100px; text-align: right; }
.totals-box .total-row.grand { font-size: 1.05rem; border-top: 1.5px solid var(--border); padding-top: .4rem; margin-top: .2rem; color: var(--primary); }

/* Permissions checkboxes */
.perms-grid-modal { display: grid; grid-template-columns: repeat(3,1fr); gap: .5rem; }
.perm-check { display: flex; align-items: center; gap: .4rem; font-size: .82rem; cursor: pointer; }
.perm-check input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }

/* ══════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
═════════════════════════════════════════════════════════════ */
.toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 900; display: flex; flex-direction: column; gap: .6rem; }
.toast {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .8rem 1.2rem;
  box-shadow: var(--shadow-lg); min-width: 260px; max-width: 360px;
  display: flex; align-items: center; gap: .7rem; font-size: .88rem;
  animation: toastIn .3s ease;
  border-left: 4px solid var(--primary);
}
@keyframes toastIn { from { transform:translateX(100%); opacity:0; } to { transform:none; opacity:1; } }
@keyframes toastOut { from { transform:none; opacity:1; } to { transform:translateX(100%); opacity:0; } }
.toast.success { border-left-color: var(--green-500); }
.toast.error   { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast.info    { border-left-color: var(--info); }
.toast i { font-size: 1.1rem; flex-shrink: 0; }
.toast.success i { color: var(--green-500); }
.toast.error i   { color: var(--danger); }
.toast.warning i { color: var(--warning); }
.toast.info i    { color: var(--info); }
.toast-msg { flex: 1; }

/* ══════════════════════════════════════════════════════════
   SHORTCUT HINT
═════════════════════════════════════════════════════════════ */
.shortcut-hint {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg2); padding: .5rem 1.2rem;
  border-radius: 20px; font-size: .78rem; z-index: 800;
  animation: fadeIn .2s ease;
}
.shortcut-hint kbd { background: rgba(255,255,255,.15); border-radius: 4px; padding: .1rem .4rem; margin: 0 .2rem; }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
═════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; z-index: 200; transform: translateX(-100%); width: var(--sidebar-w) !important; }
  .sidebar.mobile-open { transform: translateX(0); }
  .mob-menu-btn { display: flex; }
  .search-global input { width: 150px; }
  .search-global input:focus { width: 180px; }
  .charts-row { grid-template-columns: 1fr; }
  .dash-bottom { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .perms-grid-modal { grid-template-columns: repeat(2,1fr); }
  .page-container { padding: 1rem; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-actions { flex-direction: column; align-items: stretch; }
  .filter-row { flex-direction: column; }
  .search-input { max-width: 100%; }
}

/* ─── UTILITY CLASSES ──────────────────────────────────── */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; }
.flex { display: flex; } .items-center { align-items: center; } .gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; }
.w-full { width: 100%; }
.empty-state {
  text-align: center; padding: 3rem 1rem; color: var(--text-3);
}
.empty-state i { font-size: 3rem; display: block; margin-bottom: .8rem; }
.empty-state p { font-size: .9rem; }

/* Color dot for status */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-green  { background: var(--green-500); }
.dot-red    { background: var(--danger); }
.dot-yellow { background: var(--warning); }

/* Stock bar */
.stock-bar-wrap { width: 80px; background: var(--bg3); border-radius: 4px; height: 6px; overflow: hidden; }
.stock-bar { height: 100%; border-radius: 4px; background: var(--green-500); transition: width .4s; }
.stock-bar.low { background: var(--warning); }
.stock-bar.critical { background: var(--danger); }
