/* Action Points (AP) — Timero design tokens */

.ap-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--accent, #e07a3d);
  color: #fff;
  cursor: pointer;
  vertical-align: middle;
  line-height: 1;
}
.ap-badge:hover { background: var(--accent-2, #c5642a); }
.ap-badge.is-overdue { background: var(--danger, #c33636); }
.ap-badge[hidden] { display: none !important; }

/* Compact add / header icon */
.ap-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--border-2, #d8d2c6);
  border-radius: 8px;
  background: var(--bg-surface, #fff);
  color: var(--ink-2, #4a4640);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s, background 0.15s, box-shadow 0.15s;
}
.ap-icon-btn:hover {
  border-color: var(--accent, #e07a3d);
  color: var(--accent-2, #c5642a);
  background: var(--accent-soft, #fde4d2);
  box-shadow: 0 0 0 2px var(--accent-soft, #fde4d2);
}
.ap-icon-btn-plus {
  position: absolute;
  right: -3px;
  top: -3px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--accent, #e07a3d);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 12px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--bg-surface, #fff);
}
.ap-icon-btn--tile {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  flex-shrink: 0;
}
.ap-icon-btn--tile svg { width: 13px; height: 13px; }
.ap-icon-btn--tile .ap-icon-btn-plus {
  width: 11px;
  height: 11px;
  font-size: 9px;
  line-height: 11px;
}

/* Unified list */
.ap-list { display: flex; flex-direction: column; gap: 14px; }
.ap-list-section-hd {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-3, #7a756c);
  margin: 0 0 8px;
}
.ap-list-section-hd em {
  font-style: normal;
  font-weight: 600;
  color: var(--ink-4, #a8a294);
}
.ap-list-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ap-empty {
  font-size: 12px;
  color: var(--ink-4, #a8a294);
  padding: 12px 4px;
  text-align: center;
}

.ap-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--border, #e6e1d9);
  border-radius: 10px;
  background: var(--bg-surface, #fff);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ap-card:hover {
  border-color: var(--border-2, #d8d2c6);
  box-shadow: 0 1px 2px rgba(28, 25, 22, 0.04);
}
.ap-card.is-overdue {
  border-color: rgba(195, 54, 54, 0.35);
  background: linear-gradient(90deg, rgba(195, 54, 54, 0.06), var(--bg-surface, #fff) 48%);
}
.ap-card.is-closed {
  opacity: 0.72;
  background: var(--bg-surface-2, #faf7f2);
}
.ap-card-check {
  position: relative;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  cursor: pointer;
}
.ap-card-check input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}
.ap-card-check span {
  display: block;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border-2, #d8d2c6);
  border-radius: 5px;
  background: var(--bg-surface, #fff);
  box-sizing: border-box;
  transition: border-color 0.15s, background 0.15s;
}
.ap-card-check:hover span { border-color: var(--accent, #e07a3d); }
.ap-card-check input:checked + span,
.ap-card-check.is-done span {
  background: var(--accent, #e07a3d);
  border-color: var(--accent, #e07a3d);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5 6.5 11.5 12.5 4.5'/%3E%3C/svg%3E");
  background-size: 12px 12px;
  background-position: center;
  background-repeat: no-repeat;
}
.ap-card-main { flex: 1; min-width: 0; }
.ap-card-top {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}
.ap-card-title {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink-1, #1c1916);
  letter-spacing: -0.01em;
}
.ap-card.is-overdue .ap-card-title { color: var(--danger, #c33636); }
.ap-card-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-4, #a8a294);
  cursor: pointer;
  flex-shrink: 0;
}
.ap-card-open:hover {
  background: var(--bg-hover, #f3efe9);
  color: var(--ink-1, #1c1916);
}
.ap-card-comment {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-4, #a8a294);
  cursor: pointer;
  flex-shrink: 0;
}
.ap-card-comment:hover {
  background: var(--bg-hover, #f3efe9);
  color: var(--accent-2, #c5642a);
}
.ap-card-comment-n {
  position: absolute;
  right: -2px;
  top: -2px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 999px;
  background: var(--accent, #e07a3d);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
  box-shadow: 0 0 0 1.5px var(--bg-surface, #fff);
}
.ap-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.ap-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--bg-surface-2, #faf7f2);
  color: var(--ink-3, #7a756c);
  border: 1px solid transparent;
}
.ap-chip-status.ap-status-new {
  background: rgba(61, 110, 224, 0.1);
  color: #2f5fc4;
}
.ap-chip-status.ap-status-in_progress {
  background: var(--accent-soft, #fde4d2);
  color: var(--accent-2, #c5642a);
}
.ap-chip-status.ap-status-closed {
  background: rgba(47, 148, 97, 0.12);
  color: #1f7a4d;
}
.ap-chip-deadline.is-overdue {
  background: var(--danger-soft, #fbdada);
  color: var(--danger, #c33636);
}
.ap-chip-entity {
  background: rgba(28, 25, 22, 0.04);
  color: var(--ink-2, #4a4640);
  max-width: 220px;
}
.ap-chip-person.is-a {
  border-color: var(--border, #e6e1d9);
}
.ap-chip-muted { opacity: 0.75; }

/* Dashboard / CRM panel */
.ap-dash-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.ap-dash-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-3, #7a756c);
}
.ap-dash-title span {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink-4, #a8a294);
}
.ap-dash-list { min-height: 40px; }

/* Page strip above projects / funnel */
.ap-open-strip {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--border, #e6e1d9);
  border-radius: 12px;
  background: var(--bg-surface, #fff);
}
.ap-open-strip-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.ap-open-strip-title {
  font-size: 13px;
  font-weight: 650;
  color: var(--ink-1, #1c1916);
  letter-spacing: -0.01em;
}
.ap-open-strip-body .ap-list-section-hd { display: none; }
.ap-open-strip-body .ap-list { gap: 0; }
.ap-open-strip-body .ap-list-stack {
  max-height: 220px;
  overflow: auto;
  padding-right: 2px;
}
[data-ap-strip-host][hidden] { display: none !important; }
.ap-strip-mode { margin-right: 4px; flex-shrink: 0; }
.ap-strip-mode.seg.sm .seg-btn {
  height: 24px;
  padding: 0 9px;
  font-size: 11.5px;
}
.strip-hd .ap-strip-mode { align-self: center; }
.ap-sheet-people {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}
.ap-sheet-mark-icon {
  font-size: 0;
}
.ap-sheet-mark-icon svg {
  width: 14px;
  height: 14px;
}
.ap-comments-inline {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.ap-comments-inline .ap-comments-list {
  max-height: 180px;
  overflow: auto;
  margin-bottom: 8px;
}

/* Sheet form (create / edit) */
.ap-sheet {
  margin: -4px -2px 0;
  font-family: var(--font, Inter, system-ui, sans-serif);
}
.ap-sheet-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 2px 8px;
  border-bottom: 1px solid var(--border, #e6e1d9);
  margin-bottom: 10px;
}
.ap-sheet-mark {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--accent, #e07a3d);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}
.ap-sheet-titles { min-width: 0; flex: 1; }
.ap-sheet-titles h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-1, #1c1916);
  letter-spacing: -0.01em;
}
.ap-sheet-titles p { display: none; }
.ap-sheet-sub {
  display: block !important;
  margin: 2px 0 0;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3, #7a756c);
  text-transform: none;
  letter-spacing: 0;
}
.ap-sheet-head-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ap-sheet-list .ap-list-filter {
  margin: 0 2px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.ap-sheet-list-body { max-height: min(62vh, 560px); overflow: auto; padding-right: 2px; }
.ap-card-title.is-clickable {
  cursor: pointer;
  border-radius: 4px;
}
.ap-card-title.is-clickable:hover {
  color: var(--accent-2, #c5642a);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ap-field textarea {
  width: 100%;
  border: 1px solid var(--border-2, #d8d2c6);
  border-radius: 5px;
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink-1, #1c1916);
  background: var(--bg-surface, #fff);
  resize: vertical;
  min-height: 56px;
  outline: none;
  box-sizing: border-box;
}
.ap-field textarea:focus {
  border-color: var(--accent, #e07a3d);
  box-shadow: 0 0 0 2px var(--accent-soft, #fde4d2);
}
.ap-comment-compose { margin-top: 10px; }
.ap-comment-body {
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink-1, #1c1916);
  white-space: pre-wrap;
}
.ap-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 2px;
}
.ap-field label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-3, #7a756c);
  margin-bottom: 3px;
}
.ap-field input,
.ap-field select {
  width: 100%;
  border: 1px solid var(--border-2, #d8d2c6);
  border-radius: 5px;
  padding: 5px 8px;
  font-size: 12px;
  line-height: 1.3;
  color: var(--ink-1, #1c1916);
  background: var(--bg-surface, #fff);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  min-height: 0;
  height: 30px;
  box-sizing: border-box;
}
.ap-field input:focus,
.ap-field select:focus {
  border-color: var(--accent, #e07a3d);
  box-shadow: 0 0 0 2px var(--accent-soft, #fde4d2);
}
.ap-field input:disabled,
.ap-field select:disabled {
  background: var(--bg-hover, #f3efe9);
  color: var(--ink-4, #a8a294);
  cursor: not-allowed;
}
.ap-field-hint { display: none; }
.ap-title-input {
  font-size: 13px !important;
  font-weight: 600;
  padding: 6px 8px !important;
  height: 32px !important;
}
.ap-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.ap-bind-card {
  border: 1px solid var(--border, #e6e1d9);
  border-radius: 8px;
  background: var(--bg-surface-2, #faf7f2);
  padding: 8px;
}
.ap-bind-card-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-2, #4a4640);
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ap-bind-card-title::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent, #e07a3d);
}
.ap-bind-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 8px;
}
.ap-bind-grid .ap-field-span { grid-column: 1 / -1; }
.ap-status-pills {
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
}
.ap-status-pills label {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 0;
  padding: 4px 6px;
  border: 1px solid var(--border-2, #d8d2c6);
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink-2, #4a4640);
  cursor: pointer;
  background: var(--bg-surface, #fff);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  height: 28px;
  box-sizing: border-box;
}
.ap-status-pills label:has(input:checked),
.ap-status-pills label.is-active {
  border-color: var(--accent, #e07a3d);
  background: var(--accent-soft, #fde4d2);
  color: var(--accent-2, #c5642a);
}
.ap-status-pills input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.ap-form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border, #e6e1d9);
  margin-top: 2px;
}
.ap-btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.3;
}
.ap-btn-ghost {
  background: transparent;
  border-color: var(--border-2, #d8d2c6);
  color: var(--ink-2, #4a4640);
}
.ap-btn-ghost:hover { background: var(--bg-hover, #f3efe9); }
.ap-btn-primary {
  background: var(--accent, #e07a3d);
  color: #fff;
}
.ap-btn-primary:hover { background: var(--accent-2, #c5642a); }
.ap-btn-danger {
  background: transparent;
  border-color: rgba(195, 54, 54, 0.35);
  color: var(--danger, #c33636);
  margin-right: auto;
}
.ap-btn-danger:hover { background: var(--danger-soft, #fbdada); }
.ap-bind-summary {
  display: none;
  margin-top: 6px;
  font-size: 11px;
  color: var(--ink-3, #7a756c);
}
.ap-bind-summary.is-visible { display: block; }
.ap-comments { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border, #e6e1d9); }
.ap-comment {
  padding: 8px 0;
  border-bottom: 1px solid var(--border, #e6e1d9);
  font-size: 12px;
  color: var(--ink-2, #4a4640);
}
.ap-comment:last-child { border-bottom: 0; }
.ap-comment-meta {
  font-size: 10px;
  color: var(--ink-4, #a8a294);
  margin-bottom: 3px;
}
.ap-modal-wide { max-width: min(780px, 94vw) !important; width: min(780px, 94vw) !important; }
/* Global / entity AP list sheet: tiles hug modal edges */
#modal-content.ap-modal-wide .ap-list-sheet .sh-hd {
  padding: 10px 8px;
}
#modal-content.ap-modal-wide .ap-list-sheet .sh-bd {
  padding: 8px 6px 10px;
  gap: 8px;
}
#modal-content.ap-modal-wide .ap-list-sheet .ap-list-filter {
  margin: 0 2px 0;
}
#modal-content.ap-modal-wide #ap-global-list,
#modal-content.ap-modal-wide #ap-entity-list {
  margin: 0;
}
.ap-toolbar-hint { font-size: 12px; color: var(--ink-3, #7a756c); }

/* Legacy aliases kept so older markup still paints */
.ap-row { /* unused — prefer .ap-card */ }
.ap-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-3, #7a756c);
  margin: 0 0 8px;
}

@media (max-width: 640px) {
  .ap-row-2,
  .ap-bind-grid {
    grid-template-columns: 1fr;
  }
  .ap-chip-entity { max-width: 140px; }
}
