/*
 * Dashboard Specific Styles
 * Reconstructed based on theme.css and html structure
 */

/* User Info Card in Header */
.user-info-card {
  transition: all 0.2s ease;
}
.user-info-card:hover {
  background: linear-gradient(135deg, rgba(99,102,241,0.12) 0%, rgba(139,92,246,0.1) 100%) !important;
}

/* Activation Status Indicators */
.activation-status-indicator {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  line-height: 1.3;
}
.activation-status-indicator.hidden {
  display: none;
}
.activation-status-indicator.activation-ok {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.activation-status-indicator.activation-bad {
  background: rgba(239, 68, 68, 0.12);
  color: #DC2626;
  border: 1px solid rgba(239, 68, 68, 0.25);
}
.activation-status-indicator.expiry-ok {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.activation-status-indicator.expiry-warn {
  background: rgba(245, 158, 11, 0.12);
  color: #D97706;
  border: 1px solid rgba(245, 158, 11, 0.25);
}
.activation-status-indicator.expiry-bad {
  background: rgba(239, 68, 68, 0.12);
  color: #DC2626;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

/* Layout */
.dashboard-shell {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow-x: hidden;
  overflow-y: hidden;
  background: transparent;
  min-width: 0;
}

/* Sidebar */
.sidebar {
  width: clamp(240px, 18vw, 280px);
  flex-shrink: 0;
  background: var(--gradient-sidebar, linear-gradient(180deg, #FDFEFF 0%, #F8FAFD 100%));
  border-right: 1px solid var(--color-border, #E2E8F0);
  box-shadow: 1px 0 8px rgba(0, 0, 0, 0.02), 4px 0 16px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 20px 16px;
  transition: width 0.25s ease, padding 0.25s ease, opacity 0.25s ease;
}

.sidebar.collapsed {
  width: 0;
  padding: 0;
  overflow: hidden;
  opacity: 0;
  border-right: none;
}

/* Sidebar Collapse/Expand Buttons */
.sidebar-collapse-btn {
  background: transparent;
  border: none;
  color: var(--color-text-muted, #64748B);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-collapse-btn:hover {
  background: var(--color-bg-hover, #F0F3F7);
  color: var(--color-text-main, #1E293B);
}

.sidebar-expand-btn {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 48px;
  background: var(--gradient-primary, linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%));
  border: none;
  border-radius: 0 8px 8px 0;
  color: white;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 2px 0 8px rgba(99, 102, 241, 0.3);
  z-index: 100;
  transition: all 0.2s;
}

.sidebar-expand-btn:hover {
  width: 28px;
  box-shadow: 4px 0 12px rgba(99, 102, 241, 0.4);
}

.sidebar.collapsed ~ .sidebar-expand-btn {
  display: flex;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999;
}

.sidebar-toggle-btn {
  display: none;
  gap: 6px;
  align-items: center;
}

.page-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-header {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border, #E2E8F0);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--color-text-main);
}

.sidebar-section {
  margin-bottom: 20px;
}

.sidebar-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

/* Sidebar Components */
.dashboard-type-switch {
  display: flex;
  background: rgba(99, 102, 241, 0.06);
  padding: 4px;
  border-radius: 8px;
  gap: 4px;
}

.dashboard-type-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  padding: 8px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.dashboard-type-btn.active {
  background: var(--gradient-primary, linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%));
  color: white;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

.sidebar-metric-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--color-border, #E2E8F0);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 6px;
  transition: all 0.2s;
}

.sidebar-metric-card:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(99, 102, 241, 0.2);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.06);
}

.sidebar-metric-card .label {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.sidebar-metric-card .value {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-main);
}

.sidebar-top-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.top-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.top-item:hover {
  background: var(--color-bg-hover, #F0F2F5);
}

.top-item-img {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--color-bg-input, #F5F7FA);
}

.top-item-info {
  flex: 1;
  min-width: 0;
}

/* KPI Section Collapse */
.kpi-section {
  margin-bottom: 8px;
}

.kpi-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--glass-bg, #FFFFFF);
  border: 1px solid var(--glass-border, #E2E8F0);
  border-radius: var(--radius-md, 10px);
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.kpi-header:hover {
  background: var(--color-bg-hover, #F0F3F7);
}

.kpi-header-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-main, #1E293B);
}

.kpi-toggle-icon {
  color: var(--color-text-muted, #64748B);
  transition: transform 0.25s ease;
  margin-left: auto;
}

.kpi-section.collapsed .kpi-toggle-icon {
  transform: rotate(-90deg);
}

.kpi-cards-wrapper {
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.25s ease, margin 0.25s ease;
  max-height: 500px;
  opacity: 1;
  margin-top: 8px;
}

.kpi-section.collapsed .kpi-cards-wrapper {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
}

.kpi-value {
  width: 100%;
  max-width: 100%;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}

.kpi-value .kpi-decimal {
  font-size: 0.68em;
  opacity: 0.9;
  letter-spacing: -0.01em;
}

.kpi-value .kpi-suffix {
  font-size: 1.05em;
  letter-spacing: -0.01em;
}

.top-item-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 1px;
}

.top-item-delta {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-secondary);
}

/* Main Content */
.page-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: clamp(16px, 2vw, 28px);
  min-width: 0;
  overflow: hidden;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.header-actions {
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}

@media (max-width: 1180px) {
  .sidebar-toggle-btn {
    display: inline-flex;
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100vh;
    width: min(280px, 80vw);
    transform: translateX(-102%);
    transition: transform 0.22s ease;
    z-index: 1000;
  }
  body.sidebar-open .sidebar {
    transform: translateX(0);
  }
  body.sidebar-open .sidebar-backdrop {
    display: block;
  }
}

@media (max-width: 980px) {
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .sidebar {
    width: min(300px, 88vw);
    padding: 16px 14px;
  }
}

.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  align-items: center;
}

.task-filter-btn {
  min-width: 112px;
}

.task-filter-btn.task-filter-update {
  background: rgba(0, 180, 42, 0.08);
  border: 1px solid rgba(0, 180, 42, 0.2);
  color: #00B42A;
}

.task-filter-btn.task-filter-bounty {
  background: rgba(255, 125, 0, 0.08);
  border: 1px solid rgba(255, 125, 0, 0.2);
  color: #FF7D00;
}

.task-filter-btn.task-filter-update:hover {
  background: rgba(0, 180, 42, 0.12);
  border-color: rgba(0, 180, 42, 0.3);
}

.task-filter-btn.task-filter-bounty:hover {
  background: rgba(255, 125, 0, 0.12);
  border-color: rgba(255, 125, 0, 0.3);
}

.task-filter-btn.task-filter-update.active {
  background: rgba(0, 180, 42, 0.15);
  border-color: rgba(0, 180, 42, 0.4);
  box-shadow: 0 2px 8px rgba(0, 180, 42, 0.15);
  color: #00B42A;
}

.task-filter-btn.task-filter-bounty.active {
  background: rgba(255, 125, 0, 0.15);
  border-color: rgba(255, 125, 0, 0.4);
  box-shadow: 0 2px 8px rgba(255, 125, 0, 0.15);
  color: #FF7D00;
}

/* Table Area */
.table-scroll-container {
  flex: 1;
  overflow: auto;
  border-radius: 14px;
  border: 1px solid var(--color-border, #E2E8F0);
  background: #FFFFFF;
  position: relative;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.03));
}

.product-thumb {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  cursor: zoom-in;
  transition: transform 0.2s;
}

.product-thumb:hover {
  transform: scale(1.05);
}

.product-link {
  color: var(--color-text-main);
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s;
}

.product-link:hover {
  color: var(--color-indigo-400);
}

/* Table Specifics */
.draggable-th {
  cursor: grab;
  user-select: none;
  position: relative;
}

.draggable-th:active {
  cursor: grabbing;
}

.draggable-th.dragging {
  opacity: 0.5;
  background: rgba(99, 102, 241, 0.2);
}

.draggable-th.over {
  border-left: 2px solid var(--color-indigo-400);
}

.select-th {
  width: 44px;
  text-align: center;
}

.row-select-cell {
  text-align: center;
}

.row-select-checkbox, .select-all-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--color-indigo-500);
  border-radius: 4px;
}

.preview-locked-row {
  position: relative;
  cursor: pointer;
}

.preview-locked-row td {
  filter: blur(4px);
  opacity: 0.6;
  pointer-events: none;
}

.preview-locked-row td.row-select-cell,
.preview-locked-row td.preview-locked-cell {
  filter: none;
  opacity: 1;
  pointer-events: auto;
}

.preview-locked-overlay-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(29, 33, 41, 0.95);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: white;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10;
  white-space: nowrap;
}

.preview-locked-title {
  filter: none !important;
  opacity: 0.8 !important;
}

/* Modals */
.image-preview-modal {
  position: fixed;
  inset: 0;
  background: rgba(30, 41, 59, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.image-preview-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.image-preview-content {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transform: scale(0.95);
  transition: transform 0.3s ease;
  object-fit: contain;
}

.image-preview-modal.active .image-preview-content {
  transform: scale(1);
}

.image-preview-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(30, 41, 59, 0.6);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  color: white;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.image-preview-close:hover {
  background: rgba(30, 41, 59, 0.8);
}

/* App Modal System */
.app-modal {
  position: fixed;
  inset: 0;
  background: rgba(30, 41, 59, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1050;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.app-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.app-modal-content {
  background: #FFFFFF;
  border: 1px solid var(--color-border, #E2E8F0);
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
  width: 500px;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.app-modal.active .app-modal-content {
  transform: scale(1);
}

.app-modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--color-border, #E2E8F0);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--color-bg-table-header, #F8F9FC);
}

.app-modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-main, #1D2129);
  margin: 0;
}

.app-modal-close {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s;
}

.app-modal-close:hover {
  background: var(--color-bg-hover, #F0F2F5);
  color: var(--color-text-main, #1D2129);
}

.app-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.app-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--color-border, #E5E6EB);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: var(--color-bg-table-header, #FAFBFC);
}

/* Specific Modal Sizes */
.app-modal-content.size-lg {
  width: 800px;
}

.app-modal-content.size-xl {
  width: 960px;
}

.app-modal-content.size-2xl {
  width: 1180px;
  max-width: 96vw;
}

.bounty-public-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 140px 110px 110px auto;
  gap: 10px;
  align-items: center;
}

.bounty-public-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.bounty-public-actions .spacer {
  margin-left: auto;
}

.bounty-public-list {
  margin-top: 10px;
  max-height: 360px;
  overflow: auto;
  border-radius: 12px;
  border: 1px solid var(--color-border, #E5E6EB);
  background: #FFFFFF;
  position: relative;
}

.bounty-public-item {
  display: flex;
  gap: 10px;
  padding: 12px 12px;
  border-bottom: 1px solid var(--color-border, #E5E6EB);
  cursor: pointer;
}

.bounty-public-item:hover {
  background: var(--color-bg-hover, #F0F2F5);
}

.bounty-public-item:last-child {
  border-bottom: none;
}

.bounty-public-item input[type="checkbox"] {
  margin-top: 4px;
  width: 16px;
  height: 16px;
  accent-color: var(--color-indigo-500);
  cursor: pointer;
}

.bounty-public-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-main, #1D2129);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.bounty-public-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--color-text-muted, #86909C);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.bounty-public-tag {
  font-size: 11px;
  color: var(--color-text-main, #1D2129);
  background: var(--color-bg-input, #F5F7FA);
  border: 1px solid var(--color-border, #E5E6EB);
  padding: 2px 8px;
  border-radius: 999px;
}

.bounty-public-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 62px;
  background: radial-gradient(closest-side, rgba(255,255,255,0.7), rgba(255,255,255,0.9));
}

.bounty-public-loading-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.bounty-public-loading-card {
  width: min(520px, calc(100% - 24px));
  border-radius: 14px;
  border: 1px solid var(--color-border, #E5E6EB);
  background: #FFFFFF;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  padding: 14px 14px 12px;
}

.bounty-public-loading-spinner {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 3px solid var(--color-border, #E5E6EB);
  border-top-color: var(--color-indigo-500, #4E6EF2);
  animation: spin 0.85s linear infinite;
}

.bounty-public-loading-skeleton {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bounty-public-loading-skeleton .sk-item {
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, #F0F2F5, #E5E6EB, #F0F2F5);
  background-size: 240% 100%;
  animation: sk-shimmer 1.2s ease-in-out infinite;
}

.bounty-public-loading-skeleton .sk-item:nth-child(1) { width: 82%; }
.bounty-public-loading-skeleton .sk-item:nth-child(2) { width: 94%; }
.bounty-public-loading-skeleton .sk-item:nth-child(3) { width: 76%; }
.bounty-public-loading-skeleton .sk-item:nth-child(4) { width: 90%; }
.bounty-public-loading-skeleton .sk-item:nth-child(5) { width: 84%; }

.btn.is-busy {
  opacity: 0.92;
}

.btn-spinner {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid var(--color-border, #E5E6EB);
  border-top-color: var(--color-indigo-500, #4E6EF2);
  animation: spin 0.8s linear infinite;
  flex: 0 0 auto;
}

.btn-icon-spin {
  animation: spin 0.9s linear infinite;
}

.table-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 90px;
  background: radial-gradient(closest-side, rgba(255,255,255,0.7), rgba(255,255,255,0.9));
}

.table-loading-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.table-loading-card {
  margin: 12px;
  border-radius: 16px;
  border: 1px solid var(--color-border, #E5E6EB);
  background: #FFFFFF;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  padding: 14px 14px 12px;
}

.table-loading-spinner {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 3px solid var(--color-border, #E5E6EB);
  border-top-color: var(--color-indigo-500, #4E6EF2);
  animation: spin 0.85s linear infinite;
}

.table-loading-skeleton {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.table-loading-skeleton .sk-row {
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #F0F2F5, #E5E6EB, #F0F2F5);
  background-size: 240% 100%;
  animation: sk-shimmer 1.2s ease-in-out infinite;
}

.table-loading-skeleton .sk-row:nth-child(1) { width: 72%; }
.table-loading-skeleton .sk-row:nth-child(2) { width: 96%; }
.table-loading-skeleton .sk-row:nth-child(3) { width: 84%; }
.table-loading-skeleton .sk-row:nth-child(4) { width: 92%; }
.table-loading-skeleton .sk-row:nth-child(5) { width: 78%; }
.table-loading-skeleton .sk-row:nth-child(6) { width: 88%; }

@keyframes sk-shimmer {
  0% { background-position: 0% 0%; opacity: 0.85; }
  50% { background-position: 100% 0%; opacity: 1; }
  100% { background-position: 0% 0%; opacity: 0.85; }
}

/* Leaderboard Styles */
.leaderboard-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 320px;
  color: var(--color-text-main);
  font-family: 'Inter', sans-serif;
  overflow-y: auto;
  padding-right: 4px;
}

.podium-section {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 24px;
  padding: 30px 0 20px 0;
  border-bottom: 1px solid var(--color-border, #E5E6EB);
}

.podium-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100px;
  text-align: center;
  position: relative;
}

.podium-rank-1 { order: 2; z-index: 2; }
.podium-rank-2 { order: 1; z-index: 1; }
.podium-rank-3 { order: 3; z-index: 1; }

.podium-avatar-box {
  position: relative;
  margin-bottom: 12px;
  display: flex;
  justify-content: center;
}

.podium-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-bg-input, #F5F7FA);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 24px;
  border: 3px solid transparent;
  color: var(--color-text-muted, #86909C);
  overflow: hidden;
}

.podium-rank-1 .podium-avatar { 
  border-color: #ffd700; 
  width: 72px; 
  height: 72px; 
  font-size: 32px; 
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.2); 
}

.podium-rank-2 .podium-avatar { border-color: #c0c0c0; }
.podium-rank-3 .podium-avatar { border-color: #cd7f32; }

.podium-crown {
  position: absolute;
  top: -26px;
  left: 50%;
  transform: translateX(-50%) rotate(-5deg);
  color: #ffd700;
  font-size: 28px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0% { transform: translateX(-50%) rotate(-5deg) translateY(0); }
  50% { transform: translateX(-50%) rotate(-5deg) translateY(-4px); }
  100% { transform: translateX(-50%) rotate(-5deg) translateY(0); }
}

.podium-info {
  margin-bottom: 8px;
  width: 100%;
}

.podium-username {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.podium-points {
  font-size: 13px;
  color: var(--color-accent);
  font-weight: bold;
}

.podium-bar {
  width: 100%;
  background: var(--color-bg-input, #F5F7FA);
  border-radius: 8px 8px 0 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 12px;
  color: var(--color-text-tertiary, #C9CDD4);
  font-size: 32px;
  font-weight: 900;
  position: relative;
  overflow: hidden;
}

.podium-bar::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 30%;
  background: linear-gradient(to bottom, rgba(255,255,255,0.5), transparent);
}

.podium-rank-1 .podium-bar { 
  height: 110px; 
  background: linear-gradient(to bottom, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.05)); 
  border-top: 3px solid rgba(255, 215, 0, 0.6); 
  color: rgba(255, 215, 0, 0.2);
}

.podium-rank-2 .podium-bar { 
  height: 80px; 
  background: linear-gradient(to bottom, rgba(192, 192, 192, 0.2), rgba(192, 192, 192, 0.05)); 
  border-top: 3px solid rgba(192, 192, 192, 0.6); 
  color: rgba(192, 192, 192, 0.2);
}

.podium-rank-3 .podium-bar { 
  height: 60px; 
  background: linear-gradient(to bottom, rgba(205, 127, 50, 0.2), rgba(205, 127, 50, 0.05)); 
  border-top: 3px solid rgba(205, 127, 50, 0.6); 
  color: rgba(205, 127, 50, 0.2);
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 20px;
}

.leaderboard-header {
  display: flex;
  padding: 0 16px 8px 16px;
  font-size: 12px;
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-border, #E5E6EB);
  margin-bottom: 4px;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: var(--color-bg-input, #F5F7FA);
  border-radius: 10px;
  font-size: 13px;
  transition: background 0.2s;
}

.leaderboard-item:hover {
  background: var(--color-bg-hover, #F0F2F5);
}

.leaderboard-item.is-me {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.lb-rank { width: 50px; font-weight: bold; color: var(--color-text-muted); font-size: 14px; }
.lb-user { flex: 1; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.lb-user-avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--color-bg-input, #F5F7FA);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: var(--color-text-muted, #86909C);
}
.lb-points { width: 100px; text-align: right; color: var(--color-accent); font-weight: bold; font-family: monospace; font-size: 14px; }
.lb-extra { width: 220px; text-align: right; color: var(--color-text-muted); font-size: 12px; display: flex; flex-direction: column; line-height: 1.3; }

.tag-chip-bounty {
  background: rgba(255, 125, 0, 0.08);
  border: 1px solid rgba(255, 125, 0, 0.2);
  color: #FF7D00;
}

.tag-chip-update {
  background: rgba(0, 180, 42, 0.08);
  border: 1px solid rgba(0, 180, 42, 0.2);
  color: #00B42A;
}

/* Mac Retina / HiDPI Optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .sidebar {
    border-right-width: 0.5px;
  }
  .sidebar-metric-card {
    border-width: 0.5px;
  }
  .sidebar-header {
    border-bottom-width: 0.5px;
  }
  .table-scroll-container {
    border-width: 0.5px;
  }
  .app-modal-content {
    border-width: 0.5px;
  }
  .app-modal-header,
  .app-modal-footer {
    border-width: 0.5px;
  }
}
