:root {
  --ink: #15201b;
  --muted: #6c7771;
  --surface: #fff;
  --bg: #f3f6f4;
  --line: #dce4df;
  --brand: #16745b;
  --brand-dark: #0d3d31;
  --accent: #e9814d;
  --green: #2d8b5d;
  --red: #c9554e;
  --yellow: #d79b2b;
  --blue: #376fd7;
  --purple: #7656cf;
  --navy: #0d1c16;
  --shadow: 0 18px 55px rgba(18,31,24,.1);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; font-size: 16px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.is-hidden { display: none !important; }
:focus-visible { outline: 3px solid rgba(22,116,91,.22); outline-offset: 3px; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 11px; padding: 10px 13px; background: #fff; color: var(--ink); font-size: 14px; font-weight: 800; transition: .18s ease; }
.button:hover { transform: translateY(-1px); }
.button--primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.button--ghost { border-color: var(--line); }
.button--success { background: #e9f7ef; color: var(--green); border-color: #ccebd9; }
.button--danger { background: #fff0ef; color: var(--red); border-color: #f2ceca; }
.button--small { padding: 8px 10px; font-size: 13px; }
.icon-button { width: 34px; height: 34px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--muted); font-weight: 900; }
.icon-button:hover { color: var(--brand); border-color: #9fc7ba; }

/* Login */
.login-screen { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 15% 10%, rgba(36,154,116,.27), transparent 28%), radial-gradient(circle at 90% 90%, rgba(233,129,77,.16), transparent 30%), #081710; }
.login-card { width: min(440px, 100%); padding: 30px; border-radius: 24px; background: #fff; box-shadow: 0 35px 110px rgba(0,0,0,.4); }
.login-brand { display: flex; gap: 11px; align-items: center; }
.login-brand__mark { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 14px; background: linear-gradient(145deg,var(--brand),#e7a04d); color: #fff; font-weight: 950; }
.login-brand strong { display: block; }
.login-brand small { color: var(--muted); font-size: 13px; }
.login-card h1 { margin: 24px 0 7px; font-size: 30px; }
.login-card > p { color: var(--muted); font-size: 15px; }
.login-field { margin-top: 18px; }
.login-field label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 850; }
.login-code { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.login-code input { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 11px; }
.login-code button { border: 1px solid var(--line); border-radius: 11px; background: #fff; padding: 0 12px; font-weight: 800; }
.demo-code { margin: 13px 0; padding: 10px 12px; border: 1px solid #cde5da; border-radius: 11px; background: #edf7f3; color: #235f4e; font-size: 14px; }
.form-message { margin-top: 10px; padding: 10px; border-radius: 10px; background: #fff0ef; color: #9a332e; font-size: 14px; }

/* Shell */
.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0,1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 250px; z-index: 60; display: flex; flex-direction: column; padding: 22px 15px; background: var(--navy); color: #fff; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; }
.sidebar-brand__mark { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 13px; background: linear-gradient(145deg,#27916f,#1a5947); font-size: 13px; font-weight: 950; }
.sidebar-brand strong { display: block; font-size: 17px; }
.sidebar-brand small { color: rgba(255,255,255,.45); font-size: 13px; }
.side-nav { display: grid; gap: 5px; }
.side-link { width: 100%; display: flex; align-items: center; gap: 11px; padding: 11px 12px; border: 0; border-radius: 11px; background: transparent; color: rgba(255,255,255,.62); font-size: 16px; font-weight: 750; text-align: left; }
.side-link:hover, .side-link.is-active { background: rgba(255,255,255,.1); color: #fff; }
.side-link > span:first-child { width: 22px; text-align: center; }
.bubble { margin-left: auto; min-width: 21px; height: 21px; display: grid; place-items: center; border-radius: 999px; background: var(--brand); color: #fff; font-size: 12px; }
.sidebar-bottom { margin-top: auto; display: grid; gap: 8px; }
.demo-badge { padding: 13px; border: 1px solid rgba(255,255,255,.1); border-radius: 13px; background: rgba(255,255,255,.07); color: rgba(255,255,255,.55); font-size: 13px; line-height: 1.55; }
.demo-badge strong { color: #fff; }
.admin-main { grid-column: 2; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 35; height: 72px; display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 0 27px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.9); backdrop-filter: blur(15px); }
.topbar-mobile-title { display: none; font-weight: 850; }
.global-search { position: relative; width: min(460px, 45vw); }
.global-search span { position: absolute; left: 12px; top: 10px; color: var(--muted); }
.global-search input { width: 100%; padding: 10px 12px 10px 37px; border: 1px solid var(--line); border-radius: 11px; background: #f5f8f6; outline: none; font-size: 14px; }
.admin-user { display: flex; align-items: center; gap: 10px; }
.admin-user strong { font-size: 15px; }
.admin-user small { color: var(--muted); font-size: 13px; }
.avatar { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--brand); color: #fff; font-size: 13px; font-weight: 900; }
.admin-content { max-width: 1550px; margin: 0 auto; padding: 28px; }

.page-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 20px; }
.page-heading h1 { margin: 0; font-size: 32px; letter-spacing: -.035em; }
.page-heading p { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.heading-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.alert-banner { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 17px; padding: 13px 15px; border: 1px solid #eed587; border-radius: 13px; background: #fff8df; color: #765300; }
.alert-banner strong { font-size: 15px; }
.alert-banner small { font-size: 13px; }

/* KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 13px; margin-bottom: 17px; }
.kpi-card { padding: 17px; border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: 0 7px 24px rgba(18,31,24,.04); transition: .2s ease; }
.kpi-card[data-kpi-filter] { cursor: pointer; }
.kpi-card[data-kpi-filter]:hover { transform: translateY(-3px); border-color: #b8d0c6; box-shadow: var(--shadow); }
.kpi-card__head { display: flex; justify-content: space-between; gap: 10px; align-items: center; color: var(--muted); font-size: 14px; font-weight: 750; }
.kpi-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; background: #edf6f2; color: var(--brand); }
.kpi-value { margin: 10px 0 2px; font-size: 31px; font-weight: 950; letter-spacing: -.04em; }
.kpi-sub { color: var(--muted); font-size: 13px; }

/* Panels */
.dashboard-grid { display: grid; grid-template-columns: 1.38fr .62fr; gap: 15px; margin-bottom: 15px; }
.dashboard-grid.equal { grid-template-columns: 1fr 1fr; }
.panel { overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: 0 7px 24px rgba(18,31,24,.04); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 16px 17px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font-size: 18px; }
.panel-head small { color: var(--muted); font-size: 13px; }
.panel-body { padding: 17px; }
.chart-wrap { height: 230px; display: flex; align-items: flex-end; gap: 12px; padding: 15px 6px 3px; }
.chart-column { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 7px; }
.chart-value { font-size: 13px; font-weight: 850; color: var(--muted); }
.chart-bar { width: min(38px, 80%); min-height: 9px; border-radius: 9px 9px 3px 3px; background: linear-gradient(180deg,#45a482,var(--brand)); }
.chart-column > span { color: var(--muted); font-size: 13px; }
.source-list { display: grid; gap: 14px; }
.source-row > div:first-child { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.progress { height: 7px; margin-top: 6px; overflow: hidden; border-radius: 999px; background: #edf1ef; }
.progress span { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.funnel { display: grid; gap: 12px; }
.funnel-row { display: grid; grid-template-columns: 75px 1fr 26px 30px; gap: 8px; align-items: center; font-size: 13px; }
.funnel-track { height: 24px; padding: 3px; border-radius: 8px; background: #edf1ef; }
.funnel-track i { display: block; height: 100%; min-width: 10px; border-radius: 6px; background: linear-gradient(90deg,var(--brand),#57a589); }
.funnel-row small { color: var(--muted); }
.activity-list { display: grid; }
.activity-item { width: 100%; display: grid; grid-template-columns: 35px 1fr; gap: 10px; padding: 11px 0; border: 0; border-bottom: 1px solid #edf1ef; background: transparent; text-align: left; }
.activity-item:last-child { border-bottom: 0; }
.activity-item > span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: #edf6f2; color: var(--brand); }
.activity-item strong { display: block; font-size: 14px; line-height: 1.35; }
.activity-item small { display: block; margin-top: 3px; color: var(--muted); font-size: 12.5px; }

/* Tables and filtering */
.quick-filters { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.quick-filter { padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); font-size: 13px; font-weight: 800; }
.quick-filter:hover, .quick-filter.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }
.toolbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 15px; margin-bottom: 12px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters label { display: grid; gap: 4px; color: var(--muted); font-size: 12px; font-weight: 750; }
.filters select, .filters input { min-width: 130px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font-size: 14px; }
.filters .search-field { min-width: 210px; }
.view-toggle { display: flex; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; }
.view-toggle button { padding: 9px 11px; border: 0; background: #fff; color: var(--muted); font-size: 14px; }
.view-toggle button.is-active { background: var(--navy); color: #fff; }
.filter-summary { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 11px; padding: 10px 13px; border-radius: 11px; background: #edf6f2; color: #286652; font-size: 14px; }
.table-wrap { overflow: auto; }
.data-table { width: 100%; min-width: 980px; border-collapse: collapse; }
.data-table th { padding: 9px 11px; border-bottom: 1px solid var(--line); background: #fafbfa; color: var(--muted); font-size: 12px; text-align: left; text-transform: uppercase; letter-spacing: .07em; }
.data-table td { padding: 9px 11px; border-bottom: 1px solid #edf1ef; font-size: 14px; vertical-align: middle; line-height: 1.3; }
.data-table tr:hover td { background: #fbfdfc; }
.data-table td > strong { display: block; }
.data-table td > small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.person-cell { display: flex; align-items: center; gap: 9px; }
.person-cell > span { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 11px; background: #edf6f2; color: var(--brand); font-size: 12px; font-weight: 950; }
.person-cell strong { display: block; font-size: 15px; }
.person-cell small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 999px; font-size: 12px; font-weight: 900; white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status--new { color: var(--blue); background: #e9f0ff; }
.status--callback { color: #ae6a00; background: #fff1d9; }
.status--quote { color: var(--purple); background: #efe9ff; }
.status--accepted { color: var(--green); background: #e8f6ed; }
.status--refused { color: #6a7470; background: #eff2f0; }
.site-badge { display: inline-flex; padding: 5px 7px; border-radius: 999px; font-size: 12px; font-weight: 850; white-space: nowrap; }
.site-badge--renovation { color: #9b4b2a; background: #fff0e8; }
.site-badge--plomberie { color: #08758e; background: #e8f6f9; }
.site-badge--electricite { color: #806500; background: #fff6cb; }
.site-badge--menuiserie { color: #527054; background: #edf4e9; }
.source-pill { display: inline-flex; padding: 5px 7px; border-radius: 999px; background: #f0f3f1; color: #61706a; font-size: 12px; font-weight: 800; }
.next-action strong { display: block; font-size: 14px; }
.next-action small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.next-action.is-late strong, .next-action.is-late small { color: var(--red); }
.empty-state { margin: 0; padding: 28px; color: var(--muted); text-align: center; font-size: 14px; }
.empty-state.compact { padding: 12px; }

/* Kanban */
.kanban { display: grid; grid-template-columns: repeat(5,minmax(230px,1fr)); gap: 12px; overflow: auto; padding-bottom: 8px; }
.kanban-column { min-height: 430px; padding: 10px; border-radius: 16px; background: #eaf0ec; }
.kanban-column > header { display: flex; justify-content: space-between; align-items: center; padding: 4px 3px 10px; font-size: 14px; }
.kanban-column > header span { min-width: 22px; height: 22px; display: grid; place-items: center; border-radius: 999px; background: #fff; color: var(--muted); font-size: 12px; }
.kanban-card { margin-bottom: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: 0 8px 20px rgba(18,31,24,.05); cursor: pointer; }
.kanban-card:hover { border-color: #a8c8bb; }
.kanban-card__top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.kanban-card__top small { color: var(--muted); font-size: 12px; }
.kanban-card h3 { margin: 11px 0 3px; font-size: 15px; }
.kanban-card p { margin: 0; color: var(--muted); font-size: 13px; }
.kanban-budget { display: block; margin: 10px 0 4px; font-size: 14px; }
.kanban-card > small { color: var(--muted); font-size: 13px; }
.kanban-empty { padding: 12px; color: var(--muted); font-size: 13px; text-align: center; }

/* Accepted */
.accepted-summary { display: grid; grid-template-columns: repeat(3,1fr); gap: 13px; margin-bottom: 15px; }
.summary-card { padding: 17px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.summary-card small { color: var(--muted); font-size: 13px; }
.summary-card strong { display: block; margin-top: 5px; font-size: 28px; }

/* Automations, mailbox */
.automation-kpis { grid-template-columns: repeat(4,1fr); }
.log-list { display: grid; }
.log-row { display: grid; grid-template-columns: 36px 1fr; gap: 10px; padding: 12px 0; border-bottom: 1px solid #edf1ef; }
.log-row:last-child { border-bottom: 0; }
.log-row > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: #edf6f2; color: var(--brand); }
.log-row strong { display: block; font-size: 14px; }
.log-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.mail-list { display: grid; grid-template-columns: repeat(2,1fr); gap: 11px; }
.mail-card { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.mail-card button { width: 100%; padding: 14px; border: 0; background: #fff; text-align: left; }
.mail-card button:hover { background: #fbfcfb; }
.mail-card__head { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.mail-card__head small { color: var(--muted); font-size: 12px; }
.mail-category { padding: 5px 7px; border-radius: 999px; background: #edf6f2; color: var(--brand); font-size: 12px; font-weight: 850; }
.mail-card h3 { margin: 11px 0 5px; font-size: 15px; }
.mail-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.mail-card > button > span:last-child { display: block; margin-top: 9px; color: #46544e; font-size: 13px; line-height: 1.5; }

/* Settings */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.settings-form { display: grid; gap: 13px; }
.settings-form label { display: grid; gap: 6px; font-size: 14px; font-weight: 800; }
.settings-form input, .settings-form select { width: 100%; padding: 10px 11px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 14px; }
.feature-list { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14px; line-height: 1.9; }

/* Drawer */
.drawer-overlay { position: fixed; inset: 0; z-index: 80; background: rgba(6,15,11,.4); opacity: 0; pointer-events: none; transition: opacity .22s ease; }
.drawer-overlay.is-open { opacity: 1; pointer-events: auto; }
.lead-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 90; width: min(610px,100%); display: flex; flex-direction: column; background: #fff; box-shadow: -25px 0 70px rgba(0,0,0,.16); transform: translateX(103%); transition: transform .25s ease; }
.lead-drawer.is-open { transform: none; }
.drawer-head { flex: 0 0 auto; display: flex; justify-content: space-between; gap: 15px; padding: 18px 21px; border-bottom: 1px solid var(--line); background: #fff; }
.drawer-head small { color: var(--muted); font-size: 12px; }
.drawer-head h2 { margin: 3px 0 0; font-size: 25px; }
.drawer-reference { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.close-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 11px; background: #fff; font-size: 20px; }
.drawer-body { padding: 20px; overflow: auto; }
.drawer-status-row { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 13px; }
.drawer-contact { display: flex; justify-content: space-between; gap: 15px; align-items: center; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: #f7faf8; }
.drawer-contact small { display: block; color: var(--muted); font-size: 12px; }
.drawer-contact strong { display: block; margin-top: 2px; font-size: 15px; }
.drawer-contact span { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; }
.drawer-contact__actions { display: flex; gap: 7px; flex-wrap: wrap; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 13px; }
.detail-box { padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.detail-box small { display: block; color: var(--muted); font-size: 12px; }
.detail-box strong { display: block; margin-top: 4px; font-size: 14px; }
.drawer-section { margin-top: 22px; }
.drawer-section h3 { margin: 0 0 10px; font-size: 17px; }
.section-row { display: flex; justify-content: space-between; gap: 15px; align-items: center; }
.section-row span { color: var(--muted); font-size: 12px; }
.description-box { margin: 0; padding: 14px; border-radius: 12px; background: #f5f7f5; color: #47544e; font-size: 14px; line-height: 1.7; }
.attachment-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.attachment-card { min-width: 0; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; text-align: left; }
.attachment-card:hover { border-color: #9fc5b7; box-shadow: 0 9px 20px rgba(18,31,24,.08); }
.attachment-preview { height: 100px; display: grid; place-items: center; overflow: hidden; background: #eef2ef; }
.attachment-preview img { width: 100%; height: 100%; object-fit: cover; }
.attachment-icon { font-size: 20px; font-weight: 950; color: var(--red); }
.attachment-title { display: block; padding: 8px 8px 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 800; }
.attachment-card small { display: block; padding: 0 8px 8px; color: var(--muted); font-size: 12px; }
.drawer-form-card { padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfb; }
.drawer-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.drawer-form-grid label { display: grid; gap: 5px; font-size: 13px; font-weight: 800; }
.drawer-form-grid label.full { grid-column: 1 / -1; }
.drawer-form-grid input, .drawer-form-grid select, .drawer-form-grid textarea { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-size: 14px; }
.drawer-form-card > .button { width: 100%; margin-top: 11px; }
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.timeline { display: grid; gap: 0; }
.timeline-item { display: grid; grid-template-columns: 34px 1fr; gap: 9px; padding: 10px 0; border-bottom: 1px solid #edf1ef; }
.timeline-item > span { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 10px; background: #edf6f2; color: var(--brand); }
.timeline-item strong { display: block; font-size: 14px; }
.timeline-item small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }

/* Modals/toasts */
.modal { position: fixed; inset: 0; z-index: 130; display: none; place-items: center; padding: 20px; background: rgba(6,15,11,.58); }
.modal.is-open { display: grid; }
.modal-card { width: min(550px,100%); max-height: 90vh; overflow: auto; padding: 23px; border-radius: 19px; background: #fff; box-shadow: var(--shadow); }
.modal-card h2 { margin: 0 0 7px; font-size: 23px; }
.modal-card > p { margin: 0; color: var(--muted); font-size: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.mail-modal-meta { margin-bottom: 15px; color: var(--muted); font-size: 12px; }
.mail-modal-body { white-space: pre-wrap; color: #46534d; font-size: 14px; line-height: 1.75; }
.toast-wrap { position: fixed; top: 84px; right: 20px; z-index: 200; display: grid; gap: 9px; }
.toast { min-width: 290px; max-width: 380px; padding: 13px 14px; border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 12px; background: #fff; box-shadow: var(--shadow); opacity: 0; transform: translateX(20px); transition: .22s ease; }
.toast.is-visible { opacity: 1; transform: none; }
.toast strong { display: block; font-size: 14px; }
.toast span { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; }

@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(3,1fr); }
  .dashboard-grid, .dashboard-grid.equal { grid-template-columns: 1fr; }
  .mail-list { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 78px minmax(0,1fr); }
  .sidebar { width: 78px; padding: 17px 9px; }
  .sidebar-brand span:last-child, .side-link > span:nth-child(2), .demo-badge, .sidebar-bottom .side-link > span:nth-child(2) { display: none; }
  .sidebar-brand { padding-inline: 10px; }
  .side-link { justify-content: center; font-size: 16px; }
  .bubble { position: absolute; transform: translate(14px,-12px); font-size: 12px; }
  .admin-main { grid-column: 2; }
  .toolbar { align-items: flex-start; flex-direction: column; }
  .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 670px) {
  .admin-shell { display: block; }
  .sidebar { top: auto; right: 0; width: 100%; height: 66px; flex-direction: row; align-items: center; padding: 7px; }
  .sidebar-brand, .sidebar-bottom { display: none; }
  .side-nav { width: 100%; grid-template-columns: repeat(6,1fr); gap: 2px; }
  .side-link { padding: 9px 3px; font-size: 16px; }
  .side-link > span:first-child { width: auto; }
  .side-link > span:nth-child(2) { display: none; }
  .bubble { transform: translate(10px,-11px); font-size: 12px; }
  .admin-main { margin: 0; }
  .topbar { height: 62px; padding: 0 13px; }
  .global-search { display: none; }
  .topbar-mobile-title { display: block; }
  .admin-user div { display: none; }
  .admin-content { padding: 16px 12px 82px; }
  .page-heading { flex-direction: column; }
  .page-heading h1 { font-size: 32px; }
  .kpi-grid, .automation-kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi-card { padding: 13px; }
  .kpi-value { font-size: 31px; }
  .alert-banner { align-items: flex-start; flex-direction: column; }
  .filters { width: 100%; }
  .filters label, .filters select, .filters input { width: 100%; min-width: 0; }
  .view-toggle { width: 100%; }
  .view-toggle button { flex: 1; font-size: 14px; }
  .accepted-summary { grid-template-columns: 1fr; }
  .lead-drawer { width: 100%; }
  .drawer-contact { align-items: flex-start; flex-direction: column; }
  .detail-grid, .drawer-form-grid, .action-grid, .attachment-grid { grid-template-columns: 1fr; }
  .drawer-form-grid label.full { grid-column: auto; }
  .toast-wrap { left: 12px; right: 12px; top: 72px; }
  .toast { min-width: 0; max-width: none; }
}


/* =========================================================
   BATIPLOTI — lisibilité, navigation et actions enrichies
   ========================================================= */
body { font-size: 16px; }
.button { font-size: 14px; }
.button--small { font-size: 13px; }
.sidebar-brand-row { display: grid; grid-template-columns: 30px 1fr; align-items: center; gap: 3px; margin-bottom: 3px; }
.sidebar-brand { padding: 4px 5px 18px; min-width: 0; }
.sidebar-toggle { width: 29px; height: 38px; border: 1px solid rgba(255,255,255,.14); border-radius: 9px; background: rgba(255,255,255,.08); color: #fff; font-size: 23px; line-height: 1; }
.sidebar-toggle:hover { background: rgba(255,255,255,.15); }
.side-link { font-size: 16px; }
.sidebar-brand small { font-size: 13px; }
.demo-badge { font-size: 13px; }
.page-heading p { font-size: 15px; }
.panel-head h2 { font-size: 18px; }
.panel-head small { font-size: 13px; }
.kpi-card__head { font-size: 14px; }
.kpi-sub { font-size: 13px; }
.quick-filter { font-size: 13px; }
.filter-summary { font-size: 14px; }
.filters label { font-size: 12px; }
.filters select, .filters input { font-size: 14px; }

/* Plus gros caractères sans agrandir la hauteur des tableaux */
.data-table th { padding: 9px 11px; font-size: 12px; }
.data-table td { padding: 9px 11px; font-size: 14px; line-height: 1.3; }
.data-table td > small { margin-top: 2px; font-size: 12px; }
.person-cell strong { font-size: 15px; }
.person-cell small { font-size: 12px; }
.status, .site-badge, .source-pill { font-size: 12px; }
.next-action strong { font-size: 14px; }
.next-action small { font-size: 12px; }
.clickable-row { cursor: pointer; }
.clickable-row:hover td { background: #f3faf7 !important; }
.clickable-row:focus-visible { outline: 3px solid rgba(22,116,91,.20); outline-offset: -3px; }
.clickable-row td:last-child { width: 42px; }

.panel-head-actions { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.compact-select { display: grid; gap: 4px; color: var(--muted); font-size: 12px; font-weight: 800; }
.compact-select select { padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); font-size: 14px; }
.special-filter-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 13px; padding: 13px 15px; border: 1px solid #9ed0c0; border-radius: 13px; background: #eaf7f2; color: #245f4d; }
.special-filter-banner span { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 900; }
.special-filter-banner strong { display: block; margin-top: 3px; font-size: 15px; }

/* Menu latéral réductible */
body.sidebar-collapsed .admin-shell { grid-template-columns: 78px minmax(0,1fr); }
body.sidebar-collapsed .sidebar { width: 78px; padding-inline: 9px; }
body.sidebar-collapsed .sidebar-brand-row { grid-template-columns: 1fr; justify-items: center; }
body.sidebar-collapsed .sidebar-toggle { transform: rotate(180deg); }
body.sidebar-collapsed .sidebar-brand { padding: 5px 0 16px; }
body.sidebar-collapsed .sidebar-brand span:last-child,
body.sidebar-collapsed .side-link > span:nth-child(2),
body.sidebar-collapsed .demo-badge,
body.sidebar-collapsed .sidebar-bottom .side-link > span:nth-child(2) { display: none; }
body.sidebar-collapsed .side-link { justify-content: center; padding-inline: 8px; }
body.sidebar-collapsed .bubble { position: absolute; transform: translate(14px,-12px); }
body.sidebar-collapsed .admin-main { grid-column: 2; }

/* Fiche prospect : texte vraiment lisible */
.lead-drawer { width: min(690px,100%); }
.drawer-head small, .drawer-reference { font-size: 12px; }
.drawer-head h2 { font-size: 25px; }
.drawer-contact small { font-size: 12px; }
.drawer-contact strong { font-size: 15px; }
.drawer-contact span { font-size: 13px; }
.detail-box small { font-size: 12px; }
.detail-box strong { font-size: 14px; }
.drawer-section h3 { font-size: 17px; }
.section-row span { font-size: 12px; }
.description-box { font-size: 14px; }
.drawer-form-grid label, .identity-edit-grid label, .action-composer label { font-size: 13px; }
.drawer-form-grid input, .drawer-form-grid select, .drawer-form-grid textarea,
.identity-edit-grid input, .identity-edit-grid select, .identity-edit-grid textarea,
.action-composer input, .action-composer select, .action-composer textarea { font-size: 14px; padding: 10px 11px; }
.timeline-item strong { font-size: 14px; }
.timeline-item small { font-size: 12px; }
.attachment-title { font-size: 12px; }
.attachment-card small { font-size: 12px; }

.identity-editor { margin-top: 13px; padding: 16px; border: 1px solid #bdd8ce; border-radius: 14px; background: #f4faf7; }
.identity-editor__head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 12px; }
.identity-editor__head h3 { margin: 0; }
.identity-edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.identity-edit-grid label { display: grid; gap: 5px; font-weight: 800; font-size: 13px; }
.identity-edit-grid label.full { grid-column: 1/-1; }
.identity-edit-grid input, .identity-edit-grid select, .identity-edit-grid textarea { width: 100%; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-size: 14px; }
.identity-editor .button { width: 100%; margin-top: 12px; }

.action-grid .button { min-height: 52px; font-size: 14px; }
.action-grid .button--quote { border-color: #d8dde4; background: #fff; }
.action-grid .button--followup { border-color: #d8dde4; background: #fff; }
.action-grid .button--success { background: #eaf7ef; }
.action-grid .button--danger { background: #fff0ef; }
.reminder-action { width: 100%; margin-top: 8px; }
.action-composer { margin-top: 13px; padding: 17px; border: 1px solid #b8d8cc; border-radius: 14px; background: #f7fbf9; }
.action-composer__head { display: flex; justify-content: space-between; align-items: start; gap: 14px; margin-bottom: 13px; }
.action-composer__head h4 { margin: 0 0 4px; font-size: 17px; }
.action-composer__head p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.action-composer__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.action-composer label { display: grid; gap: 5px; font-weight: 800; font-size: 13px; }
.action-composer label.full { grid-column: 1/-1; }
.action-composer input, .action-composer select, .action-composer textarea { width: 100%; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-size: 14px; }
.action-composer__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 13px; }
.auto-save-note { margin-top: 7px; color: var(--green); font-size: 12px; }

@media (max-width: 900px) {
  .sidebar-toggle { display: none; }
  .panel-head-actions { width: 100%; }
}
@media (max-width: 670px) {
  .special-filter-banner { align-items: flex-start; flex-direction: column; }
  .identity-edit-grid, .action-composer__grid { grid-template-columns: 1fr; }
  .identity-edit-grid label.full, .action-composer label.full { grid-column: auto; }
}

/* Nouvelles fonctions Batiploti */
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.drawer-head-actions { display: flex; align-items: center; gap: 9px; }

/* Infobulles du menu réduit */
body.sidebar-collapsed .side-link[data-tooltip] { position: relative; }
body.sidebar-collapsed .side-link[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 13px);
  top: 50%;
  z-index: 150;
  transform: translateY(-50%) translateX(-4px);
  min-width: max-content;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 9px;
  background: #15201b;
  color: #fff;
  box-shadow: 0 12px 30px rgba(0,0,0,.24);
  font-size: 13px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transition: .16s ease;
}
body.sidebar-collapsed .side-link[data-tooltip]:hover::after,
body.sidebar-collapsed .side-link[data-tooltip]:focus-visible::after { opacity: 1; transform: translateY(-50%) translateX(0); }

/* Résultats filtrés directement dans le tableau de bord */
.dashboard-filter-panel { margin-bottom: 17px; border-color: #9ecdbd; box-shadow: 0 13px 34px rgba(22,116,91,.09); }
.dashboard-filter-panel .panel-head { background: #f1faf6; }

/* À faire aujourd'hui */
.task-summary { grid-template-columns: repeat(3,1fr); }
.task-layout { grid-template-columns: minmax(0,1.15fr) minmax(330px,.85fr); }
.task-focus-card { padding: 5px; }
.task-focus-card.overdue { border-left: 4px solid var(--red); padding-left: 16px; }
.task-focus-card.today { border-left: 4px solid var(--yellow); padding-left: 16px; }
.task-focus-card.upcoming { border-left: 4px solid var(--brand); padding-left: 16px; }
.task-focus-top { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.task-focus-card h3 { margin: 22px 0 7px; font-size: 22px; }
.task-focus-card > p { margin: 0; color: var(--muted); font-size: 15px; }
.task-focus-date { margin: 16px 0; font-size: 15px; font-weight: 850; }
.task-focus-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.task-list { max-height: 570px; overflow: auto; }
.task-item { width: 100%; display: grid; grid-template-columns: 10px 1fr auto; gap: 12px; align-items: center; padding: 14px 17px; border: 0; border-bottom: 1px solid #edf1ef; background: #fff; text-align: left; }
.task-item:hover, .task-item.is-active { background: #f3faf7; }
.task-item strong { display: block; font-size: 15px; }
.task-item small { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }
.task-marker { width: 9px; height: 34px; border-radius: 999px; background: var(--brand); }
.task-marker--overdue { background: var(--red); }
.task-marker--today { background: var(--yellow); }
.task-marker--upcoming { background: var(--brand); }

/* Automatisations détaillées */
.automation-card { cursor: pointer; }
.automation-card:hover { transform: translateY(-3px); border-color: #a9cbbf; }
.automation-panel-head { align-items: flex-end; flex-wrap: wrap; }
.automation-filters { justify-content: flex-end; }
.automation-filters .search-field input { min-width: 240px; }
.automation-row { width: 100%; grid-template-columns: 38px minmax(0,1fr) 24px; align-items: center; border: 0; border-bottom: 1px solid #edf1ef; background: transparent; text-align: left; cursor: pointer; }
.automation-row:hover { background: #f7fbf9; }
.automation-row-content { min-width: 0; }
.automation-row-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.automation-row strong { font-size: 15px; }
.automation-row p { margin: 5px 0; color: #44524c; font-size: 14px; line-height: 1.45; }
.automation-row small { font-size: 12px; }
.automation-status { flex: 0 0 auto; padding: 5px 8px; border-radius: 999px; font-size: 12px; font-weight: 900; }
.automation-status--scheduled { color: #8d6500; background: #fff1cf; }
.automation-status--completed { color: var(--green); background: #e7f5ec; }
.automation-status--canceled { color: #67716d; background: #edf1ef; }
.automation-status--failed { color: var(--red); background: #fff0ef; }
.automation-open { color: var(--muted); font-size: 18px; }

/* Boîte e-mail avec suppression individuelle */
.mail-card { position: relative; }
.mail-card-main { display: block; }
.mail-delete-button { width: 100%; padding: 9px 14px; border: 0; border-top: 1px solid var(--line); background: #fff; color: var(--red); font-size: 13px; font-weight: 850; text-align: right; }
.mail-delete-button:hover { background: #fff4f3; }

/* Relance active dans la fiche */
.scheduled-followup-box { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-top: 12px; padding: 14px; border: 1px solid #e0c67c; border-radius: 12px; background: #fff9e8; }
.scheduled-followup-box strong { display: block; font-size: 15px; }
.scheduled-followup-box span { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; }
.scheduled-followup-box > div:last-child { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }

/* Modale nouveau prospect et visite guidée */
.modal-card--large { width: min(840px,100%); }
.modal-title-row { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.new-prospect-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.new-prospect-grid label { display: grid; gap: 6px; font-size: 14px; font-weight: 800; }
.new-prospect-grid label.full { grid-column: 1/-1; }
.new-prospect-grid input, .new-prospect-grid select, .new-prospect-grid textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 15px; }
.new-prospect-grid small { color: var(--muted); font-size: 12px; font-weight: 500; }
.checkbox-label { grid-template-columns: auto 1fr !important; align-items: center; justify-content: start; }
.checkbox-label input { width: auto !important; }
.duplicate-warning { margin-top: 15px; padding: 14px; border: 1px solid #e2bf68; border-radius: 12px; background: #fff8df; }
.duplicate-warning strong { font-size: 15px; }
.duplicate-warning p { margin: 5px 0 10px; font-size: 14px; }
.duplicate-warning label { font-size: 14px; font-weight: 800; }
.tour-steps { display: grid; gap: 12px; margin-top: 19px; }
.tour-steps article { display: grid; grid-template-columns: 38px 1fr; gap: 12px; align-items: start; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: #f8faf9; }
.tour-steps article > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--brand); color: #fff; font-weight: 900; }
.tour-steps strong { font-size: 15px; }
.tour-steps p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

@media (max-width: 900px) {
  .task-layout { grid-template-columns: 1fr; }
  .automation-filters { width: 100%; justify-content: flex-start; }
  .topbar-actions > .button { display: none; }
}
@media (max-width: 670px) {
  .task-summary { grid-template-columns: 1fr; }
  .new-prospect-grid { grid-template-columns: 1fr; }
  .new-prospect-grid label.full { grid-column: auto; }
  .scheduled-followup-box { align-items: flex-start; flex-direction: column; }
  .scheduled-followup-box > div:last-child { justify-content: flex-start; }
  .drawer-head-actions .button { display: none; }
}


/* Refonte finale — alertes utiles, e-mails lus/non lus et mobile */
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.bubble[hidden]{display:none!important}.mobile-more-trigger,.mobile-more-menu{display:none}.mailbox-toolbar{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 14px}.mail-card.is-unread{border-color:#8bc2ae;box-shadow:0 10px 28px rgba(22,116,91,.1)}.mail-card.is-unread h3{font-weight:950}.mail-card.is-read{opacity:.78}.mail-read-dot{display:inline-block;width:9px;height:9px;border-radius:50%;background:var(--brand);margin-right:6px}.demo-only-button::after{content:'DÉMO';font-size:9px;padding:3px 5px;border-radius:999px;background:rgba(255,255,255,.2)}.automation-row.is-failed{border-left:4px solid var(--red);background:#fff8f7}.automation-row-actions{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}.example-disclaimer{font-size:12px;color:var(--muted);font-style:italic}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition:none!important;animation:none!important}}
@media(max-width:670px){
 .side-nav{grid-template-columns:repeat(5,1fr)!important}.side-nav [data-section="accepted"],.side-nav [data-section="mailbox"],.side-nav [data-section="settings"]{display:none}.mobile-more-trigger{display:flex!important}.mobile-more-menu{position:fixed;right:10px;bottom:76px;z-index:120;width:min(280px,calc(100vw - 20px));padding:8px;border:1px solid var(--line);border-radius:14px;background:#fff;box-shadow:var(--shadow)}.mobile-more-menu:not([hidden]){display:grid}.mobile-more-menu button,.mobile-more-menu a{padding:13px;border:0;border-radius:9px;background:#fff;color:var(--ink);font:inherit;font-weight:800;text-align:left}.mobile-more-menu button:hover,.mobile-more-menu a:hover{background:#edf6f2}.automation-kpis{grid-template-columns:1fr!important}.page-heading h1{font-size:28px!important}
}
