/* Card base */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  transition: background 0.2s, border-color 0.2s;
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--skeleton) 25%, transparent 50%, var(--skeleton) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* KPI trend arrows */
.trend-up { color: var(--success); }
.trend-down { color: var(--danger); }
.trend-neutral { color: var(--text-muted); }

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}
.badge-blue { background: #DBEAFE; color: #1E40AF; }
.badge-green { background: #DCFCE7; color: #166534; }
.badge-red { background: #FEE2E2; color: #991B1B; }
.badge-orange { background: #FEF3C7; color: #92400E; }
.badge-purple { background: #EDE9FE; color: #5B21B6; }
.badge-gray { background: #F1F5F9; color: #475569; }
html.dark .badge-blue { background: #1E3A5F; color: #93C5FD; }
html.dark .badge-green { background: #14532D; color: #86EFAC; }
html.dark .badge-red { background: #450A0A; color: #FCA5A5; }
html.dark .badge-orange { background: #451A03; color: #FCD34D; }
html.dark .badge-purple { background: #2E1065; color: #C4B5FD; }
html.dark .badge-gray { background: #334155; color: #94A3B8; }

/* Table */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 10px 12px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}
.data-table tr:hover td { background: var(--bg-primary); }
.data-table tr { cursor: pointer; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }

/* Nav active */
.nav-link.active {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
}

/* Modal overlay */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
  animation: fadeIn 0.15s ease-out;
}
.modal-content {
  background: var(--bg-card);
  border-radius: 12px;
  max-width: 720px; width: 95%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: slideUp 0.2s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Error panel */
.error-panel {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #991B1B;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
}
html.dark .error-panel { background: #450A0A; border-color: #7F1D1D; color: #FCA5A5; }

/* Mobile burger menu */
.mobile-nav {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 40;
  animation: fadeIn 0.15s ease-out;
}
.mobile-nav-panel {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 280px;
  background: var(--bg-nav);
  box-shadow: 4px 0 20px rgba(0,0,0,0.2);
  animation: slideRight 0.2s ease-out;
  padding: 20px;
}
@keyframes slideRight { from { transform: translateX(-100%); } to { transform: translateX(0); } }

/* Pagination */
.pagination { display: flex; align-items: center; gap: 8px; }
.pagination button {
  min-width: 36px; min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 14px;
}
.pagination button:hover { background: var(--bg-primary); }
.pagination button:disabled { opacity: 0.5; cursor: not-allowed; }

/* Split-pane layout */
.split-pane { display: flex; gap: 16px; min-height: 500px; }
.split-pane-left { flex: 1 1 55%; min-width: 0; overflow: hidden; }
.split-pane-right { flex: 1 1 45%; min-width: 0; overflow: hidden; }
@media (max-width: 1024px) {
  .split-pane { flex-direction: column; min-height: auto; }
}

/* Selected row highlight */
.data-table tr.selected td { background: var(--accent-bg, #EFF6FF); }
html.dark .data-table tr.selected td { background: rgba(37, 99, 235, 0.15); }

/* Filter bar */
.filter-bar { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.filter-bar select {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
}
.filter-bar label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Placeholder for empty panel */
.panel-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
  padding: 24px;
}
