/* ORERO window controls: custom line icons, ordered at the right of every titlebar. */
html:root .managed-window > .window-titlebar { align-items: center; gap: 16px; }
html:root .window-titlebar > :not(.window-controls):not(.window-head-actions):not(.task-head-actions) { flex: 1; min-width: 0; }
html:root .window-titlebar > :is(.window-head-actions,.task-head-actions):empty { display: none; }
html:root .window-controls { display: flex; flex: 0 0 auto; align-items: center; gap: 4px; margin-left: auto; padding-left: 10px; border-left: 1px solid var(--border); }
html:root :is(#operations-dialog,#company-search-dialog,#employee-dialog,#department-dialog,#profile-dialog,#task-drawer,#calendar-event-dialog,#calendar-room-dialog,#invoice-route-dialog,#invoice-dialog,#hr-create-dialog,#project-dialog,#chat-dialog,#messenger-view,#structure-view) .window-control {
  position: relative; display: inline-grid; place-items: center; flex: 0 0 auto;
  width: 36px; min-width: 36px; height: 36px; min-height: 36px; margin: 0; padding: 0;
  border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--text-secondary);
  box-shadow: none; transform: none; line-height: 1;
  transition: color var(--window-control-duration,.16s), background-color var(--window-control-duration,.16s), border-color var(--window-control-duration,.16s);
}
html:root .window-controls .window-control svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
html:root :is(#operations-dialog,#company-search-dialog,#employee-dialog,#department-dialog,#profile-dialog,#task-drawer,#calendar-event-dialog,#calendar-room-dialog,#invoice-route-dialog,#invoice-dialog,#hr-create-dialog,#project-dialog,#chat-dialog,#messenger-view,#structure-view) .window-control:is(:hover,:focus-visible,[aria-pressed="true"]) { background: var(--accent-soft); color: var(--accent); border-color: var(--border); }
html:root :is(#operations-dialog,#company-search-dialog,#employee-dialog,#department-dialog,#profile-dialog,#task-drawer,#calendar-event-dialog,#calendar-room-dialog,#invoice-route-dialog,#invoice-dialog,#hr-create-dialog,#project-dialog,#chat-dialog,#messenger-view,#structure-view) .window-control-close:is(:hover,:focus-visible) { background: var(--theme-danger-bg); color: var(--theme-danger); border-color: var(--theme-danger); }
/* ID specificity deliberately beats the individual dialog size and mobile rules. */
html:root :is(#operations-dialog,#company-search-dialog,#employee-dialog,#department-dialog,#profile-dialog,#task-drawer,#calendar-event-dialog,#calendar-room-dialog,#invoice-route-dialog,#invoice-dialog,#hr-create-dialog,#project-dialog,#chat-dialog,#messenger-view,#structure-view).managed-window.window-maximized {
  position: fixed; inset: 8px; width: calc(100vw - 16px); height: calc(100dvh - 16px);
  max-width: none; max-height: none; margin: 0; transform: none; border-radius: var(--radius-modal);
}
html:root .managed-window.window-maximized > :is(.employee-dialog-body,#calendar-event-details,#calendar-room-form,#chat-create-form,#project-form,#invoice-form,#hr-create-form,#invoice-detail) { flex: 1; min-height: 0; }
@media (max-width: 700px) {
  html:root .managed-window > .window-titlebar { gap: 8px 12px; flex-wrap: wrap; }
  html:root #task-drawer > .window-titlebar > .task-head-title { flex: 1 1 100%; }
  html:root .window-titlebar > .task-head-actions:not(:empty) { margin-left: auto; }
}
@media (pointer: coarse), (max-width: 700px) {
  html:root :is(#operations-dialog,#company-search-dialog,#employee-dialog,#department-dialog,#profile-dialog,#task-drawer,#calendar-event-dialog,#calendar-room-dialog,#invoice-route-dialog,#invoice-dialog,#hr-create-dialog,#project-dialog,#chat-dialog,#messenger-view,#structure-view) .window-control { width: 44px; min-width: 44px; height: 44px; min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { html:root { --window-control-duration: 0s; } }
