/* /assets/js/styles/support.css — mxAURA Support Portal (Dark Theme) */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0B0F19;
  color: #E2E8F0;
  overflow: hidden;
  font-size: 14px;
}

a { text-decoration: none; color: inherit; cursor: pointer; }

/* ═══════════════════════════════════════════════════════════
   TOPBAR
   ═══════════════════════════════════════════════════════════ */

.sp-topbar {
  height: 48px;
  background: #111827;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid #1F2937;
}

.sp-topbar-left { display: flex; align-items: center; gap: 12px; }

.sp-logo { font-size: 22px; font-weight: 700; color: #fff; letter-spacing: -0.3px; line-height: 1; user-select: none; }
.sp-logo-aura { color: #7c3aed; }
.sp-logo-tm { font-size: 9px; font-weight: 500; color: #7c3aed; vertical-align: top; opacity: 0.7; }

.sp-logo-tag {
  font-size: 9px; font-weight: 700; letter-spacing: 2px;
  color: #F59E0B; background: rgba(245, 158, 11, 0.15);
  padding: 2px 8px; border-radius: 4px;
}

.sp-topbar-right { display: flex; align-items: center; gap: 16px; }
.sp-admin-name { font-size: 12px; color: #6B7280; }
.sp-logout-btn {
  background: none; border: 1px solid #374151; color: #9CA3AF; padding: 3px 10px;
  border-radius: 4px; font-size: 11px; cursor: pointer; transition: all 0.15s;
}
.sp-logout-btn:hover { border-color: #6B7280; color: #fff; }

/* ═══════════════════════════════════════════════════════════
   LAYOUT — Sidebar + Main
   ═══════════════════════════════════════════════════════════ */

.sp-layout { display: flex; height: calc(100vh - 48px); }

.sp-sidebar {
  width: 190px; background: #111827; padding: 8px 0;
  display: flex; flex-direction: column; gap: 1px;
  flex-shrink: 0; overflow-y: auto; border-right: 1px solid #1F2937;
}

.sp-nav-link {
  display: flex; align-items: center; gap: 8px; padding: 8px 16px;
  color: #9CA3AF; font-size: 13px; font-weight: 500;
  border-left: 2px solid transparent; transition: all 0.1s;
}
.sp-nav-link:hover { color: #E5E7EB; background: rgba(255,255,255,0.03); }
.sp-nav-link.active { color: #F59E0B; background: rgba(245,158,11,0.08); border-left-color: #F59E0B; }
.sp-nav-link svg { flex-shrink: 0; opacity: 0.7; }
.sp-nav-link.active svg { opacity: 1; }

.sp-main { flex: 1; overflow-y: auto; padding: 24px 28px; }

/* ═══════════════════════════════════════════════════════════
   PAGE ELEMENTS
   ═══════════════════════════════════════════════════════════ */

.sp-page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.sp-page-header h1 { font-size: 20px; font-weight: 700; color: #F3F4F6; }

.sp-back-link { font-size: 11px; color: #F59E0B; display: block; margin-bottom: 4px; }
.sp-back-link:hover { text-decoration: underline; }

.sp-section { margin-top: 28px; }
.sp-section h2 { font-size: 14px; font-weight: 600; color: #9CA3AF; margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.5px; }

.sp-loading { text-align: center; padding: 48px; color: #6B7280; font-size: 14px; }
.sp-empty { text-align: center; padding: 40px; color: #4B5563; font-size: 14px; }
.sp-empty-sm { padding: 16px; color: #4B5563; font-size: 13px; text-align: center; }
.sp-error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); border-radius: 8px; padding: 14px; color: #FCA5A5; font-size: 13px; }
.sp-hint { color: #6B7280; font-size: 13px; padding: 12px 0; }

.sp-text-green { color: #34D399; }
.sp-text-red { color: #F87171; }
.sp-text-muted { color: #6B7280; font-size: 12px; }
.sp-mt-12 { margin-top: 12px; }

/* ═══════════════════════════════════════════════════════════
   METRIC CARDS
   ═══════════════════════════════════════════════════════════ */

.sp-metric-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px; margin-bottom: 24px;
}

.sp-metric-card {
  background: #111827; border: 1px solid #1F2937;
  border-radius: 8px; padding: 12px 16px; text-align: center;
}
.sp-metric-card.sp-metric-ok { border-color: rgba(16,185,129,0.3); }
.sp-metric-card.sp-metric-warn { border-color: rgba(245,158,11,0.3); }
.sp-metric-card.sp-metric-err { border-color: rgba(239,68,68,0.3); }

.sp-metric-value { font-size: 24px; font-weight: 700; color: #F3F4F6; font-family: "JetBrains Mono", monospace; }
.sp-metric-card.sp-metric-ok .sp-metric-value { color: #34D399; }
.sp-metric-card.sp-metric-warn .sp-metric-value { color: #FBBF24; }
.sp-metric-card.sp-metric-err .sp-metric-value { color: #F87171; }
.sp-metric-label { font-size: 10px; font-weight: 600; color: #6B7280; margin-top: 2px; text-transform: uppercase; letter-spacing: 0.5px; }

/* ═══════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════ */

.sp-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }

.sp-card { background: #111827; border: 1px solid #1F2937; border-radius: 8px; padding: 16px; }
.sp-card h3 { font-size: 13px; font-weight: 600; color: #9CA3AF; margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.3px; }

.sp-detail-list { display: flex; flex-direction: column; gap: 8px; }
.sp-detail-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; padding: 6px 0; border-bottom: 1px solid #1F2937;
}
.sp-detail-row:last-child { border-bottom: none; }
.sp-detail-row > span:first-child { color: #6B7280; font-weight: 500; }
.sp-row-error { color: #F87171; }

/* ═══════════════════════════════════════════════════════════
   RESOURCE PILLS
   ═══════════════════════════════════════════════════════════ */

.sp-resource-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.sp-resource-pill {
  display: flex; flex-direction: column; align-items: center;
  padding: 10px; background: #0B0F19; border-radius: 6px; border: 1px solid #1F2937;
}
.sp-resource-count { font-size: 20px; font-weight: 700; color: #F3F4F6; font-family: "JetBrains Mono", monospace; }
.sp-resource-label { font-size: 11px; color: #6B7280; text-align: center; }

/* ═══════════════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════════════ */

.sp-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.sp-table th {
  text-align: left; padding: 8px 10px; font-weight: 600; color: #6B7280;
  border-bottom: 1px solid #1F2937; font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px;
}
.sp-table td { padding: 8px 10px; border-bottom: 1px solid rgba(31,41,55,0.5); vertical-align: middle; color: #D1D5DB; }
.sp-table tbody tr:hover { background: rgba(255,255,255,0.02); }
.sp-table-empty { text-align: center; color: #4B5563; padding: 24px; }
.sp-table-compact td { padding: 5px 8px; font-size: 11px; }
.sp-table-scroll { overflow-x: auto; }

.sp-cell-name { font-weight: 500; color: #E5E7EB; }
.sp-cell-sub { font-size: 11px; color: #6B7280; margin-top: 1px; }
.sp-cell-date { font-size: 11px; color: #6B7280; white-space: nowrap; }
.sp-cell-trunc { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-cell-nowrap { white-space: nowrap; }

.sp-result-count { font-size: 12px; color: #6B7280; margin-bottom: 8px; font-weight: 500; }

/* ═══════════════════════════════════════════════════════════
   BADGES & STATUS
   ═══════════════════════════════════════════════════════════ */

.sp-badge {
  display: inline-block; padding: 2px 7px; border-radius: 10px;
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px;
}
.sp-badge-agency { background: rgba(124,58,237,0.15); color: #A78BFA; }
.sp-badge-company { background: rgba(99,102,241,0.15); color: #A5B4FC; }
.sp-badge-plan { background: rgba(107,114,128,0.2); color: #9CA3AF; }
.sp-badge-role { background: rgba(14,165,233,0.15); color: #38BDF8; }
.sp-badge-success { background: rgba(16,185,129,0.15); color: #34D399; }
.sp-badge-no_message { background: rgba(245,158,11,0.15); color: #FBBF24; }
.sp-badge-error { background: rgba(239,68,68,0.15); color: #F87171; }
.sp-badge-filtered { background: rgba(107,114,128,0.2); color: #9CA3AF; }
.sp-badge-active { background: rgba(16,185,129,0.15); color: #34D399; }
.sp-badge-terminated { background: rgba(239,68,68,0.15); color: #F87171; }
.sp-badge-pending { background: rgba(245,158,11,0.15); color: #FBBF24; }

.sp-status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.sp-dot-green { background: #10B981; box-shadow: 0 0 6px rgba(16,185,129,0.4); }
.sp-dot-red { background: #EF4444; box-shadow: 0 0 6px rgba(239,68,68,0.4); }

/* ═══════════════════════════════════════════════════════════
   CODE
   ═══════════════════════════════════════════════════════════ */

.sp-code { font-family: "JetBrains Mono", monospace; font-size: 11px; background: #1F2937; padding: 2px 6px; border-radius: 4px; color: #9CA3AF; }
.sp-code-lg { font-size: 16px; font-weight: 700; letter-spacing: 2px; padding: 4px 10px; color: #E5E7EB; }
.sp-code-sm { font-size: 10px; }

/* ═══════════════════════════════════════════════════════════
   SEARCH & FILTERS
   ═══════════════════════════════════════════════════════════ */

.sp-search-bar { display: flex; gap: 8px; margin-bottom: 20px; }

.sp-search-input {
  flex: 1; padding: 10px 14px;
  background: #111827; border: 1px solid #1F2937;
  border-radius: 6px; font-size: 14px; color: #E5E7EB; outline: none; transition: border-color 0.2s;
}
.sp-search-input:focus { border-color: #F59E0B; box-shadow: 0 0 0 2px rgba(245,158,11,0.15); }
.sp-search-input::placeholder { color: #4B5563; }

.sp-search-btn {
  padding: 10px 20px; background: #F59E0B; color: #fff; border: none;
  border-radius: 6px; font-weight: 500; cursor: pointer; transition: background 0.15s;
}
.sp-search-btn:hover { background: #D97706; }

.sp-filter-bar { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.sp-filter-input {
  padding: 8px 12px; background: #111827; border: 1px solid #1F2937;
  border-radius: 6px; font-size: 13px; color: #E5E7EB; outline: none; min-width: 140px;
}
.sp-filter-input:focus { border-color: #F59E0B; }
.sp-filter-input::placeholder { color: #4B5563; }
.sp-filter-select {
  padding: 8px 12px; background: #111827; border: 1px solid #1F2937;
  border-radius: 6px; font-size: 13px; color: #E5E7EB; outline: none;
}
.sp-filter-date { width: 150px; }

/* ═══════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════ */

.sp-link-btn { font-size: 12px; color: #F59E0B; font-weight: 500; cursor: pointer; display: inline-block; }
.sp-link-btn:hover { text-decoration: underline; }

.sp-tiny-btn {
  font-size: 11px; color: #F59E0B; background: none;
  border: 1px solid rgba(245,158,11,0.3); border-radius: 4px;
  padding: 2px 8px; cursor: pointer; margin-left: 8px;
}
.sp-tiny-btn:hover { background: rgba(245,158,11,0.1); }

.sp-refresh-btn {
  padding: 5px 12px; background: #1F2937; border: 1px solid #374151;
  border-radius: 6px; font-size: 12px; color: #9CA3AF; cursor: pointer;
}
.sp-refresh-btn:hover { border-color: #6B7280; color: #fff; }

.sp-impersonate-btn {
  padding: 4px 10px; background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.3); border-radius: 4px;
  font-size: 11px; font-weight: 600; color: #FBBF24; cursor: pointer; transition: all 0.15s;
}
.sp-impersonate-btn:hover { background: rgba(245,158,11,0.2); border-color: #F59E0B; }

.sp-btn-warn {
  padding: 8px 18px; background: #F59E0B; color: #fff; border: none;
  border-radius: 6px; font-weight: 600; font-size: 13px; cursor: pointer;
}
.sp-btn-warn:hover { background: #D97706; }
.sp-btn-warn:disabled { opacity: 0.5; cursor: not-allowed; }

.sp-btn-ghost {
  padding: 8px 18px; background: transparent; color: #9CA3AF;
  border: 1px solid #374151; border-radius: 6px; font-size: 13px; cursor: pointer;
}
.sp-btn-ghost:hover { border-color: #6B7280; color: #fff; }

/* ═══════════════════════════════════════════════════════════
   WORKER CHIPS
   ═══════════════════════════════════════════════════════════ */

.sp-worker-grid { display: flex; flex-wrap: wrap; gap: 8px; }

.sp-worker-chip { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 6px; font-size: 12px; }
.sp-chip-ok { background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.25); }
.sp-chip-err { background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.25); }
.sp-chip-gray { background: rgba(107,114,128,0.08); border: 1px solid #1F2937; color: #4B5563; }

.sp-chip-dot { width: 6px; height: 6px; border-radius: 50%; }
.sp-chip-ok .sp-chip-dot { background: #10B981; box-shadow: 0 0 6px rgba(16,185,129,0.4); }
.sp-chip-err .sp-chip-dot { background: #EF4444; box-shadow: 0 0 6px rgba(239,68,68,0.4); }
.sp-chip-gray .sp-chip-dot { background: #374151; }

.sp-chip-name { font-weight: 600; color: #E5E7EB; font-family: "JetBrains Mono", monospace; font-size: 12px; }
.sp-chip-gray .sp-chip-name { color: #4B5563; }
.sp-chip-meta { color: #6B7280; font-size: 11px; }

/* ═══════════════════════════════════════════════════════════
   ACTIVITY LIST
   ═══════════════════════════════════════════════════════════ */

.sp-activity-list { background: #111827; border: 1px solid #1F2937; border-radius: 8px; overflow: hidden; }

.sp-activity-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; font-size: 12px; border-bottom: 1px solid rgba(31,41,55,0.5);
}
.sp-activity-row:last-child { border-bottom: none; }
.sp-activity-type { font-weight: 600; color: #9CA3AF; min-width: 140px; font-family: "JetBrains Mono", monospace; font-size: 11px; }
.sp-activity-desc { flex: 1; color: #6B7280; }
.sp-activity-date { color: #4B5563; font-size: 11px; white-space: nowrap; }

/* ═══════════════════════════════════════════════════════════
   QUICK ACTIONS
   ═══════════════════════════════════════════════════════════ */

.sp-quick-actions { display: flex; gap: 12px; }

.sp-action-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 20px; background: #111827; border: 1px solid #1F2937;
  border-radius: 8px; font-size: 13px; font-weight: 500; color: #9CA3AF; cursor: pointer; transition: all 0.15s;
}
.sp-action-btn:hover { border-color: #F59E0B; color: #F59E0B; background: rgba(245,158,11,0.05); }

/* ═══════════════════════════════════════════════════════════
   ALERTS
   ═══════════════════════════════════════════════════════════ */

.sp-alert { padding: 10px 14px; border-radius: 8px; font-size: 12px; margin-bottom: 12px; }
.sp-alert-error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: #FCA5A5; }

/* ═══════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════ */

.sp-modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 10000;
}

.sp-modal {
  background: #111827; border: 1px solid #1F2937; border-radius: 12px;
  width: 440px; max-width: 90vw; box-shadow: 0 20px 60px rgba(0,0,0,0.5); overflow: hidden;
}

.sp-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid #1F2937;
}
.sp-modal-header h3 { font-size: 15px; font-weight: 600; color: #F3F4F6; margin: 0; }
.sp-modal-header-warn { background: rgba(245,158,11,0.1); border-bottom-color: rgba(245,158,11,0.3); }
.sp-modal-header-warn h3 { color: #FBBF24; }

.sp-modal-close {
  background: none; border: none; font-size: 20px; color: #6B7280; cursor: pointer;
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 4px;
}
.sp-modal-close:hover { background: #1F2937; color: #E5E7EB; }

.sp-modal-body { padding: 20px; }
.sp-modal-body p { font-size: 13px; color: #9CA3AF; line-height: 1.6; margin: 0 0 12px; }
.sp-modal-note { font-size: 12px; color: #4B5563; }

.sp-modal-field { margin-top: 16px; }
.sp-modal-field label { display: block; font-size: 12px; font-weight: 600; color: #6B7280; margin-bottom: 6px; }
.sp-modal-input {
  width: 100%; padding: 8px 12px; background: #0B0F19; border: 1px solid #1F2937;
  border-radius: 6px; font-size: 16px; font-weight: 600; letter-spacing: 4px;
  text-align: center; color: #E5E7EB; outline: none;
}
.sp-modal-input:focus { border-color: #F59E0B; }

.sp-modal-error {
  background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3);
  border-radius: 6px; padding: 8px 12px; margin-top: 12px; color: #FCA5A5; font-size: 12px;
}

.sp-modal-footer { display: flex; gap: 8px; padding: 14px 20px; border-top: 1px solid #1F2937; }

/* ═══════════════════════════════════════════════════════════
   LOGIN
   ═══════════════════════════════════════════════════════════ */

.sp-login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #0B0F19; }

.sp-login-card {
  background: #111827; border: 1px solid #1F2937; border-radius: 12px;
  padding: 36px; width: 380px; max-width: 90vw;
}

.sp-login-logo { font-size: 26px; font-weight: 700; color: #F3F4F6; text-align: center; margin-bottom: 4px; }
.sp-login-tag { text-align: center; font-size: 9px; font-weight: 700; letter-spacing: 3px; color: #F59E0B; margin-bottom: 28px; }

.sp-login-field { margin-bottom: 14px; }
.sp-login-field label { display: block; font-size: 12px; font-weight: 500; color: #6B7280; margin-bottom: 5px; }
.sp-login-field input {
  width: 100%; padding: 9px 12px; background: #0B0F19; border: 1px solid #1F2937;
  border-radius: 6px; color: #E5E7EB; font-size: 14px; outline: none;
}
.sp-login-field input:focus { border-color: #F59E0B; }
.sp-login-field input::placeholder { color: #4B5563; }

.sp-login-btn {
  width: 100%; padding: 9px; background: #F59E0B; color: #fff; border: none;
  border-radius: 6px; font-size: 14px; font-weight: 600; cursor: pointer; margin-top: 6px;
}
.sp-login-btn:hover { background: #D97706; }
.sp-login-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.sp-login-error {
  background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3);
  border-radius: 6px; padding: 10px; color: #FCA5A5; font-size: 12px; margin-bottom: 14px;
}

.sp-login-note { text-align: center; font-size: 11px; color: #4B5563; margin-top: 14px; }

/* ── Build version under the logo ─────────────────────────────────────── */

.sp-logo-stack { display: flex; flex-direction: column; gap: 1px; }

.sp-app-version {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.4);
  font-variant-numeric: tabular-nums;
  user-select: none;
  line-height: 1;
  min-height: 10px;
}
