:root {
  --bg: #0f1419;
  --bg-elevated: #1a222c;
  --bg-soft: #243040;
  --surface: #ffffff;
  --surface-soft: #f5f7f9;
  --ink: #121820;
  --ink-muted: #5a6775;
  --accent: #b51f2e;
  --accent-dark: #8e1622;
  --accent-soft: rgba(181, 31, 46, 0.1);
  --brass: #c9a227;
  --brass-soft: rgba(201, 162, 39, 0.16);
  --ok: #1f7a55;
  --warn: #b7791f;
  --danger: #b51f2e;
  --border: #e2e8ee;
  --shadow-sm: 0 1px 2px rgba(15, 20, 25, 0.04);
  --shadow-md: 0 10px 30px rgba(15, 20, 25, 0.07);
  --shadow-lg: 0 18px 48px rgba(15, 20, 25, 0.12);
  --radius: 14px;
  --radius-sm: 10px;
  --nav-height: 64px;
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;
  --gold: var(--brass);
}

* { box-sizing: border-box; }

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: #faf6f0;
  color: var(--ink);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

body:has(.app-shell) {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.app-shell {
  display: grid;
  grid-template-columns: minmax(200px, 252px) minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  width: 100%;
  max-width: 100vw;
}

.sidebar {
  background:
    linear-gradient(185deg, #141b24 0%, #0f1419 55%, #161016 100%);
  color: #f3eee8;
  padding: 1.35rem 0.95rem 1.1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: inset -1px 0 0 rgba(201, 162, 39, 0.08);
  overflow: hidden;
}

.brand {
  padding: 0.55rem 0.75rem 1rem;
  position: relative;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
}

.brand::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background:
    radial-gradient(ellipse 90% 70% at 50% 0%, rgba(201, 162, 39, 0.14), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 70%);
  border: 1px solid rgba(201, 162, 39, 0.18);
  pointer-events: none;
}

.brand-logo {
  position: relative;
  z-index: 1;
  width: clamp(72px, 12vh, 128px);
  height: auto;
  max-width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 14px;
  display: block;
  margin: 0 auto;
  background: #f4efe6;
  padding: 0;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

.brand-logo-lg {
  width: clamp(96px, 22vw, 168px);
  border-radius: 18px;
  margin-bottom: 0.85rem;
}

.brand-eyebrow,
.brand-name,
.brand-tagline {
  position: relative;
  z-index: 1;
}

.brand-eyebrow {
  display: block;
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(201, 162, 39, 0.85);
  margin-bottom: 0.45rem;
}

.brand-name {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 1.9vw, 1.85rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.05;
  color: #fff8ef;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
  background: linear-gradient(180deg, #fffdf8 10%, #f0d78a 55%, #c9a227 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
}

.brand-tagline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-family: var(--font-body);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #cbb8a6;
  margin: 0.7rem 0 0;
}

.brand-tagline::before,
.brand-tagline::after {
  content: "";
  width: 1.35rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 162, 39, 0.7), transparent);
}

.login-brand {
  text-align: center;
  margin-bottom: 0.35rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(201, 162, 39, 0.22);
}

.login-brand .brand-eyebrow {
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.login-brand .brand-name {
  font-size: clamp(2rem, 5vw, 2.55rem);
  letter-spacing: 0.05em;
  background: linear-gradient(180deg, #1a1410 0%, #8e1622 55%, #c9a227 120%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
}

.login-brand .brand-tagline {
  color: var(--ink-muted);
  margin-top: 0.55rem;
}

.login-brand .brand-tagline::before,
.login-brand .brand-tagline::after {
  background: linear-gradient(90deg, transparent, rgba(181, 31, 46, 0.45), transparent);
}

.login-card .subtitle {
  color: var(--ink-muted);
  margin: 1.15rem 0 1.5rem;
  font-weight: 500;
  text-align: center;
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
  overflow: auto;
  padding: 0 0.2rem;
}

.nav-links a {
  color: #c5ced8;
  text-decoration: none;
  padding: 0.68rem 0.9rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.92rem;
  transition: background 0.18s ease, color 0.18s ease, transform 0.15s ease;
  border: 1px solid transparent;
}

.nav-links a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  text-decoration: none;
}

.nav-links a.active {
  background: linear-gradient(135deg, rgba(181, 31, 46, 0.28), rgba(201, 162, 39, 0.12));
  color: #fff;
  border-color: rgba(181, 31, 46, 0.28);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  text-decoration: none;
}

.sidebar-user {
  padding: 0.95rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.88rem;
  color: #9aa7b5;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
}

.sidebar-user strong {
  color: #fff;
  display: block;
  font-size: 0.95rem;
}

.main {
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  padding: clamp(0.85rem, 1.8vw, 1.65rem) clamp(0.9rem, 2.2vw, 2.1rem) clamp(1.25rem, 2.5vw, 2.75rem);
  background: #faf6f0;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.45rem;
  flex-wrap: wrap;
}

.page-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 2.5vw, 2.45rem);
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.page-header p {
  margin: 0.3rem 0 0;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.3rem 1.35rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.panel h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 0.85rem;
  letter-spacing: -0.01em;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
  gap: 0.95rem;
  margin-bottom: 1.25rem;
}

.kpi-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.kpi-grid-store {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.sales-kpis {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: min(640px, 100%);
}

.kpi {
  background:
    linear-gradient(155deg, #1a222c 0%, #121820 60%, #1b1418 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.kpi::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--brass), transparent);
}

.kpi .label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brass);
  margin-bottom: 0.4rem;
  font-weight: 700;
}

.kpi .value {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.2vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  word-break: break-word;
}

.kpi .value small {
  font-size: 0.4em;
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: 0.02em;
  opacity: 0.85;
}

.kpi-delta {
  margin-top: 0.45rem;
  font-size: 0.78rem;
  color: #9aa7b5;
  font-weight: 600;
}

.kpi-delta.is-up { color: #6dcea0; }
.kpi-delta.is-down { color: #f0a0a0; }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.panel-head h2 {
  margin: 0;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid #e2e8ee;
  background: #fff;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.93rem;
  min-width: 640px;
}

.table th,
.table td {
  padding: 1rem 1.15rem;
  text-align: left;
  vertical-align: middle;
}

.table th {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #c9d2dc;
  font-weight: 800;
  background: linear-gradient(165deg, #1a222c 0%, #121820 100%);
  border-bottom: none;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

.table thead th:first-child { border-radius: 13px 0 0 0; }
.table thead th:last-child { border-radius: 0 13px 0 0; }

.table tbody td {
  border-bottom: 1px solid #eef1f4;
  color: var(--ink);
  background: #fff;
}

.table tbody tr:nth-child(even) td {
  background: #fafbfc;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody tr {
  transition: background 0.15s ease;
}

.table tbody tr:hover td {
  background: #fff6f4;
}

.table tbody tr:hover td:first-child {
  box-shadow: inset 3px 0 0 var(--accent);
}

.table a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
}

.table a:hover {
  color: var(--accent-dark);
  text-decoration: none;
}

.table .num,
.table td.num,
.table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.table td.num {
  font-weight: 700;
  font-family: var(--font-body);
}

.table .col-actions {
  text-align: right;
  white-space: nowrap;
}

.table .btn-row {
  padding: 0.4rem 0.8rem;
  font-size: 0.76rem;
  border-radius: 999px;
  border: 1px solid #dce3ea;
  background: #fff;
  color: var(--ink);
}

.table .btn-row:hover {
  border-color: rgba(181, 31, 46, 0.35);
  background: var(--accent-soft);
  color: var(--accent-dark);
  text-decoration: none;
}

.table .empty-cell {
  text-align: center;
  padding: 3rem 1.25rem;
  color: var(--ink-muted);
  font-style: italic;
  background: #fafbfc !important;
  box-shadow: none !important;
}

.list-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.list-toolbar .search-bar {
  display: flex;
  flex: 1;
  gap: 0.5rem;
  align-items: center;
  min-width: min(100%, 280px);
  max-width: 440px;
}

.list-toolbar .search-bar .form-control {
  flex: 1;
  border-radius: 999px;
  padding-left: 1rem;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.filter-chips .btn {
  border-radius: 999px;
  padding: 0.42rem 0.9rem;
  font-size: 0.82rem;
}

.panel-table {
  padding: 1.2rem 1.25rem 1.15rem;
  background: #fff;
  border: 1px solid #e4eaef;
  box-shadow: 0 10px 32px rgba(15, 20, 25, 0.05);
  border-radius: 18px;
}

.panel-table .panel-head {
  margin-bottom: 1rem;
}

.panel-table .panel-head h2 {
  font-size: 1.2rem;
}

.cell-primary {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.cell-primary strong {
  font-weight: 700;
  letter-spacing: -0.01em;
}

.cell-primary .muted {
  font-size: 0.76rem;
  color: var(--ink-muted);
  font-weight: 500;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.02em;
}

.cell-entity {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cell-avatar {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
  background: linear-gradient(145deg, #1a222c, #121820);
  text-transform: uppercase;
}

.cell-avatar.is-accent {
  background: linear-gradient(145deg, #8e1622, #b51f2e);
}

.cell-avatar.is-brass {
  background: linear-gradient(145deg, #9a7a1c, #c9a227);
  color: #1a1410;
}

.cell-thumb {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--border);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  background: #eef2f6;
  color: #44505c;
  white-space: nowrap;
}

.sales-amount {
  color: var(--accent-dark);
  font-size: 1rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.badge-ok { background: #e4f6ee; color: #176b4a; }
.badge-warn { background: #f5e6a8; color: #7a6208; }
.badge-danger { background: #f0d0d4; color: #6e101c; }
.badge-muted { background: #eef1f4; color: #5a6775; }

.settings-page {
  max-width: min(1100px, 100%);
  width: 100%;
  min-width: 0;
}

.settings-hero {
  margin-bottom: 1.4rem;
}

.settings-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 2.6vw, 2.55rem);
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.settings-hero p:last-child {
  margin: 0.4rem 0 0;
  color: var(--ink-muted);
  font-size: 0.98rem;
}

.settings-btn-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.95rem;
}

.settings-big-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
  min-height: 240px;
  padding: 1.35rem 1.25rem 1.2rem;
  border-radius: 16px;
  text-decoration: none;
  color: var(--ink);
  background: #fff;
  border: 1px solid #e4eaef;
  box-shadow: 0 8px 24px rgba(15, 20, 25, 0.05);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
  cursor: pointer;
}

.settings-big-btn:hover {
  text-decoration: none;
  color: var(--ink);
  border-color: rgba(181, 31, 46, 0.28);
  box-shadow: 0 14px 34px rgba(15, 20, 25, 0.1);
  transform: translateY(-2px);
}

.settings-big-btn-icon {
  width: 3.35rem;
  height: 3.35rem;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(155deg, #1a222c 0%, #121820 70%);
  margin-bottom: 0.25rem;
}

.settings-big-btn-icon.is-accent {
  background: linear-gradient(145deg, #8e1622, #b51f2e);
}

.settings-big-btn-icon.is-brass {
  background: linear-gradient(145deg, #9a7a1c, #c9a227);
  color: #1a1410;
}

.settings-big-btn strong {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.settings-big-btn-desc {
  color: var(--ink-muted);
  font-size: 0.9rem;
  line-height: 1.4;
  flex: 1;
}

.settings-big-btn-count {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1;
  color: var(--accent-dark);
  margin-top: 0.35rem;
}

.settings-big-btn-go {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent);
}

.settings-big-btn:hover .settings-big-btn-go {
  background: var(--accent-dark);
}

@media (max-width: 860px) {
  .settings-big-btn { min-height: 0; }
}

@media (max-width: 960px) {
  .table { min-width: 520px; }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: none;
  border-radius: 10px;
  padding: 0.58rem 1.05rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none !important;
  transition: transform 0.12s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(180deg, #c52636 0%, var(--accent) 100%);
  color: #fff;
  box-shadow: 0 8px 18px rgba(181, 31, 46, 0.25);
}
.btn-primary:hover {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff;
}

.btn-secondary {
  background: var(--bg-elevated);
  color: #fff;
}
.btn-secondary:hover { background: var(--bg-soft); color: #fff; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink);
}
.btn-ghost:hover {
  background: var(--surface-soft);
  color: var(--ink);
  border-color: #c9d2db;
}

.btn-lg {
  padding: 0.88rem 1.45rem;
  font-size: 1.02rem;
}

.btn-danger {
  background: var(--accent-dark);
  color: #fff;
}

.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

.actions .form-control {
  flex: 1 1 200px;
  min-width: 0;
  max-width: 100%;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 1rem;
}

.form-grid-line {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(100px, 1fr) auto;
  gap: 0.75rem;
  align-items: end;
}

.form-group { margin-bottom: 0.85rem; }
.form-group label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.35rem;
  font-size: 0.88rem;
  color: #2a3440;
}

.form-control, .form-select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  font: inherit;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus, .form-select:focus {
  outline: none;
  border-color: rgba(181, 31, 46, 0.45);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-control-lg, .form-select-lg {
  padding: 0.85rem 1rem;
  font-size: 1.05rem;
}

.alert {
  padding: 0.9rem 1.05rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  font-weight: 600;
  border: 1px solid transparent;
}
.alert-success { background: #d9f3e7; color: var(--ok); border-color: #b8e6d1; }
.alert-error, .alert-danger { background: #f8d9dc; color: var(--danger); border-color: #efc0c5; }
.alert-warning { background: #f8ebd0; color: #8a6218; border-color: #efd8a8; }
.alert-info { background: #dceaf7; color: #1f4f75; border-color: #bfd7ec; }

.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 20% 15%, rgba(201, 162, 39, 0.22), transparent 42%),
    radial-gradient(ellipse at 85% 80%, rgba(181, 31, 46, 0.35), transparent 45%),
    linear-gradient(145deg, #0f1419 0%, #1a1418 50%, #121820 100%);
  padding: clamp(0.85rem, 3vw, 1.5rem);
  position: relative;
  overflow: auto;
}

.login-page::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      -12deg,
      transparent,
      transparent 18px,
      rgba(255, 255, 255, 0.015) 18px,
      rgba(255, 255, 255, 0.015) 19px
    );
  pointer-events: none;
}

.login-card {
  width: min(420px, 100%);
  background: rgba(255, 255, 255, 0.97);
  border-radius: 18px;
  padding: 2.15rem 2rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  animation: fadeRise 0.5s ease both;
}

.pos-page {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 2.5rem);
  min-height: calc(100dvh - 2.5rem);
}

.pos-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(min(100%, 320px), 0.85fr);
  gap: 1.25rem;
  align-items: stretch;
  flex: 1;
  min-height: 0;
}

.pos-total {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  color: var(--accent-dark);
  line-height: 1;
}

.pos-total span {
  font-size: 0.45em;
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}

.pos-eyebrow {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.pos-header h1 { animation: fadeRise 0.45s ease both; }

.pos-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  align-items: center;
}

.pos-search {
  flex: 1;
  min-width: 220px;
  border: 1.5px solid var(--border) !important;
  background: #fff !important;
}

/* ==========================================================================
   NOUVEAU DESIGN POINT DE VENTE & CAISSE TACTILE (POS)
   ========================================================================== */

.pos-workspace {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  animation: fadeIn 0.3s ease;
}

/* 1. TOPBAR CAISSE */
.pos-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  background: #fff;
  padding: 1rem 1.4rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.pos-topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.pos-status-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
  animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.pos-app-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.15;
}

.pos-app-subtitle {
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  color: var(--ink-muted);
  font-weight: 600;
}

.pos-topbar-stats {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.pos-stat-pill {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.35rem 0.85rem;
  border-radius: 10px;
  min-width: 90px;
}

.pos-stat-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  font-weight: 700;
}

.pos-stat-val {
  font-size: 0.92rem;
  color: var(--ink);
  font-weight: 800;
}

.clock-pill .pos-stat-val {
  color: var(--accent, #b51f2e);
  font-family: monospace;
}

.pos-history-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.6rem 1rem;
}

/* 2. DISPOSITION DE LA GRILLE DE CAISSE */
.pos-grid-container {
  display: grid;
  grid-template-columns: 1fr 480px;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 1200px) {
  .pos-grid-container {
    grid-template-columns: 1fr 420px;
  }
}

@media (max-width: 992px) {
  .pos-grid-container {
    grid-template-columns: 1fr;
  }
}

/* 3. COLONNE CATALOGUE (GAUCHE) */
.pos-catalog-panel {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  min-width: 0;
}

.pos-search-filter-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.1rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.pos-search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.pos-search-icon {
  position: absolute;
  left: 14px;
  font-size: 1.1rem;
  pointer-events: none;
  opacity: 0.6;
}

.pos-search-input {
  width: 100%;
  padding: 0.75rem 2.6rem 0.75rem 2.8rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  transition: all 0.2s ease;
}

.pos-search-input:focus {
  outline: none;
  background: #fff;
  border-color: var(--accent, #b51f2e);
  box-shadow: 0 0 0 4px rgba(181, 31, 46, 0.12);
}

.pos-search-clear-btn {
  position: absolute;
  right: 12px;
  background: #e2e8f0;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 0.75rem;
  color: #475569;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.pos-search-clear-btn:hover {
  background: #cbd5e1;
  color: #0f172a;
}

.pos-cat-nav {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.2rem;
  scrollbar-width: thin;
}

.pos-cat-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.pos-cat-tab:hover {
  border-color: var(--accent, #b51f2e);
  color: var(--accent, #b51f2e);
  transform: translateY(-1px);
}

.pos-cat-tab.active {
  background: var(--accent, #b51f2e);
  color: #fff;
  border-color: var(--accent, #b51f2e);
  box-shadow: 0 4px 12px rgba(181, 31, 46, 0.25);
}

.cat-tab-count {
  background: rgba(0, 0, 0, 0.12);
  padding: 0.15rem 0.45rem;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 800;
}

.pos-cat-tab.active .cat-tab-count {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.pos-catalog-scroll {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.pos-cat-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  border-bottom: 2px solid rgba(181, 31, 46, 0.15);
  padding-bottom: 0.4rem;
}

.pos-cat-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.pos-cat-emoji {
  font-size: 1.35rem;
}

.pos-cat-group-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--ink);
  font-weight: 800;
}

.pos-cat-group-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink-muted);
}

.pos-product-matrix {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.95rem;
}

@media (max-width: 640px) {
  .pos-product-matrix {
    grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
    gap: 0.65rem;
  }
}

.pos-item-card {
  margin: 0;
  display: flex;
  flex-direction: column;
}

.pos-item-card-inner {
  position: relative;
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 16px;
  padding: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: inherit;
  color: inherit;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s ease, border-color 0.22s ease;
  height: 100%;
}

.pos-item-card-inner:hover {
  transform: translateY(-5px);
  border-color: rgba(181, 31, 46, 0.45);
  box-shadow: 0 14px 28px rgba(181, 31, 46, 0.15);
}

.pos-item-card-inner:active {
  transform: translateY(0) scale(0.98);
}

.pos-item-card.pos-item-clicked .pos-item-card-inner {
  animation: cardTapPulse 0.35s ease;
}

@keyframes cardTapPulse {
  0% { transform: scale(0.96); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

.pos-item-card.is-disabled .pos-item-card-inner {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.5);
  box-shadow: none;
  transform: none !important;
}

/* Zone Visuelle Image HD */
.pos-item-visual {
  position: relative;
  height: 135px;
  background: radial-gradient(circle at center, #2b3543 0%, #131922 100%);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

@media (max-width: 640px) {
  .pos-item-visual {
    height: 115px;
  }
}

.pos-item-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.pos-item-card-inner:hover .pos-item-img {
  transform: scale(1.08);
}

.pos-item-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2a1619 0%, #151b24 100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.fallback-icon {
  font-size: 3rem;
  line-height: 1;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.5));
  transition: transform 0.3s ease;
}

.pos-item-card-inner:hover .fallback-icon {
  transform: scale(1.15) rotate(4deg);
}

/* Thèmes de fonds colorés pour visuels sans image */
.cat-fallback-boeuf { background: linear-gradient(135deg, #4d1419 0%, #1f0b0e 100%); }
.cat-fallback-agneau, .cat-fallback-mouton { background: linear-gradient(135deg, #482914 0%, #1f1108 100%); }
.cat-fallback-volaille { background: linear-gradient(135deg, #4d2b12 0%, #221307 100%); }
.cat-fallback-charcuterie { background: linear-gradient(135deg, #4a1922 0%, #1f0a0f 100%); }
.cat-fallback-epices, .cat-fallback-condiment { background: linear-gradient(135deg, #18412b 0%, #0c1f15 100%); }
.cat-fallback-boissonseaujus { background: linear-gradient(135deg, #133c54 0%, #091e2b 100%); }
.cat-fallback-produits-laitiers { background: linear-gradient(135deg, #1c3c50 0%, #0e1e28 100%); }
.cat-fallback-bonbonschocolat { background: linear-gradient(135deg, #3c2014 0%, #1c0e08 100%); }
.cat-fallback-nettoyage { background: linear-gradient(135deg, #144242 0%, #092121 100%); }

.pos-item-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.25) 0%, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.45) 100%);
  pointer-events: none;
}

.pos-item-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.55rem;
  border-radius: 8px;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  z-index: 2;
}

.badge-kg {
  background: rgba(26, 34, 44, 0.9);
  border: 1px solid rgba(201, 162, 39, 0.6);
  color: var(--brass, #fbbf24);
}

.badge-piece {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(96, 165, 250, 0.6);
  color: #93c5fd;
}

.badge-out {
  background: rgba(220, 38, 38, 0.95);
  color: #fff;
  left: 8px;
  right: auto;
}

.pos-item-details {
  padding: 0.75rem 0.85rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.pos-item-cat-label {
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brass, #9a781b);
}

.pos-item-name {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.25;
}

.pos-item-pricing {
  margin-top: 0.25rem;
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
}

.pos-item-price {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--accent, #b51f2e);
}

.pos-item-unit {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-muted);
}

.pos-item-stock-status {
  font-size: 0.68rem;
  font-weight: 700;
  margin-top: auto;
  padding-top: 0.4rem;
}

.status-ok { color: #059669; }
.status-low { color: #d97706; }
.status-out { color: #dc2626; }

.pos-item-add-cue {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  background: var(--accent, #b51f2e);
  color: #fff;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.25rem;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 12px rgba(181, 31, 46, 0.4);
}

.pos-item-card-inner:hover .pos-item-add-cue {
  opacity: 1;
  transform: scale(1);
}
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 10px rgba(181, 31, 46, 0.35);
}

.pos-item-card-inner:hover .pos-item-add-cue {
  opacity: 1;
  transform: scale(1);
}

.pos-manual-section {
  background: #fff;
  border: 1px dashed var(--border);
  border-radius: 14px;
  padding: 0.85rem 1.1rem;
  margin-top: 0.5rem;
}

.pos-manual-summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--ink);
  font-size: 0.9rem;
}

.pos-manual-box {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr auto;
  gap: 0.75rem;
  align-items: end;
  margin-top: 0.85rem;
}

/* 4. COLONNE TERMINAL PANIER (DROITE) */
.pos-terminal-panel {
  position: sticky;
  top: 0.5rem;
  height: calc(100vh - 7rem);
  height: calc(100dvh - 7rem);
  min-height: 540px;
  display: flex;
  flex-direction: column;
}

.pos-terminal-card {
  background: linear-gradient(180deg, #19222c 0%, #11171f 65%, #181316 100%);
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 1rem 1.15rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(201, 162, 39, 0.15);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.pos-terminal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 0.65rem;
  flex-shrink: 0;
}

.pos-terminal-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.pos-terminal-icon {
  font-size: 1.4rem;
}

.pos-terminal-heading {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: #fff;
  font-weight: 800;
}

.pos-terminal-sub {
  font-size: 0.75rem;
  color: var(--brass, #c9a227);
  font-weight: 700;
}

.pos-clear-form { margin: 0; }

.pos-btn-clear {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #cbd5e1;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pos-btn-clear:hover {
  background: rgba(220, 38, 38, 0.8);
  border-color: rgba(220, 38, 38, 0.8);
  color: #fff;
}

/* Lignes du panier avec défilement fluide et visibilité intégrale */
.pos-cart-feed {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1 1 0px;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.35rem;
  margin-bottom: 0.65rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 162, 39, 0.5) rgba(255, 255, 255, 0.06);
}

.pos-cart-feed::-webkit-scrollbar {
  width: 6px;
}

.pos-cart-feed::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.pos-cart-feed::-webkit-scrollbar-thumb {
  background: rgba(201, 162, 39, 0.4);
  border-radius: 4px;
}

.pos-cart-feed::-webkit-scrollbar-thumb:hover {
  background: var(--brass, #fbbf24);
}

.pos-cart-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0.65rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  animation: fadeRise 0.25s ease;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.pos-cart-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(201, 162, 39, 0.35);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.pos-cart-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.pos-cart-prod-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 1;
}

.pos-cart-thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  background: #1e293b;
}

.pos-cart-thumb-dummy {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.pos-cart-prod-texts {
  min-width: 0;
  flex: 1;
}

.pos-cart-prod-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  word-break: break-word;
}

.pos-cart-prod-rate {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 0.1rem;
}

.pos-cart-prod-rate small {
  color: #cbd5e1;
}

.pos-cart-total-badge {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  white-space: nowrap;
}

.pos-cart-line-amount-wrap {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(201, 162, 39, 0.25);
  padding: 0.2rem 0.5rem;
  border-radius: 7px;
}

.pos-cart-line-val {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--brass, #fbbf24);
}

.pos-cart-line-cur {
  font-size: 0.7rem;
  color: #94a3b8;
  font-weight: 700;
}

.pos-cart-del-form { margin: 0; }

.pos-cart-del-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.pos-cart-del-btn:hover {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
  transform: scale(1.08);
}

/* Responsive adaptation for small heights / screens */
@media (max-height: 840px), (max-width: 1024px) {
  .pos-terminal-panel {
    position: static;
    height: auto;
    min-height: auto;
  }
  .pos-terminal-card {
    height: auto;
    max-height: none;
    overflow: visible;
  }
  .pos-cart-feed {
    flex: 0 0 auto;
    max-height: 320px;
    min-height: 60px;
  }
}

/* Station de réglage du poids */
.pos-weight-station {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  padding: 0.4rem 0.6rem;
}

.pos-item-qty-form { margin: 0; }

.pos-weight-control-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.45rem;
}

.pos-weight-tag {
  font-size: 0.72rem;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pos-stepper-box {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 2px 3px;
  gap: 2px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.pos-step-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 900;
  font-size: 1.1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
}

.pos-step-btn:hover {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.3);
  transform: scale(1.06);
}

.pos-step-btn:active {
  transform: scale(0.94);
}

.pos-weight-num-input {
  width: 78px;
  background: transparent;
  border: none;
  color: #fff;
  font-family: inherit;
  font-weight: 900;
  font-size: 1.12rem;
  text-align: right;
  padding: 2px 4px;
  outline: none;
  -moz-appearance: textfield;
}

.pos-weight-num-input:focus {
  color: var(--brass, #fbbf24);
}

.pos-weight-num-input::-webkit-outer-spin-button,
.pos-weight-num-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.pos-weight-suffix {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--brass, #fbbf24);
  padding-right: 4px;
  user-select: none;
}

.pos-weight-quick-chips {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
  padding-top: 0.3rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.09);
}

.pos-qchip {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #e2e8f0;
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.2rem 0.45rem;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.12s ease;
  user-select: none;
}

.pos-qchip:hover {
  background: rgba(201, 162, 39, 0.35);
  border-color: var(--brass, #fbbf24);
  color: #fff;
  transform: translateY(-1px);
}

.pos-qchip:active {
  transform: translateY(0) scale(0.96);
}

.pos-cart-empty-banner {
  text-align: center;
  padding: 2.5rem 1rem;
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: auto 0;
}

.pos-empty-illus {
  font-size: 2.8rem;
  margin-bottom: 0.5rem;
  opacity: 0.85;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

.pos-cart-empty-banner h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: #fff;
  font-weight: 800;
}

.pos-cart-empty-banner p {
  margin: 0.4rem 0 0;
  font-size: 0.82rem;
  max-width: 280px;
  line-height: 1.4;
  color: #94a3b8;
}

/* 5. DECK ENCAISSEMENT */
.pos-checkout-deck {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 0.6rem;
  flex-shrink: 0;
}

.pos-checkout-deck.is-locked {
  opacity: 0.45;
  pointer-events: none;
}

.pos-grand-total-banner {
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.18), rgba(181, 31, 46, 0.22));
  border: 1px solid rgba(201, 162, 39, 0.35);
  border-radius: 12px;
  padding: 0.55rem 0.85rem;
  text-align: center;
}

.pos-total-caption {
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brass, #fbbf24);
  margin-bottom: 0.1rem;
}

.pos-total-amount {
  font-size: 1.75rem;
  font-weight: 900;
  color: #fff;
  line-height: 1.1;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.35rem;
}

.pos-total-curr {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--brass, #fbbf24);
}

/* Calculateur rendu de monnaie */
.pos-change-calculator {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.5rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.pos-calc-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0.5rem;
}

.pos-calc-field label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: 0.15rem;
}

.pos-received-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  border-radius: 6px;
  padding: 0.3rem 0.5rem;
  font-size: 0.9rem;
  font-weight: 800;
  font-family: inherit;
  outline: none;
}

.pos-received-input:focus {
  border-color: var(--brass, #fbbf24);
  background: rgba(255, 255, 255, 0.14);
}

.pos-change-field {
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: right;
}

.pos-change-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: #94a3b8;
}

.pos-change-val {
  font-size: 0.95rem;
  font-weight: 900;
  color: #cbd5e1;
}

.pos-change-val.is-positive {
  color: #10b981;
}

.pos-change-val.is-negative {
  color: #ef4444;
}

.pos-cash-presets {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.25rem;
}

.pos-preset-btn {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 0.68rem;
  font-weight: 800;
  font-family: inherit;
  padding: 0.25rem 0.1rem;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.12s;
}

.pos-preset-btn:hover {
  background: rgba(201, 162, 39, 0.25);
  border-color: var(--brass, #fbbf24);
  color: #fff;
}

.pos-preset-btn.exact-btn {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

/* Formulaire d'encaissement */
.pos-checkout-form {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0;
}

.pos-payment-radios-inline {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  padding: 0.2rem 0;
}

.pos-pay-inline-label {
  font-size: 0.68rem;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 0.15rem;
}

.pos-inline-check {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.76rem;
  font-weight: 700;
  color: #cbd5e1;
  cursor: pointer;
  user-select: none;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  transition: all 0.1s ease;
}

.pos-inline-check input[type="radio"] {
  accent-color: var(--brass, #fbbf24);
  cursor: pointer;
  width: 13px;
  height: 13px;
  margin: 0;
}

.pos-inline-check:hover {
  color: #fff;
}

.pos-inline-check.active,
.pos-inline-check:has(input:checked) {
  color: var(--brass, #fbbf24);
  font-weight: 800;
}

.pos-customer-notes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.pos-compact-group {
  margin: 0;
}

.pos-compact-group label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: 0.15rem;
}

.pos-compact-group select,
.pos-compact-group input {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  border-radius: 6px;
  padding: 0.35rem 0.5rem;
  font-size: 0.8rem;
}

.pos-compact-group select option {
  background: #1e293b;
  color: #fff;
}

.pos-btn-checkout {
  width: 100%;
  background: linear-gradient(135deg, #b51f2e, #8f1722) !important;
  border: none !important;
  color: #fff !important;
  font-size: 1rem !important;
  font-weight: 900 !important;
  padding: 0.75rem 1rem !important;
  border-radius: 10px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.45rem !important;
  cursor: pointer !important;
  box-shadow: 0 6px 18px rgba(181, 31, 46, 0.35) !important;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.pos-btn-checkout:hover:not(:disabled) {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 24px rgba(181, 31, 46, 0.5) !important;
  filter: brightness(1.08) !important;
}

.pos-btn-checkout:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none !important;
}

.period-custom {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
}

.period-custom .form-group {
  min-width: min(160px, 100%);
  flex: 1 1 140px;
}

.period-filters {
  margin: 0;
}

.period-filters .filter-chips,
.period-filters .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.ticket-card { animation: fadeRise 0.45s ease both; }

.ticket-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.ticket-label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.2rem;
}

.ticket-lines {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.ticket-line {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px dashed var(--border);
}

.ticket-line > div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.ticket-line span {
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.ticket-total {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-top: 1.25rem;
  padding-top: 1rem;
}

.ticket-total > span {
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--ink-muted);
}

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

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

@keyframes pulseAdd {
  0% { box-shadow: 0 0 0 0 rgba(181, 31, 46, 0.45); }
  100% { box-shadow: 0 0 0 12px rgba(181, 31, 46, 0); }
}

@keyframes subtleGlow {
  0%, 100% { box-shadow: 0 8px 18px rgba(181, 31, 46, 0.25); }
  50% { box-shadow: 0 8px 24px rgba(181, 31, 46, 0.4); }
}

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.25rem;
}

.dashboard-page {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.dashboard-header {
  align-items: flex-start;
  gap: 0.85rem 1.25rem;
}

.dashboard-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dashboard-page .kpi-grid-primary {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(0.55rem, 1.2vw, 0.95rem);
}

.dashboard-page .kpi-grid-secondary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(0.55rem, 1.2vw, 0.95rem);
}

.dashboard-page .kpi {
  padding: clamp(0.85rem, 1.4vw, 1.15rem) clamp(0.85rem, 1.5vw, 1.25rem);
  min-width: 0;
}

.dashboard-page .kpi .label {
  font-size: clamp(0.62rem, 0.9vw, 0.72rem);
}

.dashboard-chart-main {
  height: clamp(200px, 32vh, 320px);
}

.dashboard-chart-donut {
  height: clamp(200px, 28vh, 280px);
  max-width: min(360px, 100%);
}

.dashboard-page .panel {
  min-width: 0;
}

.dashboard-page .table-compact {
  min-width: 0;
  font-size: 0.88rem;
}

.dashboard-page .table-compact th,
.dashboard-page .table-compact td {
  padding: 0.7rem 0.85rem;
}

.dashboard-page .panel-table .table-wrap {
  border: none;
  border-radius: 0;
  background: transparent;
  margin: 0 -0.15rem;
}

.dashboard-mid,
.dashboard-bottom {
  margin-bottom: 0;
}

.stats-page,
.page-fit {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.section-header {
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  align-items: flex-end;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2vw, 1.45rem);
  margin: 0;
  font-weight: 700;
}

.muted {
  color: var(--ink-muted);
}

.panel-table .table-wrap {
  border: none;
  border-radius: 0;
  background: transparent;
}

.table-wrap-fit {
  overflow-x: visible;
}

.table-fit {
  min-width: 0 !important;
  width: 100%;
  table-layout: fixed;
  font-size: 0.88rem;
}

.table-fit th,
.table-fit td {
  padding: 0.7rem 0.65rem;
  vertical-align: middle;
}

.table-fit th:first-child,
.table-fit td:first-child {
  width: auto;
}

.table-alert-stock th.num,
.table-alert-stock td.num {
  width: 5.75rem;
  white-space: nowrap;
}

.table-alert-stock .badge {
  max-width: 100%;
  white-space: nowrap;
  font-size: 0.72rem;
  padding: 0.28rem 0.5rem;
}

.table-grid {
  border-collapse: collapse;
  border: 1px solid #d8e0e8;
}

.table-grid thead th {
  border: 1px solid #2a3440;
  border-bottom: 1px solid #2a3440;
}

.table-grid tbody td {
  border: 1px solid #d8e0e8;
  background: #fff;
}

.table-grid tbody tr:nth-child(even) td {
  background: #f8fafc;
}

.table-grid tbody tr:hover td {
  background: #f3f6f9;
}

.table-grid thead th:first-child {
  border-radius: 0;
}

.table-grid thead th:last-child {
  border-radius: 0;
}

.table-compact {
  min-width: 0;
  font-size: 0.88rem;
}

.table-compact th,
.table-compact td {
  padding: 0.7rem 0.85rem;
}

.empty {
  color: var(--ink-muted);
  font-style: italic;
  padding: 1rem 0;
}

.stats-bars {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.stats-bar-row {
  display: grid;
  grid-template-columns: 3.2rem 1fr minmax(7rem, auto);
  gap: 0.65rem;
  align-items: center;
}

.stats-bar-label {
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.stats-bar-track {
  height: 0.65rem;
  background: #e8edf2;
  border-radius: 999px;
  overflow: hidden;
}

.stats-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-dark), var(--brass));
  border-radius: 999px;
  min-width: 2px;
  transition: width 0.35s ease;
}

.stats-bar-value {
  font-size: 0.85rem;
  text-align: right;
  white-space: nowrap;
}

.chart-wrap {
  position: relative;
  height: clamp(200px, 30vh, 260px);
  width: 100%;
}

.chart-wrap-lg {
  height: clamp(220px, 32vh, 300px);
}

.chart-wrap-evolution {
  height: clamp(220px, 38vh, 340px);
}

.chart-subtitle {
  margin: 0.25rem 0 0;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.chart-panel .panel-head {
  margin-bottom: 0.85rem;
}

.chart-panel .panel-head h2 {
  margin: 0;
}

.chart-panel-hero {
  background:
    radial-gradient(ellipse 70% 80% at 100% 0%, rgba(201, 162, 39, 0.08), transparent 55%),
    radial-gradient(ellipse 50% 60% at 0% 100%, rgba(181, 31, 46, 0.05), transparent 50%),
    #fff;
}

.chart-frame {
  padding: 0.85rem 0.75rem 0.55rem;
  border-radius: 14px;
  background:
    linear-gradient(180deg, #f7f9fb 0%, #eef2f6 100%);
  border: 1px solid #e4eaef;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.chart-frame-donut {
  display: flex;
  justify-content: center;
  padding: 1rem 0.75rem 0.35rem;
}

.chart-note {
  margin: 0.85rem 0 0;
  color: var(--ink-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.chart-wrap-donut {
  height: clamp(200px, 28vh, 280px);
  max-width: min(360px, 100%);
  margin: 0 auto;
}

.chart-wrap-h {
  height: clamp(220px, 34vh, 320px);
}

@media (max-width: 1280px) {
  .dashboard-page .kpi-grid-primary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .kpi-grid-store {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: minmax(180px, 220px) minmax(0, 1fr); }
  .brand-logo { width: clamp(64px, 10vh, 96px); }
  .dashboard-page .kpi-grid-secondary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .kpi-grid-4,
  .kpi-grid-store {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .settings-btn-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  body:has(.app-shell) {
    height: auto;
    min-height: 100dvh;
    overflow: auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .sidebar {
    position: relative;
    height: auto;
    max-height: none;
    overflow: visible;
    gap: 0.85rem;
    padding: 1rem 0.85rem 0.9rem;
    border-radius: 0 0 18px 18px;
  }

  .brand { padding: 0.35rem 0.5rem 0.65rem; gap: 0.3rem; }
  .brand-logo { width: clamp(56px, 14vw, 88px); }

  .nav-links {
    flex-direction: row;
    flex-wrap: wrap;
    overflow: visible;
    flex: 0 0 auto;
  }

  .nav-links a {
    padding: 0.55rem 0.75rem;
    font-size: 0.85rem;
  }

  .pos-page { min-height: 0; }
  .pos-layout, .two-col, .ticket-meta, .pos-manual-form { grid-template-columns: 1fr; }
  .pos-cart {
    position: static;
    max-height: none;
    overflow: visible;
  }
  .cart-lines { max-height: min(40vh, 280px); }
  .main {
    height: auto;
    overflow: visible;
    padding: 1rem;
  }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(min(140px, 100%), 1fr)); }
  .chart-wrap,
  .chart-wrap-lg,
  .chart-wrap-h,
  .chart-wrap-evolution {
    height: clamp(180px, 36vh, 260px);
  }
  .chart-wrap-donut { height: clamp(180px, 32vh, 240px); }
  .page-header {
    align-items: stretch;
  }
  .page-header h1 { font-size: clamp(1.55rem, 6vw, 2.1rem); }
  .page-header .actions {
    width: 100%;
    justify-content: flex-start;
  }
  .kpi-grid,
  .kpi-grid-4,
  .kpi-grid-store,
  .sales-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: none;
  }

  .dashboard-header { align-items: stretch; }
  .dashboard-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .dashboard-page .kpi-grid-primary,
  .dashboard-page .kpi-grid-secondary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dashboard-chart-main {
    height: clamp(180px, 36vh, 260px);
  }
  .dashboard-chart-donut {
    height: clamp(180px, 32vh, 240px);
  }
  .table-compact { min-width: 420px; }
  .form-grid-line {
    grid-template-columns: 1fr;
  }
  .form-grid-line > .btn,
  .form-grid-line button {
    width: 100%;
  }
  .settings-big-btn { min-height: 0; }
}

@media (max-width: 640px) {
  .main { padding: 0.75rem; }
  .panel { padding: 1rem; }
  .table { min-width: 480px; font-size: 0.86rem; }
  .table th, .table td { padding: 0.75rem 0.8rem; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .product-tile-media { height: 64px; }
  .login-card { padding: 1.5rem 1.15rem; }

  .kpi .value,
  .dashboard-page .kpi .value {
    font-size: clamp(1.2rem, 5.5vw, 1.55rem);
  }
  .page-header .actions .btn,
  .dashboard-actions .btn {
    flex: 1 1 auto;
    min-width: calc(50% - 0.35rem);
  }
  .page-header .actions .btn-primary,
  .dashboard-actions .btn-primary {
    flex: 1 1 100%;
  }
  .table-compact { min-width: 360px; }
  .settings-btn-grid {
    grid-template-columns: 1fr;
  }
  .period-custom .form-group {
    flex: 1 1 100%;
  }
  .period-custom .btn {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .dashboard-page .kpi-grid-primary,
  .dashboard-page .kpi-grid-secondary,
  .kpi-grid,
  .kpi-grid-4,
  .kpi-grid-store,
  .sales-kpis {
    grid-template-columns: 1fr;
  }
}

