/**
 * ============================================================
 * OMSP Document Tracking / Monitoring
 * Components CSS - Buttons, cards, badges, forms, tables, modals, toasts
 * ============================================================
 * Reusable UI components used across all pages.
 * ============================================================
 */

/* ============================================================
   LOADING SPINNER
   ============================================================ */
.loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: var(--space-8) 0;
}
.loading-spinner::after {
  content: '';
  width: 36px;
  height: 36px;
  border: 3px solid var(--neutral-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0 var(--space-4);
  height: 40px;
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  line-height: 1;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
  position: relative;
  overflow: hidden;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.btn:disabled, .btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Primary */
.btn-primary,
a.btn-primary {
  background: var(--primary-700);
  color: #fff;
  box-shadow: var(--shadow-xs);
}
.btn-primary:hover,
a.btn-primary:hover {
  background: var(--primary-800);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

/* Secondary / Outline */
.btn-secondary,
.btn-outline {
  background: #fff;
  color: var(--primary-700);
  border-color: var(--primary-300);
}
.btn-secondary:hover,
.btn-outline:hover {
  background: var(--primary-50);
  border-color: var(--primary-500);
  color: var(--primary-700);
}

/* Success */
.btn-success,
a.btn-success {
  background: var(--success-600);
  color: #fff;
}
.btn-success:hover,
a.btn-success:hover {
  background: var(--success-700);
  color: #fff;
}

/* Warning */
.btn-warning {
  background: var(--accent-100);
  color: var(--accent-700);
  border-color: var(--accent-200);
}
.btn-warning:hover {
  background: var(--accent-200);
  color: var(--accent-700);
}

/* Info */
.btn-info {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #bae6fd;
}
.btn-info:hover {
  background: #0284c7;
  color: #fff;
  border-color: #0284c7;
}

/* Danger */
.btn-danger {
  background: var(--danger-50);
  color: var(--danger-700);
  border-color: var(--danger-200);
}
.btn-danger:hover {
  background: var(--danger-600);
  color: #fff;
  border-color: var(--danger-600);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--neutral-600);
}
.btn-ghost:hover {
  background: var(--neutral-100);
  color: var(--neutral-800);
}
.btn-ghost svg {
  width: 16px;
  height: 16px;
}

/* Danger Ghost (for delete buttons) */
.btn-danger-ghost {
  background: transparent;
  color: var(--danger-600);
}
.btn-danger-ghost:hover {
  background: var(--danger-50);
  color: var(--danger-700);
}

/* Icon button */
.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--neutral-500);
}
.btn-icon:hover {
  background: var(--neutral-100);
  color: var(--neutral-700);
}

/* Sizes */
.btn-sm { height: 32px; padding: 0 var(--space-3); font-size: var(--text-sm); }
.btn-lg { height: 48px; padding: 0 var(--space-6); font-size: var(--text-lg); }
.btn-xl { height: 52px; padding: 0 var(--space-8); font-size: var(--text-lg); }

/* Active state (filter toggle buttons) */
.btn.active,
.btn-secondary.active,
.btn-outline.active {
  background: var(--primary-600);
  color: #fff;
  border-color: var(--primary-600);
  box-shadow: 0 0 0 2px var(--primary-100);
}
.btn-ghost.active {
  background: var(--primary-50);
  color: var(--primary-700);
  box-shadow: inset 0 0 0 1px var(--primary-300);
}

/* Block / Full width */
.btn-block { width: 100%; }

/* Button with spinner */
.btn .spinner { display: none; }
.btn.loading .btn-text { display: none; }
.btn.loading .spinner { display: inline-block; }
.btn.loading { pointer-events: none; opacity: 0.7; }

/* Button group */
.btn-group {
  display: flex;
  gap: var(--space-2);
}
.btn-group .btn { flex-shrink: 0; }


/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: #fff;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  padding: var(--space-6);
  transition: all var(--transition-base);
  overflow: hidden;
  max-width: 100%;
}
.card:hover {
  box-shadow: var(--shadow-md);
}

.card-clickable {
  cursor: pointer;
}
.card-clickable:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}
.card-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--neutral-800);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.card-body {
  padding: 0;
}
.card-footer {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--neutral-200);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
}

/* Stat Card */
.stat-card {
  background: #fff;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}
.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}
.stat-card-primary::before,
.stat-card-blue::before { background: var(--primary-500); }
.stat-card-teal::before { background: var(--secondary-500); }
.stat-card-amber::before { background: var(--accent-500); }
.stat-card-red::before { background: var(--danger-500); }
.stat-card-green::before { background: var(--success-500); }
.stat-card-warning::before { background: var(--accent-500); }
.stat-card-danger::before { background: var(--danger-500); }
.stat-card-success::before { background: var(--success-500); }
.stat-card-info::before { background: var(--primary-400); }
.stat-card-muted::before { background: var(--neutral-400); }

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: var(--space-3);
}
.stat-icon-blue { background: var(--primary-50); color: var(--primary-600); }
.stat-icon-teal { background: var(--secondary-50); color: var(--secondary-600); }
.stat-icon-amber { background: var(--accent-50); color: var(--accent-600); }
.stat-icon-red { background: var(--danger-50); color: var(--danger-600); }
.stat-icon-green { background: var(--success-50); color: var(--success-600); }

.stat-label {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--neutral-500);
  margin-bottom: var(--space-1);
}
.stat-value {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--neutral-800);
  margin-bottom: var(--space-1);
  overflow: hidden;
  min-height: 1.3em;
}

.odometer-value {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  gap: 0;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  vertical-align: baseline;
}

.odometer-digit {
  position: relative;
  display: inline-block;
  width: 0.62em;
  height: 1em;
  overflow: hidden;
  vertical-align: top;
}

.odometer-track {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  transition: transform 0.55s cubic-bezier(0.2, 0.9, 0.2, 1);
  will-change: transform;
}

.odometer-track span {
  display: block;
  height: 1em;
  line-height: 1;
  text-align: center;
}

.odometer-separator,
.odometer-affix {
  display: inline-block;
  vertical-align: top;
  line-height: 1;
  height: 1em;
}
.stat-subtext {
  font-size: var(--text-sm);
  color: var(--neutral-500);
}
.stat-actions {
  margin-top: var(--space-3);
  display: flex;
  gap: var(--space-2);
}


/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px 10px;
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  border-radius: var(--radius-full);
  line-height: 1.5;
  white-space: nowrap;
}

.badge-primary { background: var(--primary-100); color: var(--primary-800); }
.badge-success { background: var(--success-100); color: var(--success-700); }
.badge-warning { background: var(--accent-100); color: var(--accent-700); }
.badge-danger { background: var(--danger-100); color: var(--danger-700); }
.badge-info { background: var(--primary-50); color: var(--primary-600); }
.badge-neutral { background: var(--neutral-100); color: var(--neutral-600); }
.badge-teal { background: var(--secondary-100); color: var(--secondary-700); }

/* Frequency badges */
.badge-freq-normal { background: var(--success-100); color: var(--success-700); }
.badge-freq-monitor { background: var(--accent-100); color: var(--accent-700); }
.badge-freq-high { background: var(--danger-100); color: var(--danger-700); }

/* Flagged row (cross-BM indicator) */
.row-flagged {
  background-color: #FFFBEB !important;
  border-left: 3px solid var(--accent-500);
}
.row-flagged:hover { background-color: #FEF3C7 !important; }

/* Status badges */
.badge-ongoing { background: var(--primary-100); color: var(--primary-700); }
.badge-successful { background: var(--success-100); color: var(--success-700); }
.badge-denied { background: var(--danger-100); color: var(--danger-700); }
.badge-archived { background: var(--neutral-100); color: var(--neutral-600); }
.badge-pending { background: var(--accent-100); color: var(--accent-700); }

/* Status badge aliases (for JS badge-status-* pattern) */
.badge-status-ongoing { background: var(--primary-100); color: var(--primary-700); }
.badge-status-successful { background: var(--success-100); color: var(--success-700); }
.badge-status-denied { background: var(--danger-100); color: var(--danger-700); }
.badge-status-archived { background: var(--neutral-100); color: var(--neutral-600); }
.badge-status-pending { background: var(--accent-100); color: var(--accent-700); }
.badge-status-neutral { background: var(--neutral-100); color: var(--neutral-600); }

/* Role badges */
.badge-sysadmin { background: #F3E8FF; color: #6B21A8; }
.badge-bm { background: var(--primary-100); color: var(--primary-800); }
.badge-staff { background: var(--secondary-100); color: var(--secondary-700); }

/* Category badges */
.badge-permanent { background: var(--neutral-100); color: var(--neutral-600); }
.badge-custom { background: var(--primary-50); color: var(--primary-600); }

/* Dot indicator */
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.dot-success { background: var(--success-500); }
.dot-warning { background: var(--accent-500); }
.dot-danger { background: var(--danger-500); }
.dot-info { background: var(--primary-500); }


/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--neutral-200);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: var(--space-2);
}
.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}
.progress-fill-green { background: var(--success-500); }
.progress-fill-yellow { background: var(--accent-500); }
.progress-fill-red { background: var(--danger-500); }
.progress-fill-blue { background: var(--primary-500); }

/* Progress color aliases */
.progress-primary { background: var(--primary-500); }
.progress-warning { background: var(--accent-500); }
.progress-danger { background: var(--danger-500); }

/* Progress size modifier */
.progress-sm { height: 4px; }


/* ============================================================
   FORMS
   ============================================================ */
.form-group {
  margin-bottom: var(--space-4);
}
.form-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--neutral-600);
  margin-bottom: var(--space-1);
}
.form-label .required {
  color: var(--danger-500);
  margin-left: 2px;
}

/* Label row: label + inline toggle on same line */
.form-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-1);
}
.form-label-row .form-label {
  margin-bottom: 0;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  height: 44px;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-base);
  font-family: inherit;
  color: var(--neutral-800);
  background-color: #fff;
  border: 1.5px solid var(--neutral-300);
  border-radius: var(--radius-lg, 8px);
  transition: all var(--transition-fast);
}
.form-input:hover,
.form-select:hover,
.form-textarea:hover {
  border-color: var(--primary-300, #93c5fd);
  background-color: var(--neutral-50, #f9fafb);
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary-500);
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12), 0 1px 2px rgba(0, 0, 0, 0.05);
}
.form-input::placeholder {
  color: var(--neutral-400);
}

/* ── Password Toggle ── */
.password-wrapper {
  position: relative;
}
.password-wrapper .form-input {
  padding-right: 44px;
}
.toggle-password {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  color: var(--neutral-400);
  cursor: pointer;
  background: transparent;
  border: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.toggle-password:hover {
  background: var(--neutral-100);
  color: var(--neutral-600);
}

.form-textarea {
  height: auto;
  min-height: 100px;
  max-width: 100%;
  padding: var(--space-3);
  resize: vertical;
}

/* ── Custom Select Dropdown ── */
.form-select,
select.form-input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 18px;
  padding-right: 38px;
  cursor: pointer;
}
.form-select:hover,
select.form-input:hover {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%233b82f6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 18px;
}
.form-select:focus,
select.form-input:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 18px;
}
.form-select option,
select.form-input option {
  padding: 8px 12px;
  font-size: var(--text-sm);
  color: var(--neutral-800);
  background: #fff;
}
.form-select option:checked,
select.form-input option:checked {
  background: var(--primary-50, #eff6ff);
  color: var(--primary-700);
}

/* ── Custom Date Input ── */
input[type="date"].form-input,
input[type="date"].form-input-sm {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  cursor: pointer;
  color: var(--neutral-800);
}
/* Style the calendar icon */
input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  border-radius: var(--radius, 6px);
  padding: 4px;
  margin-left: 4px;
  opacity: 0.6;
  transition: all 0.15s ease;
  filter: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px;
  width: 28px;
  height: 28px;
}
input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
  background-color: var(--primary-50, #eff6ff);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
}
/* Empty date placeholder styling */
input[type="date"]:invalid,
input[type="date"][value=""] {
  color: var(--neutral-400);
}

/* Combo-box text inputs — add a consistent chevron icon.
   Uses full background shorthand + high specificity to avoid the
   .form-input:hover / :focus shorthand resetting background-repeat. */
input.form-input.combo-input {
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 12px center / 14px;
  padding-right: 36px;
  cursor: pointer;
}
input.form-input.combo-input:hover {
  background: var(--neutral-50, #f9fafb) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 12px center / 14px;
}
input.form-input.combo-input:focus {
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 12px center / 14px;
}
/* When combo input is readonly (e.g. admin view), remove chevron */
input.form-input.combo-input[readonly],
input.form-input.combo-input:disabled {
  background: var(--neutral-100, #f3f4f6) none;
  padding-right: var(--space-3);
  cursor: default;
  opacity: 0.7;
}
/* Combo dropdown option keyboard-highlight */
.combo-dropdown .combo-option.active {
  background: var(--primary-50, #eff6ff);
}

/* Combo dropdown inside modals — boost z-index above modal body */
.modal .combo-dropdown,
.modal-body .combo-dropdown {
  z-index: 200;
}

/* Combo option touch-friendly sizing */
.combo-dropdown .combo-option {
  min-height: 40px;
  display: flex;
  align-items: center;
}

/* Error state */
.form-group.has-error .form-input,
.form-group.has-error .form-select,
.form-group.has-error .form-textarea,
.form-input.error,
.form-select.error,
textarea.form-input.error {
  border-color: var(--danger-500);
  background-color: var(--danger-50);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
}
/* Error state — custom select, datepicker, timepicker triggers */
.form-group.has-error .cs-select-trigger,
.cs-select.has-error .cs-select-trigger {
  border-color: var(--danger-500);
  background-color: var(--danger-50);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
}
.form-group.has-error .cs-date-trigger,
.cs-datepicker.has-error .cs-date-trigger {
  border-color: var(--danger-500);
  background-color: var(--danger-50);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
}
.form-group.has-error .cs-time-trigger,
.cs-timepicker.has-error .cs-time-trigger {
  border-color: var(--danger-500);
  background-color: var(--danger-50);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
}
.form-group.has-error .form-label {
  color: var(--danger-600);
}
.form-error {
  font-size: var(--text-xs);
  color: var(--danger-600);
  margin-top: var(--space-1);
  display: none;
}
.form-group.has-error .form-error { display: block; }

/* Help text */
.form-help {
  font-size: var(--text-xs);
  color: var(--neutral-500);
  margin-top: var(--space-1);
}

/* Checkbox & Radio */
.form-check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  font-size: var(--text-base);
  color: var(--neutral-700);
}
.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-600);
  cursor: pointer;
}

/* Input group (input with icon or button) */
.input-group {
  position: relative;
}
.input-group .form-input {
  padding-left: 40px;
}
.input-group-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--neutral-400);
  pointer-events: none;
  display: flex;
  align-items: center;
}
.input-group-right {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
}

/* Form row (inline fields) */
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
}

/* Form section */
.form-section {
  margin-bottom: var(--space-6);
}
.form-section-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--neutral-800);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--neutral-200);
}


/* ============================================================
   TABLES
   ============================================================ */
.table-container {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  background: #fff;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-base);
}
.data-table th {
  background: var(--neutral-50);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--neutral-500);
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--neutral-200);
  white-space: nowrap;
  user-select: none;
}
.data-table th.sortable {
  cursor: pointer;
}
.data-table th.sortable:hover {
  color: var(--neutral-700);
  background: var(--neutral-100);
}
.data-table th .sort-arrow {
  margin-left: var(--space-1);
  opacity: 0.3;
}
.data-table th.sorted .sort-arrow {
  opacity: 1;
  color: var(--primary-500);
}

.data-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--neutral-100);
  color: var(--neutral-700);
  vertical-align: middle;
}
.data-table tbody tr:hover {
  background: var(--neutral-50);
}
.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* Table actions cell */
.table-actions {
  display: flex;
  gap: var(--space-1);
  align-items: center;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--neutral-200);
  background: var(--neutral-50);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  font-size: var(--text-sm);
  color: var(--neutral-500);
}
.pagination-info {
  margin-right: auto;
  font-size: var(--text-xs);
  color: var(--neutral-400);
}
.pagination-buttons {
  display: flex;
  gap: 6px;
  align-items: center;
}
.pagination-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--neutral-200);
  background: #fff;
  color: var(--neutral-600);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.pagination-btn:hover:not(:disabled) {
  background: var(--primary-50, #eff6ff);
  border-color: var(--primary-300, #93c5fd);
  color: var(--primary-700);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.pagination-btn.active {
  background: var(--primary-700);
  color: #fff;
  border-color: var(--primary-700);
  box-shadow: 0 2px 6px rgba(var(--primary-700-rgb, 29, 78, 216), 0.25);
  pointer-events: none;
}
.pagination-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none;
}
.pagination-btn svg {
  width: 16px;
  height: 16px;
}

.pagination-ellipsis {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 36px;
  color: var(--neutral-400);
  font-size: var(--text-sm);
  letter-spacing: 2px;
}


/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: #fff;
  border-radius: var(--radius-xl, 16px);
  box-shadow: 0 25px 50px -12px rgba(0,0,0,.25), 0 0 0 1px rgba(0,0,0,.05);
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition-bounce);
}
.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-sm { max-width: 400px; }
.modal-lg { max-width: 640px; }
.modal-xl { max-width: 800px; }
.modal-edit { max-width: 720px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--neutral-200);
  background: linear-gradient(135deg, var(--neutral-50), var(--primary-50, #eff6ff));
  border-radius: var(--radius-xl, 16px) var(--radius-xl, 16px) 0 0;
  flex-shrink: 0;
}
.modal-title {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: var(--neutral-800);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  color: var(--neutral-400);
  cursor: pointer;
  transition: all var(--transition-fast);
  background: transparent;
  border: none;
  font-size: 1.25rem;
}
.modal-close:hover {
  background: var(--neutral-200);
  color: var(--neutral-700);
}

.modal-body {
  padding: var(--space-6);
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

/* ── Detail grid inside modal ── */
.modal-body .detail-grid {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--neutral-100);
}
.modal-body .detail-section {
  background: linear-gradient(135deg, var(--neutral-50), var(--neutral-100));
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary-700, var(--neutral-500));
  border-bottom: 1px solid var(--neutral-200);
}
.modal-body .detail-item {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--neutral-100);
  transition: background 0.1s ease;
}
.modal-body .detail-item:hover {
  background: var(--neutral-50);
}
.modal-body .detail-amount {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--primary-700);
  letter-spacing: -0.02em;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--neutral-200);
  background: var(--neutral-50);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  flex-shrink: 0;
}


/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  min-width: 320px;
  max-width: 420px;
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid;
  pointer-events: auto;
  animation: toastSlideIn var(--transition-bounce) forwards;
}
.toast.removing {
  animation: toastSlideOut var(--transition-base) forwards;
}

.toast-success { border-left-color: var(--success-500); }
.toast-error { border-left-color: var(--danger-500); }
.toast-warning { border-left-color: var(--accent-500); }
.toast-info { border-left-color: var(--primary-500); }

.toast-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}
.toast-content { flex: 1; }
.toast-title {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--neutral-800);
  margin-bottom: 2px;
}
.toast-message {
  font-size: var(--text-sm);
  color: var(--neutral-500);
}
.toast-close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--neutral-400);
  cursor: pointer;
  background: transparent;
  border: none;
  font-size: 1rem;
  transition: all var(--transition-fast);
}
.toast-close:hover {
  background: var(--neutral-100);
  color: var(--neutral-600);
}


/* ============================================================
   BANNERS (Term warnings, announcements)
   ============================================================ */
.banner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
  font-size: var(--text-base);
  border: 1px solid;
}

.banner-info {
  background: var(--primary-50);
  border-color: var(--primary-200);
  color: var(--primary-800);
}
.banner-warning {
  background: var(--accent-50);
  border-color: var(--accent-200);
  color: var(--accent-800, #92400E);
}
.banner-critical {
  background: #FFF7ED;
  border-color: #FED7AA;
  color: #9A3412;
}
.banner-danger {
  background: var(--danger-50);
  border-color: var(--danger-200);
  color: var(--danger-700);
}
.banner-success {
  background: var(--success-50);
  border-color: var(--success-100);
  color: var(--success-700);
}

.banner-icon {
  flex-shrink: 0;
  font-size: 1.25rem;
}
.banner-content { flex: 1; }
.banner-title {
  font-weight: var(--font-semibold);
}
.banner-message {
  font-size: var(--text-sm);
  opacity: 0.8;
}
.banner-action {
  flex-shrink: 0;
}
.banner-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  cursor: pointer;
  background: transparent;
  border: none;
  font-size: 1.125rem;
  opacity: 0.6;
  transition: opacity var(--transition-fast);
}
.banner-close:hover { opacity: 1; }


/* ============================================================
   TABS
   ============================================================ */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--neutral-200);
  margin-bottom: var(--space-6);
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
}
.tab {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  color: var(--neutral-500);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  background: transparent;
  border-top: none;
  border-left: none;
  border-right: none;
}
.tab:hover {
  color: var(--primary-600);
}
.tab.active {
  color: var(--primary-700);
  border-bottom-color: var(--primary-700);
  font-weight: var(--font-semibold);
}
.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  background: var(--neutral-100);
  color: var(--neutral-600);
  border-radius: var(--radius-full);
  margin-left: var(--space-2);
}
.tab.active .tab-count {
  background: var(--primary-100);
  color: var(--primary-700);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }


/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-6);
  text-align: center;
}
.empty-state-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  background: var(--neutral-100);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
  color: var(--neutral-400);
}
.empty-state-icon svg {
  width: 32px;
  height: 32px;
}
.empty-state-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--neutral-700);
  margin-bottom: var(--space-2);
}
.empty-state-desc {
  font-size: var(--text-base);
  color: var(--neutral-500);
  max-width: 360px;
  margin-bottom: var(--space-6);
}
.empty-state-text {
  font-size: var(--text-base);
  color: var(--neutral-500);
  max-width: 360px;
  margin-bottom: var(--space-6);
}


/* ============================================================
   SPINNER / LOADER
   ============================================================ */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
.spinner-lg {
  width: 36px;
  height: 36px;
  border-width: 3px;
}

.page-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-16);
  gap: var(--space-4);
}
.page-loader-text {
  font-size: var(--text-base);
  color: var(--neutral-500);
}


/* ============================================================
   AVATAR
   ============================================================ */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--primary-100);
  color: var(--primary-700);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  flex-shrink: 0;
}
.avatar-sm { width: 32px; height: 32px; font-size: var(--text-sm); }
.avatar-lg { width: 48px; height: 48px; font-size: var(--text-lg); }
.avatar-xl { width: 64px; height: 64px; font-size: var(--text-2xl); }


/* ============================================================
   SECTION HEADER
   ============================================================ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}
.section-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--neutral-800);
}
.section-link {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--primary-600);
}
.section-link:hover { color: var(--primary-800); text-decoration: underline; }


/* ============================================================
   QUICK ACTION CARDS
   ============================================================ */
.quick-action-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: #fff;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  color: inherit;
}
.quick-action-card:hover {
  border-color: var(--primary-300);
  background: var(--primary-50);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.quick-action-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: var(--neutral-100);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}
.quick-action-card:hover .quick-action-icon {
  background: var(--primary-100);
}
.quick-action-title {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--neutral-800);
}
.quick-action-desc {
  font-size: var(--text-sm);
  color: var(--neutral-500);
  margin-top: 2px;
}


/* ============================================================
   ACTIVITY LIST
   ============================================================ */
.activity-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--neutral-100);
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  flex-shrink: 0;
}
.activity-icon-fa { background: var(--primary-50); }
.activity-icon-pa { background: var(--secondary-50); }
.activity-icon-system { background: var(--neutral-100); }
.activity-content { flex: 1; min-width: 0; }
.activity-title {
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  color: var(--neutral-800);
}
.activity-desc {
  font-size: var(--text-sm);
  color: var(--neutral-500);
  margin-top: 2px;
}
.activity-meta {
  font-size: var(--text-xs);
  color: var(--neutral-400);
  margin-top: 2px;
}
.activity-user-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  vertical-align: middle;
}
.activity-user-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-100);
  color: var(--primary-700);
  font-size: 0.55rem;
  font-weight: 700;
  flex-shrink: 0;
  text-transform: uppercase;
  vertical-align: middle;
}


/* ============================================================
   MULTI-STEP WIZARD
   ============================================================ */
.wizard-steps {
  display: flex;
  align-items: center;
  margin-bottom: var(--space-8);
  padding: 0 var(--space-2);
}
.wizard-step {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1;
  position: relative;
}
.wizard-step:not(:last-child)::after {
  content: '';
  flex: 1;
  height: 2px;
  background: var(--neutral-200);
  margin: 0 var(--space-3);
}
.wizard-step.completed:not(:last-child)::after {
  background: var(--primary-500);
}
.wizard-step-number {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  border: 2px solid var(--neutral-300);
  color: var(--neutral-400);
  background: #fff;
  flex-shrink: 0;
  transition: all var(--transition-base);
}
.wizard-step.active .wizard-step-number {
  border-color: var(--primary-500);
  background: var(--primary-500);
  color: #fff;
}
.wizard-step.completed .wizard-step-number {
  border-color: var(--primary-500);
  background: var(--primary-500);
  color: #fff;
}
.wizard-step-label {
  font-size: var(--text-sm);
  color: var(--neutral-400);
  font-weight: var(--font-medium);
  white-space: nowrap;
}
.wizard-step.active .wizard-step-label { color: var(--primary-700); }
.wizard-step.completed .wizard-step-label { color: var(--neutral-700); }

.wizard-panel { display: none; }
.wizard-panel.active { display: block; }

.wizard-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--neutral-200);
}


/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--neutral-50, #f9fafb);
  border: 1.5px solid var(--neutral-200);
  border-radius: var(--radius-lg, 8px);
  margin-bottom: var(--space-4);
}
.filter-bar .form-input,
.filter-bar .form-select {
  height: 38px;
  font-size: var(--text-sm);
  min-width: 160px;
  flex: 1;
  background-color: #fff;
}
/* Match button height to filter-bar inputs */
.filter-bar .btn,
.filter-bar .btn-sm {
  height: 38px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

/* Mobile filter-bar: stack vertically */
@media (max-width: 768px) {
  .filter-bar {
    flex-direction: column;
    gap: var(--space-2);
  }
  .filter-bar .form-input,
  .filter-bar .form-select {
    min-width: 100%;
    flex: none;
  }
  .filter-bar .filter-group {
    width: 100%;
  }
  .filter-bar .btn,
  .filter-bar .btn-sm {
    width: 100%;
    justify-content: center;
  }

  /* Combo dropdown on tablet — comfortable touch targets */
  .combo-dropdown .combo-option {
    min-height: 42px;
    padding: 0.5rem 0.75rem;
  }
  .modal-body .form-group {
    position: relative;
  }
}

/* ============================================================
   DETAIL VIEW (Key-Value pairs)
   ============================================================ */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
}
.detail-item {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--neutral-100);
  margin-bottom: 0;
}
.detail-item:nth-child(odd) {
  border-right: 1px solid var(--neutral-100);
}
.detail-label {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--neutral-400);
  margin-bottom: 4px;
  display: block;
}
.detail-value {
  font-size: var(--text-base);
  color: var(--neutral-800);
  font-weight: var(--font-medium);
  display: block;
  word-break: break-word;
}

/* Full-width detail item */
.detail-item-full {
  grid-column: 1 / -1;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--neutral-100);
  border-right: none !important;
}
.detail-item-full .detail-label {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--neutral-400);
  margin-bottom: 4px;
  display: block;
}
.detail-item-full .detail-value {
  font-size: var(--text-base);
  color: var(--neutral-800);
  font-weight: var(--font-medium);
  display: block;
  word-break: break-word;
}

/* Detail section header */
.detail-section {
  grid-column: 1 / -1;
  padding: var(--space-2) var(--space-4);
  background: var(--neutral-50);
  border-bottom: 1px solid var(--neutral-200);
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--neutral-500);
}

/* Record ID header in modal */
.modal-record-id {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 2px var(--space-3);
  background: var(--neutral-100);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--neutral-500);
  font-family: monospace;
}

/* Amount highlight */
.detail-amount {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--primary-700);
}

/* Status in detail */
.detail-status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

@media (max-width: 480px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .detail-item:nth-child(odd) {
    border-right: none;
  }
}


/* ============================================================
   NOTIFICATION BADGE (on icons)
   ============================================================ */
.notif-wrapper {
  position: relative;
  display: inline-flex;
}
.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: var(--font-bold);
  background: var(--danger-500);
  color: #fff;
  border-radius: var(--radius-full);
  border: 2px solid #fff;
}


/* ============================================================
   DROPDOWN
   ============================================================ */
.dropdown {
  position: relative;
  display: inline-block;
}
.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 180px;
  background: #fff;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition-fast);
  padding: var(--space-1);
}
.dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--neutral-700);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition-fast);
  white-space: nowrap;
}
.dropdown-item:hover { background: var(--neutral-100); }
.dropdown-divider {
  height: 1px;
  background: var(--neutral-200);
  margin: var(--space-1) 0;
}

/* ============================================================
   BADGE ACCENT
   ============================================================ */
.badge-accent {
  background: var(--accent-100, #fef3c7);
  color: var(--accent-700, #92400e);
}

/* ============================================================
   TIMELINE
   ============================================================ */
.timeline-item {
  display: flex;
  gap: var(--space-3);
  padding-bottom: var(--space-3);
  position: relative;
}
.timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 18px;
  bottom: 0;
  width: 2px;
  background: var(--neutral-200);
}
.timeline-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 3px;
}
.dot-primary { background: var(--primary-500); }
.dot-teal    { background: var(--secondary-500); }
.timeline-content {
  flex: 1;
  min-width: 0;
}

/* ============================================================
   FORM INPUT SM (standalone)
   ============================================================ */
.form-input-sm {
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-sm);
  min-width: 140px;
  border-radius: var(--radius-lg, 8px);
  border-width: 1.5px;
}


/* ============================================================
   CUSTOM SELECT DROPDOWN
   ============================================================ */
.cs-select {
  position: relative;
  width: 100%;
}

.cs-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  width: 100%;
  height: 44px;
  padding: 0 var(--space-3);
  font-size: var(--text-base);
  color: var(--neutral-800);
  background: #fff;
  border: 1.5px solid var(--neutral-300);
  border-radius: var(--radius-lg, 8px);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
  outline: none;
}
.cs-select-trigger:hover {
  border-color: var(--primary-300, #93c5fd);
  background: var(--neutral-50, #f9fafb);
}
.cs-select.open .cs-select-trigger,
.cs-select-trigger:focus {
  border-color: var(--primary-500);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12), 0 1px 2px rgba(0, 0, 0, 0.05);
}

.cs-select-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cs-select-value.cs-placeholder {
  color: var(--neutral-400);
}

.cs-select-arrow {
  display: flex;
  align-items: center;
  color: var(--neutral-400);
  transition: transform 0.2s ease, color 0.15s ease;
  flex-shrink: 0;
}
.cs-select.open .cs-select-arrow {
  transform: rotate(180deg);
  color: var(--primary-500);
}
.cs-select-trigger:hover .cs-select-arrow {
  color: var(--primary-400);
}

/* Dropdown panel */
.cs-select-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow-y: auto;
  background: #fff;
  border: 1.5px solid var(--neutral-200);
  border-radius: var(--radius-lg, 8px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px) scale(0.98);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  padding: 4px;
}
.cs-select.open .cs-select-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.cs-select-option {
  padding: 8px 12px;
  font-size: var(--text-sm);
  color: var(--neutral-700);
  border-radius: var(--radius, 6px);
  cursor: pointer;
  transition: background 0.1s ease, color 0.1s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cs-select-option:hover {
  background: var(--primary-50, #eff6ff);
  color: var(--primary-700);
}
.cs-select-option.active {
  background: var(--primary-100, #dbeafe);
  color: var(--primary-700);
  font-weight: var(--font-semibold, 600);
}
.cs-select-option.active::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--primary-500);
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}
.cs-select-option.cs-select-placeholder {
  color: var(--neutral-400);
  font-style: italic;
}
.cs-select-option.cs-select-placeholder-last {
  border-bottom: 1px solid var(--neutral-200);
  margin-bottom: 4px;
  padding-bottom: 10px;
}

/* Small variant */
.cs-select-sm .cs-select-trigger {
  height: 38px;
  font-size: var(--text-sm);
  padding: 0 var(--space-2);
}
.cs-select-sm .cs-select-dropdown {
  max-height: 200px;
}
.cs-select-sm .cs-select-option {
  padding: 6px 10px;
  font-size: var(--text-xs);
}

/* Filter bar integration */
.filter-bar .cs-select {
  flex: 1;
  min-width: 160px;
}


/* ============================================================
   CUSTOM DATE PICKER
   ============================================================ */
.cs-datepicker {
  position: relative;
  width: 100%;
}

.cs-date-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  width: 100%;
  height: 44px;
  padding: 0 var(--space-3);
  font-size: var(--text-base);
  color: var(--neutral-800);
  background: #fff;
  border: 1.5px solid var(--neutral-300);
  border-radius: var(--radius-lg, 8px);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
  outline: none;
}
.cs-date-trigger:hover {
  border-color: var(--primary-300, #93c5fd);
  background: var(--neutral-50, #f9fafb);
}
.cs-datepicker.open .cs-date-trigger,
.cs-date-trigger:focus {
  border-color: var(--primary-500);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12), 0 1px 2px rgba(0, 0, 0, 0.05);
}

.cs-date-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cs-date-value.cs-placeholder {
  color: var(--neutral-400);
}

.cs-date-icon {
  display: flex;
  align-items: center;
  color: var(--neutral-400);
  transition: color 0.15s ease;
  flex-shrink: 0;
}
.cs-date-trigger:hover .cs-date-icon,
.cs-datepicker.open .cs-date-icon {
  color: var(--primary-500);
}

/* Small variant */
.cs-datepicker-sm .cs-date-trigger {
  height: 38px;
  font-size: var(--text-sm);
  padding: 0 var(--space-2);
}

/* Filter bar integration */
.filter-bar .cs-datepicker {
  flex: 1;
  min-width: 160px;
}

/* Calendar popup */
.cs-calendar {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 280px;
  background: #fff;
  border: 1.5px solid var(--neutral-200);
  border-radius: var(--radius-lg, 8px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14), 0 4px 12px rgba(0, 0, 0, 0.08);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px) scale(0.98);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  padding: 12px;
  user-select: none;
}
.cs-datepicker.open .cs-calendar {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Calendar header */
.cs-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.cs-cal-title {
  font-weight: var(--font-semibold, 600);
  font-size: var(--text-sm);
  color: var(--neutral-800);
  display: flex;
  gap: 4px;
}
.cs-cal-title-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-weight: var(--font-semibold, 600);
  font-size: var(--text-sm);
  color: var(--neutral-800);
  background: transparent;
  border: 1.5px solid transparent;
  border-radius: var(--radius, 6px);
  cursor: pointer;
  transition: all 0.15s ease;
}
.cs-cal-title-btn:hover {
  background: var(--primary-50, #eff6ff);
  border-color: var(--primary-200, #bfdbfe);
  color: var(--primary-700);
}
.cs-cal-title-arrow {
  opacity: 0.5;
  transition: opacity 0.15s;
}
.cs-cal-title-btn:hover .cs-cal-title-arrow {
  opacity: 1;
}
.cs-cal-month {
  color: var(--primary-700);
}
.cs-cal-nav {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--neutral-500);
  border-radius: var(--radius, 6px);
  cursor: pointer;
  transition: all 0.15s ease;
}
.cs-cal-nav:hover {
  background: var(--primary-50, #eff6ff);
  color: var(--primary-600);
}

/* Weekday labels */
.cs-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  margin-bottom: 4px;
}
.cs-cal-weekdays span {
  font-size: 11px;
  font-weight: var(--font-semibold, 600);
  color: var(--neutral-400);
  padding: 4px 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Day grid */
.cs-cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.cs-cal-day {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  font-size: var(--text-sm, 14px);
  color: var(--neutral-700);
  border-radius: var(--radius, 6px);
  cursor: pointer;
  transition: all 0.1s ease;
  position: relative;
}
.cs-cal-day:hover:not(.outside) {
  background: var(--primary-50, #eff6ff);
  color: var(--primary-700);
}
.cs-cal-day.outside {
  color: var(--neutral-300);
  cursor: default;
}
.cs-cal-day.today {
  font-weight: var(--font-bold, 700);
  color: var(--primary-600);
  background: var(--primary-50, #eff6ff);
}
.cs-cal-day.today::after {
  content: '';
  position: absolute;
  bottom: 2px;
  width: 4px;
  height: 4px;
  background: var(--primary-500);
  border-radius: 50%;
}
.cs-cal-day.selected {
  background: var(--primary-600) !important;
  color: #fff !important;
  font-weight: var(--font-semibold, 600);
}
.cs-cal-day.selected::after {
  display: none;
}
.cs-cal-day.disabled {
  color: var(--neutral-300);
  cursor: not-allowed;
  pointer-events: none;
  opacity: 0.45;
}

/* Month & Year grid */
.cs-cal-grid {
  display: grid;
  gap: 4px;
}
.cs-cal-months {
  grid-template-columns: repeat(3, 1fr);
}
.cs-cal-years {
  grid-template-columns: repeat(3, 1fr);
}
.cs-cal-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 6px;
  font-size: var(--text-sm, 14px);
  color: var(--neutral-700);
  border-radius: var(--radius, 6px);
  cursor: pointer;
  transition: all 0.12s ease;
  font-weight: var(--font-medium, 500);
}
.cs-cal-cell:hover {
  background: var(--primary-50, #eff6ff);
  color: var(--primary-700);
}
.cs-cal-cell.today {
  font-weight: var(--font-bold, 700);
  color: var(--primary-600);
  background: var(--primary-50, #eff6ff);
}
.cs-cal-cell.selected {
  background: var(--primary-600) !important;
  color: #fff !important;
  font-weight: var(--font-semibold, 600);
}

/* Back button in month/year pickers */
.cs-cal-back-btn {
  padding: 4px 12px;
  font-size: var(--text-xs);
  font-weight: var(--font-medium, 500);
  border: none;
  border-radius: var(--radius, 6px);
  cursor: pointer;
  transition: all 0.15s ease;
  background: transparent;
  color: var(--neutral-500);
}
.cs-cal-back-btn:hover {
  background: var(--neutral-100);
  color: var(--neutral-700);
}

/* Calendar footer */
.cs-cal-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--neutral-100);
}
.cs-cal-today-btn,
.cs-cal-clear-btn {
  padding: 4px 12px;
  font-size: var(--text-xs);
  font-weight: var(--font-medium, 500);
  border: none;
  border-radius: var(--radius, 6px);
  cursor: pointer;
  transition: all 0.15s ease;
}
.cs-cal-today-btn {
  background: var(--primary-50, #eff6ff);
  color: var(--primary-700);
}
.cs-cal-today-btn:hover {
  background: var(--primary-100, #dbeafe);
}
.cs-cal-clear-btn {
  background: transparent;
  color: var(--neutral-500);
}
.cs-cal-clear-btn:hover {
  background: var(--neutral-100);
  color: var(--neutral-700);
}

/* Responsive — calendar right-aligned on small screens */
@media (max-width: 480px) {
  .cs-calendar {
    width: 260px;
    padding: 10px;
  }
}

/* ============================================================
   NETFLIX-STYLE STAFF PICKER
   ============================================================ */
.staff-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px;
  background: var(--neutral-50, #f8f9fa);
  border: 1px solid var(--neutral-200, #e5e7eb);
  border-radius: 10px;
  min-height: 60px;
  align-items: flex-start;
}
.staff-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, border-color 0.2s;
  border: 2px solid transparent;
  min-width: 80px;
}
.staff-card:hover {
  background: var(--neutral-100, #f1f3f5);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.staff-card.selected {
  border-color: var(--primary, #2563eb);
  background: var(--primary-50, #eff6ff);
}
.staff-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary, #2563eb);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}
.staff-card.selected .staff-avatar {
  background: var(--primary-600, #1d4ed8);
  box-shadow: 0 0 0 3px var(--primary-200, #bfdbfe);
}
.staff-name {
  font-size: 12px;
  text-align: center;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--neutral-700, #374151);
}
.staff-card.selected .staff-name {
  font-weight: 600;
  color: var(--primary-700, #1d4ed8);
}

/* ============================================================
   BENEFICIARY INFO BANNER
   ============================================================ */
.beneficiary-banner {
  padding: 12px 16px;
  border-radius: 8px;
  border-left: 4px solid var(--primary, #2563eb);
  background: var(--primary-50, #eff6ff);
  margin-top: 8px;
  margin-bottom: 12px;
}
.beneficiary-banner .banner-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--neutral-800, #1f2937);
}
.beneficiary-banner .banner-detail {
  font-size: 13px;
  color: var(--neutral-600, #4b5563);
  line-height: 1.5;
}

/* ============================================================
   SCAM / MODUS WARNING BANNER
   ============================================================ */
.scam-warning-banner {
  padding: 12px 16px;
  border-radius: 8px;
  border-left: 4px solid var(--warning, #f59e0b);
  background: #fffbeb;
  margin-top: 8px;
}

/* ============================================================
   CLIENT HISTORY BANNER (dual banner for client lookup)
   ============================================================ */
.client-history-banner {
  padding: 12px 16px;
  border-radius: 8px;
  border-left: 4px solid var(--teal, #14b8a6);
  background: var(--teal-50, #f0fdfa);
  margin-top: 8px;
  margin-bottom: 12px;
}
.client-history-banner .banner-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--neutral-800, #1f2937);
}
.scam-warning-banner .warning-title {
  font-weight: 700;
  font-size: 14px;
  color: #92400e;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.scam-warning-banner .warning-detail {
  font-size: 13px;
  color: #78350f;
  line-height: 1.5;
}
.scam-warning-banner .warning-records {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #fde68a;
  font-size: 12px;
  color: #92400e;
}

/* ============================================================
   RESPONSIVE: MODAL & FLEX-WRAP MOBILE
   ============================================================ */
.flex-wrap-mobile { /* no-op at desktop — just a marker class */ }

@media (max-width: 640px) {
  /* Stack flex rows on mobile */
  .flex-wrap-mobile {
    flex-direction: column !important;
  }

  /* Prevent modals from exceeding viewport */
  .modal-overlay {
    padding: var(--space-2);
  }
  .modal {
    max-width: calc(100vw - 1rem) !important;
    max-height: 92vh;
    border-radius: var(--radius-lg, 12px);
  }
  .modal-header {
    padding: var(--space-3) var(--space-4);
  }
  .modal-body {
    padding: var(--space-4);
  }
  .modal-footer {
    padding: var(--space-3) var(--space-4);
    flex-wrap: wrap;
  }
  .modal-footer .btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  /* Combo dropdown on mobile — full-width, readable touch targets */
  .combo-dropdown {
    max-height: 200px;
  }
  .combo-dropdown .combo-option {
    min-height: 44px;
    padding: 0.625rem 0.75rem;
    font-size: 0.95rem;
  }
  .combo-dropdown .combo-option .autocomplete-item-name {
    font-size: 0.9rem;
  }

  /* Form groups inside modals — tighter spacing */
  .modal-body .form-group {
    margin-bottom: var(--space-3, 0.75rem);
    position: relative;
  }
  .modal-body .form-label {
    font-size: var(--text-sm, 0.875rem);
    margin-bottom: var(--space-1, 0.25rem);
  }
  .modal-body .form-input,
  .modal-body .form-select,
  .modal-body .form-textarea {
    font-size: 1rem;
    height: 42px;
    padding: var(--space-2, 0.5rem) var(--space-3, 0.75rem);
  }
  .modal-body .form-textarea {
    height: auto;
  }
}

/* ============================================================
   CUSTOM TIME PICKER
   ============================================================ */
.cs-timepicker {
  position: relative;
  width: 100%;
}

.cs-time-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  width: 100%;
  height: 44px;
  padding: 0 var(--space-3);
  font-size: var(--text-base);
  color: var(--neutral-800);
  background: #fff;
  border: 1.5px solid var(--neutral-300);
  border-radius: var(--radius-lg, 8px);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
  outline: none;
}
.cs-time-trigger:hover {
  border-color: var(--primary-300, #93c5fd);
  background: var(--neutral-50, #f9fafb);
}
.cs-timepicker.open .cs-time-trigger,
.cs-time-trigger:focus {
  border-color: var(--primary-500);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12), 0 1px 2px rgba(0, 0, 0, 0.05);
}

.cs-time-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cs-time-value.cs-placeholder {
  color: var(--neutral-400);
}

.cs-time-icon {
  display: flex;
  align-items: center;
  color: var(--neutral-400);
  transition: color 0.15s ease;
  flex-shrink: 0;
}
.cs-time-trigger:hover .cs-time-icon,
.cs-timepicker.open .cs-time-icon {
  color: var(--primary-500);
}

/* Small variant */
.cs-timepicker-sm .cs-time-trigger {
  height: 38px;
  font-size: var(--text-sm);
  padding: 0 var(--space-2);
}

/* Time popup */
.cs-time-popup {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 320px;
  background: #fff;
  border: 1.5px solid var(--neutral-200);
  border-radius: var(--radius-lg, 8px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14), 0 4px 12px rgba(0, 0, 0, 0.08);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px) scale(0.98);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  padding: 16px;
  user-select: none;
}
.cs-timepicker.open .cs-time-popup {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Columns layout */
.cs-time-columns {
  display: flex;
  gap: 14px;
}
.cs-time-col {
  flex: 1;
  min-width: 0;
}
.cs-time-period-col {
  flex: 0 0 auto;
  width: 56px;
}
.cs-time-col-label {
  font-size: var(--text-xs, 0.75rem);
  font-weight: var(--font-semibold, 600);
  color: var(--neutral-400);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  text-align: center;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--neutral-100);
}

/* Cell grid */
.cs-time-col-grid {
  display: grid;
  gap: 5px;
}
.cs-time-hours {
  grid-template-columns: repeat(3, 1fr);
}
.cs-time-minutes {
  grid-template-columns: repeat(3, 1fr);
}
.cs-time-periods {
  grid-template-columns: 1fr;
  gap: 6px;
}

/* Individual cell */
.cs-time-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  font-size: var(--text-sm, 0.875rem);
  font-weight: 500;
  color: var(--neutral-700);
  background: var(--neutral-50, #f9fafb);
  border-radius: var(--radius, 6px);
  cursor: pointer;
  transition: all 0.12s ease;
  border: 1px solid transparent;
}
.cs-time-cell:hover {
  background: var(--primary-50, #eff6ff);
  color: var(--primary-600);
  border-color: var(--primary-200);
}
.cs-time-cell.active {
  background: var(--primary-500);
  color: #fff;
  font-weight: 600;
  border-color: var(--primary-500);
}
.cs-time-cell.active:hover {
  background: var(--primary-600);
  border-color: var(--primary-600);
}

/* Period cells */
.cs-time-period-cell {
  height: 38px;
  font-weight: 600;
  font-size: var(--text-sm, 0.875rem);
  letter-spacing: 0.3px;
}

/* Footer */
.cs-time-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--neutral-100);
}
.cs-time-now-btn,
.cs-time-clear-btn {
  font-size: var(--text-xs, 0.75rem);
  font-weight: var(--font-semibold, 600);
  padding: 6px 14px;
  border-radius: var(--radius, 6px);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}
.cs-time-now-btn {
  background: var(--primary-50);
  color: var(--primary-600);
}
.cs-time-now-btn:hover {
  background: var(--primary-100);
}
.cs-time-clear-btn {
  background: var(--neutral-100);
  color: var(--neutral-600);
}
.cs-time-clear-btn:hover {
  background: var(--neutral-200);
}

/* ── Action Buttons (table row actions) ───────────────────── */
.action-btns {
  display: flex;
  gap: var(--space-1, 4px);
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
}

/* Extra small button variant for table actions */
.btn-xs {
  padding: 4px 8px;
  font-size: 12px;
  line-height: 1.4;
  border-radius: var(--radius-sm);
  height: 28px;
  min-width: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
