/* ==========================================================================
   VATERA KERESŐ — Dark Luxe Analytics Theme
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Young+Serif&display=swap');

/* ---------- Design Tokens ---------- */
:root {
  --bg-base: #0a0a0f;
  --bg-primary: #0f0f16;
  --bg-elevated: #171722;
  --bg-card: #1a1a28;
  --bg-card-hover: #222236;
  --bg-input: #13131d;

  --text-primary: #ededf2;
  --text-secondary: #9898b4;
  --text-muted: #5a5a74;

  --accent-gold: #e8a832;
  --accent-gold-bright: #f4c55e;
  --accent-gold-dim: rgba(232, 168, 50, 0.12);
  --accent-blue: #5b8def;
  --accent-blue-dim: rgba(91, 141, 239, 0.12);
  --accent-cyan: #4cc9f0;
  --accent-green: #34d399;
  --accent-green-dim: rgba(52, 211, 153, 0.12);
  --accent-red: #f25c54;

  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.6);
  --shadow-glow-gold: 0 0 24px rgba(232, 168, 50, 0.08);

  --font-display: 'Young Serif', Georgia, serif;
  --font-body: 'Outfit', system-ui, sans-serif;

  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Film grain overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 99999;
  pointer-events: none;
  opacity: 0.015;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }

:focus-visible { outline: 2px solid var(--accent-gold); outline-offset: 2px; }

/* ---------- LOGIN PAGE ---------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-base);
  background-image:
    radial-gradient(ellipse at 25% 50%, rgba(232, 168, 50, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 75% 20%, rgba(91, 141, 239, 0.04) 0%, transparent 50%);
}

.login-box {
  background: var(--bg-elevated);
  padding: 48px 40px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg), var(--shadow-glow-gold);
  width: 400px;
  max-width: calc(100vw - 32px);
  animation: fadeInUp 0.6s var(--transition-slow);
}

.login-box h1 {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--accent-gold);
  margin-bottom: 32px;
  text-align: center;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.login-box input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-primary);
  margin-bottom: 14px;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

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

.login-box input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px var(--accent-gold-dim);
}

.login-box button {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--accent-gold), #d4922a);
  color: #0a0a0f;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  letter-spacing: 0.02em;
}

.login-box button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(232, 168, 50, 0.3);
}

.login-box button:active { transform: translateY(0); }

.login-error {
  color: var(--accent-red);
  font-size: 14px;
  margin-bottom: 14px;
  text-align: center;
  padding: 10px;
  background: rgba(242, 92, 84, 0.08);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(242, 92, 84, 0.15);
}

/* ---------- APP HEADER ---------- */
.header {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  padding: 20px 24px 0;
  text-align: center;
  position: relative;
}

.header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-gold-dim), transparent);
}

.header h1 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  color: var(--accent-gold);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.header .stats {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 18px;
  letter-spacing: 0.02em;
}

/* ---------- LOGOUT ---------- */
.logout-btn {
  position: absolute;
  top: 20px;
  right: 24px;
  padding: 6px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.logout-btn:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text-secondary);
  border-color: var(--border-hover);
}

/* ---------- TABS ---------- */
.tabs { display: flex; justify-content: center; gap: 2px; }

.tab-btn {
  padding: 11px 36px;
  background: transparent;
  color: var(--text-muted);
  border: none;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  transition: color var(--transition-fast), background var(--transition-fast);
  letter-spacing: 0.02em;
  position: relative;
}

.tab-btn:hover {
  color: var(--text-secondary);
  background: rgba(255,255,255,0.03);
}

.tab-btn.active {
  background: var(--bg-base);
  color: var(--accent-gold);
  font-weight: 600;
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 2px;
  background: var(--accent-gold);
  border-radius: 1px;
}

.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.3s ease; }

/* ---------- SEARCH ---------- */
.search-bar {
  max-width: 1280px;
  margin: 24px auto;
  padding: 0 20px;
}

.search-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.search-row input[type="text"] {
  flex: 1;
  padding: 14px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-row input[type="text"]::placeholder { color: var(--text-muted); }

.search-row input[type="text"]:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px var(--accent-gold-dim);
}

.search-row button {
  padding: 14px 32px;
  background: linear-gradient(135deg, var(--accent-gold), #d4922a);
  color: #0a0a0f;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  white-space: nowrap;
}

.search-row button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(232, 168, 50, 0.25);
}

.search-row button:active { transform: translateY(0); }

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.filters select,
.filters input {
  padding: 9px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-secondary);
  outline: none;
  transition: border-color var(--transition-fast);
  cursor: pointer;
}

.filters select:hover,
.filters input:hover { border-color: var(--border-hover); }

.filters select:focus,
.filters input:focus { border-color: var(--accent-gold); }

.filters input[type="number"] { width: 120px; }

.filters select option {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

/* ---------- SEARCH FIELDS PANEL ---------- */
.search-fields-wrap {
  position: relative;
}

.search-fields-toggle {
  padding: 14px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.search-fields-toggle:hover {
  border-color: var(--border-hover);
  color: var(--text-secondary);
}

.search-fields-toggle.active {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  background: var(--accent-gold-dim);
}

.search-fields-panel {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  min-width: 200px;
  box-shadow: var(--shadow-md);
  z-index: 50;
  animation: fadeIn 0.15s ease;
}

.search-fields-panel.open {
  display: block;
}

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

.search-field-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.search-field-check:hover {
  color: var(--text-primary);
}

.search-field-check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.search-field-check input[type="checkbox"]:hover {
  border-color: var(--border-hover);
}

.search-field-check input[type="checkbox"]:checked {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
}

.search-field-check input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 6px;
  height: 10px;
  border: solid #0a0a0f;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.search-fields-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* ---------- RESULTS INFO ---------- */
.results-info {
  max-width: 1280px;
  margin: 0 auto 14px;
  padding: 0 20px;
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* ---------- PRODUCT GRID ---------- */
.grid {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px 48px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
  animation: fadeInUp 0.5s ease both;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(232, 168, 50, 0.15);
  box-shadow: var(--shadow-md), var(--shadow-glow-gold);
}

.card-img {
  width: 100%;
  height: 220px;
  object-fit: contain;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
}

.card-img-placeholder {
  width: 100%;
  height: 220px;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}

.card-body { padding: 16px; }

.card-title {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
  color: var(--text-primary);
}

.card-price {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent-gold);
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.card-price .auction {
  color: var(--accent-cyan);
  font-size: 14px;
  font-weight: 500;
}

.card-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  line-height: 1;
}

.card-meta .tag {
  background: rgba(255,255,255,0.04);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  font-size: 11px;
}

.card-meta .cat-tag {
  background: var(--accent-blue-dim);
  color: var(--accent-blue);
  border-color: rgba(91, 141, 239, 0.15);
}

.card-meta .free-ship {
  background: var(--accent-green-dim);
  color: var(--accent-green);
  border-color: rgba(52, 211, 153, 0.15);
}

/* Staggered card animation */
.card:nth-child(1)  { animation-delay: 0.02s; }
.card:nth-child(2)  { animation-delay: 0.04s; }
.card:nth-child(3)  { animation-delay: 0.06s; }
.card:nth-child(4)  { animation-delay: 0.08s; }
.card:nth-child(5)  { animation-delay: 0.10s; }
.card:nth-child(6)  { animation-delay: 0.12s; }
.card:nth-child(7)  { animation-delay: 0.14s; }
.card:nth-child(8)  { animation-delay: 0.16s; }
.card:nth-child(9)  { animation-delay: 0.18s; }
.card:nth-child(10) { animation-delay: 0.20s; }
.card:nth-child(11) { animation-delay: 0.22s; }
.card:nth-child(12) { animation-delay: 0.24s; }

/* ---------- PAGINATION ---------- */
.pagination {
  max-width: 1280px;
  margin: 0 auto 48px;
  padding: 0 20px;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.pagination button {
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pagination button:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.pagination button.active {
  background: var(--accent-gold);
  color: #0a0a0f;
  border-color: var(--accent-gold);
  font-weight: 600;
}

.pagination button:disabled { opacity: 0.3; cursor: default; }

/* ---------- MODAL ---------- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 10, 0.88);
  z-index: 100;
  overflow-y: auto;
}

.modal-overlay.open {
  display: block;
  animation: fadeIn 0.25s ease;
}

.modal {
  max-width: 920px;
  width: calc(100% - 40px);
  margin: 40px auto;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.35s var(--transition-slow);
}

.modal-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: start;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

.modal-header h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
  flex: 1;
  margin-right: 16px;
  color: var(--text-primary);
  line-height: 1.3;
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  transition: color var(--transition-fast);
  padding: 4px;
}

.modal-close:hover { color: var(--text-primary); }

.modal-body {
  padding: 24px;
  background: var(--bg-elevated);
}

.modal-price {
  font-size: 26px;
  font-weight: 700;
  color: var(--accent-gold);
  margin-bottom: 20px;
}

.modal-gallery {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  margin-bottom: 20px;
  padding-bottom: 10px;
}

.modal-gallery img {
  height: 200px;
  border-radius: var(--radius-md);
  object-fit: contain;
  background: var(--bg-primary);
  flex-shrink: 0;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.modal-gallery img:hover {
  border-color: var(--accent-gold);
  transform: scale(1.02);
}

.modal-section {
  margin-bottom: 24px;
}

.modal-section h3 {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.detail-row {
  display: flex;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.detail-label {
  width: 160px;
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.detail-value {
  flex: 1;
  font-weight: 500;
  color: var(--text-primary);
  overflow-wrap: break-word;
  word-break: break-word;
}

.modal-desc {
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  max-height: 400px;
  overflow-y: auto;
  background: var(--bg-primary);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.shipping-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--bg-elevated);
}

.shipping-table th,
.shipping-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

.shipping-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--bg-primary);
}

.shipping-table td { color: var(--text-secondary); }

.vatera-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--accent-gold), #d4922a);
  color: #0a0a0f;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.vatera-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(232, 168, 50, 0.3);
}

.img-fullscreen {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 200;
  justify-content: center;
  align-items: center;
  cursor: zoom-out;
  backdrop-filter: blur(20px);
}

.img-fullscreen.open { display: flex; animation: fadeIn 0.2s ease; }

.img-fullscreen img {
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

/* ---------- VISUALIZATION ---------- */
.viz-panel {
  max-width: 1280px;
  margin: 24px auto;
  padding: 0 20px;
}

.viz-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  align-items: center;
}

.viz-controls select {
  padding: 11px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition-fast);
}

.viz-controls select:focus { border-color: var(--accent-gold); }

.viz-controls select option,
.viz-controls select optgroup {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.viz-search {
  flex: 1;
  min-width: 200px;
  padding: 11px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

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

.viz-search:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px var(--accent-gold-dim);
}

.viz-search-help {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.6;
}

.viz-search-help b { color: var(--accent-gold); }

.viz-search-help code {
  background: var(--bg-elevated);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: var(--accent-cyan);
  border: 1px solid var(--border);
}

.viz-chart-wrap {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: relative;
  min-height: 400px;
}

.viz-chart-wrap canvas { max-height: 500px; cursor: pointer; }

.viz-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 15px;
}

.viz-drill { margin-top: 24px; }

.viz-drill h3 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 400;
  margin-bottom: 14px;
  color: var(--text-primary);
}

.viz-drill-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-muted);
  float: right;
  transition: color var(--transition-fast);
}

.viz-drill-close:hover { color: var(--text-primary); }

.drill-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.drill-table th {
  background: var(--bg-elevated);
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
  position: sticky;
  top: 0;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border);
}

.drill-table td {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text-secondary);
}

.drill-table tr:hover { background: rgba(255,255,255,0.02); }

.drill-table .thumb {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  border: 1px solid var(--border);
}

.drill-table .title-link {
  color: var(--accent-gold);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.drill-table .title-link:hover {
  color: var(--accent-gold-bright);
  text-decoration: underline;
}

.drill-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.drill-table th.sortable:hover {
  color: var(--text-secondary);
  background: rgba(255,255,255,0.04);
}

.drill-table th.sortable::after {
  content: ' \2195';
  opacity: 0.3;
  font-size: 10px;
}

.drill-table th.sorted-asc::after {
  content: ' \25B2';
  opacity: 1;
  color: var(--accent-gold);
  font-size: 10px;
}

.drill-table th.sorted-desc::after {
  content: ' \25BC';
  opacity: 1;
  color: var(--accent-gold);
  font-size: 10px;
}

/* ---------- ANIMATIONS ---------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
  .header { padding: 16px 16px 0; }
  .header h1 { font-size: 22px; }
  .tab-btn { padding: 10px 20px; font-size: 13px; }

  .search-bar, .viz-panel { padding: 0 12px; margin-top: 16px; }
  .search-row { flex-direction: column; }
  .search-fields-wrap { align-self: stretch; }
  .search-fields-toggle { width: 100%; }
  .search-fields-panel { left: 0; right: 0; }
  .filters { gap: 6px; }
  .filters select, .filters input { font-size: 12px; padding: 8px 10px; }
  .filters input[type="number"] { width: 90px; }

  .grid {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 0 12px 32px;
  }

  .card-img, .card-img-placeholder { height: 180px; }

  .modal { width: 100%; margin: 0; border-radius: 0; min-height: 100vh; }
  .modal-header { padding: 16px; }
  .modal-body { padding: 16px; }
  .detail-label { width: 120px; }

  .viz-controls { flex-direction: column; }
  .viz-controls select, .viz-search { width: 100%; min-width: unset; }

  .logout-btn { top: 14px; right: 12px; }
}

@media (max-width: 480px) {
  .login-box { padding: 32px 24px; }
  .pagination { flex-wrap: wrap; }
}
