/* ==========================================================================================
   OrNsoft Theme — tasks pages
   Covers admin/tasks/manage (list + kanban switch) and the task detail modal rendered from
   admin/tasks/view_task_template into #task-modal.
   Tokens only: every value comes from assets/tokens/ornsoft-tokens.css.
   ========================================================================================== */

/* --- page shell ------------------------------------------------------------------------- */

body.admin .ons-view--tasks {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

body.admin .ons-view--tasks > .ons-page-head {
  align-items: flex-start;
}

body.admin .ons-view--tasks .ons-page-head__actions {
  align-items: center;
}

/* The filter component ships its own inline/pull-right wrappers. */
body.admin .ons-view--tasks .ons-page-head__actions > div[id^="vueApp"] {
  float: none !important;
  margin: 0 !important;
}

body.admin .ons-view--tasks .ons-kanban-search {
  min-width: 220px;
}

body.admin .ons-view--tasks .ons-kanban-search .form-control {
  margin-bottom: 0;
}

/* --- segmented list / board switch ------------------------------------------------------ */

body.admin .ons-view--tasks .ons-seg a {
  height: calc(var(--ctl-h) - 8px);
  padding: 0 12px;
  border: 0;
  background: transparent;
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--fg-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

body.admin .ons-view--tasks .ons-seg a:hover,
body.admin .ons-view--tasks .ons-seg a:focus {
  color: var(--fg);
  text-decoration: none;
}

body.admin .ons-view--tasks .ons-seg a[aria-pressed="true"] {
  background: var(--bg-surface);
  color: var(--fg);
  font-weight: var(--fw-semibold);
  box-shadow: var(--shadow-sm);
  cursor: default;
}

/* --- status chips ----------------------------------------------------------------------- */

body.admin .ons-filters--tasks .ons-chip {
  height: auto;
  min-height: 30px;
  padding-top: 3px;
  padding-bottom: 3px;
}

body.admin .ons-filters--tasks .ons-chip__mine {
  font-family: var(--ons-font-mono);
  font-size: var(--fs-2xs);
  color: var(--fg-muted);
  padding-left: 6px;
  border-left: 1px solid var(--border);
}

/* --- list card -------------------------------------------------------------------------- */

body.admin .ons-view--tasks .ons-toolbar--bulk {
  padding: 0 0 12px;
}

body.admin .ons-view--tasks .ons-toolbar--bulk:empty,
body.admin .ons-view--tasks .ons-toolbar--bulk > .hide {
  padding: 0;
}

body.admin .ons-view--tasks > .panel_s > .panel-body {
  padding: var(--card-pad) 0 0;
}

body.admin .ons-view--tasks .ons-toolbar--bulk {
  padding-left: var(--card-pad);
  padding-right: var(--card-pad);
}

body.admin .ons-view--tasks .kan-ban-tab {
  padding-bottom: var(--sp-4);
}

/* ==========================================================================================
   Task detail modal (#task-modal) — reference: the XL task modal
   ========================================================================================== */

body.admin #task-modal .modal-dialog {
  width: min(1100px, calc(100vw - 48px));
  max-width: none;
  margin: 24px auto;
}

body.admin #task-modal .modal-content {
  border-radius: var(--r-xl);
  overflow: hidden;
}

body.admin #task-modal .modal-header.task-single-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}

body.admin #task-modal .modal-header .modal-title {
  gap: var(--sp-3);
  font-size: var(--fs-xl);
  font-weight: var(--fw-extrabold);
  letter-spacing: var(--ls-h2);
  line-height: var(--lh-tight);
}

body.admin #task-modal .modal-header .ons-modal__sub {
  font-size: var(--fs-sm);
  color: var(--fg-muted);
}

body.admin #task-modal .modal-body {
  padding: 0;
}

/* Two columns: work on the left, the info panel on a sunken rail to the right. */
body.admin #task-modal .modal-body > .row {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
}

body.admin #task-modal .task-single-col-left,
body.admin #task-modal .task-single-col-right {
  float: none;
}

body.admin #task-modal .ons-task__main {
  padding: 20px 24px 28px;
  min-width: 0;
}

body.admin #task-modal .ons-task__side {
  padding: 20px;
  background: var(--bg-subtle);
  border-left: 1px solid var(--border);
  min-width: 0;
}

@media (max-width: 991px) {
  body.admin #task-modal .ons-task__side {
    border-left: 0;
    border-top: 1px solid var(--border);
  }
}

/* Section titles — Font Awesome stands in for the reference's Lucide glyphs. */
body.admin #task-modal .ons-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  color: var(--fg);
}

body.admin #task-modal .ons-section-title > i {
  font-size: 15px;
  color: var(--accent-text);
  width: 16px;
  text-align: center;
}

body.admin #task-modal .task-info-heading.ons-section-title {
  margin-bottom: var(--sp-2);
}

body.admin #task-modal hr {
  border-color: var(--border);
  margin: 18px 0;
}

/* The task-info rows read as a definition list. */
body.admin #task-modal .ons-task__side .task-info {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

body.admin #task-modal .ons-task__side .task-info:last-of-type {
  border-bottom: 0;
}

body.admin #task-modal .ons-task__side .task-info h5 {
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--fg-secondary);
  line-height: var(--lh-snug);
}

body.admin #task-modal .ons-task__side .task-info-icon {
  color: var(--fg-muted);
  font-size: 13px;
}

body.admin #task-modal .ons-task__side .task-info-separator {
  margin: 14px 0;
}

/* Checklist rows. */
body.admin #task-modal .checklist-items-wrapper .checklist-item,
body.admin #task-modal #checklist-items > div {
  border-bottom: 1px solid var(--border);
}

body.admin #task-modal #checklist-items > div:last-child {
  border-bottom: 0;
}

/* Attachments and comments. */
body.admin #task-modal .task-attachment-col > div {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px;
  background: var(--bg-surface);
}

body.admin #task-modal .task-comment {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

body.admin #task-modal .task-comment:last-child {
  border-bottom: 0;
}

body.admin #task-modal #task_comment {
  border-radius: var(--r-md);
}

body.admin #task-modal .dropzone.dropzone-manual {
  background: transparent !important;
  border: 0;
}

/* Dark mode: the base sets a white inline background on the comment dropzone. */
[data-theme="dark"] body.admin #task-modal .dropzone.dropzone-manual {
  background: transparent !important;
}

/* ==========================================================================================
   Task status tones
   ------------------------------------------------------------------------------------------
   The platform writes each status colour straight from the database into a style attribute on
   the pill (see format_task_status() and the task tables), so a plain class rule can never win
   against it: an inline declaration outranks any selector. !important is the only way to take
   those three declarations back, and it matches how the theme already reclaims .label-success,
   .label-warning and friends.

   Only the five built-in statuses are remapped, keyed on the id the platform puts on the
   element (task-status-table on the tables, data-status / data-task-status on the task modal):
     1 Not started      -> neutral
     2 Awaiting feedback -> warning
     3 Testing           -> info
     4 In progress       -> accent
     5 Complete          -> success
   A status added through the before_get_task_statuses filter has no rule here, so it keeps the
   colour configured for it.
   ========================================================================================== */

/* Tables: tasks, task relations, timesheets, staff timesheets, dashboard "My tasks". */
body.admin [task-status-table="1"],
body.admin .task-single-header[data-status="1"] .modal-title .label,
body.admin .modal-body[data-task-status="1"] .task-info-status span[style] {
  color: var(--neutral) !important;
  background: var(--neutral-soft) !important;
  border-color: transparent !important;
}

body.admin [task-status-table="2"],
body.admin .task-single-header[data-status="2"] .modal-title .label,
body.admin .modal-body[data-task-status="2"] .task-info-status span[style] {
  color: var(--warning) !important;
  background: var(--warning-soft) !important;
  border-color: transparent !important;
}

body.admin [task-status-table="3"],
body.admin .task-single-header[data-status="3"] .modal-title .label,
body.admin .modal-body[data-task-status="3"] .task-info-status span[style] {
  color: var(--info) !important;
  background: var(--info-soft) !important;
  border-color: transparent !important;
}

body.admin [task-status-table="4"],
body.admin .task-single-header[data-status="4"] .modal-title .label,
body.admin .modal-body[data-task-status="4"] .task-info-status span[style] {
  color: var(--accent-soft-fg) !important;
  background: var(--accent-soft) !important;
  border-color: transparent !important;
}

body.admin [task-status-table="5"],
body.admin .task-single-header[data-status="5"] .modal-title .label,
body.admin .modal-body[data-task-status="5"] .task-info-status span[style] {
  color: var(--success) !important;
  background: var(--success-soft) !important;
  border-color: transparent !important;
}

/* The status pills the tables render are also dropdown triggers — keep the caret legible and
   the hover state on tone rather than on the raw colour. */
body.admin a.dropdown-toggle[task-status-table] {
  border: 1px solid transparent !important;
  text-decoration: none;
}

body.admin a.dropdown-toggle[task-status-table]:hover,
body.admin a.dropdown-toggle[task-status-table]:focus {
  opacity: 1;
  filter: none;
  box-shadow: inset 0 0 0 1px currentColor;
}

/* The status text in the task modal's info panel is plain coloured text, not a pill. */
body.admin .modal-body[data-task-status] .task-info-status span[style] {
  background: transparent !important;
  font-weight: var(--fw-semibold);
}

/* Status chips on the list page: the five built-in statuses get their dot from the tone,
   a custom status still carries its own --c inline (see admin/tasks/manage.php). */
body.admin .ons-chip--task-1 i { --c: var(--neutral); }
body.admin .ons-chip--task-2 i { --c: var(--warning); }
body.admin .ons-chip--task-3 i { --c: var(--info); }
/* --accent resolves to the same blue as --info for this product, so the dot for
   "in progress" takes the deeper accent-soft foreground to stay distinct from
   "testing" at dot size. The pills already differ: info-soft vs accent-soft. */
body.admin .ons-chip--task-4 i { --c: var(--accent-soft-fg); }
body.admin .ons-chip--task-5 i { --c: var(--success); }

/* ==========================================================================================
   Task modal info panel — inline date edit and the staff pickers
   ------------------------------------------------------------------------------------------
   Two controls in the info panel were inheriting rules written for something else:

   1. The start/due date fields are plain <input> elements that carry the class "datepicker"
      (the calendar widget is bound to them). ornsoft-perfex.css styles ".datepicker" for the
      pop-up calendar - surface background, border, radius, drop shadow - so the inputs were
      picking that up too and rendering as a floating white box on the grey panel. The base
      also gives them width:100% and margin-top:-1px, which is where the extra width and the
      baseline drift came from. Below they go back to being a quiet text value that turns into
      a real control on focus. The generic .datepicker rule is left alone: it is correct for
      the calendar itself and belongs to the shell stylesheet.

   2. The assignee / follower pickers are bootstrap-select. Its own CSS positions
      .filter-option absolutely and pulls its padding from the button with padding:inherit;
      once the theme sets the button padding to "0 12px" that inherited top padding is 0, so
      the placeholder was pinned to the top edge of the control while the caret stayed centred.
      Putting .filter-option back in flow lets the button's own align-items:center do the work.
      The pickers are also wrapped in .simple-bootstrap-select, a base variant meant to render
      a borderless inline control: it zeroes the border and the left padding and forces
      background-color:transparent with !important. The border and padding come back on
      specificity alone, but the background needs !important to answer !important.

   Both blocks are scoped to the task modal / the inline-edit class so nothing else moves.
   ========================================================================================== */

/* --- inline date edit -------------------------------------------------------------------- */

body.admin .task-info .task-info-inline-input-edit,
body.admin .task-info input.task-single-inline-field {
  width: 11ch;
  max-width: 100%;
  flex: none;
  height: 24px;
  margin: 0;
  padding: 0 4px;
  text-align: right;
  background: transparent;
  border: 0;
  border-bottom: 1px dashed var(--border-strong);
  border-radius: 0;
  box-shadow: none;
  color: var(--fg);
  font-family: var(--ons-font-mono);
  font-size: var(--fs-xs);
  line-height: 24px;
  cursor: pointer;
  transition: background var(--dur-fast), border-color var(--dur-fast), box-shadow var(--dur-fast);
}

body.admin .task-info .task-info-inline-input-edit:hover {
  background: var(--bg-hover);
  border-radius: var(--r-sm);
  border-bottom-color: var(--fg-muted);
}

/* On focus it becomes a real control, same height as the other 32px quiet fields. */
body.admin .task-info .task-info-inline-input-edit:focus,
body.admin .task-info .task-info-inline-input-edit:active {
  height: 32px;
  line-height: 32px;
  padding: 0 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-focus);
  border-radius: var(--r-md);
  box-shadow: var(--ring);
  outline: 0;
  cursor: text;
}

/* Keep the value on the label's baseline: the base nudges it up by a pixel. */
body.admin .task-single-inline-wrap h5 {
  align-items: center;
}

body.admin .task-single-inline-wrap h5 > div {
  min-width: 0;
}

/* --- staff pickers and every other select in the panel ----------------------------------- */

body.admin #task-modal .bootstrap-select > .dropdown-toggle,
body.admin #task-modal .bootstrap-select > .btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  height: var(--ctl-h);
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  /* !important answers the base's own !important on the .simple-bootstrap-select variant. */
  background-color: var(--bg-surface) !important;
  color: var(--fg-secondary) !important; /* the base pins this to a hard-coded grey */
  font-size: var(--fs-sm);
  font-weight: var(--fw-regular);
  line-height: 1;
  box-shadow: none;
  text-align: left;
  white-space: nowrap;
}

/* Back in flow, so the button's own align-items:center centres the placeholder. */
body.admin #task-modal .bootstrap-select > .dropdown-toggle .filter-option {
  position: static;
  float: none;
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  height: auto;
  padding: 0;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}

/* Caret sits inside the control, on the same centre line. */
body.admin #task-modal .bootstrap-select > .dropdown-toggle .bs-caret,
body.admin #task-modal .bootstrap-select > .dropdown-toggle .caret {
  position: static;
  flex: none;
  margin: 0;
  top: auto;
  right: auto;
  color: var(--fg-muted);
}

body.admin #task-modal .bootstrap-select > .dropdown-toggle:hover {
  background-color: var(--bg-surface) !important;
  border-color: var(--fg-faint);
  color: var(--fg) !important;
}

body.admin #task-modal .bootstrap-select > .dropdown-toggle:focus,
body.admin #task-modal .bootstrap-select.open > .dropdown-toggle {
  background-color: var(--bg-surface) !important;
  border-color: var(--border-focus);
  box-shadow: var(--ring);
  outline: 0 !important;
  color: var(--fg) !important;
}

/* The tag field in the same panel is a different widget; match the control shape. */
body.admin #task-modal #inputTagsWrapper .tagit,
body.admin #task-modal .task-info-tags-edit .tagit {
  min-height: var(--ctl-h);
  padding: 4px 6px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--bg-surface);
}

/* ===== 1.3.0 lot C — tasks kanban card, detailed overview, checklist template ===== */
/* --- kanban board (admin/tasks/kan_ban + _kan_ban_card, loaded into #kan-ban) ----------------
   The platform's kanban script stamps `min-width: columns x 360px` inline on every
   .container-fluid; the board sizes itself here instead and #kan-ban-tab scrolls it. */

body.admin .ons-view--tasks #kan-ban-tab .container-fluid {
  min-width: 0 !important;
  padding: 0;
}

body.admin .ons-view--tasks #kan-ban-tab > .row {
  margin: 0;
}

body.admin .ons-view--tasks #kan-ban-tab #kanban-params {
  display: none;
}

body.admin #kan-ban:has(> .tasks-kanban) {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: max-content;
  min-width: 100%;
  padding-bottom: 8px;
}

body.admin #kan-ban > ul.kan-ban-col.tasks-kanban {
  flex: 0 0 290px;
  width: 290px;
  margin: 0;
  padding: 0;
  float: none;
  display: block;
  background: transparent;
  border: 0;
  border-radius: 0;
}

body.admin .tasks-kanban .kan-ban-col-wrapper {
  list-style: none;
}

body.admin .tasks-kanban .panel_s.ons-kcol {
  margin: 0;
  padding: 10px;
  gap: 8px;
  min-height: 320px;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: none;
}

body.admin .tasks-kanban .panel-heading.ons-kcol__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 4px 6px;
  background: transparent;
  border: 0;
  color: var(--fg);
}

body.admin .tasks-kanban .ons-kcol__head .ons-badge {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.admin .tasks-kanban .ons-kcol__count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--r-pill);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--fg-muted);
  font-family: var(--ons-font-mono);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-medium);
  line-height: 1;
}

body.admin .tasks-kanban .kan-ban-content-wrapper {
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* The core build paints the drop area with a fixed light slate. */
body.admin .tasks-kanban .kan-ban-content {
  padding: 0;
  background: transparent;
}

body.admin .tasks-kanban .tasks-status {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  min-height: 120px;
  list-style: none;
}

body.admin .tasks-kanban li.task {
  list-style: none;
  border: 0;
  background: transparent;
}

/* --- task card ------------------------------------------------------------------------------ */

body.admin #kan-ban li.task > .panel-body.ons-tkcard {
  margin: 0;
  padding: 12px;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}

body.admin #kan-ban li.task > .panel-body.ons-tkcard:hover {
  border-color: var(--border-strong);
}

/* The core build tints these cards with raw blue / red at !important; the signed-in person's
   tasks are marked on the border, overdue ones by the due-date tone alone. */
body.admin #kan-ban li.task.current-user-task > .panel-body.ons-tkcard {
  background: var(--bg-surface) !important;
  border: 1px solid color-mix(in oklab, var(--accent) 45%, var(--border)) !important;
}

body.admin #kan-ban li.task.overdue-task > .panel-body.ons-tkcard {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border) !important;
}

body.admin #kan-ban li.task.current-user-task.overdue-task > .panel-body.ons-tkcard {
  border-color: color-mix(in oklab, var(--accent) 45%, var(--border)) !important;
}

body.admin #kan-ban li.task.not-sortable > .ons-tkcard {
  cursor: default;
}

/* The core build draws a dragger image behind .task-name. */
body.admin #kan-ban .ons-tkcard .task-name {
  background: none;
  padding: 0;
  margin: 0;
}

body.admin .ons-tkcard__title a {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--fg);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
  text-decoration: none;
}

body.admin .ons-tkcard__title a:hover {
  color: var(--accent-text);
}

body.admin .ons-tkcard--done .ons-tkcard__title a {
  color: var(--fg-muted);
  text-decoration: line-through;
}

body.admin .ons-tkcard__rel {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-top: -4px;
  color: var(--fg-muted);
  font-size: var(--fs-xs);
  text-decoration: none;
}

body.admin .ons-tkcard__rel span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.admin .ons-tkcard__rel:hover {
  color: var(--accent-text);
}

body.admin .ons-tkcard__meta {
  gap: 10px;
  min-width: 0;
}

body.admin .ons-tkcard .ons-prio i,
body.admin .ons-tkcard .ons-due i {
  font-size: 11px;
}

body.admin .ons-tkcard .ons-avatars .ons-avatar {
  border-color: var(--bg-surface);
  background: var(--neutral-soft);
}

body.admin .ons-tkcard .ons-avatar img {
  width: 100%;
  height: 100%;
  margin: 0;
  border-radius: 50%;
  object-fit: cover;
}

body.admin .ons-tkcard__counts {
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  color: var(--fg-muted);
  font-size: var(--fs-xs);
}

body.admin .ons-tkcard__count {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-variant-numeric: tabular-nums;
}

body.admin .ons-tkcard__count--done {
  color: var(--success);
}

body.admin .ons-tkcard__id {
  color: var(--fg-faint);
  font-size: var(--fs-2xs);
}

body.admin .ons-tkcard .kanban-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

body.admin .ons-tkcard .kanban-tags .label,
body.admin .ons-tkcard .kanban-tags a {
  display: inline-flex;
  align-items: center;
  height: 20px;
  margin: 0;
  padding: 0 7px;
  border-radius: var(--r-sm);
  background: var(--neutral-soft);
  color: var(--neutral);
  font-size: 11px;
  font-weight: var(--fw-semibold);
  text-decoration: none;
}

/* Drag state. */
body.admin #kan-ban li.task.ui-sortable-helper > .ons-tkcard,
body.admin #kan-ban li.task.tilt > .ons-tkcard {
  box-shadow: var(--shadow-lg);
  border-color: var(--accent) !important;
}

body.admin .tasks-kanban .ui-state-highlight-card {
  width: auto;
  height: 72px !important;
  margin: 0;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-md);
  background: var(--bg-hover) !important;
}

/* Column footer: load more and the empty state. */
body.admin .tasks-kanban .kanban-load-more {
  list-style: none;
  margin-top: 4px;
}

body.admin .tasks-kanban .kanban-load-more .btn {
  height: var(--ctl-h-sm);
  padding: 0 10px;
  line-height: calc(var(--ctl-h-sm) - 2px);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--bg-surface);
  color: var(--fg);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
}

body.admin .tasks-kanban .kanban-load-more .btn:hover,
body.admin .tasks-kanban .kanban-load-more .btn:focus {
  background: var(--bg-hover);
  color: var(--fg);
}

body.admin .tasks-kanban .kanban-load-more .btn.disabled {
  background: var(--bg-sunken);
  border-color: var(--border);
  color: var(--fg-faint);
}

body.admin .tasks-kanban .kanban-empty {
  list-style: none;
  margin-top: 8px;
}

body.admin .tasks-kanban .kanban-empty .ons-empty {
  padding: 28px 12px;
}

body.admin .tasks-kanban .kanban-empty .ons-empty__icon {
  background: var(--bg-surface);
}

body.admin .tasks-kanban .kanban-empty .ons-empty__title {
  font-size: var(--fs-sm);
  color: var(--fg);
}

/* --- detailed overview (admin/tasks/detailed_overview, reports.html) ------------------------ */

body.admin .ons-tko .ons-kpi {
  box-shadow: var(--shadow-sm);
}

body.admin .ons-tko .ons-kpi__ico i {
  font-size: 14px;
  color: var(--fg-muted);
}

body.admin .ons-tko .ons-kpi__meta .ons-kpi__delta--down {
  font-weight: var(--fw-semibold);
}

body.admin .ons-tko form.ons-tko__filters {
  margin: 0;
  border-bottom: 1px solid var(--border);
}

body.admin .ons-tko .ons-tko__field {
  flex: 0 1 200px;
  min-width: 150px;
}

body.admin .ons-tko .ons-tko__field--year {
  flex-basis: 120px;
  min-width: 110px;
}

body.admin .ons-tko .ons-tko__field .form-group {
  margin: 0;
}

body.admin .ons-tko .ons-tko__month {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px var(--card-pad) 10px;
  border-top: 1px solid var(--border);
}

body.admin .ons-tko form.ons-tko__filters + .ons-tko__month {
  border-top: 0;
}

body.admin .ons-tko .ons-tko__month .ons-card__title {
  margin: 0;
}

body.admin .ons-tko .ons-tko__table {
  min-width: 0;
}

body.admin .ons-tko .tasks-overview th.num,
body.admin .ons-tko .tasks-overview td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

body.admin .ons-tko .ons-tko__name {
  color: var(--fg);
  font-weight: var(--fw-semibold);
  text-decoration: none;
}

body.admin .ons-tko .ons-tko__name:hover {
  color: var(--accent-text);
}

body.admin .ons-tko .ons-tko__rel {
  display: block;
  color: var(--fg-muted);
  font-size: var(--fs-xs);
}

body.admin .ons-tko .ons-tko__rel a {
  color: var(--fg-secondary);
}

body.admin .ons-tko .ons-avatar img {
  width: 100%;
  height: 100%;
  margin: 0;
  border-radius: 50%;
  object-fit: cover;
}

body.admin .ons-tko .ons-avatars .ons-avatar {
  background: var(--neutral-soft);
}

@media (max-width: 720px) {
  body.admin .ons-tko .ons-tko__field {
    flex: 1 1 100%;
  }
}

/* --- checklist rows (admin/tasks/checklist_items_template in #task-modal) ------------------- */

body.admin #task-modal .ons-chk-progress.progress {
  height: 6px;
  margin: 10px 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg-sunken);
  box-shadow: none;
}

/* The bar prints its percentage as text; at 6px only the fill is shown. */
body.admin #task-modal .ons-chk-progress .progress-bar {
  background: var(--accent);
  box-shadow: none;
  font-size: 0;
  color: transparent;
}

body.admin #task-modal .ons-chk-progress .progress-bar.progress-bar-success {
  background: var(--success);
}

body.admin #task-modal .ons-chk-list {
  display: flex;
  flex-direction: column;
}

body.admin #task-modal #checklist-items .ons-chk-row {
  padding: 6px 4px;
  border-radius: var(--r-md);
  transition: background var(--dur-fast);
}

body.admin #task-modal #checklist-items .ons-chk-row:hover {
  background: var(--bg-hover);
}

body.admin #task-modal .ons-chk-row__main {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

body.admin #task-modal .ons-chk-row__grip {
  flex: none;
  width: 12px;
  padding-top: 6px;
  color: var(--fg-faint);
  font-size: 11px;
  cursor: grab;
  opacity: 0;
  transition: opacity var(--dur-fast);
}

body.admin #task-modal .ons-chk-row:hover .ons-chk-row__grip {
  opacity: 1;
}

body.admin #task-modal .ons-chk-row .checklist-checkbox {
  flex: none;
  margin: 4px 0 0;
  padding-left: 20px;
  min-height: 18px;
}

body.admin #task-modal .ons-chk-row__text {
  flex: 1 1 auto;
  min-width: 0;
}

body.admin #task-modal .ons-chk-row__text textarea {
  display: block;
  width: 100%;
  min-height: 28px;
  padding: 4px 6px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: transparent;
  box-shadow: none;
  color: var(--fg);
  font-size: var(--fs-sm);
  line-height: 1.45;
  resize: none;
  overflow: hidden;
}

body.admin #task-modal .ons-chk-row__text textarea:focus {
  background: var(--bg-surface);
  border-color: var(--border-focus);
  box-shadow: var(--ring);
  outline: 0;
}

body.admin #task-modal .ons-chk-row__text textarea:disabled {
  cursor: default;
  background: transparent;
  color: var(--fg-secondary);
}

/* Done state follows the checkbox itself, so it is right before the list re-renders. */
body.admin #task-modal .ons-chk-row:has(input[name="checklist-box"]:checked) .ons-chk-row__text textarea {
  color: var(--fg-muted);
  text-decoration: line-through;
}

body.admin #task-modal .ons-chk-row__who {
  margin-top: 2px;
  background: var(--neutral-soft);
}

body.admin #task-modal .ons-chk-row__who img {
  width: 100%;
  height: 100%;
  margin: 0;
  border-radius: 50%;
  object-fit: cover;
}

body.admin #task-modal .ons-chk-row__actions {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  opacity: 0;
  transition: opacity var(--dur-fast);
}

body.admin #task-modal .ons-chk-row:hover .ons-chk-row__actions,
body.admin #task-modal .ons-chk-row:focus-within .ons-chk-row__actions,
body.admin #task-modal .ons-chk-row__actions .dropdown.open {
  opacity: 1;
}

body.admin #task-modal .ons-chk-row__actions .ons-btn--icon {
  width: var(--ctl-h-sm);
  padding: 0;
  color: var(--fg-muted);
}

body.admin #task-modal .ons-chk-row__actions .ons-btn--icon:hover {
  color: var(--fg);
}

body.admin #task-modal .ons-chk-row__actions .remove-checklist:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

body.admin #task-modal .ons-chk-row__actions .hide {
  display: none !important;
}

body.admin #task-modal .ons-chk-row__meta {
  margin: 2px 0 0 48px;
  color: var(--fg-muted);
  font-family: var(--ons-font-mono);
  font-size: var(--fs-2xs);
  line-height: 1.4;
}

@media (hover: none) {
  body.admin #task-modal .ons-chk-row__actions,
  body.admin #task-modal .ons-chk-row__grip {
    opacity: 1;
  }
}
/* ===== /lot C tasks ===== */
