/* ============================================================
   NYX — Phase 2A additions
   ============================================================
   Builds on the Phase 1 design system (tokens, sidebar, shell).
   Adds: header CTA bar, modals, calendar, kanban, tasks, detail
   pages, forms. Strict monochrome. No color except via tokens.
   ============================================================ */

/* ===== Page header CTA bar ===== */
/* Three persistent buttons in top-right of every admin page:
   [+ NEW SALES LEAD] [+ NEW REPAIR LEAD] [+ NEW TASK]         */

.nyx-header-ctas {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nyx-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: var(--nyx-text);
  color: var(--nyx-bg);
  border: 1px solid var(--nyx-text);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  font-family: var(--nyx-font);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  transition: box-shadow var(--nyx-t), transform 80ms ease, background var(--nyx-t);
  white-space: nowrap;
}
.nyx-cta:hover { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12); background: var(--nyx-text-2); }
.nyx-cta:active { transform: scale(0.98); }

.nyx-cta-ghost {
  background: var(--nyx-surface);
  color: var(--nyx-text);
  border-color: var(--nyx-border-2);
  box-shadow: none;
}
.nyx-cta-ghost:hover { background: var(--nyx-surface-2); box-shadow: none; }

.nyx-cta-plus {
  font-weight: 300;
  font-size: 16px;
  line-height: 0;
  margin-right: 2px;
}

/* ===== Modals ===== */
.nyx-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.4);
  z-index: 900;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 20px;
  overflow-y: auto;
  animation: nyx-fade-in 160ms ease-out;
}
@keyframes nyx-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.nyx-modal {
  background: var(--nyx-bg);
  border-radius: var(--nyx-radius-lg);
  width: 100%;
  max-width: 560px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
  animation: nyx-slide-up 200ms cubic-bezier(0.2, 0.9, 0.3, 1);
}
.nyx-modal-wide { max-width: 760px; }
@keyframes nyx-slide-up {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.nyx-modal-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 24px 28px 12px;
  border-bottom: 1px solid var(--nyx-border);
}
.nyx-modal-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.nyx-modal-close {
  background: transparent;
  border: 0;
  font-size: 20px;
  color: var(--nyx-muted);
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  border-radius: var(--nyx-radius);
}
.nyx-modal-close:hover { color: var(--nyx-text); background: var(--nyx-surface-2); }

.nyx-modal-body { padding: 20px 28px 24px; }
.nyx-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 28px 24px;
  border-top: 1px solid var(--nyx-border);
}

.nyx-form-row { margin-bottom: 16px; }
.nyx-form-row-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.nyx-form-row-cols-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.nyx-field-hint {
  font-size: 11px;
  color: var(--nyx-muted);
  margin-top: 4px;
  letter-spacing: 0.02em;
}

.nyx-field-error {
  font-size: 12px;
  color: #a04040;
  margin-top: 4px;
}

.nyx-form-section-title {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--nyx-muted);
  font-weight: 700;
  margin: 24px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--nyx-border);
}
.nyx-form-section-title:first-child { margin-top: 0; }

.nyx-toggle-more {
  background: transparent;
  border: 0;
  color: var(--nyx-muted);
  font-size: 12px;
  font-family: var(--nyx-font);
  cursor: pointer;
  padding: 8px 0;
  letter-spacing: 0.02em;
}
.nyx-toggle-more:hover { color: var(--nyx-text); }

/* Segmented control for type pickers, filters */
.nyx-seg {
  display: inline-flex;
  border: 1px solid var(--nyx-border-2);
  border-radius: var(--nyx-radius);
  overflow: hidden;
  background: var(--nyx-surface);
}
.nyx-seg-item {
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--nyx-muted);
  background: transparent;
  border: 0;
  border-right: 1px solid var(--nyx-border-2);
  cursor: pointer;
  font-family: var(--nyx-font);
  transition: background var(--nyx-t), color var(--nyx-t);
}
.nyx-seg-item:last-child { border-right: 0; }
.nyx-seg-item:hover { background: var(--nyx-surface-2); color: var(--nyx-text); }
.nyx-seg-item.active {
  background: var(--nyx-text);
  color: var(--nyx-bg);
}

/* ===== Badge count (sidebar task count) ===== */
.nyx-nav-item-with-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nyx-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--nyx-text);
  color: var(--nyx-bg);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.nyx-count-badge-muted { background: var(--nyx-surface-3); color: var(--nyx-text-2); }

/* ===== Calendar ===== */
.nyx-calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.nyx-calendar-nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.nyx-calendar-navbtn {
  background: var(--nyx-surface);
  border: 1px solid var(--nyx-border-2);
  border-radius: var(--nyx-radius);
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
  font-family: var(--nyx-font);
  min-height: 36px;
}
.nyx-calendar-navbtn:hover { background: var(--nyx-surface-2); }
.nyx-calendar-title {
  font-size: 18px;
  font-weight: 300;
  letter-spacing: 0.02em;
  padding: 0 12px;
}

/* Month grid */
.nyx-cal-month {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border: 1px solid var(--nyx-border);
  border-radius: var(--nyx-radius-lg);
  overflow: hidden;
  background: var(--nyx-surface);
}
.nyx-cal-month-dow {
  padding: 10px 8px;
  background: var(--nyx-surface-2);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--nyx-muted);
  text-align: center;
  border-bottom: 1px solid var(--nyx-border);
  border-right: 1px solid var(--nyx-border);
}
.nyx-cal-month-dow:last-child { border-right: 0; }

.nyx-cal-month-day {
  min-height: 108px;
  padding: 6px;
  border-right: 1px solid var(--nyx-border);
  border-bottom: 1px solid var(--nyx-border);
  position: relative;
  cursor: pointer;
  transition: background var(--nyx-t);
}
.nyx-cal-month-day:hover { background: var(--nyx-surface-2); }
.nyx-cal-month-day:nth-child(7n) { border-right: 0; }
.nyx-cal-month-day.other-month { background: var(--nyx-bg-subtle); }
.nyx-cal-month-day.other-month .nyx-cal-daynum { color: var(--nyx-dim); }
.nyx-cal-month-day.today .nyx-cal-daynum { color: var(--nyx-bg); background: var(--nyx-text); }

.nyx-cal-daynum {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  color: var(--nyx-text);
  margin-bottom: 2px;
}

.nyx-cal-chip {
  display: block;
  font-size: 11px;
  padding: 2px 6px;
  margin: 2px 0;
  background: var(--nyx-surface-3);
  border-left: 2px solid var(--nyx-text);
  border-radius: 2px;
  color: var(--nyx-text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--nyx-t);
}
.nyx-cal-chip:hover { background: var(--nyx-surface-2); }
.nyx-cal-chip-more {
  font-size: 10px;
  color: var(--nyx-muted);
  padding: 2px 6px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Week / Day view */
.nyx-cal-week {
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr);
  border: 1px solid var(--nyx-border);
  border-radius: var(--nyx-radius-lg);
  overflow: hidden;
  background: var(--nyx-surface);
  position: relative;
}
.nyx-cal-day {
  display: grid;
  grid-template-columns: 60px 1fr;
  border: 1px solid var(--nyx-border);
  border-radius: var(--nyx-radius-lg);
  overflow: hidden;
  background: var(--nyx-surface);
}
.nyx-cal-week-header {
  padding: 10px 6px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--nyx-muted);
  background: var(--nyx-surface-2);
  border-bottom: 1px solid var(--nyx-border);
  border-right: 1px solid var(--nyx-border);
}
.nyx-cal-week-header.today { color: var(--nyx-text); }
.nyx-cal-week-header:last-child { border-right: 0; }

.nyx-cal-hour-col {
  border-right: 1px solid var(--nyx-border);
  background: var(--nyx-surface-2);
}
.nyx-cal-hour-label {
  height: 52px;
  padding: 4px 8px 0 0;
  font-size: 10px;
  color: var(--nyx-muted);
  text-align: right;
  border-bottom: 1px dotted var(--nyx-border);
  letter-spacing: 0.04em;
}

.nyx-cal-day-col {
  position: relative;
  border-right: 1px solid var(--nyx-border);
}
.nyx-cal-day-col:last-child { border-right: 0; }
.nyx-cal-hour-slot {
  height: 52px;
  border-bottom: 1px dotted var(--nyx-border);
  cursor: pointer;
  transition: background var(--nyx-t);
}
.nyx-cal-hour-slot:hover { background: var(--nyx-surface-2); }

.nyx-cal-event {
  position: absolute;
  left: 2px;
  right: 2px;
  background: var(--nyx-surface-3);
  border-left: 2px solid var(--nyx-text);
  border-radius: 3px;
  padding: 4px 6px;
  font-size: 11px;
  line-height: 1.3;
  cursor: pointer;
  overflow: hidden;
  transition: background var(--nyx-t), box-shadow var(--nyx-t);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.nyx-cal-event:hover {
  background: var(--nyx-surface-2);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  z-index: 2;
}
.nyx-cal-event-title { font-weight: 700; color: var(--nyx-text); }
.nyx-cal-event-sub { color: var(--nyx-muted); font-size: 10px; }

/* List view */
.nyx-cal-list { border-top: 1px solid var(--nyx-border); }
.nyx-cal-list-day {
  padding: 14px 0 6px;
  border-bottom: 1px solid var(--nyx-border);
}
.nyx-cal-list-daylabel {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--nyx-muted);
  padding: 0 8px 8px;
}
.nyx-cal-list-row {
  display: grid;
  grid-template-columns: 90px 1fr 120px;
  gap: 12px;
  padding: 10px 8px;
  border-radius: var(--nyx-radius);
  cursor: pointer;
  align-items: center;
  transition: background var(--nyx-t);
}
.nyx-cal-list-row:hover { background: var(--nyx-surface-2); }
.nyx-cal-list-time { font-size: 13px; font-weight: 700; color: var(--nyx-text); }
.nyx-cal-list-sub { font-size: 12px; color: var(--nyx-muted); }
.nyx-cal-list-who { font-size: 12px; color: var(--nyx-muted); text-align: right; }

/* ===== Kanban ===== */
.nyx-kanban {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 20px;
  align-items: flex-start;
}
.nyx-kanban-col {
  flex: 0 0 280px;
  background: var(--nyx-bg-subtle);
  border: 1px solid var(--nyx-border);
  border-radius: var(--nyx-radius-lg);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 260px);
}
.nyx-kanban-col.terminal-success { background: #f6f6f6; }
.nyx-kanban-col.terminal-failure { background: #fafafa; }
.nyx-kanban-col.on-hold { background: #fbfbfb; }

.nyx-kanban-col-header {
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--nyx-border);
  position: sticky;
  top: 0;
  background: inherit;
  z-index: 1;
  border-radius: var(--nyx-radius-lg) var(--nyx-radius-lg) 0 0;
}
.nyx-kanban-col-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--nyx-text);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.nyx-kanban-col-count {
  color: var(--nyx-muted);
  font-weight: 700;
  font-size: 11px;
}

.nyx-kanban-cards {
  padding: 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 80px;
}
.nyx-kanban-cards.drop-target {
  background: var(--nyx-surface-3);
  outline: 2px dashed var(--nyx-border-2);
  outline-offset: -4px;
}

.nyx-project-card {
  background: var(--nyx-surface);
  border: 1px solid var(--nyx-border);
  border-radius: var(--nyx-radius);
  padding: 10px 12px;
  cursor: grab;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: box-shadow var(--nyx-t), transform 80ms ease;
  font-size: 13px;
}
.nyx-project-card:hover {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}
.nyx-project-card:active { cursor: grabbing; }
.nyx-project-card.dragging { opacity: 0.4; }

.nyx-project-card-ref {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--nyx-muted);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.nyx-project-card-name {
  font-weight: 700;
  color: var(--nyx-text);
  margin-bottom: 3px;
  line-height: 1.3;
}
.nyx-project-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  gap: 8px;
  font-size: 11px;
  color: var(--nyx-muted);
}
.nyx-project-card-customer {
  font-size: 12px;
  color: var(--nyx-muted);
}

/* ===== Tasks ===== */
.nyx-task-row {
  display: grid;
  grid-template-columns: 24px 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--nyx-border);
  cursor: pointer;
  transition: background var(--nyx-t);
}
.nyx-task-row:hover { background: var(--nyx-surface-2); }
.nyx-task-row:last-child { border-bottom: 0; }
.nyx-task-row.done { opacity: 0.5; }
.nyx-task-row.done .nyx-task-title { text-decoration: line-through; }

.nyx-task-checkbox {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--nyx-border-2);
  border-radius: 3px;
  background: var(--nyx-surface);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--nyx-t);
}
.nyx-task-checkbox:hover { border-color: var(--nyx-text); }
.nyx-task-checkbox.checked {
  background: var(--nyx-text);
  border-color: var(--nyx-text);
  color: var(--nyx-bg);
  font-size: 11px;
  font-weight: 700;
}

.nyx-task-title {
  font-size: 14px;
  color: var(--nyx-text);
  line-height: 1.4;
}
.nyx-task-sub {
  font-size: 12px;
  color: var(--nyx-muted);
  margin-top: 2px;
}

.nyx-task-priority {
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 3px;
  border: 1px solid var(--nyx-border-2);
  color: var(--nyx-muted);
}
.nyx-task-priority.urgent {
  border-color: var(--nyx-text);
  color: var(--nyx-text);
  border-width: 1.5px;
}
.nyx-task-priority.low { opacity: 0.7; }

.nyx-task-due {
  font-size: 12px;
  color: var(--nyx-muted);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.nyx-task-due.overdue { color: var(--nyx-text); font-weight: 900; }

/* ===== Filter bar ===== */
.nyx-filter-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.nyx-filter-bar .nyx-input,
.nyx-filter-bar .nyx-select {
  max-width: 280px;
}

/* ===== Detail page ===== */
.nyx-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--nyx-border);
}
.nyx-detail-title-row {
  display: flex;
  gap: 12px;
  align-items: baseline;
  flex-wrap: wrap;
}
.nyx-ref-code {
  font-family: var(--nyx-font-mono);
  font-size: 13px;
  color: var(--nyx-muted);
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  background: var(--nyx-surface-2);
  border-radius: 3px;
  border: 1px solid var(--nyx-border);
}

.nyx-detail-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}

.nyx-kv {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 4px 12px;
  font-size: 13px;
}
.nyx-kv-label {
  color: var(--nyx-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding-top: 4px;
}
.nyx-kv-value {
  color: var(--nyx-text);
  padding: 2px 0;
  border-bottom: 1px solid var(--nyx-border);
  min-height: 22px;
}
.nyx-kv-value:last-of-type { border-bottom: 0; }
.nyx-kv-value.empty { color: var(--nyx-subtle); font-style: italic; }

/* Stage pill (current stage on project detail) */
.nyx-stage-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: var(--nyx-text);
  color: var(--nyx-bg);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.nyx-stage-pill.terminal-success { background: var(--nyx-text-2); }
.nyx-stage-pill.terminal-failure { background: var(--nyx-muted); }
.nyx-stage-pill.on-hold { background: var(--nyx-subtle); color: var(--nyx-text); }

/* Tabs */
.nyx-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--nyx-border);
  margin-bottom: 20px;
}
.nyx-tab {
  padding: 12px 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--nyx-muted);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-family: var(--nyx-font);
  transition: all var(--nyx-t);
  margin-bottom: -1px;
}
.nyx-tab:hover { color: var(--nyx-text); }
.nyx-tab.active { color: var(--nyx-text); border-bottom-color: var(--nyx-text); }

/* Timeline for stage history */
.nyx-timeline { padding: 0 4px; }
.nyx-timeline-item {
  position: relative;
  padding: 8px 0 8px 24px;
  font-size: 13px;
  border-left: 1px solid var(--nyx-border);
}
.nyx-timeline-item::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 16px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--nyx-text);
}
.nyx-timeline-item.auto::before { background: var(--nyx-surface); border: 1.5px solid var(--nyx-text); }
.nyx-timeline-text { color: var(--nyx-text-2); }
.nyx-timeline-time { color: var(--nyx-subtle); font-size: 11px; margin-top: 2px; letter-spacing: 0.02em; }

/* ===== Quick action templates ===== */
.nyx-type-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}
.nyx-type-tile {
  padding: 16px 12px;
  background: var(--nyx-surface);
  border: 1px solid var(--nyx-border-2);
  border-radius: var(--nyx-radius);
  text-align: center;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--nyx-text-2);
  transition: all var(--nyx-t);
  font-family: var(--nyx-font);
}
.nyx-type-tile:hover {
  border-color: var(--nyx-text);
  background: var(--nyx-surface-2);
  color: var(--nyx-text);
}
.nyx-type-tile.selected {
  background: var(--nyx-text);
  color: var(--nyx-bg);
  border-color: var(--nyx-text);
}

/* ===== View toggle (kanban | table) ===== */
.nyx-view-toggle {
  display: inline-flex;
  gap: 0;
  border: 1px solid var(--nyx-border-2);
  border-radius: var(--nyx-radius);
  overflow: hidden;
}

/* ===== Empty state with CTA ===== */
.nyx-empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--nyx-muted);
}
.nyx-empty-state-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--nyx-text-2);
  margin-bottom: 6px;
}
.nyx-empty-state-sub {
  font-size: 13px;
  margin-bottom: 20px;
}

/* ===== Toast ===== */
.nyx-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  background: var(--nyx-text);
  color: var(--nyx-bg);
  border-radius: var(--nyx-radius);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  z-index: 2000;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  animation: nyx-toast-in 220ms cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes nyx-toast-in {
  from { transform: translate(-50%, 20px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}
.nyx-toast-error { background: #8a2020; }

/* ===== Confirm bar (undo) ===== */
.nyx-undo-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 16px 10px 20px;
  background: var(--nyx-text);
  color: var(--nyx-bg);
  border-radius: var(--nyx-radius);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 2000;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}
.nyx-undo-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: var(--nyx-bg);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 3px;
  cursor: pointer;
  font-family: var(--nyx-font);
}
.nyx-undo-btn:hover { background: rgba(255, 255, 255, 0.1); }

/* ===== Dashboard widgets ===== */
.nyx-dash-widget-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}
.nyx-dash-widget-link {
  font-size: 11px;
  color: var(--nyx-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  cursor: pointer;
}
.nyx-dash-widget-link:hover { color: var(--nyx-text); }

/* ===== Header subactions (right-aligned nav on detail pages) ===== */
.nyx-subheader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}

/* Back link */
.nyx-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--nyx-muted);
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 0;
  background: transparent;
  border: 0;
  font-family: var(--nyx-font);
}
.nyx-back-link:hover { color: var(--nyx-text); }

/* Visually hidden */
.nyx-sr { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ===== Mobile ===== */
@media (max-width: 800px) {
  .nyx-modal { max-width: 100%; margin: 0; border-radius: 0; }
  .nyx-modal-backdrop { padding: 0; }
  .nyx-form-row-cols, .nyx-form-row-cols-3 { grid-template-columns: 1fr; }
  .nyx-detail-grid { grid-template-columns: 1fr; }
  .nyx-cal-month-day { min-height: 64px; font-size: 11px; }
  .nyx-cal-chip { font-size: 10px; }
  .nyx-kanban-col { flex: 0 0 260px; }
  .nyx-header-ctas { width: 100%; justify-content: flex-start; }
  .nyx-cta { font-size: 11px; padding: 8px 12px; flex: 1; justify-content: center; }
  .nyx-page-header { flex-direction: column; align-items: stretch; }
  .nyx-cal-list-row { grid-template-columns: 80px 1fr; }
  .nyx-cal-list-who { grid-column: 1 / -1; text-align: left; font-size: 11px; }
}
