/* ============================================================
   PDPL ROPA Manager — Main Stylesheet
   Design: Trust Teal / Bridge GRC
   ============================================================ */

/* --- Custom Properties ------------------------------------ */
:root {
  --primary:        #0F766E;
  --primary-light:  #14B8A6;
  --primary-dark:   #0D5B56;
  --primary-bg:     rgba(20,184,166,0.08);
  --primary-border: rgba(20,184,166,0.25);

  --surface:        #FFFFFF;
  --surface-alt:    #F8FAFC;
  --surface-hover:  #F1F5F9;
  --border:         #E2E8F0;
  --border-strong:  #CBD5E1;

  --text:           #1E293B;
  --text-muted:     #64748B;
  --text-light:     #94A3B8;

  --success:        #22C55E;
  --success-bg:     #F0FDF4;
  --success-border: #BBF7D0;
  --warning:        #F59E0B;
  --warning-bg:     #FFFBEB;
  --warning-border: #FDE68A;
  --danger:         #EF4444;
  --danger-bg:      #FEF2F2;
  --danger-border:  #FECACA;
  --info:           #3B82F6;
  --info-bg:        #EFF6FF;
  --info-border:    #BFDBFE;
  --purple:         #8B5CF6;
  --purple-bg:      #F5F3FF;

  --sidebar-width:  260px;
  --radius:         10px;
  --radius-sm:      6px;
  --radius-lg:      14px;
  --shadow-sm:      0 1px 3px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04);
  --shadow:         0 4px 6px -1px rgba(15,23,42,0.07), 0 2px 4px -2px rgba(15,23,42,0.05);
  --shadow-lg:      0 10px 15px -3px rgba(15,23,42,0.08), 0 4px 6px -4px rgba(15,23,42,0.06);
  --shadow-xl:      0 20px 25px -5px rgba(15,23,42,0.1), 0 8px 10px -6px rgba(15,23,42,0.06);
  --transition:     all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset & Base ----------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--surface-alt);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-light); }

/* --- Layout ----------------------------------------------- */
.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-container {
  padding: 28px 32px;
  flex: 1;
}

/* --- Page Header ------------------------------------------ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}

.page-header-left {}

.page-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.page-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 4px;
}

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

/* --- Cards ------------------------------------------------ */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow);
}

.card-header {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title-icon {
  width: 32px; height: 32px;
  background: var(--primary-bg);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}

.card-title-icon svg { width: 16px; height: 16px; }

.card-body {
  padding: 22px;
}

.card-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
}

/* Chart cards */
.chart-card { position: relative; }
.chart-card .card-body { min-height: 280px; display: flex; flex-direction: column; }
.chart-container { flex: 1; position: relative; min-height: 240px; }

/* --- KPI Cards -------------------------------------------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 22px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--kpi-accent, var(--primary));
}

.kpi-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.kpi-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.kpi-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.kpi-icon {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  background: var(--kpi-icon-bg, var(--primary-bg));
  color: var(--kpi-accent, var(--primary));
}

.kpi-icon svg { width: 18px; height: 18px; }

.kpi-value {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1;
}

.kpi-footer {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.kpi-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 600;
}

/* KPI accent variants */
.kpi-teal   { --kpi-accent: #0F766E; --kpi-icon-bg: rgba(20,184,166,0.1); }
.kpi-blue   { --kpi-accent: #3B82F6; --kpi-icon-bg: rgba(59,130,246,0.1); }
.kpi-amber  { --kpi-accent: #F59E0B; --kpi-icon-bg: rgba(245,158,11,0.1); }
.kpi-red    { --kpi-accent: #EF4444; --kpi-icon-bg: rgba(239,68,68,0.1); }
.kpi-purple { --kpi-accent: #8B5CF6; --kpi-icon-bg: rgba(139,92,246,0.1); }
.kpi-green  { --kpi-accent: #22C55E; --kpi-icon-bg: rgba(34,197,94,0.1); }

/* Score gauge in KPI card */
.score-gauge-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.score-gauge {
  position: relative;
  width: 72px; height: 72px;
  flex-shrink: 0;
}

.score-gauge canvas { display: block; }

.score-gauge-value {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1;
}

.score-gauge-label {
  font-size: 0.55rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- Dashboard Grid --------------------------------------- */
.dashboard-grid-2 {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 20px;
  margin-bottom: 20px;
}

.dashboard-grid-equal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.dashboard-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.full-width { grid-column: 1 / -1; }

/* --- Buttons ---------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
}

.btn svg { width: 15px; height: 15px; flex-shrink: 0; }

.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary-dark);
}
.btn-primary:hover {
  background: var(--primary-dark);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15,118,110,0.3);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-danger {
  background: var(--danger);
  color: white;
  border-color: #dc2626;
}
.btn-danger:hover {
  background: #dc2626;
  color: white;
}

.btn-success {
  background: var(--success);
  color: white;
  border-color: #16a34a;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
  padding: 7px 12px;
}
.btn-ghost:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8125rem;
}

.btn-xs {
  padding: 4px 10px;
  font-size: 0.75rem;
  border-radius: 4px;
}

.btn-icon {
  padding: 8px;
  border-radius: var(--radius-sm);
}

/* --- Badges ----------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge-success { background: var(--success-bg); color: #15803D; border: 1px solid var(--success-border); }
.badge-warning { background: var(--warning-bg); color: #B45309; border: 1px solid var(--warning-border); }
.badge-danger  { background: var(--danger-bg);  color: #B91C1C; border: 1px solid var(--danger-border); }
.badge-info    { background: var(--info-bg);    color: #1D4ED8; border: 1px solid var(--info-border); }
.badge-primary { background: var(--primary-bg); color: var(--primary-dark); border: 1px solid var(--primary-border); }
.badge-purple  { background: var(--purple-bg);  color: #6D28D9; border: 1px solid #DDD6FE; }
.badge-neutral { background: #F1F5F9; color: var(--text-muted); border: 1px solid var(--border); }

.badge-dot::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.8;
}

/* --- Status mapping --------------------------------------- */
.status-active     { @extend .badge-success; }
.status-draft      { @extend .badge-warning; }
.status-under_review { @extend .badge-info; }
.status-archived   { @extend .badge-neutral; }

/* --- Tables ----------------------------------------------- */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table thead th {
  background: #F8FAFC;
  padding: 11px 14px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

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

.data-table tbody tr:hover td {
  background: var(--surface-hover);
}

.data-table .ref-number {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.data-table .activity-name {
  font-weight: 500;
  color: var(--text);
}

.data-table .activity-name a:hover {
  color: var(--primary);
}

/* --- Score Bar -------------------------------------------- */
.score-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
}

.score-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.6s ease;
}

.score-value {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  min-width: 30px;
  text-align: right;
}

/* --- Forms ------------------------------------------------ */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-label .required {
  color: var(--danger);
  margin-left: 3px;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-control {
  width: 100%;
  padding: 9px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  transition: var(--transition);
  outline: none;
  appearance: none;
}

.form-control:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(20,184,166,0.1);
}

.form-control::placeholder { color: var(--text-light); }

textarea.form-control {
  resize: vertical;
  min-height: 90px;
  line-height: 1.6;
}

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%2364748B' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  padding-right: 36px;
  cursor: pointer;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
}

.form-check input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

.form-check-label {
  font-size: 0.875rem;
  color: var(--text);
  cursor: pointer;
}

/* Form grid */
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* Tag input style hint */
.tag-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 3px;
  font-style: italic;
}

/* Tabs */
.tab-nav {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
  overflow-x: auto;
}

.tab-btn {
  padding: 10px 18px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Step indicator */
.step-indicator {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 28px;
  overflow-x: auto;
}

.step {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.step.active .step-num {
  background: var(--primary);
  color: white;
}

.step.done .step-num {
  background: var(--success);
  color: white;
}

.step-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

.step.active .step-label { color: var(--primary); font-weight: 600; }
.step.done .step-label { color: var(--success); }

.step-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  min-width: 20px;
  max-width: 40px;
}

/* --- Filters / Search Bar --------------------------------- */
.filter-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 20px;
}

.filter-bar .form-control {
  padding: 7px 12px;
  font-size: 0.8125rem;
}

.search-input {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-input svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input input {
  padding-left: 34px;
  width: 100%;
}

/* --- Alert / Flash Messages ------------------------------- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 0.875rem;
  margin-bottom: 16px;
}

.alert-success { background: var(--success-bg); border-color: var(--success-border); color: #166534; }
.alert-warning { background: var(--warning-bg); border-color: var(--warning-border); color: #92400E; }
.alert-danger  { background: var(--danger-bg);  border-color: var(--danger-border);  color: #991B1B; }
.alert-info    { background: var(--info-bg);    border-color: var(--info-border);    color: #1E40AF; }

.alert-icon { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-close {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: 0.5;
  font-size: 1rem;
  padding: 0 4px;
  line-height: 1;
  flex-shrink: 0;
}
.alert-close:hover { opacity: 1; }

/* --- Risk Heatmap ----------------------------------------- */
.heatmap-container {
  overflow-x: auto;
}

.heatmap-table {
  border-collapse: separate;
  border-spacing: 4px;
  font-size: 0.8rem;
}

.heatmap-table th {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 5px 8px;
  text-align: center;
}

.heatmap-cell {
  width: 68px;
  height: 58px;
  border-radius: var(--radius-sm);
  text-align: center;
  vertical-align: middle;
  font-weight: 700;
  font-size: 1.2rem;
  transition: var(--transition);
  cursor: default;
  position: relative;
}

.heatmap-cell:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow);
  z-index: 1;
}

.heatmap-cell.level-0 { background: #F1F5F9; color: #CBD5E1; }
.heatmap-cell.level-low { background: #DCFCE7; color: #15803D; }
.heatmap-cell.level-medium { background: #FEF9C3; color: #854D0E; }
.heatmap-cell.level-high { background: #FEE2E2; color: #991B1B; }
.heatmap-cell.level-critical { background: #F3E8FF; color: #6B21A8; }

.heatmap-axis-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* --- Domain Compliance Grid ------------------------------- */
.domain-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.domain-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.domain-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--domain-color, var(--primary));
  border-radius: 2px 0 0 2px;
}

.domain-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
}

.domain-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  background: var(--primary-bg);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.domain-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  line-height: 1.3;
}

.domain-score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.domain-score-val {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
}

/* --- Transfer Country Badges ------------------------------ */
.transfer-country-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.country-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
}

.country-badge:hover {
  border-color: var(--primary-border);
  background: var(--primary-bg);
}

.country-flag {
  font-size: 1.4rem;
  line-height: 1;
}

.country-info {}

.country-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
}

.country-count {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* --- Review Timeline -------------------------------------- */
.review-timeline {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timeline-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.timeline-item:hover {
  border-color: var(--border-strong);
}

.timeline-item.overdue {
  background: var(--danger-bg);
  border-color: var(--danger-border);
}

.timeline-item.due-soon {
  background: var(--warning-bg);
  border-color: var(--warning-border);
}

.timeline-ref {
  font-family: monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  min-width: 60px;
}

.timeline-name {
  flex: 1;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
}

.timeline-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* --- Audit Log -------------------------------------------- */
.audit-entry {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

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

.audit-icon {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--primary-bg);
  color: var(--primary);
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 700;
}

.audit-icon.action-created { background: var(--success-bg); color: #15803D; }
.audit-icon.action-updated { background: var(--info-bg); color: #1D4ED8; }
.audit-icon.action-reviewed { background: var(--primary-bg); color: var(--primary); }
.audit-icon.action-exported { background: #F1F5F9; color: var(--text-muted); }
.audit-icon.action-assessed { background: var(--warning-bg); color: #B45309; }
.audit-icon.action-deleted { background: var(--danger-bg); color: #991B1B; }

.audit-content { flex: 1; min-width: 0; }
.audit-details {
  font-size: 0.8125rem;
  color: var(--text);
  line-height: 1.4;
}
.audit-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
  display: flex;
  gap: 10px;
}

/* --- Activity Detail -------------------------------------- */
.detail-section {
  margin-bottom: 24px;
}

.detail-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.detail-item {}

.detail-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.detail-value {
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.5;
}

.detail-value.empty { color: var(--text-light); font-style: italic; }

/* Tag list */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 0.75rem;
  color: var(--text);
  font-weight: 500;
}

.tag-primary {
  background: var(--primary-bg);
  border-color: var(--primary-border);
  color: var(--primary-dark);
}

/* --- Score indicator circular ----------------------------- */
.score-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px; height: 48px;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 700;
  border: 3px solid;
}

.score-circle.high   { border-color: var(--success); color: #15803D; background: var(--success-bg); }
.score-circle.medium { border-color: var(--warning); color: #B45309; background: var(--warning-bg); }
.score-circle.low    { border-color: var(--danger);  color: #991B1B; background: var(--danger-bg);  }

/* --- Empty States ----------------------------------------- */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state-icon {
  width: 56px; height: 56px;
  margin: 0 auto 16px;
  background: var(--surface-alt);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
}

.empty-state-icon svg { width: 24px; height: 24px; }

.empty-state h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 0.875rem;
  max-width: 320px;
  margin: 0 auto 16px;
}

/* --- Breadcrumb ------------------------------------------- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb-sep { color: var(--text-light); }
.breadcrumb-current { color: var(--text); font-weight: 500; }

/* --- Compliance assess sliders ---------------------------- */
.score-slider-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.score-slider {
  flex: 1;
  -webkit-appearance: none;
  height: 6px;
  border-radius: 99px;
  background: var(--border);
  outline: none;
  cursor: pointer;
}

.score-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 0 0 3px rgba(15,118,110,0.15);
  transition: var(--transition);
}

.score-slider::-webkit-slider-thumb:hover {
  background: var(--primary-dark);
  transform: scale(1.15);
}

.score-display {
  min-width: 44px;
  text-align: right;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

/* --- Right panel on detail page --------------------------- */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 22px;
  align-items: start;
}

.detail-sidebar {
  position: sticky;
  top: 24px;
}

.sidebar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}

.sidebar-card-header {
  padding: 12px 16px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.sidebar-card-body {
  padding: 14px 16px;
}

/* --- Section dividers ------------------------------------- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: var(--primary-bg);
  color: var(--primary);
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 700;
}

/* --- Reports page ----------------------------------------- */
.report-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.report-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: var(--transition);
}

.report-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
}

.report-card-icon {
  width: 48px; height: 48px;
  background: var(--primary-bg);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.report-card-icon svg { width: 22px; height: 22px; }

.report-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.report-card-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
}

/* --- Utilities -------------------------------------------- */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--text-muted); }
.text-sm     { font-size: 0.8125rem; }
.text-xs     { font-size: 0.75rem; }
.font-mono   { font-family: 'JetBrains Mono', monospace; }
.font-bold   { font-weight: 700; }
.font-semibold { font-weight: 600; }

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }

.w-full { width: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- Scrollbar -------------------------------------------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* --- Animations ------------------------------------------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

.animate-in { animation: fadeInUp 0.4s ease both; }
.animate-in-delay-1 { animation-delay: 0.05s; }
.animate-in-delay-2 { animation-delay: 0.1s; }
.animate-in-delay-3 { animation-delay: 0.15s; }
.animate-in-delay-4 { animation-delay: 0.2s; }

/* --- Error pages ------------------------------------------ */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  padding: 40px;
}

.error-code {
  font-size: 6rem;
  font-weight: 900;
  color: var(--border);
  letter-spacing: -0.05em;
  line-height: 1;
  margin-bottom: 16px;
}

.error-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.error-desc {
  color: var(--text-muted);
  margin-bottom: 24px;
}
