/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  height: 100%;
  background: var(--color-surface);
  box-shadow: var(--shadow-sidebar);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar__logo {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-5);
}

.sidebar__logo-text {
  font-weight: var(--fw-bold);
  font-size: 20px;
  white-space: nowrap;
}

.sidebar__badge {
  background: var(--color-accent);
  color: var(--color-accent-ink);
  border-radius: var(--radius-full);
  padding: 10px 16px;
  font-weight: var(--fw-bold);
  font-size: 14px;
  line-height: 1;
}

.sidebar__block {
  padding: 0 var(--space-5);
  margin-top: 60px;
}

.sidebar__block-label {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

.sidebar__select-wrap {
  position: relative;
}

.sidebar__select {
  width: 100%;
  background: var(--color-input-bg);
  border-radius: var(--radius-pill);
  padding: 10px 16px 10px var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  font-size: var(--fs-base);
}

.select__chevron {
  transition: transform .12s ease;
}

.select__chevron.is-open {
  transform: rotate(180deg);
}

.sidebar__select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 20;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sidebar);
  padding: 6px;
}

.sidebar__select-option {
  width: 100%;
  text-align: left;
  padding: 10px var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--fs-base);
  color: var(--color-text);
}

.sidebar__select-option:hover,
.sidebar__select-option.active {
  background: var(--color-input-bg);
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: 0 var(--space-5);
}

.sidebar__nav-item {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  padding: 10px var(--space-5);
  border-radius: var(--radius-full);
  font-size: var(--fs-base);
}

.sidebar__nav-item:hover,
.sidebar__nav-item.active {
  background: var(--color-input-bg);
}

.sidebar__nav-item-sub {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

.sidebar__footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5);
}

.sidebar__avatar {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-full);
  background: var(--color-input-bg);
  overflow: hidden;
  flex-shrink: 0;
}

.sidebar__user-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar__user-name {
  font-size: var(--fs-base);
}

.sidebar__user-logout {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color .2s ease;
}

.sidebar__user-logout:hover,
.sidebar__user-logout:active {
  color: var(--color-text);
}

/* ===== Topbar ===== */
.topbar {
  height: var(--topbar-height);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-7);
}

.topbar__title {
  font-size: 20px;
  font-weight: var(--fw-bold);
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: var(--space-7);
  margin-right: 16px;
}

.topbar__icons {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.icon-group {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.icon-btn {
  width: 26px;
  height: 26px;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--color-icon-default);
  transition: color .12s ease;
}

.icon-btn:hover {
  color: var(--color-icon-hover);
}

.icon-btn svg {
  width: 100%;
  height: 100%;
}

.icon-btn__badge {
  background: var(--color-surface);
  border-radius: var(--radius-full);
  min-width: 27px;
  height: 27px;
  padding: 0 var(--space-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-xs);
  box-shadow: var(--shadow-1);
}

/* ===== Content layout ===== */
.content {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.topbar {
  flex-shrink: 0;
}

.content__body {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: stretch;
  gap: var(--space-5);
  padding: 0 var(--space-7) var(--space-7);
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.content__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}


.content__side {
  width: var(--right-col-width);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

/* ===== Card ===== */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: var(--space-7);
}

.card__title {
  font-size: var(--fs-base);
  color: var(--color-text-muted);
  margin-bottom: var(--space-5);
}

.card__section + .card__section {
  margin-top: var(--space-7);
}

/* ===== Filter row ===== */
.filter-plate {
  background: var(--color-input-bg);
  border-radius: var(--radius-md);
  padding: var(--space-5);
}

.filter-row {
  display: flex;
  align-items: flex-end;
  gap: var(--space-7);
  flex-wrap: wrap;
}

.filter-fields.is-disabled {
  pointer-events: none;
}

.filter-fields.is-disabled .select,
.filter-fields.is-disabled .pill {
  color: var(--color-icon-default);
}

.filter-fields.is-disabled .field__label {
  color: var(--color-text-muted);
}

.filter-fields.is-disabled .btn-primary {
  background: var(--color-icon-default);
  color: var(--color-surface);
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.field__label {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

.select-wrap {
  position: relative;
}

.select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 20;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sidebar);
  padding: 6px;
  max-height: 280px;
  overflow-y: auto;
}

.select-option {
  width: 100%;
  text-align: left;
  padding: 10px var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  color: var(--color-text);
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-option:hover,
.select-option.active {
  background: var(--color-input-bg);
}

.select-option .col-location {
  min-width: 0;
  max-width: 100%;
}

.select-option .col-location span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select {
  width: 100%;
  height: var(--control-h);
  background: var(--color-surface);
  border-radius: var(--radius-pill);
  padding: 0 16px 0 var(--space-5);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  font-size: var(--fs-sm);
  min-width: 160px;
}

.field-input {
  width: 100%;
  height: var(--control-h);
  background: var(--color-surface);
  border: none;
  border-radius: var(--radius-pill);
  padding: 0 var(--space-5);
  box-sizing: border-box;
  font-family: 'Stem', sans-serif;
  font-size: var(--fs-sm);
  color: var(--color-text);
  min-width: 320px;
}

.field-input::placeholder {
  color: var(--color-text-muted);
}

.field-input:focus {
  outline: none;
}

.field-input.has-error {
  border: 1px solid #FF060A;
  color: #FF060A;
}

.field-icon-btn {
  width: 56px;
  height: var(--control-h);
  flex-shrink: 0;
  background: var(--color-icon-default);
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-surface);
}

.field-icon-btn:hover {
  background: var(--color-icon-hover);
}

.field-icon-btn svg {
  width: 24px;
  height: 24px;
}

.sherlock-top-row {
  display: flex;
  align-items: stretch;
  gap: var(--space-3);
}

.sherlock-filter-card {
  flex-shrink: 0;
  width: 600px;
}

.sherlock-sources-card {
  flex: 1;
  min-width: 0;
}

.sherlock-filter {
  flex-wrap: nowrap;
  width: 100%;
  gap: var(--space-5);
}

.sherlock-filter .field {
  flex: 1;
}

.sherlock-filter .btn-primary {
  flex-shrink: 0;
}

.btn-primary:disabled {
  background: var(--color-icon-default);
  cursor: default;
}

.source-groups {
  display: flex;
  gap: var(--space-4);
  flex: 1;
  flex-wrap: wrap;
}

.source-group {
  flex: 1;
  min-width: 140px;
}


.select__chevron {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: .5;
}

.pill-group {
  height: var(--control-h);
  box-sizing: border-box;
  background: var(--color-surface);
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
}

.pill {
  height: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  padding: 0 var(--space-5);
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  color: var(--color-text);
  white-space: nowrap;
}

.pill:hover {
  color: var(--color-text-muted);
}

.pill.active,
.pill.active:hover {
  background: var(--color-bg);
  color: var(--color-accent-ink);
}

.pill--accent.active,
.pill--accent.active:hover {
  background: var(--color-accent);
  color: var(--color-accent-ink);
}

/* ===== Calendar popover ===== */
.calendar-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  width: max-content;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sidebar);
  padding: var(--space-6);
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.calendar-nav {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  color: var(--color-text);
}

.calendar-nav:hover {
  background: var(--color-input-bg);
}

.calendar-nav:disabled {
  opacity: .3;
  cursor: default;
}

.calendar-nav:disabled:hover {
  background: none;
}

.calendar-nav svg {
  width: 8px;
  height: 14px;
}

.calendar-months {
  display: flex;
  gap: var(--space-6);
}

.calendar-month__title {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

.calendar-weekdays,
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 32px);
}

.calendar-weekdays {
  margin-bottom: var(--space-2);
}

.calendar-weekdays span {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  text-align: center;
}

.calendar-day {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  font-size: var(--fs-sm);
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendar-day:hover:not(.is-empty):not(.is-selected) {
  background: var(--color-input-bg);
}

.calendar-day.is-empty {
  visibility: hidden;
  cursor: default;
}

.calendar-day.is-weekend {
  color: var(--color-stop);
}

.calendar-day.is-in-range {
  background: var(--color-input-bg);
  border-radius: 0;
}

.calendar-day.is-selected {
  background: var(--color-accent);
  color: var(--color-accent-ink);
}

.calendar-footer {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-divider);
}

.calendar-range-inputs {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-input-bg);
  border-radius: var(--radius-pill);
  padding: 10px var(--space-4);
  font-size: var(--fs-sm);
}

.calendar-range-dash {
  color: var(--color-text-muted);
}

.calendar-summary {
  flex: 1;
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
}

.btn-primary {
  height: var(--control-h);
  box-sizing: border-box;
  background: var(--color-action);
  color: var(--color-surface);
  border-radius: var(--radius-pill);
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-sm);
  font-weight: var(--fw-regular);
  white-space: nowrap;
  transition: background-color .12s ease;
}

.btn-primary:hover,
.btn-primary:active {
  background: #031ED0;
}

.btn-primary--block {
  width: 100%;
  text-align: center;
}

.btn-secondary {
  height: var(--control-h);
  box-sizing: border-box;
  background: var(--color-bg);
  color: var(--color-text);
  border-radius: var(--radius-pill);
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-sm);
  font-weight: var(--fw-regular);
  white-space: nowrap;
  transition: background-color .12s ease;
}

.btn-secondary:hover {
  background: var(--color-icon-default);
}

.btn-secondary:disabled {
  color: var(--color-icon-default);
  cursor: default;
  background: var(--color-bg);
}

.process-log {
  display: flex;
  flex-direction: column;
  max-height: 520px;
  overflow-y: auto;
}

.process-log__row {
  display: flex;
  gap: var(--space-4);
  padding: 10px 0;
  border-bottom: 1px solid var(--color-divider);
  font-size: var(--fs-sm);
}

.process-log__row:last-child {
  border-bottom: none;
}

.process-log__time {
  flex-shrink: 0;
  width: 130px;
  font-variant-numeric: tabular-nums;
}

.process-log__msg {
  color: var(--color-text);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  z-index: 100;
  background: var(--color-text);
  color: var(--color-surface);
  border-radius: var(--radius-pill);
  padding: 14px var(--space-6);
  font-size: var(--fs-sm);
  box-shadow: var(--shadow-sidebar);
  white-space: nowrap;
}

.btn-ghost {
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-pill);
  padding: 10px var(--space-5);
  font-size: var(--fs-sm);
  color: var(--color-text);
}

.btn-ghost:hover {
  color: var(--color-text-muted);
}

/* ===== Section header + toggle ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-7) 0 var(--space-5);
  background: var(--color-surface);
  border-top-left-radius: var(--radius-md);
  border-top-right-radius: var(--radius-md);
}

.table__sticky-head {
  position: sticky;
  top: 0;
  z-index: 6;
  transform: translateZ(0);
}

.table__meta-row td {
  padding: 0;
  border: none;
}

.section-header .card__title {
  margin-bottom: 0;
}

.toggle-group {
  display: flex;
  background: var(--color-input-bg);
  border-radius: var(--radius-pill);
  padding: 4px;
  gap: 4px;
}

.toggle-group button {
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: var(--fs-sm);
  color: var(--color-text);
}

.toggle-group button:hover {
  color: var(--color-text-muted);
}

.toggle-group button.active,
.toggle-group button.active:hover {
  background: var(--color-accent);
  color: var(--color-accent-ink);
}

/* ===== Table ===== */
.table-wrap {
  width: 100%;
  margin-top: calc(-1 * var(--space-7));
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

table.clients-table {
  table-layout: fixed;
}

table.clients-table th,
table.clients-table td {
  box-sizing: border-box;
}

table.clients-table td:not(:nth-child(10)):not(:nth-child(11)) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

table.clients-table td:nth-child(2) { padding-right: 12px; }
table.clients-table td:nth-child(10) { padding-right: 12px; }

table.bomber-clients-table {
  table-layout: fixed;
}

table.bomber-clients-table th,
table.bomber-clients-table td {
  box-sizing: border-box;
}

table.bomber-clients-table th:not(:last-child),
table.bomber-clients-table td:not(:last-child) {
  width: auto;
  padding-right: 12px;
}

table.bomber-clients-table td:not(:last-child) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bomber-clients-scroll {
  scrollbar-width: thin;
  scrollbar-color: var(--color-divider) transparent;
}

.bomber-clients-scroll::-webkit-scrollbar {
  width: 6px;
}

.bomber-clients-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.bomber-clients-scroll::-webkit-scrollbar-thumb {
  background-color: var(--color-divider);
  border-radius: var(--radius-pill);
}


.table th:not(:last-child),
.table td:not(:last-child) {
  width: 1%;
  padding-right: 70px;
}

.table th:nth-last-child(2),
.table td:nth-last-child(2) {
  padding-right: 30px;
}

.th-sort {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  color: inherit;
}

.th-sort__arrow {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.th-sort__arrow path {
  color: var(--color-icon-default);
  transition: color .12s ease;
}

.th-sort__arrow path.is-active {
  color: var(--color-action);
}

.table thead th {
  height: 52px;
  background: var(--color-input-bg);
  padding: var(--space-3) var(--space-2);
  text-align: left;
  font-weight: var(--fw-regular);
  font-size: var(--fs-xs);
  line-height: 1.2;
  color: var(--color-text-muted);
  white-space: nowrap;
  box-sizing: border-box;
  vertical-align: middle;
}

.table .col-address {
  font-variant-numeric: tabular-nums;
}

.table thead th:first-child {
  border-top-left-radius: var(--radius-md);
  border-bottom-left-radius: var(--radius-md);
  padding-left: 20px;
}

.table tbody td:first-child {
  padding-left: 20px;
}

.table tbody td:first-child,
.table tbody td:nth-child(6),
.table tbody td:nth-child(8),
.table tbody td:nth-child(9) {
  color: var(--color-text-muted);
}

.sherlock-table th:not(:last-child),
.sherlock-table td:not(:last-child) {
  padding-right: 30px;
}

table.sherlock-table th:first-child,
table.sherlock-table td:first-child {
  padding-right: 20px;
}

table.sherlock-table th:nth-last-child(2),
table.sherlock-table td:nth-last-child(2) {
  padding-right: 12px;
}

table.sherlock-table th:last-child,
table.sherlock-table td:last-child {
  padding-left: 8px;
}

.finder-table th:not(:last-child),
.finder-table td:not(:last-child) {
  padding-right: 28px;
}

table.finder-table th:first-child,
table.finder-table td:first-child {
  padding-right: 24px;
}

table.finder-table th:nth-last-child(2),
table.finder-table td:nth-last-child(2) {
  padding-right: 16px;
}

table.finder-table th:last-child,
table.finder-table td:last-child {
  padding-left: 8px;
}

table.finder-table tbody td {
  color: var(--color-text-muted);
}

table.finder-table tbody td:nth-child(2) {
  color: var(--color-text);
}

.funnel-table td:not(:last-child) {
  padding-right: 12px;
}

table.funnel-table {
  table-layout: fixed;
  width: 450px;
}

table.funnel-table th,
table.funnel-table td {
  width: 90px;
}

table.funnel-table th:last-child,
table.funnel-table td:last-child {
  width: 90px;
  text-align: left;
  padding-right: 12px;
}

table.funnel-table tbody td {
  padding-left: var(--space-4);
}

table.funnel-table tbody td:first-child {
  padding-left: var(--space-4);
}

table.funnel-table tbody td {
  height: 56px;
}

table.funnel-table tbody td .text-muted-sm {
  display: inline-flex;
  width: 20px;
  margin: 0;
}

.sherlock-table tbody td:nth-child(8),
.sherlock-table tbody td:nth-child(9) {
  color: var(--color-text-soft);
}

.sherlock-table tbody td.col-muted {
  color: var(--color-text-muted);
}

.text-muted-sm {
  color: var(--color-text-muted);
  font-size: var(--fs-xs);
}

.col-fixed {
  min-width: 80px;
}

.col-location {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
}

.col-location__flag {
  width: 20px;
  height: 14px;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
  flex-shrink: 0;
  overflow: hidden;
  background-size: cover;
}

.sherlock-table th.col-group-end,
.sherlock-table td.col-group-end {
  padding-right: 30px;
}

.table thead th:last-child {
  border-top-right-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
}

.table th:last-child,
.table td:last-child {
  text-align: right;
  padding-right: var(--space-5);
}

.sherlock-table th:last-child,
.sherlock-table td:last-child {
  width: 1%;
}

.table tbody td {
  height: 56px;
  padding: var(--space-4) var(--space-2);
  font-size: var(--fs-sm);
  font-weight: var(--fw-regular);
  line-height: 1.2;
  color: var(--color-text-soft);
  border-bottom: 1px solid var(--color-divider);
  white-space: nowrap;
  box-sizing: border-box;
  vertical-align: middle;
}

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

.table tbody tr:hover {
  background: var(--color-input-bg);
}

.table tbody tr.row-hover {
  background: var(--color-input-bg);
}

.table .link {
  color: var(--color-link);
}

.table .tron-icon {
  width: 20px;
  height: 20px;
}

.status-icon {
  display: inline-flex;
  vertical-align: middle;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-sm);
  background-color: #C9E7D9;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.5 8.5l3 3 6-6.5' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px 14px;
}

.status-icon--negative {
  background-color: #F6C9C0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 4l8 8M12 4l-8 8' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.bubble-holod {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  background-color: #DCEEFB;
  font-size: 11px;
  line-height: 1;
  color: var(--color-text);
  white-space: nowrap;
}

.checkbox {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-divider);
  background: var(--color-surface);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.checkbox:checked {
  background: var(--color-action);
  border-color: var(--color-action);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.5 8.5l3 3 6-6.5' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px;
}

.table-footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-5);
}

.results-count {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
}

.results-count strong {
  color: var(--color-text-muted);
  font-weight: var(--fw-regular);
}

.pagination {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.page-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-divider);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-sm);
}

.page-btn.active {
  border-color: var(--color-divider);
  background: var(--color-surface);
}

.page-btn:hover {
  color: var(--color-text-muted);
}

/* ===== Right column ===== */
.status-chip {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-input-bg);
  border-radius: var(--radius-pill);
  padding: 12px var(--space-4);
  width: fit-content;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.status-dot--stopped {
  background: var(--color-stop);
}

.status-dot--active {
  background: var(--color-accent);
}

.hint-text {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-4);
}

.field-block {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-5);
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.stat-box {
  background: var(--color-input-bg);
  border-radius: var(--radius-sm);
  padding: var(--space-4);
}

.stat-box__label {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.stat-box__value {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
}

.stat-box__value--positive {
  color: #4E9A2A;
}

/* ===== Side panel (drawer) ===== */
.panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .3);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

.panel-backdrop--open {
  opacity: 1;
  pointer-events: auto;
}

.panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 500px;
  height: 100vh;
  background: var(--color-surface);
  box-shadow: -4px 0 28px rgba(0, 0, 0, .09);
  z-index: 91;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .22s ease;
}

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

.panel__header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 0 24px;
}

.panel__title {
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
}

.panel__close {
  width: 26px;
  height: 26px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--color-icon-default);
  transition: color .12s ease;
}

.panel__close:hover {
  color: var(--color-icon-hover);
}

.panel__close svg {
  width: 14px;
  height: 14px;
  stroke-width: 1.2;
}

.panel__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
}

.panel__body-icon {
  width: 220px;
  height: 220px;
}

.panel__body p {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
}

.panel__body--sources {
  align-items: stretch;
  justify-content: flex-start;
  padding: var(--space-5) 24px 24px;
  overflow-y: auto;
}

.settings-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.settings-tag {
  padding: 8px var(--space-4);
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  background: var(--color-bg);
  white-space: nowrap;
}

.settings-tag.active {
  background: var(--color-accent);
  color: var(--color-accent-ink);
}

.panel__body--placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
}

.source-list__label {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

.source-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.source-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.source-item:hover {
  background: var(--color-input-bg);
}

.source-item__info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.source-item__name {
  font-size: var(--fs-sm);
  color: var(--color-text);
}

.source-item__url {
  font-size: var(--fs-xs);
  color: var(--color-link);
  text-decoration: none;
  width: fit-content;
}

.source-item__url:hover {
  text-decoration: underline;
}

.source-item__chain {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
}

.panel__footer {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  padding: 24px;
  background: var(--color-surface);
}

/* ===== Empty state ===== */
.results-wrap.is-search-empty {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.results-wrap.is-search-empty .results-card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.results-wrap.is-search-empty .table-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
}

/* Generic centered "process/status" popup — used for any long-running agent
   action (search, scan, sync) across every agent screen. Pale 160x160 icon,
   status text below, rounded card, dims the page behind it. */
.process-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.process-modal {
  width: 520px;
  box-sizing: border-box;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sidebar);
  padding: var(--space-8) var(--space-7);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
  text-align: center;
}

.process-modal__icon {
  width: 160px;
  height: 160px;
}

.process-modal__title {
  font-size: var(--fs-base);
  color: var(--color-text);
}

.process-modal__status-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.process-modal__subtitle {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
}

.process-modal__steps {
  width: 100%;
  margin-top: var(--space-5);
  background: var(--color-bg);
  border-radius: var(--radius-md);
  padding: var(--space-7);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  text-align: left;
}

.process-modal__step {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.process-modal__step-icon {
  flex: none;
  width: 22px;
  height: 22px;
  color: var(--color-icon-default);
}

.process-modal__step.is-active .process-modal__step-icon {
  color: var(--color-action);
}

.process-modal__step.is-done .process-modal__step-icon {
  color: var(--color-accent-ink);
}

.process-modal__step-title {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
}

.process-modal__step.is-active .process-modal__step-title {
  color: var(--color-text);
}

.process-modal__step.is-done .process-modal__step-title {
  color: var(--color-text-soft);
}

.process-modal__step-detail {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* ===== Bulk action bar ===== */
.bulk-bar {
  position: fixed;
  left: calc(var(--sidebar-width) + 30px);
  right: 30px;
  bottom: var(--space-6);
  z-index: 900;
  background: var(--color-icon-hover);
  color: var(--color-text);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  box-shadow: var(--shadow-sidebar);
}

.bulk-bar__count {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  white-space: nowrap;
  padding: 0 var(--space-3) 0 var(--space-3);
}

.bulk-bar__select {
  background: var(--color-surface);
  color: var(--color-text);
  border-radius: var(--radius-pill);
  height: var(--control-h);
  padding: 0 var(--space-5);
  font-size: var(--fs-sm);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}

.bulk-bar__select:hover {
  background: var(--color-icon-default);
}

.bulk-bar__delete {
  margin-left: auto;
  height: var(--control-h);
  box-sizing: border-box;
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  color: var(--color-text);
  border-radius: var(--radius-pill);
  padding: 0 var(--space-6);
  font-size: var(--fs-sm);
  white-space: nowrap;
}

.bulk-bar__delete:hover {
  background: #FDECEC;
  border-color: #F5B5B5;
  color: #C0392B;
}

.bulk-bar__menu {
  position: absolute;
  bottom: calc(100% + var(--space-3));
  left: 0;
  min-width: 220px;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sidebar);
  padding: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 910;
}

.bulk-bar__menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  color: var(--color-text);
  text-align: left;
  white-space: nowrap;
}

.bulk-bar__menu-item:hover {
  background: var(--color-bg);
}

.bulk-bar__menu-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,.08);
  flex-shrink: 0;
}

.status-modal__comment {
  width: 100%;
  box-sizing: border-box;
  background: var(--color-bg);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  font-size: var(--fs-sm);
  color: var(--color-text);
  font-family: inherit;
  resize: vertical;
  min-height: 88px;
}

/* ===== Status change modal ===== */
.status-modal {
  width: 440px;
  box-sizing: border-box;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sidebar);
  padding: var(--space-7);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.status-modal__title {
  font-size: var(--fs-lg);
  color: var(--color-text);
}

.status-modal__options {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.status-modal__option {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  cursor: pointer;
  transition: border-color .12s ease;
}

.status-modal__option:hover {
  border-color: var(--color-action);
}

.status-modal__option.is-active {
  border-color: var(--color-action);
  background: var(--color-bg);
}

.status-modal__radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--color-divider);
  flex-shrink: 0;
  position: relative;
}

.status-modal__option.is-active .status-modal__radio {
  border-color: var(--color-action);
}

.status-modal__option.is-active .status-modal__radio::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--color-action);
}

.status-modal__option-title {
  font-size: var(--fs-sm);
  color: var(--color-text);
}

.status-modal__option-hint {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

.status-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
}

.results-wrap.is-search-empty .empty-state {
  flex: 1;
  min-height: 0;
}

.empty-state__icon {
  width: 220px;
  height: 220px;
}

.empty-state__title {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
}

.table-load-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  margin-top: var(--space-7);
  padding-bottom: var(--space-7);
}
