/* salon-misc — thème « dashboard » (sidebar · contenu · panneau latéral) */
:root {
    --page: #dedee1;
    --surface: #fff;
    --soft: #f4f4f6;
    --line: #ececef;
    --text: #15161a;
    --muted: #8b8d95;
    --primary: #5d8fd8; --primary-soft: #eaf1fc; --primary-btn: #a9c8f0;
    --success: #4fb592; --success-soft: #e6f6f0;
    --danger: #e5484d;  --danger-soft: #fdecec;
    --warning: #f0a557; --warning-soft: #fdf1e3;
    --info: #5d8fd8;    --info-soft: #eaf1fc;
    --radius: 28px;
    --font: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--page); color: var(--text); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.ico { flex-shrink: 0; display: block; }
code { background: var(--soft); padding: 2px 7px; border-radius: 6px; font-family: var(--mono); font-size: 12.5px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

/* ---------- Cadre ---------- */
.app {
    display: grid; grid-template-columns: 260px minmax(0, 1fr) 400px;
    min-height: 100vh; background: var(--surface);
}
.app.no-aside { grid-template-columns: 260px minmax(0, 1fr); }
.main { padding: 50px 48px; min-width: 0; }

/* ---------- Sidebar ---------- */
.sidebar { display: flex; flex-direction: column; padding: 44px 26px 40px 34px; border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-size: 27px; font-weight: 600; letter-spacing: -.02em; color: var(--text); margin: 0 0 70px 8px; }
.brand:hover { text-decoration: none; }
.brand .dot { color: var(--primary); }
.nav { display: flex; flex-direction: column; gap: 10px; }
.nav a, .nav button {
    display: flex; align-items: center; gap: 18px; width: 100%; padding: 13px 10px;
    border: 0; background: none; border-radius: 14px; font: inherit; font-size: 17px;
    color: var(--muted); cursor: pointer; text-align: left;
}
.nav a:hover, .nav button:hover { color: var(--text); background: var(--soft); text-decoration: none; }
.nav a.active { color: var(--text); font-weight: 500; }
.nav a.active .ico { stroke-width: 2.1; }
.nav .plus { margin-left: auto; width: 28px; height: 28px; border-radius: 50%; background: var(--soft); display: grid; place-items: center; font-size: 16px; color: var(--text); }
/* Bloc « Nettoyage auto » puis « Déconnexion » : le groupe SUIT le menu (qui se
   termine par « Double auth. ») — plus rien n'est poussé au bas de la colonne,
   tout l'espace libre reste en dessous. */
.promo {
    margin: 28px 0; padding: 30px 22px; border-radius: 24px; text-align: center;
    background: linear-gradient(180deg, #f4f4f6 0%, #fff 100%);
}
.promo h3 { margin: 0 0 10px; font-size: 18px; font-weight: 600; }
.promo p { margin: 0 0 20px; color: var(--muted); font-size: 14.5px; }
.sidebar .nav.bottom { gap: 4px; }

/* ---------- En-tête de page ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 40px; }
.page-title { font-size: 38px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; margin: 0 0 10px; }
.page-subtitle { color: var(--muted); font-size: 17px; margin: 0; }
.date-chip { display: flex; align-items: center; gap: 16px; font-size: 15.5px; white-space: nowrap; }
.icon-btn { width: 54px; height: 54px; border-radius: 50%; background: var(--soft); border: 0; display: grid; place-items: center; color: var(--text); cursor: pointer; }
.icon-btn:hover { background: #ebebef; text-decoration: none; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.back:hover { color: var(--text); text-decoration: none; }

/* ---------- Statistiques ---------- */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 32px 0; margin-bottom: 56px; }
.stat { display: flex; align-items: center; gap: 18px; padding: 0 22px; border-left: 1px solid var(--line); min-width: 0; }
.stat:first-child { padding-left: 0; border-left: 0; }
.stat-label { white-space: nowrap; }
.stat-icon { width: 62px; height: 62px; border-radius: 50%; background: var(--soft); display: grid; place-items: center; flex-shrink: 0; }
.stat-label { font-size: 17px; font-weight: 500; margin-bottom: 4px; }
.stat-value { display: flex; align-items: baseline; gap: 12px; font-size: 25px; font-weight: 600; line-height: 1.2; }
.delta { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 400; white-space: nowrap; }
.delta::before { content: ""; border: 6px solid transparent; }
.delta.up { color: var(--success); }
.delta.up::before { border-top-color: currentColor; border-bottom-width: 0; }
.delta.down { color: var(--danger); }
.delta.down::before { border-bottom-color: currentColor; border-top-width: 0; }
.delta.flat { color: var(--muted); }
.delta.flat::before { display: none; }

/* ---------- Sections ---------- */
.section { margin-bottom: 56px; }
.section-head { display: flex; align-items: center; gap: 24px; margin-bottom: 28px; }
.section-head h2 { font-size: 27px; font-weight: 600; letter-spacing: -.01em; margin: 0; }
.section-head .sep { padding-left: 24px; border-left: 1px solid var(--line); font-size: 16px; font-weight: 500; }
.section-head .right { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 9px 20px; border-radius: 999px; background: var(--soft); font-size: 15.5px; color: var(--text); }
.pill.outline { background: none; border: 1px solid var(--line); }

/* ---------- Graphique (barres, une série) ---------- */
.chart { display: grid; grid-template-columns: 54px minmax(0, 1fr); grid-template-rows: 230px auto; }
.chart-y { position: relative; color: var(--muted); font-size: 15px; }
.chart-y span { position: absolute; left: 0; transform: translateY(50%); }
.chart-plot { position: relative; display: flex; align-items: flex-end; gap: 2px; border-bottom: 1px solid var(--line); }
.chart-plot .grid { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line); }
.bar-col { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.bar { width: min(34px, 60%); min-height: 2px; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, #7fa8e4 0%, #b9d0f2 100%); transition: background .15s; }
.bar-col:hover .bar { background: var(--primary); }
.bar-col:hover::after { content: ""; position: absolute; inset: 0 auto 0 50%; border-left: 1px dashed #c9cbd2; z-index: -1; }
.tip {
    position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%); z-index: 5;
    min-width: 210px; padding: 14px 16px; border-radius: 12px; background: #0f1220; color: #fff;
    font-size: 14px; pointer-events: none; opacity: 0; transition: opacity .12s;
}
.bar-col .tip { bottom: auto; top: -8px; transform: translate(-50%, -100%); }
.bar-col:hover .tip { opacity: 1; }
.tip strong { display: block; font-weight: 500; margin-bottom: 8px; font-size: 15px; }
.tip-row { display: flex; justify-content: space-between; gap: 16px; padding-left: 12px; border-left: 2px solid #7fa8e4; color: #b7bac6; line-height: 1.9; }
.tip-row b { color: #fff; font-weight: 500; }
.tip-row.alt { border-left-color: var(--warning); }
.chart-x { grid-column: 2; display: flex; gap: 2px; padding-top: 14px; }
.chart-x span { flex: 1; text-align: center; color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; }

/* ---------- Lignes façon « Current Tasks » ---------- */
.rows { display: flex; flex-direction: column; gap: 14px; }
.row { display: grid; grid-template-columns: 62px minmax(0, 2.2fr) minmax(0, 1.4fr) minmax(0, 1.4fr) auto; align-items: center; gap: 20px; }
.row-icon { width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); }
.row-icon.warm { background: var(--warning-soft); }
.row-icon.ko { background: var(--danger-soft); }
.row-icon.plain { background: var(--soft); }
.row-title { font-size: 16.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-title a { color: var(--text); }
.row-sub { color: var(--muted); font-size: 13.5px; }
.row-metric { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; }
.row-metric .ico { color: #c4c6cd; }
.row-metric small { font-weight: 400; color: var(--muted); font-size: 13.5px; }
.row-tags { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.more { display: inline-flex; gap: 3px; padding: 10px 6px; }
.more i { width: 4px; height: 4px; border-radius: 50%; background: var(--text); }

/* ---------- Statuts (pastille + libellé, jamais la couleur seule) ---------- */
.badge { display: inline-flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 500; color: var(--text); white-space: nowrap; }
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dot, var(--muted)); flex-shrink: 0; }
.badge.ok { --dot: var(--success); }
.badge.ko { --dot: var(--danger); }
.badge.warn { --dot: var(--warning); }
.badge.info { --dot: var(--primary); }
.badge.muted { --dot: #c4c6cd; color: var(--muted); }

/* ---------- Boutons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 22px;
    border-radius: 999px; border: 0; background: var(--soft); color: var(--text);
    font: inherit; font-size: 14.5px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: background .12s, filter .12s;
}
.btn:hover { background: #ebebef; text-decoration: none; }
.btn.primary { background: var(--primary-btn); color: #0f1b2d; }
.btn.primary:hover { filter: brightness(.95); }
.btn.danger { background: var(--danger-soft); color: #c4282d; }
.btn.danger:hover { background: #fadada; }
.btn.sm { padding: 8px 16px; font-size: 13.5px; }
.btn.block { width: 100%; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
form { margin: 0; }

/* ---------- Cartes, tableaux, divers ---------- */
.card { background: var(--soft); border-radius: 22px; padding: 24px; margin-bottom: 20px; }
.card h2 { font-size: 17px; font-weight: 600; margin: 0 0 14px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; padding: 14px 10px; vertical-align: middle; }
.row-delete { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.bulk-delete { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 13.5px; }
.trace-filter { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.trace-filter select,
.trace-filter input[type="date"] {
    padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px;
    background: var(--soft); color: var(--text); font: inherit; font-size: 13.5px;
}
th { color: var(--muted); font-weight: 400; font-size: 13.5px; border-bottom: 1px solid var(--line); }
td { border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafafb; }
.empty { color: var(--muted); text-align: center; padding: 30px 0; font-size: 15px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
ul.anomalies { margin: 0; padding: 0; list-style: none; }
ul.anomalies li { font-family: var(--mono); font-size: 12.5px; color: var(--danger); padding: 3px 0; overflow-wrap: anywhere; }
.flash { padding: 14px 18px; border-radius: 16px; margin-bottom: 20px; font-size: 14.5px; font-weight: 500; }
.flash.success { background: var(--success-soft); color: #23805f; }
.flash.error { background: var(--danger-soft); color: #c4282d; }
.flash.warning { background: var(--warning-soft); color: #a8641c; }
.flash.info { background: var(--info-soft); color: #2f62ad; }

/* ---------- Panneau latéral ---------- */
.aside { padding: 22px 22px 32px; border-left: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; }
.profile { background: var(--soft); border-radius: var(--radius); padding: 44px 24px 36px; text-align: center; }
.avatar {
    position: relative; width: 124px; height: 124px; margin: 0 auto 18px; border-radius: 50%;
    display: grid; place-items: center; font-size: 40px; font-weight: 600; color: #6b4a1f;
    background: linear-gradient(145deg, #fde9c7, #f7d39a); border: 4px solid #fff;
}
.avatar.sm { width: 50px; height: 50px; font-size: 17px; margin: 0; border-width: 2px; }
.avatar.blue { background: linear-gradient(145deg, #e3edfb, #bcd3f3); color: #2c5590; }
.avatar.red { background: linear-gradient(145deg, #fde4e4, #f5b9b9); color: #9d2227; }
.avatar.green { background: linear-gradient(145deg, #e3f5ee, #b6e3d2); color: #22745a; }
.avatar .presence { position: absolute; right: 6px; bottom: 6px; width: 20px; height: 20px; border-radius: 50%; border: 3px solid #fff; background: var(--success); }
.avatar.sm .presence { right: -1px; bottom: -1px; width: 12px; height: 12px; border-width: 2px; }
.presence.ko { background: var(--danger); }
.presence.warn { background: var(--warning); }
.profile-name { font-size: 20px; font-weight: 600; overflow-wrap: anywhere; }
.profile-handle { color: var(--muted); font-size: 16px; margin-bottom: 26px; overflow-wrap: anywhere; }
.profile-actions { display: flex; justify-content: center; gap: 22px; }
.profile-actions .icon-btn { width: 58px; height: 58px; background: #fff; }
.profile-actions .icon-btn:hover { background: #fafafb; }
.profile-actions .icon-btn.danger { color: var(--danger); }
.profile-actions .icon-btn.primary { color: var(--primary); }
.divider-title { display: flex; align-items: center; gap: 30px; margin: 40px 0 30px; font-size: 19px; font-weight: 500; }
.divider-title::before, .divider-title::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.feed { display: flex; flex-direction: column; gap: 30px; padding: 0 12px; }
.feed-item { display: grid; grid-template-columns: 50px minmax(0, 1fr); gap: 0 20px; }
.feed-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.feed-name { font-size: 17px; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.feed-name:hover { text-decoration: none; color: var(--primary); }
.feed-time { color: var(--muted); font-size: 14px; white-space: nowrap; }
.feed-text { color: var(--muted); font-size: 15px; }
.bubble { grid-column: 2; margin-top: 14px; padding: 18px 20px; border-radius: 18px; background: var(--primary-soft); font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; }
.bubble.ko { background: var(--danger-soft); }
.bubble.file { display: flex; align-items: center; gap: 14px; }
.bubble .file-ico { width: 42px; height: 42px; border-radius: 50%; background: #0f1220; color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.bubble .file-meta { color: var(--muted); font-size: 13.5px; }
.state-list { display: flex; flex-direction: column; gap: 14px; padding: 0 12px; }
.state-item { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 18px; background: var(--soft); }
.state-item .label { color: var(--muted); font-size: 13px; }
.state-item .grow { flex: 1; min-width: 0; }
.state-item .hint { color: var(--muted); font-size: 12px; }
.aside-foot { margin-top: auto; padding-top: 32px; }

/* ---------- Pages d'authentification ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 440px; background: var(--surface); border-radius: var(--radius); padding: 44px 40px; box-shadow: 0 30px 60px -30px rgba(20, 22, 30, .25); }
.auth-card .brand { margin: 0 0 34px; justify-content: center; }
.auth-card h1 { font-size: 26px; font-weight: 600; margin: 0 0 6px; text-align: center; }
.auth-card .lead { color: var(--muted); text-align: center; margin: 0 0 26px; font-size: 15px; }
.auth-card.wide { max-width: 620px; }
.auth-foot { margin-top: 22px; text-align: center; font-size: 14px; }
.fields { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.field input {
    padding: 15px 18px; border: 1px solid transparent; border-radius: 16px; background: var(--soft);
    font: inherit; font-size: 15px; color: var(--text); outline: none; transition: border-color .12s, background .12s;
}
.field input:focus { background: #fff; border-color: var(--primary-btn); }
.field input.code { font-size: 22px; letter-spacing: .4em; text-align: center; }
.qr { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; margin-bottom: 22px; }
.qr img { border-radius: 18px; background: #fff; padding: 8px; border: 1px solid var(--line); }

/* ---------- Responsive ---------- */
@media (max-width: 1360px) {
    .app, .app.no-aside { grid-template-columns: 240px minmax(0, 1fr); }
    .aside { grid-column: 2; border-left: 0; border-top: 1px solid var(--line); padding: 32px 56px 44px; }
    .main { padding: 44px 40px; }
    .aside { padding-left: 40px; padding-right: 40px; }
}
@media (max-width: 1080px) {
    .stats { grid-template-columns: 1fr; gap: 22px; }
    .stat { padding: 0; border-left: 0; }
    .row { grid-template-columns: 52px minmax(0, 1fr) auto; }
    .row-icon { width: 52px; height: 52px; }
    .row .row-col { grid-column: 2 / -1; }
    .row .row-action { grid-column: 3; grid-row: 1; }
}
@media (max-width: 860px) {
    .app, .app.no-aside { display: block; }
    .sidebar { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 16px; border-right: 0; border-bottom: 1px solid var(--line); }
    .brand { margin: 0 auto 0 0; font-size: 22px; }
    .nav { flex-direction: row; gap: 4px; }
    .nav a, .nav button { padding: 9px 10px; font-size: 14px; gap: 8px; white-space: nowrap; }
    .date-chip { display: none; }
    .nav .plus, .promo { display: none; }
    .main, .aside { padding: 24px 16px; }
    .page-head { flex-direction: column; }
    .page-title { font-size: 28px; }
    .section-head { flex-wrap: wrap; gap: 12px; }
    .section-head h2 { font-size: 22px; }
    .section-head .sep { padding-left: 12px; }
    .chart { grid-template-columns: 40px minmax(0, 1fr); }
    .feed, .state-list { padding: 0; }
}

/* Verdict fiscal (salon-api) : ligne informative sous le titre d'une ligne. */
.row-sub {
    color: #5b6472;
    font-size: 0.86rem;
    line-height: 1.45;
    margin-top: 4px;
}

