:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --panel: #ffffff;
  --border: #e5e7eb;
  --text: #1a1a1a;
  --muted: #6b7280;
  --brand: #f5a623;
  --brand-dark: #d18b10;
  --brand-soft: #fff4dc;
  --ink: #1f1f1f;
  --green: #16a34a;
  --green-soft: #dcfce7;
  --amber: #d97706;
  --amber-soft: #fef3c7;
  --red: #dc2626;
  --red-soft: #fee2e2;
  --blue: #2563eb;
  --blue-soft: #dbeafe;
  --purple: #7c3aed;
  --purple-soft: #ede9fe;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.45; }
button { font-family: inherit; cursor: pointer; }
a { color: var(--brand-dark); }

/* Layout */
.app { min-height: 100vh; display: flex; }

/* Woneo logo */
.woneo-logo { display: inline-flex; align-items: baseline; font-weight: 700; font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif; letter-spacing: -0.01em; line-height: 1; }
.woneo-logo .w { font-family: 'Brush Script MT', 'Lucida Handwriting', 'Segoe Script', cursive; font-size: 1.8em; line-height: 0.8; font-weight: 400; margin-right: 0.05em; transform: translateY(0.08em); }
.woneo-logo .o-ring { display: inline-block; width: 0.9em; height: 0.9em; border: 0.22em solid var(--brand); border-radius: 50%; vertical-align: middle; margin: 0 0.04em; transform: translateY(0.05em); }
.woneo-logo .neo { font-size: 1.4em; font-weight: 700; }
.woneo-logo .group { font-size: 0.45em; letter-spacing: 0.22em; margin-left: 4px; color: var(--muted); font-weight: 600; align-self: flex-start; margin-top: 0.3em; }
.woneo-logo.dark .w, .woneo-logo.dark .neo { color: var(--ink); }
.woneo-logo.light .w, .woneo-logo.light .neo { color: #fff; }
.woneo-logo.light .group { color: rgba(255,255,255,0.6); }
.woneo-tagline { font-size: 10px; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; margin-top: 4px; }

/* Login */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%); padding: 24px; width: 100%; }
.login-card { background: white; border-radius: 16px; padding: 36px 32px 32px; max-width: 480px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.login-brand { text-align: center; margin-bottom: 22px; }
.login-brand .woneo-logo { font-size: 22px; }
.login-brand .woneo-tagline { font-size: 9px; }
.login h1 { margin: 0 0 4px; font-size: 18px; text-align: center; }
.login p.sub { margin: 0 0 24px; color: var(--muted); font-size: 13px; text-align: center; }
.login label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 6px; color: #374151; }
.login select, .login button.primary { width: 100%; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--border); font-size: 14px; background: white; font-family: inherit; }
.login button.primary { background: var(--ink); color: white; border-color: var(--ink); font-weight: 600; margin-top: 22px; transition: all .15s; }
.login button.primary:hover { background: #000; }
.login .role-grid { display: grid; gap: 8px; }
.login .role-opt { border: 2px solid var(--border); padding: 14px; border-radius: 10px; background: white; text-align: left; transition: all .15s; }
.login .role-opt:hover { border-color: var(--brand); }
.login .role-opt.active { border-color: var(--brand); background: var(--brand-soft); }
.login .role-opt .role-title { font-weight: 600; font-size: 14px; }
.login .role-opt .role-desc { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Sidebar */
.sidebar { width: 240px; background: var(--ink); flex-shrink: 0; position: sticky; top: 0; align-self: flex-start; height: 100vh; overflow-y: visible; display: flex; flex-direction: column; padding: 18px 12px 12px; transition: width .2s ease; }
.sidebar-toggle { position: absolute; top: 22px; right: -12px; width: 24px; height: 24px; background: white; border: 1px solid var(--border); border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--muted); z-index: 11; box-shadow: 0 2px 6px rgba(0,0,0,0.08); transition: all .15s; }
.sidebar-toggle:hover { color: var(--text); background: var(--bg); }
.sidebar-logo { padding: 0 8px 18px; border-bottom: 1px solid rgba(255,255,255,0.1); margin-bottom: 8px; }
.sidebar-logo .woneo-logo { font-size: 17px; }
.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.sidebar-category { font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em; color: rgba(255,255,255,0.35); margin: 18px 12px 6px; font-weight: 700; }
.sidebar-category:first-child { margin-top: 8px; }
.sidebar-nav a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 12px; border: none; background: transparent; border-radius: 8px; color: rgba(255,255,255,0.72); font-size: 13px; cursor: pointer; text-align: left; font-family: inherit; font-weight: 500; text-decoration: none; transition: all .15s; }
.sidebar-nav a:hover { background: rgba(255,255,255,0.08); color: white; }
.sidebar-nav a.active { background: var(--brand); color: var(--ink); font-weight: 600; }
.sidebar-nav a .ico { width: 18px; text-align: center; font-size: 14px; opacity: 0.95; flex-shrink: 0; }
.nav-group { display: flex; flex-direction: column; }
.nav-group-head { display: flex; align-items: center; justify-content: space-between; width: 100%; background: none; border: none; padding: 11px 12px; margin-top: 4px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em; color: rgba(255,255,255,0.42); font-weight: 700; cursor: pointer; font-family: inherit; border-radius: 8px; }
.nav-group-head:hover { color: rgba(255,255,255,0.8); background: rgba(255,255,255,0.05); }
.nav-group-head .chev { font-size: 9px; transition: transform .15s; }
.nav-group.open .nav-group-head .chev { transform: rotate(180deg); }
.nav-group-items { display: none; flex-direction: column; gap: 1px; }
.nav-group.open .nav-group-items { display: flex; }
.sidebar-user { margin-top: 12px; padding: 10px; border-top: 1px solid rgba(255,255,255,0.1); display: flex; align-items: center; gap: 10px; }
.sidebar-user .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: var(--ink); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.sidebar-user .user-info { flex: 1; min-width: 0; overflow: hidden; }
.sidebar-user .user-name { font-weight: 600; font-size: 13px; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .role-label { font-size: 11px; color: rgba(255,255,255,0.5); }
.sidebar-user .logout { background: rgba(255,255,255,0.06); border: none; color: rgba(255,255,255,0.6); font-size: 14px; padding: 4px 8px; border-radius: 6px; cursor: pointer; text-decoration: none; }
.sidebar-user .logout:hover { color: white; background: rgba(255,255,255,0.12); }

.sidebar.collapsed { width: 64px; padding: 18px 8px 12px; overflow-x: hidden; }
.sidebar.collapsed .sidebar-logo { padding: 0 4px 14px; text-align: center; }
.sidebar.collapsed .sidebar-logo .woneo-logo .w, .sidebar.collapsed .sidebar-logo .woneo-logo .neo, .sidebar.collapsed .sidebar-logo .woneo-logo .group { display: none; }
.sidebar.collapsed .sidebar-logo .woneo-logo { font-size: 14px; }
.sidebar.collapsed .sidebar-logo .woneo-logo .o-ring { display: inline-block; margin: 0; }
.sidebar.collapsed .sidebar-category { display: none; }
.sidebar.collapsed .nav-group-head { display: none; }
.sidebar.collapsed .nav-group-items { display: flex !important; }
.sidebar.collapsed .sidebar-nav a { padding: 10px 0; justify-content: center; }
.sidebar.collapsed .sidebar-nav a .ico { margin: 0; font-size: 16px; }
.sidebar.collapsed .sidebar-nav a > *:not(.ico) { display: none; }
.sidebar.collapsed .sidebar-user { padding: 8px 4px; justify-content: center; }
.sidebar.collapsed .sidebar-user .user-info, .sidebar.collapsed .sidebar-user .logout { display: none; }

.main-area { flex: 1; min-width: 0; position: relative; display: flex; flex-direction: column; }

/* Topbar */
.topbar-page { position: sticky; top: 0; z-index: 5; background: white; border-bottom: 1px solid var(--border); padding: 12px 24px; display: flex; align-items: center; gap: 12px; min-height: 58px; }
.topbar-page .breadcrumb { display: flex; align-items: baseline; gap: 8px; }
.topbar-page .breadcrumb .category { color: var(--muted); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }
.topbar-page .breadcrumb .sep { color: var(--muted); font-size: 12px; }
.topbar-page .breadcrumb .page { font-weight: 700; color: var(--text); font-size: 17px; }
.topbar-page .spacer { flex: 1; }
.company-switch label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-right: 6px; }

/* Notif */
.notif-wrap { position: relative; }
.quickadd-wrap { position: relative; margin-right: 10px; }
.quickadd-btn { width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: var(--ink); border: none; font-size: 22px; font-weight: 700; cursor: pointer; line-height: 1; display: flex; align-items: center; justify-content: center; transition: all .15s; }
.quickadd-btn:hover { background: var(--brand-dark); color: white; }
.quickadd-menu { position: absolute; top: 46px; right: 0; background: white; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 6px; min-width: 230px; z-index: 60; }
.quickadd-menu .qa-head { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 6px 10px 4px; }
.quickadd-menu a { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 7px; font-size: 13px; color: var(--text); text-decoration: none; }
.quickadd-menu a:hover { background: var(--brand-soft); }

.notif-btn { display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 10px; background: white; border: 1px solid var(--border); border-radius: 22px; cursor: pointer; font-size: 13px; transition: all .15s; font-family: inherit; }
.notif-btn:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.notif-btn.has-alert { background: #fef2f2; border-color: #fecaca; color: var(--red); }
.notif-btn.has-alert .label { font-weight: 600; color: var(--red); }
.notif-btn .bell { font-size: 15px; }
.notif-btn .count { background: var(--red); color: white; font-weight: 700; font-size: 11px; padding: 1px 7px; border-radius: 10px; min-width: 20px; text-align: center; }
.notif-btn.no-alert .count { background: var(--green); }
.notif-btn .label { color: var(--muted); font-size: 12px; }
.notif-dropdown { position: absolute; top: calc(100% + 8px); right: 0; width: 380px; max-height: 480px; overflow-y: auto; background: white; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,0.16); z-index: 100; }
.notif-dropdown .nh { padding: 14px 16px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: space-between; }
.notif-dropdown .nh .ncount { background: var(--red); color: white; font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: 700; }
.notif-dropdown .nb { padding: 6px; }
.notif-dropdown .item { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 8px; cursor: pointer; transition: background .1s; }
.notif-dropdown .item:hover { background: var(--bg); }
.notif-dropdown .item .it-name { font-weight: 600; font-size: 13px; display: flex; justify-content: space-between; gap: 8px; }
.notif-dropdown .item .it-meta { font-size: 12px; color: var(--muted); }
.notif-dropdown .item .it-days { font-size: 11px; color: var(--red); font-weight: 700; }
.notif-dropdown .empty { padding: 32px 20px; text-align: center; color: var(--muted); font-size: 13px; }

/* Content */
.content { padding: 20px; flex: 1; max-width: 1500px; margin: 0 auto; width: 100%; }
h2.view-title { margin: 0 0 4px; font-size: 22px; font-weight: 700; }
p.view-sub { margin: 0 0 20px; color: var(--muted); font-size: 13px; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.kpi .label { font-size: 12px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .03em; }
.kpi .value { font-size: 24px; font-weight: 700; margin-top: 6px; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.kpi.brand .value { color: var(--brand-dark); }
.kpi.green .value { color: var(--green); }
.kpi.amber .value { color: var(--amber); }
.kpi.red .value { color: var(--red); }
.kpi.ink .value { color: var(--ink); }

/* Panel */
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 18px; margin-bottom: 16px; }
.panel h3 { margin: 0 0 12px; font-size: 15px; font-weight: 600; }
.panel .panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
.panel .panel-head h3 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }
.chart-container { position: relative; height: 280px; }

.stat-synth { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat-synth .ss-item { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 14px; text-align: center; }
.stat-synth .ss-v { font-size: 24px; font-weight: 700; color: var(--brand-dark); }
.stat-synth .ss-l { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* Filters */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.filters select, .filters input { padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: white; font-size: 13px; font-family: inherit; }
.filters input[type=search] { min-width: 200px; }
.filters label { font-size: 12px; color: var(--muted); font-weight: 500; }

/* View toggle */
.view-toggle { display: inline-flex; background: var(--bg); border-radius: 8px; padding: 3px; }
.view-toggle button { background: transparent; border: none; padding: 6px 12px; font-size: 13px; color: var(--muted); border-radius: 6px; font-weight: 500; }
.view-toggle button.active { background: white; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* Badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.purple { background: var(--purple-soft); color: var(--purple); }
.badge.gray { background: #f1f5f9; color: #475569; }
.badge.orange { background: var(--brand-soft); color: var(--brand-dark); }
.badge.pulse { animation: pulse 1.8s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.6; } }

/* Data table */
.dt-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { background: var(--bg); font-weight: 600; padding: 9px 12px; text-align: left; white-space: nowrap; cursor: pointer; user-select: none; }
.data-table th .arrow { color: var(--muted); font-size: 10px; margin-left: 4px; }
.data-table td { padding: 9px 12px; border-top: 1px solid var(--border); vertical-align: middle; }
.data-table tr.clickable { cursor: pointer; }
.data-table tr.clickable:hover td { background: var(--brand-soft); }
.dt-pagination { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; font-size: 13px; color: var(--muted); }
.dt-pagination button { padding: 4px 10px; border: 1px solid var(--border); border-radius: 6px; background: white; font-size: 12px; }
.dt-pagination button:disabled { opacity: .4; cursor: not-allowed; }

/* Client cards */
.client-list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.client-card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px; transition: all .15s; cursor: pointer; }
.client-card:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.06); }
.client-card .c-name { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.client-card .c-siren { font-size: 11px; color: var(--muted); }
.client-card .c-stats { display: flex; gap: 12px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 12px; }
.client-card .c-stats .stat { flex: 1; }
.client-card .c-stats .stat .v { font-weight: 600; font-size: 14px; }
.client-card .c-stats .stat .l { color: var(--muted); font-size: 11px; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal { background: white; border-radius: 14px; max-width: 720px; width: 100%; max-height: 90vh; overflow: auto; }
.modal-header { padding: 18px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { margin: 0; font-size: 17px; }
.modal-header button.close { background: none; border: none; font-size: 22px; color: var(--muted); padding: 4px 8px; border-radius: 6px; cursor: pointer; line-height: 1; }
.modal-header button.close:hover { background: var(--bg); }
.modal-body { padding: 20px; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

/* Form */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }
.form-field { display: flex; flex-direction: column; gap: 4px; }
.form-field.span-2 { grid-column: span 2; }
.form-field label { font-size: 12px; font-weight: 600; color: var(--muted); }
.form-field input, .form-field select { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; font-family: inherit; }
.form-field input:focus, .form-field select:focus { outline: none; border-color: var(--brand); }
.form-field .check { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.form-field .check input { width: 18px; height: 18px; }
.form-field .help { font-size: 11px; color: var(--muted); }

/* Alerts */
.alert-banner { background: var(--red-soft); border: 1px solid #fecaca; color: var(--red); padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; font-size: 13px; }
.alert-banner.amber { background: var(--amber-soft); border-color: #fcd34d; color: var(--amber); }
.error-msg { background: var(--red-soft); color: var(--red); padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; }
.success-msg { background: var(--green-soft); color: var(--green); padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; font-size: 13px; font-weight: 500; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); font-size: 13px; }

/* Buttons */
button.btn { padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border); background: white; font-size: 13px; font-weight: 500; cursor: pointer; transition: all .15s; }
button.btn:hover { background: var(--bg); }
button.btn.primary { background: var(--ink); color: white; border-color: var(--ink); }
button.btn.primary:hover { background: #000; }
button.btn.brand { background: var(--brand); color: var(--ink); border-color: var(--brand); }
button.btn.brand:hover { background: var(--brand-dark); color: white; }
button.btn.danger { color: var(--red); border-color: var(--red-soft); }
button.btn.danger:hover { background: var(--red-soft); }
button.btn.small { padding: 4px 10px; font-size: 12px; }
button.btn.ghost { border-color: transparent; color: var(--muted); }
button.btn.ghost:hover { background: var(--bg); color: var(--text); }
.input { padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; font-family: inherit; background: white; }
.input:focus { outline: none; border-color: var(--brand); }

/* Objectifs */
.obj-row { display: grid; grid-template-columns: 120px 1fr 160px 80px; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.obj-row:last-child { border-bottom: none; }
.obj-row .obj-name { font-weight: 600; }
.obj-bar { background: var(--bg); height: 8px; border-radius: 4px; overflow: hidden; }
.obj-bar .obj-fill { height: 100%; background: var(--brand); transition: width .3s; }
.obj-bar .obj-fill.over { background: var(--green); }
.obj-bar .obj-fill.warn { background: var(--amber); }
.obj-bar .obj-fill.low { background: var(--red); }
.obj-val { text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; }
.obj-pct { text-align: right; font-weight: 600; font-size: 13px; }

/* Settings */
.settings-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; flex-wrap: wrap; }
.settings-tabs button, .settings-tabs a { background: transparent; border: none; padding: 10px 16px; font-size: 13px; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; text-decoration: none; font-family: inherit; }
.settings-tabs button:hover, .settings-tabs a:hover { color: var(--text); }
.settings-tabs button.active, .settings-tabs a.active { color: var(--brand-dark); border-bottom-color: var(--brand); }
.commercial-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.commercial-row:last-child { border-bottom: none; }
.commercial-row .name { font-weight: 500; }
.commercial-row .badge-list { display: flex; gap: 6px; flex-wrap: wrap; }
.group-card { border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 10px; }
.group-card .group-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; flex-wrap: wrap; gap: 8px; }
.group-card .group-head .name { font-weight: 600; }
.group-card .members { display: flex; flex-wrap: wrap; gap: 6px; }
.group-card .member-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--bg); border: 1px solid var(--border); padding: 3px 8px; border-radius: 12px; font-size: 12px; }
.group-card .member-chip button { background: none; border: none; color: var(--muted); padding: 0; cursor: pointer; font-size: 14px; line-height: 1; }
.group-card .member-chip button:hover { color: var(--red); }
.obj-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.obj-table th, .obj-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: right; }
.obj-table th { background: var(--bg); font-weight: 600; text-align: center; position: sticky; top: 0; }
.obj-table th.name, .obj-table td.name { text-align: left; font-weight: 600; }
.obj-table input { width: 88px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; text-align: right; font-size: 12px; font-family: inherit; }
.obj-table-wrapper { overflow-x: auto; max-height: 600px; overflow-y: auto; }

/* Column picker */
.col-picker { position: relative; display: inline-block; }
.col-picker-btn { padding: 7px 12px; border: 1px solid var(--border); border-radius: 8px; background: white; cursor: pointer; font-size: 13px; font-family: inherit; }
.col-picker-btn:hover { background: var(--bg); }
.col-picker-dropdown { position: absolute; top: calc(100% + 4px); right: 0; width: 220px; background: white; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.1); padding: 8px; z-index: 30; }
.col-picker-dropdown .cph { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; padding: 4px 8px 6px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.col-picker-dropdown label { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.col-picker-dropdown label:hover { background: var(--bg); }
.col-picker-dropdown input { margin: 0; width: 16px; height: 16px; }

/* Trésorerie */
.treso-input { width: 110px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; text-align: right; font-size: 12px; font-family: inherit; font-variant-numeric: tabular-nums; }
.treso-input:focus { outline: none; border-color: var(--brand); }
.treso-input:hover { border-color: var(--brand); }
.treso-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.treso-table th { white-space: nowrap; background: var(--bg); padding: 8px; }

.loader { text-align: center; padding: 60px 20px; color: var(--muted); }
.table-wrapper { overflow-x: auto; }

/* ==================================================================
   Fiche client détaillée (modale Clients)
   ================================================================== */
.modal.modal-wide { max-width: 1280px; width: 95vw; height: 90vh; display: flex; flex-direction: column; overflow: hidden; }
.modal.modal-wide .modal-header { flex-shrink: 0; }
.modal.modal-wide .modal-body { flex: 1; overflow-y: auto; padding: 24px 28px; }

.cd-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.cd-stat { flex: 1; min-width: 120px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 9px 14px; }
.cd-stat .l { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .03em; }
.cd-stat .v { font-weight: 700; font-size: 15px; margin-top: 2px; }

.cd-cols { display: flex; gap: 18px; align-items: flex-start; }
.cd-main { flex: 1.35; min-width: 0; }
.cd-side { flex: 1; min-width: 0; }
@media (max-width: 820px) { .cd-cols { flex-direction: column; } }

.cd-section { margin-bottom: 20px; }
.cd-section > h4 { margin: 0 0 8px; font-size: 13px; font-weight: 700; display: flex; justify-content: space-between; align-items: baseline; }
.cd-section > h4 .muted { color: var(--muted); font-weight: 500; font-size: 12px; }
.cd-empty { color: var(--muted); font-size: 13px; padding: 10px 2px; list-style: none; }

/* Tâches */
.cd-task-form { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.cd-task-form input, .cd-task-form select { border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; font-size: 13px; font-family: inherit; background: white; }
.cd-task-form input[type=text] { flex: 1; min-width: 130px; }
.cd-task-form input:focus, .cd-task-form select:focus { outline: none; border-color: var(--brand); }
.cd-task-list { list-style: none; margin: 0; padding: 0; }
.cd-task { display: flex; align-items: flex-start; gap: 9px; padding: 8px 0; border-top: 1px solid var(--border); }
.cd-task:first-child { border-top: none; }
.cd-task input[type=checkbox] { margin-top: 2px; cursor: pointer; width: 15px; height: 15px; flex-shrink: 0; }
.cd-task .tk-body { flex: 1; min-width: 0; }
.cd-task .tk-text { font-size: 13px; cursor: pointer; }
.cd-task.done .tk-text { text-decoration: line-through; color: var(--muted); }
.cd-task .tk-due { font-size: 11px; color: var(--brand-dark); white-space: nowrap; }
.cd-task .tk-caret { color: var(--muted); font-size: 10px; margin-left: 5px; }
.cd-task .tk-detail { margin-top: 7px; padding: 9px 12px; background: var(--bg); border-radius: 8px; font-size: 12px; display: flex; flex-direction: column; gap: 4px; }
.cd-task .tk-detail .tk-dl { display: inline-block; min-width: 92px; color: var(--muted); text-transform: uppercase; font-size: 10px; letter-spacing: .03em; }
.cd-task .tk-detail .tk-d-notes { white-space: pre-wrap; word-wrap: break-word; }
.cd-ex.cd-ex-task .ex-ico { background: var(--blue-soft); }
.cd-ex.cd-ex-task.done .ex-text { text-decoration: line-through; color: var(--muted); }
.cd-task .tk-del { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 13px; padding: 0 4px; line-height: 1; }
.cd-task .tk-del:hover { color: var(--red); }

/* Feed des échanges */
.cd-ex-form { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.cd-ex-form textarea { width: 100%; resize: vertical; min-height: 48px; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 13px; font-family: inherit; }
.cd-ex-form textarea:focus { outline: none; border-color: var(--brand); }
.cd-ex-form .row { display: flex; align-items: center; gap: 6px; width: 100%; }
.cd-ex-form select,
.cd-ex-form .row input[type=date] { border: 1px solid var(--border); border-radius: 8px; padding: 6px 9px; font-size: 13px; font-family: inherit; background: white; }
.cd-ex-form .row input[type=date]:focus { outline: none; border-color: var(--brand); }
.cd-feed { max-height: 48vh; overflow: auto; }
.cd-ex { display: flex; gap: 10px; padding: 11px 0; border-top: 1px solid var(--border); }
.cd-ex:first-child { border-top: none; }
.cd-ex .ex-ico { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 14px; }
.cd-ex .ex-body { flex: 1; min-width: 0; }
.cd-ex .ex-meta { font-size: 11px; color: var(--muted); margin-bottom: 3px; display: flex; gap: 6px; flex-wrap: wrap; }
.cd-ex .ex-meta strong { color: var(--text); }
.cd-ex .ex-text { font-size: 13px; white-space: pre-wrap; word-wrap: break-word; }
.cd-ex .ex-del { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 13px; padding: 0 4px; line-height: 1; align-self: flex-start; }
.cd-ex .ex-del:hover { color: var(--red); }

/* Panneau latéral à onglets */
.cd-side-tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.cd-side-tabs button { background: none; border: none; padding: 8px 9px; font-size: 12px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; }
.cd-side-tabs button:hover { color: var(--text); }
.cd-side-tabs button.active { color: var(--brand-dark); border-bottom-color: var(--brand); }

/* Onglet Catégories */
.cd-cat-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.cd-cat-chip { display: flex; align-items: center; gap: 5px; border: 1px solid var(--border); border-radius: 10px; padding: 5px 9px; background: var(--bg); }
.cd-cat-chip .cc-n { font-weight: 700; font-size: 12px; }
.cd-cat-chip .cc-l { color: var(--muted); font-size: 11px; }
.cd-cat-sub { font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.cd-ord-list { list-style: none; margin: 0; padding: 0; }
.cd-ord { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--border); font-size: 12px; }
.cd-ord:first-child { border-top: none; }
.cd-ord .o-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-ord .o-amt { font-weight: 600; white-space: nowrap; }
.cd-ord select { border: 1px solid var(--border); border-radius: 6px; padding: 3px 6px; font-size: 11px; font-family: inherit; background: white; max-width: 120px; }
.cd-ord select:focus { outline: none; border-color: var(--brand); }

/* ==================================================================
   Prospects
   ================================================================== */
.form-field textarea { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; font-family: inherit; resize: vertical; }
.form-field textarea:focus { outline: none; border-color: var(--brand); }

.pr-banner { background: var(--green-soft); color: #166534; border: 1px solid #bbf7d0; border-radius: 10px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px; }
.pr-banner a { color: #166534; font-weight: 700; }

.pr-notes { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; }
.pr-notes .l { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 3px; }
.pr-notes div:last-child { font-size: 13px; white-space: pre-wrap; word-wrap: break-word; }

.form-hint { font-size: 11px; color: var(--muted); margin: 10px 0 0; }

/* Contacts rattachés à une entreprise */
.cd-contact-form { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.cd-contact-form input { flex: 1; min-width: 110px; border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; font-size: 13px; font-family: inherit; }
.cd-contact-form input:focus { outline: none; border-color: var(--brand); }
.cd-contact-form button { flex-shrink: 0; }
.cd-contact-list { list-style: none; margin: 0; padding: 0; }
.cd-contact { display: flex; align-items: flex-start; gap: 8px; padding: 10px 8px; border-top: 1px solid var(--border); cursor: pointer; border-radius: 6px; }
.cd-contact:first-child { border-top: none; }
.cd-contact:hover { background: var(--brand-soft); }
.cd-contact .ct-info { flex: 1; min-width: 0; }
.cd-contact .ct-nom { font-size: 13px; font-weight: 600; }
.cd-contact .ct-fn { font-size: 12px; color: var(--muted); margin-top: 2px; }
.cd-contact .ct-notes { font-size: 12px; color: var(--muted); margin-top: 3px; white-space: pre-wrap; word-wrap: break-word; }
.cd-contact .ct-coord { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; font-size: 12px; }
.cd-contact .ct-side { display: flex; flex-direction: column; gap: 3px; align-items: flex-end; text-align: right; font-size: 12px; flex-shrink: 0; max-width: 46%; }
.cd-contact .ct-side a { color: var(--brand-dark); text-decoration: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-contact .ct-side a:hover { text-decoration: underline; }

/* Onglets de la fiche (Échanges / Tâches / Contacts / …) */
.cd-tabs { margin-top: 4px; }
.cd-tabs .tab-n { display: inline-block; background: var(--bg); color: var(--muted); font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 9px; margin-left: 3px; }
.cd-tabs button.active .tab-n { background: var(--brand-soft); color: var(--brand-dark); }
.cd-tab-body { min-height: 220px; }

/* ==================================================================
   Page Tâches — liste + calendrier
   ================================================================== */
.task-row .tk-check { width: 16px; height: 16px; cursor: pointer; }
.task-row.is-done .tk-txt { text-decoration: line-through; color: var(--muted); }
.tk-late { color: var(--red); font-weight: 600; }
.tk-del-btn { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 13px; padding: 2px 6px; line-height: 1; }
.tk-del-btn:hover { color: var(--red); }

.cal-wrap { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding: 4px 0; }
.cal-cell { min-height: 96px; border: 1px solid var(--border); border-radius: 8px; padding: 5px; background: var(--bg); overflow: hidden; }
.cal-cell.cal-empty { background: transparent; border: none; }
.cal-cell.cal-today { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.cal-num { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.cal-task { font-size: 11px; background: var(--brand-soft); color: var(--brand-dark); border-radius: 4px; padding: 2px 6px; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-task.done { background: var(--green-soft); color: var(--green); text-decoration: line-through; }

/* Parc client */
.parc-avenant-row td { background: var(--bg); }
.parc-avenant-row td:first-child { padding-left: 24px; }
.parc-sub { color: var(--muted); margin-right: 2px; }
.parc-dir-sep { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--brand-dark); border-top: 1px solid var(--border); padding-top: 10px; margin-top: 2px; }
.parc-reste { font-size: 11px; color: var(--brand-dark); font-weight: 600; }
.cd-contact .ct-coord a { color: var(--brand-dark); text-decoration: none; }
.cd-contact .ct-coord a:hover { text-decoration: underline; }
.cd-contact .ct-del { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 13px; padding: 0 4px; line-height: 1; }
.cd-contact .ct-del:hover { color: var(--red); }

/* Opportunités liées (Pipe) */
.cd-opp-list { list-style: none; margin: 0; padding: 0; }
.cd-opp { padding: 9px 0; border-top: 1px solid var(--border); }
.cd-opp:first-child { border-top: none; }
.cd-opp .op-top { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.cd-opp .op-mois { font-size: 12px; color: var(--muted); }
.cd-opp .op-fig { font-size: 12px; }
.cd-opp .op-notes { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: pre-wrap; word-wrap: break-word; }

/* Onglet Contrats (Parc client) dans les fiches */
.cd-contrat-list { list-style: none; margin: 0; padding: 0; }
.cd-contrat { padding: 9px 0; border-top: 1px solid var(--border); }
.cd-contrat:first-child { border-top: none; }
.cd-contrat.is-av { padding-left: 16px; }
.cd-contrat .cn-head { font-size: 13px; margin-bottom: 3px; cursor: pointer; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.cd-contrat .cn-head:hover { color: var(--brand-dark); }
.cd-contrat .cn-toggle { margin-left: auto; color: var(--muted); font-size: 11px; }
.cd-contrat .cn-fig { font-size: 12px; color: var(--muted); }
.cd-contrat .cn-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin-top: 9px; padding: 11px 13px; background: var(--bg); border-radius: 8px; }
.cd-contrat .cn-d { display: flex; flex-direction: column; gap: 1px; }
.cd-contrat .cn-dl { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.cd-contrat .cn-dv { font-size: 13px; font-weight: 600; }
.cd-contrat .cn-notes { margin-top: 8px; padding: 9px 13px; background: var(--bg); border-radius: 8px; font-size: 12px; white-space: pre-wrap; word-wrap: break-word; }
.cn-link { display: inline-block; margin-top: 12px; font-size: 13px; color: var(--brand-dark); font-weight: 600; text-decoration: none; }
.cn-link:hover { text-decoration: underline; }
