.report-shell { display:grid; gap:14px; padding:14px; max-width:1600px; margin:auto; }
.report-workspace { display:grid; grid-template-columns:260px minmax(0,1fr); gap:14px; align-items:start; }
.report-status { color:var(--text); background:var(--panel); border-left:3px solid var(--primary); padding:10px; }
.report-status:empty { display:none; }
.report-publication-state { display:flex; flex-wrap:wrap; align-items:center; gap:8px 16px; padding:12px 14px; margin-bottom:14px; border:1px solid var(--border); border-left:4px solid var(--primary); background:var(--panel); color:var(--text); font-size:13px; }
.report-publication-state[data-published="true"] { border-left-color:var(--success,#00a65a); }
.report-publication-state strong { font-size:14px; }
.report-publication-state .btn { margin-left:auto; }
.report-calculating { display:flex; align-items:center; gap:16px; margin-top:14px; padding:24px; min-height:110px; box-sizing:border-box; border:1px solid var(--border); border-left:4px solid var(--primary); background:var(--panel); color:var(--text); }
.report-calculating strong { font-size:16px; }
.report-calculating p { margin:6px 0 0; font-size:13px; }
.report-calculating-spinner { flex:0 0 32px; width:32px; height:32px; border:4px solid var(--border); border-top-color:var(--primary); border-right-color:var(--primary); border-radius:50%; animation:report-calculating-spin .9s linear infinite; }
@keyframes report-calculating-spin { to { transform:rotate(360deg); } }
@media (prefers-reduced-motion:reduce) { .report-calculating-spinner { animation:none; } }
.report-list { display:grid; gap:6px; margin-top:12px; }
.report-list button { text-align:left; white-space:normal; }
.report-source { min-height:140px; font-family:Consolas,monospace; }
.report-columns { overflow:auto; }
.report-columns input,.report-columns select { max-width:180px; }
.report-output { overflow:auto; max-height:65vh; }
.report-output table { border-collapse:collapse; width:100%; font-size:12px; }
.report-output th,.report-output td { padding:8px 10px; text-align:left; border:1px solid var(--border); white-space:nowrap; }
.report-output th { position:sticky; top:0; background:var(--panel-alt); }
.report-output tfoot { font-weight:600; background:var(--panel-alt); }
.report-schedule-section { border:1px solid var(--border); padding:14px; background:var(--panel); margin-top:14px; }
.report-schedule-section:empty { display:none; }
.report-schedule-section [hidden] { display:none!important; }
.report-schedule-section h3 { margin:0; font-size:15px; }
.report-schedule-section summary { cursor:pointer; font-weight:600; padding:4px 0; }
.report-schedule-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; margin:14px 0; }
.report-schedule-grid label { display:grid; gap:6px; align-content:start; }
.report-schedule-section input:not([type=checkbox]),.report-schedule-section select,.report-schedule-section textarea { width:100%; min-height:34px; }
.report-schedule-section .report-check { display:flex; align-items:center; gap:8px; min-height:34px; }
.report-history-table { overflow:auto; margin:14px 0; }
.report-history-table table { width:100%; border-collapse:collapse; }
.report-history-table th,.report-history-table td { padding:10px; border-bottom:1px solid var(--border); text-align:left; font-size:12px; }
.report-history-table th { background:var(--panel-alt); }
.report-history-table small { display:block; color:var(--text-soft); margin-top:4px; }
.report-run-state { display:inline-block; padding:4px 7px; background:var(--panel-alt); border:1px solid var(--border); }
.report-run-state.is-error { color:var(--danger); }
.report-parameters { display:grid; grid-template-columns:minmax(100px,1fr) 2fr; gap:8px; overflow-wrap:anywhere; }
.report-parameters dd { margin:0; }
@media(max-width:650px) { .report-schedule-grid { grid-template-columns:1fr; } }
@media(max-width:800px) { .report-workspace { grid-template-columns:1fr; } .report-shell { padding:8px; } }
.report-schedule-section { min-width:0; }
#report-editor [hidden] { display:none!important; }
.report-navigation { border-bottom:1px solid var(--border); padding-bottom:12px; margin-bottom:4px; }
.report-schedule-section [data-dates] .toolbar { display:grid; grid-template-columns:minmax(0,1fr) auto; margin-bottom:8px; }
/* Report pages use the same palette as the Studio, including published themes. */
body.query-builder-page.report-page[data-theme] {
 --bg:var(--adm-bg);--bg-alt:var(--adm-input-bg,var(--adm-bg));
 --panel:var(--adm-panel);--panel-alt:var(--adm-surface-2);--panel-soft:var(--adm-surface-2);
 --border:var(--adm-border);--border-strong:var(--adm-border);
 --text:var(--adm-text);--text-soft:var(--adm-text-soft);--muted:var(--adm-text-soft);
 --primary:var(--adm-primary);--primary-soft:var(--adm-primary-soft);
 --success:var(--adm-success);--warning:var(--adm-warning);--danger:var(--adm-danger);
 background-color:var(--adm-bg);color:var(--adm-text);
}
.report-page .report-shell > header .toolbar { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.report-page .report-shell > header .toolbar .select { width:auto; min-width:160px; }
.report-page .report-workspace > * { min-width:0; }
@layer sysimple-actions {
 body.query-builder-page.report-page #reports-app [data-save] {
  background:var(--adm-primary)!important;border-color:var(--adm-primary)!important;
  color:var(--brand-primary-text,var(--action-on-fill))!important;
 }
}
.report-builder h2,.report-builder h3 { margin:0; }
.report-builder h2 { font-size:19px; }
.report-builder h3 { font-size:14px; }
.report-builder { display:grid; gap:14px; }
.report-builder label { display:grid; gap:6px; min-width:0; font-weight:600; font-size:12px; }
.report-builder .input,.report-builder .select { width:100%; min-height:34px; min-width:0; }
.report-builder .toolbar { display:flex; gap:6px; flex-wrap:wrap; }
.report-eyebrow { font-size:10px; letter-spacing:.08em; color:var(--text-soft); margin:0 0 4px; }
.report-builder-intro { border-left:3px solid var(--primary); padding:10px 12px; background:var(--panel-alt); margin-bottom:14px; }
.report-builder-intro p { margin:6px 0 0; color:var(--text-soft); }
.report-step { padding:12px; border:1px solid var(--border); background:var(--panel); display:grid; gap:10px; }
.report-source-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.report-designer { display:grid; grid-template-columns:230px minmax(0,1fr); gap:14px; margin:14px 0; align-items:start; }
.report-field-panel { position:sticky; top:14px; padding:12px; background:var(--panel-alt); border:1px solid var(--border); display:grid; gap:10px; }
.report-field-list { max-height:58vh; overflow:auto; display:grid; gap:4px; }
.report-field { display:flex; justify-content:space-between; gap:8px; padding:8px; min-height:34px; border:1px solid var(--border); background:var(--panel); color:var(--text); text-align:left; cursor:pointer; overflow-wrap:anywhere; }
.report-field:disabled { color:var(--text-soft); cursor:default; }
.report-field:hover:not(:disabled) { border-color:var(--primary); background:var(--primary-soft); }
.report-composition { display:grid; gap:14px; min-width:0; }
.report-selected { display:flex; justify-content:space-between; align-items:center; gap:8px; padding:6px 8px; border-bottom:1px solid var(--border); overflow-wrap:anywhere; }
.report-selected > span { min-width:0; }
.report-config-row { display:grid; gap:10px; padding:10px; border:1px solid var(--border); background:var(--panel-alt); margin-top:8px; }
.report-remove { justify-self:end; }
.report-row { display:flex; flex-wrap:wrap; align-items:end; gap:8px; }
.report-row label { flex:1; }
.report-empty { padding:14px; border:1px dashed var(--border); color:var(--text-soft); }
.report-preview { padding:14px; border:1px solid var(--border); border-top:3px solid var(--primary); display:grid; gap:12px; }
.report-warning { padding:10px; border-left:3px solid var(--warning); background:var(--panel-alt); }
.report-catalog-search { margin-top:12px; display:grid; gap:6px; }
.report-page [hidden] { display:none!important; }
.report-builder [data-panel][aria-pressed=true] { border-color:var(--primary); background:var(--primary-soft); }
.report-builder :is(button,input,select):focus-visible { outline:2px solid var(--primary); outline-offset:2px; }
.report-page .report-shell { max-width:1800px; }
.report-page .report-workspace { grid-template-columns:220px minmax(0,1fr); }
@media(max-width:1150px) { .report-designer { grid-template-columns:190px minmax(0,1fr); } .report-source-grid { grid-template-columns:1fr; } }
@media(max-width:850px) { .report-page .report-workspace,.report-designer { grid-template-columns:1fr; } .report-field-panel { position:static; } .report-field-list { max-height:230px; } .report-step .inline-meta,.report-selected { flex-wrap:wrap; } }
.report-builder,.report-builder > *,.report-designer > * { min-width:0; }
/* Compact work area: one task at a time, with persistent commands and feedback. */
.report-page .report-shell { padding-bottom:100px; }
.report-command-bar { position:sticky; top:0; z-index:20; display:grid; gap:10px; background:var(--panel); border-bottom:1px solid var(--border); border-top:3px solid var(--primary); padding:10px; box-shadow:0 4px 12px #0002; }
.report-command-bar > .inline-meta { flex-wrap:wrap; gap:8px; }
.report-command-bar > label.field { display:grid; grid-template-columns:auto minmax(160px,1fr); align-items:center; max-width:720px; }
.report-command-bar .report-eyebrow { display:none; }
.report-command-bar .report-navigation { padding-bottom:8px; margin:0; }
.report-work-tabs { display:flex; flex-wrap:wrap; gap:6px; }
.report-work-tabs .btn { display:inline-flex; align-items:center; gap:7px; }
.report-work-tabs svg { width:18px; height:18px; color:var(--primary); }
.report-work-tabs small:empty { display:none; }
.report-work-tabs small { border:1px solid var(--border); background:var(--panel); min-width:19px; padding:1px 4px; }
.report-context-summary { color:var(--text-soft); font-size:12px; overflow-wrap:anywhere; }
.report-builder [data-work-section] { display:grid; gap:10px; min-width:0; scroll-margin-top:240px; }
.report-builder [data-work-section] > * { min-width:0; max-width:100%; }
.report-builder .report-preview > .inline-meta { flex-wrap:wrap; gap:8px; min-width:0; }
.report-builder .report-preview [data-preview-result] { min-width:0; max-width:100%; }
.report-page #reports-app .btn > svg { width:17px; height:17px; vertical-align:middle; flex:none; margin-right:6px; }
.report-page #reports-app .report-work-tabs .btn > svg { margin-right:0; }
.report-builder .report-designer { margin:0; }
.report-builder .report-field-panel { position:static; }
.report-builder .report-step { border-top:3px solid var(--primary); }
.report-builder .report-step > h3,.report-builder .report-step > .inline-meta { background:var(--panel-alt); padding:8px; border-bottom:1px solid var(--border); }
.report-source-next { justify-self:end; }
.report-page #report-status:not(:empty) { position:fixed; z-index:1100; bottom:16px; right:20px; width:max-content; max-width:min(760px,calc(100vw - 40px)); max-height:25vh; overflow:auto; display:flex; align-items:center; gap:16px; padding:12px 14px; border:1px solid var(--border); border-left:4px solid var(--primary); box-shadow:0 6px 24px #0004; }
.report-page #report-status > span { white-space:pre-wrap; overflow-wrap:anywhere; }
.report-page #report-status > button { flex:none; min-width:34px; }
.report-page #report-status[data-kind="error"] { border-left-color:var(--danger); background:color-mix(in srgb,var(--danger) 16%,var(--panel)); }
.report-page #report-status[data-kind="error"] > span::before { content:'⚠ Erreur : '; font-weight:700; }
.report-page #report-status[data-kind="warning"] { border-left-color:var(--warning); background:color-mix(in srgb,var(--warning) 10%,var(--panel)); }
@layer sysimple-actions {
 body.query-builder-page.report-page #reports-app [data-report-tone="primary"] { background:#287caf!important; border-color:#287caf!important; color:#fff!important; }
 body.query-builder-page.report-page #reports-app [data-report-tone="save"] { background:#008548!important; border-color:#008548!important; color:#fff!important; }
 body.query-builder-page.report-page #reports-app [data-report-tone="publish"] { background:color-mix(in srgb,#00a65a 15%,var(--panel))!important; border-color:var(--success)!important; color:var(--text)!important; }
 body.query-builder-page.report-page #reports-app [data-report-tone="add"] { background:color-mix(in srgb,#3c8dbc 18%,var(--panel))!important; border-color:#3c8dbc!important; color:var(--text)!important; }
 body.query-builder-page.report-page #reports-app [data-report-tone="remove"] { background:color-mix(in srgb,var(--danger) 10%,var(--panel))!important; border-color:var(--danger)!important; color:var(--text)!important; }
 body.query-builder-page.report-page #reports-app :is([data-work-tab],[data-panel])[aria-pressed="true"] { background:color-mix(in srgb,#3c8dbc 18%,var(--panel))!important; border-color:#3c8dbc!important; box-shadow:inset 0 -3px #3c8dbc!important; color:var(--adm-text)!important; }
}
@media(max-width:650px) {
 .report-command-bar { padding:8px; gap:7px; }
 .report-command-bar h2 { font-size:16px; }
 .report-command-bar > label.field { grid-template-columns:1fr; }
 .report-command-bar .report-work-tabs { flex-wrap:nowrap; overflow-x:auto; padding-bottom:4px; }
 .report-work-tabs .btn { flex:none; }
 .report-context-summary { max-height:40px; overflow:auto; }
 .report-page #report-status:not(:empty) { bottom:8px; right:8px; max-width:calc(100vw - 16px); }
 .report-builder .report-field-list { max-height:220px; }
}
.report-planner { display:grid; gap:14px; min-width:0; }
.report-plan-card { border:1px solid var(--border); background:var(--panel); padding:14px; min-width:0; }
.report-plan-card h4 { display:flex; align-items:center; gap:9px; font-size:14px; margin:0 0 14px; padding-bottom:10px; border-bottom:1px solid var(--border); }
.report-plan-icon { width:19px; height:19px; flex:none; vertical-align:middle; }
.report-plan-state { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px; padding:10px 14px; border-left:3px solid var(--primary); background:var(--panel-alt); }
.report-planner label:not(.report-check) { display:grid; gap:6px; min-width:0; font-size:12px; font-weight:600; }
.report-planner .report-check { display:flex; align-items:center; gap:8px; }
.report-planner .input,.report-planner .select,.report-planner .textarea { min-width:0; width:100%; min-height:34px; box-sizing:border-box; }
.report-planner .hint { font-weight:400; line-height:1.5; }
.report-planner [hidden] { display:none!important; }
.report-planner :is(input,select,textarea,button,a):focus-visible { outline:2px solid var(--primary); outline-offset:2px; }
.report-recipient-picker { padding:12px; margin:12px 0; background:var(--panel-alt); border:1px solid var(--border); }
.report-recipient-chips { display:flex; flex-wrap:wrap; gap:8px; }
.report-recipient-chip { display:flex; align-items:center; gap:8px; max-width:100%; padding:4px 6px 4px 10px; background:var(--panel); border:1px solid var(--border); }
.report-recipient-chip > span { min-width:0; overflow-wrap:anywhere; }
.report-recipient-chip small { display:block; font-size:11px; color:var(--text-soft); }
.report-recipient-chip .btn { min-width:34px; min-height:34px; padding:4px; flex:none; }
.report-plan-footer { border-top:1px solid var(--border); padding:12px 0 0; }
.report-plan-footer [data-plan-status]:empty { display:none; }
.report-plan-footer [data-save-plan] { display:inline-flex; align-items:center; gap:8px; }
@media(max-width:650px) { .report-planner .report-schedule-grid { grid-template-columns:1fr; } .report-planner > .inline-meta { flex-wrap:wrap; } .report-plan-card { padding:10px; } }
@media(max-width:850px) { .report-builder > .inline-meta,.report-preview > .inline-meta { flex-wrap:wrap; gap:10px; } }

.report-condition-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.report-condition { display:grid; grid-template-columns:2fr 1.4fr 1fr 1.2fr auto; align-items:end; gap:8px; margin:8px 0; }
.report-condition label { min-width:0; display:grid; gap:5px; }
.report-condition .btn,.report-condition-heading .btn { min-width:34px; min-height:34px; }
.report-condition svg,.report-condition-heading svg { width:17px; height:17px; }
.report-check { display:flex; align-items:center; gap:8px; padding:8px 0; }
@media(max-width:850px) { .report-condition { grid-template-columns:1fr 1fr; border-bottom:1px solid var(--border); padding-bottom:8px; } }
@media(max-width:500px) { .report-condition { grid-template-columns:1fr; } }
.report-page .brand__title { color:var(--adm-text,var(--text)); }
.report-period-feedback { display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin-top:10px; }
.report-period-feedback > p { flex:1 1 260px; margin:0; }
.report-period-feedback .is-error { color:var(--danger); }
.report-period-feedback [hidden] { display:none!important; }
.report-source-advanced input[readonly] { background:var(--panel-alt); color:var(--text-soft); }
.report-source-advanced summary [data-period-summary] { font-weight:400; }

.report-page .report-access-summary {
 display:flex;align-items:center;justify-content:space-between;gap:12px;
 margin:10px 0;padding:10px 12px;border:1px solid #c39824;border-left:4px solid #d6aa22;
 border-radius:3px;background:color-mix(in srgb,#f5c842 22%,var(--panel));color:var(--adm-text);overflow-wrap:anywhere;
}
.report-access-summary .btn {flex-shrink:0}
.report-access-summary [data-access-summary] {margin-top:3px}
.report-access-summary .btn:focus-visible {outline:2px solid var(--primary);outline-offset:3px}
@media(max-width:600px){.report-page .report-access-summary{align-items:flex-start;flex-direction:column}}
@layer sysimple-actions { html body .report-list.sysimple-business-navigation [data-report][hidden] { display:none!important; } }

/* Use the shared Habitation item styles and keep commands named. */
.report-page .report-workspace{grid-template-columns:280px minmax(0,1fr)}
#report-catalog{padding:12px 8px;min-width:0}
#report-catalog>.panel__title{margin:0 4px 12px;font-weight:600}
#report-catalog [data-new-report]{width:100%;justify-content:flex-start;min-height:34px}
#report-catalog .report-catalog-search{margin:12px 4px 0}
#report-catalog .report-list{padding:6px 0;gap:3px;border:0!important}
#report-catalog .report-nav-copy{display:grid;gap:3px;min-width:0;line-height:1.4;overflow-wrap:anywhere}
#report-catalog .report-nav-copy small{font-size:11px;color:inherit;opacity:.8;font-weight:400}
#report-catalog :is(button,input):focus-visible{outline:2px solid var(--primary);outline-offset:2px}
@media(max-width:850px){.report-page .report-workspace{grid-template-columns:minmax(0,1fr)}#report-catalog .report-list{max-height:280px;overflow:auto}}
