/**
 * 🎨 AURORA STEPPE Components v2.0
 * Полный UI Kit с продвинутыми состояниями и анимациями
 */

/* ============================================
   BUTTONS (все состояния)
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  font-family: var(--font-primary);
  color: var(--text-primary);
  background: var(--surface-glass);
  backdrop-filter: var(--glass-blur-md);
  -webkit-backdrop-filter: var(--glass-blur-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--motion-fast) var(--easing-default);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  outline: none;
  user-select: none;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-surface);
  opacity: 0;
  transition: opacity var(--motion-fast) var(--easing-default);
  z-index: -1;
}

.btn:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}

.btn:hover::before {
  opacity: 1;
}

.btn:active {
  transform: translateY(0) scale(0.98);
  transition-duration: var(--motion-xfast);
}

.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--primary-light);
}

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

/* Primary Button */
.btn-primary {
  background: var(--gradient-accent);
  color: var(--text-inverse);
  border: none;
  box-shadow: var(--shadow-glow-accent);
  font-weight: var(--font-weight-semibold);
}

.btn-primary::before {
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0.1) 100%);
}

.btn-primary:hover {
  box-shadow: var(--shadow-glow-accent-strong), var(--shadow-lg);
  transform: translateY(-2px) scale(1.02);
}

.btn-primary:active {
  box-shadow: var(--shadow-glow-accent);
  transform: translateY(0) scale(0.98);
}

/* Secondary Button */
.btn-secondary {
  background: var(--surface-glass);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

/* Danger Button */
.btn-danger {
  background: linear-gradient(135deg, var(--error) 0%, #E63946 100%);
  color: white;
  border: none;
  box-shadow: 0 0 20px rgba(255, 77, 77, 0.3);
  font-weight: var(--font-weight-semibold);
}

.btn-danger:hover {
  box-shadow: 0 0 30px rgba(255, 77, 77, 0.5), var(--shadow-lg);
  transform: translateY(-2px) scale(1.02);
}

/* Success Button */
.btn-success {
  background: linear-gradient(135deg, var(--success) 0%, #14B869 100%);
  color: white;
  border: none;
  box-shadow: 0 0 20px rgba(22, 198, 122, 0.3);
  font-weight: var(--font-weight-semibold);
}

.btn-success:hover {
  box-shadow: 0 0 30px rgba(22, 198, 122, 0.5), var(--shadow-lg);
  transform: translateY(-2px) scale(1.02);
}

/* Ghost Button */
.btn-ghost {
  background: transparent;
  border: 1px solid transparent;
}

.btn-ghost:hover {
  background: var(--surface);
  border-color: var(--border);
}

/* Sizes */
.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: var(--space-4) var(--space-6);
  font-size: var(--text-base);
  border-radius: var(--radius-lg);
}

/* Loading State */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  margin: auto;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Button Group */
.btn-group {
  display: inline-flex;
  gap: var(--space-2);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.btn-group .btn {
  border-radius: 0;
  margin: 0;
}

.btn-group .btn:first-child {
  border-top-left-radius: var(--radius-md);
  border-bottom-left-radius: var(--radius-md);
}

.btn-group .btn:last-child {
  border-top-right-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
}

/* ============================================
   INPUTS (с масками и валидацией)
   ============================================ */
.form-group {
  margin-bottom: var(--space-6);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.form-label.required::after {
  content: ' *';
  color: var(--error);
}

.input,
.input-textarea,
.input-select,
.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  font-family: var(--font-primary);
  color: var(--text-primary);
  background: var(--surface-glass);
  backdrop-filter: var(--glass-blur-md);
  -webkit-backdrop-filter: var(--glass-blur-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--motion-fast) var(--easing-default);
  outline: none;
}

.input::placeholder,
.input-textarea::placeholder {
  color: var(--text-tertiary);
  opacity: 0.6;
}

.input:focus,
.input-textarea:focus,
.input-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light), var(--shadow-sm);
  background: var(--surface-hover);
}

.input:disabled,
.input-textarea:disabled,
.input-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--bg-tertiary);
}

/* Validation States */
.input:invalid:not(:placeholder-shown):not(:focus) {
  border-color: var(--error);
  box-shadow: 0 0 0 3px var(--error-light);
}

.input:valid:not(:placeholder-shown):not(:focus) {
  border-color: var(--success);
  box-shadow: 0 0 0 3px var(--success-light);
}

.input-error {
  border-color: var(--error) !important;
  box-shadow: 0 0 0 3px var(--error-light) !important;
}

.input-success {
  border-color: var(--success) !important;
  box-shadow: 0 0 0 3px var(--success-light) !important;
}

.input-textarea {
  min-height: 120px;
  resize: vertical;
  font-family: var(--font-primary);
}

.input-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236E6E73' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  padding-right: var(--space-10);
}

/* Fix for select options in dark/light mode - GLOBAL FIX */
.form-select option,
.input-select option,
select.form-select option,
select.input-select option,
select option {
  background: var(--surface) !important;
  color: var(--text-primary) !important;
  padding: var(--space-2) var(--space-4);
}

/* Dark mode specific fixes for select dropdown options */
[data-theme="dark"] .form-select option,
[data-theme="dark"] .input-select option,
[data-theme="dark"] select option,
html[data-theme="dark"] .form-select option,
html[data-theme="dark"] .input-select option,
html[data-theme="dark"] select option {
  background-color: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
}

/* Light mode - ensure white background for options */
[data-theme="light"] .form-select option,
[data-theme="light"] .input-select option,
[data-theme="light"] select option,
html[data-theme="light"] .form-select option,
html[data-theme="light"] .input-select option,
html[data-theme="light"] select option {
  background-color: #ffffff !important;
  color: #1a1a1a !important;
}

/* Ensure select itself has proper background */
[data-theme="dark"] .form-select,
[data-theme="dark"] .input-select,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .input-select {
  background-color: var(--surface) !important;
  color: var(--text-primary) !important;
}


/* Phone Mask Input (+7 7xx) */
.input-phone {
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
}

/* Error/Success Messages */
.input-error-message {
  display: block;
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--error);
}

.input-success-message {
  display: block;
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--success);
}

/* ============================================
   CARDS (с hover эффектами)
   ============================================ */
.card {
  background: var(--surface-glass);
  backdrop-filter: var(--glass-blur-md);
  -webkit-backdrop-filter: var(--glass-blur-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-md);
  transition: all var(--motion-base) var(--easing-default);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-surface);
  opacity: 0;
  transition: opacity var(--motion-base) var(--easing-default);
  z-index: -1;
}

.card:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  border-color: var(--border-hover);
}

.card:hover::before {
  opacity: 1;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--divider-subtle);
}

.card-title {
  font-size: var(--text-xl);
  font-weight: var(--font-weight-bold);
  font-family: var(--font-display);
  color: var(--text-primary);
  line-height: var(--line-height-tight);
}

.card-body {
  color: var(--text-secondary);
}

.card-footer {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--divider-subtle);
}

/* Card Variants */
.card-interactive {
  cursor: pointer;
}

.card-interactive:hover {
  transform: translateY(-4px) scale(1.02);
}

.card-elevated {
  box-shadow: var(--shadow-xl);
}

.card-bordered {
  border-width: 2px;
}

/* ============================================
   TAGS & CHIPS
   ============================================ */
.tag,
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  white-space: nowrap;
  transition: all var(--motion-fast) var(--easing-default);
}

.tag:hover,
.chip:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  transform: scale(1.05);
}

.chip {
  cursor: pointer;
  user-select: none;
}

.chip-active {
  background: var(--gradient-accent);
  color: var(--text-inverse);
  border-color: transparent;
}

.chip-close {
  margin-left: var(--space-1);
  cursor: pointer;
  opacity: 0.6;
  transition: opacity var(--motion-xfast);
}

.chip-close:hover {
  opacity: 1;
}

/* ============================================
   BADGE
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-bold);
  color: var(--text-inverse);
  background: var(--gradient-accent);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
}

.badge-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  min-width: 8px;
}

.badge-success {
  background: var(--success);
}

.badge-warning {
  background: var(--warning);
}

.badge-error {
  background: var(--error);
}

.badge-info {
  background: var(--info);
}

/* ============================================
   TOGGLE
   ============================================ */
.toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
}

.toggle-input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--motion-fast) var(--easing-default);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 3px;
  background: var(--text-primary);
  border-radius: 50%;
  transition: all var(--motion-fast) var(--easing-default);
  box-shadow: var(--shadow-sm);
}

.toggle-input:checked + .toggle-slider {
  background: var(--gradient-accent);
  border-color: transparent;
}

.toggle-input:checked + .toggle-slider::before {
  transform: translateX(20px);
  background: var(--text-inverse);
}

.toggle-input:focus + .toggle-slider {
  box-shadow: 0 0 0 3px var(--primary-light);
}

.toggle-input:disabled + .toggle-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================
   TOOLTIP
   ============================================ */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip-content {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  color: var(--text-inverse);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all var(--motion-fast) var(--easing-default);
  z-index: var(--z-tooltip);
  box-shadow: var(--shadow-lg);
}

.tooltip:hover .tooltip-content {
  opacity: 1;
  transform: translateX(-50%) translateY(-12px);
}

.tooltip-content::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--bg-secondary);
}

/* ============================================
   TOAST
   ============================================ */
.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  background: var(--surface-glass);
  backdrop-filter: var(--glass-blur-lg);
  -webkit-backdrop-filter: var(--glass-blur-lg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  color: var(--text-primary);
  font-size: var(--text-sm);
  max-width: 400px;
  animation: toast-slide-in var(--motion-base) var(--easing-default);
  z-index: var(--z-toast);
}

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

.toast-success {
  border-left: 4px solid var(--success);
}

.toast-error {
  border-left: 4px solid var(--error);
}

.toast-warning {
  border-left: 4px solid var(--warning);
}

.toast-info {
  border-left: 4px solid var(--info);
}

.api-key-modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: calc(var(--z-modal) + 1);
}

/* ============================================
   MODAL & SHEET
   ============================================ */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  padding: var(--space-6);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--motion-base) var(--easing-default);
}

.modal.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  background: var(--surface-glass);
  backdrop-filter: var(--glass-blur-lg);
  -webkit-backdrop-filter: var(--glass-blur-lg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2xl);
  padding: var(--space-8);
  overflow-y: auto;
  transform: scale(0.95) translateY(20px);
  transition: transform var(--motion-base) var(--easing-default);
  z-index: 1;
}

.modal.active .modal-content {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--divider-subtle);
}

.modal-title {
  font-size: var(--text-2xl);
  font-weight: var(--font-weight-bold);
  font-family: var(--font-display);
  color: var(--text-primary);
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--motion-fast) var(--easing-default);
}

.modal-close:hover {
  background: var(--surface);
  color: var(--text-primary);
}

.modal-body {
  color: var(--text-secondary);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-8);
  padding-top: var(--space-4);
  border-top: 1px solid var(--divider-subtle);
}

/* Sheet (Bottom Sheet) */
.sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 90vh;
  background: var(--surface-glass);
  backdrop-filter: var(--glass-blur-lg);
  -webkit-backdrop-filter: var(--glass-blur-lg);
  border-top: 1px solid var(--border);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: var(--shadow-2xl);
  padding: var(--space-8);
  transform: translateY(100%);
  transition: transform var(--motion-base) var(--easing-default);
  z-index: var(--z-modal);
  overflow-y: auto;
}

.sheet.active {
  transform: translateY(0);
}

/* ============================================
   KPI TILE
   ============================================ */
.kpi-tile {
  background: var(--surface-glass);
  backdrop-filter: var(--glass-blur-md);
  -webkit-backdrop-filter: var(--glass-blur-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: all var(--motion-base) var(--easing-default);
  position: relative;
  overflow: hidden;
}

.kpi-tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-accent);
  opacity: 0;
  transition: opacity var(--motion-base) var(--easing-default);
}

.kpi-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-hover);
}

.kpi-tile:hover::before {
  opacity: 1;
}

.kpi-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
  font-weight: var(--font-weight-medium);
}

.kpi-value {
  font-size: var(--text-3xl);
  font-weight: var(--font-weight-bold);
  font-family: var(--font-mono);
  color: var(--text-primary);
  line-height: var(--line-height-tight);
}

.kpi-change {
  font-size: var(--text-xs);
  margin-top: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.kpi-change-positive {
  color: var(--success);
}

.kpi-change-negative {
  color: var(--error);
}

/* ============================================
   PRICING TILE
   ============================================ */
.pricing-tile {
  background: var(--surface-glass);
  backdrop-filter: var(--glass-blur-md);
  -webkit-backdrop-filter: var(--glass-blur-md);
  border: 2px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  transition: all var(--motion-base) var(--easing-default);
  position: relative;
  overflow: hidden;
}

.pricing-tile:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-xl), var(--shadow-glow);
  border-color: var(--primary);
}

.pricing-tile-popular {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg), var(--shadow-glow-accent);
}

.pricing-tile-popular::before {
  content: 'Most Popular';
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-bold);
  color: var(--text-inverse);
  background: var(--gradient-accent);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
}

.pricing-name {
  font-size: var(--text-xl);
  font-weight: var(--font-weight-bold);
  font-family: var(--font-display);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.pricing-price {
  font-size: var(--text-4xl);
  font-weight: var(--font-weight-extrabold);
  font-family: var(--font-display);
  color: var(--text-primary);
  line-height: var(--line-height-tight);
  margin-bottom: var(--space-6);
}

.pricing-price-period {
  font-size: var(--text-base);
  color: var(--text-secondary);
  font-weight: var(--font-weight-normal);
}

.pricing-features {
  list-style: none;
  margin-bottom: var(--space-8);
}

.pricing-features li {
  padding: var(--space-2) 0;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.pricing-features li::before {
  content: '✓';
  color: var(--success);
  font-weight: var(--font-weight-bold);
  font-size: var(--text-lg);
}

/* ============================================
   STEPPER
   ============================================ */
.stepper {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.stepper-step {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex: 1;
  position: relative;
}

.stepper-step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: calc(var(--space-6) + 20px);
  top: 20px;
  width: calc(100% - var(--space-6) - 20px);
  height: 2px;
  background: var(--divider);
  z-index: 0;
}

.stepper-step.completed::after {
  background: var(--gradient-accent);
}

.stepper-number {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-base);
  font-weight: var(--font-weight-bold);
  color: var(--text-secondary);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 50%;
  position: relative;
  z-index: 1;
  transition: all var(--motion-base) var(--easing-default);
}

.stepper-step.active .stepper-number {
  color: var(--text-inverse);
  background: var(--gradient-accent);
  border-color: transparent;
  box-shadow: var(--shadow-glow-accent);
}

.stepper-step.completed .stepper-number {
  color: var(--text-inverse);
  background: var(--success);
  border-color: transparent;
}

.stepper-label {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
}

.stepper-step.active .stepper-label {
  color: var(--text-primary);
}

/* ============================================
   TABS
   ============================================ */
.tabs {
  display: flex;
  gap: var(--space-2);
  border-bottom: 1px solid var(--divider);
  margin-bottom: var(--space-6);
}

.tab {
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--motion-fast) var(--easing-default);
  position: relative;
  outline: none;
}

.tab:hover {
  color: var(--text-primary);
}

.tab-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab:focus-visible {
  box-shadow: 0 0 0 3px var(--primary-light);
  border-radius: var(--radius-sm);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ============================================
   ACCORDION
   ============================================ */
.accordion {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-4);
}

.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5);
  background: var(--surface);
  cursor: pointer;
  transition: all var(--motion-fast) var(--easing-default);
  user-select: none;
}

.accordion-header:hover {
  background: var(--surface-hover);
}

.accordion-title {
  font-size: var(--text-base);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}

.accordion-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: transform var(--motion-fast) var(--easing-default);
}

.accordion.active .accordion-icon {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--motion-base) var(--easing-default);
}

.accordion.active .accordion-content {
  max-height: 2000px;
}

.accordion-body {
  padding: var(--space-5);
  color: var(--text-secondary);
  border-top: 1px solid var(--divider-subtle);
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-16) var(--space-6);
  text-align: center;
}

.empty-icon {
  width: 64px;
  height: 64px;
  margin-bottom: var(--space-6);
  opacity: 0.5;
}

.empty-title {
  font-size: var(--text-xl);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.empty-description {
  font-size: var(--text-base);
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
  max-width: 400px;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.pagination-item {
  min-width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--motion-fast) var(--easing-default);
}

.pagination-item:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.pagination-item.active {
  background: var(--gradient-accent);
  color: var(--text-inverse);
  border-color: transparent;
  box-shadow: var(--shadow-glow-accent);
}

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

/* ============================================
   BREADCRUMBS
   ============================================ */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
  font-size: var(--text-sm);
}

.breadcrumb-item {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--motion-fast) var(--easing-default);
}

.breadcrumb-item:hover {
  color: var(--text-primary);
}

.breadcrumb-item.active {
  color: var(--text-primary);
  font-weight: var(--font-weight-medium);
}

.breadcrumb-separator {
  color: var(--text-tertiary);
  margin: 0 var(--space-1);
}

/* ============================================
   STATUS DOT
   ============================================ */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--secondary);
}

.status-dot-online {
  background: var(--success);
  box-shadow: 0 0 0 2px var(--success-light);
}

.status-dot-offline {
  background: var(--text-disabled);
}

.status-dot-warning {
  background: var(--warning);
  box-shadow: 0 0 0 2px var(--warning-light);
}

.status-dot-error {
  background: var(--error);
  box-shadow: 0 0 0 2px var(--error-light);
}

/* ============================================
   GRID SYSTEM (12-column)
   ============================================ */
.grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: repeat(var(--grid-columns), 1fr);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-6 { grid-template-columns: repeat(6, 1fr); }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-6 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .grid,
  .grid-2,
  .grid-3,
  .grid-4,
  .grid-6 {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   UTILITY EFFECTS
   ============================================ */
.tilt-effect {
  transition: transform var(--motion-base) var(--easing-default);
}

.tilt-effect:hover {
  transform: rotateY(4deg) rotateX(-2deg) scale(1.02);
}

.aurora-glow {
  position: relative;
}

.aurora-glow::after {
  content: '';
  position: absolute;
  inset: -4px;
  background: var(--gradient-aurora);
  border-radius: inherit;
  opacity: 0;
  filter: blur(12px);
  transition: opacity var(--motion-base) var(--easing-default);
  z-index: -1;
}

.aurora-glow:hover::after {
  opacity: 0.6;
}

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface) 0%,
    var(--surface-hover) 50%,
    var(--surface) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

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

/* Divider */
.divider {
  height: 1px;
  background: var(--divider-subtle);
  border: none;
  margin: var(--space-6) 0;
}

.divider-vertical {
  width: 1px;
  height: 100%;
  background: var(--divider-subtle);
  border: none;
  margin: 0 var(--space-6);
}

/* ============================================
   RESPONSIVE LAYOUT UTILITIES
   ============================================ */

@media (max-width: 1440px) {
  .container,
  .client-container {
    padding: var(--space-8);
  }
}

@media (max-width: 1280px) {
  .container,
  .client-container {
    padding: var(--space-6);
  }

  .card,
  .page-header,
  .config-header,
  header {
    padding: var(--space-6);
  }
}

@media (max-width: 1024px) {
  .container,
  .client-container {
    padding: var(--space-5);
  }

  header,
  .page-header,
  .config-header,
  .card-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: var(--space-4) !important;
  }

  header > *,
  .page-header > *,
  .config-header > *,
  .card-header > * {
    width: 100% !important;
  }

  .stats-grid,
  .grid,
  .grid-2,
  .grid-3,
  .grid-4,
  .grid-6 {
    gap: var(--space-4);
  }

  .search-filters {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
  }
}

@media (max-width: 900px) {
  .config-tabs-wrapper,
  .tabs-nav {
    gap: var(--space-2);
  }

  .tab-btn,
  .config-tab {
    padding: var(--space-3) var(--space-4);
  }
}

@media (max-width: 768px) {
  html,
  body {
    font-size: 15px;
  }

  .container,
  .client-container {
    padding: var(--space-4);
  }

  header,
  .page-header,
  .config-header,
  .card-header,
  .card {
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
  }

  .tabs-nav,
  .config-tabs-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: var(--space-2);
  }

  .tabs-nav::-webkit-scrollbar,
  .config-tabs-wrapper::-webkit-scrollbar {
    height: 4px;
  }

  .tab-btn,
  .config-tab,
  .nav-link {
    flex: 0 0 auto;
    font-size: var(--text-sm);
    padding: var(--space-3) var(--space-4);
  }

  .stats-grid,
  .kpi-section,
  .items-list,
  .card {
    gap: var(--space-3);
  }

  .search-filters {
    grid-template-columns: 1fr !important;
    gap: var(--space-3) !important;
  }

  .search-filters > * {
    width: 100% !important;
  }

  .aurora-bg > div[style*="padding: var(--space-6)"],
  .aurora-bg > div[style*="padding:var(--space-6)"],
  .aurora-bg > div[style*="padding-left: calc(var(--dock-width"] {
    padding: var(--space-4) !important;
    padding-left: var(--space-4) !important;
    padding-right: var(--space-4) !important;
  }

  .aurora-bg > div[style*="padding-bottom: calc(var(--dock-height"],
  .aurora-bg > div[style*="padding-bottom:calc(var(--dock-height"] {
    padding-bottom: calc(var(--space-8) + var(--dock-height, 72px)) !important;
  }

  .payment-card-modern,
  .client-card,
  .subscription-card,
  .config-summary-card,
  .lead-card-modern {
    grid-template-columns: 1fr !important;
  }

  .payment-card-modern > div:last-child,
  .client-card > div:last-child,
  .subscription-card > div:last-child,
  .lead-card-modern > div:last-child {
    width: 100% !important;
    min-width: 0 !important;
  }

  .payment-card-modern button,
  .client-card button,
  .subscription-card button,
  .lead-card-modern button,
  .config-summary-card button {
    width: 100% !important;
  }

  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table thead,
  table tbody,
  table tr,
  table td,
  table th {
    white-space: nowrap;
  }

  .modal-content,
  .admin-payment-modal .modal-content {
    width: 100% !important;
    max-width: 100% !important;
    padding: var(--space-4) !important;
    margin: 0 !important;
  }

  .admin-payment-modal {
    align-items: flex-start !important;
  }
}

@media (max-width: 640px) {
  .container,
  .client-container {
    padding: var(--space-3);
  }

  header,
  .page-header,
  .config-header,
  .card {
    padding: var(--space-4);
  }

  header h1,
  .page-header h1,
  .config-header h1 {
    font-size: var(--text-h3);
  }

  header p,
  .page-header p,
  .config-header p {
    font-size: var(--text-sm);
  }

  .tab-btn,
  .config-tab {
    font-size: 13px;
    padding: var(--space-2) var(--space-3);
  }

  .payment-card-modern,
  .lead-card-modern,
  .subscription-card {
    padding: var(--space-4) !important;
  }

  .aurora-bg > div[style*="padding: var(--space-4)"],
  .aurora-bg > div[style*="padding:var(--space-4)"] {
    padding-left: var(--space-3) !important;
    padding-right: var(--space-3) !important;
  }

  .payment-card-modern .btn,
  .lead-card-modern .btn,
  .modal-content .btn,
  form .btn {
    width: 100% !important;
  }

  input,
  select,
  textarea,
  .form-input,
  .form-select,
  .form-textarea {
    width: 100% !important;
  }
}

@media (max-width: 480px) {
  body {
    line-height: 1.5;
  }

  .container,
  .client-container {
    padding: var(--space-2) var(--space-3);
  }

  .stats-grid,
  .grid,
  .grid-2,
  .grid-3,
  .grid-4,
  .grid-6 {
    grid-template-columns: 1fr !important;
  }

  .kpi-value {
    font-size: var(--text-xl);
  }

  .kpi-label {
    font-size: var(--text-xs);
  }

  .tab-btn,
  .config-tab {
    min-width: max-content;
  }

  .status-dot {
    width: 10px;
    height: 10px;
  }

  .dock {
    max-width: 100%;
  }
}