/* ============================================================
   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;
}

.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-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;
}

.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;
}

.sub-tab {
  flex: 1;
  min-width: 0;
  padding: 10px 8px;
  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);
}

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