/* ScatterID Clean Enterprise Theme (Jade Green Accent, No Rainbow Gradients) */
:root {
  --bg-dark: #080a0f;
  --bg-card: rgba(15, 19, 27, 0.9);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.18);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  
  --primary: #10b981; /* Brand Book Jade Green */
  --primary-glow: rgba(16, 185, 129, 0.15);
  --jade-green: #10b981;
  --accent-green: #10b981;
  
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --error: #ef4444;
  --error-bg: rgba(239, 68, 68, 0.12);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.12);
  
  --font-sans: 'Roboto', 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', 'Roboto Mono', monospace;
}

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

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

/* Background Atmosphere */
.glow-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at 50% 0%, rgba(16, 185, 129, 0.05) 0%, transparent 60%);
  z-index: -1;
  pointer-events: none;
}

/* Sidebar Navigation (Collapsible) */
.sidebar {
  width: 260px;
  background-color: rgba(11, 14, 21, 0.98);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed {
  width: 68px;
}

.logo {
  padding: 20px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}

.brand-logo-img {
  height: 28px;
  width: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

.logo-text {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.5px;
  color: #ffffff;
  white-space: nowrap;
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-text,
.sidebar.collapsed .sidebar-footer-text {
  display: none;
}

.sidebar-toggle-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.sidebar-toggle-btn:hover {
  color: #fff;
  border-color: var(--primary);
}

.nav-links {
  list-style: none;
  padding: 16px 10px;
  flex: 1;
  overflow-y: auto;
}

.nav-links li {
  margin-bottom: 6px;
}

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

.nav-link:hover {
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.04);
}

.nav-link.active {
  color: #ffffff;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  font-weight: 700;
}

.nav-icon-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.nav-link.active .nav-icon-dot {
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-color);
  background: rgba(7, 9, 14, 0.5);
}

.system-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.sidebar-footer-text {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--success);
  box-shadow: 0 0 8px var(--success);
  flex-shrink: 0;
}

/* Main Layout (Expands horizontally when sidebar collapses) */
.main-content {
  margin-left: 260px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-content.expanded {
  margin-left: 68px;
}

.top-header {
  padding: 16px 28px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(8, 10, 15, 0.95);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 90;
}

.header-left h2 {
  font-size: 1.3rem;
  font-weight: 700;
}

.subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.content-body {
  padding: 24px 28px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Tab Panes */
.tab-pane {
  display: none;
  animation: fadeIn 0.25s ease;
  flex: 1;
}

.tab-pane.active {
  display: flex;
  flex-direction: column;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Shared Cards & Glass Panels */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 20px;
  position: relative;
  backdrop-filter: blur(12px);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.card-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
}

/* Solid Clean Badges (No Rainbow Gradients) */
.badge {
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

.badge.green {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--primary);
}

/* Clean Buttons (Theme jade green) */
.btn {
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background-color: var(--primary);
  color: #07090e;
  font-weight: 700;
}

.btn-primary:hover {
  background-color: #0d9668;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-hover);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 0.78rem;
  border-radius: 5px;
}

/* Status Badges */
.status-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.status-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(7, 9, 14, 0.6);
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.service-name {
  font-size: 0.85rem;
  font-weight: 500;
}

.status-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
}

.status-badge.running {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge.stopped, .status-badge.offline {
  background: rgba(239, 68, 68, 0.15);
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-badge.checking {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* 5-Node Shard Matrix Grid */
.shard-matrix-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.shard-node-card {
  background: rgba(7, 9, 14, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shard-node-card.healthy { border-top: 3px solid var(--success); }
.shard-node-card.offline { border-top: 3px solid var(--error); }

.shard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.shard-title {
  font-size: 0.85rem;
  font-weight: 700;
}

.shard-details {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.shard-details span {
  font-family: var(--font-mono);
  color: var(--text-main);
}

/* Full Viewport Consoles (Fabric Logs & Diagnostics) */
.log-card.full-viewport, .console-box.full-viewport {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 200px);
  min-height: 520px;
}

.log-container, .console-body {
  background: #05070a;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.5;
  color: #38bdf8;
  overflow: hidden;
  height: 100%;
  max-height: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
}

#log-output {
  white-space: pre-wrap;
  word-break: break-all;
  height: 100%;
  max-height: 100%;
  overflow-y: auto;
  margin: 0;
  padding-right: 8px;
  color: #a7f3d0;
  font-family: var(--font-mono);
}

.log-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.log-controls select {
  background: rgba(7, 9, 14, 0.8);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  outline: none;
}

/* Redesigned Clean Architecture Layout */
.arch-flow-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.arch-card {
  background: rgba(7, 9, 14, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.arch-card h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
}

.arch-card p {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.arch-steps-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.arch-step-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(7, 9, 14, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.arch-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--primary);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  flex-shrink: 0;
}

.arch-step-info {
  font-size: 0.82rem;
  color: var(--text-main);
}

/* Grid System */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.mb-4 { margin-bottom: 16px; }

/* Table Styles */
.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  background: rgba(7, 9, 14, 0.6);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
}

td {
  font-family: var(--font-mono);
}

.expandable-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}

.cell-text {
  word-break: break-all;
  transition: all 0.2s ease;
}

.cell-text.expanded {
  color: var(--primary) !important;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

.btn-copy-sm {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-copy-sm:hover {
  background: var(--primary);
  color: #07090e;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .grid-2, .arch-flow-grid, .shard-matrix-grid { grid-template-columns: 1fr; }
}

/* Settings and API Key Styles */
.mono-input {
  background: rgba(8, 10, 15, 0.8);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  padding: 8px 12px;
  border-radius: 4px;
  outline: none;
  transition: border-color 0.2s;
}

.mono-input:focus {
  border-color: var(--primary);
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
}

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

.badge.purple {
  background: rgba(168, 85, 247, 0.12);
  color: #a855f7;
  border: 1px solid rgba(168, 85, 247, 0.2);
}

/* Cryptographic Guarantees Cards */
.crypto-guarantees-title {
  margin-bottom: 24px;
  animation: fadeIn 0.4s ease-out;
}
.crypto-guarantees-title h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 6px;
}
.crypto-guarantees-title p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.crypto-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 12px;
  backdrop-filter: blur(12px);
  animation: fadeIn 0.4s ease-out;
}

/* Hover effects with color accents */
.crypto-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.crypto-card.card-mldsa:hover {
  border-color: var(--primary);
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.12);
}

.crypto-card.card-shamir:hover {
  border-color: #06b6d4;
  box-shadow: 0 0 25px rgba(6, 182, 212, 0.12);
}

.crypto-card.card-vault:hover {
  border-color: #a855f7;
  box-shadow: 0 0 25px rgba(168, 85, 247, 0.12);
}

.crypto-card.card-fabric:hover {
  border-color: #fbbf24;
  box-shadow: 0 0 25px rgba(251, 191, 36, 0.12);
}

.crypto-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.crypto-number {
  font-family: var(--font-mono);
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  color: rgba(255, 255, 255, 0.02);
  position: absolute;
  top: 15px;
  right: 15px;
  transition: color 0.3s ease;
  user-select: none;
}

.crypto-card:hover .crypto-number {
  color: rgba(255, 255, 255, 0.06);
}

.crypto-card.card-mldsa:hover .crypto-number {
  color: rgba(16, 185, 129, 0.06);
}

.crypto-card.card-shamir:hover .crypto-number {
  color: rgba(6, 182, 212, 0.06);
}

.crypto-card.card-vault:hover .crypto-number {
  color: rgba(168, 85, 247, 0.06);
}

.crypto-card.card-fabric:hover .crypto-number {
  color: rgba(251, 191, 36, 0.06);
}

.crypto-card-title {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  z-index: 1;
}

.crypto-card-desc {
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
  z-index: 1;
}

/* More Badge Colors */
.badge.cyan {
  background: rgba(6, 182, 212, 0.12);
  color: #06b6d4;
  border: 1px solid rgba(6, 182, 212, 0.2);
}

.badge.gold {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.2);
}

/* Mobile Responsive Overrides */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 250px !important;
    box-shadow: 10px 0 35px rgba(0, 0, 0, 0.7);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0 !important;
  }

  .main-content.expanded {
    margin-left: 0 !important;
  }

  .sidebar-toggle-btn {
    display: none !important;
  }

  .mobile-menu-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: #ffffff;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    font-size: 1.25rem;
    cursor: pointer;
    transition: background 0.2s;
  }

  .mobile-menu-btn:hover {
    background: rgba(255, 255, 255, 0.1);
  }

  .top-header {
    padding: 12px 16px !important;
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 12px;
  }

  .header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
  }

  .header-left h2 {
    font-size: 1.1rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header-left .subtitle {
    display: none !important;
  }

  .header-right {
    flex-shrink: 0;
  }

  .header-right #refresh-all-btn {
    padding: 6px 12px;
    font-size: 0.75rem;
  }

  .content-body {
    padding: 16px !important;
  }

  /* Grid Layouts Stack */
  .grid-2 {
    grid-template-columns: 1fr !important;
  }

  .card {
    padding: 16px !important;
  }

  /* Logs view font decrease */
  pre#log-output {
    font-size: 0.72rem !important;
    line-height: 1.4 !important;
  }

  /* Tables responsiveness */
  .table-container {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border-color);
    border-radius: 6px;
  }

  table {
    width: 100% !important;
    min-width: 500px;
  }

  /* Inputs stacking */
  .input-wrapper {
    flex-direction: column !important;
    width: 100% !important;
    gap: 8px !important;
  }

  .input-wrapper input {
    width: 100% !important;
  }

  .input-wrapper button {
    width: 100% !important;
  }

  /* Shard Matrix adjustments */
  .shard-details {
    grid-template-columns: 1fr !important;
    gap: 4px !important;
  }
}


