#userForm > .formgrid { align-items:start; }
#userForm .field, #bulkHours .field, .work-hours-fields { min-width:0; }
#userForm :is(input, select), .work-hours-fields :is(input[type="time"],input[type="datetime-local"]) {
  max-width:100%;
}
#userForm .formgrid select { width:100%; min-width:0; min-height:42px; }
#userForm .user-access-note { margin-top:-4px; color:var(--muted); }
.work-hours-fields { margin-inline:0; }
.work-hours-fields .formgrid { align-items:start; margin-top:12px; }
.work-hours-fields .day-choices { display:flex; flex-wrap:wrap; gap:6px 12px; }
.work-hours-fields .day-choices .check { white-space:nowrap; }
.work-hours-fields .field input { width:100%; }
#userUnitsTitle { scroll-margin-top:12px; }

.unit-summary, .crm-action-menu > summary {
  display:inline-flex; align-items:center; gap:8px; padding:5px 9px;
  border:1px solid var(--line); border-radius:8px; background:var(--surface);
  font-size:13px; font-weight:600; cursor:pointer; white-space:nowrap;
}
.crm-action-menu > summary { list-style:none; }
.crm-action-menu > summary::-webkit-details-marker { display:none; }
.crm-action-menu[open] > summary { color:var(--accent); }
.crm-action-list {
  display:grid; gap:2px; min-width:148px; padding:4px;
  margin-top:5px; border:1px solid var(--line); border-radius:8px;
  background:var(--surface);
}
.crm-action-list[popover] { display:none; }
.crm-action-list[popover]:popover-open {
  display:grid; position:fixed; inset:auto; margin:0; overflow:auto;
  min-width:0; max-width:calc(100vw - 16px); color:var(--ink);
  box-shadow:0 8px 28px rgb(16 35 59 / 20%);
}
.crm-action-list button, .crm-text-danger {
  border:0; background:transparent; text-align:left; font-size:13px;
  padding:6px 8px; white-space:normal;
}
.crm-action-list button:not(:disabled):hover, .crm-text-danger:hover { background:var(--bg); }
.crm-action-list .danger, .crm-text-danger { color:var(--danger,#a52840); }
.crm-unit-list { columns:2; padding-left:20px; }
.crm-unit-list li { break-inside:avoid; padding:4px 0; }
.crm-status-row {
  display:grid; grid-template-columns:minmax(0,1.3fr) minmax(0,1fr) auto auto;
  align-items:end; gap:10px; padding:9px 0; border-bottom:1px solid var(--line);
}
.crm-status-row .field { min-width:0; }
.crm-status-row .field :is(input,select) { min-width:0; width:100%; }
.crm-status-row .check { align-self:end; min-height:42px; white-space:nowrap; }
#crmAddStatus { margin-top:12px; }
#crmStatusError:not(:empty) { color:var(--danger,#a52840); }
.crm-import-section .card-head { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.crm-import-section .card-head h2 { margin:0 auto 0 0; }
.crm-published-filters { display:flex; flex-wrap:wrap; gap:8px 16px; margin:12px 0; }

#app .productivity-kpis {
  grid-template-columns:repeat(5,minmax(0,1fr)) !important;
  gap:10px; margin-bottom:12px;
}
#app .productivity-kpis .metric {
  min-height:0; min-width:0; padding:7px 11px; gap:3px; margin:0;
}
#app .productivity-kpis .metric strong { font-size:clamp(19px,2vw,27px); }
#app .productivity-kpis .metric :is(label,small) { overflow-wrap:anywhere; }
#app .productivity-kpis .metric small { line-height:1.2; }
.executive-ranking .crm-ranking-total {
  width:min(100%,7rem); margin-inline:auto; min-width:0;
}
.crm-ranking-total progress { display:block; width:100%; height:5px; margin-top:4px; }
.executive-ranking .crm-ranking-total b { font-variant-numeric:tabular-nums; }
.crm-productivity-controls, .crm-chart-legend {
  display:flex; align-items:end; gap:8px 14px; flex-wrap:wrap; margin-bottom:12px;
}
.crm-productivity-controls .crm-segments { margin:0; }
.crm-phase {
  display:inline-flex; align-items:center; gap:6px; padding:3px 8px;
  border-radius:999px; font-size:12px; font-weight:600;
  color:var(--phase); background:color-mix(in srgb,var(--phase) 12%,var(--surface));
}
.crm-phase-done { --phase:#08754e; }
.crm-phase-active { --phase:#9b5600; }
:root[data-theme=dark] .crm-phase-done { --phase:#6bd6a6; }
:root[data-theme=dark] .crm-phase-active { --phase:#f0be69; }
.crm-phase-bar-done { fill:#15805c; }
.crm-phase-bar-active { fill:#cf831d; }
:root[data-theme=dark] .crm-phase-bar-done { fill:#55c792; }
:root[data-theme=dark] .crm-phase-bar-active { fill:#e4aa55; }
.crm-phase::before { content:""; width:8px; height:8px; border-radius:50%; background:currentColor; }
.crm-daily-scroll { overflow-x:auto; }
.crm-daily-scroll .crm-daily-chart { min-width:var(--chart-min,770px); width:auto; max-width:none; }
[data-crm-daily-detail] { cursor:pointer; }
[data-crm-daily-detail]:focus-visible { outline:2px solid var(--ink); outline-offset:-3px; }
@media(max-width:800px) {
 #app .productivity-kpis { grid-template-columns:repeat(3,minmax(0,1fr)) !important; }
 .crm-status-row { grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
}
@media(max-width:490px) {
 #app .productivity-kpis { grid-template-columns:repeat(2,minmax(0,1fr)) !important; }
 .crm-unit-list { columns:1; }
}

.crm-action-list [data-close-actions] {
  border-top:1px solid var(--line);
  border-radius:0;
  margin-top:3px;
  color:var(--muted);
}
