:root {
  --osv-bg-dark: #0a0e17;
  --osv-bg-card: rgba(19, 27, 46, 0.85);
  --osv-border: rgba(255, 255, 255, 0.12);
  --osv-border-glow: rgba(16, 185, 129, 0.4);
  --osv-cyan: #06b6d4;
  --osv-emerald: #10b981;
  --osv-amber: #f59e0b;
  --osv-ruby: #ef4444;
  --osv-text-primary: #f8fafc;
  --osv-text-secondary: #cbd5e1;
  --osv-text-muted: #94a3b8;
  --osv-font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --osv-radius: 12px;
}

body.osv-body {
  background-color: var(--osv-bg-dark);
  color: var(--osv-text-primary);
  font-family: var(--osv-font-family);
  min-height: 100vh;
  margin: 0;
  padding-top: 0;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.osv-hero {
  position: relative;
  padding: 35px 15px 25px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(0, 229, 255, 0.08) 0%, transparent 100%);
  overflow: hidden;
}

.osv-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--osv-cyan), transparent);
}

.osv-title {
  font-size: 2.2rem;
  font-weight: 700;
  background: linear-gradient(135deg, #ffffff 0%, #00e5ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
  margin-bottom: 10px;
}

.osv-subtitle {
  color: var(--osv-text-secondary);
  font-size: 1.05rem;
  max-width: 750px;
  margin: 0 auto 15px;
  line-height: 1.6;
}

.osv-nav-tabs {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 25px;
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: 2px;
  width: 100%;
  max-width: 100%;
}

@media (min-width: 992px) {
  .osv-nav-tabs {
    justify-content: center;
  }
}

.osv-nav-tabs::-webkit-scrollbar { height: 4px; }
.osv-nav-tabs::-webkit-scrollbar-thumb { background: rgba(0, 229, 255, 0.3); border-radius: 4px; }

.osv-nav-tabs .nav-item { flex: 0 0 auto; }

.osv-nav-tabs .nav-link {
  color: var(--osv-text-secondary);
  border: none;
  border-bottom: 3px solid transparent;
  padding: 12px 18px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.25s ease;
  background: transparent;
  white-space: nowrap;
}

.osv-nav-tabs .nav-link:hover {
  color: var(--osv-cyan);
  border-color: rgba(0, 229, 255, 0.3);
}

.osv-nav-tabs .nav-link.active {
  color: #ffffff;
  border-bottom: 3px solid var(--osv-cyan);
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
}

.osv-card {
  background: var(--osv-bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--osv-border);
  border-radius: var(--osv-radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.osv-card-equal-height {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.osv-card:hover {
  border-color: var(--osv-border-glow);
  box-shadow: 0 8px 32px 0 rgba(0, 229, 255, 0.15);
}

.osv-card-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.osv-card-title i { color: var(--osv-cyan); }

.osv-input, .osv-select, .osv-textarea {
  background: rgba(11, 15, 25, 0.8) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
  border-radius: 8px !important;
  padding: 12px 14px !important;
  font-size: 0.95rem !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.osv-input:focus, .osv-select:focus, .osv-textarea:focus {
  border-color: var(--osv-cyan) !important;
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.25) !important;
  outline: none !important;
}

.osv-textarea {
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 0.88rem !important;
  line-height: 1.5;
}

.btn-osv-primary {
  background: linear-gradient(135deg, #00b0ff 0%, #00e5ff 100%);
  color: #070a12;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  padding: 12px 22px;
  transition: all 0.25s ease;
  box-shadow: 0 4px 15px rgba(0, 229, 255, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-osv-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 229, 255, 0.5);
  color: #070a12;
}

.btn-osv-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--osv-text-primary);
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 10px 16px;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-osv-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border-color: var(--osv-cyan);
}

.osv-dropzone {
  border: 2px dashed rgba(0, 229, 255, 0.3);
  border-radius: var(--osv-radius);
  padding: 25px 15px;
  text-align: center;
  background: rgba(0, 229, 255, 0.02);
  cursor: pointer;
  transition: all 0.25s ease;
}

.osv-dropzone:hover, .osv-dropzone.dragover {
  border-color: var(--osv-cyan);
  background: rgba(0, 229, 255, 0.08);
  transform: scale(1.01);
}

.osv-dropzone-icon {
  font-size: 2.4rem;
  color: var(--osv-cyan);
  margin-bottom: 8px;
}

.osv-stat-card {
  background: rgba(11, 15, 25, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 14px 10px;
  text-align: center;
}

.osv-stat-number {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 4px;
}

.osv-stat-label {
  font-size: 0.78rem;
  color: var(--osv-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.badge-severity-critical {
  background: rgba(255, 23, 68, 0.2);
  color: #ff1744;
  border: 1px solid rgba(255, 23, 68, 0.5);
  font-weight: 700;
}

.badge-severity-high {
  background: rgba(255, 145, 0, 0.2);
  color: #ff9100;
  border: 1px solid rgba(255, 145, 0, 0.5);
  font-weight: 700;
}

.badge-severity-medium {
  background: rgba(255, 171, 0, 0.2);
  color: #ffab00;
  border: 1px solid rgba(255, 171, 0, 0.5);
  font-weight: 700;
}

.badge-severity-low {
  background: rgba(0, 230, 118, 0.2);
  color: #00e676;
  border: 1px solid rgba(0, 230, 118, 0.5);
  font-weight: 700;
}

.badge-severity-unknown {
  background: rgba(148, 163, 184, 0.2);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.5);
  font-weight: 600;
}

/* Clear, High Contrast Table UX/UI */
.osv-table-container {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
  border: 1px solid rgba(0, 229, 255, 0.25);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  margin-bottom: 20px;
  background: rgba(15, 23, 42, 0.95);
  display: block;
  width: 100%;
}

.osv-table-container::-webkit-scrollbar {
  height: 6px;
}

.osv-table-container::-webkit-scrollbar-thumb {
  background: rgba(0, 229, 255, 0.4);
  border-radius: 4px;
}

.osv-table {
  width: 100%;
  color: var(--osv-text-primary) !important;
  margin-bottom: 0;
  border-collapse: separate;
  border-spacing: 0;
  background: transparent !important;
}

.osv-table th {
  background: linear-gradient(180deg, rgba(16, 26, 48, 0.98) 0%, rgba(10, 16, 30, 0.98) 100%) !important;
  color: var(--osv-cyan) !important;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.82rem;
  letter-spacing: 0.8px;
  padding: 15px 18px;
  border-bottom: 2px solid rgba(0, 229, 255, 0.35);
  white-space: nowrap !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
}

.osv-table tr, .osv-table td {
  background-color: rgba(15, 23, 42, 0.95) !important;
  color: var(--osv-text-primary) !important;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  vertical-align: middle;
  white-space: nowrap !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
  font-size: 0.92rem;
}

.osv-table tbody tr:nth-child(even) td,
.osv-table tbody tr:nth-child(even) {
  background-color: rgba(22, 34, 60, 0.95) !important;
  color: var(--osv-text-primary) !important;
}

.osv-table tbody tr:hover td,
.osv-table tbody tr:hover {
  background-color: rgba(0, 229, 255, 0.15) !important;
  color: #ffffff !important;
  transition: background-color 0.2s ease;
}

.osv-intel-card {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 12px;
  padding: 20px;
  margin-top: 15px;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.osv-remediation-box {
  background: rgba(0, 230, 118, 0.08);
  border-left: 4px solid var(--osv-emerald);
  padding: 14px 16px;
  border-radius: 0 8px 8px 0;
  margin: 15px 0;
}

.osv-remediation-title {
  color: var(--osv-emerald);
  font-weight: 700;
  font-size: 0.98rem;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.osv-result-banner-success {
  background: rgba(0, 230, 118, 0.12) !important;
  border: 1px solid #00e676 !important;
  color: #00e676 !important;
  border-radius: 10px;
  padding: 16px 20px;
  font-size: 1rem;
  font-weight: 600;
  margin: 20px 0;
  box-shadow: 0 4px 20px rgba(0, 230, 118, 0.2);
  display: flex;
  align-items: center;
  gap: 12px;
}

.osv-result-banner-success strong {
  color: #ffffff !important;
  font-weight: 700;
}

.osv-result-banner-warning {
  background: rgba(255, 171, 0, 0.12) !important;
  border: 1px solid #ffab00 !important;
  color: #ffab00 !important;
  border-radius: 10px;
  padding: 16px 20px;
  font-size: 1rem;
  font-weight: 600;
  margin: 20px 0;
  box-shadow: 0 4px 20px rgba(255, 171, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 12px;
}

.osv-result-banner-warning strong {
  color: #ffffff !important;
  font-weight: 700;
}

.osv-skeleton-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(0, 229, 255, 0.12);
  border-radius: 12px;
  padding: 20px;
  margin-top: 15px;
}

/* High-Contrast External References & Advisories List */
.osv-ref-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.osv-ref-item {
  background: rgba(11, 15, 25, 0.85);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.2s ease;
  word-break: break-all;
}

.osv-ref-item:hover {
  background: rgba(15, 23, 42, 0.95);
  border-color: var(--osv-cyan);
  box-shadow: 0 4px 15px rgba(0, 229, 255, 0.15);
}

.osv-ref-item a,
.osv-ref-item a:visited,
.osv-ref-item a:active,
.osv-ref-item a:focus {
  color: #ffffff !important;
  text-decoration: none !important;
}

.osv-ref-item a:hover {
  color: var(--osv-cyan) !important;
  text-decoration: underline !important;
}

.badge-ref-type {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  flex-shrink: 0;
  display: inline-block;
}

.badge-ref-advisory {
  background: rgba(255, 23, 68, 0.2) !important;
  color: #ff1744 !important;
  border: 1px solid rgba(255, 23, 68, 0.5) !important;
}

.badge-ref-fix {
  background: rgba(0, 230, 118, 0.2) !important;
  color: #00e676 !important;
  border: 1px solid rgba(0, 230, 118, 0.5) !important;
}

.badge-ref-web {
  background: rgba(0, 229, 255, 0.2) !important;
  color: #00e5ff !important;
  border: 1px solid rgba(0, 229, 255, 0.5) !important;
}

.badge-ref-default {
  background: rgba(148, 163, 184, 0.2) !important;
  color: #94a3b8 !important;
  border: 1px solid rgba(148, 163, 184, 0.5) !important;
}

.osv-skeleton-line {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 25%, rgba(0, 229, 255, 0.15) 50%, rgba(255, 255, 255, 0.04) 75%);
  background-size: 200% 100%;
  animation: osvSkeletonWave 1.4s ease-in-out infinite;
  border-radius: 6px;
  display: block;
}

@keyframes osvSkeletonWave {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.osv-spinner {
  width: 24px;
  height: 24px;
  border: 2.5px solid rgba(0, 229, 255, 0.1);
  border-left-color: var(--osv-cyan);
  border-radius: 50%;
  animation: osvSpin 0.8s linear infinite;
  display: inline-block;
}

@keyframes osvSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Custom Popup Modal Overlay */
.osv-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(5, 8, 16, 0.85);
  backdrop-filter: blur(10px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

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

.osv-modal-content {
  background: rgba(18, 26, 44, 0.95);
  border: 1px solid var(--osv-cyan);
  box-shadow: 0 12px 40px rgba(0, 229, 255, 0.25);
  border-radius: 16px;
  padding: 28px 24px;
  width: 90%;
  max-width: 440px;
  text-align: center;
  transform: translateY(20px);
  transition: transform 0.25s ease;
}

.osv-modal-overlay.active .osv-modal-content {
  transform: translateY(0);
}

.osv-modal-icon {
  font-size: 2.6rem;
  margin-bottom: 12px;
}

@media (min-width: 992px) {
  .osv-card-equal-height {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
}

@media (max-width: 991px) {
  .osv-card-equal-height {
    height: auto !important;
  }
  .osv-card {
    margin-bottom: 24px !important;
  }
}

@media (max-width: 768px) {
  body.osv-body { padding-top: 65px; }
  #header { height: 65px !important; padding: 8px 0 !important; }
  #header #logo h1 { font-size: 20px !important; letter-spacing: 1px !important; }
  .osv-hero { padding: 22px 10px 15px; }
  .osv-title { font-size: 1.6rem; }
  .osv-subtitle { font-size: 0.92rem; }
  .osv-card, .osv-intel-card { padding: 16px; }
  .osv-stat-number { font-size: 1.4rem; }
  .osv-stat-label { font-size: 0.7rem; }
  .osv-table th, .osv-table td { padding: 10px 12px; font-size: 0.85rem; }
}

#batchFilterGroup {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex-wrap: wrap !important;
}

#batchFilterGroup .btn {
  border-radius: 8px !important;
  margin-right: 10px !important;
}

#batchFilterGroup .btn:last-child {
  margin-right: 0 !important;
}

.osv-export-group {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex-wrap: wrap !important;
}

.osv-export-group .btn {
  border-radius: 8px !important;
  margin-right: 10px !important;
}

.osv-export-group .btn:last-child {
  margin-right: 0 !important;
}

@media (max-width: 576px) {
  #header #logo h1 { font-size: 16px !important; }
  #header .btn-osv-secondary { padding: 6px 10px !important; font-size: 0.78rem !important; width: auto !important; }
  .osv-title { font-size: 1.35rem; }
  .osv-subtitle { font-size: 0.85rem; }
  .osv-nav-tabs .nav-link { padding: 8px 10px; font-size: 0.82rem; }
  .osv-card-title { font-size: 1.02rem; }
  .btn-sm { width: auto !important; }
  .d-flex > .btn { margin-bottom: 0; }
}
