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

:root {
  --text-primary: #1a1a1a;
  --text-secondary: #4a4a4a;
  --text-tertiary: #757575;
  --border-light: #e5e5e5;
  --border-medium: #d0d0d0;
  --surface: #ffffff;
  --background: #fafafa;
  --accent: #2a2a2a;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  color: var(--text-primary);
  background: var(--background);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 49px,
      rgba(0,0,0,0.025) 49px,
      rgba(0,0,0,0.025) 50px
    ),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 49px,
      rgba(0,0,0,0.025) 49px,
      rgba(0,0,0,0.025) 50px
    );
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  top: 0;
  right: 0;
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(240,240,240,0.5) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Top Navigation */
.top-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 48px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-mark {
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: white;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
}

.brand-text {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-item {
  padding: 8px 16px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.nav-item:hover {
  background: var(--background);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent);
  color: white;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--background);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-secondary);
}

.status-dot {
  width: 6px;
  height: 6px;
  background: var(--text-tertiary);
  border-radius: 50%;
}

.user-menu {
  position: relative;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
}

/* Main Content */
.main-wrapper {
  position: relative;
  z-index: 1;
}

.hero-section {
  padding: 80px 0 60px;
  position: relative;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(circle, rgba(230,230,230,0.4) 0%, transparent 70%);
  pointer-events: none;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px;
  position: relative;
}

.hero-content {
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}

.hero-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--text-tertiary);
  margin-bottom: 16px;
}

h1 {
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 16px;
  line-height: 1.1;
}

.hero-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 32px;
  line-height: 1.6;
}

.btn-primary {
  background: var(--accent);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-primary:hover {
  background: var(--text-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary span {
  font-size: 18px;
}

/* Info Banner */
.info-banner {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 32px;
}

.banner-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.banner-content {
  flex: 1;
  font-size: 13px;
  color: var(--text-secondary);
}

.banner-content strong {
  color: var(--text-primary);
  font-weight: 600;
}

.banner-badge {
  background: var(--background);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

/* Filters */
.filter-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
}

.filter-group {
  display: flex;
  gap: 16px;
}

.filter-group label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-group label span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.filter-group select {
  padding: 10px 14px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
  color: var(--text-primary);
  min-width: 200px;
  cursor: pointer;
  transition: border 0.2s;
}

.filter-group select:focus {
  outline: none;
  border-color: var(--border-medium);
}

.filter-updated {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 10px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  appearance: none;
  width: 100%;
  text-align: left;
  font: inherit;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 24px;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.stat-card:hover,
.stat-card:focus-visible {
  border-color: var(--text-tertiary);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.07);
  transform: translateY(-2px);
  outline: none;
}

.stat-card:focus-visible {
  outline: 2px solid var(--text-secondary);
  outline-offset: 3px;
}

.stat-icon {
  width: 40px;
  height: 40px;
  background: var(--background);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 16px;
}

.stat-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.stat-desc {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Insights */
.insights-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.insight-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 24px;
}

.card-header {
  margin-bottom: 20px;
}

.card-header h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.card-header p {
  font-size: 12px;
  color: var(--text-secondary);
}

.provider-chart {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.provider-row {
  display: grid;
  grid-template-columns: 100px 1fr 40px;
  align-items: center;
  gap: 12px;
}

.provider-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.provider-symbol {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--background);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
}

.bar-track {
  height: 8px;
  background: var(--background);
  border-radius: 4px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.provider-total {
  text-align: right;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.opportunities-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.opportunity-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.opportunity-icon {
  width: 36px;
  height: 36px;
  background: var(--background);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.opportunity-info {
  flex: 1;
  min-width: 0;
}

.opportunity-info strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.opportunity-info span {
  display: block;
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.opportunity-cost {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

/* Findings Section */
.findings-section {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 40px;
}

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

.section-header h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.section-header p {
  font-size: 12px;
  color: var(--text-secondary);
}

.search-container {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--background);
  transition: border 0.2s;
}

.search-container:focus-within {
  border-color: var(--border-medium);
}

.search-icon {
  font-size: 18px;
  color: var(--text-tertiary);
}

.search-container input {
  border: none;
  background: none;
  outline: none;
  font-size: 13px;
  color: var(--text-primary);
  width: 180px;
}

.search-container input::placeholder {
  color: var(--text-tertiary);
}

/* Table */
.table-wrapper {
  overflow-x: auto;
  margin: 0 -24px;
}

.findings-table {
  width: 100%;
  border-collapse: collapse;
}

.findings-table thead {
  background: var(--background);
}

.findings-table th {
  padding: 12px 24px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
}

.findings-table td {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  font-size: 13px;
  color: var(--text-secondary);
}

.findings-table td:last-child {
  text-align: right;
}

.resource-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.resource-avatar {
  width: 36px;
  height: 36px;
  background: var(--background);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.resource-title {
  font-weight: 600;
  color: var(--text-primary);
  display: block;
  margin-bottom: 2px;
}

.resource-id {
  font-size: 11px;
  color: var(--text-tertiary);
}

.provider-pill, .risk-pill, .confidence-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: var(--background);
  color: var(--text-secondary);
}

.risk-pill.critical, .risk-pill.high {
  background: var(--accent);
  color: white;
}

.cost-cell {
  font-weight: 600;
  color: var(--text-primary);
}

.details-button {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--border-light);
  transition: text-decoration-color 0.2s;
}

.details-button:hover {
  text-decoration-color: var(--text-primary);
}

.table-footer {
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.empty-state {
  padding: 40px;
  text-align: center;
  color: var(--text-tertiary);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--accent);
  color: white;
  padding: 14px 24px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  opacity: 0;
  transition: all 0.3s;
  z-index: 1000;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.error {
  background: #1a1a1a;
}

/* Modal */
.modal {
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 32px;
  max-width: 600px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal::backdrop {
  background: rgba(0,0,0,0.4);
}

.modal-close {
  float: right;
  background: var(--background);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background 0.2s;
}

.modal-close:hover {
  background: var(--border-light);
}

.modal-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
  margin-bottom: 12px;
}

.modal h2 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
  clear: both;
}

.modal-summary {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

.modal-details {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.modal-details dt {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.modal-details dd {
  font-size: 12px;
  color: var(--text-primary);
}

.metric-dialog {
  width: min(600px, calc(100vw - 32px));
  max-height: min(80vh, 720px);
  overflow: auto;
}

.metric-content {
  max-height: 42vh;
  overflow: auto;
}

.metric-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--border-light);
}

.metric-list li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 2px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  line-height: 1.45;
}

.metric-list li span {
  color: var(--text-secondary);
}

.metric-list li strong {
  flex-shrink: 0;
  color: var(--text-primary);
  text-align: right;
  text-transform: capitalize;
}

.metric-empty {
  padding: 20px;
}

.modal-disclaimer {
  background: var(--background);
  padding: 14px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Responsive */
@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  
  .hero-section {
    padding: 60px 0 40px;
  }
  
  h1 {
    font-size: 36px;
  }
  
  .stats-grid,
  .insights-row {
    grid-template-columns: 1fr;
  }
  
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-group {
    flex-direction: column;
  }
  
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  
  .search-container {
    width: 100%;
  }
  
  .search-container input {
    width: 100%;
  }
}


/* Real scan button */
.btn-secondary {
  padding: 10px 20px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #4a5568;
  background: #ffffff;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-secondary:hover {
  background: #f7fafc;
  border-color: #a0aec0;
  transform: translateY(-1px);
}

.btn-secondary:active {
  transform: translateY(0);
}


/* Infrastructure View Styles */
.architecture-diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  gap: 20px;
}

.arch-node {
  background: #f7fafc;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  padding: 20px 40px;
  text-align: center;
  min-width: 200px;
}

.arch-node.highlight {
  background: #edf2f7;
  border-color: #cbd5e0;
}

.arch-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.arch-label {
  font-size: 16px;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 4px;
}

.arch-sublabel {
  font-size: 13px;
  color: #718096;
}

.arch-arrow {
  font-size: 24px;
  color: #a0aec0;
}

/* Resource List */
.resource-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
}

.resource-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: #f7fafc;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.resource-icon {
  font-size: 24px;
  width: 40px;
  text-align: center;
}

.resource-info {
  flex: 1;
}

.resource-name {
  font-size: 14px;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 2px;
}

.resource-id {
  font-size: 12px;
  color: #718096;
  font-family: 'Courier New', monospace;
}

.resource-status {
  font-size: 12px;
  font-weight: 500;
  color: #38a169;
  padding: 4px 12px;
  background: #c6f6d5;
  border-radius: 12px;
}

/* Concepts Grid */
.concepts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  padding: 20px;
}

.concept-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  background: #f7fafc;
  border-radius: 6px;
  border-left: 3px solid #cbd5e0;
}

.concept-number {
  font-size: 14px;
  font-weight: 700;
  color: #4a5568;
  width: 28px;
  height: 28px;
  background: #e2e8f0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.concept-name {
  font-size: 14px;
  font-weight: 600;
  color: #2d3748;
}

.concept-desc {
  font-size: 13px;
  color: #718096;
}

/* Cost Breakdown */
.cost-breakdown {
  padding: 20px;
}

.cost-item {
  display: grid;
  grid-template-columns: 2fr 2fr 1fr;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid #e2e8f0;
}

.cost-item.total {
  border-top: 2px solid #cbd5e0;
  border-bottom: none;
  margin-top: 8px;
  padding-top: 16px;
}

.cost-service {
  font-size: 14px;
  color: #2d3748;
}

.cost-usage {
  font-size: 13px;
  color: #718096;
}

.cost-amount {
  font-size: 14px;
  font-weight: 600;
  color: #2d3748;
  text-align: right;
}

.cost-note {
  margin-top: 16px;
  padding: 12px;
  background: #edf2f7;
  border-radius: 6px;
  font-size: 13px;
  color: #4a5568;
}

/* Console Links */
.console-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
}

.console-link {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: #f7fafc;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  text-decoration: none;
  color: inherit;
  transition: all 0.15s ease;
}

.console-link:hover {
  background: #edf2f7;
  border-color: #cbd5e0;
  transform: translateX(4px);
}

.console-icon {
  font-size: 24px;
  width: 40px;
  text-align: center;
}

.console-info {
  flex: 1;
}

.console-name {
  font-size: 14px;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 2px;
}

.console-desc {
  font-size: 12px;
  color: #718096;
}

.console-arrow {
  font-size: 18px;
  color: #a0aec0;
}
