/* ============================================================================
   CENTRALIZED TABLE COMPONENT SYSTEM
   ============================================================================
   
   This file defines all reusable table styles across the application.
   Uses design tokens from /static/css/tokens/base.css
   
   Table Variants:
   - .table (base)
   - .table-striped (alternating row colors)
   - .table-hover (row hover effects)
   - .table-compact (reduced padding)
   - .table-spacious (increased padding)
   
   Table Structure:
   - .table-container / .table-wrapper
   - table, thead, tbody, tfoot
   - .table-head, .table-body, .table-foot
   - th, td
   - .table-header, .table-cell
   
   ============================================================================ */

/* ============================================================================
   TABLE CONTAINER
   ============================================================================ */

.table-container,
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-lg, 14px);
  border: 1px solid var(--color-border-subtle);
  background: var(--color-surface);
  box-shadow: var(--shadow-xs);
}

.table-container-dense {
  border-radius: var(--radius-md, 10px);
  border: none;
}

/* ============================================================================
   BASE TABLE STYLES
   ============================================================================ */

.table,
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-family-base);
  font-size: var(--font-size-sm);
  text-align: left;
}

/* ============================================================================
   TABLE HEAD
   ============================================================================ */

.table thead,
.table-head,
table thead {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border-subtle);
}

.table th,
.table-header,
table th {
  padding: var(--space-3) var(--space-4);
  font-weight: 700;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  vertical-align: middle;
  white-space: nowrap;
  text-align: left;
}

.table th:first-child,
.table-header:first-child,
table th:first-child {
  text-align: left;
}

.table th:last-child,
.table-header:last-child,
table th:last-child {
  text-align: right;
}

/* ============================================================================
   TABLE BODY
   ============================================================================ */

.table tbody,
.table-body,
table tbody {
  border-top: none;
}

.table tr,
.table-row,
table tr {
  border-bottom: 1px solid var(--color-border-subtle);
  transition: background var(--duration-base) var(--easing-smooth);
}

.table tr:last-child,
.table-row:last-child,
table tr:last-child {
  border-bottom: none;
}

.table td,
.table-cell,
table td {
  padding: var(--space-3) var(--space-4);
  vertical-align: middle;
  color: var(--color-text);
}

.table td:first-child,
.table-cell:first-child,
table td:first-child {
  text-align: left;
}

.table td:last-child,
.table-cell:last-child,
table td:last-child {
  text-align: right;
}

/* ============================================================================
   TABLE HOVER STATE
   ============================================================================ */

.table-hover tbody tr:hover,
table.table-hover tbody tr:hover {
  background: var(--color-bg);
  cursor: pointer;
}

.table tbody tr:hover,
table tbody tr:hover {
  background: rgba(99, 102, 241, 0.03);
}

/* ============================================================================
   TABLE STRIPED
   ============================================================================ */

.table-striped tbody tr:nth-child(odd),
table.table-striped tbody tr:nth-child(odd) {
  background: var(--color-bg);
}

.table-striped tbody tr:nth-child(odd):hover,
table.table-striped tbody tr:nth-child(odd):hover {
  background: var(--color-border-subtle);
}

/* ============================================================================
   TABLE SIZES
   ============================================================================ */

/* Compact Table */
.table-compact th,
.table-compact td,
table.table-compact th,
table.table-compact td {
  padding: var(--space-2) var(--space-2);
  font-size: var(--font-size-xs);
}

/* Spacious Table */
.table-spacious th,
.table-spacious td,
table.table-spacious th,
table.table-spacious td {
  padding: var(--space-4) var(--space-5);
  font-size: var(--font-size-base);
}

/* ============================================================================
   TABLE CELL VARIANTS
   ============================================================================ */

.table-cell-primary,
.td-primary {
  font-weight: 600;
  color: var(--color-text);
}

.table-cell-muted,
.td-muted {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
}

.table-cell-numeric,
.td-numeric {
  text-align: right;
  font-family: "Courier New", monospace;
  font-weight: 500;
}

.table-cell-center,
.td-center {
  text-align: center;
}

.table-cell-right,
.td-right {
  text-align: right;
}

.table-cell-truncate {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================================================
   TABLE CELL STATUS COLORS
   ============================================================================ */

.table-cell-success,
.cell-success {
  color: #10b981;
  font-weight: 600;
}

.table-cell-error,
.cell-error,
.table-cell-danger,
.cell-danger {
  color: #ef4444;
  font-weight: 600;
}

.table-cell-warning,
.cell-warning {
  color: #f59e0b;
  font-weight: 600;
}

.table-cell-info,
.cell-info {
  color: var(--color-accent);
  font-weight: 600;
}

/* ============================================================================
   TABLE FOOTER
   ============================================================================ */

.table tfoot,
.table-foot,
table tfoot {
  background: var(--color-bg);
  border-top: 2px solid var(--color-border-subtle);
}

.table tfoot tr,
table tfoot tr {
  border-bottom: none;
}

.table tfoot td,
table tfoot td {
  font-weight: 600;
  color: var(--color-text);
}

/* ============================================================================
   TABLE EMPTY STATE
   ============================================================================ */

.table-empty,
.table-empty-row {
  padding: var(--space-6) var(--space-4);
  text-align: center;
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

.table-empty-icon {
  font-size: 48px;
  opacity: 0.3;
  margin-bottom: var(--space-2);
}

.table-empty-text {
  font-weight: 500;
  margin-bottom: var(--space-1);
}

.table-empty-subtext {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

/* ============================================================================
   TABLE ACTIONS
   ============================================================================ */

.table-actions,
.table-cell-actions,
.td-actions,
.table-action-group {
  display: flex;
  gap: var(--space-1);
  align-items: center;
  justify-content: flex-end;
  white-space: nowrap;
}

.table-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: var(--space-1);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm, 6px);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--duration-base) var(--easing-smooth);
  font-size: 18px;
}

.table-action-btn svg,
.table-action-btn svg use {
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  fill: currentColor;
  stroke: currentColor;
  flex-shrink: 0;
  pointer-events: none;
  display: inline-block;
}

.table-action-btn:hover {
  background: var(--color-bg) !important;
  border-color: var(--color-border) !important;
  color: var(--color-text) !important;
}

.table-action-btn-primary:hover {
  background: var(--color-accent-contrast) !important;
  color: var(--color-accent) !important;
}

.table-action-group--start {
  justify-content: flex-start;
}

.table-action-btn--circle {
  width: 30px;
  min-width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--color-border-subtle) !important;
  border-radius: 999px !important;
  background: var(--color-surface) !important;
  box-shadow: none;
  color: var(--color-text-muted);
  flex: 0 0 auto;
}

.table-action-btn--circle:hover {
  transform: none;
  box-shadow: none;
}

.table-action-btn-view:hover {
  background: var(--color-accent-contrast) !important;
  border-color: rgba(59, 130, 246, 0.24) !important;
  color: var(--color-accent) !important;
}

.table-action-btn-edit:hover {
  background: rgba(16, 185, 129, 0.12) !important;
  border-color: rgba(16, 185, 129, 0.24) !important;
  color: #059669 !important;
}

.table-action-btn-duplicate:hover {
  background: rgba(139, 92, 246, 0.12) !important;
  border-color: rgba(139, 92, 246, 0.24) !important;
  color: #7c3aed !important;
}

.table-action-btn-danger:hover {
  background: rgba(239, 68, 68, 0.12) !important;
  border-color: rgba(239, 68, 68, 0.24) !important;
  color: #dc2626 !important;
}

/* ============================================================================
   TABLE SELECTION
   ============================================================================ */

.table-select-all,
.table-cell-select input[type="checkbox"] {
  cursor: pointer;
}

.table-row-selected {
  background: var(--color-accent-contrast);
}

.table-row-selected:hover {
  background: rgba(99, 102, 241, 0.15);
}

/* ============================================================================
   PAGINATION
   ============================================================================ */

.table-pagination,
.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--color-border-subtle);
  background: var(--color-bg);
  flex-wrap: wrap;
}

.table-pagination-info {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
}

.table-pagination-count {
  font-weight: 600;
  color: var(--color-text);
}

.table-pagination-controls {
  display: flex;
  gap: var(--space-1);
  align-items: center;
}

.table-pagination-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm, 6px);
  color: var(--color-text);
  cursor: pointer;
  font-size: var(--font-size-sm);
  font-weight: 500;
  transition: all var(--duration-base) var(--easing-smooth);
}

.table-pagination-btn:hover:not(:disabled) {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: white;
}

.table-pagination-btn:disabled,
.table-pagination-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.table-pagination-btn-active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: white;
}

/* ============================================================================
   RESPONSIVE TABLE
   ============================================================================ */

@media (max-width: 768px) {
  .table-container {
    border-radius: var(--radius-md, 10px);
  }

  .table th,
  .table td {
    padding: var(--space-2) var(--space-2);
    font-size: var(--font-size-xs);
  }

  .table-spacious th,
  .table-spacious td {
    padding: var(--space-3) var(--space-3);
  }

  .table-pagination {
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
  }

  .table-pagination-info,
  .table-pagination-controls {
    width: 100%;
    justify-content: center;
  }

  /* Hide specific columns on mobile */
  .table-hide-mobile {
    display: none;
  }
}

@media (max-width: 480px) {
  .table-container {
    border: none;
    border-radius: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table {
    min-width: 600px;
  }

  .table th,
  .table td {
    padding: var(--space-1) var(--space-2);
    font-size: 12px;
  }

  .table-actions {
    flex-direction: column;
    gap: 4px;
  }

  .table-pagination-btn {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }
}

/* ============================================================================
   DARK MODE ADJUSTMENTS
   ============================================================================ */

html[data-theme="dark"] .table-container {
  background: var(--color-surface);
  border-color: var(--color-border);
}

html[data-theme="dark"] .table thead {
  background: var(--color-bg);
  border-color: var(--color-border);
}

html[data-theme="dark"] .table tr {
  border-color: var(--color-border);
}

html[data-theme="dark"] .table tbody tr:hover {
  background: rgba(99, 102, 241, 0.05);
}

html[data-theme="dark"] .table-striped tbody tr:nth-child(odd) {
  background: var(--color-bg);
}

html[data-theme="dark"] .table-striped tbody tr:nth-child(odd):hover {
  background: rgba(99, 102, 241, 0.1);
}

html[data-theme="dark"] .table-pagination,
html[data-theme="dark"] .table tfoot {
  background: var(--color-bg);
  border-color: var(--color-border);
}

html[data-theme="dark"] .table-pagination-btn {
  background: var(--color-surface);
  border-color: var(--color-border);
}

html[data-theme="dark"] .table-action-btn {
  color: var(--color-text-muted);
}

html[data-theme="dark"] .table-action-btn:hover {
  background: var(--color-surface);
  border-color: var(--color-border);
}

/* System preference dark mode support */
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .table-container {
    background: var(--color-surface);
    border-color: var(--color-border);
  }

  html:not([data-theme]) .table thead {
    background: var(--color-bg);
    border-color: var(--color-border);
  }

  html:not([data-theme]) .table tr {
    border-color: var(--color-border);
  }

  html:not([data-theme]) .table tbody tr:hover {
    background: rgba(99, 102, 241, 0.05);
  }

  html:not([data-theme]) .table-striped tbody tr:nth-child(odd) {
    background: var(--color-bg);
  }

  html:not([data-theme]) .table-striped tbody tr:nth-child(odd):hover {
    background: rgba(99, 102, 241, 0.1);
  }

  html:not([data-theme]) .table-pagination,
  html:not([data-theme]) .table tfoot {
    background: var(--color-bg);
    border-color: var(--color-border);
  }

  html:not([data-theme]) .table-pagination-btn {
    background: var(--color-surface);
    border-color: var(--color-border);
  }

  html:not([data-theme]) .table-action-btn {
    color: var(--color-text-muted);
  }

  html:not([data-theme]) .table-action-btn:hover {
    background: var(--color-surface);
    border-color: var(--color-border);
  }
}

/* ============================================================================
   GENERAL TABLE LAYOUT (used by general_table.html)
   ============================================================================ */

div.table {
  display: flex !important;
  flex-direction: column !important;
  width: 100%;
}

div.table.dashboard-booking-table-wrapper {
  overflow: visible !important;
}

.general-table-scroll {
  height: 42.5rem !important;
  overflow: auto !important;
  min-height: 0;
  flex: 1 1 auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.general-table-scroll > table {
  width: 100%;
  min-width: 1200px;
}

.general-table-scroll > table > thead > tr {
  position: sticky;
  top: 0;
  z-index: 1;
  background-color: #f9fafb;
}

.general-table-scroll > table > tbody > tr:last-child {
  border-bottom: none !important;
}

html[data-theme="dark"] .general-table-scroll > table > thead > tr {
  background-color: var(--color-bg);
}

/* ---------- Aim Table Styles ---------- */
.aim-table-wrap {
  width: 100%;
  min-width: 0;
}

.aim-table-wrap .table {
  display: block !important;
}

.aim-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  table-layout: auto;
}

.general-table-scroll > .aim-table {
  min-width: 0;
}

.aim-table thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 16px;
  border-bottom: 1px solid var(--color-border-subtle);
  background: var(--color-bg);
  overflow: hidden;
}

.aim-table thead th.aim-cell-icon {
  width: 44px;
  padding-right: 0;
}

.aim-table tbody tr:hover {
  background: var(--color-bg);
}

.aim-provider-name {
  font-weight: 600;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

.aim-provider-meta {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

.aim-cell-actions {
  text-align: right;
  white-space: nowrap;
  overflow: visible;
}

html[data-theme="dark"] .aim-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

.table-header-actions {
  text-align: right;
}

.table-cell-id {
  text-align: center;
  font-weight: 500;
  color: #6b7280;
}

.table-cell-content {
  color: #111827;
}

html[data-theme="dark"] .table-cell-id {
  color: var(--color-text-muted);
}

html[data-theme="dark"] .table-cell-content {
  color: var(--color-text);
}

/* ============================================================================
   UNPREFIXED PAGINATION (used by catalog, enrollments tables)
   ============================================================================ */

.pagination-info {
  font-size: 0.875rem;
  color: #6b7280;
}

.pagination-highlight {
  font-weight: 500;
  color: #111827;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pagination-btn {
  padding: 0.5rem;
  border-radius: 0.375rem;
  border: 1px solid #d1d5db;
  background-color: white;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pagination-btn:hover:not(:disabled) {
  background-color: #f3f4f6;
}

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

@media (prefers-color-scheme: dark) {
  .pagination-info {
    color: #9ca3af;
  }
  .pagination-highlight {
    color: #f9fafb;
  }
  .pagination-btn {
    border-color: #4b5563;
    background-color: #1f2937;
    color: #9ca3af;
  }
  .pagination-btn:hover:not(:disabled) {
    background-color: #374151;
  }
}

/* ============================================================================
   GLASSMORPHISM MODAL
   ============================================================================ */

.glass-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  -webkit-backdrop-filter: blur(5px);
  animation: glass-fade-in 0.2s ease-out;
}

@keyframes glass-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.glass-modal {
  width: 90%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--color-bg);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  animation: glass-slide-up 0.25s ease-out;
}

@keyframes glass-slide-up {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.glass-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.glass-modal-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.glass-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(239, 68, 68, 0.1);
  cursor: pointer;
  border-radius: 8px;
  color: #ef4444;
  text-decoration: none;
  transition:
    background 0.15s,
    color 0.15s;
}

.glass-modal-close:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #dc2626;
}

.glass-modal-body {
  padding: 16px 24px 0;
}

.glass-modal-label {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
  font-size: 12px;
  color: var(--color-text-muted, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.glass-modal-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  color: #111827;
  box-sizing: border-box;
  transition: border-color 0.15s;
}

.glass-modal-input:focus {
  outline: none;
  border-color: var(--color-accent, #3b82f6);
  background: rgba(255, 255, 255, 0.9);
}

/* Locked input - no focus effects (for disabled/readonly display values) */
.glass-modal-input-locked,
.glass-modal-input-locked:focus,
.glass-modal-input-locked:active {
  outline: none !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
  background: rgba(0, 0, 0, 0.03) !important;
  cursor: default;
  user-select: none;
}

html[data-theme="dark"] .glass-modal-input-locked,
html[data-theme="dark"] .glass-modal-input-locked:focus,
html[data-theme="dark"] .glass-modal-input-locked:active {
  border-color: rgba(255, 255, 255, 0.1) !important;
  background: rgba(255, 255, 255, 0.05) !important;
}

.glass-modal-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
}

.glass-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 20px 0 24px;
}

html[data-theme="dark"] .glass-modal {
  background: rgba(30, 41, 55, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .glass-modal-input {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: #f9fafb;
}

html[data-theme="dark"] .glass-modal-input:focus {
  background: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .glass-modal-close {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

html[data-theme="dark"] .glass-modal-close:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #fecaca;
}

/* Discount form modal classes */
.glass-modal-description {
  margin: 0 0 var(--space-4) 0;
  color: var(--color-text-muted);
  font-size: 14px;
}

.glass-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.glass-modal-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.glass-modal-hint {
  font-size: 11px;
  color: var(--color-text-muted);
}

.required-mark {
  color: #ef4444;
}

.glass-modal-checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-4);
  padding: var(--space-3);
  background: var(--color-bg);
  border-radius: var(--radius-md);
}

.glass-modal-checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  font-weight: 500;
  color: var(--color-text);
  font-size: 14px;
}

.glass-modal-checkbox-label input {
  width: 18px;
  height: 18px;
  accent-color: var(--color-success);
}

.glass-modal-errors {
  margin-top: var(--space-3);
}

.glass-modal-error {
  margin: 0 0 var(--space-2) 0;
  color: #ef4444;
  font-size: 13px;
  padding: 8px 12px;
  background: rgba(239, 68, 68, 0.1);
  border-radius: 6px;
}

/* Scrollbar Styling */
.table-container::-webkit-scrollbar {
  height: 6px;
}

.table-container::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}

.table-container::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.table-container::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

@media (prefers-color-scheme: dark) {
  .table-container::-webkit-scrollbar-track {
    background: #1e293b;
  }
  .table-container::-webkit-scrollbar-thumb {
    background: #475569;
  }
  .table-container::-webkit-scrollbar-thumb:hover {
    background: #64748b;
  }
}

/* ============================================================================
   MODEL COUNT BADGE
   ============================================================================ */

.aim-model-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 8px;
  border-radius: 9999px;
  background: var(--color-accent-contrast, rgba(59, 130, 246, 0.1));
  color: var(--color-accent, #3b82f6);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

html[data-theme="dark"] .aim-model-count-badge {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.3);
}

/* ============================================================================
   TABLE ROW ACTIONS (inline action buttons)
   ============================================================================ */

.table-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.table-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-md, 10px);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
}

.table-action:hover {
  background: var(--bg);
  border-color: var(--border);
}

/* Catalog actions cell */
.table-td-catalog-actions {
  font-size: 12px;
}

.table-td-catalog-actions-container {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.table-td-catalog-actions-container .action-btn-text {
  display: none;
}

.table-td-catalog-actions-container .action-btn {
  padding: 6px;
  min-width: 32px;
  width: 32px;
}

/* Professional Action Buttons */
.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 10px;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm, 6px);
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
  background: transparent;
  color: #475569;
  transition: all 0.2s ease;
  cursor: pointer;
  white-space: nowrap;
  min-width: 32px;
  height: 32px;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.action-btn svg {
  fill: currentColor !important;
  width: 16px;
  height: 16px;
}

.action-btn:hover {
  box-shadow: none;
}

.action-btn:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.action-btn-icon {
  font-size: 12px;
  line-height: 1;
}

.action-btn-text {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Edit Button */
.action-btn-edit {
  color: #3b82f6 !important;
  border: 1px solid #3b82f6 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.action-btn-edit:hover {
  color: #3b82f6 !important;
  border: 1px solid #3b82f6 !important;
  background: rgba(59, 130, 246, 0.08) !important;
  box-shadow: none !important;
}

/* View Button */
.action-btn-view {
  color: #6366f1 !important;
  border: 1px solid #6366f1 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.action-btn-view:hover {
  color: #6366f1 !important;
  border: 1px solid #6366f1 !important;
  background: rgba(99, 102, 241, 0.08) !important;
  box-shadow: none !important;
}

/* Delete Button */
.action-btn-delete {
  color: #ef4444 !important;
  border: 1px solid #ef4444 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.action-btn-delete:hover {
  color: #ef4444 !important;
  border: 1px solid #ef4444 !important;
  background: rgba(239, 68, 68, 0.08) !important;
  box-shadow: none !important;
}

/* Checkbox column — fixed narrow width, centered */
.aim-table thead th.th-checkbox {
  width: 44px;
  padding-right: 0;
  text-align: center;
}

.aim-table tbody td.td-checkbox {
  width: 44px;
  padding: 14px 0;
  text-align: center;
  vertical-align: middle;
  overflow: visible;
}

.aim-table tbody td.td-checkbox .checkbox-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Title cell — allow wrapping, no truncation */
.aim-table tbody td.aim-cell-title {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

/* Compact mode for smaller screens */
@media (max-width: 640px) {
  .action-btn-text {
    display: none;
  }

  .action-btn {
    padding: 6px 8px;
    min-width: 32px;
    width: 32px;
  }

  .table-td-catalog-actions-container {
    gap: 4px;
  }
}
