/* DevSecPulse Modern CyberSec Theme */
:root {
  --bg-primary: #0a0f1d;
  --bg-secondary: #11192e;
  --bg-card: #16213e;
  --bg-hover: #1c2b52;
  --border: #23355d;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --accent-cyan: #06b6d4;
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;

  --critical: #ef4444;
  --critical-bg: rgba(239, 68, 68, 0.15);
  --high: #f97316;
  --high-bg: rgba(249, 115, 22, 0.15);
  --medium: #f59e0b;
  --medium-bg: rgba(245, 158, 11, 0.15);
  --low: #3b82f6;
  --low-bg: rgba(59, 130, 246, 0.15);
  --info: #10b981;
  --info-bg: rgba(16, 185, 129, 0.15);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
}

.brand {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: bold;
  color: #fff;
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.4);
}

.brand h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #fff;
}

.brand span {
  font-size: 11px;
  color: var(--accent-cyan);
  display: block;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.nav-menu {
  list-style: none;
  padding: 20px 12px;
  flex: 1;
}

.nav-item {
  margin-bottom: 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
}

.nav-link:hover, .nav-link.active {
  background: var(--bg-hover);
  color: #fff;
}

.nav-link.active {
  background: linear-gradient(90deg, rgba(6, 182, 212, 0.15), transparent);
  border-left: 3px solid var(--accent-cyan);
  color: var(--accent-cyan);
}

.nav-link svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--info);
  box-shadow: 0 0 8px var(--info);
  display: inline-block;
  margin-right: 6px;
}

/* Main Content Area */
.main-content {
  margin-left: 260px;
  flex: 1;
  padding: 30px;
  max-width: 1400px;
}

/* Header */
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.header-title h2 {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
}

.header-title p {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}

.header-actions {
  display: flex;
  gap: 12px;
}

/* Buttons */
.btn {
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: #fff;
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.35);
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-hover);
}

.btn-danger {
  background: var(--critical);
  color: #fff;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 6px;
}

/* Stat Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-cyan);
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.stat-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  font-weight: 600;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
}

.stat-sub {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 6px;
}

.badge-critical { color: var(--critical); }
.badge-high { color: var(--high); }
.badge-medium { color: var(--medium); }
.badge-low { color: var(--low); }
.badge-info { color: var(--info); }

/* Card Containers */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th {
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 14px 16px;
  font-size: 13px;
  border-bottom: 1px solid rgba(35, 53, 93, 0.5);
  color: var(--text-main);
  vertical-align: middle;
}

tr:hover td {
  background: rgba(28, 43, 82, 0.4);
}

/* Severity Pill Badges */
.pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.pill-CRITICAL {
  background: var(--critical-bg);
  color: var(--critical);
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.pill-HIGH {
  background: var(--high-bg);
  color: var(--high);
  border: 1px solid rgba(249, 115, 22, 0.4);
}

.pill-MEDIUM {
  background: var(--medium-bg);
  color: var(--medium);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.pill-LOW {
  background: var(--low-bg);
  color: var(--low);
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.pill-INFO {
  background: var(--info-bg);
  color: var(--info);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.pill-active, .pill-valid {
  background: var(--info-bg);
  color: var(--info);
}

.pill-expiring_soon {
  background: var(--high-bg);
  color: var(--high);
}

.pill-expired {
  background: var(--critical-bg);
  color: var(--critical);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

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

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 90%;
  max-width: 600px;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
}

/* Form inputs */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent-cyan);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 12px 20px;
  background: var(--bg-card);
  border-left: 4px solid var(--accent-cyan);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.3s ease forwards;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.hidden { display: none !important; }

