:root {
  --bg: #0a0f1f;
  --body-bg: #eef2f7;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef2f7;
  --field-bg: #ffffff;
  --field-border: #cfd6e3;
  --line: #e3e7ef;
  --text: #1c2433;
  --muted: #697386;
  --brand: #d71920;
  --brand-dark: #a71117;
  --success: #18794e;
  --warning: #a15c00;
  --danger: #b42318;
  --info: #155eef;
  --sidebar-bg: #0a0f1f;
  --sidebar-text: #ffffff;
  --topbar-bg: rgba(255,255,255,.86);
  --public-bg: radial-gradient(circle at 12% 8%, rgba(215,25,32,.12), transparent 28%), radial-gradient(circle at 84% 16%, rgba(21,94,239,.12), transparent 28%), linear-gradient(135deg, #f8fafc, #eef2f7 54%, #fff1f2);
  --public-text: #1c2433;
  --public-muted: #586174;
  --glass: rgba(255,255,255,.78);
  --glass-border: rgba(10,15,31,.10);
  --ghost-border: rgba(10,15,31,.18);
  --radius: 16px;
  --shadow: 0 18px 45px rgba(10, 15, 31, .12);
}
:root[data-theme="dark"] {
  --body-bg: #0a0f1f;
  --surface: #121a2f;
  --surface-2: #17213a;
  --surface-3: #0f172a;
  --field-bg: #0f172a;
  --field-border: #334155;
  --line: #27334c;
  --text: #f5f7fb;
  --muted: #aab6c9;
  --sidebar-bg: #070b16;
  --sidebar-text: #ffffff;
  --topbar-bg: rgba(18,26,47,.88);
  --public-bg: radial-gradient(circle at 12% 8%, rgba(215,25,32,.36), transparent 28%), radial-gradient(circle at 84% 16%, rgba(255,255,255,.11), transparent 28%), linear-gradient(135deg, #070b16, #10182b 54%, #260609);
  --public-text: #ffffff;
  --public-muted: rgba(255,255,255,.76);
  --glass: rgba(255,255,255,.08);
  --glass-border: rgba(255,255,255,.14);
  --ghost-border: rgba(255,255,255,.22);
  --shadow: 0 22px 70px rgba(0,0,0,.28);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--body-bg);
  color: var(--text);
  line-height: 1.45;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; }
.public-body {
  min-height: 100vh;
  background: var(--public-bg);
  color: var(--public-text);
}
.public-shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 30px 0 60px; }
.public-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 72px; gap: 16px; }
.public-links { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 28px; align-items: center; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 5rem); line-height: .95; margin: 0 0 20px; letter-spacing: -0.07em; }
.hero p { color: var(--public-muted); font-size: 1.08rem; max-width: 680px; }
.hero-card, .compact-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  border-radius: 28px;
  padding: 28px;
  backdrop-filter: blur(14px);
}
.compact-card { max-width: 640px; margin-top: 8vh; }
.brand { display: flex; gap: 12px; align-items: center; font-weight: 900; letter-spacing: -.03em; }
.brand-mark, .brand-logo {
  width: 48px; height: 48px; border-radius: 14px;
  display: inline-grid; place-items: center; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--brand), #ff7a59);
  color: #fff; font-weight: 900; box-shadow: 0 12px 30px rgba(215,25,32,.35);
  overflow: hidden;
}
.brand-logo { background: var(--surface); border: 1px solid var(--line); padding: 3px; }
.brand-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.app-shell { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--sidebar-bg); color: var(--sidebar-text); padding: 22px 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .brand { margin: 0 8px 24px; }
.sidebar small { color: rgba(255,255,255,.56); }
.nav-section { margin: 18px 8px 8px; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.45); }
.nav-link {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; margin: 3px 0; border-radius: 12px;
  color: rgba(255,255,255,.78);
}
.nav-link:hover, .nav-link.active { background: rgba(255,255,255,.1); color: #fff; }
.main { min-width: 0; }
.topbar {
  height: 70px; background: var(--topbar-bg); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px; position: sticky; top: 0; z-index: 20;
}
.topbar h1 { margin: 0; font-size: 1.1rem; }
.content { padding: 26px; }
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card h2, .card h3 { margin-top: 0; }
.stat { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.stat strong { display: block; font-size: 2rem; line-height: 1; margin-top: 8px; letter-spacing: -.04em; }
.stat span { color: var(--muted); font-size: .9rem; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--surface-3); color: var(--text); }
.badge.success { background: #e8f5ee; color: var(--success); }
.badge.warning { background: #fff4e5; color: var(--warning); }
.badge.danger { background: #fee4e2; color: var(--danger); }
.badge.info { background: #eaf0ff; color: var(--info); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 12px; padding: 9px 13px; cursor: pointer; font-weight: 750;
  min-height: 40px;
}
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.ghost { background: transparent; color: inherit; border-color: var(--ghost-border); }
.btn.danger { background: #fee4e2; border-color: #fecdca; color: var(--danger); }
.btn.small { padding: 6px 9px; min-height: 32px; font-size: .85rem; border-radius: 9px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; min-width: 820px; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
label { display: block; font-weight: 760; margin-bottom: 6px; }
input, select, textarea {
  width: 100%; border: 1px solid var(--field-border); border-radius: 12px; padding: 10px 12px; background: var(--field-bg); color: var(--text);
}
textarea { min-height: 110px; resize: vertical; }
.help { color: var(--muted); font-size: .9rem; }
.public-body .help { color: var(--public-muted); }
.flash { margin-bottom: 16px; padding: 12px 14px; border-radius: 12px; border: 1px solid; }
.flash.success { background: #e8f5ee; border-color: #bee7d0; color: var(--success); }
.flash.error { background: #fee4e2; border-color: #fecdca; color: var(--danger); }
.flash.info { background: #eaf0ff; border-color: #c7d7fe; color: var(--info); }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.meta { color: var(--muted); font-size: .9rem; }
.kpi-list { display: grid; gap: 10px; }
.kpi-list div { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dashed var(--line); padding-bottom: 9px; }
.public-body .kpi-list div { border-bottom-color: var(--ghost-border); }
.mobile-menu { display: none; }
.footer-note { color: var(--muted); font-size: .85rem; margin-top: 18px; }
.logo-settings { display: grid; grid-template-columns: 88px 1fr; gap: 16px; align-items: start; }
.logo-preview { width: 88px; height: 88px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.logo-preview img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.inline-check { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; }
.inline-check input { width: auto; }
code, pre { background: var(--surface-3); color: var(--text); border-radius: 8px; padding: 2px 6px; }
@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -310px; top: 0; width: 280px; z-index: 100; transition: left .2s ease; }
  body.sidebar-open .sidebar { left: 0; }
  .mobile-menu { display: inline-flex; }
  .hero { grid-template-columns: 1fr; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4, .form-grid { grid-template-columns: 1fr; }
  .content { padding: 18px; }
  .topbar { min-height: 70px; height: auto; padding: 12px 18px; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
  .logo-settings { grid-template-columns: 1fr; }
}

/* Patch UI/UX accueil — inscription lisible, installation PWA non intrusive, icônes */
[hidden] { display: none !important; }
.public-shell { width: min(1240px, calc(100% - 36px)); padding-top: 26px; }
.public-nav { margin-bottom: 56px; }
.public-links .nav-cta { box-shadow: 0 12px 28px rgba(215,25,32,.16); }
.btn-icon-text { white-space: nowrap; }
.btn-lg { min-height: 46px; padding: 12px 16px; border-radius: 14px; }
.btn-soft-install { opacity: .78; padding-inline: 11px; }
.btn-soft-install:hover { opacity: 1; }
.hero-premium { grid-template-columns: minmax(0, 1.05fr) minmax(360px, .75fr); align-items: stretch; gap: 34px; }
.hero-copy { display: flex; flex-direction: column; justify-content: center; min-height: 520px; }
.eyebrow {
  width: fit-content; display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 11px; margin-bottom: 18px; border-radius: 999px;
  border: 1px solid var(--ghost-border); background: rgba(255,255,255,.44);
  color: var(--public-muted); font-weight: 800; font-size: .86rem;
}
:root[data-theme="dark"] .eyebrow { background: rgba(255,255,255,.06); }
.hero h1 { max-width: 820px; }
.hero-lead { font-size: clamp(1.06rem, 1.6vw, 1.22rem) !important; line-height: 1.65; }
.hero-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.install-note { color: var(--public-muted); font-size: .86rem; margin: 10px 0 0; max-width: 540px; }
.hero-points { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.hero-points span {
  display: inline-flex; gap: 6px; align-items: center; padding: 9px 11px; border-radius: 999px;
  border: 1px solid var(--ghost-border); background: rgba(255,255,255,.36); color: var(--public-muted); font-size: .9rem;
}
.hero-points strong { color: var(--public-text); }
:root[data-theme="dark"] .hero-points span { background: rgba(255,255,255,.06); }
.hero-panel {
  background: linear-gradient(180deg, rgba(255,255,255,.86), rgba(255,255,255,.66));
  border: 1px solid var(--glass-border); box-shadow: var(--shadow); border-radius: 32px;
  padding: 28px; backdrop-filter: blur(14px); align-self: center;
}
:root[data-theme="dark"] .hero-panel { background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.05)); }
.panel-header { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 20px; }
.panel-header h2 { margin: 0; font-size: 1.35rem; }
.panel-header p { margin: 4px 0 0; font-size: .93rem; }
.panel-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--brand); color: #fff; box-shadow: 0 14px 28px rgba(215,25,32,.22); }
.event-list { display: grid; gap: 10px; }
.event-item { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; padding: 13px 0; border-top: 1px dashed var(--ghost-border); }
.event-item strong { display: block; }
.event-item small { display: block; color: var(--public-muted); margin-top: 3px; }
.event-item time { font-weight: 850; white-space: nowrap; color: var(--brand); }
.empty-state { padding: 24px; border: 1px dashed var(--ghost-border); border-radius: 22px; background: rgba(255,255,255,.34); color: var(--public-muted); }
:root[data-theme="dark"] .empty-state { background: rgba(255,255,255,.05); }
.empty-state span { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; background: rgba(215,25,32,.12); margin-bottom: 12px; }
.empty-state strong { display: block; color: var(--public-text); margin-bottom: 4px; }
.empty-state p { margin: 0; font-size: .93rem; }
.public-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 34px; }
.feature-card { background: var(--glass); border: 1px solid var(--glass-border); border-radius: 22px; padding: 20px; box-shadow: 0 12px 30px rgba(10,15,31,.08); }
.feature-card > span { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; background: rgba(215,25,32,.11); margin-bottom: 10px; }
.feature-card h3 { margin: 0 0 7px; }
.feature-card p { margin: 0; color: var(--public-muted); }
@media (max-width: 980px) {
  .public-nav { align-items: flex-start; margin-bottom: 36px; }
  .public-links { justify-content: flex-start; }
  .hero-premium { grid-template-columns: 1fr; }
  .hero-copy { min-height: auto; }
  .public-features { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .public-shell { width: min(100% - 24px, 1240px); padding-top: 18px; }
  .public-nav { flex-direction: column; }
  .public-links { width: 100%; }
  .public-links .btn { flex: 1 1 auto; }
  .hero h1 { font-size: clamp(2.15rem, 13vw, 3.8rem); }
  .hero-actions .btn { width: 100%; }
  .hero-points span { width: 100%; }
  .hero-panel { padding: 22px; border-radius: 24px; }
}
