:root {
  --bg: #0a0e1a;
  --surface: #111827;
  --surface2: #1a2235;
  --border: #1e2d45;
  --accent: #f59e0b;
  --accent2: #3b82f6;
  --accent3: #10b981;
  --danger: #ef4444;
  --warn: #f97316;
  --text: #f1f5f9;
  --text2: #94a3b8;
  --text3: #64748b;
  --patron: #f59e0b;
  --depot: #3b82f6;
  --livreur: #10b981;
  --client: #a78bfa;
  --emballage: #fb7185;
}
* { margin:0; padding:0; box-sizing:border-box; }
body { font-family:'DM Sans',sans-serif; background:var(--bg); color:var(--text); min-height:100vh; overflow-x:hidden; }
h1,h2,h3,h4 { font-family:'Syne',sans-serif; }


/* ── LANDING ── */
#page-landing {
  background: radial-gradient(ellipse at 20% 50%, #1a2a4a 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, #1a3a2a 0%, transparent 50%),
              var(--bg);
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  min-height:100vh; padding:40px 20px;
}
.brand { text-align:center; margin-bottom:60px; }
.brand-logo { font-family:'Syne',sans-serif; font-size:48px; font-weight:800; letter-spacing:-2px; }
.brand-logo span { color:var(--accent); }
.brand-sub { color:var(--text2); font-size:14px; letter-spacing:4px; text-transform:uppercase; margin-top:8px; }
.brand-desc { color:var(--text3); font-size:15px; margin-top:16px; max-width:400px; }

.role-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:16px; max-width:760px; width:100%; }
.role-card {
  background:var(--surface); border:1px solid var(--border);
  border-radius:16px; padding:28px 20px; cursor:pointer;
  transition:all .25s; position:relative; overflow:hidden;
  text-align:center;
}
.role-card::before {
  content:''; position:absolute; top:0; left:0; right:0; height:3px;
  background:var(--c); border-radius:16px 16px 0 0;
}
.role-card:hover { transform:translateY(-4px); border-color:var(--c); background:var(--surface2); box-shadow:0 20px 40px rgba(0,0,0,.4); }
.role-icon { font-size:36px; margin-bottom:12px; }
.role-name { font-family:'Syne',sans-serif; font-size:16px; font-weight:700; margin-bottom:6px; color:var(--c); }
.role-desc { font-size:12px; color:var(--text3); line-height:1.5; }
.role-badge { font-size:10px; background:var(--c); color:#000; border-radius:20px; padding:2px 8px; display:inline-block; margin-top:8px; font-weight:600; }

/* ── LOGIN ── */
#page-login {
  display:flex; align-items:center; justify-content:center; min-height:100vh;
  background:radial-gradient(ellipse at 30% 50%, #1a2a4a 0%, transparent 55%), var(--bg);
}
.login-box { background:var(--surface); border:1px solid var(--border); border-radius:20px; padding:40px; width:100%; max-width:400px; }
.login-back { color:var(--text3); font-size:13px; cursor:pointer; margin-bottom:24px; display:flex; align-items:center; gap:6px; }
.login-back:hover { color:var(--text); }
.login-role-badge { font-size:11px; padding:4px 12px; border-radius:20px; display:inline-block; margin-bottom:20px; font-weight:600; color:#000; }
.login-title { font-family:'Syne',sans-serif; font-size:26px; font-weight:800; margin-bottom:6px; }
.login-sub { color:var(--text3); font-size:14px; margin-bottom:32px; }
.form-group { margin-bottom:20px; }
.form-group label { font-size:13px; color:var(--text2); display:block; margin-bottom:8px; font-weight:500; }
.form-group input {
  width:100%; background:var(--bg); border:1px solid var(--border);
  border-radius:10px; padding:12px 16px; color:var(--text); font-size:14px;
  font-family:'DM Sans',sans-serif; outline:none; transition:border-color .2s;
}
.form-group input:focus { border-color:var(--accent2); }
.btn-primary {
  width:100%; padding:14px; border-radius:10px; border:none; cursor:pointer;
  font-family:'Syne',sans-serif; font-size:15px; font-weight:700; letter-spacing:.5px;
  background:var(--c,var(--accent)); color:#000; transition:opacity .2s;
}
.btn-primary:hover { opacity:.85; }
.demo-hint { text-align:center; margin-top:16px; font-size:12px; color:var(--text3); }

/* ── LAYOUT ── */
.app-layout { display:flex; min-height:100vh; }
.sidebar {
  width:240px; background:var(--surface); border-right:1px solid var(--border);
  display:flex; flex-direction:column; position:fixed; top:0; left:0; bottom:0; z-index:100;
}
.sidebar-brand { padding:24px 20px; border-bottom:1px solid var(--border); }
.sidebar-brand-name { font-family:'Syne',sans-serif; font-size:20px; font-weight:800; }
.sidebar-brand-name span { color:var(--accent); }
.sidebar-role { font-size:11px; letter-spacing:2px; text-transform:uppercase; margin-top:4px; }
.sidebar-nav { flex:1; padding:16px 0; overflow-y:auto; }
.nav-section { padding:8px 20px 4px; font-size:10px; text-transform:uppercase; letter-spacing:2px; color:var(--text3); font-weight:600; }
.nav-item {
  display:flex; align-items:center; gap:10px; padding:10px 20px;
  cursor:pointer; color:var(--text2); font-size:14px; transition:all .15s;
  border-left:3px solid transparent; margin:1px 0;
}
.nav-item:hover { background:var(--surface2); color:var(--text); }
.nav-item.active { background:var(--surface2); color:var(--text); border-left-color:var(--c); }
.nav-item .nav-icon { font-size:18px; width:22px; }
.sidebar-footer { padding:16px 20px; border-top:1px solid var(--border); }
.user-info { display:flex; align-items:center; gap:10px; cursor:pointer; }
.user-avatar { width:36px; height:36px; border-radius:10px; display:flex; align-items:center; justify-content:center; font-family:'Syne',sans-serif; font-weight:700; font-size:14px; color:#000; }
.user-name { font-size:13px; font-weight:500; }
.user-role-text { font-size:11px; color:var(--text3); }
.main-content { margin-left:240px; flex:1; min-height:100vh; }

/* ── TOPBAR ── */
.topbar {
  background:var(--surface); border-bottom:1px solid var(--border);
  padding:0 32px; height:64px; display:flex; align-items:center; justify-content:space-between;
  position:sticky; top:0; z-index:50;
}
.topbar-title { font-family:'Syne',sans-serif; font-size:20px; font-weight:700; }
.topbar-actions { display:flex; align-items:center; gap:12px; }
.notif-btn { position:relative; background:var(--bg); border:1px solid var(--border); border-radius:10px; width:38px; height:38px; cursor:pointer; display:flex; align-items:center; justify-content:center; font-size:18px; }
.notif-dot { position:absolute; top:6px; right:6px; width:8px; height:8px; background:var(--danger); border-radius:50%; }
.btn-sm { padding:8px 16px; border-radius:8px; border:none; cursor:pointer; font-family:'Syne',sans-serif; font-size:13px; font-weight:700; }

/* ── CONTENT ── */
.content { padding:32px; }
.subpage { display:none; }
.subpage.active { display:block; }

/* ── STATS GRID ── */
.stats-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin-bottom:32px; }
.stat-card { background:var(--surface); border:1px solid var(--border); border-radius:14px; padding:20px; position:relative; overflow:hidden; }
.stat-card::after { content:''; position:absolute; bottom:0; left:0; right:0; height:3px; background:var(--c); }
.stat-label { font-size:12px; color:var(--text3); text-transform:uppercase; letter-spacing:1px; margin-bottom:8px; }
.stat-value { font-family:'Syne',sans-serif; font-size:32px; font-weight:800; color:var(--c); }
.stat-sub { font-size:12px; color:var(--text3); margin-top:4px; }

/* ── TABLES ── */
.table-card { background:var(--surface); border:1px solid var(--border); border-radius:14px; overflow:hidden; margin-bottom:24px; }
.table-header { padding:16px 20px; border-bottom:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; }
.table-title { font-family:'Syne',sans-serif; font-size:15px; font-weight:700; }
table { width:100%; border-collapse:collapse; }
th { font-size:11px; text-transform:uppercase; letter-spacing:1px; color:var(--text3); padding:12px 20px; text-align:left; border-bottom:1px solid var(--border); background:var(--bg); }
td { padding:14px 20px; font-size:14px; border-bottom:1px solid var(--border); color:var(--text2); }
tr:last-child td { border-bottom:none; }
tr:hover td { background:var(--surface2); color:var(--text); }

/* ── BADGES ── */
.badge { font-size:11px; padding:3px 10px; border-radius:20px; font-weight:600; display:inline-flex; align-items:center; gap:4px; }
.badge-green { background:#10b98122; color:#10b981; }
.badge-yellow { background:#f59e0b22; color:#f59e0b; }
.badge-red { background:#ef444422; color:#ef4444; }
.badge-blue { background:#3b82f622; color:#3b82f6; }
.badge-purple { background:#a78bfa22; color:#a78bfa; }
.badge-orange { background:#f9731622; color:#f97316; }

/* ── FORM CARD ── */
.form-card { background:var(--surface); border:1px solid var(--border); border-radius:14px; padding:24px; margin-bottom:24px; }
.form-card-title { font-family:'Syne',sans-serif; font-size:15px; font-weight:700; margin-bottom:20px; }
.form-row { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.form-row-3 { display:grid; grid-template-columns:1fr 1fr 1fr; gap:16px; }
.form-group-inline { margin-bottom:16px; }
.form-group-inline label { font-size:12px; color:var(--text2); display:block; margin-bottom:6px; font-weight:500; }
.form-group-inline input,
.form-group-inline select,
.form-group-inline textarea {
  width:100%; background:var(--bg); border:1px solid var(--border);
  border-radius:8px; padding:10px 14px; color:var(--text); font-size:13px;
  font-family:'DM Sans',sans-serif; outline:none; transition:border-color .2s;
}
.form-group-inline select { cursor:pointer; }
.form-group-inline input:focus,
.form-group-inline select:focus,
.form-group-inline textarea:focus { border-color:var(--accent2); }
.btn-action { padding:10px 20px; border-radius:8px; border:none; cursor:pointer; font-family:'Syne',sans-serif; font-size:13px; font-weight:700; transition:opacity .2s; }
.btn-action:hover { opacity:.8; }
.btn-green { background:var(--accent3); color:#000; }
.btn-blue { background:var(--accent2); color:#fff; }
.btn-amber { background:var(--accent); color:#000; }
.btn-red { background:var(--danger); color:#fff; }
.btn-ghost { background:transparent; border:1px solid var(--border); color:var(--text2); }

/* ── ALERT ── */
.alert { border-radius:10px; padding:14px 18px; margin-bottom:16px; display:flex; align-items:center; gap:10px; font-size:13px; }
.alert-yellow { background:#f59e0b18; border:1px solid #f59e0b44; color:#f59e0b; }
.alert-red { background:#ef444418; border:1px solid #ef444444; color:#ef4444; }
.alert-green { background:#10b98118; border:1px solid #10b98144; color:#10b981; }

/* ── CARDS ROW ── */
.cards-row { display:grid; grid-template-columns:1fr 1fr; gap:20px; margin-bottom:24px; }
.info-card { background:var(--surface); border:1px solid var(--border); border-radius:14px; padding:20px; }
.info-card-title { font-family:'Syne',sans-serif; font-size:14px; font-weight:700; margin-bottom:16px; color:var(--text3); text-transform:uppercase; letter-spacing:1px; font-size:11px; }

/* ── TIMELINE ── */
.timeline { list-style:none; }
.timeline li { display:flex; gap:14px; padding-bottom:16px; position:relative; }
.timeline li::before { content:''; position:absolute; left:6px; top:18px; bottom:0; width:2px; background:var(--border); }
.timeline li:last-child::before { display:none; }
.tl-dot { width:14px; height:14px; border-radius:50%; border:2px solid var(--c,var(--accent)); background:var(--bg); flex-shrink:0; margin-top:3px; }
.tl-content { font-size:13px; }
.tl-time { font-size:11px; color:var(--text3); }

/* ── MODAL ── */
.modal-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,.7); z-index:500; align-items:center; justify-content:center; }
.modal-overlay.open { display:flex; }
.modal { background:var(--surface); border:1px solid var(--border); border-radius:20px; padding:32px; width:100%; max-width:520px; max-height:90vh; overflow-y:auto; }
.modal-title { font-family:'Syne',sans-serif; font-size:20px; font-weight:800; margin-bottom:6px; }
.modal-sub { color:var(--text3); font-size:13px; margin-bottom:24px; }
.modal-actions { display:flex; gap:10px; justify-content:flex-end; margin-top:24px; }

/* ── STOCK BARS ── */
.stock-bar-wrap { margin-bottom:14px; }
.stock-bar-label { display:flex; justify-content:space-between; font-size:13px; margin-bottom:6px; }
.stock-bar-track { background:var(--bg); border-radius:20px; height:8px; }
.stock-bar-fill { height:8px; border-radius:20px; transition:width .5s; }

/* ── MAP MOCK ── */
.map-mock { background:var(--bg); border:1px solid var(--border); border-radius:12px; height:220px; display:flex; align-items:center; justify-content:center; flex-direction:column; gap:8px; color:var(--text3); font-size:13px; position:relative; overflow:hidden; }
.map-mock::before { content:''; position:absolute; inset:0; background:radial-gradient(circle at 40% 60%, #1a3a2a 0%, transparent 60%), radial-gradient(circle at 70% 30%, #1a2a3a 0%, transparent 50%); }
.map-mock-icon { font-size:32px; position:relative; }
.map-mock-text { position:relative; }

/* ── TABS ── */
.tabs { display:flex; gap:4px; background:var(--bg); border-radius:10px; padding:4px; margin-bottom:24px; border:1px solid var(--border); width:fit-content; }
.tab { padding:8px 18px; border-radius:8px; font-size:13px; font-weight:600; cursor:pointer; color:var(--text3); font-family:'Syne',sans-serif; transition:all .15s; }
.tab.active { background:var(--surface); color:var(--text); }

/* ── PRODUCT LIST ── */
.product-list { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; }
.product-item { background:var(--bg); border:1px solid var(--border); border-radius:10px; padding:14px; cursor:pointer; transition:all .15s; }
.product-item:hover { border-color:var(--accent2); }
.product-item.selected { border-color:var(--accent2); background:var(--surface2); }
.product-icon { font-size:24px; margin-bottom:6px; }
.product-name { font-size:13px; font-weight:600; }
.product-price { font-size:12px; color:var(--accent3); }
.product-stock { font-size:11px; color:var(--text3); }

/* ── CLIENT PROFILE ── */
.profile-header { background:var(--surface); border:1px solid var(--border); border-radius:14px; padding:24px; margin-bottom:24px; display:flex; align-items:center; gap:20px; }
.profile-avatar-big { width:64px; height:64px; border-radius:16px; display:flex; align-items:center; justify-content:center; font-family:'Syne',sans-serif; font-size:24px; font-weight:800; color:#000; }
.profile-balance { text-align:right; }
.profile-balance-value { font-family:'Syne',sans-serif; font-size:28px; font-weight:800; }

/* ── CHARTS ── */
.chart-bar-container { display:flex; align-items:flex-end; gap:8px; height:120px; padding-top:10px; }
.chart-bar-col { flex:1; display:flex; flex-direction:column; align-items:center; gap:4px; height:100%; }
.chart-bar { width:100%; border-radius:6px 6px 0 0; transition:height .5s; cursor:pointer; }
.chart-bar:hover { filter:brightness(1.2); }
.chart-bar-label { font-size:10px; color:var(--text3); white-space:nowrap; }

/* ── NOTIFICATION PANEL ── */
.notif-list { list-style:none; }
.notif-item { padding:14px 20px; border-bottom:1px solid var(--border); display:flex; gap:12px; align-items:flex-start; cursor:pointer; }
.notif-item:hover { background:var(--surface2); }
.notif-item.unread { background:var(--surface2); }
.notif-dot-item { width:8px; height:8px; border-radius:50%; background:var(--accent2); flex-shrink:0; margin-top:5px; }
.notif-text { font-size:13px; line-height:1.4; }
.notif-time { font-size:11px; color:var(--text3); margin-top:2px; }

/* ── RESPONSIVE ── */
@media(max-width:900px) {
  .stats-grid { grid-template-columns:1fr 1fr; }
  .role-grid { grid-template-columns:1fr 1fr; }
  .form-row, .form-row-3 { grid-template-columns:1fr; }
  .cards-row { grid-template-columns:1fr; }
  .product-list { grid-template-columns:1fr 1fr; }
}

.page { min-height:100vh; }
.auth-error { display:none; margin-top:14px; color:var(--danger); font-size:12px; text-align:center; }
.auth-error.show { display:block; }
.demo-credentials { margin-top:16px; padding:12px; border:1px solid var(--border); border-radius:10px; background:var(--bg); color:var(--text3); font-size:12px; line-height:1.6; }
.demo-credentials strong { color:var(--text); }
