@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&display=swap");

:root {
  --ink: #151713;
  --ink-2: #30332d;
  --muted: #74786e;
  --paper: #fff;
  --canvas: #f4f5f1;
  --soft: #eef0ea;
  --line: #dfe1da;
  --line-strong: #cdd0c6;
  --green: #bdfc7a;
  --green-2: #e8fbd9;
  --green-dark: #275b37;
  --amber: #fff0c7;
  --amber-dark: #795716;
  --red: #fae1dc;
  --red-dark: #8c4438;
  --blue: #e1edff;
  --blue-dark: #335e9f;
  --violet: #eee8ff;
  --violet-dark: #604d9a;
  --sidebar: 244px;
  --topbar: 70px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 12px 35px rgba(18, 20, 16, .07);
  --ease: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: "Outfit", ui-sans-serif, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body.nav-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { color: inherit; font: inherit; }
button, a, label { -webkit-tap-highlight-color: transparent; }
img, svg { display: block; max-width: 100%; }
::selection { background: var(--green); }
:focus-visible { outline: 3px solid rgba(39, 91, 55, .35); outline-offset: 2px; }

.skip-link { position: fixed; top: 10px; left: 10px; z-index: 1000; padding: 9px 13px; border-radius: 999px; color: #fff; background: var(--ink); transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }

.admin-shell { display: grid; min-height: 100svh; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; display: flex; height: 100svh; flex-direction: column; padding: 22px 15px 16px; color: #c8cbc2; background: var(--ink); overflow-y: auto; }
.side-brand { display: flex; height: 38px; align-items: center; padding: 0 10px; color: #fff; font-size: 1rem; font-weight: 800; letter-spacing: -.04em; }
.side-brand small { margin-left: 7px; padding: 3px 6px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; color: #9ea298; font-size: .52rem; letter-spacing: .08em; text-transform: uppercase; }
.side-context { margin: 22px 2px 18px; padding: 12px; border: 1px solid rgba(255,255,255,.1); border-radius: 12px; background: rgba(255,255,255,.045); }
.side-context span, .side-context b { display: block; }
.side-context span { color: #8f9489; font-size: .63rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.side-context b { margin-top: 4px; color: #fff; font-size: .78rem; }
.side-context i { float: right; width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: #70cb81; box-shadow: 0 0 0 4px rgba(112,203,129,.12); }
.side-nav { display: grid; gap: 3px; }
.side-label { margin: 18px 10px 7px; color: #747a70; font-size: .57rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.side-link { display: flex; min-height: 40px; align-items: center; gap: 10px; padding: 0 10px; border-radius: 9px; color: #aeb2a8; font-size: .78rem; font-weight: 500; transition: color 160ms ease, background 160ms ease; }
.side-link:hover { color: #fff; background: rgba(255,255,255,.06); }
.side-link[aria-current="page"] { color: #fff; background: #2c3029; }
.side-link[aria-current="page"] .nav-glyph { color: var(--ink); background: var(--green); border-color: var(--green); }
.nav-glyph { display: grid; width: 22px; height: 22px; flex: 0 0 auto; place-items: center; border: 1px solid #50554c; border-radius: 7px; color: #b9bdb3; font-size: .6rem; font-style: normal; font-weight: 700; }
.side-spacer { flex: 1; min-height: 28px; }
.side-user { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 9px; padding: 12px 9px 2px; border-top: 1px solid rgba(255,255,255,.1); }
.user-avatar { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 50%; color: var(--ink); background: var(--green); font-size: .67rem; font-weight: 800; }
.side-user b, .side-user span { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user b { color: #fff; font-size: .71rem; }
.side-user span { color: #858a80; font-size: .6rem; }
.side-user button { border: 0; color: #969b90; background: transparent; cursor: pointer; }

.admin-main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 50; display: flex; height: var(--topbar); align-items: center; justify-content: space-between; gap: 20px; padding: 0 30px; border-bottom: 1px solid rgba(223,225,218,.9); background: rgba(255,255,255,.88); backdrop-filter: blur(16px) saturate(140%); }
.topbar-left, .topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-title { font-size: .94rem; font-weight: 700; letter-spacing: -.025em; }
.topbar-subtitle { margin-left: 8px; color: var(--muted); font-size: .71rem; }
.menu-toggle { display: none; }
.command-button { display: flex; width: min(32vw, 320px); height: 38px; align-items: center; gap: 9px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: var(--canvas); cursor: pointer; text-align: left; font-size: .72rem; }
.command-button kbd { margin-left: auto; padding: 2px 6px; border: 1px solid var(--line); border-radius: 5px; color: #8a8e84; background: #fff; font: .58rem "Outfit", sans-serif; }
.icon-button { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.icon-button:hover { background: var(--soft); }
.notif { position: relative; }
.notif::after { position: absolute; top: 8px; right: 8px; width: 6px; height: 6px; border: 2px solid #fff; border-radius: 50%; background: #df705d; content: ""; }
.mobile-backdrop { display: none; }

.page { width: min(100%, 1540px); margin-inline: auto; padding: 30px clamp(22px, 3.2vw, 50px) 60px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 26px; margin-bottom: 26px; }
.eyebrow { margin: 0 0 5px; color: var(--muted); font-size: .63rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.page-title { margin: 0; font-size: clamp(1.65rem, 2.8vw, 2.35rem); line-height: 1.08; letter-spacing: -.045em; }
.page-description { max-width: 720px; margin: 8px 0 0; color: var(--muted); }
.page-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; gap: 9px; }
.btn { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 8px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 10px; color: var(--ink-2); background: #fff; cursor: pointer; font-size: .74rem; font-weight: 700; transition: transform 180ms var(--ease), background 180ms ease, border-color 180ms ease; }
.btn:hover { transform: translateY(-1px); background: var(--soft); }
.btn.primary { color: #fff; background: var(--ink); border-color: var(--ink); }
.btn.primary:hover { color: var(--ink); background: var(--green); border-color: var(--green); }
.btn.success { color: var(--green-dark); background: var(--green-2); border-color: #c9e9b7; }
.btn.danger { color: var(--red-dark); background: var(--red); border-color: #efc9c1; }
.btn.small { min-height: 32px; padding-inline: 10px; border-radius: 8px; font-size: .68rem; }
.btn.wide { width: 100%; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.layout-main-aside { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.layout-aside-main { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }
.stack { display: grid; gap: 18px; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: 0 2px 8px rgba(18,20,16,.015); }
.panel.dark { color: #fff; background: var(--ink); border-color: var(--ink); }
.panel-head { display: flex; min-height: 58px; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel.dark .panel-head { border-color: rgba(255,255,255,.12); }
.panel-title { margin: 0; font-size: .89rem; font-weight: 700; letter-spacing: -.02em; }
.panel-subtitle { margin: 2px 0 0; color: var(--muted); font-size: .67rem; }
.panel-body { padding: 18px; }
.panel-empty { display: grid; min-height: 260px; place-items: center; padding: 35px; text-align: center; }
.panel-empty .empty-icon { display: grid; width: 48px; height: 48px; margin: 0 auto 14px; place-items: center; border-radius: 15px; background: var(--soft); font-weight: 700; }
.panel-empty h3 { margin: 0 0 5px; font-size: 1rem; }
.panel-empty p { max-width: 340px; margin: 0 auto 16px; color: var(--muted); font-size: .76rem; }

.kpi { min-height: 126px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.kpi-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.kpi-label { color: var(--muted); font-size: .68rem; font-weight: 600; }
.kpi-icon { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 10px; color: var(--green-dark); background: var(--green-2); font-size: .68rem; font-weight: 800; }
.kpi-icon.blue { color: var(--blue-dark); background: var(--blue); }
.kpi-icon.amber { color: var(--amber-dark); background: var(--amber); }
.kpi-icon.violet { color: var(--violet-dark); background: var(--violet); }
.kpi-value { display: block; margin-top: 13px; font-size: 1.85rem; font-weight: 700; line-height: 1; letter-spacing: -.055em; }
.kpi-foot { display: flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--muted); font-size: .62rem; }
.trend { color: var(--green-dark); font-weight: 700; }
.trend.down { color: var(--red-dark); }

.toolbar { display: flex; min-height: 64px; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.toolbar-group { display: flex; min-width: 0; align-items: center; gap: 8px; }
.search-field { position: relative; min-width: min(300px, 30vw); }
.search-field input { width: 100%; height: 38px; padding: 0 12px 0 34px; border: 1px solid var(--line); border-radius: 9px; outline: 0; background: var(--canvas); font-size: .73rem; }
.search-field::before { position: absolute; top: 9px; left: 12px; color: var(--muted); content: "⌕"; font-size: .9rem; }
.field, .select-field { display: grid; gap: 6px; }
.field label, .select-field label { color: var(--ink-2); font-size: .67rem; font-weight: 600; }
.field input, .field textarea, .select-field select { width: 100%; min-height: 40px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; outline: 0; background: #fff; font-size: .74rem; }
.field textarea { min-height: 92px; resize: vertical; }
.field input:focus, .field textarea:focus, .select-field select:focus, .search-field input:focus { border-color: #8e9487; box-shadow: 0 0 0 3px rgba(21,23,19,.06); }
.field-hint { color: var(--muted); font-size: .61rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.filter-button { min-height: 38px; }

.table-scroll { overflow-x: auto; }
.data-table { width: 100%; min-width: 760px; border-collapse: collapse; }
.data-table th, .data-table td { height: 52px; padding: 10px 14px; border-bottom: 1px solid #ebede7; text-align: left; vertical-align: middle; }
.data-table th { height: 40px; color: var(--muted); background: #fafbf8; font-size: .58rem; font-weight: 700; letter-spacing: .075em; text-transform: uppercase; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background 140ms ease; }
.data-table tbody tr[data-href] { cursor: pointer; }
.data-table tbody tr:hover { background: #fafbf8; }
.data-table td { color: #44483f; font-size: .7rem; }
.cell-person { display: flex; min-width: 175px; align-items: center; gap: 10px; }
.avatar { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: #3d4239; background: var(--soft); font-size: .6rem; font-weight: 800; }
.avatar.green { background: var(--green); }
.avatar.blue { background: var(--blue); }
.avatar.violet { background: var(--violet); }
.cell-person b, .cell-person span { display: block; }
.cell-person b { color: var(--ink); font-size: .72rem; }
.cell-person span { color: var(--muted); font-size: .61rem; }
.status { display: inline-flex; width: fit-content; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 999px; color: var(--green-dark); background: var(--green-2); font-size: .59rem; font-weight: 700; white-space: nowrap; }
.status::before { width: 5px; height: 5px; border-radius: 50%; background: #54a869; content: ""; }
.status.off { color: var(--red-dark); background: var(--red); }
.status.off::before { background: #bf6557; }
.status.pending { color: var(--amber-dark); background: var(--amber); }
.status.pending::before { background: #c49335; }
.status.info { color: var(--blue-dark); background: var(--blue); }
.status.info::before { background: #5e8bc8; }
.status.neutral { color: #60645b; background: var(--soft); }
.status.neutral::before { background: #8a8f84; }
.tag { display: inline-flex; padding: 4px 7px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: #fff; font-size: .58rem; font-weight: 600; white-space: nowrap; }
.table-footer { display: flex; min-height: 56px; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .66rem; }
.pagination { display: flex; align-items: center; gap: 5px; }
.page-button { display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; font-size: .65rem; }
.page-button.active { color: #fff; background: var(--ink); border-color: var(--ink); }

.chart-wrap { min-height: 280px; padding: 20px 18px 12px; }
.chart-legend { display: flex; gap: 16px; margin-bottom: 18px; color: var(--muted); font-size: .63rem; }
.legend-dot { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: var(--ink); }
.legend-dot.green { background: #78c65c; }
.line-chart { width: 100%; height: 210px; overflow: visible; }
.line-chart .grid-line { stroke: #e7e9e2; stroke-width: 1; }
.line-chart .line { fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.line-chart .line-green { fill: none; stroke: #73bd59; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.line-chart .area { fill: url(#chartFade); opacity: .32; }
.chart-axis { display: flex; justify-content: space-between; color: #9a9e94; font-size: .57rem; }
.bar-chart { display: flex; height: 200px; align-items: end; justify-content: space-between; gap: 8px; padding-top: 16px; border-bottom: 1px solid var(--line); background-image: linear-gradient(to bottom, transparent 24%, #eef0ea 25%, transparent 25%, transparent 49%, #eef0ea 50%, transparent 50%, transparent 74%, #eef0ea 75%, transparent 75%); }
.bar { position: relative; width: 100%; max-width: 24px; border-radius: 5px 5px 0 0; background: var(--ink); }
.bar::after { position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(to top, rgba(255,255,255,.02), rgba(255,255,255,.16)); content: ""; }
.bar.green { background: #82ca68; }

.activity-list { display: grid; }
.activity-item { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 11px; padding: 15px 0; border-bottom: 1px solid #eceee8; }
.activity-item:last-child { border-bottom: 0; }
.activity-icon { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; color: var(--green-dark); background: var(--green-2); font-size: .62rem; font-weight: 800; }
.activity-icon.red { color: var(--red-dark); background: var(--red); }
.activity-icon.blue { color: var(--blue-dark); background: var(--blue); }
.activity-icon.amber { color: var(--amber-dark); background: var(--amber); }
.activity-copy b { display: block; color: var(--ink); font-size: .7rem; }
.activity-copy p { margin: 2px 0 0; color: var(--muted); font-size: .64rem; }
.activity-time { color: #979b92; font-size: .58rem; white-space: nowrap; }

.progress-line { height: 7px; overflow: hidden; border-radius: 999px; background: var(--soft); }
.progress-line span { display: block; height: 100%; border-radius: inherit; background: var(--ink); }
.progress-line.green span { background: #77c95f; }
.progress-line.amber span { background: #d8ab4a; }
.metric-list { display: grid; gap: 16px; }
.metric-row { display: grid; gap: 7px; }
.metric-label { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .65rem; }
.metric-label b { color: var(--ink); }

.profile-head { display: flex; align-items: center; gap: 14px; }
.profile-head .avatar { width: 48px; height: 48px; font-size: .8rem; }
.profile-head h2 { margin: 0; font-size: 1.25rem; letter-spacing: -.035em; }
.profile-head p { margin: 3px 0 0; color: var(--muted); font-size: .68rem; }
.profile-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 16px; color: var(--muted); font-size: .66rem; }
.profile-meta b { color: var(--ink-2); }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.detail-cell { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fafbf8; }
.detail-cell span, .detail-cell b { display: block; }
.detail-cell span { margin-bottom: 4px; color: var(--muted); font-size: .56rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.detail-cell b { overflow: hidden; font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.section-label { margin: 4px 0 10px; color: var(--muted); font-size: .58rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.consent-card { padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.consent-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.consent-head b { font-size: .73rem; }
.consent-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.consent-meta span { color: var(--muted); font-size: .59rem; }
.consent-meta b { display: block; margin-top: 2px; color: var(--ink); font-size: .65rem; }

.timeline { position: relative; display: grid; gap: 14px; margin-left: 9px; padding-left: 28px; }
.timeline::before { position: absolute; top: 10px; bottom: 16px; left: 5px; width: 1px; background: var(--line-strong); content: ""; }
.timeline-item { position: relative; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: #fafbf8; }
.timeline-item::before { position: absolute; top: 17px; left: -29px; width: 11px; height: 11px; border: 3px solid #fff; border-radius: 50%; background: #68b879; box-shadow: 0 0 0 1px #b9bdb3; content: ""; }
.timeline-item.optout::before { background: #ca6f60; }
.timeline-item.sync::before { background: #668fca; }
.timeline-item b { display: block; font-size: .71rem; }
.timeline-item p { margin: 3px 0 0; color: var(--muted); font-size: .62rem; }
.timeline-item time { display: block; margin-top: 7px; color: #9a9e94; font-size: .57rem; }

.proof-hero { display: grid; grid-template-columns: 1fr auto; gap: 24px; padding: 22px; color: #fff; background: var(--ink); }
.proof-hero h2 { margin: 8px 0 3px; font-size: 1.25rem; letter-spacing: -.035em; }
.proof-id { color: #8f9489; font: .63rem ui-monospace, SFMono-Regular, Menlo, monospace; }
.proof-badge { align-self: start; padding: 7px 10px; border-radius: 999px; color: var(--ink); background: var(--green); font-size: .62rem; font-weight: 800; }
.proof-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.proof-cell { min-height: 82px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: #fafbf8; }
.proof-cell span { display: block; margin-bottom: 6px; color: var(--muted); font-size: .55rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.proof-cell b { font-size: .68rem; }
.hash-box { position: relative; margin-top: 12px; padding: 14px 84px 14px 14px; border: 1px solid #2b2e28; border-radius: 10px; color: #aaf36c; background: #11130f; font: .64rem/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; }
.hash-box .copy { position: absolute; top: 9px; right: 9px; }

.tabs { display: flex; gap: 3px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); }
.tab { min-height: 31px; padding: 0 10px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; cursor: pointer; font-size: .65rem; font-weight: 600; }
.tab.active { color: var(--ink); background: #fff; box-shadow: 0 2px 7px rgba(18,20,16,.06); }
.tab-panel[hidden] { display: none; }

.form-card { display: flex; min-height: 250px; flex-direction: column; overflow: hidden; }
.form-card-cover { position: relative; display: grid; min-height: 116px; place-items: center; color: #fff; background: var(--ink); }
.form-card-cover.green { color: var(--ink); background: var(--green); }
.form-card-cover.blue { color: #243d61; background: var(--blue); }
.form-card-cover span { font-size: .68rem; font-weight: 800; letter-spacing: .08em; }
.form-card-cover .qr-mini { position: absolute; right: 13px; bottom: 13px; display: grid; width: 34px; height: 34px; place-items: center; border: 4px solid #fff; color: var(--ink); background: repeating-conic-gradient(#111 0 25%,#fff 0 50%) 0 0/8px 8px; font-size: 0; }
.form-card-body { display: flex; flex: 1; flex-direction: column; padding: 16px; }
.form-card-body h3 { margin: 0; font-size: .86rem; }
.form-card-body p { margin: 4px 0 14px; color: var(--muted); font-size: .64rem; }
.form-card-stats { display: flex; gap: 16px; margin-top: auto; color: var(--muted); font-size: .6rem; }
.form-card-stats b { display: block; color: var(--ink); font-size: .7rem; }
.form-card-actions { display: flex; gap: 7px; margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); }

.builder { display: grid; height: calc(100svh - var(--topbar)); grid-template-columns: 250px minmax(420px, 1fr) 290px; overflow: hidden; }
.builder-panel { min-width: 0; overflow-y: auto; border-right: 1px solid var(--line); background: #fff; }
.builder-panel:last-child { border-right: 0; border-left: 1px solid var(--line); }
.builder-head { position: sticky; top: 0; z-index: 2; display: flex; min-height: 55px; align-items: center; justify-content: space-between; padding: 12px 15px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.95); }
.builder-head b { font-size: .75rem; }
.builder-content { padding: 15px; }
.builder-section { margin-bottom: 22px; }
.builder-section h3 { margin: 0 0 9px; color: var(--muted); font-size: .58rem; letter-spacing: .08em; text-transform: uppercase; }
.field-palette { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; }
.palette-item { display: grid; min-height: 67px; place-items: center; gap: 5px; padding: 8px; border: 1px solid var(--line); border-radius: 9px; background: #fafbf8; cursor: pointer; font-size: .61rem; font-weight: 600; }
.palette-item:hover { border-color: #9ca196; background: var(--green-2); }
.palette-item i { display: grid; width: 23px; height: 23px; place-items: center; border: 1px solid var(--line-strong); border-radius: 7px; font-style: normal; }
.builder-canvas { overflow-y: auto; padding: 34px; background: #e9ebe5; }
.phone-preview { width: min(100%, 430px); margin-inline: auto; overflow: hidden; border: 8px solid #242721; border-radius: 28px; background: #fff; box-shadow: 0 25px 55px rgba(18,20,16,.18); }
.phone-notch { width: 90px; height: 18px; margin: -1px auto 0; border-radius: 0 0 12px 12px; background: #242721; }
.public-form-cover { min-height: 165px; padding: 28px; color: #fff; background: var(--ink); }
.public-form-cover small { font-size: .58rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.public-form-cover h2 { max-width: 300px; margin: 46px 0 0; font-size: 1.65rem; line-height: 1; letter-spacing: -.045em; }
.public-form-fields { display: grid; gap: 12px; padding: 24px; }
.preview-field { position: relative; padding: 11px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: #fafbf8; font-size: .67rem; }
.preview-field b { display: block; margin-bottom: 6px; color: var(--ink); font-size: .65rem; }
.preview-field.selected { border-color: #6d7468; box-shadow: 0 0 0 2px rgba(21,23,19,.06); }
.preview-field.selected::after { position: absolute; top: 7px; right: 7px; padding: 2px 5px; border-radius: 5px; color: var(--ink); background: var(--green); content: "Sélectionné"; font-size: .48rem; font-weight: 700; }
.preview-submit { display: grid; height: 40px; place-items: center; border-radius: 999px; color: #fff; background: var(--ink); font-size: .68rem; font-weight: 700; }

.integration-card { padding: 18px; }
.integration-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.integration-logo { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 12px; color: #fff; background: var(--ink); font-size: .65rem; font-weight: 800; }
.integration-logo.green { color: var(--ink); background: var(--green); }
.integration-logo.blue { color: var(--blue-dark); background: var(--blue); }
.integration-logo.violet { color: var(--violet-dark); background: var(--violet); }
.integration-card h3 { margin: 14px 0 4px; font-size: .86rem; }
.integration-card p { min-height: 40px; margin: 0; color: var(--muted); font-size: .64rem; }
.integration-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 13px; border-top: 1px solid var(--line); color: var(--muted); font-size: .59rem; }

.mapping-flow { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: stretch; gap: 12px; }
.mapping-column { padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: #fafbf8; }
.mapping-column h3 { margin: 0 0 12px; font-size: .75rem; }
.mapping-field { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 39px; margin-bottom: 7px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: .63rem ui-monospace, SFMono-Regular, Menlo, monospace; }
.mapping-field:last-child { margin-bottom: 0; }
.mapping-arrow { display: grid; place-items: center; color: var(--muted); }

.stepper { display: grid; grid-template-columns: repeat(6, 1fr); margin-bottom: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.step { position: relative; min-height: 82px; padding: 14px; border-right: 1px solid var(--line); }
.step:last-child { border-right: 0; }
.step span, .step b { display: block; }
.step span { color: var(--muted); font-size: .56rem; font-weight: 700; letter-spacing: .07em; }
.step b { margin-top: 8px; font-size: .68rem; }
.step.done::after, .step.active::after { position: absolute; right: 13px; bottom: 13px; width: 7px; height: 7px; border-radius: 50%; background: #69b87a; content: ""; }
.step.active { background: var(--green-2); }
.step.active::after { background: #3f9657; box-shadow: 0 0 0 4px rgba(63,150,87,.12); }

.json-editor { min-height: 430px; padding: 20px; overflow: auto; border-radius: 11px; color: #dfe3d8; background: #131510; font: .68rem/1.72 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; white-space: pre-wrap; }
.json-editor .key { color: #9fc8ff; }
.json-editor .value { color: #bdfc7a; }
.json-editor .number { color: #ffd78a; }
.schema-preview { display: grid; gap: 12px; }
.schema-group { padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: #fafbf8; }
.schema-group-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 11px; }
.schema-group-head b { font-size: .7rem; }
.schema-fields { display: flex; flex-wrap: wrap; gap: 6px; }

.audit-detail { max-width: 660px; }
.diff { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; }
.diff-block { min-height: 180px; padding: 14px; border-radius: 10px; background: #151713; color: #d6dad0; font: .62rem/1.65 ui-monospace, monospace; white-space: pre-wrap; }
.diff-block.before { border-top: 3px solid #d97968; }
.diff-block.after { border-top: 3px solid #78c869; }

.toast { position: fixed; right: 22px; bottom: 22px; z-index: 200; display: flex; max-width: 360px; align-items: center; gap: 10px; padding: 12px 15px; border: 1px solid #30332d; border-radius: 11px; color: #fff; background: var(--ink); box-shadow: var(--shadow); font-size: .7rem; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity 180ms ease, transform 240ms var(--ease); }
.toast.show { opacity: 1; transform: none; }

.command-modal { position: fixed; inset: 0; z-index: 300; display: none; place-items: start center; padding: 12vh 20px 20px; background: rgba(15,17,13,.42); backdrop-filter: blur(5px); }
.command-modal.open { display: grid; }
.command-box { width: min(100%, 620px); overflow: hidden; border: 1px solid #363932; border-radius: 15px; background: #fff; box-shadow: 0 28px 80px rgba(0,0,0,.22); }
.command-input { width: 100%; height: 58px; padding: 0 18px; border: 0; border-bottom: 1px solid var(--line); outline: 0; font-size: .85rem; }
.command-results { display: grid; gap: 3px; max-height: 330px; padding: 8px; overflow-y: auto; }
.command-result { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 9px; font-size: .72rem; }
.command-result:hover { background: var(--soft); }

/* Public collection pages */
.collect-page { min-height: 100svh; background: #fff; }
.collect-shell { display: grid; min-height: 100svh; grid-template-columns: minmax(330px,.88fr) minmax(440px,1.12fr); }
.collect-cover { position: relative; display: flex; min-height: 100%; flex-direction: column; justify-content: space-between; padding: clamp(32px,5vw,72px); color: #fff; background: var(--ink); overflow: hidden; }
.collect-cover::after { position: absolute; right: -18%; bottom: -22%; width: 65%; aspect-ratio: 1; border-radius: 50%; background: var(--green); content: ""; filter: blur(90px); opacity: .19; }
.collect-brand { position: relative; z-index: 1; font-size: .82rem; font-weight: 800; letter-spacing: .08em; }
.collect-copy { position: relative; z-index: 1; max-width: 580px; margin-block: 80px; }
.collect-kicker { margin: 0 0 20px; color: #aeb3a7; font-size: .64rem; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.collect-copy h1 { margin: 0; font-size: clamp(3rem,5.8vw,6.2rem); line-height: .9; letter-spacing: -.065em; }
.collect-copy p { max-width: 520px; margin: 25px 0 0; color: #c3c7be; font-size: clamp(1rem,1.6vw,1.2rem); }
.collect-foot { position: relative; z-index: 1; color: #90968a; font-size: .67rem; }
.collect-form-wrap { display: grid; min-height: 100%; place-items: center; padding: 48px 24px; background: var(--canvas); }
.collect-form { width: min(100%, 500px); }
.collect-form h2 { margin: 0 0 8px; font-size: clamp(2rem,3.4vw,3rem); line-height: 1; letter-spacing: -.05em; }
.collect-form > p { margin: 0 0 28px; color: var(--muted); }
.collect-form .field { margin-bottom: 15px; }
.choice-card { display: flex; align-items: flex-start; gap: 11px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: #fff; cursor: pointer; }
.choice-card input { width: auto; min-height: 0; flex: 0 0 auto; margin-top: 3px; padding: 0; accent-color: var(--ink); }
.choice-card b { display: block; font-size: .75rem; }
.choice-card span { display: block; margin-top: 3px; color: var(--muted); font-size: .64rem; }
.choice-card.selected { border-color: var(--ink); background: var(--green-2); box-shadow: 0 0 0 2px rgba(21,23,19,.05); }
.collect-legal { margin: 18px 0; color: var(--muted); font-size: .62rem; }
.collect-success { display: grid; min-height: 100svh; place-items: center; padding: 30px; background: var(--canvas); }
.success-card { width: min(100%, 520px); padding: clamp(34px,6vw,64px); border: 1px solid var(--line); border-radius: 24px; text-align: center; background: #fff; box-shadow: var(--shadow); }
.success-icon { display: grid; width: 58px; height: 58px; margin: 0 auto 24px; place-items: center; border-radius: 50%; color: var(--green-dark); background: var(--green-2); font-size: 1.3rem; font-weight: 800; }
.success-card h1 { margin: 0 0 12px; font-size: clamp(2rem,5vw,3.2rem); line-height: .98; letter-spacing: -.055em; }
.success-card p { color: var(--muted); }

.mini-list { display: grid; gap: 9px; }
.mini-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 43px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fafbf8; font-size: .67rem; }
.mini-row small { display: block; color: var(--muted); font-size: .57rem; }
.callout { padding: 15px; border: 1px solid #cfe7bf; border-radius: 11px; color: var(--green-dark); background: var(--green-2); font-size: .68rem; }
.callout.amber { color: var(--amber-dark); background: var(--amber); border-color: #ead7a8; }
.code-inline { padding: 2px 5px; border-radius: 5px; color: #d5f5b9; background: #252820; font: .61rem ui-monospace, monospace; }
.role-card { padding: 18px; }
.role-card h3 { margin: 0 0 5px; font-size: .84rem; }
.role-card p { min-height: 38px; margin: 0 0 14px; color: var(--muted); font-size: .64rem; }
.permission-list { display: grid; gap: 7px; color: #4c5047; font-size: .63rem; }
.permission-list span::before { margin-right: 7px; color: #4d9b61; content: "✓"; font-weight: 800; }
.channel-preview { display: grid; min-height: 170px; place-items: center; padding: 22px; border: 1px dashed var(--line-strong); border-radius: 12px; text-align: center; background: #fafbf8; }
.channel-preview b { display: block; margin-bottom: 5px; font-size: .76rem; }
.channel-preview p { max-width: 300px; margin: 0 0 13px; color: var(--muted); font-size: .63rem; }
.qr-large { width: 108px; height: 108px; margin: 0 auto 16px; border: 9px solid #fff; outline: 1px solid var(--line); background: repeating-conic-gradient(#111 0 25%,#fff 0 50%) 0 0/18px 18px; }
.coverage-map { position: relative; min-height: 280px; overflow: hidden; border-radius: 11px; background: #ecefe8; }
.coverage-map::before { position: absolute; inset: 18px; border-radius: 46% 54% 42% 58% / 38% 44% 56% 62%; background: #d6dacd; content: ""; transform: rotate(-6deg); }
.map-dot { position: absolute; z-index: 1; display: grid; width: 24px; height: 24px; place-items: center; border: 4px solid #fff; border-radius: 50%; color: #fff; background: var(--ink); box-shadow: 0 4px 10px rgba(0,0,0,.12); font-size: 0; }
.map-dot.active { background: #66b778; }
.event-pill { display: inline-flex; padding: 3px 6px; border-radius: 6px; color: #4e534a; background: var(--soft); font: .55rem ui-monospace, monospace; }

@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .layout-main-aside { grid-template-columns: minmax(0,1fr) 300px; }
  .builder { grid-template-columns: 220px minmax(390px,1fr) 250px; }
  .stepper { grid-template-columns: repeat(3,1fr); }
  .step:nth-child(3) { border-right: 0; }
  .step:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; z-index: 120; width: var(--sidebar); transform: translateX(-105%); transition: transform 280ms var(--ease); }
  .sidebar.open { transform: translateX(0); }
  .mobile-backdrop { position: fixed; inset: 0; z-index: 110; display: block; background: rgba(15,17,13,.36); opacity: 0; pointer-events: none; transition: opacity 220ms ease; }
  .mobile-backdrop.open { opacity: 1; pointer-events: auto; }
  .menu-toggle { display: grid; }
  .layout-main-aside, .layout-aside-main { grid-template-columns: 1fr; }
  .builder { height: auto; min-height: calc(100svh - var(--topbar)); grid-template-columns: 1fr; overflow: visible; }
  .builder-panel { overflow: visible; border-right: 0; border-bottom: 1px solid var(--line); }
  .builder-panel:last-child { border-left: 0; }
  .builder-canvas { min-height: 720px; }
  .collect-shell { grid-template-columns: 1fr; }
  .collect-cover { min-height: 600px; }
  .collect-form-wrap { min-height: 740px; }
}

@media (max-width: 680px) {
  .topbar { padding-inline: 14px; }
  .topbar-subtitle, .command-button span, .command-button kbd { display: none; }
  .command-button { width: 38px; padding: 0; justify-content: center; }
  .page { padding: 24px 14px 50px; }
  .page-head { flex-direction: column; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .grid-2, .grid-3, .grid-4, .form-grid, .proof-grid { grid-template-columns: 1fr; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-group { width: 100%; overflow-x: auto; }
  .search-field { width: 100%; min-width: 0; }
  .table-footer { align-items: flex-start; flex-direction: column; }
  .detail-grid, .consent-meta { grid-template-columns: 1fr; }
  .proof-hero { grid-template-columns: 1fr; }
  .proof-badge { justify-self: start; }
  .hash-box { padding-right: 14px; padding-bottom: 52px; }
  .mapping-flow { grid-template-columns: 1fr; }
  .mapping-arrow { transform: rotate(90deg); }
  .stepper { grid-template-columns: 1fr; }
  .step, .step:nth-child(3) { border-right: 0; border-bottom: 1px solid var(--line); }
  .step:last-child { border-bottom: 0; }
  .field-palette { grid-template-columns: repeat(3,1fr); }
  .builder-canvas { min-height: 650px; padding: 20px 12px; }
  .diff { grid-template-columns: 1fr; }
  .collect-cover { min-height: 540px; padding: 30px 22px; }
  .collect-copy { margin-block: 70px; }
  .collect-copy h1 { font-size: clamp(3rem,16vw,4.7rem); }
  .collect-form-wrap { padding: 46px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
