/* ==========================================================================
   Win3 Academy - Shared UI Components
   Cards, buttons, badges, forms, modals, toasts, progress, etc.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Glass Card
   -------------------------------------------------------------------------- */
.card {
  background: var(--glass-bg);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow);
  padding: var(--space-lg);
  transition: background var(--transition-theme),
              border-color var(--transition-theme),
              box-shadow var(--transition-base),
              transform var(--transition-base);
}

.card:hover {
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card-flat {
  background: var(--glass-bg);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow);
  padding: var(--space-lg);
  transition: background var(--transition-theme), border-color var(--transition-theme);
}

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

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

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

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

/* --------------------------------------------------------------------------
   KPI Card
   -------------------------------------------------------------------------- */
.kpi-card {
  background: var(--glass-bg);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow);
  padding: var(--space-lg);
  text-align: center;
  transition: background var(--transition-theme),
              border-color var(--transition-theme),
              transform var(--transition-base);
}

.kpi-card:hover {
  transform: translateY(-2px);
}

.kpi-card-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--space-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--gold-10);
  color: var(--accent-gold);
}

.kpi-card-icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.kpi-card-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.kpi-card-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

.kpi-card-trend {
  font-size: 0.75rem;
  margin-top: var(--space-xs);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.kpi-card-trend.up {
  color: var(--accent-green);
  background: rgba(76, 175, 80, 0.1);
}

.kpi-card-trend.down {
  color: var(--accent-red);
  background: rgba(231, 76, 60, 0.1);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 10px 24px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.4;
  border: none;
  cursor: pointer;
  transition: transform var(--transition-base),
              box-shadow var(--transition-base),
              background var(--transition-fast),
              color var(--transition-fast),
              border-color var(--transition-fast);
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
}

.btn:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 2px;
}

.btn:active {
  transform: translateY(0) !important;
}

.btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  flex-shrink: 0;
}

/* Primary Button (Orange CTA) */
.btn-primary {
  background: var(--accent-orange);
  color: #FFFFFF;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(217, 105, 53, 0.3);
}

/* Secondary Button (Outlined Gold) */
.btn-secondary {
  background: transparent;
  color: var(--accent-gold);
  border: 1.5px solid var(--accent-gold);
}

.btn-secondary:hover {
  background: var(--gold-10);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--gold-15);
}

/* Ghost Button (Transparent) */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

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

/* Danger Button */
.btn-danger {
  background: var(--accent-red);
  color: #FFFFFF;
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(231, 76, 60, 0.3);
}

/* Button sizes */
.btn-sm {
  padding: 6px 14px;
  font-size: 0.8125rem;
  border-radius: 6px;
}

.btn-lg {
  padding: 14px 32px;
  font-size: 1.0625rem;
  border-radius: 10px;
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-md);
}

.btn-icon.btn-sm {
  width: 32px;
  height: 32px;
}

/* Disabled state */
.btn:disabled,
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

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

.btn.loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* --------------------------------------------------------------------------
   Badges
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--radius-full);
  line-height: 1.4;
  white-space: nowrap;
}

.badge-gold {
  background: var(--gold-15);
  color: var(--accent-gold);
  border: 1px solid var(--gold-25);
}

.badge-orange {
  background: rgba(217, 105, 53, 0.15);
  color: var(--accent-orange);
  border: 1px solid rgba(217, 105, 53, 0.25);
}

.badge-green {
  background: rgba(76, 175, 80, 0.12);
  color: var(--accent-green);
  border: 1px solid rgba(76, 175, 80, 0.2);
}

.badge-blue {
  background: rgba(100, 149, 237, 0.12);
  color: var(--accent-blue);
  border: 1px solid rgba(100, 149, 237, 0.2);
}

.badge-red {
  background: rgba(231, 76, 60, 0.12);
  color: var(--accent-red);
  border: 1px solid rgba(231, 76, 60, 0.2);
}

.badge-muted {
  background: var(--bg-secondary);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

/* Phase badges */
.badge-be {
  background: rgba(100, 149, 237, 0.12);
  color: var(--phase-be);
  border: 1px solid rgba(100, 149, 237, 0.25);
}

.badge-do {
  background: rgba(76, 175, 80, 0.12);
  color: var(--phase-do);
  border: 1px solid rgba(76, 175, 80, 0.25);
}

.badge-make {
  background: rgba(188, 128, 52, 0.12);
  color: var(--phase-make);
  border: 1px solid var(--gold-25);
}

/* Tier badges */
.badge-tier-free {
  background: var(--bg-secondary);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.badge-tier-kurs {
  background: rgba(100, 149, 237, 0.12);
  color: var(--accent-blue);
  border: 1px solid rgba(100, 149, 237, 0.25);
}

.badge-tier-mentoring {
  background: linear-gradient(135deg, rgba(188, 128, 52, 0.2), rgba(217, 105, 53, 0.2));
  color: var(--accent-gold);
  border: 1px solid var(--gold-35);
}

.badge-tier-admin {
  background: rgba(231, 76, 60, 0.12);
  color: var(--accent-red);
  border: 1px solid rgba(231, 76, 60, 0.25);
}

/* --------------------------------------------------------------------------
   Phase Indicator
   -------------------------------------------------------------------------- */
.phase-indicator {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.875rem;
  font-weight: 500;
}

.phase-indicator-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.phase-indicator-dot.be { background: var(--phase-be); }
.phase-indicator-dot.do { background: var(--phase-do); }
.phase-indicator-dot.make { background: var(--phase-make); }

/* Phase progress strip */
.phase-strip {
  display: flex;
  gap: 2px;
  border-radius: var(--radius-full);
  overflow: hidden;
  height: 6px;
}

.phase-strip-segment {
  flex: 1;
  transition: opacity var(--transition-base);
}

.phase-strip-segment.be { background: var(--phase-be); }
.phase-strip-segment.do { background: var(--phase-do); }
.phase-strip-segment.make { background: var(--phase-make); }
.phase-strip-segment.locked { opacity: 0.2; }

/* --------------------------------------------------------------------------
   Avatar
   -------------------------------------------------------------------------- */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-gold-dark), var(--accent-gold));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-weight: 600;
  font-size: 1rem;
  flex-shrink: 0;
  border: 2px solid transparent;
  background-clip: padding-box;
  position: relative;
}

.avatar::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange));
  z-index: -1;
  opacity: 0.5;
}

.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 0.8125rem;
}

.avatar-lg {
  width: 56px;
  height: 56px;
  font-size: 1.25rem;
}

.avatar-xl {
  width: 80px;
  height: 80px;
  font-size: 1.75rem;
}

.avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

/* --------------------------------------------------------------------------
   Streak Badge
   -------------------------------------------------------------------------- */
.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: linear-gradient(135deg, rgba(217, 105, 53, 0.15), rgba(188, 128, 52, 0.15));
  border: 1px solid rgba(217, 105, 53, 0.25);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent-orange);
}

.streak-badge-icon {
  width: 16px;
  height: 16px;
}

.streak-badge-icon svg {
  width: 100%;
  height: 100%;
  stroke: var(--accent-orange);
  fill: none;
  stroke-width: 2;
}

.streak-badge-count {
  font-variant-numeric: tabular-nums;
}

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

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

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

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast),
              box-shadow var(--transition-fast),
              background var(--transition-theme);
  outline: none;
}

.form-input:hover,
.form-textarea:hover,
.form-select:hover {
  border-color: var(--border-card);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px var(--gold-15);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-dim);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

.form-select {
  appearance: 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='%23888' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

.form-error {
  font-size: 0.8125rem;
  color: var(--accent-red);
  margin-top: var(--space-xs);
}

.form-hint {
  font-size: 0.8125rem;
  color: var(--text-dim);
  margin-top: var(--space-xs);
}

.form-input.error,
.form-textarea.error {
  border-color: var(--accent-red);
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

/* Checkbox / Radio */
.form-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent-gold);
  flex-shrink: 0;
}

.form-check-label {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Toggle switch */
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

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

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  top: 2px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform var(--transition-fast), background var(--transition-fast);
}

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

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

/* --------------------------------------------------------------------------
   Modal
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal-backdrop);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-slow), visibility var(--transition-slow);
  padding: var(--space-md);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-primary);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.95);
  transition: transform var(--transition-slow);
  z-index: var(--z-modal);
}

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

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

.modal-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  transition: background var(--transition-fast), color var(--transition-fast);
}

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

.modal-close svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.modal-body {
  padding: var(--space-lg);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border-subtle);
}

/* --------------------------------------------------------------------------
   Toast Notifications
   -------------------------------------------------------------------------- */
#toast-container {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-lg);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
  max-width: 380px;
  width: 100%;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toast-in 0.3s ease forwards;
  transition: background var(--transition-theme);
}

.toast.removing {
  animation: toast-out 0.3s ease forwards;
}

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.toast-content {
  flex: 1;
  font-size: 0.875rem;
  color: var(--text-primary);
  line-height: 1.5;
}

.toast-close {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--text-dim);
  cursor: pointer;
  transition: color var(--transition-fast);
}

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

.toast-close svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.toast-success {
  border-left: 3px solid var(--accent-green);
}
.toast-success .toast-icon { color: var(--accent-green); }

.toast-error {
  border-left: 3px solid var(--accent-red);
}
.toast-error .toast-icon { color: var(--accent-red); }

.toast-info {
  border-left: 3px solid var(--accent-blue);
}
.toast-info .toast-icon { color: var(--accent-blue); }

.toast-warning {
  border-left: 3px solid var(--accent-gold);
}
.toast-warning .toast-icon { color: var(--accent-gold); }

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(100%) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0) translateY(0);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* --------------------------------------------------------------------------
   Progress Bar
   -------------------------------------------------------------------------- */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--accent-gold-dark), var(--accent-gold), var(--accent-gold-light));
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.15) 50%, transparent 100%);
  animation: progress-shimmer 2s infinite;
}

@keyframes progress-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

.progress-bar-sm {
  height: 4px;
}

.progress-bar-lg {
  height: 12px;
}

/* Progress with label */
.progress-labeled {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.progress-labeled .progress-bar {
  flex: 1;
}

.progress-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  min-width: 40px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Phase-colored progress fills */
.progress-fill.be { background: linear-gradient(90deg, #4A7BD9, var(--phase-be)); }
.progress-fill.do { background: linear-gradient(90deg, #388E3C, var(--phase-do)); }
.progress-fill.make { background: linear-gradient(90deg, var(--accent-gold-dark), var(--phase-make)); }

/* --------------------------------------------------------------------------
   Tabs
   -------------------------------------------------------------------------- */
.tab-bar {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-item {
  padding: var(--space-sm) var(--space-md);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--transition-fast), border-color var(--transition-fast);
  flex-shrink: 0;
}

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

.tab-item.active {
  color: var(--accent-gold);
  border-bottom-color: var(--accent-gold);
}

.tab-content {
  padding: var(--space-lg) 0;
}

/* Pill-style tabs */
.tab-bar-pills {
  display: flex;
  gap: var(--space-sm);
  border-bottom: none;
  flex-wrap: wrap;
}

.tab-pill {
  padding: 6px 16px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab-pill:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.tab-pill.active {
  color: var(--accent-gold);
  background: var(--gold-10);
  border-color: var(--gold-25);
}

/* --------------------------------------------------------------------------
   Divider
   -------------------------------------------------------------------------- */
.divider {
  height: 1px;
  border: none;
  background: linear-gradient(
    90deg,
    transparent,
    var(--border-subtle) 20%,
    var(--accent-gold) 50%,
    var(--border-subtle) 80%,
    transparent
  );
  margin: var(--space-xl) 0;
}

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

.divider-labeled {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-xl) 0;
}

.divider-labeled::before,
.divider-labeled::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.divider-labeled span {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Empty State
   -------------------------------------------------------------------------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-3xl) var(--space-lg);
  text-align: center;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  margin-bottom: var(--space-lg);
  color: var(--text-dim);
  opacity: 0.5;
}

.empty-state-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
}

.empty-state-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.empty-state-text {
  font-size: 0.9375rem;
  color: var(--text-muted);
  max-width: 320px;
  margin-bottom: var(--space-lg);
}

/* --------------------------------------------------------------------------
   Skeleton Loading
   -------------------------------------------------------------------------- */
.skeleton {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.04) 40%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.04) 60%,
    transparent 100%
  );
  animation: skeleton-shimmer 1.5s infinite;
}

[data-theme="light"] .skeleton::after {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 0, 0, 0.03) 40%,
    rgba(0, 0, 0, 0.06) 50%,
    rgba(0, 0, 0, 0.03) 60%,
    transparent 100%
  );
}

@keyframes skeleton-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.skeleton-text {
  height: 14px;
  margin-bottom: var(--space-sm);
}

.skeleton-text:last-child {
  width: 60%;
}

.skeleton-heading {
  height: 24px;
  width: 50%;
  margin-bottom: var(--space-md);
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.skeleton-card {
  height: 120px;
  border-radius: var(--radius-lg);
}

.skeleton-btn {
  height: 40px;
  width: 120px;
  border-radius: var(--radius-md);
}

/* --------------------------------------------------------------------------
   Confetti
   -------------------------------------------------------------------------- */
.confetti-piece {
  position: absolute;
  width: 8px;
  height: 12px;
  border-radius: 2px;
  animation: confetti-fall 2s ease-out forwards;
  opacity: 0;
}

@keyframes confetti-fall {
  0% {
    opacity: 1;
    transform: translateY(0) rotate(0deg) scale(1);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(100vh) rotate(720deg) scale(0.3);
  }
}

/* --------------------------------------------------------------------------
   Callout / Alert
   -------------------------------------------------------------------------- */
.callout {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  transition: background var(--transition-theme), border-color var(--transition-theme);
}

.callout-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.callout-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.callout-content {
  flex: 1;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.callout-info {
  border-color: rgba(100, 149, 237, 0.25);
  background: rgba(100, 149, 237, 0.05);
}
.callout-info .callout-icon { color: var(--accent-blue); }

.callout-success {
  border-color: rgba(76, 175, 80, 0.25);
  background: rgba(76, 175, 80, 0.05);
}
.callout-success .callout-icon { color: var(--accent-green); }

.callout-warning {
  border-color: var(--gold-25);
  background: rgba(188, 128, 52, 0.05);
}
.callout-warning .callout-icon { color: var(--accent-gold); }

.callout-error {
  border-color: rgba(231, 76, 60, 0.25);
  background: rgba(231, 76, 60, 0.05);
}
.callout-error .callout-icon { color: var(--accent-red); }

/* --------------------------------------------------------------------------
   Tag / Chip
   -------------------------------------------------------------------------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.tag:hover {
  background: var(--bg-card-hover);
  color: var(--text-secondary);
}

.tag-removable {
  cursor: pointer;
}

.tag-removable .tag-close {
  width: 14px;
  height: 14px;
  margin-left: 2px;
  opacity: 0.6;
  transition: opacity var(--transition-fast);
}

.tag-removable:hover .tag-close {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Tooltip (CSS-only)
   -------------------------------------------------------------------------- */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-primary);
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  box-shadow: var(--shadow-md);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-fast), visibility var(--transition-fast);
  pointer-events: none;
  z-index: var(--z-tooltip);
}

[data-tooltip]:hover::before {
  opacity: 1;
  visibility: visible;
}

/* --------------------------------------------------------------------------
   Status Dot
   -------------------------------------------------------------------------- */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.online { background: var(--accent-green); box-shadow: 0 0 6px rgba(76, 175, 80, 0.4); }
.status-dot.offline { background: var(--text-dim); }
.status-dot.busy { background: var(--accent-red); }
.status-dot.away { background: var(--accent-gold); }

/* --------------------------------------------------------------------------
   Dropdown Menu
   -------------------------------------------------------------------------- */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 180px;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-xs) 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity var(--transition-fast), visibility var(--transition-fast), transform var(--transition-fast);
  z-index: var(--z-dropdown);
}

.dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 8px 14px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.dropdown-item:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.dropdown-item svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  flex-shrink: 0;
}

.dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: var(--space-xs) 0;
}

/* --------------------------------------------------------------------------
   Table
   -------------------------------------------------------------------------- */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  padding: var(--space-sm) var(--space-md);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-align: left;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.table td {
  padding: var(--space-sm) var(--space-md);
  font-size: 0.875rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

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

.table tr:hover td {
  background: rgba(188, 128, 52, 0.03);
}

/* --------------------------------------------------------------------------
   Search Input
   -------------------------------------------------------------------------- */
.search-input {
  position: relative;
}

.search-input input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-input input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px var(--gold-15);
}

.search-input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-dim);
  pointer-events: none;
}

.search-input-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

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

.pagination-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.pagination-btn:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.pagination-btn.active {
  background: var(--gold-15);
  color: var(--accent-gold);
}

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

.pagination-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}
