:root {
  --green: #198754;
  --green-dark: #146c43;
  --green-soft: #e8f4ed;
  --white: #ffffff;
  --bg: #f5f7f6;
  --text: #252b27;
  --muted: #6b7570;
  --line: #e4e9e6;
  --orange: #ffc000;
  --lime: #92d050;
  --bs-primary: #198754;
  --bs-body-color: #252b27;
  --bs-body-font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}
body { background: var(--white); color: var(--text); font-size: .94rem; }
a { color: var(--green-dark); }
.btn-primary { --bs-btn-bg: var(--green); --bs-btn-border-color: var(--green); --bs-btn-hover-bg: var(--green-dark); --bs-btn-hover-border-color: var(--green-dark); --bs-btn-active-bg: var(--green-dark); --bs-btn-disabled-bg: var(--green); --bs-btn-disabled-border-color: var(--green); }
.btn-outline-primary { --bs-btn-color: var(--green); --bs-btn-border-color: var(--green); --bs-btn-hover-bg: var(--green); --bs-btn-hover-border-color: var(--green); --bs-btn-active-bg: var(--green-dark); }
.btn { border-radius: 10px; font-weight: 600; }
.form-control, .form-select { border-radius: 10px; border-color: #d6ddd9; }
.form-control:focus, .form-select:focus { border-color: var(--green); box-shadow: 0 0 0 .2rem rgba(25, 135, 84, .15); }
.form-check-input:checked { background-color: var(--green); border-color: var(--green); }
.form-label { font-weight: 600; font-size: .85rem; }
.text-green { color: var(--green) !important; }
.bg-green-soft { background: var(--green-soft); }

/* Layout */
.sx-sidebar { position: fixed; inset: 0 auto 0 0; width: 250px; background: var(--white); border-right: 1px solid var(--line); padding: 1.25rem .9rem; overflow-y: auto; z-index: 1040; transition: transform .2s; }
.sx-brand { display: flex; align-items: center; gap: .6rem; padding: .25rem .5rem 1.25rem; font-weight: 800; font-size: 1.15rem; letter-spacing: .5px; }
.sx-brand .logo { width: 36px; height: 36px; border-radius: 10px; background: var(--green); color: #fff; display: grid; place-items: center; font-size: 1.1rem; }
.sx-nav-title { text-transform: uppercase; font-size: .68rem; letter-spacing: .08em; color: var(--muted); padding: 1rem .75rem .35rem; font-weight: 700; }
.sx-nav a { display: flex; align-items: center; gap: .7rem; padding: .6rem .85rem; margin-bottom: 2px; border-radius: 12px; color: var(--text); text-decoration: none; font-weight: 500; }
.sx-nav a i { font-size: 1.05rem; color: var(--muted); }
.sx-nav a:hover { background: var(--bg); }
.sx-nav a.active { background: var(--green-soft); color: var(--green-dark); font-weight: 700; }
.sx-nav a.active i { color: var(--green); }
.sx-main { margin-left: 250px; min-height: 100vh; background: var(--bg); }
.sx-topbar { background: var(--white); border-bottom: 1px solid var(--line); padding: .7rem 1.5rem; display: flex; align-items: center; gap: 1rem; position: sticky; top: 0; z-index: 1030; }
.sx-content { padding: 1.5rem; max-width: 1500px; }
.sx-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--green-soft); color: var(--green-dark); display: grid; place-items: center; font-weight: 700; }
.page-title { font-size: 1.35rem; font-weight: 800; margin: 0; }
.page-sub { color: var(--muted); margin: 0; }

/* Cards */
.sx-card { background: var(--white); border: 1px solid var(--line); border-radius: 16px; }
.sx-card .head { padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.sx-card .head h2 { font-size: 1rem; font-weight: 700; margin: 0; }
.sx-card .body, .sx-card.body { padding: 1.5rem; }
.form-section { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: .25rem 0 -.25rem; padding-top: .75rem; border-top: 1px solid var(--line); }
.form-section:first-child { border-top: 0; padding-top: 0; }
.form-actions { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); display: flex; gap: .5rem; }
.stat { padding: 1.1rem 1.25rem; }
.stat .label { color: var(--muted); font-size: .8rem; font-weight: 600; display: flex; align-items: center; justify-content: space-between; }
.stat .label i { width: 32px; height: 32px; border-radius: 10px; background: var(--bg); display: grid; place-items: center; color: var(--green); }
.stat .value { font-size: 1.7rem; font-weight: 800; line-height: 1.2; margin-top: .35rem; }
.stat.accent { border-top: 3px solid var(--green); }
.progress { height: 8px; border-radius: 8px; background: var(--bg); }
.progress-bar { background: var(--green); }
.progress-bar.warn { background: var(--orange); }

/* Tables */
.table { --bs-table-bg: transparent; margin: 0; }
.table thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--line); background: var(--white); white-space: nowrap; }
.table td { vertical-align: middle; border-color: var(--line); }
.table-hover tbody tr:hover { background: #fafcfb; }

/* Badges */
.badge-sx { display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .6rem; border-radius: 20px; font-size: .75rem; font-weight: 600; background: var(--bg); color: var(--text); }
.badge-sx.green { background: var(--green-soft); color: var(--green-dark); }
.badge-sx.red { background: #fdecec; color: #b42318; }
.badge-sx.gray { background: #eef0ef; color: #525b55; } /* darker than --muted: #6b7570 on this bg is 4.17:1, under AA 4.5:1 */
.badge-sx.amber { background: #fff3cd; color: #8a6500; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* Button still submits (server returns the real closedReason() error, no silent failure) but reads as closed. */
.btn-disabled-look { opacity: .55; filter: grayscale(.3); }

/* Row action clusters (icon-only buttons): keep real tap targets >= 44px without
   touching the shared .btn-sm used elsewhere (admin/structures/index.blade.php and similar). */
.row-actions { display: inline-flex; align-items: center; gap: .3rem; }
.row-actions .btn, .row-actions a.btn { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.row-actions .btn-copy { min-width: auto; padding-left: .7rem; padding-right: .7rem; }
.photo-thumb { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; background: var(--bg); }
.photo-lg { width: 140px; height: 170px; object-fit: cover; border-radius: 14px; border: 1px solid var(--line); }
.link-box { background: var(--bg); border: 1px dashed #c5d0ca; border-radius: 12px; padding: .6rem .8rem; font-family: ui-monospace, monospace; font-size: .82rem; word-break: break-all; }

/* Builder */
.field-row { display: flex; align-items: center; gap: .75rem; padding: .7rem 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--white); margin-bottom: .5rem; }
.field-row.dragging { opacity: .5; }
.field-row .handle { cursor: grab; color: var(--muted); }
.field-row.inactive { background: var(--bg); opacity: .75; }

/* Public & login */
.public-wrap { min-height: 100vh; background: var(--bg); display: flex; align-items: flex-start; justify-content: center; padding: 2rem 1rem; }
.public-card { width: 100%; max-width: 720px; background: var(--white); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.public-card.public-card-wide { max-width: 1120px; }
.public-card .top { height: 5px; background: var(--green); }
.public-card .inner { padding: 2rem; }

/* Hub: category switcher */
.hub-switcher { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .6rem; }
.hub-switcher-item { display: flex; align-items: center; gap: .6rem; padding: .7rem .9rem; border-radius: 12px; border: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 600; font-size: .85rem; }
.hub-switcher-item:hover { background: var(--bg); }
.hub-switcher-item.active { background: var(--green-soft); border-color: var(--green); color: var(--green-dark); }
.hub-switcher-item .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.hub-switcher-item .dot.green { background: var(--green); }
.hub-switcher-item .dot.red { background: #b42318; }
.hub-switcher-item .dot.gray { background: var(--muted); }
.hub-switcher-item .dot.amber { background: #8a6500; }

/* Hub: add-people method switch */
.hub-method-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.hub-method { display: flex; flex-direction: column; gap: .15rem; text-align: left; padding: .75rem .9rem; border-radius: 12px; border: 1px solid var(--line); background: var(--white); color: var(--text); text-decoration: none; }
.hub-method strong { font-size: .9rem; }
.hub-method small { font-size: .74rem; color: var(--muted); line-height: 1.3; }
.hub-method:hover { background: var(--bg); }
.hub-method.active { background: var(--green-soft); border-color: var(--green); }
.hub-method.active strong { color: var(--green-dark); }
.hub-method-hint { font-size: .85rem; color: var(--muted); }
.hub-switcher-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.hub-switcher-text small { font-weight: 500; color: var(--muted); font-size: .74rem; }
.hub-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.hub-step { display: flex; gap: .7rem; align-items: flex-start; background: var(--bg); border-radius: 12px; padding: .75rem .9rem; }
.hub-step > span { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--green); color: #fff; font-weight: 700; font-size: .8rem; display: grid; place-items: center; }
.hub-step strong { display: block; font-size: .85rem; }
.hub-step small { display: block; color: var(--muted); font-size: .76rem; line-height: 1.3; }
.hub-numbers { display: flex; gap: 1.25rem; }
.hub-numbers > div { text-align: center; }
.hub-numbers strong { display: block; font-size: 1.35rem; line-height: 1.1; }
.hub-numbers small { color: var(--muted); font-size: .72rem; }
.hub-linkbox { background: var(--green-soft); border: 1px solid #cfe5d8; border-radius: 12px; padding: .75rem .9rem; }
.hub-url { font-family: ui-monospace, monospace; font-size: .8rem; word-break: break-all; overflow-wrap: anywhere; min-width: 0; }
@media (max-width: 767px) {
  .hub-steps, .hub-method-switch { grid-template-columns: 1fr; }
  .hub-numbers { gap: .9rem; }
}

@media (max-width: 991px) {
  .sx-sidebar { transform: translateX(-100%); }
  .sx-sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .15); }
  .sx-main { margin-left: 0; }
  .sx-content { padding: 1rem; }
}

/* Pagination aux couleurs SIREXE */
.pagination { --bs-pagination-color: var(--green); --bs-pagination-hover-color: var(--green-dark); --bs-pagination-hover-bg: var(--green-soft); --bs-pagination-hover-border-color: var(--green); --bs-pagination-focus-color: var(--green-dark); --bs-pagination-focus-bg: var(--green-soft); --bs-pagination-focus-box-shadow: 0 0 0 .2rem rgba(25, 135, 84, .2); --bs-pagination-active-color: #fff; --bs-pagination-active-bg: var(--green); --bs-pagination-active-border-color: var(--green); --bs-pagination-disabled-color: #9aa5a0; --bs-pagination-border-color: var(--line); }
.lang-switch .btn { font-weight: 700; padding: .25rem .6rem; }

/* Bandeau « je vois le compte de… » */
.viewas-bar { background: var(--orange); color: var(--text); padding: .55rem 1.5rem; display: flex; align-items: center; justify-content: center; gap: .75rem; flex-wrap: wrap; font-size: .9rem; position: relative; z-index: 1050; }
.viewas-bar form { margin: 0; }

.hub-num { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--green); color: #fff; font-size: .72rem; margin-right: .25rem; }
.hub-recap { display: flex; align-items: center; gap: .75rem; background: var(--green-soft); border: 1px solid #cfe5d8; border-radius: 12px; padding: .8rem 1rem; margin: 1.25rem 0 .75rem; }
.hub-recap i { font-size: 1.3rem; color: var(--green); }

.hub-sentlist { border: 1px solid var(--line); border-radius: 12px; background: var(--white); padding: .5rem .85rem; max-height: 220px; overflow: auto; font-size: .88rem; }
.hub-sentlist > div { padding: .35rem 0; border-bottom: 1px solid var(--line); }
.hub-sentlist > div:last-child { border-bottom: 0; }

.send-icon { width: 68px; height: 68px; border-radius: 50%; margin: 0 auto; display: grid; place-items: center; font-size: 2rem; color: #fff; }
.send-icon.ok { background: var(--green); }
.send-icon.ko { background: #d92d20; }
.send-icon.mixed { background: var(--orange); color: var(--text); }
.send-list { list-style: none; margin: 0; padding: .5rem .75rem; border-radius: 10px; font-size: .9rem; max-height: 160px; overflow: auto; word-break: break-all; }
.send-list.ok { background: var(--green-soft); }
.send-list.ko { background: #fdecec; }

.confirm-icon { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto; display: grid; place-items: center; font-size: 1.8rem; }
.confirm-icon.info { background: var(--green-soft); color: var(--green); }
.confirm-icon.danger { background: #fdecec; color: #d92d20; }
