:root {
  --bg: #f1eee6;
  --surface: #ffffff;
  --surface-2: #e8e2d3;
  --ink: #23262b;
  --ink-soft: #5c5f66;
  --ink-faint: #8b8d92;
  --accent: #2e4057;
  --accent-strong: #1c2c40;
  --accent-soft: #dbe2ea;
  --line: #d9d1bd;
  --good: #2f7a4f;
  --good-bg: #e4f0e8;
  --warn: #a2661f;
  --warn-bg: #f4e8d7;
  --bad: #b23a3a;
  --bad-bg: #f6e2e2;
  --dpe-a: #2e8b3d; --dpe-b: #5aa93a; --dpe-c: #7cb342; --dpe-d: #dcb51c;
  --dpe-e: #e08a2c; --dpe-f: #d9622c; --dpe-g: #c1272d;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
}

.navbar-brand { font-weight: 700; letter-spacing: -0.01em; }
.navbar { background: var(--accent-strong) !important; }
.navbar .nav-link { color: rgba(255,255,255,.82) !important; }
.navbar .nav-link.active { color: #fff !important; font-weight: 600; }

.card, .table-card { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }

.pill { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-family: ui-monospace, monospace; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.pill.good { background: var(--good-bg); color: var(--good); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.status { background: var(--accent-soft); color: var(--accent-strong); }
.pill.muted { background: var(--surface-2); color: var(--ink-soft); }

.dpe-badge { display: inline-flex; width: 24px; height: 22px; align-items: center; justify-content: center; font-weight: 700; font-size: .78rem; color: #fff; border-radius: 5px; }
.dpe-badge.A { background: var(--dpe-a); } .dpe-badge.B { background: var(--dpe-b); }
.dpe-badge.C { background: var(--dpe-c); } .dpe-badge.D { background: var(--dpe-d); color:#2a1b04; }
.dpe-badge.E { background: var(--dpe-e); } .dpe-badge.F { background: var(--dpe-f); }
.dpe-badge.G { background: var(--dpe-g); }

.sim-bar { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; margin-bottom: 18px; }
.sim-bar label { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-faint); }

table.dashboard-table { background: var(--surface); font-size: .88rem; }
table.dashboard-table th { font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); background: var(--surface-2); white-space: nowrap; }
table.dashboard-table td { vertical-align: middle; white-space: nowrap; }
table.dashboard-table .property-name { font-weight: 600; white-space: normal; }
table.dashboard-table .property-sub { color: var(--ink-faint); font-size: .76rem; }
table.dashboard-table .status-select-auto { min-width: 160px; }

.property-card { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 14px 16px; margin-bottom: 14px; position: relative; }
.property-card .price { font-family: ui-monospace, monospace; font-size: 1.2rem; font-weight: 700; }
.property-card .stat-box { background: var(--surface-2); border-radius: 8px; padding: 7px 10px; }
.property-card .stat-box .l { font-size: .62rem; text-transform: uppercase; color: var(--ink-faint); letter-spacing: .04em; }
.property-card .stat-box .v { font-family: ui-monospace, monospace; font-weight: 600; }
.property-card .dur-line { display: flex; justify-content: space-between; font-size: .8rem; padding: 4px 0; border-top: 1px solid var(--line); }

.fab-note { position: fixed; bottom: 18px; right: 18px; z-index: 1030; border-radius: 999px; padding: 12px 18px; box-shadow: 0 8px 20px -6px rgba(0,0,0,.5); }

.timeline-item { border-left: 2px solid var(--line); padding-left: 16px; margin-bottom: 18px; position: relative; }
.timeline-item::before { content: ""; position: absolute; left: -5px; top: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.timeline-date { font-family: ui-monospace, monospace; font-size: .76rem; color: var(--ink-faint); }

.score-badge { font-family: ui-monospace, monospace; font-weight: 700; font-size: 1rem; }

.section-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); margin-bottom: 6px; }

@media (max-width: 767px) {
  .desktop-only { display: none !important; }
}
@media (min-width: 768px) {
  .mobile-only { display: none !important; }
}

.info-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; min-width: 22px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-strong);
  font-size: .72rem; font-weight: 700; border: none; padding: 0; margin-left: 4px;
  cursor: pointer; vertical-align: middle; line-height: 1;
  touch-action: manipulation;
}
.info-icon:hover, .info-icon:focus { background: var(--accent); color: #fff; }

.info-body table { width: 100%; font-size: .88rem; border-collapse: collapse; }
.info-body table td { padding: 3px 0; }
.info-body table td.num { text-align: right; font-family: ui-monospace, monospace; white-space: nowrap; }
.info-body table tr.total td { border-top: 1px solid var(--line); font-weight: 700; padding-top: 6px; }
.info-body .warn-box { background: var(--warn-bg); color: var(--warn); border-radius: 8px; padding: 8px 12px; font-size: .85rem; margin-top: 10px; }
.info-body .note { color: var(--ink-soft); font-size: .85rem; margin-top: 10px; }
.info-body ul.levers { padding-left: 1.1em; font-size: .88rem; margin: 6px 0; }
.info-body h6.subtitle { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); margin: 14px 0 4px; }

.status-select-pill {
  background: var(--accent-soft); color: var(--accent-strong);
  border: none; border-radius: 999px; font-size: .68rem; font-family: ui-monospace, monospace;
  padding: 4px 22px 4px 10px; max-width: 100%; text-overflow: ellipsis;
}

/* Champs comptant pour le % de fiche complétée (voir services/completion.py) */
.field-important { background: var(--accent-soft); border-radius: 8px; padding: 8px 8px 10px; margin-top: -4px; }
.field-important .form-label::after { content: " ★"; color: var(--accent-strong); }
