:root {
  --bg: #1f2024;
  --bg-2: #18191d;
  --panel: #2a2b30;
  --panel-2: #222329;
  --panel-3: #303138;
  --field: #1f2025;
  --line: #3b3d45;
  --text: #f1f1f3;
  --muted: #b5b7c0;
  --red: #8f0f2e;
  --red-2: #b01039;
  --accent-rgb: 176, 16, 57;
  --overdue: #b01039;
  --violet: #875ad1;
  --brand-accent: #e31745;
  --white: #f3f3f4;
  --black: #030304;
  --button-text: var(--white);
  --accent-text: var(--white);
  --shadow: 0 16px 34px rgba(0, 0, 0, .26);
  font-family: "Consolas", "Courier New", monospace;
}

:root[data-theme="blueberry"] {
  --bg: #171922;
  --bg-2: #11131b;
  --panel: #252837;
  --panel-2: #1d2030;
  --panel-3: #31364a;
  --field: #171a27;
  --line: #3a4159;
  --text: #f2f4ff;
  --muted: #b3bad8;
  --red: #3d418f;
  --red-2: #5965d8;
  --accent-rgb: 89, 101, 216;
  --overdue: #b01039;
  --violet: #8b73ff;
  --brand-accent: #6d79ff;
  --shadow: 0 16px 34px rgba(7, 10, 24, .34);
}

:root[data-theme="mono"] {
  --bg: #17181b;
  --bg-2: #111214;
  --panel: #24262b;
  --panel-2: #1b1d22;
  --panel-3: #31343b;
  --field: #17191d;
  --line: #43464d;
  --text: #dde1e6;
  --muted: #aeb4bd;
  --red: #b5bac2;
  --red-2: #c9ced5;
  --accent-rgb: 201, 206, 213;
  --overdue: #b01039;
  --violet: #8b73ff;
  --brand-accent: #c9ced5;
  --button-text: #111214;
  --accent-text: #111214;
  --shadow: 0 16px 34px rgba(4, 5, 7, .34);
}

:root[data-theme="mono"] .sidebar-links-panel .accepted-edit-toggle,
:root[data-theme="mono"] .edit-button,
:root[data-theme="mono"] .template-row-edit,
:root[data-theme="mono"] .template-global-edit {
  color: var(--white);
}

:root[data-theme="mono"] .sidebar-links-panel .accepted-edit-toggle.is-active {
  color: var(--black);
}

:root[data-theme="mono"] .custom-select-toggle {
  color: var(--white);
}

:root[data-theme="mono"] .custom-select-option {
  color: var(--white);
}

* { box-sizing: border-box; }

[hidden] {
  display: none !important;
}

* {
  scrollbar-width: thin;
  scrollbar-color: #777982 var(--panel-2);
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: var(--panel-2);
  border-radius: 8px;
}

*::-webkit-scrollbar-thumb {
  background: #777982;
  border: 2px solid var(--panel-2);
  border-radius: 8px;
}

*::-webkit-scrollbar-thumb:hover {
  background: #92949d;
}

html {
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: scroll;
  scrollbar-gutter: stable;
  background: var(--bg);
  color: var(--text);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  letter-spacing: 0;
}

body.scroll-locked {
  position: fixed;
  width: 100%;
  overflow: hidden;
}

body.modal-open {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
  color: var(--text);
}

button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: var(--red-2);
  color: var(--button-text);
  font-weight: 700;
  cursor: pointer;
  transition:
    background-color .16s ease,
    border-color .16s ease,
    box-shadow .16s ease,
    color .16s ease,
    filter .16s ease;
}

button:disabled { opacity: .6; cursor: default; }

button:not(:disabled):hover {
  filter: brightness(1.04);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .08),
    0 8px 18px rgba(0, 0, 0, .14);
}

button:not(:disabled):active {
  filter: brightness(.98);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04);
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--field);
  padding: 0 14px;
  outline: 0;
}

textarea {
  min-height: 140px;
  padding: 14px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
.custom-select-toggle:focus,
button:focus-visible {
  border-color: var(--red-2);
  outline: 0;
}

a { color: var(--white); text-underline-offset: 3px; }

.muted { color: var(--muted); }

.top-accent {
  position: fixed;
  inset: 0 0 auto;
  height: 2px;
  background: var(--red-2);
  z-index: 20;
}

.app-header {
  position: fixed;
  top: 2px;
  left: 0;
  right: 0;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 42px;
  background: var(--bg);
  z-index: 15;
}

.brand {
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
}

.brand span { color: var(--white); }
.brand strong { color: var(--brand-accent); }

.header-actions {
  position: fixed;
  top: 16px;
  right: 42px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  z-index: 16;
}

.header-theme {
  width: 42px;
  position: relative;
}

.theme-toggle-btn {
  width: 42px;
  min-height: 42px;
  padding: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  position: relative;
}

.theme-toggle-btn .theme-toggle-swatch {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .08);
}

.theme-toggle-btn[data-theme="classic"] .theme-toggle-swatch {
  background: linear-gradient(135deg, #8f0f2e 0 50%, #2a2b30 50% 100%);
}

.theme-toggle-btn[data-theme="blueberry"] .theme-toggle-swatch {
  background: linear-gradient(135deg, #5965d8 0 50%, #252837 50% 100%);
}

.theme-toggle-btn[data-theme="mono"] .theme-toggle-swatch {
  background: linear-gradient(135deg, #f3f3f4 0 50%, #24262b 50% 100%);
}

.theme-menu {
  position: absolute;
  top: 0;
  right: calc(100% + 8px);
  z-index: 40;
  display: flex;
  flex-direction: row-reverse;
  gap: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateX(8px);
  pointer-events: none;
  transition:
    opacity .16s ease,
    transform .16s ease,
    visibility 0s linear .16s;
}

.theme-menu[hidden] {
  display: flex !important;
}

.theme-menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  pointer-events: auto;
  transition:
    opacity .16s ease,
    transform .16s ease,
    visibility 0s linear 0s;
}

.theme-menu-item {
  width: 42px;
  min-height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
}

.theme-menu-item .theme-toggle-swatch {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .08);
}

.theme-menu-item[data-theme-choice="classic"] .theme-toggle-swatch {
  background: linear-gradient(135deg, #8f0f2e 0 50%, #2a2b30 50% 100%);
}

.theme-menu-item[data-theme-choice="blueberry"] .theme-toggle-swatch {
  background: linear-gradient(135deg, #5965d8 0 50%, #252837 50% 100%);
}

.theme-menu-item[data-theme-choice="mono"] .theme-toggle-swatch {
  background: linear-gradient(135deg, #f3f3f4 0 50%, #24262b 50% 100%);
}

.theme-menu-item.is-active {
  border-color: var(--red-2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}

.header-icon {
  width: 42px;
  min-height: 42px;
  display: grid;
  place-items: center;
  background: var(--panel);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.header-icon svg,
.nav-item svg {
  width: 22px;
  height: 22px;
}

.header-icon svg path,
.header-icon svg circle,
.header-icon svg rect,
.nav-item svg path,
.nav-item svg circle,
.nav-item svg rect {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.logout-icon {
  background: var(--panel);
  border: 1px solid var(--line);
}

.logout-icon svg {
  margin: 0;
}

.sidebar {
  position: fixed;
  top: 72px;
  left: 22px;
  width: 278px;
  display: grid;
  gap: 28px;
  z-index: 10;
}

.user-card {
  min-height: 64px;
  display: grid;
  grid-template-columns: 46px 1fr;
  align-items: center;
  gap: 14px;
  padding: 12px;
  background: var(--panel);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.user-card img {
  width: 40px;
  height: 40px;
  image-rendering: pixelated;
}

.user-card b,
.user-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.sidebar-panel {
  display: grid;
  gap: 16px;
  padding: 22px 22px 20px;
  background: var(--panel);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.sidebar-panel:not(.sidebar-links-panel) {
  gap: 20px;
}

.sidebar-panel-title {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.sidebar-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 30px;
  margin-bottom: 2px;
}

.sidebar-nav {
  display: grid;
  gap: 16px;
  margin-top: -2px;
}

.nav-item,
.ghost {
  background: transparent;
  text-align: left;
  color: var(--text);
}

.nav-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 12px;
  min-height: 32px;
  padding: 0;
}

.nav-item.active { color: var(--red-2); }

:root[data-theme="mono"] .nav-item.active {
  color: var(--white);
  background: color-mix(in srgb, var(--white) 10%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--white) 18%, transparent);
  border-radius: 8px;
  padding: 0 8px;
  margin: 0 -8px;
}

.sidebar-links-panel {
  gap: 16px;
}

.sidebar-links-panel .accepted-edit-toggle {
  position: static;
  width: 28px;
  min-height: 28px;
  margin-top: -1px;
}

.sidebar-links-body {
  display: grid;
  gap: 0;
  margin-top: -4px;
}

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

.sidebar-link {
  min-height: 30px;
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 12px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  text-align: left;
  font-weight: 400;
  transition: color .15s ease, background-color .15s ease;
}

.sidebar-link:hover {
  color: var(--red-2);
  background: rgba(var(--accent-rgb), .12);
}

.sidebar-template-button:not(:disabled):hover,
.sidebar-template-button:not(:disabled):active {
  filter: none;
  box-shadow: none;
}

.sidebar-link.is-disabled {
  color: var(--muted);
  cursor: default;
}

.sidebar-link svg {
  width: 18px;
  height: 18px;
  margin-left: 1px;
}

.sidebar-link svg path,
.sidebar-link svg circle,
.sidebar-link svg rect {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-link-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-links-edit-list {
  display: grid;
  gap: 10px;
}

.sidebar-link-edit-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 30px;
  gap: 8px;
  align-items: center;
  padding: 8px;
  background: var(--panel-2);
  border-radius: 8px;
  transition: box-shadow .15s ease, background-color .15s ease;
}

.sidebar-link-edit-row input {
  min-height: 34px;
  background: var(--field);
}

.sidebar-link-edit-row.is-dragging {
  opacity: .78;
  box-shadow: 0 10px 18px rgba(0, 0, 0, .18);
}

.sidebar-link-edit-row.is-drop-before {
  box-shadow: inset 0 2px 0 var(--red-2);
}

.sidebar-link-edit-row.is-drop-after {
  box-shadow: inset 0 -2px 0 var(--red-2);
}

.sidebar-link-fields {
  display: grid;
  gap: 8px;
}

.sidebar-link-drag {
  width: 30px;
  min-height: 30px;
  padding: 0;
  display: grid;
  place-items: center;
  background: var(--field);
  color: var(--muted);
  cursor: grab;
}

.sidebar-link-drag:active {
  cursor: grabbing;
}

.sidebar-link-remove {
  width: 30px;
  min-height: 30px;
  padding: 0;
  display: grid;
  place-items: center;
}

.sidebar-links-add {
  width: 100%;
  min-height: 34px;
  background: var(--panel-3);
}

.workspace {
  min-height: 100vh;
  padding: 78px 34px 34px 344px;
}

.view-heading {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0 0 20px;
}

.view-mark {
  font-size: 30px;
  color: var(--muted);
}

.view-heading h1 {
  margin: 0;
  font-size: 22px;
}

.view-heading p { margin: 4px 0 0; }

.heading-action {
  margin-left: auto;
  margin-top: 12px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.15;
}

.heading-action[hidden] {
  display: none !important;
}

.view { display: none; }
.view.active { display: block; }

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 2147483647;
  max-width: 360px;
  padding: 14px 18px;
  background: var(--panel);
  border-left: 4px solid var(--red-2);
  border-radius: 8px;
  box-shadow: var(--shadow);
  pointer-events: none;
}

.admin-only { display: none; }
body.is-admin .admin-only { display: grid; }

.appeals-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  margin: -12px 0 20px;
}

.create-appeal-open {
  min-width: 220px;
  min-height: 38px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  line-height: 1;
}

:root[data-theme="mono"] .create-appeal-open b {
  color: var(--black);
}

.create-appeal-open span,
.create-appeal-open b {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.create-appeal-open b {
  color: var(--muted);
  font-size: 17px;
}

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

.reks-layout {
  display: grid;
  grid-template-columns: 332px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  margin-top: 11px;
}

.appeals-left,
.appeals-content,
.reks-left,
.reks-content {
  display: grid;
  align-content: start;
  align-self: start;
  gap: 20px;
  min-width: 0;
}

.reks-content {
  width: 100%;
}

.appeals-filter-panel,
.appeals-history-panel,
.date-filter-panel,
.accepted-panel {
  position: relative;
  background: var(--panel);
  border-radius: 8px;
  overflow: visible;
  box-shadow: var(--shadow);
}

.appeals-filter-panel:focus-within,
.date-filter-panel:focus-within,
.appeals-history-panel:focus-within,
.accepted-panel:focus-within {
  z-index: 60;
}

.filter-title {
  position: relative;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 42px;
  background: var(--red);
  border-radius: 6px 6px 0 0;
  color: var(--accent-text);
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
}

.filter-title::-webkit-details-marker { display: none; }

.filter-title::after {
  content: "›";
  position: absolute;
  right: 22px;
  top: 50%;
  width: auto;
  height: auto;
  border: 0;
  color: var(--accent-text);
  transform: translateY(-50%);
  transform-origin: center;
  transition: transform .2s ease;
}

details[open] > .filter-title::after { transform: translateY(-50%) rotate(90deg); }

.collapsible-body {
  overflow: visible;
  transition: grid-template-rows .22s ease, opacity .22s ease;
}

.collapsible-inner {
  min-height: 0;
  overflow: visible;
}

details.collapsible-panel:not([open]) > .collapsible-body,
.collapsible-body[hidden] {
  display: none !important;
}

.appeals-filter-body,
.date-filter-body {
  display: grid;
  gap: 12px;
  padding: 0;
}

.appeals-filter-body > .collapsible-inner,
.date-filter-body > .collapsible-inner {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.appeals-filter-body label,
.date-filter-body label {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.appeal-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 14px;
}

.stat-card {
  --stat-accent: var(--white);
  min-height: 90px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 10px;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid transparent;
  border-left: 5px solid var(--white);
  text-align: left;
}

.stat-card[data-kind="overdue"] { --stat-accent: var(--overdue); border-left-color: var(--overdue); }
.stat-card[data-kind="clarification"] { --stat-accent: var(--violet); border-left-color: var(--violet); }
.stat-card[data-kind="closed"] { --stat-accent: var(--black); border-left-color: var(--black); }
.stat-card.is-active {
  border-color: var(--stat-accent);
  box-shadow: inset 0 0 0 1px var(--stat-accent);
}

.stat-card[data-kind="closed"].is-active {
  box-shadow: inset 0 0 0 1px var(--black);
}
.stat-card span { color: var(--muted); }
.stat-card b { font-size: 22px; }

:root[data-theme="mono"] .stat-card b {
  color: var(--white);
}

.view-mode-icon-toggle {
  width: 38px;
  height: 38px;
  min-width: 38px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--white);
}

.view-mode-icon-toggle[aria-pressed="true"] {
  border-color: #62646d;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .055);
}

.view-mode-icon {
  width: 17px;
  height: 17px;
  display: grid;
  gap: 3px;
}

.view-mode-icon-list i {
  display: block;
  height: 3px;
  background: currentColor;
  border-radius: 3px;
}

.view-mode-icon-cards {
  grid-template-columns: repeat(2, 1fr);
}

.view-mode-icon-cards i {
  display: block;
  background: currentColor;
  border-radius: 2px;
}

.appeals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  grid-auto-rows: min-content;
  align-items: start;
  gap: 16px;
}

.appeals-grid.is-row-mode {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
}

.list-pagination {
  min-height: 38px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.list-pagination:empty {
  display: none;
}

.list-pagination-summary {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.list-pagination-pages {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.list-pagination-pages button {
  min-width: 34px;
  min-height: 32px;
  padding: 0 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
}

.list-pagination-pages button.is-active {
  border-color: #62646d;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .055);
}

.list-pagination-gap {
  min-width: 14px;
  align-self: center;
  color: var(--muted);
  text-align: center;
}

.compact-table-wrap {
  min-width: 100%;
}

.compact-table {
  width: 100%;
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0 6px;
}

.compact-table th {
  padding: 0 12px 6px;
  color: var(--muted);
  font-size: 12px;
  text-align: left;
  white-space: nowrap;
}

.compact-table td {
  min-height: 44px;
  padding: 10px 12px;
  background: var(--panel);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  white-space: nowrap;
}

.compact-table td:first-child {
  border-left: 5px solid var(--white);
  border-radius: 8px 0 0 8px;
}

.compact-table td:last-child {
  width: 1%;
  border-right: 1px solid var(--line);
  border-radius: 0 8px 8px 0;
  text-align: right;
}

.compact-table tr[data-status="overdue"] td:first-child { border-left-color: var(--overdue); }
.compact-table tr[data-status="clarification"] td:first-child { border-left-color: var(--violet); }
.compact-table tr[data-status="closed"] td:first-child,
.compact-table tr[data-status="accepted"] td:first-child,
.compact-table tr[data-status="rejected"] td:first-child,
.compact-table tr[data-status="reviewed"] td:first-child { border-left-color: var(--black); }

.compact-table tr[data-status="waiting"][data-rek-review="1"] td:first-child {
  border-left-color: #d4b24f;
}

.compact-table tr[data-status="overdue"][data-rek-review="1"] td:first-child {
  border-left-color: transparent;
  background:
    linear-gradient(var(--panel), var(--panel)) padding-box,
    linear-gradient(180deg, var(--overdue), #d4b24f) border-box;
}

.compact-table strong {
  display: block;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compact-table button {
  min-height: 30px;
  padding: 0 12px;
  font-size: 13px;
}

.loading-state,
.loading-card {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.loading-state {
  min-height: 78px;
  display: grid;
  gap: 9px;
  padding: 14px 16px;
  animation: itemReveal .2s ease both;
}

.loading-state b {
  color: var(--text);
}

.loading-state span,
.loading-card span {
  display: block;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--panel-3), color-mix(in srgb, var(--panel-3) 72%, var(--text)), var(--panel-3));
  background-size: 220% 100%;
  animation: loadingShimmer 1.15s linear infinite;
}

.loading-state span:first-of-type { width: 74%; }
.loading-state span:last-of-type { width: 48%; }

.loading-card {
  min-height: 230px;
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 18px;
  border-left: 6px solid var(--white);
  animation: cardReveal .24s ease both;
  animation-delay: calc(var(--card-index, 0) * 36ms);
}

.loading-card span:nth-child(1) {
  width: 54%;
  height: 18px;
}

.loading-card span:nth-child(2) { width: 88%; }
.loading-card span:nth-child(3) { width: 76%; }
.loading-card span:nth-child(4) { width: 62%; }

@keyframes loadingShimmer {
  from { background-position: 110% 0; }
  to { background-position: -110% 0; }
}

.rek-auto-form {
  display: grid;
  gap: 10px;
  min-width: 0;
  width: min(520px, 100%);
  max-width: 100%;
}

.reks-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-bottom: 20px;
}

.reks-toolbar [data-rek-bulk-open] {
  order: 1;
}

.reks-toolbar [data-rek-auto-open] {
  order: 2;
}

.reks-toolbar [data-rek-bulk-open] b {
  font-size: 0;
}

.reks-toolbar [data-rek-bulk-open] b::before {
  content: "⇣";
  font-size: 18px;
}

.rek-auto-open b {
  font-size: 18px;
}

.rek-auto-row {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.rek-auto-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.rek-auto-row::before {
  content: "";
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-3);
  box-shadow: inset 0 0 0 1px transparent;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.rek-auto-row:has(input:checked)::before {
  border-color: rgba(var(--accent-rgb), .72);
  background: color-mix(in srgb, var(--accent) 18%, var(--panel-3));
  box-shadow: none;
}

.rek-auto-row:has(input:checked)::after {
  content: "✓";
  position: absolute;
  left: 12px;
  top: 12px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
}

.rek-auto-row:has(input:checked)::after {
  content: "";
  position: absolute;
  left: 26px;
  top: 21px;
  width: 8px;
  height: 14px;
  display: block;
  border: solid var(--text);
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

.rek-auto-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.rek-auto-row.is-taken {
  opacity: .65;
}

.rek-bulk-row {
  width: 100%;
  color: var(--text);
  text-align: left;
  box-shadow: none;
  grid-template-columns: 44px minmax(0, 1fr);
  min-height: 78px;
  padding: 14px;
  cursor: pointer;
}

.rek-bulk-row::before {
  content: "⇣";
  display: grid;
  place-items: center;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
}

.rek-bulk-row::before {
  width: 42px;
  height: 42px;
  align-self: center;
  background: var(--panel-3);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.rek-bulk-row span {
  min-width: 0;
}

.rek-bulk-row b,
.rek-bulk-row small {
  white-space: nowrap;
}

.rek-bulk-row:hover,
.rek-bulk-row:focus-visible {
  border-color: var(--red-2);
  outline: 0;
}

.rek-bulk-row.is-loading {
  opacity: .68;
  pointer-events: none;
}

#rekBulkDialog {
  width: min(520px, calc(100vw - 28px));
}

#rekBulkDialog .dialog-head,
#rekBulkDialog .rek-detail-body {
  width: 100%;
}

#rekBulkDialog .rek-detail-body {
  display: block;
}

#rekBulkDialog .edit-actions {
  display: none;
}

#rekBulkDialog #closeRekBulkDialog {
  display: none;
}

#rekBulkDialog .dialog-head {
  display: block;
}

#rekBulkDialog .dialog-head h2 {
  width: 100%;
}

@keyframes cardReveal {
  from {
    opacity: 0;
    transform: translateY(12px) scale(.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes sectionReveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes itemReveal {
  from {
    opacity: 0;
    transform: translateY(10px) scale(.992);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.view.is-entering:not(#appealsView):not(#reksView) {
  animation: sectionReveal .18s ease both;
}

#profileView.is-entering .profile-card,
#acceptedView.is-entering .accepted-toolbar,
#acceptedView.is-entering .accepted-panel,
#bonusesView.is-entering .bonuses-toolbar,
#bonusesView.is-entering .bonuses-table-card,
#bonusesView.is-entering .bonuses-requisites-card,
#compensationsView.is-entering .compensation-toolbar,
#compensationsView.is-entering .compensation-panel,
#compensationsView.is-entering .compensation-archive-panel,
#scheduleView.is-entering .schedule-toolbar,
#scheduleView.is-entering .schedule-grid,
#scheduleView.is-entering .schedule-week-wrap {
  animation: itemReveal .22s ease both;
}

#profileView.is-entering .profile-stat,
#profileView.is-entering .profile-requisites-card,
#acceptedView.is-entering .accepted-row,
#acceptedView.is-entering .accepted-edit-row,
#bonusesView.is-entering .bonuses-table tbody tr,
#compensationsView.is-entering .compensation-row,
#compensationsView.is-entering .compensation-edit-row,
#compensationsView.is-entering .compensation-archive-row,
#scheduleView.is-entering .schedule-grid-row,
#scheduleView.is-entering .schedule-week-row {
  animation: itemReveal .24s ease both;
}

#profileView.is-entering .profile-stat:nth-child(1),
#acceptedView.is-entering .accepted-panel:nth-child(1),
#bonusesView.is-entering .bonuses-table tbody tr:nth-child(1),
#compensationsView.is-entering .compensation-row:nth-child(1),
#compensationsView.is-entering .compensation-archive-row:nth-child(1),
#scheduleView.is-entering .schedule-grid-row:nth-child(1),
#scheduleView.is-entering .schedule-week-row:nth-child(1) {
  animation-delay: 20ms;
}

#profileView.is-entering .profile-stat:nth-child(2),
#acceptedView.is-entering .accepted-panel:nth-child(2),
#bonusesView.is-entering .bonuses-table tbody tr:nth-child(2),
#compensationsView.is-entering .compensation-row:nth-child(2),
#compensationsView.is-entering .compensation-archive-row:nth-child(2),
#scheduleView.is-entering .schedule-grid-row:nth-child(2),
#scheduleView.is-entering .schedule-week-row:nth-child(2) {
  animation-delay: 44ms;
}

#profileView.is-entering .profile-stat:nth-child(3),
#acceptedView.is-entering .accepted-panel:nth-child(3),
#bonusesView.is-entering .bonuses-table tbody tr:nth-child(3),
#compensationsView.is-entering .compensation-row:nth-child(3),
#compensationsView.is-entering .compensation-archive-row:nth-child(3),
#scheduleView.is-entering .schedule-grid-row:nth-child(3),
#scheduleView.is-entering .schedule-week-row:nth-child(3) {
  animation-delay: 68ms;
}

.appeal-card {
  align-self: start;
  display: grid;
  gap: 12px;
  min-height: 230px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 6px solid var(--white);
  border-radius: 8px;
  cursor: pointer;
  position: relative;
}

.appeal-card.is-new {
  animation: cardReveal .24s ease both;
  animation-delay: calc(var(--card-index, 0) * 36ms);
}

.appeal-card[data-status="overdue"] { border-left-color: var(--overdue); }
.appeal-card[data-status="clarification"] { border-left-color: var(--violet); }
.appeal-card[data-status="waiting"] { border-left-color: var(--white); }
.appeal-card[data-status="closed"] { border-left-color: var(--black); opacity: .84; }
.appeal-card[data-status="waiting"][data-rek-review="1"] { border-left-color: #d4b24f; }
.appeal-card[data-status="overdue"][data-rek-review="1"] {
  border-color: var(--line);
  border-left-color: transparent;
  background:
    linear-gradient(var(--panel), var(--panel)) padding-box,
    linear-gradient(180deg, var(--overdue), #d4b24f) border-box;
}
.rek-card[data-status="waiting"] { border-left-color: var(--white); }
.rek-card[data-status="clarification"] { border-left-color: var(--violet); }
.rek-card[data-status="accepted"],
.rek-card[data-status="rejected"],
.rek-card[data-status="reviewed"],
.rek-card[data-status="closed"] { border-left-color: var(--black); opacity: .86; }

.appeal-card h3 {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-row,
.kv {
  display: grid;
  grid-template-columns: minmax(80px, .8fr) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.card-row span:first-child,
.kv span:first-child {
  color: var(--muted);
}

.card-row span:last-child,
.kv span:last-child,
.kv a {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.status-pill {
  display: inline-block;
  padding: 4px 10px;
  background: var(--panel-3);
  border-radius: 8px;
}

.appeals-history {
  display: grid;
  gap: 0;
  padding: 0;
}

.appeals-history > .collapsible-inner {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.history-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 4px;
  align-items: center;
  min-height: 48px;
  padding: 6px 10px;
  background: var(--panel-2);
  text-align: left;
}

.history-item > b {
  display: grid;
  place-items: center;
  color: var(--white);
}

.history-text {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.history-text strong,
.history-text small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:root[data-theme="mono"] .history-text strong {
  color: var(--white);
}

.history-text small {
  display: block;
  color: var(--muted);
}

.date-picker {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 0;
  overflow: visible;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--field);
}

.date-picker:focus-within {
  border-color: var(--red-2);
}

.date-calendar {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 500;
  width: min(320px, calc(100vw - 48px));
  max-width: calc(100vw - 48px);
  padding: 14px;
  background: #494a50;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.date-calendar-head,
.date-weekdays,
.date-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  text-align: center;
}

.date-calendar-head {
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
  margin-bottom: 12px;
}

.date-calendar-head button,
.date-clear,
.date-cell {
  background: transparent;
}

.date-cell {
  min-height: 30px;
  color: var(--white);
}

.date-cell.is-muted { opacity: .45; }
.date-cell.is-selected { background: var(--panel-3); border: 1px solid var(--line); }
.date-clear { width: 100%; margin-top: 10px; background: var(--panel-2); }

:root[data-theme="mono"] .date-clear {
  color: var(--white);
}

.custom-select {
  position: relative;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.native-select-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.custom-select-toggle {
  width: 100%;
  min-height: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 14px;
  background: var(--field);
  border: 1px solid transparent;
}

.custom-select-toggle::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform .16s ease;
}

.custom-select:has(.custom-select-menu:not([hidden])) .custom-select-toggle::after {
  transform: rotate(225deg);
}

.custom-select-menu {
  position: absolute;
  z-index: 500;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 230px;
  overflow: auto;
  background: #494a50;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.custom-select-option {
  width: 100%;
  border-radius: 0;
  background: transparent;
  text-align: left;
  padding: 0 14px;
}

.custom-select-option:hover {
  background: var(--red);
}

:root[data-theme="mono"] .custom-select-option:hover {
  background: color-mix(in srgb, var(--white) 14%, transparent);
}

.custom-select-option.is-selected {
  background: transparent;
  color: var(--white);
}

.custom-select-option.is-selected::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--muted);
  vertical-align: middle;
}

.custom-select-option.is-selected:hover::before {
  background: var(--white);
}

.theme-toggle-swatch,
.theme-option-swatch {
  display: inline-flex;
  flex: none;
  border-radius: 999px;
}

.theme-option-swatch {
  width: 14px;
  height: 14px;
  margin-right: 10px;
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}

.theme-swatch-classic {
  background:
    linear-gradient(135deg, #8f0f2e 0 50%, #2a2b30 50% 100%);
}

.theme-swatch-blueberry {
  background:
    linear-gradient(135deg, #5965d8 0 50%, #252837 50% 100%);
}

.theme-swatch-mono {
  background:
    linear-gradient(135deg, #f3f3f4 0 50%, #24262b 50% 100%);
}

.theme-select .custom-select-menu {
  right: -2px;
  left: auto;
  min-width: 156px;
}

.theme-select .custom-select-option {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
}

#acceptedView,
#compensationsView,
#bonusesView {
  padding-top: 10px;
}

.profile-shell {
  max-width: 1120px;
}

.profile-card {
  display: grid;
  gap: 20px;
  padding: 22px;
  background:
    radial-gradient(circle at 12% 8%, rgba(89, 101, 216, .28), transparent 34%),
    linear-gradient(135deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.profile-hero {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
}

.profile-skin-frame {
  width: 188px;
  min-height: 188px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,.06), transparent),
    var(--panel-3);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.profile-skin-frame img {
  width: 150px;
  height: 150px;
  object-fit: cover;
  image-rendering: pixelated;
  filter: drop-shadow(0 18px 22px rgba(0,0,0,.36));
}

.profile-identity span,
.profile-requisites-card span,
.profile-stat span {
  color: var(--muted);
}

.profile-identity h2 {
  margin: 8px 0;
  font-size: clamp(28px, 4vw, 54px);
  line-height: .95;
}

.profile-identity p {
  margin: 0;
  color: var(--muted);
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
}

.profile-stat,
.profile-requisites-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  background: rgba(20, 22, 32, .54);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.profile-stat b {
  font-size: 28px;
}

.profile-rank {
  color: var(--muted);
  margin-left: 3px;
  font-style: normal;
}

.profile-stat small {
  color: var(--muted);
}

.profile-requisites-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.profile-requisites-card strong {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
}

.profile-requisites-form {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
  padding-top: 10px;
}

.profile-requisites-form[hidden] {
  display: none;
}

.profile-requisites-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
}

.profile-form-actions {
  display: flex;
  gap: 10px;
  align-items: end;
}

.profile-form-actions button {
  min-width: 84px;
}

.profile-form-actions [data-profile-edit-cancel] {
  min-width: 96px;
}

#profileRequisitesResult {
  align-self: end;
  margin: 0;
}

.accepted-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 420px));
  gap: 18px;
  justify-content: start;
  align-items: start;
}

.accepted-shell {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.accepted-toolbar {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 10px;
  margin: 5px 0 0;
  width: 160px;
  flex: 0 0 160px;
  align-self: stretch;
  min-height: 168px;
}

.accepted-toolbar button {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-inline: 12px;
}

.accepted-toolbar .admin-only {
  display: none;
}

body.is-admin .accepted-toolbar .admin-only {
  display: flex;
}

.accepted-panel > summary { position: relative; }

.accepted-edit-toggle {
  position: absolute;
  right: 7px;
  width: 30px;
  min-height: 30px;
  padding: 0;
  background: rgba(0, 0, 0, .18);
}

.accepted-edit-toggle.is-active {
  background: var(--red-2);
}

.accepted-body {
  display: grid;
  gap: 0;
  padding: 0;
}

.accepted-body > .collapsible-inner {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.accepted-table,
.accepted-editor {
  display: grid;
  gap: 8px;
}

.accepted-row,
.accepted-edit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px;
  gap: 10px;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  background: var(--panel-2);
  border-radius: 8px;
}

.accepted-row span,
.accepted-row b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.accepted-row b {
  color: var(--white);
  font-weight: 500;
  text-align: center;
}

.accepted-head,
.compensation-head {
  background: var(--panel-3);
  color: var(--muted);
}

.accepted-head b,
.compensation-head b {
  color: var(--muted);
}

.accepted-table.is-editing .accepted-head {
  grid-template-columns: minmax(0, 1fr) 90px;
}

.accepted-empty {
  margin: 0;
  padding: 12px;
  background: var(--panel-2);
  border-radius: 8px;
}

.accepted-edit-row {
  grid-template-columns: minmax(0, 1fr) 86px 34px;
  padding: 6px;
}

.accepted-edit-row input {
  min-height: 34px;
  padding: 0 9px;
}

.accepted-count-edit {
  position: relative;
  width: 100%;
}

.accepted-count-edit input[name="count"] {
  width: 100%;
  padding-right: 24px;
  -moz-appearance: textfield;
  appearance: textfield;
}

.accepted-count-edit input[name="count"]::-webkit-outer-spin-button,
.accepted-count-edit input[name="count"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.accepted-count-stepper {
  position: absolute;
  inset: 4px 4px 4px auto;
  width: 18px;
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 0;
  border-left: 1px solid color-mix(in srgb, var(--text-soft) 22%, transparent);
  z-index: 2;
}

.accepted-count-step {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  position: relative;
  box-shadow: none;
  width: 100%;
  display: grid;
  place-items: center;
}

.accepted-count-step::before {
  content: "";
  width: 6px;
  height: 6px;
  border-left: 2px solid var(--text);
  border-top: 2px solid var(--text);
  transform: translateY(1px) rotate(45deg);
  opacity: .88;
}

.accepted-count-step[data-accepted-step="down"]::before {
  transform: translateY(-1px) rotate(225deg);
}

.accepted-count-step[data-user-penalty-step="down"]::before {
  transform: translateY(-1px) rotate(225deg);
}

.accepted-count-step[data-accepted-step="up"] {
  border-bottom: 1px solid color-mix(in srgb, var(--text-soft) 18%, transparent);
}

.accepted-count-step:hover::before,
.accepted-count-step:focus-visible::before {
  border-color: var(--text);
  opacity: 1;
}

.accepted-count-step:hover,
.accepted-count-step:focus-visible {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

.accepted-count-step:focus-visible {
  outline: none;
}

.accepted-edit-row > button[data-accepted-remove],
.accepted-add-row {
  min-height: 34px;
  padding: 0;
  background: var(--panel-3);
}

.accepted-table.is-saving,
.compensation-table.is-saving {
  opacity: .78;
}

.compensation-layout {
  display: grid;
  width: min(100%, 1400px);
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  justify-content: start;
}

.compensation-columns {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) 640px;
  gap: 18px;
  align-items: start;
}

.compensation-toolbar {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) 640px;
  gap: 18px;
  align-items: start;
  margin: 0 0 18px;
}

.compensation-export {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 14px;
  background: var(--panel);
  border-radius: 8px;
  grid-template-columns: minmax(148px, 1fr) 150px 150px 150px;
  gap: 10px;
  align-items: center;
  box-shadow: var(--shadow);
  position: relative;
  z-index: 90;
}

.compensation-export div {
  display: grid;
  gap: 4px;
}

.compensation-export .export-date-picker {
  min-width: 0;
  align-self: center;
}

.compensation-export button {
  min-width: 0;
  align-self: center;
}

.compensation-archive-export {
  grid-template-columns: minmax(160px, 1fr) 150px 150px 150px;
}

.export-date-picker .date-calendar {
  top: calc(100% + 8px);
  left: 0;
}

#compensationExportToPicker .date-calendar {
  left: auto;
  right: 0;
}

.export-date-picker .field-error {
  display: none !important;
}

.export-date-picker.has-error {
  border-color: #ff6f8b;
}

.justfun-remove-form {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  padding: 18px;
  align-items: center;
  overflow: visible;
}

.justfun-remove-form .export-date-picker {
  position: relative;
  min-width: 0;
  border-color: var(--line);
  background: var(--field);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .035);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.justfun-remove-form .export-date-picker:hover,
.justfun-remove-form .export-date-picker:focus-within {
  z-index: 20;
  border-color: #62646d;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .055),
    0 0 0 2px rgba(255, 255, 255, .035);
}

.justfun-remove-form .date-picker-input {
  color: var(--text);
  font-weight: 700;
}

.justfun-remove-form .date-picker-input::placeholder {
  color: var(--muted);
  opacity: .88;
}

.justfun-remove-form .date-picker-icon {
  background: transparent;
  border-left: 1px solid var(--line);
}

.justfun-remove-form .date-picker-icon::after {
  border-color: var(--muted);
  background:
    linear-gradient(var(--muted), var(--muted)) 3px 0 / 1.5px 4px no-repeat,
    linear-gradient(var(--muted), var(--muted)) calc(100% - 4px) 0 / 1.5px 4px no-repeat;
}

.justfun-remove-form .date-calendar {
  top: calc(100% + 8px);
  left: 0;
  z-index: 3000;
}

#justFunRemoveToPicker .date-calendar {
  left: auto;
  right: 0;
}

.justfun-remove-form p {
  grid-column: 1 / -1;
  margin: 0;
}

#removeJustFunDialog {
  overflow: visible;
}

.compensation-row {
  grid-template-columns: minmax(110px, 1fr) 92px minmax(110px, 1fr) 112px;
}

.compensation-head {
  grid-template-columns: minmax(110px, 1fr) 92px minmax(110px, 1fr) 112px;
}

.compensation-table.is-editing .compensation-row,
.compensation-edit-row {
  grid-template-columns: minmax(110px, 1fr) 150px minmax(110px, 1fr) 116px 34px;
}

.compensation-amount-edit {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  gap: 0;
  min-height: 34px;
  background: var(--field);
  border: 1px solid transparent;
  border-radius: 8px;
  transition: border-color .16s ease, background .16s ease;
}

.compensation-amount-edit:focus-within {
  border-color: var(--red-2);
}

.compensation-amount-edit input {
  min-height: 34px;
  padding: 0 10px;
  background: transparent;
  border: 0;
  border-radius: 8px 0 0 8px;
}

.compensation-amount-edit input:focus {
  border-color: transparent;
}

.amount-menu-toggle {
  min-height: 34px;
  padding: 0;
  display: grid;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: 0 8px 8px 0;
  color: var(--white);
}

.amount-menu-toggle::after {
  content: "";
  width: 5px;
  height: 5px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);
  transition: transform .16s ease;
}

.amount-menu-toggle:focus-visible {
  border-color: transparent;
  outline: 0;
}

.amount-menu-toggle:has(+ .amount-menu:not([hidden]))::after {
  transform: rotate(225deg);
}

.amount-menu {
  position: absolute;
  z-index: 520;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  overflow: hidden;
  background: #494a50;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.amount-menu button {
  width: 100%;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 0;
  background: transparent;
  text-align: left;
}

:root[data-theme="mono"] .amount-menu button {
  color: var(--white);
}

.amount-menu button:hover {
  background: var(--red);
}

:root[data-theme="mono"] .amount-menu button:hover,
:root[data-theme="mono"] .role-menu button:hover {
  background: color-mix(in srgb, var(--white) 14%, transparent);
}

.bonuses-shell {
  display: grid;
  width: min(100%, 1180px);
  gap: 12px;
}

.bonuses-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 420px);
  gap: 10px;
  align-items: center;
  justify-content: start;
}

.bonuses-toolbar-main {
  display: grid;
  gap: 6px;
}

.bonuses-mode-switch {
  display: flex;
  gap: 6px;
  padding: 5px;
  background: var(--panel);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.bonuses-mode-button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 34px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  font-size: 13px;
}

.bonuses-mode-button.active {
  background: var(--red-2);
  color: var(--button-text);
}

.bonuses-period-line {
  min-height: 20px;
  color: var(--muted);
  font-size: 12px;
}

.bonuses-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
}

.bonuses-edit-toggle {
  width: 38px;
  min-height: 34px;
  padding: 0;
  background: var(--panel-3);
  color: var(--white);
}

.bonuses-edit-toggle.is-active {
  background: var(--red-2);
}

.bonuses-toolbar-actions [data-bonuses-report] {
  min-height: 34px;
  padding: 0 14px;
  font-size: 13px;
}

.bonuses-table-card {
  min-width: 0;
  padding: 10px 10px 16px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  background: var(--panel);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.bonuses-requisites-card {
  min-width: 0;
  display: grid;
  gap: 0;
  padding: 10px 10px 16px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  background: var(--panel);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.bonuses-section-head {
  display: grid;
  gap: 2px;
  padding: 2px 10px 4px;
}

.bonuses-section-head h3 {
  margin: 0;
  font-size: 16px;
}

.bonuses-table-wrap {
  width: 100%;
  min-width: 0;
}

.bonuses-table {
  width: 100%;
  min-width: 900px;
  border-collapse: separate;
  border-spacing: 0 6px;
}

.bonuses-table thead th {
  padding: 0 10px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}

.bonuses-table thead th:not(:first-child),
.bonuses-table tbody td:not(:first-child) {
  text-align: right;
}

.bonuses-table tbody td {
  min-height: 42px;
  padding: 9px 12px;
  background: var(--panel-2);
  vertical-align: middle;
}

.bonuses-table tbody tr td:first-child {
  border-radius: 10px 0 0 10px;
}

.bonuses-table tbody tr td:last-child {
  border-radius: 0 10px 10px 0;
}

.bonuses-requisites-table {
  width: 100%;
  min-width: 900px;
}

.bonuses-requisites-table thead th:not(:first-child),
.bonuses-requisites-table tbody td:not(:first-child) {
  text-align: left;
}

.bonuses-requisites-table tbody td {
  white-space: nowrap;
}

.bonuses-row.is-saving td {
  opacity: .72;
}

.bonuses-user-cell {
  display: grid;
  gap: 4px;
  min-width: 170px;
}

.bonuses-user-cell strong {
  font-size: 14px;
}

.bonuses-user-cell small {
  color: var(--muted);
}

.bonuses-total-cell {
  color: var(--white);
  font-weight: 700;
  white-space: nowrap;
}

.bonuses-edit-input {
  min-width: 120px;
  text-align: right;
}

.bonuses-empty {
  border-radius: 10px !important;
  color: var(--muted);
  text-align: center !important;
}

.empty-state,
.skeleton-card {
  padding: 18px;
  background: var(--panel);
  border-radius: 8px;
}

.appeals-grid .empty-state {
  min-height: 82px;
  display: grid;
  align-items: center;
}

dialog {
  width: min(1180px, calc(100vw - 28px));
  max-width: calc(100vw - 28px);
  max-height: calc(100vh - 28px);
  overflow-x: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(0, 0, 0, .68);
}

dialog.is-opening { animation: dialogIn .16s ease both; }
dialog.is-closing { animation: dialogOut .14s ease both; }

#templateDialog.is-closing {
  animation-duration: .2s;
  animation-timing-function: ease;
}

@keyframes dialogIn {
  from { opacity: 0; transform: translateY(10px) scale(.99); }
  to { opacity: 1; transform: none; }
}

@keyframes dialogOut {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateY(10px) scale(.99); }
}

.dialog-head {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 16px;
  align-items: center;
  padding: 14px 18px;
}

.dialog-head h2 {
  margin: 0;
  min-height: 38px;
  display: grid;
  place-items: center;
  background: var(--panel);
  border-radius: 8px;
  font-size: 16px;
  text-transform: uppercase;
}

#detailTitle,
#rekDetailTitle {
  text-transform: none;
}

.back-button {
  border: 1px solid var(--red-2);
  background: transparent;
}

:root[data-theme="mono"] .back-button {
  color: var(--white);
}

:root[data-theme="mono"] .template-text-dialog .back-button {
  color: var(--white) !important;
}

.confirm-dialog {
  width: min(440px, calc(100vw - 28px));
  border: 1px solid color-mix(in srgb, var(--red-2) 44%, var(--line));
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--panel) 88%, var(--red-2)) 0%, var(--panel-2) 78%),
    var(--panel-2);
}

.confirm-dialog::backdrop {
  background:
    radial-gradient(circle at 50% 50%, rgba(var(--accent-rgb), .18), transparent 34%),
    rgba(0, 0, 0, .72);
}

.confirm-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
}

.confirm-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--red-2) 22%, transparent);
  color: var(--white);
}

.confirm-icon svg {
  width: 24px;
  height: 24px;
}

.confirm-icon path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.confirm-content {
  display: grid;
  gap: 8px;
  align-content: start;
}

.confirm-content h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.confirm-content p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.confirm-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.confirm-actions button {
  min-width: 126px;
  padding: 0 16px;
}

.confirm-cancel {
  background: var(--panel-3);
  color: var(--text);
}

.confirm-ok {
  background: var(--red-2);
}

.rek-dialog {
  width: min(1120px, calc(100vw - 28px));
  max-width: calc(100vw - 28px);
  overflow-x: hidden;
}

#rekAutoDialog {
  width: min(560px, calc(100vw - 28px));
}

#rekAutoDialog .dialog-head {
  grid-template-columns: 150px minmax(0, 1fr);
}

#rekAutoDialog .rek-detail-body {
  display: block;
}

.rek-detail-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  padding: 8px 18px 18px;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.rek-detail-main,
.rek-detail-side {
  display: grid;
  align-content: start;
  gap: 14px;
}

.rek-detail-side .detail-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.rek-detail-side .detail-panel h3 {
  margin: 0;
  font-size: 14px;
}

.rek-detail-side .kv b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.rek-player,
.rek-video-preview,
.rek-photo-preview,
.rek-media-carousel {
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.rek-player iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}

.rek-video-preview img,
.rek-photo-preview img,
.rek-media-slide img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  display: block;
  border: 0;
  object-fit: contain;
  background: var(--panel-2);
}

.rek-media-carousel {
  position: relative;
}

.rek-media-slides,
.rek-media-slide {
  width: 100%;
  height: 100%;
}

.rek-media-slide {
  display: none;
  position: relative;
  color: var(--white);
  text-decoration: none;
}

.rek-media-slide.is-active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.rek-media-slide > span:not(.rek-media-counter) {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, .58);
  border-radius: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rek-media-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 38px;
  height: 54px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: rgba(12, 13, 18, .68);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 8px;
  color: var(--white);
  font-size: 28px;
  line-height: 1;
}

.rek-media-nav:hover,
.rek-media-nav:focus-visible {
  background: rgba(194, 11, 62, .88);
}

.rek-media-prev {
  left: 10px;
}

.rek-media-next {
  right: 10px;
}

.rek-media-counter {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 2;
  padding: 6px 9px;
  background: rgba(0, 0, 0, .58);
  border-radius: 8px;
  color: var(--white);
  font-size: 12px;
}

.rek-video-preview {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0;
  color: var(--white);
  text-decoration: none;
}

.rek-photo-preview {
  display: flex;
  align-items: center;
  justify-content: center;
}

.rek-video-preview span {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, .58);
  border-radius: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rek-no-player,
.rek-text,
.rek-attachments,
.rek-links {
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.rek-no-player {
  color: var(--muted);
}

.rek-text {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.45;
}

.rek-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rek-links {
  display: grid;
  gap: 10px;
}

.rek-links h3 {
  margin: 0;
  font-size: 14px;
}

.rek-links .rek-attachments {
  padding: 0;
  background: transparent;
  border: 0;
}

.rek-attachment-pill,
.rek-side-link {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  background: var(--panel-3);
  border-radius: 8px;
  color: var(--white);
  text-decoration: none;
  transition:
    background-color .16s ease,
    border-color .16s ease,
    box-shadow .16s ease,
    color .16s ease,
    filter .16s ease;
}

.rek-side-link {
  width: 100%;
}

.rek-side-link:hover,
.rek-side-link:focus-visible {
  filter: brightness(1.04);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .08),
    0 8px 18px rgba(0, 0, 0, .14);
  outline: 0;
}

.rek-actions {
  gap: 8px;
}

.rek-actions button {
  width: 100%;
}

.detail-layout {
  padding: 8px 18px 18px;
  display: grid;
  grid-template-columns: minmax(260px, 330px) minmax(330px, 1fr) minmax(330px, 440px);
  gap: 18px;
  align-items: start;
}

.detail-layout.detail-closed {
  grid-template-columns: minmax(260px, 330px) minmax(360px, 1fr);
}

.detail-left-stack,
.detail-stack {
  display: grid;
  gap: 14px;
}

.detail-block {
  background: var(--panel);
  border-radius: 8px;
  overflow: hidden;
}

.detail-block h3 {
  position: relative;
  min-height: 36px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 42px;
  background: var(--red);
  border-radius: 6px 6px 0 0;
  font-size: 14px;
  text-transform: uppercase;
}

:root[data-theme="mono"] .detail-block h3 {
  color: var(--black);
}

.detail-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.detail-history .detail-list,
.detail-dupe .detail-list {
  max-height: 260px;
  overflow: auto;
  scrollbar-gutter: stable both-edges;
}

.detail-note textarea {
  width: calc(100% - 24px);
  min-height: 92px;
  margin: 12px 12px 4px;
  resize: vertical;
}

.note-actions {
  min-height: 6px;
  padding: 0 12px 4px;
}

.template-grid {
  display: grid;
  gap: 10px;
  padding: 12px 12px 4px;
}

#replyText {
  min-height: 232px;
}

#replyResult {
  min-height: 0;
  margin: 0;
}

.edit-button {
  position: absolute;
  right: 7px;
  width: 30px;
  min-height: 30px;
  padding: 0;
  background: rgba(0, 0, 0, .18);
}

.editable-kv .kv-edit,
.editable-kv .custom-select {
  grid-column: 2;
}

.appeal-edit-form.is-editing .editable-kv {
  border: 1px solid transparent;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.appeal-edit-form.is-editing .editable-kv:focus-within {
  background: linear-gradient(90deg, rgba(var(--accent-rgb), .18), var(--panel-2) 42%);
  border-color: rgba(var(--accent-rgb), .55);
  box-shadow: inset 3px 0 0 var(--red-2);
}

.appeal-edit-form.is-editing .editable-kv input,
.appeal-edit-form.is-editing .editable-kv .custom-select-toggle {
  padding: 0 8px;
  border-color: transparent;
  border-radius: 6px;
}

.appeal-edit-form.is-editing .editable-kv input:focus,
.appeal-edit-form.is-editing .editable-kv .custom-select-toggle:focus {
  border-color: transparent;
  background: rgba(255, 255, 255, .025);
  box-shadow: none;
}

.appeal-edit-form:not(.is-editing) .kv-edit,
.appeal-edit-form:not(.is-editing) .custom-select,
.appeal-edit-form:not(.is-editing) .kv-edit-control {
  display: none;
}

.appeal-edit-form.is-editing .kv-view {
  display: none;
}

.edit-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.edit-actions[hidden] { display: none; }

.punishment-card,
.dupe-account {
  background: var(--panel-2);
  border-radius: 8px;
  overflow: hidden;
}

.punishment-card summary,
.dupe-account summary {
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 0 12px;
  cursor: pointer;
}

.punishment-card summary::-webkit-details-marker,
.dupe-account summary::-webkit-details-marker {
  display: none;
}

.punishment-card summary::before,
.dupe-account summary::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-right: 1px solid var(--red-2);
  border-bottom: 1px solid var(--red-2);
  transform-origin: center;
  transform: rotate(-45deg);
  transition: transform .16s ease;
}

.punishment-card[open] > summary::before,
.dupe-account[open] > summary::before {
  transform: rotate(45deg);
}

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

.info-cell {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: var(--panel-3);
  border-radius: 8px;
}

.info-cell span {
  color: var(--muted);
}

.template-dialog {
  width: min(1060px, calc(100vw - 28px));
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
}

.template-board,
.template-board-edit {
  min-width: min-content;
  padding: 8px 20px 20px;
  display: grid;
  gap: 10px;
}

.template-board-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  grid-auto-columns: auto;
  gap: 12px;
  align-items: center;
  background: var(--panel);
  border-radius: 8px;
  min-height: 36px;
  padding: 6px 12px;
}

.template-scope-tabs {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 6px;
}

.template-status-tabs {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 6px;
  min-width: 0;
}

.template-scope-tab {
  min-height: 28px;
  padding: 0 12px;
  background: var(--panel-3);
  color: var(--muted);
}

.template-status-tab {
  min-height: 28px;
  padding: 0 12px;
  background: var(--panel-3);
  color: var(--muted);
  white-space: nowrap;
}

.template-scope-tab.is-active {
  background: var(--red);
  color: var(--button-text);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}

.template-status-tab.is-active {
  background: var(--red);
  color: var(--button-text);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}

.template-groups,
.template-edit-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 14px;
  align-items: start;
}

.template-groups-4,
.template-groups-5,
.template-groups-6,
.template-groups-7,
.template-groups-8 {
  display: block;
  column-count: 3;
  column-gap: 14px;
}

.template-groups-4 .template-group,
.template-groups-5 .template-group,
.template-groups-6 .template-group,
.template-groups-7 .template-group,
.template-groups-8 .template-group {
  width: 100%;
  margin: 0 0 14px;
  break-inside: avoid;
}

.template-group,
.template-edit-group {
  align-self: start;
  display: grid;
  align-content: start;
  gap: 8px;
  background: var(--panel);
  border-radius: 8px;
  padding: 10px;
}

.template-group header,
.template-edit-group header {
  min-height: 34px;
  display: grid;
  place-items: center;
  background: var(--red);
  border-radius: 8px;
  font-weight: 700;
}

:root[data-theme="mono"] .template-group header,
:root[data-theme="mono"] .template-edit-group header,
:root[data-theme="mono"] .template-edit-group header input {
  color: var(--black);
}

.template-list,
.template-editor-list {
  display: grid;
  align-content: start;
  gap: 7px;
  max-height: 360px;
  overflow: auto;
}

.template-item,
.template-editor-row {
  min-height: 36px;
  display: grid;
  align-items: center;
  gap: 8px;
  background: var(--panel-3);
  border-radius: 8px;
  padding: 0 10px;
  transition:
    transform .14s ease,
    box-shadow .14s ease,
    background-color .14s ease,
    opacity .14s ease;
}

:root[data-theme="mono"] .template-item,
:root[data-theme="mono"] .template-editor-row input,
:root[data-theme="mono"] .template-add-choice button:first-child {
  color: var(--white);
}

:root[data-theme="mono"] .template-drag-handle,
:root[data-theme="mono"] .template-row-remove,
:root[data-theme="mono"] .template-add {
  color: var(--white);
}

.template-editor-row {
  grid-template-columns: 28px minmax(0, 1fr) 30px 30px;
}

.template-drag-handle,
.template-row-edit,
.template-row-remove,
.template-global-edit {
  min-height: 30px;
  width: 30px;
  padding: 0;
  background: rgba(0, 0, 0, .18);
  transition:
    background-color .14s ease,
    color .14s ease,
    box-shadow .14s ease,
    transform .14s ease;
}

.template-drag-handle {
  cursor: grab;
}

.template-drag-handle:hover {
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  color: var(--text);
}

.template-drag-handle:active {
  cursor: grabbing;
}

.template-editor-list .template-editor-row.is-dragging {
  opacity: .9;
  transform: translateY(-1px);
  background: color-mix(in srgb, var(--panel) 72%, var(--panel-3));
  box-shadow:
    0 12px 24px rgba(0, 0, 0, .22),
    0 0 0 1px color-mix(in srgb, var(--red-2) 34%, transparent);
}

.template-editor-list:has(.template-editor-row.is-dragging) .template-editor-row:not(.is-dragging) {
  opacity: .92;
}

.template-editor-list:has(.template-editor-row.is-dragging) .template-editor-row:not(.is-dragging):hover {
  transform: translateX(2px);
}

.template-editor-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.create-dialog {
  width: min(470px, calc(100vw - 28px));
}

.appeal-create-form {
  display: grid;
  gap: 10px;
  padding: 4px 24px 18px;
}

.appeal-create-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
}

.appeal-create-form > input,
.appeal-create-form .custom-select-toggle,
.appeal-create-form select,
.appeal-create-form .manual-datetime-input {
  min-height: 46px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.appeal-create-form > input:focus,
.appeal-create-form .manual-datetime-input:focus {
  border-color: rgba(var(--accent-rgb), .75);
  box-shadow: inset 3px 0 0 var(--red-2);
}

.appeal-create-form > input.has-error,
.appeal-create-form .manual-datetime.has-error .manual-datetime-input {
  border-color: #ff6f8b;
  box-shadow: inset 3px 0 0 #ff6f8b;
}

.appeal-create-form .datetime-field {
  gap: 9px;
  padding: 10px 12px 12px;
  background: rgba(34, 35, 41, .54);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.users-list,
.user-form {
  display: grid;
  gap: 12px;
  width: min(980px, 100%);
}

.user-create-panel {
  width: min(980px, 100%);
  margin: 0 0 18px;
  padding: 14px 16px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.user-create-panel h2 {
  margin: 0 0 12px;
  min-height: 34px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: var(--panel-3);
  border-radius: 8px;
  font-size: 14px;
  text-transform: uppercase;
}

.user-form {
  grid-template-columns: 190px 190px minmax(190px, 1fr) 148px 144px;
  margin-bottom: 0;
}

.user-form > button[type="submit"] {
  width: 100%;
}

.schedule-table-wrap {
  width: min(1080px, 100%);
  max-width: 100%;
  min-width: 0;
  display: grid;
  gap: 12px;
}

#scheduleView {
  margin-top: -55px;
}

.schedule-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.schedule-mode-switch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.schedule-mode-button {
  min-width: 138px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.schedule-mode-button.active {
  background: var(--red-2);
  color: var(--button-text);
}

.schedule-grid {
  width: 100%;
  max-width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.schedule-grid-head,
.schedule-grid-row {
  display: grid;
  grid-template-columns: minmax(138px, 1fr) 63px 92px;
  align-items: center;
}

.schedule-grid-head {
  padding: 12px 16px;
  background: var(--panel-3);
  font-size: 13px;
  text-transform: uppercase;
}

.schedule-grid-head span:nth-child(2),
.schedule-grid-head span:nth-child(3) {
  text-align: center;
}

.schedule-grid-row {
  padding: 10px 16px;
  border-top: 1px solid rgba(255, 255, 255, .04);
}

.schedule-day-label {
  font-weight: 700;
}

.schedule-shift-cell {
  justify-self: center;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.schedule-shift-cell input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.schedule-shift-cell span {
  width: 16px;
  height: 16px;
  border: 1px solid var(--text);
  border-radius: 4px;
  background: transparent;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.schedule-shift-cell:hover {
  border-color: rgba(var(--accent-rgb), .72);
}

.schedule-shift-cell input:checked + span {
  background: var(--red-2);
  border-color: var(--red-2);
  box-shadow: inset 0 0 0 3px var(--panel-2);
}

.schedule-shift-cell input:disabled + span {
  opacity: .55;
}

.schedule-week-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow-x: auto;
}

.schedule-week-table {
  width: 100%;
  min-width: 1020px;
  border-collapse: collapse;
  table-layout: fixed;
}

.schedule-week-table thead th {
  padding: 12px 8px;
  background: var(--panel-3);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.schedule-week-table thead tr:last-child th {
  padding-top: 10px;
  padding-bottom: 10px;
  font-size: 11px;
  color: var(--muted);
}

.schedule-week-user-head,
.schedule-week-user {
  width: 172px;
  padding-left: 16px !important;
  text-align: left;
}

.schedule-week-user-head {
  display: table-cell;
  vertical-align: middle;
}

.schedule-toolbar-edit,
.schedule-toolbar-filter {
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.schedule-toolbar-filter svg {
  width: 18px;
  height: 18px;
}

.schedule-toolbar-filter svg circle,
.schedule-toolbar-filter svg path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.schedule-toolbar-edit.active,
.schedule-toolbar-filter.active {
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .55);
}

.schedule-week-row {
  border-top: 1px solid rgba(255, 255, 255, .04);
}

.schedule-week-row.is-current-user {
  background: rgba(var(--accent-rgb), .035);
}

.schedule-week-user {
  padding: 12px 16px !important;
  font-weight: 700;
}

.schedule-week-cell {
  padding: 12px 8px;
  text-align: center;
}

.schedule-empty-slot {
  display: inline-block;
  width: 40px;
  height: 40px;
}

.schedule-assigned-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
}

.schedule-assigned-badge.is-owned {
  border-color: rgba(var(--accent-rgb), .34);
}

.schedule-assigned-badge.is-check,
.schedule-assigned-badge.is-cross {
  border-color: rgba(var(--accent-rgb), .34);
}

.schedule-mark-editor {
  width: 40px;
  margin: 0 auto;
  display: block;
}

.schedule-mark-number {
  width: 100%;
  min-height: 40px;
  padding: 0 6px;
  font-size: 14px;
  text-align: center;
  border-radius: 8px;
}

.schedule-mark-number {
  appearance: textfield;
  -moz-appearance: textfield;
}

.schedule-mark-number::-webkit-outer-spin-button,
.schedule-mark-number::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.schedule-claim,
.schedule-unclaim {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
}

.schedule-unclaim {
  border-color: rgba(var(--accent-rgb), .34);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), .08);
}

.schedule-claim span {
  width: 16px;
  height: 16px;
  border: 1px solid var(--text);
  border-radius: 4px;
}

.schedule-claim:hover,
.schedule-unclaim:hover {
  border-color: rgba(var(--accent-rgb), .72);
}

.schedule-unclaim {
  font-size: 22px;
  line-height: 1;
}

.role-picker {
  position: relative;
}

.role-menu {
  position: absolute;
  z-index: 80;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #494a50;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.role-menu button {
  width: 100%;
  border-radius: 0;
  background: transparent;
  text-align: left;
  padding: 0 14px;
}

.role-menu button:hover {
  background: var(--red);
}

.user-item {
  display: grid;
  grid-template-columns: minmax(150px, 1.2fr) 120px minmax(180px, 1fr) minmax(120px, .7fr) 180px;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  background: var(--panel-2);
  border-radius: 8px;
}

.user-vk {
  color: var(--muted);
  font-size: 12px;
}

.user-penalties {
  display: inline-grid;
  grid-template-columns: auto minmax(18px, auto) auto minmax(18px, auto);
  align-items: center;
  justify-content: start;
  gap: 6px 10px;
  min-width: 0;
  padding: 0 8px;
  color: var(--text);
}

.user-penalties span,
.user-penalty-field span {
  color: var(--muted);
  font-size: 12px;
}

.user-penalties b {
  color: var(--text);
  text-align: center;
}

.user-penalty-field {
  display: grid;
  grid-template-rows: 14px 40px;
  gap: 5px;
}

.user-penalty-number {
  position: relative;
  display: block;
}

.user-penalty-number input {
  width: 100%;
  min-height: 40px;
  padding-right: 28px;
  -moz-appearance: textfield;
  appearance: textfield;
}

.user-penalty-number input::-webkit-outer-spin-button,
.user-penalty-number input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.user-penalty-number .accepted-count-stepper {
  inset: 5px 5px 5px auto;
}

.user-actions {
  display: grid;
  grid-template-columns: 38px 130px;
  gap: 8px;
  align-items: center;
  justify-content: end;
}

.icon-action,
.icon-action-placeholder {
  width: 38px;
  min-height: 38px;
  padding: 0;
}

.icon-action-placeholder {
  display: block;
}

.user-actions .muted {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  white-space: nowrap;
}

.user-edit-form {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 110px 150px 136px 136px 188px;
  gap: 8px;
  align-items: start;
}

.user-edit-field,
.user-edit-form > .user-penalty-field {
  align-self: start;
}

.user-edit-field {
  display: grid;
  gap: 6px;
}

.user-edit-field > span {
  font-size: 12px;
  color: var(--muted);
}

.user-edit-field > input,
.user-edit-field > .custom-select,
.user-edit-field > .role-static {
  width: 100%;
}

.user-edit-actions {
  grid-column: 6;
  align-self: end;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.user-edit-actions > button {
  width: 100%;
}

.user-edit-form[hidden] { display: none; }

.role-static {
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  background: var(--field);
  border-radius: 8px;
  color: var(--text);
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 30px;
  background: var(--bg);
}

.login-shell {
  width: min(420px, 100%);
  display: grid;
  grid-template-columns: 1fr;
}

.login-panel {
  min-height: 0;
  background: var(--panel);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.login-visual-head {
  height: 48px;
  display: flex;
  align-items: center;
  padding: 0 18px;
  background: var(--red);
  font-weight: 700;
}

.login-visual-body {
  position: relative;
  min-height: 482px;
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  align-items: center;
  gap: 26px;
  padding: 34px 26px;
  background:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px),
    var(--panel-2);
  background-size: 32px 32px;
}

.login-skin {
  width: 190px;
  image-rendering: pixelated;
  filter: drop-shadow(0 18px 22px rgba(0, 0, 0, .35));
  justify-self: center;
}

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

.login-metrics div {
  min-height: 56px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: rgba(24, 25, 29, .82);
  border-radius: 8px;
}

.login-metrics span { color: var(--muted); }
.login-metrics b { text-align: right; }

.login-panel {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 42px 34px 28px;
}

.login-panel h1 {
  margin: 8px 0 -4px;
  font-size: 28px;
}

.login-panel .muted {
  margin: 0 0 10px;
}

.login-form {
  display: grid;
  gap: 13px;
}

.login-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.login-form button {
  margin-top: 8px;
  min-height: 46px;
}

.error {
  min-height: 20px;
  margin: 0;
  color: #ff7e98;
}

.workspace:has(#appealsView.active) {
  padding-top: 84px;
}

.workspace:has(#acceptedView.active),
.workspace:has(#bonusesView.active),
.workspace:has(#compensationsView.active),
.workspace:has(#profileView.active),
.workspace:has(#reksView.active),
.workspace:has(#usersView.active),
.workspace:has(#scheduleView.active) {
  padding-top: 84px;
}

#profileView > h1,
#usersView > h1 {
  display: none;
}

.appeals-toolbar {
  margin: -32px 0 12px;
}

.appeals-layout,
.reks-layout {
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 22px;
}

.filter-title {
  width: 100%;
  border-radius: 6px 6px 0 0;
}

.filter-title button,
.filter-title .accepted-edit-toggle {
  text-transform: none;
}

.collapsible-panel.is-animating .collapsible-body {
  display: grid;
  overflow: hidden;
  transition:
    grid-template-rows .22s ease,
    height .22s ease,
    opacity .18s ease;
}

.collapsible-panel.is-animating.is-closing .collapsible-body {
  transition:
    height .18s ease,
    opacity .12s ease .03s;
}

.collapsible-panel.is-animating .collapsible-inner {
  overflow: hidden;
}

.date-picker-input {
  border-radius: 8px 0 0 8px;
  border-right: 0;
}

.date-picker > .date-picker-input {
  border: 0;
  background: transparent;
}

.date-picker-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--accent-text);
  border-radius: 0 8px 8px 0;
  min-height: 40px;
  padding: 0;
  border: 0;
}

.date-picker-icon::after {
  content: "";
  width: 15px;
  height: 14px;
  box-sizing: border-box;
  border: 1.5px solid var(--muted);
  border-radius: 3px;
  background:
    linear-gradient(var(--muted), var(--muted)) 3px 0 / 1.5px 4px no-repeat,
    linear-gradient(var(--muted), var(--muted)) calc(100% - 4px) 0 / 1.5px 4px no-repeat;
  transition: border-color .16s ease, transform .16s ease, background .16s ease;
}

.date-picker:hover .date-picker-icon::after,
.date-picker:focus-within .date-picker-icon::after {
  border-color: var(--white);
  background:
    linear-gradient(var(--white), var(--white)) 3px 0 / 1.5px 4px no-repeat,
    linear-gradient(var(--white), var(--white)) calc(100% - 4px) 0 / 1.5px 4px no-repeat;
}

.date-picker-icon:focus-visible {
  border-color: transparent;
  outline: 0;
}

.date-calendar {
  width: min(300px, calc(100vw - 48px));
  padding: 14px 16px;
  background: #4a4b51;
}

#reksView .date-calendar {
  width: min(300px, 100%);
  max-width: 100%;
}

.date-weekdays {
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 700;
}

.date-calendar-head b {
  font-size: 14px;
}

.date-cell {
  min-height: 30px;
  border: 1px solid transparent;
  border-radius: 8px;
}

.date-cell:hover,
.date-cell.is-selected {
  background: var(--panel-3);
  border-color: var(--line);
}

.appeal-stats {
  grid-template-columns: repeat(4, minmax(170px, 1fr));
}

.appeals-grid {
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}

.appeal-card {
  min-height: 230px;
  padding: 18px 20px;
}

.card-row {
  grid-template-columns: 110px minmax(0, 1fr);
}

.accepted-layout {
  grid-template-columns: repeat(3, 420px);
  gap: 18px;
}

.accepted-panel {
  min-width: 0;
  align-self: start;
}

.accepted-panel > .filter-title {
  padding-right: 52px;
}

.accepted-panel > .filter-title::after {
  right: 48px;
}

.accepted-edit-toggle {
  top: 4px;
  right: 7px;
  display: grid;
  place-items: center;
}

.accepted-row,
.accepted-edit-row {
  grid-template-columns: minmax(0, 1fr) 90px;
}

.accepted-table.is-editing .accepted-edit-row {
  grid-template-columns: minmax(0, 1fr) 90px 34px;
}

.accepted-table.is-editing .accepted-head {
  grid-template-columns: minmax(0, 1fr) 90px;
}

.compensation-row,
.compensation-head {
  grid-template-columns: minmax(96px, .92fr) 146px minmax(108px, 1fr) 112px;
}

.compensation-table.is-editing .compensation-row,
.compensation-table.is-editing .compensation-head,
.compensation-edit-row {
  grid-template-columns: minmax(96px, .92fr) 146px minmax(108px, 1fr) 112px 34px;
}

.accepted-edit-row button[data-accepted-remove],
.compensation-edit-row button[data-compensation-remove] {
  display: grid;
  place-items: center;
  width: 34px;
}

:root[data-theme="mono"] .accepted-add-row,
:root[data-theme="mono"] .accepted-edit-row button[data-accepted-remove],
:root[data-theme="mono"] .compensation-edit-row button[data-compensation-remove] {
  color: var(--white);
}

:root[data-theme="mono"] .compensation-edit-row button[data-compensation-remove] {
  color: var(--black);
}

.accepted-row span,
.accepted-row b {
  color: var(--text);
}

.accepted-head span,
.accepted-head b,
.compensation-head span,
.compensation-head b {
  color: var(--muted);
  font-weight: 500;
}

.compensation-layout {
  width: 100%;
  max-width: none;
  grid-template-columns: minmax(0, 1fr);
}

.compensation-columns {
  width: 100%;
  grid-template-columns: minmax(0, 1fr) 760px;
}

.compensation-toolbar {
  width: 100%;
  grid-template-columns: minmax(0, 1fr) 760px;
}

.compensation-export {
  display: grid;
  width: 100%;
  max-width: none;
}

.compensation-archive-export {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(148px, 1fr) 150px 150px 150px;
  gap: 10px;
  align-items: center;
}

.compensation-toolbar.admin-only {
  display: none;
}

body.is-admin .compensation-toolbar.admin-only {
  display: grid;
}

.compensation-panel {
  width: 100%;
}

.compensation-archive-panel {
  width: 100%;
  min-width: 0;
}

.compensation-archive-table {
  display: grid;
  gap: 10px;
}

.compensation-archive-row {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding-right: 2px;
  min-height: 54px;
  padding-block: 4px;
}

.compensation-archive-row span {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.compensation-archive-row strong {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compensation-archive-row small {
  color: var(--muted);
  font-size: 12px;
}

.compensation-archive-row button {
  width: auto;
  min-width: 150px;
  min-height: 38px;
  padding-inline: 18px;
  justify-self: end;
  align-self: center;
  margin-right: 8px;
}

.create-dialog {
  width: min(468px, calc(100vw - 28px));
}

.create-dialog .dialog-head {
  padding-bottom: 4px;
}

.appeal-create-form {
  gap: 10px;
  padding: 12px 22px 10px;
}

.appeal-create-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 6px;
}

.appeal-create-actions > button {
  width: 100%;
  min-height: 38px;
}

.datetime-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px 118px;
  gap: 8px;
}

.manual-datetime {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
}

.datetime-picker .date-calendar {
  grid-column: 1 / -1;
}

.datetime-picker .date-picker-input {
  border-radius: 8px;
  border-right: 1px solid transparent;
}

.manual-datetime .date-picker-input {
  border-radius: 8px;
  border-right: 1px solid transparent;
}

.manual-datetime-input {
  border-radius: 8px;
}

.manual-datetime.has-error .manual-datetime-input {
  border-color: #ff6f8b;
  box-shadow: inset 3px 0 0 #ff6f8b;
}

.field-error {
  min-height: 26px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(176, 16, 57, .16);
  border: 1px solid rgba(255, 111, 139, .34);
  border-radius: 8px;
  color: #ff9daf;
  font-size: 12px;
}

.field-error::before {
  content: "!";
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--red-2);
  border-radius: 5px;
  color: var(--white);
  font-weight: 700;
  line-height: 1;
}

:root[data-theme="mono"] .field-error::before {
  color: var(--black);
}

.field-error[hidden] {
  display: none;
}

.datetime-picker .date-picker-icon {
  border-radius: 8px;
}

.datetime-time {
  min-height: 40px;
}

#appealDialog {
  width: min(1220px, calc(100vw - 26px));
  overflow-x: hidden;
}

#appealDialog.is-closed-appeal {
  width: min(910px, calc(100vw - 26px));
}

.detail-layout {
  grid-template-columns: 330px minmax(360px, 1fr) 440px;
  gap: 16px;
  max-width: 100%;
  overflow-x: hidden;
}

.detail-layout.detail-closed {
  grid-template-columns: 330px minmax(360px, 530px);
  max-width: 100%;
}

.detail-block {
  border-radius: 8px;
  min-width: 0;
}

.detail-block h3 {
  min-height: 34px;
}

.detail-list {
  gap: 7px;
  padding: 10px;
}

.kv {
  min-height: 34px;
  padding: 0 10px;
  background: var(--panel-2);
  border-radius: 8px;
  grid-template-columns: 120px minmax(0, 1fr);
  min-width: 0;
}

.kv input,
.kv .custom-select-toggle {
  min-height: 34px;
  padding: 0;
  background: transparent;
  border-radius: 0;
}

.kv a,
.kv-view a {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
  transition: color .15s ease;
}

.kv a:hover,
.kv-view a:hover {
  color: var(--red-2);
  background: rgba(var(--accent-rgb), .12);
}

.detail-history .detail-list,
.detail-dupe .detail-list {
  max-height: 250px;
  padding: 8px 8px 4px;
}

.punishment-card summary,
.dupe-account summary {
  grid-template-columns: 16px minmax(0, 1fr) auto;
}

.punishment-card summary::before,
.dupe-account summary::before {
  grid-column: 1;
}

.punishment-card summary span,
.dupe-account summary span {
  grid-column: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.punishment-card summary b,
.dupe-account summary b {
  grid-column: 3;
}

.detail-control textarea,
#replyText {
  min-height: 232px;
  margin-bottom: 0;
  resize: vertical;
}

.reply-status-row {
  display: grid;
  grid-template-columns: minmax(180px, 340px) 40px 40px;
  gap: 10px;
  align-items: center;
  justify-content: start;
  min-width: 0;
}

.reply-no-rek-button,
.reply-vk-chat-button {
  width: 40px;
  min-height: 40px;
  display: grid;
  place-items: center;
  background: var(--red-2);
  border: 1px solid var(--red-2);
  border-radius: 8px;
  cursor: pointer;
  color: var(--button-text);
  font-weight: 900;
  padding: 0;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.reply-vk-chat-button {
  background: var(--red-2);
  border-color: var(--red-2);
}

.reply-vk-chat-button svg {
  width: 19px;
  height: 19px;
}

.reply-vk-chat-button path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.reply-no-rek-button:hover,
.reply-vk-chat-button:hover {
  background: var(--red-2);
  border-color: var(--red-2);
  transform: translateY(-1px);
}

:root[data-theme="mono"] .reply-no-rek-button:hover,
:root[data-theme="mono"] .reply-vk-chat-button:hover {
  background: var(--white);
  border-color: var(--white);
  color: var(--black);
}

.template-dialog {
  width: min(1120px, calc(100vw - 28px));
  max-height: calc(100vh - 20px);
}

#templateDialog .dialog-head {
  position: relative;
  min-height: 66px;
}

#templateDialog .dialog-head h2 {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  box-sizing: border-box;
  width: min(360px, calc(100% - 260px));
  padding: 0 18px;
}

.template-board {
  padding: 8px 20px 20px;
}

.template-board-head {
  grid-template-columns: minmax(0, 1fr);
  min-height: 34px;
  padding: 5px 12px;
}

.template-edit-groups {
  grid-template-columns: repeat(4, minmax(220px, 1fr));
}

.template-list,
.template-editor-list {
  max-height: 430px;
}

.template-edit-group header {
  padding: 4px;
}

.template-edit-group header input {
  min-height: 30px;
  background: transparent;
  text-align: center;
  font-weight: 700;
}

.template-editor-row {
  grid-template-columns: 28px minmax(0, 1fr) 30px 30px;
  padding: 5px;
}

.template-editor-row input {
  min-height: 30px;
  padding: 0 8px;
  background: transparent;
}

.template-add {
  min-height: 34px;
  background: var(--panel-3);
}

.template-add-menu {
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
  padding: 8px;
  background: var(--panel-2);
  border-radius: 8px;
}

.template-add-create {
  width: 100%;
}

.template-add-choice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  gap: 6px;
}

.template-add-choice button {
  min-height: 32px;
  background: var(--panel-3);
  text-align: left;
  padding: 0 10px;
}

.template-add-choice button:last-child {
  display: grid;
  place-items: center;
  padding: 0;
  background: var(--red);
  text-align: center;
}

.template-text-dialog {
  width: min(720px, calc(100vw - 28px));
}

.template-text-form {
  display: grid;
  gap: 12px;
  padding: 16px 22px 22px;
}

.template-text-form textarea {
  min-height: 330px;
  padding: 16px;
  background: var(--field);
  border: 1px solid #62646d;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04);
  resize: none;
}

.template-text-form textarea:focus {
  border-color: var(--red-2);
}

@media (prefers-reduced-motion: reduce) {
  .view.is-entering:not(#appealsView):not(#reksView),
  #profileView.is-entering .profile-card,
  #acceptedView.is-entering .accepted-toolbar,
  #acceptedView.is-entering .accepted-panel,
  #bonusesView.is-entering .bonuses-toolbar,
  #bonusesView.is-entering .bonuses-table-card,
  #compensationsView.is-entering .compensation-toolbar,
  #compensationsView.is-entering .compensation-panel,
  #compensationsView.is-entering .compensation-archive-panel,
  #scheduleView.is-entering .schedule-toolbar,
  #scheduleView.is-entering .schedule-grid,
  #scheduleView.is-entering .schedule-week-wrap,
  #profileView.is-entering .profile-stat,
  #profileView.is-entering .profile-requisites-card,
  #acceptedView.is-entering .accepted-row,
  #acceptedView.is-entering .accepted-edit-row,
  #bonusesView.is-entering .bonuses-table tbody tr,
  #compensationsView.is-entering .compensation-row,
  #compensationsView.is-entering .compensation-edit-row,
  #compensationsView.is-entering .compensation-archive-row,
  #scheduleView.is-entering .schedule-grid-row,
  #scheduleView.is-entering .schedule-week-row,
  .loading-state,
  .loading-card,
  .loading-state span,
  .loading-card span {
    animation: none;
  }
}

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

  .login-visual {
    min-height: 360px;
  }

  .login-visual-body {
    min-height: 312px;
  }
}

@media (max-width: 900px) {
  .app-header { padding: 0 14px; }
  .header-actions { right: 14px; }
  .sidebar {
    position: static;
    width: auto;
    padding: 70px 14px 0;
  }
  .sidebar-panel {
    padding: 10px;
  }
  .sidebar-nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
  }
  .nav-item {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 4px;
    font-size: 12px;
  }
  .workspace { padding: 18px 14px 28px; }
  .view-heading { margin: 10px 0 16px; }
  .heading-action {
    margin-left: 0;
  }
  .appeals-toolbar { justify-content: stretch; margin: 0 0 14px; }
  .create-appeal-open { width: 100%; }
  .appeals-layout,
  .reks-layout,
  .detail-layout,
  .rek-detail-body,
  .detail-layout.detail-closed,
  .template-grid,
  .user-form,
  .user-item,
  .user-edit-form,
  .punishment-grid {
    grid-template-columns: 1fr;
  }
  .appeal-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .accepted-layout,
  .compensation-layout,
  .bonuses-shell {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .schedule-grid-head,
  .schedule-grid-row {
    grid-template-columns: minmax(130px, 1fr) 90px 90px;
  }
  #scheduleView {
    margin-top: -12px;
  }
  .schedule-toolbar {
    justify-content: flex-start;
  }
  .schedule-mode-switch {
    width: 100%;
  }
  .schedule-mode-button {
    flex: 1 1 0;
    min-width: 0;
  }
  .schedule-week-table {
    min-width: 820px;
  }
  .schedule-week-user-head,
  .schedule-week-user {
    width: 136px;
  }
  .accepted-shell {
    flex-direction: column;
  }
  .accepted-toolbar {
    width: 100%;
    flex: none;
    min-height: 0;
    align-self: auto;
    justify-content: flex-start;
    gap: 10px;
    margin-top: 0;
  }
  .compensation-toolbar,
  .compensation-columns {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .bonuses-toolbar,
  .bonuses-toolbar-main {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .bonuses-toolbar-actions {
    justify-content: flex-start;
  }
  .bonuses-toolbar-actions [data-bonuses-report] {
    flex: 1 1 auto;
  }
  .bonuses-mode-switch {
    width: 100%;
  }
  .bonuses-mode-button {
    flex: 1 1 0;
    min-width: 0;
  }
  .bonuses-table {
    width: 900px;
    min-width: 900px;
  }
  .bonuses-requisites-table {
    width: 900px;
    min-width: 900px;
  }
  .profile-hero,
  .profile-stats,
  .profile-requisites-card,
  .profile-requisites-form {
    grid-template-columns: 1fr;
  }
  .profile-skin-frame {
    min-height: 210px;
  }
  .compensation-export {
    grid-template-columns: 1fr;
    max-width: none;
  }
  .justfun-remove-form {
    grid-template-columns: 1fr;
  }
  .compensation-row,
  .compensation-table.is-editing .compensation-row,
  .compensation-edit-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .template-groups,
  .template-edit-groups {
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    min-width: 760px;
  }
  .template-board,
  .template-board-edit {
    min-width: 800px;
  }
  .dialog-head {
    grid-template-columns: 1fr;
  }
}
