

/* ---------- 5. Tables polish ---------- */

table.table tbody tr {
  cursor: default;
}

table.table tbody tr.is-clickable {
  cursor: pointer;
}

table.table tbody tr.is-active td {
  background: rgba(59, 130, 246, 0.10) !important;
  box-shadow: inset 3px 0 0 var(--brand-600);
}

table.table th.is-sortable {
  cursor: pointer;
  user-select: none;
  padding-right: 1.2rem;
  position: relative;
}

table.table th.is-sortable::after {
  content: "↕";
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  opacity: 0.45;
}

table.table th.is-sortable.sort-asc::after { content: "▲"; opacity: 0.85; }
table.table th.is-sortable.sort-desc::after { content: "▼"; opacity: 0.85; }

/* Sticky first column for code/name cells */
table.table.table--sticky-first thead th:first-child,
table.table.table--sticky-first tbody td:first-child {
  position: sticky;
  left: 0;
  background: inherit;
  z-index: 1;
}

table.table.table--sticky-first thead th:first-child {
  z-index: 3;
}

/* Empty-state row: span+icon */
table.table tbody tr td.empty-row {
  text-align: center;
  padding: 1.6rem 0.6rem;
  color: var(--text-500);
}

/* ---------- 6. Charts polish ---------- */

.chart-stage {
  position: relative;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(245, 249, 255, 0.4), transparent 80%);
}

html[data-theme="dark"] .chart-stage {
  background:
    linear-gradient(180deg, rgba(96, 165, 250, 0.04), transparent 80%);
}

/* ---------- 7. Modal accent + Toast animation ---------- */

.modal-content {
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--surface-shadow);
  overflow: hidden;
  position: relative;
}

.modal-content::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, var(--brand-600), var(--brand-500), transparent 80%);
}

.modal-header {
  border-bottom: 1px solid var(--surface-border);
  padding: 0.65rem 0.85rem;
}

.modal-title {
  font-size: 0.95rem;
  font-weight: 800;
}

.modal-body {
  padding: 0.85rem;
  color: var(--text-700);
  font-size: 0.9rem;
}

.modal-footer {
  border-top: 1px solid var(--surface-border);
  padding: 0.55rem 0.7rem;
  gap: 0.4rem;
}

html[data-theme="dark"] .modal-content {
  background: var(--surface-strong);
  border-color: rgba(120, 152, 196, 0.28);
}

@keyframes toast-slide-in {
  from { opacity: 0; transform: translateX(28px) scale(0.97); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toast-slide-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(28px); }
}

.app-toast {
  animation: toast-slide-in 0.22s ease-out 1;
  max-height: 320px;
  overflow: auto;
}

.app-toast.is-leaving {
  animation: toast-slide-out 0.18s ease-in 1 forwards;
}

/* ---------- 8. Loading: spinner + skeleton ---------- */

.skeleton {
  background: linear-gradient(90deg,
              rgba(120, 145, 178, 0.10) 0%,
              rgba(120, 145, 178, 0.20) 50%,
              rgba(120, 145, 178, 0.10) 100%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: 6px;
  display: inline-block;
  height: 0.85em;
  width: 100%;
  vertical-align: middle;
}

.skeleton--row {
  height: 14px;
  margin: 0.3rem 0;
}

.skeleton--block {
  height: 60px;
  display: block;
}

@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

html[data-theme="dark"] .skeleton {
  background: linear-gradient(90deg,
              rgba(140, 168, 200, 0.10) 0%,
              rgba(140, 168, 200, 0.22) 50%,
              rgba(140, 168, 200, 0.10) 100%);
  background-size: 200% 100%;
}

/* ---------- 9. Empty state with icon ---------- */

.empty-state-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.4rem 1rem;
  color: var(--text-500);
  text-align: center;
}

.empty-state-block__icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(120, 145, 178, 0.12);
  color: var(--text-500);
}

.empty-state-block__icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.empty-state-block__title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-700);
}

.empty-state-block__hint {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  max-width: 320px;
}

.empty-state-block__action {
  margin-top: 0.3rem;
}

html[data-theme="dark"] .empty-state-block__icon {
  background: rgba(140, 168, 200, 0.12);
}

/* ---------- 10. Nav: badge slot only (existing underline style preserved) ---------- */

/* Optional badge slot on nav items */
.nav-link__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 5px;
  margin-left: 0.32rem;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  background: var(--danger-600);
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}