:root {
  --bg-dark: #0f172a;
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --primary: #8b5cf6;
  --primary-hover: #7c3aed;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
}

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

.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
}

.error {
  color: #ef4444;
  margin-top: 12px;
  font-size: 14px;
}

/* Views */
.view {
  display: none;
  height: 100vh;
  width: 100vw;
}

.view.active {
  display: flex;
}

/* Auth */
#auth-view {
  justify-content: center;
  align-items: center;
}

.auth-container {
  padding: 40px;
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.auth-container h2 {
  margin-bottom: 8px;
  font-weight: 600;
}

.auth-container p {
  color: var(--text-muted);
  margin-bottom: 24px;
}

form input,
form textarea {
  width: 100%;
  padding: 12px;
  margin-bottom: 16px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.2);
  color: white;
  outline: none;
  transition: border 0.3s ease;
}

form input:focus,
form textarea:focus {
  border-color: var(--primary);
}

button {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.1s ease;
}

button:hover {
  background: var(--primary-hover);
}

button:active {
  transform: scale(0.98);
}

.toggle-auth {
  margin-top: 16px;
  cursor: pointer;
  font-size: 14px;
  color: var(--primary);
}

/* Main App */
.sidebar {
  width: 250px;
  height: calc(100vh - 32px);
  margin: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.status-container {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.status-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.status-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
}

.status-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #ef4444;
  /* default red */
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
  transition: all 0.3s ease;
}

.status-dot.ok {
  background-color: #10b981;
  /* green */
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.logo {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 40px;
  background: -webkit-linear-gradient(#c084fc, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  list-style: none;
}

.nav-links li {
  padding: 12px 16px;
  margin-bottom: 8px;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s;
  color: var(--text-muted);
}

.nav-links li:hover {
  color: white;
}

.nav-links li.active {
  color: white;
}

.content {
  flex: 1;
  padding: 16px 16px 16px 0;
  height: 100vh;
}

.tab {
  display: none;
  height: 100%;
}

.tab.active {
  display: block;
}

/* Chat */
.chat-container {
  height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.chat-history {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-right: 10px;
}

.chat-history::-webkit-scrollbar {
  width: 6px;
}

.chat-history::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.message {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 12px;
  line-height: 1.6;
}

.message.user {
  align-self: flex-end;
  background: var(--primary);
  white-space: pre-wrap;
}

.message.ai {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Markdown styling inside AI messages */
.message.ai p {
  margin-bottom: 0.75rem;
}

.message.ai p:last-child {
  margin-bottom: 0;
}

.message.ai ul,
.message.ai ol {
  margin-bottom: 0.75rem;
  padding-left: 1.5rem;
}

.message.ai ul:last-child,
.message.ai ol:last-child {
  margin-bottom: 0;
}

.message.ai li {
  margin-bottom: 0.35rem;
}

.message.ai li:last-child {
  margin-bottom: 0;
}

.message.ai strong {
  color: #ffffff;
  font-weight: 600;
}

.message.ai h1,
.message.ai h2,
.message.ai h3,
.message.ai h4 {
  color: #ffffff;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.message.ai code {
  background: rgba(255, 255, 255, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.875em;
}

.message.ai pre {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 0.75rem;
}

.message.ai pre code {
  background: transparent;
  padding: 0;
  border-radius: 0;
  font-size: 0.875em;
}

/* ChatGPT style Streaming cursor indicator */
.message.ai.streaming>*:last-child::after,
.message.ai.streaming:not(:has(*))::after {
  content: '▊';
  display: inline-block;
  margin-left: 4px;
  animation: cursor-blink 1s steps(2, start) infinite;
  color: var(--primary);
  vertical-align: middle;
}

@keyframes cursor-blink {
  to {
    opacity: 0;
  }
}

/* --- Markdown Table Component --- */
/* Responsible solely for formatting, borders, and layout of tables within AI messages */
.message.ai table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.9em;
}

/* Responsible for header gradients and contrast */
.message.ai th {
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.25) 0%, rgba(139, 92, 246, 0.1) 100%);
  color: #ffffff;
  font-weight: 600;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.message.ai th:last-child {
  border-right: none;
}

/* Responsible for table cell layout and cell borders */
.message.ai td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  vertical-align: middle;
}

.message.ai td:last-child {
  border-right: none;
}

.message.ai tr:last-child td {
  border-bottom: none;
}

/* Responsible for row-level styling (zebra-striping and row hover effects for readability) */
.message.ai tr:nth-child(even) td {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0.05) 50%, rgba(255, 255, 255, 0.02) 100%);
}

.message.ai tr:nth-child(odd) td {
  background: rgba(255, 255, 255, 0.01);
}

.message.ai tr:hover td {
  background: rgba(255, 255, 255, 0.06);
}

.chat-input-area {
  display: flex;
  gap: 12px;
}

.chat-input-area input {
  margin-bottom: 0;
  flex: 1;
}

.chat-input-area button {
  width: auto;
  padding: 0 24px;
}

/* Settings / Knowledge */
.settings-container,
.knowledge-container {
  padding: 40px;
  height: calc(100vh - 32px);
  overflow-y: auto;
}

/* Settings Dashboard overhaul style */
.settings-header {
  margin-bottom: 32px;
}

.settings-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.settings-header p {
  color: var(--text-muted);
  font-size: 14px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 24px;
  margin-top: 16px;
}

.settings-card {
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  height: fit-content;
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.settings-card:hover {
  border-color: rgba(255, 255, 255, 0.08);
}

.card-header {
  padding: 24px;
  display: flex;
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.card-icon {
  font-size: 22px;
  background: rgba(139, 92, 246, 0.12);
  color: var(--primary);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(139, 92, 246, 0.1);
}

.card-title-group h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
}

.card-title-group p {
  font-size: 13px;
  color: var(--text-muted);
}

.card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#persona-input {
  width: 100%;
  min-height: 120px;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-main);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  transition: all 0.3s ease;
}

#persona-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
  background: rgba(0, 0, 0, 0.25);
}

.action-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.primary-btn {
  width: auto;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

.primary-btn:hover {
  background: linear-gradient(135deg, #9b6cff 0%, #8b5cf6 100%);
  box-shadow: 0 6px 16px rgba(139, 92, 246, 0.3);
}

.sec-btn {
  width: auto;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.sec-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.status-msg {
  font-size: 13px;
  color: #10b981;
  font-weight: 500;
}

/* API Key list styling */
.api-key-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 4px;
  list-style: none;
}

.api-key-list::-webkit-scrollbar {
  width: 4px;
}

.api-key-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.api-key-item {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 12px 16px;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: all 0.2s ease;
}

.api-key-item:hover {
  background: rgba(0, 0, 0, 0.25);
  border-color: rgba(255, 255, 255, 0.08);
}

.api-key-item code {
  font-family: SFMono-Regular, Consolas, monospace;
  font-size: 13px;
  color: #c084fc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.api-key-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.copy-key-btn,
.delete-key-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  font-size: 12px;
}

.copy-key-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.copy-key-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
}

.delete-key-btn {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #f87171;
}

.delete-key-btn:hover {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

/* Premium Document List styling */
.doc-list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.doc-list .doc-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 14px 18px;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.doc-list .doc-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.doc-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.doc-icon {
  font-size: 20px;
  background: rgba(139, 92, 246, 0.15);
  color: var(--primary);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}

.doc-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.doc-name {
  font-weight: 500;
  font-size: 14px;
  color: var(--text-main);
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-date {
  font-size: 12px;
  color: var(--text-muted);
}

.delete-doc-btn {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.2);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  font-size: 14px;
}

.delete-doc-btn:hover {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
  transform: scale(1.05);
}

.delete-doc-btn:active {
  transform: scale(0.95);
}

/* Sidebar Nav sliding indicator */
.nav-indicator-bg {
  position: absolute;
  left: 0;
  width: 100%;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.35) 0%, rgba(139, 92, 246, 0.1) 100%);
  border: 1px solid rgba(139, 92, 246, 0.4);
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
}

.nav-links {
  position: relative;
}

.nav-links li {
  position: relative;
  z-index: 2;
  transition: color 0.25s ease;
}

/* Pulse animation for active status dots */
.status-dot.ok {
  animation: pulse-green 2s infinite ease-in-out;
}

@keyframes pulse-green {

  0%,
  100% {
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
    background-color: #10b981;
  }

  50% {
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.9);
    background-color: #34d399;
  }
}

/* Chat loading dots */
.chat-loading-dots {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  height: 24px;
}

.loading-dot {
  width: 8px;
  height: 8px;
  background-color: var(--primary);
  border-radius: 50%;
  display: inline-block;
}

/* Drag and Drop Upload Zone */
.upload-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.upload-drop-zone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 32px 20px;
  text-align: center;
  background: rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.upload-drop-zone:hover {
  border-color: var(--primary);
  background: rgba(139, 92, 246, 0.04);
}

.upload-drop-zone.drag-over {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.08);
  transform: scale(1.02);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.15);
}

.drop-zone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.upload-icon {
  font-size: 32px;
  margin-bottom: 4px;
}

.drop-zone-text {
  font-weight: 500;
  font-size: 15px;
  color: var(--text-main);
}

.drop-zone-subtext {
  font-size: 12px;
  color: var(--text-muted);
}

/* Selected File Panel */
.selected-file-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px 16px;
}

.selected-file-info {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  max-width: 70%;
}

.file-icon {
  font-size: 20px;
  color: var(--primary);
  flex-shrink: 0;
}

.file-name {
  font-weight: 500;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-size {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.upload-action-btn {
  width: auto;
  padding: 8px 16px;
  font-size: 13px;
}

/* Upload Progress UI */
.upload-progress-container {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.upload-progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 500;
}

.progress-bar-bg {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary) 0%, #a78bfa 100%);
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* Upload Spinner */
.upload-spinner {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.spinner-ring {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s infinite linear;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.upload-status-msg {
  font-size: 14px;
  font-weight: 500;
  transition: opacity 0.3s ease;
}

/* ==========================================================================
   AI Security & Hardening Dashboard
   ========================================================================== */

.security-container {
  padding: 40px;
  height: calc(100vh - 32px);
  overflow-y: auto;
}

.security-header {
  margin-bottom: 32px;
}

.security-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.security-header p {
  color: var(--text-muted);
  font-size: 14px;
}

/* Stats Grid */
.security-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.security-stat-card {
  padding: 20px 24px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  gap: 20px;
  transition: all 0.3s ease;
}

.security-stat-card:hover {
  border-color: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

.security-stat-card .stat-icon {
  font-size: 28px;
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}

.font-high-red {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

.font-medium-orange {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}

.font-low-green {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.security-stat-card .stat-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.security-stat-card .stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1;
}

.security-stat-card .stat-label {
  font-size: 13px;
  color: var(--text-muted);
}

/* Layout Grid */
.security-layout-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .security-layout-grid {
    grid-template-columns: 1fr;
  }
}

.security-card {
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color 0.3s ease;
}

.security-card:hover {
  border-color: rgba(255, 255, 255, 0.08);
}

.shield-indicators {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.shield-indicator-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.shield-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.2);
}

.shield-status-dot.active {
  background: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.8);
  animation: pulse-shield-green 2s infinite ease-in-out;
}

@keyframes pulse-shield-green {

  0%,
  100% {
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
  }

  50% {
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.9);
  }
}

.shield-details h3 {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 2px;
}

.shield-details p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Log Table */
.log-table-card {
  min-height: 380px;
}

.log-table-body {
  padding: 0;
  overflow: hidden;
}

.log-table-wrapper {
  max-height: 400px;
  overflow-y: auto;
}

.log-table-wrapper::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.log-table-wrapper::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

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

.log-table th {
  position: sticky;
  top: 0;
  background: #181c30;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 10;
}

.log-table td {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 13px;
  color: var(--text-main);
  vertical-align: middle;
}

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

.log-table tr:last-child td {
  border-bottom: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge.severity-low {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge.severity-medium {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge.severity-high {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge.severity-critical {
  background: rgba(185, 28, 28, 0.25);
  color: #fca5a5;
  border: 1px solid rgba(185, 28, 28, 0.3);
  animation: pulse-badge-critical 1.5s infinite;
}

@keyframes pulse-badge-critical {

  0%,
  100% {
    background: rgba(185, 28, 28, 0.25);
  }

  50% {
    background: rgba(185, 28, 28, 0.45);
    box-shadow: 0 0 8px rgba(185, 28, 28, 0.4);
  }
}

.badge.event-injection {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
}

.badge.event-rate-limit {
  background: rgba(236, 72, 153, 0.15);
  color: #f472b6;
}

.badge.event-length {
  background: rgba(100, 116, 139, 0.15);
  color: #94a3b8;
}

.badge.event-pii {
  background: rgba(20, 184, 166, 0.15);
  color: #2dd4bf;
}

/* Hermes Adaptive Security Styling */
.security-adaptive-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .security-adaptive-grid {
    grid-template-columns: 1fr;
  }
}

.rules-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 350px;
  overflow-y: auto;
  padding-right: 4px;
}

.rules-list::-webkit-scrollbar {
  width: 4px;
}

.rules-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.rule-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 14px 18px;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.rule-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.rule-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
  overflow: hidden;
}

.rule-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.rule-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-main);
}

.rule-pattern {
  font-family: SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  color: #c084fc;
  background: rgba(0, 0, 0, 0.2);
  padding: 4px 8px;
  border-radius: 6px;
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.rule-date {
  font-size: 11px;
  color: var(--text-muted);
}

.rule-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.rule-action-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  transition: all 0.2s ease;
  padding: 0;
  font-size: 13px;
}

.rule-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
}

.rule-action-btn.approve-btn:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
}

.rule-action-btn.reject-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
}

.rule-action-btn.delete-btn {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.rule-action-btn.delete-btn:hover {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

.badge-status.status-pending {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-status.status-active {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-status.status-rejected {
  background: rgba(100, 116, 139, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.2);
}

/* Responsive Mobile Styles */
@media (max-width: 768px) {
  #main-view {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    margin: 0;
    padding: 12px;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
    z-index: 100;
  }

  .logo {
    margin-bottom: 0;
    font-size: 20px;
    width: 100%;
    text-align: center;
    padding-bottom: 8px;
  }

  .nav-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
  }

  .nav-links li {
    padding: 8px 12px;
    margin-bottom: 0;
    font-size: 14px;
  }

  #chat-sessions-list,
  .status-container,
  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: block !important;
  }

  .content {
    padding: 12px;
    height: calc(100vh - 120px);
    flex: 1;
  }

  .chat-container,
  .settings-container,
  .knowledge-container,
  .security-container {
    height: 100%;
    padding: 16px;
  }

  .chat-input-area {
    flex-direction: column;
  }

  .chat-input-area button {
    width: 100%;
    padding: 12px;
  }

  .security-layout-grid,
  .security-adaptive-grid {
    grid-template-columns: 1fr;
  }

  .auth-container {
    padding: 24px;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }
}