@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;500;600;700&family=Space+Grotesk:wght@500;600&display=swap');

:root {
  --bg: #0f141b;
  --bg-accent: #151c26;
  --ink: #f4f6fb;
  --muted: #9aa4b2;
  --text: #f4f6fb;
  --accent: #e4537a;
  --accent-2: #5b78ff;
  --accent-3: #f28aa6;
  --card: #141b26;
  --error: #e66b7a;
  --shadow: 0 14px 30px rgba(5, 8, 12, 0.45);
  --panel: rgba(20, 27, 38, 0.95);
  --border: rgba(255, 255, 255, 0.08);
  --glass: rgba(21, 28, 38, 0.92);
  --radius: 12px;
  --link: #dbe8ff;
  --link-hover: #ffffff;
  --link-visited: #c9dbff;
}

html[data-theme="light"] {
  --bg: #f3f5f9;
  --bg-accent: #e8edf5;
  --ink: #0f172a;
  --muted: #5b667a;
  --text: #0f172a;
  --accent: #e4537a;
  --accent-2: #4b6cff;
  --accent-3: #f28aa6;
  --card: #ffffff;
  --error: #d84e63;
  --shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  --panel: rgba(255, 255, 255, 0.98);
  --border: rgba(15, 23, 42, 0.08);
  --glass: rgba(255, 255, 255, 0.95);
  --link: #1e40af;
  --link-hover: #1d4ed8;
  --link-visited: #3730a3;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg-accent), var(--bg));
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  min-width: 1320px;
}

body::before,
body::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 10%, rgba(91, 120, 255, 0.12), transparent 45%),
              radial-gradient(circle at 80% 0%, rgba(228, 83, 122, 0.12), transparent 40%);
  z-index: -1;
}

a,
a:visited {
  color: var(--link);
}

a:hover,
a:focus-visible {
  color: var(--link-hover);
}

a:visited {
  color: var(--link-visited);
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 18px 16px;
  gap: 18px;
  transition: width 0.2s ease, transform 0.2s ease;
  position: sticky;
  top: 0;
  height: 100vh;
}

html[data-theme="light"] .sidebar {
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(241, 245, 249, 0.95));
}

.sidebar.collapsed {
  width: 76px;
}


.sidebar.pinned {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sidebar-controls {
  display: flex;
  gap: 8px;
}

.icon-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  padding: 6px 8px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
}

.icon-btn:hover {
  color: var(--ink);
  border-color: var(--accent-2);
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: var(--panel);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 40;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.back-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(12, 16, 22, 0.64);
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: none;
}

.back-btn:hover {
  transform: none;
  filter: none;
  border-color: rgba(82, 194, 255, 0.55);
}

.header-brand .brand-logo {
  width: 58px;
  height: 58px;
}

.header-brand.varqus-brand .brand-logo {
  width: 220px;
  height: 58px;
  object-fit: contain;
  object-position: left center;
}

@media (max-width: 900px) {
  .header-brand.varqus-brand .brand-logo {
    width: 160px;
    height: 46px;
  }
}

html[data-theme="light"] .site-header {
  background: linear-gradient(120deg, rgba(248, 250, 252, 0.98), rgba(241, 245, 249, 0.92));
  border-bottom-color: rgba(15, 23, 42, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0;
}

.brand-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.35));
}

html[data-theme="light"] .brand-logo {
  filter: drop-shadow(0 6px 18px rgba(15, 23, 42, 0.18));
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-right: 0;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.nav-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-row > a {
  flex: 1;
}

.nav-sub {
  display: none;
  flex-direction: column;
  gap: 6px;
  margin-left: 18px;
}

.nav-sub.open {
  display: flex;
}

.nav-caret-btn {
  all: unset;
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-caret-btn:hover {
  color: var(--ink);
}

.nav-caret-btn.open {
  transform: rotate(180deg);
}

.nav-sub a {
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 10px;
}

.nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar .nav a {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 10px 12px;
  border-radius: 12px;
}

.sidebar.collapsed .nav a {
  justify-content: center;
  padding: 10px;
}

.sidebar.collapsed .nav a::after {
  display: none;
}

.sidebar.collapsed .nav a {
  font-size: 0;
}

.sidebar.collapsed .nav-sub {
  display: none;
}

.sidebar.collapsed .nav a::before {
  content: attr(data-icon);
  font-size: 16px;
  color: var(--muted);
}

.sidebar.collapsed .brand-logo {
  width: 48px;
  height: 48px;
}

.sidebar.collapsed .sidebar-controls {
  flex-direction: column;
}

.sidebar.collapsed .sidebar-top {
  flex-direction: column;
}

.sidebar.collapsed .nav a {
  border: 1px solid var(--border);
}

.sidebar.collapsed .nav a:hover::before {
  color: var(--accent);
}

.content {
  width: 100%;
  max-width: 1760px;
  margin: 0 auto;
  padding: 24px 28px 42px;
}

.nav a:hover {
  color: var(--ink);
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="light"] .nav a {
  color: #0f172a;
}

html[data-theme="light"] .nav a:hover {
  background: rgba(15, 23, 42, 0.06);
  border-color: rgba(15, 23, 42, 0.12);
}

button,
.pill {
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 9px 14px;
  font-weight: 600;
  cursor: pointer;
}

button {
  background: var(--accent-2);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(19, 24, 32, 0.25);
}

button:hover {
  filter: brightness(1.05);
}

.nav .nav-caret-btn {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  width: 16px;
  height: 16px;
}

.nav .nav-caret-btn:hover {
  filter: none;
  background: transparent;
}

.pill {
  background: transparent;
  color: var(--ink);
  border-color: var(--border);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.pill:hover {
  border-color: rgba(91, 120, 255, 0.5);
}

.pill.active {
  background: rgba(91, 120, 255, 0.18);
  border-color: rgba(91, 120, 255, 0.35);
  color: var(--ink);
}

.split {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.check-panel {
  margin-top: 12px;
}

.brand {
  font-family: "Space Grotesk", sans-serif;
  font-size: 22px;
  letter-spacing: 0.4px;
}

.content {
  width: 100%;
  max-width: 1760px;
  margin: 0 auto;
  padding: 24px 28px 42px;
}

.layout {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  align-items: start;
}

.layout-wide {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(220px, 1fr) minmax(240px, 1.1fr) minmax(240px, 1.1fr);
  align-items: start;
}

.layout-full {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.panel {
  background: var(--panel);
  border-radius: calc(var(--radius) + 4px);
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.panel-stack {
  display: grid;
  gap: 16px;
}

.create-layout {
  display: grid;
  gap: 28px;
}

.create-row {
  display: grid;
  gap: 28px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}

@media (max-width: 900px) {
  .create-row {
    grid-template-columns: 1fr;
  }
}

.report-layout {
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  align-items: start;
}

.report-layout--single {
  grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 1100px) {
  .report-layout {
    grid-template-columns: 1fr;
  }
}

.risk-layout {
  display: grid;
  gap: 28px;
}

.risk-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.metric {
  background: rgba(18, 24, 32, 0.9);
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 16px;
  display: grid;
  gap: 6px;
  min-width: 0;
}

.metric-label {
  font-size: 12px;
  color: var(--muted);
}

.metric-value {
  font-size: 20px;
  font-weight: 700;
}

.metric.metric-low {
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.45);
}

.metric.metric-low .metric-label,
.metric.metric-low .metric-value {
  color: #c7f9c0;
}

.metric.metric-moderate {
  background: rgba(255, 159, 64, 0.12);
  border-color: rgba(255, 159, 64, 0.45);
}

.metric.metric-moderate .metric-label,
.metric.metric-moderate .metric-value {
  color: #ffd7a3;
}

.metric.metric-high,
.metric.metric-critical {
  background: rgba(255, 77, 77, 0.12);
  border-color: rgba(255, 77, 77, 0.45);
}

.metric.metric-high .metric-label,
.metric.metric-high .metric-value,
.metric.metric-critical .metric-label,
.metric.metric-critical .metric-value {
  color: #ffb1b1;
}

.risk-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.risk-node {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(18, 24, 32, 0.9);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 13px;
}

.risk-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.risk-card {
  background: rgba(18, 24, 32, 0.9);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  display: grid;
  gap: 12px;
}

.risk-placeholder {
  border: 1px dashed var(--border);
  border-radius: 14px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.risk-map {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 12px;
}

.risk-map-list,
.risk-map-detail,
.risk-timeline,
.risk-signal-list {
  display: grid;
  gap: 10px;
}

.risk-rel-btn {
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(18, 24, 32, 0.9);
  color: var(--text);
  font-weight: 600;
}

.risk-filter {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.risk-case-filter {
  display: grid;
  grid-template-columns: minmax(260px, 440px) auto;
  gap: 12px;
  align-items: end;
}

.risk-case-filter > label {
  margin: 0;
}

.risk-case-filter-btn {
  width: auto;
  min-width: 120px;
  height: 46px;
  align-self: end;
  justify-self: start;
  padding: 0 18px;
}

.risk-timeline-item {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(18, 24, 32, 0.9);
  border: 1px solid var(--border);
  font-size: 13px;
}

.risk-score {
  display: grid;
  gap: 6px;
}

.risk-score-value {
  font-size: 28px;
  font-weight: 800;
}

.risk-signal-list {
  display: grid;
  gap: 8px;
}

.risk-signal {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(208, 106, 46, 0.12);
  border: 1px solid rgba(208, 106, 46, 0.25);
  font-size: 13px;
}

.risk-action {
  justify-self: start;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(208, 106, 46, 0.35);
  background: rgba(208, 106, 46, 0.15);
  color: var(--accent);
  font-weight: 700;
}

.risk-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.risk-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.risk-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.risk-queue-layout {
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.risk-queue-panel {
  display: grid;
  gap: 12px;
}

.risk-queue-metrics {
  display: grid;
  gap: 12px;
}

.risk-queue-actions {
  display: grid;
  gap: 8px;
}

.risk-queue-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.risk-queue-toolbar--split {
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
}

.risk-bulk-form {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  align-items: center;
}

.risk-bulk-select {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(18, 24, 32, 0.9);
  color: var(--text);
}

.risk-queue-actions-inline {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.risk-queue-main textarea {
  width: 100%;
  min-width: 160px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(18, 24, 32, 0.9);
  color: var(--text);
  padding: 6px 8px;
  font-size: 12px;
}

.risk-search {
  width: min(360px, 100%);
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(18, 24, 32, 0.9);
  color: var(--text);
}

.risk-search-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: nowrap;
}

.risk-search::placeholder {
  color: var(--muted);
}

.risk-queue-main {
  display: grid;
  gap: 16px;
}

.risk-form-grid {
  display: grid;
  gap: 12px;
}

.case-card .risk-form-grid label,
.analyze-invoice-modal .risk-form-grid label,
.panel .risk-form-grid label {
  display: grid;
  gap: 6px;
}

.case-card .risk-form-grid input,
.case-card .risk-form-grid select,
.case-card .risk-form-grid textarea,
.analyze-invoice-modal .risk-form-grid input,
.analyze-invoice-modal .risk-form-grid select,
.analyze-invoice-modal .risk-form-grid textarea,
.panel .risk-form-grid input,
.panel .risk-form-grid select,
.panel .risk-form-grid textarea {
  width: 100%;
  min-height: 46px;
  box-sizing: border-box;
}

.case-card .risk-form-grid textarea,
.analyze-invoice-modal .risk-form-grid textarea,
.panel .risk-form-grid textarea {
  min-height: 110px;
}

.case-card .risk-form-grid button,
.analyze-invoice-modal .risk-form-grid button,
.panel .risk-form-grid button {
  width: 100%;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.risk-inline-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.risk-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.risk-table th,
.risk-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.risk-table th {
  white-space: nowrap;
}

.risk-table a,
.risk-table a:visited,
.table-scroll a,
.table-scroll a:visited {
  color: var(--link);
  font-weight: 600;
}

.risk-table a:hover,
.table-scroll a:hover {
  color: var(--link-hover);
}

.risk-cell-date {
  white-space: nowrap;
}

.risk-cell-total {
  white-space: nowrap;
  text-align: right;
}

.risk-cell-text,
.risk-cell-reasons,
.risk-cell-note {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.3;
}

.risk-clamp {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.risk-clamp-2 {
  -webkit-line-clamp: 2;
  max-height: 2.7em;
}

.risk-cell-action {
  white-space: nowrap;
}

.risk-table-review th:nth-child(1),
.risk-table-review td:nth-child(1) {
  width: 105px;
}

.risk-table-review th:nth-child(4),
.risk-table-review td:nth-child(4) {
  width: 95px;
}

.risk-table-review th:nth-child(5),
.risk-table-review td:nth-child(5) {
  width: 135px;
}

.risk-table-review th:nth-child(6),
.risk-table-review td:nth-child(6) {
  width: 70px;
}

.risk-table-review th:nth-child(9),
.risk-table-review td:nth-child(9) {
  width: 170px;
}

.risk-table-cases th:nth-child(1),
.risk-table-cases td:nth-child(1) {
  width: 34px;
}

.risk-table-cases th:nth-child(2),
.risk-table-cases td:nth-child(2) {
  width: 130px;
}

.risk-table-cases th:nth-child(3),
.risk-table-cases td:nth-child(3) {
  width: 105px;
}

.risk-table-cases th:nth-child(6),
.risk-table-cases td:nth-child(6) {
  width: 95px;
}

.risk-table-cases th:nth-child(7),
.risk-table-cases td:nth-child(7) {
  width: 135px;
}

.risk-table-cases th:nth-child(8),
.risk-table-cases td:nth-child(8) {
  width: 70px;
}

.risk-table-cases th:nth-child(9),
.risk-table-cases td:nth-child(9) {
  width: 85px;
}

.risk-table-cases th:nth-child(10),
.risk-table-cases td:nth-child(10) {
  width: 150px;
}

.risk-table-cases th:nth-child(11),
.risk-table-cases td:nth-child(11) {
  width: 96px;
}

.risk-table-closed th:nth-child(1),
.risk-table-closed td:nth-child(1) {
  width: 130px;
}

.risk-table-closed th:nth-child(2),
.risk-table-closed td:nth-child(2) {
  width: 115px;
}

.risk-table-closed th:nth-child(5),
.risk-table-closed td:nth-child(5) {
  width: 90px;
}

.risk-table-closed th:nth-child(6),
.risk-table-closed td:nth-child(6) {
  width: 135px;
}

.risk-table-closed th:nth-child(7),
.risk-table-closed td:nth-child(7) {
  width: 70px;
}

.risk-queue-actions-inline {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: flex-start;
}

.risk-action-pill {
  min-height: 36px;
  height: 36px;
  min-width: 70px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  line-height: 1;
}

.risk-table tbody tr {
  height: 64px;
}

.risk-table td textarea {
  min-height: 36px;
}

@media (max-width: 1200px) {
  .risk-queue-toolbar--split,
  .risk-bulk-form,
  .risk-search-form {
    flex-wrap: wrap;
  }

  .risk-table {
    table-layout: auto;
  }
}

.case-console {
  display: grid;
  gap: 18px;
}

.case-header {
  position: sticky;
  top: 88px;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  width: 100%;
  box-sizing: border-box;
}

.focus-mode .case-column:first-child .case-card:not(#case-notes) {
  opacity: 0.2;
}
.focus-mode .case-column:first-child #case-notes {
  opacity: 1;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
}

.status-open {
  background: rgba(56, 189, 248, 0.15);
  color: #7dd3fc;
  border-color: rgba(56, 189, 248, 0.4);
}

.status-on-hold {
  background: rgba(251, 191, 36, 0.12);
  color: #facc15;
  border-color: rgba(251, 191, 36, 0.4);
}

.status-escalated {
  background: rgba(244, 63, 94, 0.12);
  color: #fb7185;
  border-color: rgba(244, 63, 94, 0.4);
}

.status-closed {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.4);
}

@media (max-width: 900px) {
  .case-header {
    position: sticky;
    top: 64px;
    padding: 12px;
  }
  .case-header .case-meta-row {
    font-size: 11px;
  }
  .case-header .case-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

.case-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
}

.case-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.case-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.case-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: 16px;
  align-items: start;
}

.case-column {
  display: grid;
  gap: 16px;
}

.case-card {
  background: var(--glass);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 18px;
  display: grid;
  gap: 12px;
  min-width: 0;
}

.case-card table {
  width: 100%;
  table-layout: fixed;
}

.case-card table th,
.case-card table td {
  word-break: break-word;
  overflow-wrap: anywhere;
}

.case-card input[type="file"] {
  width: 100%;
  max-width: 100%;
}

.case-card form.stack {
  width: 100%;
}

.case-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.case-summary {
  display: grid;
  gap: 10px;
}

.case-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.case-summary-label {
  color: var(--muted);
  font-size: 12px;
}

.case-summary-value {
  font-weight: 600;
}

.inline-select-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.inline-select-form > label {
  margin: 0;
}

.inline-select-form > button {
  width: auto;
  white-space: nowrap;
}

.case-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.case-control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.case-control-actions {
  display: flex;
  align-items: end;
}

.case-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.case-timeline {
  display: grid;
  gap: 10px;
}

.case-timeline-item {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(18, 24, 32, 0.75);
  display: grid;
  gap: 6px;
}

.case-timeline-meta {
  font-size: 12px;
  color: var(--muted);
}

.case-timeline-title {
  font-weight: 600;
}

.note-list {
  display: grid;
  gap: 12px;
}

.note-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px 16px;
}

.note-meta {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 8px;
}

.note-body {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  white-space: normal;
}

html[data-theme="light"] .note-card {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
}

.note-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.note-postit {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 16px;
  display: grid;
  gap: 10px;
  box-shadow: 0 14px 30px rgba(8, 10, 16, 0.35);
}

.note-postit-meta {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.note-postit-source a {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.note-postit-source a:hover {
  text-decoration: underline;
}

.note-preview,
.note-full {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
}

.note-readable {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.note-expand summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--muted);
  margin-top: 8px;
}

.note-postit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.note-badge {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(88, 255, 144, 0.1);
  color: #58ff90;
  border: 1px solid rgba(88, 255, 144, 0.3);
}

html[data-theme="light"] .note-postit {
  background: #f5f6fa;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 14px 30px rgba(16, 16, 24, 0.12);
}

html[data-theme="light"] .note-badge {
  background: rgba(24, 124, 70, 0.12);
  color: #1a7f4b;
  border-color: rgba(24, 124, 70, 0.3);
}

.case-details {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  background: rgba(18, 24, 32, 0.55);
  display: grid;
  gap: 12px;
}

.case-details summary {
  cursor: pointer;
  font-weight: 600;
}

.case-pdf {
  width: 100%;
  height: 520px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #0c1017;
}

@media (max-width: 1000px) {
  .risk-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .risk-grid {
    grid-template-columns: 1fr;
  }
  .risk-columns {
    grid-template-columns: 1fr;
  }
  .risk-metrics {
    grid-template-columns: 1fr;
  }
  .risk-map {
    grid-template-columns: 1fr;
  }
  .risk-filter {
    grid-template-columns: 1fr;
  }
  .risk-case-filter {
    grid-template-columns: 1fr;
  }
  .risk-case-filter-btn {
    width: 100%;
    justify-self: stretch;
  }
  .risk-queue-layout {
    grid-template-columns: 1fr;
  }
  .case-header {
    position: static;
  }
  .case-grid {
    grid-template-columns: 1fr;
  }
  .case-control-grid {
    grid-template-columns: 1fr;
  }
  .inline-select-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1200px) {
  .case-grid {
    grid-template-columns: 1fr;
  }
}

.crypto-box {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  border: 1px dashed var(--border);
  background: rgba(18, 24, 32, 0.9);
}

.panel-actions {
  display: grid;
  gap: 24px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.pill {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(208, 106, 46, 0.15);
  border: 1px solid rgba(208, 106, 46, 0.25);
  color: var(--muted);
}

a.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-weight: 600;
  color: var(--accent-2);
  background: rgba(75, 108, 255, 0.12);
}

.card {
  background: var(--glass);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.create-row .card {
  height: 100%;
}

.section-title {
  padding: 0 4px;
}

.invite-list {
  display: grid;
  gap: 12px;
}

.invite-item form {
  margin-top: 10px;
}

.kvk-result-name,
.kvk-result-name a {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #ffffff;
  text-decoration: none;
}

.kvk-result-name a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.kvk-result-address {
  color: #d6deea;
}

html[data-theme="light"] .kvk-result-address {
  color: #324055;
}

.card h2 {
  margin-bottom: 10px;
}

h1, h2 {
  font-family: "Space Grotesk", sans-serif;
  margin-top: 0;
  letter-spacing: 0.2px;
}

.muted {
  color: var(--muted);
  margin-top: 4px;
}

.small {
  font-size: 12px;
}

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

.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 600;
}

/* Utility: keep checkbox/radio controls inline with their label text. */
.checkbox-row,
label.inline {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.checkbox-row input[type="checkbox"],
.checkbox-row input[type="radio"],
label.inline input[type="checkbox"],
label.inline input[type="radio"] {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
}

input, textarea, select {
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: 14px;
  font-family: inherit;
  background: var(--glass);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.store-search {
  margin: 10px 0 16px;
}

button {
  padding: 12px 18px;
  background: var(--accent-2);
  color: #fff;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(19, 24, 32, 0.25);
}

.logout button {
  background: var(--accent);
}

.flash {
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(224, 122, 63, 0.15);
  border: 1px solid rgba(224, 122, 63, 0.3);
  margin-bottom: 16px;
}

.error {
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(163, 33, 33, 0.12);
  border: 1px solid rgba(163, 33, 33, 0.3);
  color: var(--error);
}

.store-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: grid;
  gap: 12px;
}

.store-card {
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.store-title {
  font-weight: 600;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.store-card {
  overflow: hidden;
}

.store-card .muted {
  word-break: break-word;
  overflow-wrap: anywhere;
}

.store-card a {
  word-break: break-word;
  overflow-wrap: anywhere;
}
.counts {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  font-size: 13px;
  margin-top: 4px;
  color: var(--muted);
}

.invite-list {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.invite-item {
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  word-break: break-word;
  overflow-wrap: anywhere;
  min-width: 0;
}

.invite-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.token {
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--glass);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
}

.file-view {
  white-space: pre-wrap;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  font-size: 13px;
  color: var(--text);
}

.report-preview {
  overflow-x: auto;
  width: 100%;
  max-width: 100%;
  min-width: 100%;
  display: block;
}

.report-preview-readable {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  background: rgba(12, 16, 22, 0.9);
}

.report-preview-readable h1,
.report-preview-readable h2,
.report-preview-readable h3 {
  margin: 10px 0 8px;
  line-height: 1.3;
}

.report-preview-readable p {
  margin: 8px 0;
  line-height: 1.6;
}

.report-preview-readable ul,
.report-preview-readable ol {
  margin: 8px 0 12px 20px;
  line-height: 1.6;
}

.report-preview table {
  width: 100% !important;
  border-collapse: collapse;
  margin: 10px 0 18px;
  font-size: 13px;
  table-layout: auto;
  min-width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  display: table;
}

.report-preview th,
.report-preview td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: normal;
}

.report-preview th {
  background: rgba(91, 120, 255, 0.08);
  font-weight: 600;
  white-space: normal;
}

.risk-pill {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.risk-gauge {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin: 6px 0 10px;
}

/* In risk graphic gauge, keep all levels color-coded, and emphasize active one. */
.risk-gauge .risk-pill.risk-low {
  color: #9fe7b7;
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.28);
}

.risk-gauge .risk-pill.risk-moderate,
.risk-gauge .risk-pill.risk-medium {
  color: #f2c28a;
  background: rgba(255, 159, 64, 0.12);
  border: 1px solid rgba(255, 159, 64, 0.28);
}

.risk-gauge .risk-pill.risk-high,
.risk-gauge .risk-pill.risk-critical {
  color: #f3aaaa;
  background: rgba(255, 77, 77, 0.12);
  border: 1px solid rgba(255, 77, 77, 0.28);
}

.risk-gauge .risk-pill:not(.active) {
  opacity: 0.45;
  filter: saturate(0.55);
}

.risk-gauge .risk-pill.active {
  opacity: 1;
  filter: none;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 0 14px rgba(91, 120, 255, 0.15);
}

.risk-gauge .risk-pill.active::before {
  content: "●";
  font-size: 10px;
  margin-right: 6px;
  line-height: 1;
}

.risk-gauge .risk-pill.active.risk-low {
  color: #c7f9c0;
  background: rgba(52, 211, 153, 0.4);
  border: 1px solid rgba(52, 211, 153, 0.75);
}

.risk-gauge .risk-pill.active.risk-moderate,
.risk-gauge .risk-pill.active.risk-medium {
  color: #ffd7a3;
  background: rgba(255, 159, 64, 0.4);
  border: 1px solid rgba(255, 159, 64, 0.75);
}

.risk-gauge .risk-pill.active.risk-high,
.risk-gauge .risk-pill.active.risk-critical {
  color: #ffb1b1;
  background: rgba(255, 77, 77, 0.4);
  border: 1px solid rgba(255, 77, 77, 0.75);
}

.risk-high {
  color: #ffb1b1;
  background: rgba(255, 77, 77, 0.2);
  border: 1px solid rgba(255, 77, 77, 0.45);
}

.risk-moderate {
  color: #ffd7a3;
  background: rgba(255, 159, 64, 0.2);
  border: 1px solid rgba(255, 159, 64, 0.45);
}

.risk-medium {
  color: #ffd7a3;
  background: rgba(255, 159, 64, 0.2);
  border: 1px solid rgba(255, 159, 64, 0.45);
}

.risk-low {
  color: #c7f9c0;
  background: rgba(52, 211, 153, 0.2);
  border: 1px solid rgba(52, 211, 153, 0.45);
}

.risk-critical {
  color: #ffb1b1;
  background: rgba(255, 77, 77, 0.2);
  border: 1px solid rgba(255, 77, 77, 0.45);
}

.needs-review-badge {
  background: rgba(255, 77, 77, 0.2);
  border: 1px solid rgba(255, 77, 77, 0.45);
  color: #ffb1b1;
}

.confidence-line {
  padding: 3px 8px;
  border-radius: 8px;
  margin-bottom: 0;
  font-size: 12px;
  border: 1px solid transparent;
  line-height: 1.2;
}

.confidence-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 6px;
  white-space: normal;
}

.conf-high {
  color: #c7f9c0;
  background: rgba(52, 211, 153, 0.18);
  border-color: rgba(52, 211, 153, 0.4);
}

.conf-mid {
  color: #ffd7a3;
  background: rgba(255, 159, 64, 0.18);
  border-color: rgba(255, 159, 64, 0.4);
}

.conf-low {
  color: #ffb1b1;
  background: rgba(255, 77, 77, 0.18);
  border-color: rgba(255, 77, 77, 0.4);
}

.report-preview th:first-child,
.report-preview td:first-child {
  width: auto;
}

.report-preview th:last-child,
.report-preview td:last-child {
  width: auto;
}

.report-preview table.table-metadata th:nth-child(1),
.report-preview table.table-metadata td:nth-child(1) {
  width: 55%;
}

.report-preview table.table-metadata th:nth-child(2),
.report-preview table.table-metadata td:nth-child(2) {
  width: 45%;
}

.report-preview table.table-metadata {
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
  table-layout: auto;
  display: table;
}

.report-preview table.table-assessment th:nth-child(1),
.report-preview table.table-assessment td:nth-child(1) {
  width: 30%;
}

.report-preview table.table-assessment th:nth-child(2),
.report-preview table.table-assessment td:nth-child(2) {
  width: 12%;
}

.report-preview table.table-assessment th:nth-child(3),
.report-preview table.table-assessment td:nth-child(3) {
  width: 48%;
}

.report-preview table.table-assessment th:nth-child(4),
.report-preview table.table-assessment td:nth-child(4) {
  width: 10%;
}

.report-preview table.table-risks th:nth-child(1),
.report-preview table.table-risks td:nth-child(1) {
  width: 28%;
}

.report-preview table.table-risks th:nth-child(2),
.report-preview table.table-risks td:nth-child(2) {
  width: 30%;
}

.report-preview table.table-risks th:nth-child(3),
.report-preview table.table-risks td:nth-child(3) {
  width: 30%;
}

.report-preview table.table-risks th:nth-child(4),
.report-preview table.table-risks td:nth-child(4) {
  width: 12%;
}

.report-preview table.table-actions th:nth-child(1),
.report-preview table.table-actions td:nth-child(1) {
  width: 28%;
}

.report-preview table.table-actions th:nth-child(2),
.report-preview table.table-actions td:nth-child(2) {
  width: 54%;
}

.report-preview table.table-actions th:nth-child(3),
.report-preview table.table-actions td:nth-child(3) {
  width: 18%;
}

.report-logo {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 16px;
}

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

.debug-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.debug-lines {
  margin-top: 12px;
}

.progress-bar {
  height: 4px;
  width: 100%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  border-radius: 999px;
  margin-top: 8px;
  animation: progressPulse 1.2s ease-in-out infinite;
}

@keyframes progressPulse {
  0% { opacity: 0.4; }
  50% { opacity: 1; }
  100% { opacity: 0.4; }
}

.report-preview-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 18px;
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 220px;
  overflow-y: auto;
  background: var(--glass);
}

.storage-layout {
  display: block;
}

.storage-browser {
  min-height: 620px;
}

.storage-top-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 12px 0 18px;
}

.storage-header {
  align-items: flex-start;
}

.storage-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0 4px;
}

.storage-status-grid .mini-card,
.storage-top-panel .card {
  height: 100%;
}

.storage-top-panel .stack {
  gap: 10px;
}

.storage-primary-action {
  width: 100%;
  justify-content: center;
  min-height: 44px;
}

.storage-secondary-action {
  width: 100%;
  justify-content: center;
  min-height: 40px;
}

.storage-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.storage-sidebar,
.storage-main {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.storage-sidebar {
  display: grid;
  gap: 16px;
}

.storage-search input {
  width: 100%;
  text-align: left;
  box-sizing: border-box;
}

.storage-search {
  width: 100%;
  max-width: 100%;
}

.storage-search .muted.small {
  padding-left: 4px;
}

.storage-tree .file-list {
  max-height: 280px;
}

.storage-main {
  display: grid;
  gap: 12px;
  min-width: 0;
}


.storage-list-header {
  display: grid;
  grid-template-columns: 1fr 110px 90px;
  gap: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

.storage-main.grid-mode .storage-list-header {
  display: none;
}

.storage-items.list-view .file-row.item {
  display: grid;
  grid-template-columns: 1fr 110px 90px;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  cursor: pointer;
}

.storage-items.list-view .file-row.item .file-col.name {
  min-width: 0;
}

.storage-items.list-view .file-row.item .file-col.name .file-name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.storage-items.list-view .file-row.item .file-col.name .file-name span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.storage-items.list-view .file-row.item .file-col.type {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}

.storage-items.list-view .file-row.item .file-col.size {
  white-space: nowrap;
  text-align: right;
}

.storage-items.grid-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.grid-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  background: rgba(12, 17, 24, 0.6);
  display: grid;
  gap: 10px;
  cursor: pointer;
  min-width: 0;
}

.grid-card.selected {
  border-color: rgba(91, 120, 255, 0.6);
  box-shadow: 0 0 0 2px rgba(91, 120, 255, 0.18);
}

.grid-icon {
  font-size: 26px;
  color: var(--accent-2);
}

.grid-name {
  font-weight: 600;
  word-break: break-word;
}

.grid-meta {
  color: var(--muted);
  font-size: 12px;
}


.storage-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0 12px;
}

.storage-toolbar.top-toolbar {
  grid-column: 1 / -1;
  padding: 8px 6px 4px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(0, 2fr);
  align-items: center;
  gap: 10px;
}

.storage-toolbar-actions {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.storage-tool-btn {
  width: 100%;
  justify-content: center;
  text-align: center;
}

.storage-toolbar input {
  min-width: 220px;
}

.storage-column .file-list {
  max-height: 360px;
}

.storage-title {
  font-weight: 600;
  margin-bottom: 8px;
}

.breadcrumb {
  font-weight: 600;
  color: var(--ink);
}

.breadcrumb .crumb {
  cursor: pointer;
}

.breadcrumb .crumb:hover {
  color: var(--accent-2);
}

.mini-card {
  border: 1px dashed var(--border);
  padding: 12px;
}

.link-button {
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.link-button:hover {
  color: var(--accent-2);
}

.muted.small.success {
  color: rgba(120, 230, 170, 0.9);
}

.muted.small.error {
  color: rgba(255, 120, 120, 0.9);
}

.storage-browser .file-list .toggle-item {
  align-items: center;
}

@media (max-width: 1200px) {
  .storage-shell {
    grid-template-columns: 220px 1fr;
  }
  .storage-toolbar.top-toolbar {
    grid-template-columns: 1fr;
  }
  .storage-toolbar-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .storage-shell {
    grid-template-columns: 1fr;
  }
  .storage-sidebar,
  .storage-main,
  .storage-sidepanel {
    padding: 14px;
  }
}

.folder-link {
  cursor: pointer;
  color: var(--ink);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.folder-link:hover {
  color: var(--accent-2);
}

.folder-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.folder-name {
  font-weight: 600;
}

.file-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.file-name {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-table {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--glass);
  overflow: hidden;
}

.file-table .file-row.header {
  background: rgba(15, 23, 42, 0.08);
  font-weight: 600;
  color: var(--muted);
}

html[data-theme="light"] .file-table .file-row.header {
  background: rgba(15, 23, 42, 0.06);
}

.file-body {
  max-height: 360px;
  overflow-y: auto;
  position: relative;
}

.file-row.item {
  display: grid;
  grid-template-columns: 1fr 120px 70px;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  cursor: pointer;
}

.file-row.item.selected {
  background: rgba(91, 120, 255, 0.14);
}

.file-col.name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.file-col.size,
.file-col.actions {
  text-align: right;
  font-size: 12px;
  color: var(--muted);
}


.file-row.header .file-col.size,
.file-row.header .file-col.actions {
  text-align: right;
}

.small-pill {
  padding: 4px 10px;
  font-size: 12px;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  border: none;
  padding: 0;
  margin: 0;
  background: rgba(0, 0, 0, 0.45);
  width: 100%;
  height: 100%;
  z-index: 99999;
}

.modal.open {
  display: flex;
}

.modal-content {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  width: min(420px, 90vw);
  box-shadow: var(--shadow);
}

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

.modal-backdrop {
  position: absolute;
  inset: 0;
}

.modal-panel {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  width: min(960px, 92vw);
  max-height: 90vh;
  overflow: auto;
  box-shadow: var(--shadow);
  z-index: 1;
}

.kyc-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 16px;
}

.row.wrap {
  flex-wrap: wrap;
}

.kyc-topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
}

.kyc-steps,
.kyc-role-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.kyc-steps .muted.small {
  margin-right: 6px;
}

.kyc-segments {
  margin-top: 10px;
  gap: 6px;
}

.kyc-segments .pill {
  font-size: 12px;
}

.kyc-sidebar,
.kyc-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section-summary {
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.section-summary::after {
  content: "▾";
  font-size: 12px;
  color: var(--muted);
}

details[open] > .section-summary::after {
  content: "▴";
}

.kyc-panel details + details {
  margin-top: 12px;
}

.kyc-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--glass);
}

.kyc-toggle input {
  accent-color: var(--accent);
}

.kyc-audit-filters {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.kyc-audit-filters label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.kyc-audit-filters input,
.kyc-audit-filters select {
  min-width: 220px;
}

.applicant-table {
  table-layout: fixed;
}

.applicant-table .col-name {
  width: 55%;
}

.applicant-table .col-status,
.applicant-table .col-updated {
  width: 22.5%;
}

.applicant-table .col-actions {
  width: 12%;
}

.applicant-table .kyc-name {
  word-break: break-all;
}

.kyc-invite-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
  background: var(--glass);
}

.graph-node {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 12px;
  background: var(--glass);
  margin-bottom: 12px;
}

.relationship-graph {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  padding: 8px;
  margin-bottom: 16px;
  overflow: hidden;
  --graph-edge: rgba(226, 232, 240, 0.35);
  --graph-node: rgba(226, 232, 240, 0.7);
  --graph-client: var(--accent-2);
  --graph-applicant: #f59e0b;
  --graph-supplier: #22c55e;
  --graph-person: #a855f7;
  --graph-business: #0ea5e9;
  --graph-label: var(--ink);
}

.relationship-graph svg {
  width: 100%;
  height: 320px;
  display: block;
}

.relationship-graph--full svg {
  height: 720px;
}

.graph-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.graph-modal.is-open {
  display: flex;
}

.graph-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 14, 0.72);
  backdrop-filter: blur(4px);
}

.graph-modal__panel {
  position: relative;
  z-index: 2;
  width: min(1200px, 92vw);
  max-height: 90vh;
  background: rgba(12, 16, 24, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  overflow: auto;
}

.graph-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.graph-modal__title {
  font-weight: 700;
  font-size: 18px;
}

.relationship-edge {
  stroke: var(--graph-edge);
  stroke-width: 1.2;
}

.relationship-node {
  fill: var(--graph-node);
}

.relationship-node--client {
  fill: var(--graph-client);
}

.relationship-label {
  fill: var(--graph-label);
  font-size: 11px;
  text-anchor: middle;
}

html[data-theme="light"] .relationship-graph {
  --graph-edge: rgba(15, 23, 42, 0.22);
  --graph-node: rgba(15, 23, 42, 0.5);
  --graph-client: var(--accent-2);
  --graph-applicant: #d97706;
  --graph-supplier: #16a34a;
  --graph-person: #7c3aed;
  --graph-business: #0284c7;
  --graph-label: var(--ink);
}

html[data-theme="light"] .graph-modal__panel {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.18);
}

.grid {
  display: grid;
  gap: 16px;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 8px 10px;
  vertical-align: top;
  text-align: left;
}

.tpra-layout,
.varqus-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.tpra-nav,
.varqus-nav {
  position: sticky;
  top: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
}

.tpra-nav-title,
.varqus-nav-title {
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 2px 4px 6px;
}

.tpra-nav-link,
.varqus-nav-link {
  display: flex;
  align-items: center;
  text-align: left;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(12, 16, 22, 0.6);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
}

.tpra-nav-link.active,
.varqus-nav-link.active {
  background: linear-gradient(135deg, rgba(42, 114, 194, 0.25), rgba(15, 23, 42, 0.8));
  border-color: rgba(66, 153, 225, 0.5);
  color: #dce9ff;
}

.tpra-layout .grid.three,
.varqus-layout .grid.three {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.tpra-card,
.varqus-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tpra-layout .section-summary,
.varqus-layout .section-summary {
  margin-bottom: 10px;
}

.tpra-layout form.row,
.varqus-layout form.row {
  margin-bottom: 12px;
}

.tpra-metrics,
.varqus-metrics {
  display: flex;
  gap: 18px;
  align-items: center;
}

@media (max-width: 1260px) {
  .tpra-layout .grid.three,
  .varqus-layout .grid.three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .tpra-layout .grid.three,
  .varqus-layout .grid.three {
    grid-template-columns: 1fr;
  }
}

.tpra-metrics strong,
.varqus-metrics strong {
  display: block;
  font-size: 22px;
  color: var(--ink);
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr);
  gap: 20px;
  width: 100%;
}

.overview-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.kyc-case-sections {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.kyc-case-nav {
  position: sticky;
  top: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
}

.kyc-case-nav-title {
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 2px 4px 6px;
}

.kyc-case-nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(12, 16, 22, 0.6);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
}

.kyc-case-nav-link.active {
  background: linear-gradient(135deg, rgba(42, 114, 194, 0.25), rgba(15, 23, 42, 0.8));
  border-color: rgba(66, 153, 225, 0.5);
  color: #dce9ff;
}

.kyc-case-sections-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.kyc-case-sections-body .kyc-panel {
  padding: 16px;
  gap: 14px;
}

.kyc-case-sections-body .kyc-panel > .section-summary {
  margin-bottom: 8px;
}

@media (max-width: 1100px) {
  .overview-grid {
    grid-template-columns: 1fr;
  }
}

.kyc-main {
  width: 100%;
  max-width: 100%;
}

@media (min-width: 1200px) {
  .kyc-layout {
    grid-template-columns: 1fr;
  }
}

.kyc-questionnaire-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-top: 16px;
  background: var(--glass);
}

.kyc-questionnaire {
  padding: 10px 0;
  border-top: 1px dashed var(--border);
}

.kyc-questionnaire:first-child {
  border-top: none;
  padding-top: 0;
}

.kyc-questionnaire-header {
  display: flex;
  gap: 10px;
  align-items: baseline;
  flex-wrap: wrap;
}

.kyc-questionnaire-section {
  margin-top: 10px;
}

.kyc-questionnaire-section-title {
  font-weight: 600;
  margin-bottom: 6px;
}

.kyc-questionnaire-list {
  display: grid;
  gap: 6px;
}

.kyc-questionnaire-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 2fr;
  gap: 12px;
}

.kyc-questionnaire-label {
  font-size: 12px;
  color: var(--muted);
  word-break: break-word;
}

.kyc-questionnaire-value {
  font-size: 13px;
  color: var(--ink);
  word-break: break-word;
}

.kyc-row.selected {
  background: rgba(91, 120, 255, 0.12);
}

.kyc-pdf-details summary {
  cursor: pointer;
  font-weight: 600;
}

.kyc-pdf-frame {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel);
  height: 720px;
  position: relative;
}

.kyc-pdf-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}


.kyc-case {
  cursor: pointer;
}

.kyc-case.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(91, 120, 255, 0.25);
}

.kyc-detail .code-block {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  max-height: 320px;
  overflow: auto;
}

.kyc-case .kyc-case-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.kyc-case .kyc-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

.case-title {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.case-title.expired {
  color: #f87171;
}

.invite-item .case-title {
  color: var(--ink);
  text-decoration: none;
}

.invite-item:hover .case-title {
  color: var(--accent-2);
}

.invite-item.active .case-title {
  color: var(--accent);
}

html[data-theme="light"] .invite-item .case-title {
  color: #0f172a;
}

html[data-theme="light"] .invite-item:hover .case-title {
  color: #3b5bff;
}

html[data-theme="light"] .invite-item.active .case-title {
  color: #d84e63;
}

html[data-theme="light"] .case-title.expired {
  color: #dc2626;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.operator-status-pill {
  font-weight: 700;
}

.operator-status-text {
  font-weight: 700;
  letter-spacing: 0.04em;
}

.operator-status-text.operator-approved,
.operator-status-text.operator-not_approved,
.operator-status-text.operator-id_expiring,
.operator-status-text.operator-under_investigation,
.operator-status-text.status-pending {
  background: none;
  border: 0;
  padding: 0;
}

.operator-status-text.operator-approved {
  color: #4ade80;
}

.operator-status-text.operator-not_approved {
  color: #f87171;
}

.operator-status-text.operator-under_investigation {
  color: #f59e0b;
}

.operator-status-text.operator-id_expiring {
  color: #f59e0b;
}

.operator-status-text.status-pending {
  color: #facc15;
}

.operator-approved {
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.45);
  background: rgba(16, 185, 129, 0.18);
}

.operator-not_approved {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(239, 68, 68, 0.18);
}

.operator-under_investigation {
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.2);
}

.operator-id_expiring {
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.2);
}

.status-ok {
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.45);
  background: rgba(16, 185, 129, 0.12);
}

.status-bad {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(239, 68, 68, 0.12);
}

.status-warn {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(245, 158, 11, 0.12);
}

.sumsub-status-text.status-ok,
.sumsub-status-text.status-bad,
.sumsub-status-text.status-warn {
  background: none;
  border: 0;
  padding: 0;
}

.status-pending {
  color: #facc15;
  border-color: rgba(250, 204, 21, 0.45);
  background: rgba(234, 179, 8, 0.18);
  font-weight: 700;
}

.pill.danger {
  border-color: rgba(248, 113, 113, 0.5);
  color: #fca5a5;
  background: rgba(248, 113, 113, 0.1);
}

.pill.danger:hover {
  border-color: rgba(248, 113, 113, 0.8);
  color: #fee2e2;
}

.clients-table .action-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.muted.tiny {
  font-size: 11px;
  color: var(--muted);
}

.kyc-hub .grid.two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.kyc-hub .grid.two .span-2 {
  grid-column: 1 / -1;
}

.operator-status-form {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  background: var(--glass);
}

.kyc-form-grid {
  display: grid;
  gap: 12px;
}

.kyc-form-grid .grid.two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.kyc-form-grid label {
  display: grid;
  gap: 6px;
}

.kyc-form-grid input,
.kyc-form-grid select,
.kyc-form-grid textarea {
  width: 100%;
  min-height: 46px;
  box-sizing: border-box;
}

.kyc-form-grid textarea {
  min-height: 110px;
}

.kyc-form-grid button,
.kyc-form-grid .pill {
  width: 100%;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.kyc-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.kyc-action-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  background: var(--glass);
}

.kyc-hub .event-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--glass);
}

.kyc-hub .event-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.kyc-hub .kyc-case-list form input[type="text"] {
  min-width: 220px;
}

.info-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  margin-left: 6px;
  cursor: help;
  line-height: 1;
  position: relative;
}

.info-ico::before,
.info-ico::after {
  opacity: 0;
  pointer-events: none;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  transition: opacity 0.15s ease;
  z-index: 10;
}

.info-ico::before {
  content: "";
  bottom: 26px;
  border: 6px solid transparent;
  border-top-color: var(--panel);
}

.info-ico::after {
  content: attr(data-tooltip);
  bottom: 34px;
  min-width: 220px;
  max-width: 320px;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.4;
  box-shadow: var(--shadow);
  white-space: normal;
}

.info-ico:hover::before,
.info-ico:hover::after,
.info-ico:focus::before,
.info-ico:focus::after {
  opacity: 1;
}

.role-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.role-header h3 {
  margin: 0;
}

.role-header .muted.small {
  max-width: 520px;
}

.kyc-data {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--glass);
}

.kyc-data + .kyc-data {
  margin-top: 10px;
}

.kyc-data summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
}

@media (max-width: 1100px) {
  .kyc-layout {
    grid-template-columns: 1fr;
  }
  .kyc-hub .grid.two {
    grid-template-columns: 1fr;
  }
  .kyc-form-grid .grid.two,
  .kyc-action-grid {
    grid-template-columns: 1fr;
  }
}

.selection-box {
  position: absolute;
  border: 1px dashed var(--accent-2);
  background: rgba(91, 120, 255, 0.12);
  pointer-events: none;
  z-index: 5;
}

.file-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

.folder-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

.file-icon-default { color: var(--muted); }
.file-icon-image { color: #f28aa6; }
.file-icon-pdf { color: #e4537a; }
.file-icon-doc { color: #5b78ff; }
.file-icon-xls { color: #3cb371; }
.file-icon-ppt { color: #f4a261; }
.file-icon-zip { color: #a855f7; }
.file-icon-txt { color: #94a3b8; }
.file-icon-data { color: #38bdf8; }

.dropzone {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--glass);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  min-height: 180px;
}

.dropzone.active {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 2px rgba(91, 120, 255, 0.15);
}

.dropzone input[type="file"] {
  margin-top: 10px;
}

.dropzone-inner {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  z-index: 1;
  padding: 18px;
  height: 100%;
  justify-content: center;
}

.drop-title {
  font-weight: 600;
}

.dropzone-mask {
  position: absolute;
  inset: 0;
  background: rgba(91, 120, 255, 0.08);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  pointer-events: none;
}

.preview-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.filename-preview-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.filename-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.filename-preview .mono {
  font-family: "SFMono-Regular", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  background: rgba(12, 16, 22, 0.9);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--text);
  word-break: break-word;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: rgba(12, 16, 22, 0.95);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 50;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.user-menu {
  position: relative;
}

.user-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(12, 16, 22, 0.8);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--text);
  font-size: 13px;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.user-avatar.large {
  width: 56px;
  height: 56px;
}

.user-name {
  color: var(--text);
  font-weight: 600;
}

html[data-theme="light"] .user-trigger {
  background: #f8fafc;
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .user-name {
  color: #0f172a;
}

.user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 220px;
  background: rgba(12, 16, 22, 0.98);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  display: none;
  z-index: 20;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.user-dropdown.show {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.user-title {
  font-weight: 700;
  color: var(--text);
}

.user-profile-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  text-align: center;
  padding: 12px 0;
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  max-width: 100%;
  min-width: 0;
}

.settings-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--border);
}

.settings-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-topbar-title small {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.25;
}

.settings-topbar-title h2 {
  margin: 0;
  font-size: 26px;
  letter-spacing: 0.008em;
  line-height: 1.12;
}

.settings-topbar-tools {
  min-width: 280px;
  flex: 1 1 280px;
}

.settings-search {
  width: 100%;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  padding: 8px 0;
}

.permission-item {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--text);
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(12, 16, 22, 0.6);
}

.permission-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
}

.permission-item span {
  display: inline-block;
  line-height: 1.25;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

@media (max-width: 720px) {
  .action-grid {
    grid-template-columns: 1fr;
  }
}

.action-grid-wrapper {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.action-grid-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.action-grid-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.action-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(91, 120, 255, 0.35);
  background: rgba(12, 16, 22, 0.7);
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

html[data-theme="light"] .action-card {
  background: #ffffff;
  border-color: rgba(228, 83, 122, 0.25);
}

.action-card:hover {
  transform: translateY(-2px);
  border-color: rgba(228, 83, 122, 0.7);
  box-shadow: 0 14px 28px rgba(5, 8, 12, 0.35);
}

.action-card.dragging {
  opacity: 0.6;
  cursor: grabbing;
}

.action-card:active {
  cursor: grabbing;
}

.dashboard-customize {
  display: none;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.dashboard-customize.show {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.customize-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.customize-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toggle-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text);
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(12, 16, 22, 0.6);
}

.action-title {
  font-weight: 700;
  font-size: 15px;
}

.hero-tagline {
  margin: 0;
  font-size: 17px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 820px;
}

.module-hub-page {
  animation: moduleHubIn 260ms ease-out;
}

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

.module-hub-shell {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.module-hub-title {
  padding-bottom: 4px;
}

.module-grid-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background:
    linear-gradient(180deg, rgba(12, 16, 22, 0.74), rgba(12, 16, 22, 0.5)),
    radial-gradient(circle at 0% 0%, rgba(91, 120, 255, 0.18), transparent 45%);
}

.module-grid-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.module-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(9, 12, 18, 0.7);
  color: var(--ink);
  text-decoration: none;
  min-height: 136px;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.module-card:hover {
  transform: translateY(-2px);
  border-color: rgba(91, 120, 255, 0.65);
  box-shadow: 0 14px 26px rgba(5, 8, 12, 0.35);
}

.module-card.is-enabled {
  border-color: rgba(43, 214, 162, 0.36);
}

.module-card.is-disabled {
  opacity: 0.86;
}

.module-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.module-card-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}

.module-card-id {
  font-family: "Space Grotesk", sans-serif;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.03em;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.module-card-desc {
  flex: 1;
}

.module-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.module-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  border: 1px solid var(--border);
}

.module-pill.ok {
  color: #44d3a6;
  border-color: rgba(68, 211, 166, 0.4);
  background: rgba(68, 211, 166, 0.12);
}

.module-pill.warn {
  color: #f4b054;
  border-color: rgba(244, 176, 84, 0.42);
  background: rgba(244, 176, 84, 0.12);
}

.module-pill.critical {
  color: #ff8a8a;
  border-color: rgba(255, 138, 138, 0.45);
  background: rgba(255, 138, 138, 0.14);
}

.module-pill.off {
  color: #9aa4b2;
  border-color: rgba(154, 164, 178, 0.36);
  background: rgba(154, 164, 178, 0.12);
}

.module-two-col {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(360px, 1.25fr);
  gap: 16px;
}

.module-storage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.module-storage-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(12, 16, 22, 0.62);
}

.module-storage-item.is-enabled {
  border-color: rgba(43, 214, 162, 0.36);
}

.module-storage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.module-storage-title {
  font-weight: 700;
}

.module-storage-summary {
  font-size: 13px;
  line-height: 1.4;
  color: #d8e1f0;
  margin-top: -1px;
}

.module-storage-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}

.settings-nav {
  position: sticky;
  top: 18px;
  align-self: start;
}

.settings-nav-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-tabs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.settings-tab-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.settings-tab-group-title {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding-left: 2px;
  line-height: 1.2;
}

.settings-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(12, 16, 22, 0.6);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
}

.settings-tab.active {
  background: linear-gradient(135deg, rgba(42, 114, 194, 0.25), rgba(15, 23, 42, 0.8));
  border-color: rgba(66, 153, 225, 0.5);
  color: #dce9ff;
}

.settings-tab-icon {
  width: 19px;
  height: 19px;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(20, 30, 48, 0.72);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #c7d7ff;
  flex: 0 0 auto;
}

.settings-tab.active .settings-tab-icon {
  border-color: rgba(82, 194, 255, 0.55);
  box-shadow: 0 0 0 2px rgba(82, 194, 255, 0.12);
}

.settings-tab-icon-access,
.settings-tab-icon-security,
.settings-tab-icon-users,
.settings-tab-icon-roles,
.settings-tab-icon-permissions {
  background: linear-gradient(160deg, rgba(13, 67, 107, 0.9), rgba(20, 30, 48, 0.75));
}

.settings-tab-icon-openai,
.settings-tab-icon-agents,
.settings-tab-icon-assistants,
.settings-tab-icon-messaging,
.settings-tab-icon-data,
.settings-tab-icon-activity {
  background: linear-gradient(160deg, rgba(14, 104, 78, 0.9), rgba(20, 30, 48, 0.75));
}

.settings-tab-icon-nextcloud,
.settings-tab-icon-vies,
.settings-tab-icon-invoice,
.settings-tab-icon-odoo,
.settings-tab-icon-sumsub,
.settings-tab-icon-osint,
.settings-tab-icon-risk {
  background: linear-gradient(160deg, rgba(106, 54, 18, 0.9), rgba(20, 30, 48, 0.75));
}

.settings-tab-icon-modules,
.settings-tab-icon-system,
.settings-tab-icon-audit {
  background: linear-gradient(160deg, rgba(92, 47, 92, 0.9), rgba(20, 30, 48, 0.75));
}

.settings-section {
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.settings-section.active {
  display: grid;
}

.settings-section-strip {
  grid-column: 1 / -1;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(110, 128, 156, 0.25);
  background: linear-gradient(180deg, rgba(120, 134, 161, 0.22), rgba(80, 94, 120, 0.12));
  color: #d7dfef;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  line-height: 1.25;
}

.settings-content .card {
  border-radius: 8px;
  border: 1px solid rgba(122, 139, 166, 0.24);
  background: linear-gradient(180deg, rgba(39, 47, 70, 0.36), rgba(27, 35, 54, 0.18));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  padding: 14px;
  min-height: 176px;
  min-width: 0;
  overflow: hidden;
}

.settings-content .card h3 {
  margin-bottom: 8px;
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(122, 139, 166, 0.2);
  font-size: 17px;
  line-height: 1.24;
}

.settings-content .muted.small {
  font-size: 11px;
  line-height: 1.45;
}

.settings-content .stack {
  gap: 10px;
}

.settings-content label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.3;
  min-width: 0;
}

.settings-content input,
.settings-content textarea,
.settings-content select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.35;
}

.settings-content textarea {
  min-height: 96px;
  line-height: 1.45;
}

.settings-content button {
  min-height: 36px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  border-radius: 8px;
  letter-spacing: 0;
}

.settings-content .stack > button {
  width: 100%;
}

.settings-content .split {
  gap: 10px;
  min-width: 0;
}

.settings-content .settings-action-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 14px;
  margin-top: 14px;
}

.settings-content .settings-action-row form {
  margin: 0;
  width: 100%;
}

.settings-content .settings-action-row button {
  width: 100%;
  min-width: 0;
}

.settings-content .settings-action-row.settings-action-row--triple {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.settings-content .btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #4f6dde, #4a63cf);
  border: 1px solid rgba(128, 158, 255, 0.35);
  color: #f7faff;
  box-shadow: 0 8px 18px rgba(19, 36, 88, 0.28);
}

.settings-content .btn-primary:hover {
  background: linear-gradient(135deg, #5676e6, #4f69d7);
}

.settings-content .btn-secondary {
  background: rgba(17, 24, 39, 0.55);
  color: var(--text);
  border: 1px solid rgba(128, 144, 170, 0.35);
  box-shadow: none;
}

.settings-content .btn-secondary:hover {
  border-color: rgba(156, 178, 212, 0.55);
  background: rgba(22, 31, 49, 0.72);
  box-shadow: 0 4px 10px rgba(7, 12, 22, 0.22);
}

.settings-content a.btn-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 36px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  border-radius: 8px;
  text-decoration: none;
}

.settings-section[data-section="openai"] .stack {
  gap: 14px;
}

.settings-content .checkbox-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.settings-content .checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
}

.settings-content .invite-item {
  border-radius: 8px;
  padding: 10px;
}

.settings-content .invite-row {
  gap: 10px;
}

.settings-content .store-title {
  font-size: 14px;
}

.settings-section[data-section="audit"] .card,
.settings-section[data-section="permissions"] .card,
.settings-section[data-section="users"] .card,
.settings-section[data-section="agents"] .card,
.settings-section[data-section="assistants"] .card,
.settings-section[data-section="system"] .card,
.settings-section[data-section="modules"] .card {
  grid-column: 1 / -1;
}

.settings-section[data-section="modules"] .module-storage-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.settings-section[data-section="modules"] .module-storage-item {
  min-height: 100%;
}

.settings-section[data-section="modules"] .module-storage-item .split {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-section[data-section="modules"] .module-storage-item .split button {
  width: 100%;
}

.settings-section[data-section="modules"] .module-storage-meta {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 10px;
}

.settings-section[data-section="modules"] .module-storage-meta form {
  justify-self: end;
}

.settings-section[data-section="modules"] .module-storage-meta form button {
  min-width: 120px;
}

@media (max-width: 1180px) {
  .settings-layout {
    grid-template-columns: 1fr;
  }

  .settings-nav {
    position: static;
  }
}

@media (max-width: 1180px) {
  .settings-section {
    grid-template-columns: 1fr;
  }
}

.dashboard-launcher-body .sidebar {
  display: none;
}

.dashboard-launcher-body .site-header {
  background: transparent;
  border-bottom: none;
  padding: 16px 24px 8px;
}

.dashboard-launcher-body .content {
  padding-top: 0;
}

.module-launcher-page {
  min-height: calc(100vh - 96px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 26px 26px 38px;
}

.module-launcher-shell {
  width: min(1240px, 100%);
}

.module-launcher-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(120px, 1fr));
  gap: 22px 24px;
}

.module-launcher-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 11px;
  padding: 10px 6px;
  text-decoration: none;
  color: var(--text);
}

.module-launcher-icon {
  width: 76px;
  height: 76px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(14, 19, 29, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 10px 24px rgba(5, 8, 12, 0.22);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.module-launcher-label {
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
  max-width: 150px;
}

.module-launcher-item:hover .module-launcher-icon {
  transform: translateY(-2px);
  border-color: rgba(228, 83, 122, 0.62);
  background: rgba(19, 26, 39, 0.78);
}

.module-launcher-item.is-disabled {
  opacity: 0.56;
}

.report-preview-body {
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  background: rgba(12, 16, 22, 0.9);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  min-height: 200px;
  max-height: 420px;
  overflow: auto;
}

.report-doc {
  white-space: normal;
  font-size: 13px;
  line-height: 1.55;
}

.report-doc-section {
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 16px 0 8px;
  color: #dce8ff;
}

.report-doc-section:first-child {
  margin-top: 0;
}

.report-doc-row {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  gap: 10px;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
}

.report-doc-label {
  color: var(--muted);
  font-weight: 600;
}

.report-doc-value {
  color: var(--text);
}

.report-doc-para {
  margin: 6px 0;
}

.copy-btn {
  background: linear-gradient(135deg, var(--accent-2), #2c8e87);
  padding: 8px 12px;
  font-size: 13px;
}

.danger-btn {
  background: linear-gradient(135deg, #a32121, #c63c3c);
  padding: 8px 12px;
  font-size: 13px;
}

.action-grid-actions .pill:nth-child(1) {
  background: linear-gradient(135deg, rgba(91, 120, 255, 0.45), rgba(91, 120, 255, 0.15));
  border-color: rgba(91, 120, 255, 0.6);
}

.action-grid-actions .pill:nth-child(2) {
  background: linear-gradient(135deg, rgba(228, 83, 122, 0.45), rgba(228, 83, 122, 0.15));
  border-color: rgba(228, 83, 122, 0.6);
}

.action-grid-actions .pill:nth-child(3) {
  background: linear-gradient(135deg, rgba(244, 136, 72, 0.45), rgba(244, 136, 72, 0.15));
  border-color: rgba(244, 136, 72, 0.6);
}

.invite-row .pill:nth-child(1) {
  background: linear-gradient(135deg, rgba(91, 120, 255, 0.4), rgba(91, 120, 255, 0.15));
  border-color: rgba(91, 120, 255, 0.5);
}

.invite-row .pill:nth-child(2) {
  background: linear-gradient(135deg, rgba(228, 83, 122, 0.4), rgba(228, 83, 122, 0.15));
  border-color: rgba(228, 83, 122, 0.5);
}

.invite-row .pill:nth-child(3) {
  background: linear-gradient(135deg, rgba(244, 136, 72, 0.4), rgba(244, 136, 72, 0.15));
  border-color: rgba(244, 136, 72, 0.5);
}

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

.chat-response {
  white-space: pre-wrap;
  line-height: 1.6;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  min-height: 120px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.chatkit-embed {
  display: block;
  width: 100%;
  min-height: 520px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.85);
  overflow: hidden;
}

.chat-card {
  display: grid;
  gap: 16px;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.chat-select label {
  font-weight: 600;
}

.chat-window {
  min-height: 360px;
  max-height: 520px;
  overflow-y: auto;
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(14, 18, 26, 0.85);
}

.chat-row {
  display: flex;
}

.chat-row.user {
  justify-content: flex-end;
}

.chat-row.assistant {
  justify-content: flex-start;
}

.chat-bubble {
  max-width: 70%;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(18, 24, 32, 0.95);
}

.chat-bubble.user {
  border-color: rgba(224, 122, 63, 0.35);
  background: rgba(224, 122, 63, 0.16);
}

.chat-bubble.assistant {
  border-color: rgba(61, 182, 165, 0.35);
  background: rgba(61, 182, 165, 0.12);
}

.chat-text {
  white-space: pre-wrap;
  line-height: 1.6;
}

.chat-row.streaming {
  display: none;
}

.chat-row.streaming.active {
  display: flex;
}

.typing {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: typing 1.2s infinite ease-in-out;
}

.typing span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing span:nth-child(3) {
  animation-delay: 0.4s;
}

.typing.hidden {
  display: none;
}

.hidden {
  display: none !important;
}

.report-output {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--mono, "SFMono-Regular", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);
  font-size: 0.95rem;
  line-height: 1.5;
}

@keyframes typing {
  0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
  40% { transform: scale(1.2); opacity: 1; }
}

.chat-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.chat-input textarea {
  resize: vertical;
  min-height: 72px;
  width: 100%;
}

.chat-card {
  width: 100%;
}

.chat-status {
  display: none;
  font-size: 12px;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  width: fit-content;
  background: rgba(18, 24, 32, 0.85);
  position: sticky;
  top: 0;
  z-index: 2;
  backdrop-filter: blur(6px);
}

.chat-status.active {
  display: inline-flex;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.section-title small {
  color: var(--muted);
  font-size: 12px;
}

.kpi-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.kpi {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(18, 24, 32, 0.9);
}

.kpi span {
  font-size: 12px;
  color: var(--muted);
}

.kpi strong {
  display: block;
  font-size: 16px;
  margin-top: 4px;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.analytics-hero {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  align-items: stretch;
}

.analytics-hero__chart {
  display: grid;
  gap: 12px;
}

.analytics-hero__stats {
  display: grid;
  gap: 12px;
}

@media (max-width: 900px) {
  .analytics-hero {
    grid-template-columns: 1fr;
  }
}

.chat-debug {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  word-break: break-word;
  overflow-wrap: anywhere;
}

.chat-debug pre {
  background: rgba(255, 255, 255, 0.8);
  border: 1px dashed var(--border);
  padding: 10px;
  border-radius: 12px;
  max-height: 200px;
  overflow: auto;
}

.json-preview {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  background: rgba(14, 18, 26, 0.85);
  border: 1px dashed var(--border);
  padding: 10px;
  border-radius: 12px;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-toggle {
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(12, 16, 22, 0.7);
  color: var(--ink);
  padding: 6px 10px;
  font-size: 14px;
}

html[data-theme="light"] .theme-toggle {
  background: #ffffff;
}

.client-company-section {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display: none;
  gap: 12px;
}

.client-company-section.active {
  display: grid;
}

.clients-layout.single {
  grid-template-columns: 1fr;
}

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

.clients-layout th:not(:first-child),
.clients-layout td:not(:first-child) {
  white-space: nowrap;
}

.clients-layout td:first-child,
.clients-layout th:first-child {
  width: 100%;
}

.clients-table {
  table-layout: auto;
}

.clients-table th,
.clients-table td {
  text-align: left;
  padding: 12px 16px;
  vertical-align: middle;
}

.clients-table th {
  font-weight: 600;
}

.clients-table td:first-child,
.clients-table th:first-child {
  white-space: normal;
  word-break: break-word;
  min-width: 260px;
}

.clients-table th:last-child,
.clients-table td:last-child {
  text-align: right;
  white-space: nowrap;
  width: 120px;
}

.clients-table td:nth-child(5),
.clients-table th:nth-child(5) {
  white-space: nowrap;
}

.clients-table .pill {
  display: inline-flex;
  align-items: center;
}

.client-link {
  color: inherit;
  text-decoration: none;
}

.client-link:hover {
  text-decoration: underline;
}

.clients-hub .panel-header {
  align-items: center;
}

.clients-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.metric-card {
  padding: 14px 16px;
}

.metric-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.metric-value {
  margin-top: 6px;
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
}

.metric-value-sm {
  font-size: 16px;
  line-height: 1.35;
  word-break: break-word;
}

.client-risk-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  border-radius: 999px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.client-risk-pill--low {
  background: rgba(24, 163, 110, 0.16);
  border-color: rgba(24, 163, 110, 0.5);
  color: #43d39f;
}

.client-risk-pill--moderate,
.client-risk-pill--medium {
  background: rgba(240, 173, 78, 0.14);
  border-color: rgba(240, 173, 78, 0.46);
  color: #ffcf7a;
}

.client-risk-pill--high {
  background: rgba(255, 122, 89, 0.16);
  border-color: rgba(255, 122, 89, 0.48);
  color: #ff9975;
}

.client-risk-pill--critical {
  background: rgba(226, 73, 99, 0.2);
  border-color: rgba(226, 73, 99, 0.58);
  color: #ff8fa5;
}

.client-dossier-summary {
  display: grid;
  gap: 14px;
}

.client-risk-market {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(107, 141, 255, 0.26);
  background:
    linear-gradient(112deg, rgba(20, 41, 90, 0.36), rgba(65, 26, 60, 0.26)),
    radial-gradient(circle at 15% 8%, rgba(100, 150, 255, 0.18), transparent 44%),
    radial-gradient(circle at 85% 0%, rgba(245, 111, 128, 0.13), transparent 40%),
    color-mix(in srgb, var(--bg-soft) 72%, black 28%);
}

.client-risk-market-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.client-risk-market-top h3 {
  margin: 0;
}

.client-risk-market-grid {
  display: grid;
  grid-template-columns: 1.25fr repeat(2, minmax(0, 0.78fr)) repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.market-main,
.market-ticker,
.market-kpi {
  border: 1px solid rgba(144, 171, 231, 0.24);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(8, 16, 34, 0.62);
}

.market-label {
  font-size: 11px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: #8fa3cd;
  font-weight: 700;
}

.market-risk-line {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.market-risk-text {
  font-size: 30px;
  line-height: 1.1;
  font-weight: 800;
  color: #f3f7ff;
}

.market-score {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 28px;
  font-weight: 800;
  color: #f3f7ff;
}

.market-dir {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  border: 1px solid var(--border);
}

.market-dir--up {
  color: #ff8e8e;
  border-color: rgba(255, 133, 133, 0.52);
  background: rgba(255, 98, 98, 0.17);
}

.market-dir--down {
  color: #6be6a8;
  border-color: rgba(90, 222, 162, 0.48);
  background: rgba(56, 179, 127, 0.18);
}

.market-dir--stable {
  color: #8fb2ff;
  border-color: rgba(122, 156, 241, 0.45);
  background: rgba(75, 111, 200, 0.2);
}

.market-kpi .metric-value {
  margin-top: 4px;
  margin-bottom: 2px;
}

.market-bar {
  margin-top: 10px;
  height: 7px;
  border-radius: 999px;
  border: 1px solid rgba(137, 162, 225, 0.26);
  background: rgba(8, 16, 30, 0.75);
  overflow: hidden;
}

.market-bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6b9cff, #ff6f91);
}

.market-ribbon {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.client-risk-cockpit {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(120, 154, 247, 0.36);
  background:
    linear-gradient(120deg, rgba(12, 31, 75, 0.56), rgba(67, 20, 49, 0.46)),
    radial-gradient(circle at 10% 0%, rgba(104, 153, 255, 0.2), transparent 42%),
    radial-gradient(circle at 88% -5%, rgba(255, 121, 141, 0.18), transparent 38%),
    color-mix(in srgb, var(--bg-soft) 74%, black 26%);
}

.client-risk-cockpit-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.client-risk-cockpit-head h3 {
  margin: 0;
}

.risk-tape .token {
  border-color: rgba(141, 173, 243, 0.36);
  background: rgba(13, 24, 46, 0.62);
}

.client-risk-cockpit-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(260px, 0.85fr) minmax(360px, 1.15fr) minmax(280px, 0.9fr);
  gap: 12px;
}

.client-risk-cbs-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}

.cockpit-gauge,
.cockpit-valuation,
.cockpit-trends,
.cockpit-heatstack,
.cockpit-cbs {
  border: 1px solid rgba(143, 173, 236, 0.3);
  border-radius: 12px;
  background: rgba(7, 16, 33, 0.66);
  padding: 12px;
}

.gauge-wrap {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.gauge-wrap--single {
  grid-template-columns: 1fr;
  justify-items: center;
}

.risk-gauge {
  --pct: 38%;
  width: 100%;
  max-width: 160px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  margin: 0 auto;
  padding: 10px;
  background:
    radial-gradient(circle at center, rgba(8, 18, 39, 0.96) 58%, transparent 59%),
    conic-gradient(from -90deg, #4dd6a7 0 30%, #f5cf78 30% 62%, #ff8d74 62% 82%, #ff6f95 82% 100%);
  position: relative;
  display: grid;
  place-items: center;
}

.risk-gauge::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(8, 18, 39, 1) 66%, rgba(8, 18, 39, 0.95) 100%),
    conic-gradient(from -90deg, rgba(122, 150, 217, 0.25) 0 var(--pct), rgba(72, 90, 130, 0.1) var(--pct) 100%);
}

.risk-gauge--subtle {
  background:
    radial-gradient(circle at center, rgba(8, 18, 39, 0.96) 58%, transparent 59%),
    conic-gradient(from -90deg, #63c8ff 0 100%);
}

.risk-gauge--subtle::after {
  background:
    radial-gradient(circle at center, rgba(8, 18, 39, 1) 66%, rgba(8, 18, 39, 0.95) 100%),
    conic-gradient(from -90deg, rgba(99, 200, 255, 0.38) 0 var(--pct), rgba(72, 90, 130, 0.1) var(--pct) 100%);
}

.risk-gauge-inner {
  position: relative;
  z-index: 2;
  width: 78%;
  height: 78%;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 3px;
  padding: 4px;
  box-sizing: border-box;
}

.gauge-kicker {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #97abd7;
  font-weight: 700;
  line-height: 1;
}

.gauge-score {
  font-size: 44px;
  line-height: 0.95;
  font-weight: 800;
  color: #eff5ff;
  white-space: nowrap;
}

.gauge-label {
  font-size: 10px;
  color: #c8d5ef;
  font-weight: 700;
  line-height: 1.08;
  max-width: 90px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.gauge-direction {
  margin-top: 8px;
  display: flex;
  justify-content: center;
}

.cockpit-valuation {
  display: grid;
  align-content: start;
  gap: 10px;
}

.cockpit-valuation--varqus {
  align-content: center;
}

.valuation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.valuation-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #9eb2dc;
  font-weight: 700;
}

.valuation-text {
  border: 1px solid rgba(128, 157, 226, 0.22);
  border-radius: 10px;
  background: rgba(9, 18, 36, 0.72);
  padding: 10px;
  color: #d8e4ff;
  font-size: 13px;
  line-height: 1.35;
}

.valuation-bullets {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  color: #aebddb;
  font-size: 12px;
}

.company-vote {
  margin-top: 10px;
  border: 1px solid rgba(143, 173, 236, 0.32);
  border-radius: 12px;
  background: rgba(9, 18, 36, 0.78);
  padding: 10px 12px;
}

.company-vote-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.company-vote-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #9eb2dc;
  font-weight: 700;
}

.company-vote-grade {
  border: 1px solid rgba(130, 169, 255, 0.5);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 800;
  color: #b9cdff;
  background: rgba(26, 50, 96, 0.36);
}

.company-vote--varqus .company-vote-head--varqus {
  justify-content: flex-start;
  align-items: baseline;
  gap: 12px;
}

.company-vote-grade--hero {
  font-size: 28px;
  line-height: 1;
  padding: 6px 14px;
}

.company-vote-score {
  margin-top: 6px;
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
  color: #eef5ff;
}

.company-vote-note {
  margin-top: 3px;
  font-size: 12px;
  color: #a8b7d7;
}

.cockpit-trends {
  display: grid;
  gap: 10px;
}

.trend-row {
  display: grid;
  gap: 6px;
}

.trend-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.trend-inline-value {
  font-weight: 700;
  color: #e9f0ff;
}

.trend-chart {
  margin: 0;
  height: 82px;
  padding: 6px;
  background: rgba(9, 18, 36, 0.8);
}

.cbs-timeline-chart {
  height: 220px;
  padding: 4px;
  background: rgba(9, 18, 36, 0.8);
}

.cockpit-heatstack {
  display: grid;
  gap: 9px;
}

.cockpit-cbs {
  display: grid;
  gap: 8px;
}

.cbs-main-score {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(128, 157, 226, 0.22);
  border-radius: 10px;
  background: rgba(9, 18, 36, 0.72);
  padding: 10px;
}

.cbs-score {
  font-size: 32px;
  line-height: 1;
  font-weight: 800;
  color: #eef5ff;
  min-width: 64px;
}

.cbs-band {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: #9eb2dc;
}

.heat-row {
  display: grid;
  gap: 6px;
}

.heat-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #b8c7e8;
  font-size: 12px;
}

.heat-meta strong {
  color: #eef4ff;
  font-size: 14px;
}

.risk-ribbon .token {
  border-color: rgba(143, 173, 236, 0.34);
  background: rgba(12, 22, 44, 0.58);
}

.client-dossier-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.client-dossier-headline h3 {
  margin: 0;
}

.client-dossier-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stack-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.stack-list li {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: color-mix(in srgb, var(--bg-soft) 76%, black 24%);
}

.client-overview {
  display: grid;
  gap: 16px;
}

.client-overview-posture {
  display: grid;
  gap: 10px;
}

.posture-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.posture-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: color-mix(in srgb, var(--bg-soft) 70%, black 30%);
}

.client-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.client-overview-left,
.client-overview-right {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.overview-list {
  display: grid;
  gap: 10px;
}

.overview-row {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.overview-label {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.overview-value {
  color: var(--ink);
  font-size: 15px;
}

.client-map-canvas {
  margin: 8px 0 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  background: color-mix(in srgb, var(--bg-soft) 78%, black 22%);
}

.inline-form {
  margin-top: 8px;
}

.overview-details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: rgba(12, 16, 22, 0.4);
}

.overview-details summary {
  cursor: pointer;
  font-weight: 600;
  margin: 0;
  padding: 4px 0;
}

.risk-intel-fold {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: color-mix(in srgb, var(--bg-soft) 72%, black 28%);
}

.risk-intel-fold > summary {
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  list-style: none;
}

.risk-intel-fold > summary::-webkit-details-marker {
  display: none;
}

.risk-intel-fold > summary::after {
  content: "+";
  color: var(--muted);
  font-weight: 700;
}

.risk-intel-fold[open] > summary::after {
  content: "-";
}

.risk-intel-fold[open] > summary {
  margin-bottom: 10px;
}

.overview-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.workflow-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.mini-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.mini-table th,
.mini-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-table.applicant-table td,
.mini-table.applicant-table th {
  white-space: normal;
}

.mini-table .col-name {
  width: 60%;
}

.mini-table .col-status {
  width: 120px;
}

.mini-table .col-updated {
  width: 80px;
}

.mini-table td:first-child {
  max-width: 320px;
}

.mini-table td:nth-child(2) {
  max-width: 100px;
}

.mini-table td:nth-child(3) {
  max-width: 140px;
}

.mini-table td:nth-child(4) {
  max-width: 180px;
}

.mini-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.mini-table th .table-sort-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.mini-table th .table-sort-btn:hover,
.mini-table th .table-sort-btn:focus-visible {
  color: var(--fg);
}

.mini-table th .table-sort-btn:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.mini-table th .sort-arrow {
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
}

.mini-table.risk-cases-table {
  table-layout: fixed;
}

.mini-table.risk-cases-table th:nth-child(1),
.mini-table.risk-cases-table td:nth-child(1) {
  width: 11%;
}

.mini-table.risk-cases-table th:nth-child(2),
.mini-table.risk-cases-table td:nth-child(2) {
  width: 14%;
}

.mini-table.risk-cases-table th:nth-child(3),
.mini-table.risk-cases-table td:nth-child(3) {
  width: 20%;
}

.mini-table.risk-cases-table th:nth-child(4),
.mini-table.risk-cases-table td:nth-child(4) {
  width: 22%;
}

.mini-table.risk-cases-table th:nth-child(5),
.mini-table.risk-cases-table td:nth-child(5) {
  width: 11%;
}

.mini-table.risk-cases-table td:nth-child(4),
.mini-table.risk-cases-table td:nth-child(5) {
  max-width: none;
}

.mini-table.risk-cases-table th:nth-child(6),
.mini-table.risk-cases-table td:nth-child(6) {
  width: 12%;
  white-space: nowrap;
}

.mini-table.risk-cases-table th:last-child,
.mini-table.risk-cases-table td:last-child {
  width: 10%;
  white-space: nowrap;
}

.mini-table.risk-cases-table td:nth-child(2),
.mini-table.risk-cases-table td:nth-child(3),
.mini-table.risk-cases-table td:nth-child(4) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analyze-invoice-modal {
  width: min(680px, 92vw);
}

.progress-shell {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-soft) 82%, black 18%);
  overflow: hidden;
  margin-top: 8px;
}

.progress-shell .progress-bar {
  margin-top: 0;
  height: 100%;
  transition: width 0.2s ease-in-out;
}

.client-overview .chat-window {
  min-height: 220px;
  max-height: 420px;
}

.client-overview .chat-bubble {
  max-width: 60%;
}

.client-overview .chat-card {
  gap: 10px;
}

.client-overview .chat-header h2 {
  margin: 0;
}

.client-overview .chat-select .token {
  padding: 8px 12px;
  border-radius: 12px;
}

.checks-cockpit {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
  border: 1px solid rgba(118, 151, 232, 0.28);
  background:
    linear-gradient(115deg, rgba(17, 37, 78, 0.42), rgba(66, 22, 50, 0.34)),
    color-mix(in srgb, var(--bg-soft) 74%, black 26%);
}

.checks-metric {
  border: 1px solid rgba(133, 161, 226, 0.24);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(8, 16, 32, 0.66);
  display: grid;
  gap: 4px;
}

.checks-kicker {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #90a5d2;
  font-weight: 700;
}

.checks-value {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.15;
  color: #ecf3ff;
  word-break: break-word;
}

.checks-value--good {
  color: #68dfad;
}

.checks-value--bad {
  color: #ff8f96;
}

.checks-value--stable {
  color: #9cc0ff;
}

@media (max-width: 900px) {
  .overview-row {
    grid-template-columns: 1fr;
  }
  .client-overview .chat-bubble {
    max-width: 78%;
  }
  .checks-cockpit {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .client-risk-cockpit-grid {
    grid-template-columns: 1fr;
  }

  .client-risk-cbs-grid {
    grid-template-columns: 1fr;
  }

  .gauge-wrap {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .client-risk-market-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .market-main {
    grid-column: 1 / -1;
  }

  .client-overview-grid {
    grid-template-columns: 1fr;
  }

  .clients-metrics-grid,
  .client-dossier-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.client-form-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--glass);
  display: grid;
  gap: 12px;
}

.client-autofill summary {
  list-style: none;
  cursor: pointer;
}

.client-autofill summary::-webkit-details-marker {
  display: none;
}

.client-autofill summary h3 {
  margin: 4px 0 0;
}

.client-autofill[open] summary {
  margin-bottom: 8px;
}

.client-form-section h3 {
  margin: 0;
}

.client-form-intro {
  display: grid;
  gap: 10px;
}

.client-form-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.client-form-actions {
  justify-content: flex-end;
}

.client-form-actions button {
  min-width: 220px;
}

.section-kicker {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.required-label .label-title::after {
  content: " *";
  color: #e4537a;
  font-weight: 600;
}

.label-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.label-title.placeholder {
  visibility: hidden;
}

.client-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.kvk-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.kvk-stack {
  display: grid;
  gap: 12px;
}

.kvk-grid .full-span {
  grid-column: 1 / -1;
}

.kvk-grid label > input + input {
  margin-top: 10px;
}

.kvk-grid label > input + input + input {
  margin-top: 10px;
}

.client-form-grid .sbi-split {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.client-form-grid .full-span {
  grid-column: 1 / -1;
}

.sbi-stack {
  display: grid;
  gap: 12px;
}

@media (max-width: 900px) {
  .client-form-grid {
    grid-template-columns: 1fr;
  }
  .sbi-split {
    grid-template-columns: 1fr;
  }
  .kvk-grid {
    grid-template-columns: 1fr;
  }
}

.client-company-section h4 {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

html[data-theme="light"] .panel {
  background: rgba(255, 255, 255, 0.92);
}

html[data-theme="light"] .card {
  background: #ffffff;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .invite-item {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] .token {
  background: rgba(15, 23, 42, 0.06);
  color: var(--text);
}

html[data-theme="light"] input,
html[data-theme="light"] textarea,
html[data-theme="light"] select {
  background: #ffffff;
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .chat-window {
  background: #f3f6fb;
  border-color: rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] .chat-bubble {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
  color: var(--text);
}

html[data-theme="light"] .chat-bubble.user {
  background: rgba(91, 120, 255, 0.15);
  border-color: rgba(91, 120, 255, 0.35);
}

html[data-theme="light"] .chat-bubble.assistant {
  background: rgba(228, 83, 122, 0.12);
  border-color: rgba(228, 83, 122, 0.35);
}

html[data-theme="light"] .chat-status {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] .file-view,
html[data-theme="light"] .report-preview-body {
  background: #ffffff;
  color: var(--text);
}

html[data-theme="light"] .report-doc-section {
  color: #1e3a8a;
}

html[data-theme="light"] .report-doc-row {
  border-bottom-color: rgba(15, 23, 42, 0.1);
}

html[data-theme="light"] .store-card,
html[data-theme="light"] .invite-item,
html[data-theme="light"] .action-card {
  background: #ffffff;
  color: var(--text);
}

html[data-theme="light"] .store-card a,
html[data-theme="light"] .store-card .muted,
html[data-theme="light"] .store-card .counts,
html[data-theme="light"] .invite-item .muted {
  color: var(--text);
}

html[data-theme="light"] .store-card {
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .counts {
  color: var(--muted);
}

html[data-theme="light"] .store-search input {
  background: #ffffff;
  color: var(--text);
}

html[data-theme="light"] .panel {
  background: rgba(255, 255, 255, 0.92);
}

html[data-theme="light"] .metric,
html[data-theme="light"] .risk-node,
html[data-theme="light"] .risk-card,
html[data-theme="light"] .risk-rel-btn,
html[data-theme="light"] .risk-timeline-item,
html[data-theme="light"] .crypto-box {
  background: #ffffff;
  color: var(--text);
  border-color: rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] .metric.metric-low {
  background: rgba(22, 163, 74, 0.09);
  border-color: rgba(22, 163, 74, 0.45);
}

html[data-theme="light"] .metric.metric-low .metric-label,
html[data-theme="light"] .metric.metric-low .metric-value {
  color: #166534;
}

html[data-theme="light"] .metric.metric-moderate {
  background: rgba(245, 158, 11, 0.11);
  border-color: rgba(245, 158, 11, 0.5);
}

html[data-theme="light"] .metric.metric-moderate .metric-label,
html[data-theme="light"] .metric.metric-moderate .metric-value {
  color: #92400e;
}

html[data-theme="light"] .metric.metric-high,
html[data-theme="light"] .metric.metric-critical {
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.48);
}

html[data-theme="light"] .metric.metric-high .metric-label,
html[data-theme="light"] .metric.metric-high .metric-value,
html[data-theme="light"] .metric.metric-critical .metric-label,
html[data-theme="light"] .metric.metric-critical .metric-value {
  color: #991b1b;
}

html[data-theme="light"] .risk-placeholder,
html[data-theme="light"] .risk-list,
html[data-theme="light"] .metric-label {
  color: var(--muted);
}

html[data-theme="light"] .risk-action {
  background: rgba(91, 120, 255, 0.12);
  border-color: rgba(91, 120, 255, 0.35);
  color: #1b3fbf;
}

html[data-theme="light"] .risk-signal {
  background: rgba(228, 83, 122, 0.12);
  border-color: rgba(228, 83, 122, 0.3);
  color: var(--text);
}

.brain-drawer {
  margin: 10px 0 14px;
}

.brain-context-fold {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.02);
}

.brain-context-fold > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}

.brain-context-fold > summary::-webkit-details-marker {
  display: none;
}

.brain-context-open-token {
  transition: transform 0.18s ease;
}

.brain-context-fold[open] .brain-context-open-token {
  transform: translateY(-1px);
}

.brain-context-content {
  margin-top: 10px;
}

.brain-first-open-note {
  margin: 0 0 10px;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px dashed rgba(120, 175, 255, 0.35);
  background: linear-gradient(140deg, rgba(29, 52, 100, 0.3), rgba(18, 27, 43, 0.2));
  color: #dbeafe;
}

.brain-brief-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 10px;
}

.brain-brief-card {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  min-height: 220px;
}

.brain-script {
  margin-top: 6px;
  margin-bottom: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px dashed rgba(120, 175, 255, 0.38);
  background: linear-gradient(135deg, rgba(25, 52, 102, 0.35), rgba(15, 23, 42, 0.24));
  color: #d7e7ff;
  font-size: 12px;
  line-height: 1.4;
}

.brain-section-label {
  margin: 4px 0;
}

.brain-impact-list,
.brain-proposal-list {
  margin: 0 0 8px 16px;
  padding: 0;
}

.brain-impact-list li,
.brain-proposal-list li {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.brain-six-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.brain-tip-card {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  min-height: 170px;
  position: relative;
  overflow: hidden;
}

.varqus-brain-card {
  min-height: 220px;
}

.brain-card-title {
  color: #dbeafe;
  margin-bottom: 10px;
  letter-spacing: 0.03em;
}

.brain-loading-graph {
  display: none;
  position: absolute;
  right: 10px;
  top: 10px;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
  z-index: 2;
}

.brain-loading-graph span {
  width: 3px;
  border-radius: 99px;
  background: rgba(127, 204, 255, 0.95);
  animation: brainLoadBars 0.9s ease-in-out infinite;
}

.brain-loading-graph span:nth-child(1) { animation-delay: 0ms; height: 8px; }
.brain-loading-graph span:nth-child(2) { animation-delay: 90ms; height: 13px; }
.brain-loading-graph span:nth-child(3) { animation-delay: 170ms; height: 10px; }
.brain-loading-graph span:nth-child(4) { animation-delay: 250ms; height: 6px; }

.brain-tip-card.is-loading {
  min-height: 196px;
}

.brain-tip-card.is-loading > :not(.brain-loading-graph) {
  visibility: hidden;
}

.brain-tip-card.is-loading .brain-loading-graph {
  display: inline-flex;
}

.brain-tip-card.is-loading::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 10px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.08)) 0 0 / 55% 10px no-repeat,
    linear-gradient(rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.08)) 0 20px / 90% 8px no-repeat,
    linear-gradient(rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.08)) 0 36px / 96% 8px no-repeat,
    linear-gradient(rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.08)) 0 52px / 88% 8px no-repeat,
    linear-gradient(rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.08)) 0 76px / 62% 8px no-repeat,
    linear-gradient(rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.08)) 0 94px / 95% 8px no-repeat;
}

.brain-tip-card.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    96deg,
    rgba(255, 255, 255, 0) 10%,
    rgba(127, 204, 255, 0.17) 45%,
    rgba(255, 255, 255, 0) 80%
  );
  transform: translateX(-120%);
  animation: brainCardShimmer 1.2s ease-in-out infinite;
  animation-delay: var(--brain-load-delay, 0ms);
}

html[data-theme="light"] .brain-tip-card {
  border-color: rgba(15, 23, 42, 0.12);
  background: rgba(15, 23, 42, 0.03);
}

html[data-theme="light"] .brain-card-title {
  color: #1e3a8a;
}

html[data-theme="light"] .brain-context-fold {
  border-color: rgba(15, 23, 42, 0.12);
  background: rgba(15, 23, 42, 0.02);
}

html[data-theme="light"] .brain-first-open-note {
  color: #1e3a8a;
  border-color: rgba(30, 64, 175, 0.28);
  background: linear-gradient(140deg, rgba(219, 234, 254, 0.95), rgba(239, 246, 255, 0.92));
}

@keyframes brainCardShimmer {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}

@keyframes brainLoadBars {
  0%, 100% { transform: scaleY(0.7); opacity: 0.66; }
  50% { transform: scaleY(1.2); opacity: 1; }
}

.brain-drawer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.brain-row {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.02);
}

html[data-theme="light"] .brain-row {
  border-color: rgba(15, 23, 42, 0.12);
  background: rgba(15, 23, 42, 0.02);
}

html[data-theme="light"] .brain-brief-card {
  border-color: rgba(15, 23, 42, 0.12);
  background: rgba(15, 23, 42, 0.03);
}

html[data-theme="light"] .brain-script {
  border-color: rgba(30, 64, 175, 0.28);
  background: linear-gradient(135deg, rgba(219, 234, 254, 0.95), rgba(239, 246, 255, 0.96));
  color: #1e3a8a;
}

@media (max-width: 980px) {
  .brain-brief-grid {
    grid-template-columns: 1fr;
  }
  .brain-drawer-grid {
    grid-template-columns: 1fr;
  }
  .brain-six-grid {
    grid-template-columns: 1fr;
  }
}

/* VARQUS Training Mode */
.training-overlay {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: min(360px, calc(100vw - 32px));
  z-index: 70;
  border: 1px solid rgba(102, 142, 255, 0.55);
  border-radius: 14px;
  background: rgba(8, 18, 40, 0.94);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
  padding: 10px;
}
.training-overlay[hidden] {
  display: none !important;
}
.training-overlay-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.training-overlay-body label,
.training-modal-card label {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}
.training-overlay-prompt {
  border: 1px solid rgba(95, 122, 210, 0.5);
  border-radius: 12px;
  padding: 10px;
  margin-top: 8px;
}
.training-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(3, 7, 18, 0.66);
}
.training-modal[hidden] {
  display: none !important;
}
.training-modal-card {
  width: min(520px, calc(100vw - 32px));
  border-radius: 14px;
  border: 1px solid rgba(102, 142, 255, 0.45);
  background: rgba(8, 18, 40, 0.96);
  padding: 14px;
}
.training-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
