/* ═══════════════════════════════════════════════════════════════════
   JOVENA POS — Premium Dark Theme for Android Tablet
   ═══════════════════════════════════════════════════════════════════ */
:root {
  --bg-primary: #0f1117;
  --bg-secondary: #1a1d27;
  --bg-tertiary: #242836;
  --bg-card: #1e2230;
  --bg-hover: #2a2f40;
  --bg-input: #161922;

  --accent: #6c5ce7;
  --accent-light: #a29bfe;
  --accent-glow: rgba(108, 92, 231, 0.25);

  --success: #00b894;
  --success-dark: #00a884;
  --success-glow: rgba(0, 184, 148, 0.2);

  --danger: #e17055;
  --warning: #fdcb6e;

  --text-primary: #f1f2f6;
  --text-secondary: #a4a8b8;
  --text-muted: #636e88;

  --border: rgba(255, 255, 255, 0.06);
  --border-light: rgba(255, 255, 255, 0.1);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;

  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);

  /* Overlays — theme-aware semi-transparent layers */
  --overlay-subtle: rgba(255, 255, 255, 0.03);
  --overlay-hover: rgba(255, 255, 255, 0.06);
  --overlay-active: rgba(255, 255, 255, 0.1);
  --overlay-border: rgba(255, 255, 255, 0.08);

  /* Status — subtle backgrounds & borders */
  --danger-subtle: rgba(225, 112, 85, 0.15);
  --danger-border: rgba(225, 112, 85, 0.3);
  --success-subtle: rgba(0, 184, 148, 0.15);
  --success-border: rgba(0, 206, 158, 0.3);
  --warning-subtle: rgba(245, 158, 11, 0.15);
  --warning-border: rgba(245, 158, 11, 0.4);
  --accent-subtle: rgba(108, 92, 231, 0.15);
  --accent-border: rgba(108, 92, 231, 0.3);

  /* Backdrop */
  --backdrop: rgba(0, 0, 0, 0.5);

  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --theme-speed: 0.4s;
}

/* Smooth fade between dark/light — only active during toggle, not page load */
.theme-transitioning,
.theme-transitioning *,
.theme-transitioning *::before,
.theme-transitioning *::after {
  transition: background-color var(--theme-speed) ease,
    color var(--theme-speed) ease,
    border-color var(--theme-speed) ease,
    box-shadow var(--theme-speed) ease !important;
}

:root {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 15px;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-touch-callout: none !important;
  user-select: none;
  -webkit-user-select: none;
}

input,
button {
  font-family: inherit;
}

.hidden {
  display: none !important;
}

.screen {
  display: none;
  height: 100vh;
  width: 100vw;
}

.screen.active {
  display: flex;
}

/* ─── SCROLLBAR ────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 4px;
}

/* ═══════════════════════════════════════════════════════════════════
   LOGIN SCREEN
   ═══════════════════════════════════════════════════════════════════ */

#login-screen {
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 30%, var(--accent-subtle), transparent 70%),
    var(--bg-primary);
}

.login-container {
  width: 380px;
  max-width: 90vw;
}

.login-logo {
  text-align: center;
  margin-bottom: 40px;
}

.logo-icon {
  font-size: 64px;
  margin-bottom: 12px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

.login-logo h1 {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: 6px;
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 4px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.app-version {
  display: inline-block;
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 1px;
  font-weight: 500;
  margin-top: 6px;
}

.login-form {
  background: var(--bg-secondary);
  padding: 32px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

/* ─── Login Numpad ─────────────────────────────────────────────── */

.login-numpad {
  margin-top: 20px;
  width: 100%;
}

.numpad-row {
  display: flex;
  margin-bottom: 16px;
}

.numpad-key {
  flex: 1;
  height: 56px;
  margin: 0 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 22px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.numpad-key:active {
  background: var(--accent);
  color: #fff;
  transform: scale(0.95);
}

.numpad-del {
  background: var(--danger-subtle);
  color: var(--danger);
  border-color: var(--danger-border);
}

.numpad-del:active {
  background: var(--danger);
  color: #fff;
}

.numpad-ok {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
  border-color: rgba(34, 197, 94, 0.3);
  font-size: 26px;
}

.numpad-ok:active {
  background: var(--success);
  color: #fff;
}

.login-container .input-group input.numpad-focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(124, 92, 252, 0.3);
}

.input-group {
  margin-bottom: 20px;
}

.input-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.input-group input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 16px;
  transition: var(--transition);
  outline: none;
}

.input-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-group input::placeholder {
  color: var(--text-muted);
}

.error-msg {
  margin-top: 16px;
  padding: 12px;
  background: var(--danger-subtle);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-sm);
  color: var(--danger);
  font-size: 13px;
  text-align: center;
  animation: shake 0.4s ease;
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-8px);
  }

  75% {
    transform: translateX(8px);
  }
}

/* ═══════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════ */

.btn>*+* {
  margin-left: 24px;
}

.btn:active {
  transform: scale(0.96);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #5a4bd1);
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
}

.btn-success {
  background: linear-gradient(135deg, var(--success), var(--success-dark));
  color: white;
}

.btn-success:hover {
  box-shadow: 0 0 20px var(--success-glow);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 12px;
}

.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-lg {
  padding: 16px 32px;
  font-size: 16px;
  border-radius: var(--radius);
  width: 100%;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

.btn-mode {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  font-size: 0.85rem;
}

.btn-mode.active {
  background: var(--accent-glow);
  color: var(--accent-light);
  border-color: var(--accent);
}

.badge {
  background: var(--accent);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* ═══════════════════════════════════════════════════════════════════
   POS HEADER
   ═══════════════════════════════════════════════════════════════════ */

.pos-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 70px;
  background: var(--bg-secondary);
  border-bottom: none;
  flex-shrink: 0;
  position: relative;
}

.pos-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #B5473A, #8B4B7A, #2B3A6B);
}

.header-left {
  display: flex;
  align-items: center;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-right: 20px;
}

.brand-logo {
  height: 28px;
  width: auto;
  object-fit: contain;
}

.brand span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-top: 1px;
}

.header-info {
  display: flex;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
}

.header-info>*+* {
  margin-left: 12px;
}

.header-time {
  font-weight: 600;
  color: var(--text-secondary);
  margin-left: 40px;
  font-size: 1.5em;
}

.header-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.header-vendeur {
  color: var(--accent-light);
  font-weight: 600;
  font-size: 14px;
}

.header-right {
  display: flex;
  align-items: center;
}

.header-right>*+* {
  margin-left: 12px;
}

/* ═══════════════════════════════════════════════════════════════════
   POS ALERTS — Bell button + dropdown panel
   ═══════════════════════════════════════════════════════════════════ */

.pos-alert-wrap {
  position: relative;
}

.pos-alert-btn {
  position: relative;
  overflow: visible;
}

.pos-alert-btn.has-alerts {
  animation: alert-pulse 2s ease-in-out infinite;
}

.pos-alert-btn.has-critical {
  color: var(--danger);
}

@keyframes alert-pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.15);
  }
}

.pos-alert-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--danger), var(--danger));
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
  z-index: 2;
}

#btn-sales-today {
  position: relative;
  overflow: visible;
}

#sales-count-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
  z-index: 2;
}

.pos-alerts-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 380px;
  max-height: 520px;
  background: rgba(30, 27, 46, 0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--overlay-border);
  border-radius: 16px;
  box-shadow:
    0 20px 60px var(--backdrop),
    0 0 0 1px var(--overlay-hover) inset;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: alertSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: top right;
}

.pos-alerts-panel.hidden {
  display: none;
}

@keyframes alertSlideIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.pos-alerts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--overlay-hover);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.3px;
}

.pos-alerts-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
  max-height: 380px;
}

.pos-alerts-list::-webkit-scrollbar {
  width: 4px;
}

.pos-alerts-list::-webkit-scrollbar-thumb {
  background: var(--overlay-active);
  border-radius: 4px;
}

.pos-alert-group {
  margin-bottom: 12px;
}

.pos-alert-group-title {
  display: flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 4px 4px 6px;
  color: var(--text-muted);
}

.pos-alert-group-title>*+* {
  margin-left: 6px;
}

.pos-alert-group-title.critical {
  color: var(--danger);
}

.pos-alert-group-title.warning {
  color: var(--warning);
}

.pos-alert-item {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  margin-bottom: 4px;
  background: var(--overlay-subtle);
  border: 1px solid var(--overlay-subtle);
  transition: background 0.15s, border-color 0.15s;
  font-size: 12.5px;
}

.pos-alert-item>*+* {
  margin-left: 10px;
}

.pos-alert-item:hover {
  background: var(--overlay-hover);
  border-color: var(--overlay-border);
}

.pos-alert-item .alert-icon {
  font-size: 16px;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.pos-alert-item .alert-icon.critical {
  background: var(--danger-subtle);
}

.pos-alert-item .alert-icon.warning {
  background: var(--warning-subtle);
}

.pos-alert-item .alert-body {
  flex: 1;
  min-width: 0;
}

.pos-alert-item .alert-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  font-size: 12px;
}

.pos-alert-item .alert-detail {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 1px;
}

.pos-alert-item .alert-tag {
  flex-shrink: 0;
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.alert-tag.critical {
  background: var(--danger-subtle);
  color: var(--danger);
}

.alert-tag.warning {
  background: var(--warning-subtle);
  color: #fbbf24;
}

.pos-alerts-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--overlay-hover);
}

.pos-signal-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.3px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--success), var(--success));
  color: #fff;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.25);
}

.pos-signal-btn>*+* {
  margin-left: 8px;
}

.pos-signal-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
}

.pos-signal-btn:active {
  transform: translateY(0);
}

.pos-signal-btn.copied {
  background: linear-gradient(135deg, var(--success), #34d399);
}

.pos-alert-empty {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-muted);
  font-size: 13px;
}

.pos-alert-empty .empty-check {
  font-size: 32px;
  margin-bottom: 8px;
  display: block;
}

/* ═══════════════════════════════════════════════════════════════════
   POS MAIN LAYOUT — Cart en bas, produits en haut
   ═══════════════════════════════════════════════════════════════════ */

#pos-screen {
  flex-direction: column;
  max-width: 100vw;
  overflow: hidden;
}

.pos-main {
  display: flex;
  flex-direction: row;
  flex: 1;
  overflow: hidden;
  max-width: 100vw;
}

.pos-products {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  min-width: 0;
}


[data-theme="light"] .pos-products {
  background: #e8ddd6;
}


.pos-cart {
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  width: 40%;
  min-width: 340px;
  max-width: 480px;
  order: -1;
  position: relative;
}

.pos-cart::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 2px;
  height: 100%;
  background: linear-gradient(180deg, #B5473A, #8B4B7A, #2B3A6B);
}

/* ─── Search Bar ──────────────────────────────────────────────── */

.search-bar {
  padding: 10px 14px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.search-input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 0 14px;
  transition: var(--transition);
  position: relative;
}

.search-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-icon {
  color: var(--text-muted);
  flex-shrink: 0;
}

#scan-input {
  flex: 1;
  border: none;
  background: none;
  padding: 10px 10px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  text-transform: uppercase;
}

#scan-input::placeholder {
  color: var(--text-muted);
}

.scan-indicator {
  display: flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--success);
  color: white;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  animation: pulse 1s ease infinite;
}

.scan-indicator>*+* {
  margin-left: 4px;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.6;
  }
}

/* ─── Family Bar ──────────────────────────────────────────────── */

.famille-bar {
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  padding: 6px 14px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  max-width: 100vw;
  box-sizing: border-box;
  max-height: 90px;
  overflow-x: auto;
  overflow-y: hidden;
}

/* ─── Family Bar ──────────────────────────────────────────────── */

.famille-bar>* {
  margin: 3px 3px;
}

.famille-chip {
  padding: 6px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.famille-chip:hover {
  background: var(--bg-hover);
}

.famille-chip.active {
  background: var(--accent-glow);
  color: var(--accent-light);
  border-color: var(--accent);
}

/* ─── Search Results ──────────────────────────────────────────── */

.search-results {
  max-height: 300px;
  overflow-y: auto;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 1px solid var(--border);
}

.search-result-item:hover,
.search-result-item:active {
  background: var(--bg-hover);
}

.search-result-item.pvu-zero {
  opacity: 0.4;
  filter: grayscale(0.5);
}

.result-info {
  display: flex;
  flex-direction: column;
}

.result-info>*+* {
  margin-top: 2px;
}

.result-name {
  font-weight: 600;
  font-size: 14px;
}

.result-code {
  font-size: 12px;
  color: var(--text-muted);
  font-family: monospace;
}

.result-price {
  font-weight: 700;
  font-size: 16px;
  color: var(--success);
}

/* ─── Product Grid ────────────────────────────────────────────── */

.product-grid {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  font-size: 14px;
}

.empty-state>*+* {
  margin-top: 16px;
}

.product-grid-items {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(5, 1fr);
  grid-gap: 10px;
  flex: 1;
}

/* ── Modern Pagination ──────────────────────────────────────── */
.grid-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 10px 0 4px;
}

.grid-page-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 28px;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
}

.grid-page-btn:hover:not(:disabled) {
  background: var(--accent);
  color: #fff;
}

.grid-page-btn:disabled {
  opacity: 0.2;
  cursor: default;
}

.grid-page-dots {
  display: flex;
  align-items: center;
  gap: 10px;
}

.grid-page-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: all 0.25s ease;
}

.grid-page-dot:hover {
  background: var(--text-secondary);
  transform: scale(1.2);
}

.grid-page-dot.active {
  width: 40px;
  border-radius: 8px;
  background: var(--accent);
  box-shadow: 0 0 6px rgba(0, 212, 170, 0.4);
}


.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.product-card>*+* {
  margin-top: 4px;
}

.product-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px var(--accent-subtle);
}

.product-card:active {
  transform: scale(0.97);
}

.product-card-name {
  font-weight: 600;
  font-size: 16px;
  line-height: 1.25;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card-family {
  font-size: 13px;
  color: var(--text-muted);
}

.product-card-bottom {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 4px;
}

.product-card-price {
  font-weight: 700;
  font-size: 18px;
  color: var(--success);
}

.product-card-stock {
  font-size: 13px;
  color: var(--text-muted);
}

.product-card-stock.low {
  color: var(--warning);
}

.product-card-stock.out {
  color: var(--danger);
}

.product-card.stock-empty {
  opacity: 0.35;
  filter: grayscale(0.6);
}

.product-card.pvu-zero {
  opacity: 0.4;
  filter: grayscale(0.5);
  cursor: not-allowed;
  border-color: rgba(245, 158, 11, 0.3);
}

.product-card.pvu-zero:hover {
  transform: none;
  box-shadow: none;
}

/* ═══════════════════════════════════════════════════════════════════
   CART — Panneau en bas
   ═══════════════════════════════════════════════════════════════════ */

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.cart-header h2 {
  display: flex;
  align-items: center;
  font-size: 15px;
  font-weight: 700;
}

.cart-header h2>*+* {
  margin-left: 12px;
}

.cart-icon-wrap {
  position: relative;
  display: inline-flex;
}

.cart-badge {
  position: absolute;
  top: -8px;
  right: -10px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
  z-index: 2;
}

/* Memory slot buttons (M1/M2) */
.memory-buttons {
  display: flex;
  margin-left: auto;
  margin-right: 8px;
}

/* Memory slot buttons (M1/M2) */
.memory-buttons>*+* {
  margin-left: 6px;
}

.btn-memory {
  position: relative;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.5px;
}

.btn-memory:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-memory.has-items {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.3);
}

.btn-memory.has-items:hover {
  background: rgba(99, 102, 241, 0.25);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

.mem-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  border-radius: 8px;
  padding: 0 4px;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
  min-height: 0;
}

.cart-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  font-size: 14px;
}

.cart-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  animation: slideIn 0.2s ease;
}

.cart-item>*+* {
  margin-left: 8px;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cart-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.cart-item-info>*+* {
  margin-left: 0;
  margin-top: 2px;
}

.cart-item-name {
  font-weight: 600;
  font-size: 13px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}

.cart-item-price {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.cart-item-qty {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.cart-item-qty>*+* {
  margin-left: 2px;
}

.qty-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 16px;
  cursor: pointer;
  transition: var(--transition);
  line-height: 1;
}

.qty-btn:hover {
  background: var(--bg-hover);
}

.qty-btn:active {
  transform: scale(0.9);
}

.qty-btn.minus:hover {
  background: rgba(225, 112, 85, 0.2);
  color: var(--danger);
}

.cart-item-qty-value {
  min-width: 35px;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
}

.cart-item-total {
  font-weight: 700;
  font-size: 13px;
  color: var(--success);
  text-align: right;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 70px;
}

.cart-item-remove {
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  opacity: 0.5;
  transition: var(--transition);
  flex-shrink: 0;
}

.cart-item-remove:hover {
  color: var(--danger);
  opacity: 1;
}

/* ─── Cart Summary Line (below items) ─────────────────────────── */

.cart-summary-line {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 10px 32px;
  margin-top: 4px;
  border-top: 1px dashed var(--border-light);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}

/* ─── Cart Summary Line (below items) ─────────────────────────── */

.cart-summary-line>*+* {
  margin-left: 12px;
}

.cart-summary-count {
  color: var(--text-muted);
}

.cart-summary-sep {
  color: var(--border-light);
  font-weight: 400;
}

.cart-summary-total {
  color: var(--success);
  font-weight: 800;
  font-size: 14px;
}

/* ─── Cart Footer ─────────────────────────────────────────────── */

.cart-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 2px solid var(--border);
  background: var(--bg-tertiary);
  flex-shrink: 0;
  box-sizing: border-box;
  width: 100%;
}

.footer-articles {
  display: flex;
  align-items: baseline;
  font-size: 13px;
  color: var(--text-secondary);
}

.footer-articles-label {
  font-weight: 500;
  margin-left: 6px;
}

.footer-articles-count {
  font-weight: 700;
  font-size: 15px;
  color: var(--success);
}

.footer-total {
  display: flex;
  align-items: baseline;
}

.footer-total-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  margin-right: 10px;
}

.footer-total-amount {
  font-size: 20px;
  font-weight: 900;
  color: var(--success);
  white-space: nowrap;
  text-align: right;
}

/* ─── Encaisser button in cart footer ──────────────────────────── */

.btn-pay-footer {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  border-radius: 8px;
  background: var(--success);
  color: #ffffff;
  border: none;
  cursor: pointer;
  letter-spacing: 0.3px;
}

.btn-pay-footer svg {
  margin-right: 6px;
}

.btn-pay-footer:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════════════════════════ */

.modal {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.7);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.25s ease;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 700;
}

.modal-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.modal-footer>*+* {
  margin-left: 10px;
}

.modal-footer .btn {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Payment Modal — Pro POS ─────────────────────────────── */
.payment-modal-content {
  width: 1080px;
  max-width: 95vw;
  overflow: hidden;
}

/* Compact colored header */
.pay-header {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  background: linear-gradient(135deg, var(--accent) 0%, #7c3aed 100%);
  color: #fff;
  position: relative;
}

/* Compact colored header */
.pay-header>*+* {
  margin-left: 16px;
}

.pay-header-left {
  display: flex;
  align-items: baseline;
}

.pay-header-left>*+* {
  margin-left: 10px;
}

.pay-header-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.8;
}

.pay-header-amount {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.pay-header-right {
  margin-left: auto;
  text-align: right;
  display: flex;
  flex-direction: column;
}

.pay-header-right>*+* {
  margin-top: 2px;
}

.pay-header-client {
  font-size: 13px;
  font-weight: 600;
}

.pay-header-tva {
  font-size: 11px;
  opacity: 0.7;
}

.pay-header-tva strong {
  opacity: 1;
  font-weight: 700;
}

.pay-close {
  position: absolute;
  top: 8px;
  right: 8px;
  color: #fff !important;
  opacity: 0.7;
  font-size: 18px;
}

.pay-close:hover {
  opacity: 1;
}

/* 2-column layout: left = payment form, right = numpad */
.payment-body-wrapper {
  display: flex;
  gap: 0;
}

.payment-body {
  padding: 16px 20px;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ─── Numeric Keypad ─────────────────────────────────── */
.pay-numpad {
  width: 300px;
  flex-shrink: 0;
  padding: 16px 16px 16px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.numpad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  flex: 1;
}

.numpad-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 26px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 14px 0;
  font-family: inherit;
  min-height: 66px;
}

.numpad-btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
}

.numpad-btn:active {
  transform: scale(0.95);
  background: var(--accent-glow);
}

.numpad-btn.numpad-backspace {
  background: rgba(225, 112, 85, 0.1);
  border-color: var(--danger-border);
  color: var(--danger);
  font-size: 22px;
}

.numpad-btn.numpad-backspace:hover {
  background: rgba(225, 112, 85, 0.2);
}

.numpad-btn.numpad-exact {
  grid-column: 1 / -1;
  background: var(--success-glow);
  border-color: var(--success);
  color: var(--success);
  font-size: 14px;
  font-weight: 700;
  padding: 10px 0;
}

.numpad-btn.numpad-exact:hover {
  background: var(--success);
  color: white;
}

/* Mode buttons */
.payment-mode-btns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 16px;

  grid-gap: 10px;
}

/* Mode buttons */


.btn-mode {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  font-size: 0.85rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-mode:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
}

.btn-mode.active {
  background: var(--accent-glow);
  color: var(--accent-light);
  border-color: var(--accent);
}

/* Amount input row */
.payment-input-row {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.payment-input-row>*+* {
  margin-left: 10px;
}

.pay-amount-input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
}

.pay-amount-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.pay-ref-input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
}

.pay-ref-input:focus {
  outline: none;
  border-color: var(--accent);
}

/* Numpad focus indicator — shows which input receives numpad digits */
.pay-amount-input.numpad-focus,
.pay-ref-input.numpad-focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

/* Ref validation glow */
.pay-ref-input.ref-valid {
  border-color: #38a169;
  box-shadow: 0 0 0 2px rgba(56, 161, 105, 0.25);
}

.pay-ref-input.ref-invalid {
  border-color: #e53e3e;
}

.btn-add-payment {
  padding: 10px 14px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  white-space: nowrap;
  height: auto;
}

/* Quick amount buttons */
.quick-amounts {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 10px;
  flex: 1;
}

.quick-amounts .btn-quick {
  margin: 0;
}

.btn-quick {
  padding: 10px 6px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  text-align: center;
  white-space: nowrap;
}

.btn-quick:hover {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent-light);
}

.btn-quick:active {
  transform: scale(0.95);
}

.btn-quick-exact {
  background: var(--success-glow);
  border-color: var(--success);
  color: var(--success);
}

.btn-quick-exact:hover {
  background: var(--success);
  color: white;
}

/* Payment entries list */
.payment-entries {
  display: flex;
  flex-direction: column;
  margin: 6px 0;
  max-height: 120px;
  overflow-y: auto;
}

/* Payment entries list */
.payment-entries>*+* {
  margin-top: 4px;
}

.payment-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 12px;
  animation: slideInEntry 0.2s ease-out;
}

@keyframes slideInEntry {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.payment-entry-mode {
  font-weight: 700;
  color: var(--text-primary);
  min-width: 70px;
}

.payment-entry-amount {
  font-weight: 700;
  color: var(--success);
  font-variant-numeric: tabular-nums;
}

.payment-entry-ref {
  font-size: 10px;
  color: var(--text-muted);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.payment-entry-remove {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  opacity: 0.6;
  transition: var(--transition);
}

.payment-entry-remove:hover {
  opacity: 1;
}

/* Change / Remaining compact */
.payment-change {
  padding: 10px 14px;
  background: var(--bg-tertiary);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  margin-top: 6px;
  transition: var(--transition);
}

.payment-change.has-change {
  background: rgba(0, 184, 148, 0.08);
  border-color: var(--success);
  box-shadow: 0 0 20px var(--success-glow);
}

.payment-change.insufficient {
  background: rgba(225, 112, 85, 0.08);
  border-color: var(--danger);
}


.payment-remaining {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.payment-remaining span:first-child {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.remaining-amount {
  font-size: 18px;
  font-weight: 800;
  color: var(--warning, var(--warning));
}

.remaining-amount.paid {
  color: var(--success);
}

.payment-change-display {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-light);
  padding-top: 8px;
  margin-top: 8px;
}

.change-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.change-amount {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-muted);
  transition: var(--transition);
}

.payment-change.has-change .change-amount {
  color: var(--success);
}

.payment-change.insufficient .change-amount {
  color: var(--danger);
  font-size: 14px;
}

/* Footer */
.pay-footer {
  padding: 12px 20px;
}

/* ─── Shift Modals ────────────────────────────────────────────── */

.shift-modal-content {
  width: 440px;
  max-width: 92vw;
  text-align: center;
  padding: 36px 28px 28px;
  animation: logoutSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.shift-close-content,
.shift-daily-content {
  max-height: 85vh;
  overflow-y: auto;
}

.shift-icon-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.shift-icon-ring {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shift-icon-ring.open {
  background: rgba(0, 206, 158, 0.1);
  border: 2px solid var(--success-border);
  color: var(--success);
  animation: shiftPulseGreen 2s ease-in-out infinite;
}

.shift-icon-ring.close {
  background: rgba(225, 177, 44, 0.1);
  border: 2px solid rgba(225, 177, 44, 0.3);
  color: #e1b12c;
  animation: shiftPulseOrange 2s ease-in-out infinite;
}

.shift-icon-ring.daily {
  background: rgba(108, 92, 231, 0.1);
  border: 2px solid var(--accent-border);
  color: var(--accent);
  animation: shiftPulsePurple 2s ease-in-out infinite;
}

@keyframes shiftPulseGreen {

  0%,
  100% {
    box-shadow: 0 0 0 0 var(--success-border);
  }

  50% {
    box-shadow: 0 0 0 10px rgba(0, 206, 158, 0);
  }
}

@keyframes shiftPulseOrange {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(225, 177, 44, 0.3);
  }

  50% {
    box-shadow: 0 0 0 10px rgba(225, 177, 44, 0);
  }
}

@keyframes shiftPulsePurple {

  0%,
  100% {
    box-shadow: 0 0 0 0 var(--accent-border);
  }

  50% {
    box-shadow: 0 0 0 10px rgba(108, 92, 231, 0);
  }
}

.shift-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 8px;
}

.shift-user {
  font-size: 14px;
  color: var(--accent-light);
  font-weight: 600;
  margin: 0 0 12px;
  padding: 5px 14px;
  background: var(--accent-glow);
  border-radius: 20px;
  display: inline-block;
}

.shift-date {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 16px;
  font-weight: 600;
}

.shift-message {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 0 20px;
}

.shift-field {
  text-align: left;
  margin-bottom: 16px;
}

.shift-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.shift-field .input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 700;
  box-sizing: border-box;
  transition: var(--transition);
}

.shift-field .input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.shift-btn-open {
  width: 100%;
  padding: 14px !important;
  font-size: 16px !important;
}

/* ─── Shift & Pause Numpads ─────────────────────────────── */
.shift-numpad,
.pause-numpad {
  margin: 16px auto 12px;
  max-width: 320px;
}

.pause-numpad {
  margin-top: 12px;
  margin-bottom: 16px;
}

/* Recap table */
.shift-recap {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  text-align: left;
}

.recap-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.recap-row span:last-child {
  font-weight: 600;
  color: var(--text-primary);
}

.recap-val {
  font-variant-numeric: tabular-nums;
}

.recap-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}

.recap-total {
  font-size: 15px;
  font-weight: 800;
}

.recap-total span:last-child {
  color: var(--success) !important;
  font-size: 18px;
}

.recap-grand-total span:last-child {
  font-size: 22px;
  text-shadow: 0 0 20px var(--success-border);
}

.recap-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 8px 0 4px;
}

/* Ecart */
.shift-ecart {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 16px;
  text-align: center;
}

.shift-ecart.positive {
  background: rgba(0, 206, 158, 0.1);
  border: 1px solid var(--success-border);
  color: var(--success);
}

.shift-ecart.negative {
  background: rgba(225, 112, 85, 0.1);
  border: 1px solid var(--danger-border);
  color: var(--danger);
}

.shift-ecart.zero {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.shift-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.shift-actions>*+* {
  margin-left: 8px;
}

.shift-actions .btn {
  flex: 1;
  min-width: 0;
  padding: 12px 10px;
  font-size: 13px;
  font-weight: 700;
  width: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Logout Modal ────────────────────────────────────────────── */

.logout-modal-content {
  width: 400px;
  max-width: 90vw;
  text-align: center;
  padding: 40px 32px 32px;
  animation: logoutSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes logoutSlideIn {
  from {
    opacity: 0;
    transform: scale(0.85) translateY(20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.logout-icon-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.logout-icon-ring {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: rgba(225, 112, 85, 0.1);
  border: 2px solid var(--danger-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--danger);
  animation: logoutPulse 2s ease-in-out infinite;
}

@keyframes logoutPulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 var(--danger-border);
  }

  50% {
    box-shadow: 0 0 0 12px rgba(225, 112, 85, 0);
  }
}

.logout-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 8px;
}

.logout-user {
  font-size: 14px;
  color: var(--accent-light);
  font-weight: 600;
  margin: 0 0 12px;
  padding: 6px 16px;
  background: var(--accent-glow);
  border-radius: 20px;
  display: inline-block;
}

.logout-message {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 0 28px;
}

.logout-actions {
  display: flex;
  gap: 10px;
}

.logout-actions>*+* {
  margin-left: 10px;
}

.logout-actions .btn {
  flex: 1;
  min-width: 0;
  padding: 14px 12px;
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--radius);
  width: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logout-actions .btn-ghost {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
}

.logout-actions .btn-ghost:hover {
  background: var(--bg-hover);
  border-color: var(--border);
}

.logout-actions .btn-danger {
  background: linear-gradient(135deg, var(--danger), #c0392b);
  border: none;
  color: white;
  box-shadow: 0 4px 15px var(--danger-border);
}

.logout-actions .btn-danger:hover {
  box-shadow: 0 6px 25px rgba(225, 112, 85, 0.5);
  transform: translateY(-1px);
}

/* ─── Receipt Modal ───────────────────────────────────────────── */

.receipt-modal-content {
  width: 400px;
  max-width: 95vw;
}

.receipt-content {
  padding: 24px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  background: white;
  color: #111;
  margin: 16px;
  border-radius: var(--radius-sm);
}

.receipt-content .receipt-header {
  text-align: center;
  margin-bottom: 12px;
}

.receipt-content .receipt-header h3 {
  font-size: 18px;
  margin-bottom: 4px;
}

.receipt-content .receipt-divider {
  border-top: 1px dashed #999;
  margin: 8px 0;
}

.receipt-content .receipt-line {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
}

.receipt-content .receipt-total {
  font-weight: bold;
  font-size: 16px;
  border-top: 2px solid #111;
  padding-top: 4px;
  margin-top: 4px;
}

.receipt-content .receipt-footer {
  text-align: center;
  margin-top: 12px;
  font-size: 11px;
  color: #666;
}

/* ─── Sales Modal ─────────────────────────────────────────────── */

.sales-modal-content {
  width: 95vw;
  max-width: 1200px;
}

.sales-summary {
  display: flex;
  padding: 20px 24px;
}

.sales-summary>*+* {
  margin-left: 16px;
}

.summary-card {
  flex: 1;
  padding: 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  text-align: center;
}

.summary-card-value {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 4px;
}

.summary-card-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sales-list {
  max-height: 400px;
  overflow-y: auto;
  padding: 0 24px 20px;
}

.sale-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  font-size: 13px;
}

.sale-row-num {
  font-weight: 700;
  color: var(--accent-light);
  min-width: 40px;
}

.sale-row-time {
  color: var(--text-muted);
}

.sale-row-amount {
  font-weight: 700;
  color: var(--success);
}

.sale-row-mode {
  font-size: 11px;
  padding: 2px 8px;
  background: var(--bg-hover);
  border-radius: 10px;
  color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════════════════
   MODIFICATION MODE
   ═══════════════════════════════════════════════════════════════════ */

.modif-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.15));
  border: 1px solid var(--warning-border);
  border-radius: 8px;
  margin: 0 0 8px 0;
  color: var(--warning);
  font-weight: 600;
  font-size: 13px;
  animation: modifPulse 2s ease-in-out infinite;
}

.modif-banner.hidden {
  display: none;
}

.modif-banner button {
  color: var(--warning);
  border: 1px solid var(--warning-border);
  font-size: 11px;
  padding: 4px 10px;
}

@keyframes modifPulse {

  0%,
  100% {
    border-color: var(--warning-border);
  }

  50% {
    border-color: rgba(245, 158, 11, 0.8);
  }
}

/* Shift sales list */
.shift-sale-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--overlay-hover);
  transition: background 0.15s;
}

.shift-sale-item:hover {
  background: var(--overlay-subtle);
}

.shift-sale-info {
  display: flex;
  flex-direction: column;
}

.shift-sale-info>*+* {
  margin-top: 2px;
}

.shift-sale-num {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 14px;
}

.shift-sale-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

.shift-sale-amount {
  font-weight: 700;
  color: var(--accent-green);
  font-size: 15px;
  margin-right: 12px;
}

.btn-edit-sale {
  background: var(--accent-subtle);
  border: 1px solid var(--accent-border);
  color: var(--accent-purple);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-edit-sale:hover {
  background: var(--accent-border);
  border-color: var(--accent-purple);
}

.shift-sales-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  font-size: 14px;
}

.shift-sale-item {
  cursor: pointer;
}

.btn-edit-sale.locked {
  background: var(--overlay-hover);
  border-color: var(--overlay-active);
  color: var(--text-muted);
}

.btn-edit-sale.locked:hover {
  background: var(--warning-subtle);
  border-color: var(--warning-border);
  color: var(--warning);
}

/* ─── Sale Detail Panel ──────────────────────────────────────── */
.sale-detail-panel {
  padding: 0 24px 20px;
}

.sale-detail-header {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}

.sale-detail-header>*+* {
  margin-left: 12px;
}

.sale-detail-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-light);
}

.sale-detail-body .detail-info-row {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.sale-detail-body .detail-info-row>*+* {
  margin-left: 16px;
}

.detail-info-chip {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.detail-info-chip strong {
  color: var(--text-primary);
}

.detail-articles-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
  font-size: 13px;
}

.detail-articles-table th {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-articles-table td {
  padding: 8px;
  border-bottom: 1px solid var(--overlay-subtle);
}

.detail-articles-table .td-right {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.detail-articles-table .td-total {
  font-weight: 700;
  color: var(--success);
}

.detail-payments {
  margin-bottom: 16px;
}

.detail-payment-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 8px;
  background: var(--bg-tertiary);
  border-radius: 6px;
  margin-bottom: 4px;
  font-size: 13px;
}

.detail-payment-mode {
  color: var(--text-secondary);
}

.detail-payment-amount {
  font-weight: 700;
  color: var(--text-primary);
}

.detail-payment-ref {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 8px;
}

.detail-total-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 8px;
  border-top: 2px solid var(--border);
  font-size: 16px;
  font-weight: 800;
}

.detail-total-row .detail-total-amount {
  color: var(--success);
}

.detail-actions {
  display: flex;
  margin-top: 12px;
}

.detail-actions>*+* {
  margin-left: 8px;
}

/* ═══════════════════════════════════════════════════════════════════
   PRINT STYLES
   ═══════════════════════════════════════════════════════════════════ */

.print-only {
  display: none;
}

@media print {
  body * {
    display: none !important;
  }

  .print-only,
  .print-only * {
    display: block !important;
    visibility: visible !important;
  }

  .print-only {
    position: fixed;
    top: 0;
    left: 0;
    width: 80mm;
    padding: 4mm;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #000;
    background: #fff;
    line-height: 1.4;
  }

  .print-only .p-header {
    text-align: center;
    margin-bottom: 4mm;
    font-weight: bold;
    font-size: 16px;
  }

  .print-only .p-info {
    text-align: center;
    font-size: 10px;
    margin-bottom: 3mm;
  }

  .print-only .p-divider {
    border-top: 1px dashed #000;
    margin: 2mm 0;
  }

  .print-only .p-line {
    display: flex !important;
    justify-content: space-between;
    padding: 1px 0;
  }

  .print-only .p-total {
    font-weight: bold;
    font-size: 14px;
    border-top: 2px solid #000;
    padding-top: 2mm;
    margin-top: 2mm;
  }

  .print-only .p-footer {
    text-align: center;
    margin-top: 4mm;
    font-size: 10px;
  }

  @page {
    size: 80mm auto;
    margin: 0;
  }
}

/* (Old payment CSS removed — now in compact payment modal section above) */

/* Cart client selector */
.cart-client-selector {
  padding: 18px 32px;
  border-top: 2px solid var(--border-light);
  background: rgba(108, 92, 231, 0.05);
}

.client-select-row {
  display: flex;
  align-items: center;
}

.client-select-row>*+* {
  margin-left: 16px;
}

.client-select-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.client-search-wrap {
  flex: 1;
  position: relative;
}

.client-search-input {
  width: 100%;
  padding: 10px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 15px;
  font-family: inherit;
  box-sizing: border-box;
  transition: var(--transition);
}

.client-search-input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.client-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-height: 180px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 8px 24px var(--backdrop);
}

.client-dropdown-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.1s;
}

.client-dropdown-item:hover {
  background: var(--accent-glow);
}

.client-dropdown-item:last-child {
  border-bottom: none;
}

.client-dropdown-item .client-name {
  font-weight: 600;
  color: var(--text-primary);
}

.client-dropdown-item .client-code {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 8px;
}

.client-nif-display {
  font-size: 11px;
  color: var(--text-muted);
  padding-top: 4px;
}

/* ═══════════════════════════════════════════════════════════════════
   ADMIN LAYOUT
   ═══════════════════════════════════════════════════════════════════ */

.admin-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  background: var(--bg-primary);
}

/* ─── Sidebar ──────────────────────────────────────────────────── */
.admin-sidebar {
  width: 220px;
  min-width: 220px;
  height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.sidebar-header {
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-bottom: 1px solid var(--border);
  gap: 6px;
}

.sidebar-logo-img {
  height: 28px;
  width: auto;
  object-fit: contain;
}

.sidebar-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 2px;
  text-align: center;
  word-break: break-word;
  line-height: 1.2;
  max-width: 100%;
}

.sidebar-nav {
  flex: 1;
  min-height: 0;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
}

.sidebar-nav>*+* {
  margin-top: 4px;
}

.sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid var(--border);
}

.sidebar-item {
  display: flex;
  align-items: center;
  padding: 11px 14px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
  text-align: left;
  position: relative;
  border-left: 3px solid transparent;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.sidebar-item>*+* {
  margin-left: 12px;
}

.sidebar-item:hover {
  background: var(--overlay-subtle);
  color: var(--text-primary);
  border-left-color: rgba(162, 155, 254, 0.3);
}

.sidebar-item.active {
  background: linear-gradient(135deg, var(--accent-subtle), rgba(162, 155, 254, 0.08));
  color: #ffffff;
  border-left-color: var(--accent-light);
  font-weight: 600;
  box-shadow: 0 2px 12px var(--accent-subtle);
}

.sidebar-item.active svg {
  stroke: var(--accent-light);
  filter: drop-shadow(0 0 4px rgba(162, 155, 254, 0.4));
}

.sidebar-back {
  color: var(--success);
}

.sidebar-back:hover {
  background: var(--success-glow);
  color: var(--success);
}

/* ─── Sidebar Group Labels ─────────────────────────────────────── */
.sidebar-group-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: 12px 14px 4px;
  opacity: 0.6;
  user-select: none;
}

.sidebar-group-label:first-child {
  padding-top: 4px;
}

.sidebar-nav>.sidebar-group-label+.sidebar-item {
  margin-top: 0;
}

/* ─── Content Area ─────────────────────────────────────────────── */
.admin-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px 60px 28px;
  /* Extra bottom padding to clear licence banner */
}

.admin-panel {
  display: none;
}

.admin-panel.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.panel-header>* {
  margin: 6px 6px;
}

.panel-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.panel-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.panel-actions>* {
  margin: 5px 5px;
}

.input-search {
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 8px 14px;
  font-size: 13px;
  min-width: 180px;
  outline: none;
  transition: var(--transition);
}

.input-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-select {
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 8px 12px;
  font-size: 13px;
  outline: none;
  cursor: pointer;
}

/* ─── Dashboard ────────────────────────────────────────────────── */
.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 24px;

  grid-gap: 16px;
}

/* ─── Dashboard ────────────────────────────────────────────────── */


.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.kpi-card.kpi-sales::before {
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
}

.kpi-card.kpi-ca::before {
  background: linear-gradient(90deg, var(--success), #2ecc71);
}

.kpi-card.kpi-avg::before {
  background: linear-gradient(90deg, #0984e3, var(--accent));
}

.kpi-card.kpi-stock::before {
  background: linear-gradient(90deg, var(--danger), var(--warning));
}

.kpi-card.kpi-articles::before {
  background: linear-gradient(90deg, #6c5ce7, #fd79a8);
}

.kpi-icon {
  font-size: 28px;
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}

.kpi-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;

  grid-gap: 20px;
}


.dashboard-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.dashboard-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.top-article-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.top-article-row:last-child {
  border-bottom: none;
}

.top-article-rank {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-glow);
  color: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  margin-right: 10px;
  flex-shrink: 0;
}

.top-article-name {
  flex: 1;
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-article-qty {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-left: 12px;
}

.stock-alert-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.stock-alert-row:last-child {
  border-bottom: none;
}

.stock-alert-name {
  flex: 1;
  font-size: 13px;
  color: var(--text-secondary);
}

.stock-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}

.stock-badge.critique {
  background: var(--danger-subtle);
  color: var(--danger);
}

.stock-badge.bas {
  background: rgba(253, 203, 110, 0.15);
  color: var(--warning);
}

.stock-badge.ok {
  background: var(--success-glow);
  color: var(--success);
}

/* ─── Piste Date Filter ────────────────────────────────────────── */
.piste-date-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.pf-modes {
  display: flex;
  gap: 0;
  background: var(--bg-tertiary);
  border-radius: 6px;
  padding: 2px;
}

.pf-mode-btn {
  padding: 5px 14px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.pf-mode-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.pf-mode-btn.active { background: var(--accent); color: #fff; }

.pf-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pf-nav-btn {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border-light);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.pf-nav-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

.pf-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 160px;
  text-align: center;
  text-transform: capitalize;
}

.pf-date-input {
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: var(--text-primary);
  padding: 4px 8px;
  font-size: 12px;
  outline: none;
  width: 130px;
}

.pf-date-input:focus { border-color: var(--accent); }

.pf-today-btn {
  padding: 4px 12px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent-light);
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.pf-today-btn:hover { background: var(--accent); color: #fff; }

/* ─── Piste Pagination ─────────────────────────────────────────── */
.piste-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 12px;
  margin-top: 8px;
}

.pp-info {
  font-size: 12px;
  color: var(--text-muted);
}

.pp-btn {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.pp-btn:hover:not(:disabled) { background: var(--accent); color: #fff; border-color: var(--accent); }
.pp-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.pp-page {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 50px;
  text-align: center;
}

/* ─── Data Tables ──────────────────────────────────────────────── */
.data-table-wrap {
  overflow-x: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.data-table th {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  white-space: nowrap;
}

.data-table tbody tr:hover {
  background: var(--bg-hover);
}

.data-table tbody tr:nth-child(even) {
  background: var(--overlay-subtle);
}

.data-table tbody tr:hover {
  background: var(--bg-hover);
}

.table-btn {
  padding: 4px 10px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: var(--transition);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  margin-right: 4px;
}

.table-btn:hover {
  background: var(--accent-glow);
  color: var(--accent-light);
}

.table-btn.danger:hover {
  background: var(--danger-subtle);
  color: var(--danger);
}

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.table-pagination>*+* {
  margin-left: 8px;
}

.page-btn {
  padding: 6px 12px;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: var(--transition);
}

.page-btn:hover {
  background: var(--bg-hover);
}

.page-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.status-badge.active {
  background: var(--success-glow);
  color: var(--success);
}

.status-badge.inactive {
  background: var(--danger-subtle);
  color: var(--danger);
}

.status-badge.online {
  background: var(--success-glow);
  color: var(--success);
}

.type-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.type-badge.admin {
  background: var(--accent-subtle);
  color: var(--accent-light);
}

.type-badge.gerant {
  background: rgba(9, 132, 227, 0.15);
  color: var(--accent);
}

.type-badge.caissier {
  background: rgba(253, 203, 110, 0.15);
  color: var(--warning);
}

/* ─── Admin Forms ──────────────────────────────────────────────── */
.admin-form {
  padding: 16px 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 16px;

  grid-gap: 16px;
}


.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
}

.form-group>*+* {
  margin-top: 6px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.form-group input[type="text"],
.form-group input[type="search"] {
  text-transform: uppercase;
}

.form-group input,
.form-group select {
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 10px 14px;
  font-size: 14px;
  outline: none;
  transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

.form-actions>*+* {
  margin-left: 8px;
}

/* ─── Stock Tabs ───────────────────────────────────────────────── */
.stock-tabs {
  display: flex;
  margin-bottom: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  padding: 4px;
}

/* ─── Stock Tabs ───────────────────────────────────────────────── */
.stock-tabs>*+* {
  margin-left: 4px;
}

.stock-tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.stock-tab:hover {
  background: var(--bg-hover);
}

.stock-tab.active {
  background: var(--accent);
  color: white;
}

/* ─── Adjustment/Movement styles ──────────────────────────────── */
.movement-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.movement-type {
  font-weight: 600;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 6px;
}

.movement-type.vente {
  background: var(--success-subtle);
  color: var(--success);
}

.movement-type.annulation {
  background: var(--danger-subtle);
  color: var(--danger);
}

.movement-type.ajustement {
  background: var(--accent-subtle);
  color: var(--accent-light);
}

.movement-type.reception {
  background: rgba(9, 132, 227, 0.15);
  color: var(--accent);
}

/* ─── Emoji picker for famille ─────────────────────────────────── */
.emoji-picker-wrap {
  display: flex;
  align-items: flex-start;
}

/* ─── Emoji picker for famille ─────────────────────────────────── */
.emoji-picker-wrap>*+* {
  margin-left: 12px;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  max-height: 120px;
  overflow-y: auto;
  flex: 1;

  grid-gap: 4px;
}


.emoji-grid button {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 18px;
  padding: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.emoji-grid button:hover {
  background: var(--primary);
  transform: scale(1.2);
}

.famille-icon {
  font-size: 22px;
  text-align: center;
}

.famille-status-active {
  color: var(--success);
  font-weight: 600;
}

.famille-status-inactive {
  color: var(--text-muted);
  font-style: italic;
}

/* ─── Article edit modal ───────────────────────────────────────── */
.article-modal-content {
  width: 95vw;
  max-width: 900px;
}

/* ─── Reception form items ─────────────────────────────────────── */
.reception-modal-content {
  max-width: 1200px;
  width: 95vw;
}

.reception-top-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;

  grid-gap: 12px;
}


.reception-grid-4 {
  grid-template-columns: 1fr 1fr 1fr 1fr;
}

.reception-top-fields .required {
  color: var(--danger);
  font-weight: 700;
}

.reception-echeance-custom {
  max-width: 250px;
  margin-bottom: 8px;
}

.reception-total-line {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 12px 0 4px;
  font-size: 15px;
  border-top: 1px solid var(--border-light);
  margin-top: 8px;
}

.reception-total-line>*+* {
  margin-left: 12px;
}

.reception-total-line strong {
  font-size: 18px;
  color: var(--accent);
}

/* ─── Factures panel ───────────────────────────────────────────── */
.factures-summary {
  display: flex;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* ─── Factures panel ───────────────────────────────────────────── */
.factures-summary>* {
  margin: 8px 8px;
}

.factures-summary .facture-stat {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 12px 20px;
  flex: 1;
  min-width: 160px;
  text-align: center;
}

.factures-summary .facture-stat .stat-value {
  font-size: 22px;
  font-weight: 700;
  display: block;
}

.factures-summary .facture-stat .stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.factures-summary .facture-stat.danger .stat-value {
  color: var(--danger);
}

.factures-summary .facture-stat.warning .stat-value {
  color: var(--warning);
}

.factures-summary .facture-stat.success .stat-value {
  color: var(--success);
}

.factures-filters {
  display: flex;
  margin-bottom: 12px;
}

.factures-filters>*+* {
  margin-left: 8px;
}

.facture-filter {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  padding: 6px 16px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.facture-filter:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.facture-filter.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

.facture-status-a_regler {
  color: var(--warning);
  font-weight: 600;
}

.facture-status-en_retard {
  color: var(--danger);
  font-weight: 700;
}

.facture-status-payee {
  color: var(--success);
  font-weight: 600;
}

.facture-row-overdue {
  background: rgba(231, 76, 60, 0.08) !important;
}

/* ─── Paiement modal info ─────────────────────────────────────── */
.paiement-facture-info {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 1.7;
}

.reception-items-header {
  display: grid;
  grid-template-columns: 150px 1fr 80px 110px 36px;
  padding: 4px 0;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;

  grid-gap: 10px;
}


.reception-item-row {
  display: grid;
  grid-template-columns: 150px 1fr 80px 110px 36px;
  align-items: start;
  margin-bottom: 6px;

  grid-gap: 10px;
}


.reception-article-wrap {
  position: relative;
}

.reception-item-row input,
.reception-item-row select {
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 8px 10px;
  font-size: 13px;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}

.reception-item-row input:focus {
  border-color: var(--accent);
}

.reception-qty-input,
.reception-pa-input {
  text-align: center;
}

/* Autocomplete dropdown */
.reception-autocomplete {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 500px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  max-height: 200px;
  overflow-y: auto;
  z-index: 999;
  display: none;
  box-shadow: 0 8px 24px var(--backdrop);
}

.reception-autocomplete.visible {
  display: block;
}

.ac-item {
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.15s;
}

.ac-item:hover {
  background: var(--accent-bg);
}

.ac-item span {
  font-size: 13px;
  color: var(--text-primary);
}

.ac-item small {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  margin-left: 12px;
  flex-shrink: 0;
}

.ac-empty {
  padding: 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.ac-create-item {
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  border-top: 1px dashed var(--border-light);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s;
}

.ac-create-item>*+* {
  margin-left: 8px;
}

.ac-create-item:hover {
  background: var(--accent-bg);
}

.btn-remove-item {
  padding: 8px 10px;
  border: none;
  background: var(--danger-subtle);
  color: var(--danger);
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

/* Fournisseurs panel & admin table */
.admin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.admin-table thead th {
  text-align: left;
  padding: 6px 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

.admin-table tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--overlay-subtle);
  vertical-align: middle;
  color: var(--text-secondary);
  white-space: nowrap;
}

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

.admin-table tbody tr:hover {
  background: var(--overlay-subtle);
}

.admin-table tbody td:first-child {
  color: var(--text-primary);
  font-weight: 600;
}

.admin-table .badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.admin-table .badge-success {
  background: rgba(0, 230, 118, 0.15);
  color: #00e676;
}

.admin-table .badge-muted {
  background: var(--overlay-border);
  color: var(--text-muted);
}

.row-inactive {
  opacity: 0.45;
}

.fournisseur-contact-info {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

#panel-fournisseurs .table-container {
  margin-top: 12px;
  overflow-x: auto;
}

.empty-state-admin {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ═══════════════════════════════════════════════════════════════════
   PRINT TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════════ */

.print-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-light);
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.print-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.print-toast.success {
  border-color: var(--success);
  background: linear-gradient(135deg, rgba(46, 213, 115, 0.15), var(--bg-card));
}

.print-toast.error {
  border-color: var(--danger);
  background: linear-gradient(135deg, var(--danger-subtle), var(--bg-card));
}

/* ═══════════════════════════════════════════════════════════════════
   HARDWARE TABS
   ═══════════════════════════════════════════════════════════════════ */

.hw-tabs {
  display: flex;
  margin-bottom: 20px;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 4px;
  border: 1px solid var(--border-light);
}

/* ═══════════════════════════════════════════════════════════════════
   HARDWARE TABS
   ═══════════════════════════════════════════════════════════════════ */

.hw-tabs>*+* {
  margin-left: 4px;
}

.hw-tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
  transition: all .2s ease;
}

.hw-tab:hover {
  background: rgba(108, 92, 231, .08);
  color: var(--text-primary);
}

.hw-tab.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(108, 92, 231, .3);
}

.hw-tab-content {
  display: none;
}

.hw-tab-content.active {
  display: block;
  animation: fadeIn .2s ease;
}

/* ═══════════════════════════════════════════════════════════════════
   PRINTER SETTINGS PANEL
   ═══════════════════════════════════════════════════════════════════ */

.printer-settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.printer-settings-card h4 {
  margin: 0 0 16px;
  color: var(--text-primary);
  font-size: 15px;
  display: flex;
  align-items: center;
}

.printer-settings-card h4>*+* {
  margin-left: 8px;
}

/* Receipt preview - thermal ticket simulation */
.receipt-preview-wrap {
  flex: 0 0 280px;
}

.receipt-preview {
  background: #fff;
  color: #000;
  font-family: 'Courier New', Courier, monospace;
  font-size: 11px;
  line-height: 1.5;
  padding: 16px 12px;
  width: 280px;
  border: 2px dashed #ccc;
  border-radius: 4px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  white-space: pre-wrap;
  word-break: break-word;
}

.receipt-preview .rp-header {
  text-align: center;
  margin-bottom: 8px;
}

.receipt-preview .rp-title {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 1px;
}

.receipt-preview .rp-line {
  font-size: 11px;
}

.receipt-preview .rp-sep {
  border-top: 1px dashed #999;
  margin: 6px 0;
}

.receipt-preview .rp-sep-double {
  border-top: 2px double #333;
  margin: 6px 0;
}

.receipt-preview .rp-item-line {
  display: flex;
  justify-content: space-between;
}

.receipt-preview .rp-total {
  font-size: 14px;
  font-weight: 900;
  display: flex;
  justify-content: space-between;
}

.receipt-preview .rp-footer {
  text-align: center;
  margin-top: 8px;
  font-size: 11px;
}

.printer-status-bar {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.printer-status-bar>*+* {
  margin-left: 12px;
}

.printer-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--danger);
  flex-shrink: 0;
}

.printer-status-dot.connected {
  background: var(--success);
  box-shadow: 0 0 6px rgba(46, 213, 115, 0.5);
}

.printer-status-info {
  flex: 1;
}

.printer-status-info .name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
}

.printer-status-info .type {
  font-size: 12px;
  color: var(--text-muted);
}

.printer-actions {
  display: flex;
  flex-wrap: wrap;
}

.printer-actions>* {
  margin: 5px 5px;
}

.printer-actions .btn {
  font-size: 13px;
  padding: 8px 16px;
}

.printer-option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

.printer-option-row:last-child {
  border-bottom: none;
}

.printer-option-row label {
  color: var(--text-primary);
  font-size: 13px;
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-input);
  border-radius: 24px;
  transition: 0.3s;
  border: 1px solid var(--border-light);
}

.toggle-slider:before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: 0.3s;
}

.toggle-switch input:checked+.toggle-slider {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle-switch input:checked+.toggle-slider:before {
  transform: translateX(20px);
  background: white;
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE (smaller tablets)
   ═══════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .pos-main {
    flex-direction: column;
  }

  .pos-cart {
    width: 100%;
    min-width: unset;
    max-width: unset;
    max-height: 45vh;
    border-right: none;
    border-top: 1px solid var(--border);
    order: 1;
  }

  .product-grid-items {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }

  .payment-mode-btns {
    flex-wrap: wrap;
  }

  .payment-input-row {
    flex-wrap: wrap;
  }

  /* Admin responsive */
  .admin-sidebar {
    width: 60px;
    min-width: 60px;
  }

  .sidebar-title,
  .sidebar-item span {
    display: none;
  }

  .sidebar-item {
    justify-content: center;
    padding: 12px 8px;
  }

  .admin-content {
    padding: 16px 16px 60px 16px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .panel-actions {
    width: 100%;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}

/* ═══ SYNC INDICATOR ═══ */
.sync-indicator {
  display: flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--overlay-hover);
  cursor: default;
  font-size: 12px;
}

/* ═══ SYNC INDICATOR ═══ */
.sync-indicator>*+* {
  margin-left: 6px;
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6b7280;
  transition: background .3s;
}

.sync-indicator.connected .sync-dot {
  background: var(--success);
  box-shadow: 0 0 6px rgba(34, 197, 94, .5);
  animation: syncPulse 2s infinite;
}

.sync-indicator.pending .sync-dot {
  background: var(--warning);
  box-shadow: 0 0 6px rgba(245, 158, 11, .5);
  animation: syncPulse 1s infinite;
}

.sync-indicator.offline .sync-dot {
  background: var(--danger);
  box-shadow: 0 0 6px rgba(239, 68, 68, .5);
}

.sync-indicator.standalone .sync-dot {
  background: #6b7280;
}

.sync-text {
  color: var(--text-secondary);
}

@keyframes syncPulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: .5;
  }
}

/* ═══ REPORTS ═══ */
.report-summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-bottom: 20px;

  grid-gap: 12px;
}

/* ═══ REPORTS ═══ */


.report-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}

.report-card .card-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
}

.report-card .card-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.report-chart-container {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  min-height: 180px;
}

.report-chart-container svg {
  width: 100%;
  height: 160px;
}

.report-bar {
  fill: var(--primary);
  rx: 3;
  transition: opacity .2s;
}

.report-bar:hover {
  opacity: 0.8;
}

/* ═══ PERMISSIONS ═══ */
.perm-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.perm-section-label {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
  display: block;
}

.perm-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);

  grid-gap: 8px;
}


.perm-check {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.perm-check>*+* {
  margin-left: 8px;
}

.perm-check:hover {
  border-color: var(--primary);
  color: var(--text-primary);
}

.perm-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.perm-check.active {
  background: rgba(var(--primary-rgb, 124, 92, 252), 0.1);
  border-color: var(--primary);
  color: var(--text-primary);
}

/* ═══ MAINTENANCE DANGER ZONE ═══ */
.maintenance-danger-zone {
  border: 1px solid var(--danger) !important;
  background: rgba(229, 62, 62, 0.05) !important;
  margin-top: 24px;
}

.maintenance-danger-zone h4 {
  color: var(--danger);
}

.maintenance-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);

  grid-gap: 10px;
}


.btn-danger {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 12px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-danger:hover {
  background: var(--danger-subtle);
  border-color: var(--danger);
}

.btn-danger-full {
  background: var(--danger);
  border: 1px solid var(--danger);
  color: #fff;
  padding: 12px 16px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  grid-column: 1 / -1;
}

.btn-danger-full:hover {
  background: #c53030;
}

/* ═══ SIDEBAR BADGE ═══════════════════════════════════════════════ */
.sidebar-badge {
  background: var(--danger);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  margin-left: auto;
  min-width: 18px;
  text-align: center;
  line-height: 1.3;
}

/* ═══ AUDIT PANEL ═════════════════════════════════════════════════ */
.audit-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 16px;

  grid-gap: 12px;
}

/* ═══ AUDIT PANEL ═════════════════════════════════════════════════ */


.audit-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  border-left: 4px solid var(--border);
}

.audit-card-count {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}

.audit-card-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.audit-critical {
  border-left-color: var(--danger);
}

.audit-critical .audit-card-count {
  color: var(--danger);
}

.audit-warning {
  border-left-color: var(--warning);
}

.audit-warning .audit-card-count {
  color: var(--warning);
}

.audit-info {
  border-left-color: #3b82f6;
}

.audit-info .audit-card-count {
  color: #3b82f6;
}

.audit-total {
  border-left-color: var(--accent);
}

.audit-total .audit-card-count {
  color: var(--accent);
}

.audit-filters {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.audit-filters>* {
  margin: 4px 4px;
}

.audit-filter {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 14px;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.audit-filter:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
  color: var(--text-primary);
}

.audit-filter.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ═══ DEDUP ACTION BAR ═══════════════════════════════════════════ */
.dedup-bar {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  margin: 8px 0;
  background: var(--surface-alt, rgba(99, 102, 241, 0.08));
  border: 1px solid var(--primary-dim, rgba(99, 102, 241, 0.25));
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

/* ═══ DEDUP ACTION BAR ═══════════════════════════════════════════ */
.dedup-bar>*+* {
  margin-left: 12px;
}

.dedup-bar.hidden {
  display: none;
}

.dedup-bar #dedup-count {
  flex: 1;
  color: var(--text-muted);
}

.dedup-bar .btn {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  background: var(--surface-hover);
  color: var(--text);
  transition: all 0.15s;
}

.dedup-bar .btn:hover {
  background: var(--primary);
  color: #fff;
}

.dedup-bar .btn-danger {
  background: var(--danger)30;
  color: var(--danger);
}

.dedup-bar .btn-danger:hover:not(:disabled) {
  background: var(--danger);
  color: #fff;
}

.dedup-bar .btn-danger:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.dedup-check {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* ═══ INIT WIZARD ═════════════════════════════════════════════════ */
.wizard-dialog {
  position: relative;
  width: 480px;
  max-width: 94vw;
  background: linear-gradient(165deg, #1e1e2e 0%, #161622 100%);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, .5);
  animation: modalPop .3s cubic-bezier(.34, 1.56, .64, 1);
}

.wizard-steps {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.wizard-steps>*+* {
  margin-left: 8px;
}

.wizard-step {
  display: flex;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--bg-tertiary);
  transition: all .3s;
}

.wizard-step>*+* {
  margin-left: 6px;
}

.wizard-step span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--border);
  font-weight: 700;
  font-size: 0.72rem;
}

.wizard-step.active {
  background: var(--primary);
  color: #fff;
}

.wizard-step.active span {
  background: var(--overlay-active);
}

.wizard-step.done {
  color: var(--success);
}

.wizard-step.done span {
  background: var(--success);
  color: #fff;
}

.wizard-page {
  display: none;
}

.wizard-page.active {
  display: block;
  animation: fadeIn .3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.wizard-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.wizard-actions>*+* {
  margin-left: 10px;
}

.wizard-checkbox {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.wizard-checkbox>*+* {
  margin-left: 10px;
}

.wizard-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.wizard-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-6px);
  }

  50% {
    transform: translateX(6px);
  }

  75% {
    transform: translateX(-4px);
  }
}

.shake {
  animation: shake .4s ease;
}

/* ═══ PREMIUM CONFIRM MODAL ═══════════════════════════════════════ */

.confirm-dialog {
  position: relative;
  width: 420px;
  max-width: 92vw;
  background: linear-gradient(165deg, #1e1e2e 0%, #161622 100%);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 20px;
  box-shadow:
    0 0 40px rgba(239, 68, 68, 0.08),
    0 25px 60px var(--backdrop),
    inset 0 1px 0 var(--overlay-subtle);
  overflow: hidden;
  animation: confirmSlideIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-align: center;
  padding: 0 28px 28px;
}

@keyframes confirmSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ─ Red danger strip at top ─ */
.confirm-danger-strip {
  height: 4px;
  background: linear-gradient(90deg, var(--danger), #f97316, var(--danger), var(--danger));
  background-size: 300% 100%;
  animation: dangerShimmer 3s linear infinite;
}

@keyframes dangerShimmer {
  0% {
    background-position: 0% 0%;
  }

  100% {
    background-position: 300% 0%;
  }
}

/* ─ Close button ─ */
.confirm-x {
  position: absolute;
  top: 14px;
  right: 16px;
  background: var(--overlay-hover);
  border: 1px solid var(--overlay-border);
  color: var(--text-muted);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.confirm-x:hover {
  background: var(--danger-subtle);
  color: var(--danger);
  border-color: var(--danger-border);
}

/* ─ Warning icon ─ */
.confirm-icon-wrap {
  display: flex;
  justify-content: center;
  padding-top: 28px;
  margin-bottom: 16px;
}

.confirm-icon-ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--danger-subtle) 0%, transparent 70%);
  border: 2px solid rgba(239, 68, 68, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--danger);
  animation: iconPulse 2.5s ease-in-out infinite;
}

@keyframes iconPulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.25);
  }

  50% {
    box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
  }
}

/* ─ Title & description ─ */
.confirm-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #f1f5f9;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.confirm-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0 0 24px;
  padding: 0 8px;
}

/* ─ Password field ─ */
.confirm-password-group {
  text-align: left;
  margin-bottom: 24px;
}

.confirm-label {
  display: flex;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.confirm-label>*+* {
  margin-left: 6px;
}

.confirm-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--overlay-border);
  border-radius: 12px;
  color: #f1f5f9;
  font-size: 1rem;
  font-family: inherit;
  letter-spacing: 2px;
  transition: all 0.25s;
  box-sizing: border-box;
}

.confirm-input::placeholder {
  color: #475569;
  letter-spacing: 4px;
}

.confirm-input:focus {
  outline: none;
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1), 0 0 20px rgba(239, 68, 68, 0.05);
  background: var(--backdrop);
}

/* ─ Action buttons ─ */
.confirm-actions {
  display: flex;
}

/* ─ Action buttons ─ */
.confirm-actions>*+* {
  margin-left: 12px;
}

.confirm-btn-cancel {
  flex: 1;
  padding: 12px 20px;
  background: var(--overlay-hover);
  border: 1px solid var(--overlay-active);
  border-radius: 12px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}

.confirm-btn-cancel:hover {
  background: var(--overlay-border);
  color: #cbd5e1;
  border-color: var(--overlay-active);
}

.confirm-btn-go {
  flex: 1.3;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--danger) 0%, #b91c1c 100%);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 12px;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

.confirm-btn-go>*+* {
  margin-left: 8px;
}

.confirm-btn-go:hover {
  background: linear-gradient(135deg, var(--danger) 0%, var(--danger) 100%);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.35);
  transform: translateY(-1px);
}

.confirm-btn-go:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.2);
}

.confirm-btn-go:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ─ Modal footer (legacy compat) ─ */
.modal-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  margin-top: 12px;
}

/* ─ Modal footer (legacy compat) ─ */
.modal-footer>*+* {
  margin-left: 10px;
}

/* Small buttons for tables */
.btn-sm {
  padding: 4px 8px;
  font-size: 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.btn-sm:hover {
  background: var(--bg-hover);
}

.btn-danger-sm {
  padding: 4px 8px;
  font-size: 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
}

.btn-danger-sm:hover {
  background: var(--danger-subtle);
}

/* ═══════════════════════════════════════════════════════════════
   PAUSE LOCK SCREEN
   ═══════════════════════════════════════════════════════════════ */

.pause-lock-screen {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pause-lock-screen.hidden {
  display: none;
}

.pause-lock-backdrop {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(10, 12, 20, 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.pause-lock-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 3rem 2.5rem;
  border-radius: 1.5rem;
  background: rgba(30, 34, 50, 0.85);
  border: 1px solid var(--overlay-border);
  box-shadow: 0 25px 60px var(--backdrop);
  max-width: 420px;
  width: 90vw;
  animation: pauseSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes pauseSlideUp {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.pause-lock-icon {
  margin-bottom: 1rem;
  color: var(--warning, var(--warning));
  animation: pausePulseIcon 2s ease-in-out infinite;
}

@keyframes pausePulseIcon {

  0%,
  100% {
    opacity: 0.7;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

.pause-lock-clock {
  font-size: 3rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #fff;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 12px var(--backdrop);
}

.pause-lock-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.25rem;
}

.pause-lock-user {
  font-size: 1rem;
  color: var(--text-muted);
  margin: 0 0 1.5rem;
}

.pause-lock-timer {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  background: rgba(246, 173, 85, 0.12);
  border: 1px solid rgba(246, 173, 85, 0.25);
}

.pause-lock-timer>*+* {
  margin-left: 0.75rem;
}

.pause-timer-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.pause-timer-value {
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--warning, var(--warning));
}

.pause-lock-form {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
  max-width: 100%;
  width: 100%;
}

.pause-input {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--overlay-active);
  background: var(--overlay-border);
  color: #fff;
  font-size: 1.1rem;
  outline: none;
  transition: border-color 0.2s;
  text-align: center;
  letter-spacing: 2px;
  box-sizing: border-box;
}

.pause-input::placeholder {
  color: var(--text-muted);
  letter-spacing: normal;
}

.pause-input:focus {
  border-color: var(--primary, #667eea);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.pause-resume-btn {
  white-space: nowrap;
  padding: 0.85rem 1rem;
  width: 100%;
  margin-top: 1.25rem;
  font-size: 1.1rem;
}

.pause-lock-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

.pause-error {
  margin-top: 0.75rem;
  padding: 0.6rem 1rem;
  border-radius: 0.5rem;
  background: var(--danger-subtle);
  border: 1px solid rgba(229, 62, 62, 0.3);
  color: var(--danger);
  font-size: 0.85rem;
}

.pause-error.hidden {
  display: none;
}

/* Coffee button glow when shift is active */
#btn-pause-shift {
  transition: color 0.2s, background 0.2s;
}

#btn-pause-shift:hover {
  color: var(--warning, var(--warning));
  background: rgba(246, 173, 85, 0.1);
}

/* ═══ SHIFT / CLOTURE HISTORY ═══ */

.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-ferme {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.badge-ouvert {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.badge-pause {
  background: var(--warning-subtle);
  color: var(--warning);
}

tr.clickable {
  cursor: pointer;
  transition: background 0.15s;
}

tr.clickable:hover {
  background: rgba(139, 92, 246, 0.08) !important;
}

.shift-detail-row td {
  padding: 0 !important;
}

.btn-reprint-quart,
.btn-reprint-cloture {
  background: none;
  border: 1px solid var(--overlay-active);
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 14px;
  transition: background .2s;
}

.btn-reprint-quart:hover,
.btn-reprint-cloture:hover {
  background: rgba(139, 92, 246, .25);
}

.payment-chips-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.payment-chip {
  display: inline-block;
  background: rgba(139, 92, 246, .15);
  border: 1px solid rgba(139, 92, 246, .3);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 12px;
  white-space: nowrap;
}

.payment-chip small {
  opacity: .6;
  margin-left: 2px;
}

.shift-detail-card {
  background: var(--bg-secondary, #1a1d2e);
  border-left: 3px solid var(--primary, var(--accent));
  padding: 16px 20px;
  margin: 4px 12px 8px;
  border-radius: 8px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  font-size: 13px;

  grid-gap: 8px;
}


.detail-chips {
  display: flex;
  flex-wrap: wrap;
  margin-top: 6px;
}

.detail-chips>* {
  margin: 4px 4px;
}

.detail-chip {
  background: var(--bg-card, #232636);
  border: 1px solid var(--border-light, #2d3044);
  border-radius: 8px;
  padding: 6px 12px;
  display: flex;
  flex-direction: column;
}

.chip-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary, var(--accent));
  text-transform: uppercase;
}

.chip-value {
  font-size: 13px;
  color: var(--text-primary, #e2e8f0);
}

.shift-detail-card .admin-table {
  margin: 0;
  font-size: 12px;
}

.shift-detail-card .admin-table th {
  padding: 6px 8px;
  font-size: 11px;
}

.shift-detail-card .admin-table td {
  padding: 5px 8px;
}

/* ── Vente blocks inside shift detail ── */

.ventes-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
}

/* ── Vente blocks inside shift detail ── */

.ventes-list>*+* {
  margin-top: 10px;
}

.vente-block {
  background: var(--bg-card, #232636);
  border: 1px solid var(--border-light, #2d3044);
  border-radius: 8px;
  overflow: hidden;
}

.vente-header {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background: rgba(139, 92, 246, 0.08);
  font-size: 13px;
  flex-wrap: wrap;
}

.vente-header>* {
  margin: 6px 6px;
}

.vente-num {
  font-weight: 700;
  color: var(--primary, var(--accent));
}

.vente-time {
  color: var(--text-secondary, var(--text-muted));
  font-size: 12px;
}

.vente-amount {
  font-weight: 600;
  color: var(--success);
}

.vente-mode {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.vente-client {
  color: var(--text-secondary, var(--text-muted));
  font-size: 12px;
  margin-left: auto;
}

.vente-articles-table {
  margin: 0 !important;
  border-radius: 0 !important;
  font-size: 12px;
  table-layout: fixed;
  width: 100%;
}

.vente-articles-table th:nth-child(1),
.vente-articles-table td:nth-child(1) {
  width: 35%;
}

.vente-articles-table th:nth-child(2),
.vente-articles-table td:nth-child(2) {
  width: 22%;
}

.vente-articles-table th:nth-child(3),
.vente-articles-table td:nth-child(3) {
  width: 8%;
  text-align: center;
}

.vente-articles-table th:nth-child(4),
.vente-articles-table td:nth-child(4) {
  width: 15%;
  text-align: right;
}

.vente-articles-table th:nth-child(5),
.vente-articles-table td:nth-child(5) {
  width: 20%;
  text-align: right;
}

.vente-articles-table th {
  padding: 5px 10px !important;
  font-size: 11px !important;
}

.vente-articles-table td {
  padding: 4px 10px !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ═══ SETUP WIZARD ═══════════════════════════════════════════════ */

#setup-screen {
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 30%, var(--accent-subtle), transparent 70%),
    var(--bg-primary);
  overflow-y: auto;
}

#setup-screen .login-container {
  width: 680px;
  max-width: 92vw;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: 36px 40px;
  margin: 20px auto;
}

#setup-screen .login-logo {
  margin-bottom: 24px;
}

.setup-step-dot {
  flex: 1;
  text-align: center;
  padding: 10px 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  transition: all 0.3s;
}

.setup-step-dot.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 2px 12px var(--accent-border);
}

.setup-step-dot.done {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border-color: rgba(16, 185, 129, 0.3);
}

#setup-screen .form-group {
  margin-bottom: 14px;
}

#setup-screen label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#setup-screen input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 1rem;
  box-sizing: border-box;
  transition: var(--transition);
}

#setup-screen input::placeholder {
  color: var(--text-muted);
}

#setup-screen input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

#setup-screen h3 {
  font-size: 1.15rem;
  margin-bottom: 16px;
}

#setup-screen .form-row {
  gap: 16px !important;
}

#setup-screen .btn-lg {
  padding: 16px 32px;
  font-size: 1rem;
  margin-top: 20px;
}

/* ═══════════════════════════════════════════════════════════════════
   CUSTOM DATE PICKER — Premium Dark Theme
   Chrome 74 compatible (flex only, no gap, no grid)
   ═══════════════════════════════════════════════════════════════════ */

.jdp-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9998;
  animation: jdp-fadeIn 0.15s ease;
}

@keyframes jdp-fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes jdp-slideIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.92);
  }

  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.jdp-picker {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  width: 340px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: jdp-slideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Inter', -apple-system, sans-serif;
}

/* Header with selected date */
.jdp-header {
  background: linear-gradient(135deg, var(--accent), #5a4bd1);
  padding: 20px 24px;
}

.jdp-header-year {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 4px;
}

.jdp-header-date {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
}

/* Navigation row */
.jdp-nav {
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: space-between;
  justify-content: space-between;
  padding: 12px 16px 8px;
}

.jdp-nav-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  justify-content: center;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.jdp-nav-btn:active {
  background: var(--bg-hover);
}

.jdp-month-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  cursor: default;
}

/* Day names row */
.jdp-weekdays {
  display: -webkit-flex;
  display: flex;
  padding: 4px 12px 0;
}

.jdp-weekday {
  -webkit-flex: 1;
  flex: 1;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 0;
}

/* Calendar grid */
.jdp-days {
  padding: 4px 12px 12px;
}

.jdp-week {
  display: -webkit-flex;
  display: flex;
}

.jdp-day {
  -webkit-flex: 1;
  flex: 1;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  justify-content: center;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s;
  margin: 1px;
  -webkit-tap-highlight-color: transparent;
}

.jdp-day:active {
  background: var(--accent-glow);
}

.jdp-day.empty {
  cursor: default;
  pointer-events: none;
}

.jdp-day.other-month {
  color: var(--text-muted);
  opacity: 0.4;
}

.jdp-day.today {
  color: var(--accent-light);
  font-weight: 700;
}

.jdp-day.selected {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  border-radius: 50%;
}

.jdp-day.selected:active {
  background: var(--accent-light);
}

/* Footer buttons */
.jdp-footer {
  display: -webkit-flex;
  display: flex;
  -webkit-justify-content: flex-end;
  justify-content: flex-end;
  padding: 8px 16px 14px;
  border-top: 1px solid var(--border);
}

.jdp-footer-btn {
  border: none;
  background: transparent;
  color: var(--accent-light);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 8px 16px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 0.12s;
  -webkit-tap-highlight-color: transparent;
  margin-left: 4px;
}

.jdp-footer-btn:active {
  background: var(--accent-glow);
}

.jdp-footer-btn.clear {
  color: var(--text-muted);
  margin-right: auto;
}

/* Make date inputs look good */
input[data-jdp] {
  cursor: pointer !important;
}

/* ═══════════════════════════════════════════════════════════════════
   LIGHT THEME — Tailscale-inspired
   To disable: delete this entire block → dark theme only
   ═══════════════════════════════════════════════════════════════════ */
[data-theme="light"] {
  /* Core palette — JOVENA brand warm tones */
  --bg-primary: #f4f1ee;
  --bg-secondary: #faf8f6;
  --bg-tertiary: #e8e3de;
  --bg-card: #faf8f6;
  --bg-hover: #ede8e3;
  --bg-input: #f7f4f1;

  --accent: #B5473A;
  --accent-light: #9A3C31;
  --accent-glow: rgba(181, 71, 58, 0.15);

  --success: #2d8659;
  --success-dark: #246e49;
  --success-glow: rgba(45, 134, 89, 0.12);

  --danger: #c53030;
  --warning: #c27803;

  --text-primary: #2d2522;
  --text-secondary: #5c524d;
  --text-muted: #9e938c;

  --border: rgba(80, 50, 30, 0.1);
  --border-light: rgba(80, 50, 30, 0.15);

  --shadow: 0 1px 3px rgba(80, 50, 30, 0.08), 0 1px 2px rgba(80, 50, 30, 0.04);
  --shadow-lg: 0 4px 16px rgba(80, 50, 30, 0.1);

  /* Overlays — warm tints */
  --overlay-subtle: rgba(80, 50, 30, 0.02);
  --overlay-hover: rgba(80, 50, 30, 0.04);
  --overlay-active: rgba(80, 50, 30, 0.07);
  --overlay-border: rgba(80, 50, 30, 0.1);

  /* Status — adjusted for light backgrounds */
  --danger-subtle: rgba(197, 48, 48, 0.08);
  --danger-border: rgba(197, 48, 48, 0.2);
  --success-subtle: rgba(45, 134, 89, 0.08);
  --success-border: rgba(45, 134, 89, 0.2);
  --warning-subtle: rgba(194, 120, 3, 0.1);
  --warning-border: rgba(194, 120, 3, 0.25);
  --accent-subtle: rgba(181, 71, 58, 0.1);
  --accent-border: rgba(181, 71, 58, 0.25);

  /* Backdrop */
  --backdrop: rgba(45, 37, 34, 0.35);
}

/* ─── Login ─────────────────────────────────────────────────────── */
[data-theme="light"] #login-screen {
  background: radial-gradient(ellipse at 50% 30%, rgba(181, 71, 58, 0.08), transparent 70%),
    var(--bg-primary);
}


[data-theme="light"] .numpad-key {
  background: var(--bg-secondary);
}

[data-theme="light"] .numpad-del {
  background: var(--danger-subtle);
  color: var(--danger);
  border-color: var(--danger-border);
}

[data-theme="light"] .numpad-ok {
  background: var(--success-subtle);
  color: var(--success);
  border-color: var(--success-border);
}

/* ─── Header ────────────────────────────────────────────────────── */
[data-theme="light"] .pos-header {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .pos-header::after {
  background: linear-gradient(90deg, #B5473A, #8B4B7A, #2B3A6B);
}

[data-theme="light"] .header-vendeur {
  color: var(--accent);
}

/* ─── Sidebar ───────────────────────────────────────────────────── */
[data-theme="light"] .sidebar-item.active {
  background: linear-gradient(135deg, rgba(181, 71, 58, 0.12), rgba(181, 71, 58, 0.06));
  color: #5C2D1A;
  border-left-color: #B5473A;
  box-shadow: none;
  font-weight: 700;
}

[data-theme="light"] .sidebar-item.active svg {
  stroke: #B5473A;
  filter: none;
}

/* ─── Cart ──────────────────────────────────────────────────────── */
[data-theme="light"] .pos-cart {
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .pos-cart::after {
  background: linear-gradient(180deg, #B5473A, #8B4B7A, #2B3A6B);
}

/* ─── Alerts panel ──────────────────────────────────────────────── */
[data-theme="light"] .pos-alerts-panel {
  background: rgba(250, 251, 253, 0.97);
  box-shadow: var(--shadow-lg);
}

/* ─── Scrollbar ─────────────────────────────────────────────────── */
[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
}

/* ─── Product grid ──────────────────────────────────────────────── */
[data-theme="light"] .product-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px var(--accent-glow);
}

[data-theme="light"] .family-tab.active {
  background: var(--accent);
  color: #ffffff;
}

/* ─── Toast ─────────────────────────────────────────────────────── */
[data-theme="light"] .toast {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* ─── Payment screen ────────────────────────────────────────────── */
[data-theme="light"] .pay-mode-btn.active,
[data-theme="light"] .pay-mode-btn:hover {
  border-color: var(--accent);
  background: rgba(181, 71, 58, 0.05);
}

/* ─── Ensure white text on colored active states ────────────────── */
[data-theme="light"] .numpad-key:active,
[data-theme="light"] .numpad-del:active,
[data-theme="light"] .numpad-ok:active {
  color: #ffffff;
}

/* ─── Active buttons/filters/tabs — light theme contrast fix ───── */
[data-theme="light"] .audit-filter.active {
  background: #B5473A;
  border-color: #B5473A;
  color: #fff;
}

[data-theme="light"] .page-btn.active {
  background: #B5473A;
  border-color: #B5473A;
  color: #fff;
}

[data-theme="light"] .stock-tab.active {
  background: #B5473A;
  color: #fff;
}

[data-theme="light"] .facture-filter.active {
  background: #B5473A;
  border-color: #B5473A;
  color: #fff;
}

[data-theme="light"] .hw-tab.active {
  background: #B5473A;
  color: #fff;
  box-shadow: 0 2px 8px rgba(181, 71, 58, 0.3);
}

/* ─── Theme toggle button ───────────────────────────────────────── */
.theme-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  font-size: 18px;
  line-height: 1;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
  color: var(--text-secondary);
}

.theme-toggle:hover {
  background: var(--bg-hover);
}

.theme-toggle:active {
  transform: scale(0.92);
}