/* KRONBERG grāmatvedība — F1.6.1 UI karkass. Profesionāls biznesa stils. */

:root {
  --mk-ink: #001145;
  --mk-ink-hover: #0B2866;
  --mk-ink-active: #000D34;
  --mk-slate: #3B5C8A;
  --mk-accent: #3D8FFA;
  --mk-link: #3075D4;
  --mk-accent-tint: #E8F2FE;
  --mk-surface: #F6F7F8;
  --mk-line: #DBDEE5;
  --mk-white: #FFFFFF;
  --mk-danger: #dc2626;
  --mk-sidebar-text: #B3C6E4;
  --mk-sidebar-muted: #7C93BC;
  --mk-focus: 0 0 0 3px rgba(61, 143, 250, .45);
  --mk-ring: 0 0 0 3px rgba(61, 143, 250, .12);
  --primary: var(--mk-ink);
  --primary-hover: var(--mk-ink-hover);
  --primary-soft: var(--mk-accent-tint);
  --sidebar: var(--mk-ink);
  --sidebar-2: var(--mk-ink-hover);
  --sidebar-line: rgba(255, 255, 255, .1);
  --sidebar-text: var(--mk-sidebar-text);
  --sidebar-muted: var(--mk-sidebar-muted);
  --sidebar-active: var(--mk-accent);
  --bg: var(--mk-surface);
  --panel: var(--mk-white);
  --border: var(--mk-line);
  --line-strong: var(--mk-line);
  --text: #33456B;
  --muted: var(--mk-slate);
  --faint: var(--mk-sidebar-muted);
  --danger: var(--mk-danger);
  --danger-soft: #FEF2F2;
  --warning: #9a6700;
  --warning-soft: #fff7df;
  --success: #087443;
  --radius-sm: 6px;
  --radius: 8px;
  --shadow-sm: 0 2px 8px rgba(0, 17, 69, .04);
  --shadow-md: 0 8px 32px rgba(0, 17, 69, .18);
  --header-h: 74px;
  --mk-font: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font: var(--mk-font);
}

*, *::before, *::after { box-sizing: border-box; }

/* Klases selektors ar `display` pārspēj pārlūka `[hidden]` noteikumu, tāpēc
   pilnekrāna ekrāni (pieteikšanās, inicializācijas kļūda) paliktu redzami un
   nosegtu lietotni arī tad, kad kods tos ir paslēpis. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  font-family: var(--mk-font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
}

/* —— Pieteikšanās ekrāns —— */
.acc-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}

.acc-login__card {
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.acc-login__logo {
  margin-bottom: 16px;
}

.acc-login__logo img {
  height: 22px;
  width: auto;
  display: block;
  margin: 0 auto;
}

.acc-login__title {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--text);
}

.acc-login__text {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 24px;
}

.acc-login__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.acc-login__form {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.acc-login__form .acc-field__label { margin-top: 6px; }

.acc-login__error {
  color: var(--danger);
  font-size: 13px;
  margin: 8px 0 0;
}

.acc-login__submit { width: 100%; margin-top: 12px; }

/* —— Galvenā izkārtojuma struktūra —— */
.acc-app {
  display: none;
  min-height: 100vh;
}

.acc-app.is-ready {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.acc-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: stretch;
  background: var(--mk-ink);
  color: var(--mk-white);
}

.acc-header__brand {
  width: 210px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 23px;
  border-right: 1px solid var(--sidebar-line);
  text-decoration: none;
}

.acc-header__logo {
  height: 22px;
  width: auto;
  display: block;
}

.acc-header__company {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.acc-header__company-label {
  font-size: 13px;
  color: var(--sidebar-text);
  white-space: nowrap;
}

.acc-header__company-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--mk-white);
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.acc-header__company .acc-select {
  height: 34px;
  border-color: rgba(255, 255, 255, .18);
  background-color: var(--mk-ink-hover);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='m2 2 4 4 4-4' fill='none' stroke='%23B3C6E4' stroke-width='1.5'/%3E%3C/svg%3E");
  color: var(--mk-white);
}

.acc-header__utils {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
}

.acc-header__avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--mk-ink-hover);
  color: var(--mk-white);
  font-size: 12px;
  font-weight: 600;
}

.acc-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

.acc-topnav {
  display: flex;
  align-items: center;
  gap: 5px;
  padding-left: 20px;
  min-width: 0;
}

.acc-nav__link,
.acc-menu__summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--sidebar-text);
  font-family: inherit;
  font-size: 13px;
  line-height: 20px;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  list-style: none;
  cursor: pointer;
}

.acc-menu__summary::-webkit-details-marker { display: none; }

.acc-nav__link:hover,
.acc-menu__summary:hover {
  background: rgba(255, 255, 255, .06);
  color: var(--mk-white);
}

.acc-nav__link.is-active,
.acc-menu.is-selected > .acc-menu__summary {
  background: var(--mk-ink-hover);
  color: var(--mk-white);
}

.acc-nav__icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: .8;
}

.acc-nav__icon svg {
  width: 17px;
  height: 17px;
  display: block;
}

.acc-nav__link.is-active .acc-nav__icon { opacity: 1; }

/* —— Galvenes nolaižamās izvēlnes —— */
.acc-menu { position: relative; }

.acc-menu__chevron {
  width: 12px;
  height: 12px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  opacity: .7;
}

.acc-menu__panel {
  position: absolute;
  z-index: 120;
  top: calc(100% + 10px);
  left: 0;
  min-width: 225px;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel);
  box-shadow: var(--shadow-md);
}

.acc-menu--right .acc-menu__panel { right: 0; left: auto; }

.acc-menu--account > .acc-menu__summary { padding: 5px 0; gap: 6px; }

.acc-menu__item {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.acc-menu__item:hover {
  background: var(--bg);
  color: var(--text);
}

.acc-menu__item.is-active {
  background: var(--primary-soft);
  color: var(--mk-link);
}

.acc-menu__label {
  display: block;
  padding: 7px 12px;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (max-width: 1250px) {
  .acc-header__brand { width: 175px; padding: 0 16px; }
  .acc-topnav { padding-left: 10px; gap: 1px; }
  .acc-topnav > .acc-nav__link,
  .acc-menu__summary { font-size: 12px; padding: 8px 9px; }
  .acc-header__utils { gap: 8px; padding: 0 11px; }
}

@media (max-width: 850px) {
  .acc-header {
    height: auto;
    min-height: 64px;
    flex-wrap: wrap;
  }
  .acc-header__brand { height: 64px; width: 180px; }
  .acc-header__utils { min-height: 64px; }
  .acc-topnav {
    order: 3;
    width: 100%;
    min-height: 47px;
    padding: 4px 9px;
    flex-wrap: wrap;
    gap: 4px;
    border-top: 1px solid var(--sidebar-line);
  }
  .acc-topnav > .acc-menu:last-child .acc-menu__panel { right: 0; left: auto; }
}

@media (max-width: 460px) {
  .acc-header__brand { width: 140px; padding: 0 10px; }
  .acc-topnav { gap: 0; }
  .acc-topnav > .acc-nav__link,
  .acc-menu__summary { font-size: 11px; padding: 7px; }
  .acc-topnav > .acc-nav__link .acc-nav__icon { display: none; }
}

.acc-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  padding: 24px 28px;
  overflow-y: auto;
}

/* —— Satura paneļi —— */
.acc-view__header {
  margin-bottom: 20px;
}

.acc-view--form > .acc-view__header {
  display: none;
}

.acc-view__header--row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.acc-view__header-text { min-width: 0; }

.acc-view__actions {
  flex-shrink: 0;
  padding-top: 2px;
}

.acc-view__title {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--text);
}

.acc-view__subtitle {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}

.acc-placeholder {
  background: var(--panel);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 48px 32px;
  text-align: center;
  max-width: 560px;
}

.acc-placeholder__label {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.acc-placeholder__title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--text);
}

.acc-placeholder__text {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}

/* —— Pogas —— */
.acc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  min-height: 44px;
  padding: .72em 1.5em;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.2;
  letter-spacing: .01em;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: .15s ease;
}

.acc-btn--primary {
  background: var(--primary);
  color: var(--mk-white);
  border-color: var(--primary);
}

.acc-btn--primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.acc-btn--secondary {
  background: transparent;
  color: var(--mk-ink);
  border-color: var(--border);
}

.acc-btn--secondary:hover {
  background: var(--primary-soft);
  border-color: var(--mk-accent);
}

/* Morrowkey .mk-btn (karte — kabineta primārā skala) */
.mk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  min-height: 44px;
  padding: 0 1.25em;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--mk-font, inherit);
  line-height: 1.2;
  letter-spacing: .01em;
  border-radius: 7px;
  border: 1px solid var(--mk-line, var(--border));
  background: var(--mk-white, #fff);
  color: var(--mk-ink);
  cursor: pointer;
  transition: .15s ease;
}

.mk-btn:hover {
  border-color: var(--mk-accent);
  background: var(--primary-soft);
}

.mk-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.mk-btn--sm {
  min-height: 36px;
  padding: 0 1em;
  font-size: 14px;
}

.acc-btn:focus-visible {
  outline: none;
  box-shadow: var(--mk-focus);
}

.acc-menu__summary:focus-visible,
.acc-nav__link:focus-visible,
.acc-link-back:focus-visible,
.acc-link:focus-visible {
  outline: 2px solid var(--mk-accent);
  outline-offset: 2px;
}

.acc-input:focus-visible,
.acc-select:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--mk-ring);
}

.acc-inv-form__partner-opt:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.acc-btn--sm {
  min-height: 36px;
  padding: .5em 1em;
  font-size: 14px;
}

/* —— Formas elementi (ievade) — Morrowkey §6 —— */
.acc-input {
  box-sizing: border-box;
  height: 38px;
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--mk-line);
  border-radius: 7px;
  background: var(--mk-white);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  -webkit-appearance: none;
  appearance: none;
}

.acc-input::placeholder {
  color: var(--mk-slate);
}

.acc-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--mk-ring);
}

.acc-input:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.acc-input--date { min-width: 140px; }

.acc-datepicker {
  position: relative;
  width: 100%;
  min-width: 140px;
}

.acc-datepicker__native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.acc-datepicker__field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  cursor: pointer;
}

.acc-datepicker__field.is-empty .acc-datepicker__text {
  color: var(--muted);
}

.acc-datepicker__field svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--muted);
}

.acc-datepicker-pop {
  position: fixed;
  z-index: 310;
  width: max-content;
  max-width: calc(100vw - 16px);
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.acc-datepicker-pop__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.acc-datepicker-pop__title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: min-content;
}

.acc-datepicker-pop__month {
  flex: 1 1 auto;
  width: auto;
  min-width: 11em;
  max-width: none;
}

.acc-datepicker-pop__year {
  flex: 0 0 auto;
  width: auto;
}

.acc-datepicker-pop__week,
.acc-datepicker-pop__days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.acc-datepicker-pop__week {
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}

.acc-datepicker-pop__day {
  width: 36px;
  min-height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  border-radius: var(--radius);
  cursor: pointer;
}

.acc-datepicker-pop__day:hover:not(:disabled) {
  background: var(--primary-soft);
}

.acc-datepicker-pop__day.is-muted {
  color: var(--muted);
}

.acc-datepicker-pop__day.is-today:not(.is-selected) {
  box-shadow: var(--mk-ring);
}

.acc-datepicker-pop__day.is-selected {
  background: var(--mk-accent);
  color: var(--mk-white);
}

.acc-datepicker-pop__day:disabled {
  opacity: .4;
  cursor: default;
}

.acc-datepicker-pop__foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
}


.acc-field { min-width: 0; }

.acc-field--grow { flex: 1 1 220px; }

.acc-field__label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 4px;
}

.acc-select--full { max-width: none; width: 100%; }

.acc-muted { color: var(--faint); font-style: italic; }

/* —— Paneļi —— */
.acc-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px 20px 18px;
}

.acc-panel.acc-invoices-table {
  padding: 0;
}

.acc-panel .acc-field + .acc-table-wrap {
  margin-top: 8px;
}

/* —— Rēķinu filtri —— */
.acc-invoices-filters {
  padding: 16px 20px 18px;
  margin-bottom: 16px;
}

.acc-invoices-filters__row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: flex-end;
}

.acc-invoices-filters__row + .acc-invoices-filters__row {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* —— Tabula —— */
.acc-invoices-table { overflow: hidden; }

.acc-table-meta {
  margin: 0;
  padding: 12px 24px;
  font-size: 13px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.acc-table-meta strong { color: var(--text); font-weight: 600; }

.acc-table-wrap { overflow-x: auto; }

.acc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.acc-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 24px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.acc-table td {
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.acc-table tbody tr:last-child td { border-bottom: none; }

.acc-table__num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.acc-table th.acc-table__num { text-align: right; }

.acc-table__strong { font-weight: 500; color: var(--text); }

.acc-table__row--clickable {
  cursor: pointer;
  transition: background .12s;
}

.acc-table__row--clickable:hover,
.acc-table__row--clickable:focus {
  background: var(--primary-soft);
  outline: none;
}

.acc-table__row--skeleton:hover { background: transparent; cursor: default; }

/* —— Ielādes skelets —— */
.acc-skeleton {
  display: block;
  height: 14px;
  border-radius: 4px;
  background: #e8ecf2;
}

.acc-skeleton--sm { width: 72px; }
.acc-skeleton--xs { width: 36px; }
.acc-skeleton--badge { width: 88px; height: 22px; border-radius: var(--radius-sm); }
.acc-skeleton--bar { width: 100%; height: 10px; margin-bottom: 8px; }
.acc-skeleton--short { width: 65%; }

.acc-load-skeleton {
  padding: 32px 24px;
  text-align: center;
}

.acc-load-skeleton__text {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 16px;
}

.acc-load-skeleton__row {
  max-width: 320px;
  margin: 0 auto 8px;
}

/* —— Stāvokļa apzīmes —— */
.acc-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.acc-badge--draft {
  color: #475467;
  background: #f2f4f7;
  border: 1px solid #e4e7ec;
}

.acc-badge--approved {
  color: #1e429f;
  background: #eef4ff;
  border: 1px solid #c7d7fe;
}

.acc-badge--issued {
  color: #175cd3;
  background: #eff8ff;
  border: 1px solid #b2ddff;
}

.acc-badge--posted {
  color: #067647;
  background: #ecfdf3;
  border: 1px solid #abefc6;
}

.acc-badge--paid {
  color: #087443;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}

.acc-badge--cancelled {
  color: #912018;
  background: #fef3f2;
  border: 1px solid #fecdca;
}

.acc-badge--archived {
  color: #667085;
  background: #f9fafb;
  border: 1px solid #eaecf0;
}

.acc-badge--neutral {
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
}

/* —— Lappušošana —— */
.acc-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.acc-pagination__info {
  font-size: 13px;
  color: var(--muted);
}

.acc-pagination__controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.acc-pagination__page {
  font-size: 13px;
  color: var(--text);
  min-width: 56px;
  text-align: center;
}

.acc-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}

/* —— Tukšs / kļūda / vietturis —— */
.acc-invoices-empty,
.acc-invoices-error,
.acc-invoices-placeholder {
  padding: 40px 32px;
  text-align: center;
}

.acc-invoices-empty__title,
.acc-invoices-error__title,
.acc-invoices-placeholder__title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--text);
}

.acc-invoices-empty__text,
.acc-invoices-error__text,
.acc-invoices-placeholder__text {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 16px;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.acc-invoices-empty__actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.acc-error-details {
  margin: 0 auto 16px;
  max-width: 420px;
  text-align: left;
  font-size: 12px;
  color: var(--muted);
}

.acc-error-details summary {
  cursor: pointer;
  font-weight: 500;
  margin-bottom: 4px;
}

.acc-error-details code {
  display: block;
  font-family: ui-monospace, monospace;
  color: var(--faint);
  word-break: break-all;
}

.acc-error-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.acc-invoices-placeholder__id {
  font-size: 12px;
  font-family: ui-monospace, monospace;
  color: var(--faint);
  margin: 0;
}

.acc-link-back {
  display: inline-block;
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
  text-decoration: none;
  margin-bottom: 20px;
}

.acc-link-back:hover { text-decoration: underline; }

.acc-invoices-root { min-height: 120px; }

/* —— Rēķina forma (F1.6.3) —— */
.acc-inv-form { margin-bottom: 24px; }

/* —— Jauna rēķina ievade (makets) — tikai .acc-inv-form--sale —— */
.acc-inv-form--sale {
  background: var(--mk-white);
  margin-bottom: 0;
  padding-bottom: 88px;
}

.acc-inv-form--sale .acc-select {
  padding-right: 29px;
}

.acc-inv-form--sale .acc-inv-form__partner-add {
  width: 36px;
  height: 38px;
}

.acc-inv-form--sale .acc-inv-form__partner-split {
  top: 8px;
  bottom: 8px;
  right: 36px;
}

.acc-inv-form--sale .acc-inv-form__partner--add .acc-inv-form__partner-q .acc-input {
  padding-right: 40px;
}

.acc-inv-form__page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 0 20px;
}

.acc-inv-form__back {
  display: inline-flex;
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 8px;
}

.acc-inv-form__heading-line {
  display: flex;
  align-items: center;
  gap: 13px;
  flex-wrap: wrap;
}

.acc-inv-form__h1 {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -.6px;
  line-height: 1.35;
  margin: 0;
  color: var(--mk-ink);
}

.acc-inv-form__badge {
  font-size: 11px;
  padding: 3px 8px;
  background: var(--mk-surface);
  border-radius: 5px;
  color: var(--text);
}

.acc-inv-form__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--mk-line);
  background: var(--mk-white);
  border-radius: 7px;
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}

.acc-inv-form__btn--primary {
  background: var(--mk-ink);
  border-color: var(--mk-ink);
  color: var(--mk-white);
}

.acc-inv-form__section-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 24px;
  border-top: 1px solid var(--mk-line);
  border-bottom: 1px solid var(--mk-line);
  min-height: 46px;
  background: var(--mk-white);
  margin-bottom: 26px;
}

.acc-inv-form__section-nav a {
  text-decoration: none;
  font-size: 12px;
  color: var(--text);
  padding: 12px 0;
  border-bottom: 2px solid transparent;
}

.acc-inv-form__currency {
  font-size: 11px;
  color: var(--muted);
  margin-left: auto;
}

.acc-inv-form__block { margin-bottom: 30px; }

.acc-inv-form__section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 16px;
  gap: 20px;
}

.acc-inv-form--sale .acc-inv-form__section-title .acc-inv-form__heading {
  font-size: 17px;
  margin: 0;
  color: var(--mk-ink);
}

.acc-inv-form__section-title span {
  font-size: 11px;
  color: var(--muted);
}

.acc-inv-form__fields {
  display: grid;
  grid-template-columns: 1.4fr 1fr .85fr .85fr 1.1fr;
  gap: 18px;
}

.acc-inv-form__fields--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.acc-inv-form__fields--pavadzime {
  grid-template-columns: 1.2fr .95fr .75fr .75fr .95fr .8fr;
}

.acc-inv-form__line-toolbar {
  background: var(--mk-white);
  padding: 12px 0;
  border-bottom: 1px solid var(--mk-line);
  min-height: 62px;
}

.acc-inv-form__add-line {
  margin: 0;
  padding: 9px 14px;
  border: 1px solid var(--mk-line);
  border-radius: 7px;
  background: var(--mk-white);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--mk-link);
  font-size: 12px;
  line-height: 20px;
  font-weight: 500;
  cursor: pointer;
}

.acc-inv-form__add-line svg { width: 18px; height: 18px; }

.acc-inv-form--sale .acc-inv-form__lines--sale {
  min-width: 1040px;
}

.acc-inv-form--sale .acc-inv-form__lines--sale.acc-inv-form__lines--with-sums,
.acc-inv-form--sale .acc-inv-form__lines--sale.acc-inv-form__lines--with-allowance {
  min-width: 1240px;
}

.acc-inv-form--sale .acc-inv-form__lines--sale th,
.acc-inv-form--sale .acc-inv-form__lines--sale td {
  padding-left: 7px;
  padding-right: 7px;
}

.acc-inv-form--sale .acc-inv-form__lines--sale th {
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
}

.acc-inv-form--sale .acc-inv-form__lines--sale .acc-inv-form__col-nr {
  width: 3%;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
}

.acc-inv-form--sale .acc-inv-form__lines--sale .acc-inv-form__col-name {
  width: 26%;
}

.acc-inv-form--sale .acc-inv-form__lines--sale .acc-input,
.acc-inv-form--sale .acc-inv-form__lines--sale .acc-select {
  height: 38px;
  font-size: 13px;
}

.acc-inv-form__row-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

.acc-inv-form__icon-btn {
  height: 38px;
  width: 30px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 7px;
  padding: 0;
  color: var(--muted);
  cursor: pointer;
}

.acc-inv-form__icon-btn:hover { border-color: var(--mk-line); color: var(--mk-ink); }
.acc-inv-form__icon-btn--remove:hover { color: var(--mk-danger); }
.acc-inv-form__icon-btn svg { width: 18px; height: 18px; display: block; }

.acc-inv-form__extra summary {
  font-size: 15px;
  font-weight: 600;
  color: var(--mk-ink);
  cursor: pointer;
  padding: 12px 0;
}

.acc-inv-form__under {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 335px;
  gap: 65px;
  margin-top: 10px;
}

.acc-inv-form--sale .acc-inv-form__totals {
  border-top: 2px solid var(--mk-ink);
  padding-top: 14px;
  align-self: start;
  scroll-margin-top: var(--header-h);
}

.acc-inv-form--sale .acc-inv-form__totals .acc-inv-form__heading {
  font-size: 16px;
  margin: 0 0 14px;
}

.acc-inv-form--sale .acc-inv-form__totals-dl {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
}

.acc-inv-form--sale .acc-inv-form__totals-dl div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 0;
}

.acc-inv-form--sale .acc-inv-form__totals-dl dt,
.acc-inv-form--sale .acc-inv-form__totals-dl dd {
  margin: 0;
  font-size: 13px;
  font-weight: 400;
  color: var(--text);
}

.acc-inv-form--sale .acc-inv-form__totals-pay dt,
.acc-inv-form--sale .acc-inv-form__totals-pay dd {
  font-weight: 600;
  color: var(--mk-ink);
}

.acc-inv-form--sale .acc-inv-form__vat {
  font-size: 12px;
}

.acc-inv-form--sale .acc-inv-form__block,
.acc-inv-form--sale .acc-inv-form__lines-section,
.acc-inv-form--sale .acc-inv-form__extra,
.acc-inv-form--sale .acc-inv-workflow {
  scroll-margin-top: var(--header-h);
}

.acc-inv-form__bottom {
  position: sticky;
  bottom: 0;
  z-index: 20;
  margin: 24px 0 0;
  padding: 14px 0;
  border-top: 1px solid var(--mk-line);
  background: var(--mk-white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.acc-inv-form__save-state { font-size: 11px; color: var(--muted); }
.acc-inv-form__bottom-actions { display: flex; align-items: center; gap: 12px; }

.acc-inv-form__preview {
  width: min(720px, calc(100% - 32px));
  padding: 26px;
  border: 1px solid var(--mk-line);
  border-radius: 8px;
  background: var(--mk-white);
  color: var(--mk-ink);
}

.acc-inv-form__preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.acc-inv-form__preview::backdrop {
  background: rgba(0, 17, 69, .3);
}

.acc-inv-form__footer-total {
  font-size: 12px;
  color: var(--muted);
}

.acc-inv-form__footer-total strong {
  font-size: 17px;
  color: var(--mk-ink);
  margin-left: 9px;
}

.acc-inv-form--sale .acc-inv-form__extra summary {
  list-style: none;
}

.acc-inv-form--sale .acc-inv-form__extra summary::-webkit-details-marker {
  display: none;
}

.acc-inv-form--sale .acc-inv-form__btn {
  font-family: inherit;
  white-space: nowrap;
}

.acc-main:has(.acc-inv-form--sale) {
  background: var(--mk-white);
}

.acc-view[data-view="rekini"]:has(.acc-inv-form--sale) > .acc-view__header {
  display: none;
}

@media (max-width: 1080px) {
  .acc-inv-form__fields,
  .acc-inv-form__fields--pavadzime { grid-template-columns: 1fr 1fr; }
  .acc-inv-form__fields .acc-field:first-child { grid-column: 1 / -1; }
  .acc-inv-form__under { grid-template-columns: 1fr; gap: 25px; }
}

/* —— Atskaites (Bilance / PZA / NP / PK) — tikai .acc-rep--statements —— */
.acc-main:has(.acc-rep--statements) { background: var(--mk-white); }
.acc-view[data-view="atskaites"]:has(.acc-rep--statements) > .acc-view__header { display: none; }

.acc-rep--statements { color: var(--mk-ink); padding-bottom: 40px; }
.acc-rep__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.acc-rep__page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 23px;
}
.acc-rep__h1 {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.6px;
  margin: 0 0 7px;
  color: var(--mk-ink);
}
.acc-rep__subtitle { font-size: 13px; color: var(--muted); margin: 0; }
.acc-rep__menu { position: relative; }
.acc-rep__menu > summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--mk-line);
  border-radius: 7px;
  background: var(--mk-white);
  padding: 9px 13px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}
.acc-rep__menu > summary::-webkit-details-marker { display: none; }
.acc-rep__menu > summary::after { content: "⌄"; font-size: 14px; }
.acc-rep__dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 205px;
  background: var(--mk-white);
  border: 1px solid var(--mk-line);
  border-radius: 9px;
  padding: 7px;
  box-shadow: var(--shadow-md);
  z-index: 20;
}
.acc-rep__dropdown button {
  display: block;
  width: 100%;
  background: var(--mk-white);
  border: 0;
  text-align: left;
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  border-radius: 5px;
  color: var(--text);
  cursor: pointer;
}
.acc-rep__dropdown button:hover { background: var(--mk-surface); }
.acc-rep__menu-note { font-size: 12px; color: var(--muted); margin: 8px 10px; }
.acc-rep__toolbar {
  position: sticky;
  top: var(--header-h);
  background: var(--mk-white);
  z-index: 10;
  border-top: 1px solid var(--mk-line);
  border-bottom: 1px solid var(--mk-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  margin-bottom: 25px;
}
.acc-rep__tabs { display: flex; gap: 25px; overflow-x: auto; }
.acc-rep__tab {
  border: 0;
  border-bottom: 2px solid transparent;
  background: var(--mk-white);
  color: var(--text);
  padding: 17px 0 15px;
  white-space: nowrap;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}
.acc-rep__tab[aria-selected="true"] {
  color: var(--mk-ink);
  border-color: var(--mk-accent);
  font-weight: 600;
}
.acc-rep__period { display: flex; align-items: center; gap: 10px; flex: none; }
.acc-rep__period > span { font-size: 11px; color: var(--muted); }
.acc-rep__period .acc-select {
  max-width: 160px;
}
.acc-rep__report-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 23px;
  gap: 20px;
}
.acc-rep__report-head h2 {
  font-size: 22px;
  letter-spacing: -.4px;
  line-height: 1.4;
  margin: 0 0 4px;
  font-weight: 600;
  color: var(--mk-ink);
}
.acc-rep__report-head p { font-size: 12px; color: var(--muted); margin: 0; }
.acc-rep__unit { font-size: 11px; color: var(--muted); }
.acc-rep__summary {
  display: flex;
  gap: 38px;
  border-bottom: 1px solid var(--mk-line);
  padding: 0 0 24px;
  margin: 0 0 20px;
}
.acc-rep__summary > div { min-width: 150px; }
.acc-rep__summary dt { font-size: 12px; color: var(--muted); margin-bottom: 7px; }
.acc-rep__summary dd {
  font-size: 26px;
  font-weight: 500;
  color: var(--mk-ink);
  font-variant-numeric: tabular-nums;
  margin: 0;
  line-height: 1.3;
  letter-spacing: -.5px;
}
.acc-rep__summary dd span {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0;
  font-weight: 400;
  margin-left: 7px;
}
.acc-rep__diff { border-left: 1px solid var(--mk-line); padding-left: 35px; }
.acc-rep__tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 18px;
}
.acc-rep__search { position: relative; width: 280px; }
.acc-rep__search input {
  width: 100%;
  height: 38px;
  border: 1px solid var(--mk-line);
  border-radius: 7px;
  padding: 8px 11px;
  color: var(--mk-ink);
  background: var(--mk-white);
  font: inherit;
  font-size: 14px;
}
.acc-rep__toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text);
}
.acc-rep__expand { display: flex; gap: 14px; margin-left: auto; }
.acc-rep__text-btn {
  border: 0;
  background: none;
  padding: 0;
  font-size: 12px;
  font-family: inherit;
  color: var(--mk-link);
  cursor: pointer;
}
.acc-rep__columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 55px;
}
.acc-rep__columns--one { grid-template-columns: 1fr; }
.acc-rep__side-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 10px;
}
.acc-rep__side-title h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  color: var(--mk-ink);
}
.acc-rep__side-title span {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--mk-ink);
}
.acc-rep__col-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  padding: 8px 0;
  border-bottom: 1px solid var(--mk-line);
}
.acc-rep__group { border-bottom: 1px solid var(--mk-line); }
.acc-rep__group > summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--mk-ink);
  list-style: none;
}
.acc-rep__group > summary::-webkit-details-marker { display: none; }
.acc-rep__group-sum { font-variant-numeric: tabular-nums; font-weight: 500; }
.acc-rep__line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--mk-line);
  background: var(--mk-white);
  padding: 11px 0;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.acc-rep__line:hover { background: var(--mk-surface); }
.acc-rep__level-2 { padding-left: 18px; }
.acc-rep__level-3 { padding-left: 32px; }
.acc-rep__value, .acc-rep__label { min-width: 0; }
.acc-rep__value { font-variant-numeric: tabular-nums; flex: none; color: var(--mk-ink); }
.acc-rep__empty { padding: 28px 0; }
.acc-rep__empty h3 { font-size: 16px; margin: 0 0 8px; }
.acc-rep__empty-col { font-size: 13px; color: var(--muted); }
.acc-rep__btn {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--mk-line);
  border-radius: 7px;
  background: var(--mk-white);
  padding: 9px 13px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  color: var(--text);
}
.acc-rep__note { font-size: 12px; color: var(--muted); margin: 22px 0 0; }
.acc-rep__loading { font-size: 13px; color: var(--muted); margin: 12px 0; }
.acc-rep__dialog {
  width: min(720px, calc(100% - 32px));
  padding: 26px;
  border: 1px solid var(--mk-line);
  border-radius: 8px;
  background: var(--mk-white);
  color: var(--mk-ink);
}
.acc-rep__dialog::backdrop { background: rgba(0, 17, 69, .3); }
.acc-rep__dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.acc-rep__dialog-head h2 { font-size: 18px; margin: 0; }
.acc-rep__close {
  width: 31px;
  height: 31px;
  border: 1px solid var(--mk-line);
  border-radius: 7px;
  background: var(--mk-white);
  font-size: 21px;
  cursor: pointer;
}
.acc-rep__dialog-meta {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 12px;
  color: var(--muted);
  padding-bottom: 20px;
  border-bottom: 1px solid var(--mk-line);
}
.acc-rep__dialog-meta strong { font-size: 21px; color: var(--mk-ink); font-weight: 500; }
.acc-rep__dialog-copy { font-size: 13px; color: var(--text); line-height: 1.8; margin: 22px 0; }
.acc-rep__dialog-actions { display: flex; justify-content: flex-end; }

@media (max-width: 1080px) {
  .acc-rep__columns { grid-template-columns: 1fr; gap: 28px; }
  .acc-rep__toolbar { flex-wrap: wrap; gap: 8px; }
  .acc-rep__period { margin-left: auto; }
  .acc-rep__search { width: 100%; }
}

/* —— Rēķinu saraksts — tikai .acc-inv-list —— */
.acc-main:has(.acc-inv-list),
.acc-main:has(.acc-inv-list__tabs) { background: var(--mk-white); }
.acc-view[data-view="rekini"]:has(.acc-inv-list) > .acc-view__header { display: none; }

.acc-inv-list {
  color: var(--mk-ink);
  padding-bottom: 40px;
}
.acc-inv-list svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.acc-inv-list__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.acc-inv-list__page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 25px;
}
.acc-inv-list__page-head .acc-view__actions { padding-top: 0; }
.acc-inv-list__h1 {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.6px;
  margin: 0 0 7px;
  color: var(--mk-ink);
}
.acc-inv-list__subtitle { font-size: 13px; color: var(--muted); margin: 0; }
.acc-inv-list__actions { display: flex; align-items: center; gap: 10px; }
.acc-inv-list__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--mk-line);
  background: var(--mk-white);
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  border-radius: 7px;
  white-space: nowrap;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
}
.acc-inv-list__btn:hover { border-color: var(--mk-accent); background: var(--mk-surface); }
.acc-inv-list__btn--primary {
  background: var(--mk-ink);
  border-color: var(--mk-ink);
  color: var(--mk-white);
}
.acc-inv-list__btn--primary:hover { background: var(--mk-ink-hover); }
.acc-inv-list__btn--sm { padding: 8px 12px; font-size: 12px; }
.acc-inv-list__btn:disabled { opacity: .45; cursor: not-allowed; }
.acc-inv-list__tabs {
  display: flex;
  align-items: center;
  gap: 27px;
  border-top: 1px solid var(--mk-line);
  border-bottom: 1px solid var(--mk-line);
  margin-bottom: 25px;
  overflow-x: auto;
}
.acc-inv-list__tab {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 14px 0 12px;
  white-space: nowrap;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
}
.acc-inv-list__tab[aria-selected="true"] {
  color: var(--mk-ink);
  border-bottom-color: var(--mk-accent);
  font-weight: 600;
}
.acc-inv-list__tab:hover { color: var(--mk-accent); }
.acc-inv-list__filters {
  display: flex;
  align-items: flex-end;
  gap: 13px;
  flex-wrap: wrap;
  margin-bottom: 15px;
}
.acc-inv-list__field { min-width: 0; }
.acc-inv-list__field .acc-field__label { margin-bottom: 6px; }
.acc-inv-list__field--search { flex: 1; min-width: 250px; }
.acc-inv-list__field--date { width: 155px; }
.acc-inv-list__field--kind { width: 185px; }
.acc-inv-list__field--state { width: 150px; }
.acc-inv-list .acc-input,
.acc-inv-list .acc-select {
  height: 38px;
  padding: 8px 11px;
  border-radius: 7px;
}
.acc-inv-list .acc-select { padding-right: 29px; }
.acc-inv-list__search {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--mk-line);
  border-radius: 7px;
  height: 38px;
  padding: 0 11px;
  background: var(--mk-white);
}
.acc-inv-list__search:focus-within { border-color: var(--primary); }
.acc-inv-list__search svg { color: var(--muted); width: 17px; height: 17px; }
.acc-inv-list__search .acc-input {
  border: 0;
  height: 34px;
  padding: 0;
  box-shadow: none;
}
.acc-inv-list__search .acc-input:focus { box-shadow: none; }
.acc-inv-list__clear {
  border: 0;
  background: transparent;
  padding: 10px 0;
  color: var(--mk-accent);
  font-size: 12px;
  font-family: inherit;
  white-space: nowrap;
  cursor: pointer;
}
.acc-inv-list__error {
  font-size: 13px;
  color: var(--danger);
  margin: 0 0 14px;
}
.acc-inv-list__error[hidden] { display: none !important; }
.acc-inv-list__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
  color: var(--muted);
  padding: 8px 0 16px;
  min-height: 55px;
}
.acc-inv-list__meta strong { color: var(--text); font-weight: 500; }
.acc-inv-list__sort {
  display: flex;
  gap: 9px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}
.acc-inv-list__sort .acc-select { height: 38px; max-width: 260px; }
.acc-inv-list__table {
  width: 100%;
  min-width: 960px;
  border-collapse: collapse;
  table-layout: fixed;
}
.acc-inv-list__col-num { width: 14%; }
.acc-inv-list__col-partner { width: 36%; }
.acc-inv-list__col-date { width: 13%; }
.acc-inv-list__col-sum { width: 12%; }
.acc-inv-list__col-cur { width: 8%; }
.acc-inv-list__col-status { width: 10%; }
.acc-inv-list__col-act { width: 7%; }
.acc-inv-list__table th {
  background: var(--mk-white);
  border-top: 1px solid var(--mk-line);
  border-bottom: 1px solid var(--mk-line);
  padding: 12px;
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: .02em;
  color: var(--muted);
  font-weight: 600;
  text-align: left;
  text-transform: none;
  white-space: nowrap;
}
.acc-inv-list__table td {
  border-bottom: 1px solid var(--mk-line);
  padding: 14px 12px;
  color: var(--text);
  font-size: 14px;
  vertical-align: middle;
  white-space: nowrap;
}
.acc-inv-list__table th:first-child,
.acc-inv-list__table td:first-child { padding-left: 0; }
.acc-inv-list__table th:last-child,
.acc-inv-list__table td:last-child { padding-right: 0; }
.acc-inv-list__table .acc-table__num { text-align: right; }
.acc-inv-list__currency { text-align: center; }
.acc-inv-list__date { font-variant-numeric: tabular-nums; white-space: nowrap; }
.acc-inv-list__td-partner { white-space: normal; }
.acc-inv-list__row { cursor: pointer; }
.acc-inv-list__row:hover { background: var(--mk-surface); }
.acc-inv-list__link { color: var(--mk-ink); }
.acc-inv-list__row:hover .acc-inv-list__link { color: var(--mk-accent); }
.acc-inv-list__partner { font-weight: 500; }
.acc-inv-list__unnumbered { color: var(--muted); }
.acc-inv-list__table .acc-badge {
  font-size: 12px;
}
.acc-inv-list__icon-btn {
  height: 33px;
  width: 33px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 6px;
  color: var(--muted);
  padding: 0;
  cursor: pointer;
}
.acc-inv-list__icon-btn:hover { border-color: var(--mk-line); color: var(--mk-ink); }
.acc-inv-list__icon-btn svg { width: 17px; height: 17px; }
.acc-inv-list__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 18px;
  font-size: 13px;
  color: var(--muted);
}
.acc-inv-list__pager { display: flex; align-items: center; gap: 10px; }
.acc-inv-list__page { color: var(--text); }
.acc-inv-list__empty { padding: 45px 10px; text-align: center; }
.acc-inv-list__empty h2 { font-size: 16px; margin: 0 0 8px; font-weight: 600; }
.acc-inv-list__empty p { font-size: 14px; color: var(--muted); margin: 0; }
.acc-inv-list__empty-actions { margin-top: 16px; }
.acc-inv-list__tech { font-size: 11px; margin-top: 8px !important; }
.acc-inv-list__dialog {
  width: min(720px, calc(100% - 40px));
  max-height: calc(100vh - 48px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--mk-line);
  border-radius: 12px;
  background: var(--mk-white);
  color: var(--mk-ink);
  box-shadow: 0 8px 32px rgba(0, 17, 69, .18);
}
.acc-inv-list__dialog::backdrop { background: rgba(0, 17, 69, .32); }
.acc-inv-list__dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: var(--mk-surface);
  border-bottom: 1px solid var(--mk-line);
}
.acc-inv-list__dialog-head h2 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}
.acc-inv-list__dialog-head .acc-inv-list__icon-btn {
  border-color: var(--mk-line);
  width: 28px;
  height: 28px;
  font-size: 17px;
  color: var(--text);
}
.acc-inv-list__dialog-copy {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
  margin: 0;
  padding: 16px 20px 0;
}
.acc-inv-list__dialog .acc-field { padding: 16px 20px 0; }
.acc-inv-list__monthly-note {
  border-top: 1px solid var(--mk-line);
  padding: 15px 20px 0;
  margin: 17px 0 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.8;
}
.acc-inv-list__monthly-result {
  font-size: 13px;
  line-height: 1.8;
  margin: 16px 20px 0;
}
.acc-inv-list__monthly-table { padding: 12px 20px 0; }
.acc-inv-list__monthly-table .acc-inv-list__table { min-width: 0; table-layout: auto; }
.acc-inv-list__monthly-create { padding: 12px 20px 0; margin: 0; }
.acc-inv-list__dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--mk-line);
  margin-top: 18px;
}

@media (max-width: 1080px) {
  .acc-inv-list__field--search { flex-basis: 100%; }
  .acc-inv-list__page-head { align-items: flex-start; }
}
@media (max-width: 700px) {
  .acc-inv-list__page-head { flex-wrap: wrap; }
  .acc-inv-list__actions { width: 100%; justify-content: flex-end; }
  .acc-inv-list__filters { display: grid; grid-template-columns: 1fr 1fr; }
  .acc-inv-list__field--search { grid-column: 1 / -1; min-width: 0; }
  .acc-inv-list__field--date,
  .acc-inv-list__field--kind,
  .acc-inv-list__field--state { width: auto; }
  .acc-inv-list__sort > span { display: none; }
  .acc-inv-list__bottom { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 640px) {
  .acc-inv-list__dialog {
    width: 100%;
    max-height: 90vh;
    border-radius: 12px 12px 0 0;
    margin: auto 0 0;
  }
  .acc-inv-list__dialog-actions {
    flex-direction: column;
  }
  .acc-inv-list__dialog-actions .acc-inv-list__btn { width: 100%; }
}

.acc-inv-form__title-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 16px;
}

.acc-inv-form__title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

.acc-inv-form__meta {
  font-size: 12px;
  font-family: ui-monospace, monospace;
  color: var(--faint);
}

.acc-inv-form__section {
  padding: 16px 20px 18px;
  margin-bottom: 16px;
}

.acc-inv-form__section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.acc-inv-form__heading {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 14px;
  color: var(--text);
}

.acc-inv-form__section-head .acc-inv-form__heading { margin-bottom: 0; }

.acc-inv-form__subheading {
  font-size: 13px;
  font-weight: 600;
  margin: 16px 0 8px;
  color: var(--muted);
}

.acc-inv-form__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px 16px;
}

.acc-inv-form__partner { position: relative; }

.acc-inv-form__partner-q { position: relative; }

.acc-inv-form__partner--add .acc-inv-form__partner-q .acc-input {
  padding-right: 38px;
}

.acc-inv-form__partner-q input[type="search"]::-webkit-search-cancel-button,
.acc-inv-form__partner-q input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.acc-inv-form__partner-split {
  position: absolute;
  top: 8px;
  bottom: 8px;
  right: 38px;
  width: 1px;
  background: var(--mk-line);
  pointer-events: none;
}

.acc-inv-form__partner-add {
  position: absolute;
  top: 0;
  right: 0;
  width: 38px;
  height: 38px;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--mk-ink);
  font: inherit;
  font-size: 15px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
}

.acc-inv-form__partner-add:focus-visible {
  outline: 2px solid var(--mk-accent);
  outline-offset: -2px;
}

.acc-pur-manual__account-cell { min-width: 0; }
.acc-pur-manual__account { position: relative; min-width: 0; }
.acc-pur-manual__doc-account { min-width: 220px; }

.acc-pur-view__doc-account {
  margin-top: 12px;
  max-width: 28rem;
}

.acc-pur-view__doc-account-ro {
  margin: 0;
  font-size: 14px;
}

.acc-inv-form__partner-list {
  position: absolute;
  z-index: 50;
  left: 0;
  right: 0;
  top: 100%;
  margin: 4px 0 0;
  padding: 4px 0;
  list-style: none;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  max-height: 240px;
  overflow-y: auto;
}

.acc-inv-form__partner-opt {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  font-size: 14px;
  font-family: inherit;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text);
}

.acc-inv-form__partner-opt:hover,
.acc-inv-form__partner-opt:focus {
  background: var(--primary-soft);
  outline: none;
}

.acc-inv-form__lookup-warn {
  font-size: 12px;
  color: var(--warning, #b54708);
  margin: 4px 0 0;
}

.acc-reg-lookup__status {
  font-size: 12px;
  color: var(--muted);
  margin: 4px 0 0;
}

.acc-reg-lookup__status--loading {
  font-style: italic;
}

.acc-reg-lookup__status--warn {
  color: var(--warning, #b54708);
}

.acc-inv-form__hint {
  font-size: 13px;
  color: var(--muted);
  margin: 12px 0 0;
}

.acc-inv-form__hint--block { margin: 0 0 12px; }

.acc-inv-form__readonly {
  margin: 0;
  padding: 8px 0;
  font-weight: 500;
}

.acc-inv-form__lines th,
.acc-inv-form__lines td {
  padding-left: 16px;
  padding-right: 16px;
}

.acc-inv-form__lines .acc-input,
.acc-inv-form__lines .acc-select {
  min-width: 0;
  font-size: 13px;
}

.acc-inv-form__lines .acc-input {
  height: 38px;
  padding: 8px 8px;
}

.acc-inv-form__lines .acc-select {
  height: 38px;
  padding: 8px 22px 8px 8px;
}

.acc-inv-form__lines--sale {
  table-layout: fixed;
  width: 100%;
}

.acc-inv-form__lines--sale .acc-inv-form__col-name {
  width: 42%;
}

.acc-inv-form__lines--sale .acc-inv-form__col-qty,
.acc-inv-form__lines--sale .acc-inv-form__col-unit {
  padding-left: 8px;
  padding-right: 8px;
}

.acc-inv-form__lines--sale .acc-inv-form__col-qty {
  width: calc(4.5em + 16px);
}

.acc-inv-form__lines--sale .acc-inv-form__col-unit {
  width: calc(5.8em + 16px);
}

.acc-inv-form__lines--purchase {
  table-layout: fixed;
  width: 100%;
}

.acc-inv-form__lines--purchase .acc-inv-form__col-qty,
.acc-inv-form__lines--purchase .acc-inv-form__col-unit {
  padding-left: 8px;
  padding-right: 8px;
}

.acc-inv-form__lines--purchase .acc-inv-form__col-qty {
  width: 4.2em;
}

.acc-inv-form__lines--purchase .acc-inv-form__col-unit {
  width: 3.2em;
}

.acc-inv-form__lines--purchase th,
.acc-inv-form__lines--purchase td {
  padding-left: 8px;
  padding-right: 8px;
}

.acc-inv-form__lines--purchase .acc-inv-form__col-account {
  width: calc(5ch + 28px);
}

.acc-inv-form__lines--purchase .acc-inv-form__col-price,
.acc-inv-form__lines--purchase .acc-inv-form__col-net {
  width: 5.6em;
}

.acc-inv-form__lines--purchase .acc-inv-form__col-tax {
  width: 7em;
}

.acc-input--num { text-align: right; font-variant-numeric: tabular-nums; }

.acc-inv-form__line-actions { width: 40px; text-align: center; }

.acc-inv-form__readonly-banner {
  padding: 12px 16px;
  margin-bottom: 16px;
  background: #fffaeb;
  border: 1px solid #fedf89;
  border-radius: var(--radius);
  font-size: 14px;
  color: #93370d;
}

.acc-inv-form__readonly-banner p { margin: 0; }

.acc-inv-form__error {
  padding: 14px 18px;
  margin-bottom: 16px;
  border-left: 4px solid var(--danger);
}

.acc-inv-form__error-msg {
  margin: 0;
  font-size: 14px;
  color: var(--text);
}

.acc-inv-form__error-fields {
  margin: 8px 0 0;
  padding-left: 20px;
  font-size: 13px;
  color: var(--text);
}

.acc-inv-form__error-fields li { margin: 4px 0; }

.acc-field--error .acc-input,
.acc-field--error .acc-select,
.acc-input.acc-input--error,
.acc-select.acc-select--error {
  border-color: var(--danger, #c0392b);
  box-shadow: 0 0 0 1px var(--danger, #c0392b);
}

.acc-inv-form__error-details {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.acc-inv-form__error-details code {
  font-family: ui-monospace, monospace;
  color: var(--faint);
}

.acc-inv-form__totals-dl {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px 20px;
  margin: 0 0 8px;
}

.acc-inv-form__totals-dl div { min-width: 0; }

.acc-inv-form__totals-dl dt {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin: 0 0 2px;
}

.acc-inv-form__totals-dl dd {
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin: 0;
  color: var(--text);
}

.acc-inv-form__totals-pay dd { color: var(--primary); }

.acc-inv-form__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 4px;
}

.acc-inv-form__saving {
  font-size: 14px;
  color: var(--muted);
}

.acc-inv-form__loading {
  padding: 0;
}

.acc-inv-form__loading .acc-load-skeleton {
  padding: 40px 32px;
}

@media (max-width: 768px) {
  .acc-inv-form__grid { grid-template-columns: 1fr; }
  .acc-inv-form__lines { font-size: 13px; }
}

/* —— Rēķina process (F1.6.4) —— */
.acc-inv-workflow { margin-bottom: 16px; }

.acc-inv-workflow__actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 14px 0 10px;
}

.acc-inv-workflow__busy {
  font-size: 13px;
  color: var(--muted);
}

.acc-inv-workflow__hint {
  font-size: 13px;
  color: var(--muted);
  margin: 8px 0 0;
}

.acc-inv-workflow__hint--ok { color: var(--success); }

.acc-inv-workflow__status-extra {
  font-size: 13px;
  color: var(--muted);
  margin: 8px 0 0;
}

.acc-inv-workflow__entry {
  font-size: 13px;
  color: var(--text);
  margin: 0 0 8px;
}

.acc-inv-workflow__feedback {
  font-size: 14px;
  padding: 10px 14px;
  margin: 12px 0 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
}

.acc-inv-workflow__feedback--ok {
  border-color: #abefc6;
  background: #f0fdf4;
  color: var(--success);
}

.acc-inv-workflow__feedback--info {
  border-color: var(--border);
  background: var(--primary-soft);
  color: var(--text);
}

.acc-inv-workflow__feedback--warn {
  border-color: #fedf89;
  background: var(--warning-soft);
  color: var(--warning);
}

/* Dzīves cikla josla */
.acc-lifecycle { margin: 4px 0 0; }

.acc-lifecycle__list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0;
}

.acc-lifecycle__step {
  flex: 1;
  position: relative;
  text-align: center;
  padding: 0 4px 0 0;
}

.acc-lifecycle__step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 11px;
  left: calc(50% + 14px);
  right: calc(-50% + 14px);
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.acc-lifecycle__step--done:not(:last-child)::after {
  background: var(--primary);
}

.acc-lifecycle__marker {
  display: block;
  width: 22px;
  height: 22px;
  margin: 0 auto 6px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--panel);
  position: relative;
  z-index: 1;
}

.acc-lifecycle__step--done .acc-lifecycle__marker {
  border-color: var(--primary);
  background: var(--primary);
}

.acc-lifecycle__step--done .acc-lifecycle__marker::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 3px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.acc-lifecycle__step--current .acc-lifecycle__marker {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 1px rgba(61, 143, 250, .15);
}

.acc-lifecycle__step--pending .acc-lifecycle__marker {
  border-color: var(--line-strong);
  background: var(--bg);
}

.acc-lifecycle__step--neutral .acc-lifecycle__marker {
  border-color: var(--border);
  background: var(--bg);
}

.acc-lifecycle__label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.3;
}

.acc-lifecycle__step--current .acc-lifecycle__label {
  color: var(--primary);
  font-weight: 600;
}

.acc-lifecycle__step--done .acc-lifecycle__label {
  color: var(--text);
}

/* Validācijas saraksts */
.acc-val-list { margin-top: 12px; }

.acc-val-list__title {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--text);
}

.acc-val-list--error .acc-val-list__title { color: var(--danger); }
.acc-val-list--warn .acc-val-list__title { color: var(--warning); }

.acc-val-list__items {
  list-style: none;
  margin: 0;
  padding: 0;
}

.acc-val-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 12px;
  padding: 8px 12px;
  margin-bottom: 4px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.acc-val-item--error {
  background: var(--danger-soft);
  border-left: 3px solid var(--danger);
}

.acc-val-item--warn {
  background: var(--warning-soft);
  border-left: 3px solid var(--warning);
}

.acc-val-item--info {
  background: var(--bg);
  border-left: 3px solid var(--line-strong);
}

.acc-val-item__message {
  flex: 1;
  min-width: 0;
  color: var(--text);
}

.acc-val-item__code {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  color: var(--faint);
  white-space: nowrap;
}

/* Kritiskās darbības poga */
.acc-btn--critical {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line-strong);
  font-weight: 600;
}

.acc-btn--critical:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

/* Apstiprinājuma modālis — Morrowkey §7 */
.acc-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.acc-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 17, 69, .32);
}

.acc-modal__dialog {
  position: relative;
  width: calc(100% - 40px);
  max-width: 420px;
  max-height: calc(100vh - 48px);
  background: var(--mk-white);
  border: 1px solid var(--mk-line);
  border-radius: 12px;
  padding: 16px 20px 18px;
  box-shadow: var(--shadow-md);
}

.acc-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 1;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--mk-line);
  border-radius: 6px;
  background: var(--mk-white);
  color: var(--mk-ink);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}

.acc-modal__close:hover {
  border-color: var(--mk-accent);
}

.acc-modal__title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 36px 10px 0;
  color: var(--mk-ink);
}

.acc-modal__text {
  font-size: 14px;
  color: var(--mk-slate);
  margin: 2px 36px 16px 0;
  line-height: 1.5;
}

.acc-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.acc-main.acc-modal-open,
body.acc-modal-open {
  overflow: hidden !important;
}

.acc-modal__dialog--wide {
  max-width: min(720px, calc(100% - 40px));
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.acc-modal__dialog--wide .acc-modal__header {
  flex-shrink: 0;
  padding: 14px 48px 14px 18px;
  background: var(--mk-surface);
  border-bottom: 1px solid var(--mk-line);
}

.acc-modal__dialog--wide .acc-modal__body {
  flex: 1 1 auto;
  overflow: auto;
  padding: 12px 24px;
  max-height: min(62vh, 560px);
}

.acc-modal__dialog--wide .acc-modal__footer {
  flex-shrink: 0;
  padding: 12px 24px 20px;
  border-top: 1px solid var(--border);
}

.acc-modal__footer .acc-modal__actions {
  margin-top: 12px;
}

.acc-table__account-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.acc-table__amount {
  white-space: nowrap;
  text-align: right;
}

.acc-table__nowrap {
  white-space: nowrap;
}

.acc-pur-posting-table-wrap {
  overflow-x: auto;
}

.acc-pur-posting-table {
  table-layout: fixed;
  width: 100%;
  min-width: 640px;
}

.acc-pur-posting-table th:nth-child(1),
.acc-pur-posting-table td:nth-child(1) { width: 44px; }

.acc-pur-posting-table th:nth-child(2),
.acc-pur-posting-table td:nth-child(2) { width: 76px; }

.acc-pur-posting-table th:last-child,
.acc-pur-posting-table td:last-child { width: 112px; }

.acc-pur-posting-table__account,
.acc-pur-posting-table__desc {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.acc-pur-posting-table__desc {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

@media (max-width: 768px) {
  .acc-lifecycle__label { font-size: 11px; }
  .acc-lifecycle__step:not(:last-child)::after { display: none; }
  .acc-lifecycle__list { flex-direction: column; gap: 8px; }
  .acc-lifecycle__step { text-align: left; display: flex; align-items: center; gap: 10px; }
  .acc-lifecycle__marker { margin: 0; flex-shrink: 0; }
  .acc-modal__actions { flex-direction: column-reverse; }
  .acc-modal__actions .acc-btn { width: 100%; }
}

/* —— Izsniegta rēķina skats (F1.6.5) —— */
.acc-inv-view { margin-bottom: 24px; }

.acc-inv-view__header {
  margin-bottom: 16px;
}

.acc-inv-view__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.acc-inv-view__title {
  font-size: 22px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

.acc-inv-view__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 16px;
  align-items: start;
}

/* F2.2a: anketa ir darba vieta, ne metadatu josla. */
.acc-inv-view__layout--ocr {
  grid-template-columns: minmax(0, 1.4fr) minmax(360px, 1fr);
}

.acc-inv-view__main,
.acc-inv-view__aside {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.acc-inv-view__section,
.acc-inv-workflow {
  padding: 18px 20px;
}

.acc-inv-view__section { margin-bottom: 0; }

.acc-inv-view__section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.acc-inv-view__meta-dl {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px 20px;
  margin: 0 0 20px;
}

.acc-inv-view__meta-dl dt {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin: 0 0 2px;
}

.acc-inv-view__meta-dl dd {
  margin: 0;
  font-size: 14px;
  color: var(--text);
}

.acc-inv-view__hint {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

.acc-inv-view__hint--ok { color: var(--success); }
.acc-inv-view__hint--error { color: var(--danger); }

.acc-inv-view__pdf-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f1f5f9;
  overflow: hidden;
}

.acc-inv-view__pdf-frame {
  display: block;
  width: 100%;
  height: 640px;
  border: 0;
  background: #fff;
}

img.acc-inv-view__pdf-frame {
  height: auto;
  max-height: 640px;
  object-fit: contain;
}

.acc-inv-view__print {
  padding: 16px 20px 18px;
  background: var(--mk-white);
}

.acc-inv-view__print-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.acc-inv-view__print-head .acc-inv-form__title {
  text-align: right;
}

.acc-inv-view__print-head .acc-inv-form__meta {
  text-align: right;
  margin: 4px 0 0;
}

.acc-inv-view__print-grid {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  align-items: flex-start;
}

.acc-inv-view__print-grid > * {
  flex: 1;
  min-width: 0;
}

.acc-inv-view__print-buyer {
  background: var(--mk-surface);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
}

.acc-inv-view__print-pay,
.acc-inv-view__print-notes {
  margin-top: 16px;
}

.acc-inv-view__print-pay p,
.acc-inv-view__print-notes p {
  margin: 0;
}

.acc-inv-view__print-foot {
  margin-top: 16px;
  color: var(--muted);
}

.acc-inv-view__file-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.acc-inv-view__file-state--error {
  padding: 12px;
  background: var(--danger-soft);
  border: 1px solid #fecdca;
  border-radius: var(--radius-sm);
}

.acc-inv-view__file-state--error p {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--danger);
}

.acc-inv-view__xml {
  margin: 0;
  padding: 14px;
  max-height: 420px;
  overflow: auto;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.45;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  white-space: pre-wrap;
  word-break: break-word;
}

.acc-inv-view__transport-note {
  margin: 0 0 12px;
  padding: 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  background: var(--warning-soft);
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
}

.acc-inv-view__transport-note strong { color: var(--warning); }

.acc-inv-view__snapshot {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.acc-inv-view__snapshot:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.acc-inv-view__snapshot-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--text);
}

.acc-inv-view__snapshot-note {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 12px;
  line-height: 1.45;
}

.acc-inv-view__snapshot-dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.acc-inv-view__snapshot-dl dt {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  margin: 0;
}

.acc-inv-view__snapshot-dl dd {
  margin: 0 0 4px;
  font-size: 13px;
  color: var(--text);
}

.acc-inv-view__entry-line {
  font-size: 14px;
  margin: 0 0 8px;
}

.acc-inv-view__audit-time {
  white-space: nowrap;
  font-size: 13px;
  color: var(--muted);
}

.acc-inv-view__vat-wrap { margin-top: 12px; }

.acc-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.acc-link:hover { text-decoration: underline; }

@media (max-width: 1024px) {
  .acc-inv-view__layout { grid-template-columns: 1fr; }
  .acc-inv-view__pdf-frame { height: 480px; }
}

@media (max-width: 860px) {
  .acc-inv-view__layout--ocr { grid-template-columns: 1fr; }
}

/* —— Formas elementi (select) — Morrowkey §11 —— */
.acc-select {
  box-sizing: border-box;
  height: 38px;
  max-width: 320px;
  padding: 8px 11px;
  padding-right: 29px;
  border: 1px solid var(--mk-line);
  border-radius: 7px;
  background-color: var(--mk-white);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='m2 2 4 4 4-4' fill='none' stroke='%236780a3' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
  -webkit-appearance: none;
  appearance: none;
}

.acc-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--mk-ring);
}

.acc-select:disabled {
  opacity: .4;
  cursor: not-allowed;
}

/* —— Kļūdu paziņojumi —— */
.acc-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  max-width: 420px;
  padding: 14px 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  font-size: 14px;
  animation: acc-toast-in .2s ease;
}

.acc-toast--error {
  border-left: 4px solid var(--danger);
}

.acc-toast--warn {
  border-left: 4px solid var(--warning);
}

.acc-toast__message {
  margin: 0;
  color: var(--text);
}

.acc-toast__code {
  margin: 6px 0 0;
  font-size: 11px;
  font-family: ui-monospace, monospace;
  color: var(--faint);
}

@keyframes acc-toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* —— Ielādes stāvoklis —— */
.acc-loading {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}

.acc-loading__inner {
  text-align: center;
  max-width: 280px;
  width: 100%;
}

.acc-loading__brand {
  margin-bottom: 16px;
}

.acc-loading__brand img {
  height: 22px;
  width: auto;
  display: block;
  margin: 0 auto;
}

.acc-loading__text {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 20px;
}

.acc-loading__bars {
  max-width: 200px;
  margin: 0 auto;
}

.acc-loading.is-hidden { display: none; }

/* —— Inicializācijas kļūda —— */
.acc-init-error {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}

.acc-init-error__card {
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.acc-init-error__logo {
  margin-bottom: 16px;
}

.acc-init-error__logo img {
  height: 22px;
  width: auto;
  display: block;
  margin: 0 auto;
}

.acc-init-error__title {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--text);
}

.acc-init-error__text {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 24px;
  text-align: left;
}

.acc-init-error__message {
  margin: 0 0 12px;
  text-align: center;
}

.acc-init-error__stack {
  margin: 0;
  padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 6px);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.acc-init-error__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* —— Tukšs uzņēmumu saraksts —— */
.acc-empty {
  max-width: 480px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

.acc-empty__title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px;
}

.acc-empty__text {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}

.acc-view { display: none; }
.acc-view.is-active { display: block; }

/* —— Mobilā adaptācija —— */
@media (max-width: 768px) {
  .acc-header { z-index: 220; }
  .acc-header__brand { width: 150px; padding: 0 12px; }
  .acc-header__utils { padding: 0 12px; }
  .acc-header__company { flex: 1; min-width: 0; }
  .acc-header__company-label { display: none; }
  .acc-header__company .acc-select {
    max-width: none;
    width: 100%;
  }
  .acc-header__company-name { max-width: none; }
  .acc-topnav > .acc-nav__link,
  .acc-menu__summary { font-size: 12px; padding: 7px 8px; }
  .acc-menu__panel { min-width: 200px; }
  .acc-main { padding: 16px 28px; }
  .acc-view__header--row { flex-direction: column; }
  .acc-view[data-view="sanemtie"] > .acc-inv-list__page-head {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .acc-view__actions { width: 100%; }
  .acc-view__actions .acc-btn { width: 100%; }
  #accPurchasesActions .acc-inv-list__actions {
    width: 100%;
    justify-content: flex-end;
  }
  .acc-invoices-filters__row { flex-direction: column; }
  .acc-pur-import__tabs.acc-invoices-filters__row {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 6px;
  }
  .acc-pur-import__tabs .acc-btn {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    padding: 8px 6px;
    font-size: 13px;
  }
  .acc-field--grow { flex: 1 1 auto; }
  .acc-pagination { flex-direction: column; align-items: stretch; }
  .acc-pagination__controls { justify-content: center; }
  .acc-inv-view__pdf-frame { min-height: 360px; height: 50vh; }

  .acc-pur-import__row--desktop { display: none; }
  .acc-pur-import__mobile-pick {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .acc-pur-import__mobile-pick .acc-btn {
    width: 100%;
    min-height: 48px;
  }
  .acc-vision-drop { display: none; }
}

/* =============================================================================
   Saņemtie rēķini (F2.1)
   ============================================================================= */

/* —— Stāvokļa apzīme —— */
.acc-badge--received {
  color: #0b4a6f;
  background: #f0f9ff;
  border: 1px solid #b9e6fe;
}

/* —— Sadaļas galvenes darbības —— */
.acc-pur-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* —— Filtru čipi (partija, piegādātājs) —— */
.acc-pur-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.acc-pur-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 10px;
  font-size: 13px;
  color: var(--text);
  background: var(--primary-soft);
  border: 1px solid #c7d7fe;
  border-radius: var(--radius-sm);
}

.acc-pur-chip__x {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
  color: var(--muted);
  font-family: inherit;
}

.acc-pur-chip__x:hover { color: var(--danger); }

.acc-pur-field-note {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

/* —— Procesa josla (kompakta) —— */
.acc-pur-toolbar {
  margin: 0;
  padding: 0;
}

.acc-pur-toolbar__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.acc-pur-toolbar__spacer {
  flex: 1 1 auto;
  min-width: 8px;
}

.acc-pur-toolbar__actions {
  flex-shrink: 0;
}

.acc-pur-toolbar__actions .acc-inv-workflow__actions-row {
  flex-wrap: wrap;
  gap: 6px;
}

.acc-pur-toolbar__reasons {
  margin: 4px 0 0;
  padding: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}

/* —— Atradumu kompaktā josla —— */
.acc-pur-findings-bar-wrap {
  position: relative;
  flex-shrink: 0;
}

.acc-pur-findings-bar {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.acc-pur-findings-bar:disabled {
  cursor: default;
  opacity: .85;
}

.acc-pur-findings-bar--error {
  color: var(--danger);
  border-color: #fecdca;
  background: var(--danger-soft);
}

.acc-pur-findings-bar--warn {
  color: #b54708;
  border-color: #fedf89;
  background: var(--warning-soft);
}

.acc-pur-findings-bar--ok {
  color: var(--muted);
}

.acc-pur-findings-bar--loading {
  cursor: default;
  color: var(--muted);
  font-weight: 400;
}

.acc-pur-findings-pop {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 30;
  min-width: min(420px, 92vw);
  max-width: min(520px, 96vw);
  max-height: min(360px, 60vh);
  overflow: auto;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
}

.acc-pur-findings-pop .acc-val-list__items {
  margin: 0;
}

.acc-pur-findings-pop .acc-pur-findings__summary {
  margin-bottom: 8px;
}

.acc-pur-workflow__actions {
  margin-top: 0;
}

.acc-pur-workflow__reasons {
  list-style: none;
  margin: 10px 0 0;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.acc-pur-workflow__reasons li { margin: 0; }
.acc-pur-workflow__reasons li + li { margin-top: 6px; }

/* —— Atradumu saraksts —— */
.acc-pur-findings__summary {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin: 0 0 10px;
}

.acc-pur-findings__summary--error { color: var(--danger); }
.acc-pur-findings__summary--ok { color: var(--success); }

.acc-pur-findings__hint {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.acc-pur-findings__where {
  display: block;
  margin-top: 2px;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  color: var(--faint);
}

/* —— Kartīte —— */
.acc-pur-view__sticky {
  position: sticky;
  top: 0;
  z-index: 15;
  margin-bottom: 10px;
  padding-bottom: 8px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.acc-pur-view__findings-row {
  margin-top: 2px;
}

.acc-pur-view__top-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 10px;
  margin-bottom: 10px;
  align-items: start;
}

.acc-pur-actions-panel .acc-pur-toolbar__actions {
  margin-top: 0;
}

.acc-pur-actions-panel .acc-inv-workflow__actions-row {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.acc-pur-actions-panel .acc-inv-workflow__actions-row .acc-btn {
  width: 100%;
  justify-content: center;
}

.acc-pur-actions-panel .acc-pur-toolbar__reasons {
  margin-top: 8px;
}

.acc-pur-account-portal {
  position: fixed;
  left: 0;
  top: 0;
  margin: 0;
  overflow-y: auto;
  min-width: 240px;
}

.acc-pur-account-portal .acc-inv-form__partner-opt.is-active {
  background: var(--primary-soft);
}

.acc-pur-view__header {
  margin-bottom: 6px;
}

.acc-pur-view__doc-id {
  margin-left: auto;
  font-size: 12px;
}

.acc-pur-view__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.acc-pur-view__section--compact,
.acc-pur-view .acc-inv-view__section {
  padding: 12px 14px;
}

.acc-pur-view__section-title {
  font-size: 15px;
  margin-bottom: 8px;
}

.acc-pur-view .acc-inv-form__subheading {
  margin: 10px 0 6px;
  font-size: 13px;
}

.acc-pur-view__meta-dl {
  gap: 8px 16px;
  margin-bottom: 10px;
}

.acc-pur-view__source-inline {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

.acc-pur-view__lines-wrap {
  overflow-x: visible;
}

.acc-pur-view__lines {
  font-size: 13px;
  table-layout: fixed;
  width: 100%;
}

.acc-pur-view__lines th:nth-child(1),
.acc-pur-view__lines td:nth-child(1) { width: 34px; }

.acc-pur-view__lines th.acc-pur-view__col-qty,
.acc-pur-view__lines td.acc-pur-view__col-qty {
  width: 4.2em;
}

.acc-pur-view__lines th.acc-pur-view__col-unit,
.acc-pur-view__lines td.acc-pur-view__col-unit {
  width: 3.2em;
}

.acc-pur-view__lines th.acc-pur-view__col-money,
.acc-pur-view__lines td.acc-pur-view__col-money {
  width: 5.6em;
}

.acc-pur-view__lines th.acc-pur-view__col-account,
.acc-pur-view__lines td.acc-pur-view__col-account {
  width: calc(5ch + 28px);
}

.acc-pur-view__lines td.acc-pur-view__col-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.acc-pur-view__lines .acc-table__num {
  white-space: nowrap;
}

.acc-pur-view__lines--ext-unit th:nth-child(5),
.acc-pur-view__lines--ext-unit td:nth-child(5) { width: 52px; }

.acc-pur-view__account-cell {
  min-width: 0;
  overflow: hidden;
}

.acc-pur-view__account-cell--readonly .acc-table__account-name {
  font-size: 12px;
}

.acc-pur-view__account {
  position: relative;
  min-width: 0;
}

.acc-pur-view__account .acc-input--compact {
  width: 100%;
  min-width: 0;
}

.acc-table--compact th,
.acc-table--compact td {
  padding: 6px 8px;
}

.acc-input--compact {
  height: auto;
  padding: 4px 6px;
  font-size: 12px;
}

.acc-pur-view__line-no {
  white-space: nowrap;
}

.acc-pur-line-flag {
  display: inline-block;
  width: 14px;
  margin-right: 2px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  vertical-align: middle;
  cursor: help;
}

.acc-pur-line-flag--error { color: var(--danger); }
.acc-pur-line-flag--warn { color: #b54708; }
.acc-pur-line-flag--info { color: var(--muted); }

.acc-pur-view__totals-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 16px;
  margin: 4px 0 0;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.acc-pur-view__totals-item {
  white-space: nowrap;
}

.acc-pur-view__totals-bruto {
  font-weight: 600;
  color: var(--primary);
}

.acc-pur-view__fold {
  padding: 0;
  overflow: hidden;
}

.acc-pur-view__fold-summary {
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.acc-pur-view__fold-summary::-webkit-details-marker { display: none; }

.acc-pur-view__fold-summary::before {
  content: "▸";
  display: inline-block;
  width: 1em;
  margin-right: 6px;
  color: var(--muted);
  transition: transform .15s ease;
}

.acc-pur-view__fold[open] > .acc-pur-view__fold-summary::before {
  transform: rotate(90deg);
}

.acc-pur-view__fold-body {
  padding: 0 14px 12px;
  border-top: 1px solid var(--border);
}

.acc-pur-view__fold-body > .acc-inv-form__heading:first-child {
  display: none;
}

.acc-pur-view .acc-inv-view__header {
  margin-bottom: 0;
}

.acc-pur-view__source-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
}

.acc-pur-view__reject {
  padding: 12px 14px;
  margin: 0 0 16px;
  font-size: 14px;
  color: #912018;
  background: var(--danger-soft);
  border: 1px solid #fecdca;
  border-radius: var(--radius-sm);
}

.acc-pur-view__batch-link,
.acc-pur-view__note {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 8px;
}

.acc-pur-view__link-btn {
  border: none;
  background: transparent;
  padding: 0;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}

.acc-pur-view__link-btn:hover { text-decoration: underline; }

.acc-pur-view__unit-src {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

/* —— Pielikuma pievienošana —— */
.acc-pur-view__upload {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.acc-pur-view__upload-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.acc-pur-view__file { flex: 1 1 220px; padding: 6px 8px; }

.acc-pur-view__upload-error,
.acc-pur-import__error {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--danger);
}

/* —— Augšupielāde un priekšskatījums —— */
.acc-pur-import__panel {
  padding: 18px 20px;
  margin-bottom: 16px;
}

.acc-pur-import__lead {
  font-size: 14px;
  color: var(--text);
  margin: 0 0 10px;
}

.acc-pur-import__rules {
  margin: 0 0 16px;
  padding-left: 20px;
  font-size: 13px;
  color: var(--muted);
}

.acc-pur-import__rules li { margin: 2px 0; }

.acc-pur-import__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.acc-pur-import__mobile-pick { display: none; }

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

.acc-pur-import__file { flex: 1 1 260px; padding: 6px 8px; }

.acc-pur-import__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.acc-pur-import__blocked {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--danger);
}

.acc-pur-import__notice {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
}

.acc-pur-import__notice--info {
  border-color: #c7d7fe;
  background: var(--primary-soft);
}

.acc-pur-import__notice p {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--text);
}

/* —— Importa partijas —— */
.acc-pur-batch__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 12px;
  margin: 0 0 16px;
}

.acc-pur-batch__stat {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  text-align: center;
}

.acc-pur-batch__stat-value {
  display: block;
  font-size: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.acc-pur-batch__stat-label {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.acc-pur-batch__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding-top: 4px;
}

.acc-pur-reason {
  min-height: 72px;
  resize: vertical;
  margin-bottom: 16px;
}

/* —— Korekcijas panelis —— */
.acc-pur-corr__fields {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.acc-pur-corr__fields .acc-field { flex: 1 1 150px; }

.acc-pur-corr__table select { min-width: 140px; }

.acc-pur-corr__note {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.acc-pur-corr__changes {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  font-size: 13px;
}

.acc-pur-corr__changes li { margin: 2px 0; }

.acc-pur-corr__left {
  margin: 8px 0 0;
  font-size: 13px;
}

.acc-pur-corr__left--ok { color: var(--success); }

.acc-pur-corr__where {
  margin: 6px 0 0;
  font-size: 12px;
}

.acc-pur-corr__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 12px;
}

tr.acc-pur-corr__flag > td { background: var(--warning-soft); }

select.acc-pur-corr__flag,
input.acc-pur-corr__flag {
  border-color: var(--warning);
  box-shadow: 0 0 0 1px var(--warning);
}

@media (max-width: 1100px) {
  .acc-pur-view__top-grid {
    grid-template-columns: 1fr;
  }

  .acc-pur-view__top-grid .acc-pur-actions-panel {
    order: -1;
  }
}

@media (max-width: 768px) {
  .acc-pur-view__upload-row .acc-btn,
  .acc-pur-import__row .acc-btn { width: 100%; }
  .acc-pur-corr__actions .acc-btn { width: 100%; }
}

/* —— Maksājumi un norēķini (F2.3) ——
   Ekrāns izkārtojumu ņem no esošajām klasēm (`acc-invoices-filters__*`,
   `acc-inv-form__*`, `acc-pur-view__*`, `acc-table__num`). Sava definīcija ir
   tikai nesadalītā atlikuma paziņojumam: neitrāla informatīva bloka, kas nav
   piesaistīts importa ekrānam, līdz šim nebija. */
.acc-pay-notice {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  font-size: 14px;
  color: var(--text);
}

/* —— Klienti (grāmatveža uzņēmumi) —— */

.acc-clients-root {
  padding: 0 0 24px;
}

.acc-client-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
  padding: 0 28px;
}

.acc-client-toolbar__file {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.acc-client-import-error {
  margin: 0 28px 12px;
  color: var(--danger);
  font-weight: 500;
}

.acc-client-empty-hint {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--muted);
}

.acc-client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.acc-client-folder,
.acc-client-add {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 148px;
  padding: 18px 16px 16px;
  text-align: left;
  font: inherit;
  cursor: pointer;
  border-radius: var(--radius);
  transition: box-shadow .15s ease, border-color .15s ease;
}

.acc-client-folder {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.acc-client-folder__trash {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  margin: 0;
  z-index: 1;
}

.acc-client-folder:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

.acc-client-folder__icon {
  position: relative;
  width: 44px;
  height: 34px;
  margin-bottom: 4px;
  background: var(--primary-soft);
  border: 1px solid var(--border);
  border-radius: 0 var(--radius-sm) var(--radius-sm) var(--radius-sm);
}

.acc-client-folder__icon::before {
  content: "";
  position: absolute;
  top: -8px;
  left: -1px;
  width: 20px;
  height: 8px;
  background: var(--primary-soft);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.acc-client-folder__name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  word-break: break-word;
}

.acc-client-folder__reg {
  font-size: 13px;
  color: var(--muted);
}

.acc-client-folder__vat {
  font-size: 13px;
  color: var(--text);
  margin-top: auto;
}

.acc-client-add {
  justify-content: center;
  align-items: center;
  background: var(--bg);
  border: 2px dashed var(--line-strong);
  color: var(--muted);
}

.acc-client-add:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.acc-client-add__plus {
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  color: var(--primary);
}

.acc-client-add__label {
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}

.acc-client-form__section {
  grid-column: 1 / -1;
  margin: 8px 0 0;
}

@media (max-width: 540px) {
  .acc-client-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

/* —— Iestatījumi (rediģējamie bloki) —— */
.acc-settings-panel {
  padding: 16px 20px 18px;
  margin-bottom: 16px;
}

.acc-settings-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.acc-settings-panel__head .acc-invoices-empty__title {
  margin-bottom: 0;
}

.acc-settings-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.acc-settings-title {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.acc-settings-title .acc-invoices-empty__title {
  margin: 0;
}

.acc-settings-title svg,
.acc-inv-form__actions .acc-btn svg,
.acc-invoices-filters__row > .acc-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: block;
}

.acc-invoices-filters__row > .acc-btn {
  white-space: nowrap;
  flex-shrink: 0;
}

.acc-settings-kpi {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

@media (max-width: 768px) {
  .acc-settings-split { grid-template-columns: 1fr; }
  .acc-settings-kpi { grid-template-columns: 1fr 1fr; }
}

.acc-settings-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 420px;
}

.acc-settings-form__actions {
  margin-top: 4px;
}

.acc-settings-bank-table .acc-table__actions {
  text-align: right;
  white-space: nowrap;
}

.acc-settings-bool {
  white-space: nowrap;
}

.acc-settings-bank-form {
  margin-top: 12px;
  margin-bottom: 16px;
}

.acc-settings-check__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}

/* —— Vision OCR — vairāku failu imports —— */
.acc-vision-drop {
  margin: 16px 0;
  padding: 32px 20px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  text-align: center;
  transition: border-color .15s, background .15s;
}

.acc-vision-drop--over {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.acc-vision-drop__title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}

.acc-vision-drop__hint {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.acc-vision-filelist {
  margin: 12px 0 0;
  padding-left: 20px;
  font-size: 14px;
  color: var(--text);
}

.acc-vision-filelist--bad {
  color: var(--danger);
}

.acc-vision-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.acc-vision-meta__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.acc-vision-poll-warn {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--warning);
}

.acc-vision-expand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-right: 4px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--muted);
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
}

.acc-vision-expand:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.acc-vision-children {
  margin: 0 0 8px 28px;
  padding: 8px 0 4px 12px;
  border-left: 3px solid var(--border);
}

.acc-vision-children__table {
  font-size: 14px;
}

.acc-vision-child-row td:first-child {
  padding-left: 4px;
}

.acc-vision-deduct {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 8px 0 4px;
}

.acc-vision-deduct__select {
  min-width: 220px;
}

.acc-vision-child-row--needs-tax {
  background: var(--warning-soft);
}

.acc-vision-child-row--needs-tax td {
  border-left-color: var(--warning);
}

.acc-vision-child-row--needs-tax .acc-select {
  border-color: var(--warning);
  box-shadow: 0 0 0 1px var(--warning);
}

.acc-vision-tax-hint {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.acc-vision-accept-hint {
  font-size: 13px;
  color: var(--muted);
}
