:root {
  --app-sidebar-width: 240px;
}
.app-body { background: #f5f6f8; }
.auth-body { background: linear-gradient(160deg, #eef2f9 0%, #f8f9fb 100%); }
.app-topbar { height: 56px; z-index: 1030; }
.app-search { max-width: 560px; }
.app-shell { min-height: calc(100vh - 56px); }
.app-main { min-width: 0; }

@media (min-width: 992px) {
  .app-sidebar {
    width: var(--app-sidebar-width);
    flex: 0 0 var(--app-sidebar-width);
    position: sticky;
    top: 56px;
    height: calc(100vh - 56px);
    overflow-y: auto;
  }
}
.app-nav .nav-link {
  color: #3a4250;
  padding: .45rem 1.1rem;
  border-left: 3px solid transparent;
  font-size: .925rem;
}
.app-nav .nav-link i { width: 1.4rem; display: inline-block; color: #6c757d; }
.app-nav .nav-link:hover { background: #f1f4f9; }
.app-nav .nav-link.active { background: #e9f0fe; border-left-color: var(--bs-primary); color: var(--bs-primary); font-weight: 500; }
.app-nav .nav-link.active i { color: var(--bs-primary); }
.app-nav .nav-link.sub { padding-left: 2.4rem; font-size: .875rem; }
.app-nav-section {
  text-transform: uppercase; font-size: .7rem; letter-spacing: .06em;
  color: #8a94a6; padding: 1rem 1.1rem .3rem;
}
.notif-menu { width: 320px; max-width: 90vw; }

.card { border: 1px solid #e5e8ee; }
.stat-card .stat-value { font-size: 1.6rem; font-weight: 600; line-height: 1.1; }
.stat-card .stat-label { font-size: .8rem; color: #6c757d; text-transform: uppercase; letter-spacing: .04em; }
.stat-card a { text-decoration: none; color: inherit; }

.table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: #6c757d; font-weight: 600; white-space: nowrap; }
.table td { vertical-align: middle; }
.table-responsive { border-radius: .375rem; }

.timeline { list-style: none; padding-left: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 11px; top: 4px; bottom: 4px; width: 2px; background: #e1e5ec; }
.timeline li { position: relative; padding-left: 2.2rem; padding-bottom: 1rem; }
.timeline li .tl-dot { position: absolute; left: 4px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--bs-primary); }

.provenance { font-size: .75rem; }
.badge-ai { background: #6f42c1; }
.filter-card .form-label { font-size: .8rem; margin-bottom: .2rem; }
.perm-group { break-inside: avoid; }
.perm-columns { column-gap: 2rem; }
@media (min-width: 768px) { .perm-columns { columns: 2; } }
@media (min-width: 1200px) { .perm-columns { columns: 3; } }
.preview-table td { font-size: .82rem; max-width: 220px; }
.preview-table input.form-control-sm { min-width: 120px; }
.text-truncate-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
pre.raw-text { max-height: 360px; overflow: auto; background: #f8f9fa; padding: .75rem; font-size: .8rem; white-space: pre-wrap; }
.chart-box { position: relative; height: 260px; }
.stat-accent { border-left: 4px solid var(--accent, var(--bs-primary)) !important; }
.matrix-wrap { max-height: 75vh; }
.matrix thead th { position: sticky; top: 0; background: #fff; z-index: 2; min-width: 96px; }
.matrix thead th:first-child { min-width: 240px; }
.matrix td:first-child { background: #fff; }
/* Tables with row action menus: let menus overflow the table on wider screens. */
@media (min-width: 768px) { .table-responsive.overflow-visible-md { overflow: visible; } }
