/* Hygio Gest — panel d'administration de la plateforme (V4) */
:root {
    --gest-navy: #0f2342;
    --gest-navy-2: #16305a;
    --gest-active: #f6ecd6;
    --gest-bg: #f5f7fb;
    --gest-border: #e6eaf2;
    --gest-text: #1b2b45;
    --gest-muted: #6b7a90;
    --gest-blue: #1f6feb;
}
html, body { background: var(--gest-bg); color: var(--gest-text); font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif; }
.gest-layout { display: flex; min-height: 100vh; }
.gest-sidebar { width: 260px; flex-shrink: 0; background: var(--gest-navy); color: #e8eef9; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.gest-brand { display: flex; align-items: center; gap: .6rem; padding: 1.4rem 1.5rem; font-size: 1.3rem; font-weight: 700; color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); text-decoration: none; }
.gest-brand .logo-img { height: 32px; width: auto; }
.gest-brand .logo { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg,#29b6f6,#1f6feb); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; font-size: 1rem; }
.gest-nav { list-style: none; padding: 1rem .75rem; margin: 0; flex: 1; overflow-y: auto; }
.gest-nav a { display: flex; align-items: center; gap: .85rem; padding: .7rem .9rem; margin-bottom: .2rem; border-radius: 10px; color: #dbe4f3; text-decoration: none; font-weight: 500; }
.gest-nav a i { font-size: 1.15rem; width: 1.3rem; text-align: center; }
.gest-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.gest-nav a.active { background: var(--gest-active); color: var(--gest-navy); font-weight: 600; }
.gest-nav .badge { margin-left: auto; }
.gest-user { border-top: 1px solid rgba(255,255,255,.08); padding: 1rem 1.25rem; display: flex; align-items: center; gap: .75rem; color: #fff; text-decoration: none; }
.gest-avatar { width: 40px; height: 40px; border-radius: 50%; background: #2b4470; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; }
.gest-user small { color: #9fb1cf; display: block; }
.gest-main { flex: 1; min-width: 0; padding: 1.75rem 2rem 3rem; overflow-wrap: break-word; }
.gest-topbar { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.gest-title h1 { font-size: 1.85rem; font-weight: 700; margin: 0; color: var(--gest-navy); }
.gest-title p { color: #4a6a9c; margin: .25rem 0 0; }
.gest-search { min-width: 320px; }
.gest-search .form-control { border-radius: 8px; border-color: var(--gest-border); padding-left: 2.2rem; }
.gest-search .bi { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--gest-muted); }
.gest-card { background: #fff; border: 1px solid var(--gest-border); border-radius: 12px; box-shadow: 0 1px 2px rgba(16,35,66,.04); }
.gest-card > .gest-card-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--gest-border); display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.gest-card > .gest-card-header h2 { font-size: 1.05rem; font-weight: 700; margin: 0; display: flex; align-items: center; gap: .5rem; }
.gest-card > .gest-card-body { padding: 1.25rem; }
.kpi { display: flex; gap: 1rem; align-items: flex-start; padding: 1.25rem; height: 100%; }
.kpi-icon { width: 48px; height: 48px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 1.25rem; flex-shrink: 0; }
.kpi-icon.blue { background: #e7f0ff; color: #1f6feb; }
.kpi-icon.violet { background: #f0eafe; color: #7c4dff; }
.kpi-icon.red { background: #fde9ea; color: #e5484d; }
.kpi-icon.green { background: #e5f7ed; color: #1f9d55; }
.kpi-icon.amber { background: #fff4e0; color: #d98a00; }
.kpi-icon.gray { background: #eef1f6; color: #5b6b82; }
.kpi-label { font-weight: 600; font-size: .9rem; }
.kpi-value { font-size: 1.8rem; font-weight: 700; line-height: 1.2; margin: .15rem 0; }
.kpi-trend { font-size: .82rem; }
.kpi-trend.up { color: #1f9d55; } .kpi-trend.down { color: #e5484d; } .kpi-trend.neutral { color: var(--gest-muted); }
.gest-table { width: 100%; margin: 0; }
.gest-table th { font-size: .82rem; color: #3d4e67; font-weight: 600; padding: .8rem 1rem; border-bottom: 1px solid var(--gest-border); background: #fbfcfe; white-space: nowrap; }
.gest-table td { padding: .85rem 1rem; border-bottom: 1px solid #f0f2f7; vertical-align: middle; font-size: .92rem; }
.gest-table tr:last-child td { border-bottom: 0; }
.gest-table tr.clickable:hover td { background: #f8faff; cursor: pointer; }
.initials { width: 34px; height: 34px; border-radius: 50%; background: #eef2f8; color: #33476a; display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; margin-right: .6rem; }
.pill { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.green { background: #e5f7ed; color: #1f9d55; } .pill.amber { background: #fff4e0; color: #c47c00; } .pill.red { background: #fde9ea; color: #d33a3f; }
.pill.blue { background: #e7f0ff; color: #1f6feb; } .pill.gray { background: #eef1f6; color: #5b6b82; } .pill.violet { background: #f0eafe; color: #6d3fe0; }
.pill.no-dot::before { display: none; }
.plan-badge { padding: .25rem .65rem; border-radius: 8px; font-size: .8rem; font-weight: 600; }
.plan-badge.pro { background: #e7f0ff; color: #1f6feb; } .plan-badge.essentiel { background: #f5e8fb; color: #a234c9; }
.gest-tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--gest-border); padding: 0 1rem; overflow-x: auto; }
.gest-tabs a { padding: .9rem 1rem; color: #3d4e67; text-decoration: none; font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; display: flex; align-items: center; gap: .45rem; }
.gest-tabs a.active { color: var(--gest-blue); border-bottom-color: var(--gest-blue); font-weight: 600; }
.btn-primary { background: var(--gest-blue); border-color: var(--gest-blue); }
.text-muted-2 { color: var(--gest-muted) !important; }
.service-row { display: flex; align-items: center; justify-content: space-between; padding: .65rem 0; border-bottom: 1px solid #f0f2f7; }
.service-row:last-child { border-bottom: 0; }
.msg { border: 1px solid var(--gest-border); border-radius: 10px; padding: .75rem 1rem; margin-bottom: .75rem; background: #fff; }
.msg.admin { background: #f4f8ff; border-color: #d6e4ff; }
.msg.internal { background: #fff8e6; border-color: #f5dca0; }
.msg .meta { font-size: .8rem; color: var(--gest-muted); margin-bottom: .3rem; }
.gest-login { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--gest-navy); }
.gest-login .card { width: 420px; border-radius: 14px; border: 0; }
/* --- Mobile et tablette : barre du haut + menu coulissant ------------------ */
.gest-mobilebar, .gest-overlay, .gest-close { display: none; }
@media (max-width: 991.98px) {
    .gest-mobilebar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; position: sticky; top: 0; z-index: 1030;
        background: var(--gest-navy); color: #fff; padding: .55rem .85rem; box-shadow: 0 2px 10px rgba(0,0,0,.15); }
    .gest-burger { background: transparent; border: 0; color: #fff; font-size: 1.6rem; line-height: 1; padding: .2rem .35rem; border-radius: 8px; }
    .gest-burger:focus-visible { outline: 2px solid #fff; }
    .gest-mobilebar-brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.1rem; display: flex; align-items: center; gap: .5rem; }
    .gest-mobilebar-brand img { height: 26px; }
    .gest-mobilebar-badge { color: #fff; text-decoration: none; position: relative; font-size: 1.3rem; padding: .2rem .35rem; }
    .gest-mobilebar-badge .badge { position: absolute; top: -2px; right: -6px; font-size: .65rem; }
    .gest-mobilebar-spacer { width: 2.3rem; }
    .gest-layout { display: block; }
    .gest-sidebar { position: fixed; top: 0; left: 0; bottom: 0; height: 100vh; height: 100dvh; width: min(290px, 85vw); z-index: 1050;
        transform: translateX(-100%); transition: transform .22s ease; overflow-y: auto; box-shadow: 4px 0 24px rgba(0,0,0,.25); }
    .gest-close { display: block; position: absolute; top: .9rem; right: .8rem; background: transparent; border: 0; color: #c9d6ea; font-size: 1.1rem; }
    .gest-overlay { display: block; position: fixed; inset: 0; background: rgba(10,20,35,.45); z-index: 1040; opacity: 0; pointer-events: none; transition: opacity .2s; }
    body.gest-menu-open { overflow: hidden; }
    body.gest-menu-open .gest-sidebar { transform: translateX(0); }
    body.gest-menu-open .gest-overlay { opacity: 1; pointer-events: auto; }
    .gest-nav { display: block; overflow: visible; }
    .gest-main { padding: 1rem .85rem 2.5rem; }
    .gest-search { min-width: 0; width: 100%; }
    .gest-title h1 { font-size: 1.45rem; }
    .gest-topbar { gap: .75rem; margin-bottom: 1rem; }
    .gest-topbar > .btn, .gest-topbar > a.btn, .gest-topbar > form { flex-shrink: 0; }
    /* Tableaux : défilement horizontal dans leur carte plutôt que débordement de la page */
    .gest-table { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .gest-table thead, .gest-table tbody { width: 100%; }
    .gest-table td, .gest-table th { white-space: nowrap; }
    .gest-table td.small, .gest-table td .small { white-space: normal; min-width: 180px; }
    .gest-card > .gest-card-header { padding: .85rem 1rem; }
    .gest-card-body { padding: 1rem; }
    .gest-tabs { padding: 0 .5rem; }
    .gest-tabs a { padding: .75rem .7rem; font-size: .9rem; }
    .kpi { padding: 1rem; }
    .kpi-value { font-size: 1.5rem; }
    .modal-dialog { margin: .5rem; }
}
@media (max-width: 575.98px) {
    .kpi { flex-direction: column; gap: .5rem; padding: .85rem; }
    .kpi-icon { width: 38px; height: 38px; font-size: 1.05rem; }
    .kpi-value { font-size: 1.3rem; }
    .kpi-label { font-size: .82rem; }
    .gest-topbar { flex-direction: column; align-items: stretch; }
    .gest-topbar > .btn, .gest-topbar > a.btn { width: 100%; }
    .gest-card-header form { width: 100%; }
    .gest-card-header form .form-control, .gest-card-header form .form-select { flex: 1 1 140px; min-width: 0; }
    .set-row { grid-template-columns: 1fr auto; }
    .set-row .set-value { grid-column: 1 / -1; grid-row: 2; }
    .set-row .set-arrow { grid-row: 1; grid-column: 2; }
    .set-head { flex-wrap: wrap; }
    .settings-grid { grid-template-columns: 1fr; }
    .set-last { width: 100%; }
}

/* --- V4 : Paramètres (maquette « cartes ») ------------------------------- */
.alert { white-space: pre-line; }
.settings-layout { display: grid; grid-template-columns: 270px 1fr; gap: 1.25rem; align-items: start; }
.settings-layout > *, .settings-grid > * { min-width: 0; }
.settings-menu { padding: .5rem; position: sticky; top: 1rem; }
.settings-menu a { display: flex; gap: .85rem; align-items: flex-start; padding: .8rem .9rem; border-radius: 10px; color: var(--gest-text); text-decoration: none; border-bottom: 1px solid var(--gest-border); }
.settings-menu a:last-child { border-bottom: 0; }
.settings-menu a i { font-size: 1.2rem; color: #4a5b74; margin-top: .1rem; }
.settings-menu a span { display: flex; flex-direction: column; line-height: 1.25; }
.settings-menu a small { color: var(--gest-muted); font-size: .78rem; }
.settings-menu a.active { background: #eaf2ff; }
.settings-menu a.active strong { color: var(--gest-blue); text-decoration: underline; }
.settings-menu a.active i { color: var(--gest-blue); }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 1.25rem; }
.set-card { padding: 1.1rem 1.25rem; }
.set-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.set-head h2 { font-size: 1.05rem; font-weight: 700; margin: 0; display: flex; align-items: center; gap: .55rem; }
.set-head h2 i { font-size: 1.25rem; color: var(--gest-blue); background: #eaf2ff; border-radius: 50%; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; }
.set-row { display: grid; grid-template-columns: 44% 1fr auto; gap: .5rem; align-items: center; padding: .62rem 0; border-top: 1px solid var(--gest-border); font-size: .9rem; }
.set-label { color: #3d4e67; }
.set-value { font-weight: 500; }
.set-arrow { color: var(--gest-blue); }
.set-row.disabled .set-label { color: #a0abbb; }
.set-soon { opacity: .75; }
.set-switch { display: inline-block; width: 34px; height: 19px; border-radius: 999px; background: #cfd6e2; position: relative; vertical-align: middle; margin-right: .35rem; }
.set-switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: #fff; transition: left .15s; }
.set-switch.on { background: #22a35a; }
.set-switch.on::after { left: 17px; }
.set-last { background: #f5f7fb; border-radius: 10px; padding: .75rem 1rem; min-width: 190px; }
.small-avatar { width: 34px; height: 34px; font-size: .8rem; background: #e3e9f4; color: #1b2b45; }
.deploy-log { background: #0f1b2d; color: #d6e2f5; border-radius: 0 0 12px 12px; margin: 0; padding: 1rem 1.25rem; max-height: 460px; overflow: auto; font-size: .8rem; white-space: pre-wrap; }
.brand-preview { display: flex; border: 1px solid var(--gest-border); border-radius: 10px; overflow: hidden; height: 110px; }
.brand-preview .bp-side { background: var(--p-side); color: #fff; width: 55%; padding: .8rem; font-weight: 700; display: flex; flex-direction: column; gap: .2rem; }
.brand-preview .bp-side img { height: 26px; width: 26px; }
.brand-preview .bp-side small { font-weight: 400; opacity: .7; }
.brand-preview .bp-main { flex: 1; background: #f4f6f8; display: flex; align-items: center; justify-content: center; }
.brand-preview .bp-btn { background: var(--p-main); color: #fff; border-radius: 8px; padding: .35rem .9rem; font-size: .85rem; }
@media (max-width: 991px) {
    .settings-layout { grid-template-columns: 1fr; }
    .settings-menu { position: static; display: flex; overflow-x: auto; gap: .25rem; padding: .35rem; -webkit-overflow-scrolling: touch; }
    .settings-menu a { flex: 0 0 auto; border-bottom: 0; padding: .55rem .8rem; align-items: center; }
    .settings-menu a small { display: none; }
    .settings-grid { grid-template-columns: 1fr; }
}
