/* ============================================================
   SIPGN-SIPHR DASHBOARD — Global Styles
   ============================================================ */

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-bg: #090d1a;
  --color-surface: #0f1629;
  --color-surface-2: #151d35;
  --color-surface-3: #1a243e;
  --color-border: rgba(99, 120, 180, 0.15);
  --color-border-hover: rgba(99, 120, 180, 0.35);

  --color-primary: #3b82f6;
  --color-primary-hover: #2563eb;
  --color-primary-glow: rgba(59, 130, 246, 0.25);
  --color-secondary: #6366f1;
  --color-accent: #22d3ee;

  --color-green: #22c55e;
  --color-green-bg: rgba(34, 197, 94, 0.1);
  --color-blue: #3b82f6;
  --color-blue-bg: rgba(59, 130, 246, 0.1);
  --color-purple: #a855f7;
  --color-purple-bg: rgba(168, 85, 247, 0.1);
  --color-orange: #f97316;
  --color-orange-bg: rgba(249, 115, 22, 0.1);
  --color-red: #ef4444;
  --color-red-bg: rgba(239, 68, 68, 0.1);
  --color-yellow: #eab308;
  --color-yellow-bg: rgba(234, 179, 8, 0.1);

  --color-text: #e2e8f0;
  --color-text-muted: #64748b;
  --color-text-subtle: #94a3b8;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --shadow-glow: 0 0 30px rgba(59, 130, 246, 0.15);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);

  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background-color: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(59, 130, 246, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 110%, rgba(99, 102, 241, 0.06) 0%, transparent 60%);
}

/* ── Header ───────────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 13, 26, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.5));
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.logo-sub {
  font-size: 11px;
  color: var(--color-text-muted);
  font-weight: 400;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 6px 14px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-text-muted);
  transition: var(--transition);
}

.status-dot.online {
  background: var(--color-green);
  box-shadow: 0 0 8px var(--color-green);
  animation: pulse 2s infinite;
}

.status-dot.error {
  background: var(--color-red);
  box-shadow: 0 0 8px var(--color-red);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.status-text {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-subtle);
}

/* ── Main Layout ──────────────────────────────────────────── */
.main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  position: relative;
}

/* ── Sections ─────────────────────────────────────────────── */
.section {
  animation: fadeInUp 0.4s ease both;
}

.dashboard-section {
  display: none;
}

.dashboard-section.active {
  display: block;
}

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

.section-header {
  margin-bottom: 28px;
}

.step-badge {
  display: inline-flex;
  align-items: center;
  background: var(--color-primary-glow);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: var(--color-primary);
  border-radius: var(--radius-full);
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.section-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.section-desc {
  font-size: 14px;
  color: var(--color-text-muted);
  max-width: 560px;
  line-height: 1.7;
}

/* ── Login Card ───────────────────────────────────────────── */
.login-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 28px 28px 24px;
  max-width: 540px;
  margin: 0 auto;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

/* ── Step Row & Pill ──────────────────────────────────────── */
.step-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.step-pill {
  display: inline-flex;
  align-items: center;
  background: var(--color-primary-glow);
  border: 1px solid rgba(59,130,246,0.3);
  color: var(--color-primary);
  border-radius: var(--radius-full);
  padding: 3px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.step-pill-green {
  background: var(--color-green-bg);
  border-color: rgba(34,197,94,0.3);
  color: var(--color-text-muted);
}

.step-pill-success {
  background: var(--color-green-bg);
  border-color: rgba(34,197,94,0.4);
  color: var(--color-green) !important;
}

/* ── Bookmarklet Button ───────────────────────────────────── */
.btn-bookmarklet {
  background: linear-gradient(135deg, #1e3a5f, #2563eb);
  color: white;
  border: none;
  padding: 16px 20px !important;
  font-size: 16px !important;
  font-weight: 700;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px rgba(37,99,235,0.35);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 4px;
}

.btn-bookmarklet:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(37,99,235,0.45);
  color: white;
}

.btn-bookmarklet-install {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 13px;
  cursor: grab;
  border: 2px dashed var(--color-border-hover) !important;
  background: var(--color-surface-2) !important;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--color-text);
}

.btn-bookmarklet-install:hover {
  border-color: var(--color-primary) !important;
  color: var(--color-primary);
}

/* ── Hint Text ─────────────────────────────────────────────── */
.hint-text {
  font-size: 12px;
  color: var(--color-text-muted);
  text-align: center;
}

/* ── Collapsible Manual Details ───────────────────────────── */
.manual-details {
  margin-top: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.manual-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  background: var(--color-surface-2);
  user-select: none;
  list-style: none;
}

.manual-summary:hover { color: var(--color-text); }
.manual-summary::-webkit-details-marker { display: none; }

.manual-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  border-top: 1px solid var(--color-border);
}

.manual-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.manual-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
}

.badge-letter {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-primary);
  color: white;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.manual-desc {
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.6;
}

.manual-steps {
  padding-left: 18px;
  font-size: 13px;
  color: var(--color-text-subtle);
  display: flex;
  flex-direction: column;
  gap: 6px;
  line-height: 1.6;
}



.login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary), var(--color-accent));
}

.login-card-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  background: var(--color-primary-glow);
  border: 1px solid rgba(59,130,246,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  margin: 0 auto 20px;
}

.login-card-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--color-text);
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.login-card-desc {
  font-size: 13px;
  color: var(--color-text-muted);
  text-align: center;
  margin-bottom: 28px;
  line-height: 1.6;
}

/* ── Form Elements ────────────────────────────────────────── */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--color-text-muted);
  pointer-events: none;
  flex-shrink: 0;
}

.form-input {
  width: 100%;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px 16px 12px 42px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--color-text);
  outline: none;
  transition: var(--transition);
}

.form-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-glow);
}

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

.toggle-password {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  padding: 4px;
  display: flex;
  align-items: center;
  transition: var(--transition);
}

.toggle-password:hover { color: var(--color-text); }

/* ── Login Error ──────────────────────────────────────────── */
.form-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--color-red-bg);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--color-red);
  margin-bottom: 16px;
}

/* ── Block Button ─────────────────────────────────────────── */
.btn-block {
  width: 100%;
  justify-content: center;
  padding: 14px !important;
  font-size: 15px !important;
}

/* ── Divider ──────────────────────────────────────────────── */
.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  font-size: 12px;
  color: var(--color-text-muted);
}

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

/* ── Spin animation for loading button ────────────────────── */
.spin {
  animation: spin 0.8s linear infinite;
}

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



/* ── Mode Tabs ────────────────────────────────────────────── */
.mode-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 6px;
}

.mode-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  background: transparent;
  cursor: pointer;
  transition: var(--transition);
}

.mode-tab:hover {
  background: var(--color-surface-2);
  color: var(--color-text);
}

.mode-tab.active {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: white;
  box-shadow: 0 2px 12px rgba(59,130,246,0.3);
}

/* ── Login Toolbar (updated) ───────────────────────────────── */
.login-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--color-surface-2);
  border-bottom: 1px solid var(--color-border);
}

.toolbar-url {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-muted);
}

.url-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.url-dot-green {
  background: var(--color-green);
  box-shadow: 0 0 6px var(--color-green);
  animation: pulse 2s infinite;
}

.url-text { font-family: 'Courier New', monospace; }

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Iframe Loading ───────────────────────────────────────── */
.iframe-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--color-surface-2);
  border-bottom: 1px solid var(--color-border);
  font-size: 13px;
  color: var(--color-text-muted);
  transition: var(--transition);
}

.iframe-loading.hidden { display: none; }

.spinner-sm {
  width: 16px;
  height: 16px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ── Iframe Wrapper ───────────────────────────────────────── */
.iframe-wrapper {
  position: relative;
  height: 480px;
}



/* ── Proxy Status Bar ─────────────────────────────────────── */
.proxy-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-top: 16px;
  gap: 16px;
}

.proxy-status-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  position: relative;
}

.proxy-status-indicator.detected {
  color: var(--color-green);
}

.pulse-ring {
  position: absolute;
  left: -4px;
  top: -4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--color-primary);
  opacity: 0;
  animation: pulseRing 2s ease-out infinite;
}

@keyframes pulseRing {
  0%   { transform: scale(0.6); opacity: 0.8; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* ── Proxy Info Box ───────────────────────────────────────── */
.proxy-info-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--color-primary-glow);
  border: 1px solid rgba(59,130,246,0.25);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--color-text-subtle);
  line-height: 1.6;
}

/* ── Link style ───────────────────────────────────────────── */
.link {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.link:hover { color: var(--color-accent); }

#loginFrame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ── Cookie Section ───────────────────────────────────────── */
.cookie-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Login Step Cards ─────────────────────────────────────── */
.login-step-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 24px 28px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}

.login-step-card:hover {
  border-color: var(--color-border-hover);
  box-shadow: var(--shadow-lg);
}

.login-step-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: white;
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.login-step-body {
  flex: 1;
}

.login-step-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 6px;
}

.login-step-desc {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 14px;
}

.cookie-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.cookie-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--color-primary-glow);
  border: 1px solid rgba(59, 130, 246, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  flex-shrink: 0;
}

.cookie-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 4px;
}

.cookie-desc {
  font-size: 13px;
  color: var(--color-text-muted);
}

.cookie-guide {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
}

.guide-step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--color-text-subtle);
}

.guide-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-primary);
  color: white;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

kbd {
  background: var(--color-surface-3);
  border: 1px solid var(--color-border-hover);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: monospace;
  font-size: 12px;
  color: var(--color-text);
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.input-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-subtle);
}

.cookie-input {
  width: 100%;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: var(--color-text);
  resize: vertical;
  min-height: 100px;
  transition: var(--transition);
  outline: none;
}

.cookie-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-glow);
}

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

.input-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: white;
  padding: 12px 20px;
  font-size: 14px;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
  background: var(--color-surface-2);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  padding: 10px 16px;
  font-size: 13px;
}

.btn-secondary:hover:not(:disabled) {
  background: var(--color-surface-3);
  border-color: var(--color-border-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  padding: 8px 14px;
  font-size: 13px;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--color-surface-2);
  color: var(--color-text);
}

.btn-sm {
  padding: 7px 12px !important;
  font-size: 12px !important;
}

/* ── Dashboard Nav ────────────────────────────────────────── */
.dashboard-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.last-updated {
  font-size: 12px;
  color: var(--color-text-muted);
  flex: 1;
}

/* ── Profile Card ─────────────────────────────────────────── */
.profile-section {
  margin-bottom: 24px;
}

.profile-card {
  background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-surface-2) 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 28px;
  display: flex;
  align-items: center;
  gap: 24px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.profile-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary), var(--color-accent));
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.35);
}

.profile-info {
  flex: 1;
}

.profile-name {
  font-size: 20px;
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}

.profile-username {
  font-size: 13px;
  color: var(--color-primary);
  font-weight: 500;
  margin-bottom: 2px;
}

.profile-email {
  font-size: 13px;
  color: var(--color-text-muted);
}

.profile-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 24px;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.meta-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}

.meta-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

/* ── Stats Row ────────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: var(--transition);
  box-shadow: var(--shadow-card);
}

.stat-card:hover {
  border-color: var(--color-border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon-green { background: var(--color-green-bg); color: var(--color-green); }
.stat-icon-blue  { background: var(--color-blue-bg);  color: var(--color-blue);  }
.stat-icon-purple{ background: var(--color-purple-bg);color: var(--color-purple);}
.stat-icon-orange{ background: var(--color-orange-bg);color: var(--color-orange);}

.stat-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.stat-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* ── Detail Section ───────────────────────────────────────── */
.detail-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.detail-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-2);
}

.detail-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
  letter-spacing: 0.02em;
  background: var(--color-surface-3);
  color: var(--color-text-subtle);
  border: 1px solid var(--color-border);
}

.badge.present {
  background: var(--color-green-bg);
  color: var(--color-green);
  border-color: rgba(34, 197, 94, 0.3);
}

.badge.absent {
  background: var(--color-red-bg);
  color: var(--color-red);
  border-color: rgba(239, 68, 68, 0.3);
}

.badge.late {
  background: var(--color-yellow-bg);
  color: var(--color-yellow);
  border-color: rgba(234, 179, 8, 0.3);
}

.detail-grid {
  padding: 6px 0;
}

.detail-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px 22px;
  border-bottom: 1px solid var(--color-border);
  gap: 16px;
  transition: var(--transition);
}

.detail-row:last-child { border-bottom: none; }
.detail-row:hover { background: var(--color-surface-2); }

.detail-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-muted);
  min-width: 130px;
}

.detail-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  text-align: right;
  word-break: break-word;
}

.status-late  { color: var(--color-yellow); }
.status-early { color: var(--color-orange); }
.status-present { color: var(--color-green); }

/* ── Raw Response ─────────────────────────────────────────── */
.raw-response {
  padding: 16px;
}

.raw-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.raw-tab {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font);
}

.raw-tab:hover { background: var(--color-surface-3); color: var(--color-text); }
.raw-tab.active {
  background: var(--color-primary-glow);
  border-color: rgba(59, 130, 246, 0.35);
  color: var(--color-primary);
}

.raw-code {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  line-height: 1.6;
  color: var(--color-text-subtle);
  overflow: auto;
  max-height: 340px;
  white-space: pre;
  word-break: break-all;
}

/* ── Loading ──────────────────────────────────────────────── */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(9, 13, 26, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-overlay.hidden { display: none; }

.loading-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 32px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-lg);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.loading-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-muted);
}

/* ── Toast ────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.25s ease both;
  pointer-events: auto;
  max-width: 360px;
}

.toast.success { border-left: 3px solid var(--color-green); }
.toast.error   { border-left: 3px solid var(--color-red); }
.toast.info    { border-left: 3px solid var(--color-blue); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Utilities ─────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Refresh spin animation ───────────────────────────────── */
.refreshing #refreshIcon {
  animation: spin 0.7s linear infinite;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .detail-section { grid-template-columns: 1fr; }
  .profile-card { flex-wrap: wrap; }
  .profile-meta { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .main { padding: 20px 16px 48px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .header-inner { padding: 12px 16px; }
  .section-title { font-size: 22px; }
  .profile-meta { grid-template-columns: 1fr; }
  .stat-value { font-size: 15px; }
}
