:root {
  --bg-dark: #0f172a;
  --bg-card: rgba(30, 41, 59, 0.7);
  --text-main: #f8fafc;
  --text-dim: #94a3b8;
  
  --border-light: rgba(255, 255, 255, 0.1);
  --border-focus: #3b82f6;

  --accent-color: #3b82f6;
  --success-color: #10b981;
  --danger-color: #ef4444;

  --danger-bg: rgba(239, 68, 68, 0.15);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Roboto', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  padding: 2rem 1rem;
  overflow-x: hidden;
  position: relative;
}

.light-beam {
  position: absolute;
  filter: blur(120px);
  border-radius: 50%;
  opacity: 0.3;
  z-index: -1;
  animation: float 15s infinite alternate ease-in-out;
}
.beam-1 { width: 600px; height: 600px; background: #2e1065; top: 0; left: 10%; }
.beam-2 { width: 500px; height: 500px; background: #0c4a6e; bottom: 0; right: 10%; animation-delay: -5s; }

@keyframes float {
  0% { transform: translateY(0); }
  100% { transform: translateY(100px); }
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-light);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
}

header {
  padding: 2rem;
  text-align: center;
  border-bottom: 1px solid var(--border-light);
  background: rgba(15, 23, 42, 0.5);
}
header h1 { font-size: 2rem; color: #e2e8f0; margin-bottom: 0.5rem; }

main { padding: 2rem; }

.hidden { display: none !important; }

/* Upload Area */
.upload-section {
  padding: 4rem 2rem;
  text-align: center;
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  transition: all 0.3s;
  cursor: default;
  margin: 1rem 0;
  background: rgba(0,0,0,0.2);
}
.upload-section.dragover { border-color: var(--accent-color); background: rgba(59, 130, 246, 0.1); }
.upload-icon { width: 64px; height: 64px; color: var(--accent-color); margin: 0 auto 1.5rem auto; }
.upload-section h3 { margin-bottom: 0.5rem; font-size: 1.25rem; }
.upload-section p { color: var(--text-dim); margin-bottom: 1.5rem; }

.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.2s;
}
.btn-secondary { background: rgba(255,255,255,0.1); color: #fff; border: 1px solid rgba(255,255,255,0.2); }
.btn-secondary:hover { background: rgba(255,255,255,0.2); }
.btn-danger { background: var(--danger-color); color: #fff; width: 100%; margin-top: 1.5rem; padding: 1rem;}
.btn-danger:hover { background: #b91c1c; }

/* StatusBar */
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  background: rgba(0,0,0,0.2);
  padding: 1rem 1.5rem;
  border-radius: 8px;
}
.status-safe { color: var(--success-color); font-weight: bold; border: 1px solid var(--success-color); padding: 0.2rem 0.5rem; border-radius: 4px; background: rgba(16,185,129,0.1);}
.status-danger { color: var(--danger-color); font-weight: bold; border: 1px solid var(--danger-color); padding: 0.2rem 0.5rem; border-radius: 4px; background: var(--danger-bg); animation: pulseSafe 1s infinite alternate;}

/* Table */
.report-table { width: 100%; border-collapse: collapse; background: rgba(0,0,0,0.1); border-radius: 8px; overflow: hidden;}
.report-table th, .report-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-light);
}
.report-table th { background: rgba(0,0,0,0.3); font-weight: 500; text-transform: uppercase; font-size: 0.85rem; color: var(--text-dim); text-align: left; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }

/* Group Headers Format from Excel */
.group-header td {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.2) 0%, transparent 100%);
  font-weight: 700; font-size: 1.1rem; color: #60a5fa; border-top: 2px solid #3b82f6; 
}
.sub-group-header td {
  background: rgba(255,255,255,0.03); font-weight: 500; color: #94a3b8; padding-left: 2rem !important; 
}

.data-row td:first-child { padding-left: 3rem; color: #e2e8f0; }

.val-box {
  display: inline-block;
  padding: 0.4rem 1rem;
  border-radius: 4px;
  background: rgba(0,0,0,0.3);
  font-weight: 600;
  letter-spacing: 0.5px;
  min-width: 100px;
  text-align: right;
  border: 1px solid transparent;
}
.val-box.error {
  background: var(--danger-bg);
  border-color: var(--danger-color);
  color: #fca5a5;
  box-shadow: 0 0 10px rgba(239,68,68,0.3);
  animation: shake 0.4s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.75); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; z-index: 100;
  opacity: 1; visibility: visible; transition: opacity 0.3s;
}
.modal-overlay.hidden { opacity: 0; visibility: hidden; }

.modal-content {
  width: 90%; max-width: 450px; background: #1e293b;
  border: 1px solid rgba(239, 68, 68, 0.4); box-shadow: 0 0 40px rgba(239, 68, 68, 0.3);
  padding: 2rem; border-radius: 12px; text-align: center;
  transform: translateY(0); transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.modal-overlay.hidden .modal-content { transform: translateY(30px); }

.alert-icon-container {
  width: 64px; height: 64px; background: var(--danger-bg); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 1.5rem auto;
  animation: pulse 1.5s infinite;
}
.alert-icon { width: 36px; height: 36px; color: var(--danger-color); }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(239,68,68,0.5); }
  70% { box-shadow: 0 0 0 15px rgba(239,68,68,0); }
  100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
}

.modal-content h2 { color: #fca5a5; margin-bottom: 0.5rem; font-size: 1.5rem; }
.modal-content p { color: var(--text-dim); margin-bottom: 1.5rem; font-size: 0.95rem; }

.error-list-wrapper {
  background: rgba(0,0,0,0.3); padding: 1rem; border-radius: 6px; text-align: left;
  max-height: 150px; overflow-y: auto;
}
#error-list { list-style: none; }
#error-list li { margin-bottom: 0.5rem; font-size: 0.9rem; color: #f87171; border-left: 2px solid var(--danger-color); padding-left: 10px; }
