/*
 * 4KC Design System Components
 *
 * Minimal technical foundation for shared KC UI building blocks.
 * Uses existing --kc-* tokens with fallbacks; no business-specific selectors.
 */

.kc-card,
.kc-section {
  background: var(--kc-surface, #ffffff);
  border: 1px solid var(--kc-border-soft, var(--kc-border, #e2e8f0));
  border-radius: var(--kc-radius-lg, 1rem);
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
  color: var(--kc-text, #0f172a);
}

.kc-card {
  padding: var(--kc-space-5, 1.25rem);
}

.kc-section {
  padding: var(--kc-space-4, 1rem);
}

.kc-stack {
  display: flex;
  flex-direction: column;
  gap: var(--kc-space-4, 1rem);
  width: 100%;
  max-width: none;
  min-width: 0;
}

.kc-page-wide {
  inline-size: 100%;
  max-inline-size: none;
}

.kc-grid {
  display: grid;
  gap: var(--kc-space-4, 1rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
}

.kc-kpi-strip {
  display: grid;
  align-items: stretch;
  gap: 0.375rem;
  width: 100%;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .kc-kpi-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

@media (max-width: 420px) {
  .kc-kpi-strip {
    grid-template-columns: 1fr;
  }
}

.kc-kpi-strip > .kc-kpi-card {
  height: 100%;
}

/* Billing stats keep Filament's native markup and add restrained 4KC accents. */
[data-billing-stat] {
  --billing-stat-accent: var(--kc-primary, #2563eb);
  border: 1px solid color-mix(in srgb, var(--billing-stat-accent) 38%, var(--kc-border-soft, #e2e8f0));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--billing-stat-accent) 11%, transparent), transparent 62%),
    var(--kc-surface, #ffffff);
  box-shadow: 0 10px 28px rgb(15 23 42 / 0.07);
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

[data-billing-stat]:hover {
  border-color: color-mix(in srgb, var(--billing-stat-accent) 68%, var(--kc-border, #cbd5e1));
  box-shadow: 0 14px 34px rgb(15 23 42 / 0.11);
  transform: translateY(-1px);
}

[data-billing-stat] .fi-icon {
  color: var(--billing-stat-accent);
}

[data-billing-stat="warning"] {
  --billing-stat-accent: var(--kc-warning, #b45309);
}

[data-billing-stat="info"] {
  --billing-stat-accent: #0284c7;
}

[data-billing-stat="danger"] {
  --billing-stat-accent: var(--kc-danger, #dc2626);
}

[data-billing-stat="success"] {
  --billing-stat-accent: var(--kc-success, #15803d);
}

[data-billing-stat="neutral"] {
  --billing-stat-accent: var(--kc-text-muted, #475569);
}

.dark [data-billing-stat="info"] {
  --billing-stat-accent: #38bdf8;
}

@media (prefers-reduced-motion: reduce) {
  [data-billing-stat] {
    transition: none;
  }

  [data-billing-stat]:hover {
    transform: none;
  }
}

.kc-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(18rem, 1.55fr) repeat(4, minmax(9rem, 1fr));
  gap: 0.75rem;
  align-items: stretch;
}

.kc-dashboard-grid > * {
  min-width: 0;
  height: 100%;
}

.kc-dashboard-card .fi-section-content,
.kc-dashboard-card .fi-section-content-ctn {
  height: 100%;
}

.kc-dashboard-intro {
  color: var(--kc-text-muted, #475569);
  font-size: 0.8125rem;
  line-height: 1.35rem;
  margin-top: 0.4rem;
}

.kc-dashboard-title-row,
.kc-dashboard-action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.kc-dashboard-title {
  color: var(--kc-text, #0f172a);
  font-size: 1rem;
  font-weight: 800;
  margin: 0;
}

.kc-dashboard-status-metrics,
.kc-dashboard-metrics {
  display: grid;
  gap: 0.625rem;
}

.kc-dashboard-status-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 0.9rem;
}

.kc-dashboard-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  text-align: center;
}

.kc-dashboard-metric__value {
  color: var(--kc-text, #0f172a);
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.5rem;
}

.kc-dashboard-metric__label {
  color: var(--kc-text-muted, #475569);
  font-size: 0.72rem;
  line-height: 1rem;
  margin-top: 0.25rem;
}

.kc-dashboard-meta__label {
  color: var(--kc-text-muted, #475569);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}

.kc-dashboard-meta__value {
  color: var(--kc-text, #0f172a);
  font-size: 0.82rem;
  font-weight: 700;
  margin-top: 0.25rem;
}

.kc-review-tabs-scroll,
.kc-data-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.kc-review-panel {
  margin-top: 1rem;
}

.kc-data-table {
  border-collapse: collapse;
  min-width: 44rem;
  width: 100%;
  color: var(--kc-text, #0f172a);
  font-size: 0.8125rem;
  text-align: left;
}

.kc-data-table th,
.kc-data-table td {
  border-bottom: 1px solid var(--kc-border-soft, #e2e8f0);
  padding: 0.65rem 0.75rem;
  vertical-align: middle;
}

.kc-data-table th {
  background: var(--kc-surface-soft, #f8fafc);
  color: var(--kc-text-muted, #475569);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

[data-kc-job-progress] {
  margin-top: 0.75rem;
  padding: 0.75rem;
  border: 1px solid color-mix(in srgb, var(--kc-primary, #2563eb) 20%, var(--kc-border, #e2e8f0));
  border-radius: var(--kc-radius-md, 0.75rem);
  background: color-mix(in srgb, var(--kc-primary, #2563eb) 5%, var(--kc-surface, #fff));
}

[data-kc-job-progress] > div:first-child,
[data-kc-job-progress] > div:last-child {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

[data-kc-job-progress] [role="progressbar"] {
  display: block;
  height: 0.45rem;
  margin-top: 0.65rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--kc-surface-soft, #e2e8f0);
}

[data-kc-job-progress] [role="progressbar"] > div {
  height: 100%;
  background: var(--kc-primary, #2563eb);
}

@media (max-width: 1200px) {
  .kc-dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kc-dashboard-card--status {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .kc-dashboard-grid,
  .kc-dashboard-status-metrics {
    grid-template-columns: 1fr;
  }

  .kc-dashboard-card--status {
    grid-column: auto;
  }
}

.kc-kpi-card--compact {
  min-height: 3.75rem;
  padding: 0.625rem 0.75rem;
}

.kc-kpi-card__value--sm {
  font-size: 1.125rem;
  line-height: 1.5rem;
}

.kc-table-panel {
  display: flex;
  flex-direction: column;
  gap: var(--kc-space-3, 0.75rem);
}

.kc-table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--kc-space-3, 0.75rem);
  padding: var(--kc-space-4, 1rem);
  background: var(--kc-surface, #ffffff);
  border: 1px solid var(--kc-border-soft, var(--kc-border, #e2e8f0));
  border-radius: var(--kc-radius-lg, 1rem);
}

.kc-table-toolbar__title {
  color: var(--kc-text, #0f172a);
  font-size: 0.9375rem;
  font-weight: 700;
}

.kc-table-toolbar__hint {
  color: var(--kc-text-muted, #475569);
  font-size: 0.8125rem;
}

.kc-table-toolbar__controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--kc-space-2, 0.5rem);
}

.kc-table-search,
.kc-table-filter,
.kc-table-filter-trigger,
.kc-table-settings,
.kc-table-export {
  min-height: 2.25rem;
  border: 1px solid var(--kc-border-soft, var(--kc-border, #e2e8f0));
  border-radius: var(--kc-radius-md, 0.75rem);
  background: var(--kc-surface, #ffffff);
  color: var(--kc-text, #0f172a);
  font-size: 0.875rem;
  padding: 0.375rem 0.75rem;
}

.kc-table-search {
  min-width: min(16rem, 100%);
}

.kc-table-sort {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  padding: 0;
  text-transform: inherit;
}

.kc-table-bulkbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--kc-space-3, 0.75rem);
  padding: var(--kc-space-3, 0.75rem) var(--kc-space-4, 1rem);
  background: color-mix(in srgb, var(--kc-primary, #2563eb) 8%, var(--kc-surface, #ffffff));
  border: 1px solid color-mix(in srgb, var(--kc-primary, #2563eb) 18%, var(--kc-border, #e2e8f0));
  border-radius: var(--kc-radius-lg, 1rem);
  color: var(--kc-text, #0f172a);
  font-size: 0.875rem;
  font-weight: 700;
}

.kc-table-filter-panel,
.kc-table-settings-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--kc-space-3, 0.75rem);
  padding: var(--kc-space-3, 0.75rem) var(--kc-space-4, 1rem);
  background: var(--kc-surface-soft, #f8fafc);
  border: 1px solid var(--kc-border-soft, var(--kc-border, #e2e8f0));
  border-radius: var(--kc-radius-lg, 1rem);
}

.kc-table-filter-panel[hidden],
.kc-table-settings-panel[hidden] {
  display: none;
}

.kc-table-panel__label {
  color: var(--kc-text, #0f172a);
  font-size: 0.8125rem;
  font-weight: 800;
}

.kc-table-panel__hint {
  color: var(--kc-text-muted, #475569);
  font-size: 0.75rem;
  font-weight: 600;
}

.kc-table-filter-options,
.kc-table-settings-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--kc-space-2, 0.5rem);
}

.kc-table-filter-options label,
.kc-table-settings-grid label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--kc-text-muted, #475569);
  font-size: 0.8125rem;
  font-weight: 600;
}

.kc-table-bulkbar[hidden] {
  display: none;
}

.kc-table-select {
  width: 2.75rem;
  text-align: center;
  vertical-align: middle;
}

.kc-table-actions,
.kc-table-actions-heading {
  text-align: right;
  white-space: nowrap;
}

.kc-kpi-card {
  display: flex;
  min-height: 7rem;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--kc-space-3, 0.75rem);
  padding: var(--kc-space-5, 1.25rem);
  background: var(--kc-surface, #ffffff);
  border: 1px solid var(--kc-border-soft, var(--kc-border, #e2e8f0));
  border-radius: var(--kc-radius-xl, 1.25rem);
  box-shadow: 0 8px 24px rgb(15 23 42 / 0.05);
}

.kc-kpi-card.kc-kpi-card--compact {
  min-height: 3.75rem;
  gap: 0.375rem;
  padding: 0.625rem 0.75rem;
}

.kc-kpi-card__label,
.kc-value__label,
.kc-detail-header__subline {
  color: var(--kc-text-muted, #475569);
  font-size: 0.8125rem;
  line-height: 1.25rem;
}

.kc-kpi-card__value {
  color: var(--kc-text, #0f172a);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.375rem;
}

.kc-detail-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--kc-space-4, 1rem);
  padding: var(--kc-space-5, 1.25rem);
  background: var(--kc-surface, #ffffff);
  border: 1px solid var(--kc-border-soft, var(--kc-border, #e2e8f0));
  border-radius: var(--kc-radius-lg, 1rem);
}

.kc-detail-header--hero {
  align-items: center;
  padding: var(--kc-space-6, 1.5rem);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--kc-primary, #2563eb) 10%, transparent), transparent 42%),
    var(--kc-surface, #ffffff);
  border-color: color-mix(in srgb, var(--kc-primary, #2563eb) 16%, var(--kc-border, #e2e8f0));
  box-shadow: 0 14px 40px rgb(15 23 42 / 0.08);
}

.kc-detail-header__eyebrow {
  margin: 0 0 var(--kc-space-1, 0.25rem);
  color: var(--kc-primary, #2563eb);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1rem;
  text-transform: uppercase;
}

.kc-detail-header__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--kc-space-2, 0.5rem);
  margin-top: var(--kc-space-2, 0.5rem);
  color: var(--kc-text-muted, #475569);
  font-size: 0.875rem;
}

.kc-detail-header__meta span:not(:last-child)::after {
  content: "·";
  margin-left: var(--kc-space-2, 0.5rem);
  color: var(--kc-text-subtle, #94a3b8);
}

.kc-detail-header__title {
  margin: 0;
  color: var(--kc-text, #0f172a);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.75rem;
}

.kc-detail-grid {
  display: grid;
  gap: var(--kc-space-3, 0.75rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
}

.kc-detail-grid--product {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
}

.kc-value {
  min-width: 0;
  padding: var(--kc-space-3, 0.75rem);
  background: var(--kc-surface-soft, #f8fafc);
  border: 1px solid var(--kc-border-soft, var(--kc-border, #e2e8f0));
  border-radius: var(--kc-radius-md, 0.75rem);
}

.kc-value__content {
  overflow-wrap: anywhere;
  color: var(--kc-text, #0f172a);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.5rem;
}

.kc-value__hint {
  margin-top: var(--kc-space-1, 0.25rem);
  color: var(--kc-text-muted, #64748b);
  font-size: 0.75rem;
  line-height: 1rem;
}

.kc-table-wrap {
  overflow-x: auto;
  background: var(--kc-surface, #ffffff);
  border: 1px solid var(--kc-border-soft, var(--kc-border, #e2e8f0));
  border-radius: var(--kc-radius-lg, 1rem);
}

.kc-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--kc-text, #0f172a);
  font-size: 0.875rem;
  text-align: left;
}

.kc-table th,
.kc-table td {
  border-bottom: 1px solid var(--kc-border-soft, var(--kc-border, #e2e8f0));
  padding: var(--kc-space-3, 0.75rem) var(--kc-space-4, 1rem);
  vertical-align: top;
}

.kc-table th {
  background: var(--kc-surface-soft, #f8fafc);
  color: var(--kc-text-muted, #475569);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.kc-table tr:last-child td {
  border-bottom: 0;
}

.kc-record-type,
.kc-record-name,
.kc-record-value {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);
  font-size: 0.8125rem;
}

.kc-record-type {
  color: var(--kc-text, #0f172a);
  font-weight: 700;
  white-space: nowrap;
}

.kc-record-name {
  color: var(--kc-text-muted, #475569);
  white-space: nowrap;
}

.kc-record-value {
  min-width: 0;
  max-width: 100%;
  color: var(--kc-text-muted, #475569);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.kc-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: fit-content;
  border-radius: var(--kc-radius-sm, 999px);
  border: 1px solid transparent;
  padding: 0.125rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.125rem;
  white-space: nowrap;
}

.kc-badge--success {
  background: color-mix(in srgb, var(--kc-success, #15803d) 12%, transparent);
  border-color: color-mix(in srgb, var(--kc-success, #15803d) 25%, transparent);
  color: var(--kc-success, #15803d);
}

.kc-badge--warning {
  background: color-mix(in srgb, var(--kc-warning, #b45309) 12%, transparent);
  border-color: color-mix(in srgb, var(--kc-warning, #b45309) 25%, transparent);
  color: var(--kc-warning, #b45309);
}

.kc-badge--danger {
  background: color-mix(in srgb, var(--kc-danger, #dc2626) 12%, transparent);
  border-color: color-mix(in srgb, var(--kc-danger, #dc2626) 25%, transparent);
  color: var(--kc-danger, #dc2626);
}

.kc-badge--info,
.kc-badge--primary {
  background: color-mix(in srgb, var(--kc-primary, #2563eb) 12%, transparent);
  border-color: color-mix(in srgb, var(--kc-primary, #2563eb) 25%, transparent);
  color: var(--kc-primary, #2563eb);
}

.kc-badge--gray {
  background: var(--kc-surface-soft, #f8fafc);
  border-color: var(--kc-border-soft, #e2e8f0);
  color: var(--kc-text-muted, #475569);
}

.kc-notice {
  display: flex;
  gap: var(--kc-space-3, 0.75rem);
  padding: var(--kc-space-4, 1rem);
  border: 1px solid var(--kc-border-soft, var(--kc-border, #e2e8f0));
  border-radius: var(--kc-radius-lg, 1rem);
  color: var(--kc-text, #0f172a);
}

.kc-notice--info {
  background: color-mix(in srgb, var(--kc-primary, #2563eb) 8%, var(--kc-surface, #ffffff));
  border-color: color-mix(in srgb, var(--kc-primary, #2563eb) 18%, var(--kc-border, #e2e8f0));
}

.kc-notice--warning {
  background: color-mix(in srgb, var(--kc-warning, #b45309) 8%, var(--kc-surface, #ffffff));
  border-color: color-mix(in srgb, var(--kc-warning, #b45309) 18%, var(--kc-border, #e2e8f0));
}

.kc-notice--danger {
  background: color-mix(in srgb, var(--kc-danger, #dc2626) 8%, var(--kc-surface, #ffffff));
  border-color: color-mix(in srgb, var(--kc-danger, #dc2626) 18%, var(--kc-border, #e2e8f0));
}

.kc-empty-state {
  padding: var(--kc-space-6, 1.5rem);
  background: var(--kc-surface-soft, #f8fafc);
  border: 1px dashed var(--kc-border, #cbd5e1);
  border-radius: var(--kc-radius-lg, 1rem);
  color: var(--kc-text-muted, #475569);
  text-align: center;
}

.kc-action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--kc-space-2, 0.5rem);
}

.kc-timeline {
  display: flex;
  flex-direction: column;
  gap: var(--kc-space-3, 0.75rem);
}

.kc-timeline__item {
  padding: var(--kc-space-3, 0.75rem);
  background: var(--kc-surface, #ffffff);
  border: 1px solid var(--kc-border-soft, var(--kc-border, #e2e8f0));
  border-radius: var(--kc-radius-md, 0.75rem);
}

/* 4KC server overview generic card-pattern extension */
.kc-kpi-card__top {
  display: flex;
  align-items: center;
  gap: var(--kc-space-2, 0.5rem);
}

.kc-kpi-card__icon {
  display: inline-flex;
  width: 2.25rem;
  height: 2.25rem;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 800;
}

.kc-kpi-card__icon--primary {
  background: color-mix(in srgb, var(--kc-primary, #2563eb) 16%, transparent);
  color: var(--kc-primary, #2563eb);
}

.kc-kpi-card__icon--success {
  background: color-mix(in srgb, var(--kc-success, #15803d) 16%, transparent);
  color: var(--kc-success, #15803d);
}

.kc-kpi-card__icon--info {
  background: color-mix(in srgb, var(--kc-info, #0ea5e9) 16%, transparent);
  color: var(--kc-info, #0ea5e9);
}

.kc-kpi-card__icon--purple {
  background: color-mix(in srgb, #7c3aed 16%, transparent);
  color: #7c3aed;
}

.kc-kpi-card__hint {
  color: var(--kc-text-muted, #64748b);
  font-size: 0.75rem;
  font-weight: 600;
}

.kc-text-success {
  color: var(--kc-success, #15803d);
}

.kc-text-purple {
  color: #7c3aed;
}

.kc-card-panel {
  display: flex;
  flex-direction: column;
  gap: var(--kc-space-4, 1rem);
  width: 100%;
  min-width: 0;
  overflow: hidden;
  padding: var(--kc-space-4, 1rem);
  background: var(--kc-surface, #ffffff);
  border: 1px solid var(--kc-border-soft, var(--kc-border, #e2e8f0));
  border-radius: var(--kc-radius-xl, 1.25rem);
  box-shadow: 0 10px 30px rgb(15 23 42 / 0.05);
}

.kc-panel-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--kc-space-3, 0.75rem);
}

.kc-panel-heading__title {
  margin: 0;
  color: var(--kc-text, #0f172a);
  font-size: 0.9375rem;
  font-weight: 800;
  line-height: 1.375rem;
}

.kc-panel-heading__hint {
  margin: var(--kc-space-1, 0.25rem) 0 0;
  color: var(--kc-text-muted, #64748b);
  font-size: 0.8125rem;
  line-height: 1.25rem;
}

.kc-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.125rem;
  padding: 0.1875rem;
  background: var(--kc-surface-soft, #f8fafc);
  border: 1px solid var(--kc-border-soft, #e2e8f0);
  border-radius: var(--kc-radius-md, 0.75rem);
}

.kc-view-toggle__item {
  display: inline-flex;
  min-height: 2rem;
  align-items: center;
  border-radius: calc(var(--kc-radius-md, 0.75rem) - 0.1875rem);
  color: var(--kc-text-muted, #64748b);
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 0.375rem 0.75rem;
}

.kc-view-toggle__item--active {
  background: var(--kc-primary, #2563eb);
  color: #ffffff;
  box-shadow: 0 8px 18px rgb(37 99 235 / 0.22);
}

.kc-resource-card-grid {
  display: grid;
  gap: var(--kc-space-4, 1rem);
  width: 100%;
  min-width: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.kc-resource-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--kc-space-3, 0.75rem);
  padding: var(--kc-space-4, 1rem);
  background: var(--kc-surface, #ffffff);
  border: 1px solid var(--kc-border-soft, var(--kc-border, #e2e8f0));
  border-radius: var(--kc-radius-lg, 1rem);
  box-shadow: 0 8px 24px rgb(15 23 42 / 0.04);
}

.kc-resource-card__header,
.kc-resource-card__title-row,
.kc-resource-card__actions {
  display: flex;
  align-items: center;
  gap: var(--kc-space-2, 0.5rem);
  flex-wrap: wrap;
}

.kc-resource-card__header {
  justify-content: space-between;
}

.kc-resource-card__title {
  margin: 0;
  color: var(--kc-text, #0f172a);
  font-size: 0.9375rem;
  font-weight: 800;
  line-height: 1.25rem;
}

.kc-status-dot {
  width: 0.625rem;
  height: 0.625rem;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--kc-text-subtle, #94a3b8);
}

.kc-status-dot--success {
  background: var(--kc-success, #15803d);
}

.kc-status-dot--danger {
  background: var(--kc-danger, #dc2626);
}

.kc-status-dot--warning {
  background: var(--kc-warning, #b45309);
}

.kc-status-dot--gray {
  background: var(--kc-text-subtle, #94a3b8);
}

.kc-icon-metric-list {
  display: flex;
  flex-direction: column;
  gap: var(--kc-space-2, 0.5rem);
  margin: 0;
}

.kc-icon-metric {
  display: grid;
  align-items: center;
  gap: var(--kc-space-2, 0.5rem);
  grid-template-columns: minmax(5rem, 0.85fr) minmax(0, 1fr);
  color: var(--kc-text-muted, #64748b);
  font-size: 0.8125rem;
}

.kc-icon-metric dt,
.kc-icon-metric dd {
  margin: 0;
}

.kc-icon-metric dd {
  min-width: 0;
  color: var(--kc-text, #0f172a);
  font-weight: 650;
  text-align: right;
}

.kc-icon-metric code {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  padding: 0.125rem 0.375rem;
  background: var(--kc-surface-soft, #f8fafc);
  border-radius: var(--kc-radius-sm, 0.5rem);
  color: inherit;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

.kc-button {
  display: inline-flex;
  min-height: 2rem;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--kc-radius-md, 0.75rem);
  font-size: 0.8125rem;
  font-weight: 800;
  padding: 0.375rem 0.75rem;
}

.kc-button--primary-outline {
  flex: 1 1 auto;
  background: color-mix(in srgb, var(--kc-primary, #2563eb) 8%, transparent);
  border-color: color-mix(in srgb, var(--kc-primary, #2563eb) 30%, transparent);
  color: var(--kc-primary, #2563eb);
}

.kc-button--icon {
  width: 2.25rem;
  padding-inline: 0;
  background: var(--kc-surface, #ffffff);
  border-color: var(--kc-border-soft, #e2e8f0);
  color: var(--kc-text-muted, #64748b);
}

.kc-notice__content {
  min-width: 0;
  flex: 1 1 auto;
}

.kc-notice__icon {
  color: var(--kc-primary, #2563eb);
  font-size: 1.5rem;
  line-height: 1;
}

.kc-notice__title {
  margin-bottom: var(--kc-space-2, 0.5rem);
  color: var(--kc-primary, #2563eb);
  font-weight: 800;
}

.kc-notice__grid {
  display: grid;
  gap: var(--kc-space-2, 0.5rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  color: var(--kc-text, #0f172a);
  font-size: 0.8125rem;
  line-height: 1.25rem;
}

@media (max-width: 640px) {
  .kc-panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .kc-view-toggle,
  .kc-resource-card__actions {
    width: 100%;
  }

  .kc-view-toggle {
    overflow-x: auto;
  }

  .kc-view-toggle__item {
    flex: 1 0 auto;
    justify-content: center;
  }

  .kc-resource-card-grid {
    grid-template-columns: 1fr;
  }

  .kc-icon-metric {
    grid-template-columns: 1fr;
  }

  .kc-icon-metric dd {
    text-align: left;
  }
}

@media (max-width: 1279px) {
  .kc-resource-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .kc-resource-card-grid {
    grid-template-columns: 1fr;
  }
}

/* 4KC server detail generic detail-pattern extension */
.kc-detail-shell {
  --kc-detail-panel-bg: color-mix(in srgb, var(--kc-surface, #ffffff) 92%, var(--kc-primary, #2563eb) 8%);
  width: 100%;
  max-width: none;
  min-width: 0;
}

.kc-detail-hero {
  display: grid;
  gap: var(--kc-space-6, 1.5rem);
  width: 100%;
}

.kc-detail-titlebar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--kc-space-6, 1.5rem);
}

.kc-detail-breadcrumbs {
  display: flex;
  align-items: center;
  gap: var(--kc-space-2, 0.5rem);
  color: var(--kc-text-muted, #64748b);
  font-size: 0.875rem;
  font-weight: 650;
}

.kc-detail-heading-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--kc-space-3, 0.75rem);
  margin-top: var(--kc-space-4, 1rem);
}

.kc-detail-title {
  margin: 0;
  color: var(--kc-text, #0f172a);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 850;
  letter-spacing: -0.05em;
  line-height: 1;
}

.kc-detail-subtitle {
  margin: var(--kc-space-3, 0.75rem) 0 0;
  color: var(--kc-text-muted, #64748b);
  font-size: 1rem;
  font-weight: 650;
}

.kc-detail-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--kc-space-3, 0.75rem);
}

.kc-button--primary {
  background: var(--kc-primary, #2563eb);
  border-color: var(--kc-primary, #2563eb);
  color: #ffffff;
  text-decoration: none;
}

.kc-button--secondary {
  background: var(--kc-surface, #ffffff);
  border-color: var(--kc-border-soft, #e2e8f0);
  color: var(--kc-text, #0f172a);
}

.kc-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.kc-status-strip {
  display: grid;
  gap: var(--kc-space-4, 1rem);
  width: 100%;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  padding: var(--kc-space-6, 1.5rem);
  background: var(--kc-detail-panel-bg);
  border: 1px solid var(--kc-border-soft, #e2e8f0);
  border-radius: var(--kc-radius-xl, 1.25rem);
  box-shadow: var(--kc-shadow-soft, 0 18px 60px rgba(15, 23, 42, 0.08));
}

.kc-status-metric {
  display: flex;
  align-items: center;
  gap: var(--kc-space-3, 0.75rem);
  min-width: 0;
}

.kc-status-metric__icon {
  display: inline-flex;
  flex: 0 0 auto;
  width: 2.5rem;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 900;
}

.kc-status-metric__icon--success {
  background: color-mix(in srgb, var(--kc-success, #16a34a) 14%, transparent);
  color: var(--kc-success, #16a34a);
}

.kc-status-metric__icon--warning {
  background: color-mix(in srgb, var(--kc-warning, #f59e0b) 14%, transparent);
  color: var(--kc-warning, #f59e0b);
}

.kc-status-metric__icon--info {
  background: color-mix(in srgb, var(--kc-primary, #2563eb) 14%, transparent);
  color: var(--kc-primary, #2563eb);
}

.kc-status-metric__icon--purple {
  background: color-mix(in srgb, #7c3aed 14%, transparent);
  color: #7c3aed;
}

.kc-status-metric__icon--gray {
  background: color-mix(in srgb, var(--kc-text-muted, #64748b) 14%, transparent);
  color: var(--kc-text-muted, #64748b);
}

.kc-status-metric__label,
.kc-status-metric small,
.kc-resource-meter small,
.kc-event-row small,
.kc-summary-list dt,
.kc-detail-list dt,
.kc-service-row small {
  display: block;
  color: var(--kc-text-muted, #64748b);
  font-size: 0.8125rem;
  line-height: 1.25rem;
}

.kc-status-metric strong,
.kc-resource-meter strong,
.kc-event-row strong {
  display: block;
  color: var(--kc-text, #0f172a);
  font-size: 1rem;
  font-weight: 800;
}

.kc-detail-grid {
  display: grid;
  gap: var(--kc-space-5, 1.25rem);
  width: 100%;
  min-width: 0;
}

.kc-detail-grid--two {
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
}

.kc-detail-grid--four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.kc-detail-panel {
  min-width: 0;
}

.kc-panel-heading--split {
  flex-direction: row;
  justify-content: space-between;
}

.kc-detail-list,
.kc-summary-list {
  display: grid;
  gap: var(--kc-space-3, 0.75rem);
  margin: 0;
}

.kc-detail-list--columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.kc-detail-list div,
.kc-summary-list div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--kc-space-4, 1rem);
  padding-block: 0.25rem;
}

.kc-detail-list dd,
.kc-summary-list dd {
  margin: 0;
  color: var(--kc-text, #0f172a);
  font-weight: 700;
  text-align: right;
}

.kc-panel-footer {
  margin-top: var(--kc-space-5, 1.25rem);
  padding-top: var(--kc-space-4, 1rem);
  border-top: 1px solid var(--kc-border-soft, #e2e8f0);
}

.kc-detail-tabs {
  display: flex;
  gap: var(--kc-space-5, 1.25rem);
  overflow-x: auto;
  border-bottom: 1px solid var(--kc-border-soft, #e2e8f0);
}

.kc-detail-tab {
  display: inline-flex;
  padding: 0 0 var(--kc-space-3, 0.75rem);
  border: 0;
  background: transparent;
  color: var(--kc-text-muted, #64748b);
  font-size: 0.875rem;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
}

.kc-detail-tab--active {
  border-bottom: 2px solid var(--kc-primary, #2563eb);
  color: var(--kc-primary, #2563eb);
}

.kc-service-list,
.kc-resource-meter-list,
.kc-event-list {
  display: grid;
  gap: var(--kc-space-3, 0.75rem);
}

.kc-service-row,
.kc-resource-meter,
.kc-event-row {
  display: flex;
  align-items: center;
  gap: var(--kc-space-3, 0.75rem);
  justify-content: space-between;
  padding-bottom: var(--kc-space-3, 0.75rem);
  border-bottom: 1px solid var(--kc-border-subtle, #edf2f7);
}

.kc-service-row__meta {
  display: inline-flex;
  align-items: center;
  gap: var(--kc-space-2, 0.5rem);
}

.kc-resource-meter,
.kc-event-row {
  justify-content: flex-start;
}

.kc-resource-meter__circle {
  display: inline-flex;
  width: 3rem;
  height: 3rem;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 4px solid currentColor;
  border-radius: 999px;
  color: var(--kc-primary, #2563eb);
  font-size: 0.8125rem;
  font-weight: 850;
}

.kc-resource-meter__circle--success {
  color: var(--kc-success, #16a34a);
}

.kc-resource-meter__circle--purple {
  color: #7c3aed;
}

.kc-event-row__dot {
  display: inline-flex;
  width: 1.75rem;
  height: 1.75rem;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--kc-primary, #2563eb);
}

.kc-event-row__dot--success {
  background: var(--kc-success, #16a34a);
}

.kc-event-row__dot--purple {
  background: #7c3aed;
}

.kc-link,
.kc-panel-link {
  color: var(--kc-primary, #2563eb);
  font-weight: 750;
  text-decoration: none;
}

.kc-panel-link {
  display: flex;
  justify-content: space-between;
  margin-top: auto;
  padding-top: var(--kc-space-5, 1.25rem);
}

.kc-badge--purple {
  background: color-mix(in srgb, #7c3aed 11%, transparent);
  color: #6d28d9;
}

.kc-text-success {
  color: var(--kc-success, #16a34a) !important;
}

.kc-text-warning {
  color: var(--kc-warning, #f59e0b) !important;
}

@media (max-width: 1280px) {
  .kc-status-strip,
  .kc-detail-grid--four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kc-detail-grid--two {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .kc-detail-titlebar {
    align-items: stretch;
    flex-direction: column;
  }

  .kc-detail-actions,
  .kc-status-strip,
  .kc-detail-grid--four,
  .kc-detail-list--columns {
    grid-template-columns: 1fr;
  }

  .kc-detail-actions {
    justify-content: flex-start;
  }
}

/* 4KC standard table shell
 * Single source of truth for custom table views. Mirrors the customer table UX:
 * compact toolbar, right-aligned filter/column popovers, consistent actions,
 * pagination and responsive card layout.
 */
.kc-table-standard {
  position: relative;
  overflow: visible;
  max-width: 100%;
  min-width: 0;
  gap: 0;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  box-sizing: border-box;
}

.kc-table-panel.kc-table-standard {
  gap: 0;
}

.dark .kc-table-standard {
  background: #0b1422;
  color: #e5edf7;
  border-color: #1f2b3d;
  box-shadow: none;
}

.kc-table-standard *,
.kc-table-standard *::before,
.kc-table-standard *::after {
  box-sizing: border-box;
}

.kc-table-standard [hidden] {
  display: none !important;
}

.kc-table-standard .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.kc-table-standard .kc-table-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 14px 18px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
}

.kc-table-standard .kc-table-card-head h3 {
  margin: 0;
  color: #0f172a;
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.2;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.kc-table-standard .kc-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 70px;
  padding: 12px 18px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
}

.kc-table-standard .kc-table-toolbar__spacer {
  flex: 1 1 auto;
  min-width: 1px;
}

.kc-table-standard .kc-table-toolbar__controls {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  position: relative;
  min-width: 0;
  flex: 0 1 min(100%, 520px);
}

.kc-table-standard .kc-table-search-shell {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 14rem;
  min-width: 10rem;
  max-width: 24rem;
  height: 44px;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  background: #f8fafc;
  color: #64748b;
  padding: 0 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
}

.kc-table-standard .kc-table-search-shell span {
  font-size: 24px;
  line-height: 1;
  color: #94a3b8;
  transform: rotate(-20deg);
  font-weight: 300;
}

.kc-table-standard .kc-table-search {
  width: 100%;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  color: #0f172a;
  padding: 0;
  font-size: 15px;
  outline: none;
}

.kc-table-standard .kc-table-search::placeholder {
  color: #94a3b8;
}

.kc-table-standard .kc-table-icon-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 0 0 auto;
  min-width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #64748b;
  padding: 0 12px;
  cursor: pointer;
}

.kc-table-standard .kc-table-icon-button__label {
  display: inline-flex;
  color: currentColor;
  font-size: 13px;
  font-weight: 850;
  line-height: 1;
}

.kc-table-standard .kc-table-icon-button svg {
  width: 24px;
  height: 24px;
}

.kc-table-standard .kc-table-icon-button[aria-expanded="true"],
.kc-table-standard .kc-table-icon-button.is-open {
  box-shadow: 0 0 0 2px #2563eb inset;
  color: #1d4ed8;
  background: #eff6ff;
}

.kc-table-standard .kc-table-counter {
  position: absolute;
  top: 2px;
  right: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 19px;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
}

.kc-table-standard .kc-table-filter-panel,
.kc-table-standard .kc-table-settings-panel {
  position: absolute;
  right: 18px;
  top: 126px;
  z-index: 1200;
  width: min(22rem, calc(100% - 36px));
  max-width: calc(100vw - 48px);
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.18);
  padding: 0;
  color: #111827;
  text-align: left;
  overflow: hidden;
}

.kc-table-standard .kc-table-filter-panel {
  width: min(22rem, calc(100% - 36px), calc(100vw - 48px));
}

.kc-table-standard .kc-table-settings-panel {
  width: min(20rem, calc(100% - 36px), calc(100vw - 48px));
}

.kc-table-standard--manual .kc-table-toolbar__controls .kc-table-filter-panel,
.kc-table-standard--manual .kc-table-toolbar__controls .kc-table-settings-panel {
  top: calc(100% + 10px);
  right: 0;
}

.kc-table-standard .kc-table-popover-head,
.kc-table-standard .fi-ta-filters-header,
.kc-table-standard .fi-ta-col-manager-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
  padding: 14px 16px;
}

.kc-table-standard .kc-table-popover-head div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.kc-table-standard .kc-table-popover-head span {
  color: #64748b;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.kc-table-standard .kc-table-popover-head strong,
.kc-table-standard .fi-ta-filters-heading,
.kc-table-standard .fi-ta-col-manager-heading {
  display: block;
  color: #111827;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0;
  margin: 0;
}

.kc-table-standard .kc-table-popover-head small {
  display: block;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.kc-table-standard .kc-table-filter-form {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.kc-table-standard .kc-table-filter-field {
  display: grid;
  gap: 8px;
}

.kc-table-standard .kc-table-filter-field span,
.kc-table-standard .kc-table-filter-check {
  color: #374151;
  font-size: 13px;
  font-weight: 500;
}

.kc-table-standard .kc-table-filter-field select {
  width: 100%;
  height: 38px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  padding: 0 34px 0 12px;
  font-size: 14px;
  outline: none;
}

.kc-table-standard .kc-table-filter-check {
  display: flex;
  align-items: center;
  gap: 10px;
}

.kc-table-standard .kc-table-filter-check input,
.kc-table-standard .kc-table-settings-grid input {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  accent-color: #2563eb;
}

.kc-table-standard .kc-table-settings-grid {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.kc-table-standard .kc-table-settings-grid label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #374151;
  font-size: 14px;
  font-weight: 500;
}

.kc-table-standard .kc-table-popover-actions,
.kc-table-standard .fi-ta-filters-actions-ctn,
.kc-table-standard .fi-ta-col-manager-actions-ctn {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
  margin: 0;
  padding: 12px 16px;
}

.kc-table-standard .kc-table-settings-panel .kc-table-popover-actions {
  margin: 14px 0 0;
}

.kc-table-standard .kc-table-reset-button,
.kc-table-standard .kc-table-native-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #dc2626;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.kc-table-standard .kc-table-reset-button--head {
  flex: 0 0 auto;
  margin-left: auto;
}

.kc-table-standard .kc-table-apply-button,
.kc-table-standard .kc-table-native-apply {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  min-width: 0;
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: none;
  cursor: pointer;
}

.kc-table-standard .kc-table-bulkbar {
  margin: 0;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1e3a8a;
  padding: 10px 18px;
  font-size: 14px;
}

.kc-table-standard .kc-table-wrap {
  position: relative;
  z-index: 1;
  max-width: 100%;
  overflow-x: auto;
  background: #fff;
  overscroll-behavior-x: contain;
}

.kc-table-standard .kc-table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  background: #fff;
  color: #0f172a;
  font-size: 14px;
  table-layout: fixed;
}

.kc-table-standard .kc-table th,
.kc-table-standard .kc-table td {
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
  color: #0f172a;
  text-align: left;
  padding: 12px 14px;
  vertical-align: middle;
  white-space: normal;
  min-width: 0;
}

.kc-table-standard .kc-table th {
  height: 52px;
  background: #f8fafc;
  color: #334155;
  font-size: 13px;
  font-weight: 850;
}

.kc-table-standard .kc-table td {
  height: auto;
  min-height: 58px;
  color: #0f172a;
  font-size: 14px;
}

.kc-table-standard .kc-table tbody tr:hover td {
  background: #f8fafc;
}

.kc-table-standard .kc-table-select {
  width: 44px;
  padding-right: 4px !important;
  text-align: center;
}

.kc-table-standard .kc-table-select input {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  accent-color: #2563eb;
}

.kc-table-standard .kc-table-sort {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 850;
  padding: 0;
  cursor: pointer;
  max-width: 100%;
}

.kc-table-standard .kc-table-sort span {
  color: #94a3b8;
  font-size: 20px;
  line-height: 1;
  transform: translateY(-1px);
}

.kc-table-standard .kc-table-actions,
.kc-table-standard .kc-table-actions-heading {
  text-align: right !important;
}

.kc-table-standard .kc-table-actions-heading {
  width: 118px;
}

.kc-table-standard .kc-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #e2e8f0;
  padding: 14px 18px;
  color: #475569;
  font-size: 13px;
  flex-wrap: wrap;
}

.kc-table-standard .kc-table-footer label,
.kc-table-standard .kc-table-pagination {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.kc-table-standard .kc-table-footer select,
.kc-table-standard .kc-table-footer button {
  height: 36px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  padding: 0 11px;
  font-weight: 750;
}

.kc-table-standard .kc-table-pagination button[data-kc-page-indicator] {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.kc-table-standard .kc-empty-state {
  padding: 28px;
  text-align: center;
  color: #64748b;
}

.dark .kc-table-standard .kc-table-card-head,
.dark .kc-table-standard .kc-table-toolbar,
.dark .kc-table-standard .kc-table-wrap,
.dark .kc-table-standard .kc-table,
.dark .kc-table-standard .kc-table th,
.dark .kc-table-standard .kc-table td {
  background: #0b1422;
  border-color: #1f2b3d;
  color: #f8fafc;
}

.dark .kc-table-standard .kc-table-card-head h3 {
  color: #f8fafc;
}

.dark .kc-table-standard .kc-table th {
  background: #192233;
  color: #f8fafc;
}

.dark .kc-table-standard .kc-table tbody tr:hover td {
  background: #101a2b;
}

.dark .kc-table-standard .kc-table-search-shell,
.dark .kc-table-standard .kc-table-filter-field select,
.dark .kc-table-standard .kc-table-footer select,
.dark .kc-table-standard .kc-table-footer button {
  border-color: #3b465a;
  background: #192233;
  color: #f8fafc;
}

.dark .kc-table-standard .kc-table-search {
  color: #f8fafc;
}

.dark .kc-table-standard .kc-table-icon-button {
  color: #8ea0ba;
}

.dark .kc-table-standard .kc-table-icon-button[aria-expanded="true"],
.dark .kc-table-standard .kc-table-icon-button.is-open {
  box-shadow: 0 0 0 2px #2563eb inset;
  color: #c8d7ee;
  background: #172133;
}

.dark .kc-table-standard .kc-table-counter {
  background: #1f2937;
  border-color: #475569;
  color: #e5edf7;
}

.dark .kc-table-standard .kc-table-filter-panel,
.dark .kc-table-standard .kc-table-settings-panel {
  border-color: #26364b;
  background: #0b1422;
  box-shadow: 0 28px 68px rgba(0, 0, 0, 0.42);
  color: #f8fafc;
}

.dark .kc-table-standard .kc-table-popover-head,
.dark .kc-table-standard .fi-ta-filters-header,
.dark .kc-table-standard .fi-ta-col-manager-header {
  border-color: #26364b;
  background: #0b1422;
}

.dark .kc-table-standard .kc-table-popover-head strong,
.dark .kc-table-standard .fi-ta-filters-heading,
.dark .kc-table-standard .fi-ta-col-manager-heading,
.dark .kc-table-standard .kc-table-filter-field span,
.dark .kc-table-standard .kc-table-filter-check,
.dark .kc-table-standard .kc-table-settings-grid label {
  color: #f8fafc;
}

.dark .kc-table-standard .kc-table-popover-head span,
.dark .kc-table-standard .kc-table-popover-head small {
  color: #8ea0ba;
}

.dark .kc-table-standard .kc-table-filter-field select {
  border-color: #334155;
  background: #111827;
  color: #f8fafc;
}

.dark .kc-table-standard .kc-table-reset-button,
.dark .kc-table-standard .kc-table-native-reset {
  background: transparent;
  color: #f87171;
}

.dark .kc-table-standard .kc-table-popover-actions,
.dark .kc-table-standard .fi-ta-filters-actions-ctn,
.dark .kc-table-standard .fi-ta-col-manager-actions-ctn {
  border-color: #26364b;
  background: #0b1422;
}

@media (max-width: 1100px) {
  .kc-table-standard .kc-table th,
  .kc-table-standard .kc-table td {
    padding: 10px 12px;
    font-size: 13px;
  }

  .kc-table-standard .kc-table-actions-heading {
    width: 104px;
  }
}

@media (max-width: 900px) {
  .kc-table-standard .kc-table-card-head,
  .kc-table-standard .kc-table-toolbar {
    align-items: stretch;
    flex-direction: column;
    height: auto;
    padding: 16px;
  }

  .kc-table-standard .kc-table-toolbar__controls {
    justify-content: flex-start;
    flex-wrap: wrap;
    flex-basis: auto;
    max-width: none;
    width: 100%;
  }

  .kc-table-standard .kc-table-search-shell {
    max-width: none;
    width: 100%;
  }

  .kc-table-standard .kc-table-filter-panel,
  .kc-table-standard .kc-table-settings-panel {
    position: absolute;
    right: 12px;
    top: 136px;
    width: min(520px, calc(100% - 24px), calc(100vw - 32px));
    padding: 0;
  }
}

@media (max-width: 760px) {
  .kc-table-standard .kc-table-wrap {
    overflow-x: visible;
    padding: 10px;
    background: #f8fafc;
  }

  .kc-table-standard .kc-table,
  .kc-table-standard .kc-table thead,
  .kc-table-standard .kc-table tbody,
  .kc-table-standard .kc-table tr,
  .kc-table-standard .kc-table td {
    display: block;
    width: 100%;
  }

  .kc-table-standard .kc-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .kc-table-standard .kc-table tr {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    margin: 0 0 10px;
    overflow: hidden;
  }

  .kc-table-standard .kc-table td {
    display: grid;
    grid-template-columns: minmax(6rem, 34%) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    border-bottom: 1px solid #e2e8f0;
    padding: 10px 12px;
    text-align: left !important;
    min-height: 0;
  }

  .kc-table-standard .kc-table td::before {
    content: attr(data-label);
    color: #64748b;
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0.02em;
  }

  .kc-table-standard .kc-table td.kc-table-select {
    display: flex;
    width: 100%;
    justify-content: flex-start;
    align-items: center;
    padding: 10px 12px !important;
  }

  .kc-table-standard .kc-table td.kc-table-select::before {
    content: 'Auswahl';
    margin-right: 12px;
    color: #64748b;
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
  }

  .kc-table-standard .kc-table td:last-child {
    border-bottom: 0;
  }

  .kc-table-standard .kc-table-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .kc-table-standard .kc-table-filter-panel,
  .kc-table-standard .kc-table-settings-panel {
    top: 150px;
    left: 10px;
    right: 10px;
    width: auto;
    max-width: none;
  }

  .dark .kc-table-standard .kc-table-wrap {
    background: #0f172a;
  }

  .dark .kc-table-standard .kc-table tr {
    border-color: #1f2b3d;
    background: #0b1422;
  }

  .dark .kc-table-standard .kc-table td::before,
  .dark .kc-table-standard .kc-table td.kc-table-select::before {
    color: #8ea0ba;
  }
}

@media (max-width: 520px) {
  .kc-table-standard .kc-table-card-head {
    gap: 10px;
  }

  .kc-table-standard .kc-table-toolbar__controls {
    display: grid;
    grid-template-columns: 1fr auto auto;
  }

  .kc-table-standard .kc-table-search-shell {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .kc-table-standard .kc-table td {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .kc-table-standard .kc-table-apply-button {
    width: 100%;
    min-width: 0;
  }
}

/* TLD selling-price calculation cards */
.kc-selling-price-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--kc-space-4, 1rem);
  align-items: stretch;
}

.kc-selling-price-card {
  display: flex;
  min-width: 0;
  min-height: 100%;
  flex-direction: column;
  overflow: hidden;
  background: var(--kc-surface, #ffffff);
  border: 1px solid var(--kc-border-soft, var(--kc-border, #e2e8f0));
  border-radius: var(--kc-radius-lg, 1rem);
  box-shadow: 0 8px 24px rgb(15 23 42 / 0.05);
  color: var(--kc-text, #0f172a);
}

.kc-selling-price-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--kc-space-3, 0.75rem);
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--kc-border-soft, var(--kc-border, #e2e8f0));
}

.kc-selling-price-card__title {
  margin: 0;
  color: var(--kc-text, #0f172a);
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.kc-selling-price-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1rem;
}

.kc-selling-price-card__empty {
  padding: 1rem;
  color: var(--kc-text-muted, #475569);
  font-size: 0.875rem;
}

.kc-selling-price-breakdown {
  display: grid;
  gap: 0.625rem;
  margin: 0;
}

.kc-selling-price-row {
  display: grid;
  grid-template-columns: minmax(7.5rem, 1fr) minmax(5.5rem, auto);
  align-items: start;
  gap: 1rem;
  font-size: 0.875rem;
  line-height: 1.35;
}

.kc-selling-price-row dt {
  color: var(--kc-text-muted, #475569);
}

.kc-selling-price-row dd {
  margin: 0;
  color: var(--kc-text, #0f172a);
  font-weight: 650;
  text-align: right;
}

.kc-selling-price-row dd strong,
.kc-selling-price-row dd span {
  display: block;
}

.kc-selling-price-row dd span {
  margin-top: 0.15rem;
  color: var(--kc-text-muted, #475569);
  font-size: 0.75rem;
  font-weight: 600;
}

.kc-selling-price-rule {
  margin-top: 0.15rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--kc-border-soft, var(--kc-border, #e2e8f0));
}

.kc-selling-price-total {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--kc-border, #cbd5e1);
}

.kc-selling-price-total span {
  color: var(--kc-primary, #2563eb);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.kc-selling-price-total strong {
  color: var(--kc-text, #0f172a);
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.1;
  text-align: right;
}

.dark .kc-selling-price-card {
  background: var(--kc-surface-soft, #0f172a);
  border-color: var(--kc-border, #334155);
  box-shadow: 0 12px 30px rgb(0 0 0 / 0.22);
  color: var(--kc-text, #e2e8f0);
}

.dark .kc-selling-price-card__header,
.dark .kc-selling-price-rule,
.dark .kc-selling-price-total {
  border-color: var(--kc-border, #334155);
}

.dark .kc-selling-price-card__body {
  background: transparent;
}

.dark .kc-selling-price-card__title,
.dark .kc-selling-price-row dd,
.dark .kc-selling-price-total strong {
  color: var(--kc-text, #e2e8f0);
}

.dark .kc-selling-price-row dt,
.dark .kc-selling-price-row dd span,
.dark .kc-selling-price-card__empty {
  color: var(--kc-text-muted, #cbd5e1);
}

.dark .kc-selling-price-total span {
  color: var(--kc-primary, #60a5fa);
}

@media (min-width: 1500px) {
  .kc-selling-price-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .kc-selling-price-grid {
    grid-template-columns: 1fr;
  }
}
