/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: border-color var(--transition-fast);
}

.card:hover {
  border-color: var(--border-active);
}

.card--primary {
  border-top: 2px solid transparent;
  border-image: var(--accent-gradient) 1;
  border-image-slice: 1;
}

.card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
}

.card__title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-secondary);
}

/* ── Metric Cards ── */
.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  transition: border-color var(--transition-fast);
}

.metric-card:hover {
  border-color: var(--border-active);
}

.metric-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.metric-card__label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.metric-card__icon {
  width: 16px;
  height: 16px;
  opacity: 0.5;
}

.metric-card__value {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.2;
}

.metric-card__value--mono {
  font-family: var(--font-mono);
}

.metric-card__sub {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-top: var(--space-1);
}

.metric-card__sparkline {
  height: 32px;
  margin-top: var(--space-3);
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.6;
}

.badge--success { background: var(--bg-success); color: var(--color-success); }
.badge--danger  { background: var(--bg-danger);  color: var(--color-danger);  }
.badge--warning { background: var(--bg-warning); color: var(--color-warning); }
.badge--info    { background: var(--bg-info);    color: var(--color-info);    }
.badge--neutral { background: rgba(107,114,128,0.12); color: #6B7280; }

.badge--dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ── Status Dot ── */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot--success { background: var(--color-success); }
.status-dot--danger  { background: var(--color-danger);  }
.status-dot--warning { background: var(--color-warning); }

.status-dot--pulse {
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.5); }
}

/* ── Buttons ── */
.btn {
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  border: none;
  outline: none;
}

.btn:active { transform: scale(0.97); }

.btn--primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: var(--accent-glow);
}
.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 30px rgba(108, 92, 231, 0.4);
}

.btn--secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}
.btn--secondary:hover {
  border-color: var(--border-active);
  color: var(--text-primary);
}

.btn--danger {
  background: var(--bg-danger);
  color: var(--color-danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.btn--danger:hover {
  background: rgba(239, 68, 68, 0.2);
}

.btn--success {
  background: var(--bg-success);
  color: var(--color-success);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  border: none;
}
.btn--ghost:hover { color: var(--text-primary); }

.btn--sm {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
}

.btn--lg {
  padding: var(--space-3) var(--space-8);
  font-size: var(--text-base);
}

/* ── Tables ── */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table th {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
  white-space: nowrap;
}

.data-table td {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}

.data-table tr:hover td {
  background: var(--bg-card-hover);
}

.data-table .text-success { color: var(--color-success); }
.data-table .text-danger  { color: var(--color-danger);  }

/* ── Forms ── */
.form-group {
  margin-bottom: var(--space-5);
}

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

.form-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-base);
  transition: border-color var(--transition-fast);
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(108, 92, 231, 0.15);
}

.form-input::placeholder {
  color: var(--text-tertiary);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23545D6E' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ── Toggle ── */
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
}

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

.toggle__slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--border-active);
  border-radius: var(--radius-full);
  transition: var(--transition-fast);
}

.toggle__slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: var(--transition-fast);
}

.toggle input:checked + .toggle__slider {
  background: var(--accent-primary);
}

.toggle input:checked + .toggle__slider::before {
  transform: translateX(20px);
}

/* ── Time Selector ── */
.time-selector {
  display: flex;
  gap: 2px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  padding: 2px;
}

.time-selector__btn {
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-tertiary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.time-selector__btn--active {
  background: var(--accent-primary);
  color: white;
}

.time-selector__btn:hover:not(.time-selector__btn--active) {
  color: var(--text-primary);
}

/* ── Progress Bars ── */
.multiplier-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.multiplier-row__label {
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  color: var(--text-tertiary);
  width: 110px;
  flex-shrink: 0;
}

.multiplier-bar {
  flex: 1;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--bg-input);
  overflow: hidden;
}

.multiplier-bar__fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  transition: width var(--transition-base);
}

.multiplier-bar__fill--low {
  background: linear-gradient(135deg, var(--color-warning), var(--color-danger));
}

.multiplier-row__value {
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  color: var(--text-secondary);
  width: 36px;
  text-align: right;
}

/* ── Toast Notifications ── */
.toast-container {
  position: fixed;
  top: var(--space-6);
  right: var(--space-6);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.toast {
  padding: var(--space-3) var(--space-5);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-elevated);
  font-size: var(--text-sm);
  color: var(--text-primary);
  animation: slide-in-right 300ms ease-out;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 300px;
}

.toast--success { border-left: 3px solid var(--color-success); }
.toast--danger  { border-left: 3px solid var(--color-danger);  }
.toast--warning { border-left: 3px solid var(--color-warning); }
.toast--info    { border-left: 3px solid var(--color-info);    }

@keyframes slide-in-right {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: var(--space-10) var(--space-6);
  color: var(--text-tertiary);
}

.empty-state__icon {
  font-size: 48px;
  margin-bottom: var(--space-4);
  opacity: 0.3;
}

/* ── Login ── */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-primary);
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: var(--space-10);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-elevated);
}

.login-card__logo {
  text-align: center;
  margin-bottom: var(--space-8);
}
