/* ── Feed Management Page ── */
.feeds-page {
  overflow-y: auto;
}

.back-link {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  margin-right: 12px;
}

.back-link:hover { color: var(--text); }

.feed-count {
  font-size: 13px;
  color: var(--text-muted);
  margin-left: 8px;
}

.sync-all-btn,
.add-btn {
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text);
}

.sync-all-btn:hover,
.add-btn:hover { background: #f3f4f6; }

.add-btn {
  background: var(--today-border);
  border-color: var(--today-border);
  color: #fff;
  font-weight: 600;
}

.add-btn:hover { background: #2563eb; }

.top-right {
  gap: 8px;
}

/* ── Filter Bar ── */
.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 12px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-group label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-select,
.filter-input {
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 10px;
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  outline: none;
  min-width: 140px;
}

.filter-select:focus,
.filter-input:focus {
  border-color: var(--today-border);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.search-box {
  width: 280px;
}

/* ── Table ── */
.table-wrapper {
  flex: 1;
  overflow: auto;
  padding: 0;
}

.feeds-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.feeds-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.feeds-table th {
  background: #f8f9fa;
  border-bottom: 2px solid var(--border);
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  user-select: none;
}

.feeds-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f0f0f0;
  border-right: 1px solid #f0f0f0;
  vertical-align: middle;
}

.feeds-table td:last-child {
  border-right: none;
}

.feeds-table th {
  border-right: 1px solid #e5e7eb;
}

.feeds-table th:last-child {
  border-right: none;
}

/* Column widths */
.th-expand       { width: 36px; }
.th-unit         { width: 200px; }
.th-integrations { width: 140px; }
.th-events       { width: 90px; text-align: center; }
.th-status       { width: 100px; }
.th-synced       { width: 110px; }
.th-actions      { width: 110px; }

/* ── Expand Button ── */
.td-expand {
  text-align: center;
  padding: 0 4px;
}

.expand-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 5px;
  background: transparent;
  font-size: 10px;
  cursor: pointer;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s;
}

.expand-btn:hover { background: #f3f4f6; }
.expand-btn.open { color: var(--text); }
.expand-btn:disabled { opacity: 0.3; cursor: default; }
.expand-btn:disabled:hover { background: transparent; }

/* ── Listing Rows ── */
.listing-row {
  cursor: pointer;
}

.listing-row:hover {
  background: #f8fafc;
}

.listing-row.expanded {
  background: #f0f7ff;
  border-bottom-color: transparent;
}

.listing-row.expanded:hover {
  background: #e8f1fd;
}

.listing-row.no-integrations {
  opacity: 0.7;
}

/* ── Unit Cell ── */
.td-unit {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.td-unit .unit-name {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 190px;
}

.td-unit .unit-num {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Integrations Column (count + platform dots) ── */
.td-integrations {
  text-align: center;
}

.int-count {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}

.int-dots {
  display: flex;
  justify-content: center;
  gap: 4px;
}

.th-integrations,
.th-events,
.th-synced,
.th-actions {
  text-align: center !important;
}

.platform-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

.platform-dot.airbnb-bg  { background: var(--airbnb); }
.platform-dot.vrbo-bg    { background: var(--vrbo); }
.platform-dot.booking-bg { background: var(--booking); }
.platform-dot.direct-bg  { background: var(--direct); }

.no-int-label {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

/* ── Platform Badge (in integration sub-rows) ── */
.platform-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.platform-badge.airbnb  { background: var(--airbnb); }
.platform-badge.vrbo    { background: var(--vrbo); }
.platform-badge.booking { background: var(--booking); }
.platform-badge.direct  { background: var(--direct); }
.platform-badge.other   { background: var(--other); }

/* ── Events Cell ── */
.td-events {
  text-align: center;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ── Status Cell ── */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.status-dot.ok    { background: #22c55e; }
.status-dot.error { background: #ef4444; }
.status-dot.never { background: var(--other); }

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

/* ── Synced Cell ── */
.td-synced {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  text-align: center;
}

/* ── Action Buttons ── */
.td-actions {
  white-space: nowrap;
  text-align: center;
}

.tbl-btn {
  width: 28px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  font-size: 14px;
  cursor: pointer;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tbl-btn:hover {
  background: #f3f4f6;
  border-color: var(--border);
  color: var(--text);
}

.tbl-btn.invisible {
  visibility: hidden;
}

.tbl-btn.danger:hover {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

/* ── Integration Sub-Rows ── */
.integration-row .td-actions {
  text-align: left;
}

.integration-row {
  background: #f8fafc;
}

.integration-row:hover {
  background: #f1f5f9;
}

.integration-row .td-expand {
  border-left: 3px solid var(--today-border);
}

.td-int-detail {
  padding: 8px 14px;
}

.int-row-inner {
  display: flex;
  align-items: center;
  gap: 10px;
}

.int-url {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.int-error {
  display: block;
  font-size: 11px;
  color: #dc2626;
  margin-top: 4px;
  padding-left: 62px;
}

/* ── Error Row ── */
.row-error {
  background: #fef8f8;
}

.row-error:hover {
  background: #fef2f2 !important;
}

.row-error .td-status {
  color: #dc2626;
  font-weight: 600;
}

/* ── Add Integration Inline ── */
.add-row {
  background: transparent;
}

.add-row:hover {
  background: #f8fafc !important;
}

.add-integration-inline {
  border: 1px dashed var(--border);
  border-radius: 6px;
  background: transparent;
  padding: 6px 14px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.add-integration-inline:hover {
  border-color: var(--today-border);
  color: var(--today-border);
  background: #f0f7ff;
}

/* ── Listing row error status ── */
.listing-row .td-status .status-dot.error + span,
.listing-row .td-status:has(.status-dot.error) {
  color: #dc2626;
  font-weight: 600;
}
