/* ==========================================================
   SolarPro Design System - Components
   All reusable UI components
   ========================================================== */

/* ==========================================================
   Buttons
   ========================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  user-select: none;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

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

.btn-primary {
  background: var(--accent-blue);
  color: #fff;
  border-color: var(--accent-blue);
}

.btn-primary:hover {
  background: var(--accent-blue-hover);
  border-color: var(--accent-blue-hover);
  box-shadow: var(--shadow-glow-blue);
}

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

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.btn-danger {
  background: var(--accent-red);
  color: #fff;
  border-color: var(--accent-red);
}

.btn-danger:hover {
  background: #DC2626;
  border-color: #DC2626;
  box-shadow: 0 0 20px var(--accent-red-glow);
}

.btn-success {
  background: var(--accent-green);
  color: #fff;
  border-color: var(--accent-green);
}

.btn-success:hover {
  background: var(--accent-green-hover);
  border-color: var(--accent-green-hover);
  box-shadow: var(--shadow-glow-green);
}

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

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

.btn-solar {
  background: var(--solar-gradient);
  color: #fff;
  border-color: transparent;
}

.btn-solar:hover {
  opacity: 0.9;
  box-shadow: 0 0 24px rgba(249, 115, 22, 0.25);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 12px 24px;
  font-size: 15px;
  border-radius: var(--radius-md);
}

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

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

.btn-icon.btn-lg {
  width: 44px;
  height: 44px;
}

/* Button loading state */
.btn.loading {
  color: transparent;
  pointer-events: none;
}

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

/* ==========================================================
   Inputs, Selects, Textareas
   ========================================================== */
.input,
.select,
.textarea {
  width: 100%;
  padding: 9px 14px;
  font-size: 13.5px;
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  line-height: 1.5;
}

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

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

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px var(--accent-blue-glow);
  background: var(--bg-secondary);
  outline: none;
}

.input.error,
.select.error,
.textarea.error {
  border-color: var(--accent-red);
  box-shadow: 0 0 0 3px var(--accent-red-glow);
}

.select {
  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' fill='none'%3E%3Cpath d='M2.5 4.5L6 8L9.5 4.5' stroke='%238B8B9E' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

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

.input-sm {
  padding: 6px 10px;
  font-size: 12px;
}

/* ── Input Group ── */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.input-group .input-error {
  font-size: 12px;
  color: var(--accent-red);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Input with prefix/suffix ── */
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-prefix,
.input-suffix {
  position: absolute;
  display: flex;
  align-items: center;
  color: var(--text-tertiary);
  font-size: 14px;
  pointer-events: none;
}

.input-prefix {
  left: 12px;
}

.input-suffix {
  right: 12px;
}

.input-wrapper .input.has-prefix {
  padding-left: 36px;
}

.input-wrapper .input.has-suffix {
  padding-right: 36px;
}

/* ==========================================================
   Cards (Glassmorphism)
   ========================================================== */
.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition-base);
}

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

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

.card-header-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-header-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.card-body {
  flex: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid var(--border-default);
}

.card-flat {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: var(--bg-card);
}

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

.badge-blue {
  background: var(--accent-blue-glow);
  color: var(--accent-blue);
}

.badge-green {
  background: var(--accent-green-glow);
  color: var(--accent-green);
}

.badge-amber {
  background: var(--accent-amber-glow);
  color: var(--accent-amber);
}

.badge-red {
  background: var(--accent-red-glow);
  color: var(--accent-red);
}

.badge-neutral {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
}

.badge-solar {
  background: rgba(249, 115, 22, 0.12);
  color: var(--solar-orange);
}

.badge-dot {
  padding-left: 8px;
}

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

/* ==========================================================
   Tables
   ========================================================== */
.table-container {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.table-container table {
  width: 100%;
  min-width: 600px;
}

.table-container thead {
  background: var(--bg-tertiary);
}

.table-container th {
  padding: 10px 16px;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  text-align: left;
  white-space: nowrap;
}

.table-container td {
  padding: 12px 16px;
  font-size: 13.5px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-default);
}

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

.table-container tbody tr:nth-child(even) {
  background: var(--bg-card);
}

.table-container tbody tr:hover {
  background: var(--bg-card-hover);
}

.table-container tbody tr {
  transition: background var(--transition-fast);
}

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

/* Table footer / pagination */
.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-default);
}

.table-pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}

.table-pagination-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

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

.table-pagination-btn.active {
  background: var(--accent-blue);
  color: #fff;
}

/* ==========================================================
   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: 1000;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

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

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95);
  opacity: 0;
  transition: all var(--transition-base);
}

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

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

.modal-title {
  font-size: 16px;
  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-sm);
  color: var(--text-tertiary);
  transition: all var(--transition-fast);
}

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

.modal-body {
  padding: 20px 24px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border-default);
}

.modal-lg {
  max-width: 720px;
}

.modal-sm {
  max-width: 380px;
}

.modal-full {
  max-width: 95vw;
  max-height: 95vh;
}

/* ==========================================================
   Toast Notifications
   ========================================================== */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2000;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 300px;
  max-width: 420px;
  pointer-events: all;
  animation: slideInRight 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast.dismissing {
  animation: slideOutRight 0.3s ease forwards;
}

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

.toast-content {
  flex: 1;
}

.toast-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.toast-message {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.toast-close {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  flex-shrink: 0;
  cursor: pointer;
  transition: color var(--transition-fast);
}

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

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

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

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

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

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--accent-blue);
  border-radius: 0 0 0 var(--radius-md);
  animation: toastProgress 5s linear forwards;
}

@keyframes slideOutRight {
  to {
    transform: translateX(120%);
    opacity: 0;
  }
}

@keyframes toastProgress {
  from { width: 100%; }
  to { width: 0%; }
}

/* ==========================================================
   Dropdown
   ========================================================== */
.dropdown {
  position: relative;
  display: inline-flex;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 180px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 4px;
  z-index: 500;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all var(--transition-fast);
}

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

.dropdown-menu.right {
  left: auto;
  right: 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

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

.dropdown-item-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dropdown-item.danger {
  color: var(--accent-red);
}

.dropdown-item.danger:hover {
  background: var(--accent-red-glow);
}

.dropdown-divider {
  height: 1px;
  background: var(--border-default);
  margin: 4px 0;
}

/* ==========================================================
   KPI Card
   ========================================================== */
.kpi-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all var(--transition-base);
}

.kpi-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.kpi-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-card-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.kpi-card-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  font-size: 16px;
}

.kpi-card-icon.blue {
  background: var(--accent-blue-glow);
  color: var(--accent-blue);
}

.kpi-card-icon.green {
  background: var(--accent-green-glow);
  color: var(--accent-green);
}

.kpi-card-icon.amber {
  background: var(--accent-amber-glow);
  color: var(--accent-amber);
}

.kpi-card-icon.solar {
  background: rgba(249, 115, 22, 0.12);
  color: var(--solar-orange);
}

.kpi-card-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.kpi-card-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
}

.kpi-card-trend.up {
  color: var(--accent-green);
}

.kpi-card-trend.down {
  color: var(--accent-red);
}

.kpi-card-sparkline {
  height: 32px;
  margin-top: 4px;
}

/* ==========================================================
   Avatar
   ========================================================== */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-weight: 600;
  flex-shrink: 0;
  overflow: hidden;
}

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

.avatar-sm {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.avatar-md {
  width: 36px;
  height: 36px;
  font-size: 13px;
}

.avatar-lg {
  width: 48px;
  height: 48px;
  font-size: 16px;
}

.avatar-xl {
  width: 64px;
  height: 64px;
  font-size: 20px;
}

.avatar-group {
  display: flex;
}

.avatar-group .avatar {
  border: 2px solid var(--bg-secondary);
  margin-left: -8px;
}

.avatar-group .avatar:first-child {
  margin-left: 0;
}

/* ==========================================================
   Empty State
   ========================================================== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 24px;
  gap: 16px;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xl);
  background: var(--bg-card);
  color: var(--text-tertiary);
  font-size: 28px;
}

.empty-state-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.empty-state-text {
  font-size: 13.5px;
  color: var(--text-secondary);
  max-width: 360px;
  line-height: 1.5;
}

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

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
}

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

.skeleton-title {
  height: 20px;
  width: 40%;
  margin-bottom: 12px;
}

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

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

/* ==========================================================
   Tooltip
   ========================================================== */
.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 6px 10px;
  font-size: 11.5px;
  font-weight: 500;
  color: #fff;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
  z-index: 600;
}

.tooltip:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.tooltip.tooltip-bottom::after {
  bottom: auto;
  top: calc(100% + 8px);
}

/* ==========================================================
   Tabs
   ========================================================== */
.tabs {
  display: flex;
  align-items: center;
  gap: 0;
  border-bottom: 1px solid var(--border-default);
  overflow-x: auto;
}

.tab {
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  margin-bottom: -1px;
}

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

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

.tab-content {
  padding-top: 20px;
}

/* ==========================================================
   Tags
   ========================================================== */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
}

.tag-removable {
  padding-right: 4px;
}

.tag-remove {
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 10px;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

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

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--accent-blue);
  transition: width var(--transition-slow);
}

.progress-bar-fill.green {
  background: var(--accent-green);
}

.progress-bar-fill.amber {
  background: var(--accent-amber);
}

.progress-bar-fill.red {
  background: var(--accent-red);
}

.progress-bar-fill.solar {
  background: var(--solar-gradient);
}

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

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

/* ==========================================================
   Alerts
   ========================================================== */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  font-size: 13.5px;
  line-height: 1.5;
}

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

.alert-content {
  flex: 1;
}

.alert-title {
  font-weight: 600;
  margin-bottom: 2px;
}

.alert-info {
  background: var(--accent-blue-glow);
  border-color: rgba(59, 130, 246, 0.25);
  color: var(--accent-blue);
}

.alert-success {
  background: var(--accent-green-glow);
  border-color: rgba(16, 185, 129, 0.25);
  color: var(--accent-green);
}

.alert-warning {
  background: var(--accent-amber-glow);
  border-color: rgba(245, 158, 11, 0.25);
  color: var(--accent-amber);
}

.alert-danger {
  background: var(--accent-red-glow);
  border-color: rgba(239, 68, 68, 0.25);
  color: var(--accent-red);
}

/* ==========================================================
   Divider
   ========================================================== */
.divider {
  width: 100%;
  height: 1px;
  background: var(--border-default);
  border: none;
  margin: 16px 0;
}

.divider-vertical {
  width: 1px;
  height: auto;
  align-self: stretch;
  margin: 0 12px;
}

.divider-text {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-tertiary);
  font-size: 12px;
}

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

/* ==========================================================
   Switch / Toggle
   ========================================================== */
.switch {
  position: relative;
  display: inline-flex;
  width: 40px;
  height: 22px;
  cursor: pointer;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.switch-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.switch-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: all var(--transition-fast);
}

.switch input:checked + .switch-slider {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
}

.switch input:checked + .switch-slider::after {
  transform: translateX(18px);
  background: #fff;
}

/* ==========================================================
   Spinner
   ========================================================== */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-default);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner-sm {
  width: 14px;
  height: 14px;
}

.spinner-lg {
  width: 32px;
  height: 32px;
  border-width: 3px;
}

/* ==========================================================
   Status Indicator (online/offline dot)
   ========================================================== */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.status-dot.online {
  background: var(--accent-green);
  box-shadow: 0 0 6px var(--accent-green-glow);
}

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

.status-dot.busy {
  background: var(--accent-red);
}

.status-dot.away {
  background: var(--accent-amber);
}
