/* Alpine: skrij vsebino z x-cloak do inicializacije (UI val 5; prej v base.html). */
[x-cloak] {
  display: none !important;
}

/* Design tokens (desk + shared): light/dark via .theme-dark + Bootstrap data-bs-theme */
:root {
  font-family: system-ui, -apple-system, Segoe UI, sans-serif;
  line-height: 1.5;
  color: #111;
  --link: #0b57d0;
  --border: #e0e0e0;
  --muted: #555;
  --surface: #fff;
  --desk-radius-sm: 0.375rem;
  --desk-radius-md: 0.5rem;
  --desk-radius-lg: 0.625rem;
  --desk-shadow-scroll: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --desk-space-section: 1.75rem;
  --desk-space-block: 1rem;
  --desk-readable-max: 42rem;
  --desk-readable-prose-line: 1.58;
  --desk-topbar-scroll-padding: 4.75rem;
  --desk-sticky-thead-offset: 0;
}

html.theme-dark {
  color-scheme: dark;
  color: #e8e8e8;
  /* Brighter than #aaa for small text (~4.8:1 on #141414 for UI copy) */
  --link: #9ec3ff;
  --border: #3d4450;
  --muted: #c4cad3;
  --surface: #141414;
  --desk-shadow-scroll: 0 0.125rem 0.35rem rgba(0, 0, 0, 0.35);
}

/* UI val 7: povezave v Bootstrap alert-info na temni temi (kontrast AA za sekundarne povezave) */
html.theme-dark .desk-app-shell .alert-info a {
  color: var(--bs-info-text-emphasis, #b8e7ff);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

/* UI val 7: enoten vertikalni razmik med gostimi karticami na detajlu projekta */
.desk-project-tight-card-rhythm > .card.border-0.shadow-sm.mb-4,
.desk-project-tight-card-rhythm > section.card.border-0.shadow-sm.mb-4 {
  margin-bottom: var(--desk-list-rhythm);
}

html {
  scroll-padding-top: var(--desk-topbar-scroll-padding);
}

@media (prefers-reduced-motion: reduce) {
  .desk-app-shell,
  .desk-app-shell *,
  .desk-app-shell *::before,
  .desk-app-shell *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .htmx-indicator,
  .desk-stat-card,
  .desk-employee-table tbody tr {
    transition: none !important;
  }

  a.desk-stat-card.card:hover {
    transform: none !important;
  }
}

@media (prefers-contrast: more) {
  .desk-app-shell .table {
    --bs-table-border-color: #111;
  }

  html.theme-dark .desk-app-shell .table {
    --bs-table-border-color: #f0f0f0;
  }

  .desk-app-shell .btn-outline-secondary {
    border-width: 2px;
  }
}

.desk-table-scroll :focus-visible {
  outline-offset: 3px;
}

/* Keyboard focus: visible ring without removing browser defaults on inputs */
.desk-app-shell :focus-visible {
  outline: 2px solid var(--bs-primary, var(--link));
  outline-offset: 2px;
}

.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible {
  outline-offset: 0;
}

html.theme-dark body {
  background-color: var(--bs-body-bg, var(--surface));
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

a {
  color: var(--link);
}

/* Lijevi stupac (desktop): nije offcanvas — stabilna širina in barva. */
.desk-app-shell > .desk-sidebar-rail {
  flex-shrink: 0;
  width: 15.75rem;
  min-width: 15.75rem;
  align-self: stretch;
  min-height: 100%;
  background-color: var(--bs-dark, #212529) !important;
}

.desk-sidebar-mobile .offcanvas-body {
  background-color: var(--bs-dark, #212529) !important;
  padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
}

.desk-shell-header {
  z-index: 1030;
}

.desk-erp-navbar {
  background: linear-gradient(135deg, #071a2e 0%, #0c3554 42%, #135a86 100%);
}

.desk-erp-navbar .navbar-brand {
  letter-spacing: 0.02em;
}

.desk-search-strip .desk-search-results {
  border-top: none;
  padding-top: 0;
}

.desk-callout {
  border: 1px solid var(--border);
  border-radius: var(--desk-radius-lg);
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  background: #f0f6ff;
  max-width: min(100%, calc(var(--desk-readable-max) + 8rem));
}

.desk-readable,
.desk-callout,
.desk-persona-hint,
.desk-workflow-form .text-secondary {
  line-height: var(--desk-readable-prose-line, 1.58);
}

.app-main .desk-readable,
.desk-detail-page .card-body > .text-secondary.small {
  max-width: var(--desk-readable-max);
}

html.theme-dark .desk-callout {
  background: #1a2433;
}

/* HTMX (ENG-92): global loading hint + error strip targets #desk-hx-indicator / #desk-hx-error */
.htmx-indicator {
  opacity: 0;
  transition: opacity 0.22s ease;
  pointer-events: none;
}

.htmx-indicator.htmx-request {
  opacity: 0.92;
}

.desk-hx-error-strip {
  max-height: 4rem;
  overflow: auto;
}

.desk-callout-onboarding code {
  font-size: 0.85em;
}

.desk-persona-hint {
  margin: 0 0 1rem;
  padding: 0.5rem 0.75rem;
  border-left: 3px solid var(--link);
  background: #f8f8f8;
}

html.theme-dark .desk-persona-hint {
  background: #222;
}

table.desk-sticky-head thead th {
  position: sticky;
  top: var(--desk-sticky-thead-offset, 0);
  z-index: 2;
  background: var(--bs-body-bg, var(--surface));
  box-shadow: 0 1px 0 var(--bs-border-color, var(--border));
}

.desk-table-scroll {
  overflow-x: auto;
  max-width: 100%;
  margin-bottom: 0.75rem;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--bs-border-radius, var(--desk-radius-sm));
  border: 1px solid var(--bs-border-color, var(--border));
  background: var(--bs-body-bg, var(--surface));
  box-shadow: var(--bs-box-shadow-sm, var(--desk-shadow-scroll));
}

/* Default desk data tables: slightly denser body, sticky header inside scroll region */
.desk-entity-list .desk-table-scroll table.table.desk-table {
  font-size: 0.9375rem;
}

.desk-entity-list .desk-table-scroll table.table.desk-table thead th {
  font-size: 0.8125rem;
  white-space: nowrap;
}

/* ENG-100: unified vertical rhythm on main desk list pages (timesheets, received invoices, projects) */
.desk-entity-list {
  --desk-list-rhythm: 1rem;
}

.desk-entity-list .desk-list-toolbar {
  margin-bottom: var(--desk-list-rhythm);
  /* UI val 6: varna cona na dnu (mobilna tipkovnica / iOS home indicator). */
  padding-bottom: max(0.7rem, env(safe-area-inset-bottom, 0px));
  border-bottom: 1px solid var(--bs-border-color-translucent, rgba(0, 0, 0, 0.09));
  min-height: 2.35rem;
}

html.theme-dark .desk-entity-list .desk-list-toolbar {
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

.desk-entity-list .desk-list-toolbar .btn {
  font-weight: 600;
  min-height: 2.25rem;
  padding-inline: 0.85rem;
}

.desk-entity-list > .desk-table-scroll {
  margin-bottom: var(--desk-list-rhythm);
}

.desk-entity-list .desk-table.table {
  margin-bottom: 0;
}

.desk-entity-list > form.desk-list-filters {
  margin-bottom: var(--desk-list-rhythm);
  padding: 0.65rem 0.85rem;
  border-radius: var(--bs-border-radius, 0.375rem);
  border: 1px solid var(--bs-border-color, var(--border));
  background-color: var(--bs-tertiary-bg, rgba(0, 0, 0, 0.03));
}

html.theme-dark .desk-entity-list > form.desk-list-filters {
  background-color: rgba(255, 255, 255, 0.04);
}

.desk-entity-list > form.desk-list-filters.row {
  flex-wrap: wrap;
  row-gap: 0.5rem;
}

.desk-entity-list > form.desk-list-filters .form-select,
.desk-entity-list > form.desk-list-filters select {
  max-width: 100%;
  min-width: 0;
}

@media (max-width: 36rem) {
  .desk-entity-list > form.desk-list-filters .form-select,
  .desk-entity-list > form.desk-list-filters select {
    width: 100%;
  }
}

.desk-entity-list form.desk-list-bulk .desk-table-scroll {
  margin-bottom: 0.5rem;
}

.desk-entity-list .desk-list-bulk-actions {
  margin-bottom: var(--desk-list-rhythm);
}

.desk-entity-list .desk-list-footnote {
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px dashed var(--bs-border-color-translucent, rgba(0, 0, 0, 0.12));
}

html.theme-dark .desk-entity-list .desk-list-footnote {
  border-top-color: rgba(255, 255, 255, 0.12);
}

.desk-entity-list .desk-table tbody td[colspan].muted {
  padding-top: 1.1rem;
  padding-bottom: 1.1rem;
  text-align: center;
}

.app-main .messages-stack .alert,
.desk-entity-list .alert {
  border-radius: var(--bs-border-radius, 0.375rem);
}

.app-main {
  flex: 1 1 auto;
  width: 100%;
  max-width: 1440px;
  margin-left: auto;
  margin-right: auto;
}

h1 {
  font-size: 1.35rem;
  margin: 0 0 1rem;
}

/* Detail / form pages: naslov podoben ERP, če ni že Bootstrap .h4 */
.app-main h1:not(.h4):not(.page-hero-title):not(.auth-title) {
  font-weight: 650;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--bs-border-color, var(--border));
  margin-bottom: 0.85rem;
}

h2 {
  font-size: 1.1rem;
  margin: 1.25rem 0 0.5rem;
}

.app-main table:not(.table) {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.app-main table:not(.table) th,
.app-main table:not(.table) td {
  text-align: left;
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid var(--border);
}

.app-main table:not(.table) th {
  font-weight: 600;
  color: var(--muted);
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

dl.grid {
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: 0.35rem 1rem;
}

dl.grid dt {
  color: var(--muted);
  margin: 0;
}

dl.grid dd {
  margin: 0;
}

.messages {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.messages li {
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  background: #f5f5f5;
  margin-bottom: 0.35rem;
}

.login-form label {
  display: block;
  margin-top: 0.75rem;
  font-weight: 500;
}

.login-form input[type="text"],
.login-form input[type="password"] {
  width: 100%;
  max-width: 22rem;
  padding: 0.45rem 0.5rem;
  margin-top: 0.25rem;
}

.login-form button {
  margin-top: 1rem;
  padding: 0.45rem 1rem;
}

.errorlist {
  color: #b00020;
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
}

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 28rem;
  margin-top: 0.5rem;
}

.stack-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-weight: 500;
  font-size: 0.9rem;
}

.stack-form input[type="text"],
.stack-form input[type="number"],
.stack-form input[type="date"],
.stack-form input[type="email"],
.stack-form input[type="url"],
.stack-form textarea,
.stack-form select {
  font: inherit;
  width: 100%;
  max-width: 28rem;
  padding: 0.375rem 0.75rem;
  border: var(--bs-border-width, 1px) solid var(--bs-border-color, var(--border));
  border-radius: var(--bs-border-radius, 0.375rem);
  background-color: var(--bs-body-bg, var(--surface));
  color: var(--bs-body-color, inherit);
}

.stack-form > button,
.stack-form button[type="submit"] {
  align-self: flex-start;
  margin-top: 0.25rem;
  padding: 0.45rem 1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--bs-border-radius, 0.375rem);
  border: 1px solid var(--bs-primary, var(--link));
  background: var(--bs-primary, var(--link));
  color: #fff;
}

.stack-form > button:hover,
.stack-form button[type="submit"]:hover {
  filter: brightness(1.05);
}

.stack-form .checkbox-row {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.desk-search-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.4rem 0.65rem;
}

.desk-search-form input[type="search"] {
  min-width: 9rem;
  max-width: 14rem;
  font: inherit;
  padding: 0.25rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: inherit;
}

.desk-search-form select {
  font: inherit;
  padding: 0.25rem 0.35rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: inherit;
}

.desk-search-form button {
  font: inherit;
  padding: 0.3rem 0.65rem;
  cursor: pointer;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: inherit;
}

.desk-search-label,
.desk-search-scope {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.8rem;
}

.desk-search-results {
  width: 100%;
  flex-basis: 100%;
  margin: 0;
  padding-top: 0.35rem;
  border-top: 1px solid var(--border);
}

.desk-search-hits {
  list-style: none;
  padding: 0;
  margin: 0;
}

.desk-search-hits li {
  padding: 0.2rem 0;
}

.desk-search-meta {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
}

.desk-workflow-form {
  max-width: 36rem;
}

.desk-workflow-form button {
  margin-right: 0.5rem;
  margin-bottom: 0.35rem;
}

/* --- Auth (login) --- */
html.auth-page:not(.theme-dark) body {
  background: linear-gradient(165deg, #e8eef8 0%, #f0f3f9 40%, #fafbfc 100%);
}

html.auth-page.theme-dark body {
  background: linear-gradient(165deg, #0d1118 0%, #161c24 45%, var(--surface) 100%);
}

.auth-layout {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 2rem 1rem 3rem;
  min-height: 55vh;
}

.auth-card {
  width: 100%;
  max-width: 26rem;
  padding: 1.75rem 1.5rem 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

html.theme-dark .auth-card {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.auth-brand {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--link);
}

.auth-title {
  margin: 0 0 0.75rem;
  font-size: 1.35rem;
  font-weight: 650;
  line-height: 1.25;
}

.auth-lead {
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
  line-height: 1.45;
}

.auth-form .auth-field {
  margin-bottom: 1rem;
}

.auth-form label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.auth-form input[type="text"],
.auth-form input[type="password"] {
  width: 100%;
  font: inherit;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: inherit;
}

.auth-form input:focus {
  outline: 2px solid var(--link);
  outline-offset: 1px;
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 0.25rem;
}

.auth-foot {
  margin: 1.25rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
}

.auth-secondary-link {
  font-size: 0.9rem;
}

/* Auth: secondary nav links (muted/small) stay readable on theme-dark + data-bs-theme=dark */
html.theme-dark.auth-page a.auth-secondary-nav-link {
  color: var(--bs-link-color, #6ea8fe);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

html.theme-dark.auth-page a.auth-secondary-nav-link:hover,
html.theme-dark.auth-page a.auth-secondary-nav-link:focus-visible {
  color: var(--bs-link-hover-color, #9ec5fe);
}

html.theme-dark.auth-page .auth-lead a.auth-lead-link {
  color: var(--bs-link-color, #6ea8fe);
}

html.theme-dark.auth-page .auth-lead a.auth-lead-link:hover,
html.theme-dark.auth-page .auth-lead a.auth-lead-link:focus-visible {
  color: var(--bs-link-hover-color, #9ec5fe);
}

.auth-alert-error {
  padding: 0.65rem 0.75rem;
  margin-bottom: 1rem;
  border-radius: 8px;
  border: 1px solid #e0a4a8;
  background: #fdecee;
  color: #6a1a1f;
  font-size: 0.9rem;
}

html.theme-dark .auth-alert-error {
  background: #2c1518;
  border-color: #5c2a30;
  color: #f0c4c8;
}

.auth-alert-error ul {
  margin: 0;
  padding-left: 1.1rem;
}

/* --- Dashboard hero & stats --- */
.page-hero {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.page-hero-title {
  margin: 0 0 0.35rem;
  font-size: 1.45rem;
}

.page-hero-meta {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.page-hero-lead {
  margin: 0.5rem 0 0;
  max-width: 40rem;
  line-height: 1.45;
}

.dashboard-stats-host {
  min-height: 4rem;
}

.dashboard-stats-loading {
  margin: 0;
}

.desk-section {
  margin-top: 1.75rem;
}

.desk-section-title {
  margin: 0 0 0.65rem;
  font-size: 1.05rem;
  font-weight: 650;
}

.desk-panel {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  background: var(--surface);
}

.desk-panel-title {
  margin: 0 0 0.75rem;
  font-weight: 600;
}

.desk-kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1.25rem;
  margin: 0;
  font-size: 0.92rem;
}

.desk-kv dt {
  margin: 0;
  color: var(--muted);
  font-weight: 500;
}

.desk-kv dd {
  margin: 0;
}

.desk-stat-board-heading {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 650;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.desk-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  gap: 0.75rem;
}

.desk-stat-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.desk-stat-card.card {
  border: 1px solid var(--bs-border-color-translucent, rgba(0, 0, 0, 0.08));
}

a.desk-stat-card.card:hover {
  border-color: var(--bs-primary, var(--link));
  transform: translateY(-1px);
  box-shadow: 0 0.35rem 1rem rgba(13, 110, 253, 0.15) !important;
}

html.theme-dark a.desk-stat-card.card:hover {
  box-shadow: 0 0.35rem 1rem rgba(138, 180, 255, 0.12) !important;
}

.desk-stat-card-static {
  cursor: default;
}

.desk-stat-card-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.25;
}

.desk-stat-card-value {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.desk-stat-card-sub {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
}

.desk-stat-card-hint {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

a.desk-stat-card .desk-stat-card-hint {
  color: var(--link);
  opacity: 0.9;
}

.desk-recent-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.desk-recent-list li {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
}

.desk-recent-list li:last-child {
  border-bottom: none;
}

/* WI-034: worker PWA sync status strip (sidebar shell) */
.desk-pwa-sync-shell {
  border-radius: 0.35rem;
  background: rgba(255, 255, 255, 0.06);
}

.desk-pwa-sync-shell--warn {
  background: rgba(255, 193, 7, 0.14);
}

html.theme-dark .desk-pwa-sync-shell--warn {
  background: rgba(255, 193, 7, 0.12);
}

.desk-credit-alert {
  margin: 0.75rem 0 1rem;
}

.desk-readonly-dl dt {
  font-weight: 600;
  margin-top: 0.35rem;
}

.desk-readonly-dl dd {
  margin: 0 0 0.35rem 0;
}

/* Desk: record detail pages (hero + section cards) */
.desk-detail-page {
  max-width: 52rem;
}

.desk-detail-hero {
  background: var(--bs-body-bg, var(--surface));
}

.desk-detail-hero .card-body {
  border-left: 3px solid var(--bs-primary, #0d6efd);
}

html.theme-dark .desk-detail-hero .card-body {
  border-left-color: var(--bs-primary, #6ea8fe);
}

.desk-detail-page .card.border-0.shadow-sm {
  background: var(--bs-body-bg, var(--surface));
}

.desk-detail-page .card-header {
  font-variant-numeric: tabular-nums;
}

.desk-detail-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
}

.desk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.desk-actions button[type="submit"],
.desk-actions button:not([type]) {
  font: inherit;
  padding: 0.35rem 0.75rem;
  border-radius: var(--bs-border-radius, 0.375rem);
  border: 1px solid var(--bs-border-color, var(--border));
  background: var(--bs-body-bg, var(--surface));
  cursor: pointer;
}

.desk-actions button[type="submit"]:hover {
  filter: brightness(0.97);
}

html.theme-dark .desk-actions button[type="submit"]:hover {
  filter: brightness(1.08);
}

.desk-detail-page pre.muted {
  padding: 0.75rem 1rem;
  border-radius: var(--bs-border-radius, 0.375rem);
  border: 1px solid var(--bs-border-color, var(--border));
  background: var(--bs-tertiary-bg, #f8f9fa);
}

html.theme-dark .desk-detail-page pre.muted {
  background: rgba(255, 255, 255, 0.04);
}

/* --- Desk: employee reference (list + detail) --- */
.desk-detail-page.desk-detail-page--wide {
  max-width: 72rem;
}

.desk-employee-list-page .desk-employee-lead {
  margin-bottom: 1.25rem;
}

.desk-employee-list-page .desk-employee-lead .desk-employee-lead-title {
  font-size: clamp(1.35rem, 2.5vw, 1.65rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
  color: var(--bs-body-color, inherit);
}

.desk-employee-list-page .desk-employee-lead .desk-employee-lead-text {
  margin: 0;
  max-width: 42rem;
  color: var(--bs-secondary-color, var(--muted));
  font-size: 0.95rem;
  line-height: 1.5;
}

.desk-employee-list-page .desk-list-toolbar .desk-employee-count {
  font-size: 0.875rem;
  color: var(--bs-secondary-color, var(--muted));
}

.desk-employee-table thead th {
  background: var(--bs-tertiary-bg, rgba(0, 0, 0, 0.04));
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--bs-secondary-color, var(--muted));
  border-bottom-width: 1px;
}

html.theme-dark .desk-employee-table thead th {
  background: rgba(255, 255, 255, 0.06);
}

.desk-employee-table tbody tr {
  transition: background-color 0.12s ease;
}

.desk-employee-table.table-hover tbody tr:hover {
  background-color: rgba(13, 110, 253, 0.06);
}

html.theme-dark .desk-employee-table.table-hover tbody tr:hover {
  background-color: rgba(110, 168, 254, 0.08);
}

.desk-employee-table .desk-employee-name-cell a {
  font-weight: 600;
  text-decoration: none;
}

.desk-employee-table .desk-employee-name-cell a:hover {
  text-decoration: underline;
}

.desk-employee-avatar {
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(145deg, #0c3554 0%, #135a86 55%, #1a7ab8 100%);
  box-shadow: 0 0.15rem 0.5rem rgba(7, 26, 46, 0.25);
}

.desk-employee-avatar--sm {
  width: 2.35rem;
  height: 2.35rem;
  font-size: 0.75rem;
}

html.theme-dark .desk-employee-avatar {
  box-shadow: 0 0.2rem 0.6rem rgba(0, 0, 0, 0.35);
}

.desk-employee-hero {
  overflow: hidden;
  background: var(--bs-body-bg, var(--surface));
  border: 1px solid var(--bs-border-color-translucent, rgba(0, 0, 0, 0.08));
}

.desk-employee-hero .card-body {
  position: relative;
  border-left: 3px solid var(--bs-primary, #0d6efd);
  background: linear-gradient(
    180deg,
    rgba(13, 110, 253, 0.06) 0%,
    transparent 42%
  );
}

html.theme-dark .desk-employee-hero .card-body {
  border-left-color: var(--bs-primary, #6ea8fe);
  background: linear-gradient(
    180deg,
    rgba(110, 168, 254, 0.1) 0%,
    transparent 45%
  );
}

.desk-employee-hero .desk-employee-hero-meta code {
  font-size: 0.85em;
  color: var(--bs-secondary-color, var(--muted));
}

.desk-record-section .card-header {
  border-bottom: 1px solid var(--bs-border-color-translucent, rgba(0, 0, 0, 0.09));
  background: linear-gradient(
    90deg,
    rgba(13, 110, 253, 0.07) 0%,
    var(--bs-tertiary-bg, rgba(0, 0, 0, 0.03)) 28%,
    var(--bs-tertiary-bg, rgba(0, 0, 0, 0.03)) 100%
  );
}

html.theme-dark .desk-record-section .card-header {
  background: linear-gradient(
    90deg,
    rgba(110, 168, 254, 0.12) 0%,
    rgba(255, 255, 255, 0.04) 32%,
    rgba(255, 255, 255, 0.04) 100%
  );
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.desk-record-section .card-header h2 {
  margin: 0;
}

/* Main column: anchors scroll clear of sticky topbar + subnav */
.desk-main-column .app-main h1,
.desk-main-column .app-main h2,
.desk-main-column .app-main [id].card {
  scroll-margin-top: var(--desk-topbar-scroll-padding);
}

.desk-nav-hub-link {
  display: block;
  max-width: 100%;
}

.desk-nav-hub-link .desk-nav-hub-label {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.desk-workflow-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin: 0 0 0.75rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--desk-radius-sm);
  border: 1px solid var(--bs-border-color, var(--border));
  background: var(--bs-tertiary-bg, rgba(0, 0, 0, 0.03));
  font-size: 0.8125rem;
}

html.theme-dark .desk-workflow-toc {
  background: rgba(255, 255, 255, 0.04);
}

.desk-workflow-toc a {
  text-decoration: none;
  font-weight: 600;
}

.desk-workflow-toc a:hover {
  text-decoration: underline;
}

.desk-empty-in-table td {
  padding-top: 1.5rem !important;
  padding-bottom: 1.5rem !important;
}

.desk-empty-in-table .desk-empty-title {
  font-weight: 600;
  margin: 0 0 0.35rem;
}

.desk-empty-in-table .desk-empty-lead {
  margin: 0;
  max-width: 36rem;
  margin-inline: auto;
}

.desk-http-error .desk-http-icon {
  font-size: 2.5rem;
  line-height: 1;
  opacity: 0.35;
}

.desk-kpi-source-note {
  font-size: 0.78rem;
  color: var(--bs-secondary-color, var(--muted));
  margin-top: 0.5rem;
}

/* Poročila: enotna širina številk + LTR v ćeliji (bralniki v mešanem besedilu). */
.desk-report-table td.text-end {
  font-variant-numeric: tabular-nums;
  unicode-bidi: isolate;
  direction: ltr;
}

/* UI val 6: poročilo projektov po obdobju — colgroup za krajše kode/hub in ožje številke. */
.desk-report-finperiod-cols col.desk-rpt-col-short {
  width: 6.5%;
  max-width: 5.5rem;
}
.desk-report-finperiod-cols col.desk-rpt-col-tiny {
  width: 5%;
  max-width: 3.5rem;
}
.desk-report-finperiod-cols col.desk-rpt-col-num {
  width: 10%;
  max-width: 7.5rem;
}

.desk-detail-hero .desk-detail-hero-title {
  overflow-wrap: anywhere;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media print {
  .desk-detail-hero .desk-detail-hero-title {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
  }
}

.desk-list-bulk-actions .btn-success:focus-visible,
.desk-actions .btn-outline-danger:focus-visible,
.desk-actions button[type="submit"]:focus-visible {
  outline: 2px solid var(--bs-danger, #c00);
  outline-offset: 2px;
}

.desk-settings-readonly-kv dd {
  background-color: var(--bs-secondary-bg, rgba(0, 0, 0, 0.04));
  border-radius: var(--desk-radius-sm, 0.375rem);
  padding: 0.35rem 0.5rem;
}

.desk-form-stack .form-label .text-danger {
  font-weight: 700;
}

.desk-actions-bar .btn + .btn {
  margin-left: 0;
}

.desk-pwa-sync-shell--synced {
  background: rgba(25, 135, 84, 0.12);
}

html.theme-dark .desk-pwa-sync-shell--synced {
  background: rgba(25, 135, 84, 0.18);
}

.desk-pwa-sync-shell .desk-pwa-sync-line--emphasize {
  font-weight: 600;
}

@media print {
  .desk-skip-link {
    display: none !important;
  }
}

html.theme-dark .btn:disabled,
html.theme-dark .btn.disabled,
html.theme-dark .form-control:disabled,
html.theme-dark .form-select:disabled {
  opacity: 1;
  color: #adb5bd;
  border-color: #495057;
  background-color: #2b3035;
}

html.theme-dark .btn-primary:disabled {
  color: #dee2e6;
  background-color: #375a7f;
  border-color: #375a7f;
}
