/* recovered base */
:root{
  --font-body: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --bg: #000000;
  --panel: #141414;
  --panel2:#111111;
  --border: rgba(255, 255, 255, 0.18);
  --border2: rgba(255, 255, 255, 0.12);
  --text: rgba(255, 255, 255, 0.92);
  --text-secondary: rgba(255, 255, 255, 0.85);
  --text-dim: rgba(255, 255, 255, 0.75);
  --muted: rgba(255, 255, 255, 0.65);
  --text-muted: var(--muted);
  --muted-text: var(--muted);
  --text-faint: rgba(255, 255, 255, 0.45);
  --accent: #a78bfa;
  --danger: #ff6b6b;
  --input: rgba(255, 255, 255, 0.04);
  --priority-border-width: 3px;
  --priority-border-muted: rgba(255, 255, 255, 0.12);
  --priority-accent: #c9a24d;
  --priority-bg: rgba(201, 162, 77, 0.04);
  --surface-subtle: rgba(255, 255, 255, 0.03);
  --surface-2: rgba(255, 255, 255, 0.04);
  --border-strong: rgba(255, 255, 255, 0.20);
  --bg-subtle: rgba(255, 255, 255, 0.02);
  --border-subtle: rgba(255, 255, 255, 0.14);
  --border-emphasis: rgba(255, 255, 255, 0.22);
  --border-active: rgba(255, 255, 255, 0.26);
  --header-bg: var(--bg-subtle);
  --header-border: var(--border-subtle);
  --app-status-summary-height: 64px;
  --topbar-height: 64px;
  --view-header-offset: var(--topbar-height);
  --view-header-spacing: 18px;
  --view-header-z: 900;
  --card-gap: 18px;
}

*{ box-sizing:border-box; }
html{
  height:100%;
  overflow:hidden;
  color-scheme: dark;
}
body{
  margin:0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  color-scheme: dark;
  padding-bottom: 0;
  display:flex;
  flex-direction:column;
  min-height:100vh;
  overflow-x:hidden;
  position:relative;
  overflow-y:hidden;
}

/* ============================
   FOCUS STATES – CANONICAL RULE
   ============================
   All keyboard-focusable elements get a consistent ring.
   Inputs use box-shadow instead so it respects border-radius.
   Per-component overrides may adjust offset only.
   ============================ */

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--focus-ring);
  box-shadow: 0 0 0 2px rgba(167, 139, 250, 0.2);
}

.panel > * + * {
  margin-top: var(--card-gap);
}

.topbar-main {
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:12px;
  width:100%;
}

#view-planning .planning-header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

#view-planning .planning-header-scenario-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

#view-planning .planning-header-scenario-field select {
  min-width: 300px;
  max-width: 46vw;
  border-radius: var(--radius-pill);
}


@media (max-width: 900px) {
  #view-planning .planning-header-scenario-field select {
    min-width: 240px;
    max-width: 70vw;
  }
}

.brand .title{ font-weight:700; font-size:18px; }
.brand .subtitle{ color:var(--muted); font-size:13px; margin-top:2px; }

.tabs{ 
  display:flex; 
  gap:10px; 
  flex:1 1 auto;
  justify-content:flex-start;
  flex-wrap:wrap;
}
.tab{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding:8px 14px;
  border:1px solid var(--border);
  background: var(--bg-subtle);
  color:var(--text);
  border-radius: var(--radius-sm, 10px);
  cursor:pointer;
  font-size:14px;
}
.task-launcher {
  position: relative;
  display: inline-flex;
  flex-direction: column;
}

.task-launcher-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 1200;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(180deg, rgba(18, 18, 18, 0.98), rgba(12, 12, 12, 0.98));
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.48);
}

.task-launcher-option {
  justify-content: flex-start;
}

.task-launcher.open .floating-timer-mini-new-task {
  box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.35) inset;
}
.tab.active{
  background: rgba(167, 139, 250, 0.18);
  border-color: rgba(167, 139, 250, 0.75);
  box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.25) inset;
}

.tab-count-pill {
  margin-left: 0;
  min-width: 18px;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: var(--border-strong);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.tab[data-view="inbox"].active .tab-count-pill {
  border-color: rgba(167, 139, 250, 0.85);
  background: rgba(167, 139, 250, 0.25);
}

.topbar-favicon {
  width: auto;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.05);
  object-fit: contain;
}

.wrap {
  width: 100%;
  padding: 18px 22px;
  flex: 1 1 auto;
  height: calc(100vh - var(--topbar-height));
  min-height: calc(100vh - var(--topbar-height));
  overflow-y: auto;
  background: radial-gradient(1200px 600px at 50% -10%, rgba(167, 139, 250, 0.12), transparent 60%),
              var(--bg);
}
.view .panel{
  margin-top: 6px;
}

.toolbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:10px 0 18px;
}
.toolbar .hint{ color:var(--muted); font-size:13px; }

.btn{
  padding:10px 14px;
  border-radius: var(--radius-md);
  border:1px solid var(--border);
  background: var(--bg-subtle);
  color:var(--text);
  cursor:pointer;
}
.btn.small{
  padding:6px 12px;
  font-size:13px;
  border-radius: var(--radius-sm);
  height:32px;
  line-height:1.1;
}
.btn:hover{ opacity:.92; }
.btn.primary{
  background: rgba(167, 139, 250, 0.9);
  border-color: rgba(167, 139, 250, 0.9);
  color:#1a0a2e;
  font-weight:700;
}
.btn.danger{
  background: transparent;
  border-color: rgba(255, 107, 107, 0.75);
  color: var(--danger);
}

.view{
  display:none;
  width:100%;
}
.view.active{
  display:block;
}

.panel{
  background: linear-gradient(180deg, rgba(18, 18, 18, 0.85), rgba(14, 14, 14, 0.85));
  border:1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding:18px;
}
.panel h2{ margin:0 0 8px 0; }
.muted{ color:var(--muted); margin:0 0 14px 0; }

#view-clients .client-header-row,
#view-sales .client-header-row,
#view-companies .client-header-row,
#view-settings .client-header-row,
#view-reporting .reporting-header,
#view-planning .reporting-header {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:24px;
  flex-wrap:wrap;
}
.panel-header {
  background: var(--header-bg);
  border: 1px solid var(--header-border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow:
    inset 0 1px 0 var(--surface-2),
    0 10px 24px rgba(0, 0, 0, 0.35);
}
.clients-row.panel-header {
  margin:0;
}
.companies-summary{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  align-items:center;
}
.summary-pill{
  padding:6px 10px;
  border-radius: var(--radius-sm);
  border:1px solid var(--border);
  background: var(--bg-subtle);
  font-size:14px;
}
.company-card{
  display:flex;
  flex-direction:column;
  gap:10px;
  padding:16px;
  border-radius:14px;
  border:1px solid var(--border2);
  background: var(--bg-subtle);
}
.company-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap:16px;
  width:100%;
}
.company-section{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.company-card header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
}
.companies-list{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.company-row{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:14px;
  padding:12px;
  border-radius: var(--radius-md);
  border:1px solid var(--border);
  background: rgba(255, 255, 255, 0.01);
}
.company-row strong{
  font-size:15px;
}
.company-meta{
  display:flex;
  flex-direction:column;
  gap:4px;
  font-size:13px;
  color:var(--muted);
}
.company-heat-pill{
  align-self:flex-start;
  padding:2px 10px;
  border-radius: var(--radius-pill);
  border:1px solid transparent;
  font-size:12px;
  font-weight:600;
  margin-top:4px;
  text-transform:none;
}
.company-heat-pill-hot{
  background: rgba(255, 107, 107, 0.15);
  border-color: rgba(255, 107, 107, 0.6);
  color: var(--danger);
}
.company-heat-pill-warm{
  background: rgba(255, 165, 0, 0.17);
  border-color: rgba(255, 165, 0, 0.6);
  color: #ffb347;
}
.company-heat-pill-steady{
  background: rgba(75, 209, 145, 0.18);
  border-color: rgba(75, 209, 145, 0.65);
  color: #4bd191;
}
.company-heat-pill-neutral{
  background: var(--surface-2);
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--muted);
}
.company-actions{
  display:flex;
  justify-content:flex-end;
  align-items:center;
  min-width:0;
}
.company-actions button{
  padding:4px 10px;
  font-size:12px;
  flex-shrink:0;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  text-align:center;
}

/* All Companies table styling */
.companies-table-wrapper{
  margin-top:12px;
  border-radius:16px;
  border:1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.01);
  overflow:hidden;
  box-shadow:
    inset 0 0 0 1px var(--surface-subtle),
    0 10px 20px rgba(0, 0, 0, 0.45);
}

.companies-table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  font-size:15px;
}

.companies-table thead{
  background: linear-gradient(180deg, var(--surface-2), rgba(255, 255, 255, 0.01));
}

.companies-table th{
  padding:12px 16px;
  text-align:left;
  font-size:12px;
  letter-spacing:0.1em;
  text-transform:uppercase;
  color:var(--muted);
  font-weight:600;
}

.companies-table th button{
  font-size:12px;
  font-weight:600;
  color:inherit;
  background:transparent;
  border:none;
  padding:0;
  cursor:pointer;
}

.companies-table th button:hover{
  color:var(--accent);
}

.companies-table tbody td{
  padding:14px 16px;
  border-bottom:1px solid rgba(255, 255, 255, 0.05);
  color:var(--text);
  vertical-align:middle;
}

.company-link{
  font: inherit;
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  cursor: pointer;
  text-align: left;
  display: inline-block;
}

.company-link:hover,
.company-link:focus-visible{
  text-decoration: underline;
  color: var(--accent);
}

.companies-table tbody tr:last-child td{
  border-bottom:none;
}

.companies-table tbody tr:hover{
  background: var(--surface-2);
}

@media (max-width: 900px){
  .companies-table th,
  .companies-table tbody td{
    padding:10px 12px;
  }

  .companies-table{
    font-size:14px;
  }
}

.board{
  display:flex;
  flex-direction:column;
  gap:16px;
  width:100%;
}

.client {
  background: linear-gradient(180deg, rgba(18, 18, 18, 0.72), rgba(14, 14, 14, 0.72));
  border:1px solid var(--border2);
  border-radius: var(--radius-lg);
  overflow: visible; /* FIX: allow header text to render fully */
}
.client-header{
  display:flex;
  align-items:center;
  gap:12px;
}
.client-title {
  font-weight: 700;
  line-height: 1.4;
  white-space: normal;   /* allow wrapping */
  overflow: visible;
}
.client-handle{
  color:var(--muted);
  font-size:12px;
  cursor:grab;
}
.client-body{
  padding:12px 14px 16px;
}
.client.collapsed .client-body{ display:none; }

.columns{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:14px;
}
.col h4{
  margin:6px 0 8px 0;
  color: var(--text-secondary);
}
.list{
  min-height:56px;
  border:1px dashed var(--border-strong);
  border-radius:14px;
  padding:10px;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.task{
  background: var(--surface-subtle);
  border:1px solid var(--border);
  border-radius:14px;
  padding:10px 10px;
  cursor:grab;
}
.task-top{
  display: flex;
  justify-content: space-between;
  align-items: center;   /* 🔑 FIX */
  gap: 10px;
}
.task-title{ font-weight:650; }
.task-meta{
  margin-top: 6px;
  font-size: 12px;
  opacity: 0.7;
  display: flex;
  gap: 8px;
  align-items: center;
}
.tags{ margin-top:8px; display:flex; gap:8px; flex-wrap:wrap; }
.tag{
  font-size:12px;
  padding:4px 8px;
  border-radius: var(--radius-pill);
  border:1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-secondary);
}
.tag.effort{ border-color: rgba(167, 139, 250, 0.25); }

.iconbtn{
  border:1px solid var(--border-strong);
  background: var(--bg-subtle);
  color:var(--text);
  border-radius: var(--radius-sm);
  padding:6px 10px;
  cursor:pointer;
}

.formgrid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:14px;
  width: 100%;
}
.formgrid label{ display:flex; flex-direction:column; gap:6px; }
.formgrid .span2{ grid-column: span 2; }

.formgrid input[type="date"],
.modal input[type="date"],
.time-entry input[type="date"] {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-emphasis);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  padding: 8px 10px;
  appearance: none;
  -webkit-appearance: none;
  min-height: 40px;
}

.formgrid input[type="date"]::-webkit-calendar-picker-indicator,
.modal input[type="date"]::-webkit-calendar-picker-indicator,
.time-entry input[type="date"]::-webkit-calendar-picker-indicator {
  filter: brightness(0) invert(1);
}

input, select, textarea{
  background: var(--input);
  border:1px solid var(--border);
  border-radius: var(--radius-md);
  padding:10px 12px;
  color: var(--text);
  outline:none;
}
select option{
  background: linear-gradient(180deg, rgba(18, 18, 18, 0.95), rgba(14, 14, 14, 0.95));
  color: var(--text);
}
textarea{ resize:vertical; }

.actions{ display:flex; gap:10px; margin-top:14px; }

.settings-row{ display:flex; gap:10px; margin:10px 0 16px; }
.settings-clients{ display:flex; flex-direction:column; gap:10px; }
.settings-client{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid var(--border);
  background: var(--bg-subtle);
}
.settings-client .name{ font-weight:650; }
.settings-client .drag{ color:var(--muted); cursor:grab; }

dialog{ border:none; padding:0; background:transparent; }
.row3{
  display:grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap:14px;
  margin-top:10px;
}

.confirm-dialog .confirm-card {
  width: 360px;
  max-width: calc(100vw - 32px);
  border-radius: var(--radius-dialog);
  padding: 24px 26px 24px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.65);
  background: linear-gradient(180deg, rgba(18, 18, 18, 0.98), rgba(12, 12, 12, 0.98));
  border: 1px solid var(--border-subtle);
}

.confirm-dialog .confirm-message {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
  color: var(--text);
}

.confirm-dialog .confirm-actions {
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  margin-top: 20px;
}

.confirm-dialog .btn {
  border-radius: var(--radius-pill);
  padding: 10px 24px;
  font-weight: 600;
  font-size: 15px;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border-subtle);
}

.confirm-dialog .btn.primary {
  background: var(--btn-primary-bg);
  border-color: var(--btn-primary-border);
  color: var(--btn-primary-text);
}

.confirm-dialog .btn.secondary {
  background: var(--btn-secondary-bg);
  border-color: var(--btn-secondary-border);
  color: var(--btn-secondary-text);
}

.confirm-dialog .btn:hover {
  opacity: 0.85;
}

.confirm-dialog.danger .btn.primary {
  background: rgba(255, 107, 107, 0.95);
  border-color: rgba(255, 107, 107, 0.75);
  color: #141414;
}

.prompt-dialog .prompt-card {
  width: 400px;
  max-width: calc(100vw - 32px);
  border-radius: var(--radius-dialog);
  padding: 26px 30px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.65);
  background: linear-gradient(180deg, rgba(18, 18, 18, 0.98), rgba(12, 12, 12, 0.98));
  border: 1px solid var(--border-subtle);
}

.prompt-dialog .prompt-card h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.prompt-dialog .prompt-input {
  display: block;
  margin-top: 8px;
}

.prompt-dialog input,
.prompt-dialog select,
.link-edit-dialog input {
  width: 100%;
  border-radius: 14px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  background: var(--input);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
}

.prompt-dialog input:focus,
.prompt-dialog select:focus,
.link-edit-dialog input:focus {
  outline: none;
  border-color: var(--focus-ring);
  box-shadow: 0 0 0 2px rgba(167, 139, 250, 0.35);
}

.prompt-dialog select[size]:not([size="1"]) {
  min-height: 210px;
  max-height: 280px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.35;
}

#prompt-dialog[data-mode="select"] .prompt-card {
  width: min(760px, calc(100vw - 32px));
}

#prompt-dialog[data-mode="select"] .prompt-input {
  margin-top: 12px;
}

#prompt-dialog[data-mode="select"] .modal-actions {
  margin-top: 16px;
}

.link-edit-dialog .link-edit-card {
  width: 420px;
  max-width: calc(100vw - 32px);
  border-radius: var(--radius-dialog);
  padding: 26px 30px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65);
  background: linear-gradient(
    180deg,
    rgba(18, 18, 18, 0.98),
    rgba(12, 12, 12, 0.98)
  );
  border: 1px solid var(--border-subtle);
}

.link-edit-dialog .field {
  margin-top: 12px;
}

.link-edit-dialog label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  display: block;
}


.calendar-link-dialog .field {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
}

.calendar-link-dialog label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.calendar-link-dialog select {
  flex: 1;
  min-width: 220px;
  border-radius: 14px;
  padding: 12px 16px;
  border: 1px solid var(--border-emphasis);
  background: rgba(13, 16, 22, 0.9);
  color: #fff;
  font-size: 15px;
}

/* Inputs, selects, textareas inside modal */
.modal input,
.modal select,
.modal textarea {
  color: var(--text);
  background-color: var(--border2);
}

/* Placeholder text */
.modal input::placeholder,
.modal textarea::placeholder {
  color: var(--text-faint);
}

/* Dropdown arrows / borders consistency */
.modal select {
  border-color: rgba(255, 255, 255, 0.25);
}

.status-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  white-space: nowrap;
  gap: 18px;
  padding: 0;
  margin: 0;
  width: auto;
  max-width: none;
  border-radius: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  position: static;
  top: auto;
  z-index: auto;
  backdrop-filter: none;
  min-height: unset;
  font-size: 14px;
  flex: 0 0 auto;
  justify-content: flex-end;
}

.status-summary .status-item {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  flex: 0 0 auto;
  min-width: max-content;
}

.status-summary .status-label {
  font-weight: 600;
  display: inline-flex;
  white-space: nowrap;
}

.status-summary .status-value {
  display: inline-flex;
  white-space: nowrap;
}

.status-summary .next-meeting {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.status-summary .next-meeting-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-summary #next-meeting-activities {
  flex-shrink: 0;
  padding: 4px 12px;
  font-size: 13px;
  border-radius: var(--radius-sm);
  align-self: center;
  line-height: 1.1;
}
.status-summary #next-meeting-join {
  flex-shrink: 0;
  padding: 4px 12px;
  font-size: 13px;
  border-radius: var(--radius-sm);
  align-self: center;
  line-height: 1.1;
  text-decoration: none;
}

.note-editor-body {
  min-height: 280px;
  outline: none;
  color: #fff;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-sm);
  padding: 12px;
  white-space: pre-wrap;
  overflow-y: auto;
  margin-bottom: 0;
  resize: vertical;
  width: 100%;
  min-height: 220px;
}

.notes-editor {
  border: 1px solid var(--border-active);
  background: var(--surface-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
  color: #fff;
  outline: none;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  width: 100%;
  min-height: 150px;
  resize: vertical;
  overflow-y: auto;
  transition: border-color 0.2s, background 0.2s;
}

.notes-editor:focus,
.note-editor-body:focus {
  border-color: rgba(130, 170, 255, 0.9);
  background: rgba(255, 255, 255, 0.05);
}

.view:empty::after{
  content: "";
  display:block;
  height: 40px;
}

body.dialog-open .wrap {
  overflow: hidden;
}


:root {
  --scrollbar-size: 10px;
  --scrollbar-track: rgba(8, 10, 16, 0.6);
  --scrollbar-thumb: rgba(167, 139, 250, 0.85);
  --scrollbar-thumb-hover: rgba(167, 139, 250, 0.95);
  --scrollbar-thumb-edge: rgba(0, 0, 0, 0.35);
}

/* Global scrollbar styling */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

*::-webkit-scrollbar {
  width: var(--scrollbar-size);
  height: var(--scrollbar-size);
}

*::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
  border-radius: var(--radius-pill);
  border: 2px solid transparent;
  background-clip: content-box;
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--scrollbar-thumb), rgba(84, 110, 255, 0.8));
  border-radius: var(--radius-pill);
  border: 2px solid var(--scrollbar-thumb-edge);
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--scrollbar-thumb-hover), rgba(84, 110, 255, 0.9));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3) inset;
}


/* ── Top-bar embedded timer ─────────────────────────────────── */

.floating-timer {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0 8px 0 0;
}

.floating-timer button,
.floating-timer select,
.floating-timer input {
  cursor: pointer;
}

.floating-timer-header {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 100%;
  flex-wrap: nowrap;
}

.floating-timer-collapse-stop {
  flex-shrink: 0;
  font-size: 12px;
  padding: 5px 10px;
}

.floating-timer-pause {
  flex-shrink: 0;
  font-size: 12px;
  padding: 5px 10px;
  border-color: rgba(255, 190, 65, 0.52);
  background: rgba(255, 190, 65, 0.2);
  color: #ffd99a;
  font-weight: 600;
}

.floating-timer-pause:hover,
#floating-timer-pause-panel:hover {
  border-color: rgba(255, 190, 65, 0.7);
  background: rgba(255, 190, 65, 0.28);
}

.floating-timer-pause:active,
#floating-timer-pause-panel:active {
  border-color: rgba(255, 190, 65, 0.8);
  background: rgba(255, 190, 65, 0.35);
}

#floating-timer-pause-panel {
  border-color: rgba(255, 190, 65, 0.52);
  background: rgba(255, 190, 65, 0.2);
  color: #ffd99a;
  font-weight: 600;
}

.floating-timer-toggle {
  all: unset;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  font-size: 13px;
  line-height: 1.2;
  flex: 1;
  min-width: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.floating-timer.running .floating-timer-toggle {
  border-color: rgba(91, 255, 146, 0.35);
  background: rgba(91, 255, 146, 0.07);
}

.floating-timer.paused .floating-timer-toggle {
  border-color: rgba(255, 224, 102, 0.35);
  background: rgba(255, 224, 102, 0.07);
}

.floating-timer-toggle:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.18);
}

.floating-timer.running .floating-timer-toggle:hover {
  background: rgba(91, 255, 146, 0.12);
}

.floating-timer.paused .floating-timer-toggle:hover {
  background: rgba(255, 224, 102, 0.12);
}

.floating-timer-toggle:active {
  background: rgba(255, 255, 255, 0.11);
}

.floating-timer-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.floating-timer-expand-badge {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px 2px 5px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.floating-timer-toggle:hover .floating-timer-expand-badge {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.24);
}

.floating-timer-expand-label::before {
  content: "Timer";
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.02em;
  line-height: 1;
}

.floating-timer-toggle[aria-expanded="true"] .floating-timer-expand-label::before {
  content: "Close";
}

.floating-timer-icon {
  transition: transform 0.2s ease;
  font-size: 16px;
  line-height: 1;
  color: var(--muted);
}

.floating-timer.expanded .floating-timer-icon {
  transform: rotate(180deg);
}

.floating-timer-indicator {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
}

.floating-timer.running .floating-timer-indicator {
  background: #5bff92;
  border-color: #5bff92;
  box-shadow: 0 0 8px rgba(91, 255, 146, 0.6);
}

.floating-timer.paused .floating-timer-indicator {
  background: #ffe066;
  border-color: #ffe066;
  box-shadow: 0 0 8px rgba(255, 224, 102, 0.5);
}

.floating-timer-summary {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 7px;
  min-width: 0;
  overflow: hidden;
}

.floating-timer-summary strong {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
  font-weight: 600;
}

/* Engagement sub-label redundant in collapsed bar — shown in expanded panel */
.floating-timer-summary-engagement {
  display: none;
}

.floating-timer-summary span {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.floating-timer-summary-meeting {
  font-size: 11px;
  color: var(--accent);
  text-transform: none;
}

/* Dropdown panel */
.floating-timer-panel {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 380px;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  z-index: 1100;
  background: linear-gradient(180deg, rgba(20, 20, 20, 0.98), rgba(14, 14, 14, 0.97));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(0, 0, 0, 0.4);
  margin-top: 4px;
}

.floating-timer-panel-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.floating-timer-panel-controls select {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-emphasis);
  background: var(--surface-subtle);
  color: var(--text);
  padding: 8px 10px;
  font-size: 13px;
  width: 100%;
}

.floating-timer-start-control {
  margin-top: 6px;
  width: 100%;
}

.floating-timer-mini-actions {
  display: flex;
  gap: 4px;
  margin-left: 4px;
}

.task-launcher-floating .task-launcher-panel {
  min-width: 200px;
  top: calc(100% + 8px);
  bottom: auto;
}

.floating-timer-mini-actions .btn {
  padding: 5px 12px;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.floating-timer-panel .task-launcher {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.floating-timer-panel .task-launcher > button {
  width: 100%;
}

.floating-timer-task-notes {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
}

.floating-timer-engagement-select.hidden {
  display: none !important;
}

.floating-timer.expanded .floating-timer-panel {
  display: flex;
}

/* Backdrop shown when timer panel is open for client selection (not while running) */
.floating-timer-backdrop {
  position: fixed;
  inset: 0;
  top: 48px;
  z-index: 1050;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
}

.floating-timer-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

.floating-timer-panel-summary p {
  margin: 0;
  letter-spacing: 0.03em;
}

.floating-timer-panel-state {
  font-size: 11px;
  color: var(--muted);
}

.floating-timer-panel-task {
  margin: 0;
  font-size: 13px;
  color: #fff;
  opacity: 0.85;
}

.floating-timer-panel-client {
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.floating-timer-panel-engagement {
  font-size: 12px;
  color: var(--muted);
}

.floating-timer-panel-elapsed {
  font-size: 13px;
  color: var(--muted);
}

.floating-timer-panel-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.floating-timer-panel-actions > button {
  width: 100%;
}

.floating-timer-action-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.floating-timer-action {
  flex: 1;
  display: inline-flex;
  justify-content: center;
}

.floating-timer-panel button:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.reporting-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.reporting-table {
  width: 100%;
  border-collapse: collapse;
}

.reporting-table th,
.reporting-table td {
  padding: 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.reporting-table th {
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.reporting-table td {
  color: var(--text);
  font-size: 14px;
}

.reporting-table tr.reporting-summary {
  cursor: pointer;
}

.reporting-table tr.reporting-summary:hover {
  background: rgba(255, 255, 255, 0.05);
}



.reporting-detail-table {
  width: 100%;
  margin-top: 8px;
  border-collapse: collapse;
  font-size: 0.9em;
}

.reporting-detail-table th,
.reporting-detail-table td {
  padding: 6px 8px;
  border-top: 1px solid var(--border);
}


.reporting-table tr.reporting-summary {
  cursor: pointer;
}
.reporting-details td {
  padding-left: 32px;
  color: var(--muted);
}

/* Summary rows */
.reporting-table tr.reporting-summary {
  cursor: pointer;
  transition: background 0.15s ease;
}

.reporting-table tr.reporting-summary:hover {
  background: var(--surface-subtle);
}

.reporting-table tr.reporting-summary .chevron {
  display: inline-block;
  width: 16px;
  margin-right: 6px;
  transition: transform 0.15s ease;
  opacity: 0.7;
}

/* Rotate chevron when expanded */
.reporting-table tr.reporting-summary.expanded .chevron {
  transform: rotate(90deg);
}

/* Detail container */
.reporting-detail-cell {
  padding: 0;
  background: rgba(255, 255, 255, 0.015);
}

/* Detail list */
.reporting-detail-list {
  padding: 10px 24px 12px 40px;
}

/* Individual detail rows */
.reporting-detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9em;
  color: var(--muted);
  padding: 4px 0;
}

.reporting-detail-row .date {
  opacity: 0.85;
}

.reporting-detail-row .time {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-variant-numeric: tabular-nums;
}
.reporting-detail-row .time-value {
  display: inline-block;
}

.reporting-table tr.reporting-summary .chevron::before {
  content: "▸";
  display: inline-block;
  margin-right: 6px;
  transition: transform 0.15s ease;
}

.reporting-table tr.reporting-summary.expanded .chevron::before {
  transform: rotate(90deg);
}

/* ---- Reporting controls container ---- */
.reporting-controls {
  display: flex;
  gap: 10px;
}

/* ---- Shared styling for BOTH controls ---- */
.reporting-controls select,
.reporting-controls input[type="month"],
#view-planning .reporting-controls input[type="number"] {
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: #ffffff;

  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);

  height: 36px;
  padding: 0 12px;

  line-height: 36px;

  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.client-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.client-meta {
  display: flex;
  flex-direction: column;
}

.client-name {
  font-weight: 600;
}

.client-stats {
  font-size: 12px;
  opacity: 0.7;
  display: flex;
  align-items: center;
  gap: 6px;
}

.client-stats .dot {
  opacity: 0.4;
}

.total-cell {
  text-align: right;
  font-weight: 600;
}

.reporting-table tr.reporting-summary {
  cursor: pointer;
}

.reporting-table tr.reporting-summary:hover {
  background: var(--surface-subtle);
}

.reporting-table tr.reporting-summary .chevron {
  transition: transform 0.15s ease;
}

.reporting-table tr.reporting-summary.expanded .chevron {
  transform: rotate(90deg);
}

/* Make calendar icon white in dark UI */
input[type="month"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: 0.9;
  cursor: pointer;
}

input[type="month"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

input[type="month"] {
  color-scheme: dark;
}

#time-notes {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
}

/* Hide reporting-only controls on Time view */
#view-time .collapse-controls,
#view-time .collapse-all,
#view-time .expand-all,
#view-time .tip {
  display: none !important;
}

/* Time view cleanup */
#view-time button:has-text("Collapse"),
#view-time button:has-text("Expand"),
#view-time .tip,
#view-time .hint,
#view-time .helper-text {
  display: none !important;
}

/* backdrop */
/* modal card */
.modal-card {
  background: linear-gradient(180deg, rgba(18, 18, 18, 0.96), rgba(10, 10, 10, 0.98));
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 36px;
  width: fit-content;
  display: inline-block;
  max-width: calc(100vw - 32px);
  box-shadow: 0 30px 110px rgba(0, 0, 0, 0.75);
  overflow: hidden;
}

.task-inline-workspace {
  width: min(1320px, 96vw);
  margin: 14px auto 0;
}

.task-workspace-slot {
  width: 100%;
  margin: 0 0 12px;
}

.task-inline-surface {
  position: static;
  inset: auto;
  margin: 12px 0 18px;
  width: 100%;
  max-width: none;
  border: none;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.task-inline-surface.task-inline-enter {
  animation: taskInlineEnter 170ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.task-inline-surface:last-child {
  margin-bottom: 0;
}

.task-inline-surface::backdrop {
  background: transparent;
}

dialog#intake-modal.task-floating-surface {
  position: fixed;
  inset: auto;
  margin: 0;
  z-index: 1350;
  left: var(--task-float-left, 12px);
  top: var(--task-float-top, 12px);
  width: var(--task-float-width, min(1120px, calc(100vw - 24px)));
  max-width: var(--task-float-width, min(1120px, calc(100vw - 24px)));
  transform-origin: top right;
}

dialog#company-creator-modal.task-floating-surface {
  position: fixed;
  inset: auto;
  margin: 0;
  z-index: 1350;
  left: 50%;
  top: 50%;
  width: var(--task-float-width, min(1120px, calc(100vw - 24px)));
  max-width: var(--task-float-width, min(1120px, calc(100vw - 24px)));
  transform: translate(-50%, -50%);
  transform-origin: center;
}

dialog#intake-modal.task-floating-surface .modal-card {
  height: min(80vh, 840px);
  max-height: min(80vh, 840px);
}

dialog#company-creator-modal.task-floating-surface .modal-card {
  height: auto;
  max-height: none;
}

dialog#intake-modal.task-floating-surface .intake-scroll {
  max-height: none;
}

@keyframes taskInlineEnter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .task-inline-surface.task-inline-enter {
    animation: none;
  }
}

@media (max-width: 900px) {
  dialog#intake-modal.task-floating-surface {
    left: 12px !important;
    right: 12px;
    top: 12px !important;
    width: auto !important;
    max-width: none;
  }

  dialog#intake-modal.task-floating-surface .modal-card {
    height: calc(100vh - 24px);
    max-height: calc(100vh - 24px);
  }

  dialog#company-creator-modal.task-floating-surface {
    left: 12px !important;
    right: 12px;
    top: 12px !important;
    width: auto !important;
    max-width: none;
  }
}

.task-inline-surface .intake-header {
  background: linear-gradient(
    180deg,
    rgba(18, 18, 18, 0.98) 0%,
    rgba(18, 18, 18, 0.92) 70%,
    rgba(18, 18, 18, 0) 100%
  );
  backdrop-filter: blur(2px);
}

.task-inline-surface .modal-actions.intake-actions.task-modal-footer {
  position: sticky;
  bottom: 0;
  z-index: 3;
  padding: 12px 15px 14px;
  border-top: 1px solid var(--border-subtle);
  background: linear-gradient(
    180deg,
    rgba(7, 9, 13, 0.6),
    rgba(7, 9, 13, 0.95)
  );
  backdrop-filter: blur(8px);
}

dialog.task-inline-surface#intake-modal,
dialog.task-inline-surface#task-dialog,
dialog.task-inline-surface#company-creator-modal {
  width: 100%;
  max-width: none;
  --intake-column-inset: 18px;
}

dialog.task-inline-surface#intake-modal .modal-card,
dialog.task-inline-surface#task-dialog .modal-card {
  border-radius: 16px;
  border-color: var(--border-subtle);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.35);
  background: linear-gradient(
    180deg,
    rgba(18, 18, 18, 0.97),
    rgba(12, 12, 12, 0.98)
  );
  height: auto;
  max-height: none;
}

dialog.task-inline-surface#company-creator-modal .modal-card {
  border-radius: 16px;
  border-color: var(--border-subtle);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.35);
  background: linear-gradient(
    180deg,
    rgba(18, 18, 18, 0.97),
    rgba(12, 12, 12, 0.98)
  );
}

dialog.task-inline-surface#intake-modal .intake-body,
dialog.task-inline-surface#task-dialog .intake-body {
  padding-block: 8px 12px;
  height: auto;
  max-height: none;
}

dialog.task-inline-surface#intake-modal .intake-scroll,
dialog.task-inline-surface#task-dialog .intake-scroll {
  max-height: min(65vh, 620px);
}

dialog#task-dialog {
  font-size: 13px;
}

dialog#intake-modal .modal-card {
  height: calc(100vh - 64px);
  max-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
}

dialog#task-dialog .modal-card {
  height: auto;
  max-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
}

dialog#intake-modal {
  font-size: 14px;
  font-family: var(--font-body);
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: var(--text);
}

dialog#intake-modal .modal-card,
dialog#intake-modal .intake-body {
  font-size: inherit;
  line-height: inherit;
  color: inherit;
  font-family: inherit;
}


/* title */
.modal-card h3 {
  margin: 0 0 20px;
  font-size: 20px;
  font-weight: 600;
}

/* form layout */
.modal-columns {
  width: 100%;
}

dialog#intake-modal,
dialog#task-dialog,
dialog#company-creator-modal {
  --intake-column-inset: 36px;
  width: min(1320px, 96vw);
  max-width: 1320px;
}

dialog#intake-modal.task-floating-surface {
  left: var(--task-float-left, 12px) !important;
  top: var(--task-float-top, 12px) !important;
  right: auto !important;
  bottom: auto !important;
  width: var(--task-float-width, min(1120px, calc(100vw - 24px))) !important;
  max-width: var(--task-float-width, min(1120px, calc(100vw - 24px))) !important;
}

dialog#company-creator-modal.task-floating-surface {
  left: 50% !important;
  top: 50% !important;
  right: auto !important;
  bottom: auto !important;
  width: var(--task-float-width, min(1120px, calc(100vw - 24px))) !important;
  max-width: var(--task-float-width, min(1120px, calc(100vw - 24px))) !important;
  transform: translate(-50%, -50%);
}

dialog#intake-modal .modal-card,
dialog#task-dialog .modal-card {
  padding: 0;
}

dialog#company-creator-modal .modal-card {
  padding: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
}

dialog#intake-modal .intake-body,
dialog#task-dialog .intake-body {
  padding-inline: var(--intake-column-inset);
  display: flex;
  flex-direction: column;
}

dialog#company-creator-modal .intake-body {
  padding-inline: var(--intake-column-inset);
  padding-block: 8px 12px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

dialog#intake-modal .intake-body {
  padding-block: 36px 32px;
  height: 100%;
  min-height: 0;
  flex: 1;
}

dialog#task-dialog .intake-body {
  min-height: 0;
  height: 100%;
  max-height: 100%;
  flex: 1;
}

dialog#intake-modal form#intake-form,
dialog#task-dialog form#edit-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

dialog.task-inline-surface#task-dialog form#edit-form {
  flex: 0 0 auto;
}

dialog.task-inline-surface#task-dialog .modal-actions.intake-actions.task-modal-footer {
  position: static;
}

dialog#intake-modal .modal-columns,
dialog#task-dialog .modal-columns {
  flex: 1;
  min-height: 0;
}

dialog#intake-modal .intake-scroll,
dialog#task-dialog .intake-scroll {
  flex: 1;
  min-height: 0;
  height: 100%;
  max-height: calc(100vh - 220px);
  overflow-y: auto;
  padding-bottom: 24px;
}

dialog#company-creator-modal .intake-scroll {
  max-height: min(65vh, 620px);
  overflow-y: auto;
  padding-bottom: 12px;
}

dialog#intake-modal .intake-scroll {
  max-height: 100%;
}

dialog#task-dialog .intake-scroll {
  overflow-y: auto;
}

dialog#intake-modal .intake-header,
dialog#task-dialog .intake-header {
  position: sticky;
  top: 0;
  z-index: 1;
  background: transparent;
  padding: 24px 0 12px;
  margin: 0;
}

dialog#company-creator-modal .intake-header {
  position: sticky;
  top: 0;
  z-index: 1;
  background: transparent;
  padding: 6px 0 12px;
  margin: 0;
}

dialog#intake-modal .intake-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

dialog#task-dialog .intake-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 14px 0;
}

dialog#intake-modal .intake-header__title,
dialog#task-dialog .intake-header__title {
  flex: 1;
  min-width: 0;
}

dialog#task-dialog .intake-header__title {
  display: flex;
  align-items: center;
  gap: 16px;
}

dialog#company-creator-modal .intake-header__title {
  flex: 1;
  min-width: 0;
}

dialog#intake-modal .intake-header__tabs,
dialog#task-dialog .intake-header__tabs {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  min-width: 240px;
  gap: 6px;
}

dialog#task-dialog .intake-header__tabs {
  grid-row: 2;
  width: 100%;
}

dialog#intake-modal .modal-actions.intake-actions,
dialog#task-dialog .modal-actions.intake-actions,
dialog#company-creator-modal .modal-actions.intake-actions {
  position: sticky;
  bottom: 0;
  z-index: 1;
  background: transparent;
  padding: 16px 0 24px;
  margin: 16px 0 0;
  width: 100%;
  display: flex;
  justify-content: flex-start;
  gap: 14px;
}

dialog#intake-modal .modal-actions.intake-actions.task-modal-footer,
dialog#task-dialog .modal-actions.intake-actions.task-modal-footer,
dialog#company-creator-modal .modal-actions.intake-actions.task-modal-footer {
  position: static;
  padding: 15px;
  background: transparent;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 0;
  margin-top: 0;
}

dialog#intake-modal .formgrid,
dialog#task-dialog .formgrid {
  grid-template-columns: 1fr;
}

.modal-primary-card {
  background: rgba(16, 16, 16, 0.92);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  display: grid;
  align-items: start;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.85fr);
  grid-template-areas:
    "tabs tabs"
    "main secondary";
  gap: 32px 18px;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
}

dialog#task-dialog .modal-primary-card {
  grid-template-columns: minmax(0, 1.25fr) minmax(240px, 1fr);
  gap: 32px 24px;
  width: 100%;
}

/* Edit task keeps details + sidebar visible together */
dialog#task-dialog[data-active-tab="details"] .modal-primary-card {
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.42fr);
}

dialog#intake-modal .modal-primary-card {
  flex: none;
}

dialog#intake-modal .modal-primary-card.task-modal-card {
  height: auto;
  max-height: none;
}

dialog#intake-modal .task-modal-card {
  height: auto;
  max-height: none;
}

dialog#task-dialog .modal-columns {
  height: 100%;
  min-height: 0;
}

dialog#task-dialog .modal-primary-card {
  height: auto;
  min-height: 0;
}

/* Edit task can grow vertically when recurrence/work sections expand.
   Avoid clipping content inside the primary card. */
dialog#task-dialog .task-modal-card {
  height: auto;
  max-height: none;
  overflow: visible;
}

dialog#task-dialog .task-modal-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.edit-modal-tabs {
  grid-area: tabs;
}

.task-modal-main {
  grid-area: main;
  min-height: 0;
}

.task-modal-secondary {
  grid-area: secondary;
}

/* Edit task: keep wrapper columns clean so only inner cards show borders */
dialog#task-dialog .task-modal-main,
dialog#task-dialog .task-modal-column--secondary,
dialog#task-dialog .notes-bookmarks-column {
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  padding: 0;
}

dialog#task-dialog .task-modal-layout {
  gap: 20px;
}

/* Enforce grid placement inside intake/task modal cards */
dialog#intake-modal .task-modal-main,
dialog#task-dialog .task-modal-main {
  grid-column: 1;
  grid-row: 2;
}

dialog#intake-modal .task-modal-column--secondary,
dialog#task-dialog .task-modal-column--secondary {
  grid-column: 2;
  grid-row: 2;
}

dialog#intake-modal .edit-modal-tabs,
dialog#task-dialog .edit-modal-tabs {
  grid-column: 1 / -1;
  grid-row: 1;
}

.modal-primary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  grid-template-rows: auto auto;
  column-gap: 28px;
  row-gap: 0;
  align-items: stretch;
}

@media (max-width: 1090px) {
  .modal-primary-grid {
    grid-template-columns: repeat(2, minmax(240px, 1fr));
    grid-template-rows: auto auto;
  }
}

@media (max-width: 720px) {
  .modal-primary-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }
}

.modal-primary-grid .modal-primary-panel {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-primary-grid .modal-primary-panel:not(:last-child) {
  padding-bottom: 0;
  border-bottom: none;
}

.modal-primary-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-primary-notes {
  grid-column: 1 / span 2;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-links-column {
  background: rgba(18, 18, 18, 0.82);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  width: 100%;
  max-width: none;
  min-height: 0;
  grid-row: span 2;
  grid-column: 3 / 4;
}

.modal-links-column.span-two-rows {
  grid-row: 1 / span 2;
}

.modal-links-column .links-editor {
  margin-top: 0;
}

.modal-columns .modal-primary-panel label,
.modal-links-column label {
  font-weight: 600;
  font-size: 15px;
}

dialog#quick-intake-modal label,
dialog#task-dialog .modal-primary-panel label,
dialog#task-dialog .modal-links-column label,
dialog#intake-modal .modal-primary-panel label,
dialog#intake-modal .modal-links-column label,
dialog#intake-modal label,
dialog#task-dialog label,
dialog#company-creator-modal label,
dialog#intake-modal .edit-modal-tab-label,
dialog#task-dialog .edit-modal-tab-label {
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--text);
}

/* inputs */
.field input {
  width: 100%;
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text);
}

/* actions */
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

/* buttons */
.modal-card .btn {
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
}

.modal-card .btn.primary {
  background: var(--btn-primary-bg);
  border: none;
  color: var(--btn-primary-text);
}

dialog#intake-modal input,
dialog#intake-modal select,
dialog#intake-modal textarea,
dialog#task-dialog input,
dialog#task-dialog select,
dialog#task-dialog textarea,
dialog#company-creator-modal input,
dialog#company-creator-modal select,
dialog#company-creator-modal textarea {
  font-size: 13px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  line-height: 1.5;
}

dialog#intake-modal .intake-header h2,
dialog#task-dialog .intake-header h2 {
  font-size: 18px;
  margin-bottom: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

dialog#company-creator-modal .intake-header h2 {
  font-size: 18px;
  margin-bottom: 8px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

dialog#task-dialog .intake-header h2 {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

dialog#task-dialog .intake-header h2 .edit-task-client-name,
dialog#task-dialog .intake-header h2 .edit-task-id-label {
  margin-left: 4px;
}


dialog#task-dialog .intake-header h2 .edit-task-id-label {
  font-weight: 400;
  font-size: 14px;
  color: var(--muted);
}

dialog#task-dialog .intake-header h2 .edit-task-client-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}

dialog#task-dialog .intake-header h2 .edit-task-client-name::before {
  content: "— ";
  font-weight: 400;
  opacity: 0.7;
}

dialog#task-dialog .intake-header h2 .edit-task-client-name:empty::before {
  content: "";
}

.modal-card .btn.secondary {
  background: var(--btn-secondary-bg);
  border: 1px solid var(--btn-secondary-border);
  color: var(--btn-secondary-text);
}

.modal-card .btn.secondary:hover {
  background: var(--border-subtle);
}

.modal-links-column .links-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.modal-links-column .links-input-row input {
  flex: 1;
  min-width: 0;
}

dialog#task-dialog .edit-modal-due-date-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  align-items: start;
  width: 100%;
}

dialog#task-dialog .edit-modal-due-date-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

dialog#task-dialog .edit-modal-due-date-column .due-date-field {
  width: 100%;
}

dialog#task-dialog #edit-smart-scheduler-row {
  width: 100%;
}

dialog#task-dialog .edit-modal-sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

dialog#task-dialog .edit-modal-sidebar-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

dialog#task-dialog .task-modal-secondary .task-modal-section {
  flex: 0 0 auto;
}

@media (max-width: 1100px) {
  dialog#task-dialog .modal-primary-card {
    grid-template-columns: 1fr;
  }
  dialog#task-dialog .task-modal-column--secondary[hidden] {
    display: none;
  }
}

.modal-links-column .links-input-row .btn {
  flex: 0 0 auto;
}

.modal-links-column .links-list {
  gap: 10px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

dialog#task-dialog .modal-links-column .links-list {
  gap: 6px;
}

dialog#task-dialog .modal-links-column .links-list .link-row {
  background: transparent;
  border: none;
  padding: 4px 0;
  align-items: flex-start;
}

dialog#task-dialog .modal-links-column .links-list .link-row + .link-row {
  border-top: 1px solid var(--border-subtle);
  padding-top: 8px;
}

dialog#task-dialog .modal-links-column .links-list .link-actions {
  align-self: flex-start;
}

.modal-links-column .links-pagination,
.links-editor .links-pagination {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.links-pagination button {
  flex: 1;
}

.links-pagination-container {
  width: 100%;
}

.modal-columns .priority-field {
  width: 100%;
}

@media (max-width: 720px) {
  .modal-columns {
    grid-template-columns: 1fr;
  }

  .modal-links-column {
    padding: 12px;
  }
}


.edit-modal-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.edit-modal-tab {
  appearance: none;
  border-radius: var(--radius-sm, 10px);
  border: 1px solid var(--border-emphasis);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  padding: 8px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 120px;
  text-align: center;
}

.edit-modal-tab.active {
  border-color: rgba(167, 139, 250, 0.8);
  background: rgba(167, 139, 250, 0.18);
  color: #ffffff;
}

.edit-modal-tab:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.edit-modal-tab-label {
  white-space: nowrap;
  line-height: 1.1;
}

.edit-modal-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 22px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  border: 1px solid transparent;
  background: var(--border-subtle);
  color: var(--text-dim);
}

.edit-modal-tab-count:empty {
  display: none;
}

.edit-modal-tab-count.has-value {
  border-color: rgba(255, 255, 255, 0.2);
}

.edit-modal-tab.active .edit-modal-tab-count.has-value {
  background: rgba(167, 139, 250, 0.25);
  border-color: rgba(167, 139, 250, 0.6);
  color: #ffffff;
}

.edit-modal-tab-panels {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.edit-modal-tab-panel {
  display: none;
  flex-direction: column;
  gap: 18px;
}

.edit-modal-tab-panel.active {
  display: flex;
}

dialog.modal[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

body.dialog-open,
body:has(dialog[open]) {
  overflow: hidden;
}

/* Normalize font for date + number inputs */
input[type="date"],
input[type="number"] {
  font-family: inherit;
  font-size: 14px;
  color: var(--text); /* match your light text */
}

input[type="datetime-local"] {
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
}

#edit-schedule-start,
#edit-schedule-start::placeholder,
#edit-schedule-start::-webkit-datetime-edit,
#edit-schedule-start::-webkit-datetime-edit-fields-wrapper,
#edit-schedule-start::-webkit-datetime-edit-text,
#edit-schedule-start::-webkit-datetime-edit-month-field,
#edit-schedule-start::-webkit-datetime-edit-day-field,
#edit-schedule-start::-webkit-datetime-edit-year-field,
#edit-schedule-start::-webkit-datetime-edit-hour-field,
#edit-schedule-start::-webkit-datetime-edit-minute-field,
#edit-schedule-start::-webkit-datetime-edit-ampm-field {
  font-family: inherit;
}

input[type="date"] {
  font-weight: 500;
  letter-spacing: 0.2px;
}

.modal-card .form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

#time-edit-form .field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

#time-edit-form .field label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

#time-edit-form .form-grid {
  align-items: flex-start;
}

.reporting-table {
  border-collapse: collapse;
  width: 100%;
}

.reporting-table tr.reporting-summary {
  border-bottom: 1px solid var(--border-strong);
}

.reporting-table tr.reporting-summary td {
  border-bottom: none; /* important */
  vertical-align: middle;
}

.reporting-table tr.reporting-summary td {
  vertical-align: middle;
}

.reporting-table tr.reporting-summary {
  height: 64px;
}

.reporting-table tr.reporting-summary {
  min-height: 56px;
}

.reporting-detail-row {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  align-items: center;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-secondary);
}

.reporting-detail-row .date {
  opacity: 0.8;
}

.reporting-detail-row .time {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-align: center;
  font-weight: 500;
}
.reporting-detail-row .time-value {
  display: inline-block;
}

.reporting-detail-row .actions {
  display: flex;
  gap: 8px;
}

.reporting-detail-row .iconbtn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.reporting-detail-row .iconbtn:hover {
  background: var(--border-subtle);
}

.reporting-detail-list {
  padding: 4px 0;
}

.iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.iconbtn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
}

.iconbtn:hover {
  background: var(--border-subtle);
}

.client .client-body {
  display: none;
}

.client.expanded .client-body {
  display: block;
}

.client-body {
  display: block !important;
  max-height: none !important;
  overflow: visible !important;
}

/* --------------------
   Modal: Edit Task
-------------------- */



/* Center dialog */
dialog[open] {
  margin: auto;
}

.client-pill {
  margin-left: 8px;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: var(--border-subtle);
  opacity: 0.7;
}

#completed-board .task {
  margin-bottom: 10px;
}

.reporting-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.reporting-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.range-buttons {
  display: flex;
  gap: 8px;
}

.range-buttons .btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.2);
}

.reporting-summary {
  margin: 6px 0 14px;
  font-size: 15px;
  color: var(--muted-text, var(--muted));
}

.reporting-summary strong {
  color: #fff;
  font-weight: 600;
}

.percent-cell {
  text-align: right;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}

/* ----------------------------
   Clients View Layout
----------------------------- */

#view-reporting .panel {
  width: 100%;
}
#view-companies .panel.clients-layout,
#view-settings .panel.clients-layout {
  gap: 18px;
}
.client-overview {
  margin: 16px 0 24px;
}

.client-stats {
  display: flex;
  gap: 24px;
  font-size: 14px;
  opacity: 0.85;
}





.note-editor {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#client-note-title,
#client-note-body {
  width: 100%;
}

#save-client-note {
  align-self: flex-start;
}

#client-notes-list .muted {
  padding: 12px;
  border: 1px dashed var(--border-emphasis);
  border-radius: var(--radius-sm);
  text-align: center;
}

.brand .title {
  font-size: 18px;
  font-weight: 600;
}

.brand .subtitle {
  display: none; /* optional but recommended */
}

.timer-right select,
.timer-right button {
  height: 34px;
  font-size: 13px;
}

.brand .subtitle {
  font-size: 11px;
  opacity: 0.6;
}

.tab[data-view="clients"].active {
  background: rgba(148, 120, 245, 0.15);
}

.tab[data-view="sales"].active {
  background: rgba(148, 120, 245, 0.15);
}

/* ----------------------------
   Client Task Status Tabs
----------------------------- */

.client-task-tabs {
  display: flex;
  gap: 8px;
  margin: 8px 0 12px;
}

.client-task-tabs .btn {
  position: relative;
  padding: 6px 12px;
  font-size: 13px;
  border-radius: var(--radius-sm, 10px);
  background: var(--surface-subtle);
  border: 1px solid var(--border-strong);
  color: var(--text-dim);
}

/* Active tab */
.client-task-tabs .btn.active {
  background: rgba(167, 139, 250, 0.18);
  border-color: rgba(167, 139, 250, 0.65);
  color: #fff;
}

/* Tabs WITH items (count > 0) */
.client-task-tabs .btn.has-items:not(.active) {
  border-color: rgba(167, 139, 250, 0.35);
  color: var(--text);
}

/* Subtle hover */
.client-task-tabs .btn:hover {
  background: var(--border2);
}

/* ----------------------------
   Client Header Tightening
----------------------------- */

#view-clients h2 {
  margin-bottom: 8px;
}

#view-clients .formgrid {
  margin-bottom: 8px;
}

#view-clients select {
  max-width: 420px;
}

#view-sales select {
  max-width: 420px;
}
.client-overview {
  margin: 6px 0 12px;
}

.client-overview .client-stats,
.client-overview {
  font-size: 13px;
  opacity: 0.85;
}

.client-overview strong {
  font-weight: 500;
}



/* ----------------------------
   Notes Typography Fix
----------------------------- */

#client-note-body,
#client-note-title,
.note-editor-body {
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
}

#client-note-body {
  font-size: 15px;
}



#save-client-note {
  margin-top: 4px;
}

/* ----------------------------
   Clients – Notes spacing fix
----------------------------- */





/* Editor should not push list down */
.note-editor {
  margin-bottom: 12px; /* reduce from default */
}

/* Notes list should sit tight under editor */
#client-notes-list {
  margin-top: 0;
}

/* Each note spacing */
#view-clients .panel {
  display: flex;
  flex-direction: column;
  gap: 0;
}

#view-sales .panel {
  display: flex;
  flex-direction: column;
  gap: 0;
}



/* ----------------------------
   Clients – Notes layout fix
----------------------------- */




.topbar > *:first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.topbar button {
  flex: 0 0 auto;
}

.client-header {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 100%;
  padding: 12px 16px 8px 16px;
}

.client-header > *:first-child {
  flex: 1 1 auto;
  min-width: 0; /* CRITICAL for flex text overflow */
}

.client-header select {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: visible;
}

.client-title {
  cursor: default;
}

.client-title:hover {
  text-decoration: underline;
}

/* =========================
   TOPBAR – CANONICAL RULE
   ========================= */

.topbar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 12px;

  min-height: 64px;
  padding: 12px 20px;

  position: sticky;
  top: 0;
  z-index: 1000;

  background: #000000;

  backdrop-filter: blur(10px);
}

/* Left side of topbar */
.topbar > div:first-child {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  flex-wrap: wrap;

  flex: 1 1 auto;
  min-width: 0;
}

/* Topbar client select – NO CLIPPING */
#timer-client-select,
#timer-engagement-select {
  height: 36px;
  line-height: 36px;

  padding: 0 36px 0 14px;
  min-width: 200px;
  max-width: 280px;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar .btn {
  height: 36px;
  line-height: 36px;
  padding-top: 0;
  padding-bottom: 0;
}

.note-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.note-actions .iconbtn {
  font-size: 12px;
  padding: 4px 6px;
}

.note-title {
  font-weight: 600;
  font-size: 13.5px;
}

.note-body {
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-secondary);
  white-space: pre-wrap;
    text-indent: 0;

}

.note-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  font-size: 10.5px;
    opacity: 0.6;
  color: var(--text-faint);
}

.note-actions {
  display: flex;
  gap: 6px;
}

.note-actions .iconbtn {
  opacity: 0.6;
}

.note-actions .iconbtn:hover {
  opacity: 1;
}

#note-modal .modal-card {
  display: flex;
  flex-direction: column;
  max-height: 85vh;
  padding: 24px;
  padding-bottom: 24px;
  gap: 16px;
}
#note-modal .note-editor {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: visible;
}

#note-modal .note-editor-body {
  flex: 1;
  min-height: 220px;
  max-height: 40vh;
  overflow-y: auto;
  padding-right: 4px;
  resize: vertical;
}

dialog#note-modal {
  width: min(900px, 95vw);
  max-width: 900px;
  border-radius: 16px;
  padding: 0;
  max-height: 80vh;
  overflow: hidden;
}

#note-modal .modal-card {
  width: 100%;
  max-width: none;
  gap: 20px;
  padding: 24px;
  max-height: 80vh;
  min-height: 0;
  overflow: hidden;
}

.note-modal-header,
.note-modal-footer {
  flex: 0 0 auto;
}

.note-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#note-modal .note-modal-body > label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 0;
  margin-bottom: 0;
}

#note-modal label {
  margin-bottom: 0;
}

#note-modal input,
#note-modal #client-note-body {
  font-size: 14px;
  line-height: 1.6;
}

.note-bookmark-fields {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
}

.note-bookmark-fields label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.note-bookmark-separator {
  font-size: 12px;
  color: var(--muted);
}

.note-bookmark-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 4px 8px;
  font-size: 12px;
  color: var(--accent);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  text-decoration: none;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.note-bookmark-link:hover {
  text-decoration: underline;
  border-color: var(--accent);
}
.note-bookmarks-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 0;
}
.note-bookmark-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 12px;
  color: var(--accent);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.note-bookmark-chip-remove {
  cursor: pointer;
  opacity: 0.6;
  flex-shrink: 0;
}
.note-bookmark-chip-remove:hover { opacity: 1; }



.today-section-header.priority {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;

  color: var(--text-dim);
  margin: 16px 0 10px;
}








#preview-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
}























#task-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

#task-preview {
  width: 720px;
  max-width: 90vw;
  min-height: 420px;
  max-height: 85vh;

  display: flex;
  flex-direction: column;
}

#preview-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1002;
  pointer-events: auto;
  cursor: pointer;
}

/* =========================
   Task preview modal (single source of truth)
   ========================= */

#task-preview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 18, 0.6);
  backdrop-filter: blur(4px);
  z-index: 10000;
}



#task-preview {
  position: relative;
  margin: 10vh auto 0;
  width: 520px;
  max-width: calc(100vw - 32px);
  background: #141414;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  padding: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

#preview-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  z-index: 1;
}

/* =========================
   Task preview modal (FINAL)
   ========================= */

#task-preview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 18, 0.65);
  backdrop-filter: blur(6px);
  z-index: 10000;
}

#task-preview-overlay.hidden {
  display: none;
}

#task-preview {
  position: relative;
  margin: 12vh auto 0;
  width: 520px;
  max-width: calc(100vw - 32px);

  background: linear-gradient(
    180deg,
    rgba(20, 20, 20, 0.98),
    rgba(14, 14, 14, 0.98)
  );

  border-radius: 16px;
  border: 1px solid var(--border-strong);

  padding: 24px;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.75),
    inset 0 1px 0 var(--surface-2);
}

#preview-close {
  position: absolute;
  top: 14px;
  right: 14px;

  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;

  padding: 6px;
  border-radius: 8px;
}

#preview-close:hover {
  color: #ffffff;
  background: var(--border-subtle);
}

/* Overlay must receive clicks */
.overlay {
  pointer-events: auto;
  z-index: 1000;
}

/* Modal must be above overlay */
.task-preview-modal {
  position: relative;
  z-index: 1001;
}

/* Close button must be clickable */
#preview-close {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 1002;
  pointer-events: auto;
  cursor: pointer;
}

/* Task preview modal container */
#task-preview {
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

/* Notes area should scroll, not expand */
#preview-notes {
  margin-top: 12px;
  padding-right: 6px;

  flex: 1;
  overflow-y: auto;

  max-height: 50vh;

  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.preview-links {
  margin-top: 14px;
}

.preview-links .links-list {
  margin-top: 8px;
}

#preview-notes {
  scrollbar-width: thin;
}

/* Consistent modal backdrop across app */
dialog::backdrop {
  background: rgba(5, 8, 15, 0.75);
  backdrop-filter: blur(10px);
}

#link-edit-dialog::backdrop {
  background: rgba(2, 3, 7, 0.9);
  backdrop-filter: blur(12px);
}

/* Modal-card padding now owns vertical spacing so actions stay margin-free. */
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 0;
  padding-top: 16px;
  padding-bottom: 0;
  flex: 0 0 auto;
}

.modal-actions .spacer {
  flex: 1;
}

/* Dense editor modals reuse the same compact footer spacing. */
#note-modal .modal-card {
  padding-bottom: 20px;
}

#note-modal .modal-actions {
  padding-top: 12px;
  padding-bottom: 0;
}

.stop-icon {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: currentColor;
  border-radius: 2px;
}

.intake-modal {
  min-height: 420px;
}

.intake-modal .notes-editor {
  min-height: 140px;
  max-height: 150px;
  height: 150px;
  overflow-y: auto;
}

.links-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.links-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
}

.links-input-row input {
  flex: 1;
}

.links-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

#intake-links-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 4px 0;
}

#intake-links-list .link-row {
  position: relative;
  flex-direction: column;
  align-items: flex-start;
  padding: 12px 14px;
  min-width: 180px;
  max-width: 240px;
  border-radius: var(--radius-md);
  background: linear-gradient(
    180deg,
    var(--surface-2),
    rgba(255, 255, 255, 0.01)
  );
  border: 1px solid var(--border-subtle);
  box-shadow:
    inset 0 1px 0 var(--surface-2),
    0 6px 16px rgba(0, 0, 0, 0.25);
  gap: 6px;
}

#intake-links-list .link-row .link-body {
  width: 100%;
}

#intake-links-list .link-row .link-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
}

#intake-links-list .link-row .link-remove {
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 0;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--border-subtle);
  color: inherit;
}

#intake-links-list .link-row .link-remove::after {
  content: "✕";
  font-size: 16px;
  line-height: 26px;
  color: inherit;
}

#intake-links-list .link-row .link-actions .iconbtn {
  background: transparent;
  border: none;
}

#intake-links-list .link-row.link-row--email-preview {
  min-width: 0;
  max-width: none;
  width: 100%;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}

#intake-links-list .link-row.link-row--email-preview .link-favicon {
  display: none;
}

#intake-links-list .link-row.link-row--email-preview .link-anchor {
  font-weight: 600;
  line-height: 1.25;
}

#intake-links-list .link-row.link-row--email-preview .link-actions {
  position: static;
  margin-left: auto;
  opacity: 1;
}

.links-editor .links-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.modal-links-column .links-list .muted {
  padding: 10px 0;
  font-style: italic;
  color: var(--text-dim);
}

.bookmark-picker-controls {
  display: flex;
  justify-content: flex-start;
}


.bookmark-picker-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  padding: 4px 0;
}

.bookmark-picker-row {
  width: 100%;
  gap: 10px;
}

.bookmark-picker-row input[type="checkbox"] {
  margin-top: 4px;
}

.bookmark-picker-card {
  width: 520px;
  max-width: 90vw;
}

#bookmark-picker-modal .muted {
  font-size: 0.9em;
}

.link-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  width: 100%;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.link-favicon {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: var(--border-subtle);
  flex-shrink: 0;
  align-self: center;
  object-fit: cover;
}

.link-anchor {
  color: var(--text);
  text-decoration: none;
  word-break: break-word;
  text-transform: none;
  flex: 1;
  min-width: 0;
  line-height: 1.3;
  font-size: 14px;
}

.link-anchor:hover {
  text-decoration: underline;
}

.link-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
  align-self: center;
  opacity: 0.35;
  transition: opacity 0.2s ease;
}

.link-row:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.035);
}

.link-row:hover .link-actions,
.link-row:focus-within .link-actions {
  opacity: 1;
}

.link-actions .iconbtn {
  width: auto;
  height: auto;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.link-actions .iconbtn:hover,
.link-actions .iconbtn:focus-visible {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.link-remove {
  flex-shrink: 0;
}

.client-bookmarks-row .link-row {
  gap: 12px;
}

.client-bookmarks-row .bookmark-actions {
  gap: 8px;
}

.client-bookmarks-row .bookmark-actions .iconbtn {
  padding: 6px 12px;
}

.link-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.link-meta {
  font-size: 12px;
  color: var(--muted);
}

.client-bookmarks-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.bookmark-layout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.bookmark-folders {
  min-width: 260px;
  max-width: 320px;
  flex: 0 0 280px;
  border: 1px solid var(--border2);
  background: var(--panel);
  border-radius: var(--radius-md);
  padding: 12px;
}

.bookmark-folders-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.bookmark-folders-header h4 {
  margin: 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.bookmark-folders-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

.bookmark-folder-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bookmark-folder-trigger {
  flex: 1;
  text-align: left;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
}

.bookmark-folder-trigger:hover,
.bookmark-folder-trigger:focus-visible {
  border-color: var(--border2);
  background: var(--surface-2);
}

.bookmark-folder-row.active .bookmark-folder-trigger {
  border-color: rgba(124, 152, 255, 0.55);
  background: rgba(124, 152, 255, 0.12);
}

.bookmark-folder-row.bookmark-folder-drop-target .bookmark-folder-trigger {
  border-color: rgba(124, 152, 255, 0.8);
  background: rgba(124, 152, 255, 0.18);
}

.bookmark-folder-actions {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  align-items: center;
}

.bookmark-folder-action {
  padding: 4px 6px;
  font-size: 11px;
  white-space: nowrap;
}

.bookmark-row-draggable {
  cursor: grab;
}

.bookmark-row-dragging {
  opacity: 0.6;
}

.bookmark-content {
  flex: 1 1 auto;
  min-width: 0;
}

.client-bookmarks-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.bookmark-search {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border2);
  background: var(--input);
  color: var(--text);
  min-width: 220px;
  flex: 1 1 240px;
}

.bookmark-sort {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.bookmark-sort label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.bookmark-sort-select {
  border-radius: 8px;
  border: 1px solid var(--border2);
  background: var(--input);
  color: var(--text);
  padding: 6px 10px;
  font-size: 13px;
  min-width: 140px;
}

.bookmark-form {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 10px;
  margin-bottom: 12px;
  align-items: center;
}

.bookmark-folder-select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border2);
  background: var(--input);
  color: var(--text);
  font-size: 13px;
}

.bookmark-form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

@media (max-width: 900px) {
  .bookmark-layout {
    flex-direction: column;
  }

  .bookmark-folders {
    width: 100%;
    max-width: none;
  }

  .bookmark-form {
    grid-template-columns: 1fr;
  }

  .bookmark-form-actions {
    justify-content: flex-start;
  }
}

.edit-modal-tabs {
  margin-bottom: 0;
}

dialog#task-dialog .edit-modal-tabs {
  margin-bottom: 0;
  gap: 6px;
  justify-content: flex-end;
}

dialog#task-dialog .edit-modal-tab {
  border-color: var(--border-strong);
  background: var(--surface-subtle);
  color: var(--text-dim);
  padding: 5px 12px;
  min-width: 0;
  font-size: 0.78rem;
  font-weight: 600;
}

dialog#task-dialog .edit-modal-tab.active {
  border-color: rgba(167, 139, 250, 0.7);
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

dialog#task-dialog .edit-modal-tab:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.timer-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* =========================
   Priority flag (checkbox)
========================= */

.priority-flag {
  display: flex;
  align-items: center;
  gap: 10px;

  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);

  margin-top: 6px;
}

.priority-flag input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;

  width: 18px;
  height: 18px;
  border-radius: 6px;

  border: 1px solid rgba(255, 255, 255, 0.25);
  background: var(--surface-2);

  cursor: pointer;
  position: relative;
}

.priority-flag input[type="checkbox"]:checked {
  background: rgba(167, 139, 250, 0.25);
  border-color: rgba(167, 139, 250, 0.75);
}

.priority-flag input[type="checkbox"]:checked::after {
  content: "✓";
  position: absolute;
  inset: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.priority-flag span {
  cursor: pointer;
}

/* ----------------------------
   Log Time Modal – Align with system
----------------------------- */

.log-time-modal {
  width: 720px;
  max-width: 92vw;
  min-height: 360px;

  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.log-time-modal .formgrid {
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.log-time-modal textarea {
  min-height: 120px;
  resize: vertical;
}

.log-time-modal .formgrid label {
  min-width: 0;
}

.log-time-modal select,
.log-time-modal input,
.log-time-modal textarea {
  width: 100%;
  min-width: 0;
}

.log-time-modal .modal-actions {
  margin-top: 20px;
}

@media (max-width: 720px) {
  .log-time-modal .formgrid {
    grid-template-columns: 1fr;
  }
}

/* ----------------------------
   Canonical modal layout (log-time structure)
----------------------------- */

.standard-modal-card {
  min-height: 360px;
  display: flex;
  flex-direction: column;
}

.standard-modal-card .formgrid {
  gap: 16px;
}

.standard-modal-card .modal-actions {
  margin-top: 20px;
}

.standard-modal-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 12px;
}

/* Canonical standard modal footer rhythm */
.standard-modal-actions {
  display: flex;
  align-items: center;
  margin: 0;
  padding-top: 16px;
}

.standard-modal-actions .btn {
  min-height: 32px;
}

.modal-actions-top {
  margin-top: 20px;
}

.modal-description-tight {
  margin-bottom: 8px;
}

.modal-description-spaced {
  margin-bottom: 14px;
}

.modal-event-title {
  margin: 0 0 16px;
}

.modal-description-compact {
  margin-bottom: 6px;
}

dialog#task-dialog .modal-card.standard-modal-card {
  width: 100%;
  max-width: none;
  flex: 0 0 auto;
}

dialog#intake-modal .modal-card.standard-modal-card {
  width: 100%;
  max-width: none;
  flex: 0 0 auto;
}

dialog#quick-intake-modal .modal-card.standard-modal-card {
  width: min(460px, 96vw);
  max-width: 460px;
  padding: 28px;
}

.quick-intake-grid {
  gap: 16px;
}
.due-recurrence-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}
.due-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.repeat-column {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  align-self: center;
}
.repeat-column .recurrence-toggle-field {
  width: 100%;
  justify-content: center;
  gap: 8px;
  align-items: center;
}
.repeat-column .recurrence-toggle-field #quick-intake-recurring-toggle {
  margin: 0;
}
.repeat-column .recurrence-toggle-field label[for="quick-intake-recurring-toggle"] {
  text-align: left;
  display: inline;
}
.frequency-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.frequency-row .recurrence-frequency-field {
  grid-column: 1 / 2;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.quick-intake-start-end-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.quick-intake-grid .due-date-field {
  grid-column: 1 / 2;
}

.quick-intake-note {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
}

.quick-intake-bookmark {
  margin-top: 16px;
}

.calendar-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.calendar-list li {
  padding: 8px 0;
  display: flex;
  gap: 12px;
  border-bottom: 1px solid var(--border2);
}

.calendar-event {
  align-items: flex-start;
}

.calendar-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.calendar-client-label {
  font-size: 12px;
  color: var(--muted);
}

.calendar-client-link {
  margin-left: auto;
  align-self: center;
}

.calendar-event-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
  width: 100%;
  justify-content: flex-end;
  margin-left: 0;
}

.calendar-event-actions .btn,
.calendar-event-actions .calendar-join-btn {
  height: 28px;
  min-width: 60px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  width: auto;
  flex: 0 0 auto;
}

.calendar-event-actions .btn.calendar-link-client-btn {
  border-color: rgba(167, 139, 250, 0.45);
  background: rgba(167, 139, 250, 0.14);
  color: #e8d8ff;
}

.calendar-event-actions .btn.calendar-link-client-btn:hover {
  border-color: rgba(167, 139, 250, 0.7);
  background: rgba(167, 139, 250, 0.24);
}

.calendar-event-actions .btn.calendar-link-client-btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.calendar-join-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.calendar-event-actions .calendar-client-link {
  margin-left: 0;
}

.calendar-time {
  width: 90px;
  font-size: 13px;
  opacity: 0.8;
  text-align: right;
}

.calendar-title {
  font-weight: 500;
}

.calendar-allday {
  font-size: 13px;
  opacity: 0.7;
  margin-bottom: 8px;
}

.calendar-allday span {
  margin-right: 10px;
}

.calendar-auth-warning {
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 107, 107, 0.5);
  background: rgba(255, 107, 107, 0.1);
  color: #ffd4d4;
  font-size: 13px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.pill {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  background: var(--border-subtle);
}

.muted {
  opacity: 0.7;
}



.calendar-event.active {
  background: linear-gradient(
    90deg,
    rgba(120, 170, 255, 0.18),
    rgba(120, 170, 255, 0.08)
  );
  border-left: 3px solid var(--accent);
}

.calendar-event.active .calendar-title {
  font-weight: 600;
}

.calendar-event.active .calendar-time {
  opacity: 1;
}

.calendar-event.active::before {
  content: "●";
  color: var(--accent);
  margin-right: 6px;
  font-size: 10px;
}

.calendar-event.active {
  border-left: 3px solid var(--accent);
  background: rgba(255, 130, 95, 0.08);
}

/* =========================
   Calendar – Today / Tomorrow
========================= */

/* Calendar list base */
.calendar-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.calendar-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border2);
}

/* Time column */
.calendar-time {
  width: 90px;
  text-align: right;
  font-size: 13px;
  opacity: 0.75;
  font-variant-numeric: tabular-nums;
}

/* Title */
.calendar-title {
  font-size: 14px;
  font-weight: 500;
}

/* All-day section */
.calendar-allday {
  font-size: 13px;
  opacity: 0.7;
  margin-bottom: 8px;
}

/* Active (in-progress) meeting */
.calendar-event.active {
  padding-left: 12px;
  padding-right: 12px;
  margin-left: -12px;
  margin-right: -12px;
  border-left: 3px solid var(--accent);
  background: rgba(167, 139, 250, 0.12);
}

.calendar-event.active .calendar-title {
  font-weight: 600;
}

.calendar-event.active .calendar-time {
  opacity: 1;
}

/* Collapse support */
#calendar-events,
#calendar-allday {
  transition: opacity 120ms ease;
}

.hidden {
  display: none !important;
}

.client-followups-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.client-followup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--surface-subtle);
  gap: 12px;
}

.client-followup-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.client-followup-name {
  font-weight: 600;
  color: #fff;
}

.client-followup-meta,
.client-followup-submeta {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.2;
}

.client-followup-submeta {
  font-size: 0.75rem;
}

.client-followup-dismiss {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.client-followup-dismiss input[type="checkbox"] {
  accent-color: #eab308;
}

.client-followup-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.client-followup-snooze {
  font-size: 0.75rem;
  padding: 6px 12px;
}

#calendar-card[data-day="tomorrow"] .calendar-event {
  opacity: 0.9;
}

/* =========================
   Today layout (3-column grid)
========================= */

.today-overview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.05),
    var(--bg-subtle)
  );
}

.today-overview-title {
  display: flex;
  align-items: center;
  align-self: stretch;
  margin: 0;
  line-height: 1.2;
  transform: translateY(1px);
  font-size: 0.98rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--text);
}

.today-overview-metrics {
  display: flex;
  align-items: stretch;
  gap: 10px;
  flex-wrap: wrap;
}

.today-overview-metric {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: rgba(8, 12, 18, 0.55);
}

.today-overview-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.today-overview-value {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.notifications-btn {
  position: relative;
  flex-shrink: 0;
}

.notifications-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
}

.notifications-drawer {
  position: fixed;
  top: 48px;
  right: 0;
  width: 320px;
  height: calc(100vh - 48px);
  background: var(--surface-card, #141414);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  z-index: 1001;
  transform: translateX(100%);
  transition: transform 0.22s ease;
}

.notifications-drawer.open {
  transform: translateX(0);
}

.notifications-backdrop {
  position: fixed;
  inset: 64px 0 0 0;
  z-index: 1000;
  background: transparent;
}

.notifications-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.9rem;
  font-weight: 600;
}

.notifications-drawer-header h3 {
  margin: 0;
  font-size: 0.9rem;
}

.notifications-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notif-item {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.notif-item-tag {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.notif-item-tag.overdue {
  color: rgba(239, 68, 68, 0.9);
}

.notif-item-tag.due-today {
  color: rgba(250, 189, 47, 0.9);
}

.notif-item-tag.fathom {
  color: rgba(129, 188, 255, 0.9);
}

.notif-item-tag.follow-up {
  color: rgba(167, 139, 250, 0.9);
}

.notif-item-tag.disconnected-account {
  color: rgba(252, 165, 165, 0.9);
}

.notif-item-client {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.notif-item-title {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.notif-item-title:hover {
  text-decoration: underline;
}

.notif-item-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}


.notifications-empty {
  text-align: center;
  padding: 32px 16px;
  opacity: 0.45;
  font-size: 0.88rem;
}

.today-overview-fathom-alert {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 166, 77, 0.45);
  background: linear-gradient(
    180deg,
    rgba(255, 166, 77, 0.16),
    rgba(255, 166, 77, 0.08)
  );
  color: rgba(255, 235, 210, 0.95);
  font-size: 0.88rem;
  font-weight: 600;
}

.today-overview-fathom-alert .btn {
  flex-shrink: 0;
}

.today-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(420px, 1.5fr) minmax(280px, 1fr);
  grid-template-rows: auto;
  grid-template-areas: "calendar tasks goals";
  column-gap: 24px;
  row-gap: 16px;
  align-items: start;
}

.today-goals-column {
  grid-area: goals;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  align-items: stretch;
}

#goals-card {
  padding-bottom: 32px;
}

.today-goals-column .card {
  width: 100%;
}

.goals-empty-state {
  display: none;
  font-size: 0.9rem;
  line-height: 1.4;
  padding: 0 2px;
}

.goals-card.collapsed .goals-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  padding-bottom: 12px;
  gap: 8px;
}

.goals-empty-message {
  margin: 0;
  text-align: center;
}

.goals-empty-trigger {
  min-width: 160px;
}

.goals-card.collapsed #goals-form,
.goals-card.collapsed .goals-list,
.goals-card.collapsed #goals-pagination {
  display: none;
}

.goals-card.collapsed {
  align-self: start;
  max-height: 130px;
  overflow: hidden;
  padding-bottom: 48px;
}

.goals-card.collapsed .card-header {
  margin-bottom: 0;
}

.goals-card.collapsed.goals-form-open {
  max-height: none;
  overflow: visible;
}

.goals-card.collapsed.goals-form-open #goals-form {
  display: block;
}

.goals-card.collapsed.goals-form-open .goals-empty-state {
  display: none;
}

#calendar-card,
.today-tasks {
  min-width: 0; /* prevents overflow issues */
}

.today-left-column {
  grid-area: calendar;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.today-left-column > * {
  width: 100%;
}

.today-left-column.has-followups .client-followups-card {
  order: -1;
}

.today-tasks.card {
  grid-area: tasks;
  align-self: stretch;
}

@media (max-width: 1360px) {
  .today-layout {
    grid-template-columns: minmax(300px, 1fr) minmax(460px, 1.3fr);
    grid-template-areas:
      "calendar tasks"
      "goals tasks";
  }
}

@media (max-width: 1220px) {
  .today-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "goals"
      "calendar"
      "tasks";
  }
  .today-tasks.card {
    grid-column: 1;
    grid-row: auto;
  }
}

@media (max-width: 1100px) {
  .today-overview {
    align-items: flex-start;
  }
  .today-overview-metrics {
    width: 100%;
  }
  .today-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "goals"
      "calendar"
      "tasks";
  }
  .today-tasks.card {
    grid-column: 1;
    grid-row: auto;
  }
}

@media (max-width: 1360px) {
  .topbar-main {
    align-items: flex-start;
  }

  .tabs {
    flex: 1 1 100%;
  }

  .status-summary {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .today-overview {
    padding: 10px 12px;
  }
  .today-overview-title {
    width: 100%;
  }
  .today-overview-metrics {
    flex-direction: column;
    width: 100%;
  }
  .today-overview-metric {
    justify-content: space-between;
    width: 100%;
  }
  .today-overview-fathom-alert {
    flex-direction: column;
    align-items: flex-start;
  }
}

.today-card {
  background: linear-gradient(
    180deg,
    var(--surface-2),
    rgba(255, 255, 255, 0.015)
  );
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow:
    inset 0 1px 0 var(--surface-2),
    0 10px 30px rgba(0, 0, 0, 0.35);
}

.retainer-card-body {
  margin-top: 12px;
}

.retainer-watch-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.retainer-row {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border2);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.retainer-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.retainer-row-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.retainer-name {
  font-weight: 600;
  font-size: 14px;
}

.retainer-name.today-client-link {
  cursor: pointer;
  text-decoration: underline;
}

.retainer-usage {
  color: var(--muted);
  font-size: 13px;
}

.retainer-row-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}

.retainer-row-stats .retainer-stat {
  font-weight: 500;
}

.retainer-bar {
  height: 10px;
  border-radius: var(--radius-pill);
  background: var(--border-subtle);
  overflow: hidden;
}

.retainer-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: var(--radius-pill);
  transition: width 0.2s ease;
}

.retainer-bar-fill.good {
  background: rgba(130, 220, 170, 0.8);
}

.retainer-bar-fill.warn {
  background: rgba(245, 196, 81, 0.85);
}

.retainer-bar-fill.risk {
  background: rgba(255, 120, 120, 0.85);
}

.retainer-bar-fill.neutral {
  background: rgba(255, 255, 255, 0.2);
}

.retainer-row-foot {
  font-size: 12px;
  color: var(--text-faint);
}

/* ── Today band layout ── */
.today-band-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.today-band {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.today-band-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.today-band-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.today-band-now .today-band-label {
  color: var(--accent);
}

.today-band-today .today-band-label {
  color: var(--text-dim);
}

.today-band-later .today-band-label {
  color: var(--text-faint);
}

.today-band-count {
  font-size: 11px;
  color: var(--muted);
  background: var(--surface-subtle);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 1px 8px;
  font-variant-numeric: tabular-nums;
}

.today-band-list {
  display: grid;
  gap: 10px;
}

.today-band-later-toggle {
  margin-left: auto;
  font-size: 12px;
  padding: 3px 12px;
}

.today-band-later-list[hidden] {
  display: none;
}

/* ── Band pagination ── */
.today-band-pagination {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 4px;
}

.today-band-page-info {
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-width: 32px;
  text-align: center;
}

.today-band-page-btn {
  font-size: 12px;
  padding: 3px 12px;
}

/* ── Spotlight card ── */
.today-spotlight-card {
  cursor: pointer;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 14px;
  border-radius: 16px;
  padding: 20px 22px;
  border: 1px solid var(--border-strong);
  background: rgba(18, 18, 18, 0.78);
  box-shadow: none;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
  position: relative;
  overflow: hidden;
}

.today-spotlight-card:hover {
  background: rgba(24, 24, 24, 0.9);
  border-color: rgba(185, 165, 240, 0.5);
  transform: translateY(-1px);
}


.today-spotlight-card.timer-active {
  border-color: rgba(56, 210, 180, 0.5);
  box-shadow: 0 0 0 1px rgba(56, 210, 180, 0.1), 0 2px 12px rgba(0, 0, 0, 0.25);
}

.today-spotlight-card.due-overdue {
  border-color: rgba(255, 90, 90, 0.4);
}

.today-spotlight-card.due-soon {
  border-color: rgba(255, 200, 80, 0.35);
}

/* ── Legacy filter/tab styles (kept for safety) ── */
.today-task-filter-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}
.today-task-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: var(--border2);
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease;
}
.today-task-filter-toggle:hover {
  border-color: rgba(255, 255, 255, 0.45);
  transform: translateY(-1px);
}
.today-task-filter-toggle-icon {
  display: inline-block;
  transition: transform 0.2s ease;
}
.today-task-filter-toggle[aria-expanded="true"]
  .today-task-filter-toggle-icon {
  transform: rotate(180deg);
}
.today-task-filter-bar {
  display: grid;
  gap: 12px;
  margin: 0 0 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  max-height: 600px;
  opacity: 1;
  transition: max-height 0.3s ease, opacity 0.2s ease;
  overflow: hidden;
}
.today-task-filter-bar.collapsed {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}
.today-task-filter-bar.hidden {
  display: none;
}
.today-task-scope {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.today-task-scope-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.today-task-scope-list {
  display: grid;
  gap: 10px;
}
.today-filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.today-filter-group-title {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.today-filter-group-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.today-filter-pill {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.today-filter-pill.active {
  background: var(--border-subtle);
  border-color: rgba(255, 255, 255, 0.35);
}
.today-filter-pill:hover {
  border-color: rgba(255, 255, 255, 0.35);
}

.today-task-tabs {
  display: flex;
  gap: 10px;
  margin: 16px 0;
}

.today-task-tab {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.today-task-tab.active {
  background: rgba(167, 139, 250, 0.15);
  border-color: var(--accent);
  color: var(--accent);
}

.today-task-tab:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.05);
}

.today-task-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
}

.today-task-page-btn {
  min-width: 72px;
}

.today-task-page-info {
  font-size: 13px;
  color: var(--muted);
  min-width: 90px;
  text-align: center;
}

.tab-count {
  margin-left: 6px;
  opacity: 0.75;
}

.today-task-panels {
  min-height: 120px;
}

.today-task-panel {
  display: none;
}

.today-task-panel.active {
  display: block;
}

.today-task-meeting-group {
  margin-top: 18px;
}

.today-task-meeting-group:first-child {
  margin-top: 0;
}

.today-task-meeting-group-header {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.today-task-meeting-group-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.today-task-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.today-task-group h3 {
  margin: 0;
}

.fathom-unassigned-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}

.fathom-unassigned-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}

.fathom-meeting-card {
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--bg-subtle);
  box-shadow: inset 0 1px 0 var(--surface-2);
}

.fathom-meeting-header {
  width: 100%;
  border: none;
  background: none;
  padding: 0;
  color: var(--text);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  cursor: pointer;
}

.fathom-meeting-header-content {
  flex: 1;
  text-align: left;
}

.fathom-meeting-title {
  font-weight: 600;
  font-size: 15px;
}

.fathom-meeting-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.fathom-meeting-link {
  color: var(--accent);
}

.fathom-meeting-toggle-indicator {
  font-size: 18px;
  line-height: 1;
  margin-left: 8px;
}

.fathom-meeting-body {
  margin-top: 12px;
}

.fathom-meeting-body.hidden {
  display: none;
}

.fathom-meeting-summary {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.fathom-meeting-controls {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.fathom-action-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fathom-action-item {
  border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  background: var(--bg-subtle);
}

.fathom-action-title {
  font-weight: 600;
  font-size: 14px;
}

.fathom-action-description {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

.fathom-action-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.fathom-action-links a {
  font-size: 12px;
  color: var(--accent);
}

.fathom-action-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}

.fathom-meeting-bookmark-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--muted);
}

.fathom-meeting-bookmark-label {
  flex: 1;
  min-width: 200px;
}

.fathom-bookmark-success {
  background: rgba(130, 220, 170, 0.9);
  border-color: rgba(130, 220, 170, 0.9);
  color: #08101a;
}

.fathom-action-client-select {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text);
  padding: 6px 10px;
  font-size: 13px;
  min-width: 170px;
}

.fathom-action-client-select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.fathom-meeting-ignore {
  margin-left: auto;
}

.today-task-group .today-task-row {
  margin-bottom: 10px;
}

.today-task-row {
  cursor: pointer;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 6px;
  border-radius: 10px;
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  background: rgba(18, 18, 18, 0.78);
  box-shadow: none;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
  position: relative;
  overflow: hidden;
}

.today-task-row:hover {
  background: rgba(24, 24, 24, 0.9);
  border-color: rgba(185, 165, 240, 0.5);
  transform: translateY(-1px);
  box-shadow: none;
}

/* Today view — task row variants */
.today-task-row.recent-task {
  opacity: 0.85;
}
.today-task-row.timer-active {
  border-color: rgba(95, 214, 171, 0.5);
}
.today-task-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.today-complete-btn {
  border: 1px solid var(--border-active);
  background: var(--surface-subtle);
  color: var(--text-dim);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.today-complete-btn:hover {
  border-color: rgba(198, 210, 238, 0.55);
  background: rgba(149, 170, 214, 0.16);
}
.today-complete-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.today-task-row.needs-attention .today-task-title,
.today-task-row.needs-attention .age {
  font-weight: 600;
}
.today-task-meta .today-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.05);
}
.today-status-pill.status-not-started {
  color: #f89400;
  border-color: rgba(248, 148, 0, 0.35);
  background: rgba(248, 148, 0, 0.12);
}
.today-status-pill.status-in-progress {
  color: #24ba94;
  border-color: rgba(36, 186, 148, 0.35);
  background: rgba(36, 186, 148, 0.12);
}
.today-status-pill.status-on-hold {
  color: #9d5cdf;
  border-color: rgba(157, 92, 223, 0.35);
  background: rgba(157, 92, 223, 0.12);
}
.today-status-pill.status-completed {
  color: #4adba9;
  border-color: rgba(74, 219, 169, 0.35);
  background: rgba(74, 219, 169, 0.12);
}
.today-task-row.sales-task .today-task-meta .client {
  background: rgba(192, 132, 252, 0.2);
  border-color: rgba(192, 132, 252, 0.65);
}
.today-start-timer {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}
.today-task-row:hover .today-start-timer {
  opacity: 1;
  pointer-events: auto;
}
.today-timer-btn {
  appearance: none;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text-secondary);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateX(6px) scale(0.95);
  pointer-events: none;
  transition:
    opacity 140ms ease,
    transform 140ms ease,
    background 120ms ease,
    box-shadow 120ms ease,
    border-color 120ms ease;
}
.today-task-row:hover .today-timer-btn,
.today-task-row.timer-active .today-timer-btn {
  opacity: 1;
  transform: translateX(0) scale(1);
  pointer-events: auto;
}
.today-timer-btn:hover {
  background: rgba(120, 140, 255, 0.15);
  border-color: rgba(140, 160, 255, 0.4);
}
.today-timer-btn:active {
  transform: scale(0.95);
}
.today-task-row.timer-active .today-timer-btn {
  background: rgba(80, 200, 160, 0.2);
  border-color: rgba(80, 200, 160, 0.6);
  color: #5fe0b8;
  box-shadow:
    0 0 0 1px rgba(96, 165, 250, 0.6),
    0 6px 18px rgba(96, 165, 250, 0.4);
}
.timer-btn {
  appearance: none;
  border: none;
  background: var(--border2);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #d8c8ff;
  border: 1px solid var(--border-strong);
  cursor: pointer;
  padding: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  transition:
    opacity 120ms ease,
    transform 120ms ease,
    color 120ms ease,
    box-shadow 120ms ease,
    background 120ms ease;
}
.timer-btn:hover {
  color: #ede0ff;
  background: rgba(96, 165, 250, 0.08);
  box-shadow:
    0 0 0 1px rgba(96, 165, 250, 0.35),
    0 4px 12px rgba(96, 165, 250, 0.25);
}
.timer-btn.running {
  background: rgba(255, 90, 90, 0.15);
  border-color: rgba(255, 90, 90, 0.4);
}
.timer-btn .play-icon {
  width: 0;
  height: 0;
  border-left: 8px solid currentColor;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  transform: translateX(1px);
}

.schedule-pill {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 3px 10px;
  min-height: 24px;
  font-size: 11px;
  font-weight: 650;
  border-radius: var(--radius-pill);
  letter-spacing: 0.02em;
  border: 1px solid rgba(167, 139, 250, 0.3);
  background: rgba(148, 120, 245, 0.15);
  color: #ddd0ff;
  white-space: nowrap;
}

.meeting-label {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 3px 10px;
  min-height: 24px;
  font-size: 11px;
  font-weight: 650;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(202, 166, 94, 0.45);
  background: rgba(189, 153, 83, 0.2);
  color: #e5c987;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.meeting-soon-label {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 3px 10px;
  min-height: 24px;
  font-size: 11px;
  font-weight: 650;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(167, 139, 250, 0.3);
  background: rgba(148, 120, 245, 0.15);
  color: #ddd0ff;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.due-label {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 3px 10px;
  min-height: 24px;
  font-size: 11px;
  font-weight: 650;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(214, 176, 111, 0.44);
  background: rgba(199, 161, 98, 0.2);
  color: #f0c581;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.due-label.due-soon {
  border-color: rgba(224, 182, 106, 0.52);
  background: rgba(219, 168, 78, 0.2);
  color: #ffcd7d;
}

.due-label.overdue {
  border-color: rgba(230, 113, 113, 0.5);
  background: rgba(222, 88, 88, 0.2);
  color: #ff9a9a;
}

.due-date-value {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(231, 237, 252, 0.78);
  white-space: nowrap;
}

.schedule-pill .due-date-value {
  padding: 0;
  margin-left: 6px;
}

.today-task-row.due-overdue {
  box-shadow: none;
}

@media (max-width: 720px) {
  .today-task-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .today-task-actions {
    width: 100%;
    justify-content: flex-end;
    justify-self: end;
  }
}

.today-task-group .today-task-list {
  padding: 0;
  margin: 0;
}

.today-task-group .today-task-list .muted {
  padding: 10px 4px;
}

.visually-hidden {
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

@media (max-width: 600px) {
  .today-task-tabs {
    flex-direction: column;
  }

  .today-task-pagination {
    width: 100%;
  }
}

#calendar-meta {
  font-size: 0.85rem;
  line-height: 1.3;
  white-space: nowrap;
  opacity: 0.85;
}

#calendar-meta strong {
  font-weight: 500;
}

#calendar-count.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  height: 28px;
  padding: 0 12px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: var(--radius-pill);
  background: var(--border2);
  border: 1px solid var(--border-strong);
  white-space: nowrap;
}

#calendar-card .card-header {
  margin-bottom: 16px;
}

#calendar-card .calendar-card-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
  min-height: auto;
}

#calendar-card .calendar-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.calendar-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.calendar-header-actions > :not(.calendar-date-popover) {
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#calendar-day-toggle {
  height: 28px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-pill);
}

#calendar-day-toggle.secondary {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

/* =========================
   PANEL TOP ALIGNMENT FIX
========================= */

.panel {
  padding-top: 20px; /* canonical */
}

/* =========================
   CARD HEADER BASELINE
========================= */

.card-header,
.needs-attention-header {
  min-height: 40px;
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}


#calendar-day-toggle,
#calendar-count {
  margin: 0;
  vertical-align: middle;
}

/* Goals card sizing */
#goals-card {
  min-height: 0;
  padding: 12px 18px;
}

.goals-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.goals-card-header h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.goals-new-btn {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  min-width: 140px;
}

.goals-tabs {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.goals-tab {
  padding: 4px 12px;
  font-size: 0.75rem;
  border-radius: var(--radius-sm, 10px);
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
}

.goals-tab.active {
  background: rgba(167, 139, 250, 0.24);
  border-color: rgba(167, 139, 250, 0.5);
  box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.35);
}

.goals-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: calc(3 * 54px);
  overflow-y: auto;
}

.goal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
}

.goal-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.goal-title {
  font-size: 0.95rem;
  color: var(--text);
}

.goal-kind-pill {
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid var(--border-emphasis);
  background: var(--surface-2);
  color: var(--muted);
}

.goal-row-label {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.goal-row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.goal-delete {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.goal-delete:hover {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text);
}

.goal-form {
  margin-top: 14px;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--surface-subtle);
}

.goal-form-fields {
  display: grid;
  grid-template-columns: 1fr 150px;
  gap: 10px;
}

.goal-form input,
.goal-form select {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  padding: 8px 10px;
  font-size: 0.9rem;
}

.goal-form-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.goals-pagination {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.goals-pagination .goals-page-btn {
  padding: 4px 10px;
  font-size: 0.75rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  color: var(--text);
  cursor: pointer;
}

.goals-pagination .goals-page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.goals-pagination .goals-page-indicator {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
}

/* =========================
   Today – Card Header Sync
========================= */

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  min-height: 56px;
  margin-bottom: 12px;
}

.today-tasks.card .card-header {
  padding-bottom: 0;
}

/* make tasks column span both rows to match new layout */
.today-tasks.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  grid-area: tasks;
}

.card-header--spacer {
  height: 32px;
  margin: 0;
  padding: 0;
}

.today-tasks.card {
  padding-top: 16px; /* match #calendar-card padding */
}

.today-task-group {
  margin-top: 0;
}

.today-task-group h3 {
  margin: 0 0 8px 0;
}

.card-header,
.needs-attention-header {
  min-height: 40px;
}


.today-tasks-header {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;

  min-height: 56px;   /* EXACT match */
  margin-bottom: 12px;
}

.section-main-title {
  margin: 0;
  font-size: 1.5em;
  font-weight: 700;
  padding-top: 8px;
}

.today-tasks.card {
  padding-top: 20px; /* matches calendar card top rhythm */
}

.today-task-group:first-child {
  margin-top: 0;
}

.today-task-group h3 {
  margin-top: 0;
}

.today-task-group.needs-attention h3 {
  font-size: 1rem;
  font-weight: 600;
}

/* tighten the task card so the header sits closer to the top edge */
.today-tasks.card{
  padding-top: 10px;
}

.today-task-group h3{
  margin: 0 0 10px 0;
}

.today-task-group.collapsed .today-task-list {
  display: none;
}

.today-task-group .chevron {
  margin-left: 6px;
  opacity: 0.6;
  font-size: 0.8em;
}

.today-task-group.collapsed .chevron {
  transform: rotate(-90deg);
}

.today-section-header.priority {
  margin-top: 6px;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  opacity: 0.8;
}

/* Priority field matches formgrid layout */
.priority-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* Layout for the intake priority/status combo row */
.intake-meta-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.intake-due-date-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.intake-client-engagement-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.intake-title-status-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.intake-client-engagement-row select {
  width: 100%;
}

.intake-title-status-row input,
.intake-title-status-row select {
  width: 100%;
}

.intake-meta-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.intake-meta-row .intake-meta-span {
  grid-column: 1 / -1;
}

.status-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.status-field select {
  width: 100%;
}

@media (max-width: 720px) {
  .intake-meta-row {
    grid-template-columns: 1fr;
  }

  .intake-due-date-stack {
    gap: 16px;
  }

  .intake-client-engagement-row {
    grid-template-columns: 1fr;
  }

  .intake-title-status-row {
    grid-template-columns: 1fr;
  }
}

.work-planning {
  border: 1px solid var(--border-strong);
  background: var(--surface-subtle);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.work-planning.is-disabled {
  opacity: 0.6;
}

.work-planning-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.work-planning-header-text h4 {
  margin: 0 0 4px;
  font-size: 0.95rem;
}

.work-planning-summary {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.work-planning-warning {
  margin: 6px 0 0;
  font-size: 0.8rem;
  color: #ffb86b;
}

.work-planning-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.work-planning-intro {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.work-planning-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(120px, 1fr);
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.work-planning-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.work-planning-controls .btn[disabled] {
  opacity: 0.5;
}

.work-planning-day {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 96px;
}

.work-planning-day.has-planned {
  border-color: rgba(167, 139, 250, 0.5);
  background: rgba(167, 139, 250, 0.1);
  box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.18);
}

.work-planning-day.is-selected {
  border-color: rgba(167, 139, 250, 0.65);
  box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.2);
}

.work-planning-day.is-due {
  opacity: 0.7;
}

.work-planning-day-label {
  font-weight: 600;
  font-size: 0.85rem;
}

.work-planning-day-meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.work-planning-day-plan {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.work-planning-day-actions {
  margin-top: auto;
}

.work-planning-editor {
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-active);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.work-planning-editor-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.85rem;
}

.work-planning-editor-question {
  margin: 0;
  font-size: 0.85rem;
}

.work-planning-duration-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.work-planning-duration-buttons .btn.is-selected {
  border-color: rgba(167, 139, 250, 0.7);
  background: rgba(167, 139, 250, 0.18);
  color: #e8d8ff;
}

.work-planning-custom-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.work-planning-custom-row input {
  width: 110px;
}

.work-planning-windows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.work-planning-window-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.work-planning-window {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  cursor: pointer;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  appearance: none;
  -webkit-appearance: none;
}

.work-planning-window:hover {
  border-color: var(--border-focus, var(--border-strong));
  background: var(--surface-3, var(--surface-2));
}

.work-planning-window:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.work-planning-window-time {
  font-weight: 600;
}

.work-planning-window-meta {
  font-size: 0.78rem;
  color: var(--muted);
}

.work-planning-window-actions {
  display: flex;
  gap: 6px;
}

.work-planning-no-windows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  padding: 10px;
}

.work-planning-no-windows-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.work-planning-summary-card {
  border-top: 1px solid var(--border-strong);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.work-planning-summary-title {
  font-size: 0.85rem;
  font-weight: 600;
}

.work-planning-summary-list,
.work-planning-summary-total {
  font-size: 0.82rem;
  color: var(--text-dim);
}

.work-planning-summary-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.work-planning-summary-item + .work-planning-summary-item {
  margin-top: 6px;
}

.work-planning-summary-actions {
  display: flex;
  gap: 6px;
}

/* Priority toggle */
.priority-toggle {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-emphasis);
  background: var(--surface-subtle);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  align-self: stretch;
  justify-self: stretch;
  flex-wrap: nowrap;
}

.priority-toggle:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: var(--border2);
}

.priority-toggle input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.priority-toggle input {
  accent-color: var(--priority-accent);
}

/* Make the header look clickable */
.today-task-group h3.collapsible {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Push chevron + count to the right neatly */
.today-task-group h3.collapsible .count {
  margin-left: 8px;
}

.today-task-group h3.collapsible .chevron {
  margin-left: auto;
  transition: transform 0.15s ease;
  opacity: 0.8;
}

/* Collapsing: hide the list */
.today-task-group.collapsed .today-task-list {
  display: none;
}

/* Collapsing: rotate chevron */
.today-task-group.collapsed h3.collapsible .chevron {
  transform: rotate(-90deg);
}

/* Base style for all Today section headers */
.today-task-group > h3 {
  font-size: 1.05rem;          /* match Priority */
  font-weight: 600;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

/* Collapsible-specific behavior */
.today-task-group > h3.collapsible {
  cursor: pointer;
  user-select: none;
}

/* Count styling stays consistent */
.today-task-group > h3 .count {
  font-weight: 500;
  opacity: 0.8;
}

/* Chevron alignment + animation */
.today-task-group > h3 .chevron {
  margin-left: auto;
  transition: transform 0.15s ease;
  opacity: 0.7;
}

/* Collapsed state */
.today-task-group.collapsed .today-task-list {
  display: none;
}

.today-task-group.collapsed > h3 .chevron {
  transform: rotate(-90deg);
}

.settings-client {
  cursor: pointer;
}

.settings-client:hover {
  background: var(--surface-subtle);
}

/* Client Details modal sizing */
.client-details-card {
  width: min(760px, 92vw);
  max-width: 760px;

  /* REMOVE min-height */
  /* min-height: 460px; */

  padding: 28px 32px;
  border-radius: 16px;
}

.client-details-card .modal-header h3 {
  padding-bottom: 6px;
}

.client-details-card .formgrid {
  gap: 20px 24px;
}

/* #client-details-modal::backdrop — uses global dialog::backdrop */

/* Engagement modal sizing to match client details */
.engagement-card {
  width: min(760px, 92vw);
  max-width: 760px;
  padding: 28px 32px;
  border-radius: 16px;
}

.engagement-card .formgrid {
  gap: 20px 24px;
}

/* #engagement-modal::backdrop — uses global dialog::backdrop */

/* Opportunity modal sizing to match client details */
.opportunity-card {
  width: min(760px, 92vw);
  max-width: 760px;
  padding: 28px 32px;
  border-radius: 16px;
}

.opportunity-card .formgrid {
  gap: 20px 24px;
}

/* #opportunity-modal::backdrop — uses global dialog::backdrop */

.client-details-summary {
  margin-bottom: 16px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  border: 1px solid var(--border2);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.client-details-summary label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.client-details-summary .value {
  font-size: 14px;
  font-weight: 500;
}

.clients-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 24px;
  align-items: start;
}

.clients-left {
  min-width: 0;
}

.clients-right {
  min-height: 260px; /* so the box has presence even if hidden */
}

.clients-right {
  position: sticky;
  top: 96px; /* stays visible while scrolling */
}

.client-details-summary {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: linear-gradient(
    180deg,
    var(--surface-2),
    var(--bg-subtle)
  );
  border: 1px solid var(--border-subtle);
}

.clients-shell {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 24px;
  align-items: start;
}

.clients-main {
  min-width: 0;
    grid-column: 1 / span 2;

}

.clients-context {
  min-width: 280px;
}

.client-context-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
}

.client-context-placeholder {
  min-height: 200px;
  border: 2px dashed #ff6b6b;
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
}

.clients-shell {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 24px;
}

.clients-context {
  display: flex;
  flex-direction: column;
}

.client-context-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 16px;
}

.context-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

/* Client Details Card */
.client-context-card {
  background: linear-gradient(
    180deg,
    var(--surface-2),
    var(--bg-subtle)
  );
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow:
    inset 0 1px 0 var(--surface-2),
    0 8px 24px rgba(0, 0, 0, 0.35);
}

/* Title */
.client-context-card h4 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  text-transform: uppercase;
}

/* Grid layout */
.context-grid {
  display: grid;
  grid-template-columns: 1fr;
  row-gap: 10px;
}

/* Labels */
.context-grid label {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 2px;
  display: block;
}

/* Values */
.context-grid .value {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
}

.client-context-card {
  opacity: 0.95;
}

.clients-context {
  grid-column: 2;
  grid-row: 1;
}

.clients-main {
  background: linear-gradient(
    180deg,
    var(--surface-subtle),
    rgba(255, 255, 255, 0.015)
  );
  border: 1px solid var(--border2);
  border-radius: 16px;
  padding: 20px;
}

.clients-shell {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: auto;
  gap: 24px;
}

.clients-main {
  grid-column: 1;
  grid-row: 1;
}

.clients-context {
  grid-column: 2;
  grid-row: 1;
}

.client-context-card {
  font-size: 0.85rem;
  line-height: 1.4;
}

.client-context-card h4 {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  opacity: 0.7;
}

.clients-shell {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto;
  gap: 20px;
}

.clients-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.client-context-card {
  background: linear-gradient(
    180deg,
    var(--surface-2),
    var(--bg-subtle)
  );
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 16px 20px;
  font-size: 0.8rem;
}

.client-context-card h4 {
  margin-bottom: 10px;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  opacity: 0.7;
  text-transform: uppercase;
}

.context-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.context-grid label {
  font-size: 0.65rem;
  opacity: 0.6;
  text-transform: uppercase;
}

.context-grid .value {
  font-size: 0.8rem;
  font-weight: 500;
}

/* Client details — single-line horizontal layout */
.client-context-card .context-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  align-items: center;
}

/* Labels */
.client-context-card label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  margin-bottom: 4px;
}

/* Values */
.client-context-card .value {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .client-context-card .context-grid {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 16px;
  }
}

@media (max-width: 520px) {
  .client-context-card .context-grid {
    grid-template-columns: 1fr;
  }
}

.client-context-card {
  padding: 16px 20px;
}

.client-context-card h4 {
  font-size: 12px;
  letter-spacing: 0.06em;
  opacity: 0.7;
  margin-bottom: 12px;
}

/* Client task tabs */
.client-task-tabs button {
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border-subtle);
  transition: all 0.15s ease;
}

/* ACTIVE TAB */
.client-task-tabs button.active {
  background: rgba(148, 120, 245, 0.18);
  color: #fff;
  border-color: rgba(148, 120, 245, 0.45);
  box-shadow:
    inset 0 0 0 1px rgba(148, 120, 245, 0.25),
    0 0 0 1px rgba(148, 120, 245, 0.15);
}

/* Hover (inactive only) */
.client-task-tabs button:not(.active):hover {
  background: var(--border-subtle);
  color: var(--text-dim);
}

.client-task-tabs button {
  position: relative;
}

.client-task-tabs button.active::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 12px;
  right: 12px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(
    90deg,
    rgba(148, 120, 245, 0.2),
    rgba(148, 120, 245, 0.8),
    rgba(148, 120, 245, 0.2)
  );
}

.client-task-tabs button.active .count {
  opacity: 1;
}

.client-task-tabs button .count {
  opacity: 0.6;
}

/* Base tab */
.client-task-tabs button {
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border-subtle);
  transition: all 0.15s ease;
}

/* ACTIVE = BRIGHT */
.client-task-tabs button.active {
  background: linear-gradient(
    180deg,
    rgba(140, 180, 255, 0.45),
    rgba(100, 150, 255, 0.25)
  );
  color: #ffffff;
  border-color: rgba(140, 180, 255, 0.75);
  box-shadow:
    0 0 0 1px rgba(140, 180, 255, 0.6),
    0 6px 18px rgba(148, 120, 245, 0.35);
}

/* Ensure text pops */
.client-task-tabs button.active span,
.client-task-tabs button.active {
  font-weight: 600;
}
.client-task-tabs {
  margin-bottom: 16px;
}
.client-task-tabs {
  margin-bottom: 20px;
}
.client-task-tabs button:not(.active) {
  opacity: 0.55;
}
.client-task-tabs button:not(.active):hover {
  opacity: 0.8;
}

/* =========================
   Client Task Tabs – FINAL
========================= */

.task-tabs {
  display: flex;
  gap: 8px;
  margin: 10px 0 20px;
}

.task-tabs .btn {
  background: var(--surface-subtle);
  color: var(--text-faint);
  border: 1px solid var(--border-subtle);
  font-weight: 500;
  opacity: 0.55;
}

.task-tabs .btn.active {
  opacity: 1;
  color: #ffffff;

  background: linear-gradient(
    180deg,
    rgba(140, 180, 255, 0.55),
    rgba(100, 150, 255, 0.30)
  );

  border-color: rgba(140, 180, 255, 0.85);

  box-shadow:
    0 0 0 1px rgba(140, 180, 255, 0.7),
    0 8px 24px rgba(148, 120, 245, 0.45);

  font-weight: 600;
}

/* Base tabs */
.task-tabs {
  display: flex;
  gap: 8px;
  margin: 10px 0 20px;
}

.task-tabs .btn {
  background: var(--surface-subtle);
  color: var(--text-faint);
  border: 1px solid var(--border-subtle);
  font-weight: 500;
  opacity: 0.6;
  transition: all 140ms ease;
}

/* Hover (inactive only) */
.task-tabs .btn:not(.active):hover {
  opacity: 0.8;
  background: var(--border2);
}

/* ACTIVE — toned down */
.task-tabs .btn.active {
  opacity: 1;
  color: var(--text);

  background: rgba(167, 139, 250, 0.16); /* softer fill */
  border-color: rgba(167, 139, 250, 0.45);

  box-shadow:
    inset 0 0 0 1px rgba(167, 139, 250, 0.18),
    0 2px 8px rgba(0, 0, 0, 0.35);

  font-weight: 600;
}

/* Task row container */
.task {
  display: flex;
  align-items: center;        /* ✅ vertical centering */
  justify-content: space-between;
  gap: 12px;
}

/* Ensure title doesn’t stretch vertically */
.task-title {
  display: flex;
  align-items: center;        /* ✅ keeps text centered */
  line-height: 1.4;
}

.task {
  display: flex;
  align-items: center;              /* vertical centering */
  justify-content: space-between;   /* push actions to the right */
  gap: 12px;
}

.task-title {
  flex: 1 1 auto;       /* 🔑 key line */
  min-width: 0;         /* prevents overflow bugs */
  display: flex;
  align-items: center;
}

.task-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;       /* 🔑 prevents squeezing */
}

.task-top {
  display: flex;
  align-items: center;   /* vertical centering */
  gap: 12px;
}

.task-title {
  flex: 1;               /* allows buttons to push right */
  display: flex;
  align-items: center;   /* vertical centering of text */
  gap: 8px;
  min-height: 40px;      /* optional, but stabilizes row height */
}

.task-actions {
  margin-left: auto;     /* pushes actions to the far right */
  display: flex;
  align-items: center;
  gap: 6px;
}

.complete-icon {
  display: inline-flex;
  width: 16px;
  height: 12px;
  align-items: center;
  justify-content: center;
}

.complete-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.completed-pill {
  margin-left: 8px;
  padding: 2px 8px;
  font-size: 11px;
  border-radius: var(--radius-pill);
  background: rgba(167, 139, 250, 0.15);
  color: #c8b4ff;
  font-weight: 500;
  vertical-align: middle;
}

.status-pill {
  margin-left: 8px;
  padding: 2px 8px;
  font-size: 11px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  letter-spacing: 0.01em;
  vertical-align: middle;
}

.status-pill--active {
  background: rgba(105, 228, 185, 0.15);
  color: #a8ffe1;
  border: 1px solid rgba(105, 228, 185, 0.35);
}

.status-pill--completed {
  background: rgba(167, 139, 250, 0.18);
  color: #c8b4ff;
  border: 1px solid rgba(167, 139, 250, 0.35);
}

.recurrence-pill {
  margin-left: 8px;
  padding: 2px 8px;
  font-size: 11px;
  border-radius: var(--radius-pill);
  background: rgba(105, 228, 185, 0.18);
  color: #a8ffe1;
  font-weight: 500;
  border: 1px solid rgba(105, 228, 185, 0.45);
  vertical-align: middle;
}

.fathom-pill {
  display: inline-flex;
  align-items: center;
  margin-left: 10px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-pill);
  background: rgba(167, 139, 250, 0.2);
  color: #c8b4ff;
  letter-spacing: 0.03em;
  border: 1px solid rgba(167, 139, 250, 0.5);
  vertical-align: middle;
}

/* Client tasks controls */
.client-task-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}

.client-task-controls .task-tabs {
  margin-bottom: 0;
}

.client-task-priority-section {
  margin-top: 16px;
}

.client-task-priority-section.hidden {
  display: none;
}

.client-task-completed-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.client-task-completed-list.hidden {
  display: none;
}

.client-task-completed-list .task {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.035),
    var(--bg-subtle)
  );
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: background 0.15s ease, border-color 0.15s ease;
  align-items: stretch;
  justify-content: center;
}

.client-task-completed-list .task:hover {
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(140, 170, 255, 0.35);
}

.client-task-completed-list .task-title {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.client-task-completed-list .task-title-text {
  flex: 1 1 0;
  min-width: 0;
  display: inline-block;
}

.client-task-completed-list .due-label,
.client-task-completed-list .completed-pill {
  margin-left: 0;
}

.client-task-priority-tabs {
  flex-wrap: wrap;
}

.client-task-priority-tabs.hidden {
  display: none;
}

/* Match date inputs to small buttons in Reporting */
.reporting-controls .custom-range input[type="date"] {
  height: 32px;                 /* same as .btn.small */
  padding: 0 10px;
  font-size: 13px;
  line-height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border-muted);
  background: var(--panel-bg);
  color: var(--text-primary);
}

/* Remove default inner spacing weirdness */
.reporting-controls .custom-range input[type="date"]::-webkit-datetime-edit {
  padding: 0;
}

/* Align nicely with buttons */
.reporting-controls .custom-range {
  display: flex;
  align-items: center;
  gap: 8px;
}

.reporting-controls .custom-range input[type="date"]:focus {
  outline: none;
  border-color: var(--focus-ring);
  box-shadow: 0 0 0 2px rgba(167, 139, 250, 0.2);
}

/* Reporting date inputs — visible but understated */
.reporting-controls .custom-range input[type="date"] {
  height: 32px;
  padding: 0 10px;
  font-size: 13px;
  line-height: 32px;
  border-radius: 8px;

  border: 1px solid var(--border-active); /* 👈 visible */
  background: var(--surface-2);       /* 👈 slight fill */
  color: #fff;
}

.reporting-controls .custom-range .muted {
  color: #fff;
  opacity: 0.85;
  font-size: 13px;
  line-height: 32px;
}

.reporting-controls .custom-range .muted {
  padding: 0 6px;
  border-radius: 6px;
  background: var(--border2);
  color: #fff;
  font-size: 12px;
}

.reporting-controls .custom-range {
  display: flex;
  align-items: center;   /* 👈 THIS is the key */
  gap: 8px;
}

.reporting-controls .custom-range .muted {
  display: flex;
  align-items: center;   /* 👈 centers text vertically */
  height: 32px;          /* match date input height */
  line-height: 32px;
  color: #fff;
  opacity: 0.85;
  font-size: 13px;
}

.reporting-controls .custom-range input[type="date"] {
  height: 32px;
}

.custom-range {
  display: flex;
  align-items: stretch; /* 👈 important */
  gap: 8px;
}

.custom-range input[type="date"],
.custom-range .range-separator {
  height: 36px;               /* choose your control height */
  display: flex;
  align-items: center;
}

.custom-range .range-separator {
  line-height: 1;             /* 👈 kills baseline drift */
  padding: 0 10px;
  border-radius: 8px;
  background: var(--border2);
  color: #fff;
  font-size: 13px;
  white-space: nowrap;
}

.custom-range input[type="date"] {
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-emphasis);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
}

/* HARD FIX: center the internal date text */
.custom-range input[type="date"]::-webkit-datetime-edit {
  display: flex;
  align-items: center;
  height: 100%;
}

.custom-range input[type="date"]::-webkit-calendar-picker-indicator {
  margin: 0;
  padding: 0;
  height: 100%;
  align-self: center;
}

.custom-range {
  display: flex;
  align-items: center;
  gap: 8px;
}

.custom-range input[type="date"] {
  height: 32px;
  padding: 0 10px;
  font-size: 13px;

  border-radius: 8px;
  border: 1px solid var(--border-active);
  background: var(--surface-2);
  color: #fff;

  display: flex;
  align-items: center;
}

.custom-range .muted {
  display: flex;
  align-items: center;
  justify-content: center;

  height: 32px;
  padding: 0 8px;

  font-size: 13px;
  line-height: 1;

  border-radius: 6px;
  background: var(--border2);
  color: #fff;
}

.custom-range input[type="date"] {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  line-height: normal;
}

.custom-range input[type="date"]::-webkit-datetime-edit-fields-wrapper {
  display: flex;
  align-items: center;
  height: 100%;
}

.custom-range input[type="date"]::-webkit-datetime-edit-text,
.custom-range input[type="date"]::-webkit-datetime-edit-month-field,
.custom-range input[type="date"]::-webkit-datetime-edit-day-field,
.custom-range input[type="date"]::-webkit-datetime-edit-year-field {
  padding: 0;
  line-height: 1;
}

.custom-range {
  display: flex;
  align-items: center;
  gap: 8px;
}

.custom-range input[type="date"] {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;

  border-radius: var(--radius-sm);
  border: 1px solid var(--border-active);
  background: var(--surface-2);
  color: #fff;
}

/* 🔑 WebKit date alignment hard fix */
.custom-range input[type="date"]::-webkit-datetime-edit-fields-wrapper {
  display: flex;
  align-items: center;
  height: 100%;
}

.custom-range input[type="date"]::-webkit-datetime-edit-text,
.custom-range input[type="date"]::-webkit-datetime-edit-month-field,
.custom-range input[type="date"]::-webkit-datetime-edit-day-field,
.custom-range input[type="date"]::-webkit-datetime-edit-year-field {
  padding: 0;
  line-height: 1;
}

/* calendar icon */
.custom-range input[type="date"]::-webkit-calendar-picker-indicator {
  align-self: center;
  margin: 0;
}

/* "to" pill */
.custom-range .muted {
  height: 32px;
  padding: 0 8px;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 13px;
  line-height: 1;

  border-radius: 6px;
  background: var(--border2);
  color: #fff;
}

.custom-range .muted {
  transform: translateY(2px);
}

.custom-range .muted {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  height: 36px;              /* EXACT match to date inputs */
  padding: 0 12px;           /* remove vertical padding */

  line-height: 1;            /* 🔑 kills font ascent bias */
  font-size: 13px;

  border-radius: 8px;
  background: var(--border2);
  color: #fff;
}

.custom-range input[type="date"] {
  height: 36px;
  line-height: 36px;
}

.custom-range {
  display: flex;
  align-items: center; /* vertical centering */
  gap: 10px;
}

.range-divider {
  width: 12px;                 /* spacing between inputs */
  height: 1px;                 /* thin divider */
  background: rgba(255, 255, 255, 0.7);
  flex-shrink: 0;
}


.clients-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
}

.clients-row {
  width: 100%;
  padding: 20px;
  border-radius: 14px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.035),
    rgba(255, 255, 255, 0.015)
  );
  border: 1px solid var(--border2);
  box-shadow:
    inset 0 1px 0 var(--surface-2),
    0 10px 24px rgba(0, 0, 0, 0.35);
}

.clients-row.panel-header {
  background: var(--header-bg);
  border: 1px solid var(--header-border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow:
    inset 0 1px 0 var(--surface-2),
    0 10px 24px rgba(0, 0, 0, 0.35);
}

.client-select-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 24px;
}

.client-select-row h2 {
  margin-bottom: 6px;
  font-size: 15px;
}

.client-select-row .formgrid {
  max-width: 360px; /* keeps dropdown readable */
}

.client-details-row {
  display: block;
  font-size: 0.9rem;
  opacity: 0.95;
}

.client-details-row h3 {
  margin-bottom: 0;
}

.client-details-row .detail-section-header {
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.client-details-row .context-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 900px) {
  .client-details-row .context-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.client-work-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

#view-clients .client-tab-panel[data-client-panel="emails"] .client-work-row {
  grid-template-columns: 1fr;
}

.client-work-row > div {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  padding: 16px;
  min-width: 0;
}

.client-work-row > .client-tasks {
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
}

@media (max-width: 900px) {
  .client-work-row {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1100px) {
  .clients-layout {
    gap: 28px;
  }
}

.clients-row + .clients-row {
  margin-top: 0;
}

#view-clients .client-select-row.panel-header,
#view-sales .client-select-row.panel-header,
#view-companies .client-select-row.panel-header,
#view-planning .client-select-row.panel-header {
  padding: 0;
  margin: 0;
}

#view-clients .client-header-row.panel-header,
#view-sales .client-header-row.panel-header,
#view-companies .client-header-row.panel-header,
#view-planning .client-header-row.panel-header {
  background: var(--header-bg);
  border: 1px solid var(--header-border);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  box-shadow:
    inset 0 1px 0 var(--surface-2),
    0 10px 24px rgba(0, 0, 0, 0.35);
  margin: 0;
}

#view-reporting .reporting-header-row {
  position: sticky;
  top: -18px;
  z-index: 1001;
  background: var(--panel);
  border: none;
  box-shadow: none;
  margin: -18px 0 0;
  padding: 18px 0 0;
}

#view-reporting .reporting-header-row .reporting-header {
  position: static;
  top: auto;
  z-index: auto;
  margin: 0;
  width: 100%;
}

#view-reporting .reporting-header-row .reporting-header.panel-header {
  margin: 0;
}

#view-reporting .reporting-header.panel-header,
#view-planning .reporting-header.panel-header {
  background: var(--header-bg);
  border: 1px solid var(--header-border);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  box-shadow:
    inset 0 1px 0 var(--surface-2),
    0 10px 24px rgba(0, 0, 0, 0.35);
}



/* Header row */
.client-notes h3 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0;
}

.client-tasks-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border2);
  margin-bottom: 22px;
}

#new-client-task {
  margin: 0;
  padding: 6px 14px;
  font-size: 13px;
}

.client-tasks-header h3 {
  margin: 0;
}

.client-tasks-header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* =========================
   CLIENT NOTES
========================= */

.client-notes {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

/* Header row */
.client-notes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding-bottom: 14px;
  border-bottom: 1px solid var(--border2);
  margin-bottom: 22px;
}

.client-notes-header h3 {
  margin: 0;
}

/* Button top-right */
#new-client-note {
  margin: 0;
  padding: 6px 14px;
  font-size: 13px;
}

/* Notes list full width */
#client-notes-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

/* Note card */
.client-note {
  width: 100%;
  padding: 16px 18px;
  border-radius: var(--radius-md);

  background: linear-gradient(
    180deg,
    var(--surface-2),
    var(--bg-subtle)
  );

  border: 1px solid var(--border-subtle);

  display: flex;
  flex-direction: column;
  gap: 4px;

  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.client-note:hover {
  background: var(--border2);
  border-color: rgba(140, 170, 255, 0.35);
}

/* Typography */
.client-note .note-title {
  font-size: 13px;
  font-weight: 500;
}

.client-note .note-date {
  font-size: 11.5px;
  opacity: 0.6;
}

/* =========================
   CLIENT TASK ROW POLISH
========================= */

.client-task:not(.today-task-row):not(.today-spotlight-card) {
  padding: 14px 16px;          /* ← key fix */
  border-radius: var(--radius-md);

  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.035),
    var(--bg-subtle)
  );

  border: 1px solid var(--border2);

  display: flex;
  flex-direction: column;
  gap: 4px;

  transition: background 0.15s ease, border-color 0.15s ease;
}

.client-task:not(.today-task-row):not(.today-spotlight-card):hover {
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(140, 170, 255, 0.35);
}

/* Task title */
.client-task .task-title {
  font-size: 13px;             /* ↓ from default */
  font-weight: 500;
  line-height: 1.3;
}

/* Task meta (date / age / client) */
.client-task .task-meta {
  font-size: 11.5px;
  opacity: 0.6;
}

#sales-notes-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.client-note-row {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(
    180deg,
    var(--surface-2),
    var(--bg-subtle)
  );
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.client-note-row:hover {
  background: var(--border2);
  border-color: rgba(140, 170, 255, 0.35);
}

.client-note-row .note-title {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
}

.client-note-row .note-date {
  font-size: 11.5px;
  opacity: 0.6;
  margin-top: 2px;
}

.today-task-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  text-align: left;
}

.today-task-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}

.today-task-title {
  font-size: 14.5px;
  font-weight: 600;
  display: block;
  color: var(--text);
  line-height: 1.3;
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.today-task-title-text {
  display: inline;
  width: auto;
  overflow-wrap: anywhere;
}

.today-task-title-row .client {
  font-weight: 500;
  opacity: 0.8;
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: var(--surface-subtle);
  font-size: 11.5px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.today-task-meta-row {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.today-task-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 8px;
  row-gap: 4px;
  font-size: 12px;
  color: rgba(224, 232, 248, 0.65);
  min-width: 0;
}

.today-task-meta span {
  flex-shrink: 0;
}

.today-task-meta .age {
  font-variant-numeric: tabular-nums;
  opacity: 0.66;
  align-self: center;
}

/* ----------------------------
   Reporting — Logged At (time-of-day)
----------------------------- */

.reporting-detail-row .date {
  display: inline-flex;
  align-items: center;
  gap: 6px;               /* space before dot */
}

.reporting-detail-row .logged-at {
  font-size: 11.5px;
  opacity: 0.55;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Optional subtle separator (dot already in markup) */
.reporting-detail-row .logged-at::before {
  content: "·";
  margin-right: 6px;
  opacity: 0.5;
}

.time-source-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: var(--surface-2);
  color: var(--text-dim);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.time-source-pill-fathom {
  border-color: rgba(167, 139, 250, 0.45);
  background: rgba(167, 139, 250, 0.12);
  color: #c8b4ff;
}

/* 🔑 FINAL OVERRIDE — Reporting date inputs must be native */
#view-reporting input[type="date"] {
  appearance: auto !important;
  -webkit-appearance: auto !important;
  -moz-appearance: auto !important;
  pointer-events: auto !important;
  cursor: pointer;
}

/* =========================================
   DATE INPUTS — restore native calendar UI
   ========================================= */

input[type="date"] {
  appearance: auto;
  -webkit-appearance: auto;
  -moz-appearance: auto;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 1;
  display: block;
  cursor: pointer;
}

/* =========================
   REPORTING — DATE INPUT (FINAL)
========================= */

#view-reporting input[type="date"] {
  appearance: auto !important;
  -webkit-appearance: auto !important;
  -moz-appearance: auto !important;

  display: inline-block;              /* 🔑 REQUIRED */
  height: 36px;
  color-scheme: dark;                  /* ensure native icon renders for dark UI */

  position: relative;
  width: 140px;                        /* keep inputs compact */
  padding: 0 26px 0 12px;             /* reserve space for icon */
  font-size: 13px;

  border-radius: 8px;
  border: 1px solid var(--border-active);
  background-color: var(--surface-2);
  color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px 16px;
}

#view-reporting input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0;
  display: block;
  cursor: pointer;
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);

  -webkit-filter: invert(1) brightness(2);
  filter: invert(1) brightness(2); /* dark UI: white icon */
}

/* Clients — date inputs for time tracking */
#view-clients input[type="date"] {
  appearance: auto !important;
  -webkit-appearance: auto !important;
  -moz-appearance: auto !important;

  display: inline-block;
  height: 36px;
  color-scheme: dark;

  position: relative;
  width: 140px;
  padding: 0 26px 0 12px;
  font-size: 13px;

  border-radius: 8px;
  border: 1px solid var(--border-active);
  background-color: var(--surface-2);
  color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px 16px;
}

#view-clients input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0;
  display: block;
  cursor: pointer;
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);

  -webkit-filter: invert(1) brightness(2);
  filter: invert(1) brightness(2);
}

/* =========================
   Reporting details cleanup
========================= */
#view-reporting .reporting-detail-cell {
  background: transparent;
}

#view-reporting .reporting-detail-list {
  padding: 8px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#view-reporting .reporting-detail-header {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 6px 12px 2px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

#view-reporting .reporting-detail-header span:last-child {
  text-align: right;
  padding-right: 6px;
}

#view-reporting .reporting-detail-row {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.035),
    var(--bg-subtle)
  );
  border: 1px solid var(--border2);
  color: var(--text-secondary);
  width: 100%;
}

#view-reporting .reporting-detail-row:hover {
  background: var(--border2);
  border-color: rgba(140, 170, 255, 0.35);
}

#view-reporting .reporting-detail-row .date {
  font-variant-numeric: tabular-nums;
  opacity: 0.85;
}

#view-reporting .reporting-detail-row .time {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  font-weight: 600;
  color: var(--text);
}

#view-reporting .reporting-detail-row .time-value {
  display: inline-block;
}

#view-reporting .reporting-detail-row .actions {
  display: flex;
  gap: 6px;
}

#view-reporting .reporting-detail-row .iconbtn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  color: var(--text);
}

#view-reporting .reporting-detail-row .iconbtn:hover {
  background: var(--border);
  border-color: rgba(140, 170, 255, 0.4);
}

@media (max-width: 900px) {
  #view-reporting .reporting-detail-header {
    grid-template-columns: 120px 1fr auto;
  }

  #view-reporting .reporting-detail-row {
    grid-template-columns: 120px 1fr auto;
  }
}

/* =========================
   Clients row tightening
========================= */
#view-clients .client-select-row,
#view-sales .client-select-row,
#view-companies .client-select-row {
  padding: 8px 12px;
  gap: 10px;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
}

#view-clients .client-select-row h2,
#view-sales .client-select-row h2 {
  margin: 0;
  font-size: 15px;
}

#view-clients .client-select-row .formgrid {
  max-width: 240px;
  margin: 0;
}

#view-clients .client-select-row label,
#view-sales .client-select-row label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0;
  margin: 0;
  font-size: 0;
  white-space: nowrap;
}

#view-clients .client-select-row select,
#view-sales .client-select-row select,
#view-planning .planning-header-scenario-field select {
  height: 28px;
  padding: 0 8px;
  min-width: 180px;
  font-size: 13px;
}

@media (max-width: 900px) {
  #view-clients .client-select-row,
  #view-sales .client-select-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

#view-clients .panel {
  width: 100%;
  margin: 0 auto;
}

#view-sales .panel {
  width: 100%;
  margin: 0 auto;
}

#view-reporting .reporting-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: var(--surface-subtle);
  font-size: 12px;
  color: var(--muted);
}

#view-reporting .reporting-toggle input {
  margin: 0;
}

#view-reporting .reporting-filter-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

#view-reporting #reporting-engagement-type-filter {
  height: 28px;
  line-height: 28px;
  min-width: 140px;
  padding: 0 10px;
}

/* Reporting tabs + dashboard */
#view-reporting .reporting-tabs {
  display: flex;
  gap: 8px;
  margin-top: 0;
  justify-self: flex-end;
}

#view-reporting .reporting-header-spacer {
  width: 100%;
  height: 0;
}

#view-reporting .reporting-tabs .btn.active {
  background: rgba(167, 139, 250, 0.18);
  border-color: rgba(167, 139, 250, 0.6);
  color: #fff;
}

#view-reporting .panel.clients-layout {
  gap: 18px;
}

#view-reporting .reporting-header-row {
  position: sticky;
  top: -18px;
  z-index: 1001;
  background: var(--panel);
  border: none;
  box-shadow: none;
  margin: -18px 0 0;
  padding: 18px 0 0;
}

#view-reporting .reporting-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  position: static;
  top: auto;
  z-index: auto;
  margin: 0;
  width: 100%;
}

#view-reporting .reporting-panel {
  margin: 0;
}

#view-reporting .reporting-controls {
  margin-bottom: 16px;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 12px;
}

#view-reporting .reporting-controls-header {
  margin: 0;
  justify-self: stretch;
}

#view-reporting .reporting-summary-row {
  margin: 0;
  font-size: 14px;
  color: var(--text-dim);
  white-space: nowrap;
}

#view-reporting .reporting-summary-row strong {
  color: #fff;
  font-weight: 600;
}

#view-reporting .reporting-summary-row {
  margin-top: 8px;
  margin-bottom: 8px;
}

#view-reporting .reporting-th-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#view-reporting .reporting-th-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: help;
}

#view-reporting .lift-level-pill,
#view-planning .lift-level-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
}

#view-reporting .lift-level-pill-high,
#view-planning .lift-level-pill-high {
  background: rgba(220, 53, 69, 0.2);
  color: #ff8a95;
  border: 1px solid rgba(220, 53, 69, 0.4);
}

#view-reporting .lift-level-pill-moderate,
#view-planning .lift-level-pill-moderate {
  background: rgba(255, 193, 7, 0.2);
  color: #ffd760;
  border: 1px solid rgba(255, 193, 7, 0.4);
}

#view-reporting .lift-level-pill-low,
#view-planning .lift-level-pill-low {
  background: rgba(40, 167, 69, 0.2);
  color: #89dd9f;
  border: 1px solid rgba(40, 167, 69, 0.4);
}

#view-reporting .lift-trend-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
}

#view-reporting .lift-trend-pill-up {
  background: rgba(220, 53, 69, 0.16);
  color: #ff9099;
  border: 1px solid rgba(220, 53, 69, 0.34);
}

#view-reporting .lift-trend-pill-down {
  background: rgba(40, 167, 69, 0.18);
  color: #93e3a7;
  border: 1px solid rgba(40, 167, 69, 0.36);
}

#view-reporting .lift-trend-pill-stable {
  background: rgba(255, 193, 7, 0.18);
  color: #ffd96e;
  border: 1px solid rgba(255, 193, 7, 0.34);
}

#view-reporting .lift-per-revenue-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
}

#view-reporting .lift-per-revenue-pill-high {
  background: rgba(220, 53, 69, 0.16);
  color: #ff9099;
  border: 1px solid rgba(220, 53, 69, 0.34);
}

#view-reporting .lift-per-revenue-pill-moderate {
  background: rgba(255, 193, 7, 0.18);
  color: #ffd96e;
  border: 1px solid rgba(255, 193, 7, 0.34);
}

#view-reporting .lift-per-revenue-pill-low {
  background: rgba(40, 167, 69, 0.18);
  color: #93e3a7;
  border: 1px solid rgba(40, 167, 69, 0.36);
}

#view-reporting .lift-per-revenue-pill-na {
  background: var(--border);
  color: var(--text-dim);
  border: 1px solid rgba(255, 255, 255, 0.24);
}

#view-reporting .reporting-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

#view-reporting .billing-kpis {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 4px 0 14px;
}

#view-reporting .kpi-card,
#view-planning .kpi-card {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border2);
}

#view-reporting .kpi-label,
#view-planning .kpi-label {
  font-size: 12px;
  color: var(--muted);
}

#view-reporting .kpi-value,
#view-planning .kpi-value {
  margin-top: 6px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

#view-reporting .kpi-change {
  margin-top: 6px;
  font-size: 12px;
}

#view-reporting .projected-pill {
  display: inline-block;
  margin-top: 5px;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: rgba(120, 170, 255, 0.12);
  color: rgba(180, 210, 255, 0.8);
  border: 1px solid rgba(120, 170, 255, 0.2);
}

#view-reporting .kpi-change.up {
  color: #93e3a7;
}

#view-reporting .kpi-change.down {
  color: #ff9099;
}

#view-reporting .reporting-charts {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

#view-reporting .chart-card {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border2);
}

#view-reporting .chart-card-wide {
  grid-column: 1 / -1;
}

#view-reporting .chart-title {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 8px;
}

#view-reporting .bar-chart {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#view-reporting .bar-row {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: 10px;
  align-items: center;
}

#view-reporting .bar-label {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#view-reporting .bar-track {
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--border-subtle);
  overflow: hidden;
}

#view-reporting .bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: rgba(167, 139, 250, 0.7);
}

#view-reporting .bar-value {
  font-size: 12px;
  color: #fff;
  white-space: nowrap;
}

#view-reporting .task-creation-chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#view-reporting .billing-type-line-chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#view-reporting .reporting-line-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

#view-reporting .reporting-line-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

#view-reporting .reporting-line-legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: var(--radius-pill);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22) inset;
}

#view-reporting .reporting-line-wrap {
  width: 100%;
  overflow-x: auto;
}

#view-reporting .reporting-line-svg {
  width: 100%;
  min-width: 640px;
  height: 260px;
  display: block;
}

#view-reporting .reporting-line-grid {
  stroke: var(--border-emphasis);
  stroke-width: 1;
}

#view-reporting .reporting-line-axis-label {
  fill: rgba(255, 255, 255, 0.68);
  font-size: 11px;
}

#view-reporting .task-creation-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  max-height: 96px;
  overflow-y: auto;
  padding-right: 4px;
}

#view-reporting .task-creation-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

#view-reporting .task-creation-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex: 0 0 auto;
}

#view-reporting .task-creation-legend-name {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

#view-reporting .task-creation-plot-wrap {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 8px;
  align-items: end;
}

#view-reporting .task-creation-y-axis {
  height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-bottom: 30px;
}

#view-reporting .task-creation-y-tick {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
}

#view-reporting .task-creation-bars-wrap {
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 8px;
}

#view-reporting .task-creation-bars {
  --task-creation-label-height: 18px;
  --task-creation-col-gap: 4px;
  --task-creation-plot-height: 220px;
  min-width: 560px;
  height: calc(
    var(--task-creation-plot-height) +
    var(--task-creation-col-gap) +
    var(--task-creation-label-height)
  );
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(20px, 1fr);
  gap: 8px;
  align-items: stretch;
  position: relative;
  border-left: 1px solid var(--border-strong);
  border-bottom: none;
  padding: 6px 8px 0;
}

#view-reporting .task-creation-bars::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: var(
    --task-creation-axis-bottom,
    calc(var(--task-creation-label-height) + var(--task-creation-col-gap))
  );
  border-bottom: 1px solid var(--border-strong);
  pointer-events: none;
  z-index: 0;
}

#view-reporting .task-creation-bar-col {
  height: 100%;
  display: grid;
  grid-template-rows: var(--task-creation-plot-height) var(--task-creation-label-height);
  row-gap: var(--task-creation-col-gap);
  align-self: stretch;
  position: relative;
  z-index: 1;
}

#view-reporting .task-creation-bar-track {
  height: var(--task-creation-plot-height);
  display: flex;
  align-items: flex-end;
  position: relative;
}

#view-reporting .task-creation-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  min-height: 0;
  border-radius: 4px 4px 0 0;
  overflow: hidden;
  display: flex;
  flex-direction: column-reverse;
  background: var(--border-subtle);
  cursor: pointer;
}

#view-reporting .task-creation-segment {
  width: 100%;
}

#view-reporting .task-creation-bar-label {
  min-height: var(--task-creation-label-height);
  text-align: center;
  color: var(--text-dim);
  font-size: 11px;
  line-height: 1.1;
}

#view-reporting .task-creation-bar-label.muted {
  color: var(--text-faint);
}

#view-reporting .task-creation-tooltip {
  position: fixed;
  z-index: 3000;
  pointer-events: none;
  min-width: 180px;
  max-width: 280px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-active);
  background: rgba(18, 18, 18, 0.96);
  color: #fff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 80ms ease, transform 80ms ease;
}

#view-reporting .task-creation-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

#view-reporting .task-creation-tooltip-title {
  font-size: 12px;
  font-weight: 600;
}

#view-reporting .task-creation-tooltip-total {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-secondary);
}

#view-reporting .task-creation-tooltip-breakdown {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  color: var(--text-dim);
}

@media (max-width: 1000px) {
  #view-reporting .reporting-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #view-reporting .billing-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #view-reporting .reporting-charts {
    grid-template-columns: 1fr;
  }
}

/* Client details modal date picker — force dark calendar */
#client-details-modal input[type="date"] {
  color-scheme: dark;
}

#client-details-modal input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0;
  cursor: pointer;
}

#client-details-modal input[type="date"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
  padding-right: 36px;
}

#engagement-modal.editing input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0;
  cursor: pointer;
}

#engagement-modal.editing input[type="date"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
  padding-right: 36px;
}

/* Client activity row */
#view-clients .client-activity-row h3 {
  margin: 0;
}

#client-manage-repeating-btn {
  white-space: nowrap;
}

.client-task-repeating-section {
  margin-top: 14px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 12px;
  background: var(--bg-subtle);
}

.client-task-repeating-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.client-task-repeating-header h4 {
  margin: 0;
  font-size: 14px;
}

.client-task-repeating-header p {
  margin: 0;
  font-size: 12px;
}

.client-task-repeating-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.client-repeating-create-cta {
  display: flex;
  justify-content: flex-start;
}

.client-repeating-template-row--create {
  border-color: rgba(96, 204, 172, 0.32);
  background: rgba(96, 204, 172, 0.08);
}

.client-repeating-template-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(120, 140, 255, 0.25);
  background: rgba(120, 140, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

.client-repeating-template-main h5 {
  margin: 0 0 4px;
  font-size: 14px;
}

.client-repeating-template-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 12px;
  color: var(--text-dim);
}

.client-repeating-template-status {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-pill);
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
}

.client-repeating-template-status.is-active {
  background: rgba(39, 200, 135, 0.22);
  color: #a9ffd9;
}

.client-repeating-template-status.is-paused {
  background: rgba(255, 190, 65, 0.2);
  color: #ffd99a;
}

.client-repeating-template-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.client-repeating-inline-editor {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  margin-top: 8px;
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.client-repeating-inline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.client-repeating-inline-grid label,
.client-repeating-inline-group label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}

.client-repeating-inline-groups {
  display: grid;
  gap: 8px;
}

.client-repeating-inline-group {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px;
  background: var(--surface-2);
}

.client-repeating-inline-toggle {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
}

.client-repeating-inline-weekdays {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.client-repeating-inline-weekdays label {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
}

.client-repeating-inline-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 900px) {
  .client-repeating-template-row {
    grid-template-columns: 1fr;
  }

  .client-repeating-template-actions {
    justify-content: flex-start;
  }
}

.client-recurring-templates {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 6px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-strong);
}

.client-recurring-templates-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.client-recurring-templates-header h4 {
  margin: 0;
  font-size: 13px;
}

.client-recurring-templates-header small {
  font-size: 11px;
  color: var(--muted);
}

.client-recurring-templates-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
  min-width: 220px;
}

.recurring-template-card {
  background: rgba(120, 140, 255, 0.12);
  border: 1px solid rgba(120, 140, 255, 0.3);
  color: #ffffff;
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
  white-space: nowrap;
}

.recurring-template-card:hover {
  border-color: rgba(120, 140, 255, 0.7);
  background: rgba(120, 140, 255, 0.2);
}

.recurring-template-card-title {
  font-weight: 600;
}

.recurring-template-card-details {
  font-size: 11px;
  color: var(--muted);
}

.client-recurring-templates-modal {
  position: fixed;
  inset: 0;
  z-index: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.client-recurring-templates-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(6px);
}

.client-recurring-templates-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(600px, 100%);
  max-width: 640px;
  background: rgba(16, 16, 16, 0.95);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.client-recurring-templates-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.client-recurring-templates-modal__header h3 {
  margin: 0;
  font-size: 16px;
}

.client-recurring-templates-modal__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.client-recurring-templates-modal__close {
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}

.client-recurring-templates-modal__close:hover {
  border-color: rgba(255, 255, 255, 0.6);
  background: var(--border2);
}

#task-dialog.recurrence-template-mode .task-modal-section--details .status-field,
#task-dialog.recurrence-template-mode .task-modal-section--details .due-date-field,
#task-dialog.recurrence-template-mode .task-modal-section--details .priority-field,
#task-dialog.recurrence-template-mode #edit-status,
#task-dialog.recurrence-template-mode label[for="edit-status"] {
  display: none !important;
}

#view-clients .client-time-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

#view-clients .client-time-header h3 {
  margin: 0;
}

#view-clients .client-activity-meta {
  margin-top: 4px;
  font-size: 12px;
}

#view-clients .client-activity-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

#view-clients .client-activity-filters .btn {
  padding: 6px 10px;
  font-size: 12px;
  height: 28px;
}

#view-clients .client-activity-filters .btn.active {
  background: rgba(167, 139, 250, 0.18);
  border-color: rgba(167, 139, 250, 0.6);
  color: #fff;
}

#view-clients .client-activity-chart {
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border2);
  min-height: 120px;
}

#view-clients .client-activity-chart svg {
  width: 100%;
  height: 220px;
}

#view-clients .activity-bar {
  fill: rgba(167, 139, 250, 0.7);
}

#view-clients .activity-grid {
  stroke: var(--border-subtle);
  stroke-width: 1;
}

#view-clients .activity-label {
  fill: rgba(255, 255, 255, 0.6);
  font-size: 10px;
}

#view-clients .activity-y-label {
  fill: rgba(255, 255, 255, 0.5);
  font-size: 10px;
}

#view-clients .activity-bar-label {
  fill: rgba(255, 255, 255, 0.75);
  font-size: 10px;
}

/* Client health */
#view-clients .client-health-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

#view-clients .client-health-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#view-clients .client-health-picker {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

#view-clients .client-health-picker select {
  height: 28px;
  padding: 0 8px;
  min-width: 180px;
  font-size: 13px;
}

#view-clients .engagements-row-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

#view-clients .engagements-row-header-left {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

#view-clients .opportunities-row-header,
#view-sales .opportunities-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

#view-clients .engagement-tabs {
  margin: 0;
}

#view-clients .client-engagements-summary,
#view-clients .client-opportunities-summary,
#view-sales .client-opportunities-summary,
#view-sales .client-engagements-summary {
  display: grid;
  gap: 6px;
}

#view-clients .client-engagements-summary .engagement-header,
#view-clients .client-opportunities-summary .engagement-header,
#view-clients .client-engagements-summary .engagement-row,
#view-clients .client-opportunities-summary .engagement-row,
#view-sales .client-engagements-summary .engagement-header,
#view-sales .client-opportunities-summary .engagement-header,
#view-sales .client-engagements-summary .engagement-row,
#view-sales .client-opportunities-summary .engagement-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
}

#view-clients .client-engagements-summary .engagement-header,
#view-clients .client-opportunities-summary .engagement-header,
#view-sales .client-engagements-summary .engagement-header,
#view-sales .client-opportunities-summary .engagement-header {
  padding: 0 0 8px 0;
  border-bottom: none;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-faint);
}

#view-clients .client-engagements-summary .engagement-grid,
#view-sales .client-engagements-summary .engagement-grid {
  display: grid;
  grid-template-columns: 2.2fr 1fr 1.1fr 1.2fr 1fr 1fr 84px;
  gap: 12px;
  width: 100%;
  align-items: center;
}

#view-clients .client-opportunities-summary .engagement-grid,
#view-sales .client-opportunities-summary .engagement-grid {
  display: grid;
  grid-template-columns: 2.2fr 1fr 1.1fr 1.2fr 1fr 84px;
  gap: 12px;
  width: 100%;
  align-items: center;
}

#view-clients .client-engagements-summary .engagement-grid.no-actions,
#view-sales .client-engagements-summary .engagement-grid.no-actions {
  grid-template-columns: 2.2fr 1fr 1.1fr 1.2fr 1fr 1fr;
}

#view-clients .client-opportunities-summary .engagement-grid.no-actions,
#view-sales .client-opportunities-summary .engagement-grid.no-actions {
  grid-template-columns: 2.2fr 1fr 1.1fr 1.2fr 1fr;
}

#view-clients .client-engagements-summary .engagement-grid .engagement-cell:nth-child(2),
#view-clients .client-opportunities-summary .engagement-grid .engagement-cell:nth-child(2),
#view-clients .client-engagements-summary .engagement-grid .engagement-cell:nth-child(3),
#view-clients .client-opportunities-summary .engagement-grid .engagement-cell:nth-child(3),
#view-clients .client-engagements-summary .engagement-grid .engagement-cell:nth-child(4),
#view-clients .client-opportunities-summary .engagement-grid .engagement-cell:nth-child(4),
#view-clients .client-engagements-summary .engagement-grid .engagement-cell:nth-child(5),
#view-clients .client-opportunities-summary .engagement-grid .engagement-cell:nth-child(5),
#view-clients .client-engagements-summary .engagement-grid .engagement-cell:nth-child(6),
#view-clients .client-opportunities-summary .engagement-grid .engagement-cell:nth-child(6),
#view-sales .client-engagements-summary .engagement-grid .engagement-cell:nth-child(2),
#view-sales .client-opportunities-summary .engagement-grid .engagement-cell:nth-child(2),
#view-sales .client-engagements-summary .engagement-grid .engagement-cell:nth-child(3),
#view-sales .client-opportunities-summary .engagement-grid .engagement-cell:nth-child(3),
#view-sales .client-engagements-summary .engagement-grid .engagement-cell:nth-child(4),
#view-sales .client-opportunities-summary .engagement-grid .engagement-cell:nth-child(4),
#view-sales .client-engagements-summary .engagement-grid .engagement-cell:nth-child(5),
#view-sales .client-opportunities-summary .engagement-grid .engagement-cell:nth-child(5),
#view-sales .client-engagements-summary .engagement-grid .engagement-cell:nth-child(6),
#view-sales .client-opportunities-summary .engagement-grid .engagement-cell:nth-child(6) {
  text-align: center;
}

#view-clients .client-engagements-summary .engagement-grid .engagement-cell:nth-child(2),
#view-clients .client-opportunities-summary .engagement-grid .engagement-cell:nth-child(2),
#view-sales .client-engagements-summary .engagement-grid .engagement-cell:nth-child(2),
#view-sales .client-opportunities-summary .engagement-grid .engagement-cell:nth-child(2) {
  overflow: visible;
}

#view-clients .client-engagements-summary .engagement-row,
#view-clients .client-opportunities-summary .engagement-row,
#view-sales .client-engagements-summary .engagement-row,
#view-sales .client-opportunities-summary .engagement-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--border2);
}

#view-clients .client-engagements-summary .engagement-row:last-child,
#view-clients .client-opportunities-summary .engagement-row:last-child,
#view-sales .client-engagements-summary .engagement-row:last-child,
#view-sales .client-opportunities-summary .engagement-row:last-child {
  border-bottom: none;
}

#view-clients .client-engagements-summary .engagement-actions,
#view-clients .client-opportunities-summary .engagement-actions,
#view-sales .client-engagements-summary .engagement-actions,
#view-sales .client-opportunities-summary .engagement-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

#view-clients .client-engagements-summary .engagement-cell,
#view-clients .client-opportunities-summary .engagement-cell,
#view-sales .client-engagements-summary .engagement-cell,
#view-sales .client-opportunities-summary .engagement-cell {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#view-clients .client-engagements-summary .engagement-name,
#view-clients .client-opportunities-summary .engagement-name,
#view-sales .client-engagements-summary .engagement-name,
#view-sales .client-opportunities-summary .engagement-name {
  font-weight: 600;
  color: #fff;
}

#view-clients .client-engagements-summary .engagement-status,
#view-clients .client-opportunities-summary .engagement-status,
#view-sales .client-engagements-summary .engagement-status,
#view-sales .client-opportunities-summary .engagement-status {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

#view-clients .client-engagements-summary .status-pill,
#view-clients .client-opportunities-summary .status-pill,
#view-sales .client-engagements-summary .status-pill,
#view-sales .client-opportunities-summary .status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  line-height: 1;
}

#view-clients .client-engagements-summary .status-active,
#view-sales .client-engagements-summary .status-active {
  background: rgba(34, 197, 94, 0.18);
  border: 1px solid rgba(34, 197, 94, 0.6);
  color: rgba(34, 197, 94, 0.95);
}

#view-clients .client-engagements-summary .status-completed,
#view-sales .client-engagements-summary .status-completed {
  background: rgba(167, 139, 250, 0.18);
  border: 1px solid rgba(167, 139, 250, 0.8);
  color: rgba(198, 214, 255, 0.95);
}

#view-clients .client-engagements-summary .status-ending,
#view-sales .client-engagements-summary .status-ending {
  background: rgba(251, 191, 36, 0.18);
  border: 1px solid rgba(251, 191, 36, 0.8);
  color: rgba(251, 191, 36, 0.95);
}

#view-clients .client-engagements-summary .status-not-started,
#view-sales .client-engagements-summary .status-not-started {
  background: rgba(59, 130, 246, 0.18);
  border: 1px solid rgba(59, 130, 246, 0.8);
  color: rgba(59, 130, 246, 0.95);
}

#view-clients .client-engagements-summary .status-not-active,
#view-sales .client-engagements-summary .status-not-active {
  background: rgba(107, 114, 128, 0.18);
  border: 1px solid rgba(107, 114, 128, 0.8);
  color: rgba(107, 114, 128, 0.95);
}

#view-clients .client-engagements-summary .status-not-started,
#view-sales .client-engagements-summary .status-not-started {
  background: rgba(59, 130, 246, 0.18);
  border: 1px solid rgba(59, 130, 246, 0.8);
  color: rgba(59, 130, 246, 0.95);
}

#view-clients .client-opportunities-summary .status-open,
#view-sales .client-opportunities-summary .status-open {
  background: rgba(34, 197, 94, 0.18);
  border: 1px solid rgba(34, 197, 94, 0.6);
  color: rgba(34, 197, 94, 0.95);
}

#view-clients .client-opportunities-summary .status-closed-won,
#view-sales .client-opportunities-summary .status-closed-won {
  background: rgba(56, 189, 248, 0.2);
  border: 1px solid rgba(56, 189, 248, 0.8);
  color: rgba(191, 243, 255, 0.95);
}

#view-clients .client-opportunities-summary .status-closed-lost,
#view-sales .client-opportunities-summary .status-closed-lost {
  background: rgba(248, 113, 113, 0.2);
  border: 1px solid rgba(248, 113, 113, 0.7);
  color: rgba(254, 226, 226, 0.95);
}

#client-details-modal .engagements-section {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

#client-details-modal .engagements-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

#client-details-modal .engagements-list {
  display: grid;
  gap: 8px;
}

#client-details-modal .engagement-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border2);
}

#client-details-modal .engagement-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#client-details-modal .engagement-title {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

#client-details-modal .engagement-sub {
  font-size: 11px;
  color: var(--text-faint);
}

#client-details-modal .engagement-actions {
  display: flex;
  gap: 6px;
}

#client-details-modal .engagement-editor {
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border-subtle);
}

#client-details-modal .engagement-editor .formgrid {
  margin-bottom: 10px;
}

#view-clients #timer-engagement-select,
#view-reporting #timer-engagement-select,
#timer-engagement-select {
  min-width: 200px;
}

#view-clients .client-select-row,
#view-sales .client-select-row,
#view-inbox .client-select-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-end;
}

#view-clients .client-select-controls,
#view-sales .client-select-controls,
#view-companies .client-select-controls,
#view-inbox .client-select-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  min-width: 200px;
  justify-self: end;
}

#view-clients .client-select-controls label,
#view-sales .client-select-controls label,
#view-companies .client-select-controls label,
#view-inbox .client-select-controls label {
  margin: 0;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.client-select-inline-label {
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.75;
  white-space: nowrap;
}

#view-clients .client-select-actions,
#view-sales .client-select-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.client-select-actions .btn {
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#view-clients .client-header-main,
#view-sales .client-header-main,
#view-reporting .client-header-main,
#view-planning .client-header-main,
#view-companies .client-header-main,
#view-inbox .client-header-main {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  width: 100%;
}

#view-clients .client-header-main h2,
#view-sales .client-header-main h2,
#view-reporting .client-header-main h2,
#view-planning .client-header-main h2,
#view-companies .client-header-main h2,
#view-inbox .client-header-main h2 {
  margin: 0;
  flex-shrink: 0;
  font-size: 1.75em;
  font-weight: 800;
  letter-spacing: -0.01em;
}

#view-companies .client-header-main h2 {
  margin-bottom: 15px;
}

#view-clients .client-header-actions,
#view-sales .client-header-actions,
#view-companies .client-header-actions,
#view-inbox .client-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-self: end;
}

#view-inbox .client-select-controls {
  display: grid;
  grid-template-columns:
    minmax(220px, 1.5fr)
    minmax(160px, 1fr)
    minmax(180px, 1fr)
    minmax(140px, 0.8fr)
    minmax(140px, 0.8fr);
  gap: 10px;
  align-items: end;
  width: 100%;
  min-width: 0;
}

#view-inbox .client-select-controls label {
  min-width: 0;
  width: 100%;
  justify-content: stretch;
  align-items: center;
  gap: 8px;
}

#view-inbox .client-select-controls .inbox-date-filter {
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}

#view-inbox .client-select-controls .inbox-date-filter .input-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.9;
}

#view-inbox .client-header-actions {
  align-self: end;
}

#view-inbox .client-select-controls input,
#view-inbox .client-select-controls select {
  width: 100%;
  min-width: 0;
}

@media (max-width: 1300px) {
  #view-inbox .client-header-main {
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: stretch;
  }

  #view-inbox .client-header-actions {
    justify-self: start;
  }

  #view-inbox .client-select-controls {
    grid-template-columns: minmax(220px, 1fr) minmax(180px, 1fr) minmax(160px, 1fr);
  }
}

@media (max-width: 900px) {
  #view-inbox .client-select-controls {
    grid-template-columns: 1fr;
  }
}


#view-clients .client-health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

#view-clients .health-card {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border2);
}

#view-clients .health-label {
  font-size: 12px;
  color: var(--muted);
}

#view-clients .health-value {
  margin-top: 6px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

#view-clients .health-sub {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-faint);
}

#view-clients .health-bar {
  margin-top: 10px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--border-subtle);
  overflow: hidden;
}

#view-clients .health-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: var(--radius-pill);
  background: rgba(167, 139, 250, 0.6);
  transition: width 0.2s ease;
}

#view-clients .health-bar-fill.good {
  background: rgba(130, 220, 170, 0.8);
}

#view-clients .health-bar-fill.warn {
  background: rgba(245, 196, 81, 0.85);
}

#view-clients .health-bar-fill.risk {
  background: rgba(255, 120, 120, 0.85);
}

#view-clients .health-bar-fill.neutral {
  background: rgba(255, 255, 255, 0.2);
}

#view-clients .client-health-engagements-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

#view-clients .engagement-health-card .health-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

#view-clients .engagement-health-card .health-label span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
}

#view-clients .engagement-health-card .health-value {
  font-size: 15px;
}

#view-clients .engagement-health-card .health-sub + .health-sub {
  margin-top: 4px;
}

#view-clients .engagement-health-card.compact {
  padding: 10px 12px;
}

#view-clients .engagement-health-card.compact .health-value {
  font-size: 14px;
}

#view-clients .engagement-health-card.project-fee .health-value {
  font-size: 18px;
}

@media (max-width: 900px) {
  #view-clients .client-health-grid {
    grid-template-columns: 1fr;
  }

  #view-clients .client-health-engagements-grid {
    grid-template-columns: 1fr;
  }
}

/* Client tab sub-navigation */
#view-clients .client-subtabs,
#view-sales .client-subtabs {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  width: auto;
  align-self: flex-start;
  margin: 0;
  flex-wrap: wrap;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

#view-clients .client-subtabs .btn,
#view-sales .client-subtabs .btn {
  padding: 6px 12px;
  font-size: 12px;
  height: 28px;
}

#view-clients .client-subtabs .btn.active,
#view-sales .client-subtabs .btn.active {
  background: rgba(167, 139, 250, 0.18);
  border-color: rgba(167, 139, 250, 0.6);
  color: #fff;
}

#view-clients .client-header-sticky,
#view-sales .client-header-sticky,
#view-companies .client-header-sticky,
#view-planning .client-header-sticky,
#view-inbox .client-header-sticky {
  display: flex;
  flex-direction: column;
  margin: 0;
  background: var(--panel);
  border-radius: 0;
  box-shadow: none;
}

#view-clients .client-header-sticky,
#view-companies .client-header-sticky,
#view-planning .client-header-sticky,
#view-inbox .client-header-sticky {
  position: sticky;
  top: -18px;
  z-index: 1001;
}

#view-reporting .reporting-header,
#view-planning .reporting-header,
#view-settings .client-header-row {
  background: var(--header-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--header-border);
  box-shadow: 0 2px 10px -6px rgba(0, 0, 0, 0.7);
}

#view-clients .client-header-sticky.is-stuck ~ .client-tab-panel,
#view-sales .client-header-sticky.is-stuck ~ .client-tab-panel,
#view-companies .client-header-sticky.is-stuck ~ .client-tab-panel {
  padding-top: var(--client-header-height, 0);
}

#view-clients .client-header-row,
#view-sales .client-header-row,
#view-companies .client-header-row {
  gap: 16px;
}

#view-clients .client-header-row .client-subtabs,
#view-sales .client-header-row .client-subtabs,
#view-companies .client-header-row .client-subtabs {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin: 0;
  box-shadow: none;
}

#view-clients .client-tab-panel,
#view-sales .client-tab-panel,
#view-companies .client-tab-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

#view-settings .client-tab-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 0;
}

#view-clients .client-time-controls {
  flex-wrap: wrap;
  margin: 6px 0 10px;
}

#view-clients .client-time-controls .range-buttons {
  flex-wrap: wrap;
}

#view-clients .reporting-detail-list {
  padding: 8px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#view-clients .reporting-detail-header {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 6px 12px 2px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

#view-clients .reporting-detail-header span:last-child {
  text-align: right;
  padding-right: 6px;
}

#view-clients .reporting-detail-row {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.035),
    var(--bg-subtle)
  );
  border: 1px solid var(--border2);
  color: var(--text-secondary);
  width: 100%;
}

#view-clients .reporting-detail-row:hover {
  background: var(--border2);
  border-color: rgba(140, 170, 255, 0.35);
}

#view-clients .reporting-detail-row .date {
  font-variant-numeric: tabular-nums;
  opacity: 0.85;
}

#view-clients .reporting-detail-row .time {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  font-weight: 600;
  color: var(--text);
}

#view-clients .reporting-detail-row .time-value {
  display: inline-block;
}

#view-clients .reporting-detail-row .actions {
  display: flex;
  gap: 6px;
}

#view-clients .reporting-detail-row .iconbtn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  color: var(--text);
}

#view-clients .reporting-detail-row .iconbtn:hover {
  background: var(--border);
  border-color: rgba(140, 170, 255, 0.4);
}

#view-clients .client-time-empty {
  padding: 8px 12px;
}

#view-clients .client-time-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 6px 0 8px;
}

#view-clients .client-time-pagination .btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

#view-clients .client-time-pagination #client-time-page-info {
  color: var(--muted-text, var(--muted));
  font-weight: 500;
  letter-spacing: 0.01em;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0;
  line-height: 32px;
  margin: 0;
}

@media (max-width: 900px) {
  #view-clients .reporting-detail-header {
    grid-template-columns: 120px 1fr auto;
  }

  #view-clients .reporting-detail-row {
    grid-template-columns: 120px 1fr auto;
  }
}
/* Currency input prefix */
.currency-field {
  position: relative;
}

.currency-field input {
  padding-left: 28px;
}

.currency-field::before {
  content: "$";
  position: absolute;
  left: 12px;
  bottom: 12px;
  color: var(--muted);
  font-size: 13px;
  pointer-events: none;
}

/* Force Clients view to full-width single column */
#view-clients .clients-layout {
  display: flex !important;
  flex-direction: row;
  align-items: stretch;
  gap: 0;
  width: 100%;
  height: calc(100vh - var(--topbar-height) - 36px);
  overflow: hidden;
  padding: 0;
}

/* Left: client list panel */
.client-list-panel {
  width: 190px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border2);
  overflow: hidden;
  background: var(--bg);
}

.client-list-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 10px;
  flex-shrink: 0;
}

.client-list-panel-header h2 {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0;
}

.client-list-search-wrap {
  padding: 0 10px 8px;
  flex-shrink: 0;
}

.client-list-search {
  width: 100%;
  padding: 6px 10px;
  font-size: var(--text-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  outline: none;
}

.client-list-search:focus {
  border-color: var(--accent);
}

.client-list-items {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 2px 6px 12px;
}

.client-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text);
  font-size: var(--text-sm);
  text-align: left;
  cursor: pointer;
  gap: 8px;
  line-height: 1.3;
}

.client-list-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.client-list-item.active {
  background: rgba(167, 139, 250, 0.12);
  color: var(--accent);
}

.client-list-name {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-list-task-count {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  background: rgba(167, 139, 250, 0.15);
  color: var(--accent);
  border-radius: 10px;
  padding: 1px 7px;
  min-width: 20px;
  text-align: center;
}

.client-list-empty {
  padding: 12px 10px;
  font-size: var(--text-sm);
}

/* Right: client detail area — fixed height flex column, clips overflow */
.client-detail-area {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

/* Header stays pinned at top — never scrolls away */
#view-clients .client-header-sticky {
  flex-shrink: 0;
  position: static;
  z-index: 1001;
  background: var(--bg);
  padding: 14px 20px 0;
}

/* Tab panel is the scroll container — fills remaining height */
#view-clients .client-tab-panel {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 0 20px 20px;
}

#view-clients .client-tab-panel > * {
  flex-shrink: 0;
}

/* Sales view: master-detail layout matching clients */
#view-sales .clients-layout {
  display: flex !important;
  flex-direction: row;
  gap: 0;
  width: 100%;
  height: calc(100vh - var(--topbar-height) - 36px);
  overflow: hidden;
  padding: 0;
}

#view-sales .client-header-sticky {
  flex-shrink: 0;
  position: static;
  z-index: 1001;
  background: var(--bg);
  padding: 14px 20px 0;
}

#view-sales .client-tab-panel {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
  padding: 0 20px 20px;
}

#view-sales .client-tab-panel > * {
  flex-shrink: 0;
}

/* Force Companies view to mirror the Active Clients layout */
#view-companies .clients-layout {
  display: flex !important;
  flex-direction: column;
  gap: 18px;
  width: 100%;
}

#view-companies .clients-layout > * {
  width: 100%;
}

/* Additional helpers for HTML/JS classes */
.auto-priority:not(.today-task-row):not(.today-spotlight-card) {
  border-left: 3px solid var(--accent);
  background: rgba(167, 139, 250, 0.08);
}

.client-task-tab,
.companies-sort,
  .calendar-link-client-btn,
  .scheduling-refresh-btn,
  .smart-scheduler-trigger,
  .floating-timer-mini-new-task,
  .floating-timer-new-task {
  border-radius: 14px;
  border: 1px solid var(--border-emphasis);
  background: var(--surface-subtle);
  color: var(--text-primary);
  padding: 6px 14px;
  font-size: 0.85rem;
  text-transform: none;
}

.client-task-tab.active,
.selected {
  border-color: rgba(167, 139, 250, 0.6);
  background: rgba(167, 139, 250, 0.18);
}

.smart-scheduler-trigger {
  box-shadow: 0 0 20px rgba(230, 201, 111, 0.35);
}

#view-companies .companies-search {
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.bookmarks-card,
.bookmark-row,
.detail-bookmarks-modal,
.detail-bookmarks-modal-body,
.detail-bookmark-modal-form,
.detail-bookmark-modal-search,
.detail-bookmark-inputs,
.detail-bookmark-form-actions {
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  padding: 12px;
}

.bookmarks-card {
  overflow-y: auto;
}
.bookmarks-card__notes {
  margin-top: 12px;
}
.notes-bookmarks-columns {
  display: grid;
  gap: 18px;
  align-items: stretch;
  min-height: 0;
  width: 100%;
}

.notes-bookmarks-columns--grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.notes-bookmarks-column {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.notes-bookmarks-column--left {
  grid-column: 1;
}
.notes-bookmarks-column--right {
  grid-column: 2;
}
.notes-bookmarks-column--right .task-modal-section--notes {
  margin-top: 0;
}

@media (max-width: 1100px) {
  .notes-bookmarks-columns--grid {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.9fr);
  }
}

@media (max-width: 900px) {
  .notes-bookmarks-columns--grid {
    grid-template-columns: 1fr;
  }
}


.detail-bookmarks-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.detail-bookmark-icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  flex-shrink: 0;
}

.detail-bookmark-icon img {
  width: 16px;
  height: 16px;
  max-width: 100%;
  max-height: 100%;
  border-radius: 4px;
  background: var(--border-subtle);
  object-fit: cover;
  display: block;
}

.detail-bookmark-icon img[data-fallback-icon="true"] {
  filter: grayscale(0.24);
  opacity: 0.85;
}

.detail-section-header {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
  margin-bottom: 10px;
  width: 100%;
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
}

.detail-section-header h3 {
  min-width: 0;
  margin: 0;
  flex: 1 1 auto;
}

.detail-section-bookmarks {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
  margin-bottom: 16px;
  width: 100%;
}

.detail-bookmarks-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.calendar-date-modal {
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: linear-gradient(180deg, rgba(18, 18, 18, 0.96), rgba(10, 10, 10, 0.98));
  box-shadow: 0 30px 110px rgba(0, 0, 0, 0.75);
  padding: 32px;
}

.calendar-header-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.calendar-date-modal .btn,
.calendar-link-client-btn {
  align-self: center;
}

.calendar-date-modal .modal-actions {
  justify-content: flex-end;
}

.client-engagements-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.client-engagements-row .engagements-row-header {
  width: 100%;
}

.due-date-field__scheduler {
  margin-top: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  padding: 12px 14px;
  background: var(--surface-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.quick-intake-smart-scheduler-row .smart-scheduler-summary-text {
  display: none;
}

.fathom-unassigned-header,
.fathom-meeting-date {
  font-weight: 600;
  color: var(--text-primary);
}

.fathom-meeting-bookmark-select {
  width: 100%;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 8px;
  color: var(--text-primary);
}

.floating-timer-task-select {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-emphasis);
  background: var(--surface-subtle);
  color: var(--text-primary);
  padding: 10px;
}

.focus-block-dialog {
  border-radius: var(--radius-xl);
  padding: 0;
  background: transparent;
}

.focus-block-card {
  background: linear-gradient(
    180deg,
    rgba(18, 18, 18, 0.96),
    rgba(10, 10, 10, 0.98)
  );
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 0;
  width: min(960px, 92vw);
  max-height: 92vh;
  box-shadow: 0 30px 110px rgba(0, 0, 0, 0.75);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.focus-block-header,
.focus-block-actions {
  position: sticky;
  z-index: 1;
  background: transparent;
  padding: 24px;
}

.focus-block-header {
  top: 0;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 32px;
}

.focus-block-actions {
  bottom: 0;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.focus-block-header h2 {
  margin: 0 0 8px;
}

.focus-block-body {
  padding: 24px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.focus-block-columns {
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.focus-block-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

.focus-block-description {
  margin: 0;
  color: var(--text-muted);
}

.focus-block-times {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.focus-block-times > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.focus-block-times strong {
  font-size: 1rem;
}

.focus-block-duration-field,
.focus-block-start-picker {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  padding: 12px;
  background: var(--bg-subtle);
}

.focus-block-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.focus-block-task-picker {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
}

.focus-block-task-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.focus-block-task-card {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border2);
  border-left: var(--priority-border-width) solid var(--priority-border-muted);
  background: var(--bg-subtle);
  color: var(--text-primary, #f5f7ff);
  transition: transform 0.15s ease, border-color 0.15s ease,
    box-shadow 0.2s ease, background 0.2s ease;
}

.focus-block-task-card:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.25);
}

.focus-block-task-card:focus-visible,
.focus-block-task-card:focus {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.focus-block-task-card.selected {
  border-left-color: var(--priority-accent);
  background: var(--priority-bg);
  box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.2);
}

.focus-block-task-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.focus-block-task-card-title {
  font-weight: 600;
  font-size: 1rem;
  margin: 0;
  color: inherit;
}

.focus-block-task-card-meta {
  margin-top: 4px;
  font-size: 12px;
  opacity: 0.7;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  color: var(--text-dim);
}

.focus-block-task-card-meta-chip {
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: var(--border-subtle);
  color: var(--text);
}

.focus-block-task-card-meta-single {
  padding: 6px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--border-subtle);
  color: var(--text);
}


.identity-panel,
.metadata-panel,
.intake-identity-panel,
.intake-metadata-panel {
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  padding: 14px;
  background: var(--bg-subtle);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.intake-availability-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  grid-column: 1 / -1;
}

.intake-availability-card {
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-subtle);
  padding: 14px;
  color: var(--text);
}

.intake-session-availability {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.intake-availability-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  grid-column: 1 / -1;
}

.intake-availability-text,
.intake-session-date,
.intake-session-duration,
.intake-session-slider-note,
.intake-session-start-note {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.intake-session-field,
.intake-session-slider-field,
.intake-session-start-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.intake-availability-text {
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
  grid-column: 1 / -1;
}
.intake-session-date-hint {
  width: 100%;
  text-align: left;
  align-self: flex-start;
  margin-top: 2px;
  display: inline-flex;
  align-items: center;
  height: 1.2rem;
  padding-top: 43px;
}

.intake-session-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.intake-session-slider-value-wrapper {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

.intake-session-slider-value {
  font-weight: 600;
}

.intake-session-slider-remaining {
  font-size: 0.75rem;
}

.intake-session-start-select,
.intake-session-start-field select,
.intake-session-slider-field input {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--text-primary);
  padding: 8px 10px;
}

.intake-session-summary-card {
  background: linear-gradient(
    180deg,
    rgba(18, 18, 18, 0.85),
    rgba(14, 14, 14, 0.85)
  );
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.intake-start-picker-hidden {
  display: none;
}

.link-edit {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  background: var(--bg-subtle);
}

.needs-panel,
.priority-panel,
.recent-panel,
.no-due-date-panel,
.no-due-date {
  background: var(--bg-subtle);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 14px;
}

.preview-schedule {
  border-radius: var(--radius-md);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  padding: 10px;
  background: rgba(255, 255, 255, 0.01);
}

.reporting-controls-dashboard {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.retainer-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
}

.schedule-warning {
  color: var(--danger);
  font-size: 0.85rem;
}

.scheduled-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  padding: 18px;
}

.scheduled-session-card__info,
.scheduled-session-card__actions,
.scheduled-session-card__meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.scheduling-card-header,
.smart-scheduler-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.scheduling-priority-plan {
  border-radius: 14px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.01);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.scheduling-priority-plan-title {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.scheduling-priority-plan-intro {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.4;
}

.scheduling-reauth-title,
.scheduling-reauth-message {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.smart-scheduler-views {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.task-modal-section--notes {
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  padding: 14px;
}

/* Calendar controls */
.calendar-day-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.calendar-day-controls > .calendar-day-pill + .calendar-day-pill {
  margin-left: 8px;
}

.calendar-day-pill,
button.calendar-day-pill,
button[data-calendar-day] {
  border: 1px solid var(--border-active);
  padding: 7px 14px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 500;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.2s ease;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: var(--radius-sm, 10px);
  box-shadow: inset 0 1px 0 var(--border);
}

.calendar-day-pill.active,
.calendar-day-pill:focus-visible,
button.calendar-day-pill.active,
button.calendar-day-pill:focus-visible,
button[data-calendar-day].active,
button[data-calendar-day]:focus-visible {
  border-color: rgba(167, 139, 250, 0.8);
  background: rgba(167, 139, 250, 0.18);
  color: #ffffff;
  box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.3) inset;
}

button[data-calendar-day].tertiary {
  background-color: var(--bg-subtle);
  border-color: var(--border-emphasis);
}

.calendar-date-popover {
  position: static;
  margin-top: 10px;
  width: min(300px, 100%);
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  display: block;
}

#calendar-date-input {
  width: 100%;
  min-height: 32px;
}

.client-followups-card,
.client-health-row,
.client-opportunities-row,
.client-time-row {
  border-radius: var(--radius-lg);
  border: 1px solid var(--header-border);
  background: var(--header-bg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.client-tasks {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.client-followups-card {
  gap: 16px;
}

.detail-bookmarks-modal-card {
  border-radius: 20px;
  padding: 18px;
  background: rgba(14, 14, 14, 0.95);
}

.due-date-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.due-date-field__controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.intake-modal .due-date-field__controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.intake-modal .due-date-field__controls--scheduler {
  align-items: stretch;
}

.intake-modal .due-date-field__controls input {
  width: 100%;
}

.due-date-field.smart-scheduler-highlight {
  border-radius: var(--radius-md);
}

.intake-smart-scheduler-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.intake-smart-scheduler-row .smart-scheduler-summary-text {
  flex: 1;
  min-width: 0;
}

.smart-scheduler-summary-text {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.3;
  flex: 1;
  min-width: 150px;
}

.smart-scheduler-summary-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.smart-scheduler-summary-actions .smart-scheduler-trigger {
  white-space: normal;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  min-height: 42px;
  padding: 6px 18px;
  border-color: rgba(255, 196, 59, 0.9);
  background: rgba(255, 203, 58, 0.08);
  box-shadow: 0 0 16px rgba(255, 203, 66, 0.5);
  text-align: center;
  line-height: 1.3;
}

#quick-intake-smart-scheduler-row {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
}

#quick-intake-smart-scheduler-trigger {
  width: 100%;
  max-width: 280px;
  min-height: 48px;
  padding: 12px 22px;
  line-height: 1.4;
  white-space: normal;
  text-align: center;
  overflow-wrap: break-word;
  word-break: break-word;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 196, 59, 0.9);
  background: rgba(255, 203, 58, 0.12);
  box-shadow: 0 0 20px rgba(255, 203, 66, 0.5);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  height: auto;
}

.recurrence-controls {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.recurrence-toggle-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  align-items: center;
}

.recurrence-toggle-field,
.recurrence-frequency-field {
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 4px;
  justify-content: flex-start;
}

.recurrence-toggle-field {
  display: flex;
}

.recurrence-frequency-field {
  display: flex;
}

.recurrence-frequency-modal .modal-card {
  width: min(420px, 90vw);
}

.recurrence-frequency-modal .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.recurrence-frequency-modal select {
  width: 100%;
  min-height: 44px;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-active);
  background: var(--surface-2);
  color: var(--text);
  padding: 8px 12px;
}

.recurrence-frequency-modal input {
  width: 100%;
  min-height: 44px;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-active);
  background: var(--surface-2);
  color: var(--text);
  padding: 8px 12px;
}

#recurrence-frequency-modal .recurrence-frequency-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px 20px;
}

#recurrence-frequency-modal .recurrence-frequency-grid .run-limit-field {
  grid-column: 1 / -1;
}

.recurrence-toggle-field label,
.recurrence-frequency-field label {
  white-space: nowrap;
  margin: 0;
  font-weight: 500;
  font-size: 0.95rem;
}

.recurrence-frequency-field select {
  width: 100%;
  min-width: 140px;
  max-width: none;
  height: 40px;
  font-size: 0.95rem;
}

.recurrence-toggle-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
}

.recurrence-panel {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-top: 0;
  background: var(--bg-subtle);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

dialog#intake-modal .task-modal-section--details .recurrence-controls,
dialog#task-dialog .task-modal-section--details .recurrence-controls {
  margin-top: 0;
  display: grid;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
}

@media (max-width: 760px) {
  dialog#intake-modal .task-modal-section--details .recurrence-controls,
  dialog#task-dialog .task-modal-section--details .recurrence-controls {
    padding: 12px;
  }
}

.recurrence-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.recurrence-panel__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 24px;
  align-items: start;
}

.recurrence-panel__column {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.recurrence-row--core {
  grid-template-columns: minmax(180px, 1fr) minmax(120px, 1fr);
}

.recurrence-row--dates {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.recurrence-row--limit {
  grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 560px) {
  .recurrence-panel__grid {
    grid-template-columns: 1fr;
  }
  .recurrence-row--core,
  .recurrence-row--dates {
    grid-template-columns: 1fr;
  }
}

.recurrence-summary-row {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
}

.recurrence-summary-row.visible {
  display: flex;
}

.recurrence-summary-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.recurrence-summary-action {
  padding: 4px 12px;
  border-radius: var(--radius-pill);
}

.recurrence-toggle-field {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.recurrence-toggle-field > label {
  margin: 0;
}

.recurrence-toggle-field > .recurrence-summary-row {
  flex: 1 1 100%;
}

.recurrence-row label,
.recurrence-panel label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.recurrence-frequency-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.recurrence-skip-weekends {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.recurrence-skip-weekends input[type="checkbox"] {
  margin: 0;
}

.recurrence-frequency-group .recurrence-skip-weekends--inline,
.recurrence-skip-weekends--inline {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
}
.recurrence-skip-weekends--inline span {
  font-size: inherit;
}

.recurrence-weekdays {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.recurrence-weekday {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: var(--surface-subtle);
  font-size: 0.8rem;
}

.recurrence-weekday input[type="checkbox"] {
  margin: 0;
}

@media (max-width: 560px) {
  .recurrence-weekdays {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.recurrence-panel-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.quick-intake-recurrence {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.2);
}

.header-actions,
.scheduling-card-actions,
.smart-scheduler-actions,
.task-modal-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.task-modal-footer {
  position: static;
  margin: 24px 0 0;
  padding-top: 8px;
  justify-content: flex-end;
  flex-wrap: nowrap;
  width: 100%;
}

.intake-calendar-note {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.intake-calendar-panel {
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  padding: 14px;
  background: var(--bg-subtle);
}

.intake-calendar-session-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.intake-calendar-session-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 0 0;
  border-bottom: 1px solid var(--border-subtle);
}

.intake-session-input-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 12px;
  align-items: flex-start;
}

.intake-session-input-row .intake-session-field {
  min-width: 0;
}

@media (max-width: 720px) {
  .intake-session-input-row {
    grid-template-columns: 1fr;
  }
}

.range-field,
.range-field-row,
.range-field-top,
.range-step {
  display: block;
}

.range-field,
.meeting-duration-field {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.01);
}

.meeting-duration-field-top {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.meeting-duration-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.meeting-duration-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  cursor: pointer;
  background: var(--bg-subtle);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.meeting-duration-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.meeting-duration-option::before {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: transparent;
}

.meeting-duration-option.active {
  border-color: rgba(76, 175, 80, 0.9);
  background: rgba(76, 175, 80, 0.15);
}

.meeting-duration-option.active::before {
  background: rgba(76, 175, 80, 0.9);
  border-color: rgba(76, 175, 80, 0.9);
}

.range-field-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.range-field-top {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.range-step {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-emphasis);
  background: var(--bg-subtle);
}

.schedule-inputs {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.schedule-input-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.scheduled-session-card,
.scheduled-session-cards,
.scheduled-session-container {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.scheduled-session-card {
  padding: 12px 16px;
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2);
}

.scheduled-session-card__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.scheduled-session-card__meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.scheduled-session-card__actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.scheduled-session-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.scheduled-session-container {
  padding: 12px;
  background: rgba(255, 255, 255, 0.01);
}

.scheduled-session-container--empty {
  border: none;
  background: transparent;
  padding: 0;
}

.scheduled-session-container--empty .scheduled-session-cards {
  display: none;
}

.scheduled-session-container--empty .scheduled-session-empty {
  margin: 0;
}

.scheduled-session-container--empty .scheduling-saved-title {
  display: none;
}

.scheduled-session-empty {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.scheduling-actions {
  display: flex;
  gap: 10px;
}

.scheduling-card {
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  border-radius: var(--radius-lg);
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card.today-card.scheduling-card {
  display: none !important;
}

.scheduling-card-header {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  justify-content: flex-start;
}

.scheduling-panels {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.scheduling-panel {
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.015);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.scheduling-preference {
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.01);
  align-items: flex-start;
}

.scheduling-preference .scheduling-preference-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.scheduling-preference-pills {
  flex-wrap: wrap;
  gap: 8px;
}

.scheduling-preference-pill {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-emphasis);
  background: var(--bg-subtle);
  color: var(--text);
}

.scheduling-checklist {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  width: 100%;
  padding-inline: 16px;
  box-sizing: border-box;
}

.scheduling-preference-pills,
.scheduling-preference-pill,
.scheduling-preference-label {
  display: inline-flex;
}

.scheduling-preference {
  align-items: center;
  justify-content: space-between;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 12px;
  background: var(--bg-subtle);
}

.scheduling-preference-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.scheduling-preference-pills {
  gap: 6px;
}

.scheduling-preference-pill {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-emphasis);
  background: var(--bg-subtle);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.scheduling-preference-pill[data-preference="all"] {
  margin-left: 10px;
}

.scheduling-preference-pill.active,
.scheduling-preference-pill:focus-visible {
  border-color: rgba(167, 139, 250, 0.8);
  background: rgba(167, 139, 250, 0.18);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.35);
}

.scheduling-priority-plan-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.scheduling-priority-segment {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.01);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease,
    transform 0.15s ease;
  width: 100%;
  box-sizing: border-box;
}

.scheduling-priority-segment strong {
  font-size: 0.95rem;
  font-weight: 600;
}

.scheduling-priority-segment span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.scheduling-priority-segment:hover {
  border-color: rgba(167, 139, 250, 0.8);
  background: rgba(167, 139, 250, 0.05);
  transform: translateY(-1px);
}

.scheduling-reauth {
  border-radius: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.25);
  padding: 12px;
  background: var(--bg-subtle);
}

.scheduling-reauth-btn,
.scheduling-reconnect-link {
  margin-top: 6px;
  display: inline-flex;
}

.settings-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 20px 0;
}

.settings-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  padding: 20px 24px;
}

.settings-card-header {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border2);
}

.settings-form-fields {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.settings-sections {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.settings-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-section + .settings-section {
  border-top: 1px solid var(--border-subtle);
  padding-top: 22px;
  margin-top: 18px;
}

.settings-section-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
}

.settings-section-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.settings-section-body label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-field label {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
}

.settings-section-helper {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.4;
}

.settings-calendar-reauth {
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#booking-settings-form .settings-calendar-reauth {
  margin-top: 8px;
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.settings-calendar-reauth p {
  margin: 0;
  font-weight: 500;
  color: #fff;
  letter-spacing: -0.01em;
}

.settings-account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-account-email {
  font-size: 13px;
  color: var(--muted);
}

.settings-install-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-left: 20px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.settings-install-steps strong {
  color: var(--text);
}

.settings-install-steps code {
  font-family: monospace;
  font-size: 12px;
  background: rgba(255,255,255,0.06);
  padding: 1px 5px;
  border-radius: 4px;
}

.settings-link {
  color: var(--accent, #4f8ef7);
  text-decoration: none;
}

.settings-link:hover {
  text-decoration: underline;
}

.settings-calendar-reauth .settings-integration-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid transparent;
  line-height: 1;
}

.settings-integration-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.settings-integration-head [data-google-disconnect-account] {
  margin-left: auto;
}

.settings-integration-option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--surface-subtle);
  padding: 10px 12px;
}

.settings-integration-option-label {
  display: block;
  margin: 0;
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}

.settings-integration-option-row input[type="radio"],
.settings-integration-option-row input[type="checkbox"] {
  margin: 0;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: #a78bfa;
}

@media (max-width: 700px) {
  .settings-integration-head [data-google-disconnect-account] {
    margin-left: 0;
  }

  .settings-integration-option-row {
    padding: 10px;
  }
}

.settings-integration-status--connected {
  color: #dcfce7;
  background: rgba(34, 197, 94, 0.35);
  border-color: rgba(34, 197, 94, 0.75);
}

.settings-integration-status--needs_reauth {
  color: #fef3c7;
  background: rgba(245, 158, 11, 0.35);
  border-color: rgba(245, 158, 11, 0.75);
}

.settings-integration-status--disconnected {
  color: #fee2e2;
  background: rgba(239, 68, 68, 0.35);
  border-color: rgba(239, 68, 68, 0.75);
}

a.settings-integration-status--disconnected {
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

a.settings-integration-status--disconnected:hover {
  background: rgba(239, 68, 68, 0.5);
  border-color: rgba(239, 68, 68, 1);
}

.settings-section-body small {
  display: block;
  margin-top: 10px;
  line-height: 1.4;
  color: var(--text-muted);
}

.settings-checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-checkbox-label {
  display: contents;
}

.settings-webhook-url-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.settings-webhook-url-input {
  flex: 1;
}

.settings-subtabs {
  gap: 6px;
  flex-wrap: nowrap;
  display: flex;
}

.smart-scheduler-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0;
}

.smart-scheduler-intro {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.smart-scheduler-intro-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.smart-scheduler-intro-text {
  margin: 0;
}

.smart-scheduler-mode {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.smart-scheduler-mode-title {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.smart-scheduler-modal {
  width: 100%;
  min-height: 100vh;
  padding: 32px 16px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}

.smart-scheduler-card {
  width: min(1120px, 96vw);
  max-height: calc(100vh - 120px);
  padding: 28px 32px;
  gap: 20px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(18, 18, 18, 0.96), rgba(10, 10, 10, 0.98));
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 30px 110px rgba(0, 0, 0, 0.75);
}

.smart-scheduler-header {
  gap: 14px;
  align-items: flex-start;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.smart-scheduler-header-actions {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
  flex-wrap: wrap;
}

.smart-scheduler-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.smart-scheduler-tab {
  border-radius: var(--radius-sm, 10px);
  padding: 8px 18px;
  border: 1px solid var(--border-emphasis);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 120px;
  text-align: center;
}

.smart-scheduler-tab:hover,
.smart-scheduler-tab:focus-visible {
  border-color: rgba(167, 139, 250, 0.5);
  background: rgba(167, 139, 250, 0.15);
}

.smart-scheduler-tab.active {
  border-color: rgba(167, 139, 250, 0.8);
  background: rgba(167, 139, 250, 0.18);
  color: #ffffff;
  box-shadow: none;
}

.smart-scheduler-views {
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex: 1;
  min-height: 0;
}

.smart-scheduler-content-card {
  border-radius: var(--radius-dialog);
  border: 1px solid rgba(120, 150, 255, 0.18);
  background: linear-gradient(160deg, rgba(18, 18, 18, 0.92), rgba(10, 10, 10, 0.98));
  box-shadow:
    inset 0 1px 0 var(--surface-2),
    0 18px 40px rgba(4, 6, 10, 0.6);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 0;
}

.smart-scheduler-view {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
  min-height: 0;
}

.smart-scheduler-view--smart,
.smart-scheduler-view--manual {
  width: 100%;
}

.smart-scheduler-panel {
  border-radius: 20px;
  border: 1px solid var(--border-subtle);
  padding: 20px;
  background: rgba(14, 14, 14, 0.95);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
}

.smart-scheduler-summary {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.smart-scheduler-summary-text {
  margin: 0;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.panel-header h4 {
  margin: 0;
  font-size: 0.95rem;
}

.manual-scheduler-helper {
  margin: 0;
}

.smart-scheduler-sessions-card {
  gap: 14px;
}

.smart-scheduler-sessions-card .detail-section-header {
  margin-bottom: 6px;
  padding-bottom: 10px;
}

.smart-scheduler-sessions-card .intake-calendar-note {
  margin: 0;
}

.smart-scheduler-empty-state {
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-emphasis);
  padding: 12px 14px;
  background: var(--bg-subtle);
}

.smart-scheduler-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.smart-scheduler-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.smart-scheduler-section-header h5 {
  margin: 0;
  font-size: 0.9rem;
}

.smart-scheduler-section-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-card.smart-scheduler-card.standard-modal-card .scheduler-preferences-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.modal-card.smart-scheduler-card.standard-modal-card .scheduler-col-left,
.modal-card.smart-scheduler-card.standard-modal-card .scheduler-col-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.smart-scheduler-preferences .intake-session-input-row {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: flex-start;
}

dialog#smart-scheduler-overlay .intake-session-input-row {
  display: flex !important;
  flex-direction: row !important;
  gap: 12px;
  align-items: flex-start;
}

dialog#smart-scheduler-overlay .intake-session-input-row > .intake-session-field {
  flex: 1 1 0;
  min-width: 0;
}

@media (max-width: 720px) {
  .modal-card.smart-scheduler-card.standard-modal-card .scheduler-preferences-grid {
    grid-template-columns: 1fr;
  }
}

.smart-scheduler-availability .intake-session-availability {
  grid-template-columns: 1fr;
}

.smart-scheduler-actions {
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.smart-scheduler-body .intake-calendar-panel,
.smart-scheduler-panel .calendar-list {
  min-height: 0;
}

.task-modal-card {
  border-radius: 20px;
  background: rgba(16, 16, 16, 0.92);
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
  max-height: 100vh;
  height: 100%;
  overflow: hidden;
}

/* Keep intake/task modal primary card in grid layout (override .task-modal-card) */
.modal-primary-card.task-modal-card {
  display: grid;
}

.task-modal-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
  overflow: hidden;
}

.task-modal-grid .task-modal-section {
  min-height: 0;
}

.task-modal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.85fr);
  gap: 18px;
  min-height: 0;
  width: 100%;
  align-items: stretch;
}

.task-modal-main,
.task-modal-secondary {
  min-height: 0;
  min-width: 0;
}

.task-modal-column {
  min-width: 0;
  min-height: 0;
}

.task-modal-secondary {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-self: stretch;
}

.task-modal-secondary .task-modal-section {
  flex: 1;
}

.intake-notes-section {
  min-height: 0;
}

.task-modal-main {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

@media (max-width: 1100px) {
  .task-modal-layout {
    grid-template-columns: 1fr;
  }

  .task-modal-layout.notes-bookmarks-columns {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.9fr);
  }
}

.task-modal-column--secondary[hidden] {
  display: none;
}

.modal-primary-card.intake-tab-scheduled .task-modal-column--secondary {
  display: none;
}

dialog#task-dialog .task-modal-column--secondary {
  align-self: start;
}

.task-modal-section--scheduled-area {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-self: flex-start;
}

.task-modal-section--scheduled-area .scheduled-card {
  max-height: 360px;
  overflow-y: auto;
  border-radius: 20px;
  border: 1px solid var(--border-subtle);
  background: linear-gradient(
    180deg,
    var(--surface-subtle),
    rgba(255, 255, 255, 0.008)
  );
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.task-modal-section--scheduled-area .scheduled-card--empty {
  padding-block: 12px;
  padding-inline: 18px;
  gap: 8px;
  max-height: none;
}

.task-modal-section--scheduled-area .scheduled-card--empty .scheduled-session-container {
  padding: 0;
}

.task-modal-section--scheduled-area .bookmarks-card {
  border: none;
  background: transparent;
}

dialog#task-dialog .task-modal-section--details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px 24px;
  align-items: start;
  width: 100%;
}

dialog#task-dialog .task-modal-section--details > header {
  grid-column: 1 / -1;
}

dialog#task-dialog .task-modal-section > header {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--text);
}

dialog#task-dialog .task-modal-section--details .edit-modal-due-date-row,
dialog#task-dialog .task-modal-section--details .recurrence-controls {
  grid-column: 1 / -1;
}

dialog#task-dialog .task-modal-section--details .status-field {
  width: 100%;
}

dialog#task-dialog .task-modal-section--details label {
  display: grid;
  grid-template-columns: clamp(140px, 14vw, 190px) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  width: 100%;
}

dialog#intake-modal .task-modal-section--details .recurrence-controls label,
dialog#task-dialog .task-modal-section--details .recurrence-controls label {
  display: flex;
  grid-template-columns: none;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  gap: 6px;
}

dialog#intake-modal .task-modal-section--details .recurrence-controls .recurrence-toggle-field,
dialog#task-dialog .task-modal-section--details .recurrence-controls .recurrence-toggle-field {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: start;
  gap: 10px 12px;
}

dialog#intake-modal .task-modal-section--details .recurrence-controls .recurrence-toggle-field > label,
dialog#task-dialog .task-modal-section--details .recurrence-controls .recurrence-toggle-field > label {
  display: block;
  width: auto;
  margin: 0;
}

dialog#intake-modal .task-modal-section--details .recurrence-controls .recurrence-toggle-field > .recurrence-summary-row,
dialog#task-dialog .task-modal-section--details .recurrence-controls .recurrence-toggle-field > .recurrence-summary-row {
  grid-column: 1 / -1;
}

dialog#intake-modal #intake-recurrence-summary {
  display: none !important;
}

dialog#intake-modal .task-modal-section--details .recurrence-controls .recurrence-row--core,
dialog#task-dialog .task-modal-section--details .recurrence-controls .recurrence-row--core {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.7fr);
  gap: 12px;
  align-items: end;
}

dialog#intake-modal .task-modal-section--details .recurrence-controls .recurrence-row--dates,
dialog#task-dialog .task-modal-section--details .recurrence-controls .recurrence-row--dates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

dialog#intake-modal .task-modal-section--details .recurrence-controls .recurrence-row--limit,
dialog#task-dialog .task-modal-section--details .recurrence-controls .recurrence-row--limit {
  display: grid;
  grid-template-columns: minmax(180px, 1fr);
}

dialog#intake-modal .task-modal-section--details .recurrence-controls .recurrence-frequency-group .recurrence-skip-weekends,
dialog#task-dialog .task-modal-section--details .recurrence-controls .recurrence-frequency-group .recurrence-skip-weekends,
dialog#intake-modal .task-modal-section--details .recurrence-controls .recurrence-weekday,
dialog#task-dialog .task-modal-section--details .recurrence-controls .recurrence-weekday {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  width: auto;
  gap: 8px;
}

dialog#intake-modal .task-modal-section--details .recurrence-controls .recurrence-frequency-group .recurrence-skip-weekends input[type="checkbox"],
dialog#task-dialog .task-modal-section--details .recurrence-controls .recurrence-frequency-group .recurrence-skip-weekends input[type="checkbox"],
dialog#intake-modal .task-modal-section--details .recurrence-controls .recurrence-weekday input[type="checkbox"],
dialog#task-dialog .task-modal-section--details .recurrence-controls .recurrence-weekday input[type="checkbox"] {
  margin: 0;
}

dialog#task-dialog .task-modal-section--details label > *:last-child {
  width: 100%;
}

dialog#intake-modal .task-modal-section--details .recurrence-controls .recurrence-panel__column,
dialog#task-dialog .task-modal-section--details .recurrence-controls .recurrence-panel__column,
dialog#intake-modal .task-modal-section--details .recurrence-controls .recurrence-row > *,
dialog#task-dialog .task-modal-section--details .recurrence-controls .recurrence-row > * {
  min-width: 0;
}

dialog#intake-modal .task-modal-section--details .recurrence-controls .recurrence-panel__grid,
dialog#task-dialog .task-modal-section--details .recurrence-controls .recurrence-panel__grid {
  grid-template-columns: 1fr;
  gap: 12px;
}

dialog#intake-modal .task-modal-section--details .recurrence-controls input,
dialog#intake-modal .task-modal-section--details .recurrence-controls select,
dialog#task-dialog .task-modal-section--details .recurrence-controls input,
dialog#task-dialog .task-modal-section--details .recurrence-controls select {
  width: 100%;
  min-width: 0;
}

dialog#task-dialog .task-modal-section--details label textarea {
  min-height: 120px;
}

dialog#task-dialog .task-details-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px 18px;
}

dialog#task-dialog .task-details-span-2 {
  grid-column: 1 / -1;
}

@media (max-width: 920px) {
  dialog#task-dialog .task-modal-section--details label {
    grid-template-columns: 1fr;
  }
  dialog#task-dialog .task-modal-section--details label > *:last-child {
    width: 100%;
  }
}

@media (max-width: 560px) {
  dialog#intake-modal .task-modal-section--details .recurrence-controls .recurrence-row--core,
  dialog#task-dialog .task-modal-section--details .recurrence-controls .recurrence-row--core,
  dialog#intake-modal .task-modal-section--details .recurrence-controls .recurrence-row--dates,
  dialog#task-dialog .task-modal-section--details .recurrence-controls .recurrence-row--dates {
    grid-template-columns: 1fr;
  }
}

dialog#intake-modal .task-modal-section--details .recurrence-controls .recurrence-skip-weekends,
dialog#task-dialog .task-modal-section--details .recurrence-controls .recurrence-skip-weekends,
dialog#intake-modal .task-modal-section--details .recurrence-controls .recurrence-weekday,
dialog#task-dialog .task-modal-section--details .recurrence-controls .recurrence-weekday {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
}

dialog#intake-modal .task-modal-section--details .recurrence-controls .recurrence-skip-weekends > *,
dialog#task-dialog .task-modal-section--details .recurrence-controls .recurrence-skip-weekends > *,
dialog#intake-modal .task-modal-section--details .recurrence-controls .recurrence-weekday > *,
dialog#task-dialog .task-modal-section--details .recurrence-controls .recurrence-weekday > * {
  width: auto;
}

.task-modal-section--scheduled-area .scheduled-session-container,
.task-modal-section--scheduled-area .scheduled-session-card {
  border: none;
  background: transparent;
}

.task-modal-section--notes {
  max-height: 520px;
  overflow-y: auto;
  padding-right: 6px;
}

.task-modal-section--notes textarea {
  min-height: 160px;
  max-height: 320px;
}


@media (max-width: 900px) {
  .task-modal-section--notes {
    max-height: 320px;
  }
}

.task-modal-section,
.task-modal-section--details,
.task-modal-section--scheduled-area,
.task-modal-section--notes {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  padding: 14px;
  background: rgba(255, 255, 255, 0.01);
}

/* Match Active Clients card styling inside task intake / edit modals */
dialog#intake-modal .modal-primary-card,
dialog#task-dialog .modal-primary-card,
dialog#intake-modal .task-modal-section,
dialog#task-dialog .task-modal-section,
dialog#intake-modal .modal-links-column,
dialog#task-dialog .modal-links-column {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.035),
    rgba(255, 255, 255, 0.015)
  );
  border: 1px solid var(--border2);
  box-shadow:
    inset 0 1px 0 var(--surface-2),
    0 10px 24px rgba(0, 0, 0, 0.35);
}

dialog#intake-modal .task-modal-section,
dialog#task-dialog .task-modal-section,
dialog#intake-modal .task-modal-section,
dialog#task-dialog .task-modal-section {
  border-radius: 14px;
}

dialog#intake-modal .modal-primary-card,
dialog#task-dialog .modal-primary-card,
dialog#intake-modal .modal-links-column,
dialog#task-dialog .modal-links-column {
  border-radius: var(--radius-lg);
}

.task-modal-section--scheduled-area.task-modal-section--scheduled-area--empty {
  display: none;
  border: none;
  background: transparent;
  padding: 0;
  gap: 0;
}

.task-modal-section__title {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: var(--text-muted);
}

dialog#task-dialog .task-modal-section__title {
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

/* Legacy edit-tab sidebar visibility rules removed: edit task now shows
   bookmarks + notes together in the sidebar. */

.tertiary {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-emphasis);
  background: var(--bg-subtle);
  padding: 6px 12px;
}

.time-helper {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.intake-clear-selection {
  cursor: pointer;
}

.intake-columns {
  display: block;
}
.intake-notes-section {
  min-height: 0;
}

@media (max-width: 1100px) {
  .intake-columns {
    grid-template-columns: 1fr;
  }
}

.label-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.label-helper {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.manual-scheduler-context {
  background: linear-gradient(
    180deg,
    rgba(18, 18, 18, 0.85),
    rgba(14, 14, 14, 0.85)
  );
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.manual-scheduler-context .text-error {
  color: var(--danger);
}

.manual-scheduler-header {
  margin-bottom: 12px;
}

.smart-scheduler-body-actions {
  margin: 8px 0 4px;
}

.modal-header {
  margin-bottom: 14px;
}

dialog#smart-scheduler-overlay .smart-scheduler-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

dialog#smart-scheduler-overlay .smart-scheduler-header__title {
  flex: 1;
  min-width: 0;
}

dialog#smart-scheduler-overlay .smart-scheduler-header__tabs {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  min-width: 240px;
  gap: 6px;
}

dialog#smart-scheduler-overlay .modal-actions.smart-scheduler-actions.task-modal-footer {
  position: static;
  padding: 0;
  background: transparent;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 32px;
  margin-top: 0;
}

/* Smart Scheduler: keep Scheduled start + Duration on one row */
dialog#smart-scheduler-overlay .schedule-input-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

dialog#smart-scheduler-overlay .schedule-input-row label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

dialog#smart-scheduler-overlay .schedule-input-row input,
dialog#smart-scheduler-overlay .schedule-input-row select {
  width: 100%;
  height: 40px;
}

@media (max-width: 720px) {
  dialog#smart-scheduler-overlay .schedule-input-row {
    grid-template-columns: 1fr;
  }
}

dialog#edit-recurrence-modal .modal-card {
  width: min(900px, 96vw);
  max-width: 900px;
  min-width: min(480px, 92vw);
  border-radius: 24px;
  padding: 24px;
  box-sizing: border-box;
}

dialog#edit-recurrence-modal .recurrence-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

dialog#edit-recurrence-modal .recurrence-modal-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 24px;
}

@media (max-width: 720px) {
  dialog#edit-recurrence-modal .recurrence-modal-body {
    grid-template-columns: 1fr;
  }
}


dialog#edit-recurrence-modal .recurrence-modal-actions {
  justify-content: flex-end;
  padding-top: 16px;
  margin-top: 4px;
  border-top: 1px solid var(--border-subtle);
}
.detail-bookmark-preview {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: nowrap;
  max-width: 260px;
  overflow-x: auto;
  flex: 0 1 auto;
  min-width: 0;
}

.detail-bookmark-cta {
  border-radius: var(--radius-md);
  padding: 8px 14px;
  flex-shrink: 0;
  white-space: nowrap;
}
.brand .title,
.section-main-title,
.task-modal-section__title,
h1,
h2,
h3 {
  font-family: var(--font-display);
  letter-spacing: 0.01em;
}

dialog#task-dialog .task-modal-section__title {
  font-size: 18px !important;
  font-weight: 600 !important;
  letter-spacing: 0.02em !important;
  text-transform: none !important;
  color: var(--text) !important;
  margin: 0 0 6px !important;
}

/* Edit task layout polish: reduce compression in expanded surface */
dialog#task-dialog .modal-primary-card {
  grid-template-columns: minmax(760px, 1fr) minmax(320px, 0.42fr);
  gap: 30px 24px;
}

dialog#task-dialog[data-active-tab="details"] .modal-primary-card {
  grid-template-columns: minmax(760px, 1fr) minmax(320px, 0.42fr);
  gap: 30px 24px;
}

dialog#task-dialog .task-details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 18px 20px;
  margin-top: 6px;
}

dialog#task-dialog .task-details-grid > label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
  min-width: 0;
}

dialog#task-dialog .task-details-grid > label > *:last-child {
  width: 100%;
  min-width: 0;
}

dialog#task-dialog .task-details-grid > label:first-child,
dialog#task-dialog .task-details-grid > .task-details-span-2,
dialog#task-dialog .task-details-grid > .recurrence-controls {
  grid-column: 1 / -1;
}

@media (max-width: 1240px) {
  dialog#task-dialog .task-details-grid {
    grid-template-columns: 1fr;
  }
}


.task,
.client-task:not(.today-task-row):not(.today-spotlight-card),
.client-task-completed-list .task {
  background: none;
  border: none;
  border-radius: var(--radius-md);
  box-shadow: none;
}

.task:hover,
.client-task:not(.today-task-row):not(.today-spotlight-card):hover,
.client-task-completed-list .task:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: transparent;
  box-shadow: none;
  transform: none;
}

/* Compact task density across views */
.today-task-row {
  padding: 14px 16px;
  gap: 10px;
}

.today-task-title {
  font-size: 14px;
  line-height: 1.25;
}

.today-task-meta {
  font-size: 11.5px;
  column-gap: 8px;
  row-gap: 6px;
}

.today-task-title-row .client {
  font-size: 11px;
  padding: 2px 8px;
}

.schedule-pill,
.meeting-soon-label,
.due-label {
  min-height: 22px;
  padding: 2px 8px;
  font-size: 10.5px;
}

.task,
.client-task:not(.today-task-row):not(.today-spotlight-card),
.client-task-completed-list .task {
  padding: 11px 13px;
  gap: 3px;
}

.task-title,
.client-task .task-title,
.client-task-completed-list .task-title {
  font-size: 12.5px;
  line-height: 1.25;
  min-height: auto;
}

.task-meta,
.client-task .task-meta {
  font-size: 11px;
}

/* Scenario planning */
#view-planning .planning-layout {
  gap: 16px;
  align-items: stretch !important;
}

#view-planning .planning-layout > * {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0;
}

/* Keep planning layout aligned to page width. */
#view-planning .panel.clients-layout.planning-layout {
  width: 100%;
  max-width: 100%;
  margin: 0;
}

/* Ensure planning header spans full planning page width. */
#view-planning .client-header-sticky {
  display: flex !important;
  flex-direction: column;
  position: sticky;
  top: -18px;
  z-index: 1001;
  background: var(--panel);
  border-radius: 0;
  width: 100% !important;
  margin: 0 !important;
  min-width: 0;
}

#view-planning .client-select-row.client-header-row.panel-header {
  position: sticky;
  top: -18px;
  z-index: 1001;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  min-width: 0;
  background: var(--panel);
  border-color: var(--border-strong);
}

#view-planning .client-header-sticky > .clients-row {
  width: 100% !important;
  max-width: none !important;
}

#view-planning .client-header-main {
  width: 100%;
  grid-template-columns: auto minmax(0, 1fr);
}

#view-planning .planning-controls-wrap {
  display: grid;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border2);
}

#view-planning .planning-controls-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

#view-planning .planning-controls-header h3 {
  margin: 0;
  font-size: 15px;
}

#view-planning .planning-controls-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

#view-planning .planning-cad-rate-field {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

#view-planning .planning-cad-rate-field input {
  width: 92px;
}

#view-planning .planning-rules {
  display: grid;
  gap: 16px;
  margin-top: 14px;
}

#view-planning .planning-rule-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.1fr) minmax(170px, 1fr) minmax(170px, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
}

#view-planning .planning-rule-row.planning-rule-row--with-amount {
  grid-template-columns: minmax(190px, 1.1fr) minmax(170px, 1fr) minmax(170px, 1fr) minmax(130px, 0.7fr) auto;
}

#view-planning .planning-rule-row + .planning-rule-row {
  margin-top: 10px;
}

#view-planning .planning-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

#view-planning .planning-field select,
#view-planning .planning-field input[type="number"] {
  width: 100%;
}

#view-planning .planning-rule-amount {
  max-width: 160px;
}

#view-planning .planning-rule-amount .planning-rule-amount-input {
  max-width: 120px;
}

#view-planning .planning-rule-amount .muted {
  margin: 2px 0 0;
  font-size: 11px;
  line-height: 1.2;
}

#view-planning .planning-rule-remove {
  align-self: center;
  min-width: 92px;
}

#view-planning .planning-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

#view-planning .planning-kpis .kpi-card {
  min-height: 0;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 8px;
}

#view-planning .planning-kpis .kpi-label {
  margin: 0;
  font-size: 14px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--muted);
}

#view-planning .planning-kpis .kpi-value {
  margin: 0;
  font-size: clamp(18px, 1.1vw, 24px);
  line-height: 1.2;
  font-weight: 600;
  color: #f3f6ff;
}

#view-planning .planning-table-wrap {
  overflow-x: auto;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
}

#view-planning .planning-impact-row {
  min-height: 56px;
}

#view-planning .planning-impact-row td {
  vertical-align: middle;
}

#view-planning .planning-impact-row .planning-client-cell {
  font-weight: 600;
}

#view-planning .planning-impact-row .planning-client-name {
  display: inline;
}

#view-planning .planning-table {
  border-collapse: separate;
  border-spacing: 0;
}

#view-planning .planning-table th,
#view-planning .planning-table td {
  border-bottom: 0;
  color: var(--text-secondary);
}

#view-planning .planning-table th {
  color: var(--text-secondary) !important;
}

#view-planning .planning-table td:not(.planning-positive):not(.planning-negative) {
  color: var(--text-secondary) !important;
}

#view-planning .planning-table td:not(.planning-positive):not(.planning-negative) .planning-client-name,
#view-planning .planning-table td:not(.planning-positive):not(.planning-negative) .planning-money-cad {
  color: var(--text-secondary) !important;
}

#view-planning .planning-table thead tr,
#view-planning .planning-table tbody tr {
  box-shadow: inset 0 -1px 0 var(--border);
}

.planning-positive {
  color: #77d497;
}

.planning-negative {
  color: #f29a8f;
}

.planning-estimated-pill {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(242, 202, 122, 0.45);
  background: rgba(242, 202, 122, 0.15);
  color: #f2ca7a;
  font-size: 10px;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

#view-planning .planning-money-cad {
  margin-left: 6px;
  color: var(--muted);
  font-size: 0.75em;
}

.client-email-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: visible;
  background: rgba(16, 16, 16, 0.55);
}

#view-inbox .clients-row {
  overflow: visible;
}

#view-inbox .panel.clients-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

#view-inbox .panel.clients-layout > .clients-row:first-of-type {
  flex: 0 0 auto;
}

#view-inbox .panel.clients-layout > .clients-row:last-child {
  flex: 1 1 auto;
  height: calc(100vh - var(--topbar-height) - 250px);
  min-height: 420px;
  overflow: hidden;
}

.inbox-split-layout {
  display: grid;
  grid-template-columns: minmax(340px, 460px) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  height: 100%;
  min-height: 0;
}

.inbox-list-pane {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  row-gap: 10px;
  min-width: 0;
  max-height: none;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.inbox-loading-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #c8c0dc;
  font-weight: 600;
}

.inbox-loading-spinner {
  width: 14px;
  height: 14px;
  border-radius: var(--radius-pill);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: rgba(167, 139, 250, 0.95);
  animation: inbox-spin 0.75s linear infinite;
}

@keyframes inbox-spin {
  to {
    transform: rotate(360deg);
  }
}

.inbox-loading-row {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.inbox-loading-row:last-child {
  border-bottom: 0;
}

.inbox-loading-row-primary,
.inbox-loading-row-secondary {
  display: grid;
  grid-template-columns: minmax(110px, 150px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.inbox-loading-row-secondary {
  margin-top: 10px;
  grid-template-columns: 1fr minmax(80px, 120px);
}

.inbox-loading-line {
  display: block;
  height: 10px;
  border-radius: var(--radius-pill);
  background: linear-gradient(
    90deg,
    var(--border-strong),
    rgba(195, 170, 255, 0.24),
    var(--border-strong)
  );
  background-size: 200% 100%;
  animation: inbox-skeleton-shimmer 1.2s ease-in-out infinite;
}

.inbox-loading-line.long {
  width: 100%;
}

.inbox-loading-line.medium {
  width: min(70%, 360px);
}

.inbox-loading-line.short {
  width: 80px;
}

.inbox-loading-line.tiny {
  width: 44px;
}

@keyframes inbox-skeleton-shimmer {
  0% {
    background-position: 180% 0;
  }
  100% {
    background-position: -20% 0;
  }
}

#view-inbox .inbox-list-pane .client-email-list {
  height: 100%;
  min-height: 0;
  overflow-y: auto !important;
  overflow-x: hidden;
}

.inbox-preview-pane {
  min-height: 0;
  height: 100%;
  overflow-y: hidden !important;
  overflow-x: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  padding: 14px;
}

.client-email-row {
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  transition: background-color 0.12s ease;
  overflow: visible;
}

.client-email-row[data-email-selectable="true"] {
  cursor: pointer;
}

.client-email-row:hover {
  background: rgba(255, 255, 255, 0.055);
}

.client-email-row.expanded {
  background: rgba(255, 255, 255, 0.05);
}

.client-email-row.selected {
  background: rgba(167, 139, 250, 0.16);
  box-shadow: inset 2px 0 0 rgba(167, 139, 250, 0.72);
}

.client-email-row.selected:hover {
  background: rgba(167, 139, 250, 0.22);
}

.client-email-row[data-email-selectable="true"]:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}

.client-email-row:last-child {
  border-bottom: 0;
}

.client-email-row-primary {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  cursor: pointer;
}

#view-inbox .inbox-list-pane .client-email-row-primary {
  grid-template-columns: minmax(110px, 160px) minmax(0, 1fr) auto;
  gap: 8px;
}

.client-email-row-sender {
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-email-row-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-start;
  min-width: 0;
  max-width: min(100%, 72ch);
  overflow: hidden;
}

.client-email-subject {
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.3;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-email-snippet {
  font-size: 0.88rem;
  font-weight: 500;
  color: rgba(220, 215, 235, 0.78);
  line-height: 1.35;
  max-width: 100%;
  min-width: 0;
  white-space: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

.client-email-row-time {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(220, 215, 235, 0.72);
  white-space: nowrap;
}

.client-email-row-secondary {
  margin-top: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.client-email-meta {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 8px;
  align-items: center;
  font-size: 0.78rem;
  color: var(--muted);
  min-width: 0;
  white-space: normal;
  overflow: hidden;
}

.client-email-meta-badges {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.client-email-meta-sender {
  display: block;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-email-link-badge {
  flex: 0 0 auto;
  border-radius: var(--radius-pill);
  padding: 2px 8px;
  font-size: 0.68rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(230, 236, 248, 0.78);
  white-space: nowrap;
}

.client-email-link-badge.linked {
  border-color: rgba(96, 196, 140, 0.55);
  color: #b8f3d0;
  background: rgba(96, 196, 140, 0.15);
}

.client-email-link-badge.unlinked {
  border-color: rgba(255, 255, 255, 0.2);
  background: var(--border2);
}

.client-email-account-badge {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-pill);
  padding: 2px 8px;
  font-size: 0.68rem;
  border: 1px solid rgba(167, 139, 250, 0.45);
  color: rgba(220, 205, 255, 0.95);
  background: rgba(100, 70, 180, 0.18);
  white-space: nowrap;
}

#view-inbox .inbox-list-pane .client-email-meta {
  grid-template-columns: 1fr;
  row-gap: 6px;
}

.client-email-row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-height: 34px;
  min-width: 170px;
}

/* Inbox list pane is narrow in split view; stack meta/actions to prevent badge clipping. */
#view-inbox .inbox-list-pane .client-email-row-secondary {
  grid-template-columns: 1fr;
  gap: 8px;
}

#view-inbox .inbox-list-pane .client-email-row-actions {
  justify-content: flex-start;
  min-width: 0;
}

.client-email-client-picker select {
  min-width: 170px;
  height: 34px;
  line-height: 1.2;
  padding-top: 0;
  padding-bottom: 0;
}

.client-email-row-actions .btn.small,
.client-email-row-actions a.btn.small {
  height: 34px;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
}

.client-email-expanded {
  margin-top: 10px;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(8, 14, 24, 0.58);
  max-width: 100%;
  overflow: hidden;
}

.inbox-preview-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.inbox-preview-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.inbox-preview-subject {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.35;
  word-break: break-word;
}

.inbox-preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 0.8rem;
  color: rgba(220, 215, 235, 0.8);
}

.inbox-preview-sender {
  font-weight: 600;
}

.inbox-preview-time {
  color: rgba(220, 215, 235, 0.72);
}

.inbox-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.inbox-preview-body {
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.inbox-preview-thread-section {
  margin-bottom: 12px;
}

.inbox-thread-list {
  max-height: 190px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.inbox-preview-message-section {
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.inbox-message-body {
  max-height: none;
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  font-size: 0.84rem;
  line-height: 1.4;
  color: rgba(236, 242, 252, 0.94);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.inbox-message-body.has-iframe {
  overflow-y: auto;
  overflow-x: hidden;
}

.inbox-message-body .client-email-expanded-iframe {
  min-height: 640px;
}

.inbox-thread-list .client-email-thread-item {
  grid-template-columns: minmax(130px, 220px) 1fr auto;
  font-size: 0.8rem;
  padding: 8px 10px;
}

.inbox-preview-empty {
  padding: 14px;
}

.inbox-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding-top: 12px;
}

.inbox-page-info {
  min-width: 108px;
  text-align: center;
  font-size: 0.78rem;
}

.client-email-expanded-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 14px;
  min-width: 0;
}

.client-email-expanded-section {
  min-width: 0;
}

.client-email-expanded-title {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(220, 215, 235, 0.72);
  margin-bottom: 8px;
}

.client-email-expanded-body {
  max-height: 260px;
  overflow: auto;
  font-size: 0.84rem;
  line-height: 1.4;
  color: rgba(236, 242, 252, 0.94);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.client-email-expanded-iframe {
  display: block;
  width: 100%;
  min-height: 260px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #ffffff;
}

.client-email-thread-list {
  max-height: 260px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.client-email-thread-item {
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  grid-template-columns: minmax(100px, 150px) 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 0.76rem;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 6px 8px;
  background: var(--surface-subtle);
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.client-email-thread-item.current {
  border-color: rgba(167, 139, 250, 0.55);
  background: rgba(167, 139, 250, 0.14);
}

.client-email-thread-from,
.client-email-thread-subject {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-email-thread-time {
  white-space: nowrap;
  color: rgba(220, 215, 235, 0.7);
}

@media (max-width: 980px) {
  #view-inbox .panel.clients-layout {
    display: flex;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  #view-inbox .panel.clients-layout > .clients-row:first-of-type {
    flex: 0 0 auto;
  }

  #view-inbox .panel.clients-layout > .clients-row:last-child {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .inbox-split-layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .inbox-list-pane {
    max-height: none;
    height: auto;
    overflow: visible;
    display: flex;
    flex-direction: column;
    row-gap: 0;
    gap: 10px;
  }

  #view-inbox .inbox-list-pane .client-email-list {
    overflow: visible;
  }

  .inbox-preview-pane {
    min-height: 0;
    overflow: visible;
  }

  .inbox-message-body {
    min-height: 360px;
    max-height: none;
    overflow-y: auto;
  }

  .inbox-message-body .client-email-expanded-iframe {
    min-height: 420px;
  }

  .client-email-row-primary {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .inbox-loading-row-primary,
  .inbox-loading-row-secondary {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .client-email-row-time {
    justify-self: start;
  }

  .client-email-row-content {
    max-width: 100%;
  }

  .client-email-row-secondary {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .client-email-row-actions {
    justify-content: flex-start;
  }

  .client-email-expanded-grid {
    grid-template-columns: 1fr;
  }

  #view-planning .planning-controls-header {
    flex-direction: column;
    align-items: flex-start;
  }

  #view-planning .planning-controls-header-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  #view-planning .planning-rule-row {
    grid-template-columns: 1fr;
  }

  #view-planning .planning-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  #view-planning .planning-kpis {
    grid-template-columns: 1fr;
  }
}

/* ===================================
   SIDEBAR NAVIGATION LAYOUT
   =================================== */

:root {
  --sidebar-width: 220px;
}

.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: #000000;
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  overflow: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--border2);
  flex-shrink: 0;
}

.sidebar-logo-img {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  object-fit: contain;
}

.sidebar-brand-name {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 8px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-nav .tab {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--text-body);
  font-weight: 500;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  box-shadow: none;
}

.sidebar-nav .tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border-color: transparent;
}

.sidebar-nav .tab.active {
  background: rgba(167, 139, 250, 0.12);
  border-color: rgba(167, 139, 250, 0.2);
  color: var(--accent);
  box-shadow: none;
}

.sidebar-nav .tab svg {
  flex-shrink: 0;
  opacity: 0.65;
}

.sidebar-nav .tab:hover svg {
  opacity: 0.85;
}

.sidebar-nav .tab.active svg {
  opacity: 1;
}

.sidebar-nav .tab .tab-count-pill {
  margin-left: auto;
}

.sidebar-nav-divider {
  height: 1px;
  background: var(--border2);
  margin: 6px 2px;
}

/* Content area (right of sidebar) */
.content-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Top bar */
.top-bar {
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 22px;
  background: #000000;
  gap: 0;
  position: relative;
}

.top-bar-stats {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.top-bar-stat {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 18px;
}

.top-bar-stat:first-child {
  padding-left: 0;
}

.top-bar-stat-label {
  font-size: var(--text-2xs);
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.top-bar-stat-value {
  font-size: var(--text-sm);
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

#next-meeting .top-bar-stat-value {
  max-width: none;
}

.top-bar-divider {
  width: 1px;
  height: 20px;
  background: var(--border2);
  flex-shrink: 0;
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.top-bar-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  padding: 0;
}

.top-bar-icon-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.top-bar-icon-btn svg {
  flex-shrink: 0;
  opacity: 0.65;
}

.top-bar-icon-btn:hover svg {
  opacity: 0.9;
}

/* Override .wrap height for sidebar layout, flat background */
.content-area .wrap {
  height: 100%;
  min-height: 0;
  flex: 1;
  background: var(--bg);
  padding: 18px 22px;
}

/* Fix inbox panel height in sidebar layout */
.content-area #view-inbox .panel.clients-layout > .clients-row:last-child {
  height: calc(100vh - 250px);
}

/* ===================================
   FLAT & CLEAN: Today View
   =================================== */

/* Remove outer panel box — let it be a pure layout container */
#view-today .panel {
  background: transparent;
  border: none;
  padding: 0;
  margin-top: 0;
}

#view-today .panel > * + * {
  margin-top: 0;
}

/* Flatten today-cards: no shadow, no gradient */
#view-today .today-card {
  background: rgba(255, 255, 255, 0.016);
  border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  box-shadow: none;
}

/* Flatten "At a Glance" strip — part of the natural content flow */
#view-today .today-overview {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0 2px 0;
  margin-bottom: 16px;
  gap: 16px;
}

#view-today .today-overview-title {
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Metric items — remove inner dark boxes */
#view-today .today-overview-metric {
  background: transparent;
  border: none;
  padding: 0;
  gap: 6px;
}

#view-today .today-overview-label {
  font-size: var(--text-sm);
  color: var(--muted);
  font-weight: 500;
}

#view-today .today-overview-value {
  font-size: var(--text-body);
  font-weight: 700;
}

/* Lighter, tighter section titles in cards */
#view-today .section-main-title {
  font-size: var(--text-base);
  font-weight: 600;
  padding-top: 0;
}

/* Tighten card header heights */
#view-today .card-header {
  min-height: auto;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border2);
  margin-bottom: 14px;
}

/* Goals subtabs — flatten */
#view-today .goals-tab {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  box-shadow: none;
  font-size: var(--text-sm);
}

#view-today .goals-tab:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-color: transparent;
}

#view-today .goals-tab.active {
  background: rgba(167, 139, 250, 0.1);
  border-color: rgba(167, 139, 250, 0.2);
  color: var(--accent);
  box-shadow: none;
}

/* Calendar day pills — flatten to match */
#view-today .calendar-day-pill {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  font-size: var(--text-sm);
  box-shadow: none;
}

#view-today .calendar-day-pill:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

#view-today .calendar-day-pill.active {
  background: rgba(167, 139, 250, 0.1);
  border-color: rgba(167, 139, 250, 0.2);
  color: var(--accent);
}

/* Band section separators */
#view-today .today-band-header {
  border-bottom-color: var(--border2);
}

/* ===================================
   FLAT & CLEAN: Active Clients View
   =================================== */

/* Remove outer panel box */
#view-clients .panel {
  background: transparent;
  border: none;
  padding: 0;
  margin-top: 0;
}

#view-clients .panel > * + * {
  margin-top: 0;
}

/* Flatten the sticky header — no more box, just a bottom border */
#view-clients .client-header-row.panel-header {
  background: var(--bg);
  border: none;
  border-bottom: 1px solid var(--border2);
  border-radius: 0;
  box-shadow: none;
  padding: 0 0 12px;
}

/* Keep sticky header opaque so it covers scrolled content */
#view-clients .client-header-sticky {
  background: var(--bg);
}

/* Client detail heading — shows selected client name */
#view-clients .client-header-main h2,
#view-clients .client-detail-heading {
  font-size: var(--text-xl);
  font-weight: 700;
  margin: 0;
}

/* Flatten subtabs — ghost inactive, accent active */
#view-clients .client-subtabs .btn {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  box-shadow: none;
}

#view-clients .client-subtabs .btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border-color: transparent;
}

#view-clients .client-subtabs .btn.active {
  background: rgba(167, 139, 250, 0.1);
  border-color: rgba(167, 139, 250, 0.2);
  color: var(--accent);
  box-shadow: none;
}

/* ===================================
   FLAT & CLEAN: All remaining views
   =================================== */

/* --- Outer panels: transparent, no box --- */
#view-sales .panel,
#view-inbox .panel,
#view-companies .panel,
#view-reporting .panel,
#view-planning .panel,
#view-settings .panel {
  background: transparent;
  border: none;
  padding: 0;
  margin-top: 0;
}

#view-sales .panel > * + *,
#view-inbox .panel > * + *,
#view-companies .panel > * + *,
#view-reporting .panel > * + *,
#view-planning .panel > * + *,
#view-settings .panel > * + * {
  margin-top: 0;
}

/* --- Header rows: flat with bottom border only --- */
#view-sales .client-header-row.panel-header,
#view-inbox .client-header-row.panel-header,
#view-companies .client-header-row.panel-header,
#view-settings .client-header-row.panel-header {
  background: var(--bg);
  border: none;
  border-bottom: 1px solid var(--border2);
  border-radius: 0;
  box-shadow: none;
  padding: 0 0 12px;
}

/* Inbox: normalize padding (excluded from the shared zero-padding rule) */
#view-inbox .client-select-row.panel-header {
  padding: 0;
  margin: 0;
}

/* Reporting: target .reporting-header directly (not just .panel-header variant) */
#view-reporting .reporting-header {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

#view-reporting .reporting-header.panel-header {
  background: var(--bg);
  border: none;
  border-bottom: 1px solid var(--border2);
  border-radius: 0;
  box-shadow: none;
  padding: 14px 0 12px;
}

/* Planning: match the (1,3,0) specificity rule at line 13515 */
#view-planning .client-select-row.client-header-row.panel-header {
  background: var(--bg);
  border: none;
  border-bottom: 1px solid var(--border2);
  border-radius: 0;
  box-shadow: none;
  padding: 14px 0 12px;
}

/* Planning: flatten the controls-wrap box and tighten the row */
#view-planning .planning-controls-wrap {
  background: transparent;
  border: none;
  padding: 0;
}
#view-planning .planning-controls-row {
  padding: 12px 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}
#view-planning .planning-rules {
  margin-top: 0;
}

/* Settings: also strip the .client-header-row rule (no .panel-header qualifier needed) */
#view-settings .client-header-row {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

/* --- Flatten .clients-row cards across all non-Today views --- */
#view-clients .clients-row,
#view-sales .clients-row,
#view-inbox .clients-row,
#view-companies .clients-row,
#view-reporting .clients-row,
#view-planning .clients-row,
#view-settings .clients-row {
  background: rgba(255, 255, 255, 0.016);
  border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  box-shadow: none;
}

/* Header rows override back to transparent/borderless (already handled per-view, reinforce here) */
#view-clients .clients-row.panel-header,
#view-sales .clients-row.panel-header,
#view-inbox .clients-row.panel-header,
#view-companies .clients-row.panel-header,
#view-reporting .clients-row.panel-header,
#view-planning .clients-row.panel-header,
#view-settings .clients-row.panel-header {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border2);
  border-radius: 0;
  box-shadow: none;
}

/* --- Sticky headers stay opaque --- */
#view-sales .client-header-sticky,
#view-inbox .client-header-sticky,
#view-companies .client-header-sticky {
  background: var(--bg);
}

/* Reporting sticky wrapper: override var(--panel) background */
#view-reporting .reporting-header-row {
  background: var(--bg);
  border: none;
  box-shadow: none;
}

/* --- Smaller, lighter headings --- */
#view-sales .client-header-main h2,
#view-inbox .client-header-main h2,
#view-companies .client-header-main h2,
#view-reporting .client-header-main h2,
#view-planning .client-header-main h2,
#view-settings .client-header-main h2 {
  font-size: var(--text-xl);
  font-weight: 700;
}

/* --- Subtabs: ghost inactive, accent active --- */
#view-sales .client-subtabs .btn,
#view-settings .settings-subtabs .btn,
#view-reporting .reporting-tabs .btn,
#view-reporting .range-buttons .btn {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  box-shadow: none;
}

#view-sales .client-subtabs .btn:hover,
#view-settings .settings-subtabs .btn:hover,
#view-reporting .reporting-tabs .btn:hover,
#view-reporting .range-buttons .btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border-color: transparent;
}

#view-sales .client-subtabs .btn.active,
#view-settings .settings-subtabs .btn.active,
#view-reporting .reporting-tabs .btn.active,
#view-reporting .range-buttons .btn.active {
  background: rgba(167, 139, 250, 0.1);
  border-color: rgba(167, 139, 250, 0.2);
  color: var(--accent);
  box-shadow: none;
}

/* --- Header layout: title above controls (Inbox, Reporting, Planning) --- */

/* Inbox: h2 full-width row 1, filters + actions unified toolbar row 2 */
#view-inbox .client-header-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
}
#view-inbox .client-header-main h2 {
  flex: 0 0 100%;
  margin: 0;
}
#view-inbox .client-select-controls {
  flex: 1 1 auto;
  min-width: 0;
}
#view-inbox .client-header-actions {
  flex: 0 0 auto;
  align-self: center;
}
#view-inbox .client-select-actions {
  flex-wrap: nowrap;
}

/* Reporting: h2 + tab buttons on row 1, date range buttons on row 2 */
#view-reporting .client-header-main {
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  align-items: start;
  gap: 10px 16px;
}
#view-reporting .client-header-main h2 {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
}
#view-reporting .reporting-controls.reporting-controls-header {
  grid-column: 1 / -1;
  grid-row: 2;
}
#view-reporting .reporting-tabs {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
}

/* Planning: stack h2 above scenario controls */
#view-planning .client-header-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

/* --- Companies: flatten table wrapper --- */
#view-companies .companies-table-wrapper {
  border-radius: var(--radius-md);
  border: 1px solid var(--border2);
  background: rgba(255, 255, 255, 0.016);
  box-shadow: none;
}
#view-companies .companies-table thead {
  background: transparent;
}

/* --- Settings: flatten the settings card --- */
#view-settings .card.settings-card {
  background: rgba(255, 255, 255, 0.016);
  border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  box-shadow: none;
  padding: 16px 18px;
}
#view-settings .settings-card-header {
  border-bottom: 1px solid var(--border2);
  margin-bottom: 4px;
}
#view-settings .settings-section + .settings-section {
  border-top-color: var(--border2);
}

/* ===================================
   MOBILE LAYOUT
   =================================== */

.mobile-bottom-nav {
  display: none;
}

/* Mobile back button: hidden on desktop */
.mobile-back-btn {
  display: none;
}

@media (max-width: 768px) {
  /* ── Sidebar ── */
  .sidebar {
    display: none !important;
  }

  /* ── Top bar ── */
  .top-bar {
    padding: 0 12px;
    height: 48px;
  }
  .top-bar-stats,
  .top-bar-divider {
    display: none;
  }
  .top-bar-actions {
    margin-left: auto;
  }
  .floating-timer {
    min-width: 0;
    flex: 1;
  }
  .floating-timer-panel {
    width: calc(100vw - 24px);
    left: 0;
  }

  /* ── Bottom navigation ── */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(58px + env(safe-area-inset-bottom, 0px));
    background: #0a0a0a;
    border-top: 1px solid var(--border);
    z-index: 1100;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .mobile-bottom-nav::-webkit-scrollbar { display: none; }

  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    min-width: 58px;
    padding: 6px 4px;
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    transition: color 0.15s ease;
  }
  .mobile-nav-item.active { color: var(--accent); }
  .mobile-nav-item svg { flex-shrink: 0; opacity: 0.6; }
  .mobile-nav-item.active svg { opacity: 1; }
  .mobile-nav-item .tab-count-pill {
    position: absolute;
    top: 5px;
    right: calc(50% - 18px);
    min-width: 16px;
    height: 16px;
    font-size: 9px;
    padding: 0 4px;
    line-height: 16px;
  }

  /* ── Hide floating timer from top-bar on mobile (sidecar handles timer) ── */
  .floating-timer,
  .floating-timer-backdrop {
    display: none !important;
  }
  .top-bar {
    justify-content: flex-end;
  }

  /* ── Content area ── */
  .content-area .wrap {
    padding: 12px 12px calc(58px + env(safe-area-inset-bottom, 0px) + 12px);
    overflow-y: auto;
    height: calc(100vh - 48px);
  }

  /* ── Mobile back button ── */
  .mobile-back-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    color: var(--accent);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 10px 0 8px;
    flex-shrink: 0;
  }

  /* ── Clients & Sales: slide-panel navigation ── */
  #view-clients .clients-layout,
  #view-sales .clients-layout {
    flex-direction: column !important;
    height: auto !important;
    overflow: visible !important;
  }

  /* List panel: full width, scrollable */
  #view-clients .client-list-panel,
  #view-sales .client-list-panel {
    width: 100% !important;
    border-right: none !important;
    border-bottom: 1px solid var(--border2);
    height: auto;
    max-height: none;
    overflow: visible;
  }
  #view-clients .client-list-items,
  #view-sales .client-list-items {
    max-height: 280px;
    overflow-y: auto;
  }

  /* Detail: hidden by default, shown when mobile-detail-open */
  #view-clients .client-detail-area,
  #view-sales .client-detail-area {
    display: none;
  }
  #view-clients .clients-layout.mobile-detail-open .client-list-panel,
  #view-sales .clients-layout.mobile-detail-open .client-list-panel {
    display: none;
  }
  #view-clients .clients-layout.mobile-detail-open .client-detail-area,
  #view-sales .clients-layout.mobile-detail-open .client-detail-area {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: visible;
  }

  /* Client/sales header: stack vertically */
  #view-clients .client-header-main,
  #view-sales .client-header-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  #view-clients .client-subtabs,
  #view-sales .client-subtabs {
    justify-content: flex-start !important;
    overflow-x: auto;
    flex-wrap: nowrap !important;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  #view-clients .client-subtabs::-webkit-scrollbar,
  #view-sales .client-subtabs::-webkit-scrollbar { display: none; }

  /* Client detail scroll area */
  #view-clients .client-header-sticky,
  #view-sales .client-header-sticky {
    position: static !important;
  }

  /* ── Inbox: split → single column ── */
  .inbox-split-layout {
    grid-template-columns: 1fr !important;
    height: auto !important;
    overflow: visible;
  }
  .inbox-preview-pane {
    display: none;
  }
  .inbox-split-layout.mobile-preview-open .inbox-list-pane {
    display: none;
  }
  .inbox-split-layout.mobile-preview-open .inbox-preview-pane {
    display: block;
  }
  .mobile-inbox-back {
    margin-bottom: 8px;
  }
  #view-inbox .panel.clients-layout > .clients-row:last-child {
    height: auto !important;
    min-height: 0 !important;
  }
  /* Inbox header filters: stack on mobile */
  #view-inbox .client-select-controls {
    flex-direction: column;
    gap: 8px;
  }
  #view-inbox .client-select-controls input,
  #view-inbox .client-select-controls select {
    width: 100%;
    min-width: 0;
  }

  /* ── Planning: fix select overflow ── */
  #view-planning .planning-header-scenario-field select {
    min-width: 0 !important;
    max-width: 100%;
    width: 100%;
  }
  #view-planning .planning-header-controls {
    justify-content: flex-start;
  }

  /* ── Reporting: table scroll ── */
  #view-reporting .clients-row,
  #view-reporting .clients-layout {
    overflow-x: auto;
  }
  #view-reporting table {
    min-width: 600px;
  }
  #view-reporting .reporting-kpis {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* ── General card / panel padding reduction ── */
  .clients-row {
    padding: 14px !important;
  }
  .clients-row.panel-header {
    padding: 14px 14px !important;
  }
  .panel {
    border-radius: var(--radius-md) !important;
    padding: 12px !important;
  }

  /* ── Today view ── */
  .today-layout {
    gap: 12px;
  }
  .today-tasks-header,
  .today-section-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  /* ── Modals: full screen on mobile ── */
  dialog {
    width: 100vw !important;
    max-width: 100vw !important;
    max-height: 92vh !important;
    margin: auto 0 0 !important;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
  }

  /* ── Hide desktop top-bar on mobile sidecar ── */
  #view-mobile-sidecar ~ * .top-bar,
  body:has(#view-mobile-sidecar.active) .top-bar-stats,
  body:has(#view-mobile-sidecar.active) .floating-timer {
    display: none;
  }
}

/* ===================================
   MOBILE SIDECAR
   (shown only on ≤768px via JS view system)
   =================================== */

#view-mobile-sidecar {
  display: none;
  flex-direction: column;
  gap: 14px;
  padding: 14px 14px calc(58px + env(safe-area-inset-bottom, 0px) + 14px);
}
#view-mobile-sidecar.active {
  display: flex;
}

/* Stats row */
.sc-stats-row {
  display: flex;
  align-items: stretch;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.sc-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 14px 8px;
  text-align: center;
}
.sc-stat-meeting {
  flex: 1.4;
}
.sc-stat-divider {
  width: 1px;
  background: var(--border2);
  flex-shrink: 0;
  margin: 10px 0;
}
.sc-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.sc-stat-meeting .sc-stat-value {
  font-size: 14px;
}
.sc-stat-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Card */
.sc-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.sc-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 0;
}
.sc-card-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
.sc-card-meta {
  font-size: 12px;
  color: var(--muted);
}

/* Timer card */
.sc-timer-card {
  transition: border-color 0.2s ease;
}
.sc-timer-running {
  border-color: rgba(91, 255, 146, 0.35);
  background: rgba(91, 255, 146, 0.04);
}
.sc-timer-paused {
  border-color: rgba(255, 224, 102, 0.35);
  background: rgba(255, 224, 102, 0.04);
}
.sc-timer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
}
.sc-timer-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.sc-timer-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  flex-shrink: 0;
  transition: background 0.2s ease;
}
.sc-indicator-running {
  background: #5bff92;
  box-shadow: 0 0 8px rgba(91,255,146,0.6);
  animation: sc-pulse 2s ease-in-out infinite;
}
.sc-indicator-paused {
  background: #ffe066;
}
@keyframes sc-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.sc-timer-client {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sc-timer-elapsed {
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}
.sc-timer-controls {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.sc-timer-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 16px 16px;
}
.sc-timer-form.hidden {
  display: none;
}

/* Sidecar buttons */
.sc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
  background: transparent;
  color: var(--text);
}
.sc-btn.hidden { display: none; }
.sc-btn-primary {
  background: rgba(167,139,250,0.9);
  border-color: rgba(167,139,250,0.9);
  color: #1a0a2e;
}
.sc-btn-ghost {
  background: rgba(255,255,255,0.07);
  border-color: var(--border2);
  color: var(--text);
}
.sc-btn-danger {
  border-color: rgba(255,107,107,0.6);
  color: var(--danger);
}
.sc-timer-start-btn {
  width: 100%;
  padding: 12px;
  font-size: 15px;
}

/* Selects */
.sc-select {
  width: 100%;
  padding: 10px 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  appearance: auto;
}

/* Quick actions row */
.sc-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.sc-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}
.sc-action-btn:hover, .sc-action-btn:active {
  background: rgba(255,255,255,0.08);
}

/* Task list */
.sc-task-list {
  padding: 8px 8px 8px;
}
.sc-task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: opacity 0.2s ease;
}
.sc-task-item:last-child {
  border-bottom: none;
}
.sc-task-priority {
  border-left: 3px solid var(--priority-accent);
  padding-left: 10px;
}
.sc-task-completing {
  opacity: 0.4;
  pointer-events: none;
}
.sc-task-check-btn {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  color: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.sc-task-check-btn:hover, .sc-task-check-btn:active {
  border-color: var(--accent);
  background: rgba(167,139,250,0.15);
  color: var(--accent);
}
.sc-task-body {
  flex: 1;
  min-width: 0;
}
.sc-task-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
}
.sc-task-client {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.sc-empty {
  padding: 20px 8px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}
.sc-loading {
  padding: 20px 8px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

/* ── Toast notifications ── */
#toast-container {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  max-width: 360px;
}
.toast {
  background: #1c1c1c;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm, 10px);
  font-size: 13px;
  pointer-events: all;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  line-height: 1.45;
  cursor: pointer;
  word-break: break-word;
}
.toast.toast-visible {
  opacity: 1;
  transform: translateY(0);
}
.toast.toast-error {
  border-color: rgba(255, 80, 80, 0.35);
  color: rgba(255, 160, 160, 0.95);
}
