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

:root {
  --primary: #1a56db;
  --primary-dark: #1239a0;
  --primary-light: #eff6ff;
  --accent: #f59e0b;
  --green: #006233;
  --bg: #f3f4f6;
  --surface: #ffffff;
  --border: #e5e7eb;
  --text: #111827;
  --text-muted: #6b7280;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --success: #10b981;
  --radius: 10px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.14);
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.hidden { display: none !important; }

/* ══════════════════════════════
   LOGIN PAGE
══════════════════════════════ */
#login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 24px;
}
.login-bg {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #006233 0%, #004d26 40%, #003d1e 70%, #001a0d 100%);
  z-index: 0;
}
.login-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.login-card {
  position: relative;
  z-index: 1;
  background: white;
  border-radius: 20px;
  padding: 40px 36px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 24px 64px rgba(0,0,0,0.35);
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.login-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
}
.login-logo-icon { font-size: 2rem; }
.login-logo-name {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--green);
  letter-spacing: -0.5px;
}
.login-title {
  text-align: center;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
}
.login-subtitle {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.login-options { display: flex; flex-direction: column; gap: 12px; }
.login-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: white;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  width: 100%;
}
.login-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.admin-btn:hover  { border-color: var(--primary); background: var(--primary-light); }
.viewer-btn:hover { border-color: var(--green); background: #f0fdf4; }
.agent-btn:hover  { border-color: #f59e0b; background: #fffbeb; }
.login-btn-icon { font-size: 1.8rem; flex-shrink: 0; }
.login-btn-title { font-weight: 700; font-size: 0.95rem; margin-bottom: 3px; }
.admin-btn .login-btn-title  { color: var(--primary); }
.viewer-btn .login-btn-title { color: var(--green); }
.agent-btn .login-btn-title  { color: #d97706; }
.btn-primary.viewer-btn-submit { background: var(--green); }
.btn-primary.viewer-btn-submit:hover { background: #004d20; }
.login-btn-desc { font-size: 0.78rem; color: var(--text-muted); }
.admin-form { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--border); padding-top: 16px; }
.pwd-wrap { position: relative; display: flex; align-items: center; }
.pwd-wrap input { flex: 1; }
.pwd-eye { position: absolute; right: 10px; background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 1rem; padding: 4px; line-height: 1; flex-shrink: 0; }
.pwd-eye:hover { color: var(--text); }
.ma-field-wrap .pwd-eye { position: static; padding: 0 10px; border-left: 1.5px solid var(--border); line-height: 42px; font-size: 1rem; }
.copy-wait-msg {
  background: #1e3a5f;
  color: #93c5fd;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  text-align: center;
  margin-top: 4px;
}
.login-error {
  background: var(--danger-light);
  color: var(--danger);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  text-align: center;
}
.btn-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  text-align: center;
  text-decoration: underline;
}
.login-footer {
  position: relative;
  z-index: 1;
  color: rgba(255,255,255,0.4);
  font-size: 0.75rem;
  margin-top: 20px;
}
.visitor-form { display: flex; flex-direction: column; gap: 12px; }
.equipe-link { text-align: center; }
.equipe-link a { font-size: 0.78rem; color: var(--text-muted); text-decoration: none; border-bottom: 1px dashed var(--border); padding-bottom: 1px; }
.equipe-link a:hover { color: var(--primary); border-bottom-color: var(--primary); }

/* ── Split login card ─────────────────────────────────── */
.login-card-split {
  display: flex;
  flex-direction: row;
  padding: 0;
  max-width: 720px;
  overflow: hidden;
  gap: 0;
}

/* Left panel */
.lc-left {
  background: linear-gradient(160deg, #006233 0%, #004d26 60%, #003820 100%);
  color: white;
  padding: 36px 28px;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 240px;
  flex: 0 0 240px;
}
.lc-logo { margin-bottom: 10px; }
.lc-logo-icon { font-size: 2.4rem; }
.lc-brand {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}
.lc-tagline {
  font-size: 0.76rem;
  opacity: .7;
  line-height: 1.5;
  margin-bottom: 20px;
}
.lc-divider {
  height: 1px;
  background: rgba(255,255,255,.15);
  margin-bottom: 20px;
}
.lc-features { display: flex; flex-direction: column; gap: 12px; }
.lc-feat {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.8rem;
  opacity: .9;
  line-height: 1.4;
}
.lc-feat-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }

/* Right panel */
.lc-right {
  flex: 1;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: white;
}
.lc-access-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f0fdf4;
  color: var(--green);
  border: 1.5px solid #bbf7d0;
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  align-self: flex-start;
}
.lc-right-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: -10px;
}

/* Steps */
.lc-steps { display: flex; flex-direction: column; gap: 12px; }
.lc-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.lc-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 0.78rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.lc-step-title { font-size: 0.85rem; font-weight: 700; color: var(--text); }
.lc-step-desc  { font-size: 0.76rem; color: var(--text-muted); margin-top: 1px; }
.lc-optional {
  font-size: 0.7rem;
  font-weight: 600;
  background: #fef3c7;
  color: #92400e;
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 4px;
  vertical-align: middle;
}

/* Form */
.lc-form { display: flex; flex-direction: column; gap: 10px; }
.lc-submit-btn { padding: 13px; font-size: 0.95rem; font-weight: 700; border-radius: 10px; }

/* Responsive: stack on small screens */
@media (max-width: 600px) {
  .login-card-split { flex-direction: column; }
  .lc-left { flex: none; padding: 24px 20px; }
  .lc-features { display: none; }
  .lc-right { padding: 24px 20px; }
}

/* ══════════════════════════════
   HEADER
══════════════════════════════ */
header {
  background: var(--primary);
  color: white;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}
.header-inner {
  width: 100%;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
}
.header-left { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.header-right { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }

.nav-btn {
  background: rgba(255,255,255,0.12);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  line-height: 1;
}
.nav-btn:hover:not(:disabled) { background: rgba(255,255,255,0.25); }
.nav-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.home-btn { font-size: 1rem; }

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 800;
  font-size: 1.05rem;
  user-select: none;
  letter-spacing: -0.3px;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.15s;
}
.logo:hover { background: rgba(255,255,255,0.1); }
.logo-icon { font-size: 1.2rem; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  flex-wrap: nowrap;
  overflow: hidden;
  flex: 1;
  min-width: 0;
}
.bc-sep { opacity: 0.4; flex-shrink: 0; }
.bc-item {
  cursor: pointer;
  padding: 3px 7px;
  border-radius: 5px;
  transition: background 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
  opacity: 0.85;
}
.bc-item:hover { background: rgba(255,255,255,0.15); opacity: 1; }
.bc-item.current { opacity: 1; font-weight: 600; cursor: default; }
.bc-item.current:hover { background: transparent; }

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.2px;
  white-space: nowrap;
  max-width: 260px;
}
.rb-role { font-weight: 700; }
.rb-sep  { opacity: 0.6; font-weight: 400; }
.rb-name { font-weight: 500; opacity: 0.92; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.role-badge.rb-admin      { background: var(--accent);           color: #1a1a00; }
.role-badge.rb-agent      { background: #7c3aed;                 color: #fff; }
.role-badge.rb-commercial { background: #0f766e;                 color: #fff; }
.role-badge.rb-demo       { background: #2563eb;                 color: #fff; }
.role-badge.rb-viewer     { background: rgba(255,255,255,0.2);   color: #fff; }
.icon-btn {
  background: rgba(255,255,255,0.12);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.icon-btn:hover { background: rgba(255,255,255,0.25); }

/* ══════════════════════════════
   MAIN LAYOUT
══════════════════════════════ */
main {
  width: 100%;
  padding: 24px 18px;
}

/* ══════════════════════════════
   HERO BANNER (Home page)
══════════════════════════════ */
.hero {
  background: linear-gradient(135deg, #004d26 0%, var(--primary) 100%);
  border-radius: 16px;
  padding: 32px 36px;
  color: white;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  right: -40px;
  top: -40px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
}
.hero::after {
  content: '';
  position: absolute;
  right: 60px;
  bottom: -60px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
}
.hero-tag {
  display: inline-block;
  background: rgba(255,255,255,0.18);
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
.hero-title {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 10px;
}
.hero-desc {
  font-size: 0.9rem;
  opacity: 0.85;
  max-width: 520px;
  line-height: 1.6;
}
.hero-stats {
  display: flex;
  gap: 24px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hero-stat-num { font-size: 1.4rem; font-weight: 800; }
.hero-stat-label { font-size: 0.75rem; opacity: 0.7; }

/* ══════════════════════════════
   PAGE HEADER
══════════════════════════════ */
.page-header {
  margin-bottom: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.page-title { font-size: 1.3rem; font-weight: 800; color: var(--text); }
.page-subtitle { font-size: 0.85rem; color: var(--text-muted); margin-top: 4px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ══════════════════════════════
   BUTTONS
══════════════════════════════ */
.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-primary.full-width { width: 100%; justify-content: center; }

.btn-secondary {
  background: white;
  color: var(--text);
  border: 1.5px solid var(--border);
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.btn-secondary:hover { border-color: var(--primary); background: var(--primary-light); }

.btn-danger-sm {
  background: white;
  color: var(--danger);
  border: 1.5px solid #fecaca;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-danger-sm:hover { background: var(--danger-light); border-color: var(--danger); }

/* ══════════════════════════════
   SEARCH
══════════════════════════════ */
.search-bar { margin-bottom: 20px; }
.search-bar input {
  width: 100%;
  max-width: 600px;
  padding: 10px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  outline: none;
  background: white;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-bar input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,86,219,0.12); }

/* ══════════════════════════════
   SECTOR GRID
══════════════════════════════ */
.sector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}
.sector-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.2s, transform 0.15s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sector-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.sector-card-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.sector-card-name { font-size: 0.875rem; font-weight: 600; line-height: 1.3; }
.badge {
  display: inline-block;
  background: #eff6ff;
  color: var(--primary);
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 700;
}
.badge-green { background: #dcfce7; color: #166534; }
.badge-pref  { background: #ede9fe; color: #6d28d9; }

/* ── NIVEAU 1 : Secteur avec contenu ── */
.sector-card.has-content {
  border-color: var(--primary);
  border-left: 4px solid var(--primary);
  background: linear-gradient(135deg, #f8fbff 0%, #eff6ff 100%);
}
.sector-card.has-content:hover { border-color: var(--primary-dark); }
.sector-card.has-content .sector-card-icon {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
}
.sector-card.has-content .sector-card-name { color: var(--primary-dark); font-weight: 700; }

/* ══════════════════════════════
   DATE CARDS
══════════════════════════════ */
.date-list { display: flex; flex-direction: column; gap: 12px; }
.date-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.15s;
}
.date-card:hover { box-shadow: var(--shadow); }

/* ── NIVEAU 2 : Date avec contenu ── */
.date-card.has-content {
  border-color: var(--primary);
  border-left: 4px solid var(--primary);
}
.date-card.has-content .date-card-header { background: linear-gradient(135deg, #f8fbff, #eff6ff); }
.date-card.has-content .date-folder-icon::after { content: ' '; }
.date-card.has-content .date-label { color: var(--primary-dark); }
.date-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
  gap: 12px;
}
.date-card-header:hover { background: #f9fafb; }
.date-info { display: flex; align-items: center; gap: 12px; }
.date-folder-icon { font-size: 1.3rem; }
.date-label { font-weight: 700; font-size: 0.95rem; }
.date-summary { font-size: 0.78rem; color: var(--text-muted); margin-top: 3px; }
.date-card-actions { display: flex; align-items: center; gap: 8px; }
.chevron { font-size: 1rem; color: var(--text-muted); transition: transform 0.2s; display: inline-block; }
.chevron.open { transform: rotate(90deg); }

/* ══════════════════════════════
   TYPE LIST (inside date card)
══════════════════════════════ */
.type-list {
  border-top: 1px solid var(--border);
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  background: var(--border);
  gap: 1px;
}
.type-list.open { display: grid; }
.type-item {
  background: var(--surface);
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: background 0.15s;
  border-left: 3px solid transparent;
}
.type-item:hover { background: var(--primary-light); }
.type-item-name { font-size: 0.83rem; font-weight: 500; }
.type-count-chip {
  background: #f3f4f6;
  color: var(--text-muted);
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── NIVEAU 3 : Type avec contenu ── */
.type-item.has-content {
  background: #f0f7ff;
  border-left-color: var(--primary);
}
.type-item.has-content:hover { background: #dbeafe; }
.type-item.has-content .type-item-name { font-weight: 700; color: var(--primary-dark); }
.type-count-chip.has-items { background: var(--primary); color: white; }

/* ══════════════════════════════
   WILAYA GRID
══════════════════════════════ */
.wilaya-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 10px;
}
.wilaya-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}
.wilaya-card:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-1px); }

/* Empty wilaya — muted */
.wilaya-num {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: #f3f4f6;
  color: #9ca3af;
  font-size: 0.62rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.wilaya-name { font-size: 0.83rem; font-weight: 500; flex: 1; color: var(--text-muted); }
.wilaya-img-count { font-size: 1rem; font-weight: 800; color: transparent; }

/* Wilaya WITH images — visually distinct */
.wilaya-card.has-images {
  border-color: var(--primary);
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  box-shadow: 0 2px 10px rgba(26,86,219,0.15);
}
.wilaya-card.has-images:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(26,86,219,0.25); }
.wilaya-card.has-images .wilaya-num {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 6px rgba(26,86,219,0.35);
}
.wilaya-card.has-images .wilaya-name { font-weight: 700; color: var(--text); }
.wilaya-card.has-images .wilaya-img-count {
  color: var(--primary);
  background: rgba(26,86,219,0.12);
  padding: 2px 7px;
  border-radius: 10px;
}
/* Small "has content" dot indicator */
.wilaya-card.has-images::after {
  content: '';
  position: absolute;
  top: 8px; right: 8px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 2px #dbeafe;
}

.wilaya-search { margin-bottom: 16px; }
.wilaya-search input {
  width: 100%;
  max-width: 320px;
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  outline: none;
}
.wilaya-search input:focus { border-color: var(--primary); }

/* ══════════════════════════════
   IMAGE GALLERY
══════════════════════════════ */
.gallery-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.gallery-info { font-weight: 600; font-size: 0.9rem; }
.gallery-tools { display: flex; gap: 8px; flex-wrap: wrap; }

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  margin-bottom: 20px;
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--primary); background: var(--primary-light); }
.upload-zone-icon { font-size: 2.2rem; margin-bottom: 8px; }
.upload-zone-text { font-size: 0.9rem; color: var(--text-muted); }
.upload-zone-text strong { color: var(--primary); }
#file-input { display: none; }

.upload-progress { display: none; margin-bottom: 16px; }
.upload-progress.active { display: block; }
.progress-bar { height: 6px; background: #e5e7eb; border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); transition: width 0.3s; border-radius: 3px; }
.progress-text { font-size: 0.78rem; color: var(--text-muted); margin-top: 6px; }

/* Selection bar */
.selection-bar {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: #1e40af;
  color: white;
  border-radius: var(--radius);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.selection-bar.active { display: flex; }
.selection-count { font-weight: 700; font-size: 0.9rem; flex: 1; }
.btn-sel-action {
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  padding: 6px 14px;
  border-radius: 7px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  display: flex; align-items: center; gap: 5px;
}
.btn-sel-action:hover { background: rgba(255,255,255,0.35); }
.btn-sel-action.danger { background: rgba(239,68,68,0.6); }
.btn-sel-action.danger:hover { background: rgba(239,68,68,0.85); }

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.image-card {
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid var(--border);
  background: var(--surface);
  transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
  position: relative;
}
.image-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.image-card.selected { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,86,219,0.2); }
.image-card img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  cursor: pointer;
  display: block;
}
.image-card-overlay {
  position: absolute;
  top: 6px; left: 6px;
  display: none;
}
.select-mode .image-card-overlay { display: block; }
.img-checkbox {
  width: 20px; height: 20px;
  accent-color: var(--primary);
  cursor: pointer;
  border-radius: 4px;
}
.image-card-footer {
  padding: 7px 8px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.image-name {
  font-size: 0.72rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.img-actions { display: flex; gap: 4px; }
.img-action-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 3px 5px;
  border-radius: 5px;
  font-size: 0.85rem;
  transition: background 0.15s;
}
.img-action-btn:hover { background: #f3f4f6; }

/* ══════════════════════════════
   EMPTY STATE
══════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}
.empty-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-text { font-size: 1rem; font-weight: 600; color: var(--text); }
.empty-sub { font-size: 0.85rem; margin-top: 6px; }

/* ══════════════════════════════
   TYPE BADGE COLORS
══════════════════════════════ */
.type-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
}
.type-appels-offres { background: #dbeafe; color: #1e40af; }
.type-consultations { background: #e0e7ff; color: #3730a3; }
.type-attributions { background: #d1fae5; color: #065f46; }
.type-prorogations { background: #fef3c7; color: #92400e; }
.type-annulations { background: #fee2e2; color: #991b1b; }
.type-infructuosites { background: #ede9fe; color: #4c1d95; }
.type-mises-en-demeures { background: #fce7f3; color: #9d174d; }
.type-resiliations { background: #ffedd5; color: #9a3412; }
.type-concours { background: #ecfdf5; color: #14532d; }
.type-vente-encheres { background: #fdf4ff; color: #6b21a8; }

/* ══════════════════════════════
   MODAL
══════════════════════════════ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
}
.modal-box {
  position: relative;
  background: white;
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-box h3 { font-size: 1.05rem; font-weight: 700; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }
.form-group input, .form-group select {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s;
  background: white;
}
.form-group input:focus, .form-group select:focus { border-color: var(--primary); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }

.move-current { background: #f9fafb; border-radius: 8px; padding: 10px 14px; }
.move-label { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; }
.move-path { font-size: 0.85rem; font-weight: 500; color: var(--text); }

/* ══════════════════════════════
   LIGHTBOX
══════════════════════════════ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: stretch;
  justify-content: center;
}
.lightbox-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.93);
}
.lightbox-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}
.lightbox-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(0,0,0,0.5);
  flex-shrink: 0;
  gap: 12px;
  flex-wrap: wrap;
}
.lb-counter {
  color: rgba(255,255,255,0.7);
  font-size: 0.82rem;
  white-space: nowrap;
}
.lb-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.lb-btn {
  background: rgba(255,255,255,0.12);
  border: none;
  color: white;
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.lb-btn:hover { background: rgba(255,255,255,0.25); }
.lb-zoom-level { min-width: 50px; text-align: center; font-variant-numeric: tabular-nums; }
.lb-dl { background: rgba(26,86,219,0.5); }
.lb-dl:hover { background: rgba(26,86,219,0.75); }
.lb-close-btn { background: rgba(239,68,68,0.4); }
.lb-close-btn:hover { background: rgba(239,68,68,0.7); }

.lightbox-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow: hidden;
  padding: 8px;
  min-width: 0;
}
.lb-img-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  height: 100%;
  cursor: zoom-in;
  min-width: 0;
}
.lb-img-container.zoomed {
  cursor: zoom-out;
  overflow: auto;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 12px;
}
#lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  user-select: none;
  display: block;
}
.lightbox-prev, .lightbox-next {
  background: rgba(255,255,255,0.1);
  border: none;
  color: white;
  border-radius: 50%;
  width: 44px; height: 44px;
  font-size: 1.6rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}
.lightbox-prev:hover, .lightbox-next:hover { background: rgba(255,255,255,0.25); }
@media (max-width: 480px) {
  .lightbox-prev, .lightbox-next { width: 36px; height: 36px; font-size: 1.3rem; }
  .lb-dl span { display: none; }
}

/* ══════════════════════════════
   TOAST
══════════════════════════════ */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: #1f2937;
  color: white;
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 0.875rem;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.2s ease;
  max-width: 300px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast.success { background: #065f46; }
.toast.error { background: #7f1d1d; }
.toast.warning { background: #78350f; }

.stats-bar {
  background: rgba(0,0,0,0.18);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 6px 20px;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.75);
}
.stats-bar.hidden { display: none; }
.stats-item strong { color: #fff; font-weight: 700; }
.stats-sep { opacity: 0.4; }
@keyframes slideIn {
  from { transform: translateX(110%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.loading { padding: 60px; text-align: center; color: var(--text-muted); }

/* ══════════════════════════════
   VIEWER NOTICE BANNER
══════════════════════════════ */
.viewer-notice {
  background: #fef9c3;
  border: 1px solid #fde047;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 0.83rem;
  color: #713f12;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

/* ══════════════════════════════
   RESPONSIVE — MOBILE FIRST
══════════════════════════════ */
@media (max-width: 640px) {
  main { padding: 12px 10px; }

  /* Header */
  .logo-text { display: none; }
  .header-inner { gap: 6px; padding: 0 10px; }
  .header-left { gap: 4px; }
  .header-right { gap: 5px; }
  .nav-btn { width: 28px; height: 28px; font-size: 1rem; }
  .icon-btn { width: 28px; height: 28px; font-size: 0.9rem; }
  .role-badge { font-size: 0.68rem; padding: 2px 7px; max-width: 160px; }
  .rb-name { max-width: 70px; }
  .breadcrumb { display: none; }

  /* Hero */
  .hero { padding: 18px 16px; border-radius: 12px; margin-bottom: 16px; }
  .hero-title { font-size: 1.1rem; }
  .hero-desc { font-size: 0.82rem; }
  .hero-stats { gap: 14px; margin-top: 14px; }
  .hero-stat-num { font-size: 1.2rem; }

  /* Grids */
  .sector-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .sector-card { padding: 14px 12px; }
  .sector-card-icon { width: 34px; height: 34px; font-size: 1rem; }
  .sector-card-name { font-size: 0.8rem; }

  .wilaya-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .wilaya-card { padding: 10px 10px; gap: 8px; }
  .wilaya-num { width: 28px; height: 28px; font-size: 0.65rem; }
  .wilaya-name { font-size: 0.78rem; }

  .image-grid { grid-template-columns: 1fr 1fr; gap: 8px; }

  /* Type list */
  .type-list { grid-template-columns: 1fr 1fr; }
  .type-item-name { font-size: 0.78rem; }

  /* Page header */
  .page-header { flex-direction: column; align-items: flex-start; }
  .page-actions { width: 100%; }
  .page-actions .btn-primary,
  .page-actions .btn-secondary { flex: 1; justify-content: center; }

  /* Upload zone */
  .upload-zone { padding: 20px 12px; }
  .upload-zone-icon { font-size: 1.8rem; }

  /* Buttons */
  .btn-primary, .btn-secondary { font-size: 0.82rem; padding: 8px 14px; }

  /* Date card */
  .date-label { font-size: 0.88rem; }
  .date-summary { font-size: 0.72rem; }

  /* Gallery toolbar */
  .gallery-toolbar { flex-direction: column; align-items: flex-start; }

  /* Selection bar */
  .selection-bar { gap: 8px; }
  .btn-sel-action { padding: 5px 10px; font-size: 0.78rem; }

  /* Viewer notice */
  .viewer-notice { font-size: 0.78rem; padding: 8px 12px; }

  /* Lightbox toolbar */
  .lightbox-toolbar { padding: 8px 10px; }
  .lb-btn { padding: 5px 8px; font-size: 0.75rem; }
  .lb-dl { padding: 5px 10px; }
}

@media (max-width: 380px) {
  .sector-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .wilaya-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
  .image-grid { grid-template-columns: 1fr 1fr; }
}

/* ══════════════════════════════════════════════
   OCR STATUS BADGES
══════════════════════════════════════════════ */
.ocr-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 20px; font-size: .7rem; font-weight: 600;
}
.ocr-pending  { background: #f3f4f6; color: #6b7280; }
.ocr-done     { background: #d1fae5; color: #065f46; }
.ocr-failed   { background: #fef3c7; color: #92400e; }
.ocr-manual   { background: #dbeafe; color: #1e40af; }

/* ══════════════════════════════════════════════
   IMAGE + METADATA CARD (gallery)
══════════════════════════════════════════════ */
.image-list { display: flex; flex-direction: column; gap: 16px; }

.image-meta-card {
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-template-rows: auto;
  grid-template-areas: "check check" "img meta";
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow .2s;
}
.image-meta-card:hover { box-shadow: var(--shadow-lg); }

.imc-check {
  grid-area: check;
  padding: 8px 12px 0;
  display: flex; align-items: center; gap: 8px;
}
.imc-check input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary); }

.imc-image {
  grid-area: img;
  position: relative; cursor: pointer; overflow: hidden;
  background: #000; min-height: 180px;
  display: flex; align-items: center; justify-content: center;
}
.imc-image img {
  width: 100%; height: 100%; object-fit: contain;
  display: block; transition: opacity .2s;
}
.imc-image:hover img { opacity: .88; }
.imc-img-hint {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,.55); color: #fff; font-size: .72rem;
  text-align: center; padding: 5px; opacity: 0; transition: opacity .2s;
}
.imc-image:hover .imc-img-hint { opacity: 1; }

.imc-meta {
  grid-area: meta;
  padding: 14px 16px; display: flex; flex-direction: column; gap: 8px;
}
.imc-meta.rtl { direction: rtl; text-align: right; font-family: 'Segoe UI', Tahoma, Arial, sans-serif; }

.imc-status-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  flex-wrap: wrap;
}
.imc-filename { font-size: .68rem; color: var(--text-muted); word-break: break-all; }

.imc-field { display: flex; flex-direction: column; gap: 2px; }
.imc-field label {
  font-size: .68rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .04em;
}
.imc-field .imc-val {
  font-size: .82rem; color: var(--text);
  background: #f9fafb; border-radius: 6px; padding: 5px 8px;
  min-height: 28px; border: 1px solid var(--border);
  word-break: break-word; white-space: pre-wrap;
}
.imc-field .imc-val.empty { color: var(--text-muted); font-style: italic; }

.imc-actions {
  display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px;
  padding-top: 8px; border-top: 1px solid var(--border);
}
.btn-sm {
  padding: 5px 10px; font-size: .75rem; font-weight: 600;
  border-radius: 6px; border: 1px solid var(--border);
  background: #f9fafb; color: var(--text); cursor: pointer;
  transition: background .15s, border-color .15s;
  white-space: nowrap;
}
.btn-sm:hover { background: #f3f4f6; border-color: #d1d5db; }
.btn-sm.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-sm.primary:hover { background: var(--primary-dark); }
.btn-sm.danger { color: var(--danger); border-color: #fca5a5; }
.btn-sm.danger:hover { background: var(--danger-light); }
.btn-sm.ocr-btn { color: #7c3aed; border-color: #c4b5fd; background: #f5f3ff; }
.btn-sm.ocr-btn:hover { background: #ede9fe; }
.btn-sm:disabled { opacity: .5; cursor: not-allowed; }

/* ── Modal sizes ── */
.modal-box-lg  { max-width: 620px; width: 95%; }
.modal-box-xl  { max-width: 820px; width: 96%; }

/* ── Metadata modal — full redesign ── */
.modal-meta-box {
  max-width: 1060px; width: 97%;
  padding: 20px 22px 16px;
  display: flex; flex-direction: column; gap: 0;
  max-height: calc(100dvh - 40px);
  overflow: hidden;
}
.meta-header {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 14px;
  flex-shrink: 0;
}
.meta-header h3 { margin: 0; font-size: 1.05rem; }
.meta-required-hint { font-size: .72rem; color: var(--text-muted); }
.req-star { color: #ef4444; font-weight: 700; }
label.required::after { content: ' *'; color: #ef4444; }

/* Two-panel layout */
.meta-two-panels {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 16px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
@media (max-width: 780px) {
  .meta-two-panels { grid-template-columns: 1fr; overflow-y: auto; }
}

/* Left — OCR panel */
.meta-ocr-panel {
  display: flex; flex-direction: column; gap: 4px;
  background: #f8fafc; border: 1px solid var(--border);
  border-radius: 10px; padding: 12px;
  min-height: 0; overflow-y: auto;
}
.meta-panel-title {
  font-size: .78rem; font-weight: 700; color: #374151;
}
.meta-panel-hint {
  font-size: .68rem; color: var(--text-muted); margin-bottom: 4px;
}
.meta-ocr-area {
  flex: 1; width: 100%; box-sizing: border-box;
  min-height: 180px; resize: vertical;
  font-size: .78rem; line-height: 1.7;
  color: #1e293b; font-family: 'Courier New', monospace;
  background: #fff; border: 1.5px solid #e2e8f0;
  border-radius: 7px; padding: 12px 14px;
  /* unicode-bidi allows dir=auto to work correctly on textarea */
  unicode-bidi: plaintext;
}

/* Right — fields panel */
.meta-fields-panel { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; min-height: 0; }

/* Section blocks */
.meta-section {
  background: #fff; border: 1px solid #e8edf3;
  border-radius: 10px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 9px;
}
.meta-section-head {
  font-size: .72rem; font-weight: 700; color: #6366f1;
  text-transform: uppercase; letter-spacing: .04em;
  padding-bottom: 6px; border-bottom: 1px solid #e8edf3;
}
.meta-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
@media (max-width: 600px) { .meta-row-2 { grid-template-columns: 1fr; } }

/* Inputs / textareas */
.meta-section input[type=text],
.meta-section textarea {
  width: 100%; box-sizing: border-box;
  border: 1.5px solid #e2e8f0; border-radius: 7px;
  padding: 7px 10px; font-size: .82rem;
  font-family: inherit; transition: border-color .18s, box-shadow .18s;
  background: #fafbfc;
}
.meta-section input[type=text]:focus,
.meta-section textarea:focus {
  outline: none; border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
  background: #fff;
}
.meta-section textarea { resize: vertical; }

/* Date inputs */
.date-input-wrap { display: flex; align-items: center; gap: 5px; }
.date-text { flex: 1; min-width: 0; }
.date-hidden { position: absolute; width: 0; height: 0; opacity: 0; pointer-events: none; }
.date-cal-btn {
  flex-shrink: 0; padding: 0 9px; height: 36px;
  border: 1.5px solid #e2e8f0; border-radius: 7px;
  background: #f1f5f9; cursor: pointer; font-size: .95rem;
  transition: background .15s;
}
.date-cal-btn:hover { background: #e2e8f0; }

/* Day shortcuts */
.day-shortcuts-block {
  background: #f5f3ff; border: 1px solid #ddd6fe;
  border-radius: 8px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.day-shortcuts-label {
  font-size: .68rem; font-weight: 600; color: #6d28d9;
}
.day-btns-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px;
}
.day-card-btn {
  display: flex; flex-direction: column; align-items: center;
  padding: 5px 2px; border: 1.5px solid #c4b5fd;
  border-radius: 6px; background: #ede9fe; cursor: pointer;
  transition: all .15s; gap: 1px;
}
.day-card-btn:hover { background: #ddd6fe; border-color: #8b5cf6; transform: translateY(-1px); box-shadow: 0 2px 6px rgba(109,40,217,.18); }
.day-card-btn:active { transform: translateY(0); }
.day-n { font-size: .9rem; font-weight: 800; color: #5b21b6; line-height: 1; }
.day-u { font-size: .55rem; font-weight: 500; color: #7c3aed; }

.day-adjust-row { display: flex; align-items: center; gap: 6px; }
.day-adjust-label { font-size: .68rem; color: #7c3aed; font-weight: 600; }
.day-adjust-btn {
  padding: 4px 12px; font-size: .75rem; font-weight: 700;
  border-radius: 20px; cursor: pointer; transition: all .15s;
  border: 1.5px solid;
}
.day-adjust-btn.minus { background: #fef2f2; color: #dc2626; border-color: #fca5a5; }
.day-adjust-btn.minus:hover { background: #fee2e2; }
.day-adjust-btn.plus  { background: #f0fdf4; color: #16a34a; border-color: #86efac; }
.day-adjust-btn.plus:hover  { background: #dcfce7; }

/* Modal actions */
.meta-modal-actions { justify-content: flex-end; padding-top: 12px; border-top: 1px solid var(--border); margin-top: 4px; flex-shrink: 0; }

/* Card additional rows */
.ann-adresse    { color: #9ca3af; font-size: .72rem; }
.ann-dates-row  { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.ann-chip-row   { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }

/* ══════════════════════════════════════════════
   SEARCH PAGE
══════════════════════════════════════════════ */
.search-page { padding: 0 0 32px; }

.search-hero {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; padding: 24px 20px 20px; border-radius: var(--radius);
  margin-bottom: 20px;
}
.search-hero h2 { font-size: 1.25rem; font-weight: 700; margin-bottom: 12px; }

.search-main-row {
  display: flex; gap: 10px; align-items: center;
}
.search-main-row input {
  flex: 1; padding: 10px 14px; border-radius: 8px; border: none;
  font-size: .95rem; outline: none; box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.search-main-row .btn-primary { white-space: nowrap; flex-shrink: 0; }

.search-filters-row {
  display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap;
}

.filter-group { position: relative; }

.filter-toggle-btn {
  padding: 7px 14px; border-radius: 20px; border: 2px solid rgba(255,255,255,.4);
  background: rgba(255,255,255,.15); color: #fff; font-size: .82rem; font-weight: 600;
  cursor: pointer; transition: background .15s; white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
}
.filter-toggle-btn:hover { background: rgba(255,255,255,.25); }
.filter-toggle-btn.active { background: rgba(255,255,255,.3); border-color: rgba(255,255,255,.7); }

.filter-count {
  background: #fff; color: var(--primary); border-radius: 10px;
  padding: 0 6px; font-size: .7rem; font-weight: 700; line-height: 18px;
}

.filter-panel {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 200;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); width: 280px; overflow: hidden;
}
.filter-panel input[type=text] {
  width: 100%; padding: 9px 12px; border: none; border-bottom: 1px solid var(--border);
  font-size: .82rem; outline: none;
}
.filter-list {
  max-height: 260px; overflow-y: auto; padding: 6px 0;
}
.filter-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 14px;
  font-size: .82rem; cursor: pointer; transition: background .1s;
}
.filter-item:hover { background: #f9fafb; }
.filter-item input { accent-color: var(--primary); flex-shrink: 0; }
.filter-panel-footer {
  padding: 8px 12px; border-top: 1px solid var(--border);
  display: flex; gap: 8px;
}

/* OCR pending banner */
.ocr-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: #fffbeb; border: 1px solid #fcd34d; border-radius: var(--radius);
  padding: 10px 16px; margin-bottom: 16px; font-size: .85rem;
}
.ocr-banner strong { color: #92400e; }
.ocr-banner-info {
  background: #f0fdf4; border-color: #86efac;
}
.ocr-banner-info strong { color: #166534; }

/* Search results */
.search-controls {
  background: var(--surface); border-radius: var(--radius);
  padding: 16px; margin-bottom: 16px; box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.search-controls .search-main-row input { border: 1px solid var(--border); box-shadow: none; }
.search-controls .search-main-row { flex-wrap: nowrap; }
.search-controls .filter-toggle-btn {
  border-color: var(--border); background: #f9fafb; color: var(--text);
}
.search-controls .filter-toggle-btn:hover { background: #f3f4f6; }
.search-controls .filter-toggle-btn.active { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.search-controls .filter-count { background: var(--primary); color: #fff; }

.search-results-header {
  font-size: .85rem; font-weight: 600; color: var(--primary);
  margin-bottom: 12px; padding: 6px 10px;
  background: var(--primary-light); border-radius: 8px;
  display: inline-block;
}
.search-results-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.search-result-card {
  display: flex; flex-direction: row;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 12px; overflow: hidden; cursor: pointer; min-height: 140px;
  box-shadow: var(--shadow); transition: box-shadow .2s, border-color .2s;
  position: relative;
}
.src-actions {
  position: absolute; top: 8px; right: 8px;
  display: flex; gap: 5px;
  opacity: 0; transition: opacity .18s;
}
.search-result-card:hover .src-actions { opacity: 1; }
.batch-nav-wrap { position: relative; }
.batch-nav-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,.5); color: #fff; border: none; cursor: pointer; padding: 4px 7px; font-size: 1rem; z-index: 2; border-radius: 4px; }
.batch-nav-btn.prev { left: 2px; }
.batch-nav-btn.next { right: 2px; }
.batch-counter { position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.55); color: #fff; font-size: .72rem; padding: 2px 7px; border-radius: 10px; pointer-events: none; }
.add-img-btn { position: absolute; bottom: 6px; right: 6px; background: var(--primary); color: #fff; border: none; border-radius: 50%; width: 26px; height: 26px; font-size: .85rem; cursor: pointer; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .18s; z-index: 3; }
.ann-card:hover .add-img-btn { opacity: 1; }
.sector-suggestions { position: absolute; top: 100%; left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-lg); z-index: 200; max-height: 280px; overflow-y: auto; }
.sector-sugg-item { padding: 9px 14px; cursor: pointer; display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.sector-sugg-item:hover { background: var(--primary-light); }
.hsb-input-wrap { position: relative; }
.date-filter-row { display: flex; gap: 8px; align-items: center; margin-top: 6px; font-size: .85rem; color: var(--text-muted); }
.date-filter-row input[type=date] { padding: 6px 8px; border: 1.5px solid var(--border); border-radius: 6px; font-size: .83rem; }
.search-result-card:hover { box-shadow: 0 6px 24px rgba(0,0,0,.12); border-color: #a5b4fc; }
@media (max-width: 700px) { .search-results-grid { grid-template-columns: 1fr; } }

.src-image {
  width: 90px; min-width: 90px;
  background: #dde3ef;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}
.src-image img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; transition: transform .25s; }
.search-result-card:hover .src-image img { transform: scale(1.04); }

.src-info { padding: 12px 14px 10px; display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; border-left: 1px solid var(--border); }
.src-info.rtl { direction: rtl; text-align: right; }
.src-path { font-size: .67rem; color: var(--text-muted); }
.src-path span + span::before { content: ' · '; }
.src-titre {
  font-size: .9rem; font-weight: 700; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  line-height: 1.4;
}
.src-annonceur { font-size: .75rem; color: #4b5563; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.src-dates { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }

.search-hint {
  text-align: center; padding: 48px 20px; color: var(--text-muted);
  font-size: .9rem;
}
.search-hint::before { content: '🔍'; display: block; font-size: 2.5rem; margin-bottom: 12px; }

.pagination {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border);
  font-size: .85rem; color: var(--text-muted);
}

/* ══════════════════════════════════════════════
   RESPONSIVE — new components
══════════════════════════════════════════════ */
@media (max-width: 640px) {
  .image-meta-card { grid-template-columns: 1fr; grid-template-areas: "check" "img" "meta"; }
  .imc-image { min-height: 220px; }
  .filter-panel { width: 260px; }
  .search-main-row { flex-wrap: wrap; }
  .meta-dates-row { grid-template-columns: 1fr; }
  .search-result-card { grid-template-columns: 90px 1fr; }
  .search-filters-row { gap: 8px; }
}

/* ══════════════════════════════
   HOME SEARCH BAR (unifiée)
══════════════════════════════ */
.home-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  margin: 0 0 20px;
  box-shadow: var(--shadow);
  flex-wrap: wrap;
  position: relative;
  overflow: visible;
}
.home-search-bar .filter-group { position: relative; z-index: 10; }
/* Bouton bascule "📋 Toutes les annonces" / "🗂️ Grille" — placé tout à droite */
.home-search-bar .view-mode-btn {
  margin-left: auto;
  background: #fff;
  color: #1e3a5f;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.home-search-bar .view-mode-btn:hover {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1e40af;
}
.home-search-bar .view-mode-btn.active {
  background: linear-gradient(135deg, #2563eb, #1e40af);
  color: #fff;
  border-color: #1e40af;
}
.home-search-bar .view-mode-btn.active:hover {
  background: linear-gradient(135deg, #1e40af, #1e3a5f);
}
.home-search-bar .filter-toggle-btn {
  border: 1.5px solid #d1d5db;
  background: #fff;
  color: var(--text);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: .84rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.home-search-bar .filter-toggle-btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}
.home-search-bar .filter-toggle-btn.active {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}
.home-search-bar .filter-count { background: var(--primary); color: #fff; }
.home-search-bar .filter-panel { z-index: 500; }
.hsb-input-wrap {
  flex: 1 1 200px;
  min-width: 140px;
  max-width: 320px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
}
.hsb-icon { font-size: 1rem; opacity: .6; }
.hsb-input-wrap input {
  border: none;
  background: transparent;
  outline: none;
  font-size: .9rem;
  width: 100%;
  color: var(--text);
}
.hsb-btn { white-space: nowrap; flex-shrink: 0; }
.hsb-reset { color: var(--danger, #ef4444); border-color: var(--danger, #ef4444); }

/* ══════════════════════════════
   BADGES NEW / COUNT
══════════════════════════════ */
.new-badge {
  display: inline-block;
  background: #22c55e;
  color: #fff;
  font-size: .58rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: .6px;
  vertical-align: middle;
  margin-left: 4px;
}
.new-count {
  display: inline-block;
  background: #22c55e;
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
}
.badge-new {
  background: #f97316 !important;
  color: #fff !important;
  border: none;
  animation: badgePulse 1.2s ease-in-out infinite;
}
@keyframes badgePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .55; transform: scale(1.08); }
}
.hero-stat.new .hero-stat-num { color: #22c55e; }

/* ══════════════════════════════
   GRILLE ANNONCES — 3 par ligne
══════════════════════════════ */
.ann-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 4px 0 24px;
}
@media (max-width: 640px) { .ann-grid { grid-template-columns: 1fr; } }

/* ══════════════════════════════
   ANN CARD — design carte complète
══════════════════════════════ */
.ann-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: row;
  position: relative;
  transition: box-shadow .2s, border-color .2s;
  min-height: 120px;
}
.ann-card:hover { box-shadow: 0 6px 24px rgba(0,0,0,.12); border-color: #a5b4fc; }
.ann-card.expired { border-color: #fca5a5; background: #fff8f8; }
.ann-card.expired:hover { border-color: #ef4444; }
.ann-card.selected { border-color: var(--primary); box-shadow: 0 0 0 2px #bfdbfe; }

/* checkbox overlay */
.ann-check-wrap {
  position: absolute;
  top: 8px; left: 8px;
  z-index: 4;
  background: rgba(255,255,255,.92);
  border-radius: 5px;
  padding: 2px 4px;
  cursor: pointer;
}
.ann-check-wrap input { width: 14px; height: 14px; cursor: pointer; }

/* thumbnail */
.ann-thumb {
  position: relative;
  width: 90px;
  min-width: 90px;
  background: #dde3ef;
  cursor: pointer;
  flex-shrink: 0;
  overflow: hidden;
}
.ann-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform .25s;
  display: block;
}
.ann-card:hover .ann-thumb img { transform: scale(1.04); }

/* sector pill in text zone */
.ann-tags-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-bottom: 2px;
}
.ann-sector-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  color: #fff;
  line-height: 1.35;
  white-space: nowrap;
}
.ann-sector-pill span { font-size: .82rem; }

/* Sector color palette */
.sc-0 { background: #3b82f6; }
.sc-1 { background: #10b981; }
.sc-2 { background: #f97316; }
.sc-3 { background: #8b5cf6; }
.sc-4 { background: #ec4899; }
.sc-5 { background: #14b8a6; }
.sc-6 { background: #ca8a04; }
.sc-7 { background: #ef4444; }

.ann-original-badge {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(15,23,42,.72) 0%, transparent 100%);
  color: #fff;
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-align: center;
  padding: 14px 4px 4px;
  z-index: 2;
  text-transform: uppercase;
}

.ann-thumb .ocr-badge {
  position: absolute;
  top: 4px; right: 4px;
  font-size: .55rem;
  padding: 1px 4px;
  z-index: 3;
}
.ann-expired-badge {
  position: absolute;
  top: 6px; left: 6px;
  background: #ef4444;
  color: #fff;
  font-size: .6rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 5px;
  z-index: 2;
}

/* body */
.ann-body {
  padding: 9px 11px 8px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  border-left: 1px solid var(--border);
}
.ann-body.rtl { direction: rtl; text-align: right; }
.ann-titre {
  font-size: .84rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ann-empty { color: var(--text-muted); font-style: italic; font-weight: 400; }
.ann-annonceur {
  font-size: .75rem;
  color: #4b5563;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ann-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
}
.ann-type-tag {
  font-size: .68rem;
  font-weight: 600;
  background: #ede9fe;
  color: #6d28d9;
  border-radius: 20px;
  padding: 2px 8px;
}
.ann-meta-chip {
  font-size: .68rem;
  background: #f1f5f9;
  color: var(--text-muted);
  border-radius: 20px;
  padding: 2px 8px;
  border: 1px solid var(--border);
}
.ann-meta-chip.chip-expired { background: #fef2f2; color: #ef4444; border-color: #fca5a5; font-weight: 600; }
.ann-desc {
  font-size: .75rem;
  color: #6b7280;
  line-height: 1.5;
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* admin actions bar */
.ann-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 7px;
  border-left: 1px solid var(--border);
  background: #f8fafc;
  justify-content: center;
  flex-shrink: 0;
}
.ann-actions .btn-sm {
  justify-content: center;
  font-size: .68rem;
  padding: 4px 7px;
  min-width: 30px;
}

/* ══════════════════════════════
   FOOTER
══════════════════════════════ */
#app-footer {
  background: #1e293b;
  color: #94a3b8;
  margin-top: auto;
  padding: 0;
}
.footer-inner {
  width: 100%;
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-brand {
  font-size: .82rem;
  font-weight: 600;
  color: #e2e8f0;
}
.footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.footer-links a {
  color: #94a3b8;
  text-decoration: none;
  font-size: .8rem;
  transition: color .15s;
}
.footer-links a:hover { color: #e2e8f0; }
.footer-copy { font-size: .72rem; color: #64748b; }

#app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
#app-main { flex: 1; }

/* ── responsive home search ── */
@media (max-width: 640px) {
  .home-search-bar { flex-direction: column; align-items: stretch; }
  .hsb-input-wrap { min-width: unset; }
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-links { justify-content: center; }
}

/* Admin sector search */
.admin-sector-search-wrap {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; background: #eff6ff; border: 1px solid #bfdbfe;
  border-radius: 8px; margin-top: 6px; position: relative;
}
.admin-sector-search-label { font-size: .75rem; font-weight: 600; color: #1d4ed8; white-space: nowrap; }
.admin-sector-search-inner { position: relative; flex: 1; }
.admin-sector-search-input {
  width: 100%; padding: 6px 10px; border: 1px solid #93c5fd;
  border-radius: 6px; font-size: .9rem; background: #fff; outline: none;
}
.admin-sector-search-input:focus { border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59,130,246,.15); }
.admin-sector-search-inner .sector-suggestions {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 200;
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  box-shadow: var(--shadow-lg); max-height: 280px; overflow-y: auto; margin-top: 2px;
}

/* meta-select for dup modal */
.meta-select {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 6px; font-size: .9rem; background: #fff;
}
.meta-select:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 2px rgba(26,86,219,.1); }

/* Images management in modal-meta */
.meta-images-list {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; min-height: 20px;
}
.meta-img-item {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.meta-img-thumb {
  width: 80px; height: 80px; object-fit: cover; border-radius: 6px;
  border: 2px solid var(--border); cursor: pointer;
  transition: border-color .15s;
}
.meta-img-thumb:hover { border-color: var(--primary); }
.meta-img-btns {
  display: flex; gap: 4px;
}
.meta-add-img-btn {
  width: 100%; padding: 6px; font-size: .8rem; font-weight: 600;
  background: #eff6ff; color: var(--primary); border: 1.5px dashed var(--primary);
  border-radius: 6px; cursor: pointer; transition: background .15s;
}
.meta-add-img-btn:hover { background: #dbeafe; }

/* Input with DA suffix */
.input-suffix-wrap {
  display: flex; align-items: stretch; border: 1.5px solid var(--border);
  border-radius: 8px; overflow: hidden; background: white; transition: border-color .15s;
}
.input-suffix-wrap:focus-within { border-color: var(--primary); }
.input-suffix-wrap input {
  flex: 1; border: none !important; border-radius: 0 !important;
  outline: none; padding: 9px 12px; font-size: .9rem; background: transparent;
  box-shadow: none !important;
}
.input-suffix-badge {
  display: flex; align-items: center; padding: 0 10px;
  background: #f3f4f6; border-left: 1.5px solid var(--border);
  font-size: .8rem; font-weight: 700; color: var(--text-muted); white-space: nowrap;
}

/* Image count badge on card */
.batch-count-badge {
  position: absolute;
  top: 8px; left: 50%;
  transform: translateX(-50%);
  background: rgba(37,99,235,.85);
  color: #fff;
  font-size: .82rem; font-weight: 700;
  padding: 5px 13px;
  border-radius: 20px;
  pointer-events: none;
  white-space: nowrap;
  letter-spacing: .02em;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
}

/* Search result carousel */
.src-img-wrap { position: relative; width: 100%; height: 100%; }
.src-batch-main { width: 100%; height: 100%; object-fit: cover; }
.src-batch-prev, .src-batch-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,.45); color: #fff; border: none; border-radius: 50%;
  width: 26px; height: 26px; font-size: 1rem; line-height: 1;
  cursor: pointer; z-index: 2; display: flex; align-items: center; justify-content: center;
}
.src-batch-prev { left: 4px; }
.src-batch-next { right: 4px; }
.src-batch-counter {
  position: absolute; bottom: 4px; right: 6px;
  background: rgba(0,0,0,.55); color: #fff;
  font-size: .65rem; padding: 2px 6px; border-radius: 10px; pointer-events: none;
}

/* ══════════════════════════════
   HEADER — Bouton Ajouter annonce
══════════════════════════════ */
.btn-add-header {
  background: var(--accent);
  color: #1a1200;
  border: none;
  border-radius: 7px;
  padding: 7px 15px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transition: background 0.15s, transform 0.1s;
  margin-left: 4px;
}
.btn-add-header:hover { background: #d97706; color: #fff; transform: translateY(-1px); }
@media (max-width: 640px) {
  .btn-add-header { font-size: 0; padding: 7px 10px; }
  .btn-add-header::before { content: '➕'; font-size: 1rem; }
}

/* ══════════════════════════════
   EXPIRY INDICATORS
══════════════════════════════ */
.ann-card--expired  { outline: 2.5px solid #ef4444; }
.ann-card--expiring { outline: 2.5px solid #f97316; }
.src-card--expired  { outline: 2.5px solid #ef4444; }
.src-card--expiring { outline: 2.5px solid #f97316; }

@keyframes expiry-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}
.expiry-alert {
  background: #fff7ed;
  border: 1px solid #f97316;
  color: #c2410c;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  margin-bottom: 7px;
  line-height: 1.4;
  animation: expiry-blink 1.2s ease-in-out infinite;
}
.expiry-alert--expired {
  background: #fef2f2;
  border-color: #ef4444;
  color: #b91c1c;
  animation: none;
}
.filter-empty-title-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #b91c1c;
  cursor: pointer;
  white-space: nowrap;
  margin-left: 8px;
}

/* ══════════════════════════════
   MODAL AJOUT — Section localisation
══════════════════════════════ */
.add-loc-card {
  background: var(--primary-light);
  border: 1.5px solid #bfdbfe;
  border-radius: 10px;
  padding: 10px 14px 8px;
  margin-bottom: 10px;
  flex-shrink: 0;
}
.add-loc-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--primary);
  margin-bottom: 8px;
}
.add-loc-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1.6fr 1fr;
  gap: 6px 12px;
  align-items: start;
}
.add-new-date-inline {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 7px 10px;
  border: 1.5px solid var(--primary);
  border-radius: 6px;
  font-size: 0.88rem;
  box-sizing: border-box;
  background: white;
}
@media (max-width: 820px) {
  .add-loc-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 500px) {
  .add-loc-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════
   MON COMPTE modal
══════════════════════════════ */
.ma-box {
  width: clamp(340px, 70vw, 1100px);
  max-width: none;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.ma-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 4px 0 10px;
}
/* Auth tabs */
.ma-tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 18px;
}
.ma-tab {
  padding: 8px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
}
.ma-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.ma-form { display: flex; flex-direction: column; gap: 4px; }
.ma-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
/* Profile header */
.ma-profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--primary-light);
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
}
.ma-profile-identity { display: flex; align-items: center; gap: 12px; }
.ma-profile-avatar { font-size: 2rem; }
.ma-profile-name { font-size: 1rem; font-weight: 700; color: var(--text); }
.ma-profile-email { font-size: 0.8rem; color: var(--text-muted); }
.ma-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--primary);
  margin-bottom: 4px;
}
/* Prefs panels */
.ma-panels {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-top: 10px;
}
.ma-panel {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
}
.ma-panel-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--primary);
  margin-bottom: 8px;
}
.ma-search {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 0.82rem;
  margin-bottom: 6px;
}
.ma-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 220px;
}
.ma-check-all {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  border-top: 1px solid var(--border);
  padding-top: 6px;
}
/* Info details */
.ma-info-details {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.ma-info-summary {
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  padding: 10px 14px;
  background: var(--bg);
  user-select: none;
  list-style: none;
}
.ma-info-summary::-webkit-details-marker { display: none; }
.ma-info-form {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.input-readonly { background: var(--bg); color: var(--text-muted); cursor: not-allowed; }
/* ── Profile banner ─────────────────────────────────── */
.profile-banner {
  background: linear-gradient(135deg, #1a56db 0%, #7c3aed 100%);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  box-shadow: 0 4px 16px rgba(26,86,219,.25);
}
.pb-icon-wrap {
  flex-shrink: 0;
  width: 54px; height: 54px;
  background: rgba(255,255,255,.18);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  border: 2px solid rgba(255,255,255,.35);
}
.pb-icon { line-height: 1; }
.pb-content { flex: 1; min-width: 200px; }
.pb-title {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 3px;
  letter-spacing: -.01em;
}
.pb-desc {
  font-size: 0.82rem;
  color: rgba(255,255,255,.85);
  line-height: 1.45;
}
.pb-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.pb-btn {
  background: #fff;
  color: #1a56db;
  font-weight: 800;
  font-size: 0.88rem;
  padding: 9px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  transition: transform .12s, box-shadow .12s;
}
.pb-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,.2); }
.pb-close {
  background: rgba(255,255,255,.18);
  border: 1.5px solid rgba(255,255,255,.4);
  color: #fff;
  width: 30px; height: 30px;
  border-radius: 50%;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.pb-close:hover { background: rgba(255,255,255,.3); }

/* ── Auth hero header ────────────────────────────────── */
.ma-auth-hero {
  background: linear-gradient(135deg, #1a56db, #7c3aed);
  border-radius: 12px;
  padding: 24px 20px 20px;
  text-align: center;
  margin-bottom: 20px;
}
.ma-auth-hero-icon {
  font-size: 2.6rem;
  margin-bottom: 8px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.2));
}
.ma-auth-hero-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
}
.ma-auth-hero-sub {
  font-size: 0.82rem;
  color: rgba(255,255,255,.8);
}

/* ── Icon input fields ───────────────────────────────── */
.ma-field-wrap {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
  margin-bottom: 10px;
}
.ma-field-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}
.ma-field-icon {
  padding: 0 12px;
  font-size: 1.1rem;
  flex-shrink: 0;
  border-right: 1.5px solid var(--border);
  line-height: 42px;
  background: #fff;
}
.ma-field-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 11px 14px;
  font-size: 0.92rem;
  outline: none;
  color: var(--text);
}
.ma-field-input::placeholder { color: var(--text-muted); }

/* ── CTA button ──────────────────────────────────────── */
.ma-cta-btn {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #1a56db, #7c3aed);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 6px;
  letter-spacing: .02em;
  box-shadow: 0 3px 12px rgba(26,86,219,.3);
  transition: opacity .15s, transform .12s;
}
.ma-cta-btn:hover { opacity: .92; transform: translateY(-1px); }
.ma-link-btn {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: underline;
}
.ma-link-btn:hover { color: var(--primary); }

/* ── Password rules ──────────────────────────────────── */
.ma-pwd-hint {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: -2px 0 8px;
  padding: 6px 10px;
  background: var(--bg);
  border-radius: 6px;
  border: 1px solid var(--border);
}
.ma-pwd-rule {
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: color .2s;
}
.ma-pwd-rule.ma-rule-ok { color: #059669; font-weight: 600; }

/* ── Form error ──────────────────────────────────────── */
.ma-form-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 7px;
  margin-bottom: 8px;
}
@media (max-width: 700px) {
  .ma-panels { grid-template-columns: 1fr; }
  .ma-list { max-height: 140px; }
  .ma-row-2 { grid-template-columns: 1fr; }
}

/* ══════════════════════════════
   ADD FORM PICK LIST (secteur / wilaya)
══════════════════════════════ */
.add-pick-box {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}
.add-pick-search {
  width: 100%;
  padding: 5px 10px;
  border: none;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  background: #f8fafc;
  color: var(--text);
  outline: none;
  transition: background .15s;
}
.add-pick-search:focus { background: #fff; }
.add-pick-list {
  max-height: 99px;
  overflow-y: auto;
  padding: 2px 0;
}
.add-pick-list::-webkit-scrollbar { width: 4px; }
.add-pick-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.add-pick-item { transition: background .1s; }
.add-pick-selected {
  background: var(--primary-light) !important;
  color: var(--primary);
  font-weight: 600;
}
.add-sel-badge {
  display: inline-block;
  margin-left: 4px;
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  vertical-align: middle;
}

/* ══════════════════════════════
   PROFILE CARD
══════════════════════════════ */
.ma-profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, #1a56db 0%, #7c3aed 100%);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 18px;
  color: #fff;
}
.ma-avatar-circle {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  background: rgba(255,255,255,.22);
  border: 2.5px solid rgba(255,255,255,.5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0;
}
.ma-profile-info {
  flex: 1;
  min-width: 0;
}
.ma-profile-name {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ma-profile-email {
  font-size: 0.78rem;
  color: rgba(255,255,255,.75);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Badge de statut connexion temps réel */
.ma-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 3px 10px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #fff;
  transition: all .25s;
}
.ma-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
  flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(0,0,0,0);
  transition: background .25s, box-shadow .25s;
}
/* État : connecté */
.ma-status-badge[data-state="online"]   { background: rgba(34,197,94,.22); border-color: rgba(74,222,128,.5); }
.ma-status-badge[data-state="online"] .ma-status-dot {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34,197,94,.25);
  animation: ma-pulse 2s infinite;
}
/* État : déconnecté */
.ma-status-badge[data-state="offline"]  { background: rgba(239,68,68,.22); border-color: rgba(248,113,113,.5); }
.ma-status-badge[data-state="offline"] .ma-status-dot {
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,.25);
}
/* État : vérification */
.ma-status-badge[data-state="checking"] { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.2); }
.ma-status-badge[data-state="checking"] .ma-status-dot {
  background: #cbd5e1;
  animation: ma-blink 1.4s infinite;
}
@keyframes ma-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(34,197,94,.25); }
  50%      { box-shadow: 0 0 0 5px rgba(34,197,94,.1); }
}
@keyframes ma-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: .35; }
}

.ma-logout-btn {
  flex-shrink: 0;
  background: rgba(255,255,255,.18);
  border: 1.5px solid rgba(255,255,255,.35);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.ma-logout-btn:hover { background: rgba(255,255,255,.3); }

/* ══════════════════════════════
   PREFS SECTION
══════════════════════════════ */
.ma-pref-section {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
}
.ma-pref-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.ma-pref-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}
.ma-reset-btn {
  flex-shrink: 0;
  background: var(--bg);
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.ma-reset-btn:hover { border-color: var(--primary); color: var(--primary); }

/* ── Pref tabs ── */
.ma-pref-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}
.ma-pref-tab {
  background: none;
  border: none;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -2px;
  padding: 7px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.ma-pref-tab:hover { color: var(--primary); }
.ma-pref-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: var(--primary-light);
}
.ma-tab-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
}

/* ── Panel ── */
.ma-pt-panel { display: flex; flex-direction: column; gap: 10px; }

/* ── Chip search ── */
.ma-chip-search {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.87rem;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color .15s;
}
.ma-chip-search:focus { border-color: var(--primary); background: #fff; }

/* ── Chip list ── */
.ma-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  max-height: 200px;
  overflow-y: auto;
  padding: 4px 2px;
}
.ma-chip-list::-webkit-scrollbar { width: 4px; }
.ma-chip-list::-webkit-scrollbar-track { background: transparent; }
.ma-chip-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ── Chip button ── */
.ma-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .12s, background .12s, color .12s, box-shadow .12s;
  white-space: nowrap;
}
.ma-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}
.ma-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(26,86,219,.25);
}

/* ── Bulk actions ── */
.ma-chip-bulk {
  display: flex;
  gap: 8px;
}
.ma-chip-bulk button {
  background: none;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 7px;
  cursor: pointer;
  transition: border-color .12s, color .12s;
}
.ma-chip-bulk button:hover { border-color: var(--primary); color: var(--primary); }

/* ── Info details (collapsible) ── */
.ma-info-details {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.ma-info-summary {
  padding: 13px 16px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  list-style: none;
}
.ma-info-summary::-webkit-details-marker { display: none; }
.ma-info-form { padding: 0 16px 16px; }

/* ── 3-column prefs grid ── */
.ma-prefs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin: 10px 0 0;
}
.ma-pref-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px 8px;
  background: var(--surface);
  min-height: 0;
}
.ma-pref-col-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.ma-pref-col .ma-chip-list {
  max-height: 220px;
  flex: 1;
}
.ma-pref-col .ma-chip-bulk {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  padding-top: 6px;
}

/* ── Info form rows (inside details) ── */
.ma-info-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.ma-info-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

@media (max-width: 900px) {
  .ma-prefs-grid { grid-template-columns: 1fr 1fr; }
  .ma-info-row-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .ma-box { width: 100%; max-height: 100svh; border-radius: 0; }
  .ma-profile-card { flex-wrap: wrap; }
  .ma-logout-btn { width: 100%; text-align: center; }
  .ma-prefs-grid { grid-template-columns: 1fr; }
  .ma-pref-col .ma-chip-list { max-height: 160px; }
  .ma-info-row-3 { grid-template-columns: 1fr; }
  .ma-info-row-2 { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════════════════════
   CUSTOM DATE PICKER — remplace le calendrier natif HTML5 qui débordait.
   Positionnement intelligent géré par JS, styles ici.
   ══════════════════════════════════════════════════════════════════════════ */
#cdp-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  z-index: 99998;
}
#cdp-popup {
  position: fixed;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
  padding: 10px;
  width: 280px;
  z-index: 99999;
  font-family: inherit;
  user-select: none;
}
.cdp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.cdp-nav {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 0.85rem;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cdp-nav:hover { background: #e2e8f0; }
.cdp-title {
  flex: 1;
  background: transparent;
  border: none;
  font-weight: 700;
  font-size: 0.92rem;
  color: #0f172a;
  cursor: pointer;
  padding: 6px 4px;
  border-radius: 6px;
  text-transform: capitalize;
}
.cdp-title:hover { background: #f1f5f9; }
.cdp-weekdays,
.cdp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.cdp-weekdays { margin-bottom: 4px; }
.cdp-cell {
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  border-radius: 6px;
}
.cdp-wd {
  color: #94a3b8;
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
}
.cdp-day {
  cursor: pointer;
  color: #1f2937;
  transition: background 0.12s;
}
.cdp-day:hover:not(.cdp-disabled) { background: #e0f2fe; color: #0369a1; }
.cdp-today {
  border: 1px solid #38bdf8;
  font-weight: 700;
  color: #0369a1;
}
.cdp-selected {
  background: #0369a1 !important;
  color: #ffffff !important;
  font-weight: 700;
}
.cdp-disabled {
  color: #cbd5e1;
  cursor: not-allowed;
}
.cdp-empty { cursor: default; }
.cdp-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
}
.cdp-foot-btn {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 6px;
}
.cdp-foot-btn:hover { background: #f1f5f9; color: #0f172a; }
.cdp-today-btn { color: #0369a1; font-weight: 600; }
