.table-wrap {
  overflow: auto;
  max-width: 100%;
}

.table-scroll {
  max-height: min(62vh, 680px);
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.table-scroll-compact {
  max-height: min(44vh, 420px);
}

.table-scroll table {
  min-width: 760px;
}

.table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 1px 0 var(--line);
}

.table-wrap-premium {
  border: 1px solid #b9c8dc;
  border-radius: 8px;
  background: #ffffff;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid #d7e2f0;
  border-right: 1px solid #edf2f8;
  text-align: left;
  vertical-align: top;
}

th:last-child,
td:last-child {
  border-right: 0;
}

th {
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #26466f;
  background: #eef5ff;
}

tbody tr:hover {
  background: #f4f8fd;
}

.is-filtered-out,
.is-page-hidden {
  display: none !important;
}

.table-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.table-pagination-info strong {
  color: var(--text);
}

.table-page-controls,
.table-page-size {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.table-page-size span,
.table-page-current {
  color: var(--text-soft);
  font-weight: 700;
}

.table-page-size select {
  min-height: 40px;
  padding: 8px 30px 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.case-level-cell {
  white-space: nowrap;
}

.case-level-badge {
  --level-bg: rgba(20, 33, 61, 0.06);
  --level-border: rgba(20, 33, 61, 0.1);
  --level-code: var(--primary);
  --level-text: var(--text);
  display: inline-grid;
  grid-template-columns: auto minmax(0, auto);
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 9px 4px 5px;
  border: 1px solid var(--level-border);
  border-radius: 6px;
  background: var(--level-bg);
  color: var(--level-text);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.case-level-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 25px;
  min-height: 22px;
  padding: 0 6px;
  border-radius: 4px;
  background: var(--level-code);
  color: #fff;
  font-size: 0.72rem;
  letter-spacing: 0;
}

.case-level-name {
  overflow: hidden;
  text-overflow: ellipsis;
}

.case-level-badge--t0 {
  --level-bg: rgba(20, 33, 61, 0.06);
  --level-border: rgba(20, 33, 61, 0.12);
  --level-code: #25335f;
}

.case-level-badge--t1 {
  --level-bg: rgba(244, 162, 97, 0.13);
  --level-border: rgba(194, 120, 3, 0.16);
  --level-code: #b76a16;
  --level-text: #71400f;
}

.case-level-badge--t2 {
  --level-bg: rgba(29, 120, 116, 0.12);
  --level-border: rgba(29, 120, 116, 0.16);
  --level-code: #1d7874;
  --level-text: #135b58;
}

.case-level-badge--t3 {
  --level-bg: rgba(21, 115, 71, 0.12);
  --level-border: rgba(21, 115, 71, 0.16);
  --level-code: #157347;
  --level-text: var(--success);
}

.case-level-badge--unknown {
  --level-bg: rgba(92, 92, 120, 0.08);
  --level-border: rgba(92, 92, 120, 0.14);
  --level-code: #5c5c78;
}

.section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}

.stats-premium .stat-card-premium {
  position: relative;
  overflow: hidden;
  border: none;
  border-radius: 14px;
  color: #fff;
  box-shadow: 0 14px 28px rgba(8, 42, 94, 0.18);
}

.stats-premium .stat-card-premium .pill {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.stats-premium .stat-card-premium strong {
  position: relative;
  z-index: 1;
  color: #fff;
}

.stats-premium .stat-card-premium small {
  display: block;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.5;
  position: relative;
  z-index: 1;
}

.stat-card-icon {
  position: absolute;
  right: -8px;
  bottom: -12px;
  width: 68px;
  height: 68px;
  opacity: 0.24;
  color: #fff;
  pointer-events: none;
}

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

.stat-tone-1 {
  background: linear-gradient(135deg, #0d3f8d 0%, #1057bb 100%);
}

.stat-tone-2 {
  background: linear-gradient(135deg, #b9790a 0%, #f2a900 100%);
}

.stat-tone-3 {
  background: linear-gradient(135deg, #0f5c58 0%, #1d9c95 100%);
}

.stat-tone-4 {
  background: linear-gradient(135deg, #0d5c37 0%, #189a5c 100%);
}

.stat-tone-5 {
  background: linear-gradient(135deg, #7a1710 0%, #b42318 100%);
}

.stat-tone-6 {
  background: linear-gradient(135deg, #3a2c78 0%, #5a3fae 100%);
}

@media (max-width: 640px) {
  .stats-premium {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.activity-stack,
.pending-approval-list {
  display: grid;
  gap: 12px;
}

.dashboard-feed-scroll {
  max-height: min(58vh, 560px);
  overflow: auto;
  padding-right: 4px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.activity-card,
.pending-approval-card {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  border-radius: 8px;
  border: 1px solid #d7e2f0;
  background: #ffffff;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.activity-card:hover,
.pending-approval-card:hover {
  transform: translateY(-1px);
  border-color: rgba(16, 87, 187, 0.18);
  box-shadow: 0 12px 24px rgba(16, 48, 92, 0.08);
}

.activity-card-head,
.pending-approval-top,
.activity-card-body,
.activity-card-foot,
.pending-approval-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.activity-card-body,
.activity-card-foot,
.pending-approval-meta {
  color: var(--text-soft);
  flex-wrap: wrap;
}

.inbox-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.inbox-hero-side {
  display: grid;
  gap: 4px;
  min-width: 220px;
  padding: 18px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(10, 28, 61, 0.96), rgba(16, 87, 187, 0.9));
  color: #fff;
}

.inbox-hero-side strong {
  font-size: clamp(1.8rem, 2.4vw, 2.4rem);
}

.inbox-hero-side span {
  color: rgba(255, 255, 255, 0.82);
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.table-actions .btn {
  padding: 8px 10px;
  border-radius: 6px;
}
