/* overview.css — Liquid Glass LIGHT styles for Overview page */

.overview-filters {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.overview-filters label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.overview-filters select {
  padding: 7px 32px 7px 12px;
  border: none;
  border-radius: var(--glass-radius-xs);
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.55);
  color: var(--text-primary);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23666' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
  transition: all var(--transition-fast);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  box-shadow:
    0 1px 6px rgba(0, 0, 0, 0.06),
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.overview-filters select:focus {
  outline: none;
  box-shadow:
    0 0 0 3px var(--brand-color-dim),
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.55);
}

.overview-filters select:hover {
  background: rgba(255, 255, 255, 0.70);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.08),
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.60),
    inset 0 1px 0 rgba(255, 255, 255, 0.80);
}

/* ─── Переключатели периода (Месяц / Период / Год) ─── */

.ov-period-tabs {
  display: flex;
  gap: 0;
  border-radius: var(--glass-radius-xs);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.35);
  box-shadow:
    0 1px 6px rgba(0, 0, 0, 0.06),
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
}

.ov-period-tab {
  padding: 7px 14px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  position: relative;
}

.ov-period-tab:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 25%;
  height: 50%;
  width: 1px;
  background: rgba(0, 0, 0, 0.08);
}

.ov-period-tab:hover {
  background: rgba(255, 255, 255, 0.45);
  color: var(--text-primary);
}

.ov-period-tab.active {
  background: var(--brand-color);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.ov-period-tab.active::after {
  display: none;
}

/* ─── Export Excel button ─── */

.ov-export-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 9px;
  color: #fff;
  background: var(--brand-color);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.10);
  flex-shrink: 0;
  line-height: 1;
}

.ov-export-btn:hover {
  background: var(--brand-color-hover);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.ov-export-btn:active {
  transform: scale(0.97);
}

/* ─── Sync / Refresh button ─── */

.ov-sync-wrap {
  position: relative;
  flex-shrink: 0;
}

.ov-sync-btn {
  padding: 7px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  background: var(--brand-color);
  border: none;
  border-radius: var(--glass-radius-xs);
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.10);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ov-sync-btn:hover {
  background: var(--brand-color-hover);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.ov-sync-btn:active {
  transform: scale(0.97);
}

.ov-sync-icon {
  display: block;
  transition: none;
}

/* Spinning animation */
.ov-sync-spinning .ov-sync-icon {
  animation: ov-spin 1s linear infinite;
}

@keyframes ov-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Done state */
.ov-sync-done {
  background: #28a745 !important;
}

/* Error state */
.ov-sync-error {
  background: #dc3545 !important;
}

/* Dropdown */
.ov-sync-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  padding: 6px;
  z-index: 100;
  min-width: 220px;
}

.ov-sync-info {
  padding: 10px 14px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.ov-sync-divider {
  height: 1px;
  background: #eee;
  margin: 2px 10px;
}

.ov-sync-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s;
  font-size: 0.85rem;
  text-align: left;
}

.ov-sync-option:hover {
  background: #f2f2f2;
}

.ov-sync-opt-title {
  font-weight: 500;
  color: var(--text-primary);
}

.ov-sync-opt-time {
  color: var(--text-secondary);
  font-size: 0.78rem;
  margin-left: 12px;
  white-space: nowrap;
}

/* ─── Display settings button & popup ─── */

.ov-settings-wrap {
  position: relative;
  margin-left: auto;
}

.ov-settings-btn {
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--glass-radius-xs);
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  white-space: nowrap;
}

.ov-settings-btn:hover {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(0, 0, 0, 0.12);
  color: var(--text-primary);
}

.ov-settings-popup {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 100;
  min-width: 240px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--glass-radius-sm);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.10), 0 2px 8px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ov-settings-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
  padding: 4px 0;
}

.ov-settings-check input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.ov-check-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  border: 1.5px solid rgba(0, 0, 0, 0.18);
  background: rgba(255, 255, 255, 0.8);
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.ov-settings-check input[type="checkbox"]:checked + .ov-check-mark {
  background: var(--brand-color);
  border-color: var(--brand-color);
}

.ov-settings-check input[type="checkbox"]:checked + .ov-check-mark::after {
  content: '';
  display: block;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-top: -1px;
}

.ov-settings-check:hover .ov-check-mark {
  border-color: var(--brand-color);
  box-shadow: 0 0 0 3px var(--brand-color-dim);
}

/* ─── Settings divider ─── */

.ov-settings-divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.08);
  margin: 2px 0;
}

/* ─── Plan-Fact block ─── */

.plan-fact-block {
  margin-bottom: var(--space-lg);
}

.plan-fact-table {
  width: auto;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.plan-fact-table th {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brand-color);
  text-align: right;
  padding: 4px 12px;
  border-bottom: 1px solid rgba(201, 164, 108, 0.12);
  white-space: nowrap;
}

.plan-fact-table th.pf-label {
  text-align: left;
  width: auto;
}

.plan-fact-table td.pf-label {
  text-align: left;
  white-space: nowrap;
  padding: 6px 12px;
}

.plan-fact-table td.pf-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding: 6px 12px;
  min-width: 90px;
}

.pf-row-fact td {
  font-size: 1.3rem;
  font-weight: 600;
  color: #5C4A24;
}

.pf-row-fact td.pf-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #8B7340;
}

.pf-row-plan td {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--table-border);
}

.pf-row-plan td.pf-label {
  font-size: 0.82rem;
  color: var(--text-tertiary);
}

.pf-plan-input {
  width: 90px;
  padding: 4px 8px;
  border: 1px solid rgba(201, 164, 108, 0.3);
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: right;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.7);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.pf-plan-input:focus {
  border-color: #C9A46C;
  box-shadow: 0 0 0 2px rgba(201, 164, 108, 0.15);
}

.pf-plan-input::placeholder {
  color: var(--text-tertiary);
  font-weight: 400;
}

/* Pencil toggle button */
.pf-edit-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 2px 5px;
  margin-left: 4px;
  border-radius: 4px;
  vertical-align: middle;
  opacity: 0.45;
  transition: opacity 0.2s, background 0.2s;
}

.pf-edit-toggle:hover {
  opacity: 0.8;
  background: rgba(201, 164, 108, 0.10);
}

.pf-edit-toggle.pf-edit-active {
  opacity: 1;
  background: rgba(201, 164, 108, 0.18);
}

.pf-clear-plan {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 2px 5px;
  margin-left: 2px;
  border-radius: 4px;
  vertical-align: middle;
  opacity: 0.45;
  transition: opacity 0.2s, background 0.2s;
}
.pf-clear-plan:hover {
  opacity: 0.8;
  background: rgba(201, 164, 108, 0.10);
}

/* Save feedback indicators */
.pf-save-ok {
  color: #4CAF50;
  font-size: 0.85rem;
  margin-left: 6px;
  animation: pf-fade-in 0.2s ease;
}

.pf-save-err {
  color: #e53935;
  font-size: 0.75rem;
  margin-left: 6px;
  animation: pf-fade-in 0.2s ease;
}

@keyframes pf-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Balance log button */
.pf-balance-log-btn {
  background: none;
  border: 1px solid rgba(201, 164, 108, 0.25);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--text-secondary, #b0a080);
  opacity: 0.7;
  transition: opacity 0.2s, background 0.2s;
}
.pf-balance-log-btn:hover {
  opacity: 1;
  background: rgba(201, 164, 108, 0.12);
}

.pf-balance-refresh {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 1px 3px;
  vertical-align: middle;
  opacity: 0.4;
  transition: opacity 0.2s;
}
.pf-balance-refresh:hover {
  opacity: 0.9;
}

/* Balance log popup */
.balance-log-popup {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pf-fade-in 0.15s ease;
}
.balance-log-content {
  background: #fff;
  border: 1px solid rgba(201, 164, 108, 0.3);
  border-radius: 12px;
  padding: 20px 24px;
  min-width: 360px;
  max-width: 500px;
  max-height: 70vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
.balance-log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.balance-log-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #333;
}
.balance-log-close {
  background: none;
  border: none;
  color: #666;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  opacity: 0.6;
}
.balance-log-close:hover { opacity: 1; }
.balance-log-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.balance-log-row {
  display: flex;
  gap: 12px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
}
.balance-log-date {
  font-weight: 600;
  min-width: 80px;
}
.balance-log-zero {
  color: #e53935;
  background: rgba(229, 57, 53, 0.08);
}
.balance-log-topup {
  color: #4CAF50;
  background: rgba(76, 175, 80, 0.08);
}
.balance-log-empty {
  color: #888;
  text-align: center;
  padding: 20px;
}

.pf-edit-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-tertiary);
  padding: 2px 4px;
  margin-left: 6px;
  border-radius: 4px;
  vertical-align: middle;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.pf-edit-btn:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.05);
}

/* Plan inline edit form */
.pf-edit-form {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.60);
  border-radius: var(--glass-radius-sm);
  border: 1px solid rgba(0, 0, 0, 0.08);
  flex-wrap: wrap;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--glass-shadow-sm);
}

.pf-edit-form label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.pf-edit-form input {
  width: 120px;
  padding: 5px 8px;
  border: 1px solid var(--input-border);
  border-radius: 5px;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.80);
  color: var(--text-primary);
  outline: none;
}

.pf-edit-form input:focus {
  border-color: var(--brand-color);
  box-shadow: 0 0 0 3px var(--brand-color-dim);
}

.pf-save-btn {
  padding: 6px 14px;
  background: var(--brand-color);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.pf-save-btn:hover {
  background: var(--brand-color-hover);
}

.pf-save-btn:disabled {
  background: var(--color-inactive);
  cursor: not-allowed;
}

.pf-cancel-btn {
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.70);
  color: var(--text-secondary);
  border: 1px solid rgba(0, 0, 0, 0.10);
  border-radius: 6px;
  font-size: 0.82rem;
  cursor: pointer;
}

.pf-cancel-btn:hover {
  background: rgba(255, 255, 255, 0.90);
}

/* ─── Full-width override for overview ─── */
.app-content:has(#overview-page.active) {
  max-width: none;
  padding: var(--space-md) var(--space-lg);
}

/* ─── All-directions: category column ─── */

.all-dir-cat-col { position: relative; }

.all-dir-cat-header {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.all-dir-cat-sort { cursor: pointer; }
.all-dir-cat-sort:hover { text-decoration: underline; }

.all-dir-filter-btn {
  background: none;
  border: 1px solid rgba(0,0,0,0.18);
  border-radius: 4px;
  padding: 1px 5px;
  cursor: pointer;
  font-size: 0.75em;
  color: #666;
  line-height: 1.4;
  transition: all 0.15s;
}
.all-dir-filter-btn:hover { background: rgba(0,0,0,0.06); }
.all-dir-filter-btn.is-filtered {
  background: var(--brand-color);
  color: #fff;
  border-color: var(--brand-color);
}

.all-dir-filter-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 200;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  padding: 10px 12px;
  min-width: 180px;
}

.all-dir-filter-title {
  font-size: 0.78em;
  font-weight: 600;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.all-dir-filter-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 0;
  cursor: pointer;
  font-size: 0.88em;
  white-space: nowrap;
}
.all-dir-filter-item input { cursor: pointer; accent-color: var(--brand-color); }
.all-dir-filter-item:hover { color: var(--brand-color); }

.all-dir-filter-actions { margin-top: 8px; border-top: 1px solid rgba(0,0,0,0.08); padding-top: 8px; }
.all-dir-filter-clear {
  background: none;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 6px;
  padding: 3px 10px;
  cursor: pointer;
  font-size: 0.82em;
  color: #666;
  width: 100%;
}
.all-dir-filter-clear:hover { background: rgba(0,0,0,0.05); }

.ut-cat-badge {
  white-space: nowrap;
  font-size: 0.82em;
  color: #888;
}

/* ─── Category blocks (glass card style) ─── */

.category-block {
  margin-bottom: var(--space-xl);
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--glass-radius);
  padding: var(--space-md) var(--space-sm);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.03), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.category-block:last-child {
  margin-bottom: 0;
}

.category-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(201, 164, 108, 0.20);
}

/* ─── Unified table (bundles + weekly) ─── */

/* ─── Table wrap (toolbar + top scrollbar + scroll container) ─── */

.unified-table-wrap {
  position: relative;
}

.unified-table-toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 4px 0;
}

.expand-all-weeks-btn {
  font-size: 0.78rem;
  padding: 4px 12px;
  border: 1px solid rgba(0, 0, 0, 0.10);
  border-radius: var(--glass-radius-xs);
  background: rgba(255, 255, 255, 0.60);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.expand-all-weeks-btn:hover {
  background: rgba(255, 255, 255, 0.90);
  color: var(--brand-color);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.unified-top-scrollbar {
  overflow-x: auto;
  overflow-y: hidden;
  height: 14px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-bottom: none;
  border-radius: var(--glass-radius-sm) var(--glass-radius-sm) 0 0;
  background: rgba(248, 249, 251, 0.6);
}

.unified-top-scrollbar-inner {
  height: 1px;
}

.unified-scroll-container {
  overflow: auto;
  max-height: calc(100vh - 240px);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-top: none;
  border-radius: 0 0 var(--glass-radius-sm) var(--glass-radius-sm);
  background: rgba(255, 255, 255, 0.50);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--glass-shadow-sm);
}

/* Hide bottom horizontal scrollbar — top scrollbar handles horizontal scroll */
.unified-scroll-container::-webkit-scrollbar:horizontal {
  height: 0;
  display: none;
}

.unified-table {
  border-collapse: collapse;
  font-size: 0.8rem;
  white-space: nowrap;
  table-layout: fixed;
}

.unified-table th,
.unified-table td {
  padding: 4px 6px;
  border-bottom: 1px solid var(--table-border);
}

/* Sticky header rows */
.unified-table thead tr:first-child th {
  position: sticky;
  top: 0;
  z-index: 3;
}

.unified-table thead tr:nth-child(2) th {
  position: sticky;
  /* top is set dynamically by JS based on first row height */
  top: 28px;
  z-index: 3;
}

/* Sticky first column — fully opaque to prevent bleed-through */
.ut-sticky-col {
  position: sticky;
  left: 0;
  z-index: 2;
  background: rgb(255, 255, 255);
  box-shadow: 2px 0 6px rgba(0, 0, 0, 0.08);
  width: 240px;
  min-width: 240px;
  max-width: 240px;
}

/* Corner: sticky col in header needs highest z-index (both sticky axes) */
.unified-table thead .ut-sticky-col,
.unified-table thead .ut-extra-col-header {
  z-index: 5;
}

/* Ensure header sticky-col sticks both horizontally and vertically */
.unified-table thead tr:first-child .ut-sticky-col {
  position: sticky;
  left: 0;
  top: 0;
  z-index: 6;
  background: rgb(255, 255, 255);
}

/* Group header row (Итого за месяц, Week headers) */
.ut-header {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--brand-color);
  text-align: left;
  background: rgba(248, 249, 251, 0.98);
  border-bottom: 1px solid rgba(201, 164, 108, 0.15);
  z-index: 3;
  cursor: pointer;
  user-select: none;
}

.ut-header:hover {
  color: var(--brand-color);
}

.ut-group-header {
  text-align: center;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--brand-color);
  background: rgb(253, 250, 244);
  border-bottom: 1px solid rgba(201, 164, 108, 0.15);
}

.ut-monthly-group {
  border-right: 3px solid rgba(0, 0, 0, 0.12);
}

/* Thick separator between totals and weeks */
.ut-total-separator {
  border-right: 3px solid rgba(0, 0, 0, 0.12) !important;
}

.ut-week-header {
  text-align: center;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-primary);
  background: rgb(248, 249, 251);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  border-left: 2px solid rgba(0, 0, 0, 0.06);
  cursor: pointer;
  user-select: none;
  transition: background var(--transition-fast);
}

.ut-week-header:hover {
  background: rgb(252, 248, 241);
}

/* Collapsed week: narrow clean marker — no grid lines */
.ut-week-collapsed-marker {
  width: 12px;
  min-width: 12px;
  max-width: 12px;
  padding: 4px 0;
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-tertiary);
  background: rgb(255, 255, 255);
  border: none !important;
  border-bottom: none !important;
  cursor: pointer;
  user-select: none;
  vertical-align: middle;
  transition: color var(--transition-fast);
}

.ut-week-collapsed-marker:hover {
  color: var(--brand-color);
}

.ut-week-collapsed-cell {
  width: 12px;
  min-width: 12px;
  max-width: 12px;
  padding: 0;
  background: #fff;
  border: none !important;
  border-bottom: none !important;
}

/* Gap column between expanded weeks */
.ut-week-gap {
  width: 12px;
  min-width: 12px;
  max-width: 12px;
  padding: 0;
  background: rgb(255, 255, 255) !important;
  border: none !important;
  border-bottom: none !important;
}

/* Gap in header must be opaque for sticky */
.unified-table thead .ut-week-gap {
  background: rgb(248, 249, 251) !important;
}

/* Force white on collapsed/gap cells in ALL row contexts */
.row-inactive .ut-week-collapsed-cell,
.row-inactive .ut-week-gap,
.row-total .ut-week-collapsed-cell,
.row-total .ut-week-gap,
.row-plan .ut-week-collapsed-cell,
.row-plan .ut-week-gap,
tr:hover .ut-week-collapsed-cell,
tr:hover .ut-week-gap {
  background: #fff !important;
  border: none !important;
}

/* Sub-column headers */
.ut-subcol {
  text-align: right;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-tertiary);
  background: rgb(248, 249, 251);
  border-bottom: 2px solid rgba(0, 0, 0, 0.08);
}

.ut-monthly-subcol {
  background: rgb(253, 250, 244);
}

/* last monthly subcol border handled by .ut-total-separator */

.ut-monthly-subcol.sortable {
  cursor: pointer;
  user-select: none;
  transition: color var(--transition-fast);
}

.ut-monthly-subcol.sortable:hover {
  color: var(--brand-color);
}

.ut-week-subcol {
  font-size: 0.73rem;
}

/* Left border on first column of each week group */
.ut-week-border {
  border-left: 2px solid rgba(0, 0, 0, 0.06);
}

/* Right border on last monthly column cells — handled by .ut-total-separator */

/* Bundle name column */
.ut-bundle-name {
  text-align: left;
  font-size: 0.88rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Numeric cells */
.ut-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Attribution column */
.ut-attr {
  text-align: left;
  white-space: nowrap;
  color: var(--text-tertiary);
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Totals row */
.ut-total-label {
  font-weight: 700;
  text-align: left;
  font-size: 0.88rem;
  color: var(--text-primary);
}

.unified-table tfoot .row-total td {
  font-weight: 700;
  background: var(--table-total-bg);
  border-top: 2px solid rgba(201, 164, 108, 0.15);
  color: var(--text-primary);
}

.unified-table tfoot .row-total .ut-sticky-col {
  background: rgb(252, 248, 241);
}

.unified-table tfoot .row-plan td {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  padding-top: 4px;
  border-top: none;
}

.unified-table tfoot .row-plan .ut-plan-cell {
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

/* Inline editable plan inputs */
.wp-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  font-size: inherit;
  color: var(--text-tertiary);
  text-align: right;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  transition: border-color 0.2s, background 0.2s;
}
.wp-input:hover {
  outline: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.8);
}
.wp-input:focus {
  outline: 1px solid var(--brand-color);
  background: #fff;
  color: var(--text-primary);
}
.wp-input::placeholder {
  color: var(--text-tertiary);
  opacity: 0.5;
}
.wp-input.wp-saved {
  background: rgba(201, 164, 108, 0.08);
  border-color: rgba(201, 164, 108, 0.3);
}
.wp-input.wp-error {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.3);
}

/* Inactive bundles */
.unified-table .row-inactive td {
  background: rgba(0, 0, 0, 0.02);
  color: var(--text-tertiary);
}

.unified-table .row-inactive .ut-sticky-col {
  background: rgb(245, 245, 245);
}

/* Archived/deleted bundles — red text */
.unified-table .row-archived td {
  color: #c0392b;
  background: rgba(192, 57, 43, 0.03);
}
.unified-table .row-archived .ut-sticky-col {
  background: #fdf2f1;
}

/* Hover */
.unified-table tbody tr:hover td {
  background: var(--table-row-hover);
}

.unified-table tbody tr:hover .ut-sticky-col {
  background: rgb(253, 249, 242);
}

/* ─── Bundle detail row (start date + landing URL) ─── */

.bundle-name-link {
  cursor: pointer;
  color: var(--text-primary);
  transition: color var(--transition-fast);
}

.bundle-name-link:hover {
  color: var(--brand-color);
  text-decoration: underline;
}

.bundle-detail-row td {
  background: rgba(201, 164, 108, 0.03);
  padding: 8px 16px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--table-border);
}

.bundle-detail-cell {
  text-align: left;
}

.detail-label {
  font-weight: 600;
  color: var(--text-secondary);
}

.detail-sep {
  margin: 0 12px;
  color: var(--text-tertiary);
}

.bundle-detail-cell a {
  color: var(--brand-color);
  text-decoration: none;
}

.bundle-detail-cell a:hover {
  text-decoration: underline;
}

/* New budget input in detail row */
.new-budget-input {
  width: 110px;
  padding: 4px 8px;
  border: 1px solid rgba(201, 164, 108, 0.3);
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 500;
  text-align: right;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.7);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.new-budget-input:focus {
  border-color: #C9A46C;
  box-shadow: 0 0 0 2px rgba(201, 164, 108, 0.15);
}

.new-budget-input::placeholder {
  color: var(--text-tertiary);
  font-weight: 400;
}

/* ─── BotHelp columns (подписчики, старт чата) ─── */

.ut-bh-col {
  background: rgba(201, 164, 108, 0.04);
}

thead .ut-bh-col {
  color: #8B7340;
  font-weight: 600;
  font-size: 0.78rem;
}

/* ─── Extra columns (start date, landing URL) ─── */

.ut-extra-col-header {
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: rgba(248, 249, 251, 0.98);
  text-align: left;
  padding: 7px 10px;
  white-space: nowrap;
  border-bottom: 2px solid rgba(0, 0, 0, 0.08);
}

.ut-extra-col {
  text-align: left;
  font-size: 0.82rem;
  color: var(--text-secondary);
  white-space: nowrap;
  padding: 7px 10px;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ut-landing-link {
  color: var(--brand-color);
  text-decoration: none;
  font-size: 0.82rem;
}

.ut-landing-link:hover {
  text-decoration: underline;
}

.ut-campaign-ids {
  font-family: monospace;
  font-size: 0.78rem;
  cursor: text;
  user-select: all;
}

/* Weekly green highlight — bundle had quals that week */
/* removed: weekly conditional highlights (ut-week-qual / ut-monthly-alert) */

/* Monthly red alert — no quals 2 weeks + spend > 20k */

/* Sticky column needs opaque versions for highlights */
