:root{
    --primary:#0066e8;
    --primary-dark:#00265b;
    --bg:#fffeff;
    --card:#ffffff;
    --text:#0f172a;
    --muted:#6b7280;
    --border:#e5e7eb;
    --shadow:0 18px 50px rgba(15,23,42,.10);
}

[data-theme="dark"]{
    --bg:#020617;
    --card:#0b1220;
    --text:#e5e7eb;
    --muted:#9ca3af;
    --border:#1f2937;
    --shadow:0 18px 50px rgba(0,0,0,.35);
}

*{box-sizing:border-box;margin:0;padding:0;font-family:system-ui,-apple-system,BlinkMacSystemFont,"SF Pro Text",sans-serif}

body{
    background:radial-gradient(circle at top,#003f9f 0,#00265b 40%,#020617 100%);
    min-height:100vh;display:flex;align-items:center;justify-content:center;color:var(--text)
}

body > main{
    width:100%;
    min-height:100vh;
    display:flex;
    align-items:center;
    justify-content:center;
}

.app{
    background:var(--bg);
    width:min(96vw,1400px);max-width:1400px;min-height:760px;max-height:94vh;
    border-radius:24px;box-shadow:0 30px 80px rgba(0,0,0,.45),0 0 0 1px rgba(148,163,184,.25);
    overflow:hidden;display:flex;
}

.sidebar{
    width:260px;background:linear-gradient(180deg,#00265b,#001632);
    color:#e5e7eb;padding:18px 16px;display:flex;flex-direction:column;gap:14px
}

.brand{display:flex;align-items:center;gap:10px;padding:6px 6px}

.brand-badge{
    width:36px;height:36px;border-radius:12px;
    display:flex;align-items:center;justify-content:center;font-weight:800;color:#fff;font-size:14px
}

.brand-title{font-weight:700;font-size:16px;line-height:1.1}

.brand-sub{font-size:11px;color:#9ca3af}
.sidebar-mobile-logout{display:none}

.nav-label{font-size:11px;font-weight:600;text-transform:uppercase;color:#6b7280;letter-spacing:.08em;margin:2px 6px}

.nav{display:flex;flex-direction:column;gap:4px}

.nav a{
    all:unset;cursor:pointer;border-radius:10px;padding:9px 10px;
    display:flex;align-items:center;gap:10px;font-size:14px;color:#e5e7eb;opacity:.92;
    transition:background .15s ease,transform .05s ease,opacity .15s ease
}

.nav a:hover{background:rgba(15,118,255,.12);transform:translateY(-1px);opacity:1}

.nav a.active{background:rgba(15,118,255,.18);box-shadow:0 0 0 1px rgba(96,165,250,.5);opacity:1}

.icon{width:18px;height:18px;display:inline-block;color:rgba(229,231,235,.9)}

.sidebar-footer{
    margin-top:auto;border-top:1px solid rgba(55,65,81,.8);padding-top:14px;
    display:flex;flex-direction:column;gap:8px;font-size:12px;color:#9ca3af
}

.row{display:flex;align-items:center;justify-content:space-between;gap:10px}

.btn-icon{
    width:30px;height:30px;border-radius:999px;border:1px solid rgba(148,163,184,.25);
    display:inline-flex;align-items:center;justify-content:center;background:rgba(255,255,255,.06);
    cursor:pointer;color:#e5e7eb;transition:background .15s ease,transform .05s ease
}

.btn-icon:hover{background:rgba(255,255,255,.10);transform:translateY(-1px)}

.main{flex:1;min-height:0;padding:18px 20px;display:flex;flex-direction:column;background:radial-gradient(circle at top left,rgba(59,130,246,.07),transparent 45%)}

.main.main-users-dark{
    background:radial-gradient(circle at top left,rgba(2,6,23,.98) 0,rgba(2,6,23,.98) 38%,#01040c 100%);
}

.topbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}

.title{font-size:20px;font-weight:650;display:flex;align-items:baseline;gap:8px}

.title small{font-size:12px;color:var(--muted);font-weight:400}

.actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}

.admin-dashboard-actions{flex-direction:column;align-items:stretch;width:100%}
.admin-dashboard-actions-row{display:flex;align-items:center;gap:8px}
.admin-dashboard-actions-row .btn{flex:1;justify-content:center;text-align:center}
.admin-dashboard-upgrade-btn{align-self:center}
.admin-dashboard-secondary-row{display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap;margin-top:8px}

.pill{
    font-size:11px;border-radius:999px;padding:4px 10px;border:1px solid var(--border);
    color:var(--muted);background:rgba(15,23,42,.03);display:inline-flex;align-items:center;gap:6px
}

.dot{width:8px;height:8px;border-radius:999px;background:currentColor;opacity:.7}

.btn{
    all:unset;cursor:pointer;border-radius:8px;font-size:13px;padding:7px 12px;
    display:inline-flex;align-items:center;gap:8px;transition:background .15s ease,box-shadow .15s ease,transform .05s ease
}

.btn-primary{
    background:linear-gradient(135deg,var(--primary),#2f6af5);color:#fff;box-shadow:0 2px 6px rgba(37,99,235,.25)
}

.btn-primary:hover{box-shadow:0 4px 12px rgba(37,99,235,.35)}

.btn-ghost{
    border:1px solid var(--border);color:var(--muted);background:rgba(15,23,42,.02)
}

.btn-ghost:hover{background:rgba(15,23,42,.06)}

.content{flex:1;flex-direction:column;gap:12px;overflow:auto;padding-right:4px}

.content.active{display:flex}

.grid{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(0,1.3fr);gap:12px}

.card{
    background:var(--card);border:1px solid var(--border);border-radius:16px;padding:12px 14px;
    box-shadow:var(--shadow)
}

.card-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
.card-title{font-size:14px;font-weight:650}
.card-sub{font-size:11px;color:var(--muted);margin-top:2px}
.list{display:flex;flex-direction:column;gap:6px;max-height: 60vh;overflow-y: auto;}
.item{
    border:1px solid var(--border);border-radius:12px;padding:10px 10px;background:rgba(15,23,42,.01);
    display:flex;gap:10px;align-items:flex-start
}
.item.clickable{cursor:pointer;transition:background .12s ease,transform .05s ease,box-shadow .12s ease}
.item.clickable:hover{background:rgba(37,99,235,.06);box-shadow:0 10px 24px rgba(15,23,42,.10);transform:translateY(-1px)}
.avatar{
    width:32px;height:32px;border-radius:999px;background:radial-gradient(circle at 30% 0,#93c5fd,#1d4ed8);
    color:#fff;font-weight:700;font-size:13px;display:flex;align-items:center;justify-content:center
}
.it-title{font-size:13px;font-weight:650;margin-bottom:2px}
.it-meta{font-size:11px;color:var(--muted);margin-bottom:5px}
.it-text{font-size:12px;color:var(--text)}
.tags{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.tag{
    font-size:11px;border-radius:999px;padding:3px 8px;border:1px solid var(--border);color:var(--muted);
    background:rgba(15,23,42,.02);display:inline-flex;align-items:center;gap:6px
}
.tag-urgent{border-color:rgba(239,68,68,.55);color:rgba(239,68,68,.95);background:rgba(239,68,68,.08)}
.form-row{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:10px}
.field{flex:1;min-width:160px;display:flex;flex-direction:column;gap:4px}
.field label{font-size:11px;color:var(--muted)}
input[type="text"],input[type="email"],input[type="password"],input[type="date"],input[type="number"],input[type="tel"],select,textarea{
    border-radius:10px;border:1px solid var(--border);padding:8px 9px;font-size:13px;
    background:rgba(15,23,42,.01);color:var(--text);outline:none;transition:border .12s ease,box-shadow .12s ease,background .12s ease
}

input[type="number"]{
    -moz-appearance:textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button{
    -webkit-appearance:none;
    margin:0;
}
select{
    appearance:none;
    -webkit-appearance:none;
    -moz-appearance:none;
    padding-right:34px;
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat:no-repeat;
    background-position:right 10px center;
}
select option{
    background:var(--card);
    color:var(--text);
}
input:focus,select:focus,textarea:focus{border-color:rgba(37,99,235,.8);box-shadow:0 0 0 1px rgba(37,99,235,.55);background:rgba(15,23,42,.02)}
textarea{min-height:80px;resize:vertical}
.inline{display:flex;align-items:center;gap:10px;color:var(--muted);font-size:12px}
.switchline{display:flex;align-items:center;gap:10px}
.muted{color:var(--muted)}
/* LOGIN */
.overlay{
    position:fixed;inset:0;z-index:50;display:flex;align-items:center;justify-content:center;
    background:radial-gradient(circle at top,rgba(37,99,235,.32),rgba(15,23,42,.98));
}
.login{
    width:100%;max-width:380px;background:rgba(15,23,42,.96);border-radius:20px;padding:22px 20px 18px;
    color:#e5e7eb;box-shadow:0 30px 80px rgba(15,23,42,.9),0 0 0 1px rgba(148,163,184,.5)
}
.login h1{font-size:20px;font-weight:650;margin-top:10px}
.login p{font-size:12px;color:#9ca3af;margin-top:4px;margin-bottom:14px}
.login .field label{color:#9ca3af}
.login input,.login select{background:rgba(15,23,42,.85);border-color:rgba(55,65,81,1);color:#e5e7eb}
.login .error{font-size:11px;color:#fecaca;min-height:14px;margin-top:6px}
.sep{height:1px;background:rgba(55,65,81,.8);margin:10px 0}

.login-page{
    flex:1;
    min-width:0;
    min-height:100%;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:32px 24px;
}

.login-shell{
    width:fit-content;
    max-width:100%;
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:20px;
}

.login-brand{
    margin-bottom:0;
    padding:0;
    justify-content:center;
}

.login-card{
    width:fit-content;
    max-width:100%;
    display:flex;
    flex-direction:column;
    gap:0;
}

.login-card .form-row{
    width:100%;
}

.login-card .field{
    min-width:220px;
}

.login-error{
    color:#dc2626;
    min-height:18px;
}

.login-page-light{
    background:radial-gradient(circle at 12% 0%,rgba(37,99,235,.08),transparent 36%),linear-gradient(180deg,rgba(255,255,255,.94),rgba(248,250,252,.90));
}

.login-page-dark{
    background:radial-gradient(circle at top left,rgba(51,65,85,.34) 0,rgba(2,6,23,.95) 62%,#020617 100%);
    border-radius:16px;
}

.login-brand .brand-title{
    color:#0f172a;
}

.login-page-dark .login-brand .brand-title{
    color:#e5e7eb;
}

.login-card{
    border-radius:20px;
    border:1px solid rgba(148,163,184,.28);
    padding:18px;
    box-shadow:0 24px 60px rgba(15,23,42,.20);
}

.login-card-light{
    background:linear-gradient(180deg,#ffffff,#f8fafc);
}

.login-card-dark{
    background:rgba(15,23,42,.96);
    border-color:rgba(148,163,184,.5);
    box-shadow:0 30px 80px rgba(15,23,42,.9),0 0 0 1px rgba(148,163,184,.5);
}

.login-card h1{
    font-size:20px;
    font-weight:650;
    margin-bottom:10px;
}

.login-card .field{
    min-width:220px;
}

.login-theme-toggle{
    font-size:12px;
    padding:6px 10px;
}

.login-page-light .login-theme-toggle{
    border-color:rgba(148,163,184,.45);
    color:#334155;
    background:rgba(248,250,252,.85);
}

.login-page-dark .login-theme-toggle{
    border-color:rgba(71,85,105,.7);
    color:#cbd5e1;
    background:rgba(30,41,59,.62);
}

.login-page-light .login-card h1,
.login-page-light .login-card .field label,
.login-page-light .login-error{
    color:#334155;
}

.login-page-light .login-card input,
.login-page-light .login-card select{
    background:#ffffff;
    border-color:#cbd5e1;
    color:#0f172a;
}

.login-page-light .login-error{
    color:#b91c1c;
}

.login-page-dark .login-card h1{
    color:#e5e7eb;
}

.login-page-dark .login-card .field label{
    color:#9ca3af;
}

.login-page-dark .login-card input,
.login-page-dark .login-card select{
    background:rgba(15,23,42,.85);
    border-color:rgba(55,65,81,1);
    color:#e5e7eb;
}

.login-page-dark .login-error{
    color:#fecaca;
}

.login-actions{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:10px;
    margin-top:10px;
}

.login-submit{
    max-width:100%;
}

/* USERS MANAGER */
.users-manager-grid{grid-template-columns:minmax(0,1.15fr) minmax(0,.85fr);align-items:stretch}
.users-right-column{display:flex;flex-direction:column;gap:12px;min-width:0}
.users-columns-card{min-height:0;display:flex;flex-direction:column;height:100%}
.users-stacked-groups{display:flex;flex-direction:column;gap:12px;flex:1;min-height:0}
.users-group{display:flex;flex-direction:column;gap:6px;padding:10px;border:1px solid var(--border);border-radius:12px;background:rgba(15,23,42,.02)}
.users-group-admin{border-left:4px solid #1d4ed8}
.users-group-soignant{border-left:4px solid #16a34a;flex:1;min-height:0}
.users-column-title{font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;margin-bottom:6px}
.users-group-label{margin-bottom:2px}
.users-list-compact{max-height:none}
.users-group-admin .users-list-compact{max-height:180px;overflow-y:auto}
.users-group-coordinateur .users-list-compact{max-height:180px;overflow-y:auto}
.users-group-soignant .users-list-compact{flex:1;min-height:0;overflow-y:auto}
.users-form-card form{display:flex;flex-direction:column}
.users-form-actions{margin-top:12px;display:flex;justify-content:flex-end}
.users-plan-card .card-head{margin-bottom:8px}
.users-plan-content{display:flex;flex-direction:column;gap:2px}
.users-plan-value,.users-plan-expiry{
    border:1px solid var(--border);
    border-radius:10px;
    padding:8px 9px;
    font-size:13px;
    background:rgba(15,23,42,.01);
    color:var(--text)
}
.users-plan-box{
    margin-bottom:10px;
    padding:10px;
    border:1px solid var(--border);
    border-radius:12px;
    background:rgba(15,23,42,.02)
}
.users-plan-btn-placeholder{width:100%;justify-content:center}
.users-plan-select{
    width:100%;
    border:1px solid rgba(2,132,199,.45);
    background:linear-gradient(135deg,rgba(14,165,233,.12),rgba(37,99,235,.10));
    color:#0f172a;
    font-weight:600;
    box-shadow:0 6px 16px rgba(14,116,144,.10);
}

.users-plan-select:hover{
    border-color:rgba(2,132,199,.7);
    box-shadow:0 10px 22px rgba(14,116,144,.16);
}

.users-plan-select:focus{
    border-color:#0284c7;
    box-shadow:0 0 0 2px rgba(2,132,199,.24);
}

.users-plan-switch-box{
    padding:10px;
    border:1px dashed rgba(2,132,199,.35);
    border-radius:12px;
    background:linear-gradient(135deg,rgba(224,242,254,.62),rgba(219,234,254,.42));
}

.users-plan-hint{
    margin-top:6px;
    color:#0e7490;
    font-weight:500;
}

.users-plan-value-updated{
    animation:planPulse .85s ease;
}

.users-plan-switch-box-updated{
    animation:planFrameGlow .85s ease;
}

@keyframes planPulse{
    0%{
        background:linear-gradient(135deg,rgba(110,231,183,.40),rgba(56,189,248,.30));
        border-color:rgba(2,132,199,.65);
        transform:translateY(-1px);
    }
    60%{
        background:linear-gradient(135deg,rgba(110,231,183,.18),rgba(56,189,248,.14));
        border-color:rgba(2,132,199,.45);
    }
    100%{
        background:rgba(15,23,42,.01);
        border-color:var(--border);
        transform:translateY(0);
    }
}

@keyframes planFrameGlow{
    0%{
        box-shadow:0 0 0 0 rgba(2,132,199,.34),0 10px 22px rgba(14,116,144,.18);
    }
    100%{
        box-shadow:0 0 0 0 rgba(2,132,199,0),0 0 0 rgba(14,116,144,0);
    }
}
.users-role-select{
    appearance:none;
    -webkit-appearance:none;
    -moz-appearance:none;
    padding-right:34px;
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat:no-repeat;
    background-position:right 10px center;
}

.users-btn-edit{
    border:1px solid rgba(14,116,144,.45);
    color:#0f766e;
    background:linear-gradient(135deg,rgba(20,184,166,.14),rgba(34,211,238,.12));
    font-weight:600;
}

.users-btn-edit:hover{
    background:linear-gradient(135deg,rgba(20,184,166,.22),rgba(34,211,238,.20));
    box-shadow:0 8px 20px rgba(15,118,110,.18);
}

.users-btn-edit-active{
    border-color:#0e7490;
    color:#0e7490;
    box-shadow:0 0 0 1px rgba(14,116,144,.35) inset;
}

.users-search-wrap{
    margin-top:10px;
}

.users-search-input{
    width:min(420px,100%);
}

.users-btn-toggle{
    border:1px solid rgba(148,163,184,.42);
    color:#334155;
    background:linear-gradient(135deg,rgba(248,250,252,.96),rgba(241,245,249,.96));
    font-weight:600;
}

.users-btn-toggle:hover{
    background:linear-gradient(135deg,rgba(241,245,249,.98),rgba(226,232,240,.98));
}

.users-btn-toggle-activate{
    border-color:rgba(34,197,94,.35);
    color:#166534;
    background:linear-gradient(135deg,rgba(240,253,244,.96),rgba(220,252,231,.94));
}

.users-btn-toggle-activate:hover{
    background:linear-gradient(135deg,rgba(220,252,231,.98),rgba(187,247,208,.95));
}

.users-btn-toggle:disabled,
.patients-btn-delete-inline:disabled,
.users-btn-create:disabled{
    opacity:.55;
    cursor:not-allowed;
}

.users-modal-backdrop{
    position:fixed;
    inset:0;
    z-index:1010;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:20px;
    background:rgba(2,6,23,.56);
    backdrop-filter:blur(3px);
}

.users-modal-card{
    width:min(520px,100%);
    border:1px solid rgba(239,68,68,.25);
    border-radius:18px;
    background:linear-gradient(180deg,#ffffff,#fff8f8);
    box-shadow:0 30px 70px rgba(2,6,23,.28);
    padding:18px;
}

.users-modal-title{
    font-size:18px;
    font-weight:700;
    color:#7f1d1d;
    margin-bottom:8px;
}

.users-modal-text{
    font-size:14px;
    color:#1f2937;
    line-height:1.5;
}

.users-modal-warning{
    margin-top:10px;
    font-size:12px;
    font-weight:600;
    color:#991b1b;
    background:rgba(254,226,226,.8);
    border:1px solid rgba(248,113,113,.4);
    border-radius:10px;
    padding:8px 10px;
}

.users-modal-actions{
    margin-top:16px;
    display:flex;
    justify-content:flex-end;
    gap:8px;
}

.users-btn-delete-confirm{
    border:1px solid #7f1d1d;
    color:#ffffff;
    background:linear-gradient(135deg,#b91c1c,#7f1d1d);
    font-weight:600;
}

.users-btn-delete-confirm:hover{
    box-shadow:0 10px 24px rgba(127,29,29,.35);
}

.users-manager-page{
    min-height:0;
    overflow:hidden;
    padding-right:0;
}

.users-manager-page.users-manager-light{
    border:1px solid rgba(148,163,184,.26);
    border-radius:16px;
    padding:14px;
    background:
        radial-gradient(circle at 8% 0%,rgba(37,99,235,.08),transparent 38%),
        radial-gradient(circle at 92% 18%,rgba(20,184,166,.07),transparent 34%),
        linear-gradient(180deg,rgba(255,255,255,.92),rgba(248,250,252,.86));
}

.users-manager-page .users-manager-grid{
    flex:1;
    min-height:0;
    overflow:hidden;
}

.users-manager-page .users-manager-grid > .tp-teams-card{
    min-height:0;
    overflow:auto;
    padding-right:4px;
}

.users-manager-page .users-right-column{
    min-height:0;
    overflow:auto;
    padding-right:4px;
}

.sidebar-theme-toggle{
    width:100%;
    max-width:100%;
    box-sizing:border-box;
    justify-content:center;
    font-size:12px;
    line-height:1.2;
    padding:8px 10px;
    margin-top:2px;
    white-space:normal;
}

.sidebar-theme-toggle:disabled{
    opacity:.65;
    cursor:not-allowed;
}

.sidebar-theme-toggle-active{
    border-color:rgba(96,165,250,.6);
    color:#dbeafe;
    background:rgba(30,64,175,.28);
}

.users-manager-page.users-manager-dark{
    --bg:#020617;
    --card:#0b1220;
    --text:#e5e7eb;
    --muted:#9ca3af;
    --border:#1f2937;
    --shadow:0 18px 50px rgba(0,0,0,.35);
    border:1px solid rgba(71,85,105,.5);
    border-radius:16px;
    padding:14px;
    background:radial-gradient(circle at top left,rgba(51,65,85,.32) 0,rgba(2,6,23,.94) 62%,#020617 100%);
}

.users-manager-page.users-manager-dark,
.users-manager-page.users-manager-dark .title,
.users-manager-page.users-manager-dark .title span,
.users-manager-page.users-manager-dark .card-title,
.users-manager-page.users-manager-dark .users-column-title,
.users-manager-page.users-manager-dark .it-title,
.users-manager-page.users-manager-dark .it-text,
.users-manager-page.users-manager-dark .users-modal-text,
.users-manager-page.users-manager-dark .users-modal-title,
.users-manager-page.users-manager-dark .users-plan-value,
.users-manager-page.users-manager-dark .users-plan-expiry,
.users-manager-page.users-manager-dark .tag,
.users-manager-page.users-manager-dark .pill,
.users-manager-page.users-manager-dark strong{
    color:#e5e7eb;
}

.users-manager-page.users-manager-dark .title,
.users-manager-page.users-manager-dark .it-title,
.users-manager-page.users-manager-dark .it-text,
.users-manager-page.users-manager-dark strong{
    color:var(--text);
}

.users-manager-page.users-manager-dark .it-meta,
.users-manager-page.users-manager-dark .card-sub,
.users-manager-page.users-manager-dark .field label{
    color:#cbd5e1;
}

.users-manager-page.users-manager-dark .card,
.users-manager-page.users-manager-dark .item,
.users-manager-page.users-manager-dark .tag,
.users-manager-page.users-manager-dark .pill,
.users-manager-page.users-manager-dark .users-group,
.users-manager-page.users-manager-dark .users-plan-value,
.users-manager-page.users-manager-dark .users-plan-expiry,
.users-manager-page.users-manager-dark .users-plan-box{
    background:rgba(15,23,42,.62);
}

.users-manager-page.users-manager-dark .users-plan-switch-box{
    border:1px dashed rgba(56,189,248,.45);
    background:linear-gradient(135deg,rgba(14,165,233,.18),rgba(30,64,175,.16));
}

.users-manager-page.users-manager-dark .users-plan-hint{
    color:#93c5fd;
}

.users-manager-page.users-manager-dark .users-plan-select{
    border-color:rgba(56,189,248,.55);
    color:#e5e7eb;
    background:linear-gradient(135deg,rgba(14,165,233,.18),rgba(30,64,175,.18));
}

.users-manager-page.users-manager-dark .users-plan-select option{
    background:#0b1220;
    color:#e5e7eb;
}

.users-manager-page.users-manager-dark input[type="text"],
.users-manager-page.users-manager-dark input[type="email"],
.users-manager-page.users-manager-dark input[type="password"],
.users-manager-page.users-manager-dark input[type="date"],
.users-manager-page.users-manager-dark select,
.users-manager-page.users-manager-dark textarea{
    background:rgba(15,23,42,.75);
    border-color:rgba(71,85,105,.55);
    color:#e5e7eb;
}

.users-manager-page.users-manager-dark input::placeholder,
.users-manager-page.users-manager-dark textarea::placeholder{
    color:#94a3b8;
}

.users-manager-page.users-manager-dark select{
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat:no-repeat;
    background-position:right 10px center;
}

.users-manager-page.users-manager-dark input:focus,
.users-manager-page.users-manager-dark select:focus,
.users-manager-page.users-manager-dark textarea:focus{
    border-color:rgba(96,165,250,.85);
    box-shadow:0 0 0 1px rgba(96,165,250,.55);
    background:rgba(30,41,59,.85);
}

.users-manager-page.users-manager-dark .btn-ghost{
    border-color:rgba(71,85,105,.7);
    color:#cbd5e1;
    background:rgba(30,41,59,.55);
}

.users-manager-page.users-manager-dark .btn-ghost:hover{
    background:rgba(51,65,85,.7);
}

.users-manager-page.users-manager-dark .btn-primary{
    background:linear-gradient(135deg,#1d4ed8,#1e40af);
    color:#f8fafc;
    box-shadow:0 10px 30px rgba(30,64,175,.45);
}

.users-manager-page.users-manager-dark .topbar,
.users-manager-page.users-manager-dark .users-group,
.users-manager-page.users-manager-dark .item,
.users-manager-page.users-manager-dark .card,
.users-manager-page.users-manager-dark .users-plan-box{
    border-color:rgba(71,85,105,.55);
}

.users-manager-page.users-manager-dark .users-group-admin,
.users-manager-page.users-manager-dark .users-group-soignant,
.users-manager-page.users-manager-dark .users-group-coordinateur{
    border-left-color:#60a5fa;
}

.users-manager-page.users-manager-dark .users-right-column{
    scrollbar-color:#334155 #0f172a;
    scrollbar-width:thin;
}

.users-manager-page.users-manager-dark .users-right-column::-webkit-scrollbar{
    width:10px;
}

.users-manager-page.users-manager-dark .users-right-column::-webkit-scrollbar-track{
    background:#0f172a;
    border-radius:10px;
}

.users-manager-page.users-manager-dark .users-right-column::-webkit-scrollbar-thumb{
    background:linear-gradient(180deg,#334155,#1e293b);
    border:1px solid #475569;
    border-radius:10px;
}

.users-manager-page.users-manager-dark .users-right-column::-webkit-scrollbar-thumb:hover{
    background:linear-gradient(180deg,#475569,#334155);
}

.users-manager-page.users-manager-dark .users-list-compact{
    scrollbar-color:#334155 #0f172a;
    scrollbar-width:thin;
}

.users-manager-page.users-manager-dark .users-list-compact::-webkit-scrollbar{
    width:10px;
}

.users-manager-page.users-manager-dark .users-list-compact::-webkit-scrollbar-track{
    background:#0f172a;
    border-radius:10px;
}

.users-manager-page.users-manager-dark .users-list-compact::-webkit-scrollbar-thumb{
    background:linear-gradient(180deg,#334155,#1e293b);
    border:1px solid #475569;
    border-radius:10px;
}

.users-manager-page.users-manager-dark .users-list-compact::-webkit-scrollbar-thumb:hover{
    background:linear-gradient(180deg,#475569,#334155);
}

.users-manager-page.users-manager-dark .users-btn-toggle{
    color:#cbd5e1;
    border-color:rgba(148,163,184,.45);
    background:linear-gradient(135deg,rgba(30,41,59,.90),rgba(15,23,42,.92));
}

.users-manager-page.users-manager-dark .users-btn-toggle:hover{
    background:linear-gradient(135deg,rgba(51,65,85,.95),rgba(30,41,59,.95));
}

.users-manager-page.users-manager-dark .users-btn-toggle-activate{
    border-color:rgba(34,197,94,.42);
    color:#bbf7d0;
    background:linear-gradient(135deg,rgba(20,83,45,.72),rgba(22,101,52,.72));
}

.users-manager-page.users-manager-dark .users-btn-toggle-activate:hover{
    background:linear-gradient(135deg,rgba(22,101,52,.85),rgba(21,128,61,.85));
}

.users-manager-page.users-manager-dark .patients-btn-delete-inline{
    border-color:rgba(248,113,113,.45);
    color:#fecaca;
    background:linear-gradient(135deg,rgba(127,29,29,.62),rgba(153,27,27,.62));
}

.users-manager-page.users-manager-dark .patients-btn-delete-inline:hover{
    background:linear-gradient(135deg,rgba(153,27,27,.75),rgba(185,28,28,.75));
}

.users-manager-page.users-manager-dark .users-btn-edit{
    border-color:rgba(45,212,191,.46);
    color:#99f6e4;
    background:linear-gradient(135deg,rgba(13,148,136,.35),rgba(8,145,178,.30));
}

.users-manager-page.users-manager-dark .users-btn-edit:hover{
    background:linear-gradient(135deg,rgba(13,148,136,.50),rgba(8,145,178,.45));
    box-shadow:0 8px 20px rgba(20,184,166,.2);
}

.users-manager-page.users-manager-dark .users-modal-card{
    border-color:rgba(248,113,113,.28);
    background:linear-gradient(180deg,#111827,#0f172a);
}

.users-manager-page.users-manager-dark .users-modal-title{
    color:#fecaca;
}

.users-manager-page.users-manager-dark .users-modal-text{
    color:#e5e7eb;
}

.users-manager-page.users-manager-dark .users-modal-warning{
    color:#fecaca;
    background:rgba(127,29,29,.38);
    border-color:rgba(248,113,113,.42);
}

/* TRANSMISSIONS */
.transmission-note-box{
    margin-bottom:12px;
    padding:10px;
    border:1px solid rgba(37,99,235,.25);
    border-radius:12px;
    background:linear-gradient(135deg,rgba(59,130,246,.10),rgba(14,165,233,.08));
}
.transmission-note-title{
    font-size:12px;
    font-weight:700;
    color:#1d4ed8;
    margin-bottom:3px;
    text-transform:uppercase;
    letter-spacing:.04em;
}
.transmission-form-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:12px;
}
.transmission-field-full{grid-column:1 / -1}
.transmission-patient-select-wrap{
    display:flex;
    flex-direction:column;
    gap:8px;
}
.transmission-patient-preview{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    padding:8px;
    border:1px dashed rgba(37,99,235,.35);
    border-radius:10px;
    background:rgba(255,255,255,.6);
}

.person-search-control{
    display:flex;
    gap:8px;
    align-items:stretch;
}

.transmission-recording-actions,
.transmission-abbreviation-form,
.transmission-submit-actions{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    align-items:center;
}

.transmission-abbreviation-list{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
}

.transmission-abbreviation-chip{
    display:flex;
    align-items:center;
    gap:8px;
}

.transmission-list-header{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:12px;
    flex-wrap:wrap;
    margin-bottom:12px;
}

.transmission-list-header .card-head{
    margin-bottom:0;
}

.transmission-list-item-content,
.admin-activity-main{
    min-width:0;
}

.transmission-detail-edit-actions,
.history-origin-meta{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    align-items:flex-start;
}

.history-change-grid,
.admin-activity-day-list{
    display:grid;
    gap:10px;
}

.history-change-diff{
    display:flex;
    gap:10px;
    align-items:center;
}

.history-diff-panel{
    min-width:0;
}

.history-diff-arrow{
    font-weight:700;
}

.history-origin-report{
    border-radius:4px;
}

.transmission-view{
    min-height:0;
    border:1px solid rgba(148,163,184,.26);
    border-radius:16px;
    padding:14px;
    background:
        radial-gradient(circle at 8% 0%,rgba(37,99,235,.08),transparent 38%),
        radial-gradient(circle at 92% 18%,rgba(20,184,166,.07),transparent 34%),
        linear-gradient(180deg,rgba(255,255,255,.92),rgba(248,250,252,.86));
}

.transmission-list-view.transmissions-list-dark{
    --bg:#020617;
    --card:#0b1220;
    --text:#e5e7eb;
    --muted:#9ca3af;
    --border:#1f2937;
    --shadow:0 18px 50px rgba(0,0,0,.35);
    border:1px solid rgba(71,85,105,.5);
    border-radius:16px;
    padding:14px;
    background:radial-gradient(circle at top left,rgba(51,65,85,.32) 0,rgba(2,6,23,.94) 62%,#020617 100%);
}

.transmission-list-view.transmissions-list-light{
    border:1px solid rgba(148,163,184,.26);
    border-radius:16px;
    padding:14px;
    background:
        radial-gradient(circle at 8% 0%,rgba(37,99,235,.08),transparent 38%),
        radial-gradient(circle at 92% 18%,rgba(20,184,166,.07),transparent 34%),
        linear-gradient(180deg,rgba(255,255,255,.92),rgba(248,250,252,.86));
}

.transmission-list-view.transmissions-list-dark,
.transmission-list-view.transmissions-list-dark .title,
.transmission-list-view.transmissions-list-dark .title span,
.transmission-list-view.transmissions-list-dark .card-title,
.transmission-list-view.transmissions-list-dark .it-title,
.transmission-list-view.transmissions-list-dark .it-text,
.transmission-list-view.transmissions-list-dark .tag,
.transmission-list-view.transmissions-list-dark .pill,
.transmission-list-view.transmissions-list-dark strong{
    color:#e5e7eb;
}

.transmission-list-view.transmissions-list-dark .it-meta,
.transmission-list-view.transmissions-list-dark .card-sub,
.transmission-list-view.transmissions-list-dark .field label,
.transmission-list-view.transmissions-list-dark .title small{
    color:#cbd5e1;
}

.transmission-list-view.transmissions-list-dark .card,
.transmission-list-view.transmissions-list-dark .item,
.transmission-list-view.transmissions-list-dark .tag,
.transmission-list-view.transmissions-list-dark .pill{
    background:rgba(15,23,42,.62);
}

.transmission-list-view.transmissions-list-dark .topbar,
.transmission-list-view.transmissions-list-dark .item,
.transmission-list-view.transmissions-list-dark .card{
    border-color:rgba(71,85,105,.55);
}

.transmission-list-view.transmissions-list-dark input[type="text"],
.transmission-list-view.transmissions-list-dark input[type="email"],
.transmission-list-view.transmissions-list-dark input[type="password"],
.transmission-list-view.transmissions-list-dark input[type="date"],
.transmission-list-view.transmissions-list-dark select,
.transmission-list-view.transmissions-list-dark textarea{
    background:rgba(15,23,42,.75);
    border-color:rgba(71,85,105,.55);
    color:#e5e7eb;
}

.transmission-list-view.transmissions-list-dark input::placeholder,
.transmission-list-view.transmissions-list-dark textarea::placeholder{
    color:#94a3b8;
}

.transmission-list-view.transmissions-list-dark select{
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat:no-repeat;
    background-position:right 10px center;
}

.transmission-list-view.transmissions-list-dark input:focus,
.transmission-list-view.transmissions-list-dark select:focus,
.transmission-list-view.transmissions-list-dark textarea:focus{
    border-color:rgba(96,165,250,.85);
    box-shadow:0 0 0 1px rgba(96,165,250,.55);
    background:rgba(30,41,59,.85);
}

.transmission-list-view.transmissions-list-dark .btn-ghost{
    border-color:rgba(71,85,105,.7);
    color:#cbd5e1;
    background:rgba(30,41,59,.55);
}

.transmission-list-view.transmissions-list-dark .btn-ghost:hover{
    background:rgba(51,65,85,.7);
}

.transmission-list-view.transmissions-list-dark .btn-primary{
    background:linear-gradient(135deg,#1d4ed8,#1e40af);
    color:#f8fafc;
    box-shadow:0 10px 30px rgba(30,64,175,.45);
}

.transmission-list-view.transmissions-list-dark .item.clickable:hover{
    background:rgba(37,99,235,.25);
    box-shadow:0 10px 24px rgba(2,6,23,.36);
}

.transmission-list-view.transmissions-list-dark{
    scrollbar-color:#334155 #0f172a;
    scrollbar-width:thin;
}

.transmission-list-view.transmissions-list-dark::-webkit-scrollbar{
    width:10px;
}

.transmission-list-view.transmissions-list-dark::-webkit-scrollbar-track{
    background:#0f172a;
    border-radius:10px;
}

.transmission-list-view.transmissions-list-dark::-webkit-scrollbar-thumb{
    background:linear-gradient(180deg,#334155,#1e293b);
    border:1px solid #475569;
    border-radius:10px;
}

.transmission-list-view.transmissions-list-dark::-webkit-scrollbar-thumb:hover{
    background:linear-gradient(180deg,#475569,#334155);
}

.transmission-list-view.transmissions-list-dark .list{
    scrollbar-color:#334155 #0f172a;
    scrollbar-width:thin;
}

.transmission-list-view.transmissions-list-dark .list::-webkit-scrollbar{
    width:10px;
}

/* SUBSCRIPTION MANAGEMENT (SUPER ADMIN) */
.subscription-admin-page{
    min-height:0;
    overflow:auto;
    border:1px solid rgba(148,163,184,.26);
    border-radius:16px;
    padding:14px;
    background:
        radial-gradient(circle at 8% 0%,rgba(37,99,235,.08),transparent 38%),
        radial-gradient(circle at 92% 18%,rgba(20,184,166,.07),transparent 34%),
        linear-gradient(180deg,rgba(255,255,255,.92),rgba(248,250,252,.86));
}

.subscription-admin-grid{
    grid-template-columns:minmax(0,1.08fr) minmax(0,.92fr);
    align-items:stretch;
    flex:1;
    min-height:0;
}

.subscription-admin-page .card{
    padding:16px;
    height:100%;
    display:flex;
    flex-direction:column;
}

.subscription-admin-page .subscription-admin-alert{
    height:auto;
    flex:none;
    display:block;
}

.subscription-admin-page .card-head{
    margin-bottom:14px;
}

.subscription-admin-page .form-row{
    gap:12px;
    margin-bottom:14px;
}

.subscription-admin-page .field{
    gap:6px;
}

.subscription-admin-page input[type="text"],
.subscription-admin-page input[type="email"],
.subscription-admin-page input[type="password"],
.subscription-admin-page input[type="date"],
.subscription-admin-page input[type="number"],
.subscription-admin-page select,
.subscription-admin-page textarea{
    min-height:38px;
}

.subscription-admin-current-box{
    margin-top:10px;
    margin-bottom:10px;
    padding:10px;
    border:1px dashed rgba(37,99,235,.35);
    border-radius:12px;
    background:rgba(255,255,255,.62);
    display:flex;
    flex-direction:column;
    gap:4px;
}

.subscription-admin-section{
    margin-top:14px;
    padding-top:14px;
    border-top:1px dashed var(--border);
}

.subscription-admin-section-title{
    margin-bottom:8px;
    font-size:12px;
    font-weight:700;
    color:#1d4ed8;
    text-transform:uppercase;
    letter-spacing:.04em;
}

.subscription-admin-actions-end{
    align-self:flex-end;
}

.subscription-admin-page.subscription-admin-dark{
    --bg:#020617;
    --card:#0b1220;
    --text:#e5e7eb;
    --muted:#9ca3af;
    --border:#1f2937;
    --shadow:0 18px 50px rgba(0,0,0,.35);
    border:1px solid rgba(71,85,105,.5);
    background:radial-gradient(circle at top left,rgba(51,65,85,.32) 0,rgba(2,6,23,.94) 62%,#020617 100%);
    scrollbar-color:#334155 #0f172a;
    scrollbar-width:thin;
}

.subscription-admin-page.subscription-admin-dark::-webkit-scrollbar{
    width:10px;
}

.subscription-admin-page.subscription-admin-dark::-webkit-scrollbar-track{
    background:#0f172a;
    border-radius:10px;
}

.subscription-admin-page.subscription-admin-dark::-webkit-scrollbar-thumb{
    background:linear-gradient(180deg,#334155,#1e293b);
    border:1px solid #475569;
    border-radius:10px;
}

.subscription-admin-page.subscription-admin-dark::-webkit-scrollbar-thumb:hover{
    background:linear-gradient(180deg,#475569,#334155);
}

.subscription-admin-page.subscription-admin-dark,
.subscription-admin-page.subscription-admin-dark .title,
.subscription-admin-page.subscription-admin-dark .title span,
.subscription-admin-page.subscription-admin-dark .card-title,
.subscription-admin-page.subscription-admin-dark .it-title,
.subscription-admin-page.subscription-admin-dark .it-text,
.subscription-admin-page.subscription-admin-dark .tag,
.subscription-admin-page.subscription-admin-dark .pill,
.subscription-admin-page.subscription-admin-dark strong{
    color:#e5e7eb;
}

.subscription-admin-page.subscription-admin-dark .card-sub,
.subscription-admin-page.subscription-admin-dark .field label,
.subscription-admin-page.subscription-admin-dark .title small{
    color:#cbd5e1;
}

.subscription-admin-page.subscription-admin-dark .card,
.subscription-admin-page.subscription-admin-dark .item,
.subscription-admin-page.subscription-admin-dark .tag,
.subscription-admin-page.subscription-admin-dark .pill,
.subscription-admin-page.subscription-admin-dark .subscription-admin-current-box{
    background:rgba(15,23,42,.62);
}

.subscription-admin-page.subscription-admin-dark .subscription-admin-current-box,
.subscription-admin-page.subscription-admin-dark .topbar,
.subscription-admin-page.subscription-admin-dark .item,
.subscription-admin-page.subscription-admin-dark .card,
.subscription-admin-page.subscription-admin-dark .subscription-admin-section{
    border-color:rgba(71,85,105,.55);
}

.subscription-admin-page.subscription-admin-dark .subscription-admin-section-title{
    color:#93c5fd;
}

.subscription-admin-page.subscription-admin-dark input[type="text"],
.subscription-admin-page.subscription-admin-dark input[type="email"],
.subscription-admin-page.subscription-admin-dark input[type="password"],
.subscription-admin-page.subscription-admin-dark input[type="date"],
.subscription-admin-page.subscription-admin-dark input[type="number"],
.subscription-admin-page.subscription-admin-dark select,
.subscription-admin-page.subscription-admin-dark textarea{
    background:rgba(15,23,42,.75);
    border-color:rgba(71,85,105,.55);
    color:#e5e7eb;
}

.subscription-admin-page.subscription-admin-dark input::placeholder,
.subscription-admin-page.subscription-admin-dark textarea::placeholder{
    color:#94a3b8;
}

.subscription-admin-page.subscription-admin-dark select{
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat:no-repeat;
    background-position:right 10px center;
}

.subscription-admin-page.subscription-admin-dark input:focus,
.subscription-admin-page.subscription-admin-dark select:focus,
.subscription-admin-page.subscription-admin-dark textarea:focus{
    border-color:rgba(96,165,250,.85);
    box-shadow:0 0 0 1px rgba(96,165,250,.55);
    background:rgba(30,41,59,.85);
}

.subscription-admin-page.subscription-admin-dark .btn-ghost{
    border-color:rgba(71,85,105,.7);
    color:#cbd5e1;
    background:rgba(30,41,59,.55);
}

.subscription-admin-page.subscription-admin-dark .btn-ghost:hover{
    background:rgba(51,65,85,.7);
}

.subscription-admin-page.subscription-admin-dark .btn-primary{
    background:linear-gradient(135deg,#1d4ed8,#1e40af);
    color:#f8fafc;
    box-shadow:0 10px 30px rgba(30,64,175,.45);
}

@media (max-width: 1200px){
    .subscription-admin-grid{
        grid-template-columns:1fr;
    }
}

.transmission-list-view.transmissions-list-dark .list::-webkit-scrollbar-track{
    background:#0f172a;
    border-radius:10px;
}

.transmission-list-view.transmissions-list-dark .list::-webkit-scrollbar-thumb{
    background:linear-gradient(180deg,#334155,#1e293b);
    border:1px solid #475569;
    border-radius:10px;
}

.transmission-list-view.transmissions-list-dark .list::-webkit-scrollbar-thumb:hover{
    background:linear-gradient(180deg,#475569,#334155);
}

.transmission-detail-view.transmission-detail-dark{
    --bg:#020617;
    --card:#0b1220;
    --text:#e5e7eb;
    --muted:#9ca3af;
    --border:#1f2937;
    --shadow:0 18px 50px rgba(0,0,0,.35);
    border:1px solid rgba(71,85,105,.5);
    border-radius:16px;
    padding:14px;
    background:radial-gradient(circle at top left,rgba(51,65,85,.32) 0,rgba(2,6,23,.94) 62%,#020617 100%);
}

.transmission-detail-view.transmission-detail-dark,
.transmission-detail-view.transmission-detail-dark .title,
.transmission-detail-view.transmission-detail-dark .title span,
.transmission-detail-view.transmission-detail-dark .card-title,
.transmission-detail-view.transmission-detail-dark .it-title,
.transmission-detail-view.transmission-detail-dark .it-text,
.transmission-detail-view.transmission-detail-dark .tag,
.transmission-detail-view.transmission-detail-dark .pill,
.transmission-detail-view.transmission-detail-dark strong{
    color:#e5e7eb;
}

.transmission-detail-view.transmission-detail-dark .it-meta,
.transmission-detail-view.transmission-detail-dark .card-sub,
.transmission-detail-view.transmission-detail-dark .field label,
.transmission-detail-view.transmission-detail-dark .title small{
    color:#cbd5e1;
}

.transmission-detail-view.transmission-detail-dark .card,
.transmission-detail-view.transmission-detail-dark .item,
.transmission-detail-view.transmission-detail-dark .tag,
.transmission-detail-view.transmission-detail-dark .pill{
    background:rgba(15,23,42,.62);
}

.transmission-detail-view.transmission-detail-dark .item,
.transmission-detail-view.transmission-detail-dark .card{
    border-color:rgba(71,85,105,.55);
}

.transmission-detail-view.transmission-detail-dark input[type="text"],
.transmission-detail-view.transmission-detail-dark input[type="email"],
.transmission-detail-view.transmission-detail-dark input[type="password"],
.transmission-detail-view.transmission-detail-dark input[type="date"],
.transmission-detail-view.transmission-detail-dark select,
.transmission-detail-view.transmission-detail-dark textarea{
    background:rgba(15,23,42,.75);
    border-color:rgba(71,85,105,.55);
    color:#e5e7eb;
}

.transmission-detail-view.transmission-detail-dark input::placeholder,
.transmission-detail-view.transmission-detail-dark textarea::placeholder{
    color:#94a3b8;
}

.transmission-detail-view.transmission-detail-dark select{
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat:no-repeat;
    background-position:right 10px center;
}

.transmission-detail-view.transmission-detail-dark input:focus,
.transmission-detail-view.transmission-detail-dark select:focus,
.transmission-detail-view.transmission-detail-dark textarea:focus{
    border-color:rgba(96,165,250,.85);
    box-shadow:0 0 0 1px rgba(96,165,250,.55);
    background:rgba(30,41,59,.85);
}

.transmission-detail-view.transmission-detail-dark .btn-ghost{
    border-color:rgba(71,85,105,.7);
    color:#cbd5e1;
    background:rgba(30,41,59,.55);
}

.transmission-detail-view.transmission-detail-dark .btn-ghost:hover{
    background:rgba(51,65,85,.7);
}

.transmission-detail-view.transmission-detail-dark .btn-primary{
    background:linear-gradient(135deg,#1d4ed8,#1e40af);
    color:#f8fafc;
    box-shadow:0 10px 30px rgba(30,64,175,.45);
}

.transmission-view.transmission-create-dark{
    --bg:#020617;
    --card:#0b1220;
    --text:#e5e7eb;
    --muted:#9ca3af;
    --border:#1f2937;
    --shadow:0 18px 50px rgba(0,0,0,.35);
    border:1px solid rgba(71,85,105,.5);
    border-radius:16px;
    padding:14px;
    background:radial-gradient(circle at top left,rgba(51,65,85,.32) 0,rgba(2,6,23,.94) 62%,#020617 100%);
}

.transmission-view.transmission-create-dark,
.transmission-view.transmission-create-dark .card-title,
.transmission-view.transmission-create-dark .it-title,
.transmission-view.transmission-create-dark .it-text,
.transmission-view.transmission-create-dark .tag,
.transmission-view.transmission-create-dark .pill,
.transmission-view.transmission-create-dark strong{
    color:#e5e7eb;
}

.transmission-view.transmission-create-dark .it-meta,
.transmission-view.transmission-create-dark .card-sub,
.transmission-view.transmission-create-dark .field label,
.transmission-view.transmission-create-dark .muted{
    color:#cbd5e1;
}

.transmission-view.transmission-create-dark .card,
.transmission-view.transmission-create-dark .item,
.transmission-view.transmission-create-dark .tag,
.transmission-view.transmission-create-dark .pill,
.transmission-view.transmission-create-dark .transmission-note-box,
.transmission-view.transmission-create-dark .transmission-patient-preview{
    background:rgba(15,23,42,.62);
}

.transmission-view.transmission-create-dark .card,
.transmission-view.transmission-create-dark .item,
.transmission-view.transmission-create-dark .transmission-note-box,
.transmission-view.transmission-create-dark .transmission-patient-preview{
    border-color:rgba(71,85,105,.55);
}

.transmission-view.transmission-create-dark input[type="text"],
.transmission-view.transmission-create-dark input[type="email"],
.transmission-view.transmission-create-dark input[type="password"],
.transmission-view.transmission-create-dark input[type="date"],
.transmission-view.transmission-create-dark input[type="tel"],
.transmission-view.transmission-create-dark select,
.transmission-view.transmission-create-dark textarea{
    background:rgba(15,23,42,.75);
    border-color:rgba(71,85,105,.55);
    color:#e5e7eb;
}

.transmission-view.transmission-create-dark input::placeholder,
.transmission-view.transmission-create-dark textarea::placeholder{
    color:#94a3b8;
}

.transmission-view.transmission-create-dark select{
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat:no-repeat;
    background-position:right 10px center;
}

.transmission-view.transmission-create-dark input:focus,
.transmission-view.transmission-create-dark select:focus,
.transmission-view.transmission-create-dark textarea:focus{
    border-color:rgba(96,165,250,.85);
    box-shadow:0 0 0 1px rgba(96,165,250,.55);
    background:rgba(30,41,59,.85);
}

.transmission-view.transmission-create-dark .btn-ghost{
    border-color:rgba(71,85,105,.7);
    color:#cbd5e1;
    background:rgba(30,41,59,.55);
}

.transmission-view.transmission-create-dark .btn-ghost:hover{
    background:rgba(51,65,85,.7);
}

.transmission-view.transmission-create-dark .btn-primary{
    background:linear-gradient(135deg,#1d4ed8,#1e40af);
    color:#f8fafc;
    box-shadow:0 10px 30px rgba(30,64,175,.45);
}

.transmission-view.transmission-create-dark .btn-secondary{
    border:1px solid rgba(71,85,105,.7);
    color:#cbd5e1;
    background:rgba(30,41,59,.55);
}

.transmission-view.transmission-create-dark .btn-secondary:hover{
    background:rgba(51,65,85,.7);
}

.transmission-view.transmission-create-dark{
    scrollbar-color:#334155 #0f172a;
    scrollbar-width:thin;
}

.transmission-view.transmission-create-dark::-webkit-scrollbar{
    width:10px;
}

.transmission-view.transmission-create-dark::-webkit-scrollbar-track{
    background:#0f172a;
    border-radius:10px;
}

.transmission-view.transmission-create-dark::-webkit-scrollbar-thumb{
    background:linear-gradient(180deg,#334155,#1e293b);
    border:1px solid #475569;
    border-radius:10px;
}

.transmission-view.transmission-create-dark::-webkit-scrollbar-thumb:hover{
    background:linear-gradient(180deg,#475569,#334155);
}

.transmission-view.transmission-create-dark .list{
    scrollbar-color:#334155 #0f172a;
    scrollbar-width:thin;
}

.transmission-view.transmission-create-dark .list::-webkit-scrollbar{
    width:10px;
}

.transmission-view.transmission-create-dark .list::-webkit-scrollbar-track{
    background:#0f172a;
    border-radius:10px;
}

.transmission-view.transmission-create-dark .list::-webkit-scrollbar-thumb{
    background:linear-gradient(180deg,#334155,#1e293b);
    border:1px solid #475569;
    border-radius:10px;
}

.transmission-view.transmission-create-dark .list::-webkit-scrollbar-thumb:hover{
    background:linear-gradient(180deg,#475569,#334155);
}

/* ESTABLISHMENTS LIST */
.establishments-main{
    min-height:0;
    display:flex;
    flex-direction:column;
    gap:12px;
}

#view-establishments.establishments-page{
    min-height:0;
    overflow:hidden;
    padding-right:0;
}
.establishments-card{
    display:flex;
    flex-direction:column;
    min-height:0;
    overflow:hidden;
}
.establishments-list{
    flex:1;
    min-height:0;
    max-height:none;
    overflow:auto;
    padding-right:2px;
}
.establishment-item{
    width:100%;
}
.establishments-tags{
    margin-top:4px;
    margin-bottom:6px;
}
.establishments-actions{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    align-items:center;
}
.establishments-toolbar{
    display:flex;
    gap:8px;
    align-items:center;
    flex-wrap:wrap;
}
.establishments-actions .btn:last-child{
    margin-left:auto;
}

.establishments-page.establishments-dark{
    --bg:#020617;
    --card:#0b1220;
    --text:#e5e7eb;
    --muted:#9ca3af;
    --border:#1f2937;
    --shadow:0 18px 50px rgba(0,0,0,.35);
    border:1px solid rgba(71,85,105,.5);
    border-radius:16px;
    padding:14px;
    background:radial-gradient(circle at top left,rgba(51,65,85,.32) 0,rgba(2,6,23,.94) 62%,#020617 100%);
}

.establishments-main.establishments-main-dark .topbar,
.establishments-main.establishments-main-dark .topbar .title,
.establishments-main.establishments-main-dark .topbar .title span,
.establishments-main.establishments-main-dark .topbar .title small{
    color:#e5e7eb;
}

.main.establishments-main-dark{
    background:radial-gradient(circle at top left,rgba(2,6,23,.98) 0,rgba(2,6,23,.98) 38%,#01040c 100%);
}

.establishments-page.establishments-dark,
.establishments-page.establishments-dark .title,
.establishments-page.establishments-dark .title span,
.establishments-page.establishments-dark .card-title,
.establishments-page.establishments-dark .it-title,
.establishments-page.establishments-dark .it-text,
.establishments-page.establishments-dark .tag,
.establishments-page.establishments-dark .pill,
.establishments-page.establishments-dark strong{
    color:#e5e7eb;
}

.establishments-page.establishments-dark .it-meta,
.establishments-page.establishments-dark .card-sub,
.establishments-page.establishments-dark .field label,
.establishments-page.establishments-dark .title small,
.establishments-page.establishments-dark .muted{
    color:#cbd5e1;
}

.establishments-page.establishments-dark .card,
.establishments-page.establishments-dark .item,
.establishments-page.establishments-dark .tag,
.establishments-page.establishments-dark .pill{
    background:rgba(15,23,42,.62);
}

.establishments-page.establishments-dark .item,
.establishments-page.establishments-dark .card{
    border-color:rgba(71,85,105,.55);
}

.establishments-page.establishments-dark input[type="text"],
.establishments-page.establishments-dark input[type="email"],
.establishments-page.establishments-dark input[type="password"],
.establishments-page.establishments-dark input[type="date"],
.establishments-page.establishments-dark select,
.establishments-page.establishments-dark textarea{
    background:rgba(15,23,42,.75);
    border-color:rgba(71,85,105,.55);
    color:#e5e7eb;
}

.establishments-page.establishments-dark input::placeholder,
.establishments-page.establishments-dark textarea::placeholder{
    color:#94a3b8;
}

.establishments-page.establishments-dark .btn-ghost{
    border-color:rgba(71,85,105,.7);
    color:#cbd5e1;
    background:rgba(30,41,59,.55);
}

.establishments-page.establishments-dark .btn-ghost:hover{
    background:rgba(51,65,85,.7);
}

.establishments-page.establishments-dark .establishments-list{
    scrollbar-color:#334155 #0f172a;
    scrollbar-width:thin;
}

.establishments-page.establishments-dark .establishments-list::-webkit-scrollbar{
    width:10px;
}

.establishments-page.establishments-dark .establishments-list::-webkit-scrollbar-track{
    background:#0f172a;
    border-radius:10px;
}

.establishments-page.establishments-dark .establishments-list::-webkit-scrollbar-thumb{
    background:linear-gradient(180deg,#334155,#1e293b);
    border:1px solid #475569;
    border-radius:10px;
}

.establishments-page.establishments-dark .establishments-list::-webkit-scrollbar-thumb:hover{
    background:linear-gradient(180deg,#475569,#334155);
}

/* ADMIN DASHBOARD */
.admin-dashboard-page{
    display:flex;
    flex-direction:column;
    gap:12px;
    box-shadow:none;
    border:none;
    background:transparent;
}

.admin-dashboard-page .card{
    box-shadow:none;
}

.admin-status-banner{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    border-radius:16px;
}

.admin-status-active{
    border-color:rgba(34,197,94,.38);
    background:linear-gradient(135deg,rgba(240,253,244,.9),rgba(236,253,245,.95));
}

.admin-status-suspended{
    border-color:rgba(239,68,68,.38);
    background:linear-gradient(135deg,rgba(254,242,242,.9),rgba(255,241,242,.95));
}

.admin-status-pending{
    border-color:rgba(245,158,11,.4);
    background:linear-gradient(135deg,rgba(255,251,235,.9),rgba(254,249,195,.9));
}

.admin-status-chip{
    border:1px solid rgba(15,23,42,.16);
    border-radius:999px;
    padding:6px 12px;
    font-size:12px;
    font-weight:700;
    background:#ffffffcc;
}

.admin-manage-btn{
    border:1px solid rgba(14,116,144,.45);
    color:#0f766e;
    background:linear-gradient(135deg,rgba(204,251,241,.95),rgba(153,246,228,.9));
    font-weight:700;
    box-shadow:0 8px 20px rgba(20,184,166,.18);
}

.admin-manage-btn:hover{
    background:linear-gradient(135deg,rgba(167,243,208,.95),rgba(110,231,183,.9));
    box-shadow:0 12px 24px rgba(5,150,105,.24);
    transform:translateY(-1px);
}

.admin-dashboard-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:10px;
}

.admin-kpi-card{
    display:flex;
    flex-direction:column;
    gap:6px;
    min-height:124px;
}

.admin-kpi-card-link{
    text-decoration:none;
    color:inherit;
    cursor:pointer;
    transition:transform .12s ease,box-shadow .12s ease,border-color .12s ease;
}

.admin-kpi-card-link:hover{
    transform:translateY(-2px);
    border-color:rgba(14,116,144,.35);
    box-shadow:0 10px 24px rgba(15,23,42,.10);
}

.admin-kpi-value{
    font-size:28px;
    font-weight:800;
    color:#0f172a;
    line-height:1.1;
}

.admin-progress-track{
    width:100%;
    height:8px;
    border-radius:999px;
    background:rgba(148,163,184,.24);
    overflow:hidden;
}

.admin-progress-fill{
    height:100%;
    border-radius:999px;
    background:linear-gradient(135deg,#0284c7,#14b8a6);
}

.admin-dashboard-lower-grid{
    grid-template-columns:minmax(0,1.35fr) minmax(0,1fr);
}

.admin-chart-card{
    background:
        radial-gradient(circle at 90% 8%,rgba(14,165,233,.12),transparent 34%),
        linear-gradient(180deg,rgba(255,255,255,.96),rgba(248,250,252,.95));
}

.admin-chart-nav{
    display:flex;
    gap:6px;
    flex-wrap:wrap;
    justify-content:flex-end;
}


.admin-chart-layout{
    display:grid;
    grid-template-columns:34px minmax(0,1fr);
    gap:8px;
    align-items:stretch;
}

.admin-chart-y-axis{
    height:220px;
    display:flex;
    flex-direction:column;
    justify-content:space-between;
    align-items:flex-end;
    color:#64748b;
    font-size:11px;
    padding-top:2px;
}

.admin-chart-bars{
    height:220px;
    border:1px solid rgba(148,163,184,.28);
    border-radius:14px;
    padding:12px 10px 0;
    display:grid;
    grid-template-columns:repeat(7,minmax(0,1fr));
    gap:8px;
    align-items:end;
    border-left-width:2px;
    background:
        repeating-linear-gradient(
            to top,
            rgba(148,163,184,.22) 0,
            rgba(148,163,184,.22) 1px,
            transparent 1px,
            transparent 20%
        ),
        linear-gradient(180deg,rgba(241,245,249,.72),rgba(255,255,255,.9));
}

.admin-chart-bars-wrapper{
    display:flex;
    flex-direction:column;
    gap:8px;
}
.admin-chart-col{
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:flex-end;
    gap:4px;
    min-height:0;
    height:100%;
}
.admin-chart-labels{
    display:grid;
    grid-template-columns:repeat(7,minmax(0,1fr));
    gap:8px;
    padding:0 10px;
}
.admin-chart-label-col{
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:2px;
}

.admin-chart-bar{
    width:14px;
    min-height:0;
    border-radius:4px 4px 2px 2px;
    background:linear-gradient(180deg,#06b6d4,#2563eb);
    box-shadow:0 6px 14px rgba(37,99,235,.22);
    transition:height .2s ease;
}

.admin-chart-value{
    font-size:11px;
    font-weight:700;
    color:#0f172a;
}

.admin-chart-label{
    font-size:11px;
    color:#64748b;
    text-transform:capitalize;
    line-height:1;
}

.admin-chart-date{
    font-size:10px;
    color:#94a3b8;
    line-height:1;
}

.admin-insights-card{
    background:linear-gradient(180deg,rgba(255,255,255,.96),rgba(248,250,252,.95));
}

.admin-insights-list{
    display:flex;
    flex-direction:column;
    gap:8px;
}

.admin-insight-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    border:1px solid rgba(148,163,184,.28);
    border-radius:12px;
    padding:10px;
    background:rgba(248,250,252,.72);
}

.admin-insight-row strong{
    color:#0f172a;
}

.admin-dashboard-page.admin-dashboard-light{
    border:1px solid rgba(148,163,184,.26);
    border-radius:16px;
    padding:14px;
    background:
        radial-gradient(circle at 8% 0%,rgba(37,99,235,.08),transparent 38%),
        radial-gradient(circle at 92% 18%,rgba(20,184,166,.07),transparent 34%),
        linear-gradient(180deg,rgba(255,255,255,.92),rgba(248,250,252,.86));
}

.dashboard-shell-dark{
    --bg:#020617;
    --card:#0b1220;
    --text:#e5e7eb;
    --muted:#9ca3af;
    --border:#1f2937;
    --shadow:0 18px 50px rgba(0,0,0,.35);
}

.admin-dashboard-page.admin-dashboard-dark{
    --bg:#020617;
    --card:#0b1220;
    --text:#e5e7eb;
    --muted:#9ca3af;
    --border:#1f2937;
    --shadow:0 18px 50px rgba(0,0,0,.35);
    border:1px solid rgba(71,85,105,.5);
    border-radius:16px;
    padding:14px;
    background:radial-gradient(circle at top left,rgba(51,65,85,.32) 0,rgba(2,6,23,.94) 62%,#020617 100%);
    scrollbar-color:#334155 #0f172a;
    scrollbar-width:thin;
}

.admin-dashboard-page.admin-dashboard-dark::-webkit-scrollbar{
    width:10px;
}

.admin-dashboard-page.admin-dashboard-dark::-webkit-scrollbar-track{
    background:#0f172a;
    border-radius:10px;
}

.admin-dashboard-page.admin-dashboard-dark::-webkit-scrollbar-thumb{
    background:linear-gradient(180deg,#334155,#1e293b);
    border:1px solid #475569;
    border-radius:10px;
}

.admin-dashboard-page.admin-dashboard-dark::-webkit-scrollbar-thumb:hover{
    background:linear-gradient(180deg,#475569,#334155);
}

.admin-dashboard-page.admin-dashboard-dark,
.admin-dashboard-page.admin-dashboard-dark .title,
.admin-dashboard-page.admin-dashboard-dark .title span,
.admin-dashboard-page.admin-dashboard-dark .card-title,
.admin-dashboard-page.admin-dashboard-dark .it-title,
.admin-dashboard-page.admin-dashboard-dark .it-text,
.admin-dashboard-page.admin-dashboard-dark .tag,
.admin-dashboard-page.admin-dashboard-dark .pill,
.admin-dashboard-page.admin-dashboard-dark strong{
    color:#e5e7eb;
}

.admin-dashboard-page.admin-dashboard-dark .title small,
.admin-dashboard-page.admin-dashboard-dark .it-meta,
.admin-dashboard-page.admin-dashboard-dark .card-sub,
.admin-dashboard-page.admin-dashboard-dark .field label,
.admin-dashboard-page.admin-dashboard-dark .muted,
.admin-dashboard-page.admin-dashboard-dark .admin-chart-y-axis,
.admin-dashboard-page.admin-dashboard-dark .admin-chart-label,
.admin-dashboard-page.admin-dashboard-dark .admin-chart-date{
    color:#cbd5e1;
}

.admin-dashboard-page.admin-dashboard-dark .card,
.admin-dashboard-page.admin-dashboard-dark .item,
.admin-dashboard-page.admin-dashboard-dark .tag,
.admin-dashboard-page.admin-dashboard-dark .pill,
.admin-dashboard-page.admin-dashboard-dark .admin-status-chip,
.admin-dashboard-page.admin-dashboard-dark .admin-insight-row,
.admin-dashboard-page.admin-dashboard-dark .admin-progress-track,
.admin-dashboard-page.admin-dashboard-dark .admin-chart-bars,
.admin-dashboard-page.admin-dashboard-dark .admin-chart-card,
.admin-dashboard-page.admin-dashboard-dark .admin-insights-card{
    background:rgba(15,23,42,.62);
}

.admin-dashboard-page.admin-dashboard-dark .card,
.admin-dashboard-page.admin-dashboard-dark .item,
.admin-dashboard-page.admin-dashboard-dark .tag,
.admin-dashboard-page.admin-dashboard-dark .pill,
.admin-dashboard-page.admin-dashboard-dark .admin-status-chip,
.admin-dashboard-page.admin-dashboard-dark .admin-insight-row,
.admin-dashboard-page.admin-dashboard-dark .admin-chart-bars,
.admin-dashboard-page.admin-dashboard-dark .admin-kpi-card-link:hover{
    border-color:rgba(71,85,105,.55);
}

.admin-dashboard-page.admin-dashboard-dark .btn-ghost{
    border-color:rgba(71,85,105,.7);
    color:#cbd5e1;
    background:rgba(30,41,59,.55);
}

.admin-dashboard-page.admin-dashboard-dark .btn-ghost:hover{
    background:rgba(51,65,85,.7);
}

.admin-dashboard-page.admin-dashboard-dark .btn-primary,
.admin-dashboard-page.admin-dashboard-dark .admin-manage-btn{
    background:linear-gradient(135deg,#1d4ed8,#1e40af);
    color:#f8fafc;
    box-shadow:0 10px 30px rgba(30,64,175,.45);
}

.admin-dashboard-page.admin-dashboard-dark .admin-status-active,
.admin-dashboard-page.admin-dashboard-dark .admin-status-pending,
.admin-dashboard-page.admin-dashboard-dark .admin-status-suspended{
    border-color:rgba(71,85,105,.55);
    background:rgba(30,41,59,.65);
}

.admin-dashboard-page.admin-dashboard-dark .admin-kpi-value,
.admin-dashboard-page.admin-dashboard-dark .admin-chart-value,
.admin-dashboard-page.admin-dashboard-dark .admin-insight-row strong{
    color:#e5e7eb;
}

.admin-dashboard-page.admin-dashboard-dark .admin-progress-track{
    background:rgba(51,65,85,.65);
}

.admin-dashboard-page.admin-dashboard-dark .admin-progress-fill,
.admin-dashboard-page.admin-dashboard-dark .admin-chart-bar{
    background:linear-gradient(180deg,#38bdf8,#2563eb);
}

.admin-dashboard-page.admin-dashboard-dark .admin-chart-bars{
    background:
        repeating-linear-gradient(
            to top,
            rgba(71,85,105,.36) 0,
            rgba(71,85,105,.36) 1px,
            transparent 1px,
            transparent 25%
        ),
        linear-gradient(180deg,rgba(30,41,59,.72),rgba(15,23,42,.88));
}

/* PATIENTS */
.patients-page{
    min-height:0;
    display:flex;
    flex-direction:column;
    gap:12px;
    padding:10px;
    border-radius:20px;
    border:1px solid rgba(148,163,184,.26);
    box-shadow:0 18px 40px rgba(15,23,42,.08);
    background:
        radial-gradient(circle at 8% 0%,rgba(37,99,235,.08),transparent 38%),
        radial-gradient(circle at 92% 18%,rgba(20,184,166,.07),transparent 34%),
        linear-gradient(180deg,rgba(255,255,255,.92),rgba(248,250,252,.86));
}

.patients-title-chip{
    padding:10px 14px;
    border-radius:16px;
    border:1px solid rgba(148,163,184,.30);
    background:linear-gradient(135deg,rgba(255,255,255,.94),rgba(241,245,249,.88));
    box-shadow:0 8px 16px rgba(15,23,42,.06);
    overflow:hidden;
}

.patients-list-card{
    display:flex;
    flex-direction:column;
    flex:1;
    min-height:420px;
    border-radius:20px;
    border:1px solid rgba(148,163,184,.34);
    box-shadow:0 22px 48px rgba(15,23,42,.12);
}

.patients-list{
    flex:1;
    min-height:0;
    max-height:none;
    overflow:auto;
    padding-right:2px;
}

.patients-list .item{
    border-radius:14px;
    border:1px solid rgba(148,163,184,.28);
    background:linear-gradient(180deg,rgba(255,255,255,.92),rgba(248,250,252,.88));
}

.patients-item{
    position:relative;
}

.patients-item::before{
    content:'';
    position:absolute;
    left:0;
    top:10px;
    bottom:10px;
    width:4px;
    border-radius:999px;
    background:rgba(14,116,144,.28);
}

.patients-item-urgent::before{
    background:rgba(220,38,38,.42);
}

.patients-identity-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    flex-wrap:wrap;
}

.patients-identity-tags{
    display:flex;
    gap:6px;
    flex-wrap:wrap;
    justify-content:flex-end;
}

.patients-identity-tags .tag{
    background:rgba(248,250,252,.9);
}

.patients-secondary-row{
    margin-top:8px;
    padding-top:8px;
    border-top:1px dashed rgba(148,163,184,.36);
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:10px;
    flex-wrap:wrap;
}

.patients-btn-edit{
    border:1px solid rgba(148,163,184,.42);
    color:#0f172a;
    background:linear-gradient(135deg,rgba(240,249,255,.92),rgba(224,242,254,.9));
    font-weight:650;
}

.patients-btn-edit:hover{
    background:linear-gradient(135deg,rgba(224,242,254,.95),rgba(207,250,254,.95));
    box-shadow:0 8px 20px rgba(14,165,233,.18);
}

.patients-btn-edit:disabled{
    opacity:.55;
    cursor:not-allowed;
}

.patients-item-actions{
    display:flex;
    gap:8px;
    margin-top:8px;
    flex-wrap:wrap;
}

.patients-item-actions .btn{
    padding:5px 10px;
    font-size:12px;
    border-radius:12px;
}

.patients-btn-delete-inline{
    border:1px solid rgba(220,38,38,.36);
    color:#991b1b;
    background:linear-gradient(135deg,rgba(254,242,242,.95),rgba(254,226,226,.92));
    font-weight:600;
}

.patients-btn-delete-inline:hover{
    background:linear-gradient(135deg,rgba(254,226,226,.98),rgba(254,202,202,.94));
}

.patients-actions-row{
    display:flex;
    justify-content:flex-end;
    gap:8px;
    margin-top:8px;
    flex-wrap:wrap;
}

.patients-btn-delete{
    border:1px solid rgba(185,28,28,.38);
    color:#991b1b;
    background:linear-gradient(135deg,rgba(254,226,226,.80),rgba(254,242,242,.90));
    font-weight:600;
}

.patients-btn-delete:hover{
    background:linear-gradient(135deg,rgba(254,202,202,.88),rgba(254,226,226,.95));
}

.patients-modal-backdrop{
    position:fixed;
    inset:0;
    z-index:80;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:18px;
    background:rgba(2,6,23,.56);
    backdrop-filter:blur(3px);
}

.patients-modal-card{
    width:min(980px,100%);
    max-height:90vh;
    overflow:hidden;
    display:flex;
    flex-direction:column;
    border:1px solid rgba(148,163,184,.36);
    border-radius:22px;
    padding:16px;
    background:
        linear-gradient(180deg,rgba(255,255,255,.98),rgba(248,250,252,.98));
    box-shadow:0 30px 70px rgba(2,6,23,.32),0 0 0 1px rgba(148,163,184,.18) inset;
}

.patients-modal-scroll{
    overflow:auto;
    max-height:calc(90vh - 120px);
    border-radius:16px;
    overflow-x:hidden;
    background:rgba(255,255,255,.45);
    box-shadow:inset 0 0 0 1px rgba(226,232,240,.65);
    padding-right:4px;
    scrollbar-color:rgba(148,163,184,.8) transparent;
    scrollbar-width:auto;
}

.patients-modal-scroll::-webkit-scrollbar{
    width:12px;
}

.patients-modal-scroll::-webkit-scrollbar-thumb{
    background:rgba(148,163,184,.72);
    border-radius:999px;
    border:3px solid transparent;
    background-clip:content-box;
}

.patients-modal-scroll::-webkit-scrollbar-track{
    background:transparent;
}

.patients-delete-modal{
    width:min(520px,100%);
}

.patients-delete-message{
    margin-top:6px;
    padding:10px 12px;
    border-radius:12px;
    border:1px solid rgba(254,202,202,.8);
    background:rgba(254,242,242,.9);
    color:#7f1d1d;
    font-weight:600;
}

.patients-modal-card select,
.patients-page select{
    border-color:rgba(14,116,144,.42);
    background-color:rgba(240,253,250,.92);
    border-radius:12px;
}

.patients-modal-card select:focus,
.patients-page select:focus{
    border-color:#0f766e;
    box-shadow:0 0 0 2px rgba(15,118,110,.25);
}

.patients-page .item,
.patients-modal-card .field input,
.patients-modal-card .field textarea,
.patients-modal-card .field select{
    border-radius:12px;
}

.patients-inline-meta{
    display:flex;
    flex-wrap:wrap;
    gap:6px;
}

.patients-inline-meta .tag{
    border-radius:999px;
    background:rgba(15,23,42,.02);
}

.patients-stats-inline{
    display:flex;
    gap:6px;
    flex-wrap:wrap;
    justify-content:flex-end;
}

.patients-pill{
    font-size:11px;
    border-radius:999px;
    padding:4px 8px;
    border:1px solid rgba(148,163,184,.35);
    color:#334155;
    background:rgba(241,245,249,.85);
    font-weight:600;
}

.patients-pill-urgent{
    border-color:rgba(239,68,68,.45);
    color:#991b1b;
    background:rgba(254,242,242,.92);
}

.patients-info-groups{
    margin-top:8px;
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px;
}

.patients-info-group{
    border:1px solid rgba(148,163,184,.28);
    border-radius:12px;
    padding:8px;
    background:rgba(248,250,252,.72);
}

.patients-info-title{
    font-size:11px;
    font-weight:700;
    color:#334155;
    margin-bottom:6px;
    text-transform:uppercase;
    letter-spacing:.03em;
}

.patients-stats-grid{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:6px;
}

.patients-stat-box{
    border:1px solid rgba(148,163,184,.25);
    border-radius:10px;
    background:rgba(255,255,255,.85);
    padding:6px;
    display:flex;
    flex-direction:column;
    gap:2px;
    align-items:center;
}

.patients-stat-box-urgent{
    border-color:rgba(239,68,68,.4);
    background:rgba(254,242,242,.9);
}

.patients-stat-label{
    font-size:10px;
    color:#64748b;
}

.patients-stat-value{
    font-size:13px;
    font-weight:700;
    color:#0f172a;
}

.patients-form-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
}

.patients-field-full{
    grid-column:1 / -1;
}

.patients-form-grid textarea{
    min-height:86px;
}

.patients-details-modal{
    width:min(860px,100%);
}

.patients-details-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
}

.patients-detail-row{
    border:1px solid rgba(148,163,184,.34);
    border-radius:14px;
    padding:10px;
    background:rgba(255,255,255,.9);
}

.patients-detail-label{
    font-size:11px;
    color:var(--muted);
    margin-bottom:3px;
}

.patients-detail-value{
    font-size:13px;
    color:var(--text);
    line-height:1.35;
    word-break:break-word;
}

/* PROFILE */
.profile-page.profile-light{
    border:1px solid rgba(148,163,184,.26);
    border-radius:16px;
    padding:14px;
    background:
        radial-gradient(circle at 8% 0%,rgba(37,99,235,.08),transparent 38%),
        radial-gradient(circle at 92% 18%,rgba(20,184,166,.07),transparent 34%),
        linear-gradient(180deg,rgba(255,255,255,.92),rgba(248,250,252,.86));
}

.profile-password-grid .field{
    min-width:220px;
}

.profile-password-feedback{
    margin-top:4px;
    margin-bottom:10px;
    padding:8px 10px;
    border-radius:10px;
    font-size:12px;
    border:1px solid transparent;
}

.profile-password-feedback-error{
    border-color:rgba(248,113,113,.45);
    color:#b91c1c;
    background:rgba(254,226,226,.65);
}

.profile-password-feedback-success{
    border-color:rgba(74,222,128,.45);
    color:#166534;
    background:rgba(220,252,231,.65);
}

.profile-password-actions{
    display:flex;
    justify-content:center;
}

.profile-page.profile-dark{
    --bg:#020617;
    --card:#0b1220;
    --text:#e5e7eb;
    --muted:#9ca3af;
    --border:#1f2937;
    --shadow:0 18px 50px rgba(0,0,0,.35);
    border:1px solid rgba(71,85,105,.5);
    border-radius:16px;
    padding:14px;
    background:radial-gradient(circle at top left,rgba(51,65,85,.32) 0,rgba(2,6,23,.94) 62%,#020617 100%);
}

.profile-page.profile-dark,
.profile-page.profile-dark .title,
.profile-page.profile-dark .title span,
.profile-page.profile-dark .card-title,
.profile-page.profile-dark .it-title,
.profile-page.profile-dark .it-text,
.profile-page.profile-dark .tag,
.profile-page.profile-dark .pill,
.profile-page.profile-dark strong{
    color:#e5e7eb;
}

.profile-page.profile-dark .it-meta,
.profile-page.profile-dark .card-sub,
.profile-page.profile-dark .field label,
.profile-page.profile-dark .title small,
.profile-page.profile-dark .muted{
    color:#cbd5e1;
}

.profile-page.profile-dark .card,
.profile-page.profile-dark .item,
.profile-page.profile-dark .tag,
.profile-page.profile-dark .pill{
    background:rgba(15,23,42,.62);
    border-color:rgba(71,85,105,.55);
}

.profile-page.profile-dark input[type="text"],
.profile-page.profile-dark input[type="email"],
.profile-page.profile-dark input[type="password"],
.profile-page.profile-dark input[type="date"],
.profile-page.profile-dark select,
.profile-page.profile-dark textarea{
    background:rgba(15,23,42,.75);
    border-color:rgba(71,85,105,.55);
    color:#e5e7eb;
}

.profile-page.profile-dark input::placeholder,
.profile-page.profile-dark textarea::placeholder{
    color:#94a3b8;
}

.profile-page.profile-dark .btn-ghost{
    border-color:rgba(71,85,105,.7);
    color:#cbd5e1;
    background:rgba(30,41,59,.55);
}

.profile-page.profile-dark .btn-ghost:hover{
    background:rgba(51,65,85,.7);
}

.profile-page.profile-dark .btn-primary{
    background:linear-gradient(135deg,#1d4ed8,#1e40af);
    color:#f8fafc;
    box-shadow:0 10px 30px rgba(30,64,175,.45);
}

.profile-page.profile-dark .profile-password-feedback-error{
    border-color:rgba(248,113,113,.45);
    color:#fecaca;
    background:rgba(127,29,29,.35);
}

.profile-page.profile-dark .profile-password-feedback-success{
    border-color:rgba(74,222,128,.45);
    color:#bbf7d0;
    background:rgba(20,83,45,.35);
}

.profile-page.profile-dark .list{
    scrollbar-color:#334155 #0f172a;
    scrollbar-width:thin;
}

.profile-page.profile-dark .list::-webkit-scrollbar{
    width:10px;
}

.profile-page.profile-dark .list::-webkit-scrollbar-track{
    background:#0f172a;
    border-radius:10px;
}

.profile-page.profile-dark .list::-webkit-scrollbar-thumb{
    background:linear-gradient(180deg,#334155,#1e293b);
    border:1px solid #475569;
    border-radius:10px;
}

.profile-page.profile-dark .list::-webkit-scrollbar-thumb:hover{
    background:linear-gradient(180deg,#475569,#334155);
}

.patients-page.patients-dark{
    --bg:#020617;
    --card:#0b1220;
    --text:#e5e7eb;
    --muted:#9ca3af;
    --border:#1f2937;
    --shadow:0 18px 50px rgba(0,0,0,.35);
    border:1px solid rgba(71,85,105,.5);
    border-radius:16px;
    padding:14px;
    background:radial-gradient(circle at top left,rgba(51,65,85,.32) 0,rgba(2,6,23,.94) 62%,#020617 100%);
    scrollbar-color:#334155 #0f172a;
    scrollbar-width:thin;
}

.patients-page.patients-dark::-webkit-scrollbar{
    width:10px;
}

.patients-page.patients-dark::-webkit-scrollbar-track{
    background:#0f172a;
    border-radius:10px;
}

.patients-page.patients-dark::-webkit-scrollbar-thumb{
    background:linear-gradient(180deg,#334155,#1e293b);
    border:1px solid #475569;
    border-radius:10px;
}

.patients-page.patients-dark::-webkit-scrollbar-thumb:hover{
    background:linear-gradient(180deg,#475569,#334155);
}

.patients-page.patients-dark,
.patients-page.patients-dark .title,
.patients-page.patients-dark .title span,
.patients-page.patients-dark .card-title,
.patients-page.patients-dark .it-title,
.patients-page.patients-dark .it-text,
.patients-page.patients-dark .tag,
.patients-page.patients-dark .pill,
.patients-page.patients-dark strong{
    color:#e5e7eb;
}

.patients-page.patients-dark .title small,
.patients-page.patients-dark .it-meta,
.patients-page.patients-dark .card-sub,
.patients-page.patients-dark .field label,
.patients-page.patients-dark .muted,
.patients-page.patients-dark .patients-detail-label,
.patients-page.patients-dark .patients-stat-label,
.patients-page.patients-dark .patients-info-title{
    color:#cbd5e1;
}

.patients-page.patients-dark .patients-title-chip,
.patients-page.patients-dark .card,
.patients-page.patients-dark .item,
.patients-page.patients-dark .tag,
.patients-page.patients-dark .pill,
.patients-page.patients-dark .patients-list-card,
.patients-page.patients-dark .patients-info-group,
.patients-page.patients-dark .patients-stat-box,
.patients-page.patients-dark .patients-detail-row,
.patients-page.patients-dark .patients-modal-card,
.patients-page.patients-dark .patients-modal-scroll{
    background:rgba(15,23,42,.62);
}

.patients-page.patients-dark .patients-list-card,
.patients-page.patients-dark .patients-title-chip,
.patients-page.patients-dark .item,
.patients-page.patients-dark .card,
.patients-page.patients-dark .tag,
.patients-page.patients-dark .pill,
.patients-page.patients-dark .patients-info-group,
.patients-page.patients-dark .patients-stat-box,
.patients-page.patients-dark .patients-detail-row,
.patients-page.patients-dark .patients-modal-card,
.patients-page.patients-dark .patients-modal-scroll,
.patients-page.patients-dark .patients-delete-message{
    border-color:rgba(71,85,105,.55);
}

.patients-page.patients-dark .patients-list .item,
.patients-page.patients-dark .patients-identity-tags .tag,
.patients-page.patients-dark .patients-inline-meta .tag,
.patients-page.patients-dark .patients-stat-box,
.patients-page.patients-dark .patients-detail-row{
    background:rgba(30,41,59,.72);
}

.patients-page.patients-dark .patients-item::before{
    background:rgba(56,189,248,.45);
}

.patients-page.patients-dark .patients-item-urgent::before{
    background:rgba(248,113,113,.62);
}

.patients-page.patients-dark .patients-secondary-row{
    border-top-color:rgba(71,85,105,.55);
}

.patients-page.patients-dark input[type="text"],
.patients-page.patients-dark input[type="email"],
.patients-page.patients-dark input[type="password"],
.patients-page.patients-dark input[type="date"],
.patients-page.patients-dark select,
.patients-page.patients-dark textarea,
.patients-page.patients-dark .patients-modal-card .field input,
.patients-page.patients-dark .patients-modal-card .field textarea,
.patients-page.patients-dark .patients-modal-card .field select{
    background:rgba(15,23,42,.75);
    border-color:rgba(71,85,105,.55);
    color:#e5e7eb;
}

.patients-page.patients-dark input::placeholder,
.patients-page.patients-dark textarea::placeholder{
    color:#94a3b8;
}

.patients-page.patients-dark select{
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat:no-repeat;
    background-position:right 10px center;
}

.patients-page.patients-dark input:focus,
.patients-page.patients-dark select:focus,
.patients-page.patients-dark textarea:focus,
.patients-page.patients-dark .patients-modal-card select:focus,
.patients-page.patients-dark select:focus{
    border-color:rgba(96,165,250,.85);
    box-shadow:0 0 0 1px rgba(96,165,250,.55);
    background:rgba(30,41,59,.85);
}

.patients-page.patients-dark .btn-ghost{
    border-color:rgba(71,85,105,.7);
    color:#cbd5e1;
    background:rgba(30,41,59,.55);
}

.patients-page.patients-dark .btn-ghost:hover{
    background:rgba(51,65,85,.7);
}

.patients-page.patients-dark .btn-primary{
    background:linear-gradient(135deg,#1d4ed8,#1e40af);
    color:#f8fafc;
    box-shadow:0 10px 30px rgba(30,64,175,.45);
}

.patients-page.patients-dark .patients-btn-edit{
    border-color:rgba(45,212,191,.46);
    color:#99f6e4;
    background:linear-gradient(135deg,rgba(13,148,136,.35),rgba(8,145,178,.30));
}

.patients-page.patients-dark .patients-btn-edit:hover{
    background:linear-gradient(135deg,rgba(13,148,136,.50),rgba(8,145,178,.45));
    box-shadow:0 8px 20px rgba(20,184,166,.2);
}

.patients-page.patients-dark .patients-btn-delete-inline,
.patients-page.patients-dark .patients-btn-delete{
    border-color:rgba(248,113,113,.45);
    color:#fecaca;
    background:linear-gradient(135deg,rgba(127,29,29,.62),rgba(153,27,27,.62));
}

.patients-page.patients-dark .patients-btn-delete-inline:hover,
.patients-page.patients-dark .patients-btn-delete:hover{
    background:linear-gradient(135deg,rgba(153,27,27,.75),rgba(185,28,28,.75));
}

.patients-page.patients-dark .patients-pill{
    border-color:rgba(148,163,184,.45);
    color:#cbd5e1;
    background:rgba(30,41,59,.8);
}

.patients-page.patients-dark .patients-pill-urgent,
.patients-page.patients-dark .patients-stat-box-urgent,
.patients-page.patients-dark .patients-delete-message{
    border-color:rgba(248,113,113,.45);
    color:#fecaca;
    background:rgba(127,29,29,.45);
}

.patients-page.patients-dark .patients-stat-value,
.patients-page.patients-dark .patients-detail-value{
    color:#e5e7eb;
}

.patients-page.patients-dark .patients-modal-card{
    background:linear-gradient(180deg,#111827,#0f172a);
    box-shadow:0 30px 70px rgba(2,6,23,.48),0 0 0 1px rgba(71,85,105,.38) inset;
}

.patients-page.patients-dark .patients-modal-scroll{
    box-shadow:inset 0 0 0 1px rgba(71,85,105,.55);
    scrollbar-color:#334155 #0f172a;
}

.patients-page.patients-dark .patients-list{
    scrollbar-color:#334155 #0f172a;
    scrollbar-width:thin;
}

.patients-page.patients-dark .patients-list::-webkit-scrollbar,
.patients-page.patients-dark .patients-modal-scroll::-webkit-scrollbar{
    width:10px;
}

.patients-page.patients-dark .patients-list::-webkit-scrollbar-track,
.patients-page.patients-dark .patients-modal-scroll::-webkit-scrollbar-track{
    background:#0f172a;
    border-radius:10px;
}

.patients-page.patients-dark .patients-list::-webkit-scrollbar-thumb,
.patients-page.patients-dark .patients-modal-scroll::-webkit-scrollbar-thumb{
    background:linear-gradient(180deg,#334155,#1e293b);
    border:1px solid #475569;
    border-radius:10px;
}

.patients-page.patients-dark .patients-list::-webkit-scrollbar-thumb:hover,
.patients-page.patients-dark .patients-modal-scroll::-webkit-scrollbar-thumb:hover{
    background:linear-gradient(180deg,#475569,#334155);
}

/* RESPONSIVE */
@media(max-width:900px){
    .app{
        flex-direction:column;
        max-height:none;
        min-height:100vh;
        height:auto;
        width:100%;
        border-radius:0;
        overflow:visible;
    }
    .app.app-login{
        width:100vw;
        max-width:none;
        min-height:100vh;
        height:100vh;
        max-height:none;
        box-shadow:none;
        overflow:hidden;
        background:transparent;
    }
    body > main{
        align-items:stretch;
        justify-content:stretch;
    }
    .sidebar{
        width:100%;
        padding:14px 14px 12px;
        gap:12px;
        flex-direction:column;
        align-items:stretch;
    }
    .sidebar-brand{
        width:100%;
        padding:0;
        align-items:center;
    }
    .sidebar-mobile-logout{
        display:inline-flex;
        margin-left:auto;
        flex:0 0 auto;
    }
    .sidebar-nav-section{
        width:100%;
        display:flex;
        flex-direction:column;
        gap:8px;
    }
    .nav-label{
        margin:0;
        text-align:center;
    }
    .nav{
        display:grid;
        grid-template-columns:repeat(2,minmax(0,1fr));
        gap:8px;
    }
    .nav a{
        min-width:0;
        min-height:42px;
        padding:10px 12px;
        justify-content:flex-start;
    }
    .nav button{padding:7px 9px}
    .sidebar-footer{display:none}
    .main{
        min-height:0;
        padding:12px 12px 16px;
        overflow:visible;
    }
    .main.main-login{
        padding:0;
        background:transparent;
    }
    .content{
        min-height:0;
        padding-right:0;
        overflow:visible;
    }
    .topbar{
        flex-direction:column;
        align-items:flex-start;
        gap:10px;
    }
    .title{
        font-size:18px;
        line-height:1.2;
        flex-direction:column;
        align-items:flex-start;
        gap:4px;
    }
    .actions{
        width:100%;
        justify-content:flex-start;
    }
    .actions .btn{
        flex:1 1 calc(50% - 8px);
        justify-content:center;
    }
    .card{
        padding:12px;
    }
    .card-head{
        flex-direction:column;
        align-items:flex-start;
    }
    .form-row{
        margin-bottom:12px;
    }
    .field{
        min-width:0;
    }
    .list{
        max-height:none;
    }
    .item{
        flex-wrap:wrap;
    }
    .grid{grid-template-columns:minmax(0,1fr)}
    .users-list-compact{max-height:30vh}
    .users-manager-page .title{font-size:18px;line-height:1.2;display:flex;flex-direction:column;align-items:flex-start;gap:4px}
    .users-manager-page .topbar{align-items:flex-start;flex-direction:column}
    .users-manager-page .actions{width:100%}
    .users-manager-page .actions .btn{flex:1;justify-content:center}
    .users-form-actions{justify-content:stretch}
    .users-form-actions .btn{width:100%;justify-content:center}
    .establishments-actions .btn{flex:1 1 calc(50% - 8px);justify-content:center}
    .establishments-actions .btn:last-child{margin-left:0}
    .transmission-form-grid{grid-template-columns:1fr}
    .admin-dashboard-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
    .admin-dashboard-lower-grid{grid-template-columns:minmax(0,1fr)}
    .admin-chart-bars{height:180px}
    .admin-chart-y-axis{height:180px}
    .admin-chart-nav{justify-content:stretch}
    .patients-actions-row .btn{flex:1;justify-content:center}
    .patients-form-grid{grid-template-columns:minmax(0,1fr)}
    .patients-details-grid{grid-template-columns:minmax(0,1fr)}
    .patients-secondary-row{flex-direction:column;align-items:flex-start}
    .patients-stats-inline{justify-content:flex-start}
    .patients-info-groups{grid-template-columns:minmax(0,1fr)}
    .patients-stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
    .transmission-view,
    .transmission-list-view,
    .transmission-detail-view,
    .profile-page,
    .patients-page,
    .subscription-admin-page,
    .establishments-page{
        padding:12px;
        border-radius:16px;
    }
    .person-search-control,
    .transmission-recording-actions,
    .transmission-abbreviation-form,
    .transmission-submit-actions,
    .transmission-detail-edit-actions{
        flex-direction:column;
        align-items:stretch;
    }
    .person-search-control .btn,
    .transmission-recording-actions .btn,
    .transmission-abbreviation-form .btn,
    .transmission-submit-actions .btn,
    .transmission-detail-edit-actions .btn{
        width:100%;
        justify-content:center;
    }
    .person-search-results{
        max-height:220px !important;
    }
    .transmission-list-header{
        flex-direction:column;
        align-items:stretch;
    }
    .transmission-list-header > div:last-child{
        width:100%;
    }
    .transmission-list-header > div:last-child .btn,
    .transmission-list-reset-field .btn{
        width:100%;
        justify-content:center;
    }
    .admin-status-banner{
        flex-direction:column;
        align-items:flex-start;
    }
    .admin-status-chip{
        align-self:flex-start;
    }
    .admin-chart-layout{
        grid-template-columns:minmax(0,1fr);
    }
    .admin-chart-y-axis{
        display:none;
    }
    .admin-chart-bars{
        height:200px;
        padding:12px 12px 10px;
    }
    .admin-chart-col{
        gap:4px;
    }
    .transmission-detail-card #transmission-detail-report{
        min-height:260px !important;
    }
    .history-change-diff{
        flex-direction:column;
        align-items:stretch !important;
    }
    .history-diff-arrow{
        text-align:center;
    }
    .history-origin-report{
        min-height:220px;
    }
    .admin-activity-item{
        flex-direction:column;
        align-items:flex-start !important;
    }
    .admin-activity-head{
        flex-wrap:wrap;
    }
    .admin-activity-date{
        white-space:normal !important;
    }
    .establishments-toolbar{
        flex-direction:column;
        align-items:stretch !important;
    }
    .establishments-toolbar input{
        width:100%;
        max-width:none !important;
    }
    .establishments-toolbar .btn{
        width:100%;
        justify-content:center;
    }
    .establishments-actions{
        align-items:stretch;
    }
    .establishments-actions .btn{
        flex:1 1 calc(50% - 8px);
        justify-content:center;
    }
    .subscription-admin-actions-end{
        align-items:stretch;
    }
    .subscription-admin-actions-end .btn{
        width:100%;
        justify-content:center;
    }
    .patients-modal-card{
        padding:14px;
    }
    .patients-modal-scroll{
        max-height:calc(100vh - 180px);
    }
    .login-page{
        min-height:100vh;
        width:100%;
        padding:40px 24px 32px;
        justify-content:center;
        background:var(--bg);
    }
    .login-shell{
        width:100%;
        min-height:100%;
        align-items:stretch;
        justify-content:center;
    }
    .login-card{
        width:100%;
        flex:1;
    }
    .login-card .field{
        min-width:0;
    }
    .login-card h1{
        font-size:34px;
        margin-bottom:8px;
    }
    .login-card .form-row{
        margin-bottom:14px;
    }
    .login-card input,
    .login-card select{
        min-height:48px;
        font-size:16px;
    }
}

@media(max-width:560px){
    .topbar{
        gap:8px;
    }
    .title{
        font-size:17px;
    }
    .actions .btn,
    .actions .pill{
        flex:1 1 100%;
    }
    .card{
        padding:10px;
    }
    .item{
        padding:10px;
    }
    .users-manager-page .card{padding:10px}
    .users-manager-page .it-title{font-size:12px}
    .users-manager-page .it-meta,.users-manager-page .it-text{font-size:11px}
    .establishments-actions .btn{flex:1 1 100%}
    .admin-dashboard-grid{grid-template-columns:minmax(0,1fr)}
    .admin-kpi-value{font-size:24px}
    .admin-status-chip{
        width:100%;
        text-align:center;
        justify-content:center;
    }
    .admin-chart-label,
    .admin-chart-date{
        font-size:10px;
    }
    .patients-identity-tags{
        justify-content:flex-start;
    }
    .patients-item-actions .btn,
    .patients-actions-row .btn{
        width:100%;
        justify-content:center;
    }
    .patients-modal-backdrop{
        padding:12px;
    }
    .patients-modal-card{
        padding:12px;
        border-radius:18px;
    }
    .patients-modal-scroll{
        max-height:calc(100vh - 150px);
    }
    .transmission-view,
    .transmission-list-view,
    .transmission-detail-view,
    .profile-page,
    .patients-page,
    .subscription-admin-page,
    .establishments-page{
        padding:10px;
    }
    .history-origin-report{
        min-height:180px;
    }
    .sidebar{
        padding:14px 12px 10px;
    }
    .sidebar-brand{
        align-items:flex-start;
    }
    .sidebar-mobile-logout{
        margin-left:auto;
    }
    .sidebar-brand .brand-title{
        font-size:15px;
    }
    .sidebar-brand .brand-sub{
        font-size:10px;
        line-height:1.2;
    }
    .nav{
        grid-template-columns:minmax(0,1fr);
    }
    .login-page{
        padding:32px 20px 24px;
    }
    .login-shell{
        gap:18px;
    }
    .login-brand{
        width:100%;
        justify-content:flex-start;
    }
    .login-card h1{
        font-size:32px;
    }
    .login-actions{
        justify-content:stretch;
    }
    .login-submit{
        width:100%;
        justify-content:center;
    }
}

/* ===== LOGIN PAGE: app transparent ===== */
.app:has(.login-page){
    background:transparent;
}
/* Fallback pour navigateurs sans :has() */
.app > .login-page{
    margin:-1px;
}body[data-login-page] .app{
    background:transparent;
    border-radius:0;
    box-shadow:none;
}
@media(max-width:560px){
    body[data-login-page]{
        background:#020617;
    }
    body[data-login-page] .login-page-light{
        background:#f8fafc;
    }
}


/* ========================================================================
   LOGIN MOBILE - OVERRIDE AUTHORITAIRE
   Force tout à être sombre uniforme quand body[data-login-page] est actif.
   ======================================================================== */

body[data-login-page] {
    background: #020617 !important;
}
body[data-login-page] > main,
body[data-login-page] .app,
body[data-login-page] .app.app-login,
body[data-login-page] .main,
body[data-login-page] .main.main-login,
body[data-login-page] .main.main-users-dark,
body[data-login-page] .login-page,
body[data-login-page] .login-page-dark,
body[data-login-page] .login-page-light {
    background: transparent !important;
    box-shadow: none !important;
}
body[data-login-page] .login-page,
body[data-login-page] .login-page-dark,
body[data-login-page] .login-page-light {
    min-height: 100vh !important;
}

@media(max-width:560px){
    body[data-login-page] .app,
    body[data-login-page] .app.app-login {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        min-height: 100vh !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        margin: 0 !important;
    }
    body[data-login-page] .login-shell {
        width: 100% !important;
        max-width: 100% !important;
        padding: 24px 16px;
    }
    body[data-login-page] .login-card {
        width: 100% !important;
        max-width: 100% !important;
    }
    body[data-login-page] .login-card .field {
        min-width: 0 !important;
    }
    body[data-login-page] .login-brand {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    body[data-login-page] .login-brand .brand-badge {
        width: 64px;
        height: 64px;
    }
    body[data-login-page] .login-brand .brand-title {
        color: #e5e7eb !important;
    }
}

@media(max-width:560px){
    body[data-login-page] .login-theme-toggle{
        white-space:nowrap;
        padding:10px 16px;
        font-size:13px;
        border-radius:100px;
        width:auto !important;
        min-width:auto !important;
        flex:0 0 auto !important;
    }
    body[data-login-page] .login-submit{
        white-space:nowrap;
        padding:12px 20px;
        font-size:14px;
        flex:1 1 auto !important;
        min-width:0 !important;
    }
    body[data-login-page] .login-submit span{
        white-space:nowrap;
    }
}


/* ========================================================================
   MOBILE BOTTOM BAR - barre du bas avec icones, visible uniquement mobile
   ======================================================================== */
.mobile-bottom-bar{
    display:none;
}

@media(max-width:560px){
    /* Cacher la sidebar desktop sur mobile */
    .sidebar{
        display:none !important;
    }

    /* Afficher la barre du bas */
    .mobile-bottom-bar{
        display:flex;
        position:fixed;
        bottom:0;
        left:0;
        right:0;
        height:64px;
        padding-bottom:0;
        background:rgba(2,6,23,.95);
        backdrop-filter:blur(20px);
        -webkit-backdrop-filter:blur(20px);
        border-top:1px solid rgba(148,163,184,.2);
        z-index:1000;
        justify-content:space-around;
        align-items:stretch;
    }

    .mobile-bar-link{
        flex:1;
        display:flex;
        flex-direction:column;
        align-items:center;
        justify-content:center;
        gap:4px;
        text-decoration:none;
        color:#94a3b8;
        font-family:inherit;
        padding:8px 4px;
        min-height:48px;
        transition:color 0.15s;
    }

    .mobile-bar-link.active{
        color:#3b82f6;
    }

    .mobile-bar-icon{
        width:22px;
        height:22px;
        display:flex;
        align-items:center;
        justify-content:center;
    }

    .mobile-bar-icon svg{
        width:22px;
        height:22px;
    }

    .mobile-bar-label{
        font-size:10px;
        font-weight:500;
        white-space:nowrap;
    }

    /* Bouton central plus grand */
    .mobile-bar-link-central{
        position:relative;
    }

    .mobile-bar-icon-central{
        width:48px;
        height:48px;
        border-radius:50%;
        background:linear-gradient(180deg,#06b6d4,#2563eb);
        display:flex;
        align-items:center;
        justify-content:center;
        color:white;
        box-shadow:0 4px 12px rgba(37,99,235,.4);
        margin-top:-12px;
    }

    .mobile-bar-icon-central svg{
        width:24px;
        height:24px;
    }

    .mobile-bar-link-central.active .mobile-bar-icon-central{
        box-shadow:0 4px 16px rgba(37,99,235,.6);
        transform:scale(1.05);
    }

    .mobile-bar-link-central .mobile-bar-label{
        color:#3b82f6;
        font-weight:600;
    }

    /* Padding bas pour que le contenu ne soit pas masque par la barre */
    .main{
        padding-bottom:160px !important;
    }
    /* La section content elle-meme doit aussi avoir du padding */
    .content{
        padding-bottom:24px;
    }
}


/* Force hide sidebar on mobile (avec specificite max) */
@media(max-width:560px){
    aside.sidebar,
    .app .sidebar,
    .app.app-login .sidebar,
    body[data-login-page] .sidebar{
        display:none !important;
        visibility:hidden !important;
        width:0 !important;
        height:0 !important;
        overflow:hidden !important;
        position:absolute !important;
        pointer-events:none !important;
    }
}


/* ========================================================================
   MOBILE TOP BAR - boutons logout (gauche) + theme toggle (droite)
   ======================================================================== */
.mobile-top-bar{
    display:none;
}

@media(max-width:560px){
    .mobile-top-bar{
        display:flex;
        position:fixed;
        top:0;
        left:0;
        right:0;
        height:52px;
        padding:0 12px;
        padding-top:env(safe-area-inset-top);
        z-index:999;
        justify-content:space-between;
        align-items:center;
        pointer-events:none;
    }
    .mobile-top-icon-btn{
        width:40px;
        height:40px;
        border-radius:50%;
        display:flex;
        align-items:center;
        justify-content:center;
        background:rgba(15,23,42,.6);
        backdrop-filter:blur(10px);
        -webkit-backdrop-filter:blur(10px);
        border:1px solid rgba(148,163,184,.25);
        color:#e5e7eb;
        cursor:pointer;
        transition:all 0.15s;
        pointer-events:auto;
    }
    .mobile-top-icon-btn svg{
        width:20px;
        height:20px;
    }
    .mobile-top-icon-btn:active{
        transform:scale(0.95);
    }
    .mobile-top-icon-btn:disabled{
        opacity:0.5;
    }
    .mobile-top-logout{
        color:#fca5a5;
    }
    .mobile-top-theme{
        color:#fbbf24;
    }
    /* On cache la version mobile sur la page de login (deja gere) */
    body[data-login-page] .mobile-top-bar{
        display:none;
    }
    /* Padding-top du contenu pour pas etre cache par la top bar */
    .main{
        padding-top:76px !important;
    }
}


/* ========================================================================
   FIX MOBILE: users-manager-grid forced single column on mobile
   ======================================================================== */
@media(max-width:560px){
    .grid.users-manager-grid,
    .users-manager-grid{
        grid-template-columns:minmax(0,1fr) !important;
        gap:12px !important;
    }
    .users-right-column{
        width:100% !important;
        min-width:0 !important;
    }
}


/* ========================================================================
   FIX MOBILE: users-manager-page overflow reset
   Desktop scroll indep par colonne, mobile flux naturel
   ======================================================================== */
@media(max-width:560px){
    .users-manager-page .users-manager-grid{
        overflow:visible !important;
        flex:none !important;
        min-height:auto !important;
    }
    .users-manager-page .users-right-column{
        overflow:visible !important;
        min-height:auto !important;
        padding-right:0 !important;
        width:100% !important;
        max-width:100% !important;
    }
    .users-manager-page .users-columns-card{
        height:auto !important;
        min-height:auto !important;
    }
    .users-manager-page .users-stacked-groups{
        min-height:auto !important;
    }
    .users-manager-page .users-group-admin .users-list-compact,
    .users-manager-page .users-group-coordinateur .users-list-compact,
    .users-manager-page .users-group-soignant .users-list-compact{
        max-height:none !important;
        overflow:visible !important;
    }
    .users-manager-page .users-group-soignant{
        flex:none !important;
    }
}


/* ========================================================================
   FAB Add Soignant - bouton rond flottant en bas-droite
   ======================================================================== */
.fab-add-soignant{
    position:fixed;
    right:20px;
    bottom:90px; /* au-dessus de la barre du bas mobile */
    width:56px;
    height:56px;
    border-radius:50%;
    background:linear-gradient(180deg,#3b82f6,#2563eb);
    border:none;
    color:white;
    display:flex;
    align-items:center;
    justify-content:center;
    box-shadow:0 6px 20px rgba(37,99,235,.5);
    cursor:pointer;
    z-index:998;
    transition:transform 0.15s, box-shadow 0.15s;
}
.fab-add-soignant:hover{
    transform:translateY(-2px);
    box-shadow:0 8px 24px rgba(37,99,235,.6);
}
.fab-add-soignant:active{
    transform:scale(0.95);
}
.fab-add-soignant svg{
    width:26px;
    height:26px;
}

/* Desktop: position en bas-droite, plus pres du bord (pas de barre du bas) */
@media(min-width:561px){
    .fab-add-soignant{
        bottom:24px;
    }
}


/* ========================================================================
   Modale "Ajouter un soignant" (declenchee par le FAB)
   ======================================================================== */
.add-soignant-modal-overlay{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,0.6);
    backdrop-filter:blur(4px);
    -webkit-backdrop-filter:blur(4px);
    z-index:1500;
    display:flex;
    align-items:flex-start;
    justify-content:center;
    padding:20px;
    overflow-y:auto;
}
.add-soignant-modal{
    background:#ffffff;
    border-radius:16px;
    width:100%;
    max-width:560px;
    position:relative;
    box-shadow:0 24px 64px rgba(0,0,0,0.4);
    padding:24px;
    margin:auto;
}
.add-soignant-modal-dark{
    background:#0f172a;
    color:#e5e7eb;
    border:1px solid rgba(148,163,184,0.2);
}
.add-soignant-modal-close{
    position:absolute;
    top:12px;
    right:12px;
    width:36px;
    height:36px;
    border-radius:50%;
    border:1px solid rgba(148,163,184,0.3);
    background:transparent;
    color:inherit;
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:center;
    transition:background 0.15s;
}
.add-soignant-modal-close:hover{
    background:rgba(148,163,184,0.15);
}
.add-soignant-modal-close svg{
    width:18px;
    height:18px;
}
/* Le composant Form a deja sa propre .card, on annule le padding double */
.add-soignant-modal .card{
    border:none;
    background:transparent;
    padding:0;
    box-shadow:none;
}
@media(max-width:560px){
    .add-soignant-modal-overlay{
        padding:0;
        align-items:stretch;
    }
    .add-soignant-modal{
        border-radius:0;
        max-width:100%;
        min-height:100vh;
        padding:60px 16px 100px;
    }
}


/* Hint en haut de la page Mes equipes */
.add-soignant-hint{
    display:flex;
    align-items:center;
    gap:10px;
    padding:10px 14px;
    margin:0 0 12px;
    border:1px solid rgba(59,130,246,0.3);
    background:rgba(59,130,246,0.08);
    color:#1e40af;
    border-radius:10px;
    font-size:13px;
    line-height:1.4;
}
.users-manager-dark .add-soignant-hint{
    color:#bfdbfe;
    background:rgba(59,130,246,0.12);
    border-color:rgba(59,130,246,0.4);
}
.add-soignant-hint svg{
    width:18px;
    height:18px;
    flex-shrink:0;
    color:#3b82f6;
}
.add-soignant-hint strong{
    color:#3b82f6;
    font-weight:700;
}


/* ========================================================================
   MOBILE FIX: content padding-bottom for bar clearance
   Le conteneur .content scroll en interne, il faut son propre padding-bottom
   pour que le dernier element soit au-dessus de la barre du bas
   ======================================================================== */
@media(max-width:560px){
    .content{
        padding-bottom:140px !important;
    }
    .users-manager-page{
        padding-bottom:140px !important;
    }
    .users-right-column{
        padding-bottom:60px;
    }
}

/* Code couleur urgence transmissions (bordure gauche) */
.tp-trans-item { border-left: 4px solid transparent !important; }
.tp-trans-urgent { border-left-color: #dc2626 !important; box-shadow: inset 0 0 0 1px rgba(220,38,38,0.18); }
.tp-trans-important { border-left-color: #ea8a0a !important; box-shadow: inset 0 0 0 1px rgba(234,138,10,0.16); }
.tp-trans-normal { border-left-color: transparent !important; }
.transmissions-list-dark .tp-trans-urgent { border-left-color: #f87171 !important; }
.transmissions-list-dark .tp-trans-important { border-left-color: #fbbf24 !important; }

/* ============================================================
   BLOC MOBILE UNIFIE (<=560px) — refonte propre
   Objectifs : rien ne deborde, boutons compacts, titres degages,
   graphique centre. Remplace les anciens patches empiles.
   ============================================================ */
@media (max-width: 560px) {

  /* --- Garde-fou anti-debordement global --- */
  .content,
  .card,
  .item,
  .topbar,
  .actions {
    max-width: 100%;
    box-sizing: border-box;
  }
  .card { overflow: hidden; }

  /* --- Titres de page : degages du bouton deconnexion flottant --- */
  .topbar .title {
    padding-left: 56px;
    min-height: 44px;
  }

  /* --- Boutons d'action (topbar, patients, modales) : compacts, jamais pleine largeur --- */
  .topbar .actions {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    padding-right: 0;
  }
  .topbar .actions .btn,
  .btn-reset-filters,
  .patients-modal .btn,
  .patients-modal label.btn {
    width: auto !important;
    flex: 0 0 auto !important;
    padding: 8px 14px !important;
    font-size: 13px !important;
    white-space: nowrap;
  }
  .btn-reset-filters { align-self: flex-start; }

  /* --- Graphique : navigation semaine, grille 2 colonnes egales et symetriques --- */
  .admin-chart-nav {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
    padding: 0;
    margin: 0;
  }
  .admin-chart-nav .btn {
    width: auto !important;
    min-width: 0 !important;
    box-sizing: border-box;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px !important;
    font-size: 12.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .admin-chart-card .card-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  /* --- Graphique : barres + labels centres dans le cadre, pas de debordement --- */
  .admin-chart-layout { display: block !important; }
  .admin-chart-y-axis { display: none; }
  .admin-chart-bars-wrapper {
    width: 100%;
    margin: 0;
    transform: none;
  }
  .admin-chart-bars {
    padding-left: 10px !important;
    padding-right: 10px !important;
    border-left-width: 1px !important;
  }
  .admin-chart-labels { padding: 0 10px !important; }
}

/* Modale Import CSV : bouton Televerser compact aussi en desktop */
.patients-modal .btn,
.patients-modal label.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  padding: 9px 16px;
  font-size: 14px;
}

/* Modales plein ecran : passent AU-DESSUS du bouton deconnexion flottant
   (z-index 999) pour ne plus etre chevauchees. */
@media (max-width: 560px) {
  .patients-modal-backdrop,
  .users-modal-backdrop {
    z-index: 1100 !important;
  }
}

/* Modale patient : header avec bouton fermer aligne a droite, titre degage */
.patients-modal-card .card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.patients-modal-close {
  flex: 0 0 auto;
  width: auto !important;
  padding: 7px 14px !important;
  font-size: 13px !important;
  white-space: nowrap;
}

/* Modale patient : Fermer a droite + champs non rognes a gauche */
.patients-modal-card .card-head {
  flex-direction: row;
  flex-wrap: nowrap;
}
.patients-modal-card .card-head > div:first-child {
  flex: 1 1 auto;
  min-width: 0;
}
.patients-modal-scroll {
  padding-left: 2px;
  padding-right: 2px;
}
.patients-modal-card .patients-form-grid .field label {
  padding-left: 2px;
}

/* Guide format CSV dans la modale d'import */
.csv-guide { margin-bottom: 12px; }
.csv-guide-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.csv-guide-content {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(15,23,42,.02);
  font-size: 13px;
  line-height: 1.6;
}
.csv-guide-intro { color: var(--muted); margin-bottom: 12px; }
.csv-guide-block { margin-bottom: 12px; }
.csv-guide-block:last-child { margin-bottom: 0; }
.csv-guide-block strong { display: block; margin-bottom: 6px; }
.csv-guide-block ul { margin: 0; padding-left: 18px; }
.csv-guide-block li { margin-bottom: 3px; }
.csv-guide-optional { color: var(--muted); margin: 0; }
.csv-guide code {
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  background: rgba(37,99,235,.08);
  color: #2563a8;
  padding: 1px 5px;
  border-radius: 4px;
}
.csv-guide-example {
  display: inline-block;
  margin-top: 4px;
  padding: 8px 10px !important;
}
.patients-page.patients-dark .csv-guide-content {
  background: rgba(148,163,184,.06);
  border-color: rgba(148,163,184,.2);
}
.patients-page.patients-dark .csv-guide code { color: #93c5fd; background: rgba(59,130,246,.15); }

/* Modale Import CSV : degager le bas du contenu de la barre de navigation mobile */
@media (max-width: 560px) {
  .patients-modal {
    padding-bottom: 90px;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
  }
}


/* Sprint 18 : Rapport mensuel */
.rapport-mensuel-grid{display:flex;gap:16px;align-items:flex-start}
.rapport-mensuel-historique{flex:0 0 260px}
.rapport-mensuel-contenu{flex:1;min-width:0}
.rapport-mensuel-contenu > div{font-size:14px;word-wrap:break-word;overflow-wrap:break-word}

.rapport-mensuel-notes-grid{
    display:grid;grid-template-columns:repeat(3, 1fr);gap:12px;margin-bottom:8px
}
.rapport-mensuel-note-card{
    border:1px solid var(--border, #e8e5df);border-radius:10px;padding:14px 16px;
    background:rgba(15,23,42,.02)
}
.rapport-mensuel-note-label{font-size:12px;color:var(--muted, #8a8780);margin-bottom:6px}
.rapport-mensuel-note-valeur{font-size:28px;font-weight:700;line-height:1.1;margin-bottom:4px}
.rapport-mensuel-note-detail{font-size:11px;color:var(--muted, #8a8780)}

.rapport-mensuel-dark .rapport-mensuel-note-card{
    background:rgba(255,255,255,.03);border-color:rgba(255,255,255,.08)
}
.rapport-mensuel-dark .rapport-mensuel-note-label,
.rapport-mensuel-dark .rapport-mensuel-note-detail{color:rgba(255,255,255,.55)}
/* Sprint 20 : Pieces jointes */
.pieces-jointes {
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid var(--border, #e8e5df);
}
.pieces-jointes-titre {
	font-size: 14px;
	font-weight: 600;
	margin-bottom: 10px;
}
.pieces-jointes-compteur {
	color: var(--muted, #8a8780);
	font-weight: 400;
}
.pieces-jointes-actions {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-bottom: 12px;
}
.pieces-jointes-btn {
	font-size: 14px;
	font-weight: 600;
	padding: 10px 16px;
	border: 1.5px solid var(--accent, #c15f3c);
	border-radius: 10px;
	background: #fff;
	color: var(--accent, #c15f3c);
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
	display: inline-flex;
	align-items: center;
	gap: 8px;
}
.pieces-jointes-btn:hover {
	background: var(--accent, #c15f3c);
	color: #fff;
}
.pieces-jointes-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}
.pieces-jointes-dark .pieces-jointes-btn {
	background: rgba(255, 255, 255, 0.04);
	border-color: rgba(193, 95, 60, 0.6);
	color: #e0a88f;
}
.pieces-jointes-dark .pieces-jointes-btn:hover {
	background: var(--accent, #c15f3c);
	color: #fff;
}
.pieces-jointes-info {
	font-size: 12px;
	color: var(--muted, #8a8780);
	margin: 6px 0;
}
.pieces-jointes-erreur {
	font-size: 13px;
	color: #dc2626;
	background: rgba(220, 38, 38, 0.08);
	padding: 8px 12px;
	border-radius: 8px;
	margin: 8px 0;
}
.pieces-jointes-vide {
	font-size: 13px;
	color: var(--muted, #8a8780);
	font-style: italic;
}
.pieces-jointes-liste {
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.pieces-jointes-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px 10px;
	border: 1px solid var(--border, #e8e5df);
	border-radius: 10px;
	background: rgba(15, 23, 42, 0.02);
}
.pieces-jointes-miniature {
	width: 48px;
	height: 48px;
	object-fit: cover;
	border-radius: 8px;
	flex-shrink: 0;
}
.pieces-jointes-icone {
	width: 48px;
	height: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--accent, #c15f3c);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	border-radius: 8px;
	flex-shrink: 0;
}
.pieces-jointes-meta {
	flex: 1;
	min-width: 0;
}
.pieces-jointes-nom {
	font-size: 13px;
	font-weight: 500;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.pieces-jointes-taille {
	font-size: 11px;
	color: var(--muted, #8a8780);
}
.pieces-jointes-lien,
.pieces-jointes-supprimer {
	font-size: 12px;
	background: none;
	border: none;
	cursor: pointer;
	padding: 4px 8px;
	border-radius: 6px;
	flex-shrink: 0;
}
.pieces-jointes-lien {
	color: var(--accent, #c15f3c);
}
.pieces-jointes-lien:hover {
	background: rgba(193, 95, 60, 0.08);
}
.pieces-jointes-supprimer {
	color: #dc2626;
}
.pieces-jointes-supprimer:hover {
	background: rgba(220, 38, 38, 0.08);
}

/* Dark mode */
.pieces-jointes-dark .pieces-jointes-item {
	background: rgba(255, 255, 255, 0.03);
	border-color: rgba(255, 255, 255, 0.08);
}
.pieces-jointes-dark .pieces-jointes-titre,
.pieces-jointes-dark .pieces-jointes-nom {
	color: #f3f4f6;
}
.pieces-jointes-dark .pieces-jointes-compteur,
.pieces-jointes-dark .pieces-jointes-taille,
.pieces-jointes-dark .pieces-jointes-info,
.pieces-jointes-dark .pieces-jointes-vide {
	color: rgba(255, 255, 255, 0.55);
}

/* Mobile : boutons pleine largeur */
@media (max-width: 640px) {
	.pieces-jointes-actions {
		flex-direction: column;
		align-items: stretch;
	}
	.pieces-jointes-btn {
		width: 100%;
		box-sizing: border-box;
		justify-content: center;
	}
}

/* Sprint 20 : Lightbox (zoom image plein ecran) */
.pieces-jointes-lightbox {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.88);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 9999;
	cursor: zoom-out;
	padding: 20px;
}
.pieces-jointes-lightbox-img {
	max-width: 95%;
	max-height: 90%;
	object-fit: contain;
	border-radius: 8px;
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}
.pieces-jointes-lightbox-fermer {
	position: absolute;
	top: 20px;
	right: 24px;
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
	border: 1px solid rgba(255, 255, 255, 0.3);
	border-radius: 8px;
	padding: 8px 16px;
	font-size: 14px;
	cursor: pointer;
}
.pieces-jointes-lightbox-fermer:hover {
	background: rgba(255, 255, 255, 0.25);
}

/* Sprint 20 : Modale de consentement photo */
.pieces-jointes-consentement-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.55);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 9998;
	padding: 20px;
}
.pieces-jointes-consentement-modale {
	background: #fff;
	border-radius: 14px;
	max-width: 460px;
	width: 100%;
	padding: 24px;
	box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
}
.pieces-jointes-consentement-titre {
	font-size: 17px;
	font-weight: 700;
	margin-bottom: 14px;
	color: #0f172a;
}
.pieces-jointes-consentement-texte p {
	font-size: 14px;
	line-height: 1.55;
	color: #475569;
	margin: 0 0 12px 0;
}
.pieces-jointes-consentement-actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	margin-top: 20px;
}

/* Dark mode */
.pieces-jointes-dark .pieces-jointes-consentement-modale {
	background: #1e293b;
}
.pieces-jointes-dark .pieces-jointes-consentement-titre {
	color: #f1f5f9;
}
.pieces-jointes-dark .pieces-jointes-consentement-texte p {
	color: #cbd5e1;
}

/* Mobile */
@media (max-width: 640px) {
	.pieces-jointes-consentement-actions {
		flex-direction: column-reverse;
	}
	.pieces-jointes-consentement-actions .btn {
		width: 100%;
	}
}

/* Bandeau de notification des transmissions urgentes recentes */
.bandeau-urgences {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	margin-top: 56px;
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-left: 4px solid #dc2626;
	border-radius: 12px;
	padding: 14px 16px;
	margin-bottom: 18px;
}
.bandeau-urgences-contenu {
	display: flex;
	gap: 12px;
	flex: 1;
	min-width: 0;
}
.bandeau-urgences-icone {
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: #dc2626;
	color: #fff;
	font-weight: 800;
	font-size: 18px;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}
.bandeau-urgences-titre {
	font-size: 15px;
	font-weight: 700;
	color: #991b1b;
	margin-bottom: 8px;
}
.bandeau-urgences-liste {
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.bandeau-urgences-item {
	display: flex;
	align-items: center;
	gap: 10px;
	background: none;
	border: none;
	cursor: pointer;
	padding: 4px 6px;
	border-radius: 8px;
	text-align: left;
	width: 100%;
}
.bandeau-urgences-item:hover {
	background: rgba(220, 38, 38, 0.06);
}
.bandeau-urgences-pastille {
	font-size: 11px;
	font-weight: 700;
	padding: 2px 8px;
	border-radius: 999px;
	flex-shrink: 0;
	color: #fff;
}
.bandeau-urgences-urgent {
	background: #dc2626;
}
.bandeau-urgences-important {
	background: #ea580c;
}
.bandeau-urgences-patient {
	font-size: 13px;
	font-weight: 600;
	color: #1f2937;
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.bandeau-urgences-anciennete {
	font-size: 12px;
	color: #6b7280;
	flex-shrink: 0;
}
.bandeau-urgences-plus {
	font-size: 12px;
	color: #6b7280;
	padding: 2px 6px;
	font-style: italic;
}
.bandeau-urgences-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}
.bandeau-urgences-voir {
	font-size: 13px;
	font-weight: 600;
	color: #dc2626;
	background: #fff;
	border: 1px solid #fecaca;
	border-radius: 8px;
	padding: 6px 12px;
	cursor: pointer;
	white-space: nowrap;
}
.bandeau-urgences-voir:hover {
	background: #fef2f2;
}
.bandeau-urgences-fermer {
	font-size: 22px;
	line-height: 1;
	color: #991b1b;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0 6px;
}

/* Dark mode */
.bandeau-urgences-dark {
	background: rgba(220, 38, 38, 0.12);
	border-color: rgba(248, 113, 113, 0.4);
	border-left-color: #ef4444;
}
.bandeau-urgences-dark .bandeau-urgences-titre {
	color: #fecaca;
}
.bandeau-urgences-dark .bandeau-urgences-patient {
	color: #f3f4f6;
}
.bandeau-urgences-dark .bandeau-urgences-anciennete,
.bandeau-urgences-dark .bandeau-urgences-plus {
	color: rgba(255, 255, 255, 0.55);
}
.bandeau-urgences-dark .bandeau-urgences-voir {
	background: rgba(255, 255, 255, 0.08);
	color: #fca5a5;
	border-color: rgba(248, 113, 113, 0.35);
}
.bandeau-urgences-dark .bandeau-urgences-item:hover {
	background: rgba(248, 113, 113, 0.1);
}

/* Mobile */
@media (max-width: 640px) {
	.bandeau-urgences {
		flex-direction: column;
	}
	.bandeau-urgences-actions {
		width: 100%;
		justify-content: space-between;
	}
}

/* Badge de suggestion automatique du niveau d'urgence */
.urgence-suggeree-badge {
	display: inline-block;
	font-size: 12px;
	font-weight: 600;
	color: #ea580c;
	background: #fff7ed;
	border: 1px solid #fed7aa;
	border-radius: 999px;
	padding: 3px 10px;
	margin-left: 8px;
}

/* Bandeau de suggestion automatique du patient */
.patient-suggere-bandeau {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	background: #eff6ff;
	border: 1px solid #bfdbfe;
	border-left: 4px solid #2563eb;
	border-radius: 10px;
	padding: 12px 14px;
	margin-bottom: 12px;
}
.patient-suggere-texte {
	font-size: 14px;
	color: #1e3a5f;
	flex: 1;
	min-width: 180px;
}
.patient-suggere-btn {
	font-size: 13px;
	font-weight: 600;
	color: #fff;
	background: #2563eb;
	border: none;
	border-radius: 8px;
	padding: 8px 14px;
	cursor: pointer;
}
.patient-suggere-btn:hover {
	background: #1d4ed8;
}
.patient-suggere-ignorer {
	font-size: 13px;
	color: #64748b;
	background: none;
	border: none;
	cursor: pointer;
	padding: 8px 6px;
}
.patient-suggere-ignorer:hover {
	color: #334155;
}

/* Bouton de formatage des mesures par IA */
.btn-formater-mesures {
	margin-top: 8px;
	font-size: 13px;
	font-weight: 600;
	color: #2563eb;
	background: #eff6ff;
	border: 1px solid #bfdbfe;
	border-radius: 8px;
	padding: 8px 14px;
	cursor: pointer;
	transition: background 0.15s;
}
.btn-formater-mesures:hover:not(:disabled) {
	background: #dbeafe;
}
.btn-formater-mesures:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* ===== Page Ma tournee ===== */
.tournee-erreur {
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #b91c1c;
	border-radius: 8px;
	padding: 10px 14px;
	margin-bottom: 12px;
	font-size: 14px;
}
.tournee-recherche-card {
	margin-bottom: 16px;
}
.tournee-recherche-label {
	font-size: 13px;
	font-weight: 600;
	color: #475569;
	margin-bottom: 8px;
}
.tournee-recherche-input {
	width: 100%;
	box-sizing: border-box;
	padding: 10px 12px;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	font-size: 15px;
	font-family: inherit;
}
.tournee-resultats {
	margin-top: 10px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.tournee-resultat-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 8px 12px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
}
.tournee-resultat-nom {
	font-size: 15px;
	color: #1e293b;
}
.tournee-ajouter-btn {
	width: 34px;
	height: 34px;
	flex: 0 0 34px;
	border-radius: 8px;
	border: none;
	background: #2563eb;
	color: #fff;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}
.tournee-ajouter-btn:hover {
	background: #1d4ed8;
}
.tournee-aucun-resultat {
	margin-top: 10px;
	font-size: 14px;
	color: #64748b;
}
.tournee-vide {
	color: #64748b;
	font-size: 15px;
	line-height: 1.5;
}
.tournee-liste {
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.tournee-item {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	overflow: hidden;
}
.tournee-item-principal {
	width: 100%;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px;
	background: none;
	border: none;
	cursor: pointer;
	text-align: left;
	font-family: inherit;
}
.tournee-item-numero {
	flex: 0 0 28px;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: #2563eb;
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
}
.tournee-item-infos {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}
.tournee-item-nom {
	font-size: 16px;
	font-weight: 600;
	color: #1e293b;
}
.tournee-item-adresse {
	font-size: 13px;
	color: #64748b;
}
.tournee-item-chevron {
	color: #94a3b8;
	font-size: 12px;
}
.tournee-item-menu {
	display: flex;
	flex-direction: column;
	border-top: 1px solid #e2e8f0;
}
.tournee-menu-action {
	padding: 12px 14px;
	background: #f8fafc;
	border: none;
	border-bottom: 1px solid #e2e8f0;
	text-align: left;
	font-size: 15px;
	color: #1e293b;
	cursor: pointer;
	font-family: inherit;
}
.tournee-menu-action:last-child {
	border-bottom: none;
}
.tournee-menu-action:hover {
	background: #eff6ff;
}
.tournee-menu-retirer {
	color: #b91c1c;
}
.tournee-confirm-overlay {
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.55);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1000;
	padding: 20px;
}
.tournee-confirm-modale {
	background: #fff;
	border-radius: 14px;
	padding: 22px;
	max-width: 420px;
	width: 100%;
}
.tournee-confirm-titre {
	font-size: 18px;
	font-weight: 700;
	color: #1e293b;
	margin-bottom: 10px;
}
.tournee-confirm-texte {
	font-size: 14px;
	color: #475569;
	line-height: 1.5;
	margin-bottom: 18px;
}
.tournee-confirm-actions {
	display: flex;
	gap: 10px;
	justify-content: flex-end;
}
/* Dark mode */
.tournee-dark .tournee-item,
.tournee-dark .tournee-confirm-modale {
	background: #1e293b;
	border-color: #334155;
}
.tournee-dark .tournee-item-nom,
.tournee-dark .tournee-confirm-titre,
.tournee-dark .tournee-resultat-nom,
.tournee-dark .tournee-menu-action {
	color: #e2e8f0;
}
.tournee-dark .tournee-resultat-item,
.tournee-dark .tournee-menu-action {
	background: #0f172a;
	border-color: #334155;
}
.tournee-dark .tournee-recherche-input {
	background: #0f172a;
	border-color: #334155;
	color: #e2e8f0;
}

/* Poignee de glisser-deposer de la tournee */
.tournee-item {
	display: flex;
	align-items: stretch;
	flex-wrap: wrap;
}
.tournee-poignee {
	flex: 0 0 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f1f5f9;
	border: none;
	border-right: 1px solid #e2e8f0;
	color: #94a3b8;
	cursor: grab;
	touch-action: none;
	padding: 0;
}
.tournee-poignee:active {
	cursor: grabbing;
	background: #e2e8f0;
}
.tournee-item .tournee-item-principal {
	flex: 1 1 auto;
	width: auto;
}
.tournee-item .tournee-item-menu {
	flex: 1 0 100%;
}
.tournee-item-drag {
	opacity: 0.85;
	box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
	transform: scale(1.01);
}
.tournee-dark .tournee-poignee {
	background: #0f172a;
	border-color: #334155;
	color: #64748b;
}

/* Tournees enregistrees (modeles) */
.tournee-modeles-card {
	margin-bottom: 16px;
}
.tournee-modeles-liste {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 8px;
}
.tournee-modele {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	flex-wrap: wrap;
	padding: 10px 12px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
}
.tournee-modele-infos {
	display: flex;
	flex-direction: column;
	min-width: 0;
}
.tournee-modele-nom {
	font-size: 15px;
	font-weight: 600;
	color: #1e293b;
}
.tournee-modele-compte {
	font-size: 13px;
	color: #64748b;
}
.tournee-modele-actions {
	display: flex;
	gap: 8px;
}
.tournee-modele-charger {
	font-size: 13px;
	font-weight: 600;
	color: #fff;
	background: #2563eb;
	border: none;
	border-radius: 8px;
	padding: 8px 14px;
	cursor: pointer;
}
.tournee-modele-charger:hover {
	background: #1d4ed8;
}
.tournee-modele-supprimer {
	font-size: 13px;
	color: #b91c1c;
	background: none;
	border: 1px solid #fecaca;
	border-radius: 8px;
	padding: 8px 12px;
	cursor: pointer;
}
.tournee-modele-supprimer:hover {
	background: #fef2f2;
}
.tournee-dark .tournee-modele {
	background: #0f172a;
	border-color: #334155;
}
.tournee-dark .tournee-modele-nom {
	color: #e2e8f0;
}

/* Lignes de tournee a hauteur uniforme : indispensable pour que le
   glisser-deposer reste precis (le calcul de position suppose des lignes
   de meme hauteur) et pour un rendu regulier. */
.tournee-item {
	flex-wrap: nowrap;
	align-items: stretch;
	min-height: 64px;
}
.tournee-item .tournee-item-principal {
	min-width: 0;
	padding: 12px 14px;
}
.tournee-item-infos {
	min-width: 0;
	overflow: hidden;
}
.tournee-item-nom,
.tournee-item-adresse {
	display: block;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 100%;
}
.tournee-poignee {
	flex: 0 0 40px;
	align-self: stretch;
}
/* Le menu deplie doit rester sous la ligne, sans casser la rangee */
.tournee-item {
	flex-wrap: wrap;
}
.tournee-item .tournee-item-menu {
	flex: 1 0 100%;
}

/* Correctif : le bloc principal doit pouvoir retrecir, sinon il passe a la
   ligne et la poignee se retrouve seule au-dessus (rendu casse + glissement
   imprecis). flex-basis a 0 au lieu de auto. */
.tournee-item .tournee-item-principal {
	flex: 1 1 0 !important;
	min-width: 0 !important;
}
.tournee-item .tournee-poignee {
	flex: 0 0 40px !important;
}

/* ===== Bilan de suivi patient ===== */
.bilan-bloc {
	margin-top: 18px;
	padding-top: 16px;
	border-top: 1px solid #e2e8f0;
}
.bilan-titre {
	font-size: 16px;
	font-weight: 700;
	color: #1e293b;
	margin-bottom: 12px;
}
.bilan-etat {
	padding: 14px 0;
	font-size: 14px;
	color: #64748b;
}
.bilan-erreur {
	color: #b91c1c;
}
.bilan-indicateurs {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}
.bilan-indicateur {
	flex: 1 1 90px;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 10px 6px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
}
.bilan-indicateur-valeur {
	font-size: 20px;
	font-weight: 700;
	color: #1e293b;
	line-height: 1.1;
}
.bilan-indicateur-label {
	font-size: 11px;
	color: #64748b;
	text-align: center;
}
.bilan-periode {
	margin-top: 8px;
	font-size: 12px;
	color: #64748b;
	text-align: center;
}
.bilan-section {
	margin-top: 16px;
}
.bilan-section-titre {
	font-size: 13px;
	font-weight: 600;
	color: #475569;
	margin-bottom: 8px;
}
.bilan-barre {
	display: flex;
	height: 12px;
	border-radius: 6px;
	overflow: hidden;
	background: #e2e8f0;
}
.bilan-barre-segment {
	height: 100%;
}
.bilan-legende {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
	margin-top: 8px;
}
.bilan-legende-item {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 12px;
	color: #475569;
}
.bilan-legende-pastille {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	display: inline-block;
}
.bilan-courbe {
	width: 100%;
	height: auto;
	display: block;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
}
.bilan-categories {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.bilan-categorie {
	font-size: 12px;
	color: #475569;
	background: #f1f5f9;
	border: 1px solid #e2e8f0;
	border-radius: 999px;
	padding: 4px 10px;
	text-transform: capitalize;
}
.bilan-vide {
	margin-top: 12px;
	font-size: 13px;
	color: #64748b;
	line-height: 1.5;
}
.bilan-avertissement {
	margin-top: 14px;
	font-size: 11px;
	color: #94a3b8;
	line-height: 1.4;
	font-style: italic;
}

/* Le SVG ne doit pas s'etirer sur toute la largeur : au-dela, l'echelle
   agrandit les textes de facon disproportionnee et le graphique devient
   illisible. On le plafonne et on le centre. */
.bilan-courbe {
	max-width: 420px;
	margin: 0 auto;
}

/* Nom du patient cliquable depuis le detail d'une transmission */
.lien-fiche-patient {
	background: none;
	border: none;
	padding: 0;
	font: inherit;
	color: inherit;
	cursor: pointer;
	text-decoration: underline;
	text-decoration-style: dotted;
	text-underline-offset: 3px;
}
.lien-fiche-patient:hover {
	color: #2563eb;
}

/* ===== Bascule Professionnel / Famille sur l'ecran de connexion ===== */
.espace-bascule {
	position: relative;
	display: flex;
	background: rgba(148, 163, 184, 0.18);
	border-radius: 999px;
	padding: 4px;
	margin-bottom: 16px;
}
.espace-bascule-option {
	position: relative;
	z-index: 1;
	flex: 1 1 50%;
	padding: 10px 8px;
	background: none;
	border: none;
	border-radius: 999px;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	color: #94a3b8;
	cursor: pointer;
	transition: color 0.25s ease;
}
.espace-bascule-active {
	color: #0f172a;
}
.espace-bascule-curseur {
	position: absolute;
	top: 4px;
	left: 4px;
	width: calc(50% - 4px);
	height: calc(100% - 8px);
	background: #fff;
	border-radius: 999px;
	box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
	transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}
.espace-famille-message {
	font-size: 13px;
	line-height: 1.5;
	color: #6ee7b7;
	margin: 0 0 14px;
}

/* Bascule visuelle en vert quand l'espace famille est selectionne */
.login-page {
	transition: background 0.5s ease;
}
.login-page-famille {
	background: linear-gradient(160deg, #064e3b 0%, #065f46 45%, #047857 100%);
}
.login-page-famille .login-card {
	border-color: rgba(16, 185, 129, 0.45);
	box-shadow: 0 18px 50px rgba(4, 120, 87, 0.35);
}
.login-page-famille .btn-primary,
.login-page-famille button[type='submit'] {
	background: #059669;
	border-color: #059669;
}
.login-page-famille .btn-primary:hover,
.login-page-famille button[type='submit']:hover {
	background: #047857;
}
.login-page-famille .brand-title {
	color: #d1fae5;
}

/* ===== Espace famille ===== */
.famille-page {
	min-height: 100vh;
	background: #f8fafc;
	display: flex;
	flex-direction: column;
}
.famille-entete {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 18px 20px;
	background: linear-gradient(135deg, #047857 0%, #059669 100%);
	color: #fff;
}
.famille-titre {
	font-size: 19px;
	font-weight: 700;
}
.famille-sous-titre {
	font-size: 13px;
	opacity: 0.9;
	margin-top: 2px;
}
.famille-deconnexion {
	background: rgba(255, 255, 255, 0.16);
	border: 1px solid rgba(255, 255, 255, 0.3);
	color: #fff;
	border-radius: 8px;
	padding: 8px 12px;
	font-size: 13px;
	cursor: pointer;
	white-space: nowrap;
}
.famille-contenu {
	flex: 1;
	width: 100%;
	max-width: 680px;
	margin: 0 auto;
	padding: 20px 16px 40px;
	box-sizing: border-box;
}
.famille-etat {
	padding: 24px 0;
	color: #64748b;
}
.famille-erreur {
	color: #b91c1c;
}
.famille-vide {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	padding: 24px;
	color: #475569;
	line-height: 1.6;
}
.famille-vide-titre {
	font-size: 16px;
	font-weight: 600;
	color: #1e293b;
	margin-bottom: 8px;
}
.famille-bilans {
	display: flex;
	flex-direction: column;
	gap: 14px;
}
.famille-bilan {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	padding: 18px;
}
.famille-bilan-recent {
	border-color: #6ee7b7;
	box-shadow: 0 4px 16px rgba(5, 150, 105, 0.12);
}
.famille-bilan-entete {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	flex-wrap: wrap;
}
.famille-bilan-periode {
	font-size: 14px;
	font-weight: 600;
	color: #1e293b;
}
.famille-bilan-badge {
	font-size: 11px;
	font-weight: 600;
	color: #047857;
	background: #d1fae5;
	border-radius: 999px;
	padding: 3px 10px;
}
.famille-bilan-visites {
	font-size: 12px;
	color: #64748b;
	margin-top: 4px;
}
.famille-bilan-texte {
	margin-top: 12px;
	font-size: 15px;
	line-height: 1.65;
	color: #334155;
}
.famille-bilan-texte p {
	margin: 0 0 10px;
}
.famille-bilan-texte p:last-child {
	margin-bottom: 0;
}
.famille-mention {
	margin-top: 22px;
	font-size: 12px;
	line-height: 1.5;
	color: #94a3b8;
}

/* ===== Transition Professionnel <-> Famille sur l'ecran de connexion ===== */

/* Le fond vert est peint PAR-DESSUS le fond bleu habituel, puis se retire
   quand on revient sur Professionnel. On anime un calque dedie plutot que le
   fond de la page : la transition est plus douce et reversible. */
.login-fond-famille {
	position: fixed;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	overflow: hidden;
	opacity: 1;
}

/* Coup de peinture : un disque vert qui se deploie depuis le centre. */
.login-fond-famille::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 300vmax;
	height: 300vmax;
	margin: -150vmax 0 0 -150vmax;
	border-radius: 50%;
	background: radial-gradient(circle at 50% 45%, #059669 0%, #047857 45%, #064e3b 100%);
	transform: scale(0);
	transition: transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}
.login-page-famille .login-fond-famille::before {
	transform: scale(1);
}

/* Bulles blanches : elles montent lentement, comme dans une eau claire. */
.login-bulle {
	position: absolute;
	bottom: -12vh;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.16);
	border: 1px solid rgba(255, 255, 255, 0.28);
	opacity: 0;
	animation: login-bulle-montee linear infinite;
}

@keyframes login-bulle-montee {
	0% {
		transform: translateY(0) translateX(0) scale(0.7);
		opacity: 0;
	}
	12% {
		opacity: 1;
	}
	80% {
		opacity: 0.8;
	}
	100% {
		transform: translateY(-118vh) translateX(var(--derive, 0px)) scale(1.15);
		opacity: 0;
	}
}

/* Le contenu reste au-dessus du decor. */
.login-shell {
	position: relative;
	z-index: 1;
}

/* Certaines personnes preferent limiter les animations : on respecte ce
   reglage systeme en supprimant les mouvements, sans perdre la couleur. */
@media (prefers-reduced-motion: reduce) {
	.login-fond-famille::before {
		transition: none;
	}
	.login-bulle {
		display: none;
	}
}

/* ===== Gestion des acces familles (administration) ===== */
.acces-famille-avertissement {
	background: #fffbeb;
	border: 1px solid #fde68a;
	border-radius: 10px;
	padding: 12px 14px;
	font-size: 13px;
	line-height: 1.55;
	color: #92400e;
	margin-bottom: 16px;
}
.acces-famille-message {
	background: #ecfdf5;
	border: 1px solid #a7f3d0;
	border-radius: 10px;
	padding: 12px 14px;
	font-size: 13px;
	color: #065f46;
	margin-bottom: 12px;
	line-height: 1.5;
}
.acces-famille-erreur {
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: 10px;
	padding: 12px 14px;
	font-size: 13px;
	color: #991b1b;
	margin-bottom: 12px;
}
.acces-famille-titre-section {
	font-size: 14px;
	font-weight: 700;
	color: #1e293b;
	margin: 18px 0 10px;
}
.acces-famille-grille {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 12px;
}
.acces-famille-large {
	grid-column: 1 / -1;
}
.acces-famille-grille .field {
	display: flex;
	flex-direction: column;
	gap: 5px;
}
.acces-famille-grille .field span {
	font-size: 12px;
	font-weight: 600;
	color: #475569;
}
.acces-famille-consentement {
	display: flex;
	align-items: flex-start;
	gap: 9px;
	margin: 16px 0;
	font-size: 13px;
	line-height: 1.5;
	color: #334155;
	cursor: pointer;
}
.acces-famille-consentement input {
	margin-top: 2px;
	flex-shrink: 0;
}
.acces-famille-bouton {
	width: 100%;
}
.acces-famille-etat {
	font-size: 13px;
	color: #64748b;
	padding: 10px 0;
}
.acces-famille-liste {
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.acces-famille-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	padding: 12px 14px;
	flex-wrap: wrap;
}
.acces-famille-item-nom {
	font-size: 14px;
	font-weight: 600;
	color: #1e293b;
}
.acces-famille-lien {
	font-weight: 400;
	color: #64748b;
}
.acces-famille-item-detail {
	font-size: 12px;
	color: #64748b;
	margin-top: 3px;
}
.acces-famille-revoquer {
	background: none;
	border: 1px solid #fecaca;
	color: #b91c1c;
	border-radius: 8px;
	padding: 7px 12px;
	font-size: 13px;
	cursor: pointer;
	white-space: nowrap;
}
.acces-famille-revoquer:hover {
	background: #fef2f2;
}

/* Espace famille : pas de barre laterale, le contenu occupe toute la largeur */
.app-famille {
	display: block;
}
.app-famille .main {
	margin: 0;
	padding: 0;
	width: 100%;
	max-width: none;
}

/* Corrections de mise en forme de l'ecran des acces familles */
.acces-famille-page .acces-famille-grille {
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.acces-famille-grille .field input,
.acces-famille-grille .field select {
	width: 100%;
	box-sizing: border-box;
	padding: 10px 12px;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	font-size: 14px;
	background: #fff;
}
.acces-famille-bouton {
	width: auto;
	min-width: 200px;
	display: block;
	margin-left: auto;
}

/* ===== Tiroir de navigation (mobile) ===== */
/* La barre du bas garde les actions frequentes ; ce tiroir donne acces au
   reste du menu. Sur grand ecran, la barre laterale suffit : on le masque. */
.mobile-drawer-bouton {
	display: none;
	position: fixed;
	top: 12px;
	left: 12px;
	z-index: 1200;
	width: 40px;
	height: 40px;
	align-items: center;
	justify-content: center;
	background: rgba(15, 23, 42, 0.85);
	border: 1px solid rgba(148, 163, 184, 0.35);
	border-radius: 10px;
	color: #e2e8f0;
	cursor: pointer;
	padding: 0;
}
.mobile-drawer-bouton svg {
	width: 20px;
	height: 20px;
}
.mobile-drawer-fond {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 1300;
	background: rgba(15, 23, 42, 0.5);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s ease;
}
.mobile-drawer-fond-visible {
	opacity: 1;
	pointer-events: auto;
}
.mobile-drawer {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	bottom: 0;
	z-index: 1400;
	width: 262px;
	max-width: 82vw;
	background: #0f2544;
	color: #e2e8f0;
	transform: translateX(-100%);
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	overflow-y: auto;
	box-shadow: 4px 0 24px rgba(2, 6, 23, 0.4);
}
.mobile-drawer-ouvert {
	transform: translateX(0);
}
.mobile-drawer-entete {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 16px 12px;
	border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}
.mobile-drawer-titre {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #94a3b8;
}
.mobile-drawer-fermer {
	background: none;
	border: none;
	color: #cbd5e1;
	cursor: pointer;
	padding: 4px;
	display: flex;
}
.mobile-drawer-fermer svg {
	width: 20px;
	height: 20px;
}
.mobile-drawer-liens {
	display: flex;
	flex-direction: column;
	padding: 10px 10px 28px;
	gap: 2px;
}
.mobile-drawer-lien {
	display: block;
	padding: 13px 14px;
	border-radius: 10px;
	color: #cbd5e1;
	text-decoration: none;
	font-size: 15px;
}
.mobile-drawer-lien-actif {
	background: rgba(59, 130, 246, 0.22);
	color: #fff;
	font-weight: 600;
}

@media (max-width: 900px) {
	.mobile-drawer-bouton,
	.mobile-drawer-fond,
	.mobile-drawer {
		display: flex;
	}
	.mobile-drawer {
		flex-direction: column;
	}
	.mobile-drawer-fond {
		display: block;
	}
}

/* ===== Relecture des bilans familles ===== */
.bilans-attente-explication {
	background: #eff6ff;
	border: 1px solid #bfdbfe;
	border-radius: 10px;
	padding: 12px 14px;
	font-size: 13px;
	line-height: 1.55;
	color: #1e40af;
	margin-bottom: 16px;
}
.bilans-attente-message {
	background: #ecfdf5;
	border: 1px solid #a7f3d0;
	border-radius: 10px;
	padding: 11px 14px;
	font-size: 13px;
	color: #065f46;
	margin-bottom: 12px;
}
.bilans-attente-erreur {
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: 10px;
	padding: 11px 14px;
	font-size: 13px;
	color: #991b1b;
	margin-bottom: 12px;
}
.bilans-attente-etat {
	font-size: 14px;
	color: #64748b;
	padding: 16px 0;
	line-height: 1.55;
}
.bilans-attente-liste {
	display: flex;
	flex-direction: column;
	gap: 14px;
}
.bilans-attente-item {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 16px;
}
.bilans-attente-item-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 10px;
}
.bilans-attente-patient {
	font-size: 15px;
	font-weight: 700;
	color: #1e293b;
}
.bilans-attente-periode {
	font-size: 12px;
	color: #64748b;
	margin-top: 3px;
}
.bilans-attente-badge {
	font-size: 11px;
	font-weight: 600;
	color: #92400e;
	background: #fef3c7;
	border-radius: 999px;
	padding: 3px 9px;
	white-space: nowrap;
}
.bilans-attente-echeance {
	font-size: 12px;
	color: #059669;
	font-weight: 600;
	margin-top: 8px;
}
.bilans-attente-texte {
	margin-top: 12px;
	font-size: 14px;
	line-height: 1.6;
	color: #334155;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	padding: 14px;
}
.bilans-attente-texte p {
	margin: 0 0 9px;
}
.bilans-attente-texte p:last-child {
	margin-bottom: 0;
}
.bilans-attente-textarea {
	width: 100%;
	box-sizing: border-box;
	margin-top: 12px;
	padding: 13px;
	border: 1px solid #cbd5e1;
	border-radius: 10px;
	font: inherit;
	font-size: 14px;
	line-height: 1.6;
	resize: vertical;
}
.bilans-attente-actions {
	display: flex;
	gap: 9px;
	margin-top: 12px;
	flex-wrap: wrap;
}
.bilans-attente-secondaire {
	background: #fff;
	border: 1px solid #cbd5e1;
	color: #334155;
	border-radius: 8px;
	padding: 9px 14px;
	font-size: 13px;
	cursor: pointer;
}
.bilans-attente-secondaire:hover {
	background: #f1f5f9;
}
.bilans-attente-bloquer {
	background: #fff;
	border: 1px solid #fecaca;
	color: #b91c1c;
	border-radius: 8px;
	padding: 9px 14px;
	font-size: 13px;
	cursor: pointer;
}
.bilans-attente-bloquer:hover {
	background: #fef2f2;
}

/* Le contenu de la page des bilans doit defiler librement : sans cela, le
   dernier bilan est tronque par la hauteur du conteneur. */
.bilans-attente-page {
	overflow: visible;
	max-height: none;
	padding-bottom: 90px;
}
.bilans-attente-item {
	overflow: visible;
}

/* Le bouton de deconnexion occupe deja le coin superieur gauche : on decale
   le bouton du tiroir juste a cote plutot que par-dessus. */
.mobile-drawer-bouton {
	left: 62px;
}

/* ===== Avertissement sur les valeurs impossibles ===== */
/* Volontairement visible mais non bloquant : le soignant reste seul juge. */
.anomalies-mesures {
	margin-top: 10px;
	background: #fffbeb;
	border: 1px solid #fcd34d;
	border-left: 4px solid #f59e0b;
	border-radius: 10px;
	padding: 12px 14px;
}
.anomalies-mesures-titre {
	font-size: 13px;
	font-weight: 700;
	color: #92400e;
	margin-bottom: 6px;
}
.anomalies-mesures ul {
	margin: 0;
	padding-left: 18px;
}
.anomalies-mesures li {
	font-size: 13px;
	line-height: 1.5;
	color: #92400e;
	margin-bottom: 3px;
}
.anomalies-mesures-note {
	font-size: 12px;
	line-height: 1.5;
	color: #a16207;
	margin-top: 8px;
	font-style: italic;
}

/* Le bouton du tiroir passe a droite : a gauche il recouvrait le titre de la
   page, ce qui rendait l'ecran illisible sur mobile. */
.mobile-drawer-bouton {
	left: auto;
	right: 62px;
}

/* Sur mobile, une regle generale applique "overflow: hidden" a toutes les
   cartes pour eviter les debordements horizontaux. Elle tronquait aussi le
   contenu vertical de la page des bilans. On retablit le defilement vertical
   pour cette page seulement, sans reintroduire de debordement lateral. */
.bilans-attente-page,
.acces-famille-page {
	overflow-x: hidden !important;
	overflow-y: visible !important;
	max-height: none !important;
	height: auto !important;
	padding-bottom: 110px;
}

/* Le bouton du tiroir se place sous le bouton de deconnexion, dans la meme
   colonne, plutot que de chevaucher le titre de la page. */
.mobile-drawer-bouton {
	top: 66px;
	left: 12px;
	right: auto;
}

/* CAUSE DU CONTENU TRONQUE : `.app` impose max-height 94vh et overflow hidden
   pour l'effet de cadre. Aucune regle posee sur une carte ne peut compenser
   cela, puisque la coupure a lieu au-dessus. On rend donc la zone de contenu
   defilante : le cadre est preserve, et les pages longues redeviennent
   entierement accessibles. */
.main {
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

@media (max-width: 900px) {
	/* Sur mobile, le cadre n'a pas d'interet : l'application occupe l'ecran,
	   et la page defile naturellement. */
	body {
		display: block;
		align-items: stretch;
	}
	body > main {
		min-height: 100dvh;
		display: block;
	}
	.app {
		width: 100%;
		max-width: none;
		min-height: 100dvh;
		max-height: none;
		border-radius: 0;
		overflow: visible;
	}
	.main {
		overflow-y: visible;
		padding-bottom: 110px;
	}
}

/* ===== Documents administratifs du dossier patient ===== */
.documents-patient {
	margin-top: 18px;
	padding-top: 16px;
	border-top: 1px solid #e2e8f0;
}
.documents-patient-entete {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	flex-wrap: wrap;
	margin-bottom: 12px;
}
.documents-patient-titre {
	font-size: 16px;
	font-weight: 700;
	color: #1e293b;
}
.documents-patient-ajouter {
	background: #fff;
	border: 1px solid #2563eb;
	color: #2563eb;
	border-radius: 8px;
	padding: 8px 13px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
}
.documents-patient-ajouter:hover {
	background: #eff6ff;
}
.documents-patient-message {
	background: #ecfdf5;
	border: 1px solid #a7f3d0;
	border-radius: 8px;
	padding: 10px 12px;
	font-size: 13px;
	color: #065f46;
	margin-bottom: 10px;
}
.documents-patient-erreur {
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: 8px;
	padding: 10px 12px;
	font-size: 13px;
	color: #991b1b;
	margin-bottom: 10px;
}
.documents-patient-formulaire {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 14px;
	margin-bottom: 14px;
	display: flex;
	flex-direction: column;
	gap: 11px;
}
.documents-patient-champ {
	display: flex;
	flex-direction: column;
	gap: 5px;
}
.documents-patient-champ span {
	font-size: 12px;
	font-weight: 600;
	color: #475569;
}
.documents-patient-champ input[type='text'],
.documents-patient-champ input:not([type]),
.documents-patient-champ select {
	width: 100%;
	box-sizing: border-box;
	padding: 9px 11px;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	font-size: 14px;
	background: #fff;
}
.documents-patient-champ input[type='file'] {
	font-size: 13px;
	padding: 6px 0;
}
.documents-patient-aide {
	font-size: 11px;
	color: #94a3b8;
	line-height: 1.45;
}
.documents-patient-etat {
	font-size: 13px;
	color: #64748b;
	padding: 10px 0;
	line-height: 1.5;
}
.documents-patient-groupes {
	display: flex;
	flex-direction: column;
	gap: 14px;
}
.documents-patient-groupe-titre {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #64748b;
	margin-bottom: 7px;
}
.documents-patient-compte {
	background: #e2e8f0;
	color: #475569;
	border-radius: 999px;
	padding: 1px 7px;
	font-size: 11px;
	letter-spacing: 0;
}
.documents-patient-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	padding: 10px 12px;
	margin-bottom: 6px;
}
.documents-patient-lien {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
	background: none;
	border: none;
	padding: 0;
	text-align: left;
	cursor: pointer;
	font: inherit;
}
.documents-patient-nom {
	font-size: 14px;
	font-weight: 600;
	color: #2563eb;
	text-decoration: underline;
	text-decoration-style: dotted;
	text-underline-offset: 3px;
	word-break: break-word;
}
.documents-patient-meta {
	font-size: 11px;
	color: #94a3b8;
}
.documents-patient-supprimer {
	background: none;
	border: 1px solid #fecaca;
	color: #b91c1c;
	border-radius: 8px;
	padding: 6px 10px;
	font-size: 12px;
	cursor: pointer;
	white-space: nowrap;
	flex-shrink: 0;
}
.documents-patient-supprimer:hover {
	background: #fef2f2;
}

/* Marges internes de la fiche patient : les sections ajoutees (bilan,
   documents) touchaient les bords de la fenetre, ce qui donnait une
   impression de contenu tronque. */
.patients-modal-backdrop .documents-patient,
.patients-modal-backdrop .bilan-bloc {
	padding-left: 4px;
	padding-right: 4px;
}
.bilan-bloc .bilan-section,
.bilan-bloc .bilan-indicateurs,
.bilan-bloc .bilan-titre {
	padding-left: 2px;
	padding-right: 2px;
}
.bilan-courbe {
	margin-top: 4px;
}
.documents-patient-groupes {
	padding-bottom: 4px;
}

/* ===== Messagerie interne ===== */
.messagerie-nouvelle {
	background: #fff;
	border: 1px solid #2563eb;
	color: #2563eb;
	border-radius: 8px;
	padding: 8px 13px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
}
.messagerie-nouvelle:hover {
	background: #eff6ff;
}
.messagerie-erreur {
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: 8px;
	padding: 10px 13px;
	font-size: 13px;
	color: #991b1b;
	margin-bottom: 12px;
}
.messagerie-formulaire {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 14px;
	margin-bottom: 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.messagerie-recherche {
	width: 100%;
	box-sizing: border-box;
	padding: 9px 12px;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	font-size: 14px;
}
.messagerie-destinataires {
	max-height: 230px;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 3px;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	background: #fff;
	padding: 5px;
}
.messagerie-destinataire {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 8px 10px;
	border-radius: 7px;
	cursor: pointer;
	font-size: 14px;
}
.messagerie-destinataire:hover {
	background: #f1f5f9;
}
.messagerie-destinataire-choisi {
	background: #eff6ff;
}
.messagerie-destinataire-nom {
	flex: 1;
	color: #1e293b;
}
.messagerie-destinataire-role {
	font-size: 11px;
	color: #64748b;
	background: #f1f5f9;
	border-radius: 999px;
	padding: 2px 8px;
}
.messagerie-creer {
	align-self: flex-start;
}
.messagerie-corps {
	display: flex;
	gap: 14px;
	min-height: 420px;
}
.messagerie-liste {
	width: 290px;
	flex-shrink: 0;
	display: flex;
	flex-direction: column;
	gap: 5px;
	border-right: 1px solid #e2e8f0;
	padding-right: 12px;
	overflow-y: auto;
	max-height: 560px;
}
.messagerie-conversation {
	text-align: left;
	background: none;
	border: 1px solid transparent;
	border-radius: 10px;
	padding: 11px 12px;
	cursor: pointer;
	font: inherit;
	width: 100%;
}
.messagerie-conversation:hover {
	background: #f8fafc;
}
.messagerie-conversation-active {
	background: #eff6ff;
	border-color: #bfdbfe;
}
.messagerie-conversation-haut {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}
.messagerie-conversation-titre {
	font-size: 14px;
	font-weight: 600;
	color: #1e293b;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.messagerie-pastille {
	background: #2563eb;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	border-radius: 999px;
	padding: 1px 7px;
	flex-shrink: 0;
}
.messagerie-conversation-apercu {
	font-size: 12px;
	color: #64748b;
	margin-top: 3px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.messagerie-conversation-meta {
	font-size: 11px;
	color: #94a3b8;
	margin-top: 2px;
}
.messagerie-fil {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
}
.messagerie-fil-entete {
	display: flex;
	align-items: center;
	gap: 10px;
	padding-bottom: 10px;
	border-bottom: 1px solid #e2e8f0;
	margin-bottom: 10px;
}
.messagerie-retour {
	display: none;
	background: none;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	padding: 6px 11px;
	font-size: 13px;
	cursor: pointer;
	color: #334155;
}
.messagerie-fil-titre {
	font-size: 15px;
	font-weight: 700;
	color: #1e293b;
}
.messagerie-messages {
	flex: 1;
	overflow-y: auto;
	max-height: 400px;
	display: flex;
	flex-direction: column;
	gap: 9px;
	padding-right: 4px;
}
.messagerie-message {
	max-width: 74%;
	align-self: flex-start;
	background: #f1f5f9;
	border-radius: 12px;
	padding: 9px 12px;
}
.messagerie-message-moi {
	align-self: flex-end;
	background: #dbeafe;
}
.messagerie-auteur {
	font-size: 11px;
	font-weight: 700;
	color: #475569;
	margin-bottom: 3px;
}
.messagerie-texte {
	font-size: 14px;
	line-height: 1.5;
	color: #1e293b;
	white-space: pre-wrap;
	word-break: break-word;
}
.messagerie-piece {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin-top: 6px;
	background: #fff;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	padding: 6px 10px;
	font-size: 13px;
	color: #2563eb;
	cursor: pointer;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
}
.messagerie-piece-taille {
	font-size: 11px;
	color: #94a3b8;
	flex-shrink: 0;
}
.messagerie-heure {
	font-size: 10px;
	color: #94a3b8;
	margin-top: 4px;
	text-align: right;
}
.messagerie-saisie {
	margin-top: 12px;
	border-top: 1px solid #e2e8f0;
	padding-top: 11px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.messagerie-saisie textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 10px 12px;
	border: 1px solid #cbd5e1;
	border-radius: 10px;
	font: inherit;
	font-size: 14px;
	resize: vertical;
}
.messagerie-saisie-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	flex-wrap: wrap;
}
.messagerie-saisie-actions input[type='file'] {
	font-size: 12px;
	max-width: 60%;
}
.messagerie-etat {
	font-size: 13px;
	color: #64748b;
	padding: 16px 4px;
	line-height: 1.5;
}
.messagerie-etat-fil {
	text-align: center;
	padding-top: 60px;
}

@media (max-width: 900px) {
	/* Un seul volet a la fois : la liste, ou le fil ouvert. */
	.messagerie-corps {
		display: block;
		min-height: 0;
	}
	.messagerie-liste {
		width: 100%;
		border-right: none;
		padding-right: 0;
		max-height: none;
	}
	.messagerie-fil {
		display: none;
	}
	.messagerie-fil-ouvert .messagerie-liste {
		display: none;
	}
	.messagerie-fil-ouvert .messagerie-fil {
		display: flex;
	}
	.messagerie-retour {
		display: inline-block;
	}
	.messagerie-messages {
		max-height: none;
	}
	.messagerie-message {
		max-width: 88%;
	}
}

/* Edition d'un acces famille */
.acces-famille-item {
	flex-direction: column;
	align-items: stretch;
}
.acces-famille-item-haut {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
}
.acces-famille-actions {
	display: flex;
	gap: 7px;
	flex-wrap: wrap;
}
.acces-famille-action {
	background: #fff;
	border: 1px solid #cbd5e1;
	color: #334155;
	border-radius: 8px;
	padding: 7px 12px;
	font-size: 13px;
	cursor: pointer;
	white-space: nowrap;
}
.acces-famille-action:hover {
	background: #f1f5f9;
	border-color: #94a3b8;
}
.acces-famille-suspendu {
	display: inline-block;
	margin-left: 8px;
	font-size: 11px;
	font-weight: 600;
	color: #92400e;
	background: #fef3c7;
	border-radius: 999px;
	padding: 2px 9px;
	vertical-align: middle;
}
.acces-famille-edition {
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid #e2e8f0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.acces-famille-edition-ligne {
	display: flex;
	align-items: flex-end;
	gap: 9px;
	flex-wrap: wrap;
}
.acces-famille-edition-ligne .field {
	flex: 1 1 220px;
	display: flex;
	flex-direction: column;
	gap: 5px;
}
.acces-famille-edition-ligne .field span {
	font-size: 12px;
	font-weight: 600;
	color: #475569;
}
.acces-famille-edition-ligne .field input {
	width: 100%;
	box-sizing: border-box;
	padding: 9px 11px;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	font-size: 14px;
	background: #fff;
}
.acces-famille-edition-note {
	font-size: 11px;
	line-height: 1.5;
	color: #94a3b8;
	font-style: italic;
}

/* Itinéraire tournée */
.tournee-menu-itineraire {
  display: block;
  text-decoration: none;
  color: inherit;
}
