/* Objectif Support (Workspace ▸ Objectif Support) — port of the Leads7 Support
   Objectif board. Tokens only (both themes flip through app.css variables);
   every class is sob-* so nothing here can restyle another s2 view. */

#supportObjectifView { background: var(--bg); }
.sob-head { gap: 12px; }
.sob-head h2 [data-lucide] { color: var(--wa); }
.sob-head-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sob-head-hint { font-size: 12px; color: var(--text-tertiary); white-space: nowrap; }
.sob-shell { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; }
.sob-body { padding: 16px 16px 28px; }
.sob-denied { padding: 48px 16px; text-align: center; color: var(--text-secondary); font-size: 14px; }

.sob-wrap { max-width: 1080px; margin: 0 auto; display: grid; gap: 16px; }
.sob-loading { padding: 32px 16px; text-align: center; color: var(--text-tertiary); font-size: 13px; }
.sob-error { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 36px 16px; text-align: center; }
.sob-error-text { font-size: 13px; color: var(--danger); max-width: 560px; }

/* Monthly / Weekly segmented control */
.sob-seg {
  display: flex; gap: 3px; padding: 3px; width: 100%; max-width: 280px; margin: 0 auto;
  background: var(--surface-sunken); border: 1px solid var(--border-subtle); border-radius: 11px;
}
.sob-seg-btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; border-radius: 8px; padding: 6px 14px;
  font-family: inherit; font-size: 13px; font-weight: 600; color: var(--text-tertiary); cursor: pointer;
  transition: background var(--motion-fast) var(--ease), color var(--motion-fast) var(--ease), box-shadow var(--motion-fast) var(--ease);
}
.sob-seg-btn:hover { color: var(--text-secondary); }
.sob-seg-btn.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.sob-seg-btn:focus-visible, .sob-count-btn:focus-visible, .sob-client-link:focus-visible,
.sob-side-link:focus-visible, .sob-chev:focus-visible, .sob-ext-link:focus-visible {
  outline: var(--focus-w) solid var(--focus); outline-offset: var(--focus-offset);
}

/* Period stepper */
.sob-nav { display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: -4px; }
.sob-stepper {
  display: inline-flex; align-items: center; gap: 2px; padding: 2px;
  border-radius: 8px; background: var(--surface-sunken); border: 1px solid var(--border-subtle);
}
.sob-chev { width: 26px; height: 26px; color: var(--text-tertiary); }
.sob-chev:disabled { opacity: .4; cursor: not-allowed; }
.sob-chev:disabled:hover { background: transparent; }
.sob-stepper-label {
  min-width: 112px; padding: 0 6px; text-align: center;
  font-size: 12px; font-weight: 600; color: var(--text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.sob-stepper-label-week { min-width: 170px; }

/* Hero */
.sob-hero {
  background: var(--surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: 22px 26px 24px;
}
.sob-hero.is-reached { border-color: var(--success); }
.sob-hero-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-tertiary); }
.sob-amount { display: flex; align-items: baseline; gap: 10px; margin: 10px 0 16px; }
.sob-amount-num {
  font-family: var(--font-display); font-variation-settings: "opsz" 144;
  font-size: clamp(36px, 4.2vw, 56px); font-weight: 550; line-height: 1; letter-spacing: -.015em;
  color: var(--text); font-variant-numeric: tabular-nums;
}
.sob-amount-cur { font-size: clamp(16px, 1.7vw, 22px); font-weight: 600; color: var(--text-tertiary); }
.sob-progress { display: flex; flex-direction: column; gap: 8px; }
.sob-progress-track { height: 10px; border-radius: var(--radius-pill); background: var(--surface-sunken); overflow: hidden; }
.sob-progress-fill {
  height: 100%; min-width: 2px; border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--wa), var(--lougha));
  transition: width .8s cubic-bezier(.2, .8, .2, 1);
}
.sob-progress-fill.is-done { background: var(--success); }
.sob-progress-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--text-secondary); }
.sob-progress-meta-week { margin-top: 4px; }
.sob-progress-pct { font-size: 14px; color: var(--text); font-variant-numeric: tabular-nums; }
.sob-progress-obj { font-variant-numeric: tabular-nums; }
.sob-progress-reste { color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
.sob-progress-reste.is-done { color: var(--success); font-weight: 600; }
.sob-restsplit { font-variant-numeric: tabular-nums; color: var(--text-tertiary); }
.sob-rest-accent { color: var(--info); }

/* Cards */
.sob-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
.sob-card {
  background: var(--surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); min-width: 0;
}
.sob-board { overflow: hidden; }
.sob-card-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 16px 12px; border-bottom: 1px solid var(--border-subtle);
}
.sob-card-title { font-size: 14px; font-weight: 650; color: var(--text); }
.sob-card-sub { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }
.sob-card-objline { font-size: 12px; color: var(--text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Leaderboard rows */
.sob-row {
  display: grid; grid-template-columns: 24px 32px minmax(0, 1fr) auto auto;
  align-items: center; column-gap: 12px; row-gap: 4px;
  padding: 10px 16px; border-bottom: 1px solid var(--border-subtle);
}
.sob-row:last-child { border-bottom: 0; }
.sob-row.is-top { background: var(--wa-soft); box-shadow: inset 3px 0 0 var(--wa); }
.sob-rank { font-size: 13px; color: var(--text-tertiary); font-variant-numeric: tabular-nums; text-align: center; }
.sob-rank.is-podium { font-family: var(--font-display); font-size: 15px; font-weight: 600; color: var(--text); }
.avatar.sob-avatar { width: 32px; height: 32px; font-size: 12px; }
.sob-name { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-size: 14px; font-weight: 550; color: var(--text); }
.sob-name-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sob-crown { display: inline-flex; flex: none; color: var(--amber-500); }
.sob-crown svg { width: 15px; height: 15px; }
.sob-chips { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.sob-count-btn {
  font-family: inherit; font-size: 11px; font-weight: 600; line-height: 1.5; white-space: nowrap;
  padding: 3px 10px; border-radius: var(--radius-pill); border: 1px solid transparent;
  background: var(--gray-100); color: var(--text-secondary); cursor: pointer; font-variant-numeric: tabular-nums;
  transition: background-color var(--motion-fast) var(--ease), color var(--motion-fast) var(--ease), border-color var(--motion-fast) var(--ease), transform .08s ease;
}
.sob-count-btn:hover { background: var(--gray-200); color: var(--text); border-color: var(--border-subtle); }
.sob-count-btn:active { transform: scale(.97); }
.sob-total { text-align: right; min-width: 104px; }
.sob-total-num { font-size: 16px; font-weight: 750; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -.01em; white-space: nowrap; }
.sob-total-split { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 2px; font-size: 11px; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
.sob-total-paid, .sob-total-rest { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.sob-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); flex: none; }
.sob-total-rest .sob-dot { background: var(--info); }
.sob-row-progress { grid-column: 3 / -1; display: flex; align-items: center; gap: 8px; }
.sob-row-track { flex: 1; height: 4px; border-radius: var(--radius-pill); background: var(--surface-sunken); overflow: hidden; }
.sob-row-fill { height: 100%; min-width: 2px; border-radius: var(--radius-pill); background: linear-gradient(90deg, var(--wa), var(--lougha)); }
.sob-row-fill.is-done { background: var(--success); }
.sob-row-pct { min-width: 34px; text-align: right; font-size: 11px; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
.sob-row-pct.is-done { color: var(--success); font-weight: 600; }
.sob-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 36px 24px; text-align: center; }
.sob-empty-ic { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--wa-soft); color: var(--wa); }
.sob-empty-ic svg { width: 22px; height: 22px; }
.sob-empty-txt { font-size: 13px; color: var(--text-secondary); max-width: 320px; }

/* Side stats */
.sob-side { display: flex; flex-direction: column; gap: 14px; padding: 16px; }
.sob-stat { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sob-stat-num {
  font-family: var(--font-display); font-variation-settings: "opsz" 144;
  font-size: 24px; font-weight: 550; line-height: 1.1; color: var(--text); font-variant-numeric: tabular-nums;
}
.sob-stat-num.is-owed { color: var(--text); }
.sob-stat-num.is-good { color: var(--success); }
.sob-stat-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-tertiary); }
.sob-side-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 2px; padding: 8px 10px; border: 1px solid var(--border-subtle); border-radius: var(--radius);
  background: transparent; color: var(--text-secondary); font-family: inherit; font-size: 13px; font-weight: 550; cursor: pointer;
  transition: background var(--motion-fast) var(--ease), color var(--motion-fast) var(--ease);
}
.sob-side-link:hover { background: var(--surface-hover); color: var(--text); }
.sob-side-link svg { width: 15px; height: 15px; }

/* Tables (inline detail + popup) */
.sob-detail-box { padding: 12px 16px 16px; }
.sob-table-scroll { max-height: 56vh; overflow: auto; border: 1px solid var(--border-subtle); border-radius: 10px; }
.sob-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sob-table th {
  position: sticky; top: 0; z-index: 1; background: var(--surface-sunken);
  text-align: left; padding: 8px 12px; white-space: nowrap;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-tertiary);
}
.sob-table td { padding: 8px 12px; border-top: 1px solid var(--border-subtle); color: var(--text); white-space: nowrap; }
.sob-table tbody tr:hover td { background: var(--surface-hover); }
.sob-table .sob-td-num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.sob-td-idx, .sob-td-date { color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
.sob-td-muted { color: var(--text-secondary); }
.sob-td-client { max-width: 260px; }
.sob-client-inner { display: flex; align-items: center; min-width: 0; }
.sob-client-link {
  flex: 0 1 auto; min-width: 0; max-width: 100%; padding: 0; border: 0; background: none;
  color: var(--wa-dark); font: inherit; font-weight: 550; cursor: pointer; text-align: left;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
[data-theme="dark"] .sob-client-link { color: var(--wa); }
.sob-client-link:hover { text-decoration: underline; }
.sob-client-name { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sob-moved-badge {
  flex: 0 0 auto; margin-left: 6px; padding: 1px 7px; border-radius: var(--radius-pill); cursor: help;
  font-size: 10.5px; font-weight: 650; line-height: 1.6; white-space: nowrap;
  color: var(--accent); background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
}
.sob-kind {
  display: inline-block; padding: 1px 8px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 600; white-space: nowrap;
  color: var(--text-secondary); background: var(--surface-sunken);
}
.sob-kind.is-rest { color: var(--info); background: var(--info-soft); }
.sob-table-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 4px 0; font-size: 13px; color: var(--text-secondary); }
.sob-table-total { color: var(--text); font-variant-numeric: tabular-nums; }
.sob-table-empty { padding: 28px; text-align: center; color: var(--text-secondary); font-size: 13px; }
.sob-table-empty.is-error { color: var(--danger); }

/* Popup: 9 columns, wider than modal-lg but capped to the viewport (16px gutters) */
.sob-ocp-card { max-width: min(1180px, calc(100vw - 32px)); }
.sob-ocp-head { min-width: 0; }
.sob-ocp-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sob-ocp-body { padding: 16px 20px; }
.sob-ocp-table { table-layout: fixed; min-width: 100%; }
.sob-ocp-table th, .sob-ocp-table td { overflow: hidden; text-overflow: ellipsis; }
.sob-ocp-table .sob-td-fill { padding-left: 0; padding-right: 0; }
.sob-ocp-table td.sob-td-client { max-width: none; }
.sob-col-resize {
  position: absolute; top: 0; right: 0; width: 10px; height: 100%;
  cursor: col-resize; user-select: none; touch-action: none; z-index: 2;
}
.sob-col-resize::after {
  content: ''; position: absolute; right: 4px; top: 25%; bottom: 25%; width: 2px; border-radius: 1px;
  background: var(--border-strong); opacity: .5; transition: opacity var(--motion-fast) var(--ease), background var(--motion-fast) var(--ease);
}
.sob-col-resize:hover::after, .sob-col-resize.is-dragging::after { top: 0; bottom: 0; opacity: 1; background: var(--wa); border-radius: 0; }
body.sob-col-resizing, body.sob-col-resizing * { cursor: col-resize !important; user-select: none !important; }
.sob-ocp-foot { justify-content: flex-start; padding: 10px 20px; }
.sob-ext-link { font-size: 12px; color: var(--text-tertiary); text-decoration: none; border-radius: 4px; }
.sob-ext-link:hover { color: var(--text-secondary); text-decoration: underline; }

/* 13" laptops and below */
@media (max-width: 1280px) {
  .sob-wrap { gap: 12px; }
  .sob-hero { padding: 18px 20px 20px; }
  .sob-grid { grid-template-columns: minmax(0, 1fr) 240px; gap: 12px; }
}
@media (max-width: 1024px) {
  .sob-grid { grid-template-columns: minmax(0, 1fr); }
  .sob-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); align-items: end; }
  .sob-side-link { grid-column: 1 / -1; }
  .sob-head-hint { display: none; }
}
@media (max-width: 640px) {
  .sob-body { padding: 12px 12px 24px; }
  .sob-row { grid-template-columns: 24px 32px minmax(0, 1fr) auto; }
  .sob-chips { grid-column: 3 / 4; justify-content: flex-start; }
  .sob-total { grid-column: 4 / 5; grid-row: 1 / 3; align-self: center; }
  .sob-row-progress { grid-column: 3 / -1; }
  .sob-ocp-body { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .sob-progress-fill, .sob-seg-btn, .sob-count-btn, .sob-side-link { transition: none; }
  .sob-count-btn:active { transform: none; }
}
