/* ============================================================
   SVC App — Shared Component Styles
   Supplements the inline design system in index.html
   ============================================================ */

/* ── Search Bar ──────────────────────────── */
.search-bar {
  position: relative;
  margin-bottom: var(--space-md);
}

.search-bar-input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s ease;
}

.search-bar-input:focus {
  border-color: var(--red-primary);
  box-shadow: 0 0 0 3px rgba(240, 192, 0, 0.1);
}

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

.search-bar-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* ── Filter Tabs ─────────────────────────── */
.filter-tabs {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  padding-bottom: var(--space-sm);
  margin-bottom: var(--space-md);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.filter-tabs::-webkit-scrollbar { display: none; }

.filter-tab {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.filter-tab.active {
  background: var(--red-primary);
  color: #131312;
  border-color: var(--red-primary);
  box-shadow: 0 0 12px var(--red-glow);
}

/* ── FAB (Floating Action Button) ────────── */
.fab {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
  right: 16px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--red-primary), var(--red-accent));
  color: #131312;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(240, 192, 0, 0.35);
  z-index: 50;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.fab:active { transform: scale(0.9); }
.fab svg { width: 24px; height: 24px; }

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

.empty-state svg { color: var(--text-muted); margin-bottom: var(--space-md); }
.empty-state-text { color: var(--text-muted); font-size: 0.9rem; }

/* ── List Items ──────────────────────────── */
.list-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.list-item:active { transform: scale(0.98); background: var(--bg-tertiary); }

.list-item-content { flex: 1; min-width: 0; }
.list-item-title { font-weight: 600; font-size: 0.95rem; }
.list-item-sub { font-size: 0.8rem; color: var(--text-secondary); margin-top: 2px; }
.list-item-meta { text-align: right; flex-shrink: 0; }

/* ── Data Table ──────────────────────────── */
.data-table {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.data-table th {
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-medium);
  white-space: nowrap;
}

.data-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

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

.data-table tr:active td { background: var(--bg-tertiary); }

/* ── Stat Cards ──────────────────────────── */
.metric-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  position: relative;
  overflow: hidden;
  min-width: 0;
}

.metric-card::after {
  content: '';
  position: absolute;
  top: -20px;
  right: -20px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  opacity: 0.08;
  pointer-events: none;
}

:root { --purple: #A78BFA; }

.metric-card.red::after { background: var(--red-accent); }
.metric-card.green::after { background: var(--success); }
.metric-card.blue::after { background: var(--info); }
.metric-card.amber::after { background: var(--warning); }
.metric-card.purple::after { background: var(--purple); }

.metric-value {
  font-family: var(--font-heading);
  font-size: clamp(24px, 3vw, 42px);
  font-weight: 800;
  line-height: 1;
  position: relative;
  z-index: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

/* Escalado defensivo según el largo del valor — clase aplicada por metricCard() en admin.js */
.metric-value.metric-value--md { font-size: clamp(20px, 2.6vw, 34px); }
.metric-value.metric-value--lg { font-size: clamp(17px, 2.2vw, 28px); }
.metric-value.metric-value--xl { font-size: clamp(14px, 1.8vw, 22px); }

.metric-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.metric-change {
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 8px;
}

/* ── Quick Actions Grid ──────────────────── */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
  margin: var(--space-md) 0;
}

.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-lg) var(--space-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.quick-action-btn:active { transform: scale(0.95); background: var(--bg-tertiary); }
.quick-action-btn svg { color: var(--red-accent); }

/* ── Sub-View Tabs (within admin) ────────── */
.sub-tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 3px;
  margin-bottom: var(--space-md);
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.sub-tab {
  flex: 0 0 auto;
  min-width: 88px;
  padding: 10px 14px;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.sub-tab.active {
  background: var(--bg-secondary);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* ── User Menu Bottom Sheet ─────────────── */
.user-menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  background: none;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
  text-align: left;
}

.user-menu-item:active {
  background: var(--bg-tertiary);
}

.user-menu-item svg {
  color: var(--text-secondary);
  flex-shrink: 0;
}

.user-menu-logout {
  color: var(--error);
}

.user-menu-logout svg {
  color: var(--error);
}

.user-menu-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--red-primary), var(--red-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  color: #131312;
  margin: 0 auto 12px;
}

.user-menu-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.user-menu-email {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.user-menu-role {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(240, 192, 0, 0.15);
  color: var(--red-accent);
}

/* ── Currency Price Box ──────────────────── */
.price-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin: 16px 0;
}

.price-usd {
  font-family: var(--font-heading);
  font-size: 36px;
  font-weight: 800;
  color: var(--text-primary);
}

.price-usd span {
  font-size: 16px;
  color: var(--text-secondary);
  font-weight: 400;
}

.price-divider {
  font-size: 12px;
  color: var(--text-muted);
  margin: 8px 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.price-bs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

.price-bs-item {
  background: var(--bg-tertiary);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.price-bs-item.usdt {
  border: 1px solid rgba(240, 192, 0, 0.2);
}

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

.price-bs-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-heading);
}

.price-bs-rate {
  font-size: 10px;
  color: var(--text-muted);
}

.price-updated {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 12px;
  opacity: 0.7;
}

.price-toggle-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 8px;
  background: none;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.price-toggle-btn:hover {
  color: var(--red-accent);
  border-color: rgba(240, 192, 0, 0.3);
}

.currency-loading {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 20px;
}

/* ── Currency Dashboard Widget ──────────── */
.currency-widget {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.currency-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.currency-widget-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.currency-widget-updated {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.currency-widget-rates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.currency-widget-rate {
  background: var(--bg-tertiary);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.currency-widget-rate.usdt {
  border: 1px solid rgba(240, 192, 0, 0.15);
}

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

.currency-widget-value {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
}

.currency-widget-toggle {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 6px;
  background: none;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.currency-widget-toggle:hover {
  color: var(--red-accent);
  border-color: rgba(240, 192, 0, 0.3);
}

/* ── File Uploader ──────────────────────── */
.upload-zone {
  border: 2px dashed rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--red-primary);
  background: rgba(240, 192, 0, 0.05);
}

.upload-zone.uploaded {
  border-color: var(--success);
  background: rgba(34, 197, 94, 0.05);
  cursor: default;
}

.upload-zone.uploading {
  pointer-events: none;
  opacity: 0.7;
}

.upload-zone-icon {
  color: var(--text-muted);
}

.upload-zone-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.upload-zone-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.upload-zone-btn {
  margin-top: 4px;
  padding: 8px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.upload-zone-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.upload-progress {
  width: 100%;
  height: 4px;
  background: var(--border-subtle);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 12px;
}

.upload-progress-bar {
  height: 100%;
  background: var(--red-primary);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.upload-preview-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 8px;
}

.upload-preview-info {
  text-align: center;
}

.upload-preview-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-all;
}

.upload-preview-size {
  font-size: 0.75rem;
  color: var(--success);
  margin-top: 2px;
}

.upload-change-btn {
  margin-top: 10px;
  padding: 6px 14px;
  background: none;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.upload-change-btn:hover {
  color: var(--red-accent);
  border-color: rgba(240, 192, 0, 0.3);
}

/* ============================================================
   STATUS BANNER (membership / verification pending)
   Gold palette harmonized with SVU brand (#f0c000).
   Lives inside #app so on desktop it inherits the sidebar offset.
   ============================================================ */
.status-banner {
  position: sticky;
  top: 0;
  z-index: 90;
  background:
    linear-gradient(180deg, rgba(240, 192, 0, 0.10) 0%, rgba(240, 192, 0, 0.03) 100%),
    rgba(19, 19, 26, 0.95);
  border-bottom: 1px solid rgba(240, 192, 0, 0.22);
  box-shadow: 0 4px 20px rgba(240, 192, 0, 0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: status-banner-slide 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.status-banner.hidden {
  display: none;
}

/* Severity is signalled by the dot color/intensity, not the whole banner.
   Keeps the gold palette unified across states. */
.status-banner-warning {
  border-bottom-color: rgba(240, 192, 0, 0.32);
}

.status-banner-info {
  border-bottom-color: rgba(240, 192, 0, 0.18);
}

.status-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.status-banner-dot {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f0c000;
  box-shadow: 0 0 0 4px rgba(240, 192, 0, 0.18), 0 0 16px rgba(240, 192, 0, 0.45);
  animation: status-banner-pulse 2s ease-in-out infinite;
}

.status-banner-info .status-banner-dot {
  background: #d4a600;
  box-shadow: 0 0 0 3px rgba(240, 192, 0, 0.12), 0 0 10px rgba(240, 192, 0, 0.30);
}

.status-banner-text {
  flex: 1;
  min-width: 0;
}

.status-banner-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14.5px;
  color: #fff;
  margin-bottom: 3px;
  letter-spacing: 0.01em;
}

.status-banner-body {
  font-size: 13px;
  color: rgba(240, 240, 245, 0.72);
  line-height: 1.5;
}

.status-banner-cta {
  flex-shrink: 0;
  background: linear-gradient(135deg, #f0c000, #d4a600);
  color: #131312;
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 12px rgba(240, 192, 0, 0.25);
  transition: all 0.18s ease;
}

.status-banner-cta:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(240, 192, 0, 0.35);
}

.status-banner-cta:active {
  transform: translateY(0);
}

@keyframes status-banner-slide {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

@keyframes status-banner-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(0.85); }
}

@media (max-width: 600px) {
  .status-banner-inner {
    flex-wrap: wrap;
    padding: 12px 16px;
    gap: 10px;
    row-gap: 10px;
  }
  .status-banner-dot {
    order: 1;
  }
  .status-banner-text {
    flex: 1 1 calc(100% - 24px);
    order: 2;
  }
  .status-banner-cta {
    order: 3;
    width: 100%;
    padding: 11px 16px;
  }
  .status-banner-title { font-size: 14px; }
  .status-banner-body  { font-size: 12.5px; }
}

/* Desktop overrides moved to /assets/css/desktop.css */
