:root {
  --bg-dark: #0f1116; 
  --bg-card: #181c24;
  --text-main: #f0f0f0; 
  --text-dim: #a0a5b0;
  --gold: #ffd700; 
  --green: #2ecc71; 
  --red: #e74c3c;
  --border: rgba(255, 255, 255, 0.1);
}

body {
  font-family: 'Montserrat', sans-serif;
  background-color: var(--bg-dark); 
  color: var(--text-main);
  margin: 0; 
  font-size: 14px;
  min-height: 100vh;
  position: relative;
  padding-bottom: 100px;
}

.scanner-panel {
  background: rgba(21, 25, 33, 0.98);
  border-bottom: 1px solid var(--gold);
  padding: 12px 0; 
  position: sticky; 
  top: 0; 
  z-index: 100;
  backdrop-filter: blur(10px); 
  box-shadow: 0 5px 20px rgba(0,0,0,0.5);
}

.scanner-container {
  max-width: 1400px; 
  margin: 0 auto; 
  padding: 0 20px;
  display: flex; 
  align-items: center; 
  gap: 20px;
}

.scanner-brand { 
  font-size: 1.1rem; 
  font-weight: 800; 
  color: #fff; 
  letter-spacing: 1px; 
  white-space: nowrap; 
}

.input-wrapper {
  display: flex; 
  flex: 1; 
  gap: 10px; 
  align-items: stretch;
}

.tag-container {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  transition: 0.3s;
  min-height: 45px;
}

.tag-container:focus-within {
  border-color: var(--gold);
  background: rgba(0, 0, 0, 0.4);
}

.tag-chip {
  background: var(--gold);
  color: #000;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
  animation: popIn 0.2s ease-out;
}

.tag-chip i { 
  cursor: pointer; 
  opacity: 0.6; 
  font-size: 0.8rem; 
}
.tag-chip i:hover { 
  opacity: 1; 
  color: var(--red); 
}

#tag-input {
  background: transparent;
  border: none;
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  flex: 1;
  min-width: 150px;
}

.scanner-btn {
  background: var(--gold); 
  color: #000; 
  border: none;
  padding: 0 25px; 
  border-radius: 6px; 
  font-weight: 800;
  cursor: pointer; 
  text-transform: uppercase; 
  min-width: 160px;
}
.scanner-btn:disabled { 
  background: #555; 
  color: #888; 
  cursor: not-allowed; 
}

.container { 
  max-width: 1400px; 
  margin: 30px auto; 
  padding: 0 15px; 
  padding-bottom: 80px;
}

#empty-state {
  text-align: center; 
  padding: 80px 0; 
  color: var(--text-dim);
}
#empty-state i { 
  font-size: 3rem; 
  margin-bottom: 20px; 
  opacity: 0.3; 
  display: block; 
}

.camp-block {
  background: var(--bg-card); 
  border: 1px solid var(--border);
  border-radius: 10px; 
  padding: 20px; 
  margin-bottom: 30px;
  position: relative; 
  animation: slideIn 0.3s ease-out;
}

.camp-actions {
  position: absolute;
  top: 15px;
  right: 15px;
  display: flex;
  gap: 10px;
}

.action-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  color: #7f8c8d;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  transition: 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.download-btn:hover {
  border-color: var(--green);
  color: var(--green);
  background: rgba(46, 204, 113, 0.1);
}

.close-btn:hover {
  border-color: var(--red);
  color: var(--red);
  background: rgba(231, 76, 60, 0.1);
}

.camp-header {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.camp-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.camp-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.camp-ids-list {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.id-badge {
  background: rgba(255,255,255,0.1);
  color: var(--text-dim);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-family: monospace;
}

.data-timestamp {
  font-size: 0.8rem;
  color: #3498db;
  opacity: 0.8;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
}

.summary-grid {
  display: grid; 
  grid-template-columns: repeat(3, 1fr); 
  gap: 15px;
  margin-bottom: 25px;
}
@media (max-width: 768px) { 
  .summary-grid { grid-template-columns: 1fr; } 
}

.mini-card {
  background: #1f2530; 
  border-radius: 6px; 
  padding: 20px; 
  border-left: 4px solid #555; 
  display: flex; 
  flex-direction: column; 
  justify-content: center;
}
.mc-p { border-color: #3498db; } 
.mc-k { border-color: var(--red); }
.mc-d { border-color: #9b59b6; } 

.mc-lbl { 
  font-size: 0.75rem; 
  color: var(--text-dim); 
  font-weight: 700; 
  text-transform: uppercase; 
  display: block; 
  margin-bottom: 8px; 
  letter-spacing: 1px; 
}
.mc-val { 
  font-size: 1.8rem; 
  font-weight: 800; 
  color: #fff; 
  display: block; 
}

.table-wrap { 
  overflow-x: auto; 
  border: 1px solid var(--border); 
  border-radius: 6px; 
}

.dense-table { 
  width: 100%; 
  border-collapse: collapse; 
  white-space: nowrap; 
  font-size: 0.85rem; 
}

.dense-table th {
  background: #121419; 
  color: var(--text-dim); 
  padding: 12px 15px; 
  text-align: right;
  font-size: 0.75rem; 
  text-transform: uppercase; 
  position: sticky; 
  top: 0; 
  z-index: 2;
}
.dense-table th:first-child { 
  text-align: left; 
  left: 0; 
  z-index: 10; 
  background: #121419; 
}

.dense-table td {
  padding: 10px 15px; 
  border-bottom: 1px solid rgba(255,255,255,0.03);
  text-align: right; 
  vertical-align: middle; 
  color: #ddd;
}
.dense-table td:first-child { 
  text-align: left; 
  position: sticky; 
  left: 0; 
  background: var(--bg-card);
  border-right: 1px solid var(--border); 
  z-index: 5; 
  font-weight: 800; 
  color: var(--gold);
}

.c-green { color: var(--green); } 
.c-red { color: var(--red); } 
.c-grey { color: #555; }
.val-big { font-weight: 700; display: block; }
.val-sub { display: block; font-size: 0.7rem; margin-top: 3px; opacity: 0.8; }

.btn-spinner {
  width: 14px; 
  height: 14px; 
  border: 2px solid rgba(0,0,0,0.3);
  border-top: 2px solid #000; 
  border-radius: 50%; 
  animation: spin 1s linear infinite;
  display: none; 
  margin: 0 auto;
}

.camp-badge {
  cursor: text;
  transition: all 0.2s;
  border: 2px solid var(--gold);
  background: var(--gold);
  color: #000;
  min-width: 120px;
  padding: 5px 15px;
  border-radius: 6px;
  text-align: center;
  font-weight: 800;
  display: inline-block;
  outline: none;
}

.camp-badge:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.camp-badge:focus {
  box-shadow: 0 0 0 3px rgba(255,255,255,0.3);
  border-color: #fff;
}

.color-picker-wrapper {
  position: relative;
  width: 32px;
  height: 32px;
}

.color-btn-label {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  width: 100%;
  height: 100%;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: 0.2s;
}

.color-btn-label:hover {
  background: #fff;
  color: #000;
}

.hidden-color-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slideIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes popIn { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.clickable-id {
  color: var(--gold);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: 0.2s;
}
.clickable-id:hover {
  color: #fff;
  text-shadow: 0 0 10px var(--gold);
}

.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s;
}

.modal-content {
  background: linear-gradient(135deg, #064e70, #032b40);
  width: 90%;
  max-width: 600px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  position: relative;
  padding: 30px;
  color: #fff;
  font-family: 'Montserrat', sans-serif;
}

.modal-close {
  position: absolute;
  top: 15px; right: 15px;
  background: none; border: none;
  font-size: 2rem; color: rgba(255,255,255,0.5);
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { color: #fff; }

.modal-header { text-align: center; margin-bottom: 20px; }
.modal-header h2 { margin: 0; font-size: 1.5rem; text-transform: uppercase; color: rgba(255,255,255,0.9); letter-spacing: 1px; }

.modal-info-bar {
  display: flex; justify-content: center; gap: 20px;
  font-size: 0.9rem; color: #a4d4ea; margin-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 10px;
}

.radar-container {
  position: relative;
  height: 300px;
  width: 100%;
  display: flex;
  justify-content: center;
}

.modal-stats-row {
  display: flex; justify-content: space-around;
  margin-top: 25px;
  background: rgba(0,0,0,0.2);
  padding: 15px;
  border-radius: 8px;
}

.stat-box { text-align: center; }
.stat-box label { display: block; font-size: 0.75rem; color: #8ab; margin-bottom: 5px; text-transform: uppercase; }
.stat-val { font-size: 1.1rem; font-weight: 800; }
.text-gold { color: var(--gold); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.tooltip-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 10px;
  cursor: pointer;
}

.qa-icon {
  width: 20px;
  height: 20px;
  opacity: 0.8;
  transition: 0.2s;
}

.qa-icon:hover {
  opacity: 1;
  transform: scale(1.1);
}

.tooltip-box {
  display: none;
  position: absolute;
  top: 30px;
  right: -10px;
  width: 320px;
  max-height: 400px;
  overflow-y: auto;
  background: #e6f7ff; 
  color: #2c3e50;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  font-size: 0.8rem;
  line-height: 1.4;
  z-index: 10000;
  text-align: left;
  border: 1px solid #b3e0ff;
}

.tooltip-box.active {
  display: block;
  animation: fadeIn 0.2s;
}

.tooltip-box h3 { margin: 0 0 10px 0; font-size: 0.95rem; color: #005f99; border-bottom: 1px solid #ccc; padding-bottom: 5px; }
.tooltip-box ul { padding-left: 15px; margin: 0; }
.tooltip-box li { margin-bottom: 8px; }
.tooltip-box strong { color: #000; font-weight: 700; }
.tooltip-box::-webkit-scrollbar { width: 6px; }
.tooltip-box::-webkit-scrollbar-thumb { background: #005f99; border-radius: 3px; }
.tooltip-box::-webkit-scrollbar-track { background: #ccc; }
.rating-tiers { margin-top: 15px; padding-top: 10px; border-top: 1px solid #ccc; display: flex; flex-wrap: wrap; gap: 5px; }
.rating-tiers strong { width: 100%; display: block; margin-bottom: 5px; }
.tier { font-size: 0.75rem; padding: 2px 6px; border-radius: 4px; color: #fff; font-weight: bold; }
.tier-s { background: #ffd700; color: #000; }
.tier-a { background: #e74c3c; }
.tier-b { background: #9b59b6; }
.tier-c { background: #3498db; }
.tier-d { background: #95a5a6; }

.app-footer {
  width: 100%;
  background: #0b0d11;
  color: #fafafa;
  text-align: center;
  padding: 20px 0;
  border-top: 1px solid rgba(255,255,255,0.05);
  position: absolute;
  bottom: 0;
  left: 0;
}

.footer-content p {
  margin: 5px 0;
  font-size: 0.75rem;
}

.floating-actions {
  position: fixed;
  bottom: 30px;
  right: 30px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  z-index: 999;
}

.floating-btn {
  background: var(--gold);
  color: #000;
  border: none;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(0,0,0,0.3);
  transition: 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.floating-btn:hover {
  transform: translateY(-5px) scale(1.1);
  box-shadow: 0 15px 30px rgba(255, 215, 0, 0.4);
}

.xlsx-btn {
  background: #27ae60;
  color: #fff;
}

.xlsx-btn:hover {
  background: #2ecc71;
  box-shadow: 0 15px 30px rgba(46, 204, 113, 0.4);
}