﻿:root {
  --navy: #003b7e;
  --navy-deep: #002858;
  --navy-mid: #0a4a94;
  --navy-soft: #e8eef6;
  --red: #d31219;
  --red-deep: #a50e14;
  --red-soft: #fde8e9;
  --bg: #f4f7fb;
  --ink: #0f1b2d;
  --muted: #5a6b82;
  --card: #ffffff;
  --line: #d7e0ec;
  --ok: #1f8f55;
  --ok-soft: #e6f6ee;
  --warn: #c48a00;
  --warn-soft: #fff6db;
  --danger: #d31219;
  --shadow: 0 14px 40px rgba(0, 59, 126, 0.09);
  --shadow-sm: 0 4px 16px rgba(0, 59, 126, 0.07);
  --radius: 18px;
  --font: "Source Sans 3", "Segoe UI", Candara, sans-serif;
  --display: "Libre Baskerville", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(980px 480px at -5% -15%, rgba(211, 18, 25, 0.08), transparent 55%),
    radial-gradient(900px 460px at 105% -5%, rgba(0, 59, 126, 0.12), transparent 52%),
    linear-gradient(180deg, #eef3fa 0%, var(--bg) 38%, #f8fafc 100%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--red); }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .85rem 1.5rem;
  min-height: 64px;
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid rgba(215, 224, 236, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: var(--shadow-sm);
}

.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--red) 0%, var(--red) 28%, var(--navy) 28%, var(--navy) 100%);
  opacity: .95;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .85rem;
  color: var(--navy);
  text-decoration: none;
  min-height: 44px;
}
.brand:hover { color: var(--navy); text-decoration: none; }
.brand-logo {
  display: block;
  height: 42px;
  width: auto;
  max-width: min(320px, 52vw);
  object-fit: contain;
  object-position: left center;
}
.brand-text {
  display: grid;
  line-height: 1.15;
  padding-left: .85rem;
  border-left: 1px solid var(--line);
}
.brand-text small {
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  white-space: nowrap;
}

.topbar nav {
  display: flex;
  gap: .85rem;
  align-items: center;
  flex-wrap: wrap;
}
.topbar nav > a:not(.btn) {
  color: var(--navy);
  font-weight: 700;
  padding: .4rem .15rem;
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.topbar nav > a:not(.btn):hover {
  color: var(--red);
  border-bottom-color: var(--red);
  text-decoration: none;
}
.topbar nav > a:not(.btn).is-active {
  color: var(--red);
  border-bottom-color: var(--red);
  font-weight: 800;
}
.topbar nav > a.nav-ssd {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .75rem;
  border: 1px solid rgba(0, 59, 126, .22);
  border-radius: 8px;
  border-bottom: 1px solid rgba(0, 59, 126, .22);
  background: var(--navy-soft);
  color: var(--navy);
  font-weight: 800;
  letter-spacing: .04em;
}
.topbar nav > a.nav-ssd:hover {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
  border-bottom-color: var(--navy);
}
.topbar nav > a.nav-ssd.is-active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
  border-bottom-color: var(--navy);
  box-shadow: 0 0 0 2px rgba(0, 59, 126, .18);
}
.topbar nav > a.nav-vozila {
  padding: .35rem .7rem;
  border-radius: 8px;
  border: 1px solid transparent;
}
.topbar nav > a.nav-vozila.is-active {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
  border-bottom-color: var(--red);
  box-shadow: 0 4px 12px rgba(211, 18, 25, .28);
  font-weight: 800;
}
.topbar nav > a.nav-vozila.is-active:hover {
  color: #fff;
  filter: brightness(1.05);
}
.ssd-filename {
  font-weight: 700;
  color: var(--navy-deep);
  word-break: break-word;
}
.ssd-panels {
  display: grid;
  gap: 1rem;
}
.ssd-panel h2 {
  margin-bottom: .35rem;
}
.ssd-disk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  align-items: center;
}
.ssd-config-hint {
  margin: .85rem 0 0;
  padding: .85rem 1rem;
  background: #f4f7fb;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: .85rem;
  overflow-x: auto;
  white-space: pre;
}
.flash-warn {
  background: #fff7e6;
  border: 1px solid #f0d9a0;
  color: #7a5b12;
  padding: .75rem 1rem;
  border-radius: 10px;
}
.topbar-account {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .2rem;
  margin-left: .15rem;
}
.topbar-account .user {
  text-align: center;
  line-height: 1.15;
  white-space: nowrap;
}
.topbar-account .btn {
  padding: .2rem .65rem;
  font-size: .8rem;
  min-height: 0;
  line-height: 1.2;
  text-align: center;
}
.topbar-session {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .2rem;
}
.topbar-session > .btn {
  padding: .2rem .65rem;
  font-size: .8rem;
  min-height: 0;
  line-height: 1.2;
  text-align: center;
}
.topbar-help-btn {
  width: 100%;
  font-weight: 800;
  letter-spacing: .02em;
}
.help-guide-dialog {
  width: min(640px, calc(100vw - 1.5rem));
}
.help-guide-body {
  max-height: min(70vh, 34rem);
  overflow: auto;
  padding-right: .15rem;
}
.help-guide-section {
  margin: 0 0 1rem;
  padding-bottom: .85rem;
  border-bottom: 1px solid var(--line);
}
.help-guide-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}
.help-guide-section h3 {
  margin: 0 0 .4rem;
  font-size: 1.02rem;
  color: var(--navy);
}
.help-guide-section p {
  margin: 0 0 .45rem;
  font-size: .92rem;
  line-height: 1.45;
  color: var(--ink);
}
.help-guide-section ul {
  margin: 0;
  padding-left: 1.15rem;
  font-size: .9rem;
  line-height: 1.45;
  color: var(--ink);
}
.help-guide-section li + li {
  margin-top: .28rem;
}
.help-guide-section code {
  font-size: .86em;
  padding: .05rem .3rem;
  border-radius: 4px;
  background: rgba(0, 59, 126, 0.08);
}
.user {
  color: var(--navy);
  font-size: .9rem;
  font-weight: 650;
  padding: .4rem .85rem;
  background: var(--navy-soft);
  border-radius: 999px;
}

.wrap {
  width: min(1560px, calc(100% - 1.5rem));
  margin: .35rem auto 2.25rem;
  min-width: 0;
  box-sizing: border-box;
}

.card {
  background: var(--card);
  border: 1px solid rgba(215, 224, 236, 0.95);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.35rem 1.5rem;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--red), var(--navy));
}

h1 {
  margin: 0 0 1rem;
  font-family: var(--display);
  font-size: clamp(1.4rem, 2.3vw, 1.8rem);
  color: var(--navy-deep);
  letter-spacing: -.015em;
  font-weight: 700;
}
h2 {
  margin: 0 0 .85rem;
  font-size: .78rem;
  color: var(--navy);
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 800;
}
.muted { color: var(--muted); }

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: .85rem;
  flex-wrap: wrap;
}
.page-head h1 { margin-bottom: .2rem; }
.page-head p { margin: 0; }
.page-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
}

.archive-mode-banner {
  margin: 0 0 .85rem;
  padding: .65rem .8rem;
  border-radius: 8px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a5f;
  font-size: .92rem;
  line-height: 1.4;
}
.archive-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  align-items: center;
  margin-bottom: 1rem;
  padding: .65rem .75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
}
.archive-selected-count {
  font-weight: 700;
  margin-right: .35rem;
  min-width: 6rem;
}
.table .col-archive-check {
  width: 2.5rem;
  text-align: center;
  vertical-align: middle;
}
.archive-check-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  cursor: pointer;
}
.archive-check-label input {
  width: 1.05rem;
  height: 1.05rem;
  cursor: pointer;
}
.archive-doc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.archive-doc-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  padding: .55rem 0;
  border-bottom: 1px solid var(--line);
}
.archive-doc-item:last-child { border-bottom: 0; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 1rem;
  align-items: end;
}
.toolbar form {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  align-items: end;
  flex: 1;
}

label {
  display: grid;
  gap: .35rem;
  font-size: .82rem;
  color: var(--muted);
  font-weight: 700;
}
input, select, textarea, button, .btn { font: inherit; }
input, select, textarea {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .72rem .9rem;
  background: #fff;
  color: var(--ink);
  min-width: 0;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #7fa0c9;
  box-shadow: 0 0 0 3px rgba(0, 59, 126, 0.14);
}
textarea { min-height: 90px; resize: vertical; }

.btn, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  border: 0;
  border-radius: 999px;
  padding: .7rem 1.25rem;
  background: linear-gradient(135deg, var(--navy-mid) 0%, var(--navy-deep) 100%);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  font-weight: 750;
  box-shadow: 0 10px 22px rgba(0, 59, 126, 0.24);
  transition: transform .12s ease, filter .12s ease, box-shadow .12s ease;
}
.btn:hover, button:hover {
  filter: brightness(1.05);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(0, 59, 126, 0.28);
}
.btn-accent {
  background: linear-gradient(135deg, var(--red) 0%, var(--red-deep) 100%);
  box-shadow: 0 10px 22px rgba(211, 18, 25, 0.25);
}
.btn-ghost {
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--line);
  box-shadow: none;
}
.btn-ghost:hover {
  border-color: var(--navy);
  color: var(--navy);
  filter: none;
  box-shadow: none;
}
.btn-danger {
  background: linear-gradient(135deg, var(--red) 0%, var(--red-deep) 100%);
  box-shadow: 0 8px 18px rgba(211, 18, 25, 0.22);
}
.btn:disabled,
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
  box-shadow: none;
  pointer-events: none;
}
.btn-secondary { background: #334155; box-shadow: none; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  text-align: left;
  padding: .42rem .5rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-size: .92rem;
  line-height: 1.25;
}
.table th {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  font-weight: 800;
  padding: .5rem .5rem;
}
.table th a.th-sort {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  white-space: nowrap;
}
.table th a.th-sort:hover {
  color: var(--navy);
}
.table th a.th-sort.is-sorted {
  color: var(--navy);
}
.th-sort-ind::after {
  content: '⇅';
  opacity: .35;
  font-size: .85em;
  font-weight: 700;
}
.th-sort.is-sorted-asc .th-sort-ind::after {
  content: '↑';
  opacity: 1;
}
.th-sort.is-sorted-desc .th-sort-ind::after {
  content: '↓';
  opacity: 1;
}
.table tbody tr {
  transition: background .12s ease;
}
.table tbody tr:hover { background: #f5f9ff; }
.table tbody tr.case-list-row {
  cursor: pointer;
}
.table tbody tr.case-list-row:focus-visible {
  outline: 2px solid rgba(30, 90, 160, .45);
  outline-offset: -2px;
}
.table .col-done {
  width: 2.2rem;
  text-align: center;
  white-space: nowrap;
}
.case-done-mark {
  display: inline-block;
  color: #1a7f37;
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1;
}
.table a,
.table a strong {
  color: var(--navy);
  font-family: var(--font);
  font-style: normal;
  font-size: inherit;
  font-weight: 700;
}
.table a:hover,
.table a:hover strong {
  color: var(--red);
  text-decoration: none;
}
.table .badge {
  padding: .12rem .5rem;
  font-size: .74rem;
}

.badge {
  display: inline-block;
  padding: .24rem .7rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .02em;
}
.badge-nov { background: var(--navy-soft); color: var(--navy); }
.badge-u_radu { background: #e7f3ff; color: #0b5cab; }
.badge-na_cekanju { background: var(--warn-soft); color: #8a6200; }
.badge-zavrsen { background: var(--ok-soft); color: #146c2e; }
.badge-arhiviran { background: #eceff3; color: #556070; }
.badge-obrisan { background: #fde8e8; color: #9b1c1c; }
.badge-transport-nov { background: #eef1f5; color: #5a6573; }
.badge-transport-utovareno { background: #e7f3ff; color: #0b5cab; }
.badge-transport-istovareno { background: #e6f6ec; color: #146c2e; }
.badge-spedicija-nov { background: #eef1f5; color: #5a6573; }
.badge-spedicija-smesteno_pod_nadzor { background: #fff4df; color: #8a6200; }
.badge-spedicija-ocarinjeno { background: #ebe7ff; color: #4b3f9a; }
.badge-spedicija-tranzit { background: #e0f2fe; color: #075985; }
.badge-legacy {
  background: #f3efe6;
  color: #6b5428;
}
.badge-legacy-ocr {
  background: #e6f6ec;
  color: #146c2e;
  font-weight: 700;
}
.badge-legacy-ocr.is-waiting {
  background: #fff4df;
  color: #8a6200;
}
.toolbar-check {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .88rem;
  font-weight: 650;
  color: var(--ink);
  white-space: nowrap;
}
.toolbar-result-count {
  display: inline-flex;
  align-items: baseline;
  gap: .35rem;
  padding: .55rem .15rem .55rem .35rem;
  font-size: .92rem;
  color: var(--ink);
  white-space: nowrap;
  font-weight: 650;
}
.toolbar-result-count strong {
  font-variant-numeric: tabular-nums;
  color: var(--navy);
}
.list-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  margin-top: .85rem;
  padding-top: .65rem;
  border-top: 1px solid var(--line);
}
.list-pager-status {
  font-size: .88rem;
  color: var(--muted);
  font-weight: 700;
  min-width: 7rem;
  text-align: center;
}
.btn.is-disabled,
.btn.is-disabled:hover {
  opacity: .45;
  pointer-events: none;
  cursor: default;
}
.legacy-import-card label,
.legacy-import-form label {
  display: grid;
  gap: .35rem;
  font-weight: 700;
  font-size: .88rem;
}
.legacy-import-form input[type="text"] {
  width: 100%;
  max-width: 48rem;
  box-sizing: border-box;
}
.legacy-import-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  align-items: end;
  margin-top: .85rem;
}
.legacy-import-limit {
  display: grid;
  gap: .25rem;
  font-size: .8rem;
}
.legacy-import-limit input {
  width: 5rem;
}
.legacy-ocr-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
  margin: .75rem 0;
}
.legacy-ocr-stats > div {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .65rem .75rem;
  background: #f7fbff;
}
.legacy-ocr-stats span {
  display: block;
  font-size: .72rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--muted);
}
.legacy-ocr-stats strong {
  font-size: 1.25rem;
}
.legacy-ocr-bar {
  height: .55rem;
  border-radius: 999px;
  background: #e4ebf3;
  overflow: hidden;
  margin: .35rem 0 .5rem;
}
.legacy-ocr-bar-fill {
  height: 100%;
  background: var(--navy);
  border-radius: 999px;
  min-width: 0;
  transition: width .25s ease;
}
.legacy-ocr-pending {
  list-style: none;
  margin: .5rem 0 0;
  padding: 0;
  max-height: 14rem;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.legacy-ocr-pending li {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  padding: .45rem .7rem;
  border-bottom: 1px solid #e4ebf3;
  font-size: .86rem;
}
.legacy-ocr-pending li:last-child { border-bottom: 0; }
.legacy-dry-table .legacy-status-ok td:last-child { color: #146c2e; font-weight: 700; }
.legacy-dry-table .legacy-status-duplikat td:last-child,
.legacy-dry-table .legacy-status-duplikat_fajl td:last-child,
.legacy-dry-table .legacy-status-vec_uvezen td:last-child { color: #8a6200; }
@media (max-width: 700px) {
  .legacy-ocr-stats { grid-template-columns: 1fr 1fr; }
}
.case-status-stack {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
  justify-content: flex-end;
}
.case-transport-link {
  display: grid;
  gap: .2rem;
  margin: .45rem 0 0;
  width: 100%;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.case-transport-link input {
  width: 100%;
  box-sizing: border-box;
  padding: .32rem .5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--navy);
  font-size: .85rem;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}
.case-mark-finished-form {
  margin: 0;
  display: inline-flex;
}
.case-mark-finished-btn {
  font-size: .78rem;
  padding: .28rem .65rem;
  border: 1px solid #b7d4be;
  color: #146c2e;
  background: #eef8f1;
}
.case-mark-finished-btn:hover {
  background: #e0f2e6;
}
.table tr.is-case-deleted td { opacity: 0.55; text-decoration: line-through; }
.table tr.is-case-deleted td:first-child,
.table tr.is-case-deleted .badge { text-decoration: none; }

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.55fr);
  gap: 1.25rem;
  align-items: start;
}
.case-layout {
  display: flex;
  flex-wrap: nowrap;
  gap: 1.25rem;
  align-items: flex-start;
  width: 100%;
  min-width: 0;
}
.case-layout > .case-stack {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  max-width: 100%;
}
.case-layout > .case-side {
  flex: 0 1 300px;
  width: min(300px, 100%);
  max-width: 340px;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  gap: .45rem;
}
.case-layout > .case-side > .card {
  width: 100%;
  max-width: none;
  min-width: 0;
}
.case-layout > .card {
  flex: 0 1 300px;
  width: min(300px, 100%);
  max-width: 340px;
  min-width: 240px;
}
.case-layout .stack {
  align-content: start;
}
.case-docs,
.case-summary {
  min-width: 0;
  max-width: 100%;
}
.doc-categories,
.doc-category,
.doc-category-main,
.doc-category-head {
  min-width: 0;
  max-width: 100%;
}
@media (max-width: 1100px) {
  .doc-sectors {
    grid-template-columns: 1fr;
  }
  .case-layout > .card,
  .case-layout > .case-side {
    flex: 0 1 260px;
    max-width: 280px;
  }
}
@media (max-width: 860px) {
  .grid-2 { grid-template-columns: 1fr; }
  .case-layout {
    flex-direction: column;
  }
  .case-layout > .case-stack,
  .case-layout > .card,
  .case-layout > .case-side {
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  .topbar { flex-direction: column; align-items: flex-start; }
  .brand-logo { height: 36px; max-width: 240px; }
  .brand-text { padding-left: .65rem; }
  .doc-category-head,
  .doc-sector-toolbar { align-items: stretch; }
  .doc-sector-head { flex-direction: column; align-items: stretch; }
  .doc-sector-filename-wrap {
    width: 100%;
    max-width: none;
    margin: 0;
  }
  .doc-sector-upload-row { justify-content: stretch; }
  .doc-invoice-upload-btn {
    margin-left: 0;
  }
  .doc-service-upload-btn { flex: 1 1 calc(50% - .35rem); min-width: 7rem; }
  .doc-category-actions { width: 100%; }
  .doc-upload-btn { flex: 1; }
  .doc-sectors {
    grid-template-columns: 1fr;
    padding-left: 0;
  }
  .doc-category-rail,
  .doc-sector-rail {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    width: auto;
    margin: 0;
    pointer-events: none;
  }
  .doc-sector .postit-toggle {
    position: absolute;
    right: .45rem;
    left: auto;
    top: -.7rem;
    transform: none;
    margin: 0;
  }
  .doc-sector.has-postit-open .postit-toggle,
  .doc-sector .postit-toggle.is-on,
  .doc-sector .postit-toggle:hover,
  .doc-sector.has-postit-open .postit-toggle:hover,
  .doc-sector .postit-toggle.is-on:hover {
    right: .45rem;
    left: auto;
    top: -.7rem;
    transform: none;
  }
  .doc-sector .postit {
    position: absolute;
    top: calc(-.85rem - 50px);
    right: calc(.55rem + 30px);
    left: auto;
    transform: rotate(1.5deg);
    width: 141px;
    max-width: 141px;
    height: 141px;
    min-height: 141px;
    min-width: 141px;
    max-height: 141px;
    resize: none;
  }
  .doc-category.has-postit-open .doc-category-rail,
  .doc-sector.has-postit-open .doc-sector-rail {
    width: auto;
    min-width: 0;
    align-items: flex-start;
    position: absolute;
    padding-top: 0;
  }
  .doc-category.has-postit-open .postit,
  .doc-sector.has-postit-open .postit {
    width: 140px;
    height: 140px;
  }
  .doc-category.has-postit-open .postit-toggle,
  .doc-sector.has-postit-open .postit-toggle {
    top: auto;
    left: auto;
    transform: none;
  }
  .doc-row,
  .doc-sector .doc-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .doc-row .doc-actions,
  .doc-sector .doc-row .doc-actions {
    justify-self: end;
  }
}

.stack { display: grid; gap: 1rem; }
.case-stack { gap: .55rem; }
.meta { display: grid; gap: .55rem; font-size: .98rem; }
.meta strong { color: var(--muted); font-weight: 750; margin-right: .35rem; }

.card.case-summary {
  padding: .7rem 1rem .75rem;
}
.case-summary .back-link {
  display: inline-block;
  margin-bottom: .25rem;
  font-size: .88rem;
}
.case-summary-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .75rem;
  margin-bottom: .2rem;
}
.case-summary-top {
  /* Glavni (stranke+roba+sken) | desno sektori+klijent+Poslati */
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 280px);
  gap: .75rem 1.1rem;
  align-items: start;
}
.case-scan-slot {
  align-self: end;
  justify-self: center;
  padding-bottom: .1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
}
.case-main-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .55rem .85rem;
  margin-top: .55rem;
}
.case-scan-slot--inline {
  align-self: center;
  justify-self: start;
  margin-top: 0;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem .65rem;
}
.case-main-actions .case-summary-send-row {
  margin-left: auto;
  align-items: flex-end;
  gap: .55rem .75rem;
  flex-wrap: wrap;
}
.case-transport-link--inline {
  margin: 0;
  width: auto;
  min-width: 9.5rem;
  flex: 0 1 11rem;
}
.case-transport-link--inline input {
  width: 100%;
  min-width: 9.5rem;
}
.case-scan-agent {
  display: block;
  width: 14rem;
  max-width: 100%;
  font-size: .78rem;
  padding: .28rem .4rem;
  border-radius: 6px;
  border: 1px solid #c5d0de;
  background: #fff;
  color: var(--navy);
  box-sizing: border-box;
}
.case-scan-agent:disabled {
  opacity: 1;
  color: var(--navy);
  background: #f7f9fc;
  cursor: default;
}
.scan-switch {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  cursor: pointer;
  user-select: none;
  font-size: .82rem;
  font-weight: 750;
  color: var(--navy);
}
.scan-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.scan-switch-track {
  width: 2.35rem;
  height: 1.3rem;
  border-radius: 999px;
  background: #d5dde8;
  border: 1px solid #c5d0de;
  position: relative;
  flex: none;
  transition: background .15s ease, border-color .15s ease;
}
.scan-switch-knob {
  position: absolute;
  top: 1px;
  left: 1px;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 35, 64, .25);
  transition: transform .15s ease;
}
.scan-switch input:checked + .scan-switch-track {
  background: #1f4e79;
  border-color: #1f4e79;
}
.scan-switch input:checked + .scan-switch-track .scan-switch-knob {
  transform: translateX(1.05rem);
}
.scan-switch.link-switch input:checked + .scan-switch-track {
  background: #0f766e;
  border-color: #0f766e;
}
.scan-switch input:focus-visible + .scan-switch-track {
  outline: 2px solid rgba(30, 90, 160, .45);
  outline-offset: 2px;
}
.scan-switch.link-switch input:focus-visible + .scan-switch-track {
  outline-color: rgba(15, 118, 110, .45);
}
.case-summary-main {
  min-width: 0;
  container-type: inline-size;
  container-name: casemain;
}
.case-title {
  margin: 0;
  font-family: var(--font);
  font-style: normal;
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  color: var(--navy);
  letter-spacing: normal;
  font-weight: 650;
  line-height: 1.15;
}
.case-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem .65rem;
}
.case-title-row .case-title {
  margin: 0;
}
.case-ocr-complete {
  font-size: .72rem;
  padding: .32rem .62rem;
}
.case-subtitle {
  margin: .2rem 0 0;
  font-size: .88rem;
  line-height: 1.3;
}
.case-meta-inline {
  gap: .2rem;
  font-size: .9rem;
}
.case-identity-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .55rem;
  align-items: start;
  margin: .3rem 0 0;
}
@container casemain (min-width: 34rem) {
  .case-identity-row {
    /* Levo stranke, desno roba/dimenzije/LDM/težina */
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: .45rem .85rem;
  }
}
.case-identity-teams,
.case-client-column .case-teams-block,
.case-client-column .sector-teams-board,
.case-client-column .sector-teams-group,
.case-client-column .case-teams-chips,
.case-client-column .case-team-chip {
  min-width: 0;
  max-width: 100%;
}
.case-client-column .case-teams-block {
  margin: 0;
  box-sizing: border-box;
}
.case-client-column .case-team-chip span {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  box-sizing: border-box;
}
.case-client-column .case-identity-teams {
  /* Ispod klijenta — kompaktan prikaz sektora */
  order: 0;
}
.case-client-column .case-teams-block--info {
  padding: .35rem .5rem;
  border-radius: 8px;
}
.case-client-column .case-teams-block--info .sector-teams-board {
  grid-template-columns: 1fr;
  gap: .2rem;
}
.case-client-column .case-teams-block--info .sector-teams-group {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  align-items: center;
  gap: .25rem .4rem;
}
.case-client-column .case-teams-block--info .sector-teams-group-label {
  margin: 0;
  font-size: .62rem;
  letter-spacing: .05em;
  line-height: 1.15;
}
.case-client-column .case-teams-block--info .case-teams-chips {
  gap: .2rem;
}
.case-client-column .case-teams-block--info .case-team-chip span {
  padding: .18rem .42rem;
  font-size: .7rem;
  line-height: 1.2;
}
.case-client-column .case-teams-block--info .case-team-chip span small {
  font-size: .62rem;
}
.case-client-column .case-teams-lock-hint {
  margin: .25rem 0 0;
  font-size: .72rem;
}
.case-identity-main {
  min-width: 0;
}
.case-parties,
.case-cargo {
  margin: 0;
  display: grid;
  gap: .28rem;
  max-width: none;
}
.case-cargo-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .35rem .55rem;
}
.case-parties-field {
  display: grid;
  gap: .2rem;
  font-size: .82rem;
  font-weight: 700;
  color: var(--muted);
}
.case-parties-input {
  font-weight: 500;
  color: var(--navy);
  width: 100%;
  box-sizing: border-box;
  padding: .42rem .55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: .9rem;
  text-transform: uppercase;
}
.case-parties-input--normal {
  text-transform: none;
}
.case-parties-input::placeholder {
  text-transform: none;
}
.case-parties-input:focus {
  outline: 2px solid rgba(30, 90, 160, .28);
  border-color: #3a6ea5;
}
.case-parties-hint {
  margin: 0;
  font-size: .75rem;
  line-height: 1.3;
}
.case-parties-status {
  font-size: .78rem;
}
.case-parties-status.is-error {
  color: #b42318;
}
.table .col-kupac,
.table .col-posiljalac {
  max-width: 11rem;
  font-size: .88rem;
  word-break: break-word;
}
.table .col-broj .case-broj-cell {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-width: 0;
  max-width: 100%;
}
.case-mail-sent-icon {
  flex: 0 0 1rem;
  width: 1rem;
  height: 1rem;
  display: inline-grid;
  place-items: center;
  color: var(--navy, #1a2744);
  opacity: .85;
  line-height: 0;
}
.case-mail-sent-icon.is-empty {
  visibility: hidden;
}
.case-mail-sent-icon svg {
  display: block;
}
.case-summary-notes {
  margin: .55rem 0 0;
  line-height: 1.45;
  font-size: .94rem;
}
.case-summary-head .badge {
  flex-shrink: 0;
  margin-top: .1rem;
}
.card.case-summary {
  overflow: visible;
}
.case-client-column {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .55rem;
  min-width: 0;
}
.case-client-block {
  margin: 0;
  padding: .65rem .75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7fbff;
  box-sizing: border-box;
}
.case-client-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: .28rem;
  font-size: .84rem;
}
.case-client-grid strong {
  color: var(--muted);
  font-weight: 750;
  margin-right: .25rem;
}
.case-client-span { grid-column: auto; }
.case-client-missing {
  margin: .45rem 0 0;
  font-size: .78rem;
}
.case-summary-send-row {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  margin-top: 0;
}
.case-send-btn {
  gap: .45rem;
  padding: .55rem 1rem;
}
.case-send-icon {
  display: grid;
  place-items: center;
  line-height: 0;
}
@media (max-width: 720px) {
  .case-summary-top {
    grid-template-columns: 1fr;
  }
  .case-scan-slot {
    justify-self: start;
  }
}
.service-dialog.case-mail-dialog {
  width: min(820px, calc(100vw - 1.5rem));
  max-width: min(820px, calc(100vw - 1.5rem));
  height: min(88vh, 740px);
  max-height: min(92vh, 740px);
  overflow: hidden;
}
.case-mail-dialog .case-mail-inner {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  box-sizing: border-box;
  padding: 0;
}
.case-mail-anchor {
  flex: 0 0 auto;
  position: sticky;
  top: 0;
  z-index: 3;
  background: #fff;
  padding: 1.15rem 1.25rem .75rem;
  border-bottom: 1px solid var(--line);
}
.case-mail-anchor .service-dialog-head {
  margin-bottom: .55rem;
}
.case-mail-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: .85rem 1.25rem;
}
.case-mail-footer {
  flex: 0 0 auto;
  margin: 0;
  padding: .85rem 1.25rem 1.15rem;
  border-top: 1px solid var(--line);
  background: #fff;
  overflow: visible;
}
.case-mail-footer.service-dialog-actions {
  margin-top: 0;
}
.case-mail-footer .btn {
  box-shadow: 0 2px 8px rgba(15, 27, 45, 0.12);
}
.case-mail-dialog .case-mail-docs {
  flex: 1 1 auto;
  min-height: 180px;
  height: auto;
  max-height: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.case-mail-dialog .case-mail-doc-list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: .15rem;
}
.case-mail-emails-label {
  display: grid;
  gap: .35rem;
  margin: 0 0 .35rem;
}
.case-mail-emails-label input,
.case-mail-emails,
.case-mail-subject-label input,
.case-mail-subject {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.case-mail-subject-label {
  display: grid;
  gap: .35rem;
  margin: .55rem 0 0;
}
.case-mail-hint {
  margin: 0 0 .75rem;
  font-size: .8rem;
}
.case-mail-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: .55rem;
}
.case-mail-tab {
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--line);
  box-shadow: none;
  padding: .45rem .8rem;
  font-size: .82rem;
}
.case-mail-tab.is-active {
  background: linear-gradient(135deg, var(--navy-mid) 0%, var(--navy-deep) 100%);
  color: #fff;
  border-color: transparent;
}
.case-mail-docs {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .7rem .75rem .75rem;
  background: #f7fbff;
  overflow: hidden;
  min-height: 160px;
  box-sizing: border-box;
}
.case-mail-docs-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  margin-bottom: .55rem;
  flex-wrap: wrap;
  flex: 0 0 auto;
}
.case-mail-select-all {
  padding: .3rem .65rem;
  font-size: .76rem;
  box-shadow: none;
}
.case-mail-doc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: none;
  overflow: visible;
}
.case-mail-doc-list > li {
  margin: 0;
  padding: 0;
  border-bottom: 1px solid #e4ebf3;
  list-style: none;
}
.case-mail-doc-list > li:last-child {
  border-bottom: 0;
}
.case-mail-doc-item {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  gap: .65rem;
  margin: 0;
  padding: .55rem .35rem;
  font-size: .88rem;
  font-weight: 650;
  color: var(--ink);
  line-height: 1.35;
  min-width: 0;
  min-height: 2.5rem;
  box-sizing: border-box;
  cursor: pointer;
  border-radius: 8px;
}
.case-mail-doc-item:hover {
  background: rgba(0, 59, 126, 0.05);
}
.case-mail-doc-item input[type="checkbox"],
.case-mail-doc-check {
  appearance: auto;
  -webkit-appearance: checkbox;
  flex: 0 0 auto;
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  padding: 0 !important;
  border: 1px solid #8aa0b8 !important;
  border-radius: 4px !important;
  box-shadow: none !important;
  background: #fff;
  accent-color: var(--navy-mid, #003b7e);
  cursor: pointer;
  align-self: center;
}
.case-mail-doc-name {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--ink);
  font-weight: 650;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.35;
}
.case-mail-doc-size {
  flex: 0 0 auto;
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--muted);
  line-height: 1.35;
}
.case-mail-status {
  margin: .65rem 0 0;
  flex: 0 0 auto;
}
.case-mail-preview-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 95vh;
  overflow: hidden;
  padding: 1.1rem 1.2rem 1.15rem;
  box-sizing: border-box;
}
.case-mail-preview-hint {
  margin: 0 0 .75rem;
  font-size: .82rem;
  flex: 0 0 auto;
}
.case-mail-preview-meta {
  display: grid;
  gap: .45rem;
  margin-bottom: .75rem;
  padding: .7rem .8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7fbff;
  flex: 0 0 auto;
}
.case-mail-preview-meta > div {
  display: grid;
  grid-template-columns: 4.2rem minmax(0, 1fr);
  gap: .45rem;
  align-items: start;
  font-size: .88rem;
}
.case-mail-preview-meta span {
  color: var(--muted);
  font-weight: 700;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  padding-top: .15rem;
}
.case-mail-preview-meta strong {
  font-weight: 650;
  color: var(--ink);
  word-break: break-word;
}
.case-mail-preview-subject {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  font-size: .9rem;
  font-weight: 650;
  padding: .45rem .65rem;
  border-radius: 10px;
}
.case-mail-preview-frame-wrap {
  min-height: 0;
  margin-bottom: .55rem;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}
.case-mail-preview-attachments {
  min-height: 0;
  margin-bottom: .55rem;
  flex: 0 0 auto;
}
.case-mail-preview-frame-label {
  font-size: .78rem;
  font-weight: 750;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-bottom: .35rem;
  flex: 0 0 auto;
}
.case-mail-preview-frame-label em {
  font-style: normal;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--navy);
  opacity: 0.75;
}
.case-mail-preview-editor {
  width: 100%;
  flex: 1 1 auto;
  min-height: 160px;
  height: auto;
  max-height: none;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-sizing: border-box;
  padding: .85rem 1rem;
  font-size: .95rem;
  line-height: 1.5;
  color: var(--ink);
  outline: none;
}
.case-mail-preview-editor:focus {
  border-color: #7fa0c9;
  box-shadow: 0 0 0 3px rgba(0, 59, 126, 0.14);
}
.case-mail-preview-editor p {
  margin: 0 0 .65rem;
}
.case-mail-preview-frame {
  width: 100%;
  flex: 1 1 auto;
  min-height: 160px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-sizing: border-box;
}
.case-mail-preview-att-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 7.5rem;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7fbff;
}
.case-mail-preview-att-list li {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  padding: .55rem .75rem;
  border-bottom: 1px solid #e4ebf3;
  font-size: .86rem;
  font-weight: 650;
}
.case-mail-preview-att-list li:last-child {
  border-bottom: 0;
}
.case-mail-preview-att-list .muted {
  font-weight: 600;
  font-size: .78rem;
  white-space: nowrap;
}
.case-mail-preview-att-empty {
  padding: .7rem .75rem;
  color: var(--muted);
  font-size: .86rem;
}
.case-mail-preview-inner > .service-dialog-head,
.case-mail-preview-inner > .service-dialog-actions,
.case-mail-preview-inner > .case-mail-status {
  flex: 0 0 auto;
}
@media (max-width: 700px) {
  .case-summary-top { grid-template-columns: 1fr; }
}
.case-docs > h2 {
  margin-bottom: .35rem;
  font-size: 1.15rem;
}
.case-docs > .muted {
  margin-bottom: .35rem !important;
  font-size: .86rem;
}

.flash {
  padding: .95rem 1.1rem;
  border-radius: 14px;
  margin-bottom: 1rem;
  border: 1px solid var(--line);
  font-weight: 600;
}
.flash-ok { background: var(--ok-soft); border-color: #b6e0c7; color: #146c2e; }
.flash-error { background: var(--red-soft); border-color: #f3b6b8; color: var(--red-deep); }

.login-wrap {
  min-height: calc(100vh - 5.5rem);
  display: grid;
  place-items: center;
  padding: 1rem 0 2rem;
}
.login-card {
  width: min(420px, 100%);
  text-align: center;
  padding: 2rem 1.75rem 1.75rem;
}
.login-card::before { display: none; }
.login-logo {
  width: min(100%, 320px);
  height: auto;
  margin: 0 auto 1.35rem;
  display: block;
}
.login-card h1 {
  margin-bottom: .35rem;
}
.login-card .muted {
  margin: 0 0 1.25rem;
}
.login-card form {
  text-align: left;
}
.login-card button {
  width: 100%;
  margin-top: .25rem;
}

.doc-list, .activity-list, .comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.doc-list li, .activity-list li, .comment-list li {
  padding: .9rem 0;
  border-bottom: 1px solid var(--line);
}
.doc-list-item {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.activity-list li:last-child { border-bottom: 0; }
.doc-list li:last-child { border-bottom: 0; }

.log-list .log-entry-head {
  margin-bottom: .25rem;
}
.log-entry-body {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .45rem .55rem;
  line-height: 1.45;
}
.log-action-badge {
  display: inline-block;
  padding: .12rem .5rem;
  border-radius: 999px;
  background: var(--navy-soft);
  color: var(--navy);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .02em;
}
.log-detail {
  color: var(--ink);
  font-size: .92rem;
}
.log-case-gone {
  color: var(--muted);
  font-size: .88rem;
  font-style: italic;
}
.log-search-hint {
  margin: .35rem 0 0;
  font-size: .82rem;
  line-height: 1.35;
  flex: 1 1 100%;
}
.log-search-hint code {
  font-size: .78rem;
  padding: .05rem .3rem;
  border-radius: 4px;
  background: var(--navy-soft);
}
.doc-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.doc-actions form { margin: 0; }
.doc-ocr-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  padding: .28rem .5rem;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 750;
  letter-spacing: .04em;
  line-height: 1;
  color: #166534;
  background: #dcfce7;
  border: 1px solid #86efac;
  user-select: none;
}

.card.case-docs {
  overflow: visible;
}
.doc-categories,
.doc-sectors {
  display: grid;
  gap: .55rem;
}
.doc-sectors {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .85rem;
  align-items: start;
  padding-left: 0;
  padding-top: 0;
  overflow: visible;
}
.doc-sector {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .7rem .75rem .65rem .85rem;
  background: linear-gradient(180deg, #fbfdff 0%, #fff 100%);
  position: relative;
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  z-index: 1;
}
.doc-sector.has-postit-open {
  z-index: 5;
}
.doc-sector-rail {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  width: auto;
  height: auto;
  min-height: 0;
  z-index: 8;
  pointer-events: none;
  display: block;
  order: unset;
}
.doc-sector-rail > * {
  pointer-events: auto;
}
.doc-sector.has-postit-open .doc-sector-rail {
  width: auto;
  min-width: 0;
}
.doc-sector-main {
  min-width: 0;
  padding-left: 0;
  padding-top: 0;
  flex: 1 1 auto;
  position: relative;
  z-index: 1;
}
.doc-sector.is-sector-done {
  border-color: #6aad82;
  background: linear-gradient(180deg, #dceee3 0%, #e8f4eb 100%);
  box-shadow: inset 0 0 0 1px rgba(22, 122, 58, 0.08);
}
.doc-sector .postit-toggle {
  position: absolute;
  right: .45rem;
  left: auto;
  top: -.7rem;
  transform: none;
  margin: 0;
  z-index: 11;
  align-self: auto;
}
.doc-sector.has-postit-open .postit-toggle,
.doc-sector .postit-toggle.is-on {
  right: .45rem;
  left: auto;
  top: -.7rem;
  transform: none;
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  box-shadow: 0 1px 3px rgba(0, 59, 126, .25);
}
.doc-sector .postit-toggle:hover,
.doc-sector.has-postit-open .postit-toggle:hover,
.doc-sector .postit-toggle.is-on:hover {
  transform: none;
  background: var(--navy-deep);
  border-color: var(--navy-deep);
  color: #fff;
}
.doc-sector .postit-toggle-icon {
  transform: rotate(-90deg);
}
.doc-sector.has-postit-open .postit-toggle-icon {
  transform: rotate(90deg);
}
.doc-sector .postit {
  --postit-size: 141px;
  position: absolute;
  top: calc(-.85rem - 50px);
  right: calc(.55rem + 30px);
  left: auto;
  transform: rotate(1.5deg);
  width: var(--postit-size);
  height: var(--postit-size);
  min-width: var(--postit-size);
  min-height: var(--postit-size);
  max-width: var(--postit-size);
  max-height: var(--postit-size);
  box-sizing: border-box;
  background: #fff3a0;
  border: 1px solid #e6d36a;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .55) inset,
    3px 5px 0 rgba(0, 0, 0, 0.12),
    0 10px 18px rgba(0, 0, 0, 0.12);
  padding: .55rem .45rem .4rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  resize: none;
  z-index: 10;
  align-self: auto;
}
.doc-sector-toolbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .45rem;
  padding-bottom: .45rem;
  margin-bottom: .35rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.doc-sector-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .45rem;
}
.doc-sector-title {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .15rem;
  min-width: 0;
}
.doc-sector-title h3 {
  margin: 0;
  display: inline;
  font-size: 1.05rem;
  line-height: 1.1;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--navy-deep);
  font-family: var(--display);
  font-style: italic;
  font-weight: 700;
}
.doc-sector-meta {
  margin: 0;
  font-size: .78rem;
  white-space: normal;
}
.doc-sector-filename-wrap {
  width: 100%;
  max-width: none;
  display: grid;
  gap: .25rem;
  margin: 0;
  font-size: .75rem;
  color: var(--muted);
  font-weight: 700;
  text-align: left;
}
.doc-sector-filename-wrap > span {
  white-space: nowrap;
}
.doc-sector-filename {
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  padding: .42rem .65rem;
  border-radius: 8px;
  font-size: .9rem;
}
.doc-sector-body {
  display: grid;
  gap: .45rem;
  margin-bottom: .35rem;
  min-width: 0;
  max-width: 100%;
}
.doc-sector-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .4rem;
  width: 100%;
}
.doc-sector-upload-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: .35rem;
  width: 100%;
}
.doc-sector-upload-row--docs {
  flex-wrap: wrap;
}
.doc-sector-upload-row--docs .doc-sector-preset-btn,
.doc-sector-upload-row--docs .doc-sector-upload-btn {
  flex: 1 1 5.2rem;
  min-width: 4.6rem;
}
.doc-sector-upload-row--quad {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
}
.doc-sector-upload-row--quad .doc-sector-preset-btn,
.doc-sector-upload-row--quad .doc-sector-upload-btn {
  flex: none;
  width: auto;
  min-width: 0;
  padding-left: .35rem;
  padding-right: .35rem;
}
.doc-sector-upload-row--extra {
  flex-wrap: wrap;
}
.doc-sector-list-bar {
  display: flex;
  justify-content: flex-start;
  margin: .15rem 0 .25rem;
}
.doc-sector-list-toggle {
  padding: .28rem .65rem;
  font-size: .76rem;
  font-weight: 700;
  box-shadow: none;
}
.doc-sector.is-list-collapsed .doc-sector-list-panel {
  display: none;
}
.doc-sector-list-panel {
  margin-bottom: .15rem;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.doc-sector-upload-btn,
.doc-sector-preset-btn,
.doc-invoice-upload-btn,
.doc-service-upload-btn {
  white-space: nowrap;
  padding: .45rem .9rem;
  font-size: .84rem;
}
.doc-sector-upload-btn,
.doc-sector-preset-btn {
  flex: 1 1 0;
  min-width: 0;
  box-shadow: 0 4px 10px rgba(211, 18, 25, 0.18);
}
.doc-sector-preset-btn {
  font-weight: 800;
  letter-spacing: .02em;
}
.doc-sector-preset-btn--blue,
.is-scan-mode .doc-sector-preset-btn,
.is-scan-mode .doc-sector-upload-btn,
.is-scan-mode .doc-invoice-upload-btn {
  background: linear-gradient(135deg, var(--navy-mid) 0%, var(--navy-deep) 100%);
  color: #fff;
  box-shadow: 0 4px 10px rgba(0, 59, 126, 0.22);
}
.doc-sector-preset-btn--blue:hover,
.is-scan-mode .doc-sector-preset-btn:hover,
.is-scan-mode .doc-sector-upload-btn:hover,
.is-scan-mode .doc-invoice-upload-btn:hover {
  box-shadow: 0 6px 14px rgba(0, 59, 126, 0.28);
}
.is-link-mode .doc-sector-preset-btn,
.is-link-mode .doc-sector-upload-btn,
.is-link-mode .doc-invoice-upload-btn {
  background: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
  color: #fff;
  box-shadow: 0 4px 10px rgba(15, 118, 110, 0.22);
}
.is-link-mode .doc-sector-preset-btn:hover,
.is-link-mode .doc-sector-upload-btn:hover,
.is-link-mode .doc-invoice-upload-btn:hover {
  box-shadow: 0 6px 14px rgba(15, 118, 110, 0.3);
}
.doc-sector-upload-btn:disabled,
.doc-sector-upload-btn[disabled],
.doc-sector-upload-btn[aria-disabled="true"] {
  opacity: .45;
  cursor: not-allowed;
  filter: grayscale(.2);
  box-shadow: none;
  pointer-events: none;
}
.doc-invoice-upload-btn {
  margin-left: 0;
  flex: 1 1 100%;
  width: 100%;
  box-shadow: none;
  white-space: normal;
  line-height: 1.25;
  text-align: center;
  font-size: .78rem;
  padding: .42rem .7rem;
}
.doc-service-upload-btn.has-docs {
  background: linear-gradient(180deg, #dceee3 0%, #b8ddc4 100%);
  color: #145a32;
  box-shadow: 0 4px 10px rgba(22, 122, 58, 0.14);
  border: 1px solid #6aad82;
}
.doc-service-upload-btn.has-docs:hover {
  filter: brightness(1.03);
  color: #0f4528;
  box-shadow: 0 6px 12px rgba(22, 122, 58, 0.18);
}
.doc-sector .doc-empty {
  margin: .15rem 0 0;
  font-size: .82rem;
}
.doc-categories {
  display: grid;
  gap: 1rem;
}
.doc-category {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: .85rem 1rem;
  background: linear-gradient(180deg, #fbfdff 0%, #fff 100%);
  display: block;
  position: relative;
  overflow: visible;
}
.doc-category-rail {
  position: absolute;
  right: calc(100% + .35rem);
  top: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 4;
  width: 26px;
  box-sizing: border-box;
}
.doc-category.has-postit-open .doc-category-rail {
  width: auto;
  min-width: 158px;
  align-items: flex-start;
}
.doc-category-main { min-width: 0; }
.doc-category-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .85rem;
  margin-bottom: .65rem;
  flex-wrap: wrap;
}
.doc-category-title {
  flex: 0 0 auto;
  min-width: 110px;
}
.doc-category-actions {
  display: flex;
  gap: .55rem;
  flex: 0 0 auto;
  align-items: center;
  align-self: center;
}
.doc-category.is-step-done {
  border-color: #6aad82;
  background: linear-gradient(180deg, #dceee3 0%, #e8f4eb 100%);
  box-shadow: inset 0 0 0 1px rgba(22, 122, 58, 0.08);
}
.doc-subsection {
  margin-top: .85rem;
  padding-top: .85rem;
  border-top: 1px dashed var(--line);
}
.doc-subsection h4 {
  margin: 0 0 .65rem;
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 800;
}
.doc-upload-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
.doc-category h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--navy-deep);
  font-family: var(--display);
  font-style: italic;
}
.doc-category-meta {
  margin: .2rem 0 0;
  font-size: .85rem;
}
.doc-category-note-wrap {
  flex: 1 1 220px;
  display: grid;
  gap: .35rem;
  margin: 0;
  font-size: .82rem;
  color: var(--muted);
  font-weight: 700;
  min-width: 0;
}
.doc-category-note {
  min-height: 44px;
  resize: vertical;
  width: 100%;
}

.postit-toggle {
  position: relative;
  z-index: 5;
  width: 28px;
  height: 28px;
  margin-top: .2rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--navy);
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
  flex: 0 0 auto;
  align-self: center;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}
.doc-category.has-postit-open .postit-toggle {
  position: absolute;
  top: .45rem;
  left: -34px;
  right: auto;
  margin-top: 0;
  margin-left: 0;
  transform: none;
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  box-shadow: 0 1px 3px rgba(0, 59, 126, .25);
}
.doc-category.has-postit-open .postit-toggle-icon {
  transform: scaleX(-1);
}
.postit-toggle:hover {
  transform: none;
  filter: none;
  border-color: var(--navy);
  background: var(--navy-soft);
  color: var(--navy-deep);
}
.postit-toggle-icon {
  display: grid;
  place-items: center;
  pointer-events: none;
  line-height: 0;
  transition: transform .15s ease;
}
.postit-toggle-icon svg {
  display: block;
}
.postit-toggle.is-on {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  box-shadow: 0 1px 3px rgba(0, 59, 126, .25);
}
.doc-category.has-postit-open .postit-toggle:hover,
.postit-toggle.is-on:hover {
  background: var(--navy-deep);
  border-color: var(--navy-deep);
  color: #fff;
}
.postit {
  --postit-size: 158px;
  position: relative;
  width: var(--postit-size);
  height: var(--postit-size);
  min-width: var(--postit-size);
  min-height: var(--postit-size);
  max-width: min(420px, 70vw);
  max-height: min(420px, 70vh);
  box-sizing: border-box;
  background: #fff3a0;
  border: 1px solid #e6d36a;
  box-shadow: 2px 3px 0 rgba(0, 0, 0, 0.08);
  padding: .7rem .55rem .5rem;
  transform: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  resize: vertical;
}
.postit[hidden] { display: none !important; }
.postit-body {
  width: 100%;
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  border: 0;
  background: transparent;
  resize: none;
  overflow-y: auto;
  font-family: var(--font);
  font-style: normal;
  font-size: .85rem;
  line-height: 1.35;
  color: #3a2f12;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
}
.postit-body:focus {
  outline: none;
  box-shadow: none;
  border: 0;
}
.doc-empty {
  margin: 0;
  font-size: .92rem;
}
.doc-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .55rem 0.75rem;
  align-items: start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.doc-row-main {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.doc-filename-row {
  display: flex;
  align-items: center;
  gap: .4rem;
  min-width: 0;
  max-width: 100%;
}
.doc-filename {
  display: block;
  min-width: 0;
  flex: 1 1 auto;
  font-weight: 800;
  color: var(--navy-deep);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
button.doc-filename-preview {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 800;
  color: var(--navy-deep);
  text-align: left;
  cursor: pointer;
  max-width: 100%;
  box-shadow: none;
  filter: none;
  transform: none;
  border-radius: 0;
}
button.doc-filename-preview:hover {
  color: var(--navy);
  text-decoration: underline;
  box-shadow: none;
  filter: none;
  transform: none;
}
.doc-preview-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding: .85rem 1rem 1rem;
  box-sizing: border-box;
}
.doc-preview-head {
  flex: 0 0 auto;
  margin-bottom: .55rem;
}
.doc-preview-head h2 {
  font-size: 1.05rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: min(70vw, 42rem);
}
.doc-preview-head-actions {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-shrink: 0;
}
.doc-preview-stage {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: #e8eef5;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}
.doc-preview-stage iframe,
.doc-preview-stage img {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}
.doc-preview-stage img {
  object-fit: contain;
  padding: .5rem;
  background: #1a2332;
}
.doc-preview-stage .muted {
  margin: auto;
  padding: 1rem;
}
.doc-preview-meta {
  font-size: .78rem;
  white-space: nowrap;
}
.doc-preview-pdf-layout {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  width: 100%;
  height: 100%;
  min-height: 0;
  background: #1a2332;
}
.doc-preview-thumbs {
  overflow-y: auto;
  overflow-x: hidden;
  padding: .45rem .4rem;
  display: flex;
  flex-direction: column;
  gap: .45rem;
  background: #121a26;
  border-right: 1px solid rgba(255,255,255,.08);
}
.doc-preview-thumb {
  position: relative;
  border: 2px solid transparent;
  border-radius: 8px;
  background: #0d1420;
  cursor: pointer;
  padding: .2rem;
  flex: 0 0 auto;
}
.doc-preview-thumb.is-active {
  border-color: #3b82f6;
}
.doc-preview-thumb-canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
  background: #fff;
}
.doc-preview-thumb-label {
  display: block;
  text-align: center;
  color: #c5d0de;
  font-size: .68rem;
  font-weight: 700;
  margin-top: .15rem;
}
.doc-preview-thumb-del {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 1.35rem;
  height: 1.35rem;
  border: 0;
  border-radius: 999px;
  background: rgba(185, 28, 28, .92);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.35);
}
.doc-preview-thumb-del:hover {
  background: #dc2626;
}
.doc-preview-main {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: .75rem;
}
.doc-preview-main-canvas {
  max-width: 100%;
  height: auto;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.doc-preview-fallback-note {
  position: absolute;
  left: .75rem;
  bottom: .55rem;
  margin: 0;
  padding: .35rem .55rem;
  background: rgba(255,255,255,.9);
  border-radius: 6px;
  font-size: .75rem;
  z-index: 2;
}
@media (max-width: 720px) {
  .doc-preview-pdf-layout {
    grid-template-columns: 5.6rem minmax(0, 1fr);
  }
}
.doc-row .doc-actions {
  flex-shrink: 0;
  justify-self: end;
  gap: .3rem;
}
.doc-row .doc-actions .btn {
  padding: .18rem .45rem;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.15;
  min-height: 0;
  border-radius: 6px;
  box-shadow: none;
}
.doc-row .doc-actions .btn:hover {
  box-shadow: none;
  transform: none;
}
.doc-meta {
  margin-top: .2rem;
  font-size: .88rem;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  max-width: 100%;
}
.doc-sector .doc-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}
.doc-sector .doc-row .doc-actions {
  justify-self: end;
  align-self: center;
}
.doc-note {
  margin: .45rem 0 0;
  padding: .55rem .7rem;
  border-radius: 10px;
  background: var(--navy-soft);
  color: var(--ink);
  font-size: .92rem;
  line-height: 1.45;
}

.dropzone {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  background: #f8fbff;
  text-align: center;
}
.dropzone.drag { border-color: var(--navy); background: var(--navy-soft); }
.progress {
  height: 8px;
  background: #e4ebf4;
  border-radius: 999px;
  overflow: hidden;
  margin-top: .75rem;
  display: none;
}
.progress > span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--navy), var(--red));
}
.doc-sector-progress {
  margin: .45rem 0 .15rem;
}
.doc-sector-progress[hidden] {
  display: none !important;
}
.doc-sector-progress .progress {
  margin-top: 0;
  display: block;
}
.doc-sector-upload-status {
  margin: .35rem 0 0;
  font-size: .82rem;
  min-height: 0;
}

.live-dot {
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  background: var(--red);
  display: inline-block;
  margin-right: .35rem;
  box-shadow: 0 0 0 0 rgba(211, 18, 25, .45);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(211, 18, 25, .4); }
  70% { box-shadow: 0 0 0 8px rgba(211, 18, 25, 0); }
  100% { box-shadow: 0 0 0 0 rgba(211, 18, 25, 0); }
}

.doc-icons {
  display: flex;
  flex-wrap: wrap;
  gap: .85rem;
  margin: .35rem 0 1rem;
}
.doc-icon {
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 15px;
  border: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  position: relative;
  padding: 0;
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .12s ease;
}
.doc-icon:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: var(--shadow);
}
.doc-icon.is-empty {
  background: linear-gradient(160deg, #ffd56a, #e8a817);
  color: #5c4300;
}
.doc-icon.is-done {
  background: linear-gradient(160deg, #3bb56f, #1a7a48);
  color: #fff;
}
.doc-icon-num {
  position: absolute;
  right: .32rem;
  bottom: .18rem;
  font-size: .72rem;
  font-weight: 800;
  opacity: .95;
}
.doc-icon-glyph { display: grid; place-items: center; }

.back-link {
  font-weight: 700;
  font-size: .92rem;
}

.case-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: 0;
}
.case-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
  width: 100%;
}
.case-toolbar-actions .btn {
  flex: 1 1 auto;
  padding: .45rem .75rem;
  font-size: .82rem;
}
.btn-ghost-danger {
  color: var(--red);
  border-color: rgba(211, 18, 25, .35);
}
.btn-ghost-danger:hover {
  background: #fff0f0;
  border-color: var(--red);
  color: var(--red);
}
.case-delete-dialog .case-delete-warning {
  margin: 0 0 1rem;
  padding: .75rem .85rem;
  border-radius: 10px;
  background: #fff5f5;
  border: 1px solid rgba(211, 18, 25, .25);
  color: #7a1a1e;
  line-height: 1.45;
}
.case-merge-dialog .case-merge-current {
  margin: 0 0 .65rem;
}
.case-merge-numbers-label {
  display: block;
  margin: 0 0 .75rem;
  font-weight: 600;
}
.case-merge-numbers {
  display: block;
  width: 100%;
  margin-top: .35rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .95rem;
  line-height: 1.4;
  resize: vertical;
}
.case-merge-preview {
  margin: 0 0 .85rem;
  padding: .65rem .75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}
.case-merge-preview-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.case-merge-preview-list li {
  padding: .28rem 0;
  border-bottom: 1px solid var(--line);
  font-size: .92rem;
}
.case-merge-preview-list li:last-child { border-bottom: 0; }
.case-merge-tag {
  display: inline-block;
  margin-left: .25rem;
  padding: .05rem .4rem;
  border-radius: 4px;
  background: #dcfce7;
  color: #166534;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.case-merge-tag.is-free {
  background: #fee2e2;
  color: #991b1b;
}
.case-merge-missing {
  margin: .5rem 0 0;
  color: #9f1239;
  font-size: .9rem;
}
.case-merge-survivor-note {
  margin: .55rem 0 0;
  font-size: .92rem;
}
.case-delete-confirm-label {
  display: grid;
  gap: .35rem;
  margin: 0 0 1rem;
  font-size: .88rem;
  font-weight: 700;
  color: var(--muted);
}
.case-delete-confirm {
  font-family: ui-monospace, Consolas, monospace;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.field-label {
  font-size: .82rem;
  color: var(--muted);
  font-weight: 700;
}
.client-autocomplete {
  text-transform: uppercase;
  letter-spacing: .02em;
}
.client-autocomplete::placeholder {
  text-transform: none;
  letter-spacing: normal;
}

.service-toggle-board {
  display: grid;
  gap: .85rem;
}
.service-toggle-group-label {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: .45rem;
}
.service-toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}
.service-chip {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  margin: 0;
}
.service-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.service-chip span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.2rem;
  padding: .35rem .85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--navy);
  font-weight: 700;
  font-size: .88rem;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.service-chip.is-on span,
.service-chip input:checked + span {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.service-chip:hover span {
  border-color: var(--navy);
}

.service-dialog {
  border: 0;
  border-radius: 18px;
  padding: 0;
  width: min(560px, calc(100vw - 1.5rem));
  max-height: calc(100vh - 2rem);
  box-shadow: var(--shadow);
}
.service-dialog.case-mail-preview-dialog {
  width: 90vw;
  max-width: 90vw;
  height: 95vh;
  max-height: 95vh;
}
/* Mora posle .service-dialog — inače ostaje 560px i PDF ima horizontalni scroll. */
.service-dialog.doc-preview-dialog {
  width: 70vw;
  max-width: 70vw;
  height: calc(100vh - 1.25rem);
  max-height: calc(100vh - 1.25rem);
  padding: 0;
  overflow: hidden;
}
.service-dialog::backdrop {
  background: rgba(15, 27, 45, 0.45);
}
.service-dialog-inner {
  padding: 1.15rem 1.25rem 1.25rem;
}
.service-dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  margin-bottom: .35rem;
}
.service-dialog-head h2 {
  margin: 0;
}
.service-dialog-close {
  font-size: 1.4rem;
  line-height: 1;
  padding: .25rem .7rem;
  min-width: 0;
}
.service-dialog-actions {
  display: flex;
  gap: .55rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}
.ui-msg-dialog {
  width: min(440px, calc(100vw - 1.5rem));
  max-width: min(440px, calc(100vw - 1.5rem));
}
.ui-msg-dialog .ui-msg-inner {
  padding: 1.15rem 1.25rem 1.2rem;
}
.ui-msg-body {
  margin: .35rem 0 0;
  font-size: .95rem;
  line-height: 1.45;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}
.ui-msg-actions {
  margin-top: 1.1rem;
}
.service-settings-dialog {
  width: min(640px, calc(100vw - 1.5rem));
  max-width: min(640px, calc(100vw - 1.5rem));
}
.service-settings-notes-label {
  display: grid;
  gap: .35rem;
  margin: 1rem 0 .25rem;
}
.service-settings-notes-label textarea {
  min-height: 110px;
}

.clients-page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: .85rem;
}
.clients-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
}
.clients-import-form { margin: 0; }
.clients-search-form {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  align-items: end;
}
.clients-form-card { margin-bottom: 1rem; }
.clients-form-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  margin-bottom: .85rem;
}
.clients-form-head h2 { margin: 0; }
.clients-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem 1rem;
}
.clients-span-2 { grid-column: 1 / -1; }
.clients-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-top: 1rem;
}
.clients-table-wrap {
  overflow-x: auto;
}
.clients-table td,
.clients-table th {
  vertical-align: top;
  font-size: .9rem;
}
.clients-sub {
  margin-top: .2rem;
  font-size: .78rem;
  font-weight: 500;
}
.clients-portal-box {
  margin-top: .35rem;
  padding: .9rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--navy-soft);
}
.clients-portal-title {
  margin: 0 0 .35rem;
  font-size: 1rem;
}
.clients-portal-hint {
  margin: 0 0 .75rem;
  font-size: .88rem;
}
.clients-portal-on { color: var(--ok); }
.clients-portal-off { color: var(--warn); }
.clients-portal-fields {
  display: grid;
  gap: .65rem;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}
.clients-portal-clear {
  display: flex !important;
  align-items: center;
  gap: .4rem;
  font-weight: 600;
  padding-bottom: .55rem;
}
@media (max-width: 860px) {
  .clients-form-grid { grid-template-columns: 1fr; }
  .clients-span-2 { grid-column: auto; }
  .clients-portal-fields { grid-template-columns: 1fr; }
}

.settings-page { display: grid; gap: 1rem; }
.settings-head h1 { margin: 0 0 .25rem; }
.settings-head .muted { margin: 0; }
.settings-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
.settings-nav {
  display: grid;
  gap: .35rem;
  padding: .85rem;
}
.settings-nav-link {
  display: block;
  padding: .55rem .75rem;
  border-radius: 10px;
  color: var(--navy);
  text-decoration: none;
  font-weight: 700;
  font-size: .92rem;
}
.settings-nav-link:hover {
  background: #f0f5fb;
}
.settings-nav-link.is-active {
  background: linear-gradient(135deg, var(--navy-mid) 0%, var(--navy-deep) 100%);
  color: #fff;
}
.settings-nav-hint {
  margin: .5rem .35rem 0;
  font-size: .78rem;
}
.settings-mail-form { gap: .85rem; }
.settings-mail-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .55rem .85rem .85rem;
  background: #fbfdff;
}
.settings-mail-block > summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--navy);
  padding: .35rem 0;
  list-style: none;
}
.settings-mail-block > summary::-webkit-details-marker { display: none; }
.settings-mail-block > summary::before {
  content: '? ';
  color: var(--muted);
}
.settings-mail-block[open] > summary::before { content: '? '; }
.settings-mail-fields { margin-top: .65rem; }
.settings-html-editor {
  min-height: 260px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .84rem;
  line-height: 1.45;
  white-space: pre;
}
.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-top: .25rem;
}
.settings-reset-form { margin-top: .85rem; }
.settings-main code {
  font-size: .78rem;
  word-break: break-word;
}
@media (max-width: 800px) {
  .settings-layout { grid-template-columns: 1fr; }
}

/* OCR / resync status (Podešavanja) */
.ocr-status-panel { display: grid; gap: 1.1rem; }
.ocr-status-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
}
.ocr-status-head h2 { margin: 0 0 .2rem; }
.ocr-status-head-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.ocr-status-pill {
  display: inline-block;
  padding: .28rem .65rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 650;
  background: #e8eef5;
  color: #334155;
}
.ocr-status-pill.is-run {
  background: #dcfce7;
  color: #166534;
}
.ocr-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .65rem;
}
@media (max-width: 900px) {
  .ocr-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.ocr-stat {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .7rem .8rem;
  background: #f8fafc;
}
.ocr-stat-label {
  font-size: .72rem;
  color: #64748b;
  margin-bottom: .25rem;
}
.ocr-stat-value {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.1;
  color: #0f172a;
}
.ocr-progress-wrap { display: grid; gap: .4rem; }
.ocr-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .5rem;
}
.ocr-progress-bar {
  height: 10px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}
.ocr-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #0ea5e9);
  border-radius: 999px;
  transition: width .35s ease;
}
.ocr-progress-hint { margin: 0; font-size: .8rem; }
.ocr-hourly h3,
.ocr-queue h3 {
  margin: 0 0 .45rem;
  font-size: 1rem;
}
.ocr-hourly-meta {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: .2rem;
}
.ocr-queue-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}
.ocr-queue-table th,
.ocr-queue-table td {
  border-bottom: 1px solid var(--line);
  padding: .45rem .4rem;
  text-align: left;
  vertical-align: top;
}
.ocr-queue-file {
  max-width: 14rem;
  word-break: break-word;
}
.ocr-log-details summary {
  cursor: pointer;
  font-weight: 600;
}
.ocr-log-tail {
  margin: .55rem 0 0;
  padding: .65rem .75rem;
  max-height: 220px;
  overflow: auto;
  font-size: .72rem;
  line-height: 1.35;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 10px;
  white-space: pre-wrap;
}
.ocr-status-updated { margin: 0; font-size: .78rem; }

.case-teams-block {
  margin: .85rem 0 0;
  padding: .75rem .85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7fbff;
}
.case-teams-block--form {
  margin: 0;
}

.case-teams-block--info .case-team-chip {
  cursor: default;
  pointer-events: none;
}
.case-teams-block--info .case-team-chip span {
  pointer-events: none;
}
.case-teams-block--info .sector-teams-board {
  grid-template-columns: 1fr;
  gap: .55rem;
}
.sector-teams-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .85rem;
  align-items: start;
}
.sector-teams-group {
  min-width: 0;
}
.sector-teams-group-label {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 .4rem;
}
@media (max-width: 700px) {
  .sector-teams-board {
    grid-template-columns: 1fr;
  }
}
.case-teams-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .45rem .75rem;
  margin-bottom: .55rem;
}
.case-teams-head strong { color: var(--navy); }
.case-teams-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.sector-teams-group[data-group="spedicija"] .case-teams-chips {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: flex-start;
}
.case-team-chip {
  display: inline-flex;
  align-items: center;
  margin: 0;
  cursor: pointer;
}
.case-team-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.case-team-chip span {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .38rem .7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--navy);
  font-weight: 700;
  font-size: .8rem;
}
.case-team-chip span small {
  font-weight: 600;
  color: var(--muted);
  font-size: .72rem;
}
.case-team-chip.is-on span {
  background: linear-gradient(135deg, var(--navy-mid) 0%, var(--navy-deep) 100%);
  border-color: transparent;
  color: #fff;
}
.case-team-chip.is-on span small { color: rgba(255,255,255,.82); }
.case-team-chip.is-locked {
  cursor: not-allowed;
  opacity: 0.92;
}
.case-team-chip.is-locked span {
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.25);
  padding-right: 1.55rem;
  position: relative;
}
.case-team-chip.is-locked span::after {
  content: '';
  position: absolute;
  right: .55rem;
  top: 50%;
  width: .55rem;
  height: .7rem;
  margin-top: -.4rem;
  border: 2px solid rgba(255,255,255,.9);
  border-top: 0;
  border-left: 0;
  border-radius: 0 0 2px 0;
  transform: rotate(40deg);
  opacity: .95;
}
.sector-teams-group.is-disabled {
  opacity: 0.48;
  filter: grayscale(0.35);
  pointer-events: none;
  user-select: none;
}
.sector-teams-group.is-disabled .case-team-chip {
  cursor: not-allowed;
}
.sector-teams-disabled-tag {
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  font-size: .68rem;
  color: var(--muted);
  margin-left: .15rem;
}
.sector-teams-disabled-dash {
  font-size: .82rem;
}
.case-teams-lock-hint {
  margin: .55rem 0 0;
  font-size: .82rem;
}
.case-teams-status { margin: .45rem 0 0; font-size: .8rem; }

.case-mail-team-wrap {
  margin: 0;
  min-height: 5.6rem;
}
.case-mail-team-wrap.is-inactive {
  visibility: hidden;
  pointer-events: none;
}
.case-mail-team-label {
  margin: 0 0 .35rem;
  font-size: .82rem;
  font-weight: 700;
}
.case-mail-team-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.case-mail-team-tab {
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--line);
  box-shadow: none;
  padding: .4rem .7rem;
  font-size: .78rem;
  border-radius: 999px;
}
.case-mail-team-tab.is-tagged {
  border-color: #7fa0c9;
  background: #f0f6fc;
}
.case-mail-team-tab.is-active {
  background: linear-gradient(135deg, var(--navy-mid) 0%, var(--navy-deep) 100%);
  color: #fff;
  border-color: transparent;
}
.case-mail-team-hint {
  margin: .4rem 0 0;
  font-size: .76rem;
}

.settings-mail-teams {
  margin-top: .65rem;
  gap: .55rem;
}
.settings-mail-team {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: .45rem .7rem .7rem;
  background: #fff;
}
.settings-mail-team > summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--navy);
  padding: .25rem 0;
}




/* ?? Vozila ?? */
.vozila-page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: .85rem;
}
.vozila-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
}
.vozila-search-form {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  align-items: end;
}
.vozila-form-card { margin-bottom: .75rem; }
.vozila-form-card.card { padding: .85rem 1rem; }
.vozila-form-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  margin-bottom: .55rem;
}
.vozila-form-head h2 { margin: 0; font-size: 1.05rem; }
.vozila-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .35rem .5rem;
  align-items: end;
}
.vozila-form-grid > label {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  margin: 0;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .01em;
  color: #5c6573;
  min-width: 0;
}
.vozila-form-grid input,
.vozila-form-grid select,
.vozila-form-grid textarea {
  width: 100%;
  box-sizing: border-box;
  padding: .32rem .45rem;
  font-size: .86rem;
  font-weight: 500;
  line-height: 1.25;
  min-height: 2rem;
}
.vozila-form-grid textarea {
  min-height: 3rem;
  resize: vertical;
}
.vozila-span-2 { grid-column: span 2; }
.vozila-span-4 { grid-column: 1 / -1; }
.vozila-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .65rem;
}
.vozila-docs-block {
  margin-top: .85rem;
  padding-top: .7rem;
  border-top: 1px solid var(--line);
}
.vozila-docs-block h3 {
  margin: 0 0 .4rem;
  font-size: .95rem;
}
.vozila-doc-rows {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  margin-top: .35rem;
}
.vozila-doc-row {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr) auto auto;
  gap: .35rem .55rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .35rem .55rem;
  background: #fafbfc;
}
.vozila-doc-kind {
  font-size: .82rem;
  font-weight: 700;
  white-space: nowrap;
}
.vozila-doc-file {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: .35rem;
  overflow: hidden;
}
.vozila-doc-name {
  font-weight: 600;
  font-size: .82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vozila-doc-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: .25rem;
  flex-shrink: 0;
}
.vozila-doc-actions .btn,
.vozila-doc-upload .btn {
  padding: .28rem .55rem;
  font-size: .8rem;
}
.vozila-doc-upload {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: .3rem;
  justify-content: flex-end;
}
.vozila-doc-upload input[type=file] {
  max-width: 11rem;
  font-size: .72rem;
}
.vozila-so-banner {
  margin-bottom: .65rem;
  padding: .55rem .7rem;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f7faf8;
}
.vozila-so-banner p { margin: 0 0 .35rem; font-size: .88rem; }
@media (max-width: 1100px) {
  .vozila-form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .vozila-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vozila-doc-row {
    grid-template-columns: 1fr;
  }
  .vozila-doc-upload {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}
@media (max-width: 560px) {
  .vozila-form-grid { grid-template-columns: 1fr; }
  .vozila-span-2,
  .vozila-span-4 { grid-column: auto; }
}
.vozila-table-wrap { overflow-x: auto; }
.vozila-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .84rem;
}
.vozila-table th,
.vozila-table td {
  vertical-align: middle;
  padding: .22rem .35rem !important;
  line-height: 1.15;
}
.vozila-table th {
  font-size: .68rem;
  letter-spacing: .03em;
  padding-top: .28rem !important;
  padding-bottom: .28rem !important;
}
.vozila-table tbody tr:nth-child(even) {
  background: #fafbfc;
}
.vozila-table .btn {
  padding: .15rem .4rem;
  font-size: .76rem;
  line-height: 1.1;
  min-height: 0;
}
.vozila-table .badge {
  font-size: .68rem;
  padding: .08rem .32rem;
  line-height: 1.15;
}
.vozila-vin {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .76rem;
  letter-spacing: .01em;
  white-space: nowrap;
  max-width: 13.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vozila-cell-input {
  min-width: 4.5rem;
  max-width: 8rem;
  padding-right: .2rem !important;
}
.vozila-inline-input {
  width: 100%;
  box-sizing: border-box;
  padding: .12rem .28rem;
  font-size: .8rem;
  min-height: 1.4rem;
  height: 1.4rem;
  line-height: 1.1;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}
.vozila-inline-input:focus {
  outline: none;
  border-color: #7aa2c4;
  box-shadow: 0 0 0 2px rgba(70, 130, 180, .15);
}
.vozila-inline-input.is-saving { opacity: .65; }
.vozila-inline-input.is-saved { border-color: #9dceb0; }
.vozila-doc-flags {
  display: flex;
  flex-wrap: nowrap;
  gap: .12rem;
}
.vozila-doc-flag {
  display: inline-block;
  min-width: 1.55rem;
  text-align: center;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .02em;
  padding: .05rem .2rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: #8a93a3;
  background: #f7f8fa;
  line-height: 1.1;
}
.vozila-doc-flag.is-on {
  color: #1f4d2e;
  background: #e7f5ec;
  border-color: #9dceb0;
}
.vozila-so-import-form { margin: 0; }
.vozila-so-label { cursor: pointer; }

/* —— Korisnici —— */
.users-page {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  gap: 1rem 1.25rem;
  align-items: start;
}
.users-toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 80;
  max-width: min(22rem, calc(100vw - 2rem));
  padding: .65rem .9rem;
  border-radius: 10px;
  background: #146c2e;
  color: #fff;
  font-size: .88rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(20, 40, 70, .18);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
}
.users-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.users-toast.is-error {
  background: var(--red-deep, #a11);
}
@media (max-width: 960px) {
  .users-page { grid-template-columns: 1fr; }
}
.users-page-head { margin-bottom: .35rem; }
.users-page-head h1 { margin: 0 0 .2rem; }
.users-page-lead { margin: 0; font-size: .88rem; line-height: 1.35; }
.users-list-card { overflow: visible; min-width: 0; }
.users-create-card h2 { margin-top: 0; font-size: 1.05rem; }
.users-create-feeder {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-weight: 600;
  cursor: pointer;
}
.users-table-wrap {
  overflow-x: auto;
  margin: 0 -.15rem;
  padding: 0 .15rem;
}
.users-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.users-table th,
.users-table td {
  vertical-align: middle;
  padding: .55rem .65rem;
  overflow: visible;
}
.users-table thead th {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  font-weight: 750;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.users-table tbody tr {
  border-bottom: 1px solid var(--line);
}
.users-table tbody tr:hover {
  background: #f3f7fc;
}
.users-table tbody tr.is-inactive {
  opacity: .62;
  background: #fafafa;
}
.users-table tbody tr.is-me {
  background: #f0f6ff;
}
.users-table .col-name { width: 22%; }
.users-table .col-user { width: 16%; }
.users-table .col-role { width: 28%; }
.users-table .col-feeder {
  width: 5.5rem;
  text-align: center;
}
.users-table .col-actions { width: 28%; }
.users-fullname {
  font-weight: 650;
  color: var(--navy);
}
.users-username {
  font-size: .84rem;
  background: transparent;
  padding: 0;
  color: var(--muted);
}
.users-chip {
  display: inline-block;
  margin-left: .35rem;
  padding: .1rem .4rem;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 700;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.users-chip--me {
  background: #dce9f8;
  color: #1a4a7a;
}
.users-chip--off {
  background: #eee;
  color: #666;
}
.users-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  align-items: center;
  justify-content: flex-start;
}
.users-inline-form { margin: 0; display: inline; }
.users-role-form { margin: 0; }
.users-role-form select {
  width: 100%;
  max-width: 100%;
  font-size: .84rem;
  padding: .35rem .45rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}
.users-feeder-form { margin: 0; display: flex; justify-content: center; }
.users-feeder-label {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  cursor: pointer;
  margin: 0;
  user-select: none;
}
.users-feeder-label input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--navy, #1a3a5c);
  cursor: pointer;
}
.users-feeder-text {
  font-size: .78rem;
  color: var(--muted);
  min-width: 1.1rem;
}
.users-pw-details {
  position: relative;
  display: inline-block;
}
.users-pw-details > summary {
  list-style: none;
  cursor: pointer;
  display: inline-block;
}
.users-pw-details > summary::-webkit-details-marker { display: none; }
.users-pw-form {
  position: absolute;
  right: 0;
  top: calc(100% + .35rem);
  z-index: 20;
  margin: 0;
  padding: .65rem .75rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(20, 40, 70, .12);
  width: 15.5rem;
}
.users-pw-form label { font-size: .8rem; }
.btn-sm {
  padding: .32rem .55rem;
  font-size: .8rem;
  line-height: 1.2;
}

/* —— Sektor zvonce (notifikacije) —— */
.doc-sector {
  position: relative;
}
.doc-sector-watch {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: .55rem;
  padding-top: .15rem;
}
.doc-sector-bell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  padding: 0;
  border: 1px solid var(--line, #d5dde8);
  border-radius: 999px;
  background: #fff;
  color: var(--muted, #6a768a);
  cursor: pointer;
  box-shadow: none;
  transition: color .15s ease, background .15s ease, border-color .15s ease, transform .12s ease;
}
.doc-sector-bell:hover {
  color: var(--navy, #003b7e);
  border-color: var(--navy, #003b7e);
}
.doc-sector-bell.is-on {
  color: #fff;
  background: var(--navy, #003b7e);
  border-color: var(--navy, #003b7e);
}
.doc-sector-bell.is-on:hover {
  filter: brightness(1.06);
  color: #fff;
}
.doc-sector-bell.is-busy {
  opacity: .55;
  pointer-events: none;
}
.my-settings-radio {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 600;
  cursor: pointer;
}
.my-settings-radio input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--navy, #003b7e);
}

.my-settings-account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1.25rem;
  flex-wrap: wrap;
  margin: .65rem 0 0;
  font-size: .88rem;
}
.my-settings-account-row .btn {
  flex: none;
}
.my-settings-scan-note {
  margin: .35rem 0 0;
  font-size: .82rem;
}
.my-settings-sector-list {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  margin: .35rem 0 .15rem;
}
.my-settings-sector-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1rem;
  flex-wrap: wrap;
  padding: .55rem .7rem;
  border: 1px solid rgba(0, 59, 126, 0.14);
  border-radius: 8px;
  background: #f7f9fc;
}
.my-settings-sector-row.is-on {
  background: #eef4fb;
  border-color: rgba(0, 59, 126, 0.28);
}
.my-settings-sector-check {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 700;
  min-width: 7.5rem;
  cursor: pointer;
}
.my-settings-sector-check input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--navy, #003b7e);
}
.my-settings-sector-channels {
  display: flex;
  align-items: center;
  gap: .65rem;
  flex-wrap: wrap;
}
.my-settings-channel-opt {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.my-settings-channel-opt input:disabled + span,
.my-settings-sector-row:not(.is-on) .my-settings-channel-opt {
  opacity: .45;
  cursor: default;
}
.my-settings-channel-opt input {
  width: .95rem;
  height: .95rem;
  accent-color: var(--navy, #003b7e);
}

.chat-app {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: .75rem;
  height: calc(100vh - 7.5rem);
  min-height: 28rem;
}
.chat-side,
.chat-main {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.chat-side-head,
.chat-main-head {
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}
.chat-side-head h1,
.chat-main-head h2 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--navy);
}
.chat-new {
  border: 0;
  background: var(--navy);
  color: #fff;
  font-weight: 800;
  border-radius: 8px;
  padding: .4rem .7rem;
  cursor: pointer;
}
.chat-search {
  margin: .75rem 1rem 0;
  width: calc(100% - 2rem);
  box-sizing: border-box;
}
.chat-list {
  overflow: auto;
  padding: .5rem;
  flex: 1;
}
.chat-section {
  margin: .6rem .4rem .3rem;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.chat-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 10px;
  padding: .65rem .7rem;
  cursor: pointer;
  color: inherit;
  font: inherit;
  box-shadow: none;
}
.chat-item:hover { background: var(--navy-soft); }
.chat-item.is-active {
  background: var(--navy-soft);
  border-color: rgba(0, 59, 126, .25);
}
.chat-item.is-unread {
  border-color: var(--red);
  background: var(--red-soft);
  box-shadow: inset 3px 0 0 var(--red);
}
.chat-item.is-unread.is-active,
.chat-item.is-unread:hover {
  border-color: var(--red);
  background: #fde0e1;
}
.chat-item strong {
  display: block;
  width: 100%;
  text-align: left;
  color: var(--navy);
}
.chat-item span {
  display: block;
  width: 100%;
  margin-top: .15rem;
  color: var(--muted);
  font-size: .85rem;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-messages {
  flex: 1;
  overflow: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  background: var(--bg);
}
.chat-empty {
  margin: auto;
  color: var(--muted);
  text-align: center;
}
.chat-bubble {
  max-width: min(34rem, 82%);
  border-radius: 14px;
  padding: .55rem .75rem;
  border: 1px solid var(--line);
  background: #fff;
}
.chat-bubble.is-mine {
  align-self: flex-end;
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.chat-bubble a.chat-case-link {
  color: var(--navy);
  font-weight: 800;
  text-decoration: underline;
}
.chat-bubble.is-mine a.chat-case-link {
  color: #fff;
}
.chat-bubble a.chat-file {
  display: inline-block;
  max-width: 100%;
  margin: .15rem 0 .2rem;
  padding: .35rem .55rem;
  border-radius: 8px;
  background: #e7eef6;
  color: #0a2342;
  font-weight: 700;
  text-decoration: underline;
  word-break: break-word;
}
.chat-bubble a.chat-file:hover {
  background: #fff;
  color: var(--red);
}
.chat-bubble .who {
  font-size: .75rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: .15rem;
}
.chat-edited,
.chat-deleted {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .01em;
  opacity: .8;
}
.chat-deleted { font-style: italic; }
.chat-actions {
  display: flex;
  gap: .45rem;
  margin-top: .2rem;
}
.chat-actions button,
.chat-body > button {
  border: 0;
  background: transparent;
  color: inherit;
  opacity: .75;
  font-size: .68rem;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
}
.chat-edit-box {
  width: 100%;
  min-height: 3.2rem;
  margin-bottom: .35rem;
  color: var(--ink);
  background: #fff;
}
.chat-edit-actions {
  display: flex;
  gap: .9rem;
  margin-top: .1rem;
}
.chat-edit-actions button {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: .72rem;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
}
.chat-bubble .when {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: .35rem;
  margin-top: .25rem;
  font-size: .72rem;
  opacity: .85;
}
.chat-ticks {
  letter-spacing: -0.18em;
  font-weight: 700;
  opacity: .8;
}
.chat-ticks.is-read { color: #128c7e; opacity: 1; }
.chat-bubble.is-mine .chat-ticks.is-read { color: #7fd4ff; }
.chat-emoji[hidden] {
  display: none;
}
.chat-emoji {
  display: flex;
  flex-wrap: wrap;
  gap: .2rem;
  padding: .4rem .75rem 0;
}
.chat-emoji button {
  border: 0;
  background: transparent;
  font-size: 1.35rem;
  line-height: 1.2;
  cursor: pointer;
}
.chat-compose {
  display: flex;
  gap: .5rem;
  padding: .75rem;
  border-top: 1px solid var(--line);
  align-items: flex-end;
}
.chat-pending {
  padding: .35rem .75rem 0;
  color: var(--muted, #667);
  font-size: .85rem;
}
.chat-photo {
  display: block;
  max-width: 100%;
  max-height: 240px;
  border-radius: 10px;
  margin-bottom: .35rem;
  cursor: pointer;
}
.chat-compose textarea {
  flex: 1;
  min-height: 2.6rem;
  max-height: 8rem;
  resize: vertical;
  margin: 0;
}
.chat-error { color: var(--danger, #d31219); padding: 0 1rem .4rem; font-weight: 700; }
@media (max-width: 860px) {
  .chat-app {
    grid-template-columns: 1fr;
    height: auto;
  }
  .chat-side { max-height: 22rem; }
  .chat-main { min-height: 28rem; }
}
.browser-notif-toasts {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  width: min(22rem, calc(100% - 2rem));
}
.browser-notif-toast {
  text-align: left;
  border: 0;
  border-left: 4px solid var(--red);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 10px 30px rgba(15, 27, 45, .18);
  padding: .75rem .9rem;
  cursor: pointer;
  font: inherit;
}
.browser-notif-toast strong {
  display: block;
  color: var(--navy);
  margin-bottom: .15rem;
}
.browser-notif-toast span {
  display: block;
  color: var(--muted);
  font-size: .92rem;
}
.transport-split {
  display: grid;
  grid-template-columns: minmax(20rem, 34rem) minmax(0, 1fr);
  gap: .75rem;
  align-items: start;
}
.scan-more {
  display: none;
  flex-direction: column;
  align-items: stretch;
  gap: .45rem;
  margin: .35rem 0 .75rem;
}
.scan-more.is-open {
  display: flex;
}
.scan-more-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: .35rem;
  align-items: center;
}
.scan-more .btn {
  flex: 1 1 0;
  padding: .4rem .45rem;
  white-space: nowrap;
}
.transport-files-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: .75rem;
}
.transport-files-head .case-scan-slot {
  margin-left: auto;
}
.transport-other-name {
  display: grid;
  gap: .25rem;
  margin: 0 0 .55rem;
  font-size: .75rem;
  font-weight: 700;
  color: var(--muted);
}
.transport-other-name input {
  width: 100%;
  box-sizing: border-box;
  padding: .42rem .65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--navy);
  font-size: .9rem;
  font-weight: 500;
}
.transport-kind-row {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-bottom: .75rem;
}
.transport-kind-row .btn {
  flex: 1 1 9.2rem;
}
.transport-kind-row.is-scan-mode .btn {
  background: linear-gradient(135deg, var(--navy-mid) 0%, var(--navy-deep) 100%);
  box-shadow: 0 4px 10px rgba(0, 59, 126, 0.22);
}
.transport-kind-row.is-scan-mode .btn:hover {
  box-shadow: 0 6px 14px rgba(0, 59, 126, 0.28);
}
#transportOtherBtn:disabled,
#transportOtherBtn[disabled] {
  opacity: .45;
  filter: grayscale(.35);
  cursor: not-allowed;
  box-shadow: none;
}
.transport-list th,
.transport-list td {
  padding: .16rem .4rem;
  font-size: .8rem;
  line-height: 1.15;
}
.transport-list .btn {
  padding: .18rem .65rem;
  font-size: .75rem;
  box-shadow: none;
}
.transport-file-row {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  align-items: center;
  padding: .4rem 0;
  border-bottom: 1px solid var(--line);
}
.transport-file-row form { margin: 0; }
@media (max-width: 860px) {
  .transport-split { grid-template-columns: 1fr; }
}
/* Cloud (licni folder) */
.cloud-card { overflow-x: auto; }
.cloud-head-actions {
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem .65rem;
}
.cloud-scan-name {
  min-width: 12rem;
  max-width: 18rem;
  width: 100%;
  padding: .62rem .85rem;
}
.cloud-scan-agent {
  width: 14rem;
  max-width: min(14rem, 100%);
  padding: .5rem .55rem;
  font-size: .82rem;
}
.cloud-upload-btn { cursor: pointer; margin: 0; }
.cloud-upload-btn input { display: none; }
.cloud-status {
  margin: 0 0 .75rem;
  padding: .45rem .65rem;
  background: rgba(0, 59, 126, 0.06);
  border-radius: 8px;
}
.cloud-table {
  table-layout: fixed;
  width: 100%;
}
.cloud-table th,
.cloud-table td {
  vertical-align: middle;
}
.cloud-table .cloud-col-name { width: 36%; }
.cloud-table .cloud-col-size { width: 7.5rem; white-space: nowrap; }
.cloud-table .cloud-col-date { width: 11.5rem; white-space: nowrap; }
.cloud-table .cloud-col-share { width: auto; }
.cloud-table .cloud-col-actions {
  width: 12.5rem;
  white-space: nowrap;
  text-align: right;
}
.cloud-table .cloud-name-cell {
  min-width: 0;
}
.cloud-filename {
  font-weight: 700;
  word-break: break-word;
  color: var(--navy, #1a2744);
  text-decoration: underline;
  text-underline-offset: 2px;
}
a.cloud-filename:hover {
  color: var(--red, #d31219);
}
.cloud-badge {
  display: inline-block;
  margin-left: .35rem;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .12rem .4rem;
  border-radius: 999px;
  background: rgba(0, 59, 126, 0.1);
  color: var(--navy, #1a2744);
  vertical-align: middle;
}
.cloud-actions {
  white-space: nowrap;
  text-align: right;
}
.cloud-actions .btn {
  padding: .18rem .45rem;
  font-size: .75rem;
  min-height: 0;
}
.cloud-share-dialog { width: min(640px, calc(100vw - 1.5rem)); }
.cloud-share-file { margin: 0 0 .35rem; font-weight: 700; color: var(--ink); }
.cloud-share-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: .75rem;
}
.cloud-share-h {
  margin: 0 0 .4rem;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}
.cloud-share-list {
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .35rem;
  background: #fff;
}
.cloud-share-item {
  display: flex;
  align-items: flex-start;
  gap: .45rem;
  padding: .35rem .4rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: .9rem;
  line-height: 1.25;
}
.cloud-share-item:hover { background: rgba(0, 59, 126, 0.05); }
.cloud-share-item input { margin-top: .15rem; flex-shrink: 0; }
.cloud-share-status { color: #b42318; }
@media (max-width: 640px) {
  .cloud-share-cols { grid-template-columns: 1fr; }
  .cloud-actions { white-space: normal; }
  .cloud-table .cloud-col-size,
  .cloud-table .cloud-col-date,
  .cloud-table .cloud-col-actions { width: auto; }
}
