:root {
  --bg: #2b2b2b;
  --panel: #353535;
  --line: #4a4a4a;
  --text: #ececec;
  --muted: #a8a8a8;
  --accent: #3d7dff;
  --accent-2: #6ea2ff;
  --danger: #ff6b7a;
  --ok: #5bd39b;
  --sidebar: #242424;
  --hover: #3a3a3a;
  --input: #1f1f1f;
  --dar-strip: #303030;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 "Segoe UI", system-ui, sans-serif;
}

a {
  color: var(--accent-2);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

body.app-page {
  display: flex;
  min-height: 100vh;
  align-items: stretch;
}

body.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a1a1a;
}

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}

.sidebar-brand {
  display: flex;
  justify-content: center;
  padding: 1.2rem 1rem 0.85rem;
}

.logo {
  display: block;
  object-fit: contain;
}

.logo-sidebar {
  width: 88px;
  height: 88px;
}

.logo-login {
  width: 100%;
  height: auto;
}

.login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1.1rem;
  border: 1px solid #6e6e6e;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
}

.login-btn:hover,
.login-btn:focus-visible {
  background: #3a3a3a;
  text-decoration: none;
  outline: none;
}

.login-btn svg {
  flex: 0 0 auto;
}

.login-box {
  background: #323232;
  border: 1px solid #3f3f3f;
  border-radius: 16px;
  padding: 1.8rem 1.8rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(480px, calc(100vw - 2rem));
  text-align: center;
}

.login-box .logo-login {
  margin-bottom: 1rem;
}

.login-box h1 {
  margin: 0 0 1.15rem;
  font-size: 1.45rem;
  font-weight: 650;
}

.login-box .button {
  margin-top: 0;
  width: 100%;
  text-align: center;
}

.login-box .flash {
  width: 100%;
  text-align: left;
}

.login-box .lede {
  margin: 0 0 1.2rem;
}

.sidebar-divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0.35rem 1rem 0.85rem;
}

.sidenav {
  display: flex;
  flex-direction: column;
  padding: 0 0.7rem;
  gap: 0.15rem;
}

.sidenav a {
  color: var(--text);
  text-decoration: none;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  font-weight: 600;
}

.sidenav a:hover {
  background: var(--hover);
  text-decoration: none;
}

.sidenav a.active {
  background: var(--accent);
  color: white;
}

.sidenav a.active:hover {
  filter: brightness(1.08);
}

.sidebar-logout {
  margin-top: auto;
  padding: 0.8rem 0.7rem 1rem;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.sidebar-user-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  padding: 0.55rem 0.35rem 0.55rem 0.75rem;
}

.sidebar-logout button {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: auto;
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  padding: 0.55rem;
  border-radius: 8px;
}

.sidebar-logout button:hover,
.sidebar-logout button:focus-visible {
  background: var(--hover);
  color: var(--text);
  outline: none;
}

.sidebar-logout svg {
  flex: 0 0 auto;
}

.wrap {
  width: min(880px, calc(100% - 2.5rem));
  margin: 2rem auto 4rem;
}

.app-page .wrap {
  flex: 0 1 auto;
  min-width: 0;
}

.login-page .wrap {
  width: auto;
  margin: 0;
}

.hero {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 2.4rem;
}

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-size: 0.75rem;
  margin: 0 0 0.4rem;
}

h1,
h2 {
  margin: 0 0 0.5rem;
}

.lede,
.muted,
.hint {
  color: var(--muted);
}

.hint {
  font-size: 0.9rem;
}

.button {
  display: inline-block;
  margin-top: 1.2rem;
  background: var(--accent);
  color: white;
  padding: 0.7rem 1.1rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  border: 0;
  cursor: pointer;
}

.button:hover,
button[type="submit"]:hover {
  filter: brightness(1.08);
  text-decoration: none;
}

.button.secondary {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}

.button.small {
  margin-top: 0.6rem;
  padding: 0.4rem 0.7rem;
  font-size: 0.9rem;
}

.button.danger {
  background: transparent;
  border: 1px solid #5a2430;
  color: var(--danger);
}

.button.danger:hover,
.button.danger:focus-visible {
  background: #2a151b;
  filter: none;
}

.page-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1.2rem;
}

.search {
  display: flex;
  gap: 0.4rem;
}

input,
select,
textarea,
button[type="submit"] {
  font: inherit;
}

input,
select,
textarea {
  background: var(--input);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
}

.search button,
.note-form button {
  background: var(--accent);
  color: white;
  border: 0;
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  font-weight: 600;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.85rem;
}

tr:last-child td {
  border-bottom: 0;
}

.person {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  font-weight: 600;
}

.person img,
.profile-photo,
.avatar-fallback {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: #444;
}

.avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.avatar-fallback.large,
.profile-photo {
  width: 88px;
  height: 88px;
  font-size: 2rem;
}

.badge {
  display: inline-block;
  background: var(--hover);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.badge.danger {
  color: var(--danger);
  border-color: #5a2430;
  background: #2a151b;
}

.badge.watch {
  color: #f0c674;
  border-color: #6a5420;
  background: #2a2414;
}

.pager {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 1rem;
  color: var(--muted);
}

.flash {
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.flash.error {
  background: #2a151b;
  color: #ffd0d5;
}

.flash.success {
  background: #10291f;
  color: var(--ok);
}

.profile {
  display: flex;
  gap: 1.2rem;
  margin: 1rem 0 1.5rem;
}

.row-gap {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.2rem;
  margin-bottom: 1rem;
}

.note-form {
  display: grid;
  gap: 0.8rem;
}

.note-form > label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
}

.note-types {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.note-types legend {
  color: var(--muted);
  padding: 0;
  margin-bottom: 0.35rem;
}

.note-type-options {
  display: flex;
  gap: 0.5rem;
}

.note-type {
  position: relative;
  flex: 1;
  cursor: pointer;
}

.note-type input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.note-type span {
  display: block;
  text-align: center;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input);
  color: var(--text);
  font-weight: 600;
}

.note-type input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.note-type input:checked + span {
  border-color: var(--accent);
  background: #24365c;
  color: #fff;
}

.note-type:has(input[value="watch"]:checked) span {
  border-color: #c9a227;
  background: #2a2414;
  color: #f0c674;
}

.note-types .hint {
  margin: 0;
}

.notes {
  list-style: none;
  margin: 0;
  padding: 0;
}

.notes li {
  border-top: 1px solid var(--line);
  padding: 0.9rem 0;
}

.notes li:first-child {
  border-top: 0;
  padding-top: 0;
}

.note-meta {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  flex-wrap: wrap;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.note-delete {
  margin-left: auto;
}

.note-delete .button.small {
  margin-top: 0;
}

.notes p {
  margin: 0;
  white-space: pre-wrap;
}

.empty {
  color: var(--muted);
}

.back {
  color: var(--muted);
}

.dar-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.dar-toolbar .back {
  margin: 0;
}

.dar-toolbar form {
  margin: 0;
}

.dar-toolbar .button {
  margin-top: 0;
}

.wrap.wide {
  width: min(1040px, calc(100% - 2.5rem));
}

.page-head-actions {
  display: flex;
  gap: 0.7rem;
  align-items: end;
  flex-wrap: wrap;
}

.page-head .button,
.row-gap .button,
.inline-actions .button,
table .button {
  margin-top: 0;
}

.inline-actions {
  margin: 0 0 1rem;
}

.badge.status-pending {
  color: #e7c56a;
  border-color: #5a4a24;
  background: #2a2415;
}

.badge.status-investigating {
  color: var(--accent-2);
}

.badge.status-active {
  color: var(--ok);
  border-color: #245a3d;
  background: #10291f;
}

.badge.status-closed {
  color: var(--muted);
}

.dar-sheet {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  margin-top: 0.8rem;
}

.dar-masthead {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.2rem;
  align-items: center;
  padding: 1.1rem 1.2rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #3d3d3d 0%, #323232 100%);
}

.dar-masthead-title h1 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: 0;
  text-transform: none;
}

.dar-masthead-title .kicker {
  margin: 0 0 0.15rem;
  color: var(--muted);
}

.dar-status {
  display: grid;
  min-width: 8.5rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  background: var(--input);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.dar-status strong {
  font-size: 1rem;
  letter-spacing: 0.04em;
}

.dar-status strong.status-pending {
  color: #e7c56a;
}

.dar-status strong.status-investigating {
  color: var(--accent-2);
}

.dar-status strong.status-active {
  color: var(--ok);
}

.dar-status strong.status-closed {
  color: var(--muted);
}

.dar-access {
  display: grid;
  gap: 0.2rem;
  padding: 0.55rem 0.8rem;
  background: #3a2a16;
  color: #f0d7a8;
  font-size: 0.8rem;
  font-weight: 700;
  text-align: right;
  max-width: 10rem;
}

.dar-access.muted-access {
  background: var(--hover);
  color: var(--muted);
  font-weight: 600;
}

.dar-guide,
.dar-legend {
  margin: 0;
  padding: 0.7rem 1.2rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
  background: var(--dar-strip);
}

.dar-legend {
  border-bottom: 0;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
}

.dar-legend strong {
  color: var(--text);
  font-weight: 600;
}

.dar-step {
  border-bottom: 1px solid var(--line);
}

.dar-step:last-child {
  border-bottom: 0;
}

.dar-step-head {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 1rem 1.2rem 0.85rem;
  background: var(--dar-strip);
}

.dar-step-num {
  flex: 0 0 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dar-step-head h2 {
  margin: 0;
  font-size: 1.05rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
}

.dar-step-head p {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.dar-banner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.8rem 1.2rem;
  border-bottom: 1px solid var(--line);
  background: #2a3830;
}

.dar-banner p {
  margin: 0;
  color: var(--ok);
}

.dar-banner .button {
  margin-top: 0;
}

.dar-form.is-locked input,
.dar-form.is-locked textarea,
.dar-form.is-locked select {
  opacity: 0.95;
}

.dar-cells {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dar-cell {
  display: grid;
  grid-template-rows: auto 1fr;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.dar-cell.span-2 {
  grid-column: span 2;
}

.dar-cell.span-4 {
  grid-column: span 4;
}

.dar-cell > span,
.dar-field > span,
.dar-field-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.5rem 0.85rem;
  border-bottom: 1px solid var(--line);
  background: var(--dar-strip);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.dar-cell input,
.dar-cell select,
.dar-field textarea,
.dar-table-row > input[type="text"],
.action-row input[type="text"] {
  width: 100%;
  border: 0;
  border-radius: 0;
  background: var(--input);
  padding: 0.7rem 0.75rem;
}

.dar-table-row > input[type="text"]::placeholder {
  color: #7a7a7a;
}

.dar-cell input:focus,
.dar-cell select:focus,
.dar-field textarea:focus,
.dar-table-row > input[type="text"]:focus,
.action-row input[type="text"]:focus,
.picker-pop input:focus {
  outline: 1px solid var(--accent);
  outline-offset: -1px;
}

.dar-cell-body {
  padding: 0.6rem 0.75rem 0.75rem;
  background: var(--input);
}

.dar-field {
  display: block;
  border-bottom: 1px solid var(--line);
}

.dar-field textarea {
  display: block;
  min-height: 5.5rem;
  resize: vertical;
}

.dar-field-bar em {
  font-style: normal;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
}

.dar-table-head,
.dar-table-row {
  display: grid;
  grid-template-columns: 2.75rem minmax(8rem, 1.5fr) minmax(11rem, 1.1fr) minmax(12.5rem, 1fr) 2.2rem;
  align-items: stretch;
}

.dar-table-head-3,
.dar-table-row-3 {
  grid-template-columns: 2.75rem minmax(9rem, 1.4fr) minmax(12rem, 1.1fr) 2.2rem;
}

.dar-table-head {
  background: var(--dar-strip);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
}

.dar-table-head span,
.repeat-num {
  padding: 0.55rem 0.75rem;
}

.dar-table-row {
  border-bottom: 1px solid var(--line);
}

.repeat-num {
  display: flex;
  align-items: center;
  font-weight: 700;
  color: var(--muted);
  background: var(--input);
  border-right: 1px solid var(--line);
}

.dar-table-row > input[type="text"] {
  border-right: 1px solid var(--line);
}

.evidence-file,
.statement-from {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.55rem;
  background: var(--input);
  border-right: 1px solid var(--line);
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--input);
}

.row-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 1.15rem;
  line-height: 1;
}

.row-remove:hover,
.row-remove:focus-visible {
  color: var(--danger);
  background: rgba(255, 107, 122, 0.12);
  outline: none;
}

.row-remove[hidden] {
  display: none;
}

.evidence-thumb-link {
  display: block;
  flex: 0 0 auto;
  line-height: 0;
}

.evidence-thumb-link[hidden] {
  display: none;
}

.evidence-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.file-pick {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.7rem;
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
  border: 1px dashed var(--line);
  background: var(--dar-strip);
  color: var(--accent-2);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

.file-pick:hover,
.file-pick:focus-within {
  border-style: solid;
  background: var(--hover);
}

.file-pick input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  border: 0;
  padding: 0;
  background: none;
}

.dar-empty {
  margin: 0;
  padding: 0.8rem 0.75rem;
  background: var(--input);
}

.people-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--dar-strip);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.85rem;
}

.chip-link {
  color: inherit;
  font-weight: 600;
}

.chip-link:hover {
  text-decoration: underline;
}

.chip-fallback {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.person-cell {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.55rem;
  background: var(--input);
  border-right: 1px solid var(--line);
}

.people-row[data-empty-hint]:not(:has(.person-chip))::after {
  content: attr(data-empty-hint);
  color: var(--muted);
  font-size: 0.82rem;
}

.member-hover {
  position: fixed;
  z-index: 40;
  width: 260px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  padding: 0.75rem;
}

.member-hover-inner {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 0.7rem;
  align-items: start;
}

.member-hover-inner img,
.member-hover-inner .avatar-fallback {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.member-hover-inner strong {
  display: block;
}

.member-hover-inner p {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
}

.member-hover-links {
  margin-top: 0.45rem;
}

.chip-remove {
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  line-height: 1;
}

.picker {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.add-person {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 1.7rem;
  height: 1.7rem;
  padding: 0;
  border-radius: 999px;
  border: 1px dashed var(--line);
  background: var(--dar-strip);
  color: var(--accent-2);
  cursor: pointer;
}

.add-person:hover,
.add-person:focus-visible {
  border-style: solid;
  background: var(--hover);
  outline: none;
}

.picker-pop {
  position: fixed;
  z-index: 30;
  width: 16.5rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  padding: 0.4rem;
}

.picker-pop input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--input);
  padding: 0.4rem 0.55rem;
}

.picker-results {
  overflow: auto;
  max-height: 14rem;
}

.picker-results:empty {
  display: none;
}

.picker-results:not(:empty) {
  margin-top: 0.3rem;
}

.picker-results .empty {
  margin: 0.45rem 0.15rem 0.2rem;
  font-size: 0.82rem;
}

.picker-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  color: var(--text);
  padding: 0.55rem 0.7rem;
  cursor: pointer;
  font: inherit;
}

.picker-item:hover {
  background: var(--hover);
}

.action-list {
  background: var(--input);
}

.action-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.8rem;
  align-items: start;
  padding: 0.85rem 0.9rem;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.action-row:last-child {
  border-bottom: 0;
}

.action-row:has(input:checked) {
  background: rgba(61, 125, 255, 0.12);
  box-shadow: inset 3px 0 0 var(--accent);
}

.action-points {
  background: var(--hover);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  font-size: 0.75rem;
  color: var(--text);
}

.action-who {
  color: var(--muted);
}

.dar-footer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.95rem 1.2rem;
  border-bottom: 1px solid var(--line);
  background: var(--dar-strip);
}

.dar-footer-actions .hint {
  margin: 0;
  max-width: 22rem;
}

.dar-footer-actions .button {
  margin-top: 0;
  margin-right: 0.45rem;
}

.action-row p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.action-row-head {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.action-row-head span {
  color: var(--muted);
  font-size: 0.8rem;
}

.action-row input[type="text"] {
  margin-top: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.dar-plain-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--input);
}

.dar-plain-table th,
.dar-plain-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--line);
}

.dar-plain-table th {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.dar-activity {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--input);
}

.dar-activity li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.8rem;
  align-items: baseline;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--line);
}

.welcome {
  margin-bottom: 1.4rem;
}

.welcome h1 {
  margin-bottom: 0.15rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
  margin-bottom: 1.4rem;
}

.stat-card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  color: inherit;
  text-decoration: none;
}

.stat-card:hover {
  text-decoration: none;
  border-color: #6a6a6a;
}

.stat-card .muted {
  margin: 0;
  font-size: 0.82rem;
}

.stat-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 0.12rem;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  flex: 0 0 auto;
}

.stat-trend.up {
  color: var(--ok);
}

.stat-trend.down {
  color: var(--danger);
}

.stat-trend svg {
  display: block;
}

.stat-card strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.65rem;
  line-height: 1.2;
}

.stat-card .hint {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
}

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.dash-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dash-list li {
  border-top: 1px solid var(--line);
  padding: 0.7rem 0;
}

.dash-list li:first-child {
  border-top: 0;
  padding-top: 0;
}

.dash-list li:last-child {
  padding-bottom: 0;
}

.dash-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.dash-row .person {
  min-width: 0;
}

.joined-meta {
  display: block;
  font-weight: 500;
  font-size: 0.82rem;
}

.card .dash-list {
  margin-top: 0.35rem;
}

@media (max-width: 900px) {
  .stat-grid,
  .dash-grid {
    grid-template-columns: 1fr 1fr;
  }

  .dar-masthead,
  .dar-cells,
  .dar-table-head,
  .dar-table-row,
  .dar-table-head-3,
  .dar-table-row-3 {
    grid-template-columns: 1fr;
  }

  .dar-cell.span-2,
  .dar-cell.span-4,
  .dar-access {
    grid-column: auto;
    text-align: left;
  }

  .dar-table-head {
    display: none;
  }

  .repeat-num,
  .dar-table-row > input[type="text"],
  .person-cell,
  .evidence-file {
    border-right: 0;
  }

  .row-actions {
    justify-content: flex-end;
    padding: 0.15rem 0.45rem 0.45rem;
  }
}

@media (max-width: 800px) {
  body.app-page {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-brand {
    padding: 0.8rem 1rem 0.4rem;
  }

  .logo-sidebar {
    width: 56px;
    height: 56px;
  }

  .sidebar-divider {
    display: none;
  }

  .sidenav {
    flex-direction: row;
    flex-wrap: wrap;
    padding: 0 0.7rem 0.6rem;
  }

  .sidebar-logout {
    margin-top: 0;
    border-top: 0;
    padding: 0 0.7rem 0.7rem;
  }

  .sidebar-logout button {
    width: auto;
  }
}

@media (max-width: 700px) {
  .stat-grid,
  .dash-grid {
    grid-template-columns: 1fr;
  }

  .page-head,
  .profile {
    flex-direction: column;
    align-items: stretch;
  }

  .search {
    width: 100%;
  }

  .search input {
    flex: 1;
  }

  .dar-banner,
  .dar-footer-actions,
  .dar-step-head {
    flex-direction: column;
    align-items: stretch;
  }
}
