.card {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: 8px; box-shadow: var(--card-shadow); overflow: hidden;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px 9px;
}
.card-header-left { display: flex; align-items: center; gap: 10px; }
.icon-circle {
  width: 30px; height: 30px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 14px; font-weight: 700;
}
.icon-circle.green  { background: #107C10; color: #fff; }
.icon-circle.blue   { background: #0078D4; color: #fff; }
.icon-circle.purple { background: #744DA9; color: #fff; }
.icon-circle svg { width: 14px; height: 14px; }
.card-title { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.2; }
.card-subtitle { font-size: 11px; color: var(--text-secondary); margin-top: 1px; }

/* USD CARD */
.usd-delta {
  font-size: 12px; font-weight: 500; color: #FF3B30;
  display: flex; align-items: center; gap: 3px; white-space: nowrap;
}
.usd-delta svg { width: 11px; height: 11px; }
.rate-rows { border-top: 1px solid var(--divider); }
.rate-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px; border-bottom: 1px solid var(--divider);
  position: relative;
}
.rate-row:last-child { border-bottom: none; }
.rate-rows.no-next #row-today { border-bottom: none; }
.rate-row.today { background: var(--today-bg); }
.rate-row.today::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: #0078D4; border-radius: 0 2px 2px 0;
}
.rate-label { display: flex; flex-direction: column; gap: 1px; }
.label-name { font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.rate-row.today .label-name { color: #0078D4; font-weight: 500; }
.label-date { font-size: 11px; color: var(--text-tertiary); }
.rate-value { font-size: 17px; font-weight: 600; color: var(--text); letter-spacing: -0.5px; }
.rate-row.today .rate-value { font-size: 17px; font-weight: 600; }

/* SPEC CARD */
.dropzone {
  margin: 0 12px 12px; border: 2px dashed var(--dashed-border);
  border-radius: 6px; padding: 26px 20px;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  min-height: 164px; gap: 6px;
}
.dropzone:hover { border-color: #0078D4; background: rgba(0,120,212,0.04); }
.dropzone.drag-over { border-color: #34C759; background: rgba(52,199,89,0.06); }
.dropzone-icon { color: var(--text-secondary); margin-bottom: 4px; }
.dropzone-icon svg { width: 30px; height: 30px; }
.dropzone-title { font-size: 13px; font-weight: 600; color: var(--text); text-align: center; }
.dropzone-sub { font-size: 12px; color: var(--text-secondary); text-align: center; line-height: 1.45; }
.dropzone-ok { font-size: 12px; color: #34C759; text-align: center; }

/* DYNAMICS CARD */
.pd-periods {
  display: flex; gap: 4px;
  padding: 0 14px 10px;
}
.pd-period-btn {
  flex: 1; height: 28px; border-radius: 7px;
  font-size: 12px; font-weight: 500; color: var(--text-secondary);
  background: transparent; border: 1px solid var(--divider);
  cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.pd-period-btn.active {
  background: #0078D4; color: #fff; border-color: #0078D4;
}
.pd-rows { padding: 0 14px 4px; }
.pd-row {
  display: flex; align-items: center;
  padding: 5px 0; border-bottom: 1px solid var(--divider);
}
.pd-row:last-child { border-bottom: none; }
.pd-cat { font-size: 12px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; margin-right: 8px; }
.pd-val-wrap { display: flex; align-items: center; flex-shrink: 0; }
.pd-val { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; width: 52px; text-align: right; }
.pd-delta {
  font-size: 11px; font-weight: 600;
  display: flex; align-items: center; gap: 2px;
  flex-shrink: 0; width: 64px; justify-content: flex-end;
}
.pd-delta.up   { color: #FF3B30; }
.pd-delta.down { color: #34C759; }
.pd-delta.flat { color: var(--text-tertiary); }
.pd-chart-btns {
  display: flex; gap: 8px; padding: 10px 16px 14px;
  border-top: 1px solid var(--divider);
}
.pd-chart-btn {
  flex: 1; height: 30px; border-radius: 8px;
  font-size: 12px; font-weight: 500;
  border: 1px solid var(--filter-border);
  color: var(--text-secondary); background: transparent;
  cursor: pointer; transition: background 0.15s, color 0.15s;
  display: flex; align-items: center; justify-content: center; gap: 5px;
}
.pd-chart-btn:hover { background: var(--row-hover); color: var(--text); }
.pd-chart-btn svg { width: 12px; height: 12px; }

/* ANOMALY WIDGET */
.anomaly-section { padding: 0 14px 12px; }
#anomaly-list {
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4,0,0.2,1);
  max-height: 200px;
}
.anomaly-header {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; color: var(--text-tertiary);
  letter-spacing: 0.4px; text-transform: uppercase;
  padding: 10px 0 7px; border-top: 1px solid var(--divider);
}
.anomaly-header svg { width: 12px; height: 12px; color: #FF9500; flex-shrink:0; }
.anomaly-empty { font-size: 12px; color: var(--text-tertiary); }
.anomaly-item {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 5px 0; border-bottom: 1px solid var(--divider);
  gap: 8px;
}
.anomaly-item:last-child { border-bottom: none; }
.anomaly-name { font-size: 12px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.anomaly-price { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; }
.anomaly-badge {
  font-size: 11px; font-weight: 600; color: #FF3B30;
  background: rgba(255,59,48,0.12); border-radius: 4px; padding: 1px 5px;
  white-space: nowrap; flex-shrink: 0;
}
.anomaly-row td:last-child { color: #FF3B30 !important; }

/* EMPTY STATE */
.table-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 20px; gap: 10px; text-align: center;
}
.table-empty svg { width: 36px; height: 36px; color: var(--text-tertiary); margin-bottom: 4px; }
.table-empty-title { font-size: 14px; font-weight: 600; color: var(--text); }
.table-empty-sub { font-size: 13px; color: var(--text-secondary); }
.table-empty-btn {
  margin-top: 6px; padding: 8px 18px; border-radius: 6px;
  background: #0078D4; color: #fff; font-size: 13px; font-weight: 500;
  border: none; cursor: pointer; transition: opacity 0.15s;
}
.table-empty-btn:hover { opacity: 0.85; }

/* SKELETON (CBR loading) */
.skeleton {
  display: inline-block; border-radius: 6px;
  background: linear-gradient(90deg, var(--card-border) 25%, var(--row-hover) 50%, var(--card-border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.anomaly-limit-btns { display: flex; gap: 4px; margin-left: auto; }
.anomaly-limit-btn {
  font-size: 11px; font-weight: 500; color: var(--text-secondary);
  background: transparent; border: 1px solid var(--divider);
  border-radius: 5px; padding: 2px 0; cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  line-height: 1.4; min-width: 28px; text-align: center;
}
.anomaly-limit-btn.active {
  background: #0078D4; color: #fff; border-color: #0078D4;
}
.anomaly-limit-btn:hover:not(.active) { background: var(--row-hover); color: var(--text); }

/* SEARCH BAR */
.search-wrap { position: relative; }
.search-input {
  width: 100%; height: 38px;
  padding: 0 36px 0 36px;
  background: transparent;
  border: 1px solid var(--filter-border);
  border-radius: 6px;
  font-size: 13px; color: var(--text);
  outline: none;
  -webkit-appearance: none;
  transition: border-color 0.15s;
  font-family: inherit;
}
.search-input::placeholder { color: var(--text-tertiary); }
.search-input:focus { border-color: #0078D4; outline: none; box-shadow: none; }
.search-icon {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  pointer-events: none; color: var(--text-secondary);
}
.search-icon svg { width: 14px; height: 14px; display: block; }
.search-clear {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; border-radius: 50%; background: var(--text-tertiary);
  color: var(--card-bg); font-size: 11px; display: none;
  align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
  line-height: 1;
}
.search-clear.visible { display: flex; }

/* FILTER BAR */
.right-col { display: flex; flex-direction: column; gap: 14px; }
.filter-bar { display: flex; align-items: center; gap: 10px; }
.filter-left { display: flex; align-items: center; gap: 10px; flex: 1; }
.filter-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 13px; border: 1px solid var(--filter-border);
  border-radius: 6px; background: transparent; color: var(--text);
  font-size: 13px; font-weight: 500; cursor: pointer;
  position: relative; transition: background 0.15s, border-color 0.15s;
  min-width: 160px; white-space: nowrap;
}
.filter-btn:hover { background: var(--row-hover); }
.filter-btn.active { border-color: #0078D4; }
.f-icon { color: var(--text-secondary); flex-shrink: 0; }
.f-icon svg { width: 14px; height: 14px; }
.f-arrow { margin-left: auto; color: var(--text-secondary); }
.f-arrow svg { width: 13px; height: 13px; transition: transform 0.2s; }
.filter-btn.open .f-arrow svg { transform: rotate(180deg); }
.filter-badge {
  position: absolute; top: -7px; right: -7px;
  width: 18px; height: 18px; background: #0078D4; color: #fff;
  border-radius: 50%; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.reset-btn { font-size: 13px; font-weight: 500; color: #FF3B30; padding: 8px 2px; white-space: nowrap; }
.reset-btn:hover { opacity: 0.75; }
.pos-count {
  font-size: 13px; color: var(--text-secondary);
  display: flex; align-items: center; gap: 5px; white-space: nowrap; margin-left: auto;
}
.pos-count svg { width: 14px; height: 14px; }

/* DROPDOWN */
.dd-wrapper { position: relative; }
.dd-list {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 200px;
  background: var(--dropdown-bg); border: 1px solid var(--card-border);
  border-radius: 6px; box-shadow: var(--dropdown-shadow);
  z-index: 200; display: none;
  max-height: 280px; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  /* скруглённый скроллбар */
  scrollbar-width: thin;
  scrollbar-color: var(--card-border) transparent;
}
.dd-list::-webkit-scrollbar { width: 4px; }
.dd-list::-webkit-scrollbar-track { background: transparent; }
.dd-list::-webkit-scrollbar-thumb { background: var(--card-border); border-radius: 4px; }
.dd-list.open { display: block; animation: ddFadeIn 0.15s ease; }
@keyframes ddFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.dd-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; cursor: pointer; font-size: 14px;
  color: var(--text); transition: background 0.1s;
}
.dd-item:hover { background: var(--row-hover); }
.dd-item input[type="checkbox"] {
  display: block; width: 16px; height: 16px;
  border: 1.5px solid var(--text-secondary); border-radius: 4px;
  background: transparent; appearance: none; -webkit-appearance: none;
  cursor: pointer; position: relative; flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.dd-item input[type="checkbox"]:checked { background: #0078D4; border-color: #0078D4; }
.dd-item input[type="checkbox"]:checked::after {
  content: ''; position: absolute;
  left: 50%; top: 50%;
  width: 9px; height: 5px;
  border-left: 1.5px solid #fff; border-bottom: 1.5px solid #fff;
  transform: translate(-50%, -60%) rotate(-45deg);
}

/* TABLE */
