:root {
  --ey-dark: #2e2e38;
  --ey-darker: #1e1e28;
  --ey-yellow: #ffe600;
  --ey-muted: #747480;
  --ey-border: #e0e0e0;
  --ey-surface: #ffffff;
  --ey-bg: #f5f5f5;
  --radius: 12px;
  --radius-sm: 8px;
}

.header-hint {
  font-size: 14px;
  color: var(--ey-muted);
}

/* Layout */
.dashboard {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px 48px;
}

.dashboard-head {
  margin-bottom: 24px;
}

.dashboard-title {
  font-size: 28px;
  font-weight: 600;
  color: var(--ey-dark);
}

.dashboard-subtitle {
  margin-top: 6px;
  font-size: 14px;
  color: var(--ey-muted);
}

.block-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--ey-dark);
}

/* Status banner */
.status-banner {
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
  font-size: 14px;
  border: 1px solid var(--ey-border);
  background: var(--ey-surface);
  color: var(--ey-dark);
}

.status-banner.error {
  border-color: #e3b3b3;
  background: #fceded;
  color: #9a1f1f;
}

/* Metric cards */
.metrics {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.metric-card {
  background: var(--ey-surface);
  border: 1px solid var(--ey-border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--ey-yellow);
}

.metric-value {
  font-size: 30px;
  font-weight: 700;
  color: var(--ey-dark);
  line-height: 1.1;
}

.metric-label {
  margin-top: 6px;
  font-size: 13px;
  color: var(--ey-muted);
}

/* Filters */
.filter-bar {
  background: var(--ey-surface);
  border: 1px solid var(--ey-border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.filter-bar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.filter-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.search-wrapper {
  position: relative;
}

.search-input {
  width: 360px;
  max-width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--ey-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--ey-dark);
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: var(--ey-dark);
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--ey-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.filter-field select {
  appearance: none;
  width: 100%;
  padding: 10px 36px 10px 12px;
  border: 1px solid var(--ey-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--ey-dark);
  background-color: #fff;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 4l4 4 4-4' fill='none' stroke='%23747480' stroke-width='1.5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

.filter-field select:focus {
  border-color: var(--ey-dark);
}

.filter-field select.active {
  border-color: var(--ey-dark);
  background-color: #fafad2;
}

/* Charts */
.charts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.chart-card {
  background: var(--ey-surface);
  border: 1px solid var(--ey-border);
  border-radius: var(--radius);
  padding: 20px;
}

.chart-card h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--ey-dark);
  margin-bottom: 16px;
}

.bar-row {
  display: grid;
  grid-template-columns: 130px 1fr 44px;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.bar-label {
  font-size: 12px;
  color: var(--ey-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-track {
  background: var(--ey-bg);
  border-radius: 4px;
  height: 18px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--ey-dark);
  border-radius: 4px 0 0 4px;
  min-width: 2px;
  transition: width 0.3s ease;
}

.bar-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--ey-dark);
  text-align: right;
}

.chart-empty {
  font-size: 13px;
  color: var(--ey-muted);
}

/* Table */
.table-section {
  background: var(--ey-surface);
  border: 1px solid var(--ey-border);
  border-radius: var(--radius);
  padding: 24px;
}

.table-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
}

.result-count {
  font-size: 13px;
  color: var(--ey-muted);
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--ey-border);
  border-radius: var(--radius-sm);
}

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

.vm-table thead th {
  background: var(--ey-bg);
  color: var(--ey-dark);
  font-weight: 600;
  text-align: left;
  padding: 10px 12px;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid var(--ey-border);
  position: sticky;
  top: 0;
}

.vm-table thead th .sort-arrow {
  color: var(--ey-muted);
  font-size: 10px;
  margin-left: 4px;
}

.vm-table tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid #efeff1;
  color: var(--ey-dark);
  white-space: nowrap;
}

.vm-table tbody tr:hover {
  background: #fafafa;
}

.vm-table tbody td.wrap {
  white-space: normal;
  min-width: 180px;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-delete {
  background: #fce9e9;
  color: #9a1f1f;
}

.badge-support {
  background: #fff6d6;
  color: #7a5b00;
}

.badge-review {
  background: #e7eefc;
  color: #1f3f9a;
}

.badge-none {
  background: #eaf6ec;
  color: #1f7a36;
}

.badge-neutral {
  background: var(--ey-bg);
  color: var(--ey-muted);
}

.empty-row td {
  text-align: center;
  color: var(--ey-muted);
  padding: 32px 12px;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.pagination button {
  padding: 6px 12px;
  border: 1px solid var(--ey-border);
  background: #fff;
  border-radius: 6px;
  font-size: 13px;
  color: var(--ey-dark);
  cursor: pointer;
}

.pagination button:hover:not(:disabled) {
  background: var(--ey-bg);
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination .page-info {
  font-size: 13px;
  color: var(--ey-muted);
  margin-right: auto;
}

/* Responsive */
@media (max-width: 1100px) {
  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .charts {
    grid-template-columns: 1fr;
  }
  .filter-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .metrics,
  .filter-grid {
    grid-template-columns: 1fr;
  }
  .search-input {
    width: 100%;
  }
}
