/* MeshGuard Dashboard - Brand Consistent Styles */
/* Matches meshguard.app branding */

:root {
  --navy: #0a0f1a;
  --navy-light: #0d1424;
  --navy-border: #1a2332;
  --teal: #00D4AA;
  --teal-dim: rgba(0, 212, 170, 0.1);
  --terminal-green: #4ADE80;
  --terminal-yellow: #FACC15;
  --terminal-red: #F87171;
  --code-blue: #7DD3FC;
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.5);
}

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

body {
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Courier New', monospace;
  background: var(--navy);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Header */
header {
  background: var(--navy-light);
  border-bottom: 1px solid var(--navy-border);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo h1 {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.logo-tagline {
  font-size: 0.625rem;
  color: var(--text-muted);
  letter-spacing: 0;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.header-controls input {
  background: var(--navy);
  border: 1px solid var(--navy-border);
  color: var(--text-primary);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.875rem;
  min-width: 180px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.header-controls input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-dim);
}

.header-controls input::placeholder {
  color: var(--text-muted);
}

.header-controls button {
  background: var(--teal);
  color: var(--navy);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}

.header-controls button:hover {
  opacity: 0.9;
}

.header-controls button:active {
  transform: scale(0.98);
}

.status-indicator {
  font-size: 0.75rem;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  font-weight: 500;
}

.status-indicator.disconnected {
  background: rgba(248, 113, 113, 0.15);
  color: var(--terminal-red);
}

.status-indicator.connected {
  background: rgba(74, 222, 128, 0.15);
  color: var(--terminal-green);
}

/* Gateway URL display (shown when connected) */
.gateway-url-display {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  padding: 0.5rem 0.75rem;
  background: var(--navy);
  border: 1px solid var(--navy-border);
  border-radius: 6px;
  letter-spacing: 0.02em;
}

/* Refresh button (shown when connected) */
.refresh-btn {
  background: transparent;
  color: var(--teal);
  border: 1px solid var(--teal);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.refresh-btn:hover {
  background: var(--teal-dim);
}

.refresh-btn:active {
  transform: scale(0.98);
}

/* Main Content */
main {
  padding: 1.5rem 2rem;
  max-width: 1600px;
  margin: 0 auto;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1.5rem;
}

/* Cards */
.card {
  background: var(--navy-light);
  border: 1px solid var(--navy-border);
  border-radius: 12px;
  overflow: hidden;
}

.card h2 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--teal);
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--navy-border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card h2::before {
  content: '>';
  color: var(--text-muted);
}

.card-content {
  padding: 1.25rem;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
}

.stat-item {
  text-align: center;
  padding: 1rem;
  background: var(--navy);
  border-radius: 8px;
  border: 1px solid var(--navy-border);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--teal);
  line-height: 1;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Lists */
.list-container {
  max-height: 350px;
  overflow-y: auto;
}

.list-item {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--navy-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: background 0.15s;
}

.list-item:last-child {
  border-bottom: none;
}

.list-item:hover {
  background: var(--navy);
}

.list-item-main {
  flex: 1;
  min-width: 0;
}

.list-item-title {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.list-item-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Badges */
.badge {
  font-size: 0.625rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.badge.privileged {
  background: rgba(250, 204, 21, 0.15);
  color: var(--terminal-yellow);
}

.badge.trusted {
  background: rgba(0, 212, 170, 0.15);
  color: var(--teal);
}

.badge.verified {
  background: rgba(125, 211, 252, 0.15);
  color: var(--code-blue);
}

.badge.unverified {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

.badge.allow {
  background: rgba(74, 222, 128, 0.15);
  color: var(--terminal-green);
}

.badge.deny {
  background: rgba(248, 113, 113, 0.15);
  color: var(--terminal-red);
}

/* Audit Log */
.audit-entry {
  font-size: 0.8125rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--navy-border);
  font-family: inherit;
}

.audit-entry:last-child {
  border-bottom: none;
}

.audit-time {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.audit-action {
  color: var(--code-blue);
  margin-left: 0.5rem;
}

.audit-decision {
  margin-left: 0.5rem;
}

.audit-decision.allow {
  color: var(--terminal-green);
}

.audit-decision.deny {
  color: var(--terminal-red);
}

/* Filter Controls */
.filter-controls {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--navy-border);
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  background: var(--navy);
  border: 1px solid var(--navy-border);
  color: var(--text-secondary);
  padding: 0.375rem 0.75rem;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s;
}

.filter-btn:hover {
  border-color: var(--teal);
  color: var(--text-primary);
}

.filter-btn.active {
  background: var(--teal-dim);
  border-color: var(--teal);
  color: var(--teal);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  opacity: 0.5;
}

/* Loading */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: var(--text-muted);
}

.loading::after {
  content: '';
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--navy-border);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: 0.75rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--navy-border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Tab Navigation */
.tab-nav {
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--navy-border);
}

.tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  padding: 0.75rem 1.5rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: color 0.2s, border-color 0.2s;
}

.tab-btn:hover {
  color: var(--text-secondary);
}

.tab-btn.active {
  color: var(--teal);
  border-bottom-color: var(--teal);
}

/* Tab content: only the active tab is visible */
.tab-content {
  display: none !important;
  animation: fadeIn 0.3s ease;
}

.tab-content.active {
  display: block !important;
}

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

/* Analytics Controls */
.analytics-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.period-selector {
  display: flex;
  gap: 0;
  background: var(--navy-light);
  border: 1px solid var(--navy-border);
  border-radius: 6px;
  overflow: hidden;
}

.period-btn {
  background: none;
  border: none;
  border-right: 1px solid var(--navy-border);
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.period-btn:last-child {
  border-right: none;
}

.period-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.period-btn.active {
  background: var(--teal-dim);
  color: var(--teal);
}

.analytics-refresh-indicator {
  font-size: 0.6875rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* Analytics Stats Strip */
.analytics-stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.analytics-stat-card {
  background: var(--navy-light);
  border: 1px solid var(--navy-border);
  border-radius: 10px;
  padding: 1.25rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s;
}

.analytics-stat-card:hover {
  border-color: rgba(0, 212, 170, 0.3);
}

.analytics-stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--teal);
  line-height: 1.2;
  min-height: 2.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.analytics-stat-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 0.375rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.analytics-stat-trend {
  font-size: 0.75rem;
  margin-top: 0.5rem;
  min-height: 1.125rem;
}

.trend-up {
  color: var(--terminal-green);
}

.trend-down {
  color: var(--terminal-red);
}

.trend-neutral {
  color: var(--text-muted);
}

/* Analytics Grid */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.analytics-volume-card,
.analytics-leaderboard-card,
.analytics-heatmap-card {
  grid-column: span 2;
}

/* Bar Chart */
.bar-chart-container {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 200px;
  padding: 0 0.5rem;
  position: relative;
  min-height: 200px;
}

.bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  position: relative;
  cursor: pointer;
}

.bar-stack {
  width: 100%;
  max-width: 40px;
  display: flex;
  flex-direction: column-reverse;
  border-radius: 3px 3px 0 0;
  overflow: hidden;
  transition: opacity 0.15s;
}

.bar-group:hover .bar-stack {
  opacity: 0.85;
}

.bar-segment {
  width: 100%;
  transition: height 0.4s ease;
}

.bar-segment.allowed {
  background: var(--teal);
}

.bar-segment.denied {
  background: var(--terminal-red);
}

.bar-label {
  font-size: 0.5625rem;
  color: var(--text-muted);
  margin-top: 0.375rem;
  text-align: center;
  white-space: nowrap;
}

.bar-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  border: 1px solid var(--navy-border);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.6875rem;
  white-space: nowrap;
  z-index: 10;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.bar-group:hover .bar-tooltip {
  display: block;
}

.bar-chart-legend {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  margin-top: 1rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.legend-dot.allowed {
  background: var(--teal);
}

.legend-dot.denied {
  background: var(--terminal-red);
}

/* Donut Chart */
.enforcement-layout {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.donut-container {
  flex-shrink: 0;
  width: 160px;
  height: 160px;
  position: relative;
}

.donut-container svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.donut-center-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.donut-center-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--teal);
}

.donut-center-text {
  font-size: 0.625rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.policy-list {
  flex: 1;
  min-width: 0;
}

.policy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--navy-border);
  font-size: 0.8125rem;
}

.policy-row:last-child {
  border-bottom: none;
}

.policy-name {
  color: var(--text-primary);
  font-weight: 500;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 1rem;
}

.policy-metrics {
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.policy-deny-rate {
  color: var(--terminal-red);
  font-weight: 600;
}

/* Leaderboard Table */
.leaderboard-table-wrapper {
  overflow-x: auto;
  min-height: 100px;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.leaderboard-table th {
  text-align: left;
  padding: 0.625rem 0.75rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--navy-border);
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
  white-space: nowrap;
}

.leaderboard-table th:hover {
  color: var(--teal);
}

.leaderboard-table th.sorted {
  color: var(--teal);
}

.leaderboard-table th .sort-arrow {
  margin-left: 0.25rem;
  font-size: 0.5625rem;
}

.leaderboard-table td {
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--navy-border);
  color: var(--text-secondary);
}

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

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

.leaderboard-table .agent-name {
  color: var(--text-primary);
  font-weight: 500;
}

/* Trust Distribution */
.trust-distribution {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 80px;
}

.trust-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.trust-tier-label {
  width: 80px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.trust-tier-label.privileged { color: var(--terminal-yellow); }
.trust-tier-label.trusted { color: var(--teal); }
.trust-tier-label.verified { color: var(--code-blue); }
.trust-tier-label.unverified { color: var(--text-muted); }

.trust-bar-track {
  flex: 1;
  height: 24px;
  background: var(--navy);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--navy-border);
}

.trust-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
  min-width: 2px;
}

.trust-bar-fill.privileged { background: var(--terminal-yellow); }
.trust-bar-fill.trusted { background: var(--teal); }
.trust-bar-fill.verified { background: var(--code-blue); }
.trust-bar-fill.unverified { background: rgba(255, 255, 255, 0.3); }

.trust-count {
  width: 40px;
  text-align: right;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  flex-shrink: 0;
}

.trust-pct {
  width: 45px;
  text-align: right;
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Delegation Chains */
.delegation-stats {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1rem;
  min-height: 40px;
}

.delegation-stat {
  text-align: center;
  padding: 0.75rem 1rem;
  background: var(--navy);
  border-radius: 6px;
  border: 1px solid var(--navy-border);
  flex: 1;
}

.delegation-stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--teal);
}

.delegation-stat-label {
  font-size: 0.625rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

.delegation-pairs {
  min-height: 50px;
}

.delegation-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.delegation-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--navy-border);
}

.delegation-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--navy-border);
  color: var(--text-secondary);
}

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

.delegation-arrow {
  color: var(--teal);
  margin: 0 0.25rem;
}

/* Latency Heatmap */
.heatmap-container {
  min-height: 220px;
}

.heatmap-grid {
  display: grid;
  grid-template-columns: 50px repeat(24, 1fr);
  gap: 2px;
}

.heatmap-row-label {
  display: flex;
  align-items: center;
  font-size: 0.625rem;
  color: var(--text-muted);
  padding-right: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  justify-content: flex-end;
}

.heatmap-col-label {
  font-size: 0.5rem;
  color: var(--text-muted);
  text-align: center;
  padding-bottom: 0.25rem;
}

.heatmap-cell {
  aspect-ratio: 1;
  min-height: 20px;
  border-radius: 3px;
  position: relative;
  cursor: pointer;
  transition: transform 0.1s;
}

.heatmap-cell:hover {
  transform: scale(1.3);
  z-index: 2;
}

.heatmap-cell-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  border: 1px solid var(--navy-border);
  border-radius: 4px;
  padding: 0.375rem 0.5rem;
  font-size: 0.625rem;
  white-space: nowrap;
  z-index: 20;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  color: var(--text-primary);
}

.heatmap-cell:hover .heatmap-cell-tooltip {
  display: block;
}

.heatmap-corner {
  /* empty top-left corner */
}

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, var(--navy) 25%, rgba(255,255,255,0.06) 50%, var(--navy) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
  border-radius: 6px;
}

.skeleton-value {
  width: 80px;
  height: 2rem;
  margin: 0 auto;
}

.skeleton-chart {
  width: 100%;
  height: 200px;
}

.skeleton-donut {
  width: 160px;
  height: 160px;
  border-radius: 50%;
}

.skeleton-list {
  width: 100%;
  height: 120px;
}

.skeleton-table {
  width: 100%;
  height: 200px;
}

.skeleton-bars {
  width: 100%;
  height: 120px;
}

.skeleton-stats {
  width: 100%;
  height: 60px;
}

.skeleton-heatmap {
  width: 100%;
  height: 200px;
}

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

/* Analytics Empty States */
.analytics-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
}

.analytics-empty-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.4;
}

.analytics-empty-text {
  font-size: 0.8125rem;
}

.analytics-empty-sub {
  font-size: 0.6875rem;
  margin-top: 0.25rem;
  color: var(--text-muted);
  opacity: 0.7;
}

/* Data loaded animation */
.data-loaded {
  animation: dataFadeIn 0.4s ease;
}

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

/* Responsive */
@media (max-width: 768px) {
  header {
    padding: 1rem;
    gap: 0.75rem;
  }
  
  .header-controls {
    width: 100%;
    justify-content: flex-start;
  }
  
  .header-controls input {
    flex: 1;
    min-width: 0;
  }
  
  .gateway-url-display {
    font-size: 0.75rem;
    padding: 0.375rem 0.5rem;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  main {
    padding: 1rem;
  }
  
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .analytics-stats-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .analytics-grid {
    grid-template-columns: 1fr;
  }
  
  .analytics-volume-card,
  .analytics-leaderboard-card,
  .analytics-heatmap-card {
    grid-column: span 1;
  }
  
  .enforcement-layout {
    flex-direction: column;
  }
  
  .delegation-stats {
    flex-wrap: wrap;
  }
  
  .heatmap-grid {
    overflow-x: auto;
    min-width: 600px;
  }
  
  .analytics-controls {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
  }
}

/* ══════════════════════════════════════════════════════════════════════════════
   Auth Screen - Magic Code Login
   Added as a layer on top of existing dashboard. No existing styles modified.
   ══════════════════════════════════════════════════════════════════════════════ */

.auth-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  flex-direction: column;
}

.auth-screen.hidden {
  display: none;
}

.auth-card {
  background: var(--navy-light);
  border: 1px solid var(--navy-border);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
  margin: 1rem;
}

.auth-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo img {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  margin-bottom: 1rem;
}

.auth-logo h1,
.auth-logo h2 {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.25rem;
}

.auth-tagline {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
}

.auth-form-state {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-input {
  background: var(--navy);
  border: 1px solid var(--navy-border);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9375rem;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-dim);
}

.auth-input::placeholder {
  color: var(--text-muted);
}

.auth-code-input {
  text-align: center;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.5em;
  padding: 1rem;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Courier New', monospace;
}

.auth-btn {
  background: var(--teal);
  color: var(--navy);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: opacity 0.2s, transform 0.1s;
}

.auth-btn:hover {
  opacity: 0.9;
}

.auth-btn:active {
  transform: scale(0.98);
}

.auth-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.auth-footer-link {
  text-align: center;
  margin-top: 0.5rem;
}

.auth-link {
  color: var(--text-muted);
  font-size: 0.8125rem;
  text-decoration: none;
  transition: color 0.15s;
}

.auth-link:hover {
  color: var(--teal);
}

.auth-message {
  font-size: 0.8125rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  text-align: center;
}

.auth-message.error {
  background: rgba(248, 113, 113, 0.1);
  color: var(--terminal-red);
  border: 1px solid rgba(248, 113, 113, 0.2);
}

.auth-message.success {
  background: rgba(74, 222, 128, 0.1);
  color: var(--terminal-green);
  border: 1px solid rgba(74, 222, 128, 0.2);
}

.auth-check-email {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
}

.auth-check-sub {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: -0.5rem;
}

.admin-access-modal {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  z-index: 1001;
}

/* Logout Button */
.logout-btn {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--navy-border);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all 0.15s;
}

.logout-btn:hover {
  border-color: var(--terminal-red);
  color: var(--terminal-red);
}

/* Auth screen responsive */
@media (max-width: 768px) {
  .auth-card {
    margin: 1rem;
    padding: 2rem 1.5rem;
  }
}

/* ══════════════════════════════════════════════════════════════════════════════
   Trust Tab Styles
   ══════════════════════════════════════════════════════════════════════════════ */

/* Trust Stats Strip — same pattern as analytics strip */
.trust-stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.trust-stat-card {
  background: var(--navy-light);
  border: 1px solid var(--navy-border);
  border-radius: 10px;
  padding: 1.25rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s;
}

.trust-stat-card:hover {
  border-color: rgba(0, 212, 170, 0.3);
}

.trust-stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--teal);
  line-height: 1.2;
  min-height: 2.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.trust-stat-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 0.375rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Trust Grid Layout */
.trust-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.trust-scores-card {
  grid-column: span 2;
}

.trust-anomalies-card {
  grid-column: span 2;
}

/* Trust Scores Table */
.trust-scores-table-wrapper {
  overflow-x: auto;
  min-height: 100px;
}

.trust-scores-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.trust-scores-table th {
  text-align: left;
  padding: 0.625rem 0.75rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--navy-border);
  white-space: nowrap;
}

.trust-scores-table td {
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--navy-border);
  color: var(--text-secondary);
}

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

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

.trust-scores-table .agent-name {
  color: var(--text-primary);
  font-weight: 500;
}

/* Trust Score Bar */
.trust-score-bar-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 140px;
}

.trust-score-bar {
  flex: 1;
  height: 8px;
  background: var(--navy);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--navy-border);
}

.trust-score-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease, background 0.3s;
}

.trust-score-value {
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 36px;
  text-align: right;
}

/* Trust Tier Badges */
.trust-tier-badge {
  font-size: 0.625rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.trust-tier-badge.unverified {
  background: rgba(248, 113, 113, 0.15);
  color: var(--terminal-red);
}

.trust-tier-badge.verified {
  background: rgba(250, 204, 21, 0.15);
  color: var(--terminal-yellow);
}

.trust-tier-badge.trusted {
  background: rgba(74, 222, 128, 0.15);
  color: var(--terminal-green);
}

.trust-tier-badge.privileged {
  background: rgba(0, 212, 170, 0.15);
  color: var(--teal);
}

/* Trend Arrow */
.trust-trend-up {
  color: var(--terminal-green);
}

.trust-trend-down {
  color: var(--terminal-red);
}

.trust-trend-flat {
  color: var(--text-muted);
}

/* Components breakdown (inline) */
.trust-components {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.trust-component-chip {
  font-size: 0.625rem;
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
  background: var(--navy);
  border: 1px solid var(--navy-border);
  color: var(--text-secondary);
  white-space: nowrap;
}

.trust-component-chip .comp-label {
  color: var(--text-muted);
  margin-right: 0.25rem;
}

/* Delegation Graph List */
.trust-delegations-list {
  min-height: 80px;
  max-height: 350px;
  overflow-y: auto;
}

.trust-delegation-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--navy-border);
  font-size: 0.8125rem;
}

.trust-delegation-row:last-child {
  border-bottom: none;
}

.trust-delegation-agent {
  color: var(--text-primary);
  font-weight: 500;
  min-width: 80px;
}

.trust-delegation-arrow {
  color: var(--teal);
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.trust-delegation-scopes {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
  margin-left: auto;
}

.trust-scope-badge {
  font-size: 0.5625rem;
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
  background: var(--teal-dim);
  color: var(--teal);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Anomalies Feed */
.trust-anomalies-feed {
  min-height: 80px;
  max-height: 400px;
  overflow-y: auto;
}

.trust-anomaly-entry {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--navy-border);
  font-size: 0.8125rem;
}

.trust-anomaly-entry:last-child {
  border-bottom: none;
}

.trust-anomaly-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 70px;
}

.trust-anomaly-severity {
  font-size: 0.5625rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  flex-shrink: 0;
}

.trust-anomaly-severity.info {
  background: rgba(96, 165, 250, 0.15);
  color: #60A5FA;
}

.trust-anomaly-severity.warning {
  background: rgba(250, 204, 21, 0.15);
  color: var(--terminal-yellow);
}

.trust-anomaly-severity.critical {
  background: rgba(251, 146, 60, 0.15);
  color: #FB923C;
}

.trust-anomaly-severity.emergency {
  background: rgba(248, 113, 113, 0.15);
  color: var(--terminal-red);
}

/* Map low/medium/high to the above palette too */
.trust-anomaly-severity.low {
  background: rgba(96, 165, 250, 0.15);
  color: #60A5FA;
}

.trust-anomaly-severity.medium {
  background: rgba(250, 204, 21, 0.15);
  color: var(--terminal-yellow);
}

.trust-anomaly-severity.high {
  background: rgba(251, 146, 60, 0.15);
  color: #FB923C;
}

.trust-anomaly-message {
  flex: 1;
  color: var(--text-secondary);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trust-anomaly-agent {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Risk Overview */
.trust-risk-list {
  min-height: 80px;
}

.trust-risk-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--navy-border);
}

.trust-risk-row:last-child {
  border-bottom: none;
}

.trust-risk-rank {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.trust-risk-agent {
  flex: 1;
  min-width: 0;
}

.trust-risk-agent-name {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
}

.trust-risk-agent-id {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 0.125rem;
}

.trust-risk-bar-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 120px;
}

.trust-risk-bar {
  flex: 1;
  height: 6px;
  background: var(--navy);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--navy-border);
}

.trust-risk-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--terminal-red);
  transition: width 0.6s ease;
}

.trust-risk-count {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--terminal-red);
  min-width: 24px;
  text-align: right;
}

/* Trust tab responsive */
@media (max-width: 768px) {
  .trust-stats-strip {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .trust-scores-card,
  .trust-anomalies-card {
    grid-column: span 1;
  }
}

/* ══════════════════════════════════════════════════════════════════════════════
   Modal Styles
   ══════════════════════════════════════════════════════════════════════════════ */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 15, 26, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(4px);
}

.modal-card {
  background: var(--navy-light);
  border: 1px solid var(--navy-border);
  border-radius: 12px;
  width: 100%;
  max-width: 420px;
  margin: 1rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--navy-border);
}

.modal-header h3 {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.15s;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
}

.modal-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.modal-input,
.modal-select {
  width: 100%;
  background: var(--navy);
  border: 1px solid var(--navy-border);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.modal-input:focus,
.modal-select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-dim);
}

.modal-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' fill-opacity='0.5' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.modal-message {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.modal-message.error {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: var(--terminal-red);
}

.modal-message.success {
  background: rgba(0, 212, 170, 0.1);
  border: 1px solid rgba(0, 212, 170, 0.3);
  color: var(--teal);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--navy-border);
}

.modal-btn {
  padding: 0.625rem 1.25rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.modal-btn.primary {
  background: var(--teal);
  border: none;
  color: var(--navy);
}

.modal-btn.primary:hover {
  filter: brightness(1.1);
}

.modal-btn.secondary {
  background: transparent;
  border: 1px solid var(--navy-border);
  color: var(--text-secondary);
}

.modal-btn.secondary:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
}

/* Token Display */
.token-warning {
  background: rgba(250, 204, 21, 0.1);
  border: 1px solid rgba(250, 204, 21, 0.3);
  color: var(--terminal-yellow);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.8125rem;
  margin-bottom: 1rem;
}

.token-display {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.token-display code {
  flex: 1;
  background: var(--navy);
  border: 1px solid var(--navy-border);
  color: var(--teal);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.75rem;
  word-break: break-all;
  max-height: 100px;
  overflow-y: auto;
}

.copy-btn {
  background: var(--navy);
  border: 1px solid var(--navy-border);
  color: var(--text-secondary);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.copy-btn:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.token-copied {
  color: var(--teal);
  font-size: 0.8125rem;
  margin-top: 0.75rem;
  text-align: center;
}

/* Card Header Row (for Add buttons) */
.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.card-header-row h2 {
  margin: 0;
}

.btn-add {
  background: transparent;
  border: 1px solid var(--teal);
  color: var(--teal);
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-add:hover {
  background: var(--teal);
  color: var(--navy);
}

/* Agent List Item Actions */
.list-item {
  position: relative;
}

.list-item-actions {
  display: flex;
  gap: 0.5rem;
  opacity: 0;
  transition: opacity 0.15s;
}

.list-item:hover .list-item-actions {
  opacity: 1;
}

.action-btn {
  background: transparent;
  border: 1px solid var(--navy-border);
  color: var(--text-muted);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.6875rem;
  cursor: pointer;
  transition: all 0.15s;
}

.action-btn:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.action-btn.danger:hover {
  border-color: var(--terminal-red);
  color: var(--terminal-red);
}

/* ══════════════════════════════════════════════════════════════════════════════
   Settings Modal Styles
   ══════════════════════════════════════════════════════════════════════════════ */

.settings-btn {
  background: transparent;
  border: 1px solid var(--navy-border);
  color: var(--text-secondary);
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.15s;
}

.settings-btn:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.settings-modal-card {
  width: 90%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}

.settings-modal-body {
  padding: 0;
}

.settings-section {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--navy-border);
}

.settings-section:last-child {
  border-bottom: none;
}

.settings-section h4 {
  color: var(--teal);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 0.75rem;
}

.settings-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
}

.settings-label {
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.settings-value {
  color: var(--text-primary);
  font-size: 0.8125rem;
  font-weight: 500;
}

/* Credentials */
.settings-credential {
  margin-bottom: 1rem;
}

.settings-credential:last-child {
  margin-bottom: 0;
}

.settings-credential-label {
  color: var(--text-secondary);
  font-size: 0.75rem;
  margin-bottom: 0.5rem;
}

.settings-credential-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.settings-credential-value {
  flex: 1;
  background: var(--navy);
  border: 1px solid var(--navy-border);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--teal);
  word-break: break-all;
  min-width: 0;
}

.settings-credential-row .settings-btn {
  padding: 0.4rem 0.5rem;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.settings-credential-warning {
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: rgba(250, 204, 21, 0.1);
  border: 1px solid rgba(250, 204, 21, 0.3);
  border-radius: 4px;
  color: var(--terminal-yellow);
  font-size: 0.6875rem;
}

/* Usage Bars */
.settings-usage-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0;
}

.settings-usage-label {
  color: var(--text-muted);
  font-size: 0.75rem;
  width: 50px;
}

.settings-usage-bar {
  flex: 1;
  height: 6px;
  background: var(--navy);
  border-radius: 3px;
  overflow: hidden;
}

.settings-usage-fill {
  height: 100%;
  background: var(--teal);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.settings-usage-value {
  color: var(--text-muted);
  font-size: 0.6875rem;
  width: 50px;
  text-align: right;
}

/* ══════════════════════════════════════════════════════════════════════════════
   Policy Modal Styles
   ══════════════════════════════════════════════════════════════════════════════ */

.policy-modal-card {
  width: 90%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
}

.policy-tiers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.policy-tier-checkbox {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  cursor: pointer;
}

.policy-tier-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--teal);
  cursor: pointer;
}

.policy-templates {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.policy-template-btn {
  background: var(--navy);
  border: 1px solid var(--navy-border);
  color: var(--text-secondary);
  padding: 0.375rem 0.75rem;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s;
}

.policy-template-btn:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.policy-yaml-editor {
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Courier New', monospace;
  font-size: 0.8125rem;
  line-height: 1.5;
  background: var(--navy);
  border: 1px solid var(--navy-border);
  color: var(--code-blue);
  padding: 0.75rem;
  border-radius: 6px;
  resize: vertical;
  min-height: 200px;
}

.policy-yaml-editor:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-dim);
}

.policy-yaml-hint {
  color: var(--text-muted);
  font-size: 0.6875rem;
  margin-top: 0.5rem;
}

/* Modal textarea base style */
.modal-textarea {
  width: 100%;
  background: var(--navy);
  border: 1px solid var(--navy-border);
  color: var(--text-primary);
  padding: 0.75rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.875rem;
  resize: vertical;
}

.modal-textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-dim);
}
