/* ==========================================================================================
   OrNsoft theme — support-side screens (1.3.0)
   To-dos (D23 as a page), announcements (table, article, editor), utilities (activity log as
   D27 + table, all reminders, ticket pipe log). Tokens only. Shared form fixes: forms.css.
   ========================================================================================== */

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

body.admin .ons-support-page,
body.admin .ons-todos-page,
body.admin .ons-ann-editor {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

body.admin .ons-support-page > .ons-back,
body.admin .ons-ann-editor > .ons-back {
  align-self: flex-start;
  color: var(--fg-muted);
  text-decoration: none;
}

body.admin .ons-support-page > .ons-back:hover,
body.admin .ons-ann-editor > .ons-back:hover {
  color: var(--fg);
}

/* Links styled as buttons keep the button label colour (the theme paints admin links with
   the accent). */
body.admin .ons-support-page a.ons-btn:not(.ons-btn--primary):not(.ons-btn--danger),
body.admin .ons-todos-page a.ons-btn:not(.ons-btn--primary):not(.ons-btn--danger) {
  color: var(--fg);
}

body.admin .ons-support-page a.ons-btn--ghost:not(:hover),
body.admin .ons-todos-page a.ons-btn--ghost:not(:hover) {
  color: var(--fg-secondary);
}

body.admin .ons-support-page a.ons-btn--primary,
body.admin .ons-todos-page a.ons-btn--primary {
  color: var(--accent-fg);
}

body.admin .ons-support-page a.ons-btn--danger {
  color: var(--danger);
}

body.admin .ons-support-page .ons-btn i,
body.admin .ons-todos-page .ons-btn i,
body.admin .ons-support-page .ons-seg i {
  font-size: 12px;
  line-height: 1;
}

body.admin .ons-support-page .ons-back i {
  font-size: 12px;
}

body.admin .ons-support-page .ons-page-head__actions {
  flex-wrap: wrap;
}

/* --- D23 to-dos as a page ------------------------------------------------------------------ */

body.admin .ons-todos-card {
  max-width: 860px;
}

body.admin .ons-todos {
  gap: 6px;
}

body.admin .ons-todos .ons-quickadd-form {
  margin: 0 0 6px;
}

body.admin .ons-todos .ons-quickadd i {
  font-size: 13px;
}

/* The field inside the quick add is borderless: the dashed frame is the control. */
body.admin .ons-todos .ons-quickadd input[type="text"] {
  flex: 1;
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  outline: 0;
  color: var(--fg);
  font: inherit;
}

body.admin .ons-todos .todo-body,
body.admin .ons-todos .events {
  background: transparent;
  box-shadow: none;
}

body.admin ul.ons-todo {
  margin: 0;
  padding: 0;
  list-style: none;
  min-height: 8px;
}

/* Row: drag handle · round tick · text + date · actions on hover. */
body.admin ul.ons-todo > li.ons-todo__item {
  display: grid;
  align-items: start; /* long descriptions keep the tick on their first line */
  grid-template-columns: 10px 18px minmax(0, 1fr) auto;
  gap: 12px;
  padding: 10px 0;
  background: var(--bg-surface);
}

body.admin ul.ons-todo > li.ons-todo__item:first-child,
body.admin ul.ons-todo > li.no-todos + li.ons-todo__item {
  border-top: 0;
}

body.admin .ons-todo .todo-dragger {
  position: static; /* the base pins the handle absolutely; here it is the first grid column */
  width: 10px;
  height: 18px;
  margin: 0;
  float: none;
  background: radial-gradient(currentColor 1.1px, transparent 1.3px) 0 0 / 5px 5px;
  color: var(--fg-faint);
  cursor: grab;
  opacity: 0;
  transition: opacity var(--dur-fast);
}

body.admin .ons-todo__item:hover .todo-dragger {
  opacity: 1;
}

@media (hover: none) {
  body.admin .ons-todo .todo-dragger {
    opacity: 1;
  }
}

/* The platform checkbox becomes the kit's round tick; the input itself is the control so the
   platform's change handler still fires. */
body.admin .ons-todo .todo-checkbox {
  position: relative;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
}

body.admin .ons-todo .todo-checkbox label {
  display: none;
}

body.admin .ons-todo .todo-checkbox input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  position: static;
  display: grid;
  place-content: center;
  width: 18px;
  height: 18px;
  margin: 0;
  opacity: 1;
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  z-index: 1;
}

body.admin .ons-todo .todo-checkbox input[type="checkbox"]:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

body.admin .ons-todo .todo-checkbox input[type="checkbox"]:checked {
  border-color: var(--success);
  background: var(--success);
}

body.admin .ons-todo .todo-checkbox input[type="checkbox"]:checked::after {
  content: "";
  width: 8px;
  height: 4px;
  border: 2px solid #fff;
  border-top: 0;
  border-right: 0;
  transform: rotate(-45deg) translate(1px, -1px);
}

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

body.admin .ons-todo .todo-description {
  padding: 0;
  color: var(--fg);
  font-size: var(--fs-sm);
  overflow-wrap: anywhere;
}

body.admin .ons-todo .todo-description.line-throught {
  text-decoration: line-through;
  color: var(--fg-muted);
}

body.admin .ons-todo .todo-date {
  display: block;
  margin-top: 2px;
  font-family: var(--ons-font-mono);
  font-size: var(--fs-2xs);
  color: var(--fg-muted);
}

body.admin .ons-todo .ons-todo__acts i {
  font-size: 12px;
}

body.admin .ons-todo > li.no-todos {
  display: block;
  padding: 0;
  list-style: none;
}

body.admin .ons-todo > li.no-todos.hide {
  display: none;
}

body.admin .ons-todo > li.no-todos .ons-widget-empty i {
  font-size: 24px;
  color: var(--fg-faint);
}

/* Drag feedback. */
body.admin .ons-todo .ui-sortable-helper {
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  padding-left: 8px;
  padding-right: 8px;
}

body.admin .ons-todo .ui-sortable-placeholder {
  visibility: visible !important;
  height: 40px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-md);
  background: var(--bg-subtle);
}

body.admin .ons-todos-more {
  display: flex;
  justify-content: center;
}

body.admin .ons-todos-more.hide,
body.admin .ons-todos-more .disabled {
  display: none;
}

body.admin .ons-todos .ons-disclose i {
  font-size: 10px;
  transition: transform var(--dur-fast);
}

body.admin .ons-todos .ons-disclose.is-open i {
  transform: rotate(90deg);
}

body.admin .ons-todos .is-hidden {
  display: none;
}

body.admin .ons-todos-finished {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* --- announcements -------------------------------------------------------------------------- */

body.admin .ons-ann-split {
  align-items: start;
}

body.admin .ons-ann-article .ons-record {
  flex-wrap: nowrap;
  border-bottom: 1px solid var(--border);
}

body.admin .ons-ann-article .ons-record__icon i {
  font-size: 20px;
}

body.admin .ons-ann-article__head {
  flex: 1 1 auto;
  min-width: 0;
}

body.admin .ons-ann-article h1.ons-ann-article__title {
  margin: 0;
  font-size: var(--fs-2xl);
  font-weight: var(--fw-extrabold);
  letter-spacing: var(--ls-h2);
  line-height: var(--lh-tight);
  color: var(--fg);
  overflow-wrap: anywhere;
}

body.admin .ons-ann-article__actions {
  flex: none;
  margin-left: auto;
}

body.admin .ons-ann-article__body {
  max-width: 76ch;
  font-size: var(--fs-md);
  line-height: var(--lh-body);
  color: var(--fg-secondary);
  overflow-wrap: anywhere;
}

body.admin .ons-ann-article__body img {
  max-width: 100%;
  height: auto;
}

body.admin .ons-ann-article__body > :last-child {
  margin-bottom: 0;
}

body.admin .ons-ann-recent > .ons-card__head {
  padding-bottom: 14px;
}

body.admin .ons-ann-recent__item {
  display: grid;
  gap: 4px;
  padding: 12px var(--card-pad);
  border-top: 1px solid var(--border);
  color: var(--fg) !important;
  text-decoration: none !important;
}

body.admin .ons-ann-recent__item:hover {
  background: var(--bg-hover);
}

body.admin .ons-ann-recent__item b {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
}

body.admin .ons-ann-recent__item small {
  font-size: var(--fs-2xs);
  color: var(--fg-muted);
}

body.admin .ons-ann-recent__excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: var(--fs-xs);
  color: var(--fg-secondary);
}

body.admin .ons-ann-editor {
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
}

body.admin .ons-ann-editor__foot {
  flex-wrap: wrap;
}

body.admin .ons-ann-editor__checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

body.admin .ons-ann-editor__checks .checkbox-inline {
  margin: 0;
}

/* --- utilities: activity log (D27 + table), reminders, pipe log --------------------------- */

body.admin .ons-actlog .ons-card__head {
  flex-wrap: wrap;
  row-gap: 10px;
}

body.admin .ons-actlog .ons-card__actions {
  flex-wrap: wrap;
}

body.admin .ons-actlog__types {
  flex-wrap: wrap;
}

body.admin .ons-actlog__types b {
  margin-left: 2px;
  font-weight: var(--fw-semibold);
  color: var(--fg-muted);
}

body.admin .ons-actlog__list {
  border-top: 1px solid var(--border);
}

body.admin .ons-actlog__list .ons-act__verb i {
  font-size: 8px;
}

body.admin .ons-actlog__list .ons-act__quote {
  font-size: var(--fs-2xs);
  overflow-wrap: anywhere;
}

body.admin .ons-actlog__list .ons-act__meta .ons-mono {
  font-size: var(--fs-2xs);
}

body.admin .ons-actlog__list .ons-widget-empty i {
  font-size: 24px;
  color: var(--fg-faint);
}

body.admin .ons-actlog__toolbar {
  border-bottom: 1px solid var(--border);
}

body.admin .ons-actlog__date {
  width: 260px;
  max-width: 100%;
}

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

body.admin .ons-actlog__date .control-label {
  font-size: var(--fs-xs);
  color: var(--fg-muted);
}

body.admin .ons-support-page .ons-widget-empty i {
  font-size: 24px;
  color: var(--fg-faint);
}

/* Text columns (related record, description, pipe log subject / message) wrap instead of
   stretching the table to several screen widths; dates and people stay on one line. */
body.admin .ons-support-page .table-reminders tbody td:nth-child(1),
body.admin .ons-support-page .table-reminders tbody td:nth-child(2),
body.admin .ons-support-page .table-activity-log tbody td:first-child,
body.admin .ons-support-page .table-activity-log tbody td:nth-child(5),
body.admin .ons-support-page .table-activity-log tbody td:nth-child(6) {
  white-space: normal;
  min-width: 200px;
  max-width: 520px;
  overflow-wrap: anywhere;
}

/* --- responsive ----------------------------------------------------------------------------- */

@media (max-width: 720px) {
  body.admin .ons-ann-article .ons-record {
    flex-wrap: wrap;
  }

  body.admin .ons-ann-article .ons-record__icon {
    display: none;
  }

  body.admin .ons-ann-article h1.ons-ann-article__title {
    font-size: var(--fs-xl);
  }

  body.admin .ons-actlog .ons-card__actions {
    margin-left: 0;
    width: 100%;
  }
}
