:root {
  --brand-nav-bg: #6eb6e8;
  --brand-nav-text: #000;
  --brand-chip-bg: #d6ebf7;
  --brand-chip-text: #000;
  --brand-accent-bg: #e8f4fc;
  --brand-accent-border: #9ec9e8;
  --brand-accent-text: #164061;
  --brand-focus: #5a9fd4;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: #222;
  background: #f5f6f8;
}

.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: var(--brand-nav-bg);
  color: var(--brand-nav-text);
}

.top-nav nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-title-chip {
  background: var(--brand-chip-bg);
  color: var(--brand-chip-text);
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 4px;
  min-width: 140px;
}

.nav-divider {
  width: 1px;
  height: 24px;
  background: rgba(0, 0, 0, 0.25);
  display: inline-block;
}

.top-nav a,
.top-nav .dropdown-toggle,
.top-nav button {
  color: var(--brand-nav-text);
  text-decoration: none;
  border: 0;
  background: none;
  font-size: 14px;
  cursor: pointer;
}

.top-nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--brand-nav-text);
}

.top-nav-right span,
.top-nav-right a {
  font-size: 14px;
  color: var(--brand-nav-text);
}

.top-nav-username {
  white-space: nowrap;
}

#predmet-switch-select.project-switch-select {
  min-width: 120px;
  width: auto;
  max-width: 280px;
  color: #000;
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.25);
}

#sk-god-switch-select.project-switch-select {
  min-width: 88px;
  width: auto;
  max-width: 120px;
  color: #000;
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.25);
}

.project-switch-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.project-switch-select {
  height: 24px;
  min-width: 96px;
  width: 96px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 12px;
  padding: 0 4px;
}

.project-switch-select option {
  color: #222;
}

.dropdown {
  position: relative;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 24px;
  left: 0;
  min-width: 220px;
  background: #fff;
  color: #222;
  border: 1px solid #ddd;
  border-radius: 4px;
  z-index: 10;
}

.dropdown-menu a {
  display: block;
  padding: 8px 10px;
  color: #222;
}

.dropdown.open .dropdown-menu {
  display: block;
}

.page-content {
  padding: 14px;
}

.panel {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}

.split-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
}

.split-layout > .panel {
  min-width: 0;
}

.animals-layout {
  grid-template-columns: 4fr 1fr;
}

.tests-layout {
  --tests-right-panel-width: 260px;
  grid-template-columns: minmax(0, 1fr) 10px minmax(220px, var(--tests-right-panel-width));
  min-height: calc(100vh - 110px);
  align-items: stretch;
}

.tests-layout > .panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#tests-grid {
  flex: 1 1 auto;
  min-height: 0;
}

.tests-vertical-splitter {
  cursor: col-resize;
  border-left: 2px solid #d7dbe0;
  border-right: 2px solid #d7dbe0;
  border-radius: 4px;
  background: linear-gradient(to right, #f5f7fa, #eef2f7);
  margin: 0 4px;
}

.tests-vertical-splitter:hover {
  border-left-color: #9db4d8;
  border-right-color: #9db4d8;
}

.grid-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.admin-tables-toolbar {
  align-items: center;
}

.izvjestaji-top-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.izvjestaji-subtabs-toolbar,
.admin-tables-subtabs-toolbar {
  justify-content: flex-start;
  padding-top: 6px;
  border-top: 1px solid #e1e6ec;
}

.izvjestaji-subtabs-toolbar[hidden],
.admin-tables-subtabs-toolbar[hidden] {
  display: none !important;
}

.izvjestaji-napomena-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.izvjestaji-napomena-btn-exists {
  background: #b42318;
  border-color: #912018;
  color: #fff;
}

.izvjestaji-workload-pivot-section {
  min-height: calc(100vh - 190px);
}

.izvjestaji-workload-pivot-toolbar {
  justify-content: flex-start;
  border-bottom: 1px solid #d7dde5;
}

.izvjestaji-workload-pivot {
  width: 100%;
  height: calc(100vh - 235px);
  min-height: 520px;
}

.izvjestaji-server-pivot-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #d7dde5;
}

.izvjestaji-server-pivot-filters label {
  font-size: 12px;
  font-weight: 700;
}

.izvjestaji-server-pivot-filters select {
  min-width: 130px;
}

.izvjestaji-server-pivot-wrap {
  max-height: calc(100vh - 285px);
  min-height: 480px;
  overflow: auto;
}

.izvjestaji-server-pivot {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.izvjestaji-server-pivot th,
.izvjestaji-server-pivot td {
  padding: 8px 10px;
  border-right: 1px solid #d7dde5;
  border-bottom: 1px solid #d7dde5;
  white-space: nowrap;
}

.izvjestaji-server-pivot th {
  background: #eef2f7;
  font-weight: 700;
  text-align: center;
}

.izvjestaji-server-pivot td:nth-child(n + 4) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.izvjestaji-server-pivot tbody tr:nth-child(even) td {
  background: #f8fafc;
}

.izvjestaji-server-pivot tbody tr:hover td {
  background: #eaf2fb;
}

.izvjestaji-server-pivot-method {
  border-left: 2px solid #aeb9c7;
}

.izvjestaji-napomena-modal-card {
  max-width: 560px;
  width: min(560px, 94vw);
  max-height: min(90vh, 820px);
  overflow-y: auto;
}

.animals-modal-form.izvjestaji-napomena-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: stretch;
}

.izvjestaji-napomena-predmeti-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.izvjestaji-napomena-field-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.izvjestaji-napomena-field-label {
  display: block;
  font-weight: 650;
  font-size: 13px;
  color: #1f2937;
}

.animals-modal-form.izvjestaji-napomena-form textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 96px;
  resize: vertical;
}

.admin-tables-toolbar .admin-tables-tabs {
  flex: 1 1 auto;
  flex-wrap: wrap;
  margin-bottom: 0;
  min-width: 0;
}

.admin-tables-actions-toolbar {
  margin-top: -2px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.admin-tables-clear-groups-btn {
  margin-left: auto;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.clear-groups-modal-card {
  max-width: 560px;
}

.clear-groups-modal-body {
  white-space: pre-wrap;
  line-height: 1.45;
  margin: 8px 0 14px;
}

.clear-groups-modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.clear-groups-cancel-btn {
  font-size: 1.15rem;
  font-weight: 700;
  padding: 10px 18px;
}

.clear-groups-confirm-btn {
  font-size: 0.82rem;
  padding: 6px 10px;
  opacity: 0.92;
}

.izvjestaji-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
}

.izvjestaji-summary-wrap {
  min-height: 120px;
}

.grid td.izvjestaji-min-sati-prekoracen {
  background: #f8d7da;
  color: #842029;
  font-weight: 700;
}

.izvjestaji-detail-section {
  margin-top: 8px;
  min-height: 0;
}

.izvjestaji-detail-toolbar {
  margin-bottom: 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}

.izvjestaji-detail-tabs {
  margin: 0;
}

.izvjestaji-detail-empty {
  margin: 8px 0 0;
}

.izvjestaji-detail-wrap {
  min-height: 140px;
}

#izvjestaji-drilldown-section {
  padding-top: 2px;
}

#izvjestaji-drilldown-wrap {
  min-height: 180px;
}

.danger-btn {
  background: #b42318;
  color: #fff;
  border: 1px solid #8e1a12;
}

.shipment-top-toolbar {
  align-items: center;
}

.shipment-send-btn {
  font-weight: 700;
  background: #16794a;
  color: #fff;
  border: 1px solid #0f5d39;
}

.shipment-items-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

.shipment-section-title {
  margin: 0;
}

.shipment-items-toolbar {
  margin-bottom: 0;
  justify-content: flex-end;
}

.shipment-divider {
  height: 0;
  border-top: 2px solid #c7c7c7;
  border-bottom: 2px solid #c7c7c7;
  margin: 10px 0;
}

.shipment-request-tests-section {
  margin-top: 10px;
  width: 460px;
  max-width: 100%;
  background: #e9e9ee;
  border: 1px solid #cfcfd8;
  border-radius: 4px;
  padding: 10px;
}

.shipment-request-tests-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.shipment-request-test-row {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
}

.shipment-request-test-row select {
  width: 260px;
  min-width: 260px;
  max-width: 260px;
  flex: 0 0 auto;
}

.shipment-request-tests-submit-wrap {
  justify-content: flex-start;
  margin-top: 8px;
}

.side-panel {
  max-height: calc(100vh - 180px);
  overflow-y: auto;
  overflow-x: hidden;
}

.tests-results-panel {
  max-height: none;
  height: 100%;
}

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

.detail-block {
  padding: 8px;
  border: 1px solid #ddd;
  background: #fafafa;
  border-radius: 4px;
}

.tests-detail-compact {
  gap: 6px;
}

.tests-detail-compact .detail-block {
  padding: 6px;
  font-size: 12px;
  line-height: 1.2;
}

.tests-detail-compact .detail-block > div {
  margin-bottom: 2px;
}

.tests-detail-compact .detail-block > div:last-child {
  margin-bottom: 0;
}

.tests-animal-mini-map {
  width: 100%;
  height: 130px;
  border: 1px solid #d5d5d5;
  border-radius: 4px;
  margin-top: 4px;
}

.tests-adv-filter-modal-card {
  width: min(900px, 96vw);
}

.tests-adv-filter-controls {
  display: grid;
  grid-template-columns: 80px 180px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.tests-adv-filter-rows {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
}

.tests-adv-filter-row {
  display: grid;
  grid-template-columns: minmax(110px, 160px) 64px minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.tests-adv-filter-row > * {
  min-width: 0;
}

.tests-adv-filter-row select,
.tests-adv-filter-row input,
.tests-adv-filter-value-wrap {
  width: 100%;
}

.tests-adv-filter-row button {
  min-width: 34px;
  width: 34px;
  padding: 4px 0;
}

.form-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 6px 8px;
  align-items: center;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
}

.list-box {
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
}

.list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-bottom: 1px solid #eee;
}

.list-row:last-child {
  border-bottom: 0;
}

.list-row.shipment-request-test-row {
  justify-content: flex-start;
  gap: 6px;
}

.mobile-scan-nav-toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 3000;
  min-width: 280px;
  max-width: 420px;
  background: #1f2937;
  color: #fff;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
  padding: 10px 12px;
}

.mobile-scan-nav-toast-text {
  margin-bottom: 8px;
  line-height: 1.35;
}

.mobile-scan-nav-toast-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.mobile-scan-nav-toast-actions button {
  padding: 4px 10px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay[hidden] {
  display: none !important;
}

.modal-card {
  width: min(520px, 92vw);
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 14px;
}

.bulk-delete-preview-card {
  width: min(920px, 96vw);
  max-height: 88vh;
  overflow: auto;
}

.bulk-delete-preview-note {
  color: #a15c00;
}

.bulk-delete-preview-list-wrap {
  margin-top: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 8px;
}

.bulk-delete-preview-table {
  width: 100%;
  border-collapse: collapse;
}

.bulk-delete-preview-table th,
.bulk-delete-preview-table td {
  border: 1px solid #e3e3e3;
  padding: 6px;
  vertical-align: top;
  text-align: left;
}

.bulk-delete-preview-table pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.multiply-edit-modal-card {
  width: min(720px, 96vw);
  border: 2px solid #b42318;
}

.multiply-edit-warning {
  margin: 0 0 10px 0;
  color: #b42318;
  font-weight: 700;
}

.multiply-edit-selected-count {
  margin: 0 0 10px 0;
  color: #344054;
  font-size: 13px;
}

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

.multiply-edit-field-row {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 8px;
  align-items: center;
}

.multiply-edit-field-toggle {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-size: 13px;
}

#animals-map {
  width: 100%;
  aspect-ratio: 5 / 4;
  height: auto;
  border: 1px solid #ddd;
}

.grid-scroll-wrap {
  width: 100%;
  overflow: visible;
}

.grid-host {
  width: 100%;
  overflow-x: scroll;
  overflow-y: hidden;
}

.animals-grid-wrap {
  max-height: none;
  overflow: visible;
}

.animals-samples-section {
  margin-top: 10px;
}

.animals-samples-toolbar {
  justify-content: space-between;
  align-items: center;
}

.animals-samples-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.animals-samples-actions .danger-btn {
  background: #b42318;
  color: #fff;
  border: 1px solid #8e1a12;
}

.animals-samples-grid-wrap {
  max-height: none;
  overflow: visible;
}

.samples-tissues-grid-wrap {
  max-height: none;
  overflow: visible;
}

.samples-aliquots-section {
  margin-top: 10px;
}

.samples-meta-line {
  margin: 2px 0 6px;
  font-size: 12px;
  line-height: 1.35;
  color: #3c4a5c;
}

.samples-horizontal-splitter,
.tables-horizontal-splitter {
  height: 10px;
  margin: 6px 0;
  cursor: row-resize;
  border-top: 2px solid #d7dbe0;
  border-bottom: 2px solid #d7dbe0;
  border-radius: 4px;
  background: linear-gradient(to bottom, #f5f7fa, #eef2f7);
}

.samples-horizontal-splitter:hover,
.tables-horizontal-splitter:hover {
  border-top-color: #9db4d8;
  border-bottom-color: #9db4d8;
}

.samples-aliquots-grid-wrap {
  max-height: none;
  overflow: visible;
}

.animals-side-actions {
  align-items: center;
}

.animals-side-actions .danger-btn {
  margin-left: auto;
  background: #b42318;
  color: #fff;
  border: 1px solid #8e1a12;
}

.animals-modal-card {
  width: min(1100px, 96vw);
  max-height: 92vh;
  overflow: auto;
}

.animals-sample-modal-card {
  width: min(520px, 92vw);
}

.animals-sample-form {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 8px;
  align-items: center;
}

.animals-sample-form input,
.animals-sample-form select {
  width: 100%;
}

.animals-modal-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr);
  gap: 12px;
}

.animals-modal-form {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px;
  align-items: center;
}

.animals-modal-form textarea,
.animals-modal-form input,
.animals-modal-form select {
  width: 100%;
}

.animals-modal-map-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#animals-edit-map {
  width: 100%;
  min-height: 300px;
  border: 1px solid #ddd;
}

.animals-files-sections {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.animals-files-section {
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  padding: 8px;
}

.animals-files-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.animals-files-header h3 {
  margin: 0;
  font-size: 15px;
}

.animals-existing-files,
.animals-upload-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.animals-docs-drop-zone {
  border: 1px dashed #999;
  border-radius: 6px;
  padding: 10px;
  text-align: center;
  color: #555;
  background: #fafafa;
  margin-bottom: 8px;
}

.animals-docs-drop-zone.dragover {
  border-color: var(--brand-focus);
  background: var(--brand-accent-bg);
}

.animals-file-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: center;
}

.animals-doc-file-row {
  grid-template-columns: 1fr 1fr auto;
}

.animals-file-row button {
  min-width: 28px;
}

.animals-existing-file-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: center;
  padding: 4px 6px;
  border: 1px solid #eee;
  border-radius: 4px;
}

.animals-modal-error {
  color: #b42318;
  font-size: 13px;
  margin-top: 8px;
  min-height: 18px;
}

.animals-modal-actions {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

#tests-form-modal .animals-sample-modal-card,
#tests-bulk-edit-modal .animals-sample-modal-card {
  width: min(780px, 96vw);
}

#tests-form-upload-section,
#tests-bulk-upload-section {
  grid-column: 1 / -1;
  width: calc(100% + 28px);
  margin-left: -14px;
  margin-right: -14px;
  border-left: 0;
  border-right: 0;
  border-radius: 0;
  padding: 10px 14px;
}

#tests-bulk-edit-modal .animals-sample-form {
  grid-template-columns: 160px minmax(0, 1fr);
  justify-content: stretch;
  align-content: start;
}

.tests-date-input-wrap {
  position: relative;
  width: 100%;
}

.tests-date-input-wrap input[type="text"] {
  padding-right: 28px;
}

.tests-date-picker-arrow {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.tests-date-picker-arrow::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -35%);
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 6px solid #555;
}

.tests-date-picker-arrow:hover::before {
  border-top-color: #222;
}

.tests-code-input-wrap {
  position: relative;
  width: 100%;
}

.tests-code-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 35;
  max-height: 220px;
  overflow: auto;
  background: #fff;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  box-shadow: 0 6px 16px rgba(16, 24, 40, 0.12);
}

.tests-code-suggestion-item {
  padding: 6px 8px;
  cursor: pointer;
  font-size: 13px;
}

.tests-code-suggestion-item:hover {
  background: #f2f4f7;
}

#tests-form-upload-section .animals-doc-file-row,
#tests-bulk-upload-section .animals-doc-file-row,
#tests-form-upload-section .animals-existing-file-row {
  grid-template-columns: minmax(0, 1fr) minmax(180px, 260px) auto;
}

.tests-upload-delete-btn {
  min-width: 52px !important;
  width: 52px;
  padding: 2px 6px;
  font-size: 11px;
  line-height: 1.2;
}

.grid-fixed-rows tbody {
  display: block;
  max-height: var(--grid-body-max-height, 360px);
  overflow-y: auto;
  overflow-x: hidden;
}

.grid-fixed-rows thead,
.grid-fixed-rows tbody tr {
  display: table;
  width: 100%;
  table-layout: fixed;
}

.grid-fixed-rows thead tr.grid-filter-row th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #fff;
}

.grid-fixed-rows thead tr.grid-header-row th {
  position: sticky;
  top: 34px;
  z-index: 3;
  background: #fff;
}

.animals-thumbnails {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.animals-attachments {
  margin: 8px 0;
}

.animals-attachments-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.animals-attachment-link-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.animals-attachments-list a {
  font-size: 12px;
}

.file-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid var(--brand-accent-border);
  background: var(--brand-accent-bg);
  color: var(--brand-accent-text);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

.animals-thumbnail {
  width: 88px;
  height: 88px;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.animals-thumbnail img {
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
}

.animals-thumbnail-label {
  width: 88px;
  font-size: 11px;
  color: #555;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.animals-detail-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.animals-detail-card {
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  padding: 8px;
}

.animals-detail-line {
  font-size: 13px;
  margin-bottom: 4px;
}

.animals-detail-line:last-child {
  margin-bottom: 0;
}

table.animals-grid th:nth-child(1),
table.animals-grid td:nth-child(1) {
  width: 32px;
  min-width: 32px;
  max-width: 32px;
  padding-left: 4px;
  padding-right: 4px;
}

table.animals-grid th:nth-child(2),
table.animals-grid td:nth-child(2) {
  width: 42px;
  min-width: 42px;
  max-width: 42px;
  padding-left: 4px;
  padding-right: 4px;
}

table.animals-grid th:nth-child(3),
table.animals-grid td:nth-child(3) {
  width: 135px;
  min-width: 135px;
  max-width: 135px;
  padding-left: 4px;
  padding-right: 4px;
}

table.animals-grid th:nth-child(4),
table.animals-grid td:nth-child(4) {
  width: 132px;
  min-width: 132px;
  max-width: 132px;
  padding-left: 4px;
  padding-right: 4px;
}

table.animals-grid th:nth-child(5),
table.animals-grid td:nth-child(5) {
  width: 70px;
  min-width: 70px;
  max-width: 70px;
  padding-left: 4px;
  padding-right: 4px;
}

table.animals-grid th:nth-child(6),
table.animals-grid td:nth-child(6) {
  width: 110px;
  min-width: 110px;
  max-width: 110px;
  padding-left: 4px;
  padding-right: 4px;
}

table.animals-grid th:nth-child(9),
table.animals-grid td:nth-child(9) {
  width: 72px;
  min-width: 72px;
  max-width: 72px;
  padding-left: 4px;
  padding-right: 4px;
  text-align: center;
}

table.samples-tissues-grid th:nth-child(5),
table.samples-tissues-grid td:nth-child(5),
table.samples-aliquots-grid th:nth-child(5),
table.samples-aliquots-grid td:nth-child(5) {
  width: 92px;
  min-width: 92px;
  max-width: 92px;
}

table.samples-tissues-grid th:nth-child(6),
table.samples-tissues-grid td:nth-child(6),
table.samples-aliquots-grid th:nth-child(6),
table.samples-aliquots-grid td:nth-child(6) {
  width: 88px;
  min-width: 88px;
  max-width: 88px;
}

table.samples-tissues-grid th:nth-child(7),
table.samples-tissues-grid td:nth-child(7),
table.samples-aliquots-grid th:nth-child(7),
table.samples-aliquots-grid td:nth-child(7) {
  width: 72px;
  min-width: 72px;
  max-width: 72px;
  text-align: right;
}

table.samples-tissues-grid th:nth-child(8),
table.samples-tissues-grid td:nth-child(8),
table.samples-aliquots-grid th:nth-child(8),
table.samples-aliquots-grid td:nth-child(8) {
  width: 56px;
  min-width: 56px;
  max-width: 56px;
  text-align: center;
}

table.samples-tissues-grid th:nth-child(9),
table.samples-tissues-grid td:nth-child(9),
table.samples-aliquots-grid th:nth-child(9),
table.samples-aliquots-grid td:nth-child(9) {
  width: 84px;
  min-width: 84px;
  max-width: 84px;
}

table.samples-tissues-grid th:nth-child(10),
table.samples-tissues-grid td:nth-child(10) {
  width: 68px;
  min-width: 68px;
  max-width: 68px;
  text-align: center;
}

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.tab-btn {
  padding: 6px 10px;
  border: 1px solid #ccc;
  background: #fff;
}

.tab-btn.active {
  background: #e8f2ff;
}

.settings-entities-modal-card {
  width: min(760px, 94vw);
  max-height: 90vh;
  overflow-y: auto;
}

.admin-tables-subject-people {
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.admin-tables-subject-people-toolbar {
  justify-content: flex-start;
}

.admin-tables-subject-people > .muted {
  margin: 10px 0;
}

.bodovi-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: flex-end;
  margin-bottom: 10px;
}

.bodovi-predmet-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.9rem;
  min-width: 280px;
}

.bodovi-predmet-field select {
  min-width: 280px;
  max-width: min(640px, 100vw);
}

.bodovi-layout {
  --bodovi-right-panel-width: 420px;
  grid-template-columns: minmax(0, 1fr) 10px minmax(280px, var(--bodovi-right-panel-width));
  min-height: calc(100vh - 110px);
  align-items: stretch;
  gap: 0;
}

.bodovi-layout > .panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.bodovi-left-panel {
  min-width: 0;
}

.bodovi-grid-wrap {
  flex: 1 1 auto;
  min-height: 0;
}

#bodovi-grid {
  flex: 1 1 auto;
  min-height: 0;
}

.bodovi-right-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 280px;
  padding: 10px 12px 12px;
  border: 1px solid #d7dbe0;
  border-radius: 6px;
  background: #fff;
  max-height: calc(100vh - 110px);
  overflow: hidden;
}

.bodovi-right-title {
  margin: 0 0 8px;
  font-size: 15px;
  flex: 0 0 auto;
}

.bodovi-right-stats {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bodovi-right-napomena {
  flex: 0 0 auto;
  max-height: 28%;
  min-height: 96px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-top: 1px solid #e1e6ec;
  padding-top: 10px;
}

.bodovi-stats-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bodovi-stats-header {
  flex: 0 0 auto;
  margin-bottom: 8px;
}

.bodovi-stats-student {
  font-weight: 650;
  font-size: 14px;
  line-height: 1.3;
}

.bodovi-stats-meta {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.35;
}

.bodovi-stats-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}

.bodovi-stats-table-scroll {
  overflow-x: auto;
  max-width: 100%;
  margin-bottom: 4px;
}

.bodovi-stats-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 6px;
  font-size: 12px;
}

.bodovi-stats-section-title {
  margin: 12px 0 6px;
  font-size: 13px;
  font-weight: 650;
}

.bodovi-stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.bodovi-stats-breakdown th,
.bodovi-stats-breakdown td {
  border: 1px solid #e2e8f0;
  padding: 4px 5px;
  text-align: left;
  vertical-align: top;
}

.bodovi-stats-breakdown thead th {
  background: #f8fafc;
  font-weight: 600;
  white-space: nowrap;
}

.bodovi-stats-breakdown tbody th {
  background: #fff;
  font-weight: 600;
  text-align: left;
}

.bodovi-stats-breakdown td {
  text-align: right;
  white-space: nowrap;
}

.bodovi-stats-breakdown td.bodovi-stats-below-min,
.bodovi-stats-breakdown th.bodovi-stats-below-min {
  background: rgba(220, 70, 70, 0.14);
  color: #b42318;
  font-weight: 600;
}

.bodovi-stats-table th,
.bodovi-stats-table td {
  border: 1px solid #e2e8f0;
  padding: 4px 6px;
  text-align: left;
  vertical-align: top;
}

.bodovi-stats-table th {
  background: #f8fafc;
  font-weight: 600;
  width: 62%;
}

.bodovi-stats-table td {
  text-align: right;
  white-space: nowrap;
  width: 38%;
}

.bodovi-stats-table tr.bodovi-stats-below-min th,
.bodovi-stats-table tr.bodovi-stats-below-min td {
  background: rgba(220, 70, 70, 0.14);
  color: #b42318;
  font-weight: 600;
}

.bodovi-napomena-text {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.bodovi-vertical-splitter {
  cursor: col-resize;
  border-left: 2px solid #d7dbe0;
  border-right: 2px solid #d7dbe0;
  border-radius: 4px;
  background: linear-gradient(to right, #f5f7fa, #eef2f7);
  margin: 0 4px;
  touch-action: none;
}

.bodovi-vertical-splitter:hover {
  border-left-color: #9db4d8;
  border-right-color: #9db4d8;
}

body.bodovi-resizing {
  cursor: col-resize;
  user-select: none;
}

.grid td.bodovi-below-min {
  background: rgba(220, 70, 70, 0.18);
  color: #b42318;
  font-weight: 600;
}

.grid tr.bodovi-row-passed td {
  background: rgba(46, 160, 67, 0.16);
}

.grid tr.bodovi-row-passed td.bodovi-below-min {
  background: rgba(220, 70, 70, 0.22);
  color: #b42318;
}

.admin-tables-enrollment {
  margin-top: 8px;
}

.bodovi-koeficijenti {
  margin-top: 8px;
}

.bodovi-koeficijenti-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: flex-end;
  margin-bottom: 12px;
}

.bodovi-koeficijenti-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.9rem;
  min-width: 260px;
}

.bodovi-koeficijenti-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.7fr);
  gap: 16px;
  align-items: start;
}

.bodovi-koeficijenti-left {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.bodovi-koeficijenti-grid-block {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px 12px;
  background: var(--panel, #fff);
}

.bodovi-koeficijenti-grid-block.active {
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.35);
}

.bodovi-koeficijenti-grid-block h3,
.bodovi-koeficijenti-right h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.bodovi-koeficijenti-right {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel, #fff);
  position: sticky;
  top: 12px;
}

.bodovi-koeficijenti-profile-title {
  margin: 0 0 8px;
}

.bodovi-koeficijenti-rules {
  margin: 0 0 14px;
  padding-left: 1.15rem;
  font-size: 0.9rem;
  line-height: 1.45;
}

.bodovi-koeficijenti-rules li + li {
  margin-top: 6px;
}

.bodovi-koeficijenti-napomena-field {
  width: 100%;
  min-width: 0;
}

.bodovi-koeficijenti-napomena-field textarea {
  width: 100%;
  min-height: 180px;
  resize: vertical;
  font: inherit;
  line-height: 1.4;
}

.bodovi-koeficijenti-napomena-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}

@media (max-width: 980px) {
  .bodovi-koeficijenti-layout {
    grid-template-columns: 1fr;
  }

  .bodovi-koeficijenti-right {
    position: static;
  }
}

.admin-tables-enrollment-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: flex-end;
  margin-bottom: 10px;
}

.admin-tables-enrollment-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.9rem;
}

.admin-tables-enrollment-paste {
  flex: 1 1 320px;
  min-width: 260px;
}

.admin-tables-enrollment-paste textarea {
  width: 100%;
  min-height: 72px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
}

.admin-tables-enrollment-meta {
  flex: 1 1 240px;
  align-self: center;
}

#admin-tables-enrollment-section[data-mode="elective"] .enrollment-person-field {
  display: none !important;
}

.enrollment-person-field[hidden] {
  display: none !important;
}

.grid tr.enrollment-row-exists td {
  background: rgba(46, 160, 67, 0.12);
}

.grid tr.enrollment-row-missing td {
  background: rgba(220, 70, 70, 0.12);
}

.settings-entities-modal-form {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 8px;
  align-items: center;
}

.settings-entities-modal-form > label {
  justify-self: start;
  align-self: start;
  padding-top: 7px;
  text-align: left;
}

.settings-entities-modal-form input,
.settings-entities-modal-form select {
  width: 100%;
}

.settings-entities-modal-form input[type="checkbox"] {
  width: auto;
  min-width: 0;
  margin: 0;
  flex: 0 0 auto;
}

.settings-entities-multiselect-wrap {
  display: grid;
  gap: 6px;
  width: 100%;
  justify-self: stretch;
  text-align: left;
}

.settings-entities-multiselect-search {
  width: 100%;
}

.multi-select-panel {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  margin-top: 4px;
  border: 1px solid #c5c7d0;
  border-radius: 6px;
  background: #fff;
  padding: 8px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.multi-select-search {
  width: 100%;
  margin-bottom: 6px;
}

.multi-select-options {
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.multi-select-option {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  width: 100%;
  text-align: left;
}

.settings-entities-multiselect-panel-inline {
  position: static;
  margin-top: 0;
  box-shadow: none;
}

.settings-entities-multiselect-panel-inline .multi-select-options {
  min-height: 112px;
  max-height: 160px;
  align-items: stretch;
}

.settings-entities-multiselect-panel-inline .multi-select-option {
  justify-content: flex-start;
  width: auto;
  text-align: left;
}

.settings-entities-multiselect-panel-inline .multi-select-option span {
  flex: 1 1 auto;
  text-align: left;
}

.multi-select-option-all {
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 6px;
  margin-bottom: 2px;
}

.multi-select-empty {
  color: #6b7280;
  font-size: 13px;
}

.multi-select-count {
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #4f46e5;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
}

.settings-entities-app-settings-form {
  display: grid;
  grid-template-columns: 240px minmax(320px, 1fr);
  gap: 8px 10px;
  align-items: center;
  margin-top: 8px;
  width: 100%;
}

/* Printer settings: QZ/network blocks were wrapping labels in divs, so grid row-gap did not apply between fields (unlike Print layout). Subtree participates in parent grid when visible. */
#settings-printer-settings-wrap #settings-app-qz-controls:not([hidden]),
#settings-printer-settings-wrap #settings-app-network-controls:not([hidden]) {
  display: contents;
}

.settings-app-printer-save-row {
  grid-column: 1 / -1;
  margin-top: 10px;
}

.settings-app-worker-script-link-row {
  display: contents;
}

.settings-app-worker-script-link {
  grid-column: 1 / -1;
  margin-top: 4px;
  font-size: 14px;
}

.settings-print-queue-scroll {
  max-height: min(38.5vh, 336px);
  overflow: auto;
  width: 100%;
}

.settings-print-queue-note {
  margin-top: 8px;
  font-size: 12px;
  color: #64748b;
}

#settings-entities-app-settings,
#settings-entities-data-import {
  width: min(50vw, 980px);
  max-width: 100%;
}

/* ~30% wider than sibling settings blocks so Print settings + layout + queue table fit one line per cell */
#settings-entities-print-settings {
  width: min(65vw, 1274px);
  max-width: 100%;
}

.settings-entities-app-settings-form input,
.settings-entities-app-settings-form select {
  width: 100%;
}

.settings-app-layout-name-wrap,
.settings-app-layout-save-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.settings-app-layout-save-wrap {
  grid-template-columns: 1fr auto;
}

.settings-app-printer-name-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.settings-app-qz-download-row-wrap {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.settings-app-section-divider {
  grid-column: 1 / -1;
  border-top: 2px solid #cfd4dc;
  margin: 6px 0 2px 0;
}

.settings-app-major-divider {
  grid-column: 1 / -1;
  border-top: 4px solid #1f2937;
  margin: 14px 0 10px 0;
}

.settings-app-layout-section-title {
  grid-column: 1 / -1;
  font-weight: 600;
  margin-top: 2px;
  margin-bottom: 2px;
}

.settings-app-label-preview-wrap {
  border: 1px solid #d6dbe2;
  border-radius: 6px;
  background: #f8fafc;
  padding: 10px;
  width: 100%;
  min-width: 460px;
  box-sizing: border-box;
}

/* Full width of form like section dividers; avoid narrow 2nd column squeezing the table */
.settings-app-print-queue-wrap {
  grid-column: 1 / -1;
  min-width: 0;
  max-width: none;
}

.settings-app-print-queue-wrap .settings-print-queue-scroll {
  overflow-x: auto;
}

.settings-app-print-queue-wrap table {
  width: max(100%, 598px);
  table-layout: auto;
}

.settings-app-print-queue-wrap th,
.settings-app-print-queue-wrap td {
  white-space: nowrap;
  padding: 6px 10px;
}

.settings-app-label-preview {
  width: 100%;
  min-height: 140px;
}

.settings-app-label-preview-sheet {
  border: 2px solid #111827;
  border-radius: 4px;
  background: #fff;
  overflow: hidden;
  display: grid;
  align-content: start;
  gap: 1px;
  padding: 4px;
  margin: 0 auto;
}

.settings-app-label-preview-row {
  border: 1px dashed #c4ccd7;
  border-radius: 4px;
  background: #f8fafc;
  padding: 1px 3px;
  min-height: 22px;
  display: flex;
  align-items: center;
}

.settings-app-label-preview-text {
  font-size: 12px;
  color: #111827;
}

.settings-app-label-preview-qr {
  width: 52px;
  height: 52px;
  border: 1px solid #111827;
  background:
    linear-gradient(90deg, #111827 25%, transparent 25%, transparent 50%, #111827 50%, #111827 75%, transparent 75%),
    linear-gradient(#111827 25%, transparent 25%, transparent 50%, #111827 50%, #111827 75%, transparent 75%);
  background-size: 10px 10px;
}

.settings-app-label-preview-barcode {
  width: 100%;
}

.settings-app-label-preview-barcode-bars {
  height: 44px;
  background: repeating-linear-gradient(
    to right,
    #111827 0 2px,
    transparent 2px 4px,
    #111827 4px 7px,
    transparent 7px 10px
  );
  border: 1px solid #111827;
}

.settings-app-label-preview-barcode-text {
  margin-top: 3px;
  font-size: 10px;
  letter-spacing: 0.5px;
}

.settings-app-label-preview-meta {
  margin-top: 8px;
  text-align: center;
  font-size: 12px;
  color: #4b5563;
}

.settings-app-print-label-row {
  margin-top: 8px;
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.settings-app-print-label-row-inline {
  grid-column: 1 / -1;
}

.settings-import-result {
  margin: 0;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.4;
}

.settings-import-history table {
  width: 100%;
  border-collapse: collapse;
}

.settings-import-history th,
.settings-import-history td {
  border-bottom: 1px solid #e5e7eb;
  padding: 6px 8px;
  font-size: 12px;
  text-align: left;
}

#settings-app-label-rows-config,
#settings-app-animal-label-rows-config {
  display: grid;
  gap: 8px;
}

.settings-app-label-row {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) 76px 82px 118px 168px;
  gap: 8px;
  align-items: center;
}

.settings-app-label-row input,
.settings-app-label-row select {
  width: 100%;
}

.dashboard-table {
  width: min(50%, 640px);
  border-collapse: collapse;
  table-layout: fixed;
  margin: 0;
}

.dashboard-table th,
.dashboard-table td {
  border: 1px solid #d7dce3;
  padding: 8px 10px;
  text-align: center;
  vertical-align: middle;
}

.dashboard-table thead th {
  background: #f4f7fb;
  font-weight: 600;
}

@media (max-width: 900px) {
  .dashboard-table {
    width: 100%;
  }
}

table.grid {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

table.grid th,
table.grid td {
  border-bottom: 1px solid #e5e5e5;
  border-left: 0;
  border-right: 0;
  padding: 6px 8px;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

table.grid th {
  position: relative;
}

table.grid tr.grid-filter-row th {
  overflow: visible;
  vertical-align: top;
}

table.grid th.grid-select-col,
table.grid td.grid-select-col {
  width: 28px;
  min-width: 28px;
  max-width: 28px;
  padding-left: 4px;
  padding-right: 4px;
  text-align: center;
}

table.grid td.grid-select-col input[type="checkbox"] {
  margin: 0;
}

table.grid th.grid-id-col,
table.grid td.grid-id-col {
  min-width: 42px;
  padding-left: 4px;
  padding-right: 4px;
}

table.grid th.grid-actions-col,
table.grid td.grid-actions-col {
  min-width: 56px;
  white-space: nowrap;
}

table.grid th.grid-dup-action-col,
table.grid td.grid-dup-action-col {
  width: 36px;
  min-width: 36px;
  max-width: 40px;
  padding: 2px;
  text-align: center;
  vertical-align: middle;
}

button.grid-row-dup-btn {
  border: 1px solid #c5ced6;
  background: #f7f9fb;
  color: #334155;
  border-radius: 4px;
  width: 26px;
  height: 24px;
  padding: 0;
  line-height: 1;
  cursor: pointer;
  font-size: 14px;
}

button.grid-row-dup-btn:hover {
  background: #e8eef5;
  border-color: #9db4d8;
}

table.grid tbody tr:nth-child(odd) {
  background: #fafafa;
}

table.grid tbody tr:nth-child(even) {
  background: #fff;
}

table.grid tbody tr.row-selected {
  background: #dbeafe !important;
}

table.grid th.sortable {
  cursor: pointer;
}

table.grid td.editable-cell {
  background: #fffceb;
  cursor: pointer;
}

.grid-inline-input {
  width: 100%;
  min-width: 90px;
  box-sizing: border-box;
}

.grid-col-resize-handle {
  position: absolute;
  top: 0;
  right: -4px;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
  z-index: 2;
}

.grid-col-resize-handle::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 3px;
  width: 1px;
  background: transparent;
}

table.grid th:hover .grid-col-resize-handle::after {
  background: #cbd5e1;
}

.grid-filter-row input {
  width: 100%;
}

.grid-filter-row select {
  width: 100%;
}

.grid-date-filter {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.grid-date-filter input[type="text"] {
  width: 100%;
  font-size: 12px;
}

.grid-pager {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0 0;
}

.grid-pager-top {
  padding: 0 0 8px;
}

.grid-pager-status {
  color: #475467;
  font-size: 12px;
}

.grid-pager-size {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.pdf-viewer-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  background: #f8fafc;
  padding: 8px;
}

#pdf-canvas {
  display: block;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 2px 10px rgba(16, 24, 40, 0.15);
}

table.animals-grid .grid-filter-row th:nth-child(7) input {
  max-width: 120px;
}

.messages .message {
  padding: 8px 10px;
  margin-bottom: 8px;
  border-radius: 4px;
}

.messages .success {
  background: #e7f8ed;
}

.login-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.login-header-image {
  display: block;
  width: min(816px, 96vw);
  max-height: 276px;
  object-fit: contain;
}

.login-panel {
  width: min(340px, 88vw);
  margin: 0 auto;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 10px 14px;
}

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

.login-subtitle {
  margin: 0 0 12px;
  color: #666;
  font-size: 13px;
}

.login-aai-button {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border-radius: 4px;
  background: #356da8;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}

.login-aai-button:hover {
  background: #285985;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 8px;
  color: #777;
  font-size: 11px;
}

.login-divider::before,
.login-divider::after {
  content: "";
  height: 1px;
  background: #ddd;
  flex: 1;
}

.login-local-link {
  display: block;
  margin-top: 12px;
  font-size: 12px;
  text-align: center;
}

.page-heading-row h1 {
  margin: 0 0 12px;
  font-size: 22px;
}

.grid-panel {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 8px;
  min-height: 420px;
}

.prisustvo-layout {
  --prisustvo-right-panel-width: 420px;
  grid-template-columns: minmax(0, 1fr) 10px minmax(260px, var(--prisustvo-right-panel-width));
  min-height: calc(100vh - 110px);
  align-items: stretch;
  gap: 0;
}

.prisustvo-layout > .panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.prisustvo-left-panel {
  min-width: 0;
}

.prisustvo-right-panel {
  max-height: none;
  height: 100%;
  min-width: 260px;
  padding: 8px 10px 10px;
  border: 1px solid #d7dbe0;
  border-radius: 6px;
  background: #fff;
}

.prisustvo-right-title {
  margin: 0 0 8px;
  font-size: 16px;
}

.prisustvo-people-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  flex: 0 0 auto;
}

.prisustvo-people-toolbar button {
  font-size: 12px;
  padding: 4px 10px;
}

#prisustvo-people-wrap {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
}

.prisustvo-vertical-splitter {
  cursor: col-resize;
  border-left: 2px solid #d7dbe0;
  border-right: 2px solid #d7dbe0;
  border-radius: 4px;
  background: linear-gradient(to right, #f5f7fa, #eef2f7);
  margin: 0 4px;
  touch-action: none;
}

.prisustvo-vertical-splitter:hover {
  border-left-color: #9db4d8;
  border-right-color: #9db4d8;
}

#prisustvo-sessions-grid,
#prisustvo-people-grid {
  flex: 1 1 auto;
  min-height: 0;
}

#prisustvo-people-empty {
  margin-top: 4px;
}

.login-panel form p {
  margin: 6px 0;
}

.login-panel input[type="text"],
.login-panel input[type="password"] {
  width: 100%;
}

.login-panel button[type="submit"] {
  margin-top: 6px;
  font-size: 12px;
  padding: 4px 10px;
}

.muted {
  color: #666;
  font-size: 12px;
}

.page-heading-inline-moved {
  display: none;
}

.prisustvo-termin-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  margin-bottom: 10px;
}

.prisustvo-termin-actions button {
  font-size: 12px;
  padding: 4px 10px;
}

.prisustvo-satnica-select {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 8px;
  padding: 6px 8px;
  border: 1px solid #cdd7e0;
  border-radius: 4px;
  background: #fff;
  font-size: 13px;
}

.prisustvo-satnica-select option.satnica-option-existing {
  background-color: #fde2e1;
  color: #7a2e2a;
}

.prisustvo-satnica-select option.satnica-option-current {
  background-color: #d7eaf8;
  color: #1a3a55;
}

.prisustvo-satnica-select option.satnica-option-existing.satnica-option-current {
  background-color: #fde2e1;
  color: #7a2e2a;
}

#prisustvo-session-modal label[for="prisustvo-modal-satnica"] {
  font-weight: 600;
  color: var(--brand-accent-text, #1f4e79);
}

#prisustvo-session-modal .prisustvo-grupe-multiselect {
  justify-self: start;
  width: max-content;
  max-width: 100%;
  gap: 4px;
}

#prisustvo-session-modal .prisustvo-grupe-toggle {
  width: auto;
  min-width: 140px;
  max-width: 280px;
  padding: 4px 10px;
  font-size: 12px;
  white-space: nowrap;
}

#prisustvo-session-modal .prisustvo-grupe-panel {
  left: 0;
  right: auto;
  width: max-content;
  min-width: 160px;
  max-width: 260px;
  padding: 6px;
}

#prisustvo-session-modal .prisustvo-grupe-panel .multi-select-search {
  width: 100%;
  box-sizing: border-box;
  font-size: 12px;
  padding: 3px 6px;
  margin-bottom: 4px;
}

#prisustvo-session-modal .prisustvo-grupe-panel .multi-select-options {
  max-height: 200px;
  align-items: stretch;
}

#prisustvo-session-modal .prisustvo-grupe-panel .multi-select-option {
  width: auto;
  justify-content: flex-start;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}

#prisustvo-session-modal .prisustvo-modal-datum,
#prisustvo-session-modal .prisustvo-modal-vrijeme {
  width: 140px;
  max-width: 100%;
  justify-self: start;
}

#prisustvo-session-modal .prisustvo-modal-predmet,
#prisustvo-session-modal .prisustvo-modal-oblik,
#prisustvo-session-modal .prisustvo-modal-prostorija {
  width: 100%;
  max-width: 420px;
  justify-self: start;
}

#prisustvo-session-modal .prisustvo-modal-sk-god {
  width: 100px;
  max-width: 100%;
  justify-self: start;
  background: #f3f4f6;
  color: #4b5563;
  cursor: default;
}

#prisustvo-sessions-grid tr.session-row-current td {
  background: #cfe8ff;
}

#prisustvo-sessions-grid tr.session-row-has-people td {
  background: #d9f2d9;
}

#prisustvo-sessions-grid tr.session-row-empty td {
  background: #ffe4c4;
}

#prisustvo-people-grid tr.person-row-teacher td {
  background: #e8f1fb;
}

#prisustvo-people-grid tr.person-row-student td {
  background: #f7faf7;
}

#prisustvo-people-modal .prisustvo-people-modal-meta {
  margin: 4px 0 8px;
  font-size: 12px;
}

#prisustvo-people-modal .prisustvo-people-candidates {
  max-height: 280px;
  overflow: auto;
  border: 1px solid #d5dde7;
  border-radius: 6px;
  padding: 6px 8px;
  background: #fafbfd;
}

#prisustvo-people-modal .prisustvo-people-candidate-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 3px 2px;
  font-size: 13px;
  cursor: pointer;
}

#prisustvo-people-modal .prisustvo-people-candidate-all {
  font-weight: 600;
  border-bottom: 1px solid #e4ebf3;
  margin-bottom: 4px;
  padding-bottom: 6px;
}

#prisustvo-people-modal #prisustvo-people-modal-teacher:not([hidden]) {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px;
  align-items: center;
  width: 100%;
}

#prisustvo-people-modal #prisustvo-people-modal-single:not([hidden]) {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px;
  align-items: center;
  width: 100%;
}

#prisustvo-people-modal #prisustvo-people-modal-jmbag:not([hidden]) {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  width: 100%;
}

#prisustvo-people-modal #prisustvo-people-modal-jmbag textarea {
  width: 100%;
  min-height: 10rem;
  box-sizing: border-box;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  resize: vertical;
}

#prisustvo-people-modal #prisustvo-people-modal-multi:not([hidden]) {
  grid-column: 1 / -1;
  width: 100%;
}

#prisustvo-people-modal #prisustvo-people-modal-teacher[hidden],
#prisustvo-people-modal #prisustvo-people-modal-single[hidden],
#prisustvo-people-modal #prisustvo-people-modal-jmbag[hidden],
#prisustvo-people-modal #prisustvo-people-modal-multi[hidden] {
  display: none !important;
}

#prisustvo-people-modal .prisustvo-person-search,
#ocjenjivanje-grade-modal .prisustvo-person-search {
  position: relative;
  width: 100%;
  min-width: 0;
}

#prisustvo-people-modal .prisustvo-person-search input[type="text"],
#ocjenjivanje-grade-modal .prisustvo-person-search input[type="text"] {
  width: 100%;
  box-sizing: border-box;
}

#prisustvo-people-modal .prisustvo-person-search-list,
#ocjenjivanje-grade-modal .prisustvo-person-search-list {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: calc(100% + 2px);
  max-height: 240px;
  overflow: auto;
  border: 1px solid #d5dde7;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(20, 40, 70, 0.12);
}

#prisustvo-people-modal .prisustvo-person-search-option,
#ocjenjivanje-grade-modal .prisustvo-person-search-option {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 7px 10px;
  font: inherit;
  cursor: pointer;
}

#prisustvo-people-modal .prisustvo-person-search-option:hover,
#prisustvo-people-modal .prisustvo-person-search-option:focus,
#ocjenjivanje-grade-modal .prisustvo-person-search-option:hover,
#ocjenjivanje-grade-modal .prisustvo-person-search-option:focus {
  background: #eef4fb;
}

#prisustvo-people-modal .prisustvo-person-search-empty,
#ocjenjivanje-grade-modal .prisustvo-person-search-empty {
  padding: 8px 10px;
  color: #6b7a90;
  font-size: 13px;
}

#prisustvo-sessions-grid tr.row-selected td {
  outline: 2px solid #5a9fd4;
  outline-offset: -2px;
}

.prisustvo-edit {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #cdd7e0;
  border-radius: 6px;
  background: #fff;
}

.prisustvo-edit-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}

.prisustvo-edit-head h2 {
  margin: 0;
  font-size: 14px;
}

.prisustvo-edit-status {
  font-size: 12px;
  color: #555;
}

.prisustvo-edit-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 6px;
  margin-bottom: 10px;
}

.prisustvo-edit-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.prisustvo-edit-cell label {
  font-size: 11px;
  color: #555;
  white-space: nowrap;
}

.prisustvo-edit-cell input {
  width: 100%;
  box-sizing: border-box;
  padding: 4px 5px;
  border: 1px solid #cdd7e0;
  border-radius: 4px;
  font-size: 12px;
}

.prisustvo-edit-readonly {
  background: #f1f3f5;
  color: #666;
}

.prisustvo-edit-actions {
  display: flex;
  gap: 8px;
}

/* ---- Ocjenjivanje ---- */

.ocjenjivanje-layout {
  --ocjenjivanje-right-panel-width: 420px;
  grid-template-columns: minmax(0, 1fr) 10px minmax(260px, var(--ocjenjivanje-right-panel-width));
  min-height: calc(100vh - 110px);
  align-items: stretch;
  gap: 0;
}

.ocjenjivanje-layout > .panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.ocjenjivanje-left-panel {
  min-width: 0;
}

.ocjenjivanje-termin-bar {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.ocjenjivanje-termin-bar label {
  font-weight: 600;
  white-space: nowrap;
}

.ocjenjivanje-termin-bar select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.ocjenjivanje-termin-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.ocjenjivanje-termin-actions button {
  font-size: 12px;
  padding: 4px 10px;
}

.ocjenjivanje-draft-meta {
  font-size: 12px;
}

.ocjenjivanje-grade-modal-hint {
  margin: 4px 0 0;
  font-size: 12px;
  grid-column: 1 / -1;
}

#ocjenjivanje-grade-modal .animals-modal-card {
  width: min(480px, 92vw);
}

#ocjenjivanje-grade-modal #ocjenjivanje-grade-modal-jmbag:not([hidden]),
#ocjenjivanje-grade-modal #ocjenjivanje-grade-modal-pojedinacno:not([hidden]) {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px;
  align-items: center;
  width: 100%;
}

#ocjenjivanje-grade-modal #ocjenjivanje-grade-modal-jmbag:not([hidden]) {
  align-items: start;
}

#ocjenjivanje-grade-modal #ocjenjivanje-grade-modal-jmbag[hidden],
#ocjenjivanje-grade-modal #ocjenjivanje-grade-modal-pojedinacno[hidden],
#ocjenjivanje-grade-modal #ocjenjivanje-grade-modal-hint-prisutni[hidden],
#ocjenjivanje-grade-modal #ocjenjivanje-grade-modal-hint-pojedinacno[hidden],
#ocjenjivanje-grade-modal #ocjenjivanje-grade-modal-hint-jmbag[hidden] {
  display: none !important;
}

#ocjenjivanje-grade-modal #ocjenjivanje-grade-modal-jmbag textarea {
  width: 100%;
  min-height: 8rem;
  box-sizing: border-box;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  resize: vertical;
}

#ocjenjivanje-grade-modal #ocjenjivanje-grade-modal-napomena {
  width: 100%;
}

#prisustvo-session-modal .animals-modal-card {
  width: min(520px, 92vw);
}

#prisustvo-session-modal input[data-field="napomena"] {
  width: 100%;
}

#ocjenjivanje-grades-grid tr.ocjenjivanje-row-pending td {
  background-color: #fff8e6;
}

#ocjenjivanje-grades-grid tr.ocjenjivanje-row-pending td.ocjenjivanje-cell-from-session {
  background-color: #e8f7ec;
}

#ocjenjivanje-grades-grid tr.ocjenjivanje-row-absent td {
  background-color: #f3f4f6;
}

.ocjenjivanje-grades-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#ocjenjivanje-grades-grid {
  flex: 1 1 auto;
  min-height: 0;
}

#ocjenjivanje-grades-grid td.ocjenjivanje-cell-from-session {
  background-color: #dff5e4;
}

.ocjenjivanje-right-panel {
  max-height: none;
  height: 100%;
  min-width: 260px;
  padding: 8px 10px 10px;
  border: 1px solid #d7dbe0;
  border-radius: 6px;
  background: #fff;
}

.ocjenjivanje-right-title {
  margin: 0 0 8px;
  font-size: 16px;
}

.ocjenjivanje-right-tabs {
  margin: 0 0 10px;
  flex-wrap: wrap;
}

.ocjenjivanje-exam-counts-toolbar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.ocjenjivanje-exam-counts-toolbar label {
  font-size: 12px;
  font-weight: 600;
}

.ocjenjivanje-exam-counts-toolbar select {
  width: 100%;
}

#ocjenjivanje-exam-counts-meta {
  margin-bottom: 8px;
  font-size: 11px;
}

.ocjenjivanje-exam-counts-sort {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-align: inherit;
  cursor: pointer;
}

.ocjenjivanje-exam-counts-sort:hover {
  text-decoration: underline;
}

.ocjenjivanje-student-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
  max-height: calc(100vh - 160px);
  padding-right: 2px;
}

.ocjenjivanje-stats-header {
  margin-bottom: 4px;
}

.ocjenjivanje-stats-student {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
}

.ocjenjivanje-stats-predmet {
  font-size: 12px;
  margin-top: 2px;
}

.ocjenjivanje-stats-section-title {
  margin: 10px 0 4px;
  font-size: 13px;
  font-weight: 650;
}

.ocjenjivanje-stats-year {
  margin: 8px 0 4px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}

.ocjenjivanje-stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.ocjenjivanje-stats-notes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ocjenjivanje-stats-note {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
}

.ocjenjivanje-stats-note-time {
  font-size: 11px;
  margin-bottom: 4px;
}

.ocjenjivanje-stats-note-text {
  font-size: 12px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.ocjenjivanje-stats-table th,
.ocjenjivanje-stats-table td {
  border: 1px solid #e2e8f0;
  padding: 4px 6px;
  text-align: left;
  vertical-align: top;
}

.ocjenjivanje-stats-table th {
  background: #f8fafc;
  font-weight: 600;
}

.ocjenjivanje-stats-table td:nth-child(2),
.ocjenjivanje-stats-table td:nth-child(3),
.ocjenjivanje-stats-table th:nth-child(2),
.ocjenjivanje-stats-table th:nth-child(3) {
  text-align: right;
  white-space: nowrap;
}

.ocjenjivanje-vertical-splitter {
  cursor: col-resize;
  border-left: 2px solid #d7dbe0;
  border-right: 2px solid #d7dbe0;
  border-radius: 4px;
  background: linear-gradient(to right, #f5f7fa, #eef2f7);
  margin: 0 4px;
  touch-action: none;
}

.ocjenjivanje-vertical-splitter:hover {
  border-left-color: #9db4d8;
  border-right-color: #9db4d8;
}

#ocjenjivanje-session-select option.ocjenjivanje-session-today {
  background-color: #d7eaf8;
  color: #1a3a55;
}

#ocjenjivanje-session-select option.ocjenjivanje-session-current {
  background-color: #2f6ea5;
  color: #fff;
  font-weight: 600;
}

#ocjenjivanje-session-select option.ocjenjivanje-session-graded {
  background-color: #d8edd8;
  color: #1f4d2a;
}

#ocjenjivanje-session-select.ocjenjivanje-session-select-today {
  background-color: #d7eaf8;
  border-color: #8eb6d8;
  color: #1a3a55;
}

#ocjenjivanje-session-select.ocjenjivanje-session-select-current {
  background-color: #2f6ea5;
  border-color: #1f4e79;
  color: #fff;
  font-weight: 600;
}

#ocjenjivanje-session-select.ocjenjivanje-session-select-graded {
  background-color: #d8edd8;
  border-color: #8fbf8f;
  color: #1f4d2a;
}

.moji-rezultati-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 12px 14px 18px;
}

.moji-rezultati-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: flex-end;
}

.moji-rezultati-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.9rem;
  min-width: 220px;
}

.moji-rezultati-field select {
  min-width: 220px;
  max-width: min(520px, 100vw);
}

.moji-self-label {
  font-size: 0.92rem;
  padding-bottom: 4px;
}

.moji-empty {
  margin: 8px 0 0;
}

.moji-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.moji-block {
  border-top: 1px solid #e1e6ec;
  padding-top: 12px;
}

.moji-block-title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 650;
}

.moji-stats-body {
  max-height: none;
  overflow: visible;
  max-width: 40%;
  width: fit-content;
  min-width: min(100%, 280px);
}

.moji-stats-body .bodovi-stats-table-scroll,
.moji-stats-body .bodovi-stats-table {
  width: auto;
  max-width: 100%;
}

@media (max-width: 900px) {
  .moji-stats-body {
    max-width: 100%;
  }
}

.moji-napomena-text {
  flex: none;
  max-height: 220px;
  margin-top: 4px;
}

.moji-table-wrap {
  width: 100%;
}

.moji-table-scroll {
  overflow-x: auto;
  max-width: 100%;
}

.moji-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.moji-data-table th,
.moji-data-table td {
  border: 1px solid #e2e8f0;
  padding: 4px 6px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.moji-data-table th {
  background: #f8fafc;
  font-weight: 600;
}

