/* ============================================
   Stock Vanderperre — styles mobile-first
   ============================================ */
:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --primary: #1d4ed8;
  --primary-light: #3b82f6;
  --primary-dark: #1e3a8a;
  --success: #16a34a;
  --success-light: #dcfce7;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
  --r: 12px;
  --r-sm: 8px;
  --safe-bottom: env(safe-area-inset-bottom, 0);
  --safe-top: env(safe-area-inset-top, 0);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  overscroll-behavior-y: contain;
}

body {
  padding-bottom: calc(80px + var(--safe-bottom));
  min-height: 100vh;
}

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 16px; }

/* ============= Top bar ============= */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(12px + var(--safe-top)) 16px 12px;
  box-shadow: var(--shadow-md);
}
.brand { font-weight: 600; font-size: 18px; }
.topbar-actions { display: flex; gap: 4px; }
.topbar-actions .icon-btn {
  background: rgba(255,255,255,0.15);
  color: white;
  border: none;
  font-size: 18px;
  width: 38px; height: 38px;
  border-radius: 10px;
  display: grid; place-items: center;
  position: relative;
}
.topbar-actions .icon-btn:active { background: rgba(255,255,255,0.3); }
.badge-count {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--danger);
  color: white;
  font-size: 10px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  display: grid; place-items: center;
  font-weight: 600;
}

/* ============= Stats strip ============= */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 8px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.stat-mini {
  text-align: center;
  padding: 6px 4px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
}
.stat-mini span {
  display: block;
  font-weight: 700;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}
.stat-mini small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stat-mini.alert span { color: var(--danger); }
.stat-mini.value span { font-size: 14px; color: var(--success); }

/* ============= Search bar ============= */
.search-bar {
  position: sticky;
  top: calc(58px + var(--safe-top));
  z-index: 40;
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.search-bar input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 10px 14px;
  background: var(--surface-2);
  outline: none;
}
.search-bar input:focus { border-color: var(--primary); background: white; }

.icon-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px;
  min-height: 40px;
}
.icon-btn.primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.icon-btn.small { padding: 6px 10px; font-size: 14px; min-width: 36px; min-height: 36px; }
.icon-btn:active { transform: scale(0.96); }

/* ============= Filter chips ============= */
.filter-chips {
  display: flex;
  gap: 8px;
  padding: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.filter-chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  white-space: nowrap;
}
.chip.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ============= Tabs content ============= */
.tab-content { display: none; padding-bottom: 16px; }
.tab-content.active { display: block; }

/* ============= Items list ============= */
.items-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 12px;
}
.item-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
}
.item-card:active {
  transform: scale(0.99);
  background: var(--surface-2);
}
.item-card.low { border-left: 4px solid var(--danger); }
.item-card.warn { border-left: 4px solid var(--warning); }

.item-thumb {
  width: 56px; height: 56px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
  font-size: 24px;
  color: var(--muted);
}
.item-thumb img { width: 100%; height: 100%; object-fit: cover; }

.item-info { flex: 1; min-width: 0; }
.item-name {
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item-meta {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item-meta .badge {
  background: #eef2ff;
  color: #4338ca;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  margin-right: 4px;
}

.item-qty {
  text-align: right;
  flex-shrink: 0;
}
.item-qty .qty {
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.item-qty .qty.low { color: var(--danger); }
.item-qty .qty.warn { color: var(--warning); }
.item-qty .qty.ok { color: var(--success); }
.item-qty .unit { font-size: 11px; color: var(--muted); display: block; }

/* Bouton "+1" rapide */
.plus-one-btn {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--success);
  color: white;
  font-weight: 700;
  font-size: 14px;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.35);
  margin-left: 4px;
}
.plus-one-btn:active {
  transform: scale(0.9);
  background: #128340;
}
@keyframes plus-one-flash {
  0%   { background: var(--success-light); }
  100% { background: var(--surface); }
}
.item-card.plus-one-flash {
  animation: plus-one-flash 0.6s ease-out;
}

/* ============= Movements list ============= */
.mov-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 12px;
}
.mov-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow);
}
.mov-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}
.mov-icon.in { background: var(--success-light); color: var(--success); }
.mov-icon.out { background: var(--danger-light); color: var(--danger); }
.mov-icon.adjust { background: #e0e7ff; color: var(--primary); }
.mov-info { flex: 1; min-width: 0; }
.mov-title { font-weight: 600; font-size: 14px; }
.mov-sub { font-size: 12px; color: var(--muted); }
.mov-qty {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 15px;
}
.mov-qty.in { color: var(--success); }
.mov-qty.out { color: var(--danger); }

/* ============= Empty state ============= */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty .big-icon { font-size: 64px; opacity: 0.4; margin-bottom: 12px; }
.empty h3 { margin: 0 0 8px; }

/* ============= Bottom nav ============= */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr auto 1fr 1fr;
  align-items: center;
  padding: 6px 0 calc(6px + var(--safe-bottom));
  z-index: 50;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.04);
}
.nav-btn {
  background: none;
  border: none;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px;
  font-size: 11px;
}
.nav-btn .nav-icon { font-size: 22px; }
.nav-btn.active { color: var(--primary); }
.nav-btn.active .nav-icon { transform: scale(1.1); }

.fab {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 30px;
  font-weight: 300;
  border: none;
  box-shadow: 0 6px 16px rgba(29,78,216,0.4);
  display: grid;
  place-items: center;
  margin: 0 auto;
  margin-top: -16px;
  line-height: 1;
}
.fab:active { transform: scale(0.94); background: var(--primary-dark); }

/* ============= Modals ============= */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.18s;
}
.modal.show { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-content {
  background: var(--surface);
  width: 100%;
  max-width: 600px;
  border-radius: 20px 20px 0 0;
  padding: 16px 16px calc(20px + var(--safe-bottom));
  max-height: 92vh;
  overflow-y: auto;
  animation: slideUp 0.22s;
  box-shadow: var(--shadow-lg);
}
@keyframes slideUp { from { transform: translateY(20%); } to { transform: translateY(0); } }

@media (min-width: 640px) {
  .modal { align-items: center; }
  .modal-content { border-radius: 16px; max-height: 90vh; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: -8px -4px 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { margin: 0; font-size: 17px; }

.modal-footer {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.modal-footer button { flex: 1; min-width: 100px; }

/* ============= Forms ============= */
.form-field { margin-bottom: 12px; }
.form-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  background: var(--surface);
  outline: none;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus { border-color: var(--primary); }
.form-field textarea { resize: vertical; min-height: 50px; }
.form-field small { color: var(--muted); font-size: 12px; display: block; margin-top: 4px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 380px) { .form-row { grid-template-columns: 1fr; } }

.input-with-btn { display: flex; gap: 6px; }
.input-with-btn > *:first-child { flex: 1; }

.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--r-sm);
  padding: 12px 16px;
  font-weight: 600;
  font-size: 15px;
}
.btn-primary:active { background: var(--primary-dark); }

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-weight: 500;
  font-size: 14px;
}
.btn-secondary.small { padding: 8px 12px; font-size: 13px; }
.btn-secondary.block { width: 100%; margin-top: 8px; }
.btn-secondary:active { background: var(--border); }

.btn-danger {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid #fecaca;
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-weight: 500;
}

/* ============= Photo zone ============= */
.photo-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: var(--surface-2);
  border-radius: var(--r);
  margin-bottom: 12px;
}
.photo-placeholder {
  width: 120px; height: 120px;
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: var(--r);
  display: grid; place-items: center;
  color: var(--muted);
}
.photo-placeholder .big-icon { font-size: 36px; opacity: 0.6; }
#itemPhotoPreview {
  width: 140px; height: 140px;
  object-fit: cover;
  border-radius: var(--r);
  border: 1px solid var(--border);
}
.photo-actions { display: flex; gap: 8px; }

.photo-mini-zone { display: flex; align-items: center; gap: 10px; }
#movPhotoPreview { width: 60px; height: 60px; object-fit: cover; border-radius: 8px; }

/* ============= Quantity input ============= */
.qty-input {
  display: grid;
  grid-template-columns: 50px 1fr 50px;
  gap: 4px;
  align-items: stretch;
}
.qty-input input {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 12px 8px;
}
.qty-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 22px;
  font-weight: 700;
}
.qty-btn:active { background: var(--border); }

.qty-presets {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.preset-btn {
  flex: 1;
  min-width: 44px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 6px;
  font-weight: 600;
}

/* ============= Movement type ============= */
.mov-type-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 14px;
}
.mov-type-btn {
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: var(--r);
  padding: 14px;
  font-weight: 700;
  font-size: 16px;
}
.mov-type-btn.in.active { background: var(--success-light); border-color: var(--success); color: var(--success); }
.mov-type-btn.out.active { background: var(--danger-light); border-color: var(--danger); color: var(--danger); }

.mov-item-info {
  background: var(--surface-2);
  border-radius: var(--r);
  padding: 10px 12px;
  margin-bottom: 14px;
}
.mov-item-name { font-weight: 600; }
.mov-item-stock { font-size: 13px; }

/* ============= Detail modal ============= */
.detail-photo {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: var(--r);
  margin-bottom: 12px;
}
.detail-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}
.detail-stat.big {
  text-align: center;
  padding: 12px;
  background: var(--surface-2);
  border-radius: var(--r);
  min-width: 100px;
}
.detail-stat.big .qty-value {
  font-size: 36px;
  font-weight: 700;
  display: block;
  font-variant-numeric: tabular-nums;
}
.detail-stat.big small { color: var(--muted); }
.detail-meta { flex: 1; font-size: 13px; }
.detail-meta div { padding: 2px 0; }
.detail-notes {
  padding: 8px 12px;
  background: var(--surface-2);
  border-radius: var(--r-sm);
  font-size: 13px;
}
.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 14px 0;
}
.big-action {
  border: none;
  border-radius: var(--r);
  padding: 18px;
  font-weight: 700;
  font-size: 18px;
  color: white;
}
.big-action.in { background: var(--success); }
.big-action.out { background: var(--danger); }
.big-action:active { transform: scale(0.97); }

/* ============= Settings ============= */
.settings-section {
  background: var(--surface);
  margin: 12px;
  padding: 16px;
  border-radius: var(--r);
  border: 1px solid var(--border);
}
.settings-section h3 { margin: 0 0 12px; font-size: 15px; }
.cards-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.cards-list .card-row {
  background: var(--surface-2);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  border: 1px solid var(--border);
}
.cards-list .card-row:active { background: var(--border); }
.cards-list .card-row strong { display: block; font-size: 14px; }
.cards-list .card-row small { color: var(--muted); }

.muted { color: var(--muted); }
.small { font-size: 12px; }
code {
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
}

/* ============= Scanner ============= */
.scan-content { padding-bottom: 16px; }
.scan-area {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  background: black;
  border-radius: var(--r);
  overflow: hidden;
}
#scanVideo { width: 100%; height: 100%; object-fit: cover; }
.scan-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.scan-line {
  width: 80%;
  height: 60%;
  border: 2px solid rgba(255,255,255,0.7);
  border-radius: var(--r);
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.3);
}
.scan-status {
  text-align: center;
  margin: 12px 0;
  color: var(--muted);
  font-size: 13px;
}
.scan-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* ============= Lookup price ============= */
.lookup-suppliers {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px 0;
}
.lookup-supplier-row {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}
.lookup-supplier-row:active { background: var(--border); }

/* ============= Toast ============= */
.toast {
  position: fixed;
  bottom: calc(100px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text);
  color: white;
  padding: 10px 18px;
  border-radius: 24px;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  opacity: 0;
  transition: transform 0.25s, opacity 0.25s;
  pointer-events: none;
  max-width: 90%;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

/* ============= Form section ============= */
.form-section { margin-bottom: 12px; }

/* ============= Pending stat ============= */
.stat-mini.pending span { color: var(--warning); }

/* ============= Quick add ============= */
.quick-content { padding-top: 12px; }

/* Champ principal mis en valeur */
.quick-main label { font-size: 13px; color: var(--text); font-weight: 700; }
.quick-main input {
  font-size: 17px;
  font-weight: 500;
  padding: 14px 14px;
  border: 2px solid var(--primary);
  border-radius: var(--r);
}

.quick-photo-zone {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--surface-2);
  border-radius: var(--r-sm);
  margin-bottom: 12px;
}
#quickPhotoPreview {
  width: 56px; height: 56px;
  object-fit: cover;
  border-radius: var(--r-sm);
  flex-shrink: 0;
}
.quick-photo-placeholder {
  width: 56px; height: 56px;
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: var(--r-sm);
  display: grid; place-items: center;
  font-size: 22px;
  color: var(--muted);
  flex-shrink: 0;
}
.quick-photo-buttons { display: flex; gap: 6px; }
.quick-photo-zone small { font-size: 11px; }

/* Options avancées repliables */
.quick-advanced {
  margin-top: 10px;
  border-top: 1px dashed var(--border);
  padding-top: 8px;
}
.quick-advanced summary {
  cursor: pointer;
  color: var(--primary);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 0;
  list-style: none;
}
.quick-advanced summary::-webkit-details-marker { display: none; }
.quick-advanced[open] summary { margin-bottom: 8px; }

/* Bouton vert "& suivant" */
.btn-primary.btn-success {
  background: var(--success);
}
.btn-primary.btn-success:active { background: #128340; }

/* ============= Pending list ============= */
.resolution-header { padding: 12px 16px 0; }
.pending-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 12px;
}
.pending-card {
  background: var(--surface);
  border: 1px solid var(--warning);
  border-left: 4px solid var(--warning);
  border-radius: var(--r);
  padding: 12px;
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.pending-card:active { background: var(--surface-2); }
.pending-card .item-thumb { width: 60px; height: 60px; }
.pending-info .pending-ref {
  font-weight: 600;
  font-size: 14px;
}
.pending-info .pending-name {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pending-info .pending-meta { font-size: 12px; color: var(--muted); }
.pending-qty {
  text-align: right;
  font-weight: 700;
  font-size: 18px;
  color: var(--warning);
  font-variant-numeric: tabular-nums;
}
.pending-qty small { display: block; font-size: 11px; color: var(--muted); font-weight: normal; }

/* ============= Resolve modal (wide on desktop) ============= */
.modal-content.modal-wide {
  max-width: 920px;
}
.resolve-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 720px) {
  .resolve-grid { grid-template-columns: 1fr; }
}
.resolve-side {
  background: var(--surface-2);
  padding: 12px;
  border-radius: var(--r);
}
.resolve-side h4 {
  margin: 0 0 10px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
}
.resolve-photo {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  background: white;
  border-radius: var(--r-sm);
  margin-bottom: 10px;
  border: 1px solid var(--border);
}
.resolve-info {
  background: var(--surface);
  padding: 10px;
  border-radius: var(--r-sm);
  font-size: 13px;
  margin-bottom: 12px;
}
.resolve-info div { padding: 2px 0; }
.resolve-actions-side { margin-top: 10px; }
.resolve-quick-suppliers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 6px;
}
.supplier-btn.highlighted {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  font-weight: 700;
}
.supplier-btn.highlighted:active { background: var(--primary-dark); }

/* Status badge */
.status-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.status-badge.pending { background: var(--warning-light); color: var(--warning); }
.status-badge.validated { background: var(--success-light); color: var(--success); }

/* Bottom nav badge position (override for badge inside nav-btn) */
.bottom-nav .nav-btn { position: relative; }
.bottom-nav .nav-btn .badge-count {
  position: absolute;
  top: 2px; right: 18%;
  background: var(--warning);
  color: white;
  font-size: 10px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  display: grid; place-items: center;
  font-weight: 700;
}

/* Settings cards */
.cards-list .card-row .card-row-actions { display: flex; gap: 4px; }

/* ============= Condition / vétusté ============= */
.condition-info {
  background: var(--surface-2);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  margin-bottom: 12px;
}
.condition-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
@media (max-width: 480px) {
  .condition-presets { grid-template-columns: repeat(3, 1fr); }
}
.preset-condition {
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px 4px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
}
.preset-condition strong { font-size: 13px; display: block; }
.preset-condition small { color: var(--muted); font-size: 11px; }
.preset-condition.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.preset-condition.active small { color: rgba(255,255,255,0.8); }
.condition-result {
  background: var(--surface-2);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  margin-top: 8px;
  font-size: 14px;
}
.condition-result div { padding: 2px 0; }

/* Period rows */
.period-card {
  background: var(--surface-2);
  border-radius: var(--r-sm);
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  border: 1px solid var(--border);
  margin-bottom: 6px;
}
.period-card:active { background: var(--border); }
.period-card.closed { border-left: 4px solid var(--success); }
.period-card.open { border-left: 4px solid var(--primary); }
.period-card .period-name { font-weight: 600; font-size: 14px; }
.period-card .period-meta { font-size: 12px; color: var(--muted); }
.period-card .period-value {
  font-weight: 700;
  font-size: 14px;
  color: var(--success);
  font-variant-numeric: tabular-nums;
}
.period-card .period-status {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-left: 6px;
}
.period-card .period-status.open { background: var(--primary); color: white; }
.period-card .period-status.closed { background: var(--success); color: white; }

.period-info {
  background: var(--surface-2);
  padding: 12px;
  border-radius: var(--r-sm);
  font-size: 13px;
  margin-bottom: 12px;
}
.period-info div { padding: 3px 0; }
.period-actions { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }

/* Depreciation badge on item card */
.depreciation-badge {
  display: inline-block;
  background: var(--warning-light);
  color: var(--warning);
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 4px;
}
