/* ============================================================
   ALP Components CSS — components.css
   Vercel & Firebase Dashboard UI Component Styles
   ============================================================ */

/* ── Smart Card Shadows (applies app-wide to every card class) ─
   Layered ambient + contact + gold-tint on lift. Any element that
   opts in gets a "floating" premium feel without per-page tweaks.
   The class list catches the actual card containers used across
   the app so we don't apply the shadow to buttons/inputs/etc. */
.card,
.session-card,
.dp-site-card,
.dp-card,
.dp-st-card,
.dp-list-row,
.stat-card,
.stat-card-mini,
.stat-tile,
.infra-tile,
.website-card,
.bin-details,
.bin-cc,
.bin-history-panel,
.cc-input-panel,
.cc-stat,
.cc-row,
.log-term,
.notif-dropdown,
.danger-dropdown,
.captured-card,
.logs-total-pill,
.filter-bar,
.wdw-shell,
.premium-card {
  box-shadow: var(--shadow-card);
  transition: transform var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out),
              border-color var(--duration-normal) var(--ease-out);
}
.card:hover,
.session-card:hover,
.dp-site-card:hover,
.dp-card:hover,
.dp-st-card:hover,
.dp-list-row:hover,
.stat-card:hover,
.stat-card-mini:hover,
.infra-tile:hover,
.website-card:hover,
.bin-details:hover,
.bin-cc:hover,
.bin-history-panel:hover,
.cc-input-panel:hover,
.cc-stat:hover,
.cc-row:hover,
.captured-card:hover,
.premium-card:hover {
  box-shadow: var(--shadow-card-lift);
}
/* Slight lift on the interactive cards only — don't move dropdowns/panels. */
.card:hover,
.session-card:hover,
.dp-site-card:hover,
.dp-card:hover,
.dp-st-card:hover,
.stat-card:hover,
.stat-card-mini:hover,
.infra-tile:hover,
.website-card:hover,
.captured-card:hover {
  transform: translateY(-3px);
}
/* Terminals, dropdowns, filter bars: no vertical drift (they're anchored) */
.log-term, .notif-dropdown, .danger-dropdown, .filter-bar,
.log-term:hover, .notif-dropdown:hover, .danger-dropdown:hover, .filter-bar:hover {
  transform: none;
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-card);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.3), transparent);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.card:hover {
  border-color: rgba(212, 175, 55, 0.25);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  background: var(--bg-hover);
}

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

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

.card-header h3 {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin: 0;
}

.card-title {
  font-size: var(--text-md);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.card-subtitle {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 40px;
  padding: 0 var(--space-5);
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-base);
  -webkit-user-select: none;
  user-select: none;
  background: none;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255,255,255,0.1), transparent 70%);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

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

.btn-primary {
  background: var(--gradient-primary);
  color: #0a0a0a;
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  filter: brightness(1.15);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border-primary);
  color: var(--text-primary);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(212, 175, 55, 0.35);
  color: var(--text-primary);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.1);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  filter: brightness(1.15);
}

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

.btn-ghost:hover {
  background: rgba(212, 175, 55, 0.07);
  color: var(--text-primary);
  border-color: rgba(212, 175, 55, 0.2);
}

.btn-sm {
  height: 32px;
  padding: 0 var(--space-3);
  font-size: 13px;
}

.btn-lg {
  height: 48px;
  padding: 0 var(--space-6);
  font-size: var(--text-md);
}

.btn-icon {
  width: 40px;
  padding: 0;
}

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

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
  filter: none !important;
}

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 11px;
  font-weight: var(--font-semibold);
  line-height: 1;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.badge-success {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.2);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.08);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.2);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.08);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.2);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.08);
}

.badge-info {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.2);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.08);
}

.badge-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border-primary);
}

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

.form-group label {
  display: block;
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
  letter-spacing: 0.01em;
}

.input, .select, .form-select, .textarea {
  width: 100%;
  height: 40px;
  padding: 0 var(--space-4);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-family: inherit;
  transition: all var(--transition-base);
  outline: none;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

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

.input:hover, .select:hover, .form-select:hover, .textarea:hover {
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.03);
}

.input:focus, .select:focus, .form-select:focus, .textarea:focus {
  border-color: var(--accent-primary);
  background: rgba(212, 175, 55, 0.03);
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.08), inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.input:disabled, .select:disabled, .form-select:disabled, .textarea:disabled {
  opacity: 0.5;
  background: rgba(255, 255, 255, 0.01);
  cursor: not-allowed;
}

select, .select, .form-select {
  color-scheme: dark;
}

[data-theme='light'] select,
[data-theme='light'] .select,
[data-theme='light'] .form-select {
  color-scheme: light;
}

.select, .form-select {
  appearance: none;
  cursor: pointer;
  padding-right: var(--space-8) !important;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  transition: all var(--transition-base);
}

.select:focus, .form-select:focus,
.select:hover, .form-select:hover {
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23D4AF37' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
}

select option, .select option, .form-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.textarea {
  height: auto;
  min-height: 100px;
  padding: var(--space-3);
  resize: vertical;
  line-height: var(--leading-relaxed);
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
}

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--border-primary);
  border-radius: var(--radius-pill);
  transition: .2s;
  border: 1px solid var(--border-primary);
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: var(--text-secondary);
  border-radius: 50%;
  transition: .2s;
}

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

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(16px);
  background-color: #ffffff;
}

/* ── Data Tables ──────────────────────────────────────────── */
.table-container {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  background: rgba(22, 22, 42, 0.40);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: var(--text-sm);
}

.data-table th {
  padding: var(--space-4) var(--space-4);
  font-weight: var(--font-semibold);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-primary);
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.04), transparent);
  white-space: nowrap;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.05em;
}

.data-table td {
  padding: var(--space-4) var(--space-4);
  color: var(--text-primary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  white-space: nowrap;
}

.data-table tbody tr {
  transition: all var(--transition-fast);
  position: relative;
}

.data-table tbody tr::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 100%;
  background: var(--accent-primary);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

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

.data-table tbody tr:hover {
  background: rgba(212, 175, 55, 0.04);
}

.data-table tbody tr:hover::before {
  opacity: 1;
}

/* ── Avatars ──────────────────────────────────────────────── */
.avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: #ffffff;
  flex-shrink: 0;
  -webkit-user-select: none;
  user-select: none;
}

/* ── Pulse Indicator ──────────────────────────────────────── */
.pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--color-success);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
  animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* ── Tabs ─────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: var(--space-1);
  border-bottom: 1px solid var(--border-primary);
  margin-bottom: var(--space-5);
  overflow-x: auto;
}

.tab {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
  -webkit-user-select: none;
  user-select: none;
}

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

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

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

.empty-state-icon {
  font-size: 40px;
  margin-bottom: var(--space-4);
  opacity: 0.6;
}

.empty-state h3 {
  font-size: var(--text-md);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.empty-state p {
  font-size: var(--text-sm);
  color: var(--text-muted);
  max-width: 320px;
  margin: 0;
}

/* ── Loading Skeleton ─────────────────────────────────────── */
.skeleton {
  background: var(--border-primary);
  background-image: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0.05),
    rgba(255, 255, 255, 0)
  );
  background-size: 200px 100%;
  background-repeat: no-repeat;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

/* ── Custom ALP Dropdown ──────────────────────────────────── */
.alp-dropdown {
  position: relative;
  display: inline-block;
  min-width: 180px;
  font-family: var(--font-sans);
  user-select: none;
}
.alp-dropdown.w-full {
  width: 100%;
  display: block;
}
.alp-dropdown-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px var(--space-4) 8px var(--space-3);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  cursor: pointer;
  transition: all var(--transition-base);
  height: 38px;
  width: 100%;
  box-sizing: border-box;
}
.alp-dropdown-trigger:hover {
  border-color: var(--border-hover);
  background: var(--bg-hover);
}
.alp-dropdown-trigger:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-ring);
  outline: none;
}
.alp-dropdown-trigger-content {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.alp-dropdown-logo {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  object-fit: contain;
  flex-shrink: 0;
}
.alp-dropdown-avatar {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.alp-dropdown-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
  text-align: left;
}
.alp-dropdown-arrow {
  color: var(--text-secondary);
  transition: transform var(--transition-base);
  flex-shrink: 0;
}
.alp-dropdown.open .alp-dropdown-arrow {
  transform: rotate(180deg);
}
.alp-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown);
  display: none;
  max-height: 260px;
  overflow-y: auto;
  margin: 0;
  padding: var(--space-1) 0;
  list-style: none;
  animation: dropdownFadeIn 0.2s var(--ease-out) both;
}
.alp-dropdown.open .alp-dropdown-menu {
  display: block;
}
@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.alp-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px var(--space-3);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  color: var(--text-secondary);
  font-size: var(--text-sm);
}
.alp-dropdown-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.alp-dropdown-item.selected {
  background: var(--accent-primary-muted);
  color: var(--accent-primary-hover);
  font-weight: var(--font-semibold);
}
.alp-dropdown-item-logo {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  object-fit: contain;
  flex-shrink: 0;
}
.alp-dropdown-item-avatar {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.alp-dropdown-item-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.alp-dropdown-item-name {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}
.alp-dropdown-item-domain {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
  text-align: left;
}

/* ── Tab Strip (sub-tabs inside pages / drawers) ─────────────── */
.alp-tabs { display: block; }

.alp-tabs-bar {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin: 0 0 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.06));
  border-radius: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.alp-tabs-bar::-webkit-scrollbar { display: none; }

.alp-tab {
  flex: 1 1 auto;
  min-width: max-content;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  background: transparent;
  border: 0;
  border-radius: 7px;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}
.alp-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}
.alp-tab.active {
  color: var(--text-primary);
  background: var(--bg-secondary, rgba(255, 255, 255, 0.08));
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.alp-tab-icon { display: inline-flex; }
.alp-tab-icon svg { display: block; }

.alp-tab-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  margin-left: 2px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  border-radius: 9px;
}
.alp-tab.active .alp-tab-pill {
  background: var(--accent-primary, #D4AF37);
  color: #0b0a06;
}

.alp-tab-panel { display: none; animation: alpTabFade 0.18s ease both; }
.alp-tab-panel.active { display: block; }

@keyframes alpTabFade {
  from { opacity: 0; transform: translateY(2px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Compact variant — tighter, borderless bar (for cramped drawers) */
.alp-tabs--compact > .alp-tabs-bar {
  background: transparent;
  border: 0;
  padding: 0;
  border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  border-radius: 0;
  gap: 0;
  margin-bottom: 12px;
}
.alp-tabs--compact > .alp-tabs-bar > .alp-tab {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.alp-tabs--compact > .alp-tabs-bar > .alp-tab.active {
  background: transparent;
  box-shadow: none;
  color: var(--accent-primary, #D4AF37);
  border-bottom-color: var(--accent-primary, #D4AF37);
}

/* Pill variant — rounded pills, standalone tab-bar */
.alp-tabs--pill > .alp-tabs-bar {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}
.alp-tabs--pill > .alp-tabs-bar > .alp-tab {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 6px 14px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Reusable primitives (AlpEmpty, AlpCallout, AlpKV, AlpLiveDot,
   AlpSectionHeader, AlpStats, AlpSearchInput, AlpPasswordInput,
   AlpConfirm, AlpTerminal)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── AlpEmpty ────────────────────────────────────────────── */
.alp-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 32px 20px; color: var(--text-secondary);
  gap: 8px;
}
.alp-empty-icon { font-size: 32px; color: var(--text-muted); margin-bottom: 4px; }
.alp-empty-spinner {
  width: 26px; height: 26px; border: 2px solid rgba(255,255,255,0.08);
  border-top-color: var(--accent-primary, #D4AF37); border-radius: 50%;
  animation: alpSpin 0.9s linear infinite; margin-bottom: 8px;
}
@keyframes alpSpin { to { transform: rotate(360deg); } }
.alp-empty-title { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.alp-empty-sub   { font-size: 12px; color: var(--text-secondary); line-height: 1.5; max-width: 360px; }
.alp-empty-action { margin-top: 10px; }

/* ── AlpCallout ──────────────────────────────────────────── */
.alp-callout {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px; border-radius: 10px; margin: 0 0 12px;
  border: 1px solid transparent;
}
.alp-callout-icon { flex: 0 0 auto; display: inline-flex; margin-top: 1px; }
.alp-callout-content { flex: 1; min-width: 0; }
.alp-callout-title { font-size: 12.5px; font-weight: 700; margin-bottom: 3px; }
.alp-callout-body  { font-size: 12px; line-height: 1.55; }
.alp-callout-action { margin-top: 10px; }

.alp-callout--info    { background: rgba(59,130,246,0.08);  border-color: rgba(59,130,246,0.22);  color: #93c5fd; }
.alp-callout--warning { background: rgba(245,158,11,0.08);  border-color: rgba(245,158,11,0.25);  color: #fbbf24; }
.alp-callout--danger  { background: rgba(239,68,68,0.08);   border-color: rgba(239,68,68,0.25);   color: #f87171; }
.alp-callout--success { background: rgba(16,185,129,0.08);  border-color: rgba(16,185,129,0.25);  color: #34d399; }
.alp-callout .alp-callout-title { color: currentColor; }
.alp-callout .alp-callout-body  { color: var(--text-primary); }

/* ── AlpKV ────────────────────────────────────────────────── */
.alp-kv {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 7px 0; border-bottom: 1px dashed rgba(255,255,255,0.06);
  font-size: 12px;
}
.alp-kv:last-child { border-bottom: 0; }
.alp-kv-k { color: var(--text-secondary); }
.alp-kv-v { color: var(--text-primary); font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.alp-kv-v--mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11.5px; font-weight: 500; }

/* ── AlpLiveDot ──────────────────────────────────────────── */
.alp-livedot {
  display: inline-block; border-radius: 50%; flex-shrink: 0;
  transition: background 0.15s ease;
}
.alp-livedot--online   { background: #10b981; animation: alpDotPulse 1.6s ease-in-out infinite; }
.alp-livedot--offline  { background: #6b7280; }
.alp-livedot--warning  { background: #f59e0b; }
.alp-livedot--danger   { background: #ef4444; animation: alpDotPulse 1.2s ease-in-out infinite; }
.alp-livedot--neutral  { background: #64748b; }
@keyframes alpDotPulse {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%      { opacity: 0.6; transform: scale(1.15); }
}

/* ── AlpSectionHeader ───────────────────────────────────── */
.alp-secthdr {
  display: flex; align-items: center; gap: 10px; margin: 20px 0 10px;
}
.alp-secthdr-icon {
  width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; flex-shrink: 0;
}
.alp-secthdr-title {
  font-size: 13px; font-weight: 700; color: var(--text-primary); margin: 0;
  letter-spacing: -.01em;
}
.alp-secthdr-action { margin-left: auto; }

/* ── AlpStats ────────────────────────────────────────────── */
.alp-stats-grid {
  display: grid; gap: 12px; margin-bottom: 20px;
}
.alp-stat-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; background: var(--bg-secondary);
  border: 1px solid var(--border-color, rgba(255,255,255,0.06));
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.alp-stat-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-card-lift); }
.alp-stat-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.alp-stat-body { flex: 1; min-width: 0; }
.alp-stat-value {
  font-size: 22px; font-weight: 800; line-height: 1.1;
  letter-spacing: -0.02em;
}
.alp-stat-label {
  font-size: 11px; font-weight: 600; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.4px; margin-top: 3px;
}
.alp-stat-sub { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.alp-stat-delta {
  font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px;
  display: inline-flex; align-items: center;
}
.alp-stat-delta--up   { background: rgba(16,185,129,0.14); color: #34d399; }
.alp-stat-delta--down { background: rgba(239,68,68,0.14);  color: #f87171; }
.alp-stat-delta--flat { background: rgba(107,114,128,0.14); color: #9ca3af; }

/* ── AlpSearchInput ─────────────────────────────────────── */
.alp-search {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px; background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-color, rgba(255,255,255,0.08));
  border-radius: 8px; min-width: 220px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.alp-search:focus-within {
  border-color: var(--accent-primary, #D4AF37);
  background: rgba(255,255,255,0.06);
}
.alp-search-icon { color: var(--text-muted); display: inline-flex; }
.alp-search-input {
  flex: 1; background: transparent; border: 0; outline: none;
  color: var(--text-primary); font-size: 12.5px; font-family: inherit;
  padding: 2px 0; min-width: 0;
}
.alp-search-input::placeholder { color: var(--text-muted); }
.alp-search-clear {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 4px; border: 0;
  background: rgba(255,255,255,0.06); color: var(--text-secondary);
  cursor: pointer; transition: background 0.12s;
}
.alp-search-clear:hover { background: rgba(255,255,255,0.12); color: var(--text-primary); }
.alp-search-count {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  padding: 2px 8px; background: rgba(255,255,255,0.06); border-radius: 999px;
  align-items: center;
}

/* ── AlpPasswordInput ───────────────────────────────────── */
.alp-pass {
  display: inline-flex; align-items: stretch; gap: 6px; width: 100%;
}
.alp-pass-input {
  flex: 1; padding: 10px 14px; background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-color, rgba(255,255,255,0.08));
  border-radius: 8px; color: var(--text-primary); font-size: 13px;
  outline: none; transition: border-color 0.2s;
}
.alp-pass-input:focus {
  border-color: var(--accent-primary, #D4AF37);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}
.alp-pass-toggle {
  padding: 0 12px; background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-color, rgba(255,255,255,0.08));
  border-radius: 8px; color: var(--text-secondary);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.alp-pass-toggle:hover { background: rgba(255,255,255,0.12); color: var(--text-primary); }

/* ── AlpConfirm ─────────────────────────────────────────── */
.alp-confirm-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(2px);
  animation: alpConfirmIn 0.16s ease both;
}
.alp-confirm-out { animation: alpConfirmOut 0.14s ease both; }
@keyframes alpConfirmIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes alpConfirmOut { from { opacity: 1; } to { opacity: 0; } }

.alp-confirm-modal {
  min-width: 320px; max-width: 460px; margin: 20px;
  background: var(--bg-secondary, #1a1a1a);
  border: 1px solid var(--border-color, rgba(255,255,255,0.1));
  border-radius: 14px; padding: 22px 22px 18px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
  animation: alpConfirmPop 0.18s cubic-bezier(0.34,1.56,0.64,1) both;
}
.alp-confirm-modal--danger  { border-top: 3px solid #ef4444; }
.alp-confirm-modal--warning { border-top: 3px solid #f59e0b; }
.alp-confirm-modal--info    { border-top: 3px solid #3b82f6; }
@keyframes alpConfirmPop {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.alp-confirm-title { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.alp-confirm-body  { font-size: 13px; color: var(--text-secondary); line-height: 1.55; margin-bottom: 16px; }
.alp-confirm-actions { display: flex; gap: 8px; justify-content: flex-end; }
.alp-confirm-btn {
  padding: 8px 16px; font-size: 12.5px; font-weight: 600; font-family: inherit;
  border-radius: 8px; border: 1px solid var(--border-color, rgba(255,255,255,0.1));
  background: rgba(255,255,255,0.04); color: var(--text-primary);
  cursor: pointer; transition: background 0.12s, transform 0.05s;
}
.alp-confirm-btn:hover  { background: rgba(255,255,255,0.08); }
.alp-confirm-btn:active { transform: scale(0.98); }
.alp-confirm-btn:focus  { outline: 2px solid var(--accent-primary, #D4AF37); outline-offset: 1px; }
.alp-confirm-btn--danger  { background: #ef4444; border-color: #ef4444; color: #fff; }
.alp-confirm-btn--danger:hover  { background: #dc2626; }
.alp-confirm-btn--warning { background: #f59e0b; border-color: #f59e0b; color: #0b0a06; }
.alp-confirm-btn--warning:hover { background: #d97706; color: #fff; }
.alp-confirm-btn--info    { background: #3b82f6; border-color: #3b82f6; color: #fff; }
.alp-confirm-btn--info:hover    { background: #2563eb; }

/* ── AlpTerminal ────────────────────────────────────────── */
.alp-term {
  background: #0a0e17;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  overflow: hidden;
}
.alp-term-hdr {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: rgba(0,0,0,0.3);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.alp-term-dots { display: flex; gap: 6px; }
.alp-term-dot  { width: 11px; height: 11px; border-radius: 50%; }
.alp-term-title {
  flex: 1; text-align: center;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11.5px; color: rgba(255,255,255,0.55);
}
.alp-term-status {
  width: 8px; height: 8px; border-radius: 50%;
}
.alp-term-status--pulse { animation: alpTermBlink 1s ease-in-out infinite; }
@keyframes alpTermBlink { 50% { opacity: 0.35; } }

.alp-term-main { display: grid; grid-template-columns: 1fr; min-height: 220px; }
.alp-term-main.has-steps { grid-template-columns: 220px 1fr; }
.alp-term-steps {
  padding: 14px 12px; background: rgba(0,0,0,0.2);
  border-right: 1px solid rgba(255,255,255,0.04);
  display: flex; flex-direction: column; gap: 4px;
  font-size: 11.5px;
}
.alp-term-step {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 6px;
  color: rgba(255,255,255,0.5);
}
.alp-term-step-icon {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,0.25); flex-shrink: 0;
}
.alp-term-step-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alp-term-step--running { color: #fbbf24; background: rgba(245,158,11,0.08); }
.alp-term-step--running .alp-term-step-icon { background: #fbbf24; animation: alpTermBlink 1s infinite; }
.alp-term-step--done { color: #34d399; }
.alp-term-step--done .alp-term-step-icon { background: #34d399; }
.alp-term-step--error { color: #f87171; }
.alp-term-step--error .alp-term-step-icon { background: #ef4444; }
.alp-term-step--warn { color: #fbbf24; }
.alp-term-step--warn .alp-term-step-icon { background: #f59e0b; }

.alp-term-log {
  padding: 14px 16px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11.5px; line-height: 1.7;
  color: rgba(255,255,255,0.72);
  overflow-y: auto; max-height: 420px;
  white-space: pre-wrap; word-break: break-word;
  background: rgba(8,8,16,0.6);
}
.alp-term-line { padding: 1px 0; }
.alp-term-line--warn  { color: #fbbf24; }
.alp-term-line--error { color: #f87171; }
.alp-term-line--ok    { color: #34d399; }

.alp-term-summary {
  padding: 10px 14px; background: rgba(0,0,0,0.2);
  border-top: 1px solid rgba(255,255,255,0.05);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11.5px; color: rgba(255,255,255,0.65);
}
