/* Base layer: element defaults and the small shared helpers the other ui/ layers build on.
   Collected in stage 5 from the retired crm.css, monday-theme.css and design.css: only the declarations
   that still changed the rendered page were kept, rewritten on the tokens in ui/tokens.css.
   Loaded first, so every rule in components/shell/board/pages/panels still wins over it. */

/* ---------- Elements ---------- */
:root { font-synthesis: none; }
* { box-sizing: border-box; scrollbar-width: thin; }
[hidden] { display: none !important; }
body { line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
/* Fields show focus with a primary ring unless a component draws its own (zero specificity, so any ui/ rule wins). */
:where(input, select, textarea):focus-visible { outline: 2px solid var(--primary-color); outline-offset: 1px; }
a { text-decoration: none; }
nav { gap: var(--space-4); }
p { margin: var(--space-8) 0; line-height: 1.7; }
h1, h2, h3 { letter-spacing: -0.4px; }
h1 { line-height: 1.3; }
table { width: 100%; text-align: left; }
td { max-width: 300px; overflow-wrap: anywhere; }
td small { display: block; margin-top: var(--space-4); }

/* ---------- Text helpers ---------- */
.muted, .help { font-size: 11px; }
.text-button, .name-link, .card-account, .card-title { padding: 0; border: 0; background: none; text-align: left; }
.text-button, .name-link { color: var(--primary-color); }
.text-button { font-size: 12px; font-weight: 500; }
.form-error { color: var(--negative-color); font-size: 12px; white-space: pre-line; }
.evidence { color: var(--secondary-text-color); }
.status-dot { margin-right: 6px; }
.button.primary { box-shadow: 0 1px 2px rgba(0, 115, 234, .25); }

/* ---------- Layout helpers used by drawers, dialogs and pages ---------- */
.panel-head, .linked-record, .action-item, .section-head { justify-content: space-between; }
.section-head { flex-wrap: wrap; }
.dialog-heading { justify-content: space-between; align-items: center; gap: 18px; }
.dialog-heading .eyebrow { font: 500 11px var(--font-family); letter-spacing: 1px; color: var(--secondary-text-color); }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wide { grid-column: 1 / -1; }
.form-more { background: var(--grey-background-color); }
#editor .dialog-footer { bottom: 0; }
.dialog-footer .delete-record { margin-right: auto; }
.button-row { margin-bottom: 15px; }
.chip-row { margin-bottom: 6px; }
.chip-row .chip { height: 28px; font-size: 11.5px; }
.source-details .detail-fact { margin: 15px 0; }
.detail-section p, .workspace-body p { font-size: 13px; line-height: 1.6; }
.action-item { align-items: center; }
.attention-next .button { margin-bottom: var(--space-4); }
.home-head { flex-wrap: wrap; }
.quick-actions .button.secondary { background: var(--primary-background-color); }
.kpi { min-width: 0; }
.kpi small { overflow-wrap: anywhere; }
.prep-when { border-radius: 999px; }
.ai-brief h3 { display: flex; align-items: center; gap: var(--space-8); flex-wrap: wrap; }
.news-list small { margin-top: 2px; }
.news-note { margin-top: var(--space-4); }
.review-card { font-size: 11px; }
.audit-row { flex-wrap: wrap; gap: var(--space-12); font-size: 11px; }
.deleted-row { flex-wrap: wrap; align-items: center; gap: 10px; font-size: 12px; }

/* ---------- Updates feed ---------- */
.timeline-item { gap: 15px; }
.timeline-item > div:last-child { flex: 1 1 0%; }
.timeline-top { flex-wrap: wrap; }
.timeline-item p { white-space: pre-wrap; line-height: 1.55; }
.quick-update textarea { border-radius: var(--border-radius-small); }
.quick-update > div { flex-wrap: wrap; }

/* ---------- Board cells and toolbar pieces ---------- */
.board-table td { overflow-wrap: anywhere; }
.board-cell { white-space: pre-wrap; }
.col-long .board-cell, .col-text .board-cell { -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.col-status { width: 150px; }
.cell-pencil-btn { top: 2px; right: 0; }
.cell-link { gap: 6px; }
.cell-link a { overflow-wrap: anywhere; }
.sum-label { margin-bottom: 2px; }
.label-select { letter-spacing: .01em; }
.label-select option { font-weight: 500; }
.label-cell { text-align: left; }
.label-chip { align-items: center; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.label-tools { gap: 6px; align-items: center; flex-wrap: wrap; }
.label-options { max-height: 320px; }
.label-option input, .columns-popover input { accent-color: var(--primary-color); }
.label-create { margin-top: 6px; }
.label-row { flex-wrap: wrap; align-items: center; gap: 10px; }
.label-row input { width: 180px; }
.label-row select { border-radius: var(--border-radius-small); background: var(--primary-background-color); }
.label-new { border-radius: var(--border-radius-medium); }
.group-heading { width: 100%; }
.group-heading > span { font-size: 11.5px; width: 12px; }
.group-heading small { border-radius: 999px; }
.view-switch.board-view-tabs button.selected { border-bottom-color: var(--primary-color); }
.save-view-menu summary, .columns-menu summary { font-size: 12px; font-weight: 500; white-space: nowrap; }
.save-view-form, .columns-popover { right: 0; max-height: 65vh; overflow-y: auto; }
.columns-popover .text-button { margin-top: 10px; }
.board-toolbar { justify-content: space-between; }
.inline-form input, .inline-form textarea { min-height: 36px; resize: vertical; box-shadow: 0 0 0 3px rgba(0, 115, 234, .13); }

/* ---------- Calendar ---------- */
.calendar-weekdays, .calendar-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays { font-size: 11.5px; text-align: center; color: var(--secondary-text-color); }
.calendar-date button { font-size: 17px; }
.calendar-event { width: 100%; overflow-wrap: anywhere; }

/* ---------- Phones ---------- */
@media (max-width: 760px) {
  .form-grid, #editor #form-fields, #editor .form-more > .form-grid { grid-template-columns: minmax(0, 1fr); }
  .wide { grid-column: auto; }
  .home-controls { flex-wrap: wrap; }
  .quick-actions { grid-template-columns: 1fr 1fr; }
  .quick-actions .button { flex: 1 1 0%; }
  .action-item { flex-direction: column; align-items: flex-start; }
  .board-toolbar .columns-menu, .board-toolbar .save-view-menu { flex-shrink: 0; }
  .calendar-toolbar { flex-wrap: wrap; }
  .calendar-toolbar .button { padding: 6px 9px; }
}
