/* ============================================================
   Café Buchra POS — Mobile-first CSS  •  Dark Brown × Orange
   ============================================================ */

/* ── Variables ────────────────────────────────────────────── */
:root {
  --bg:          #120a04;
  --surface:     #1e1208;
  --surface-2:   #261709;
  --surface-3:   #2e1e0c;
  --border:      #3d2514;
  --border-light:#2a1a0b;
  --text:        #f0dfc8;
  --text-muted:  #a07848;
  --text-faint:  #9a6840;
  --accent:      #e06020;
  --accent-bg:   #2a1508;
  --accent-dark: #b54808;
  --success:     #16a34a;
  --success-bg:  #081e0e;
  --danger:      #dc2626;
  --danger-bg:   #200a0a;
  --warn:        #d97706;
  --warn-bg:     #1e1005;
  --stone-dark:  #0c0602;
  --radius:      16px;
  --radius-sm:   10px;
  --radius-xs:   6px;
  --shadow:      0 1px 3px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.3);
  --shadow-lg:   0 10px 40px rgba(0,0,0,.6);
  --nav-h:       64px;
  --header-h:    68px;
  --font-serif:  'Georgia', 'Times New Roman', serif;
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font: inherit; }
img { display: block; max-width: 100%; }

/* ── Layout ───────────────────────────────────────────────── */
.app-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h);
  background: #1a0e07;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 20px rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2px 0 8px;
}
.header-brand {
  display: flex; align-items: center; gap: 12px;
}
.brand-logo {
  width: 96px; height: auto; border-radius: 10px; padding: 6px 10px;
  object-fit: contain; flex-shrink: 0;
  background: #ffffff;
}
.header-right { display: flex; align-items: center; gap: 0; }

.btn-icon {
  width: 42px; height: 42px; border-radius: 10px;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.btn-icon:hover { background: var(--border-light); color: var(--text); }

.app-main {
  margin-top: var(--header-h);
  margin-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding: 16px;
  min-height: calc(100vh - var(--header-h) - var(--nav-h));
}

body.page-pos {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

body.page-pos .app-main {
  height: calc(100vh - var(--header-h) - var(--nav-h) - env(safe-area-inset-bottom, 0px));
  height: calc(100dvh - var(--header-h) - var(--nav-h) - env(safe-area-inset-bottom, 0px));
  min-height: 0;
  margin-bottom: 0;
  padding: 6px;
  overflow: hidden;
}

/* ── Bottom Navigation (AppBar) ───────────────────────────── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: #1a0e07;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -1px 0 var(--border), 0 -8px 32px rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: space-around;
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 4px;
  color: var(--text-muted); font-size: 10px; font-weight: 600;
  letter-spacing: .02em; text-transform: uppercase;
  height: var(--nav-h); background: none; border: none;
  cursor: pointer; transition: color .2s;
  -webkit-tap-highlight-color: transparent;
  position: relative; isolation: isolate;
}
.nav-item:hover { color: var(--text); }
.nav-item.active { color: var(--accent); }
.nav-item.active::before {
  content: '';
  position: absolute;
  top: 9px; left: 50%;
  transform: translateX(-50%);
  width: 52px; height: 30px;
  border-radius: 15px;
  background: rgba(224,96,32,.18);
  z-index: -1;
}
.nav-icon { width: 22px; height: 22px; }

/* ── Drawer (More menu) ───────────────────────────────────── */
.drawer-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.65);
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
.drawer-overlay.open { opacity: 1; pointer-events: all; }
.drawer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 201;
  background: var(--surface-2);
  border-radius: 24px 24px 0 0;
  border-top: 1px solid var(--border);
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  padding-bottom: env(safe-area-inset-bottom, 16px);
}
.drawer.open { transform: translateY(0); }
.drawer-handle {
  width: 40px; height: 4px; border-radius: 2px;
  background: var(--border); margin: 12px auto 0;
}
.drawer-title {
  font-size: 11px; font-weight: 700; letter-spacing: .1em;
  color: var(--text-faint); text-transform: uppercase;
  padding: 16px 20px 8px;
}
.drawer-nav { padding: 0 8px; }
.drawer-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 12px; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 500; color: var(--text);
  transition: background .12s;
}
.drawer-item:hover, .drawer-item:active { background: var(--surface-3); }
.drawer-footer {
  border-top: 1px solid var(--border-light);
  margin-top: 8px; padding: 12px 16px; display: flex;
  flex-direction: column; gap: 8px;
}
.btn-profile-info {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 10px 8px; border-radius: var(--radius-sm);
  background: var(--surface-3); text-align: left;
  transition: background .12s;
}
.btn-profile-info:hover { background: var(--border); }
.profile-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: var(--text);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: bold; flex-shrink: 0;
}
.profile-name { font-size: 14px; font-weight: 600; }
.profile-role { font-size: 12px; color: var(--text-muted); text-transform: capitalize; }
.profile-info { flex: 1; }
.btn-logout {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 8px; border-radius: var(--radius-sm);
  color: var(--danger); font-size: 14px; font-weight: 500;
  transition: background .12s;
}
.btn-logout:hover { background: var(--danger-bg); }

/* ── Modals ───────────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,.7);
  display: none; align-items: flex-end;
  backdrop-filter: blur(3px);
}
.modal.open { display: flex; }
.modal-sheet {
  background: var(--surface-2); border-radius: 24px 24px 0 0;
  border-top: 1px solid var(--border);
  width: 100%; max-height: 92vh;
  display: flex; flex-direction: column;
  animation: slideUp .28s cubic-bezier(.4,0,.2,1);
}
.modal-sm .modal-sheet { max-height: 70vh; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border-light);
  position: sticky; top: 0; background: var(--surface-2); border-radius: 24px 24px 0 0;
  z-index: 1;
}
.modal-title { font-family: var(--font-serif); font-size: 20px; color: var(--text); }
.modal-close {
  width: 32px; height: 32px; border-radius: 8px;
  color: var(--text-muted); font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s, color .12s;
}
.modal-close:hover { background: var(--surface-3); color: var(--text); }
.modal-body {
  overflow-y: auto; padding: 20px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  flex: 1;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; min-height: 44px;
  transition: all .15s; cursor: pointer; border: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary   { background: #4a2c14; color: var(--text); }
.btn-primary:hover:not(:disabled) { background: #5c3820; }
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1.5px solid var(--border); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-3); }
.btn-accent    { background: var(--accent); color: #fff; }
.btn-accent:hover:not(:disabled) { background: var(--accent-dark); }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-success   { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { background: #047857; }
.btn-ghost     { color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-full { width: 100%; }
.btn-lg   { min-height: 52px; font-size: 16px; }
.btn-sm   { min-height: 34px; font-size: 13px; padding: 6px 14px; }
.btn-xs   { min-height: 28px; font-size: 11px; padding: 4px 8px; }
.btn-row  { display: flex; gap: 12px; }
.flex-1   { flex: 1; }

.btn-icon-sm {
  width: 30px; height: 30px; border-radius: 6px;
  font-size: 13px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-3); color: var(--text-muted);
  transition: background .12s, color .12s; border: none; cursor: pointer;
}
.btn-icon-sm:hover { background: var(--border); color: var(--text); }
.btn-icon-danger:hover { background: var(--danger-bg); color: var(--danger); }

/* ── Forms ────────────────────────────────────────────────── */
.form-stack { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-row   { display: flex; gap: 12px; }
.form-row > .form-group { flex: 1; min-width: 0; }
.form-row > .flex-2 { flex: 2; }
.form-label {
  font-size: 11px; font-weight: 700; letter-spacing: .08em;
  color: var(--text-faint); text-transform: uppercase;
}
.form-input, .form-select {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; color: var(--text); background: var(--surface-3);
  min-height: 44px; transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(224,96,32,.2);
}
.form-input::placeholder { color: var(--text-faint); }
.form-input-lg { font-size: 18px; min-height: 54px; }
.form-input-sm { min-height: 38px; padding: 8px 12px; font-size: 13px; }
.form-select-sm { min-height: 38px; padding: 6px 12px; font-size: 13px; }
.form-error {
  font-size: 12px; color: var(--danger);
  min-height: 16px; font-weight: 500;
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border-light); box-shadow: var(--shadow);
}
.card-warn { border-color: #5a3c10; background: var(--warn-bg); }
.card-header {
  padding: 14px 16px 10px;
  font-size: 11px; font-weight: 700; letter-spacing: .08em;
  color: var(--text-faint); text-transform: uppercase;
  border-bottom: 1px solid var(--border-light);
}
.card-body { padding: 12px 16px; }

/* ── KPI Sections ─────────────────────────────────────────── */
.kpi-section {
  background: var(--surface); border-radius: var(--radius-sm);
  border: 1px solid var(--border-light); box-shadow: var(--shadow);
  overflow: hidden; margin-top: 8px;
}
.kpi-section:first-child { margin-top: 0; }
.kpi-cells {
  display: grid; grid-template-columns: 1fr 1fr;
}
.kpi-cell { padding: 10px 12px; }
.kpi-cell:nth-child(odd)  { border-right: 1px solid var(--border-light); }
.kpi-cell:nth-child(n+3)  { border-top:   1px solid var(--border-light); }
.kpi-cell-span { grid-column: span 2; border-right: none !important; }
.kpi-section-chart {
  border-top: 1px solid var(--border-light);
  position: relative; height: 158px; padding: 4px 10px 10px;
}
.kpi-section-chart.kpi-donut-chart {
  height: auto; padding: 8px 14px 12px;
  display: flex; align-items: center; gap: 14px;
}
.kpi-section-chart.kpi-donut-chart .donut-canvas-wrap {
  width: 110px; height: 110px; flex-shrink: 0; position: relative;
}
.kpi-section-chart.kpi-donut-chart .donut-legend { flex: 1; }
.kpi-label {
  font-size: 9px; font-weight: 700; letter-spacing: .07em;
  color: var(--text-faint); text-transform: uppercase; margin-bottom: 4px;
}
.kpi-value {
  font-family: var(--font-serif); font-size: 15px; font-weight: bold;
  color: var(--accent); line-height: 1.2; margin-bottom: 3px;
  display: flex; align-items: baseline; gap: 5px; flex-wrap: wrap;
}
.kpi-sub { font-size: 10px; color: var(--text-muted); line-height: 1.3; }
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kpi-card { background: var(--surface); border-radius: var(--radius-sm); border: 1px solid var(--border-light); padding: 10px 12px; box-shadow: var(--shadow); }

/* ── Trend badges ─────────────────────────────────────────── */
.trend {
  font-size: 10px; font-weight: 700; padding: 2px 6px;
  border-radius: 20px;
}
.trend-up { background: var(--success-bg); color: var(--success); }
.trend-dn { background: var(--danger-bg);  color: var(--danger); }

/* ── Charts ───────────────────────────────────────────────── */
.chart-card {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border-light); padding: 16px;
  box-shadow: var(--shadow);
}
.chart-title {
  font-size: 10px; font-weight: 700; letter-spacing: .08em;
  color: var(--text-faint); text-transform: uppercase; margin-bottom: 12px;
}

/* ── Page header ──────────────────────────────────────────── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 16px;
}
.page-title {
  font-family: var(--font-serif); font-size: 20px;
  color: var(--accent); line-height: 1.1;
}
.dash-title {
  font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ── Section label ────────────────────────────────────────── */
.section-label {
  font-size: 10px; font-weight: 700; letter-spacing: .1em;
  color: var(--text-faint); text-transform: uppercase;
  margin-bottom: 8px;
}
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; }

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger); }
.badge-warn    { background: var(--warn-bg);     color: var(--warn); }
.badge-stone   { background: var(--surface-3);   color: var(--text-muted); }

/* ── Lists ────────────────────────────────────────────────── */
.list-items { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border-light); overflow: hidden; }
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  transition: background .1s;
}
.list-item:last-child { border-bottom: none; }
.list-item.clickable { cursor: pointer; }
.list-item.clickable:hover { background: var(--surface-3); }
.list-item-main { flex: 1; min-width: 0; }
.list-item-title { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item-sub   { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.list-item-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.list-item-amount { font-family: var(--font-serif); font-size: 14px; font-weight: 600; }
.item-actions { display: flex; align-items: center; gap: 4px; margin-top: 2px; }

/* ── Filter tabs ──────────────────────────────────────────── */
.filter-tabs {
  display: flex; gap: 4px; background: var(--border-light);
  padding: 4px; border-radius: 12px; margin-bottom: 12px;
  overflow-x: auto; scrollbar-width: none;
}
.filter-tabs::-webkit-scrollbar { display: none; }
.tab {
  flex-shrink: 0; padding: 7px 14px; border-radius: 8px;
  font-size: 13px; font-weight: 600; color: var(--text-muted);
  background: none; border: none; cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.tab.active { background: var(--surface-2); color: var(--text); box-shadow: var(--shadow); }

/* ── Tables ───────────────────────────────────────────────── */
.table-card { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border-light); overflow: hidden; }
.detail-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 12px 0; }
.detail-table th { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); padding: 8px 4px; border-bottom: 1px solid var(--border-light); text-align: left; }
.detail-table td { padding: 8px 4px; border-bottom: 1px solid var(--border-light); color: var(--text); }
.detail-table tr:last-child td { border-bottom: none; }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--border-light); }
.detail-label { font-size: 11px; color: var(--text-muted); margin-bottom: 2px; }
.mono { font-family: monospace; font-size: 12px; }
.amount-summary { background: var(--bg); border-radius: var(--radius-sm); padding: 12px 14px; margin-top: 12px; border: 1px solid var(--border-light); }
.amount-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--text-muted); padding: 4px 0; }
.border-top { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 6px; }
.text-success { color: var(--success) !important; }
.text-danger  { color: var(--danger)  !important; }
.text-warn    { color: var(--warn)    !important; }
.font-bold    { font-weight: 700; color: var(--text) !important; }

/* ── Top products ─────────────────────────────────────────── */
.top-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border-light); }
.top-item:last-child { border-bottom: none; }
.top-rank  { font-size: 11px; font-weight: 700; color: var(--text-faint); width: 20px; flex-shrink: 0; }
.top-info  { flex: 1; min-width: 0; }
.top-name  { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; color: var(--text); }
.top-value { font-size: 13px; font-weight: 600; font-family: var(--font-serif); flex-shrink: 0; color: var(--accent); }
.progress-bar  { height: 4px; background: var(--border-light); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 2px; background: var(--text-faint); transition: width .5s ease; }
.progress-fill.accent { background: var(--accent); }

/* ── POS Layout ───────────────────────────────────────────── */
.pos-layout {
  display: flex; flex-direction: column;
  /* Remplit exactement .app-main (déjà calé sur 100dvh - header - nav - safe-area).
     Évite de recalculer une hauteur en 100vh qui ignore la barre d'adresse mobile
     et l'inset bas iPhone → le footer « Valider » passait parfois sous la bottombar. */
  height: 100%;
  gap: 5px; overflow: hidden;
}
.pos-catalog { display: flex; flex-direction: column; flex: 0 0 38%; min-height: 0; overflow: hidden; }
.pos-search { position: relative; margin-bottom: 6px; flex-shrink: 0; }
.search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-faint); pointer-events: none; }
.search-input {
  width: 100%; height: 30px; padding: 0 10px 0 30px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 12px; background: var(--surface-3); color: var(--text);
  transition: border-color .15s;
}
.search-input:focus { outline: none; border-color: var(--accent); }
.pos-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 5px; overflow-y: auto; flex: 1; align-content: start;
}
@media (min-width: 480px) { .pos-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 768px) { .pos-grid { grid-template-columns: repeat(5, 1fr); } }
@media (min-width: 1024px) { .pos-grid { grid-template-columns: repeat(6, 1fr); } }

.product-card {
  background: var(--surface); border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm); padding: 7px;
  cursor: pointer; transition: all .15s; position: relative;
  text-align: left; display: block; width: 100%;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
.product-card:hover:not(:disabled) { border-color: var(--accent); }
.product-card:active:not(:disabled) { transform: scale(.97); }
.product-card:disabled { opacity: .4; cursor: not-allowed; }
.product-card.in-cart { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(224,96,32,.3); }
.product-stripe {
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.product-badge-qty {
  position: absolute; top: 5px; right: 5px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-size: 9px; font-weight: bold;
  display: flex; align-items: center; justify-content: center;
}
.product-sku  { font-size: 9px; color: var(--text-faint); font-family: monospace; margin-bottom: 2px; }
.product-name { font-size: 11px; font-weight: 600; line-height: 1.2; margin-bottom: 5px; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 4px; }
.product-price { font-family: var(--font-serif); font-size: 12px; color: var(--text); }
.product-stock { font-size: 9px; font-weight: 700; }
.product-stock.ok   { color: var(--text-faint); }
.product-stock.low  { color: var(--warn); }
.product-stock.zero { color: var(--danger); }

/* ── Cart ─────────────────────────────────────────────────── */
.pos-cart {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--radius);
  border: 1.5px solid var(--border); overflow: hidden;
}
.cart-header {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}
.cart-title { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.cart-count { color: var(--accent); }
.btn-clear  { font-size: 11px; color: var(--text-faint); margin-left: auto; white-space: nowrap; }
.btn-clear:hover { color: var(--danger); }
.cart-items { flex: 1; overflow-y: auto; padding: 6px; min-height: 0; }
.cart-empty {
  height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: var(--text-faint); gap: 6px; padding: 16px 0;
}
.cart-empty p { font-size: 12px; }
.cart-item {
  display: flex; align-items: center; gap: 6px;
  padding: 6px; background: var(--bg); border-radius: 6px;
  border: 1px solid var(--border-light); margin-bottom: 4px;
}
.cart-item-name  { font-size: 11px; font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.cart-qty-ctrl   { display: flex; align-items: center; background: var(--surface-3); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; flex-shrink: 0; }
.cart-qty-ctrl button { width: 22px; height: 22px; font-size: 14px; color: var(--text-muted); display: flex; align-items: center; justify-content: center; }
.cart-qty-ctrl button:hover { color: var(--text); }
.cart-qty-input  { width: 24px; text-align: center; font-size: 11px; font-weight: 700; border: none; outline: none; background: transparent; color: var(--text); }
.cart-item-price { width: 58px; padding: 3px 5px; border: 1px solid var(--border); border-radius: 6px; font-size: 11px; text-align: right; background: var(--surface-3); color: var(--text); -moz-appearance: textfield; appearance: textfield; }
.cart-item-price::-webkit-inner-spin-button, .cart-item-price::-webkit-outer-spin-button { -webkit-appearance: none; appearance: none; }
.cart-item-total { font-size: 11px; font-weight: 700; font-family: var(--font-serif); width: 62px; text-align: right; flex-shrink: 0; color: var(--text); }
.cart-item-del   { width: 18px; height: 18px; color: var(--text-faint); font-size: 12px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.cart-item-del:hover { color: var(--danger); }

.cart-footer { border-top: 1px solid var(--border); background: var(--stone-dark); border-radius: 0 0 var(--radius) var(--radius); flex-shrink: 0; }
.cart-total-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 12px; border-bottom: 1px solid rgba(255,255,255,.06);
}
.cart-total-label { font-size: 10px; color: rgba(255,255,255,.35); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.cart-total-value { font-family: var(--font-serif); font-size: 18px; color: var(--accent); }
.cart-options { display: flex; gap: 6px; padding: 5px 10px 0; flex-wrap: wrap; align-items: center; }
.cart-change { font-size: 11px; color: #86efac; font-weight: 600; padding: 2px 4px; }
.cart-validate-wrap { padding: 6px 10px 8px; }

/* ── Sale mode toggle ─────────────────────────────────────── */
.sale-mode-toggle {
  display: flex; gap: 2px; flex: 1;
  background: var(--border-light); border-radius: 6px; padding: 2px;
}
.mode-btn {
  flex: 1; padding: 3px 6px; border-radius: 4px;
  font-size: 10px; font-weight: 700; color: var(--text-muted);
  transition: all .15s; text-transform: uppercase; letter-spacing: .03em;
  white-space: nowrap;
}
.mode-btn.active { background: var(--accent); color: #fff; }

/* ── Receipt ──────────────────────────────────────────────── */
.receipt {
  border-radius: 16px; overflow: hidden;
  border: 1px solid var(--border-light);
}
.receipt-header { background: var(--stone-dark); color: var(--text); padding: 20px 24px; text-align: center; border-bottom: 1px solid var(--border); }
.receipt-logo-icon { width: 40px; height: 40px; border-radius: 10px; object-fit: contain; margin: 0 auto 12px; display: block; }
.receipt-shop-name { font-family: var(--font-serif); font-size: 20px; color: var(--text); }
.receipt-label { font-size: 11px; color: rgba(240,223,200,.4); text-transform: uppercase; letter-spacing: .1em; margin-top: 4px; }
.receipt-num { font-size: 12px; color: rgba(240,223,200,.3); margin-top: 8px; }
.receipt-items { background: var(--surface); padding: 16px 20px; }
.receipt-item { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.receipt-item-name  { font-size: 13px; font-weight: 600; color: var(--text); }
.receipt-item-sub   { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.receipt-item-total { font-size: 13px; font-weight: 700; font-family: var(--font-serif); flex-shrink: 0; color: var(--text); }
.receipt-summary { background: var(--bg); padding: 14px 20px; border-top: 1px solid var(--border-light); }
.receipt-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.receipt-total-bar { background: var(--stone-dark); padding: 14px 20px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border); }
.receipt-total-bar span:first-child { font-size: 11px; color: rgba(240,223,200,.4); text-transform: uppercase; letter-spacing: .1em; }
.receipt-total-bar .big { font-family: var(--font-serif); font-size: 24px; color: var(--accent); }

/* ── Invoice (table + client + footer) ───────────────────── */
.inv-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.inv-table thead tr { border-bottom: 1px solid var(--border); }
.inv-table th { padding: 8px 16px; text-align: left; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.inv-table td { padding: 9px 16px; border-bottom: 1px solid var(--border-light); color: var(--text); }
.inv-table tbody tr:last-child td { border-bottom: none; }
.inv-num { text-align: right !important; font-family: var(--font-serif); }
.inv-bold { font-weight: 700; }
.inv-client { display: flex; align-items: center; gap: 8px; padding: 9px 20px; background: var(--surface-2); border-bottom: 1px solid var(--border-light); font-size: 13px; }
.inv-client-lbl { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.inv-footer { display: flex; justify-content: space-between; align-items: center; padding: 10px 20px; font-size: 11px; color: var(--text-muted); border-top: 1px solid var(--border-light); }

/* ── Print ────────────────────────────────────────────────── */
@media print {
  * { visibility: hidden !important; }
  .print-area, .print-area * { visibility: visible !important; }
  .print-area { position: fixed !important; inset: 0 !important; background: #fff !important; color: #000 !important; }
  .print-area .receipt-header { background: #1c1917 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-area .receipt-total-bar { background: #1c1917 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-area .inv-table td, .print-area .inv-table th { border-color: #d4d4d4 !important; }
  .print-area .receipt-summary, .print-area .receipt-items { background: #fff !important; }
}

/* ── Purchases ────────────────────────────────────────────── */
.purchase-line { padding: 8px 0; border-bottom: 1px solid var(--border-light); }
.purchase-line:last-child { border-bottom: none; }
.btn-pay { font-size: 12px; font-weight: 600; color: var(--success); background: var(--success-bg); padding: 4px 10px; border-radius: 6px; border: none; cursor: pointer; }
.btn-pay:hover { opacity: .85; }

/* ── Login ────────────────────────────────────────────────── */
.login-body { background: var(--bg); }
.login-page {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center;
}

.ls {
  width: 100%; max-width: 430px;
  min-height: 100vh;
  display: flex; flex-direction: column;
}
.ls.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════
   ÉTAPE 1 — Numéroteur téléphonique
═══════════════════════════════════════════════════ */
.ls1-header {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: max(44px, env(safe-area-inset-top, 44px)) 24px 14px;
  gap: 6px;
}
.ls1-icon-wrap { margin-bottom: 8px; }
.ls1-icon {
  width: 76px; height: 76px; border-radius: 20px; object-fit: contain;
  background: #fff; padding: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,.45), 0 2px 6px rgba(0,0,0,.3);
}
.ls1-title {
  font-family: var(--font-serif); font-size: 26px; font-weight: 700;
  color: var(--text); line-height: 1.1;
}
.ls1-sub { font-size: 13px; color: var(--text-muted); line-height: 1.4; }

.ls1-display-area { padding: 0 20px 4px; }

.phone-country-row {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 0 4px 12px; flex-wrap: wrap;
}
.pc-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px 6px 10px; border-radius: 50px;
  background: var(--surface-3); border: 1.5px solid var(--border);
  font-size: 14px; font-weight: 700; color: var(--text);
  cursor: default; user-select: none;
}
.pc-flag { font-size: 18px; line-height: 1; }
.pc-code { letter-spacing: .02em; }
.pc-note { font-size: 11px; color: var(--text-faint); font-weight: 500; }

.phone-display-wrap { padding: 0 4px 4px; text-align: center; }
.phone-display {
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 300; line-height: 1.3;
  min-height: 44px; letter-spacing: .05em;
  user-select: none;
}
.pd-f   { color: var(--text); font-weight: 500; }
.pd-e   { color: var(--border); }
.pd-sep { display: inline-block; width: 10px; }

/* Clavier téléphone */
.phone-keypad {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; padding: 4px 20px 0;
  align-content: start;
}

.ls-actions {
  display: flex; flex-direction: column; gap: 10px;
  padding: 10px 24px max(32px, env(safe-area-inset-bottom, 32px));
  margin-top: auto;
}

/* ─── Touches numériques (base) ─── */
.key {
  height: 60px; border-radius: 16px; font-size: 26px; font-weight: 400;
  background: var(--surface-3); color: var(--text);
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--border);
  transition: background .08s, transform .08s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.key:not([disabled]):active { background: var(--border); transform: scale(.91); }
.key-empty { background: transparent; border-color: transparent; pointer-events: none; }
.key-del   { color: var(--text-muted); }
.key-del:not([disabled]):active { color: var(--danger); }

/* Touches téléphone avec sous-labels */
.key-phone { flex-direction: column; gap: 0; height: 64px; }
.key-num   { font-size: 23px; font-weight: 400; line-height: 1.2; }
.key-sub   {
  font-size: 8px; font-weight: 700; letter-spacing: .14em;
  color: var(--text-faint); text-transform: uppercase; line-height: 1;
}

/* Touches PIN — plus grandes, sobres, sans sous-labels */
.pin-keypad .key { height: 68px; font-size: 28px; font-weight: 300; border-radius: 18px; }

/* ═══════════════════════════════════════════════════
   ÉTAPE 2 — Écran de verrouillage PIN
═══════════════════════════════════════════════════ */
.ls-topbar {
  display: flex; align-items: center; gap: 12px;
  padding: max(18px, env(safe-area-inset-top, 18px)) 20px 0;
}
.ls-topbar-title { font-size: 17px; font-weight: 600; color: var(--text); }
.ls-topbar-hint  { font-size: 12px; color: var(--text-faint); font-weight: 500; }

.btn-back {
  width: 44px; height: 44px; border-radius: 14px; flex-shrink: 0;
  color: var(--text); background: var(--surface-3); border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, transform .1s;
}
.btn-back:hover  { background: var(--border); }
.btn-back:active { transform: scale(.93); }

/* Avatar + identité */
.ls2-user-area {
  display: flex; flex-direction: column; align-items: center;
  gap: 14px; padding: 24px 28px 8px; text-align: center;
  flex: 1; justify-content: center; max-height: 40vh;
}
.ls2-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff; font-size: 26px; font-weight: 700;
  font-family: var(--font-serif);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 24px rgba(224,96,32,.35), 0 1px 4px rgba(0,0,0,.4);
  letter-spacing: .02em;
}
.ls2-meta { display: flex; flex-direction: column; gap: 4px; }
.ls2-greeting {
  font-family: var(--font-serif); font-size: 22px; font-weight: 400;
  color: var(--text); line-height: 1.2;
}
.ls2-greeting span { font-weight: 700; }
.ls2-hint { font-size: 13px; color: var(--text-muted); }

/* PIN dots */
.ls2-pin-section { padding: 0 28px 4px; }
.pin-display {
  display: flex; justify-content: center; gap: 20px; margin-bottom: 8px;
}
.pin-dot {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--border); background: transparent;
  transition: all .18s cubic-bezier(.34,1.56,.64,1);
}
.pin-dot.filled {
  background: var(--accent); border-color: var(--accent);
  transform: scale(1.15);
  box-shadow: 0 2px 10px rgba(224,96,32,.4);
}
.pin-error { text-align: center; min-height: 20px; margin-bottom: 8px; }

/* Clavier PIN */
.pin-keypad {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 4px 20px max(28px, env(safe-area-inset-bottom, 28px));
}

/* ═══════════════════════════════════════════════════
   ÉTAPE 3 — Setup
═══════════════════════════════════════════════════ */
.ls-body {
  display: flex; flex-direction: column; gap: 14px;
  padding: 0 28px max(40px, env(safe-area-inset-bottom, 40px));
}
.ls-setup-body { padding-top: 28px; flex: 1; }
.ls-link { text-align: center; font-size: 13px; color: var(--text-muted); }
.ls-link a { color: var(--accent); font-weight: 600; }
.card-title { font-family: var(--font-serif); font-size: 24px; margin-bottom: 6px; color: var(--text); }
.card-hint  { font-size: 15px; color: var(--text-muted); margin-bottom: 24px; }

/* Animations */
.shake { animation: shake .4s ease-in-out; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%,60%  { transform: translateX(-9px); }
  40%,80%  { transform: translateX(9px); }
}

/* ═══════════════════════════════════════════════════
   PAGE INSTALLATION PWA
═══════════════════════════════════════════════════ */
.install-page {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center;
  background: var(--bg);
}
.install-wrap {
  width: 100%; max-width: 430px; display: flex; flex-direction: column; min-height: 100vh;
}
.install-hero {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: max(48px, env(safe-area-inset-top, 48px)) 24px 28px; gap: 6px;
}
.install-hero-icon {
  width: 88px; height: 88px; border-radius: 22px; object-fit: contain;
  background: #fff; padding: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,.5), 0 2px 8px rgba(0,0,0,.3);
  margin-bottom: 10px;
}
.install-hero-name {
  font-family: var(--font-serif); font-size: 26px; font-weight: 700; color: var(--text);
}
.install-hero-sub { font-size: 14px; color: var(--text-muted); }

.install-section-label {
  font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-faint); text-align: center; margin-bottom: 12px; padding: 0 20px;
}
.install-platform-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 20px 28px;
}
.install-platform-btn {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 20px 12px; border-radius: 18px;
  background: var(--surface-2); border: 2px solid var(--border);
  color: var(--text); transition: all .15s; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.install-platform-btn:hover, .install-platform-btn:active { border-color: var(--accent); background: var(--surface-3); }
.install-platform-btn.active { border-color: var(--accent); background: var(--accent-bg); box-shadow: 0 0 0 1px rgba(224,96,32,.2); }
.install-platform-name { font-size: 15px; font-weight: 700; }
.install-platform-sub  { font-size: 11px; color: var(--text-muted); }

.install-steps-wrap { padding: 0 20px; display: none; flex-direction: column; }
.install-steps-wrap.visible { display: flex; }
.install-steps-title {
  font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: 16px; text-align: center;
}
.install-step {
  display: flex; gap: 14px; padding: 16px 0;
  border-bottom: 1px solid var(--border-light); align-items: flex-start;
}
.install-step:last-child { border-bottom: none; }
.install-step-num {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; margin-top: 1px;
}
.install-step-body { flex: 1; }
.install-step-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.install-step-desc { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.install-step-desc strong { color: var(--text); font-weight: 600; }
.install-step-emoji { font-size: 22px; line-height: 1; margin-top: 3px; flex-shrink: 0; }

.install-cta-wrap {
  margin-top: auto; padding: 20px 20px max(32px, env(safe-area-inset-bottom, 32px));
  display: flex; flex-direction: column; gap: 10px;
}
.install-note { text-align: center; font-size: 12px; color: var(--text-faint); line-height: 1.6; }

/* ── Toast ────────────────────────────────────────────────── */
#toast-container {
  position: fixed; top: calc(var(--header-h) + 8px); left: 50%;
  transform: translateX(-50%); z-index: 999;
  display: flex; flex-direction: column; gap: 8px; width: calc(100% - 32px); max-width: 380px;
}
.toast {
  background: var(--surface-2); color: var(--text);
  padding: 12px 16px; border-radius: 14px;
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  animation: slideDown .2s ease;
}
.toast-icon { font-size: 16px; flex-shrink: 0; }
.toast-msg  { flex: 1; line-height: 1.4; }
.toast-close { color: var(--text-faint); font-size: 14px; cursor: pointer; padding: 2px; }
.toast-close:hover { color: var(--text); }
.toast-success .toast-icon { color: #4ade80; }
.toast-error   .toast-icon { color: #f87171; }
.toast-warn    .toast-icon { color: #fbbf24; }
@keyframes slideDown {
  from { transform: translateY(-12px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

/* ── Profile modal ────────────────────────────────────────── */
.modal-profile-wrap { align-items: flex-end; }
.profile-sheet {
  max-height: 88vh;
  display: flex; flex-direction: column;
  border-radius: 24px 24px 0 0;
  overflow: hidden;
}
.profile-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px 8px; background: var(--surface-2); flex-shrink: 0;
}
.profile-topbar-title { font-size: 15px; font-weight: 700; color: var(--text); }
.profile-back {
  width: 34px; height: 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); background: var(--surface-3);
  border: none; cursor: pointer; transition: background .12s;
}
.profile-back:hover { background: var(--border); color: var(--text); }

.profile-hero {
  background: linear-gradient(150deg, var(--stone-dark) 0%, #4a2008 100%);
  padding: 18px 20px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  flex-shrink: 0;
}
.profile-avatar-lg {
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--accent);
  color: #fff; font-size: 22px; font-weight: 800; font-family: var(--font-serif);
  display: flex; align-items: center; justify-content: center;
  border: 2px solid rgba(255,255,255,.15);
}
.profile-hero-name {
  font-family: var(--font-serif); font-size: 18px; color: var(--text); font-weight: 700;
}
.profile-hero-role {
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  background: rgba(224,96,32,.2); color: var(--accent);
  padding: 2px 10px; border-radius: 20px; border: 1px solid rgba(224,96,32,.3);
}

.profile-body {
  overflow-y: auto; flex: 1;
  padding-bottom: env(safe-area-inset-bottom, 20px);
}
.profile-info-list {
  margin: 0; border-bottom: 1px solid var(--border-light);
}
.profile-info-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 18px; border-bottom: 1px solid var(--border-light); gap: 12px;
}
.profile-info-row:last-child { border-bottom: none; }
.profile-info-lbl {
  font-size: 12px; color: var(--text-muted); font-weight: 500; flex-shrink: 0;
}
.profile-info-val {
  font-size: 13px; font-weight: 600; color: var(--text); text-align: right;
}
.profile-info-id {
  font-family: monospace; font-size: 11px; color: var(--text-faint); font-weight: 400;
}

.profile-accordions {
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px 16px 4px;
}
.profile-details {
  border: 1.5px solid var(--border-light); border-radius: var(--radius-sm);
  overflow: hidden; background: var(--surface);
}
.profile-summary {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px; gap: 12px;
  font-size: 14px; font-weight: 600; color: var(--text);
  cursor: pointer; list-style: none; user-select: none;
  transition: background .12s;
}
.profile-summary::-webkit-details-marker { display: none; }
.profile-summary:hover { background: var(--surface-3); }
.profile-summary-left { display: flex; align-items: center; gap: 12px; }
.profile-summary-left svg { color: var(--text-muted); flex-shrink: 0; }
.profile-chevron { color: var(--text-muted); flex-shrink: 0; transition: transform .2s; }
.profile-details[open] > .profile-summary .profile-chevron { transform: rotate(180deg); }
.profile-details[open] > .profile-summary { border-bottom: 1px solid var(--border-light); }
.profile-details-body { padding: 16px; background: var(--bg); }

.profile-logout-wrap { padding: 8px 16px 18px; }
.profile-action-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1.5px solid var(--border-light);
  font-size: 14px; font-weight: 600; color: var(--text);
  cursor: pointer; transition: background .12s, border-color .12s;
  text-decoration: none; width: 100%;
}
.profile-action-btn svg { color: var(--text-muted); flex-shrink: 0; }
.profile-action-btn:hover { background: var(--surface-3); border-color: var(--border); }
.profile-action-danger { color: var(--danger); }
.profile-action-danger svg { color: var(--danger); }
.profile-action-danger:hover { background: var(--danger-bg); border-color: #5a1c1c; }
.profile-action-danger.logout-confirm {
  background: var(--danger); color: #fff; border-color: var(--danger);
  animation: pulse-danger .4s ease;
}
.profile-action-danger.logout-confirm svg { color: #fff; }
@keyframes pulse-danger {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.03); }
  100% { transform: scale(1); }
}

.pin-dots-row {
  display: flex; justify-content: center; gap: 16px; margin-bottom: 6px;
}
.pin-dot-p {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid var(--border); background: transparent; transition: all .18s;
}
.pin-dot-p.filled { background: var(--accent); border-color: var(--accent); transform: scale(1.15); }

/* ── Users — grille de cartes ────────────────────────────── */
.users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.user-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex; flex-direction: column; gap: 5px;
  box-shadow: var(--shadow);
}
.user-card-inactive { opacity: .55; }
.user-card-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 6px;
}
.user-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.user-card-badges { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.user-card-name { font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--text); }
.user-me { font-weight: 400; color: var(--text-muted); font-size: 11px; }
.user-card-info { font-size: 11px; color: var(--text-muted); }
.user-card-warn { font-size: 11px; color: var(--danger); font-weight: 600; }
.user-card-actions {
  display: flex; gap: 4px;
  margin-top: 8px; padding-top: 8px;
  border-top: 1px solid var(--border-light);
}

/* ── User role cards ──────────────────────────────────────── */
.role-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.role-option { display: contents; }
.role-option input[type="radio"] { display: none; }
.role-card {
  display: flex; flex-direction: column; gap: 3px;
  padding: 10px 12px; border-radius: 8px;
  border: 2px solid var(--border-light); background: var(--surface);
  cursor: pointer; transition: all .15s;
}
.role-card:hover { border-color: var(--border); }
.role-option input:checked + .role-card {
  border-color: var(--accent); background: var(--accent-bg);
  box-shadow: 0 0 0 1px rgba(224,96,32,.2);
}
.role-name { font-size: 13px; font-weight: 700; color: var(--text); }
.role-desc { font-size: 11px; color: var(--text-muted); }

/* ── User status toggle ───────────────────────────────────── */
.status-toggle { display: flex; gap: 8px; }
.status-opt { display: contents; }
.status-opt input[type="radio"] { display: none; }
.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 600;
  border: 2px solid var(--border-light); background: var(--surface);
  cursor: pointer; transition: all .15s; color: var(--text);
}
.status-pill:hover { border-color: var(--border); }
.status-opt input:checked + .active-pill   { border-color: var(--success); background: var(--success-bg); color: var(--success); }
.status-opt input:checked + .inactive-pill { border-color: var(--danger);  background: var(--danger-bg);  color: var(--danger); }

/* ── Utilities ────────────────────────────────────────────── */
.hidden   { display: none !important; }
.loading-center { padding: 40px; text-align: center; color: var(--text-faint); font-size: 14px; }
.empty-state    { padding: 40px; text-align: center; color: var(--text-faint); font-size: 14px; font-style: italic; }
.skeleton-grid  { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.skeleton-card  { height: 90px; border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--border-light) 25%, var(--border) 50%, var(--border-light) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── Confirm dialog ───────────────────────────────────────── */
.confirm-message { font-size: 14px; color: var(--text-muted); line-height: 1.6; margin-bottom: 0; }

/* ── Scrollbars ───────────────────────────────────────────── */
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ── Stock page — product cards ───────────────────────────── */
.stock-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 10px; margin-bottom: 16px;
}
@media (min-width: 480px) { .stock-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 768px) { .stock-grid { grid-template-columns: repeat(4, 1fr); } }

.stock-card {
  background: var(--surface); border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm); padding: 12px;
  display: flex; flex-direction: column; gap: 3px;
  min-height: 110px;
}
.stock-card.stock-low   { border-left: 3px solid var(--warn); background: var(--warn-bg); }
.stock-card.stock-empty { border-left: 3px solid var(--danger); background: var(--danger-bg); }
.stock-card-cat  {
  font-size: 9px; font-weight: 700; letter-spacing: .08em;
  color: var(--text-faint); text-transform: uppercase;
}
.stock-card-name {
  font-size: 13px; font-weight: 600; line-height: 1.3;
  color: var(--text); margin: 2px 0 2px;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.stock-card-sku { font-size: 10px; color: var(--text-faint); font-family: monospace; }
.stock-card-foot {
  margin-top: auto; padding-top: 8px;
  border-top: 1px solid var(--border-light);
  display: flex; justify-content: space-between; align-items: flex-end;
}
.stock-qty { font-size: 18px; font-weight: 700; font-family: var(--font-serif); line-height: 1; }
.stock-qty.ok   { color: var(--success); }
.stock-qty.low  { color: var(--warn); }
.stock-qty.zero { color: var(--danger); }
.stock-qty-unit { font-size: 10px; color: var(--text-faint); margin-top: 2px; }
.stock-min { font-size: 10px; color: var(--text-faint); text-align: right; line-height: 1.5; }

/* ── Stock — actions carte ───────────────────────────────── */
.stock-card-actions {
  display: flex;
  gap: 4px;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--border-light);
}
.stock-card-btn {
  flex: 1;
  padding: 4px 0;
  border: none;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1;
}
.stock-card-btn-edit {
  background: var(--surface-2);
  color: var(--text-muted);
}
.stock-card-btn-edit:hover { background: var(--border); color: var(--text); }
.stock-card-btn-del {
  background: #3b1212;
  color: #f87171;
}
.stock-card-btn-del:hover { background: #4b1a1a; }

/* ── Stock — breakdown par PDV ───────────────────────────── */
.stock-pdv-breakdown {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stock-pdv-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: var(--text-faint);
}
.stock-pdv-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stock-pdv-qty  { font-weight: 600; color: var(--text-muted); margin-left: 6px; }
.pdv-badge-p {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 3px;
  padding: 0 3px;
  margin-left: 2px;
  vertical-align: middle;
}

/* ── Stock — sticky filter bar ───────────────────────────── */
.stock-sticky-bar {
  position: sticky;
  top: var(--header-h);
  z-index: 50;
  background: var(--bg);
  margin: 0 -16px;
  padding: 8px 16px 10px;
}

/* ── Stock — history filters row ─────────────────────────── */
.search-row {
  display: flex; gap: 8px; margin-bottom: 12px; align-items: center;
}
.search-row .pos-search { flex: 1; margin: 0; }
.search-row .pos-search .search-input { height: 38px; font-size: 13px; }
.search-row .form-select-sm { height: 38px; flex-shrink: 0; }

/* ── Client detail modal ──────────────────────────────────── */
.list-item-clickable { cursor: pointer; transition: background .12s; }
.list-item-clickable:hover { background: var(--surface-3); }

.cdetail-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 12px 16px; border-bottom: 1px solid var(--border-light);
}
.cdetail-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 20px;
  background: var(--surface-3); border: 1px solid var(--border-light);
  font-size: 12px; color: var(--text-muted);
}

.cdetail-balance {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border-light);
  background: var(--warn-bg); gap: 16px;
}
.cdetail-balance.settled { background: var(--success-bg); }
.cdetail-balance-lbl {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-faint); margin-bottom: 2px;
}
.cdetail-balance-val {
  font-size: 24px; font-weight: 800; font-family: var(--font-serif);
  color: var(--warn); line-height: 1.1;
}
.cdetail-balance.settled .cdetail-balance-val { color: var(--success); }
.cdetail-mini-stats { display: flex; gap: 18px; }
.cdetail-mini-stat { text-align: right; }
.cdetail-mini-lbl { font-size: 10px; color: var(--text-faint); }
.cdetail-mini-val { font-size: 13px; font-weight: 700; font-family: var(--font-serif); color: var(--text); }
.cdetail-mini-val.pos { color: var(--success); }

.cdetail-section { padding: 14px 16px; border-bottom: 1px solid var(--border-light); }
.cdetail-section:last-child { border-bottom: none; padding-bottom: 28px; }
.cdetail-section-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-faint);
  margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between;
}
.cdetail-count {
  font-size: 11px; font-weight: 500; letter-spacing: 0; text-transform: none;
  color: var(--text-faint); background: var(--surface-3);
  padding: 1px 8px; border-radius: 10px;
}
.cdetail-empty {
  font-size: 13px; color: var(--text-faint); font-style: italic;
  text-align: center; padding: 14px 0;
}

.cdetail-pay-form { display: flex; flex-direction: column; gap: 8px; }
.cpay-amount-wrap { position: relative; }
.cpay-currency {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  font-size: 12px; font-weight: 700; color: var(--text-faint); pointer-events: none;
}
.cpay-amount-input {
  width: 100%; height: 50px; padding: 0 14px 0 48px; box-sizing: border-box;
  font-size: 24px; font-weight: 800; font-family: var(--font-serif);
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-3); color: var(--text); transition: border-color .15s;
}
.cpay-amount-input:focus { outline: none; border-color: var(--accent); }
.cpay-amount-input::placeholder { font-size: 18px; font-weight: 400; color: var(--text-faint); }
.cpay-row { display: flex; gap: 8px; }
.cpay-row .form-input-sm { flex: 1; min-width: 0; }
.form-input-sm {
  height: 36px; padding: 0 10px; font-size: 13px; box-sizing: border-box;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-3); color: var(--text); width: 100%;
}
.form-input-sm:focus { outline: none; border-color: var(--accent); }
.cdetail-pay-submit {
  width: 100%; height: 42px; border: none; border-radius: var(--radius-sm);
  background: var(--success); color: #fff; font-size: 14px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  gap: 6px; transition: opacity .15s;
}
.cdetail-pay-submit:hover:not(:disabled) { opacity: .87; }
.cdetail-pay-submit:disabled { opacity: .45; cursor: default; }

.cdetail-sale-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--border-light);
}
.cdetail-sale-row:last-child { border-bottom: none; }
.cdetail-sale-date { font-size: 11px; color: var(--text-faint); width: 62px; flex-shrink: 0; line-height: 1.4; }
.cdetail-sale-badge {
  font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 10px;
  border: 1px solid transparent; white-space: nowrap; flex-shrink: 0;
}
.cdetail-sale-badge.comptant { background: var(--success-bg); color: var(--success); border-color: var(--success); }
.cdetail-sale-badge.credit   { background: var(--warn-bg);    color: var(--warn);    border-color: var(--warn); }
.cdetail-sale-badge.other    { background: var(--surface-3); color: var(--text-muted); }
.cdetail-sale-right { text-align: right; margin-left: auto; flex-shrink: 0; }
.cdetail-sale-total { font-size: 13px; font-weight: 700; font-family: var(--font-serif); color: var(--text); }
.cdetail-sale-reste { font-size: 11px; }
.cdetail-sale-reste.ok  { color: var(--text-faint); }
.cdetail-sale-reste.due { color: var(--warn); font-weight: 600; }

.cdetail-pay-row {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 0; border-bottom: 1px solid var(--border-light);
}
.cdetail-pay-row:last-child { border-bottom: none; }
.cdetail-pay-dot {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: var(--success-bg);
  display: flex; align-items: center; justify-content: center;
}
.cdetail-pay-meta { flex: 1; min-width: 0; }
.cdetail-pay-label { font-size: 12px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cdetail-pay-date  { font-size: 11px; color: var(--text-faint); }
.cdetail-pay-amount { font-size: 15px; font-weight: 800; font-family: var(--font-serif); color: var(--success); flex-shrink: 0; }

.delivery-add-row { display: flex; gap: 6px; align-items: center; }
.delivery-add-row .form-input { height: 38px; font-size: 13px; }
.delivery-add-row .form-select { height: 38px; font-size: 13px; }
.delivery-cart-list { border: 1px solid var(--border-light); border-radius: var(--radius-sm); overflow: hidden; margin-top: 4px; }
.delivery-cart-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-bottom: 1px solid var(--border-light);
}
.delivery-cart-row:last-child { border-bottom: none; }
.delivery-cart-info { flex: 1; min-width: 0; }
.delivery-cart-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.delivery-cart-sub  { font-size: 11px; color: var(--text-faint); }
.delivery-cart-total { font-size: 13px; font-weight: 700; font-family: var(--font-serif); flex-shrink: 0; color: var(--text); }
.delivery-cart-del {
  background: none; border: none; color: var(--danger); font-size: 14px;
  cursor: pointer; padding: 2px 4px; flex-shrink: 0; line-height: 1;
}
.delivery-footer { margin-top: 6px; }
.delivery-total-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-top: 2px solid var(--border);
}
.delivery-total-val {
  font-size: 22px; font-weight: 800; font-family: var(--font-serif); color: var(--accent);
}

/* ── Supplier pay button ──────────────────────────────────── */
.btn-pay {
  font-size: 11px; font-weight: 600; padding: 3px 10px;
  background: var(--success); color: #fff; border: none;
  border-radius: 10px; cursor: pointer; white-space: nowrap;
}
.btn-pay:hover { opacity: .85; }

/* ── Dashboard ────────────────────────────────────────────── */
.dash-page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 16px;
}
.dash-role-badge {
  display: inline-block; padding: 4px 11px; border-radius: 20px;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; background: var(--surface-2); color: var(--text-muted);
  border: 1px solid var(--border); flex-shrink: 0; align-self: flex-start;
  margin-top: 6px;
}

.chart-wrap { position: relative; height: 162px; }
.chart-card-tall .chart-wrap { height: 192px; }

.donut-row { display: flex; align-items: center; gap: 14px; padding-top: 6px; }
.donut-canvas-wrap { flex-shrink: 0; width: 118px; height: 118px; position: relative; }
.donut-legend { flex: 1; display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.donut-leg-item { display: flex; align-items: center; gap: 8px; min-width: 0; }
.donut-leg-dot  { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.donut-leg-info { min-width: 0; flex: 1; }
.donut-leg-name {
  font-size: 11px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.donut-leg-val { font-size: 10px; color: var(--text-muted); }
.donut-leg-pct { color: var(--text-faint); }

.pf-success { background: var(--success) !important; }
.pf-warn    { background: var(--warn)    !important; }
.pf-danger  { background: var(--danger)  !important; }

.success-txt { color: var(--success) !important; }
.warn-txt    { color: var(--warn)    !important; }
.danger-txt  { color: var(--danger)  !important; }

/* Revendeurs */
.res-chart-wrap { padding: 8px 12px 2px; height: 130px; position: relative; }
.res-list { display: flex; flex-direction: column; gap: 12px; }
.res-item { display: flex; flex-direction: column; gap: 5px; }
.res-header {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 8px; min-width: 0;
}
.res-name {
  font-size: 13px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1;
}
.res-meta { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.res-livr { font-size: 12px; font-family: var(--font-serif); color: var(--text); }
.res-owe  {
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 20px;
  background: var(--danger-bg); color: var(--danger);
}
.res-bar-row { display: flex; align-items: center; gap: 8px; }
.res-bar-bg  { flex: 1; height: 6px; border-radius: 3px; }
.res-enc {
  font-size: 10px; font-weight: 700; width: 34px; text-align: right; flex-shrink: 0; color: var(--text-muted);
}

/* Stock par produit */
.stock-list { display: flex; flex-direction: column; gap: 14px; }
.stock-item { display: flex; flex-direction: column; gap: 5px; }
.stock-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stock-name-wrap { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.stock-name {
  font-size: 11px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stock-cat { font-size: 9px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .05em; }
.stock-qty { font-size: 10px; font-weight: 700; flex-shrink: 0; }
.stock-bar { height: 4px; border-radius: 2px; }

/* Clients à crédit */
.credit-list { display: flex; flex-direction: column; gap: 14px; }
.credit-item { display: flex; flex-direction: column; gap: 5px; }
.credit-header {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
}
.credit-name {
  font-size: 13px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1;
}
.credit-balance {
  font-size: 12px; font-weight: 700; flex-shrink: 0; color: var(--danger);
}
.credit-bar-row { display: flex; align-items: center; gap: 8px; }
.credit-bar { flex: 1; height: 6px; border-radius: 3px; }
.credit-rate {
  font-size: 10px; font-weight: 700; width: 34px; text-align: right; flex-shrink: 0; color: var(--text-muted);
}

/* Skeleton loading */
.skeleton-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.skeleton-card {
  height: 82px; border-radius: var(--radius-sm);
  background: linear-gradient(90deg, #2a1a0b 25%, #3d2514 50%, #2a1a0b 75%);
  background-size: 200% 100%; animation: sk-shimmer 1.4s infinite;
}
.skeleton-card.sk-wide  { grid-column: span 2; height: 54px; }
.skeleton-card.sk-chart { grid-column: span 2; height: 180px; }
@keyframes sk-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Theme toggle icons ───────────────────────────────────── */
.icon-moon { display: none; }
[data-theme="light"] .icon-sun  { display: none; }
[data-theme="light"] .icon-moon { display: block; }

/* ── Light theme ──────────────────────────────────────────── */
[data-theme="light"] {
  --bg:          #f0e9df;
  --surface:     #ffffff;
  --surface-2:   #fdf8f3;
  --surface-3:   #f5ede3;
  --border:      #d9d0c5;
  --border-light:#e6ddd3;
  --text:        #1c1917;
  --text-muted:  #78716c;
  --text-faint:  #a8a29e;
  --accent:      #e06020;
  --accent-bg:   #fff7ed;
  --accent-dark: #b54808;
  --success:     #059669;
  --success-bg:  #ecfdf5;
  --danger:      #dc2626;
  --danger-bg:   #fef2f2;
  --warn:        #ea580c;
  --warn-bg:     #fffbeb;
  --stone-dark:  #1c1917;
  --shadow:      0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-lg:   0 10px 40px rgba(0,0,0,.14);
}

/* Light — overrides for hardcoded dark colors */
[data-theme="light"] .app-header { background: #ffffff; border-bottom-color: var(--border); box-shadow: 0 2px 20px rgba(0,0,0,.09); }
[data-theme="light"] .bottom-nav { background: #fdf8f3; box-shadow: 0 -2px 0 var(--border-light), 0 -8px 32px rgba(90,55,10,.11); }
[data-theme="light"] .nav-item { color: #7a6f66; }
[data-theme="light"] .nav-item.active::before { background: rgba(224,96,32,.13); }
[data-theme="light"] .drawer { background: #ffffff; border-top-color: var(--border-light); }
[data-theme="light"] .drawer-item:hover, [data-theme="light"] .drawer-item:active { background: var(--bg); }
[data-theme="light"] .modal-sheet { background: #ffffff; border-top-color: var(--border-light); }
[data-theme="light"] .modal-header { background: #ffffff; }
[data-theme="light"] .modal-close:hover { background: var(--bg); }
[data-theme="light"] .profile-topbar { background: #ffffff; }
[data-theme="light"] .profile-back { background: var(--bg); color: var(--text-muted); }
[data-theme="light"] .profile-back:hover { background: var(--border-light); color: var(--text); }
[data-theme="light"] .profile-hero { background: linear-gradient(150deg, #1c1917 0%, #3d2308 100%); }
[data-theme="light"] .profile-hero-role { background: rgba(255,255,255,.13); color: rgba(255,255,255,.8); border: none; }
[data-theme="light"] .profile-details { background: #ffffff; }
[data-theme="light"] .profile-summary:hover { background: var(--bg); }
[data-theme="light"] .profile-details-body { background: var(--bg); }
[data-theme="light"] .profile-action-btn { background: #ffffff; }
[data-theme="light"] .profile-action-btn:hover { background: var(--bg); border-color: var(--border); }
[data-theme="light"] .profile-action-danger:hover { background: var(--danger-bg); border-color: #fecaca; }
[data-theme="light"] .profile-action-danger.logout-confirm { background: var(--danger); color: #fff; border-color: var(--danger); }
[data-theme="light"] .btn-primary { background: #1c1917; color: #fff; }
[data-theme="light"] .btn-primary:hover:not(:disabled) { background: #292524; }
[data-theme="light"] .btn-secondary { background: #ffffff; }
[data-theme="light"] .btn-ghost:hover { background: var(--bg); }
[data-theme="light"] .btn-icon-sm { background: var(--bg); }
[data-theme="light"] .btn-icon-sm:hover { background: var(--border-light); }
[data-theme="light"] .btn-back { background: #1c1917; color: #fff; border: none; }
[data-theme="light"] .btn-back:hover { background: #292524; }
[data-theme="light"] .btn-profile-info { background: var(--bg); }
[data-theme="light"] .btn-profile-info:hover { background: var(--border-light); }
[data-theme="light"] .form-input, [data-theme="light"] .form-select { background: #ffffff; }
[data-theme="light"] .form-input-sm { background: #ffffff; }
[data-theme="light"] .cpay-amount-input { background: #ffffff; }
[data-theme="light"] .search-input { background: #ffffff; }
[data-theme="light"] .card { background: #ffffff; }
[data-theme="light"] .card-warn { border-color: #fde68a; background: #fffbeb; }
[data-theme="light"] .kpi-section { background: #ffffff; }
[data-theme="light"] .kpi-card { background: #ffffff; }
[data-theme="light"] .chart-card { background: #ffffff; }
[data-theme="light"] .table-card { background: #ffffff; }
[data-theme="light"] .list-items { background: #ffffff; }
[data-theme="light"] .list-item.clickable:hover { background: var(--bg); }
[data-theme="light"] .list-item-clickable:hover { background: var(--bg); }
[data-theme="light"] .filter-tabs { background: var(--border-light); }
[data-theme="light"] .tab.active { background: #ffffff; }
[data-theme="light"] .pos-cart { background: #ffffff; }
[data-theme="light"] .cart-item { background: var(--bg); }
[data-theme="light"] .cart-qty-ctrl { background: #ffffff; }
[data-theme="light"] .cart-qty-input { background: transparent; color: var(--text); }
[data-theme="light"] .cart-item-price { background: #ffffff; color: var(--text); }
[data-theme="light"] .cart-footer { background: #1c1917; }
[data-theme="light"] .product-card { background: #ffffff; }
[data-theme="light"] .product-card:hover:not(:disabled) { border-color: #fcd34d; }
[data-theme="light"] .receipt-items { background: #ffffff; }
[data-theme="light"] .receipt-header { background: #1c1917; border-bottom: none; }
[data-theme="light"] .receipt-total-bar { background: #1c1917; border-top: none; }
[data-theme="light"] .receipt-summary { background: var(--bg); }
[data-theme="light"] .role-card { background: #ffffff; }
[data-theme="light"] .role-option input:checked + .role-card { background: #fffbeb; }
[data-theme="light"] .status-pill { background: #ffffff; color: var(--text); }
[data-theme="light"] .stock-card { background: #ffffff; }
[data-theme="light"] .stock-card.stock-low   { background: var(--warn-bg); }
[data-theme="light"] .stock-card.stock-empty { background: var(--danger-bg); }
[data-theme="light"] .stock-card-btn-edit { background: var(--bg); color: var(--text-muted); }
[data-theme="light"] .stock-card-btn-edit:hover { background: var(--border-light); }
[data-theme="light"] .user-card { background: #ffffff; }
[data-theme="light"] .cdetail-chip { background: var(--bg); }
[data-theme="light"] .key { background: #ffffff; border-color: var(--border); color: var(--text); }
[data-theme="light"] .key:not([disabled]):active { background: var(--border-light); }
[data-theme="light"] .pc-chip { background: #ffffff; }
[data-theme="light"] .toast { background: #1c1917; color: #fff; border-color: rgba(255,255,255,.08); }
[data-theme="light"] .toast-close { color: rgba(255,255,255,.4); }
[data-theme="light"] .toast-close:hover { color: #fff; }
[data-theme="light"] .skeleton-card {
  background: linear-gradient(90deg, #ede7de 25%, #e2d9cc 50%, #ede7de 75%);
  background-size: 200% 100%;
}
[data-theme="light"] .mode-btn.active { background: var(--accent); color: #fff; }
[data-theme="light"] .amount-summary { background: var(--bg); border-color: var(--border-light); }
[data-theme="light"] .login-body { background: #f0e9df; }
[data-theme="light"] .ls1-icon { box-shadow: 0 6px 20px rgba(0,0,0,.14); }
[data-theme="light"] .ls2-avatar { box-shadow: 0 4px 20px rgba(224,96,32,.25); }
[data-theme="light"] .install-platform-btn { background: #ffffff; }
[data-theme="light"] .install-platform-btn:hover { background: var(--bg); }
