/*
 * Hemafund back office: the one small stylesheet on top of Unfold (DESIGN.md section 1).
 *
 * Unfold's settings carry the colour scales, the 4px radius and the light theme; this file adds
 * what settings cannot: Manrope instead of Inter (faces in fonts.css), flat surfaces (no shadows),
 * the line colour, sentence-case 13px table headers, 2px status labels and buttons, tabular
 * figures, serif page titles and Case ID, text tabs with a carmine underline, and the staff
 * sign-in page (design 01). Tokens: DESIGN.md frontmatter.
 *
 * Sections: 1 tokens and type, 2 shell (sidebar, header, page), 3 tabs, 4 lists, 5 forms and
 * buttons, 6 labels, 7 case pages, 8 sign-in pages.
 */

@import url("fonts.7fe2773c9e01.css");
@import url("case-work.eae0b97f0178.css"); /* the case-work screens: dashboard, conversation, payment, emails */

/* 1. Tokens and type ------------------------------------------------------------------------ */

:root {
  --font-hemafund-ui: "Manrope", Arial, sans-serif;
  --font-hemafund-title: "Source Serif 4", Georgia, serif;
  --hf-ink: var(--color-base-900);            /* #2B2D33 */
  --hf-ink-secondary: var(--color-base-700);  /* #5F6167 */
  --hf-line: var(--color-base-300);           /* #D8D6D2 */
  --hf-line-strong: var(--color-base-600);    /* #6B6D73 */
  --hf-surface-1: var(--color-base-100);      /* #F0EFED */
  --hf-page: var(--color-base-50);            /* #F7F6F5 */
  --hf-brand: var(--color-primary-600);       /* #B4363F */
  --hf-brand-pressed: var(--color-primary-700);
  --hf-brand-tint: var(--color-primary-100);  /* #F6E8E7 */
  --hf-error: #8c2a32;
}

/* Manrope replaces Unfold's Inter everywhere; Material Symbols keep their own font. */
html,
body,
button,
input,
select,
textarea {
  font-family: var(--font-hemafund-ui);
}

body {
  color: var(--hf-ink);
  font-size: 14px;
  line-height: 1.5;
}

/* Icons at weight 300 (DESIGN.md frontmatter): the face in fonts.css is the weight-300 instance;
   the optical size follows the icon's size, as in the mockups (no fixed opsz). */
.material-symbols-outlined {
  font-variation-settings: normal;
  font-optical-sizing: auto;
}

/* Tabular figures for IDs, amounts, dates and counts (DESIGN.md section 3). */
table td,
table th,
.hf-tab-count,
.sidebar-badge,
.hf-case-head__meta {
  font-variant-numeric: tabular-nums;
}

a {
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

/* One line colour for Unfold's rules and frames (DESIGN.md `line`). */
.border-base-200,
.lg\:border-base-200 {
  border-color: var(--hf-line) !important;
}

/* Flat surfaces: no shadows on cards, tables, inputs or buttons (dialogs keep theirs). */
.shadow-xs,
.shadow-sm,
.shadow-inner {
  box-shadow: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Messages and notes in Hemafund's two tones: no green, orange or blue (DESIGN.md section 2).
   Information and success are neutral on surface-1; errors in the wine red with words. */
.bg-blue-100,
.bg-green-100,
.bg-orange-100 {
  background-color: var(--hf-surface-1) !important;
  color: var(--hf-ink) !important;
}

.bg-red-100 {
  background-color: var(--hf-brand-tint) !important;
  color: var(--hf-error) !important;
}

/* 2. Shell: sidebar, header, page ------------------------------------------------------------ */

#main {
  background: var(--hf-page);
}

#nav-sidebar,
#nav-sidebar-inner {
  background: #fff;
}

#nav-sidebar {
  border-inline-end-color: var(--hf-line);
}

/* Sidebar header: the 24px heart, "Hemafund" in Source Serif 4 at 20px, "Back office" under it. */
#nav-sidebar-inner > div:first-child {
  height: 72px;
  margin-bottom: 0;
  padding: 0 12px;
}

#nav-sidebar-inner > div:first-child img {
  width: 24px;
  height: 20px;
}

#site-name {
  font-family: var(--font-hemafund-title);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: 0;
  color: var(--hf-ink);
}

#nav-sidebar-inner > div:first-child .text-subtle {
  font-size: 13px;
  line-height: 1.3;
  color: var(--hf-ink-secondary);
}

.hf-sidebar-search {
  padding: 16px 16px 4px;
}

.hf-sidebar-search__box {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--hf-line);
  border-radius: 2px;
  background: #fff;
  color: var(--hf-line-strong);
  cursor: pointer;
  text-align: start;
}

.hf-sidebar-search__box .material-symbols-outlined {
  font-size: 18px;
}

#nav-sidebar-apps {
  padding-top: 8px;
}

#nav-sidebar-apps h2 {
  margin: 0;
  padding: 16px 24px 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--hf-ink-secondary);
}

#nav-sidebar-apps ol {
  padding: 0;
}

#nav-sidebar-apps ol a {
  position: relative;
  height: 40px;
  margin: 0;
  padding: 0 24px;
  border-radius: 0;
  color: var(--hf-ink);
  font-weight: 400;
}

#nav-sidebar-apps ol a:hover {
  background: var(--hf-surface-1);
  color: var(--hf-ink);
}

#nav-sidebar-apps ol a .material-symbols-outlined {
  width: 20px;
  margin-inline-end: 12px;
  font-size: 20px;
  color: var(--hf-ink-secondary);
}

/* The active item: ink at 600, icon in carmine, a 2px carmine marker on the left edge. */
#nav-sidebar-apps ol a.active {
  background: transparent;
  color: var(--hf-ink);
  font-weight: 600;
}

#nav-sidebar-apps ol a.active .material-symbols-outlined {
  color: var(--hf-brand);
}

#nav-sidebar-apps ol a.active::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--hf-brand);
}

/* The count after "Cases": a small carmine number, not a pill. */
/* The count after "Cases": a plain carmine number (13px/600), not Unfold's pink pill. Unfold puts
   its bg-red-100 / text-red-700 / height utilities on the same element, hence !important. */
.sidebar-badge.hf-nav-count {
  height: auto !important;
  min-width: 0 !important;
  margin-inline-start: auto;
  padding: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--hf-brand) !important;
  font-size: 13px !important;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: normal;
  text-transform: none !important;
}

/* Bottom of the sidebar: "Oleksii Marchenko, Administrator" and the user menu. */
.hf-sidebar-user {
  position: relative;
  border-top: 1px solid var(--hf-line);
}

.hf-sidebar-user__button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 16px 24px;
  background: transparent;
  color: var(--hf-ink-secondary);
  text-align: start;
  cursor: pointer;
}

.hf-sidebar-user__button:hover {
  background: var(--hf-surface-1);
}

.hf-sidebar-user__button .material-symbols-outlined {
  font-size: 22px;
}

.hf-sidebar-user__name strong {
  font-weight: 600;
  color: var(--hf-ink);
}

.hf-sidebar-user__menu {
  position: absolute;
  inset-inline: 12px;
  bottom: calc(100% + 4px);
  z-index: 50;
  display: flex;
  flex-direction: column;
  padding: 4px;
  border: 1px solid var(--hf-line);
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 4px 16px rgb(43 45 51 / 0.12);
}

.hf-menu-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border-radius: 2px;
  background: transparent;
  color: var(--hf-ink);
  text-align: start;
  text-decoration: none;
  cursor: pointer;
}

.hf-menu-item:hover {
  background: var(--hf-surface-1);
  color: var(--hf-ink);
}

/* Header bar: white, 64px, the breadcrumb in ink-secondary, the quiet environment label. */
#main > div:first-child {
  margin-bottom: 0;
  padding: 0 32px;
  background: #fff;
  border-bottom-color: var(--hf-line);
}

#header-inner .hf-breadcrumb {
  font-size: 14px;
  font-weight: 400;
  color: var(--hf-ink-secondary);
}

#header-inner .hf-breadcrumb a {
  color: var(--hf-brand);
  text-decoration: underline;
}

.hf-crumb-sep {
  margin: 0 6px;
  font-size: 18px;
  vertical-align: middle;
  color: var(--hf-ink-secondary);
}

#header-inner .hf-label {
  color: var(--hf-ink-secondary);
}

/* On a desktop the sidebar stays open, as in the designs; the toggle remains on small screens. */
@media (min-width: 1280px) {
  #header-inner span:has(> [x-on\:click="sidebarToggle()"]),
  #header-inner span:has(> [x-on\:click="sidebarToggle()"]) + span {
    display: none;
  }
}

/* Page: 32px padding, the serif title row, then tabs, then content (DESIGN.md section 5). */
#main > .\@container {
  padding: 32px;
}

.hf-page-head {
  margin-bottom: 20px;
}

.hf-page-title {
  margin: 0;
  font-family: var(--font-hemafund-title);
  font-size: 28px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: 0;
  color: var(--hf-ink);
  font-variant-numeric: tabular-nums;
}

/* 3. Tabs: text tabs with a 2px carmine underline on the active one --------------------------- */

#tabs-wrapper {
  margin-bottom: 24px;
}

#tabs-wrapper > div {
  flex-grow: 1;
}

#tabs-items {
  width: 100%;
  gap: 28px;
  padding: 0;
  border-bottom: 1px solid var(--hf-line);
  border-radius: 0;
  background: transparent;
}

#tabs-items > a {
  gap: 0;
  margin-bottom: -1px;
  padding: 8px 0 12px;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--hf-ink);
  font-weight: 400;
  text-decoration: none;
}

#tabs-items > a:hover {
  color: var(--hf-brand);
}

#tabs-items > a.active {
  border-bottom-color: var(--hf-brand);
  font-weight: 600;
  color: var(--hf-ink);
}

.hf-tab-count {
  margin-inline-start: 6px;
  font-weight: 400;
  color: var(--hf-ink-secondary);
}

/* 4. Lists ------------------------------------------------------------------------------------ */

/* Search and "Filters" sit on the page above the table, not in a frame joined to it. */
#changelist div:has(> #toolbar),
#changelist div:has(> .filter-open-button) {
  align-items: center;
  margin-bottom: 20px;
  padding: 0;
  border: 0 !important;
  border-radius: 0;
}

#changelist-search > div {
  width: 360px;
  height: 40px;
  border: 1px solid var(--hf-line-strong) !important;
  border-radius: 2px;
}

#changelist-search input {
  font-weight: 400;
}

#changelist-search input::placeholder {
  color: var(--hf-line-strong);
}

#changelist-search kbd {
  display: none;
}

/* Design 14 draws the access log's search box narrower than the cases list's (320px vs 360px). */
body.model-accesslogentry #changelist-search > div {
  width: 320px;
}

/* Header and cells of a list share one left edge, 24px inside the table frame (designs 09, 14).
   The cases list starts with the expand chevron instead and keeps Unfold's spacing. */
body:not(.model-case) #result_list thead tr > :first-child,
body:not(.model-case) #result_list tbody tr > :first-child {
  padding-left: 24px !important; /* the first cell of a row is a <th> with Unfold's own padding */
}

#changelist .filter-open-button {
  flex-direction: row-reverse;
  gap: 8px;
  height: 40px;
  margin-inline-start: 0 !important;
  padding: 0 16px;
  border: 1px solid var(--hf-line-strong) !important;
  border-radius: 2px;
  color: var(--hf-ink);
  font-size: 14px;
  font-weight: 600;
}

#changelist .filter-open-button .material-symbols-outlined {
  margin: 0;
  font-size: 20px;
}

/* Column grids of designs 03 and 14. The widths include the cells' padding; the remaining column
   (Client, What) takes the rest. The table keeps its automatic layout, so a width is a minimum:
   the row action cell of the cases list has no header cell and gets its width here. */
@media (min-width: 1024px) {
  body.model-case #result_list thead th:first-child { width: 48px; }
  body.model-case #result_list .column-case_column { width: 144px; }
  body.model-case #result_list .column-request_type { width: 120px; }
  body.model-case #result_list .column-status_column { width: 180px; }
  body.model-case #result_list .column-last_message_column { width: 240px; }
  body.model-case #result_list .column-received_column { width: 180px; }
  body.model-case #result_list td.field-actions_holder { width: 44px; padding-inline: 8px; }

  body.model-accesslogentry #result_list .column-when_column { width: 214px; }
  body.model-accesslogentry #result_list .column-who_column { width: 200px; }
  body.model-accesslogentry #result_list .column-record_label { width: 160px; }
  body.model-accesslogentry #result_list .column-ip_column { width: 154px; padding-right: 24px; }

  /* An opened row's marker reaches 1px below the table; with Unfold's overflow-x: auto that
     brought up a vertical scrollbar inside the frame and moved the columns. The table fits at
     these widths, so the frame needs no scrolling. */
  body.model-case #changelist div:has(> #result_list) {
    overflow: visible;
  }
}

/* Design 03: 20px from the tabs' line to the search box (the case pages keep 24px to content). */
body.model-case.change-list #tabs-wrapper {
  margin-bottom: 20px;
}

/* The table: white, 1px rows, 52px rows, no zebra, sentence-case 13px headers. */
#changelist div:has(> #result_list),
.hf-table-frame,
.hf-empty {
  border: 1px solid var(--hf-line) !important;
  border-radius: 4px !important;
  background: #fff;
}

#result_list > tbody {
  background: #fff !important;
}

#result_list > tbody:hover > tr.data-row {
  background: var(--hf-page);
}

#result_list thead th,
#change-history > thead th {
  height: 40px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--hf-ink-secondary);
  text-transform: none;
  letter-spacing: 0;
}

#result_list thead th a {
  color: inherit;
}

#result_list thead th.sorted {
  color: var(--hf-ink);
}

#result_list thead .sortremove {
  display: none;
}

#result_list thead .sortoptions .material-symbols-outlined {
  font-size: 16px;
  color: var(--hf-ink);
}

#result_list > tbody > tr.data-row > td,
#result_list > tbody > tr.data-row > th { /* the key column's cell is a <th> */
  height: 52px;
  padding: 0 10px;
  border-top: 1px solid var(--hf-line);
  color: var(--hf-ink);
  font-size: 14px;
  white-space: nowrap;
}

#result_list > tbody > tr.data-row > td:first-child {
  padding-inline-start: 16px;
}

#result_list a {
  color: var(--hf-brand);
}

/* A list's key column (the record's own link: a client's name, an email's subject) in bold ink,
   like the Case ID column, not as a carmine link. */
#result_list > tbody > tr > th > a.text-important {
  color: var(--hf-ink);
  font-weight: 600;
  text-decoration: none;
}

#result_list > tbody > tr > th > a.text-important:hover {
  text-decoration: underline;
}

/* Size right-aligned with tabular figures, as in the case's Documents tab (design 09). */
body.model-document #result_list :is(th.column-size_column, td.field-size_column) {
  text-align: end;
  font-variant-numeric: tabular-nums;
}

body.model-document #result_list th.column-size_column > div {
  justify-content: flex-end;
}

/* Ukrainian column texts are longer ("Сторінка справи", "Без загроз", "Завантажити"): the file name
   gives way (ellipsis, the full name in its title), so the list needs no sideways scroll at 1440. */
html:lang(uk) body.model-document #result_list td.field-file_column .hf-file__name {
  max-width: 168px;
}

/* The Case ID column: Manrope 600 with tabular figures, in ink; the unread dot before it. */
a.hf-case-id,
#result_list a.hf-case-id {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--hf-ink);
  font-weight: 600;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}

a.hf-case-id:hover {
  text-decoration: underline;
}

.hf-unread {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hf-brand);
}

/* Expanded row (Unfold sections). */
#result_list > tbody > tr:not(.data-row) > td {
  padding: 16px 24px 16px 64px;
  background: var(--hf-page);
  border-top: 1px solid var(--hf-line);
}

.hf-row-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 760px;
  white-space: normal;
}

.hf-row-section p {
  margin: 0;
}

.hf-row-section__meta {
  color: var(--hf-ink-secondary);
}

.hf-row-section__meta strong {
  color: var(--hf-ink);
  font-weight: 600;
}

.hf-row-section__excerpt {
  font-size: 15px;
  line-height: 1.6;
}

.hf-row-section__links {
  display: flex;
  gap: 20px;
  color: var(--hf-ink-secondary);
}

.hf-row-section__links a {
  color: var(--hf-brand);
  font-weight: 600;
}

.hf-empty {
  padding: 32px 24px;
  color: var(--hf-ink-secondary);
}

.hf-empty p {
  margin: 0 0 8px;
}

.hf-empty a {
  color: var(--hf-brand);
  font-weight: 600;
}

/* 5. Forms and buttons ----------------------------------------------------------------------- */

/* The form's Save button in Unfold's sticky bar, drawn like every other button (design 10). */
button[name="_save"] {
  height: 40px;
  padding: 0 20px !important;
  border-radius: 2px !important;
  font-weight: 600 !important;
}

/* Fields: 1px line-strong border, radius 2px, carmine focus ring with a brand-tint halo. */
#content-main input[type="text"],
#content-main input[type="email"],
#content-main input[type="number"],
#content-main input[type="url"],
#content-main select,
#content-main textarea {
  border: 1px solid var(--hf-line-strong) !important; /* beats the line colour of Unfold's border-base-200 */
  border-radius: 2px;
  color: var(--hf-ink);
  box-shadow: none;
}

#content-main textarea {
  font-size: 15px;
  line-height: 1.6;
}

/* The mockups' text fields (composer, Notes, Covers, dialogs) have no resize grip. */
textarea {
  resize: none;
}

#content-main input:focus,
#content-main select:focus,
#content-main textarea:focus,
.hf-input:focus-within {
  outline: none;
  border-color: var(--hf-brand) !important;
  box-shadow: 0 0 0 3px var(--hf-brand-tint) !important;
}

/* Search box of a list: one frame, not a framed input inside a frame. */
#changelist-search input[type="text"] {
  min-height: 0;
  border: 0 !important;
  box-shadow: none !important;
}

/* A record form drawn as the designs' card (fieldset classes ["hf-form"], design 10): the title
   in a header row, then a two-column grid with labels above the fields. */
fieldset.hf-form {
  border: 1px solid var(--hf-line);
  border-radius: 4px;
  background: #fff;
}

fieldset.hf-form > h2 {
  height: auto;
  margin: 0;
  padding: 16px 24px;
  border-bottom: 1px solid var(--hf-line);
  border-radius: 0;
  background: transparent;
  font-size: 16px;
  font-weight: 600;
  color: var(--hf-ink);
}

fieldset.hf-form .form-rows {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px 32px;
  padding: 24px;
  border: 0 !important;
  border-radius: 0;
}

fieldset.hf-form .form-row {
  display: contents;
}

fieldset.hf-form .field-line {
  flex-direction: column;
  align-items: stretch;
  min-height: 0;
  padding: 0;
  border: 0;
}

fieldset.hf-form .field-line > div:first-child {
  width: auto;
  min-width: 0;
  height: auto;
  margin-bottom: 6px;
  line-height: 1.5;
}

fieldset.hf-form label .text-red-600 {
  display: none; /* no asterisks: every field the design shows is either needed or optional by sense */
}

fieldset.hf-form input,
fieldset.hf-form textarea {
  width: 100%;
  max-width: none;
}

fieldset.hf-form input {
  height: 40px;
}

fieldset.hf-form textarea {
  min-height: 120px;
}

fieldset.hf-form .field-notes,
fieldset.hf-form .field-case_page_line {
  grid-column: 1 / -1;
}

fieldset.hf-form .field-case_page_line > div:first-child {
  display: none;
}

fieldset.hf-form .field-case_page_line .readonly {
  color: var(--hf-ink-secondary);
  font-variant-numeric: tabular-nums;
}

/* The record form's sticky "Save" row (design 10), drawn like the Payment tab's (.hf-submit-row):
   16px 32px, a 1px line above, white and flat (no blur layer, no shadow gradient). */
#submit-row > div {
  padding: 16px 32px;
  border-top: 1px solid var(--hf-line);
  border-radius: 0;
  background: #fff;
}

#submit-row > div::after,
#submit-row > div > .absolute {
  display: none;
}

#submit-row > div > .container {
  max-width: none;
  height: auto;
}

@media (max-width: 767px) {
  #submit-row > div {
    padding: 16px;
  }

  fieldset.hf-form .form-rows {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* 6. Labels: 2px rectangles, 13px Manrope 600, sentence case ------------------------------------- */

.hf-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 8px;
  border-radius: 2px;
  background: var(--hf-surface-1);
  color: var(--hf-ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-transform: none;
}

.hf-label .material-symbols-outlined {
  font-size: 16px;
}

.hf-label--attention {
  background: var(--hf-brand-tint);
  color: var(--hf-brand);
}

/* 7. Case pages ---------------------------------------------------------------------------- */

.hf-case-head {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 20px;
}

.hf-case-head__main {
  flex: 1;
  min-width: 0;
}

.hf-case-head__title {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hf-case-head__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin-top: 6px;
  color: var(--hf-ink-secondary);
}

.hf-case-head__client {
  color: var(--hf-ink);
  font-weight: 600;
}

.hf-case-head__actions {
  display: flex;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hf-case-head__actions > li {
  height: 40px;
  border: 1px solid var(--hf-line-strong);
  border-radius: 2px;
  background: #fff;
  color: var(--hf-ink);
  font-weight: 600;
}

.hf-case-head__actions > li a {
  height: 100%;
  padding: 0 16px;
}

.hf-panel {
  border: 1px solid var(--hf-line);
  border-radius: 4px;
  background: #fff;
}

.hf-panel__title {
  margin: 0;
  padding: 16px 24px;
  border-bottom: 1px solid var(--hf-line);
  font-size: 16px;
  font-weight: 600;
}

.hf-panel__body {
  padding: 24px;
}

.hf-panel__empty {
  margin: 0;
  padding: 24px;
  color: var(--hf-ink-secondary);
}

/* Read-only tables of the case pages (Documents). */
.hf-table {
  width: 100%;
  border-collapse: collapse;
}

.hf-table th {
  height: 40px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--hf-ink-secondary);
  text-align: start;
}

.hf-table td {
  height: 52px;
  padding: 0 10px;
  border-top: 1px solid var(--hf-line);
}

.hf-table th:first-child,
.hf-table td:first-child {
  padding-inline-start: 24px;
}

.hf-table th:last-child,
.hf-table td:last-child {
  padding-inline-end: 24px;
}

.hf-table tbody tr:hover {
  background: var(--hf-page);
}

.hf-table--documents td:first-child {
  max-width: 360px;
}

.hf-num {
  text-align: end !important;
}

/* Secondary text (ink-secondary #5F6167): IP addresses, "Case page: last opened ...". */
.hf-muted {
  color: var(--hf-ink-secondary);
}

.hf-tabular {
  font-variant-numeric: tabular-nums;
}

/* The documents table on the grid of design 09: File takes the rest. */
.hf-table--documents {
  table-layout: fixed;
  width: 100%;
}

.hf-table--documents col.hf-col-from { width: 180px; }
.hf-table--documents col.hf-col-source { width: 120px; }
.hf-table--documents col.hf-col-added { width: 128px; }
.hf-table--documents col.hf-col-size { width: 96px; }
.hf-table--documents col.hf-col-scan { width: 104px; }
.hf-table--documents col.hf-col-action { width: 142px; } /* 128px plus the row's 14px end padding */
/* Ukrainian words are longer ("Без загроз", "Завантажити", "Сторінка справи"): wider columns, so
   they stay on one line; the file name column gives the room. */
html:lang(uk) .hf-table--documents col.hf-col-source { width: 144px; }
html:lang(uk) .hf-table--documents col.hf-col-scan { width: 132px; }
html:lang(uk) .hf-table--documents col.hf-col-action { width: 168px; }

.hf-table--documents td {
  overflow-wrap: anywhere;
}

.hf-nowrap {
  white-space: nowrap;
}

.hf-file {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.hf-file .material-symbols-outlined {
  font-size: 20px;
  color: var(--hf-ink-secondary);
}

.hf-file__name {
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* "Clean" and "Download" carry an icon; vertical-align: top keeps their text on the line of the
   neighbouring cells (an inline-flex box would otherwise sit on the icon's baseline, 2px higher). */
.hf-scan {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  vertical-align: top;
  color: var(--hf-ink-secondary);
}

.hf-scan .material-symbols-outlined {
  font-size: 18px;
}

.hf-scan--rejected {
  color: var(--hf-error);
}

a.hf-download,
#result_list a.hf-download {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  vertical-align: top;
  color: var(--hf-brand);
  font-weight: 600;
  text-decoration: none;
}

a.hf-download:hover {
  color: var(--hf-brand-pressed);
  text-decoration: underline;
}

.hf-download .material-symbols-outlined {
  font-size: 18px;
}

.hf-message-body {
  max-width: 760px;
  font-size: 15px;
  line-height: 1.6;
}

.hf-message-body p {
  margin: 0 0 12px;
}

/* 8. Sign-in pages (design 01) ----------------------------------------------------------------- */

.hf-auth {
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 152px 16px 48px;
  background: var(--hf-page);
}

.hf-auth__column {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  max-width: 400px;
}

.hf-auth__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--hf-ink);
  text-decoration: none;
}

.hf-auth__brand img {
  display: block;
  width: 24px;
  height: 20px;
}

.hf-auth__site {
  display: block;
  font-family: var(--font-hemafund-title);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.1;
}

.hf-auth__subsite {
  display: block;
  font-size: 13px;
  line-height: 1.3;
  color: var(--hf-ink-secondary);
}

/* The environment label under the sign-in card: quiet, as in the header (design 01). */
.hf-auth .hf-label {
  color: var(--hf-ink-secondary);
}

.hf-auth__card {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 32px;
  border: 1px solid var(--hf-line);
  border-radius: 4px;
  background: #fff;
}

.hf-auth__card h1,
.hf-auth__title {
  margin: 0;
  font-family: var(--font-hemafund-title);
  font-size: 28px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--hf-ink);
  text-wrap: pretty;
}

.hf-auth__text,
.hf-auth__card p {
  margin: 0;
}

.hf-auth__form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hf-auth__label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: var(--hf-ink);
}

.hf-auth__hint {
  margin: 6px 0 0;
  color: var(--hf-ink-secondary);
}

.hf-auth__link {
  display: inline-block;
  align-self: flex-start;
  margin-top: 10px;
  color: var(--hf-brand);
  font-weight: 600;
  text-decoration: underline;
}

.hf-auth__link:hover {
  color: var(--hf-brand-pressed);
}

.hf-auth__messages {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hf-input {
  display: block;
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--hf-line-strong);
  border-radius: 2px;
  background: #fff;
  color: var(--hf-ink);
  font-size: 14px;
}

input.hf-input:focus {
  outline: none;
  border-color: var(--hf-brand);
  box-shadow: 0 0 0 3px var(--hf-brand-tint);
}

.hf-input--with-button {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hf-input--with-button input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: none;
  background: transparent;
}

.hf-input--error {
  border-color: var(--hf-error);
}

.hf-input__button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  color: var(--hf-brand);
  font-weight: 600;
  cursor: pointer;
}

.hf-input__button .material-symbols-outlined {
  font-size: 18px;
}

.hf-error {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 6px 0 0;
  color: var(--hf-error);
}

.hf-error .material-symbols-outlined {
  font-size: 18px;
}

.hf-error--block {
  margin: 0;
}

.hf-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 20px;
  border: 1px solid var(--hf-line-strong);
  border-radius: 2px;
  background: #fff;
  color: var(--hf-ink);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

/* Secondary buttons are narrower than primary ones in the mockups (16px against 20px). */
.hf-button:not(.hf-button--primary) {
  padding: 0 16px;
}

.hf-button--primary {
  border-color: var(--hf-brand);
  background: var(--hf-brand);
  color: #fff;
}

.hf-button--primary:hover {
  border-color: var(--hf-brand-pressed);
  background: var(--hf-brand-pressed);
  color: #fff;
}

.hf-button--wide {
  width: 100%;
}

.hf-account-form {
  max-width: 560px;
}

/* Phones (390): the 16px gutter of the rest of the product, the sign-in card higher up. */
@media (max-width: 767px) {
  #main > div:first-child,
  #main > .\@container {
    padding-inline: 16px;
  }

  #main > .\@container {
    padding-top: 24px;
  }

  .hf-auth {
    padding-top: 64px;
  }

  .hf-auth__card {
    padding: 24px;
  }
}

/* The History tab's table (hemafund/templates/simple_history/object_history_list.html): the same
   white surface and quiet headers as the other tables. */
#change-history {
  background: #fff;
}

#change-history > thead th:first-child,
#change-history > tbody > tr > td:first-child {
  padding-left: 24px; /* also the Field / Old value / New value rows, so they line up */
}

/* Fixed columns, so opening a row does not move them, and 52px rows as in the other tables. */
#change-history {
  table-layout: fixed;
}

#change-history col.hf-col-when { width: 220px; }
#change-history col.hf-col-who { width: 260px; }
#change-history col.hf-col-toggle { width: 56px; }

#change-history > tbody > tr.data-row > td {
  height: 52px;
  vertical-align: middle;
}

#change-history > tbody > tr > td {
  padding-inline: 10px; /* as the header cells, so values sit under their column names */
  overflow-wrap: anywhere;
}

/* "5 entries" in the table's last row (design 14). */
#change-history > tfoot td.hf-history-count {
  height: 52px;
  padding: 0 10px 0 24px;
  border-top: 1px solid var(--hf-line);
  color: var(--hf-ink-secondary);
  font-variant-numeric: tabular-nums;
}

/* The interface language switch (hemafund/templates/hemafund/_language_switch.html): in the header
   before the environment label and under the sign-in card. Quiet text: the current language in
   ink, the other one a text button; no flags. */
.hf-lang {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}

.hf-lang__icon {
  margin-inline-end: 4px;
  font-size: 18px;
  color: var(--hf-ink-secondary);
}

.hf-lang__item {
  padding: 4px 6px;
  border: 0;
  border-radius: 2px;
  background: none;
  color: var(--hf-ink-secondary);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.hf-lang__item:hover {
  color: var(--hf-brand);
}

.hf-lang__item:focus-visible {
  outline: 2px solid var(--hf-brand);
  outline-offset: 1px;
}

.hf-lang__item--on {
  color: var(--hf-ink);
  font-weight: 600;
  cursor: default;
}

.hf-auth__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Polish round, 25 October 2026 (fresh-eyes review of the back office) ------------------------ */

/* One keyboard focus ring everywhere, as on fields and buttons (DESIGN.md): carmine, 2px, off the
   element, never the browser's own thin ring. Rules above that draw their own ring keep it. */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
[role="tab"]:focus-visible,
[role="button"]:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--hf-brand);
  outline-offset: 2px;
}

/* The sidebar's full-width items: the ring goes inside. */
#nav-sidebar-apps a:focus-visible,
.hf-sidebar-user__button:focus-visible {
  outline-offset: -2px;
}

/* An active filter or queue fills "Filters" with the brand colour: its words are white then
   (the rule in section 4 writes ink, which left them at about 2:1 on carmine). */
#changelist .filter-open-button.bg-primary-600 {
  color: #fff;
}

/* A Case ID is a link: underlined in the brand colour on hover and keyboard focus, the design's
   quiet ink at rest (dashboard and lists). */
#result_list a.hf-case-id:hover,
#result_list a.hf-case-id:focus-visible,
a.hf-case-id:hover,
a.hf-case-id:focus-visible {
  color: var(--hf-brand);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* The user menu at the bottom of the sidebar shows that it opens. */
.hf-sidebar-user__chevron {
  margin-inline-start: auto;
  font-size: 20px !important;
  color: var(--hf-ink-secondary);
}

/* The sidebar search's "Found 3 results in 0.00 seconds": technical, not shown. */
#command-results-note {
  display: none;
}

/* After a search with no result: what the search can find (access log). */
.hf-empty__hint {
  color: var(--hf-ink-secondary);
}

/* Messages above the page: an icon says success (check) or information (info). */
.hf-message {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hf-message .material-symbols-outlined {
  font-size: 18px;
}

/* The line above a case's History table. */
.hf-history-note {
  margin: 0 0 16px;
  color: var(--hf-ink-secondary);
}

/* The sticky footer of a list ("3 cases") starts on the content's left edge: the page's 32px
   (16px on phones), not Unfold's 16px. */
#main > .\@container ~ div.px-4 {
  padding-inline: 32px;
}

@media (max-width: 767px) {
  #main > .\@container ~ div.px-4 {
    padding-inline: 16px;
  }
}
