@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Lato:wght@300;400;700&display=swap');

:root {
  --teal: #3d7a74;
  --teal-light: #e8f2f1;
  --teal-dark: #2a5652;
  --terracotta: #c97b5a;
  --gold: #b8955a;
  --bordeaux: #7a3040;
  --cream: #f9f5ef;
  --taupe: #8a8070;
  --text: #2c2825;
  --text-light: #6b6560;
}

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

body {
  font-family: 'Lato', sans-serif;
  background: var(--cream);
  color: var(--text);
  min-height: 100vh;
}

/* HEADER */
header {
  background: var(--teal-dark);
  color: white;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
header .brand {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  letter-spacing: 0.04em;
}
header .brand span { color: var(--gold); }
header .subtitle { font-size: 0.8rem; opacity: 0.7; letter-spacing: 0.12em; text-transform: uppercase; margin-top: 2px; }

/* NAV TABS */
.nav-tabs {
  display: flex;
  background: white;
  border-bottom: 2px solid #eae5de;
  padding: 0 32px;
  gap: 0;
}
.nav-tab {
  padding: 14px 24px;
  cursor: pointer;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--taupe);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}
.nav-tab.active { color: var(--teal); border-bottom-color: var(--teal); }
.nav-tab:hover { color: var(--teal); }

/* MAIN */
main { padding: 28px 32px; max-width: 1100px; margin: 0 auto; }

/* SEARCH BAR */
.search-area {
  display: flex;
  gap: 12px;
  margin-bottom: 28px;
  align-items: center;
}
.search-wrapper {
  flex: 1;
  position: relative;
}
.search-input {
  width: 100%;
  padding: 12px 40px 12px 18px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-family: 'Lato', sans-serif;
  font-size: 0.95rem;
  transition: border-color 0.2s;
  background: white;
  box-sizing: border-box;
}
.search-input:focus { outline: none; border-color: var(--teal); }
.search-clear {
  display: none;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 1rem;
  color: var(--taupe);
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}
.search-clear:hover { color: var(--teal-dark); }
.search-clear.visible { display: block; }
.btn {
  padding: 12px 22px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Lato', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: all 0.2s;
}
.btn-teal { background: var(--teal); color: white; }
.btn-teal:hover { background: var(--teal-dark); }
.btn-gold { background: var(--gold); color: white; }
.btn-gold:hover { background: #a07e48; }
.btn-outline { background: white; color: var(--teal); border: 2px solid var(--teal); }
.btn-outline:hover { background: var(--teal-light); }
.btn-sm { padding: 7px 14px; font-size: 0.78rem; }
.btn-danger { background: var(--bordeaux); color: white; }

/* CLIENT CARD */
.client-card {
  background: white;
  border-radius: 14px;
  box-shadow: 0 3px 16px rgba(0,0,0,0.07);
  overflow: hidden;
  margin-bottom: 20px;
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.client-header {
  background: linear-gradient(135deg, var(--teal-dark), var(--teal));
  color: white;
  padding: 24px 28px 20px;
  position: relative;
}
.client-header-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  font-size: 1.3rem;
  cursor: pointer;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  line-height: 1;
}
.client-header-close:hover { background: rgba(255,255,255,0.3); }
.client-header-identity { padding-right: 44px; }
.client-name { font-family: 'Playfair Display', serif; font-size: 1.5rem; font-weight: 700; }
.client-meta { font-size: 0.82rem; opacity: 0.8; margin-top: 5px; display: flex; flex-wrap: wrap; gap: 4px 0; }
.client-meta span { white-space: nowrap; }
.client-meta span:not(:last-child)::after { content: '·'; margin: 0 6px; opacity: 0.6; }
.client-header-stats {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}
.stamp-count-badge {
  background: rgba(255,255,255,0.13);
  border-radius: 14px;
  padding: 10px 20px;
  text-align: center;
  min-width: 100px;
}
.stamp-count-badge .big { font-size: 1.6rem; font-weight: 700; font-family: 'Playfair Display', serif; line-height: 1.2; }
.stamp-count-badge .label { font-size: 0.7rem; opacity: 0.75; letter-spacing: 0.06em; text-transform: uppercase; margin-top: 2px; }

.client-body { padding: 24px 28px; overflow-y: auto; flex: 1; min-height: 0; }

/* LOYALTY CARD */
.loyalty-card {
  background: linear-gradient(145deg, var(--cream), #f0ebe2);
  border: 2px solid #e0d8cc;
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 22px;
}
.loyalty-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 0.95rem;
  color: var(--teal-dark);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.stamps-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.stamp {
  aspect-ratio: 1;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  border: 2px dashed #cdc5b8;
  background: white;
  position: relative;
  transition: all 0.3s;
  cursor: default;
  overflow: hidden;
}
.stamp.filled {
  border: 2px solid var(--teal);
  background: var(--teal-light);
  box-shadow: 0 2px 8px rgba(61,122,116,0.2);
}
.stamp.filled::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(61,122,116,0.08), transparent 70%);
}
.stamp-label { font-size: 0.6rem; color: var(--taupe); margin-top: 3px; text-align: center; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.stamp.filled .stamp-label { color: var(--teal-dark); }
.stamp-num { font-size: 0.65rem; color: #cdc5b8; font-weight: 700; }
.stamp.filled .stamp-num { display: none; }

/* PROGRESS BAR */
.progress-bar-wrap { margin-top: 6px; }
.progress-bar-track { background: #e0d8cc; border-radius: 50px; height: 8px; overflow: hidden; }
.progress-bar-fill { background: linear-gradient(90deg, var(--teal), var(--gold)); height: 100%; border-radius: 50px; transition: width 0.5s ease; }
.progress-label { font-size: 0.78rem; color: var(--taupe); margin-top: 6px; }

/* ADD STAMP PANEL */
.add-stamp-panel {
  background: var(--teal-light);
  border-radius: 12px;
  padding: 18px 22px;
  margin-bottom: 20px;
}
.add-stamp-title { font-weight: 700; color: var(--teal-dark); font-size: 0.88rem; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 12px; }
.categories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.cat-btn {
  background: white;
  border: 2px solid #ccc;
  border-radius: 10px;
  padding: 10px 8px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  font-family: 'Lato', sans-serif;
}
.cat-btn:hover { border-color: var(--teal); background: var(--teal-light); }
.cat-btn.selected { border-color: var(--teal); background: var(--teal); color: white; }
.cat-btn .cat-icon { font-size: 1.4rem; }
.cat-btn .cat-name { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; margin-top: 4px; color: inherit; }
.cat-btn .cat-value { font-size: 0.68rem; color: var(--gold); margin-top: 1px; }
.cat-btn.selected .cat-value { color: #ffe0a0; }

.stamp-note {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-family: 'Lato', sans-serif;
  font-size: 0.88rem;
  margin-bottom: 12px;
  resize: none;
  background: white;
}
.stamp-note:focus { outline: none; border-color: var(--teal); }

/* REWARD MODAL */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: white;
  border-radius: 18px;
  padding: 36px;
  max-width: 520px;
  width: 90%;
  text-align: center;
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
}
@keyframes popIn { from { opacity:0; transform: scale(0.85); } to { opacity:1; transform: scale(1); } }
.modal-close { position: absolute; top: 14px; right: 18px; background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--taupe); }
.modal-icon { font-size: 3rem; margin-bottom: 10px; }
.modal-title { font-family: 'Playfair Display', serif; font-size: 1.5rem; color: var(--teal-dark); margin-bottom: 8px; }
.modal-sub { color: var(--taupe); font-size: 0.9rem; margin-bottom: 24px; }
.rewards-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.reward-option {
  border: 2px solid #e0d8cc;
  border-radius: 10px;
  padding: 13px 16px;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s;
  font-family: 'Lato', sans-serif;
  background: white;
  width: 100%;
}
.reward-option:hover { border-color: var(--gold); background: #fdf8f0; }
.reward-option.selected { border-color: var(--gold); background: #fdf8f0; box-shadow: 0 2px 10px rgba(184,149,90,0.2); }
.reward-icon { font-size: 1.4rem; }
.reward-text { flex: 1; }
.reward-name { font-weight: 700; font-size: 0.9rem; color: var(--text); }
.reward-desc { font-size: 0.78rem; color: var(--taupe); margin-top: 2px; }

/* HISTORY */
.history-section { margin-top: 8px; }
.history-title { font-size: 0.82rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--taupe); font-weight: 700; margin-bottom: 12px; }
.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f0ebe2;
  font-size: 0.87rem;
}
.history-item:last-child { border-bottom: none; }
.history-icon { font-size: 1.1rem; }
.history-content { flex: 1; }
.history-cat { font-weight: 700; color: var(--text); }
.history-note { color: var(--taupe); font-size: 0.8rem; }
.history-date { font-size: 0.76rem; color: var(--taupe); white-space: nowrap; }
.history-stamps { font-size: 0.75rem; background: var(--teal-light); color: var(--teal-dark); border-radius: 50px; padding: 2px 8px; font-weight: 700; }
.activity-view-divider { width: 1px; height: 20px; background: #e0dbd2; flex-shrink: 0; }
.activity-view-btn { cursor: pointer; display: flex; align-items: center; padding: 4px; flex-shrink: 0; color: var(--teal); opacity: 0.55; transition: opacity 0.2s; }
.activity-view-btn:hover { opacity: 1; }
.activity-view-btn svg { width: 18px; height: 18px; }

/* CLIENTS LIST */
.clients-list { display: flex; flex-direction: column; gap: 10px; }
.client-row {
  background: white;
  border-radius: 10px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
}
.client-row:hover { border-color: var(--teal); box-shadow: 0 4px 14px rgba(61,122,116,0.12); }
.client-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--teal);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  flex-shrink: 0;
  line-height: 1;
}
.client-row-name { font-weight: 700; font-size: 0.95rem; }
.client-row-meta { font-size: 0.78rem; color: var(--taupe); margin-top: 2px; }
.client-row-stamps { margin-left: auto; text-align: center; flex-shrink: 0; }
.mini-stamps { display: flex; gap: 4px; }
.mini-dot { width: 10px; height: 10px; border-radius: 50%; background: #e0d8cc; }
.mini-dot.filled { background: var(--teal); }
.reward-badge { background: var(--gold); color: white; border-radius: 50px; padding: 3px 10px; font-size: 0.72rem; font-weight: 700; margin-top: 4px; }

/* ADD CLIENT */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.82rem; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 700; color: var(--taupe); margin-bottom: 6px; }
.form-input {
  width: 100%;
  padding: 11px 16px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-family: 'Lato', sans-serif;
  font-size: 0.95rem;
  background: white;
  transition: border-color 0.2s;
}
.form-input:focus { outline: none; border-color: var(--teal); }
.form-input.error { border-color: var(--bordeaux); }
.form-error { font-size: 0.78rem; color: var(--bordeaux); margin-top: 4px; min-height: 0; }
.form-error:empty { display: none; }
.duplicate-link { display: inline-block; margin-top: 6px; color: var(--teal); font-weight: 600; text-decoration: none; transition: color 0.15s; }
.duplicate-link:hover { color: var(--teal-dark); text-decoration: underline; }
.modal-sub .duplicate-link { margin-top: 10px; font-size: 0.95rem; }
.required { color: var(--bordeaux); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* STATS */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 28px; }
.stat-card { background: white; border-radius: 12px; padding: 20px 24px; box-shadow: 0 2px 10px rgba(0,0,0,0.06); }
.stat-value { font-family: 'Playfair Display', serif; font-size: 2rem; color: var(--teal); font-weight: 700; }
.stat-label { font-size: 0.8rem; color: var(--taupe); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.06em; }

.section-title { font-family: 'Playfair Display', serif; font-size: 1.15rem; color: var(--teal-dark); margin-bottom: 16px; }
.empty-state { text-align: center; padding: 40px; color: var(--taupe); }
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 10px; }

.tab-content { display: none; }
.tab-content.active { display: block; }

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

/* REWARD READY BANNER */
.reward-ready {
  background: linear-gradient(135deg, var(--gold), var(--terracotta));
  color: white;
  border-radius: 12px;
  padding: 16px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.reward-ready-icon { font-size: 2rem; }
.reward-ready-text .rr-title { font-family: 'Playfair Display', serif; font-size: 1.05rem; }
.reward-ready-text .rr-sub { font-size: 0.82rem; opacity: 0.9; margin-top: 2px; }

.divider { border: none; border-top: 2px solid #eae5de; margin: 20px 0; }

/* CLIENT ACTIONS (Modifier / Supprimer) */
.client-actions {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 10px;
}
.client-actions .btn {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* LOGIN */
.login-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: linear-gradient(135deg, var(--cream), #e8ddd3);
  display: flex; align-items: center; justify-content: center;
}
.login-overlay.hidden { display: none !important; }
.login-card {
  background: white;
  border-radius: 18px;
  padding: 40px 36px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  animation: popIn 0.4s ease;
}
.login-header {
  text-align: center;
  margin-bottom: 28px;
}
.login-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  color: var(--teal-dark);
  margin-bottom: 4px;
}
.login-header p {
  font-size: 0.85rem;
  color: var(--taupe);
  letter-spacing: 0.06em;
}
.login-card label {
  display: block;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--taupe);
  margin-bottom: 6px;
  margin-top: 16px;
}
.login-card input {
  width: 100%;
  padding: 11px 16px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-family: 'Lato', sans-serif;
  font-size: 0.95rem;
  background: white;
  transition: border-color 0.2s;
}
.login-card input:focus { outline: none; border-color: var(--teal); }
.login-error { color: #c0392b; font-size: 0.85rem; margin-top: 10px; }
.logout-btn {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  padding: 5px 14px;
  border-radius: 6px;
  font-family: 'Lato', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}
.logout-btn:hover { background: rgba(255,255,255,0.25); }

/* SYNC BADGE */
.sync-badge {
  font-size: 0.75rem; padding: 2px 10px; border-radius: 12px;
  font-weight: 500;
  cursor: default;
  position: relative;
}
.sync-badge.online { background: #d4edda; color: #155724; }
.sync-badge.offline { background: #fff3cd; color: #856404; }
.sync-badge::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.8);
  color: white;
  font-size: 0.72rem;
  font-weight: 400;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 100;
}
.sync-badge:hover::after { opacity: 1; }

/* TOAST NOTIFICATIONS */
.toast-container {
  position: fixed; bottom: 1rem; right: 1rem; z-index: 10000;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.toast {
  padding: 0.75rem 1rem; border-radius: 8px;
  animation: slideUp 0.3s ease-out;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  font-size: 0.88rem;
}
.toast.success { background: #d4edda; color: #155724; }
.toast.error { background: #f8d7da; color: #721c24; }
.toast.info { background: #d1ecf1; color: #0c5460; }
@keyframes slideUp { from { transform: translateY(1rem); opacity: 0; } }

/* HEADER RIGHT (desktop) */
.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* HAMBURGER (hidden on desktop) */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  z-index: 101;
}
.hamburger-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: white;
  margin: 4px 0;
  border-radius: 2px;
  transition: all 0.3s;
}
.hamburger-btn.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hamburger-btn.open span:nth-child(2) { opacity: 0; }
.hamburger-btn.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* MOBILE MENU (hidden on desktop) */
.mobile-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  background: var(--teal-dark);
  padding: 14px 20px;
  flex-direction: column;
  gap: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 100;
  animation: slideDown 0.25s ease;
}
.mobile-menu.open { display: flex; }
.mobile-menu-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.mobile-menu-row:last-child { border-bottom: none; }
.mobile-menu-label {
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
  line-height: 1;
}
.mobile-menu-link {
  background: none;
  border: none;
  color: white;
  font-family: 'Lato', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 6px;
  transition: background 0.2s;
}
.mobile-menu-link:hover { background: rgba(255,255,255,0.1); }
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* SETTINGS BUTTON (header) */
.settings-btn {
  background: none;
  border: none;
  color: white;
  padding: 4px;
  font-size: 1.5rem;
  cursor: pointer;
  transition: opacity 0.2s;
  line-height: 1;
  opacity: 0.8;
  position: relative;
}
.settings-btn:hover { opacity: 1; }
.settings-btn::after {
  content: 'Paramètres';
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.8);
  color: white;
  font-size: 0.72rem;
  font-weight: 400;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 100;
}
.settings-btn:hover::after { opacity: 1; }

/* SETTINGS PAGE */
.settings-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 28px;
  align-items: start;
}
.settings-sidebar {
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.settings-nav-item {
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--taupe);
  cursor: pointer;
  border-left: 3px solid transparent;
  border-radius: 0 6px 6px 0;
  transition: all 0.2s;
}
.settings-nav-item:hover { color: var(--teal); background: var(--teal-light); }
.settings-nav-item.active { color: var(--teal); border-left-color: var(--teal); background: var(--teal-light); }

.settings-section { display: none; }
.settings-section.active { display: block; }

.settings-card {
  background: white;
  border-radius: 14px;
  padding: 24px 28px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  margin-bottom: 20px;
}
.settings-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: var(--teal-dark);
  margin-bottom: 20px;
}

/* CAPACITY BAR */
.capacity-bar-wrap { margin-bottom: 20px; }
.capacity-bar-track {
  background: #e0d8cc;
  border-radius: 50px;
  height: 12px;
  overflow: hidden;
}
.capacity-fill {
  height: 100%;
  border-radius: 50px;
  transition: width 0.5s ease, background 0.3s;
  background: linear-gradient(90deg, var(--teal), var(--gold));
}
.capacity-fill.warn { background: linear-gradient(90deg, var(--gold), var(--terracotta)); }
.capacity-fill.blocked { background: linear-gradient(90deg, var(--terracotta), var(--bordeaux)); }

.capacity-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--taupe);
}
.capacity-pct { font-weight: 700; }

/* CAPACITY DETAILS */
.capacity-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.capacity-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #f0ebe2;
  font-size: 0.88rem;
}
.capacity-detail-row:last-child { border-bottom: none; }
.capacity-detail-label { color: var(--taupe); }
.capacity-detail-value { font-weight: 700; color: var(--text); }
.capacity-remaining.warn { color: var(--terracotta); }
.capacity-remaining.blocked { color: var(--bordeaux); }

/* SETTINGS INFO BANNER */
.settings-info-banner {
  background: var(--teal-light);
  border: 1px solid rgba(61,122,116,0.15);
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 0.85rem;
  color: var(--teal-dark);
  line-height: 1.5;
}

/* DOC SIZE WARNING (client detail) */
.doc-size-warning {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.84rem;
  color: #856404;
  margin-bottom: 18px;
}

/* TOAST WARNING */
.toast.warning { background: #fff3cd; color: #856404; }

@media (max-width: 600px) {
  header { padding: 14px 16px; position: fixed; top: 0; left: 0; right: 0; z-index: 200; box-shadow: none; }
  header .brand { font-size: 1.15rem; }
  header .subtitle { font-size: 0.75rem; }
  .header-right { display: none; }
  .hamburger-btn { display: block; }

  .nav-tabs { position: fixed; left: 0; right: 0; z-index: 199; background: white; }

  main { padding: 16px; }
  .stamps-grid { grid-template-columns: repeat(3, 1fr); }
  .categories-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }

  /* Search area en colonne inversée */
  .search-area { flex-direction: column-reverse; }
  .search-area .btn { width: 100%; }
  .search-wrapper { width: 100%; }
  .search-input { width: 100%; }

  /* Nav tabs */
  .nav-tabs { padding: 0 16px; }
  .nav-tab { padding: 12px 16px; }

  /* Modales */
  .modal { max-width: 95vw; max-height: 95vh; }
  .modal-title { font-size: 1.3rem; }

  /* Empêcher l'auto-zoom iOS sur les champs de saisie */
  .search-input,
  .form-input,
  .login-card input,
  select,
  textarea { font-size: 16px !important; }

  /* Touch targets */
  .btn { min-height: 44px; }
  .nav-tab { min-height: 44px; display: flex; align-items: center; }
  .client-row { min-height: 56px; }

  /* Client detail : boutons Modifier / Supprimer */
  .client-actions .btn {
    flex: 1;
    text-align: center;
    font-size: 0.75rem;
    padding: 10px 8px;
  }

  /* Bouton ajouter tampon pleine largeur */
  .flex-actions { width: 100%; }
  .flex-actions .btn { width: 100%; text-align: center; }

  /* Settings responsive */
  .settings-layout { grid-template-columns: 1fr; gap: 16px; }
  .settings-sidebar {
    position: static;
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
  }
  .settings-nav-item {
    border-left: none;
    border-bottom: 3px solid transparent;
    border-radius: 6px;
    padding: 8px 14px;
    white-space: nowrap;
    font-size: 0.8rem;
  }
  .settings-nav-item.active { border-bottom-color: var(--teal); border-left-color: transparent; }
  .settings-card { padding: 18px 16px; }
}
