/* TheSyndic — coque copropriétaire partagée (menu latéral + barre supérieure).
   Chargée par views/includes/menu.php sur toutes les pages copropriétaire. */
body.copro-shell {
    --dashboard-bg: #faf9f6;
    --dashboard-surface: #fff;
    --dashboard-soft: #f5f2f9;
    --dashboard-ink: #242039;
    --dashboard-muted: #6b677b;
    --dashboard-line: #e8e4ed;
    --dashboard-violet: #6742cc;
    --dashboard-lavender: #f0ebfc;
    --dashboard-green: #21735b;
    --dashboard-red: #b03c51;
    --sidebar-width: 250px;
}
body.copro-shell #sidebar, body.copro-shell #sidebar *, body.copro-shell #sidebar *::before, body.copro-shell #sidebar *::after,
body.copro-shell #dashboardTopbar, body.copro-shell #dashboardTopbar *, body.copro-shell #dashboardTopbar *::before, body.copro-shell #dashboardTopbar *::after { box-sizing: border-box; }
body.copro-shell #sidebar button, body.copro-shell #dashboardTopbar button, body.copro-shell #dashboardTopbar input { font-family: inherit; }
body.copro-shell #sidebar, body.copro-shell #dashboardTopbar { font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 14px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
body.copro-shell #sidebar :focus-visible, body.copro-shell #dashboardTopbar :focus-visible { outline: 3px solid var(--dashboard-violet); outline-offset: 3px; }
body.copro-shell .dashboard-icon { width: 21px; height: 21px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }

/* Pages copropriétaire historiques : même cadre que le tableau de bord, contenu conservé */
body.copro-shell:not(#coproDashboard) {
    --sidebar-gap: 0px;
    --sidebar-total: var(--sidebar-width);
    padding-left: var(--sidebar-total);
    background: var(--dashboard-bg) !important;
}
body.copro-shell:not(#coproDashboard) .index-content { margin-left: 0 !important; width: auto !important; }
body.copro-shell:not(#coproDashboard) #sidebar { z-index: 1040; }
body.copro-shell.dark-mode:not(#coproDashboard) { color-scheme: dark; }
@media (max-width: 900px) {
    body.copro-shell:not(#coproDashboard) { --sidebar-total: 0px; padding-left: 0; }
    body.copro-shell:not(#coproDashboard).sidebar-open #sidebar { z-index: 1100; }
}

body.copro-shell :focus-visible { outline: 3px solid var(--dashboard-violet); outline-offset: 3px; }
body.copro-shell .dashboard-icon { width: 21px; height: 21px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
body.copro-shell .dashboard-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
body.copro-shell .dashboard-skip { position: fixed; top: 10px; left: 16px; z-index: 20000; padding: 12px 18px; background: var(--dashboard-ink); color: var(--dashboard-surface); border-radius: 8px; transform: translateY(-160%); }
body.copro-shell .dashboard-skip:focus { transform: none; }
body.copro-shell .index-content { margin-left: var(--sidebar-width); width: calc(100% - var(--sidebar-width)); height: 100dvh; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
body.copro-shell .index-content > .scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-gutter: stable; scroll-padding-top: 20px; }

body.copro-shell #sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); height: 100dvh; display: flex; flex-direction: column; z-index: 1100; background: var(--dashboard-surface); border-right: 1px solid var(--dashboard-line); color: var(--dashboard-ink); overflow: hidden; }
body.copro-shell .sidebar-header { display: flex; justify-content: center; padding: 20px 23px 14px; }
body.copro-shell .sidebar-header a { display: inline-flex; align-items: center; min-height: 36px; }
body.copro-shell .sidebar-header img { width: 118px; height: 24px; object-fit: contain; }
body.copro-shell .dashboard-sidebar-caption { display: block; font-size: 10px; color: var(--dashboard-muted); margin-top: 4px; }
body.copro-shell .sidebar-copro { padding: 0 16px 14px; }
body.copro-shell .copro-badge { display: flex; align-items: center; gap: 10px; padding: 13px 11px; border: 1px solid var(--dashboard-line); border-radius: 12px; background: var(--dashboard-bg); }
body.copro-shell .copro-badge-icon { display: grid; place-items: center; flex: 0 0 34px; height: 37px; border-radius: 9px; color: var(--dashboard-violet); background: var(--dashboard-lavender); font-size: 14px; font-weight: 650; }
body.copro-shell .copro-badge-text { min-width: 0; }
body.copro-shell .copro-badge-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 11px; line-height: 1.5; font-weight: 600; }
body.copro-shell .copro-badge-sub { display: block; font-size: 10px; color: var(--dashboard-muted); margin-top: 3px; }
body.copro-shell .sidebar-body { display: flex; flex: 1; min-height: 0; }
body.copro-shell .sidebar-panel { display: flex; flex-direction: column; width: 100%; padding: 0 14px 20px; overflow-y: auto; scrollbar-width: thin; }
body.copro-shell .nav-section { display: flex; flex-direction: column; gap: 2px; }
body.copro-shell .nav-group-label { font-size: 9px; text-transform: uppercase; font-weight: 650; letter-spacing: .13em; color: var(--dashboard-muted); padding: 0 13px; margin: 16px 0 5px; }
body.copro-shell .nav-group-label:first-child { margin-top: 0; }
body.copro-shell .panel-item, body.copro-shell .panel-item-sm { display: flex; align-items: center; gap: 11px; min-height: 37px; padding: 8px 13px; border-radius: 9px; text-decoration: none; font-size: 12px; font-weight: 500; color: var(--dashboard-muted); transition: background .16s, color .16s; }
body.copro-shell .panel-item > svg, body.copro-shell .panel-item-sm > svg { width: 18px; height: 18px; }
body.copro-shell .panel-item:hover, body.copro-shell .panel-item-sm:hover { background: var(--dashboard-soft); color: var(--dashboard-ink); }
body.copro-shell .panel-item.active, body.copro-shell .panel-item-sm.active { color: var(--dashboard-violet); background: var(--dashboard-lavender); font-weight: 650; }
body.copro-shell .badge-pro { margin-left: auto; font-size: 8px; border: 1px solid var(--dashboard-line); border-radius: 4px; padding: 1px 4px; }
body.copro-shell .nav-system { display: flex; flex-direction: row; gap: 2px; padding-top: 14px; margin-top: auto; }
body.copro-shell .panel-item-sm { flex: 1 1 0; min-width: 0; flex-direction: column; justify-content: center; gap: 4px; min-height: 48px; padding: 8px 4px; font-size: 10.5px; line-height: 1.2; text-align: center; white-space: nowrap; }
body.copro-shell .panel-item-sm > svg { width: 16px; height: 16px; }
body.copro-shell .sidebar-actions { border-top: 1px solid var(--dashboard-line); margin: 10px 8px 0; padding-top: 12px; }
body.copro-shell .mode-syndic { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 37px; padding: 8px; margin-top: 4px; border: 1px solid var(--dashboard-line); border-radius: 9px; text-decoration: none; color: var(--dashboard-violet); font-size: 11px; font-weight: 600; }
body.copro-shell .mode-syndic:hover { background: var(--dashboard-lavender); }
body.copro-shell .mode-syndic svg { width: 15px; height: 15px; margin: 0 !important; }
body.copro-shell .sidebar-footer, body.copro-shell .close-menu, body.copro-shell .sidebar-scrim { display: none; }

body.copro-shell .up-bar, body.copro-shell #menuOverlay, body.copro-shell #btn-deploy-topbar { display: none !important; }
body.copro-shell #dashboardTopbar { display: block; position: sticky; top: 0; flex: 0 0 auto; z-index: 1000; border-bottom: 1px solid var(--dashboard-line); background: var(--dashboard-surface); box-shadow: none; transition: none; }
body.copro-shell #dashboardTopbar .topbar-shell { padding: 0; margin: 0; width: 100%; }
body.copro-shell #dashboardTopbar .topbar-card { display: flex; align-items: center; gap: 24px; min-height: 76px; padding: 15px 30px; border: 0; border-radius: 0; background: transparent; box-shadow: none; backdrop-filter: none; transition: none; }
body.copro-shell .dashboard-topbar-context { display: flex; align-items: center; gap: 12px; flex: 0 1 auto; min-width: 0; }
body.copro-shell .dashboard-topbar-context > div { min-width: 0; }
body.copro-shell .dashboard-topbar-context span { display: block; color: var(--dashboard-muted); font-size: 10px; line-height: 1.5; }
body.copro-shell .dashboard-topbar-context strong { display: block; font-size: 13px; font-weight: 600; line-height: 1.6; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
body.copro-shell .dashboard-menu-toggle { display: none; }
body.copro-shell #topbarSearchWrap { position: relative; flex: 1; max-width: 410px; min-width: 0; margin-left: auto; width: auto; }
body.copro-shell #topbarSearchInput { width: 100%; height: 42px; border: 1px solid var(--dashboard-line); background: var(--dashboard-bg); border-radius: 10px; padding: 10px 67px 10px 37px; color: var(--dashboard-ink); box-shadow: none; font-size: 11px; }
body.copro-shell #topbarSearchInput::placeholder { color: var(--dashboard-muted); }
body.copro-shell #topbarSearchInput:focus { border-color: #a88bdb; box-shadow: 0 0 0 3px #bda3ec20; outline: none; }
body.copro-shell .search-icon { color: var(--dashboard-muted); font-size: 12px; }
body.copro-shell .search-shortcut { color: var(--dashboard-muted); }
body.copro-shell .search-shortcut kbd { background: var(--dashboard-surface); color: var(--dashboard-muted); border-color: var(--dashboard-line); }
body.copro-shell #searchResults { left: 0; right: 0; width: auto; min-width: 0; max-height: min(65svh, 460px); border: 1px solid var(--dashboard-line); border-radius: 14px; background: var(--dashboard-surface); box-shadow: 0 18px 40px #30233f18; color: var(--dashboard-ink); }
body.copro-shell .search-results-group-title, body.copro-shell .sr-sublabel { color: var(--dashboard-muted); }
body.copro-shell .sr-label { color: var(--dashboard-ink); }
body.copro-shell .search-result-item:hover, body.copro-shell .search-result-item.active { background: var(--dashboard-lavender); }
body.copro-shell #dashboardTopbar .topbar-actions { margin: 0; padding: 0; gap: 9px; flex-shrink: 0; border: 0; background: none; box-shadow: none; backdrop-filter: none; transform: none; transition: none; }
body.copro-shell #dashboardTopbar .topbar-bell, body.copro-shell #dashboardTopbar .topbar-chat-btn, body.copro-shell #topbarSearchToggle { width: 39px; height: 39px; min-width: 39px; padding: 0; display: inline-flex; justify-content: center; align-items: center; color: var(--dashboard-muted); background: transparent; border: 1px solid transparent; border-radius: 10px; box-shadow: none; backdrop-filter: none; transform: none; text-decoration: none; }
body.copro-shell #dashboardTopbar .topbar-bell:hover, body.copro-shell #dashboardTopbar .topbar-chat-btn:hover, body.copro-shell #topbarSearchToggle:hover { background: var(--dashboard-soft); color: var(--dashboard-violet); border-color: var(--dashboard-line); }
body.copro-shell #topbarSearchToggle { display: none; }
body.copro-shell .topbar-bell.has-unread svg { animation: none; }
body.copro-shell #topbarProfile { border: 0; border-radius: 10px; padding: 0; background: transparent; box-shadow: none; }
body.copro-shell #dashboardProfileToggle { display: flex; align-items: center; gap: 9px; padding: 3px 5px; border: 0; border-radius: 10px; background: transparent; color: var(--dashboard-ink); min-height: 43px; }
body.copro-shell #dashboardProfileToggle:hover { background: var(--dashboard-soft); }
body.copro-shell #topbarProfile .avatar-initials, body.copro-shell .topbar-menu-avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 1px solid #dfd2f4; font-size: 10px; font-weight: 650; color: var(--dashboard-violet); background: var(--dashboard-lavender); }
body.copro-shell #topbarProfile .name { font-size: 11px; font-weight: 550; color: var(--dashboard-ink); }
body.copro-shell #topbarProfile .caret { color: var(--dashboard-muted); width: 12px; height: 12px; }
body.copro-shell #topbarMenu { min-width: 265px; max-width: calc(100vw - 28px); border: 1px solid var(--dashboard-line); border-radius: 14px; background: var(--dashboard-surface); box-shadow: 0 16px 42px #30233f1c; overflow: hidden; }
body.copro-shell .topbar-menu-header { background: var(--dashboard-soft); border-color: var(--dashboard-line); }
body.copro-shell #topbarMenu .tm-name, body.copro-shell #topbarMenu a { color: var(--dashboard-ink); }
body.copro-shell #topbarMenu .tm-email { color: var(--dashboard-muted); }
body.copro-shell #topbarMenu a:hover { background: var(--dashboard-soft); }
body.copro-shell #notifDropdown { width: 350px !important; max-width: calc(100vw - 28px); background: var(--dashboard-surface) !important; border: 1px solid var(--dashboard-line) !important; border-radius: 14px !important; box-shadow: 0 16px 42px #30233f1c !important; backdrop-filter: none !important; }
body.copro-shell #notifDropdown > div { border-color: var(--dashboard-line) !important; }
body.copro-shell #notifDropdown > div:first-child > span, body.copro-shell .notif-title { color: var(--dashboard-ink) !important; }
body.copro-shell .notif-msg, body.copro-shell .notif-time { color: var(--dashboard-muted); }
body.copro-shell .notif-item { border-color: var(--dashboard-line); }
body.copro-shell .notif-item.unread, body.copro-shell .notif-item:hover { background: var(--dashboard-soft); }
body.copro-shell #impersonation-bar { position: relative !important; top: auto !important; right: auto !important; max-width: none !important; margin: 12px 24px 0; flex-shrink: 0; }
body.copro-shell.dark-mode { --dashboard-bg: #19151f; --dashboard-surface: #241e2e; --dashboard-soft: #2b2337; --dashboard-ink: #ede7f5; --dashboard-muted: #b8aec6; --dashboard-line: #3b3149; --dashboard-violet: #bea0f5; --dashboard-lavender: #342643; --dashboard-green: #91cfb3; --dashboard-red: #f3a0af; color-scheme: dark; }
body.copro-shell.dark-mode .sidebar-header img { filter: brightness(1.4); }
@media (max-width: 1150px) {
    body.copro-shell #dashboardTopbar .topbar-card { padding-inline: 23px; gap: 16px; }
    body.copro-shell #topbarProfile .name { display: none; }
}
@media (max-width: 900px) {
    body.copro-shell .dashboard-menu-toggle { display: inline-grid; place-items: center; flex: 0 0 38px; height: 38px; padding: 0; border: 1px solid var(--dashboard-line); border-radius: 9px; background: var(--dashboard-surface); color: var(--dashboard-violet); }
    body.copro-shell #sidebar { position: relative; width: 100%; height: auto; border-right: 0; border-bottom: 1px solid var(--dashboard-line); }
    .dashboard-js body.copro-shell #sidebar { position: fixed; width: min(290px, calc(100vw - 52px)); height: 100dvh; transform: translateX(-100%); transition: transform .22s ease; border-right: 1px solid var(--dashboard-line); }
    .dashboard-js body.copro-shell.sidebar-open #sidebar { transform: translateX(0); }
    body.copro-shell .close-menu { display: none; }
    .dashboard-js body.copro-shell .close-menu { display: block; align-self: flex-end; min-height: 44px; margin: 8px 13px 0; padding: 7px 11px; border: 0; border-radius: 8px; background: var(--dashboard-soft); color: var(--dashboard-muted); font-size: 11px; }
    .dashboard-js body.copro-shell .sidebar-scrim { display: block; position: fixed; inset: 0; z-index: 1090; background: #261b3e55; backdrop-filter: blur(3px); opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s; }
    .dashboard-js body.copro-shell.sidebar-open .sidebar-scrim { opacity: 1; visibility: visible; }
    body.copro-shell .sidebar-header { padding-top: 17px; }
    body.copro-shell .sidebar-panel { max-height: none; }
    body.copro-shell .panel-item { min-height: 44px; }
}
@media (max-width: 760px) {
    body.copro-shell #dashboardTopbar .topbar-card { min-height: calc(67px + env(safe-area-inset-top)); padding: calc(10px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); gap: 10px; }
    body.copro-shell .dashboard-topbar-context { flex: 1; }
    body.copro-shell .dashboard-topbar-context span { font-size: 9px; }
    body.copro-shell .dashboard-topbar-context strong { font-size: 12px; }
    body.copro-shell #topbarSearchToggle { display: inline-flex; }
    body.copro-shell #topbarSearchWrap { display: none; position: absolute; top: calc(100% + 8px); left: 14px; right: 14px; width: auto; max-width: none; padding: 0; margin: 0; z-index: 10; box-shadow: 0 7px 24px #30233f15; border-radius: 11px; }
    body.copro-shell #dashboardTopbar.search-open #topbarSearchWrap { display: block; }
    body.copro-shell #topbarSearchInput { height: 48px; font-size: 16px; background: var(--dashboard-surface); padding-right: 14px; }
    body.copro-shell .search-shortcut { display: none; }
    body.copro-shell #searchResults { max-height: 55svh; }
    body.copro-shell #notifDropdown { position: fixed !important; top: calc(76px + env(safe-area-inset-top)) !important; right: 14px !important; }
    body.copro-shell #topbarMenu { position: fixed; top: calc(76px + env(safe-area-inset-top)); right: 14px; left: auto; }
    body.copro-shell #dashboardTopbar .topbar-actions { gap: 4px; }
}
@media (max-width: 480px) {
    body.copro-shell #dashboardTopbar .topbar-chat { display: none; }
    body.copro-shell .dashboard-topbar-context { gap: 8px; }
    body.copro-shell #topbarProfile .caret { display: none; }
}

/* Ajustements mobiles des pages historiques (l'ancienne barre fixe de 60-70px n'existe plus) */
@media (max-width: 768px) {
    body.copro-shell:not(#coproDashboard) .index-content { margin-top: 0 !important; padding: 0 14px 16px !important; }
    body.copro-shell:not(#coproDashboard) .index-content > #dashboardTopbar { margin: 0 -14px 16px; width: auto; }
}
