/*
 * Objets — raccord avec la charte Kaozéal 2026-12 (shared/web/kz/kz-ui.css).
 * Chargé APRÈS styles.css. Les variables de l'interface passent à la charte ;
 * les écrans historiques (statistiques, administration, fenêtres d'activation)
 * prennent le même aspect que les nouveaux. L'aperçu d'un site dans l'éditeur
 * est une iframe : il garde son propre rendu.
 */
:root, [data-theme="dark"] {
  --accent: #002395; --accent-strong: #001B73; --accent-soft: #F2F4FB; --accent-ring: rgba(0, 35, 149, .25); --on-accent: #FFFFFF;
  --surface: #FFFFFF; --surface-2: #F3F3F3; --bg: #FFFFFF; --line: #E8E8E8; --line-2: #E0E0E0; --border: #E8E8E8;
  --ink: #000000; --ink-2: #5C5C5C; --ink-3: #9A9A9A; --text: #000000; --text-muted: #5C5C5C;
  --success: #0B6B2E; --success-soft: #E6F4EA; --warning: #8A4B00; --warning-soft: #FFF4E0; --danger: #E3001B; --danger-soft: #FDECEE;
  --r-base: 10px; --r-card: 20px; --r-window: 20px;
  --shadow-soft: none; --shadow-pop: none;
  --font: "Inter", Arial, sans-serif; --mono: "Inter", Arial, sans-serif;
  color-scheme: light;
}
body { background: #FFFFFF; font-family: var(--font); font-size: 14px; color: #000000; }

/* styles.css impose largeur/hauteur/bordure à TOUS les champs : on rend la main aux composants Kaozéal. */
.kz-search input { width: auto; height: auto; border: 0; padding: 0; background: transparent; box-shadow: none !important; }
.kz-crumbs__name { width: auto; height: 32px; padding: 2px 6px; }
.kz-segmented button, .kz-floatbar button { box-shadow: none; }
input.kz-input:focus, select.kz-select:focus, textarea.kz-textarea:focus { box-shadow: 0 0 0 1px #002395; }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 1px #002395; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: #002395; }

/* ---------- Écrans historiques dans la nouvelle coque ---------- */
.kz-main > .content, .ob-pane .content { padding: 0; max-width: none; margin: 0; gap: 20px; display: flex; flex-direction: column; }
.kz-main .card, .ob-pane .card { border: 1px solid #E8E8E8; border-radius: 20px; box-shadow: none; background: #FFFFFF; }
.kz-main .panel { padding: 24px; }
.kz-main h2 { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.section-head h2::before { display: none !important; }
.btn { border-radius: 10px; border: 1px solid #E0E0E0; background: #FFFFFF; color: #000000; font-weight: 600; box-shadow: none; font-size: 14px; }
.btn.sm { height: 34px; font-size: 13px; }
.btn:hover { background: #FFFFFF; border-color: #000000; }
.btn.primary { background: #002395; border-color: #002395; color: #FFFFFF; }
.btn.primary:hover { background: #001B73; }
.btn.danger { background: #FFFFFF; color: #E3001B; border-color: #E0E0E0; }
.btn.danger:hover { border-color: #E3001B; }
.btn:focus-visible, .kz-btn:focus-visible { outline: 2px solid #002395; outline-offset: 2px; }
.pill { font-family: var(--font); font-size: 12px; }
.pill.gold { background: #FFF4E0; color: #8A4B00; }
.role { font-family: var(--font); font-size: 11px; background: #F3F3F3; border-color: #E8E8E8; color: #5C5C5C; }
.admin-tabs { gap: 4px; padding: 4px; background: #F3F3F3; border-radius: 12px; border: 0; flex-wrap: wrap; display: flex; align-self: flex-start; }
.admin-tabs button { border-radius: 9px; border: 0; background: transparent; color: #5C5C5C; font-weight: 500; height: 34px; padding: 0 14px; font-size: 14px; }
.admin-tabs button.active { background: #FFFFFF; color: #000000; font-weight: 600; }
.admin-search { border-radius: 10px; height: 40px; font-size: 14px; }
.sub-status { height: 40px; width: auto; border-radius: 10px; }
.chip { border-radius: 10px !important; box-shadow: none !important; }
.chip.active { background: #000000 !important; color: #FFFFFF !important; border-color: #000000 !important; }
.bulk-bar { border-color: #E8E8E8 !important; background: #F3F3F3 !important; border-radius: 14px; }
.bulk-bar.light { background: transparent !important; border-color: transparent !important; }
.empty-state { border: 2px dashed #D0D0D0; border-radius: 20px; background: transparent; color: #5C5C5C; font-size: 14px; }
.table-row { font-size: 14px; }
.mono { font-size: 12.5px; color: #5C5C5C; }
.cat-thumb.cat-empty { background: #F3F3F3; }
/* Chiffres clés historiques (administration, statistiques) : cartes gris clair, sans pastille colorée. */
.stat { background: #F3F3F3 !important; border: 0 !important; border-radius: 20px !important; }
.stat-ico { display: none !important; }
.stat span { font-family: var(--font); font-size: 12px; font-weight: 600; letter-spacing: .12em; color: #5C5C5C; }
.stat strong { font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-h { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.stat-h .h-ico { display: none; }
.seg { background: #F3F3F3; border: 0; border-radius: 12px; padding: 4px; }
.seg-btn { border-radius: 9px; color: #5C5C5C; font-size: 13px; height: 32px; padding: 0 12px; }
.seg-btn.active { background: #FFFFFF; color: #000000; }
.cmp.up { color: #0B6B2E; } .cmp.down { color: #E3001B; }
/* Aucun dégradé : l'aire de la courbe devient un aplat très léger. */
svg.chart polygon { fill: #002395; fill-opacity: .08; }
.worldmap { border-radius: 14px; }
/* Fenêtres historiques (activation, appairage, QR, dossiers, administration) */
.modal-backdrop { background: rgba(0, 0, 0, .4); backdrop-filter: none; z-index: 1400; }
.modal { border-radius: 24px; border: 0; box-shadow: none; max-width: 660px; padding: 28px; gap: 18px; }
.modal.modal-wide { max-width: 940px; }
.modal .section-head h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.modal .field > span { font-size: 13px; font-weight: 600; color: #000000; }
.mp-ovl { background: rgba(0, 0, 0, .4); }
.mp-box { border-radius: 24px; box-shadow: none; padding: 24px; }
.mpf.active { background: #000000; color: #FFFFFF; }
.toast { background: #000000; color: #FFFFFF; border-radius: 12px; box-shadow: none; font-family: var(--font); font-size: 14px; z-index: 2000; }
.notice.success { background: #E6F4EA; color: #0B6B2E; }
.notice.error { background: #FDECEE; color: #E3001B; }
.phone-cta { background: #FFFFFF; border: 1px solid #E0E0E0; border-radius: 16px; min-height: 64px; }
.phone-cta:hover { border-color: #000000; }
.phone-cta .pc-ic { width: 40px; height: 40px; border-radius: 12px; background: #F3F3F3; display: flex; align-items: center; justify-content: center; color: #000000; }
.phone-cta .pc-arrow { color: #000000; }
.pair-status.on { color: #0B6B2E; } .pair-status.off { color: #E3001B; }
.pair-qr { border-radius: 20px; }
.qr-preview { border-radius: 14px; }
/* Assistant (bulle) : noir, sans ombre — un seul bouton bleu par écran. */
.chat-toggle { background: #000000 !important; box-shadow: none !important; }
.chat-panel { box-shadow: none !important; border: 1px solid #E0E0E0 !important; border-radius: 20px !important; font-family: var(--font); }
.chat-head { background: #FFFFFF !important; color: #000000 !important; border-bottom: 1px solid #E8E8E8; }
.chat-x { color: #000000 !important; }
.chat-msg.user { background: #002395; }
.chat-input input { height: 40px; }
.faq-item { border-color: #E8E8E8; border-radius: 14px; }
.wa-btn { color: #000000 !important; border-color: #E0E0E0 !important; }

/* ---------- Accueil (objets) ---------- */
.ob-small { font-size: 13px; }
.ob-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.ob-inline .kz-select { width: auto; min-width: 130px; max-width: 200px; }
.ob-export { height: 40px; font-size: 14px; }
.ob-check { width: 18px; height: 18px; accent-color: #002395; margin: 0; }
.ob-bulk { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px; border-radius: 14px; background: #F3F3F3; }
.ob-bulk label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.ob-bulk--light { background: transparent; padding: 0 4px; }
.ob-cell { display: flex; align-items: center; gap: 12px; }
.ob-cell .cat-thumb { width: 40px; height: 40px; border-radius: 10px; }
.ob-name { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; cursor: pointer; text-align: left; color: #000000; }
.ob-name:hover { color: #002395; }
.ob-tag { display: inline-block; margin-left: 8px; padding: 0 6px; height: 20px; line-height: 20px; border-radius: 6px; background: #F3F3F3; font-size: 11px; font-weight: 600; color: #5C5C5C; vertical-align: 1px; }
.ob-dest-cell { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.ob-dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 1px solid #9A9A9A; background: #FFFFFF; flex: 0 0 auto; }
.ob-cell-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: nowrap; }
.ob-appname { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; }
.ob-thumb { width: 96px; height: 96px; border-radius: 20px; background: #FFFFFF; display: flex; align-items: center; justify-content: center; }
.ob-thumb .kz-ico { width: 44px; height: 44px; stroke-width: 1.6; }
.ob-actions-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ob-actions-list .kz-btn { justify-content: flex-start; }
.kz-table tr[hidden], .kz-card[hidden] { display: none; }
#objTable .kz-table td { vertical-align: middle; }

/* ---------- Éditeur ---------- */
.ob-editor .kz-editbar { flex-wrap: nowrap; gap: 10px; }
.ob-editor .kz-editbar > .kz-btn, .ob-editor .kz-editbar > a.kz-btn { flex: 0 0 auto; }
.ob-editor .kz-crumbs { flex: 0 1 auto; min-width: 0; }
.ob-left .ob-help, .ob-props .ob-help { margin: 0; font-size: 13px; color: #5C5C5C; line-height: 1.45; }
.ob-layer { min-height: 56px; padding: 8px 10px; }
.ob-layer[aria-selected="true"] { padding: 7px 9px; }
.ob-layer .kz-pill, .ob-layer .ob-dot { width: 12px; height: 12px; }
.ob-layer__txt { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 2px; }
.ob-layer__txt .kz-layer__meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ob-layer:focus-visible { outline: 2px solid #002395; outline-offset: 2px; }
.ob-addrule { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; border: 1px dashed #9A9A9A; border-radius: 12px; background: #FFFFFF; color: #002395; font-weight: 600; font-size: 14px; cursor: pointer; }
.ob-addrule:hover { border-color: #002395; }
.ob-canvas { justify-content: center; }
.ob-stage { display: flex; align-items: center; justify-content: center; gap: 40px; flex-wrap: wrap; width: 100%; }
.ob-stage__obj { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ob-obj { width: 240px; height: 240px; border-radius: 28px; background: #FFFFFF; border: 1px solid #E8E8E8; display: flex; align-items: center; justify-content: center; }
.ob-obj__img { width: 200px; height: 200px; border-radius: 22px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ob-obj__img img { width: 100%; height: 100%; object-fit: cover; }
.ob-obj__img .kz-ico { width: 96px; height: 96px; stroke-width: 1.4; }
.ob-obj__name { font-size: 15px; font-weight: 600; text-align: center; max-width: 280px; }
.ob-obj__tags { display: flex; gap: 12px; font-size: 12px; font-weight: 600; }
.ob-obj__tags span::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #000000; margin-right: 6px; vertical-align: 2px; }
.ob-obj__plan { font-size: 13px; color: #5C5C5C; text-align: center; max-width: 280px; }
.ob-stage__arrow { font-size: 28px; color: #5C5C5C; }
.ob-stage__dest { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ob-phone { width: 340px; height: min(620px, calc(100vh - 260px)); min-height: 440px; }
.ob-dest { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; padding: 28px 22px; }
.ob-dest__app { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border: 1px solid #E8E8E8; border-radius: 16px; font-size: 13px; font-weight: 600; }
.ob-dest__host { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; word-break: break-word; }
.ob-dest__url { font-size: 13px; color: #5C5C5C; word-break: break-all; max-width: 100%; }
.ob-dest__txt { font-size: 14px; color: #5C5C5C; margin: 0; }
.ob-dest__note { font-size: 12px; color: #9A9A9A; }
.ob-frame { width: 100%; height: 100%; border: 0; display: block; background: #FFFFFF; }
/* Barre d'outils (bande pleine largeur, modèle MiniWeb) */
.ob-floatbar { font-size: 13px; }
.ob-floatbar .kz-ico { width: 15px; height: 15px; }
.ob-floatbar .kz-floatbar__name { padding: 0 6px 0 4px; font-size: 13px; }
.kz-ctxstrip .kz-fsel { width: auto; height: 30px; padding: 0 18px 0 6px; border: 0; border-radius: 8px; font-size: 12px; box-shadow: none; }
.kz-ctxstrip .kz-fsel:focus { box-shadow: 0 0 0 1px #002395; }
.kz-ctxstrip .ob-fin { width: 44px; padding: 0 6px; text-transform: uppercase; field-sizing: fixed; }
.kz-ctxstrip input[data-rf="lang"] { text-transform: lowercase; }
[data-rf="country"] { text-transform: uppercase; }
/* Panneau Propriétés */
.ob-props .kz-props__body { gap: 16px; }
.ob-props .kz-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ob-props input[readonly] { background: #F3F3F3; color: #5C5C5C; }
.ob-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0; padding: 14px; border-radius: 14px; background: #F3F3F3; }
.ob-facts dt { font-size: 12px; color: #5C5C5C; }
.ob-facts dd { margin: 2px 0 0; font-weight: 600; font-size: 14px; }
.ob-detect { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.ob-advbtns { display: flex; flex-direction: column; gap: 8px; }
.ob-advbtns .kz-btn { justify-content: flex-start; }
/* Onglets Scans / Historique */
.ob-pane { flex: 1; min-height: 0; overflow-y: auto; background: #FFFFFF; }
.ob-pane__in { max-width: 1240px; margin: 0 auto; padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 20px; }
.ob-pane__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ob-pane__head h2 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.ob-pane__head p { margin: 2px 0 0; }
.ob-pane .grid.stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 1280px) {
  .ob-stage { gap: 24px; }
  .ob-obj { width: 200px; height: 200px; }
  .ob-obj__img { width: 168px; height: 168px; }
}
@media (max-width: 1100px) {
  .ob-editor .kz-editbar { flex-wrap: wrap; }
}
@media (max-width: 900px) {
  .ob-stage { flex-direction: column; }
  .ob-stage__arrow { transform: rotate(90deg); }
  .ob-phone { width: 320px; height: 560px; }
  .ob-pane__in { padding: 20px 16px 40px; }
  .ob-pane .grid.stats { grid-template-columns: 1fr; }
  .ob-cell-actions { flex-wrap: wrap; justify-content: flex-start; }
  .ob-actions-list { grid-template-columns: minmax(0, 1fr); }
  .modal { padding: 20px; }
  .kz-tablewrap { overflow-x: auto; }
}
/* Accueil : seconde ligne de filtres (dossier, membre, affichage) */
.ob-filter2 { margin-top: -16px; }
.ob-inline .kz-select { width: auto !important; }
.ob-mini { width: 40px; height: 40px; border-radius: 10px; background: #F3F3F3; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.kz-main svg.chart, .ob-pane svg.chart { height: 220px; }
.btn, .btn.primary, .card, .tb-icon:hover { box-shadow: none !important; }
.table-row:hover { background: transparent; }
@media (max-width: 600px) { .kz-filterbar .kz-segmented { flex-wrap: wrap; max-width: 100%; height: auto; } .ob-filter2 { margin-top: 0; } }
.kz-main .grid > *, .ob-pane .grid > * { min-width: 0; }
.kz-login__claim { color: #FFFFFF; }
