:root {
  --green: #059347;
  --green-dark: #04703a;
  --green-soft: #e7f6ee;
  --purple: #572463;
  --purple-dark: #3d1846;
  --paper: #f4f4f5;
  --ink: #1c1720;
  --muted: #6d6572;
  --line: #e6e6e8;
  --white: #fff;
  --danger: #9f1239;
  --warn: #9a6700;
  --shadow: 0 1px 2px rgba(28, 23, 32, 0.04);
  --sidebar: 272px;
  --mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 72'%3E%3Cpath fill='%23059347' d='M0 0H22V32A18 18 0 0 0 58 32V0H80V32A40 40 0 0 1 0 32Z'/%3E%3C/svg%3E");
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "IBM Plex Sans Arabic", "IBM Plex Sans", "Segoe UI", Tahoma, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
}
a { color: var(--purple); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow: hidden;
  background: var(--purple);
  color: #fff;
  padding: 16px 12px 14px;
  display: flex; flex-direction: column; gap: 14px;
}
.sidebar::after {
  content: "";
  position: absolute; z-index: 0; pointer-events: none;
  width: 280px; height: 250px;
  inset-inline-start: -70px; bottom: -36px;
  background: var(--mark) center / contain no-repeat;
  opacity: .16;
}
.brand-row, .side-nav, .sidebar-foot { position: relative; z-index: 1; }
.brand-row { display: flex; align-items: center; gap: 6px; padding: 0 4px; }
.brand { display: flex; gap: 10px; align-items: center; color: #fff; min-width: 0; flex: 1; }
.brand strong, .brand small { display: block; }
.brand small { color: rgba(255,255,255,.68); font-size: 12px; }
.mark {
  width: 42px; height: 42px; border-radius: 13px;
  background: var(--paper); color: var(--green);
  display: grid; place-items: center; flex: none;
}
.mark svg { width: 24px; height: 22px; fill: currentColor; stroke: none; }
.mark-lg { width: 72px; height: 72px; border-radius: 20px; background: #fff; }
.mark-lg svg { width: 40px; height: 36px; }
.collapse-nav {
  width: 34px; height: 34px; border: 0; border-radius: 10px; cursor: pointer;
  background: rgba(255,255,255,.1); color: #fff; display: grid; place-items: center; flex: none;
}
.side-nav { display: flex; flex-direction: column; gap: 4px; overflow: auto; padding-inline-end: 2px; }
.nav-label {
  margin: 14px 8px 4px; color: rgba(255,255,255,.55); font-size: 11px; font-weight: 700;
}
.nav-link {
  display: flex; align-items: center; gap: 10px; position: relative;
  color: rgba(255,255,255,.88); padding: 9px 10px; border-radius: 12px; font-weight: 500;
}
.nav-link svg { color: rgba(255,255,255,.7); flex: none; }
.nav-link:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav-link.active { background: var(--paper); color: var(--purple); }
.nav-link.active svg { color: var(--green); }
.nav-link.active .nav-count { background: var(--green); color: #fff; }
.nav-count {
  margin-inline-start: auto; background: #fff; color: #2c102f;
  border-radius: 999px; min-width: 20px; text-align: center; font-size: 11px; padding: 1px 6px;
}
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.user-chip { display: flex; gap: 10px; align-items: center; color: #fff; }
.user-chip strong, .user-chip small { display: block; }
.user-chip small { color: rgba(255,255,255,.68); font-size: 12px; }
.avatar {
  width: 36px; height: 36px; border-radius: 12px; background: rgba(255,255,255,.16); color: white;
  display: grid; place-items: center; font-weight: 700; flex: none;
}
.linkish { background: none; border: 0; color: rgba(255,255,255,.72); padding: 0 4px; cursor: pointer; text-align: start; }
.linkish:hover { color: #fff; }
html.sidebar-compact { --sidebar: 88px; }
html.sidebar-compact .brand span:last-child,
html.sidebar-compact .nav-link > span,
html.sidebar-compact .nav-label,
html.sidebar-compact .user-chip span,
html.sidebar-compact .linkish { display: none; }
html.sidebar-compact .nav-link, html.sidebar-compact .brand { justify-content: center; }
html.sidebar-compact .sidebar::after { display: none; }
html.sidebar-compact .nav-count {
  position: absolute; top: 4px; inset-inline-end: 4px; margin: 0; min-width: 16px; padding: 0 4px;
}
html[dir="rtl"] .collapse-nav svg,
html.sidebar-compact .collapse-nav svg { transform: scaleX(-1); }
html[dir="rtl"].sidebar-compact .collapse-nav svg { transform: none; }

.main { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 8;
  display: flex; align-items: center; gap: 14px;
  min-height: 68px; padding: 10px 22px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.topbar-title { min-width: 160px; }
.topbar h1 { margin: 0; font-size: 22px; line-height: 1.2; color: var(--purple-dark); font-weight: 700; }
.eyebrow { margin: 0; color: var(--green); font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.eyebrow::before { content: ""; width: 16px; height: 3px; border-radius: 3px; background: var(--green); flex: none; }
.nav-search {
  flex: 1; max-width: 460px; display: flex; align-items: center; gap: 8px;
  background: var(--paper); border: 1px solid transparent; border-radius: 999px; padding: 0 14px;
}
.nav-search:focus-within { background: var(--white); border-color: color-mix(in srgb, var(--purple) 35%, var(--line)); }
.nav-search input { border: 0; background: transparent; width: 100%; padding: 10px 0; outline: none; }
.nav-search svg { color: var(--muted); }
.topbar-tools { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn, .pref {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--white); color: var(--ink); display: grid; place-items: center; cursor: pointer; padding: 0;
}
.pref { width: auto; padding: 0 12px; font-size: 13px; font-weight: 600; }
.prefs { display: flex; gap: 8px; }
.bell { position: relative; color: var(--ink); }
.bell span {
  position: absolute; top: -4px; inset-inline-end: -4px;
  background: var(--green); color: white; border-radius: 999px; font-size: 11px; padding: 0 5px; line-height: 16px;
}
.notify { position: relative; }
.notify-panel {
  display: none;
  position: absolute; top: calc(100% + 10px); inset-inline-end: 0; z-index: 40;
  width: min(380px, calc(100vw - 28px));
  background: var(--white); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 18px 44px rgba(48, 24, 56, 0.16);
  overflow: hidden;
}
.notify.is-open .notify-panel { display: flex; flex-direction: column; }
.notify-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
}
.notify-head strong { font-size: 15px; }
.notify-head a { font-size: 13px; font-weight: 600; }
.notify-list { max-height: 360px; overflow: auto; padding: 8px; }
.notify-item { display: block; padding: 10px 12px; border-radius: 12px; color: inherit; }
.notify-item:hover { background: color-mix(in srgb, var(--green) 8%, var(--white)); }
.notify-item strong, .notify-item time, .notify-item p { display: block; }
.notify-item strong { font-size: 14px; }
.notify-item time { color: var(--muted); font-size: 12px; }
.notify-item p {
  margin: 4px 0 0; color: var(--muted); font-size: 13px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.notify-item.unread { background: var(--green-soft); }
.notify-empty { margin: 0; padding: 28px 12px; text-align: center; }
.notify-foot { margin: 0; padding: 8px; border-top: 1px solid var(--line); }
.notify-foot .btn { width: 100%; padding: 8px 10px; font-size: 13px; }
.notify-enable { border: 0; background: none; color: var(--purple); font-weight: 600; font-size: 13px; cursor: pointer; padding: 0; }
.notice-popups { position: fixed; z-index: 60; bottom: 18px; inset-inline-end: 18px; display: flex; flex-direction: column; gap: 8px; width: min(340px, calc(100vw - 28px)); }
.notice-popup { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: start; background: var(--white); color: inherit; border: 1px solid var(--line); border-inline-start: 4px solid var(--green); border-radius: 16px; box-shadow: 0 16px 40px rgba(48, 24, 56, .18); padding: 12px 12px 12px 14px; animation: notice-in .18s ease; }
.notice-popup a { color: inherit; min-width: 0; }
.notice-popup strong { display: block; font-size: 14px; }
.notice-popup p { margin: 4px 0 0; color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.notice-popup button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; padding: 0 2px; }
@keyframes notice-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.menu-toggle { display: none; }
.backdrop { display: none; }
.nav-create { white-space: nowrap; }

.messages { padding: 12px 22px 0; }
.toast { margin: 0 0 8px; padding: 10px 12px; border-radius: 12px; background: var(--white); border: 1px solid var(--line); }
.toast-success { border-inline-start: 4px solid var(--green); }
.toast-error { border-inline-start: 4px solid var(--danger); }
.content { padding: 16px 22px 40px; }

.intro, .note { background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; border-inline-start: 4px solid var(--green); }
.intro { border-inline-start-width: 0; border-top: 3px solid var(--green); }
.card:hover { border-color: var(--green); }
tbody tr:hover td { background: color-mix(in srgb, var(--green) 7%, transparent); }
.note.warn { background: #fff7e8; color: var(--warn); }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 14px 0; }
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: 18px; padding: 16px;
  display: flex; flex-direction: column; gap: 6px; min-height: 104px;
  box-shadow: var(--shadow);
}
.card span { color: var(--muted); font-size: 13px; }
.card strong { font-size: 28px; color: var(--purple); letter-spacing: -0.03em; }
.form-grid .check input { width: auto; }
.muted { color: var(--muted); margin: 0; }
.panel {
  background: var(--white); border: 1px solid var(--line); border-radius: 18px;
  padding: 16px 18px; box-shadow: var(--shadow); margin-bottom: 14px;
}
.panel h2 { margin: 0 0 12px; font-size: 17px; color: var(--purple-dark); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.row-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.row-actions form { margin: 0; }
.row-actions .btn { padding: 6px 10px; font-size: 13px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: start; padding: 11px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 12px; }
tr:last-child td { border-bottom: 0; }
.pill { display: inline-block; border-radius: 999px; padding: 2px 10px; background: #eee; font-size: 12px; font-weight: 600; }
.status-draft, .status-cancelled { background: #ececee; }
.status-submitted { background: #e7f0ff; }
.status-returned { background: #fff3d6; }
.status-office_rejected, .status-rejected_final, .status-execution_failed { background: #ffe4ea; color: var(--danger); }
.status-office_approved { background: #efe7f6; }
.status-accountant_rejected, .status-escalated, .status-appealed { background: #ffe8cc; }
.status-pending_execution { background: #efe4f3; color: var(--purple); }
.status-completed { background: var(--green-soft); color: var(--green-dark); }

.filter-bar, .filters {
  background: var(--white); border: 1px solid var(--line); border-radius: 18px;
  padding: 14px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.filter-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.filter-grid label, .field label, .stack label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 13px; }
.filter-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.fold, .group-fold {
  border: 1px solid var(--line); border-radius: 14px; background: var(--paper); margin-bottom: 10px;
}
.group-fold { background: var(--white); }
.group-fold .group-fold { margin-inline-start: 12px; background: var(--paper); }
.fold > summary, .group-fold > summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; font-weight: 700;
}
.fold > summary::-webkit-details-marker, .group-fold > summary::-webkit-details-marker { display: none; }
.fold > summary::before, .group-fold > summary::before {
  content: ""; width: 7px; height: 7px; flex: none;
  border-inline-end: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg); margin-bottom: 3px;
}
html[dir="rtl"] .fold > summary::before,
html[dir="rtl"] .group-fold > summary::before { transform: rotate(-45deg); }
.fold[open] > summary::before, .group-fold[open] > summary::before { transform: rotate(-45deg); margin-bottom: 0; }
html[dir="rtl"] .fold[open] > summary::before,
html[dir="rtl"] .group-fold[open] > summary::before { transform: rotate(45deg); }
.fold .filter-grid, .group-fold .table-wrap { padding: 0 12px 12px; }
.fold-note, .group-count { margin: 0 12px 12px; font-size: 13px; }
.group-count { margin: 0 0 12px; }
.group-meta { margin-inline-start: auto; color: var(--muted); font-weight: 600; font-size: 13px; }
.filter-grid input, .filter-grid select, .filters input, .filters select,
.form-grid input, .form-grid select, .form-grid textarea,
.stack input, .stack select, .stack textarea, .auth-card input {
  width: 100%; border: 1px solid var(--line); background: var(--paper); border-radius: 12px; padding: 10px 12px;
}
.filters { display: block; }
textarea { min-height: 90px; resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; min-height: 42px; }
.check input { width: auto; }
.check-row { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 12px 0; }
.matrix th, .matrix td { text-align: center; }
.matrix th:first-child, .matrix td:first-child { text-align: start; }
.matrix input { width: auto; }
.status-name { display: block; margin: 8px 0 4px; font-weight: 600; font-size: 13px; }
.status-name input { width: min(420px, 100%); border: 1px solid var(--line); background: var(--paper); border-radius: 12px; padding: 10px 12px; margin-top: 6px; }
.btn {
  border: 0; background: var(--purple); color: white; border-radius: 12px;
  padding: 10px 14px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600;
}
.btn:hover { filter: brightness(1.08); }
.btn-ghost:hover { filter: none; border-color: var(--purple); background: var(--paper); }
.btn-primary { background: var(--green); }
.btn-danger { background: var(--danger); }
.btn-ghost { background: var(--white); color: var(--purple); border: 1px solid var(--line); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-section {
  grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin: 0; padding: 16px 0 2px; border-top: 1px solid var(--line);
}
.form-section:first-of-type { border-top: 0; padding-top: 0; }
.form-section[hidden] { display: none; }
.form-section h2 { grid-column: 1 / -1; margin: 0; font-size: 16px; }
.form-section .lead, .form-section .choice-note, .lead { margin: 0; color: var(--muted); font-size: 13px; }
.form-section .lead, .form-section .choice-note { grid-column: 1 / -1; }
.field small { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.req { color: var(--danger); font-weight: 700; }
.locked-value {
  margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--paper);
  border: 1px solid var(--line); font-weight: 600;
}
.inline-action { margin-top: 8px; }
.wide { grid-column: 1 / -1; }
.claim-form { display: flex; flex-direction: column; gap: 14px; max-width: 880px; }
.claim-block {
  background: var(--white); border: 1px solid var(--line); border-radius: 18px; padding: 18px;
}
.claim-block[hidden] { display: none; }
.claim-block-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.claim-step {
  width: 28px; height: 28px; border-radius: 9px; background: var(--green); color: #fff;
  display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: none;
}
.claim-block h2 { margin: 0; font-size: 16px; color: var(--purple-dark); }
.claim-block h3 { margin: 0 0 10px; font-size: 14px; }
.claim-block .lead { margin: 4px 0 0; }
.claim-block .note { margin-bottom: 12px; }
.claim-fields, .money { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.claim-fields:has(> .field:only-child) { grid-template-columns: 1fr; }
.money { margin-top: 14px; }
.claim-fields + .claim-fields { margin-top: 14px; }
.lookup { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.lookup .btn { height: 42px; white-space: nowrap; }
.type-picks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.type-pick {
  display: flex; gap: 10px; align-items: flex-start; cursor: pointer;
  border: 1px solid var(--line); border-radius: 16px; padding: 14px; background: var(--paper);
}
.type-pick input { width: auto; margin-top: 3px; accent-color: var(--green); flex: none; }
.type-pick strong, .type-pick small { display: block; }
.type-pick small { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.type-pick:has(input:checked) {
  border-color: var(--green); background: var(--green-soft);
}
.type-pick:has(input:focus-visible) { outline: 2px solid var(--purple); outline-offset: 2px; }
.claim-form input:not([type="radio"]):not([type="checkbox"]):not([type="file"]),
.claim-form select, .claim-form textarea {
  width: 100%; border: 1px solid var(--line); background: var(--paper); border-radius: 12px; padding: 10px 12px;
}
.claim-form input:focus, .claim-form select:focus, .claim-form textarea:focus {
  outline: none; border-color: var(--purple); background: var(--white);
}
.claim-preview { margin-top: 14px; background: var(--paper); border-radius: 14px; padding: 14px; }
.claim-preview .facts { margin-top: 0; }
.claim-preview .lead, .claim-preview .note { margin-top: 10px; }
.file-drop {
  display: flex; flex-direction: column; gap: 8px; cursor: pointer;
  border: 1px dashed color-mix(in srgb, var(--purple) 40%, var(--line));
  border-radius: 16px; padding: 16px; background: var(--paper);
}
.file-drop small { color: var(--muted); font-size: 12px; line-height: 1.45; }
.claim-actions {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  background: var(--white); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px;
}
.claim-actions .lead { margin: 0; max-width: 460px; }
.claim-actions .actions { margin-inline-start: auto; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.form-error, .errorlist { color: var(--danger); margin: 0 0 8px; padding: 0; }
.preview { background: #f7f3f8; border-radius: 12px; padding: 12px; }
.split { display: grid; grid-template-columns: 1.3fr .8fr; gap: 14px; }
.detail-head, .amounts { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 14px; }
.amounts { display: grid; grid-template-columns: repeat(4, 1fr); }
.amounts article { background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 12px; }
.amounts span { color: var(--muted); display: block; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 0; }
.facts div { border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.facts dt { color: var(--muted); font-size: 13px; }
.facts dd { margin: 0; font-weight: 600; }
.stack { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.shot { display: block; width: min(100%, 280px); margin-top: 6px; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.timeline, .files, .plain { margin: 0; padding: 0 18px 0 0; }
html[dir="ltr"] .timeline, html[dir="ltr"] .files, html[dir="ltr"] .plain { padding: 0 0 0 18px; }
.timeline li, .comment, .notice { margin-bottom: 12px; }
.changelog-panel { padding: 0; }
.changelog-panel > summary {
  display: list-item; list-style: none; cursor: pointer;
  padding: 16px 18px; font-size: 17px; font-weight: 700;
}
.changelog-panel > summary::-webkit-details-marker { display: none; }
.changelog-summary { display: flex; align-items: center; gap: 8px; }
.changelog-summary::before {
  content: ""; width: 7px; height: 7px; flex: none;
  border-inline-end: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg); margin-bottom: 3px;
}
html[dir="rtl"] .changelog-summary::before { transform: rotate(-45deg); }
.changelog-panel[open] .changelog-summary::before { transform: rotate(-45deg); margin-bottom: 0; }
html[dir="rtl"] .changelog-panel[open] .changelog-summary::before { transform: rotate(45deg); }
.changelog-count { margin-inline-start: auto; font-size: 13px; font-weight: 600; }
.changelog-body { padding: 0 18px 16px; }
.changelog-note { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.changelog { list-style: none; margin: 0; padding: 0; }
.changelog-item {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  column-gap: 12px;
  padding-bottom: 10px;
}
.changelog-item:last-child { padding-bottom: 0; }
.changelog-rail { position: relative; }
.changelog-rail::before {
  content: "";
  position: absolute;
  inset-inline-start: 6px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--line);
}
.changelog-item:first-child .changelog-rail::before { top: 18px; }
.changelog-item:last-child .changelog-rail::before { bottom: auto; height: 18px; }
.changelog-item:only-child .changelog-rail::before { display: none; }
.changelog-mark {
  width: 14px; height: 14px; margin-top: 16px; border-radius: 50%;
  background: var(--white); border: 3px solid var(--purple); position: relative; z-index: 1;
}
.action-create .changelog-mark { border-color: var(--green); }
.action-delete .changelog-mark { border-color: var(--danger); }
.changelog-card { background: var(--paper); border-radius: 14px; padding: 12px 14px; }
.changelog-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.changelog-head time, .changelog-actor, .changelog-detail { color: var(--muted); font-size: 13px; }
.changelog-actor { margin-inline-start: auto; }
.changelog-diffs { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.changelog-diffs li {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px;
  background: var(--white); border-radius: 10px; padding: 8px 10px;
}
.changelog-field { min-width: 128px; color: var(--muted); font-size: 13px; font-weight: 700; }
.changelog-old, .changelog-new { overflow-wrap: anywhere; }
.changelog-old { color: var(--muted); text-decoration: line-through; }
.changelog-new { font-weight: 700; }
.changelog-arrow::before { content: "←"; color: var(--purple); font-weight: 700; }
html[dir="ltr"] .changelog-arrow::before { content: "→"; }
.pill.changelog-create { background: var(--green-soft); color: var(--green-dark); }
.pill.changelog-update { background: #efe7f6; color: var(--purple); }
.pill.changelog-delete { background: #ffe4ea; color: var(--danger); }
.comment, .notice { display: block; background: var(--paper); border-radius: 14px; padding: 12px; color: inherit; }
.notice.unread { border-inline-start: 4px solid var(--green); }
.muted, .empty { color: var(--muted); }
.missing {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 8px; padding: 36px 20px 32px;
  background:
    radial-gradient(circle at top, color-mix(in srgb, var(--purple) 14%, transparent), transparent 58%),
    var(--white);
  border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow);
}
.missing-code {
  margin: 0; font-size: 64px; line-height: 1; font-weight: 700; letter-spacing: -2px; color: var(--purple);
}
.missing h2 { margin: 0; font-size: 28px; }
.missing p { max-width: 440px; margin: 0 0 8px; color: var(--muted); }
.missing .actions { justify-content: center; }
.missing-card { text-align: center; }
.missing-card .btn { margin-top: 8px; }
.pager-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 12px; color: var(--muted); flex-wrap: wrap; }
.pager-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-size { margin: 0; }
.page-size label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.page-size select { width: auto; border: 1px solid var(--line); background: var(--paper); border-radius: 10px; padding: 6px 8px; }
.page-gap { color: var(--muted); padding: 0 2px; }
.pager { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pager a, .page-current {
  min-width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--white); color: var(--ink); padding: 0 8px;
}
.page-current { background: var(--purple); color: white; border-color: var(--purple); }
.auth-shell {
  min-height: 100vh; display: grid; grid-template-columns: minmax(300px, .86fr) 1.14fr;
  background: var(--paper);
}
.auth-brand {
  position: relative; overflow: hidden; min-height: 100vh;
  background: var(--purple); color: #fff;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 48px 40px 56px; gap: 18px;
}
.auth-brand::before {
  content: ""; position: absolute; pointer-events: none;
  width: min(560px, 90vw); height: 500px;
  inset-inline-end: -90px; top: -70px;
  background: var(--mark) center / contain no-repeat;
  opacity: .18;
}
.auth-lockup { position: relative; z-index: 1; display: flex; align-items: center; gap: 16px; }
.auth-word strong, .auth-word span { display: block; }
.auth-word strong { font-size: 28px; line-height: 1.1; }
.auth-word span { color: rgba(255,255,255,.72); font-size: 16px; }
.auth-brand > p { position: relative; z-index: 1; margin: 0; color: rgba(255,255,255,.78); }
.auth-pane { display: grid; place-items: center; padding: 32px 24px; }
.auth-card { width: min(440px, 100%); background: var(--white); border: 1px solid var(--line); border-radius: 24px; padding: 28px; }
.auth-card h1 { margin: 4px 0 4px; color: var(--purple-dark); }
.auth-card .prefs { justify-content: flex-end; margin-bottom: 8px; }
.auth-card form { display: flex; flex-direction: column; }
.auth-card label { font-weight: 600; font-size: 13px; margin-top: 10px; }
.auth-card .btn { width: 100%; margin-top: 16px; }

html[data-theme="dark"] .when-light, html:not([data-theme="dark"]) .when-dark { display: none; }
html[data-theme="dark"] {
  --paper: #120f14;
  --ink: #f6f1f7;
  --muted: #b7adba;
  --line: #322834;
  --white: #1c1720;
  --green-soft: #163528;
  --danger: #ff8aa3;
  --warn: #f0c36a;
  --shadow: none;
  --green-dark: #8ee0b2;
  --purple-dark: #e4c4ea;
}
html[data-theme="dark"] .mark { background: #f4f4f5; color: #059347; }
html[data-theme="dark"] .nav-link.active { background: rgba(255,255,255,.14); color: #fff; }
html[data-theme="dark"] .nav-link.active svg { color: #fff; }
html[data-theme="dark"] .nav-link:hover { background: rgba(255,255,255,.1); }
html[data-theme="dark"] .topbar h1,
html[data-theme="dark"] .panel h2,
html[data-theme="dark"] .auth-card h1,
html[data-theme="dark"] .card strong { color: var(--ink); }
html[data-theme="dark"] .note.warn { background: #3a2e14; }
html[data-theme="dark"] .preview { background: #2c2433; }
html[data-theme="dark"] .status-draft, html[data-theme="dark"] .status-cancelled { background: #342c3a; }
html[data-theme="dark"] .status-submitted { background: #1d2d46; }
html[data-theme="dark"] .status-returned, html[data-theme="dark"] .status-accountant_rejected,
html[data-theme="dark"] .status-escalated, html[data-theme="dark"] .status-appealed { background: #3d311c; }
html[data-theme="dark"] .status-office_rejected, html[data-theme="dark"] .status-rejected_final,
html[data-theme="dark"] .status-execution_failed { background: #4a2230; }
html[data-theme="dark"] .status-office_approved, html[data-theme="dark"] .status-pending_execution { background: #3a2744; }
html[data-theme="dark"] .pill.changelog-update { background: #3a2744; color: #e4c4ea; }
html[data-theme="dark"] .pill.changelog-delete { background: #4a2230; color: var(--danger); }

@media (max-width: 1100px) {
  .filter-grid, .cards { grid-template-columns: 1fr 1fr; }
  .nav-search { display: none; }
}
@media (max-width: 860px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { min-height: 0; padding: 28px 22px; }
  .auth-word strong { font-size: 22px; }
  .shell { grid-template-columns: 1fr; }
  .menu-toggle { display: grid; }
  .collapse-nav { display: none; }
  html.sidebar-compact { --sidebar: 272px; }
  html.sidebar-compact .brand span:last-child,
  html.sidebar-compact .nav-link > span,
  html.sidebar-compact .nav-label,
  html.sidebar-compact .user-chip span { display: block; }
  html.sidebar-compact .linkish { display: inline; }
  html.sidebar-compact .nav-count { position: static; margin-inline-start: auto; }
  .sidebar {
    position: fixed; z-index: 30; top: 0; inset-inline-start: 0;
    width: min(300px, 88vw); height: 100vh;
    transform: translateX(-105%); transition: transform .2s ease;
  }
  html[dir="rtl"] .sidebar { transform: translateX(105%); }
  html[dir="rtl"] .sidebar.is-open,
  .sidebar.is-open { transform: none; }
  .backdrop.is-open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 20; }
  .cards, .amounts, .split, .form-grid, .form-section, .facts, .filter-grid,
  .type-picks, .claim-fields, .money, .lookup { grid-template-columns: 1fr; }
  .lookup .btn, .claim-actions .actions, .claim-actions .actions .btn { width: 100%; }
  .claim-actions { align-items: stretch; }
  .content, .topbar, .messages { padding-left: 14px; padding-right: 14px; }
  .nav-create { display: none; }
  .topbar h1 { font-size: 18px; }
}
@media print {
  .sidebar, .topbar, .filter-bar, .filters, .backdrop, .actions, .btn, .pager-bar, .notice-popups { display: none !important; }
  .group-fold > :not(summary), .changelog-panel > .changelog-body { display: block !important; }
  .shell { display: block; }
  body, .panel, .card { background: white; color: black; }
}
