:root {
  --sand: #f2e8d8;
  --cream: #fffaf2;
  --ink: #1f180d;
  --mocha: #45301b;
  --gold: #d89b2b;
  --green: #1e9e69;
  --red: #d34e3f;
  --panel: rgba(35, 22, 8, 0.82);
  --line: rgba(255, 240, 214, 0.1);
  --muted: #d6c0a0;
  --shadow: 0 24px 70px rgba(8, 5, 1, 0.35);
  --radius-lg: 28px;
  --radius-md: 18px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }

body {
  color: var(--cream);
  font-family: "DM Sans", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(216, 155, 43, 0.24), transparent 30%),
    radial-gradient(circle at 85% 15%, rgba(77, 125, 224, 0.18), transparent 24%),
    linear-gradient(145deg, #110b04 0%, #241507 40%, #120d07 100%);
  overflow-x: hidden;
}

button, input, select { font: inherit; }
textarea { font: inherit; }
.hidden { display: none !important; }

.noscript-warning {
  position: fixed;
  inset: 18px;
  z-index: 1000;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
  border-radius: 18px;
  color: var(--cream);
  background: #140d07;
  border: 1px solid rgba(255, 202, 105, 0.35);
}

.app-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.2;
}

.eyebrow {
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-panel {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr 0.95fr;
  gap: 22px;
  align-items: stretch;
}

.auth-brand,
.auth-preview,
.auth-form,
.hero-card,
.card,
.kpi,
.modal {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(53, 35, 15, 0.92), rgba(21, 13, 6, 0.94));
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.auth-brand,
.auth-preview,
.auth-form { border-radius: var(--radius-lg); padding: 32px; }

.auth-brand {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 460px;
}

.auth-brand h1 {
  margin-top: 12px;
  font-family: "Syne", sans-serif;
  font-size: clamp(2.1rem, 4vw, 4rem);
  line-height: 0.95;
}

.auth-copy {
  margin-top: 16px;
  max-width: 28rem;
  color: #f3e4ca;
  line-height: 1.6;
}

.auth-logo {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  font-family: "Syne", sans-serif;
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--ink);
  background: linear-gradient(145deg, #ffca69, #d89b2b);
  border-radius: 24px;
}

.auth-preview { display: flex; align-items: end; }

.preview-card {
  width: 100%;
  padding: 24px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent),
    linear-gradient(145deg, rgba(64, 105, 208, 0.2), rgba(216, 155, 43, 0.14));
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.preview-card h2 {
  margin-top: 12px;
  font-family: "Syne", sans-serif;
  font-size: 1.8rem;
  line-height: 1.15;
}

.preview-list {
  margin-top: 20px;
  list-style: none;
  display: grid;
  gap: 12px;
}

.preview-list li {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(8, 5, 1, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.auth-form {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

.auth-form label,
.form-group label { font-size: 0.86rem; color: var(--muted); }
.form-hint {
  margin: 8px 0 0;
  color: #ffca69;
  font-size: 0.82rem;
}

.auth-form input,
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 250, 242, 0.06);
  color: var(--cream);
  padding: 14px 15px;
  border-radius: 14px;
  outline: none;
}

.form-group input[readonly] {
  cursor: not-allowed;
  color: #ffca69;
  border-color: rgba(255, 202, 105, 0.35);
}

.auth-form input:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: rgba(216, 155, 43, 0.8);
  box-shadow: 0 0 0 3px rgba(216, 155, 43, 0.12);
}

.auth-form select,
.form-group select,
.site-switcher {
  appearance: auto;
  -webkit-appearance: menulist;
  -moz-appearance: auto;
  background-image: none;
  padding-right: 14px;
}

.auth-form select option,
.form-group select option,
.site-switcher option {
  color: var(--ink);
  background: #fff7ec;
}

.auth-hint,
.auth-error,
.muted,
.bar-name,
.top-date,
.section-meta,
.kpi-foot,
.empty-copy,
.list-item-sub,
.list-item-date { color: var(--muted); }

.auth-error { min-height: 1.2rem; color: #ffb9ac; }

.btn {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 14px 18px;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.btn:hover, .icon-btn:hover, .nav-btn:hover, .fab:hover { transform: translateY(-1px); }

.btn-primary {
  color: var(--ink);
  font-weight: 700;
  background: linear-gradient(145deg, #ffca69, #d89b2b);
}

.btn-outline {
  color: var(--cream);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-danger {
  color: #fff3ef;
  background: linear-gradient(145deg, #c54f41, #983428);
}

/* ── Shell layout ───────────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
  width: 220px;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 28px 14px;
  background: rgba(14, 8, 2, 0.96);
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

.sidebar-brand { padding: 0 6px; }
.sidebar-logo {
  font-family: "Syne", sans-serif;
  font-size: 1.35rem;
  margin: 4px 0 2px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.sidebar-session {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
}

.sidebar-username {
  font-size: 0.88rem;
  color: var(--cream);
}

.sidebar-logout {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--muted);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 0.82rem;
  cursor: pointer;
  text-align: left;
  transition: color 0.15s, border-color 0.15s;
}
.sidebar-logout:hover { color: var(--cream); border-color: rgba(255,255,255,0.3); }

/* ── Nav buttons (sidebar) ───────────────────────────────────── */
.nav-btn {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 11px 13px;
  font-size: 0.91rem;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.nav-btn:hover { background: rgba(255,202,105,0.07); color: var(--cream); }
.nav-btn.active {
  background: linear-gradient(145deg, rgba(255,202,105,0.16), rgba(216,155,43,0.10));
  color: #ffca69;
  font-weight: 700;
  border-color: rgba(255,202,105,0.22);
}
.nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.75;
}
.nav-btn.active .nav-icon { opacity: 1; }

/* ── Main wrapper ────────────────────────────────────────────── */
.main-wrapper {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(14, 8, 2, 0.6);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-context h3 {
  font-family: "Syne", sans-serif;
  font-size: 1.05rem;
  margin: 3px 0;
}

.topbar h2,
.hero-card h3,
.section-head h3,
.spotlight-value,
.modal h3,
.kpi-value { font-family: "Syne", sans-serif; }

.topbar-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.site-switcher {
  min-width: 160px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--cream);
  border-radius: 999px;
  padding: 8px 14px;
}

.icon-btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--cream);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
}

.main-shell {
  flex: 1;
  padding: 28px 28px 40px;
}

/* hero-card kept for any legacy reference, now invisible */
.hero-card { display: none; }
.hero-copy { color: var(--muted); font-size: 0.85rem; margin-top: 2px; }

.hero-badge {
  min-width: 160px;
  align-self: start;
  border-radius: 18px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-badge-label { display: block; margin-bottom: 8px; color: var(--muted); }
.page { display: none; }
.page.active { display: block; }

.kpi-grid,
.dashboard-grid,
.form-grid { display: grid; gap: 14px; }

.kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 18px; }
.dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 16px; }
.form-grid.two-cols { margin-top: 0; }
.form-grid.three-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.four-cols { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.kpi,
.card { border-radius: var(--radius-md); padding: 18px; }

.kpi-value { font-size: clamp(1.55rem, 2vw, 2rem); margin-top: 6px; }
.kpi-value.amber { color: #ffca69; }
.kpi-value.red { color: #ff8e82; }
.kpi-value.green { color: #72d7a9; }

.spotlight-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent),
    linear-gradient(145deg, rgba(216, 155, 43, 0.16), rgba(42, 26, 10, 0.95));
}

.card-head,
.section-head,
.list-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.section-head { margin-bottom: 14px; }
.spotlight-value { margin-top: 8px; font-size: 2rem; }

.progress-bar,
.cat-bar {
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.progress-bar { height: 10px; margin-top: 16px; }

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffca69, #d89b2b);
  transition: width 0.35s ease;
}

.cat-row {
  display: grid;
  grid-template-columns: auto 1fr minmax(70px, 1.4fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.cat-dot { width: 12px; height: 12px; border-radius: 999px; }
.cat-bar { height: 8px; }
.cat-fill { height: 100%; border-radius: inherit; }

.tabs {
  display: flex;
  gap: 10px;
  overflow: auto;
  margin-bottom: 16px;
  padding-bottom: 4px;
}

.tab {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: pointer;
}

.tab.active {
  color: var(--ink);
  background: linear-gradient(145deg, #ffca69, #d89b2b);
  border-color: transparent;
}

.page-subtabs {
  margin-bottom: 20px;
  padding: 4px 0;
}

.list-item {
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 10px;
}

.order-card {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 12px;
}

.order-card.active {
  border-color: rgba(255, 202, 105, 0.7);
  box-shadow: 0 0 0 2px rgba(255, 202, 105, 0.28), 0 0 28px rgba(216, 155, 43, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.05);
}

.order-card.order-card-new {
  border-color: rgba(211, 78, 63, 0.9);
  animation: qrPulse 1s ease-in-out 6;
}

@keyframes qrPulse {
  0%, 100% {
    transform: translateY(0);
    box-shadow: 0 0 0 1px rgba(211, 78, 63, 0.18);
  }
  50% {
    transform: translateY(-2px);
    box-shadow: 0 0 0 2px rgba(211, 78, 63, 0.42), 0 0 24px rgba(211, 78, 63, 0.28);
  }
}

.order-lines {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.order-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.order-actions,
.line-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mini-btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--cream);
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
}

.order-total {
  font-family: "Syne", sans-serif;
  font-size: 1.15rem;
  color: #ffca69;
}

.list-item-title { font-weight: 700; }
.list-item-amount { font-family: "Syne", sans-serif; font-weight: 700; color: #ffca69; }
.list-side { display: flex; align-items: center; gap: 10px; }

.customer-order-lines {
  margin-top: 8px;
  display: grid;
  gap: 5px;
  min-width: 220px;
}

.customer-order-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--cream);
  font-size: 0.9rem;
}
.del-btn { border: none; background: transparent; color: #ff8e82; cursor: pointer; }

.badge {
  display: inline-block;
  margin-top: 8px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.72rem;
}

.badge-green { background: rgba(114, 215, 169, 0.15); color: #72d7a9; }
.badge-red { background: rgba(255, 142, 130, 0.16); color: #ffb0a7; }
.badge-amber { background: rgba(255, 202, 105, 0.16); color: #ffcf79; }

.qr-alert-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff5ef;
  background: linear-gradient(145deg, #d34e3f, #a93328);
  box-shadow: 0 10px 22px rgba(211, 78, 63, 0.22);
}

.empty-state {
  padding: 30px 18px;
  border-radius: 18px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.button-stack { display: grid; gap: 10px; margin-top: 18px; }

.stack-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.site-row,
.checkbox-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.checkbox-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
}

.compact-head {
  align-items: flex-end;
  margin-bottom: 8px;
}

.sale-formats-list {
  display: grid;
  gap: 8px;
}

.sale-format-row {
  display: grid;
  grid-template-columns: minmax(92px, 0.7fr) 1fr 1fr auto;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid rgba(255, 202, 105, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.sale-format-row label {
  margin-bottom: 4px;
}

@media (max-width: 720px) {
  .sale-format-row {
    grid-template-columns: 1fr;
  }
}

.manager-only.hidden-by-role,
.admin-only.hidden-by-role {
  display: none !important;
}

/* Bottom nav : masquee sur desktop, visible sur mobile */
.bottom-nav {
  display: none;
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  width: min(860px, calc(100% - 16px));
  gap: 6px;
  padding: 10px;
  border-radius: 22px;
  background: rgba(19, 12, 6, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  z-index: 20;
  overflow-x: auto;
  scrollbar-width: none;
}
.bottom-nav::-webkit-scrollbar { display: none; }

.fab {
  position: fixed;
  right: 28px;
  bottom: 28px;
  width: 58px;
  height: 58px;
  border: none;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--ink);
  font-size: 1.9rem;
  background: linear-gradient(145deg, #ffca69, #d89b2b);
  box-shadow: 0 16px 36px rgba(216, 155, 43, 0.28);
  cursor: pointer;
  z-index: 30;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  background: rgba(7, 4, 1, 0.72);
  padding: 20px;
  overflow-y: auto;
}

.modal-overlay.open { display: flex; }

.modal {
  width: min(560px, 100%);
  margin: 0 auto;
  border-radius: 28px;
  padding: 18px 18px 24px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.modal-handle {
  width: 52px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  margin: 0 auto 14px;
}

.inline-card {
  border-radius: 16px;
  padding: 14px 16px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  transform: translateX(-50%);
  border-radius: 999px;
  padding: 12px 18px;
  background: rgba(27, 120, 83, 0.95);
  color: white;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.toast.show { opacity: 1; }

.qr-card-preview {
  margin-top: 18px;
}

.qr-table-list {
  display: grid;
  gap: 16px;
}

.qr-table-card {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.qr-two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.qr-location-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.qr-location-header {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 4px 0;
}

.qr-card-box,
.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.qr-card-box img {
  width: 120px;
  height: 120px;
  border-radius: 12px;
  background: white;
  object-fit: cover;
  flex-shrink: 0;
}

.menu-item { flex-wrap: wrap; }

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

.menu-pack-tag {
  display: inline-flex;
  margin-top: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 202, 105, 0.14);
  color: #ffca69;
  font-size: 0.76rem;
  font-weight: 700;
}

.menu-qty-ctrl {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.qty-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08);
  color: var(--fg);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.qty-btn:hover { background: rgba(255,255,255,0.16); }

.qty-input {
  width: 52px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  color: var(--fg);
  font-size: 1rem;
  font-weight: 700;
  padding: 6px 4px;
}

.qty-input::-webkit-inner-spin-button,
.qty-input::-webkit-outer-spin-button { opacity: 0; }

.menu-category { display: grid; gap: 8px; margin-bottom: 12px; }

.menu-cat-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding: 6px 0 2px;
}

.cart-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 0.9rem;
}

.qr-link {
  color: #ffca69;
  text-decoration: none;
  word-break: break-all;
}

.customer-menu {
  display: grid;
  gap: 10px;
}

.order-shell {
  width: min(780px, 100%);
  margin: 0 auto;
  padding: 22px 16px 42px;
}

.order-hero {
  margin-bottom: 18px;
  padding: 24px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at top right, rgba(255, 202, 105, 0.22), transparent 30%),
    linear-gradient(160deg, rgba(44, 30, 12, 0.92), rgba(16, 10, 5, 0.95));
  box-shadow: var(--shadow);
}

.pdj-card {
  margin-bottom: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent),
    linear-gradient(145deg, rgba(216, 155, 43, 0.12), rgba(42, 26, 10, 0.95));
}

.pdj-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 14px 0;
}

.pdj-kpi {
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.pdj-val {
  display: block;
  font-family: "Syne", sans-serif;
  font-size: 1.3rem;
  margin-top: 6px;
}

.pdj-val.amber { color: #ffca69; }
.pdj-val.red { color: #ff8e82; }

.pdj-detail-head { margin-top: 18px; margin-bottom: 10px; }
.pdj-detail-title { font-size: 1rem; }

.stock-kpi-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.stock-kpi {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  text-align: center;
}

.red-kpi { background: rgba(211, 78, 63, 0.08); border-color: rgba(211, 78, 63, 0.2); }
.green-kpi { background: rgba(30, 158, 105, 0.08); border-color: rgba(30, 158, 105, 0.2); }
.orange-kpi { background: rgba(216, 155, 43, 0.08); border-color: rgba(216, 155, 43, 0.2); }

.stock-kpi-label {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.stock-kpi-val {
  display: block;
  font-family: "Syne", sans-serif;
  font-size: 1.3rem;
}

.stock-kpi-val.amber { color: #ffca69; }
.stock-kpi-val.red { color: #ff8e82; }
.stock-kpi-val.green { color: #72d7a9; }

.stock-table-wrap { overflow-x: auto; margin-top: 4px; }

.stock-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  min-width: 860px;
}

.stock-table th,
.stock-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  white-space: nowrap;
}

.stock-table thead tr { background: rgba(255, 255, 255, 0.06); }

.stock-table th {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.th-orange { color: #ffca69 !important; }
.th-blue { color: #77bbff !important; }

.stock-check-input {
  width: 110px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 250, 242, 0.06);
  color: var(--cream);
  padding: 9px 10px;
  border-radius: 10px;
  outline: none;
}

.stock-table tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
.stock-row-alert { background: rgba(211, 78, 63, 0.05) !important; }

.stock-reappro-btn {
  background: rgba(211, 78, 63, 0.15);
  border: 1px solid rgba(211, 78, 63, 0.35);
  color: #ff8e82;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.stock-reappro-btn:hover { background: rgba(211, 78, 63, 0.28); }

.stock-ok-badge { color: #72d7a9; font-weight: 700; font-size: 0.82rem; }

.stock-del-btn {
  background: none;
  border: none;
  color: #ff8e82;
  cursor: pointer;
  padding: 4px 6px;
  font-size: 0.8rem;
}

.stock-actions-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .stock-kpi-bar { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1024px) {
  .auth-panel,
  .dashboard-grid,
  .kpi-grid,
  .form-grid { grid-template-columns: 1fr; }
  .form-grid.four-cols,
  .form-grid.three-cols { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: flex-start; }
}

/* Mobile : sidebar cachee, bottom-nav visible */
@media (max-width: 768px) {
  .app-shell { flex-direction: column; }
  .sidebar { display: none; }
  .main-wrapper { width: 100%; }
  .main-shell { padding: 16px 14px 110px; }
  .topbar { padding: 14px 16px; position: static; }

  .bottom-nav {
    display: flex;
    width: calc(100% - 16px);
    bottom: 10px;
    gap: 4px;
    padding: 8px;
    border-radius: 18px;
  }
  .nav-btn {
    flex: 1 0 auto;
    justify-content: center;
    gap: 0;
    padding: 10px 8px;
    font-size: 0.78rem;
    border-radius: 12px;
    flex-direction: column;
  }
  .nav-icon { display: none; }
  .fab { right: 16px; bottom: 90px; }
}

@media (max-width: 720px) {
  .pdj-kpis { grid-template-columns: 1fr 1fr; }
  .auth-brand,
  .auth-preview,
  .auth-form,
  .kpi,
  .card,
  .modal { padding: 18px; }
  .modal-overlay { padding: 10px; }
  .modal { max-height: calc(100vh - 20px); }
  .qr-two-cols { grid-template-columns: 1fr; }
  .qr-card-box { flex-direction: column; align-items: flex-start; }
  .qr-card-box img { width: 100%; max-width: 220px; height: auto; }
}
