/* Operational home and role-aware navigation; loaded after the shared CRM styles. */
.crm-today {
  --today-muted: #526477;
  --today-tint: #e9f5f2;
  --today-accent: #08685e;
  --today-urgent: #8b471d;
  min-width: 0;
  color: var(--ink, #233044);
}
.crm-today *, .crm-today *::before, .crm-today *::after { box-sizing: border-box; }
.crm-today :is(h2, h3, p, strong, small, time, span) { overflow-wrap: anywhere; }
.crm-today-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin: 16px 0 20px; }
.crm-today-header > div { min-width: 0; }
.crm-today-header h2 { margin: 0 0 6px; font-size: clamp(23px, 2.2vw, 30px); line-height: 1.2; color: var(--ink-strong); }
.crm-today-header p { margin: 0; max-width: 65ch; font-size: 14px; line-height: 1.5; color: var(--today-muted); }
.crm-today-header .crm-kicker { margin-bottom: 8px; font-size: 10px; }
.crm-today-header small { display: block; margin-top: 7px; color: var(--today-muted); font-size: 12px; }
.crm-today-header .view-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.crm-today .button { min-height: 44px; white-space: normal; }
.crm-today-priorities { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 0 0 20px; }
.crm-today-priority { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 18px; border: 1px solid var(--line); border-top: 3px solid var(--today-accent); border-radius: 12px; background: var(--white); }
.crm-today-priority-label { display: block; margin: 0; font-size: 13px; font-weight: 600; line-height: 1.4; color: var(--ink); }
.crm-today-priority-value { display: block; margin: 0; font-size: 30px; font-weight: 650; letter-spacing: -.8px; line-height: 1.15; color: var(--today-accent); }
.crm-today-priority-help { display: block; margin: 0; font-size: 12px; line-height: 1.5; color: var(--today-muted); }
.crm-today-priority.is-urgent { border-top-color: var(--today-urgent); }
.crm-today-priority.is-urgent .crm-today-priority-value { color: var(--today-urgent); }
.crm-today-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.crm-today-panel { min-width: 0; padding: 20px; background: var(--white); border: 1px solid var(--line); border-radius: 14px; }
.crm-today-panel > header { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 14px; }
.crm-today-panel > header > div { min-width: 0; }
.crm-today-panel h3 { margin: 0; font-size: 16px; line-height: 1.4; }
.crm-today-panel > header p { margin: 5px 0 0; font-size: 12px; line-height: 1.5; color: var(--today-muted); }
.crm-today-panel > header .button { padding: 8px 10px; font-size: 12px; }
.crm-today-list { display: grid; min-width: 0; margin: 0; padding: 0; list-style: none; }
.crm-today-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; width: 100%; min-width: 0; min-height: 68px; padding: 14px 0; border: 0; border-top: 1px solid var(--line); color: var(--ink); background: transparent; text-align: left; font: inherit; }
button.crm-today-row { padding-inline: 10px; border-radius: 6px; cursor: pointer; }
button.crm-today-row:hover { background: var(--paper); }
.crm-today-row-copy { display: grid; flex: 1 1 150px; gap: 4px; min-width: 0; }
.crm-today-row strong { font-size: 13px; line-height: 1.45; }
.crm-today-row :is(small, time), .crm-today-meta { color: var(--today-muted); font-size: 12px; line-height: 1.5; }
.crm-today-meta { display: flex; flex-wrap: wrap; gap: 5px 12px; }
.crm-today-row .button { flex-shrink: 0; padding: 8px 10px; font-size: 12px; }
.crm-today-empty { margin: 0; padding: 20px 14px; border: 1px dashed var(--line); border-radius: 9px; color: var(--today-muted); background: var(--paper); font-size: 13px; line-height: 1.6; }
.crm-today-caption { margin: 14px 0; color: var(--today-muted); font-size: 12px; line-height: 1.5; }
.crm-today .crm-task-row { gap: 10px; min-width: 0; padding: 14px 0; }
.crm-today .crm-task-row > div { min-width: 0; flex-basis: 140px; }
.crm-today .crm-task-row .button { min-height: 44px; font-size: 12px; }
.crm-today :is(button, a):focus-visible { outline: 3px solid var(--crm-focus, #087f79); outline-offset: 2px; }

.crm-workday-nav { display: grid; gap: 6px; width: 100%; min-width: 0; }
.crm-workday-nav-primary, .crm-workday-nav-items { display: grid; gap: 4px; min-width: 0; }
.crm-workday-nav, .crm-workday-nav * { box-sizing: border-box; }
.crm-workday-nav button[data-view] { display: flex; align-items: center; width: 100%; min-width: 0; min-height: 44px; padding: 11px 14px; border: 0; border-radius: 8px; white-space: normal; overflow-wrap: anywhere; color: #bed0dc; background: transparent; text-align: left; font: inherit; font-size: 13px; font-weight: 500; line-height: 1.4; cursor: pointer; }
.crm-workday-nav button[data-view]:hover { background: #ffffff0d; color: #fff; }
.crm-workday-nav button[data-view].is-active { background: #1c454a; color: #8aefdb; box-shadow: inset 3px 0 #66dcc5; font-weight: 600; }
.crm-nav-section { min-width: 0; border-top: 1px solid #ffffff1f; }
.crm-nav-section > summary { min-height: 44px; padding: 13px 10px; color: #bed0dc; cursor: pointer; font-size: 12px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.crm-nav-section > summary:hover { color: #fff; background: #ffffff0d; border-radius: 8px; }
.crm-nav-section[open] > summary { color: #8aefdb; }
.crm-nav-section > summary::marker { color: #9cb5c5; }
.crm-workday-nav-items { padding: 0 0 8px 8px; }
.crm-workday-nav :is(button, summary):focus-visible { outline: 3px solid #8aefdb !important; outline-offset: 2px !important; }
:root[data-theme="dark"] .crm-today { --today-muted: #b5c3d3; --today-tint: #163e3a; --today-accent: #8aefdb; --today-urgent: #ffc18f; }
@media (max-width: 1100px) {
  .crm-today-priorities { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .crm-today-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 880px) {
  .main-nav:has(.crm-workday-nav) { display: block; overflow: visible; max-width: 100%; }
  .crm-workday-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 8px; }
  .crm-workday-nav-primary { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .crm-nav-section[open] { grid-column: 1 / -1; }
  .crm-workday-nav-items { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 0 8px; }
  .crm-workday-nav button[data-view] { padding: 10px 12px; }
}
@media (max-width: 480px) {
  .crm-today-header { align-items: flex-start; gap: 12px; margin: 12px 0 16px; }
  .crm-today-header .view-actions { width: 100%; }
  .crm-today-priorities { gap: 10px; margin-bottom: 16px; }
  .crm-today-priority { padding: 13px 11px; }
  .crm-today-priority-label { font-size: 12px; }
  .crm-today-priority-value { font-size: 27px; }
  .crm-today-grid { gap: 16px; }
  .crm-today-panel { padding: 16px; }
  .crm-today-row { gap: 8px; }
}
@media (forced-colors: active) {
  .crm-today-priority, .crm-today-panel, .crm-today-row, .crm-nav-section { border-color: CanvasText; }
  .crm-workday-nav button[data-view].is-active { outline: 2px solid Highlight; }
}
