:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #182230;
  --muted: #667085;
  --line: #d6deea;
  --line-soft: #e8edf5;
  --accent: #2563eb;
  --accent-soft: #eff6ff;
  --ok: #0f766e;
  --attention: #b7791f;
  --urgent: #b42318;
  --error-bg: #fff1f2;
  --error-text: #9f1239;
  --shadow: 0 12px 34px rgba(15, 23, 42, 0.07);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  letter-spacing: 0;
}

.visually-hidden {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  align-items: center;
  background: var(--panel);
  border-bottom: 1px solid var(--line-soft);
  color: var(--text);
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr auto 1fr;
  padding: 10px 22px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.brand {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0;
}

.nav-menu-wrap {
  justify-self: center;
  position: relative;
}

.nav-toggle {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  height: 38px;
  justify-content: center;
  padding: 0;
  width: 42px;
}

.nav-toggle span {
  background: var(--text);
  border-radius: 999px;
  display: block;
  height: 2px;
  width: 18px;
}

.nav {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
  display: none;
  gap: 6px;
  left: 50%;
  min-width: 230px;
  padding: 8px;
  position: absolute;
  top: calc(100% + 8px);
  transform: translateX(-50%);
  z-index: 40;
}

.nav-menu-wrap.open .nav {
  display: grid;
}

.nav-link,
.ghost-link {
  color: inherit;
  text-decoration: none;
}

.nav-link {
  border-radius: 8px;
  color: var(--muted);
  display: block;
  font-weight: 650;
  padding: 9px 10px;
  white-space: nowrap;
}

.nav-link.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.content {
  padding: 22px;
}

.page-header {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.page-header h1 {
  font-size: 32px;
  line-height: 1.05;
  margin-bottom: 4px;
}

.page-header p,
.muted {
  color: var(--muted);
}

.filters {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 14px;
}

.filter-grid {
  align-items: start;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.filter-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-row-primary {
  align-items: stretch;
}

input,
select,
button {
  font: inherit;
  letter-spacing: 0;
}

input,
select {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  min-height: 36px;
  padding: 7px 10px;
}

.filters input,
.filters select,
.filters .custom-select,
.filters .primary-button,
.filters .ghost-link,
.period-dropdown {
  min-width: 0;
  width: 100%;
}

input[type="search"] {
  min-width: 0;
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 17px) 50%,
    calc(100% - 12px) 50%;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
  padding-right: 34px;
  text-overflow: ellipsis;
}

.duration-filter {
  max-width: none;
}

.date-range-filter {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  grid-template-columns: minmax(122px, 1fr) minmax(0, 1.2fr) minmax(0, 1.2fr);
  min-height: 36px;
  padding: 0 6px 0 10px;
}

.date-range-filter span {
  color: #7b8494;
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.date-range-filter input {
  border: 0;
  min-height: 32px;
  padding: 4px 2px;
}

.custom-select {
  min-width: 0;
  position: relative;
}

.custom-select-trigger {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  min-height: 36px;
  padding: 7px 12px;
  text-align: left;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
  width: 100%;
}

.custom-select-trigger:hover {
  border-color: #b9c6d8;
}

.custom-select.is-placeholder .custom-select-trigger,
.duration-filter::placeholder,
.filter-search::placeholder {
  color: #7b8494;
}

.custom-select-trigger span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-menu {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
  display: none;
  left: 0;
  max-height: 260px;
  min-width: 100%;
  overflow: auto;
  padding: 6px;
  position: absolute;
  top: calc(100% + 6px);
  z-index: 45;
}

.custom-select.open .custom-select-menu {
  display: grid;
  gap: 3px;
}

.custom-select-option {
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  display: block;
  font: inherit;
  min-height: 32px;
  padding: 6px 8px;
  text-align: left;
  white-space: nowrap;
}

.custom-select-option:hover,
.custom-select-option.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.custom-multi-select .custom-select-menu {
  min-width: 260px;
}

.multi-menu-tools {
  background: var(--panel);
  border-bottom: 1px solid var(--line-soft);
  display: grid;
  gap: 6px;
  margin: -6px -6px 4px;
  padding: 6px;
  position: sticky;
  top: -6px;
  z-index: 1;
}

.multi-search {
  min-height: 32px;
  width: 100%;
}

.multi-option {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 18px minmax(0, 1fr);
}

.custom-multi-select [data-custom-multi-option][hidden] {
  display: none;
}

.multi-option span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.option-check {
  color: var(--accent);
  font-weight: 800;
  text-align: center;
}

.multi-clear {
  color: var(--muted);
}

.filter-period {
  grid-column: span 4;
}

.filter-search {
  grid-column: span 8;
}

.filter-control {
  grid-column: span 4;
}

.filter-actions {
  display: grid;
  gap: 8px;
  grid-column: span 4;
  grid-template-columns: minmax(0, 1fr) minmax(86px, auto);
}

.filter-state-note {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  color: var(--muted);
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  justify-self: start;
  min-height: 30px;
  padding: 5px 9px;
}

.stage-history-note {
  display: block;
  line-height: 1.35;
  max-width: 100%;
}

.primary-button,
.ghost-button,
.ghost-link,
.period-trigger,
.period-item,
.period-apply,
.period-reset {
  align-items: center;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  min-height: 36px;
  padding: 7px 11px;
}

.compact-button {
  min-height: 32px;
  padding: 5px 9px;
}

.primary-button {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: white;
  font-weight: 650;
}

.ghost-button,
.ghost-link {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
}

.danger-button {
  color: var(--urgent);
}

.logout-form {
  justify-self: end;
  margin: 0;
}

.sidebar .ghost-button {
  width: auto;
}

.suvvy-confirm-modal[hidden] {
  display: none;
}

.suvvy-confirm-modal {
  align-items: center;
  display: grid;
  inset: 0;
  padding: 20px;
  position: fixed;
  z-index: 120;
}

.suvvy-confirm-modal-backdrop {
  background: rgba(15, 23, 42, 0.44);
  inset: 0;
  position: absolute;
}

.suvvy-confirm-modal-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 26px 72px rgba(15, 23, 42, 0.24);
  justify-self: center;
  max-width: 430px;
  padding: 20px;
  position: relative;
  width: min(100%, 430px);
  z-index: 1;
}

.suvvy-confirm-modal-card h2 {
  font-size: 20px;
  line-height: 1.2;
  margin-bottom: 8px;
}

.suvvy-confirm-modal-card p {
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 18px;
}

.suvvy-confirm-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.period-dropdown {
  position: relative;
  z-index: 25;
}

.period-trigger {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--line);
  color: var(--text);
  gap: 8px;
  height: 100%;
  justify-content: space-between;
  min-height: 36px;
  overflow: hidden;
  text-align: left;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
  width: 100%;
}

.period-trigger:hover {
  border-color: #b9c6d8;
}

.period-dropdown.open .period-trigger {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.period-trigger span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chevron {
  border-bottom: 2px solid var(--muted);
  border-right: 2px solid var(--muted);
  display: inline-block;
  height: 8px;
  margin-top: -3px;
  transform: rotate(45deg);
  width: 8px;
}

.period-menu {
  background: var(--panel);
  border: 1px solid #c7d2e3;
  border-radius: 8px;
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.18);
  display: none;
  left: 0;
  min-width: 344px;
  padding: 10px;
  position: absolute;
  top: calc(100% + 8px);
  z-index: 55;
}

.period-dropdown.open .period-menu {
  display: grid;
  gap: 6px;
}

.period-menu-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 5px 4px 3px;
  text-transform: uppercase;
}

.period-item,
.period-reset {
  background: transparent;
  border: 0;
  color: var(--text);
  justify-content: flex-start;
  width: 100%;
}

.period-item:hover,
.period-item.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.period-item.active {
  font-weight: 750;
}

.period-divider {
  border-top: 1px solid var(--line-soft);
  margin: 4px 0;
}

.period-custom {
  align-items: center;
  display: grid;
  gap: 6px;
  grid-template-columns: 1fr 1fr auto;
}

.period-custom input {
  min-width: 0;
  width: 100%;
}

.period-hint {
  color: var(--muted);
  font-size: 13px;
}

.period-apply {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: white;
  font-weight: 700;
}

.period-reset {
  color: var(--muted);
  margin-top: 2px;
}

.advanced-filters {
  border-top: 1px solid var(--line-soft);
  margin-top: 4px;
  padding-top: 8px;
}

.advanced-filters summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  list-style: none;
  width: max-content;
}

.advanced-filters summary::-webkit-details-marker {
  display: none;
}

.advanced-filters summary::after {
  border-bottom: 2px solid var(--muted);
  border-right: 2px solid var(--muted);
  content: "";
  display: inline-block;
  height: 6px;
  margin-bottom: 2px;
  margin-left: 8px;
  transform: rotate(45deg);
  width: 6px;
}

.advanced-filters[open] summary::after {
  margin-bottom: -2px;
  transform: rotate(225deg);
}

.advanced-filter-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 8px;
}

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

.bulk-form {
  display: grid;
  gap: 10px;
}

.bulk-bar {
  align-items: stretch;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(150px, 190px) minmax(0, 1fr);
  overflow: visible;
  padding: 12px;
}

.bulk-title-block {
  align-content: center;
  background: var(--panel-soft);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  display: grid;
  gap: 2px;
  min-height: 42px;
  padding: 7px 10px;
}

.bulk-title {
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.bulk-subtitle {
  color: var(--muted);
  font-size: 12px;
}

.bulk-actions {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(170px, 1.2fr) minmax(150px, 0.9fr) minmax(74px, 0.45fr) minmax(96px, 0.55fr) minmax(116px, 0.7fr);
  min-width: 0;
}

.bulk-target {
  min-height: 32px;
  min-width: 0;
}

.bulk-actions .compact-button {
  width: 100%;
}

.call-card,
.detail-layout section,
.login-panel,
.loader-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.call-card {
  position: relative;
  padding: 14px 16px;
}

.call-select {
  align-items: center;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  gap: 6px;
  margin-bottom: 7px;
}

.call-select input {
  accent-color: var(--accent);
  height: 16px;
  margin: 0;
  min-height: 0;
  padding: 0;
  width: 16px;
}

.call-card-top {
  align-items: flex-start;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.call-heading {
  min-width: 0;
}

.call-title {
  font-size: 19px;
  font-weight: 800;
  line-height: 1.2;
}

.title-link {
  color: inherit;
  text-decoration-color: rgba(37, 99, 235, 0.38);
  text-underline-offset: 3px;
}

.title-link:hover {
  color: var(--accent);
}

.call-meta,
.label {
  color: var(--muted);
  font-size: 13px;
}

.badges,
.card-actions,
.call-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badges {
  justify-content: flex-end;
}

.badge {
  background: #edf2f7;
  border-radius: 999px;
  color: #344054;
  font-size: 12px;
  font-weight: 650;
  padding: 4px 8px;
  white-space: nowrap;
}

.lifecycle-chip {
  align-items: center;
  display: inline-flex;
  gap: 4px;
  max-width: min(100%, 320px);
  overflow: hidden;
}

.lifecycle-chip strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-stage-chip {
  background: #fef3c7;
  color: #92400e;
}

.deal-stage-chip {
  background: #ccfbf1;
  color: var(--ok);
}

.measurement-stage-chip {
  background: #ecfdf5;
  color: #047857;
}

.fact-chip {
  align-items: center;
  background: var(--panel-soft);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 12px;
  gap: 4px;
  padding: 4px 8px;
  white-space: nowrap;
}

.fact-chip strong {
  color: var(--text);
}

.focus-chip {
  background: #fff7ed;
  border-color: #fed7aa;
  color: var(--attention);
}

.badge.status-ready {
  background: #ccfbf1;
  color: var(--ok);
}

.badge.status-no_recording {
  background: #f1f5f9;
  color: var(--muted);
}

.badge.status-not_queued {
  background: #eef2ff;
  color: #3730a3;
}

.product-chip {
  background: #eef2ff;
  color: #3730a3;
}

.measurement-yes {
  background: #ecfdf5;
  border-color: #bbf7d0;
  color: #047857;
}

.measurement-no {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #be123c;
}

.measurement-unclear {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.measurement-not_applicable {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #64748b;
}

.badge.status-failed,
.badge.status-unrecoverable,
.badge.attention-urgent {
  background: #fee2e2;
  color: var(--urgent);
}

.badge.attention-attention {
  background: #fef3c7;
  color: var(--attention);
}

.definition-grid {
  display: grid;
  gap: 8px;
}

.call-tags {
  margin: 10px 0;
}

.value {
  font-weight: 750;
}

.summary {
  font-size: 16px;
  line-height: 1.5;
  margin-bottom: 10px;
}

.attention-note {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  color: #7c2d12;
  font-size: 14px;
  line-height: 1.45;
  margin: 0 0 10px;
  padding: 8px 10px;
}

.excerpt {
  border-left: 3px solid var(--accent);
  color: #334155;
  line-height: 1.45;
  margin: 10px 0;
  padding-left: 12px;
}

.error-box {
  background: var(--error-bg);
  border: 1px solid #fecdd3;
  border-radius: 8px;
  color: var(--error-text);
  margin: 10px 0;
  padding: 9px 11px;
}

.card-actions {
  margin-top: 10px;
}

.transcript {
  background: #0f172a;
  border-radius: 8px;
  color: #e5e7eb;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 0;
  max-height: 320px;
  overflow: auto;
  padding: 12px;
  white-space: pre-wrap;
}

.transcript.full {
  max-height: none;
}

.pagination {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 18px 0;
}

.pagination a {
  color: var(--accent);
}

.empty-state {
  background: var(--panel);
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 28px;
  text-align: center;
}

.metric-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 14px;
}

.source-metric-grid {
  display: flex;
  flex-wrap: wrap;
}

.source-metric-grid .metric-card {
  flex: 1 1 170px;
}

.metric-card,
.table-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric-card {
  display: grid;
  gap: 4px;
  min-height: 82px;
  padding: 13px 14px;
}

.metric-card span {
  color: var(--muted);
  font-size: 13px;
}

.metric-card strong {
  font-size: 26px;
  line-height: 1;
}

.metric-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.metric-warning {
  border-color: #fde68a;
  background: #fffbeb;
}

.metric-card-link {
  color: inherit;
  text-decoration: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.metric-card-link:hover {
  border-color: #b9c6d8;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
}

.report-section {
  margin-bottom: 14px;
  min-width: 0;
}

.report-heading {
  align-items: flex-end;
  margin-bottom: 8px;
}

.report-heading h2 {
  font-size: 20px;
  line-height: 1.15;
  margin-bottom: 2px;
}

.report-heading p {
  margin-bottom: 0;
}

.report-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
  margin-bottom: 14px;
  min-width: 0;
}

.report-layout-panel {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
  margin-bottom: 14px;
  padding: 0;
}

.report-layout-summary {
  cursor: pointer;
  font-weight: 750;
  list-style: none;
  padding: 12px 14px;
}

.report-layout-summary::-webkit-details-marker {
  display: none;
}

.report-layout-summary::after {
  color: var(--muted);
  content: "+";
  float: right;
  font-weight: 800;
}

.report-layout-panel[open] .report-layout-summary::after {
  content: "-";
}

.report-layout-panel form {
  border-top: 1px solid var(--line-soft);
  display: grid;
  gap: 12px;
  padding: 12px 14px 14px;
}

.report-layout-options {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.report-layout-option {
  align-items: center;
  background: var(--panel-soft);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
}

.report-layout-option input {
  margin: 0;
}

.report-layout-option input[type="checkbox"] {
  accent-color: var(--accent);
  height: 16px;
  min-height: 0;
  padding: 0;
  width: 16px;
}

.report-layout-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.report-table {
  min-width: 980px;
}

.manager-report-table {
  min-width: 1180px;
}

.report-definition {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.review-call-list {
  display: grid;
  gap: 8px;
}

.review-call-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 12px 14px;
}

.review-call-title {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.25;
}

.review-call-item .summary {
  font-size: 14px;
  margin: 8px 0 0;
}

.review-call-item .excerpt {
  font-size: 13px;
  margin-bottom: 0;
}

.review-call-side {
  align-content: start;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hour-matrix-panel {
  max-height: 520px;
}

.hour-matrix-table {
  min-width: 1540px;
  table-layout: fixed;
}

.hour-matrix-table th:first-child,
.hour-matrix-table td:first-child {
  min-width: 190px;
  text-align: left;
  width: 220px;
}

.hour-matrix-table th,
.hour-matrix-table td {
  padding: 6px 8px;
  text-align: right;
  vertical-align: middle;
}

.hour-matrix-table .hour-work-col {
  width: 86px;
}

.hour-matrix-table .hour-boundary-col {
  width: 92px;
}

.hour-matrix-table .hour-unknown-col {
  width: 112px;
}

.hour-matrix-table .hour-total-col {
  width: 104px;
}

.hour-matrix-table thead th,
.hour-matrix-table tfoot th,
.hour-matrix-table tfoot td {
  background: var(--panel-soft);
  position: sticky;
  z-index: 3;
}

.hour-matrix-table thead th {
  top: 0;
}

.hour-matrix-table tfoot th,
.hour-matrix-table tfoot td {
  bottom: 0;
}

.hour-cell {
  color: var(--text);
  display: grid;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  gap: 2px;
  line-height: 1.15;
  text-transform: none;
}

.hour-cell-row {
  align-items: baseline;
  display: flex;
  gap: 6px;
  justify-content: space-between;
}

.hour-cell-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.hour-cell-value {
  color: var(--text);
  font-weight: 600;
}

.hour-cell-total .hour-cell-value {
  font-weight: 800;
}

.hour-cell-empty {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-transform: none;
}

.hour-cell-zero {
  background: var(--panel-soft);
}

.table-panel {
  max-width: 100%;
  min-width: 0;
  overflow: auto;
}

.suvvy-metric-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.suvvy-report-filter-grid {
  grid-template-columns: repeat(8, minmax(0, 1fr));
}

.suvvy-report-filter-grid .filter-period {
  grid-column: span 5;
}

.suvvy-report-filter-grid .filter-actions {
  grid-column: span 3;
}

.suvvy-report-metric-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.suvvy-table-panel {
  margin-bottom: 14px;
}

.suvvy-table {
  min-width: 1120px;
  table-layout: fixed;
}

.suvvy-table th,
.suvvy-table td {
  vertical-align: top;
  white-space: normal;
}

.suvvy-table th:nth-child(1),
.suvvy-table td:nth-child(1) {
  width: 28%;
}

.suvvy-table th:nth-child(2),
.suvvy-table td:nth-child(2) {
  width: 12%;
}

.suvvy-table th:nth-child(5),
.suvvy-table td:nth-child(5) {
  width: 14%;
}

.suvvy-table th:nth-child(6),
.suvvy-table td:nth-child(6) {
  width: 10%;
}

.suvvy-lead-title {
  font-weight: 800;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suvvy-snippet {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  margin-top: 3px;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suvvy-control-stack,
.suvvy-actions {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.suvvy-actions {
  margin-top: 0;
}

.suvvy-report-table-panel {
  margin-bottom: 14px;
}

.suvvy-report-table {
  min-width: 980px;
  table-layout: fixed;
}

.suvvy-report-detail-table {
  min-width: 1120px;
  table-layout: fixed;
}

.suvvy-report-table th,
.suvvy-report-table td,
.suvvy-report-detail-table th,
.suvvy-report-detail-table td {
  vertical-align: top;
}

.suvvy-report-table th:nth-child(1),
.suvvy-report-table td:nth-child(1) {
  width: 14%;
}

.suvvy-report-table th:nth-child(2),
.suvvy-report-table td:nth-child(2),
.suvvy-report-detail-table th:nth-child(2),
.suvvy-report-detail-table td:nth-child(2) {
  width: 20%;
}

.source-report-table-panel {
  --source-col-1: 190px;
  --source-col-2: 300px;
  --source-cell-pad-x: 12px;
  --source-drill-control: 22px;
  --source-drill-gap: 8px;
  --source-text-offset: calc(var(--source-cell-pad-x) + var(--source-drill-control) + var(--source-drill-gap));
  max-height: calc(100vh - 88px);
  overscroll-behavior: contain;
  position: relative;
}

.data-table {
  border-collapse: collapse;
  min-width: 860px;
  width: 100%;
}

.source-report-table {
  min-width: 1480px;
  table-layout: fixed;
}

.source-report-v2-table-panel {
  --source-col-1: 300px;
  --source-col-2: 260px;
}

.source-report-v2-table {
  min-width: 1740px;
}

.source-report-table .source-type-col {
  width: var(--source-col-1);
}

.source-report-table .lead-source-col {
  width: var(--source-col-2);
}

.source-report-table .source-lead-source-col {
  width: var(--source-col-1);
}

.source-report-table .source-type-detail-col {
  width: var(--source-col-2);
}

.source-report-table .source-metric-col {
  width: 96px;
}

.source-report-table .source-rate-col {
  width: 118px;
}

.source-report-table .source-rate-col-wide {
  width: 140px;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line-soft);
  padding: 10px 12px;
  text-align: left;
  white-space: nowrap;
}

.data-table th {
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.source-report-table thead {
  position: sticky;
  top: 0;
  z-index: 6;
}

.source-report-table th.source-sticky-col-1 {
  padding-left: var(--source-text-offset);
}

.source-report-table .source-sticky-col {
  background: var(--panel);
  position: sticky;
}

.source-report-table thead .source-sticky-col {
  background: var(--panel-soft);
  z-index: 9;
}

.source-report-table .source-sticky-col-1 {
  left: 0;
  z-index: 4;
}

.source-report-table .source-sticky-col-2 {
  box-shadow: 8px 0 14px rgba(15, 23, 42, 0.06);
  left: var(--source-col-1);
  z-index: 4;
}

.data-table .summary-row td {
  background: #f9fbff;
  border-bottom-color: #cbd7ea;
  color: var(--text);
  font-weight: 800;
}

.data-table .summary-row td:first-child {
  color: var(--accent);
}

.source-report-table .summary-row .source-sticky-col {
  background: #f9fbff;
}

.source-report-table .source-parent-row .source-sticky-col {
  background: var(--panel);
}

.source-report-table .source-child-row .source-sticky-col,
.source-report-table .source-type-child-row .source-sticky-col {
  background: #fbfdff;
}

.source-type-summary {
  color: var(--muted);
  font-weight: 700;
}

.source-cell {
  align-items: center;
  display: flex;
  gap: var(--source-drill-gap);
  min-width: 0;
}

.source-cell span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-drill-toggle,
.source-drill-spacer {
  flex: 0 0 var(--source-drill-control);
  height: var(--source-drill-control);
  width: var(--source-drill-control);
}

.source-drill-toggle {
  align-items: center;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  padding: 0;
}

.source-drill-toggle:hover,
.source-drill-toggle[aria-expanded="true"] {
  background: #eef4ff;
  border-color: #c8d8f3;
  color: var(--accent);
}

.source-drill-icon {
  display: inline-block;
  font-size: 18px;
  line-height: 1;
  transform-origin: center;
  transition: transform 0.16s ease;
}

.source-drill-toggle[aria-expanded="true"] .source-drill-icon {
  transform: rotate(90deg);
}

.data-table .source-drill-row td {
  background: #fbfdff;
  color: #41516a;
  font-size: 13px;
}

.source-report-table .source-drill-row .source-sticky-col {
  background: #fbfdff;
}

.data-table .source-drill-row-muted td {
  background: #fcfcfd;
  color: var(--muted);
}

.source-report-table .source-drill-row-muted .source-sticky-col {
  background: #fcfcfd;
}

.source-drill-kind {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.data-table td.source-drill-utm-cell {
  min-width: 0;
  white-space: normal;
}

.utm-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 100%;
  min-width: 0;
}

.utm-chip {
  align-items: center;
  background: #eef4ff;
  border: 1px solid #d8e4f8;
  border-radius: 6px;
  color: var(--text);
  display: inline-flex;
  max-width: 100%;
  min-width: 0;
}

.utm-chip-key {
  border-right: 1px solid #d8e4f8;
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 6px;
}

.utm-chip-value {
  display: inline-block;
  min-width: 0;
  overflow: hidden;
  padding: 3px 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.utm-empty-label {
  color: var(--muted);
  font-weight: 700;
}

.sort-link {
  align-items: center;
  color: inherit;
  display: inline-flex;
  gap: 4px;
  text-decoration: none;
}

.sort-link:hover,
.sort-link.active {
  color: var(--accent);
}

.sort-mark {
  font-size: 12px;
  line-height: 1;
}

.detail-layout {
  display: grid;
  gap: 14px;
}

.detail-layout section {
  padding: 16px;
}

.section-heading-row {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.section-heading-row form {
  margin: 0;
}

.loader-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 14px;
}

.loader-panel {
  padding: 16px;
}

section.loader-panel {
  margin-bottom: 14px;
}

.loader-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.inline-form {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.inline-form label {
  color: var(--muted);
  display: grid;
  gap: 6px;
}

.auto-settings-form {
  display: grid;
  gap: 12px;
  margin: 10px 0 14px;
}

.toggle-row {
  align-items: center;
  color: var(--text);
  display: inline-flex;
  gap: 10px;
}

.toggle-row input[type="checkbox"] {
  accent-color: var(--accent);
  height: 18px;
  margin: 0;
  min-height: 0;
  padding: 0;
  width: 18px;
}

.compact-definition {
  font-size: 13px;
}

.compact-definition code {
  background: var(--panel-soft);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: 2px 5px;
}

.flash-stack {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.flash.success {
  background: #ecfdf5;
  border-radius: 8px;
  color: #047857;
  padding: 10px;
}

.flash.error {
  background: var(--error-bg);
  border-radius: 8px;
  color: var(--error-text);
  margin-bottom: 14px;
  padding: 10px;
}

.simple-list {
  display: grid;
  gap: 8px;
}

.simple-list a {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  padding: 9px 11px;
  text-decoration: none;
}

.customer-filter-row {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) minmax(110px, auto) minmax(86px, auto);
}

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

.customer-card {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto);
  padding: 14px 16px;
  text-decoration: none;
}

.customer-card:hover {
  border-color: var(--accent);
}

.customer-title {
  font-size: 18px;
  font-weight: 800;
}

.customer-meta,
.customer-managers {
  color: var(--muted);
  font-size: 13px;
}

.customer-managers {
  max-width: 360px;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phone-chip {
  background: var(--panel-soft);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  display: inline-flex;
  margin: 0 4px 4px 0;
  padding: 4px 8px;
}

.definition-grid {
  grid-template-columns: 180px 1fr;
}

.definition-grid dt {
  color: var(--muted);
}

.definition-grid dd {
  margin: 0;
}

.login-page {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 100vh;
}

.login-panel {
  max-width: 420px;
  padding: 28px;
  width: 100%;
}

.login-panel form,
.login-panel label {
  display: grid;
  gap: 8px;
}

.login-panel form {
  gap: 16px;
}

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

.request-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.request-card h2 {
  font-size: 18px;
  margin-bottom: 4px;
}

.request-workspace {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) 360px;
}

.request-panel,
.attached-calls {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.request-form {
  display: grid;
  gap: 10px;
}

.request-form textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  min-height: 160px;
  padding: 10px;
  resize: vertical;
  width: 100%;
}

.request-form input {
  width: 100%;
}

.request-options {
  align-items: end;
  display: grid;
  gap: 8px 12px;
  grid-template-columns: minmax(150px, 190px) minmax(0, 1fr);
}

.field-hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  padding-bottom: 8px;
}

.autosave-status {
  color: var(--muted);
  font-size: 12px;
}

.response-header {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-top: 14px;
}

.response-header h2 {
  margin: 0;
}

.ai-response {
  background: var(--panel-soft);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  line-height: 1.55;
  margin-top: 14px;
  padding: 12px;
  white-space: pre-wrap;
}

.attached-call-list {
  display: grid;
  gap: 8px;
}

.attached-call {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 9px;
}

.attached-call-title {
  font-weight: 750;
  line-height: 1.25;
}

@media (max-width: 980px) {
  .sidebar {
    padding: 10px 14px;
  }

  .brand {
    font-size: 20px;
  }

  .content {
    padding: 16px;
  }

  .call-card-top,
  .page-header {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .badges {
    justify-content: flex-start;
  }

  .definition-grid,
  .loader-grid,
  .metric-grid,
  .report-grid,
  .request-workspace {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .definition-grid,
  .loader-grid,
  .report-grid,
  .request-workspace {
    grid-template-columns: 1fr;
  }

  .filter-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .filter-period {
    grid-column: span 2;
  }

  .filter-search {
    grid-column: span 4;
  }

  .filter-control,
  .filter-actions {
    grid-column: span 3;
  }

  .date-range-filter {
    grid-column: span 6;
  }

  .advanced-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .source-metric-grid .metric-card {
    flex-basis: 240px;
  }

  .bulk-bar {
    grid-template-columns: 1fr;
  }

  .bulk-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bulk-target {
    grid-column: span 2;
  }

  .request-options {
    grid-template-columns: 1fr;
  }

  .customer-card,
  .customer-filter-row {
    grid-template-columns: 1fr;
  }

  .customer-managers {
    max-width: none;
    text-align: left;
  }

  .field-hint {
    padding-bottom: 0;
  }
}

@media (max-width: 640px) {
  .page-header h1 {
    font-size: 28px;
  }

  .filter-row,
  .filter-row-primary,
  .filter-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  input[type="search"],
  .duration-filter,
  select,
  .period-dropdown,
    .custom-select,
    .filter-period,
    .filter-search,
    .filter-control,
    .filter-actions,
    .primary-button,
    .ghost-link {
    grid-column: auto;
    max-width: none;
    width: 100%;
  }

  .period-menu {
    min-width: 0;
    width: min(100vw - 32px, 360px);
  }

  .period-custom {
    grid-template-columns: 1fr;
  }

  .date-range-filter {
    grid-template-columns: 1fr;
    padding: 8px 10px;
  }

  .date-range-filter input {
    border: 1px solid var(--line);
    padding: 7px 10px;
  }

  .advanced-filter-grid,
  .metric-grid,
  .report-grid,
  .filter-actions {
    grid-template-columns: 1fr;
  }

  .review-call-item {
    grid-template-columns: 1fr;
  }

  .review-call-side {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .source-metric-grid .metric-card {
    flex-basis: 100%;
  }

  .bulk-bar {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .bulk-actions {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .bulk-target {
    grid-column: auto;
    width: 100%;
  }

  .sidebar {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  }

  .brand {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
