/**
 * RiskyUserTroubleshooter Web - Fluent UI Dark Theme
 * Matching the PowerShell HTML report styling
 * @author Danny Vorst (@Virtualite.nl)
 */

/* ========================================
   CSS VARIABLES
   ======================================== */
:root {
  --primary-blue: #0a72d0;
  --accent-green: #2cc29f;
  --neutral: #f3f2f1;
  --bg-dark: #1b1b1f;
  --card-dark: #25252a;
  --text-light: #ffffff;
  --text-muted: #cccccc;
  --status-good: #2cc29f;
  --status-warning: #f0ad4e;
  --status-bad: #dc3545;
  --status-critical: #8b0000;
}

/* ========================================
   RESET & BASE
   ======================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-dark);
  color: var(--text-light);
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: var(--accent-green);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ========================================
   APP CONTAINER
   ======================================== */
.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ========================================
   HEADER
   ======================================== */
.app-header {
  background: var(--card-dark);
  border-bottom: 1px solid #333;
  padding: 0.5rem 2rem;
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

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

.logo-icon {
  font-size: 2rem;
}

.logo-img {
  height: 56px;
  width: auto;
}

.logo-text h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent-green);
}

.logo-text .subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Auth Status */
.auth-status {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
}

.user-name {
  font-size: 0.9rem;
  color: var(--text-light);
}

.tenant-badge {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: rgba(255,255,255,0.1);
  padding: 2px 8px;
  border-radius: 4px;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
  padding: 0.6rem 1.25rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background: var(--primary-blue);
  color: white;
}

.btn-primary:hover {
  background: #0861b0;
}

.btn-secondary {
  background: transparent;
  color: var(--text-light);
  border: 1px solid #555;
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--primary-blue);
}

.btn:focus {
  outline: 2px solid var(--accent-green);
  outline-offset: 2px;
}

.btn-icon {
  font-size: 1rem;
}

/* ========================================
   MAIN CONTENT
   ======================================== */
.main-content {
  flex: 1;
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.section {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ========================================
   INPUT SECTION
   ======================================== */
.input-card {
  background: var(--card-dark);
  border-radius: 12px;
  padding: 2rem;
  max-width: 600px;
  margin: 0 auto;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  border: 1px solid #333;
}

.input-card h2 {
  margin: 0 0 0.5rem 0;
  font-size: 1.5rem;
  color: var(--text-light);
}

.input-card p {
  margin: 0 0 1.5rem 0;
  color: var(--text-muted);
}

.input-group {
  margin-bottom: 1rem;
}

.input-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-light);
}

.input-with-button {
  display: flex;
  gap: 0.75rem;
}

.input-with-button input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid #444;
  border-radius: 6px;
  background: #1f1f23;
  color: var(--text-light);
  font-size: 1rem;
}

.input-with-button input:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 2px rgba(10, 114, 208, 0.2);
}

.input-with-button input::placeholder {
  color: #666;
}

/* Recent Searches */
.recent-searches {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #333;
}

.recent-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-right: 0.5rem;
}

.recent-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.recent-item {
  background: rgba(255,255,255,0.05);
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.recent-item:hover {
  background: rgba(10, 114, 208, 0.2);
}

/* ========================================
   PROGRESS SECTION
   ======================================== */
.progress-card {
  background: var(--card-dark);
  border-radius: 12px;
  padding: 2rem;
  max-width: 600px;
  margin: 0 auto;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  border: 1px solid #333;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1rem;
}

.progress-header h2 {
  margin: 0;
  font-size: 1.25rem;
}

#progress-upn {
  color: var(--accent-green);
}

.progress-percentage {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--accent-green);
}

.progress-bar-container {
  height: 8px;
  background: #333;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-blue), var(--accent-green));
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-steps {
  margin-bottom: 1.5rem;
}

.progress-step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.progress-step.active {
  color: var(--text-light);
}

.progress-step.completed {
  color: var(--status-good);
}

.step-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  flex-shrink: 0;
}

.step-icon.pending {
  border: 2px solid #555;
}

.step-icon.active {
  border: 2px solid var(--primary-blue);
  animation: pulse 1s infinite;
}

.step-icon.completed {
  background: var(--status-good);
  color: white;
}

.step-icon.completed::after {
  content: '\2713';
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(10, 114, 208, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(10, 114, 208, 0); }
}

.step-text {
  flex: 1;
}

.step-detail {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ========================================
   REPORT SECTION
   ======================================== */
.report-actions {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.report-container {
  animation: fadeIn 0.3s ease;
}

/* Executive Summary */
.executive-summary {
  background: linear-gradient(135deg, var(--card-dark) 0%, #2a2a35 100%);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  border: 1px solid #333;
}

.summary-user {
  margin-bottom: 1.5rem;
}

.summary-user h2 {
  margin: 0 0 0.25rem 0;
  font-size: 1.5rem;
}

.summary-user .upn {
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.summary-user .upn a {
  color: var(--accent-green);
}

.summary-meta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.risk-level-badge,
.breach-level-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
}

.risk-level-badge.low,
.breach-level-badge.low {
  background: rgba(44, 194, 159, 0.2);
  color: var(--status-good);
  border: 1px solid var(--status-good);
}

.risk-level-badge.medium,
.breach-level-badge.medium {
  background: rgba(240, 173, 78, 0.2);
  color: var(--status-warning);
  border: 1px solid var(--status-warning);
}

.risk-level-badge.high,
.breach-level-badge.high {
  background: rgba(220, 53, 69, 0.2);
  color: var(--status-bad);
  border: 1px solid var(--status-bad);
}

.risk-level-badge.critical,
.breach-level-badge.critical {
  background: rgba(139, 0, 0, 0.2);
  color: var(--status-critical);
  border: 1px solid var(--status-critical);
}

/* Summary Stats - Rectangular Cards */
.summary-stats {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.stat-card {
  background: rgba(0,0,0,0.3);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  text-align: center;
  border: 1px solid #444;
  min-width: 100px;
  flex: 1;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

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

.stat-card .stat-value {
  font-size: 1.75rem;
  font-weight: bold;
  line-height: 1.2;
  color: var(--text-light);
}

.stat-card .stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 0.25rem;
}

/* Stat card color variants */
.stat-card.low { border-color: var(--status-good); }
.stat-card.low .stat-value { color: var(--status-good); }

.stat-card.medium { border-color: var(--status-warning); }
.stat-card.medium .stat-value { color: var(--status-warning); }

.stat-card.high { border-color: var(--status-bad); }
.stat-card.high .stat-value { color: var(--status-bad); }

.stat-card.critical { border-color: var(--status-critical); }
.stat-card.critical .stat-value { color: var(--status-critical); }

/* ========================================
   RISK OVERVIEW (Summary Tab)
   ======================================== */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.overview-item {
  background: rgba(0,0,0,0.2);
  border: 1px solid #333;
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

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

.overview-value {
  font-weight: 600;
  text-align: right;
}

.overview-value.status-good { color: var(--status-good); }
.overview-value.status-warning { color: var(--status-warning); }
.overview-value.status-bad { color: var(--status-bad); }

/* ========================================
   ACTIONS LIST (Summary Tab)
   ======================================== */
.actions-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.action-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
  padding: 1rem;
  border-left: 4px solid;
  transition: transform 0.2s ease;
}

.action-item:hover {
  transform: translateX(4px);
}

.action-item.critical {
  border-left-color: var(--status-critical);
  background: rgba(139, 0, 0, 0.1);
}

.action-item.high {
  border-left-color: var(--status-bad);
  background: rgba(220, 53, 69, 0.1);
}

.action-item.medium {
  border-left-color: var(--status-warning);
  background: rgba(240, 173, 78, 0.1);
}

.action-item.low {
  border-left-color: var(--status-good);
}

.action-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.action-content {
  flex: 1;
}

.action-title {
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 0.25rem;
}

.action-description {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.action-link {
  padding: 0.5rem 1rem;
  background: var(--primary-blue);
  color: white;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  flex-shrink: 0;
  align-self: center;
}

.action-link:hover {
  background: #0861b0;
  text-decoration: none;
}

/* No Actions State */
.no-actions {
  text-align: center;
  padding: 2rem;
  background: rgba(44, 194, 159, 0.1);
  border-radius: 8px;
  border: 1px solid var(--status-good);
}

.no-actions-icon {
  font-size: 2.5rem;
  color: var(--status-good);
  margin-bottom: 0.5rem;
}

.no-actions-text {
  color: var(--status-good);
  font-weight: 500;
}

/* ========================================
   TABS
   ======================================== */
.report-tabs {
  display: flex;
  background: var(--card-dark);
  border: 1px solid #333;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.tab-btn {
  flex: 1;
  padding: 0.875rem 1rem;
  background: transparent;
  border: none;
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  border-bottom: 2px solid transparent;
}

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

.tab-btn:focus {
  outline: 2px solid var(--accent-green);
  outline-offset: -2px;
}

.tab-btn.active {
  font-weight: 600;
  color: var(--accent-green);
  background-color: rgba(44, 194, 159, 0.1);
  border-bottom: 2px solid var(--accent-green);
}

.tab-content {
  display: none;
  background: var(--card-dark);
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.4);
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.tab-content h3 {
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  color: var(--accent-green);
}

/* ========================================
   TABLES
   ======================================== */
.risk-table {
  width: 100%;
  border-collapse: collapse;
  background: #1f1f23;
  border-radius: 8px;
  overflow: hidden;
}

.risk-table th,
.risk-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #333;
}

.risk-table th {
  background-color: #2c2c31;
  color: var(--accent-green);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.risk-table tbody tr {
  transition: background-color 0.15s ease;
}

.risk-table tbody tr:hover {
  background-color: rgba(10, 114, 208, 0.12);
}

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

/* Risk Badge */
.risk-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.85rem;
}

.risk-badge.positive {
  background: rgba(220, 53, 69, 0.2);
  color: var(--status-bad);
}

.risk-badge.negative {
  background: rgba(44, 194, 159, 0.2);
  color: var(--status-good);
}

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

/* Category Badge */
.category-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.category-badge.breachsignal {
  background: rgba(220, 53, 69, 0.2);
  color: var(--status-bad);
}

.category-badge.configweakness {
  background: rgba(240, 173, 78, 0.2);
  color: var(--status-warning);
}

.category-badge.behavioral {
  background: rgba(10, 114, 208, 0.2);
  color: var(--primary-blue);
}

.category-badge.safety {
  background: rgba(44, 194, 159, 0.2);
  color: var(--status-good);
}

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

/* ========================================
   CLICKABLE TABLE ROWS
   ======================================== */
.clickable-table .clickable-row {
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.clickable-table .clickable-row:hover {
  background-color: rgba(10, 114, 208, 0.2);
  transform: translateX(4px);
}

.clickable-table .indicator-name {
  display: block;
  font-weight: 500;
}

.clickable-table .click-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.clickable-table .clickable-row:hover .click-hint {
  opacity: 1;
}

/* Checks Table */
.checks-table .check-name {
  display: block;
  font-weight: 500;
}

.checks-table .check-description {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.checks-table tr.not-detected {
  opacity: 0.6;
}

.checks-table tr.detected {
  background-color: rgba(220, 53, 69, 0.1);
}

.status-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-badge.found {
  background: rgba(220, 53, 69, 0.2);
  color: var(--status-bad);
}

.status-badge.clear {
  background: rgba(44, 194, 159, 0.2);
  color: var(--status-good);
}

/* Sign-ins Table */
.signins-table {
  font-size: 0.9rem;
}

.signins-table code {
  font-size: 0.85em;
  color: var(--text-muted);
}

.signins-table tr.failed {
  background-color: rgba(220, 53, 69, 0.1);
}

.signin-status {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 500;
}

.signin-status.success {
  background: rgba(44, 194, 159, 0.2);
  color: var(--status-good);
}

.signin-status.failed {
  background: rgba(220, 53, 69, 0.2);
  color: var(--status-bad);
}

.no-indicators {
  color: var(--text-muted);
  padding: 1.5rem;
  text-align: center;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
  border: 1px dashed #444;
}

/* ========================================
   INDICATOR POPUP
   ======================================== */
.indicator-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.indicator-popup {
  background: var(--card-dark);
  border-radius: 12px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid #444;
  animation: slideUp 0.3s ease;
}

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

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #333;
  background: rgba(0,0,0,0.2);
}

.popup-title {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.popup-title h3 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--text-light);
}

.popup-id {
  font-size: 0.85rem;
  color: var(--accent-green);
  background: rgba(44, 194, 159, 0.1);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  width: fit-content;
}

.popup-close {
  background: none;
  border: none;
  font-size: 1.75rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: color 0.2s ease;
}

.popup-close:hover {
  color: var(--status-bad);
}

.popup-body {
  padding: 1.5rem;
}

.popup-meta {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.popup-description {
  margin-bottom: 1.25rem;
}

.popup-description p {
  margin: 0;
  line-height: 1.6;
  color: var(--text-light);
}

.popup-evidence,
.popup-recommendation {
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.popup-evidence h4,
.popup-recommendation h4 {
  margin: 0 0 0.75rem 0;
  font-size: 0.85rem;
  color: var(--accent-green);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.popup-evidence ul {
  margin: 0;
  padding-left: 1.25rem;
}

.popup-evidence li {
  margin-bottom: 0.25rem;
}

.popup-recommendation p {
  margin: 0;
  color: var(--text-muted);
}

.evidence-content {
  font-size: 0.9rem;
}

/* Evidence tables in popups */
.evidence-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.evidence-table th,
.evidence-table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid #333;
}

.evidence-table th {
  background: #2c2c31;
  color: var(--accent-green);
  font-weight: 600;
  font-size: 0.8rem;
}

.evidence-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

.evidence-table code {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Clickable rows in advisory tables */
.advisory-table tr.clickable-row {
  cursor: pointer;
  transition: background 0.2s;
}

.advisory-table tr.clickable-row:hover {
  background: rgba(44, 194, 159, 0.1);
}

/* Explanation popup */
.explanation-popup {
  max-width: 600px;
}

.explanation-section {
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.explanation-section:last-child {
  margin-bottom: 0;
}

.explanation-section h4 {
  margin: 0 0 0.5rem 0;
  font-size: 0.9rem;
  color: var(--accent-green);
}

.explanation-section p {
  margin: 0;
  color: var(--text-light);
  line-height: 1.6;
}

/* Sign-in popup specific styles */
.signin-popup {
  max-width: 700px;
}

.signin-details-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.signin-details-table td {
  padding: 0.5rem 0;
  border-bottom: 1px solid #333;
}

.signin-details-table td:first-child {
  width: 140px;
  color: var(--text-muted);
}

.risk-factors-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
  overflow: hidden;
}

.risk-factors-table th,
.risk-factors-table td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid #333;
}

.risk-factors-table th {
  background: #2c2c31;
  color: var(--accent-green);
  font-size: 0.85rem;
}

.risk-factors-table .total-row {
  background: #2c2c31;
}

.risk-factors-table .total-row td {
  border-bottom: none;
}

.risk-positive {
  color: var(--status-bad);
  font-weight: 600;
}

.risk-negative {
  color: var(--status-good);
  font-weight: 600;
}

/* Risk level row colors */
.signins-table tr.risk-high {
  background: rgba(220, 53, 69, 0.15);
}

.signins-table tr.risk-medium {
  background: rgba(240, 173, 78, 0.1);
}

.signins-table tr.risk-low {
  background: rgba(255, 255, 255, 0.03);
}

.signins-table tr.clickable-row:hover {
  background: rgba(10, 114, 208, 0.2) !important;
}

/* ========================================
   ADVISORY TABLES (Summary Tab)
   ======================================== */
.advisory-section {
  margin-bottom: 1.5rem;
}

.advisory-table {
  width: 100%;
  border-collapse: collapse;
  background: #1f1f23;
  border-radius: 8px;
  overflow: hidden;
}

.advisory-table th,
.advisory-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #333;
}

.advisory-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

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

.advisory-header {
  font-size: 1rem;
  font-weight: 600;
  padding: 1rem !important;
  background: #2c2c31 !important;
}

.advisory-header.breach {
  color: var(--status-bad);
}

.advisory-header.config {
  color: var(--status-warning);
}

.advisory-header.actions {
  color: var(--primary-blue);
}

.severity-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}

.severity-badge.critical {
  background: rgba(139, 0, 0, 0.2);
  color: #dc3545;
}

.severity-badge.high {
  background: rgba(220, 53, 69, 0.2);
  color: #f0ad4e;
}

.severity-badge.medium {
  background: rgba(91, 192, 222, 0.2);
  color: #5bc0de;
}

.severity-badge.low {
  background: rgba(108, 117, 125, 0.2);
  color: #6c757d;
}

.action-link-btn {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  background: var(--primary-blue);
  color: white !important;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none !important;
  transition: background 0.2s ease;
}

.action-link-btn:hover {
  background: #0861b0;
}

/* ========================================
   SIGN-IN CARDS
   ======================================== */
.signin-card {
  background: rgba(0,0,0,0.2);
  border: 1px solid #333;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.signin-card:hover {
  border-color: var(--primary-blue);
  transform: translateX(4px);
}

.signin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.signin-app {
  font-weight: 600;
  color: var(--text-light);
}

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

.signin-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.5rem;
}

.signin-detail {
  font-size: 0.85rem;
}

.signin-detail-label {
  color: var(--text-muted);
  margin-right: 0.25rem;
}

/* ========================================
   INFO GRID
   ======================================== */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.info-card {
  background: rgba(0,0,0,0.2);
  border: 1px solid #333;
  border-radius: 8px;
  padding: 1rem;
}

.info-card-title {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}

.info-card-value {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-light);
}

/* ========================================
   ERROR SECTION
   ======================================== */
.error-card {
  background: var(--card-dark);
  border-radius: 12px;
  padding: 2rem;
  max-width: 500px;
  margin: 0 auto;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  border: 1px solid var(--status-bad);
}

.error-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.error-card h2 {
  margin: 0 0 0.5rem 0;
  color: var(--status-bad);
}

#error-message {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* ========================================
   WELCOME SECTION
   ======================================== */
.welcome-card {
  background: var(--card-dark);
  border-radius: 12px;
  padding: 3rem 2rem;
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  border: 1px solid #333;
}

.welcome-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.welcome-card h2 {
  margin: 0 0 0.5rem 0;
  font-size: 1.75rem;
}

.welcome-card > p {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  text-align: left;
}

.feature {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
}

.feature-icon {
  font-size: 1.25rem;
}

/* ========================================
   FOOTER
   ======================================== */
.app-footer {
  text-align: center;
  padding: 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid #333;
  margin-top: auto;
}

.app-footer a {
  color: var(--accent-green);
}

.app-footer .stats-line {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  opacity: 0.6;
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
  body {
    background: white;
    color: black;
  }

  .app-header,
  .app-footer,
  .report-actions,
  .report-tabs,
  #cancel-btn {
    display: none !important;
  }

  .main-content {
    padding: 0;
    max-width: none;
  }

  .tab-content {
    display: block !important;
    background: white;
    box-shadow: none;
    padding: 1rem 0;
    page-break-inside: avoid;
  }

  .tab-content::before {
    content: attr(id);
    display: block;
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    border-bottom: 2px solid #333;
    padding-bottom: 0.25rem;
    text-transform: capitalize;
  }

  .executive-summary {
    background: white;
    box-shadow: none;
    border: 1px solid #ccc;
  }

  .risk-table {
    background: white;
  }

  .risk-table th {
    background: #f0f0f0;
    color: black;
  }

  .signin-card,
  .info-card {
    background: white;
    border-color: #ccc;
  }

  .breach-circle {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 640px) {
  .app-header {
    padding: 1rem;
  }

  .main-content {
    padding: 1rem;
  }

  .executive-summary {
    padding: 1rem;
    gap: 1rem;
  }

  .breach-circle {
    width: 100px;
    height: 100px;
  }

  .breach-value {
    font-size: 1.5rem;
  }

  .summary-grid {
    flex-direction: column;
  }

  .summary-item {
    min-width: auto;
  }

  .risk-table {
    font-size: 0.85rem;
  }

  .risk-table th,
  .risk-table td {
    padding: 0.5rem;
  }

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

  .input-with-button {
    flex-direction: column;
  }

  .input-with-button .btn {
    width: 100%;
    justify-content: center;
  }
}
