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

:root {
  --bg: #0f172a;
  --bg-card: #1e293b;
  --bg-hover: #334155;
  --border: #334155;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --critical: #dc2626;
}

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

.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.auth-card h1 { font-size: 1.35rem; margin-bottom: 0.25rem; white-space: nowrap; }
.subtitle { color: var(--text-muted); margin-bottom: 1.5rem; }

.tabs { display: flex; gap: 0; margin-bottom: 1.5rem; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.tab {
  flex: 1; padding: 0.6rem; background: transparent; color: var(--text-muted);
  border: none; cursor: pointer; font-size: 0.9rem; transition: all 0.2s;
}
.tab.active { background: var(--primary); color: white; }

form { display: flex; flex-direction: column; gap: 0.75rem; }
input, select, textarea {
  padding: 0.7rem 0.9rem; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 0.9rem; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }

.btn {
  padding: 0.65rem 1.25rem; border-radius: 8px; border: none; cursor: pointer;
  font-size: 0.9rem; font-weight: 500; transition: all 0.2s; color: white;
  background: var(--bg-hover);
}
.btn-primary { background: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }
.btn-danger { background: var(--danger); }

.password-wrapper {
  position: relative; width: 100%;
}
.password-wrapper input {
  width: 100%; padding-right: 2.5rem;
}
.toggle-password {
  position: absolute; right: 0.5rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 1.1rem;
  color: var(--text-muted); padding: 0.25rem; line-height: 1; opacity: 0.6;
  transition: opacity 0.2s;
}
.toggle-password:hover { opacity: 1; }

.error { color: var(--danger); margin-top: 0.75rem; font-size: 0.85rem; }

.navbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.75rem 1.5rem; background: var(--bg-card); border-bottom: 1px solid var(--border);
}
.nav-brand { font-weight: 700; font-size: 1.1rem; }
.nav-right { display: flex; align-items: center; gap: 1rem; }
.nav-right span { color: var(--text-muted); font-size: 0.85rem; }

.main-content { display: flex; height: calc(100vh - 52px); }

.sidebar {
  width: 200px; min-width: 200px; padding: 1rem 0.75rem;
  background: var(--bg-card); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 0.25rem; overflow-y: auto;
}

.nav-item {
  padding: 0.6rem 0.9rem; border-radius: 6px; border: none; background: transparent;
  color: var(--text-muted); cursor: pointer; text-align: left; font-size: 0.9rem;
  transition: all 0.15s; width: 100%;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text); }
.nav-item.active { background: var(--primary); color: white; }

.sidebar-divider {
  height: 1px; background: var(--border); margin: 0.75rem 0;
}

.sidebar-category {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.6rem 0.9rem; color: var(--text); font-size: 0.8rem;
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  cursor: pointer; border-radius: 6px; transition: all 0.15s;
  user-select: none;
}
.sidebar-category:hover { background: var(--bg-hover); }
.category-arrow {
  font-size: 0.7rem; transition: transform 0.2s;
}
.sidebar-category.open .category-arrow {
  transform: rotate(180deg);
}

.sidebar-submenu {
  display: none; flex-direction: column; gap: 0.15rem;
  padding-left: 0.5rem;
}
.sidebar-submenu.open {
  display: flex;
}
.nav-item.sub-item {
  font-size: 0.82rem; padding: 0.45rem 0.9rem;
  border-left: 2px solid var(--border); border-radius: 0 6px 6px 0;
}
a.nav-item.sub-item {
  text-decoration: none; color: var(--text-muted); display: block;
}
a.nav-item.sub-item:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.sidebar-subcategory {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.45rem 0.9rem; color: var(--text-muted); font-size: 0.75rem;
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
  cursor: pointer; border-radius: 6px; transition: all 0.15s;
  user-select: none; border-left: 2px solid var(--border);
}
.sidebar-subcategory:hover { background: var(--bg-hover); color: var(--text); }
.sidebar-subcategory.open { color: var(--primary); border-left-color: var(--primary); }
.subcategory-arrow { font-size: 0.6rem; transition: transform 0.2s; }
.sidebar-subcategory.open .subcategory-arrow { transform: rotate(180deg); }
.sidebar-subsubmenu {
  display: none; flex-direction: column; gap: 0.1rem;
  padding-left: 0.75rem;
}
.sidebar-subsubmenu.open { display: flex; }
.nav-item.sub-item-l2 {
  font-size: 0.78rem; padding: 0.35rem 0.8rem;
  border-left: 2px solid var(--border); border-radius: 0 6px 6px 0;
  color: var(--text-muted);
}
.nav-item.sub-item-l2:hover { color: var(--text); }
.nav-item.sub-item-l2.active { color: var(--primary); border-left-color: var(--primary); }
.nav-item.sub-item.active {
  border-left-color: var(--primary);
}

.content { flex: 1; padding: 1.5rem; overflow-y: auto; }

.section-desc {
  color: var(--text-muted); font-size: 0.85rem; margin-bottom: 1.25rem;
}

.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; gap: 8px; }
.section-header-actions { display: flex; gap: 8px; align-items: center; }
.btn-export {
  background: transparent; border: 1px solid var(--border); color: var(--text-muted);
  padding: 0.35rem 0.75rem; font-size: 0.78rem; border-radius: 6px; cursor: pointer;
  transition: all 0.2s; display: inline-flex; align-items: center; gap: 4px;
}
.btn-export:hover { background: var(--bg-hover); color: var(--text); border-color: var(--text-muted); }
.btn-export-pdf { border-color: #ef4444; color: #ef8888; }
.btn-export-pdf:hover { background: rgba(239,68,68,0.15); color: #ef4444; border-color: #ef4444; }

.theme-header td {
  background: var(--bg-hover); font-weight: 600; font-size: 0.85rem;
  color: var(--primary); padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border);
}
.clause-group td {
  background: rgba(59,130,246,0.06); font-weight: 600; font-size: 0.88rem;
  color: var(--text); padding: 0.65rem 0.75rem;
}
.sub-clause td {
  padding-left: 1.75rem; font-size: 0.85rem; color: var(--text-muted);
}
.article-header td {
  background: var(--bg-hover); font-weight: 700; font-size: 0.9rem;
  color: var(--primary); padding: 0.7rem 0.75rem;
}
.subarticle td {
  padding-left: 1.75rem; font-size: 0.85rem;
}

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

.stat-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
  padding: 1.25rem; transition: border-color 0.2s;
}
.stat-card:hover { border-color: var(--primary); }
.stat-card .label { color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
.stat-card .value { font-size: 2rem; font-weight: 700; margin: 0.25rem 0; }
.stat-card .detail { color: var(--text-muted); font-size: 0.8rem; }

.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 1.25rem;
}
.card h3 { margin-bottom: 0.75rem; font-size: 1rem; }
.mt { margin-top: 1.25rem; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 0.6rem 0.75rem; color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--border); }
td { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
tr:hover td { background: rgba(255,255,255,0.02); }

.badge {
  display: inline-block; padding: 0.2rem 0.6rem; border-radius: 9999px;
  font-size: 0.75rem; font-weight: 500; text-transform: capitalize;
}
.badge-low, .badge-implemented, .badge-compliant, .badge-approved, .badge-active { background: rgba(34,197,94,0.15); color: var(--success); }
.badge-medium, .badge-in_progress, .badge-review, .badge-draft { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-high, .badge-not_started, .badge-not_compliant, .badge-non_compliant { background: rgba(239,68,68,0.15); color: var(--danger); }
.badge-critical { background: rgba(220,38,38,0.2); color: var(--critical); }
.badge-open, .badge-not_applicable, .badge-archived, .badge-inactive { background: rgba(148,163,184,0.15); color: var(--text-muted); }
.badge-mitigated, .badge-accepted, .badge-closed { background: rgba(59,130,246,0.15); color: var(--primary); }

.activity-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.5rem 0; border-bottom: 1px solid var(--border); font-size: 0.85rem;
}
.activity-item:last-child { border-bottom: none; }
.activity-action { color: var(--text); }
.activity-actor { color: var(--primary); font-weight: 500; }
.activity-time { color: var(--text-muted); font-size: 0.8rem; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: flex; justify-content: center; align-items: center; z-index: 100;
}
.modal {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
  width: 100%; max-width: 700px; max-height: 90vh; overflow-y: auto;
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 1.5rem; border-bottom: 1px solid var(--border);
}
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; }
.modal-body { padding: 1.5rem; }
.modal-body form { gap: 0.75rem; }
.form-group { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.75rem; }
.form-group label { font-size: 0.8rem; color: var(--text-muted); }

.action-btns { white-space: nowrap; }
.action-btns .btn { margin-right: 0.25rem; }

.entity-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
  padding: 1.25rem; margin-bottom: 1rem; transition: border-color 0.2s;
}
.entity-card:hover { border-color: var(--primary); }
.entity-card-header {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 0.75rem; border-bottom: 1px solid var(--border);
}
.entity-card-title { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.entity-card-title strong { font-size: 1.05rem; }
.entity-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}
.entity-field { display: flex; flex-direction: column; gap: 0.15rem; }
.field-label {
  font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.04em; font-weight: 600;
}
.field-value { font-size: 0.88rem; word-break: break-word; }

.form-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem;
}
@media (max-width: 500px) {
  .form-row { grid-template-columns: 1fr; }
}

.supplier-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
  padding: 1.25rem; margin-bottom: 1rem; transition: border-color 0.2s;
}
.supplier-card:hover { border-color: var(--primary); }
.supplier-card-header {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 0.75rem; border-bottom: 1px solid var(--border);
}
.supplier-card-title { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.supplier-card-title strong { font-size: 1.05rem; }
.supplier-cod {
  font-size: 0.8rem; font-weight: 600; color: var(--primary);
  background: rgba(59,130,246,0.1); padding: 0.15rem 0.5rem; border-radius: 4px;
}

.collapsible-card-header {
  cursor: pointer;
  user-select: none;
}
.collapsible-card:not(.card-expanded) .collapsible-card-header {
  border-bottom: none;
  padding-bottom: 0;
}
.collapse-indicator {
  display: inline-block;
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.collapse-indicator.expanded {
  transform: rotate(90deg);
}
.card-summary-field {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-left: 0.25rem;
}
.card-summary-field .field-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-right: 0.2rem;
}
.collapsible-card-details {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.checkbox-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 0.35rem; margin-top: 0.25rem;
}
.checkbox-label {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.85rem; color: var(--text); cursor: pointer;
  padding: 0.3rem 0.4rem; border-radius: 4px; transition: background 0.15s;
}
.checkbox-label:hover { background: var(--bg-hover); }
.checkbox-label input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: var(--primary);
  cursor: pointer; flex-shrink: 0;
}
@media (max-width: 500px) {
  .checkbox-grid { grid-template-columns: 1fr; }
}

.empty { text-align: center; padding: 2rem; color: var(--text-muted); }

.badge-eu { background: #1d4ed8; color: #fff; }
.badge-non-eu { background: #6b7280; color: #fff; }

.maturity-badge-high { background: #16a34a; color: #fff; }
.maturity-badge-medium { background: #ca8a04; color: #fff; }
.maturity-badge-moderate { background: #ea580c; color: #fff; }
.maturity-badge-low { background: #dc2626; color: #fff; }

.form-divider { border-top: 1px solid var(--border); margin: 1rem 0; }
.form-section-title { color: var(--primary); font-size: 0.95rem; margin-bottom: 0.5rem; }
.form-hint {
  font-size: 0.8rem; padding: 0.4rem 0.6rem; border-radius: 4px;
  margin-top: 0.3rem;
}
.hint-eu { background: rgba(29,78,216,0.15); color: #60a5fa; }
.hint-non-eu { background: rgba(107,114,128,0.15); color: #9ca3af; }

.doc-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
  margin-bottom: 1rem; overflow: hidden;
}
.doc-card-header {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.75rem 1rem; background: rgba(0,0,0,0.1);
}
.doc-card.card-expanded .doc-card-header {
  border-bottom: 1px solid var(--border);
}
.doc-card-title-row {
  display: flex; align-items: center; gap: 0.75rem; flex: 1;
}
.doc-code-badge {
  background: var(--primary); color: #fff; padding: 0.2rem 0.6rem;
  border-radius: 4px; font-weight: 600; font-size: 0.85rem; white-space: nowrap;
}
.doc-title { font-weight: 600; flex: 1; }
.doc-card-body {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.5rem 1rem;
  padding: 0.75rem 1rem;
}
.doc-field { display: flex; flex-direction: column; gap: 0.15rem; }
.doc-field-wide { grid-column: 1 / -1; }
.doc-card-actions {
  display: flex; gap: 0.5rem; padding: 0.5rem 1rem;
  border-top: 1px solid var(--border); justify-content: flex-end;
}
.doc-file-link { color: var(--primary); text-decoration: underline; }
.doc-file-link:hover { color: var(--primary-hover); }

.badge-type {
  background: rgba(99,102,241,0.2); color: #a5b4fc; font-size: 0.75rem;
  padding: 0.15rem 0.5rem; border-radius: 4px; font-weight: 500; white-space: nowrap;
}

.ref-tag {
  display: inline-block; padding: 0.15rem 0.5rem; border-radius: 4px;
  font-size: 0.78rem; font-weight: 500; margin: 0.1rem 0.15rem;
}
.ref-annex-a { background: rgba(59,130,246,0.2); color: #93c5fd; }
.ref-clause { background: rgba(34,197,94,0.2); color: #86efac; }
.ref-nis2 { background: rgba(245,158,11,0.2); color: #fcd34d; }
.ref-doc { background: rgba(168,85,247,0.2); color: #c4b5fd; }
.ref-remove {
  background: none; border: none; color: inherit; cursor: pointer;
  font-size: 0.9rem; margin-left: 0.2rem; padding: 0; line-height: 1;
}
.ref-tags-container { min-height: 28px; display: flex; flex-wrap: wrap; gap: 0.2rem; margin-top: 0.3rem; }
.fw-ref-area { margin-bottom: 0.5rem; }
.fw-ref-controls { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.fw-ref-controls select { flex: 1; min-width: 150px; }
.current-file { margin-bottom: 0.4rem; font-size: 0.85rem; color: var(--text-muted); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

.iso-scope-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
  margin-bottom: 1rem; overflow: hidden;
}
.iso-scope-header {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.75rem 1rem; background: rgba(0,0,0,0.1);
}
.iso-scope-card.card-expanded .iso-scope-header {
  border-bottom: 1px solid var(--border);
}
.iso-scope-info { display: flex; align-items: center; gap: 0.75rem; }
.iso-entity-name { font-weight: 700; font-size: 1rem; }
.iso-country-badge {
  background: rgba(59,130,246,0.15); color: #93c5fd; padding: 0.15rem 0.5rem;
  border-radius: 4px; font-size: 0.8rem; font-weight: 500;
}
.iso-scope-meta { display: flex; align-items: center; gap: 0.75rem; }
.iso-pct-bar {
  position: relative; width: 140px; height: 22px; background: rgba(255,255,255,0.08);
  border-radius: 4px; overflow: hidden;
}
.iso-pct-fill {
  height: 100%; border-radius: 4px; transition: width 0.3s ease;
}
.iso-pct-high { background: #22c55e; }
.iso-pct-mid { background: #f59e0b; }
.iso-pct-low { background: #ef4444; }
.iso-pct-label {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 600; color: #fff;
}
.iso-scope-name { padding: 0.5rem 1rem; border-bottom: 1px solid var(--border); }
.iso-items-section { padding: 0.75rem 1rem; }
.iso-items-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem;
}
.iso-items-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.iso-items-table th { text-align: left; padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--border); color: var(--text-muted); font-weight: 600; }
.iso-items-table td { padding: 0.4rem 0.5rem; border-bottom: 1px solid rgba(255,255,255,0.04); }
.iso-status-select {
  background: var(--bg-card); color: var(--text); border: 1px solid var(--border);
  border-radius: 4px; padding: 0.2rem 0.4rem; font-size: 0.8rem;
}
.badge-not_implemented { background: rgba(239,68,68,0.2); color: #fca5a5; }
.badge-on_going { background: rgba(245,158,11,0.2); color: #fcd34d; }
.badge-implemented { background: rgba(34,197,94,0.2); color: #86efac; }

.report-kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem; margin-bottom: 1.25rem;
}
.report-kpi {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
  padding: 1rem; text-align: center; transition: border-color 0.2s;
}
.report-kpi:hover { border-color: var(--primary); }
.report-kpi-value { font-size: 1.75rem; font-weight: 700; color: var(--text); }
.report-kpi-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 0.25rem; }

.report-charts-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem;
}
.report-chart-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
  padding: 1.25rem; margin-bottom: 1rem;
}
.report-chart-card h3 { font-size: 0.95rem; margin-bottom: 0.75rem; color: var(--text); }
.report-chart-wide { grid-column: 1 / -1; }
.report-canvas-container { position: relative; width: 100%; }

.report-donut-wrapper {
  display: flex; align-items: center; gap: 1.5rem; justify-content: center;
}
.report-donut-legend { display: flex; flex-direction: column; gap: 0.5rem; font-size: 0.82rem; color: var(--text-muted); }
.legend-dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 0.4rem; vertical-align: middle;
}

.report-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.report-table th { text-align: left; padding: 0.5rem 0.6rem; color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid var(--border); }
.report-table td { padding: 0.5rem 0.6rem; border-bottom: 1px solid rgba(255,255,255,0.04); vertical-align: middle; }
.report-table tr:hover td { background: rgba(255,255,255,0.02); }

.mini-bar {
  display: inline-flex; align-items: center; gap: 0.5rem; width: 100%;
}
.mini-bar > div {
  height: 8px; border-radius: 4px; min-width: 2px; flex-shrink: 0; max-width: 80px;
}
.mini-bar > span { font-size: 0.8rem; font-weight: 600; white-space: nowrap; }

.report-country-selector {
  display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.25rem;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 0.75rem 1rem;
}
.report-country-selector label { font-size: 0.85rem; color: var(--text-muted); font-weight: 600; white-space: nowrap; }
.report-country-selector select { flex: 1; max-width: 300px; }

.report-info-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
  padding: 0.75rem 1rem; margin-bottom: 1rem; font-size: 0.88rem;
  display: flex; align-items: center; gap: 0.75rem;
}

.risk-charts-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px; margin-bottom: 16px;
}
.risk-chart-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
  padding: 16px;
}
.risk-chart-card h4 { color: var(--text); margin-bottom: 12px; font-size: 0.9rem; }

.donut-chart {
  width: 140px; height: 140px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
}
.donut-hole {
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--bg-card); display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 700; color: var(--text);
}
.donut-legend { font-size: 0.8rem; color: var(--text-muted); }
.donut-legend-item { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

.hbar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.hbar-label { width: 140px; text-align: right; font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { flex: 1; height: 18px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 4px; transition: width 0.3s; }
.hbar-value { width: 30px; font-size: 0.85rem; font-weight: 600; color: var(--text); }

.risk-filters {
  display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
}
.risk-filters select {
  padding: 6px 10px; background: var(--bg-card); color: var(--text); border: 1px solid var(--border);
  border-radius: 6px; font-size: 0.85rem;
}

.risk-table { width: 100%; font-size: 0.85rem; }
.risk-table th { background: #2980b9; color: #fff; padding: 8px 10px; text-align: left; white-space: nowrap; }
.risk-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.cell-text { max-width: 200px; font-size: 0.8rem; color: var(--text-muted); }

.form-grid-2col {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.form-grid-2col .full-width { grid-column: 1 / -1; }

.top-risk-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
  margin-bottom: 16px; overflow: hidden;
}
.top-risk-header {
  display: flex; align-items: center; gap: 16px; padding: 14px 20px;
  background: rgba(255,255,255,0.03); border-bottom: 1px solid var(--border);
}
.top-risk-score { font-size: 0.95rem; color: var(--text); }
.top-risk-area { color: var(--text-muted); font-size: 0.9rem; margin-left: auto; }
.top-risk-body { padding: 16px 20px; display: flex; gap: 24px; }
.top-risk-main { flex: 1; }
.top-risk-main h4 { color: var(--text); margin-bottom: 8px; }
.top-risk-summary { color: var(--text-muted); font-size: 0.88rem; line-height: 1.5; }
.top-risk-details {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; min-width: 260px;
}
.top-risk-detail-item label { display: block; font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; margin-bottom: 2px; }
.top-risk-detail-item span { font-size: 0.9rem; color: var(--text); }
.top-risk-panels {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
  border-top: 1px solid var(--border);
}
.top-risk-panel {
  padding: 14px 20px; border-right: 1px solid var(--border);
}
.top-risk-panel:last-child { border-right: none; }
.top-risk-panel h5 { color: #27ae60; font-size: 0.8rem; margin-bottom: 8px; text-transform: uppercase; }
.top-risk-panel p { color: var(--text-muted); font-size: 0.85rem; line-height: 1.5; }

.risk-matrix-tabs { margin-bottom: 16px; display: flex; gap: 8px; }
.risk-matrix-container { margin-bottom: 16px; }
.matrix-grid { display: flex; flex-direction: column; align-items: center; }
.matrix-body { display: flex; flex-direction: column; }
.matrix-row { display: flex; align-items: center; }
.matrix-row-label { width: 30px; text-align: center; font-weight: 600; color: var(--text); font-size: 0.9rem; }
.matrix-cell {
  width: 80px; height: 60px; display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(0,0,0,0.15); cursor: default; transition: opacity 0.2s;
}
.matrix-cell:hover { opacity: 0.85; }
.matrix-count {
  background: rgba(0,0,0,0.3); color: #fff; border-radius: 50%;
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem;
}
.matrix-x-labels { margin-top: 2px; }
.matrix-x-label { width: 80px; text-align: center; font-weight: 600; color: var(--text); font-size: 0.9rem; }
.matrix-y-label {
  writing-mode: vertical-rl; text-orientation: mixed; transform: rotate(180deg);
  font-weight: 600; color: var(--text); margin-right: 4px; font-size: 0.85rem;
}
.matrix-x-title { text-align: center; font-weight: 600; color: var(--text); margin-top: 6px; font-size: 0.85rem; }
.matrix-legend { display: flex; gap: 16px; justify-content: center; margin-top: 12px; }
.legend-item { display: flex; align-items: center; gap: 4px; font-size: 0.85rem; color: var(--text-muted); }

.badge-n\/a, .badge-not-started { background: #6c757d; }
.badge-in-progress { background: #e67e22; }
.badge-completed { background: #27ae60; }

@media (max-width: 900px) {
  .report-charts-row { grid-template-columns: 1fr; }
  .risk-charts-grid { grid-template-columns: 1fr 1fr; }
  .top-risk-panels { grid-template-columns: 1fr; }
  .top-risk-body { flex-direction: column; }
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .report-kpi-grid { grid-template-columns: 1fr 1fr; }
  .risk-charts-grid { grid-template-columns: 1fr; }
  .form-grid-2col { grid-template-columns: 1fr; }
}

.licensing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.licensing-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  transition: all 0.3s ease;
}

.licensing-active {
  border-color: var(--success);
}

.licensing-inactive {
  border-color: var(--danger);
  opacity: 0.7;
}

.licensing-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.licensing-module-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.licensing-card-status {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.licensing-active .licensing-card-status {
  color: var(--success);
}

.licensing-inactive .licensing-card-status {
  color: var(--danger);
}

.licensing-toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.licensing-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.licensing-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--danger);
  border-radius: 26px;
  transition: 0.3s;
}

.licensing-toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s;
}

.licensing-toggle input:checked + .licensing-toggle-slider {
  background-color: var(--success);
}

.licensing-toggle input:checked + .licensing-toggle-slider:before {
  transform: translateX(22px);
}
