:root {
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --color-bg: #bdc9d8;
  --color-panel: #f8fafd;
  --color-border: #8faec8;
  --color-border-strong: #5f85a8;
  --color-primary: #1f64ff;
  --color-primary-dark: #1241b8;
  --color-primary-soft: #e4edff;
  --color-text: #0c1525;
  --color-muted: #536179;
  --color-input-bg: #f8fbff;
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 60px;
  --topbar-height: 52px;
  --transition-fast: 150ms ease;
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --shadow-sm: 0 1px 3px rgba(15,23,42,0.10), 0 4px 18px rgba(15,23,42,0.07);
  --shadow-md: 0 2px 8px rgba(15,23,42,0.12), 0 8px 32px rgba(15,23,42,0.09);
  --shadow-lg: 0 4px 16px rgba(15,23,42,0.14), 0 16px 52px rgba(15,23,42,0.11);
  /* ── Dark sidebar ── */
  --sb-bg: #0a1220;
  --sb-text: rgba(148, 163, 184, 0.90);
  --sb-text-active: #f1f5f9;
  --sb-text-hover: #e2e8f0;
  --sb-section: #2a3d55;
  --sb-icon-bg: rgba(255, 255, 255, 0.08);
  --sb-active-bg: rgba(31, 100, 255, 0.25);
  --sb-hover-bg: rgba(255, 255, 255, 0.07);
  /* ── Content padding — more generous ── */
  --layout-pad-x: clamp(0.75rem, 1.5vw, 1.5rem);
  --layout-pad-y: clamp(0.75rem, 1.25vw, 1.25rem);
  --panel-pad-x: clamp(1rem, 1.5vw, 1.5rem);
  --panel-pad-y: clamp(0.85rem, 1.25vw, 1.25rem);
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  width: 100%;
  -webkit-font-smoothing: subpixel-antialiased;
  -moz-osx-font-smoothing: auto;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-height: 100dvh;
  width: 100%;
  overflow-x: hidden;
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  font-synthesis: none;
  font-optical-sizing: auto;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
}

/* Brskalniki privzeto pogosto dodelijo monospace <textarea> in drugačen font vnosom — združimo z Inter */
textarea,
select,
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="hidden"]):not([type="image"]),
button {
  font-family: var(--font-sans);
}

code,
kbd,
pre,
samp,
.wo-delete-code-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
}

.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(120deg, rgba(31, 100, 255, 0.08), var(--color-bg));
  padding: 2rem;
}

.auth-card {
  width: min(420px, 100%);
  background-color: #fff;
  border-radius: 1.25rem;
  padding: 2rem;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.12);
}

.auth-card header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.muted {
  color: var(--color-muted);
}

.small {
  font-size: 0.85rem;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  width: 100%;
}

.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1.5rem;
  background-color: var(--color-panel);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 42px;   /* subnav height */
  z-index: 40;
}

.sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background-color: rgba(255,255,255,0.06);
  font-size: 1rem;
  cursor: pointer;
  color: var(--color-muted);
  flex-shrink: 0;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.sidebar-toggle:hover {
  background-color: rgba(31, 100, 255, 0.1);
  color: var(--color-primary);
  border-color: rgba(31, 100, 255, 0.3);
}

[x-cloak] { display: none !important; }

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1rem;
}

.brand-text small {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--color-muted);
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: radial-gradient(circle at 30% 30%, #7bb3ff, var(--color-primary));
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  text-decoration: none;
  transition: opacity var(--transition-fast), box-shadow var(--transition-fast);
}
.brand-mark:hover {
  opacity: 0.85;
  box-shadow: 0 0 0 3px rgba(31,100,255,0.25);
}

.app-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.workshop-switch {
  flex: 1;
  display: flex;
  justify-content: center;
}

.workshop-switch form {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 220px;
}

.workshop-switch label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted);
}

.workshop-switch select {
  border: 1px solid var(--color-border);
  border-radius: 0.65rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.9rem;
  background-color: #fff;
}

.quick-link {
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background-color: #fff;
  font-size: 0.85rem;
  color: var(--color-muted);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.quick-link:hover {
  background-color: var(--color-primary);
  color: #fff;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--color-border);
  font-size: 0.9rem;
}

.user-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
}

.app-body {
  display: flex;
  flex: 1;
  min-height: 0;
  position: relative;
}

/* Sidebar is always a fixed overlay — never takes layout space */
.app-sidebar {
  position: fixed;
  top: calc(var(--topbar-height) + env(safe-area-inset-top, 0px));
  left: 0;
  height: calc(100dvh - var(--topbar-height) - env(safe-area-inset-top, 0px));
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #0c1525 0%, var(--sb-bg) 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 4px 0 40px rgba(0, 0, 0, 0.38);
  padding: 0.5rem 0.65rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 50;
  /* Slide animation */
  transform: translateX(0);
  transition: transform 230ms cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 230ms ease;
}

.app-sidebar.sidebar-hidden {
  transform: translateX(-110%);
  box-shadow: none;
}

/* Content always takes full width — sidebar is overlay above it */
.app-content {
  flex: 1;
  width: 100%;
  min-width: 0; /* omogoči skrčitev v flex vrstici (odzivni layout) */
  padding: var(--layout-pad-y) var(--layout-pad-x);
  overflow: auto;
}

.nav-section-label {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.55);
  margin: 1.25rem 0.75rem 0.4rem;
  padding: 0;
}

.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.75rem;
  border-radius: 0.6rem;
  color: var(--sb-text);
  font-weight: 500;
  font-size: 0.875rem;
  border-left: 2.5px solid transparent;
  transition: background-color var(--transition-fast), color var(--transition-fast),
              border-left-color var(--transition-fast);
}

.nav-link[data-active="true"] {
  background-color: var(--sb-active-bg);
  color: var(--sb-text-active);
  font-weight: 700;
  border-left-color: var(--color-primary);
}

.nav-link:hover {
  background-color: var(--sb-hover-bg);
  color: var(--sb-text-hover);
}

.nav-icon {
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 0.45rem;
  background-color: var(--sb-icon-bg);
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  transition: background-color var(--transition-fast);
}

.nav-link[data-active="true"] .nav-icon {
  background-color: rgba(31, 100, 255, 0.35);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

/* Zadnji nalogi — celotna vrstica je povezava */
a.dashboard-recent-wo-row {
  transition: background-color 0.12s ease, box-shadow 0.12s ease;
}
a.dashboard-recent-wo-row:hover {
  background-color: rgba(31, 100, 255, 0.08) !important;
  box-shadow: inset 0 0 0 1px rgba(31, 100, 255, 0.12);
}
a.dashboard-recent-wo-row:last-of-type {
  border-bottom: none !important;
}

/* Letni pregled predvidenih servisov */
.service-year-overview__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.25rem;
  margin-bottom: 0.25rem;
}
.service-year-overview__year-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.service-year-overview__year {
  font-weight: 800;
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
  color: var(--color-text, #0f172a);
  min-width: 3.5rem;
  text-align: center;
}
.service-year-month {
  margin-top: 1.1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--color-border, #cbd5e1);
}
.service-year-month--empty .service-year-month__empty {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  color: var(--color-muted, #64748b);
}
.service-year-month__title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: #0f172a;
}
.service-year-month__y {
  font-weight: 600;
  color: var(--color-muted, #64748b);
}
.service-year-month__count {
  font-weight: 600;
  color: var(--color-primary, #2563eb);
  font-size: 0.88rem;
}
.service-year-section {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 2px solid var(--color-border, #a8bcd4);
}
.service-year-section__title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.65rem;
}
.service-year-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.service-year-list__item {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  padding: 0.55rem 0.72rem;
  background: linear-gradient(135deg, #fffbeb, #fff9f0);
  border: 1.5px solid #f59e0b;
  border-left: 4px solid #d97706;
  border-radius: 0.5rem;
}
.service-year-section--other .service-year-list__item {
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border-color: #94a3b8;
  border-left-color: #64748b;
}
.service-year-section--undated .service-year-list__item {
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
  border-color: #86efac;
  border-left-color: #16a34a;
}
.service-year-list__main {
  flex: 1;
  min-width: 0;
}
.service-year-list__veh {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--color-primary, #2563eb);
  text-decoration: none;
}
.service-year-list__veh:hover {
  text-decoration: underline;
}
.service-year-list__meta {
  display: block;
  font-size: 0.78rem;
  color: #536179;
  margin-top: 0.12rem;
}
.service-year-list__svc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  margin-top: 0.35rem;
}
.service-year-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: #92400e;
  background: rgba(255, 255, 255, 0.75);
  padding: 0.12rem 0.4rem;
  border-radius: 0.35rem;
  border: 1px solid rgba(217, 119, 6, 0.35);
}
.service-year-badge--date {
  color: #1e3a5f;
  border-color: rgba(30, 58, 95, 0.25);
}

.panel {
  background-color: var(--color-panel);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--panel-pad-y) var(--panel-pad-x);
  box-shadow: var(--shadow-md);
}

.form-control {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.form-control.checkbox {
  flex-direction: row;
  align-items: center;
}

.input-field,
.form-control select {
  border: 2px solid #7a9ec0;
  border-radius: var(--radius-md);
  padding: 0.62rem 0.85rem;
  font-size: 0.9rem;
  font-family: var(--font-sans);
  font-optical-sizing: auto;
  font-synthesis: none;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  line-height: 1.5;
  background-color: var(--color-input-bg);
  color: var(--color-text);
  width: 100%;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
}

.input-field:hover,
.form-control select:hover {
  border-color: #4f78a8;
}

.input-field:focus,
.form-control select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(31, 100, 255, 0.15);
  background-color: #fff;
}

textarea.input-field {
  min-height: 96px;
  resize: vertical;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

.form-grid {
  display: grid;
  gap: 0.9rem;
}

.form-grid.two-cols {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.form-grid.three-cols {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #3a4a5c;
  letter-spacing: 0.01em;
}

.form-errors {
  margin-bottom: 0.85rem;
  border: 1.5px solid rgba(220, 38, 38, 0.35);
  background-color: rgba(254, 242, 242, 0.8);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
}

.error {
  color: #b91c1c;
  font-size: 0.82rem;
  font-weight: 500;
}

.order-form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 17vw);
  gap: clamp(0.65rem, 1.5vw, 1rem);
  align-items: start;
}

.form-section {
  border: 1.5px solid #a8bcd4;
  border-radius: 0.85rem;
  padding: var(--panel-pad-y) var(--panel-pad-x);
  margin-bottom: 0.9rem;
  background: linear-gradient(180deg, rgba(31, 100, 255, 0.04), #fff);
}

.form-section h2 {
  margin: 0 0 0.75rem;
  font-size: 0.98rem;
  color: #1a3c86;
}

.wo-new-order-internal-hint {
  margin: -0.2rem 0 0.85rem;
  font-size: 0.82rem;
  color: var(--color-muted);
  line-height: 1.45;
}

.wo-recommend-from-last-wo {
  grid-column: 1 / -1;
  margin-top: 0.2rem;
  padding: 0.85rem 1rem;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 4px solid #d97706;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: #78350f;
}

.wo-recommend-from-last-wo strong {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 0.35rem;
  color: #92400e;
}

.wo-internal-from-last-wo {
  grid-column: 1 / -1;
  margin-top: 0.2rem;
  padding: 0.85rem 1rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 4px solid #dc2626;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: #7f1d1d;
}

.wo-internal-from-last-wo strong {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 0.35rem;
  color: #991b1b;
}

.order-helper {
  border: 1px solid var(--color-border);
  border-radius: 0.85rem;
  padding: 1rem;
  background-color: #fafbff;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  position: sticky;
  top: 86px;
}

.order-helper h3 {
  margin: 0;
  font-size: 0.95rem;
}

.order-helper ol {
  margin: 0;
  padding-left: 1rem;
  color: var(--color-muted);
}

.order-filters {
  margin: 1rem 0;
  display: grid;
  grid-template-columns: minmax(240px, 1.5fr) repeat(2, minmax(160px, 1fr)) auto;
  gap: 0.75rem;
  align-items: end;
}

.filter-wide {
  min-width: 0;
}

.filter-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: flex-end;
}

.order-kpis {
  margin-bottom: 1rem;
}

.dropzone {
  border: 1px dashed #9ca3af;
  border-radius: 0.85rem;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
  cursor: pointer;
  color: var(--color-muted);
  background-color: #fcfdff;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.dropzone:hover {
  border-color: #2563eb;
  background-color: #f4f8ff;
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  font-size: 0;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel-head.spaced {
  align-items: center;
}

.eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin: 0;
}

.badges-inline {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.kpi-card {
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  background-color: #fff;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}

.kpi-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.kpi-card.highlight {
  border-color: rgba(31, 100, 255, 0.35);
  background: linear-gradient(135deg, rgba(31, 100, 255, 0.07), #fff 60%);
}

.kpi-label {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted);
}

.kpi-value {
  margin: 0.3rem 0 0.1rem;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.kpi-meta {
  margin: 0;
  font-size: 0.72rem;
  color: var(--color-muted);
}

.priority-card {
  margin-top: 1.25rem;
  border: 1px dashed var(--color-border);
  border-radius: 0.85rem;
  padding: 0.85rem;
}

.priority-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.priority-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.grid-two {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.timeline-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.table-list {
  display: flex;
  flex-direction: column;
  border: 2.5px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.list-count-info {
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
  color: #475569;
  line-height: 1.35;
}
.list-count-info strong {
  color: #0f172a;
  font-weight: 750;
}
.list-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.55rem;
  margin-left: 0.35rem;
  padding: 0.12em 0.5em;
  border-radius: 999px;
  font-size: 0.55em;
  font-weight: 800;
  letter-spacing: 0.02em;
  vertical-align: middle;
  color: #1e40af;
  background: #dbeafe;
  border: 1px solid #93c5fd;
  line-height: 1.2;
}

.table-row {
  display: grid;
  gap: 0.5rem;
  padding: 0.9rem 1.1rem;
  border-bottom: 2px solid var(--color-border);
  align-items: center;
  font-size: 0.9rem;
  overflow: hidden;
  position: relative;
  transition: background-color var(--transition-fast);
}

.table-row:last-child {
  border-bottom: none;
}

.table-row.table-head {
  background: linear-gradient(135deg, rgba(31, 100, 255, 0.10), rgba(31, 100, 255, 0.06));
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: #1e40af;
  border-bottom: 2px solid rgba(31, 100, 255, 0.22);
}

/* ── Vehicle table — desktop ── */
.vehicle-table .table-head.vehicle-row {
  background: linear-gradient(135deg, #ccfbf1 0%, #f0fdfa 100%);
  border-bottom: 2px solid #5eead4;
  color: #0f766e;
  font-weight: 800;
}

/* Če je tabela širša od panela, horizontalni drsnik — stolpec Slika ostane dosegljiv */
.vehicle-table.table-list {
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-row.vehicle-row {
  grid-template-columns:
    minmax(0, 1.5fr) minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 0.85fr) minmax(0, 0.72fr)
    minmax(0, 0.95fr) minmax(52px, 3.75rem) minmax(0, 0.65fr) auto;
  min-width: min(100%, 72rem);
  border-left: 4px solid transparent;
  transition: border-color 0.15s, background 0.15s;
}

/* Namizje: sličica vozila + hover predogled (JS: #veh-list-photo-popover) */
.vehicle-table .col-photo {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  min-width: 52px;
}
.vehicle-table .veh-list-col-photo-head {
  text-align: center;
  font-size: 0.68rem;
}
.vehicle-table .veh-list-photo-hit {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: inherit;
  border-radius: 0.45rem;
}
.vehicle-table .veh-list-photo-thumb-wrap {
  display: block;
  border-radius: 0.45rem;
  overflow: hidden;
  border: 2px solid rgba(20, 184, 166, 0.38);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.vehicle-table .veh-list-photo-hit:hover .veh-list-photo-thumb-wrap {
  transform: scale(1.05);
  box-shadow: 0 4px 14px rgba(15, 118, 110, 0.22);
}
.vehicle-table .veh-list-photo-thumb {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: cover;
  vertical-align: middle;
}
.vehicle-table .veh-list-photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  font-size: 1.3rem;
  line-height: 1;
  border-radius: 0.45rem;
  border: 2px dashed #cbd5e1;
  background: #f8fafc;
  opacity: 0.88;
}
.vehicle-table .veh-list-photo-hit--empty:hover .veh-list-photo-placeholder {
  border-color: #5eead4;
  background: #f0fdfa;
}
.veh-list-photo-popover {
  position: fixed;
  z-index: 99990;
  width: 320px;
  height: 240px;
  padding: 4px;
  box-sizing: border-box;
  background: #fff;
  border-radius: 0.65rem;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(15, 23, 42, 0.06);
  pointer-events: auto;
}
.veh-list-photo-popover[hidden] {
  display: none !important;
}
.veh-list-photo-popover-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0.45rem;
  background: #f1f5f9;
}
.table-row.vehicle-row:not(.table-head):hover {
  border-left-color: #14b8a6;
  background: #f0fdfa;
}

/* Vehicle kind chip */
.veh-kind-icon {
  font-size: 1.05rem;
  margin-right: 0.3rem;
}
.veh-year {
  color: var(--color-muted);
  font-size: 0.85rem;
  font-weight: 400;
}
.veh-kind-chip {
  display: inline-block;
  font-size: 0.68rem;
  padding: 0.1rem 0.45rem;
  border-radius: 0.3rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 1.5px solid transparent;
}
.veh-kind-chip--blue   { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }
.veh-kind-chip--green  { background: #dcfce7; color: #166534; border-color: #86efac; }
.veh-kind-chip--amber  { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.veh-kind-chip--orange { background: #ffedd5; color: #9a3412; border-color: #fdba74; }
.veh-kind-chip--gray   { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }

/* ID copy button */
.veh-id-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #f1f5f9;
  border: 1.5px solid #cbd5e1;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 0.4rem;
  position: relative;
  z-index: 1;
  transition: background 0.15s, border-color 0.15s;
}
.veh-id-copy-btn:hover { background: #e2e8f0; border-color: #94a3b8; }
.veh-id-copy-btn--copied { background: #dcfce7 !important; border-color: #86efac !important; }
.veh-id-text  { font-family: monospace; font-size: 0.8rem; color: #1e293b; letter-spacing: 0.03em; font-weight: 700; }
.veh-id-ok    { font-size: 0.8rem; color: #16a34a; font-weight: 700; }
.veh-id-icon  { font-size: 0.75rem; color: #94a3b8; }

/* Customer column */
.col-customer__name  { display: block; font-size: 0.88rem; font-weight: 700; color: #1e293b; }
.col-customer__phone { display: block; font-size: 0.78rem; color: var(--color-primary); font-weight: 500; position: relative; z-index: 1; }

/* Vehicle chips (reg, orders, docs) */
.veh-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 0.4rem;
  border: 1.5px solid transparent;
  white-space: nowrap;
}
.veh-chip--reg            { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }
.veh-chip--internal       { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }
.veh-chip--orders-active  { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.veh-chip--docs           { background: #f0fdfa; color: #0f766e; border-color: #5eead4; }

/* ── Customer table — desktop ── */
.customer-table .table-head.customer-row {
  background: linear-gradient(135deg, #ede9fe 0%, #f5f3ff 100%);
  border-bottom: 2px solid #c4b5fd;
  color: #5b21b6;
  font-weight: 800;
}
.table-row.customer-row {
  grid-template-columns: 1.5fr 1.8fr 0.75fr 0.75fr 1fr 0.9fr auto;
  border-left: 4px solid #c4b5fd;
  transition: border-left-color 0.15s, background 0.15s;
}
.table-row.customer-row:not(.table-head):hover {
  border-left-color: #7c3aed;
  background: linear-gradient(135deg, #f5f3ff 0%, #faf9ff 100%);
}
/* kontakt sub-elementi */
.col-contact__person {
  display: block;
  font-weight: 600;
  color: var(--color-text);
  font-size: 0.85rem;
}
.col-contact__email {
  display: block;
  font-size: 0.78rem;
  color: var(--color-muted);
}
/* čipi vozila/nalogov */
.cust-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}
.cust-chip--veh {
  background: #ede9fe;
  color: #6d28d9;
  border: 1px solid #c4b5fd;
}
.cust-chip--orders {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}
.cust-chip--orders.cust-chip--active {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}
/* Utility */
.text-muted { color: var(--color-muted); }

/* material neto in dobiček */
.wo-material-compact__net {
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  font-size: 0.92rem;
  color: #1e40af;
}
.wo-material-compact__rvc {
  font-size: 0.72rem;
  color: #059669;
  font-weight: 700;
}

/* Inventory table column layout */
.table-row.inventory-row {
  grid-template-columns: 2fr 1fr 1.2fr 1fr 1.2fr auto;
}

/* Work order table column layout */
.table-row.workorder-row {
  grid-template-columns: 1fr 2fr 1fr 1fr 1.4fr auto;
}

.table-list[data-clickable="true"] .table-row:not(.table-head) {
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.table-list[data-clickable="true"] .table-row:not(.table-head):hover {
  background-color: rgba(31, 100, 255, 0.07);
}

.table-list[data-clickable="true"] .table-row:not(.table-head):nth-child(even) {
  background-color: rgba(15, 23, 42, 0.018);
}

.table-list[data-clickable="true"] .table-row:not(.table-head):nth-child(even):hover {
  background-color: rgba(31, 100, 255, 0.07);
}

.row-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  position: relative; /* above stretched link */
  z-index: 1;
}

/* Stretched link — makes entire row tappable as a real <a> */
.row-stretch-link {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
}

/* Skupaj material z nalogov (neto + dobiček) */
.wo-material-compact {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  line-height: 1.2;
  position: relative;
  z-index: 1;
}
.wo-material-compact__net {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  font-size: 0.88rem;
}
.wo-material-compact__rvc {
  font-size: 0.68rem;
  color: var(--color-muted);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* ── Mobile: table rows as cards (≤ 640px) ─────────────────── */
@media (max-width: 640px) {

  /* Customer card — mobilni redesign */
  .table-row.customer-row {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "name    wo_mat"
      "contact wo_mat"
      "chips   chips"
      "actions actions";
    gap: 0.2rem 0.65rem;
    padding: 0.85rem 0.9rem 0.7rem;
    border-left: 4px solid #c4b5fd;
    background: linear-gradient(135deg, #faf8ff 0%, #fff 60%);
    border-radius: 0.75rem;
    margin-bottom: 0.35rem;
    box-shadow: 0 1px 4px rgba(124,58,237,0.07);
    align-items: start;
  }
  .table-row.customer-row:active {
    background: #ede9fe;
  }

  .table-row.customer-row .col-name {
    grid-area: name;
    font-weight: 800;
    font-size: 1rem;
    color: #1e1b4b;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    align-self: end;
  }

  .table-row.customer-row .col-contact {
    grid-area: contact;
    min-width: 0;
    overflow: hidden;
    margin-top: 0.05rem;
  }
  .table-row.customer-row .col-contact .col-contact__person {
    font-size: 0.8rem;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
  }
  .table-row.customer-row .col-contact .col-contact__email {
    font-size: 0.74rem;
    color: var(--color-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
  }

  /* Material iznos — desno, prominentno */
  .table-row.customer-row .col-wo-material {
    grid-area: wo_mat;
    text-align: right;
    align-self: start;
  }
  .table-row.customer-row .col-wo-material .wo-material-compact__net {
    font-size: 1.05rem;
    font-weight: 900;
    color: #1e40af;
  }
  .table-row.customer-row .col-wo-material .wo-material-compact__rvc {
    font-size: 0.72rem;
    color: #059669;
    font-weight: 700;
  }

  /* Čipi (vozila + nalogi + datum) v eni vrstici */
  .table-row.customer-row .col-veh,
  .table-row.customer-row .col-orders,
  .table-row.customer-row .col-date {
    grid-area: unset;
  }
  /* Skupna vrstica čipov */
  .table-row.customer-row .col-veh { display: none; }
  .table-row.customer-row .col-orders { display: none; }
  .table-row.customer-row .col-date { display: none; }

  /* Skrij glavo tabele na mobilni */
  .customer-table .table-head.customer-row { display: none; }

  /* Čipi — grid z 2 stolpcema za chips vrstico */
  .table-row.customer-row .col-veh,
  .table-row.customer-row .col-orders,
  .table-row.customer-row .col-date {
    display: inline-flex;
  }
  .table-row.customer-row .col-veh    { grid-area: chips;  align-self: center; }
  .table-row.customer-row .col-orders { grid-area: chips2; align-self: center; }
  .table-row.customer-row .col-date   { display: none; }

  .table-row.customer-row .row-actions {
    grid-area: actions;
    justify-content: flex-start;
    gap: 0.45rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e9e5ff;
    margin-top: 0.3rem;
  }
  .table-row.customer-row .row-actions .badge.ghost {
    font-size: 0.76rem;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    background: #ede9fe;
    color: #6d28d9;
    border-color: #c4b5fd;
    font-weight: 700;
  }

  /* Vehicle card — mobilni redesign */
  .vehicle-table .table-head.vehicle-row { display: none; }

  .table-row.vehicle-row {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "name    reg"
      "customer reg"
      "service  orders"
      "wo_mat   wo_mat"
      "actions  actions";
    gap: 0.1rem 0.5rem;
    padding: 0.85rem 1rem;
    align-items: start;
    border-left: 4px solid #14b8a6;
    border-bottom: 1.5px solid #ccfbf1;
    min-width: 0;
    max-width: 100%;
  }

  .table-row.vehicle-row .col-name {
    grid-area: name;
    font-weight: 700;
    font-size: 0.97rem;
    color: #0f172a;
    align-self: start;
    min-width: 0;
  }

  .table-row.vehicle-row .col-customer {
    grid-area: customer;
    min-width: 0;
    margin-top: 0.1rem;
  }

  .table-row.vehicle-row .col-customer .col-customer__name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
  }

  .table-row.vehicle-row .col-customer .col-customer__phone {
    font-size: 0.76rem;
  }

  .table-row.vehicle-row .col-reg {
    grid-area: reg;
    align-self: start;
    text-align: right;
  }

  .table-row.vehicle-row .col-service {
    grid-area: service;
    margin-top: 0.35rem;
  }

  .table-row.vehicle-row .col-orders {
    grid-area: orders;
    text-align: right;
    margin-top: 0.35rem;
    align-self: start;
  }

  .table-row.vehicle-row .col-wo-material {
    grid-area: wo_mat;
    margin-top: 0.4rem;
    padding-top: 0.35rem;
    border-top: 1px solid #ccfbf1;
  }

  .table-row.vehicle-row .wo-material-compact__net {
    color: #0e7490;
    font-weight: 750;
  }

  .table-row.vehicle-row .col-attachments {
    display: none;
  }

  /* Na mobilu že ozadje kartice; stolpec sličice skrijemo */
  .vehicle-table .table-row.vehicle-row .col-photo {
    display: none;
  }

  .table-row.vehicle-row .row-actions {
    grid-area: actions;
    justify-content: flex-start;
    gap: 0.45rem;
    padding-top: 0.5rem;
    border-top: 1px solid #ccfbf1;
    margin-top: 0.3rem;
  }

  .table-row.vehicle-row .row-actions .badge.ghost {
    font-size: 0.76rem;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    background: #ccfbf1;
    color: #0f766e;
    border-color: #5eead4;
    font-weight: 700;
  }

  /* Mobil: fotografija vozila kot ozadje kartice (seznam /vehicles/) */
  .vehicle-table .table-row.vehicle-row.vehicle-row--has-photo {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border-radius: 0.75rem;
    margin-bottom: 0.4rem;
    box-shadow: 0 1px 6px rgba(15, 118, 110, 0.12);
    background: transparent !important;
    border-bottom: none;
  }
  .vehicle-table.table-list[data-clickable="true"] .table-row.vehicle-row.vehicle-row--has-photo:hover,
  .vehicle-table.table-list[data-clickable="true"] .table-row.vehicle-row.vehicle-row--has-photo:nth-child(even) {
    background: transparent !important;
  }
  .vehicle-table .table-row.vehicle-row.vehicle-row--has-photo::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: inherit;
    background-color: #f1f5f9;
    background-image: var(--veh-card-photo-url);
    /* contain = celotna slika, pravo razmerje (kot predogled na telefonu); cover obrezuje */
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.92;
    pointer-events: none;
  }
  .vehicle-table .table-row.vehicle-row.vehicle-row--has-photo::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.45) 0%, rgba(240, 253, 250, 0.42) 55%, rgba(255, 255, 255, 0.4) 100%);
  }
  .vehicle-table .table-row.vehicle-row.vehicle-row--has-photo .row-stretch-link {
    z-index: 2;
  }
  .vehicle-table .table-row.vehicle-row.vehicle-row--has-photo > span {
    position: relative;
    z-index: 3;
  }
  /* Berljivost nad fotko — seznam vozil */
  .vehicle-table .table-row.vehicle-row.vehicle-row--has-photo .col-name {
    color: #0f172a;
    font-weight: 800;
    text-shadow:
      0 0 0.4em rgba(255, 255, 255, 1),
      0 0 0.75em rgba(255, 255, 255, 0.95),
      0 0.04em 0.12em rgba(255, 255, 255, 0.98);
  }
  .vehicle-table .table-row.vehicle-row.vehicle-row--has-photo .col-name strong {
    font-weight: 900;
  }
  .vehicle-table .table-row.vehicle-row.vehicle-row--has-photo .veh-year {
    color: #1e293b;
    font-weight: 600;
    text-shadow: 0 0 0.35em rgba(255, 255, 255, 1);
  }
  .vehicle-table .table-row.vehicle-row.vehicle-row--has-photo .veh-kind-icon {
    filter: drop-shadow(0 0 0.2em rgba(255, 255, 255, 1)) drop-shadow(0 0 0.35em rgba(255, 255, 255, 0.9));
  }
  .vehicle-table .table-row.vehicle-row.vehicle-row--has-photo .veh-kind-chip,
  .vehicle-table .table-row.vehicle-row.vehicle-row--has-photo .veh-chip {
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.95),
      0 1px 5px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
  }
  .vehicle-table .table-row.vehicle-row.vehicle-row--has-photo .col-customer__name {
    color: #0f172a;
    font-weight: 700;
    text-shadow: 0 0 0.35em rgba(255, 255, 255, 1), 0 0 0.55em rgba(255, 255, 255, 0.95);
  }
  .vehicle-table .table-row.vehicle-row.vehicle-row--has-photo .col-customer__phone {
    text-shadow: 0 0 0.35em rgba(255, 255, 255, 1);
    font-weight: 600;
  }
  .vehicle-table .table-row.vehicle-row.vehicle-row--has-photo .veh-id-copy-btn {
    background: rgba(255, 255, 255, 0.94) !important;
    border-color: rgba(15, 23, 42, 0.2) !important;
    box-shadow: 0 1px 5px rgba(15, 23, 42, 0.12);
    font-weight: 700;
  }
  /* Bel panel samo okoli zneskov, ne čez celo širino kartice */
  .vehicle-table .table-row.vehicle-row.vehicle-row--has-photo .col-wo-material {
    justify-self: start;
    width: fit-content;
    max-width: 100%;
  }
  .vehicle-table .table-row.vehicle-row.vehicle-row--has-photo .wo-material-compact {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    width: auto;
    max-width: 100%;
    padding: 0.25rem 0.45rem;
    margin-left: 0;
    margin-right: 0;
    background: rgba(255, 255, 255, 0.88);
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.95);
    box-shadow: 0 1px 5px rgba(15, 23, 42, 0.08);
  }
  .vehicle-table .table-row.vehicle-row.vehicle-row--has-photo .wo-material-compact__net {
    color: #0e7490;
    font-weight: 800;
    text-shadow: 0 0 0.3em rgba(255, 255, 255, 1);
  }
  .vehicle-table .table-row.vehicle-row.vehicle-row--has-photo .wo-material-compact__rvc {
    color: #047857;
    font-weight: 700;
    text-shadow: 0 0 0.3em rgba(255, 255, 255, 1);
  }
  .vehicle-table .table-row.vehicle-row.vehicle-row--has-photo .row-actions .badge.ghost {
    background: rgba(255, 255, 255, 0.94) !important;
    box-shadow: 0 1px 5px rgba(15, 23, 42, 0.12);
    border-width: 1.5px !important;
    font-weight: 800 !important;
    color: #0f766e !important;
  }

  /* Glava tabele — skrijemo ZADNJE, da preglasi display:grid zgoraj */
  .table-row.table-head {
    display: none;
  }
}

.attachments-grid {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.attachments-grid li {
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  padding: 0.75rem;
  background-color: #fafbff;
}

.timeline-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.timeline-list.compact li {
  align-items: flex-start;
}

.micro-heading {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.75rem;
  margin-bottom: 0.4rem;
}

.btn-ghost {
  padding: 0.42rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid #c0d2e8;
  background-color: #fff;
  color: var(--color-primary);
  font-size: 0.88rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  transition: border-color var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-ghost:hover {
  border-color: rgba(31, 100, 255, 0.55);
  background-color: var(--color-primary-soft);
  box-shadow: 0 1px 4px rgba(31, 100, 255, 0.15);
}

.list-cards {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.list-cards li {
  border: 1px solid var(--color-border);
  border-radius: 0.65rem;
  padding: 0.6rem 0.75rem;
}

.finance-card {
  border: 1px solid rgba(31, 100, 255, 0.3);
  border-radius: 0.85rem;
  padding: 1rem;
  background-color: rgba(31, 100, 255, 0.05);
}

.panel-title {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.ai-panel-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 1.5rem;
  align-items: start;
}

.dropzone-icon { font-size: 1.75rem; pointer-events: none; }
.dropzone-text { font-size: 0.9rem; font-weight: 600; color: var(--color-text); pointer-events: none; }
.dropzone-hint { font-size: 0.75rem; color: var(--color-muted); pointer-events: none; }

.ai-upload-form {
  position: sticky;
  top: 88px;
  background: #ffffff;
  border: 1px solid #d4ddec;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

.ai-status-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.ai-status-card,
.ai-steps-card {
  background: #f8fbff;
  border: 1px solid #d6e4ff;
  border-radius: 12px;
  padding: 16px 20px;
}

.ai-steps-card {
  background: #fafafa;
  border-color: #e5e5e5;
}

.ai-status-label {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.ai-status-label.success {
  background: #e6f4ea;
  color: #137333;
}

.ai-status-label.warning {
  background: #fff4e5;
  color: #a15c00;
}

.ai-status-label.neutral {
  background: #eef2f7;
  color: #3f4254;
}

.ai-status-info {
  margin: 8px 0 0;
  color: #4b5563;
  line-height: 1.4;
}

.ai-steps-card ol {
  margin: 8px 0 0;
  padding-left: 20px;
  color: #374151;
}

.ai-steps-card li {
  margin-bottom: 4px;
}

.ai-steps-card li:last-child {
  margin-bottom: 0;
}

/* ── AI panel redesign ──────────────────────────────── */

.ai-form-card .ai-upload-form {
  position: static;
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.ai-page {
  width: 100%;
  max-width: none;
  margin: 0;
  box-sizing: border-box;
}

/* Hero header */
.ai-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.75rem;
  padding: 1.75rem 2rem;
  border-radius: 1.25rem;
  background: linear-gradient(135deg, #1a3fd4 0%, #2563eb 45%, #7c3aed 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.ai-hero::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -5%;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: rgba(255,255,255,.07);
  pointer-events: none;
}
.ai-hero::after {
  content: "";
  position: absolute;
  bottom: -60%;
  left: 25%;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(255,255,255,.05);
  pointer-events: none;
}

.back-link--light {
  font-size: 0.8rem;
  color: rgba(255,255,255,.7);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.4rem;
  transition: color .15s;
}
.back-link--light:hover { color: #fff; }

.ai-hero-title {
  font-size: 1.65rem;
  font-weight: 800;
  margin: 0 0 0.4rem;
  color: #fff;
  letter-spacing: -.01em;
}
.ai-hero-sub {
  font-size: 0.88rem;
  color: rgba(255,255,255,.8);
  margin: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.ai-hero-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: rgba(255,255,255,.2);
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
}

.ai-engine-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  position: relative;
  z-index: 1;
}
.ai-engine--openai    { background: rgba(255,255,255,.18); color: #fff; border: 1.5px solid rgba(255,255,255,.35); backdrop-filter: blur(6px); }
.ai-engine--warn      { background: #fff4e5; color: #a15c00; border: 1.5px solid rgba(161,92,0,.25); }
.ai-engine--heuristic { background: rgba(255,255,255,.13); color: rgba(255,255,255,.9); border: 1.5px solid rgba(255,255,255,.2); }

/* Form card */
.ai-form-card {
  background: #fff;
  border: 1px solid #d4ddec;
  border-radius: 1.25rem;
  padding: 1.5rem;
  box-shadow: 0 8px 32px rgba(15,23,42,.07);
  position: sticky;
  top: 88px;
  border-top: 4px solid #2563eb;
}

.ai-form-card-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}
.ai-form-card-icon  { font-size: 2rem; line-height: 1; }
.ai-form-card-title { font-weight: 700; font-size: 0.95rem; margin: 0; color: #1e40af; }
.ai-form-card-hint  { font-size: 0.8rem; color: var(--color-muted); margin: 0.15rem 0 0; }

.ai-form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

/* Upload zone */
.upload-zone-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: stretch;
}

.dropzone {
  border: 2px dashed #93c5fd;
  background: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 100%);
}
.dropzone:hover {
  border-color: #2563eb;
  background: linear-gradient(135deg, #dbeafe 0%, #ede9fe 100%);
}

.btn-camera {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.65rem 0.85rem;
  border: 2px dashed #a78bfa;
  border-radius: 0.85rem;
  background: linear-gradient(135deg, #f5f3ff, #fdf4ff);
  cursor: pointer;
  font-size: 0.78rem;
  color: #7c3aed;
  white-space: nowrap;
  transition: all .15s;
  min-width: 64px;
  font-weight: 600;
}
.btn-camera:hover {
  border-color: #7c3aed;
  background: linear-gradient(135deg, #ede9fe, #fae8ff);
  color: #5b21b6;
}
.btn-camera > span:first-child { font-size: 1.5rem; line-height: 1; }

/* Text collapse */
.ai-text-collapse {
  border: 1px solid #dbeafe;
  border-radius: 0.75rem;
  overflow: hidden;
}
.ai-text-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  background: linear-gradient(90deg, #eff6ff, #f5f3ff);
  border: none;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  color: #1e40af;
}
.ai-text-toggle:hover { background: linear-gradient(90deg, #dbeafe, #ede9fe); }
.toggle-arrow { color: #93c5fd; font-size: 0.85rem; }
.ai-text-body {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: #fff;
  border-top: 1px solid #dbeafe;
}
.ai-text-body textarea { width: 100%; }

/* Submit button */
.btn-ai-submit {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.9rem;
  background: linear-gradient(135deg, #1a3fd4 0%, #2563eb 50%, #7c3aed 100%);
  color: #fff;
  border: none;
  border-radius: 0.85rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 0.75rem;
  transition: opacity .15s, transform .1s, box-shadow .15s;
  letter-spacing: .02em;
  box-shadow: 0 4px 18px rgba(37,99,235,.35);
}
.btn-ai-submit:hover    { opacity: .92; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(37,99,235,.45); }
.btn-ai-submit:active   { transform: translateY(0); box-shadow: none; }
.btn-ai-submit:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

/* Steps */
.ai-steps-inline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}
.ai-step {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: var(--color-muted);
}
.ai-step-num {
  width: 1.35rem; height: 1.35rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  font-weight: 700;
  font-size: 0.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(37,99,235,.3);
}
.ai-step-sep { font-size: .75rem; color: #93c5fd; }

.form-label-standalone {
  font-size: 0.85rem;
  font-weight: 500;
  margin: 0 0 0.35rem;
}

/* Results header */
.ai-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.ai-results-count {
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-text);
}

/* Suggestion cards */
.ai-suggestion {
  border: 1px solid var(--color-border);
  border-left: 4px solid #cbd5e1;
  border-radius: 1rem;
  padding: 1.25rem;
  background: #fff;
  box-shadow: 0 4px 16px rgba(15,23,42,.05);
  transition: box-shadow .15s;
}
.ai-suggestion:hover { box-shadow: 0 8px 28px rgba(15,23,42,.09); }
.ai-suggestion--processed { border-left-color: #2563eb; }
.ai-suggestion--applied   { border-left-color: #16a34a; background: #f0fdf4; }
.ai-suggestion--failed    { border-left-color: #dc2626; }
.ai-suggestion--pending   { border-left-color: #d97706; }

.ai-suggestion-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.ai-suggestion-header-left {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.ai-suggestion-counter {
  width: 2rem; height: 2rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  font-weight: 800;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.ai-suggestion-header-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.2rem;
}
.ai-suggestion-header-right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.ai-suggestion-date {
  font-size: 0.78rem;
  color: var(--color-muted);
  margin: 0;
}
.ai-model-tag {
  font-size: 0.7rem;
  color: var(--color-muted);
  background: #f1f5f9;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: monospace;
}

/* Pill badges */
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-pill--blue   { background: #dbeafe; color: #1d4ed8; }
.badge-pill--indigo { background: #e0e7ff; color: #3730a3; }
.badge-pill--green  { background: #dcfce7; color: #15803d; }
.badge-pill--amber  { background: #fef3c7; color: #92400e; }
.badge-pill--orange { background: #ffedd5; color: #c2410c; }
.badge-pill--gray   { background: #f1f5f9; color: #64748b; }

/* AI suggestion table */
.ai-suggestion-table table thead tr {
  background: linear-gradient(90deg, #eff6ff, #f5f3ff);
}
.ai-suggestion-table table thead th {
  color: #1e40af;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 0.5rem 0.5rem;
}
.ai-item-row:hover { background: #f8faff; }
.ai-sku {
  font-size: 0.75rem;
  background: #f1f5f9;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--color-muted);
}
.ai-item-desc { max-width: 240px; }
.ai-price-cell { font-weight: 700; color: #1d4ed8; }
.text-right { text-align: right; }

/* Confidence bar */
.conf-bar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.conf-bar-fill {
  height: 6px;
  border-radius: 3px;
  display: block;
  min-width: 4px;
  max-width: 56px;
}
.conf-bar--high { background: #16a34a; }
.conf-bar--mid  { background: #d97706; }
.conf-bar--low  { background: #dc2626; }
.conf-pct { font-size: 0.72rem; color: var(--color-muted); }

/* Apply options */
.ai-apply-options {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #eff6ff, #f5f3ff);
  border: 1px solid #dbeafe;
  border-radius: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
/* .ai-apply-grid — glej spodaj pri .ai-apply-panel (kompakten 3-stolpec) */
.ai-apply-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.ai-apply-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #1e40af;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.btn-apply {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  background: linear-gradient(135deg, #15803d, #16a34a);
  color: #fff;
  border: none;
  border-radius: 0.65rem;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s, transform .1s, box-shadow .15s;
  box-shadow: 0 3px 12px rgba(21,128,61,.3);
}
.btn-apply:hover  { opacity: .9; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(21,128,61,.35); }
.btn-apply:active { transform: none; }

.ai-applied-banner {
  margin-top: 0.75rem;
  padding: 0.65rem 1rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 0.65rem;
  color: #15803d;
  font-weight: 600;
  font-size: 0.88rem;
}

.ai-no-items {
  color: var(--color-muted);
  font-size: 0.88rem;
  padding: 0.5rem 0;
}

/* Empty state */
.ai-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem;
  border: 2px dashed #bfdbfe;
  border-radius: 1.25rem;
  background: linear-gradient(135deg, #f0f9ff, #f5f3ff);
}
.ai-empty-icon  { font-size: 3rem; margin-bottom: 0.75rem; }
.ai-empty-title { font-size: 1.1rem; font-weight: 700; color: #1e40af; margin: 0 0 0.4rem; }
.ai-empty-hint  { font-size: 0.88rem; color: var(--color-muted); max-width: 320px; margin: 0; }

.ai-suggestion-summary {
  margin-bottom: 12px;
}

.suggestion-status {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.8rem;
  margin: 2px 0 4px;
}

.suggestion-status-processed {
  background: #e6f4ea;
  color: #137333;
}

.suggestion-status-failed {
  background: #fdecea;
  color: #b71c1c;
}

.suggestion-status-pending {
  background: #fff4e5;
  color: #a15c00;
}

.ai-suggestions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ai-suggestion {
  border: 1px solid var(--color-border);
  border-radius: 0.85rem;
  padding: 1rem;
  background-color: #fff;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.04);
}

.ai-suggestion header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

/* AI uvoz materiala — kompaktnejša postavitev, zneski z DDV, živi predogled */
.ai-hero {
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  border-radius: 1rem;
}
.ai-hero-title {
  font-size: 1.2rem;
}
.ai-hero-sub {
  font-size: 0.8rem;
}
.ai-form-card {
  padding: 1rem;
  border-radius: 1rem;
}
.ai-form-card-head {
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
}
.ai-form-card-icon {
  font-size: 1.4rem;
}
.ai-panel-grid {
  gap: 1rem;
}
@media (max-width: 900px) {
  .ai-form-card {
    position: static;
    top: auto;
  }
}

.ai-suggestion-summary--compact .ai-suggestion-summary__title {
  font-size: 0.95rem;
  margin: 0 0 0.2rem;
}
.ai-suggestion-summary__hint {
  margin: 0;
  font-size: 0.78rem;
}
.ai-suggestion__head {
  margin-bottom: 0.25rem;
}

.ai-suggestion-docmeta {
  margin: 0 0 0.65rem;
  padding: 0.55rem 0.7rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.55rem;
  font-size: 0.82rem;
}
.ai-suggestion-docmeta__title {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #475569;
}
.ai-suggestion-docmeta__dl {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.35rem 1rem;
  margin: 0 0 0.5rem;
}
.ai-suggestion-docmeta__dl > div {
  margin: 0;
}
.ai-suggestion-docmeta__dl dt {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 600;
  color: #64748b;
}
.ai-suggestion-docmeta__dl dd {
  margin: 0.1rem 0 0;
  font-weight: 600;
  color: #0f172a;
  word-break: break-word;
}
.ai-suggestion-docmeta__file {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.65rem;
  margin-top: 0.35rem;
}
.ai-suggestion-docmeta__link {
  font-weight: 600;
  color: #1d4ed8;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ai-suggestion-docmeta__thumb-wrap {
  display: block;
  border-radius: 0.35rem;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  line-height: 0;
}
.ai-suggestion-docmeta__thumb {
  display: block;
  max-width: 200px;
  max-height: 140px;
  width: auto;
  height: auto;
  object-fit: contain;
  background: #f8fafc;
}
.ai-suggestion-docmeta__nofile {
  margin: 0.25rem 0 0;
}
.ai-suggestion-docmeta__edit {
  margin-top: 0.55rem;
  padding-top: 0.45rem;
  border-top: 1px dashed #e2e8f0;
}
.ai-suggestion-docmeta__edit summary {
  cursor: pointer;
  font-weight: 600;
  color: #334155;
  font-size: 0.78rem;
}
.ai-suggestion-meta-form {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.45rem;
  max-width: 22rem;
}
.ai-suggestion-meta-form__lbl {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
}
.ai-suggestion-meta-form__lbl input {
  font-weight: 500;
}

.ai-suggestion-totals--compact {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0.5rem 0 0.65rem;
  padding: 0.5rem 0.65rem;
  background: #f1f5f9;
  border-radius: 0.5rem;
  font-size: 0.78rem;
}
.ai-totals-primary {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.ai-totals-big {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
}
.ai-totals-big__label {
  font-weight: 700;
  color: #334155;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ai-totals-big__val {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
}
.ai-totals-secondary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  color: #64748b;
}
.ai-alert-mismatch {
  margin: 0 0 0.5rem;
  padding: 0.45rem 0.65rem;
  font-size: 0.8rem;
}

.ai-suggestion-table--compact table {
  font-size: 0.78rem;
}
.ai-suggestion-table--compact th,
.ai-suggestion-table--compact td {
  padding: 0.28rem 0.35rem;
  vertical-align: top;
}
.ai-suggestion-table--compact thead th {
  background: #1e40af;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
}
.ai-col-cb {
  width: 2rem;
}
.ai-col-sku {
  max-width: 4.5rem;
  word-break: break-all;
}
.ai-col-desc {
  min-width: 120px;
  max-width: 240px;
}
.ai-desc-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.25;
}
.ai-col-qty {
  white-space: nowrap;
}
.ai-col-wo {
  min-width: 11rem;
  max-width: 16rem;
}
.ai-order-select {
  width: 100%;
  min-width: 10.5rem;
  max-width: 16rem;
  font-size: 0.72rem;
}
.ai-col-price,
.ai-col-line,
.ai-suggestion-table--compact .ai-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.ai-num--strong {
  font-weight: 700;
  color: #1e3a5f;
}
.ai-num--doc {
  color: #475569;
}
.ai-num--sell {
  font-weight: 700;
  color: #1d4ed8;
}
.ai-cell-muted {
  opacity: 0.5;
  color: #94a3b8 !important;
}
.ai-mat-row--unchecked {
  background: #f8fafc;
}
.ai-col-sell-u {
  min-width: 4.5rem;
}
.ai-col-sell-l {
  min-width: 5rem;
}
.ai-col-tax {
  white-space: nowrap;
}
.ai-tax-rate {
  display: inline-block;
  padding: 0.08rem 0.28rem;
  border-radius: 0.25rem;
  background: #e2e8f0;
  color: #334155;
  font-weight: 600;
  font-size: 0.72rem;
}
.ai-tax-rate--muted {
  background: #f1f5f9;
  color: #94a3b8;
  font-weight: 500;
}
.ai-badge-tiny {
  font-size: 0.65rem;
  padding: 0.1rem 0.28rem;
}
.ai-col-conf,
.ai-col-stock {
  text-align: center;
}

.ai-apply-row--targets {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.35rem 0.65rem;
  margin-bottom: 0.5rem;
  font-size: 0.78rem;
}

.ai-apply-panel {
  margin-top: 0.75rem;
  padding: 0.9rem 1rem 1rem;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #cbd5e1;
  border-radius: 0.75rem;
  max-width: 36rem;
}
.ai-apply-panel__title {
  margin: 0 0 0.55rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #1e40af;
}
.ai-apply-cost-basis {
  margin-bottom: 0.65rem;
  padding: 0.55rem 0.65rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.55rem;
}
.ai-apply-cost-basis__legend {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
}
.ai-apply-cost-basis__choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: stretch;
}
.ai-apply-chip {
  display: flex;
  align-items: center;
  cursor: pointer;
  margin: 0;
  padding: 0.35rem 0.65rem;
  border-radius: 0.45rem;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
  transition: border-color 0.12s, background 0.12s;
}
.ai-apply-chip:has(input:checked),
.ai-apply-chip.ai-apply-chip--on {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1e3a8a;
}
.ai-apply-chip input {
  margin: 0 0.45rem 0 0;
  accent-color: #2563eb;
}
.ai-apply-chip__sub {
  font-weight: 500;
  color: #64748b;
  margin-left: 0.2rem;
}
.ai-apply-cost-basis__hint {
  margin: 0.45rem 0 0;
  line-height: 1.35;
  font-size: 0.68rem !important;
}
.ai-apply-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem 0.65rem;
  margin-bottom: 0.35rem;
  align-items: end;
}
.ai-apply-grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 520px) {
  .ai-apply-grid {
    grid-template-columns: 1fr;
  }
}
.ai-apply-grid-hint {
  margin: 0 0 0.55rem;
  line-height: 1.35;
  font-size: 0.68rem !important;
}
.ai-apply-field .ai-apply-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 0.2rem;
}
.ai-apply-input--boxed {
  width: 100%;
  max-width: none;
  min-height: 40px;
  border: 2px solid #94a3b8 !important;
  border-radius: 0.4rem;
  padding: 0.35rem 0.5rem;
  background: #fff;
  font-size: 0.88rem;
}
select.ai-apply-input--boxed {
  cursor: pointer;
}
select.ai-apply-input--boxed:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: #f1f5f9;
}
.ai-field-hint {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.65rem;
  color: #64748b;
  line-height: 1.3;
  max-width: 22rem;
}
.ai-live-totals {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0.5rem 0 0.65rem;
  padding: 0.65rem 0.75rem;
  background: #fff;
  border: 1px solid #bfdbfe;
  border-radius: 0.5rem;
}
.ai-live-totals__sell {
  padding-top: 0.35rem;
  border-top: 1px dashed #cbd5e1;
}
.ai-live-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 0.12rem;
}
.ai-live-val {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e40af;
}
.ai-live-val--hero {
  font-size: 1.45rem;
  font-weight: 800;
  color: #0f172a;
}
.ai-apply-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.ai-apply-submit {
  min-height: 44px;
}

.ai-suggestion-table {
  overflow-x: auto;
  margin-top: 0.75rem;
}

.ai-suggestion-table table {
  width: 100%;
  border-collapse: collapse;
}

.ai-suggestion-table th,
.ai-suggestion-table td {
  border-bottom: 1px solid var(--color-border);
  padding: 0.4rem;
  text-align: left;
}

.order-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background-color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-fast);
}

.icon-btn:hover {
  border-color: rgba(31, 100, 255, 0.45);
  background-color: rgba(31, 100, 255, 0.07);
  box-shadow: 0 2px 8px rgba(31, 100, 255, 0.15);
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, #2d74ff 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.62rem 1.2rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 2px 8px rgba(31, 100, 255, 0.30);
  transition: background var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1855e8 0%, var(--color-primary) 100%);
  box-shadow: 0 4px 16px rgba(31, 100, 255, 0.40);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(31, 100, 255, 0.25);
}

.btn-secondary {
  background-color: #fff;
  color: var(--color-primary);
  border: 1.5px solid rgba(31, 100, 255, 0.40);
  border-radius: var(--radius-md);
  padding: 0.58rem 1.1rem;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.btn-secondary:hover {
  background-color: var(--color-primary-soft);
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(31, 100, 255, 0.15);
}

.btn-primary:focus,
.btn-ghost:focus,
.icon-btn:focus,
.btn-secondary:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(31, 100, 255, 0.28);
}

.order-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 18vw);
  gap: clamp(0.55rem, 1.2vw, 0.9rem);
}

.materials-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.materials-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.materials-table th,
.materials-table td {
  border-bottom: 1.5px solid var(--color-border);
  padding: 0.5rem;
  vertical-align: top;
  min-width: 110px;
}

.materials-table th {
  text-align: left;
  background-color: rgba(31, 100, 255, 0.12);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.materials-table tbody tr:nth-child(even) {
  background-color: #fbfdff;
}

.materials-table .delete-cell {
  min-width: 62px;
}

.material-row.is-deleted {
  opacity: 0.45;
}

.order-calculator {
  border: 1px solid #c9d6ec;
  border-radius: 0.85rem;
  padding: 1rem;
  background: linear-gradient(180deg, #f7faff, #ffffff);
  position: sticky;
  top: 86px;
  height: fit-content;
}

.order-calculator h3 {
  margin: 0 0 0.75rem;
}

.calc-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.calc-list > div {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.92rem;
}

.calc-list > div.highlight {
  margin-top: 0.25rem;
  border-top: 1px dashed var(--color-border);
  padding-top: 0.45rem;
  font-weight: 700;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid currentColor;
  background-color: #fff;
}

.badge.ghost {
  border-style: dashed;
  color: var(--color-muted);
}

.badge.success {
  color: #046c4e;
  border-color: rgba(4, 108, 78, 0.35);
  background-color: rgba(4, 108, 78, 0.09);
}

.badge.warning {
  color: #b45309;
  border-color: rgba(180, 83, 9, 0.35);
  background-color: rgba(245, 158, 11, 0.10);
}

.badge.danger {
  color: #b91c1c;
  border-color: rgba(185, 28, 28, 0.35);
  background-color: rgba(220, 38, 38, 0.09);
}

.badge.invoice-nr {
  color: #1e40af;
  border-color: rgba(30, 64, 175, 0.30);
  background-color: rgba(30, 64, 175, 0.08);
  font-weight: 700;
  letter-spacing: 0.03em;
}

/* ═══ MOBILE ≤ 960px ═══════════════════════════════════ */
@media (max-width: 960px) {
  /* Show hamburger toggle */
  .sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Skrij »Ustvari« v ločenem app-topbar (v subnav ostane) */
  .app-topbar .topbar-quick-links { display: none; }
  .app-topbar .workshop-switch     { display: none; }

  /* Mobil/tablet: minimalni robovi; spodaj prostor za bottom nav */
  .app-content {
    padding: 0.55rem var(--layout-pad-x);
    padding-bottom: max(5.5rem, calc(5.25rem + env(safe-area-inset-bottom, 0px)));
  }

  /* Misc layout fixes */
  .ai-panel-grid       { grid-template-columns: 1fr; }
  .ai-upload-form      { position: static; }
  .ai-form-card        { position: static; }
  .ai-form-row-2       { grid-template-columns: 1fr; }
  .upload-zone-wrap    { grid-template-columns: 1fr; }
  .order-form-layout   { grid-template-columns: 1fr; }
  .order-helper        { position: static; }
  .order-filters       { grid-template-columns: 1fr; }
  .filter-actions      { justify-content: flex-start; }
  .order-detail-layout { grid-template-columns: 1fr; }
  .order-calculator    { position: static; }

  /* WO detail */
  .wo-layout      { grid-template-columns: 1fr; }
  .wo-sidebar     { position: static; }
  .wo-fields-4col { grid-template-columns: repeat(2, 1fr); }
  .wo-code        { font-size: 1.4rem; }

  /* Materials table — skrij manj pomembne stolpce na mobilnem */
  .materials-table .mat-col-date { display: none; }
  .materials-table .mat-col-rvc  { display: none; }
  .ai-suggestion-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Sidebar mobile header visible */
  .sidebar-mobile-header { display: flex; }
  .sidebar-workshop-tag  { display: flex; }
}

/* ═══ TELEFON ≤ 640px ══════════════════════════════════ */
@media (max-width: 640px) {
  /* Še ožje ob straneh + varnostni rob (notch) */
  .app-content {
    padding-top: 0.4rem;
    padding-bottom: max(5.25rem, calc(5rem + env(safe-area-inset-bottom, 0px)));
    padding-left: max(0.3rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.3rem, env(safe-area-inset-right, 0px));
  }
  .panel {
    padding: 0.72rem 0.55rem;
    border-radius: 0.78rem;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
  }
  .wo-page {
    max-width: 100%;
  }
  /* ── Materiali: tabela → kartice ─────────────────────── */
  .materials-table-wrap { overflow-x: visible; }
  .materials-table thead { display: none !important; }
  .materials-table,
  .materials-table tbody { display: block; width: 100%; }

  /*
    VRSTICA 1: [Artikel combo]  [Naziv/opis]
    VRSTICA 2: [Kol.]  [Nabavna€]  [Marža%]  [Prod.€]   ← kompaktno
    VRSTICA 3: [Popust%]  [Dobiček €]  [Skupaj]  [Briši]  [Status]  ← majhno + akcija
  */
  .material-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr auto auto;
    grid-template-areas:
      "item  item  desc   desc   desc"
      "qty   cost  marza  price  price"
      "disc  rvc   total  del    status";
    gap: 0.25rem 0.4rem;
    background: #fff;
    border: 1px solid #d4e0f5;
    border-radius: 0.8rem;
    padding: 0.65rem 0.7rem 0.55rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  }
  .material-row.is-deleted { display: none !important; }

  /* ── Grid area prirejanja ── */
  .mat-col-item   { grid-area: item; }
  .mat-col-desc   { grid-area: desc; }
  .mat-col-qty    { grid-area: qty; }
  .mat-col-cost   { grid-area: cost; }
  .mat-col-marza  { grid-area: marza; }
  .mat-col-price  { grid-area: price; }
  .mat-col-disc   { grid-area: disc; }
  .mat-col-rvc    { grid-area: rvc; }
  .mat-col-date   { display: none !important; }
  .mat-col-total  { grid-area: total; }
  .mat-col-del    { grid-area: del;    display: flex; align-items: center; justify-content: center; }
  .mat-col-status { grid-area: status; display: flex; align-items: center; justify-content: flex-start; }

  /* ── Vrstica 1: Artikel + Naziv — brez labela, vhodni polji ── */
  .mat-col-item .art-combo,
  .mat-col-item .art-combo-wrap { width: 100%; }
  .mat-col-item .art-combo-wrap .art-combo-input { width: 100%; }

  /* Ločilna črta med vrsticama 1 in 2 */
  .mat-col-qty {
    grid-column-start: 1;
    border-top: 1px solid #e8eef8;
    padding-top: 0.3rem;
    margin-top: 0.1rem;
  }
  .mat-col-cost, .mat-col-marza, .mat-col-price {
    border-top: 1px solid #e8eef8;
    padding-top: 0.3rem;
    margin-top: 0.1rem;
  }

  /* ── Micro labeli za vrstico 2 (Kol, Nabavna, Marža, Prod) ── */
  .mat-col-qty::before,
  .mat-col-cost::before,
  .mat-col-marza::before,
  .mat-col-price::before {
    display: block;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin-bottom: 0.1rem;
  }
  .mat-col-qty::before   { content: "Kol."; }
  .mat-col-cost::before  { content: "Nabavna €"; }
  .mat-col-marza::before { content: "Marža %"; }
  .mat-col-price::before { content: "Prodajna €"; }

  /* ── Vrstica 3: Popust, dobiček — majhno, samo besedilo ── */
  .mat-col-disc,
  .mat-col-rvc {
    font-size: 0.7rem;
    color: #94a3b8;
    border-top: 1px dashed #e8eef8;
    padding-top: 0.25rem;
    margin-top: 0.05rem;
    display: flex;
    flex-direction: column;
  }
  .mat-col-disc::before,
  .mat-col-rvc::before {
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #cbd5e1;
    margin-bottom: 0.05rem;
  }
  .mat-col-disc::before { content: "Popust %"; }
  .mat-col-rvc::before  { content: "Dobiček €"; }

  /* Disc — kompakten input */
  .mat-col-disc .input-field {
    height: 28px !important;
    font-size: 0.78rem !important;
    padding: 0.15rem 0.35rem !important;
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #64748b;
  }

  /* Dobiček — zelena vrednost */
  .mat-col-rvc .line-rvc {
    font-size: 0.75rem;
    font-weight: 700;
    color: #16a34a;
    padding-top: 0.15rem;
  }
  /* ── Vrstica 3: Skupaj — kompaktno ob popustu/dobičku ── */
  .mat-col-total {
    grid-area: total;
    display: flex;
    flex-direction: column;
    border-top: 1px dashed #e8eef8;
    padding-top: 0.25rem;
    margin-top: 0.05rem;
  }
  .mat-col-total::before {
    content: "Skupaj";
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #cbd5e1;
    margin-bottom: 0.05rem;
  }
  .mat-col-total .line-total {
    font-size: 0.88rem;
    font-weight: 800;
    color: #16a34a;
  }

  /* ── Vsi inputi v kartici – iOS font fix ── */
  .material-row .input-field {
    width: 100% !important;
    font-size: 16px !important;
    padding: 0.38rem 0.4rem;
    height: 36px;
    box-sizing: border-box;
  }

  /* Brisanje gumb — kompakten ob total */
  .mat-col-del { border-top: 1px dashed #e8eef8; padding-top: 0.25rem; margin-top: 0.05rem; }
  .mat-col-status { border-top: 1px dashed #e8eef8; padding-top: 0.25rem; margin-top: 0.05rem; }
  .material-row .mat-del-btn {
    min-width: 30px;
    min-height: 30px;
    border-radius: 7px;
    background: #fff1f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    font-size: 0.85rem;
  }
}


@media (min-width: 961px) {
  /* Desktop: sidebar je del layouta, ne overlay */
  .app-body {
    display: flex;
    flex-direction: row;
    align-items: stretch;
  }
  .app-sidebar {
    position: relative;
    left: auto;
    top: auto;
    transform: none !important;
    box-shadow: none;
    flex: 0 0 var(--sidebar-collapsed-width);
    width: var(--sidebar-collapsed-width);
    min-width: var(--sidebar-collapsed-width);
    height: calc(100dvh - var(--topbar-height));
    overflow: hidden;
    transition: flex 180ms ease, width 180ms ease, min-width 180ms ease;
  }
  .app-sidebar:hover {
    flex: 0 0 var(--sidebar-width);
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    overflow-y: auto;
    overflow-x: hidden;
  }
  .app-sidebar.sidebar-hidden {
    flex: 0 0 0;
    width: 0;
    min-width: 0;
    overflow: hidden;
    padding: 0;
  }
  .app-content {
    flex: 1;
    min-width: 0;
  }
  /* Ikone + labele: skrit text ko je sidebar skrčen */
  .app-sidebar .nav-label,
  .app-sidebar .nav-section-label {
    opacity: 0;
    width: 0;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    margin: 0;
    padding: 0;
    transition: opacity 150ms ease, width 150ms ease;
  }
  .app-sidebar .nav-badge { opacity: 0; overflow: hidden; width: 0; }
  .app-sidebar:hover .nav-label,
  .app-sidebar:hover .nav-section-label,
  .app-sidebar:hover .nav-badge { opacity: 1; width: auto; min-width: 0; }
  .app-sidebar .nav-link { justify-content: flex-start; }
  .app-sidebar:not(:hover) .nav-link { justify-content: center; padding-left: 0.5rem; padding-right: 0.5rem; }
  .app-sidebar:not(:hover) .nav-list { align-items: center; }
  .app-sidebar:not(:hover) .nav-section-label { height: 0; margin: 0.5rem 0 0; padding: 0; line-height: 0; }
  /* Native title tooltip pri skrčenem sidebalu (klasični hover) */

  /* Mobile-only elements hidden on desktop */
  .sidebar-mobile-header { display: none; }
  .sidebar-workshop-tag  { display: none; }
  .mobile-bottom-nav     { display: none !important; }
  .sidebar-backdrop      { display: block; } /* backdrop still works on desktop */

  /* Kompaktni gumbi v subnav na desktopu */
  .user-menu-btn--compact .user-name-text,
  .user-menu-btn--compact .user-menu-caret { display: none; }
  .user-menu-btn--compact { padding: 0.25rem; }
  .user-menu-btn--compact .user-avatar { width: 32px; height: 32px; font-size: 0.8rem; }
  .topbar-search-btn--icon-only .topbar-search-label,
  .topbar-search-btn--icon-only .topbar-search-kbd { display: none; }
  .topbar-search-btn--icon-only { padding: 0.35rem 0.6rem; }
  .topbar-create-btn--icon-only .topbar-create-label,
  .topbar-create-btn--icon-only .topbar-create-caret { display: none; }
  .topbar-create-btn--icon-only { padding: 0.35rem 0.65rem; }
}

.flash-container {
  position: fixed;
  right: max(0.75rem, var(--layout-pad-x));
  bottom: max(1rem, var(--layout-pad-y));
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  z-index: 60;
  max-width: min(400px, calc(100vw - 1.5rem));
}

.flash {
  background-color: #fff;
  border-radius: var(--radius-md);
  padding: 0.8rem 1.1rem;
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.4;
  animation: flash-slide-in 0.2s ease;
}

@keyframes flash-slide-in {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}

.flash.success {
  border-color: rgba(5, 150, 105, 0.35);
  border-left-color: #059669;
  background: linear-gradient(135deg, #f0fdf8, #fff);
}

.flash.warning {
  border-color: rgba(217, 119, 6, 0.35);
  border-left-color: #d97706;
  background: linear-gradient(135deg, #fffbf0, #fff);
}

.flash.error {
  border-color: rgba(220, 38, 38, 0.35);
  border-left-color: #dc2626;
  background: linear-gradient(135deg, #fff5f5, #fff);
}

.flash.info {
  border-color: rgba(31, 100, 255, 0.35);
  border-left-color: var(--color-primary);
  background: linear-gradient(135deg, #f0f6ff, #fff);
}

/* ── Page Header ──────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.page-header-left {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.page-header-left .eyebrow {
  margin-bottom: 0.1rem;
}

.page-header-left h1 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.page-header-left p.subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.9rem;
  color: var(--color-muted);
  line-height: 1.45;
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* ── Improved panel-title inside panels ──────────────── */
.panel-title {
  margin-top: 0;
  margin-bottom: 0.4rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

/* ── Colored KPI card variants ──────────────────────── */
.kpi-card--blue {
  border-left: 3px solid var(--color-primary);
  background: linear-gradient(135deg, rgba(31, 100, 255, 0.06), #fff);
}

.kpi-card--blue .kpi-value {
  color: var(--color-primary);
}

.kpi-card--amber {
  border-left: 3px solid #f59e0b;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.07), #fff);
}

.kpi-card--amber .kpi-value {
  color: #b45309;
}

.kpi-card--red {
  border-left: 3px solid #ef4444;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.07), #fff);
}

.kpi-card--red .kpi-value {
  color: #dc2626;
}

.kpi-card--green {
  border-left: 3px solid #10b981;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.07), #fff);
}

.kpi-card--green .kpi-value {
  color: #047857;
}

/* ── Empty State ─────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--color-muted);
}

.empty-state-icon {
  font-size: 2.8rem;
  margin-bottom: 0.75rem;
  line-height: 1;
  opacity: 0.6;
}

.empty-state-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
  color: var(--color-text);
}

.empty-state-desc {
  font-size: 0.88rem;
  margin: 0 0 1.25rem;
  max-width: 320px;
}

/* ── User Menu (topbar dropdown) ─────────────────────── */
.user-menu {
  position: relative;
}

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.6rem 0.3rem 0.35rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--color-text);
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.user-menu-btn:hover {
  border-color: rgba(31, 100, 255, 0.4);
  background-color: var(--color-primary-soft);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), #7bb3ff);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.user-menu-caret {
  font-size: 0.65rem;
  opacity: 0.5;
  margin-left: 0.1rem;
}

.user-menu-dropdown {
  position: fixed;
  right: 8px;
  top: calc(var(--topbar-height) + env(safe-area-inset-top, 0px) + 6px);
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 0.9rem;
  box-shadow: 0 16px 44px rgba(15, 23, 42, 0.13);
  min-width: 190px;
  padding: 0.4rem;
  z-index: 9999;
}

.user-menu-username {
  padding: 0.45rem 0.75rem 0.3rem;
  font-size: 0.82rem;
  color: var(--color-muted);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.user-menu-dropdown a,
.user-menu-dropdown button.menu-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-radius: 0.55rem;
  font-size: 0.9rem;
  color: var(--color-text);
  border: none;
  background: none;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.user-menu-dropdown a:hover,
.user-menu-dropdown button.menu-item:hover {
  background-color: rgba(31, 100, 255, 0.07);
}

.user-menu-divider {
  height: 1px;
  background: var(--color-border);
  margin: 0.35rem 0;
}

/* ── nav-icon + nav-link: dark sidebar (in sync with :root vars) ── */
.nav-icon {
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 0.45rem;
  background-color: var(--sb-icon-bg);
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  transition: background-color var(--transition-fast);
}

.nav-link[data-active="true"] {
  background-color: var(--sb-active-bg);
  color: var(--sb-text-active);
  font-weight: 700;
  border-left-color: var(--color-primary);
}

/* ── Better HR ──────────────────────────────────────── */
hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 1.25rem 0;
}

/* ── Timeline item cards ─────────────────────────────── */
.timeline-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid var(--color-border);
  background: #fff;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.timeline-card:hover {
  background-color: rgba(31, 100, 255, 0.04);
  border-color: rgba(31, 100, 255, 0.2);
}

.timeline-card-body {
  flex: 1;
  min-width: 0;
}

.timeline-card-body strong {
  display: block;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeline-card-body p {
  margin: 0.1rem 0 0;
  font-size: 0.8rem;
  color: var(--color-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.time-badge {
  background: var(--color-primary-soft);
  color: var(--color-primary);
  border-radius: 0.5rem;
  padding: 0.22rem 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.customer-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d4e5ff, #b8d0ff);
  display: grid;
  place-items: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-primary);
  flex-shrink: 0;
  text-transform: uppercase;
}

/* ── Workshop switcher (topbar) ──────────────────────── */
.workshop-switcher {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.workshop-switcher-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
  white-space: nowrap;
}

.workshop-switcher select {
  border: 1px solid var(--color-border);
  border-radius: 0.6rem;
  padding: 0.3rem 0.6rem;
  font-size: 0.88rem;
  font-weight: 600;
  background-color: #fff;
  color: var(--color-text);
  cursor: pointer;
  transition: border-color var(--transition-fast);
  max-width: 200px;
}

.workshop-switcher select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(31, 100, 255, 0.15);
}

/* ── Finance / outstanding card ──────────────────────── */
.finance-card {
  border: 1px solid rgba(31, 100, 255, 0.25);
  border-left: 3px solid var(--color-primary);
  border-radius: 0.85rem;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(31, 100, 255, 0.05), #fff);
}

/* ── Low stock row warning ───────────────────────────── */
.stock-warning-badge {
  background-color: rgba(245, 158, 11, 0.1);
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.4);
}

/* ── Auth card improvements ──────────────────────────── */
.auth-card {
  padding: 2.5rem;
}

.auth-card header .brand-mark {
  width: 52px;
  height: 52px;
  font-size: 1.25rem;
  margin: 0 auto 1rem;
  border-radius: 14px;
}

.auth-card h1 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 0.3rem;
}

.auth-card .form-control label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--color-muted);
}

.auth-card .form-actions {
  margin-top: 1.25rem;
}

.auth-card .btn-primary {
  width: 100%;
  padding: 0.7rem 1rem;
  font-size: 1rem;
  border-radius: 0.75rem;
  text-align: center;
}

/* ── Inventory stock quantity indicator ──────────────── */
.stock-qty {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.stock-qty.low {
  color: #d97706;
  font-weight: 600;
}

.stock-qty.critical {
  color: #dc2626;
  font-weight: 700;
}

/* ── Quick link button polish ─────────────────────────── */
.quick-link {
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* ── Work Order Detail Page ──────────────────────────── */

.wo-page {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  font-family: var(--font-sans);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Delovni nalog: manj „robotski“ labeli (sentence case, ožje letter-spacing) */
.wo-page .wo-group-label,
.wo-page .wo-group-label--dense {
  text-transform: none;
  letter-spacing: 0.01em;
  font-weight: 600;
}
.wo-page .wo-form-compact .form-label,
.wo-page .wo-order-meta-compact .wo-mf-mini > .form-label {
  text-transform: none;
  letter-spacing: 0.015em;
  font-weight: 600;
  color: #64748b;
}
.wo-page .wo-sum-cell-label {
  text-transform: none;
  letter-spacing: 0.02em;
  font-weight: 600;
}
.wo-page .wo-section-head h2 {
  letter-spacing: -0.01em;
  font-weight: 600;
}

/* Delovni nalog — barvna uskladitev (modra znamka + teal poudarki) */
.wo-page {
  --wo-accent: #0f766e;
  --wo-accent-soft: #f0fdfa;
  --wo-accent-line: #99f6e4;
  --wo-brand: var(--color-primary, #1f64ff);
  --wo-brand-soft: var(--color-primary-soft, #e4edff);
}
.wo-page .wo-page-header--compact {
  padding: 0.85rem 1rem 0.95rem;
  border-radius: 0.9rem;
  border: 1px solid #dbeafe;
  background:
    linear-gradient(90deg, var(--wo-brand) 0 4px, transparent 4px),
    linear-gradient(135deg, #f8fbff 0%, #ffffff 55%, #f0fdfa 100%);
  box-shadow: 0 1px 6px rgba(31, 100, 255, 0.07);
}
.wo-page .wo-code {
  color: #0f172a;
  letter-spacing: -0.02em;
}
.wo-page .wo-back-link {
  color: var(--wo-accent);
  font-weight: 650;
}
.wo-page .wo-back-link:hover {
  color: var(--wo-brand);
}
.wo-page a.wo-meta-chip--link {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1e3a8a;
}
.wo-page a.wo-meta-chip--link:hover {
  border-color: var(--wo-brand);
  background: var(--wo-brand-soft);
}
.wo-page .wo-section {
  border-color: #dbeafe;
  border-left: 3px solid #93c5fd;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05);
  background: #fff;
}
.wo-page .wo-work-desc-section {
  border-left-color: var(--wo-accent);
  background: linear-gradient(180deg, #f7fffc 0%, #fff 42%);
}
.wo-page .wo-section--materials {
  border-left-color: var(--wo-brand);
  border-color: #bfdbfe;
  background: linear-gradient(180deg, #f8fbff 0%, #fff 48%);
}
.wo-page .wo-order-meta-details,
.wo-page .wo-entity-details {
  border-left-color: #64748b;
}
.wo-page .wo-order-meta-summary,
.wo-page .wo-entity-summary--compact {
  background: linear-gradient(90deg, #f8fafc 0%, #fff 100%);
}
.wo-page .wo-group-label,
.wo-page .wo-group-label--dense,
.wo-page .wo-entity-summary-compact-text {
  color: var(--wo-accent);
}
.wo-page .wo-jump-nav__link {
  border-color: #bfdbfe;
  color: #1e40af;
  background: #fff;
}
.wo-page .wo-jump-nav__link:hover,
.wo-page .wo-jump-nav__link:focus-visible {
  border-color: var(--wo-accent);
  color: var(--wo-accent);
  background: var(--wo-accent-soft);
}
.wo-page .wo-header-act.btn-primary {
  background: var(--wo-brand);
  border-color: var(--wo-brand);
}
.wo-page .wo-rvc-mini-strip {
  border-color: #bfdbfe;
  background: linear-gradient(90deg, #eff6ff 0%, #f0fdfa 100%);
}
.wo-page .wo-section-head h2 {
  color: #0f172a;
}
.wo-page .wo-section--materials .wo-section-head h2 {
  color: #1e40af;
}
.wo-page .wo-work-desc-section .wo-section-head h2,
.wo-page .wo-work-desc-section .wo-group-label {
  color: var(--wo-accent);
}
.wo-page .wo-header-status-badge {
  border: 1px solid transparent;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.04);
}
.wo-page .wo-header-status-badge.success {
  background: #d1fae5;
  color: #065f46;
  border-color: #6ee7b7;
}
.wo-page .wo-header-status-badge.warning {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}
.wo-page .wo-header-status-badge.danger {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}
.wo-page .wo-jump-nav {
  background: linear-gradient(180deg, #eef4ff 65%, rgba(238, 244, 255, 0.82));
  border-bottom: 1px solid #dbeafe;
  margin-left: -0.1rem;
  margin-right: -0.1rem;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}

/* Zaključen nalog: pas za spremembo statusa + zatemnitev zaklenjene vsebine */
.wo-completed-unlock-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1.25rem;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  border-radius: 10px;
  border: 1px solid #bfdbfe;
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdfa 100%);
  box-shadow: 0 1px 3px rgba(31, 100, 255, 0.08);
}
.wo-completed-unlock-banner__text {
  margin: 0;
  flex: 1 1 220px;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #4c1d95;
}
.wo-completed-unlock-banner__status {
  flex: 0 1 220px;
  margin-bottom: 0;
}
.wo-completed-unlock-banner__status .form-label {
  font-weight: 600;
  color: #1e40af;
}
/* Zaklenjeno: ostrega vsebina, rahlo zatemnjeno; ::after ujame klike (kazalec: nedovoljeno) */
.wo-completed-lock-blur {
  position: relative;
  isolation: isolate;
  user-select: none;
  -webkit-user-select: none;
}
.wo-completed-lock-blur::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(15, 23, 42, 0.08);
  pointer-events: auto;
  cursor: not-allowed;
  z-index: 1;
}
.wo-mf-status-readonly {
  pointer-events: none;
}
.wo-mf-status-readonly-val {
  margin: 0;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-input-bg);
  font-weight: 600;
  color: var(--color-muted);
}
.wo-mf-status-readonly-hint {
  font-size: 0.65rem;
  margin: 0.25rem 0 0;
  line-height: 1.35;
}

.wo-completed-locked-notes {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1rem;
}
.wo-completed-locked-note {
  grid-column: auto;
  margin-top: 0;
}
.wo-readonly-note {
  margin-top: 0.35rem;
  width: 100%;
  resize: vertical;
  cursor: default;
  background: #fff;
  color: var(--color-text);
}
/* Zaključen nalog: večja polja za branje dolgih besedil */
.wo-readonly-note--expand {
  min-height: 7.5rem;
  max-height: 28rem;
  overflow-y: auto;
  line-height: 1.45;
  field-sizing: content;
  min-block-size: 7.5rem;
}
@supports not (field-sizing: content) {
  .wo-readonly-note--expand {
    min-height: 10rem;
  }
}
.wo-work-desc-section--locked .wo-desc-expand summary {
  cursor: pointer;
}
.wo-work-desc-section--locked .wo-desc-expand-body {
  pointer-events: auto;
}
.wo-qr-rules-readonly {
  margin: 0.35rem 0 0;
  padding: 0.5rem 0.65rem;
  border-radius: 0.5rem;
  border: 1.5px solid var(--color-border);
  background: var(--color-input-bg);
  font-size: 0.88rem;
  line-height: 1.4;
}
.wo-desc-expand--qr summary {
  gap: 0.35rem;
}
.wo-qr-chip-badge {
  display: inline-block;
  margin-left: 0.25rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  vertical-align: middle;
}
.wo-qr-chip-badge--off {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}
.wo-qr-book-body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.wo-qr-book-hint {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.4;
}
.wo-qr-toggle {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.55rem 0.7rem;
  border: 1.5px solid #99f6e4;
  border-radius: 0.55rem;
  background: #f0fdfa;
  cursor: pointer;
}
.wo-qr-toggle input {
  margin-top: 0.2rem;
}
.wo-qr-toggle strong {
  display: block;
  font-size: 0.88rem;
}
.wo-qr-toggle-sub {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.75rem;
  line-height: 1.35;
}
.wo-qr-mat-field {
  margin: 0;
}
.wo-desc-expand--qr-hidden {
  border-color: #fde68a;
}
.ws-qr-settings-card {
  padding: 1.35rem 1.5rem;
  border-left: 4px solid #0d9488;
}
.ws-qr-settings-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.ws-qr-settings-card__title {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  font-weight: 700;
}
.ws-qr-settings-card__lead {
  margin: 0;
  font-size: 0.87rem;
  color: #475569;
  line-height: 1.55;
  max-width: 40rem;
}
.ws-qr-settings-opts {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.ws-qr-settings-opt {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  cursor: pointer;
  padding: 0.6rem 0.85rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 0.55rem;
  background: #f8fafc;
}
.ws-qr-settings-opt strong {
  display: block;
  font-size: 0.9rem;
}
.ws-qr-settings-opt__hint {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.8rem;
  color: #6b7280;
  line-height: 1.35;
}
.qr-center-defaults__list {
  margin: 0 0 0.75rem;
  padding-left: 1.2rem;
  font-size: 0.88rem;
  line-height: 1.55;
}
.qr-list-filter--on {
  border-color: #0d9488 !important;
  background: #ccfbf1 !important;
  color: #0f766e !important;
  font-weight: 600;
}
.mat-card--readonly {
  cursor: default;
}
.mat-card--readonly:focus {
  outline: none;
}
.wo-section--materials-locked .mat-card--readonly:hover {
  transform: none;
  box-shadow: inherit;
}
.wo-mat-locked-hint {
  margin-left: auto;
  text-align: right;
  max-width: 14rem;
}

/* Page header */
.wo-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.wo-header-main {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.wo-back-link {
  font-size: 0.82rem;
  color: var(--color-muted);
  font-weight: 500;
  transition: color var(--transition-fast);
}

.wo-back-link:hover {
  color: var(--color-primary);
}

.wo-header-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.wo-code {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--color-text);
  line-height: 1.1;
}

.badge-lg {
  padding: 0.3rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 700;
  border-radius: 999px;
}

.wo-header-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.wo-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--color-muted);
  background: #f0f4fb;
  border: 1px solid #dce6f5;
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
}

/* klikabilna varianta (stranka, vozilo) */
a.wo-meta-chip--link,
.wo-meta-chip.wo-meta-chip--link {
  text-decoration: none;
  transition: background .13s, border-color .13s, color .13s;
}
a.wo-meta-chip--link:hover,
.wo-meta-chip.wo-meta-chip--link:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  color: var(--color-primary-dark);
}

.wo-header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

/* Kompaktna glava delovnega naloga (slika + gosti metapodatki + majhni gumbi) */
.wo-page-header--compact {
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.55rem 0.65rem;
  background: #fff;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 0.85rem;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}

/* Hitra navigacija po nalogu (sidra) */
.wo-jump-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin: -0.35rem 0 0.85rem;
  padding: 0.2rem 0.15rem 0.35rem;
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(180deg, #f4f7fb 70%, rgba(244, 247, 251, 0.85));
}
.wo-jump-nav::-webkit-scrollbar { display: none; }
.wo-more-section-label {
  margin: 0.35rem 0.65rem 0.15rem;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
}
.wo-jump-nav__link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
  font-size: 0.78rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}
.wo-jump-nav__link:hover,
.wo-jump-nav__link:focus-visible {
  border-color: #14b8a6;
  color: #0f766e;
  background: #f0fdfa;
  outline: none;
}
.wo-jump-anchor {
  display: block;
  height: 0;
  width: 0;
  overflow: hidden;
  scroll-margin-top: 3.25rem;
}
#wo-jump-delo,
#wo-jump-materiali {
  scroll-margin-top: 3.25rem;
}
.wo-header-top {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.45rem 0.65rem;
  min-width: 0;
}
.wo-header-media {
  flex-shrink: 0;
  align-self: flex-start;
}
.wo-page-header--compact .wo-header-main {
  flex: 1;
  min-width: 0;
  gap: 0.2rem;
}
.wo-header-photo-link {
  display: block;
  border-radius: 0.65rem;
  overflow: hidden;
  border: 1px solid var(--color-border, #e2e8f0);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}
.wo-header-photo {
  width: clamp(44px, 10vw + 30px, 64px);
  height: clamp(44px, 10vw + 30px, 64px);
  object-fit: cover;
  display: block;
}
.wo-header-photo-placeholder {
  width: clamp(44px, 10vw + 30px, 64px);
  height: clamp(44px, 10vw + 30px, 64px);
  border-radius: 0.65rem;
  border: 1px dashed var(--color-border, #cbd5e1);
  background: var(--color-primary-soft, #eef4ff);
  display: grid;
  place-items: center;
  font-size: clamp(0.95rem, 2.2vw + 0.55rem, 1.35rem);
  color: var(--color-primary, #1f64ff);
}
.wo-page-header--compact .wo-back-link {
  font-size: clamp(0.64rem, 0.32rem + 1.5vw, 0.78rem);
  line-height: 1.25;
}
.wo-page-header--compact .wo-header-title-row {
  gap: 0.35rem;
  align-items: center;
  flex-wrap: wrap;
}
.wo-page-header--compact .wo-code {
  font-size: clamp(0.86rem, 0.5rem + 2.6vw, 1.22rem);
  font-weight: 800;
  line-height: 1.12;
  word-break: break-word;
  min-width: 0;
}
.wo-header-status-badge {
  padding: 0.1em 0.55em;
  font-size: clamp(0.56rem, 0.34rem + 1.05vw, 0.72rem);
  font-weight: 700;
  border-radius: 999px;
  flex-shrink: 0;
}
.wo-header-meta--dense {
  gap: 0.28rem 0.35rem;
}
.wo-page-header--compact .wo-header-meta--dense {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  min-width: 0;
}
.wo-page-header--compact .wo-meta-chip--dense,
.wo-page-header--compact .wo-meta-chip--entity.wo-meta-chip--dense {
  font-size: clamp(0.6rem, 0.38rem + 1.2vw, 0.76rem);
  padding: 0.12em 0.5em;
  max-width: 100%;
  box-sizing: border-box;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.wo-page-header--compact .wo-regplate--header {
  font-size: clamp(0.54rem, 0.32rem + 0.95vw, 0.76rem);
  padding: 0.04em 0.4em;
}
.wo-meta-chip--dense {
  font-size: 0.72rem;
  padding: 0.12rem 0.45rem;
}
.wo-meta-chip--entity.wo-meta-chip--dense {
  font-size: 0.74rem;
  padding: 0.14rem 0.5rem;
}
.wo-entity-edit-btn--dense {
  padding: 0.12em 0.48em;
  font-size: clamp(0.58rem, 0.36rem + 1vw, 0.74rem);
  min-height: 28px;
}
.wo-header-actions--compact-bar {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.28rem;
  overflow: visible;
  width: 100%;
}

/* Zvonček: priporočila + interna v padajočem panelu */
.wo-notes-bell-wrap {
  position: relative;
  flex-shrink: 0;
  z-index: 30;
}
.wo-notes-bell-btn {
  position: relative;
  min-width: 2.35rem;
  min-height: 30px;
  padding: 0.2rem 0.42rem;
  border-radius: 0.45rem;
  line-height: 1;
}
.wo-notes-bell-icon {
  font-size: 1.12rem;
  display: inline-block;
  line-height: 1;
}
.wo-notes-bell-count {
  position: absolute;
  top: -5px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background: #dc2626;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  border-radius: 999px;
  border: 2px solid var(--color-panel);
  box-shadow: 0 0 0 1px rgba(220,38,38,0.35), 0 2px 8px rgba(220,38,38,0.45);
  pointer-events: none;
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
}
.wo-notes-bell-btn--active .wo-notes-bell-count {
  animation: wo-bell-count-pulse 1.4s ease-in-out infinite;
}
@keyframes wo-bell-count-pulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(220,38,38,0.35), 0 2px 8px rgba(220,38,38,0.45); }
  50%       { box-shadow: 0 0 0 3px rgba(220,38,38,0.25), 0 2px 14px rgba(220,38,38,0.7); }
}
.wo-notes-bell-btn--active {
  animation: wo-bell-glow 1.35s ease-in-out infinite;
  background: linear-gradient(165deg, #fff7ed 0%, #ffedd5 35%, #fdba74 100%);
  border: 2px solid #f59e0b !important;
  color: #9a3412;
  outline: 2px solid rgba(251, 146, 60, 0.55);
  outline-offset: 1px;
}
.wo-notes-bell-btn--active .wo-notes-bell-icon {
  filter: drop-shadow(0 0 6px rgba(251, 146, 60, 0.95)) drop-shadow(0 0 12px rgba(245, 158, 11, 0.65));
  animation: wo-bell-icon-shine 1.35s ease-in-out infinite;
}
@keyframes wo-bell-icon-shine {
  0%,
  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 6px rgba(251, 146, 60, 0.95)) drop-shadow(0 0 12px rgba(245, 158, 11, 0.65));
  }
  50% {
    transform: scale(1.08);
    filter: drop-shadow(0 0 10px rgba(254, 215, 170, 1)) drop-shadow(0 0 18px rgba(249, 115, 22, 0.75));
  }
}
@keyframes wo-bell-glow {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.35), 0 0 8px 2px rgba(251, 146, 60, 0.25);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.2), 0 0 22px 8px rgba(251, 146, 60, 0.55),
      0 0 32px 6px rgba(245, 158, 11, 0.35);
  }
}
@media (prefers-reduced-motion: reduce) {
  .wo-notes-bell-btn--active,
  .wo-notes-bell-btn--active .wo-notes-bell-icon,
  .wo-notes-bell-btn--active .wo-notes-bell-count {
    animation: none;
  }
  .wo-notes-bell-btn--active {
    box-shadow: 0 0 16px 4px rgba(251, 146, 60, 0.45);
  }
}
.wo-notes-bell-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10040;
  background: transparent;
  cursor: default;
}
.wo-notes-bell-panel {
  max-height: min(70vh, 420px);
  overflow-y: auto;
  padding: 0.75rem 0.85rem;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 0.65rem;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.14);
  box-sizing: border-box;
}
.wo-notes-bell-panel--floating {
  position: fixed;
  margin: 0;
  z-index: 10050;
  min-width: 0;
}
.wo-notes-bell-block {
  padding: 0.65rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.88rem;
  line-height: 1.5;
  margin-bottom: 0.55rem;
}
.wo-notes-bell-block:last-child {
  margin-bottom: 0;
}
.wo-notes-bell-block--rec {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 4px solid #d97706;
  color: #78350f;
}
.wo-notes-bell-block--int {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 4px solid #dc2626;
  color: #7f1d1d;
}
.wo-notes-bell-block-title {
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}
.wo-notes-bell-text {
  word-break: break-word;
}
.wo-notes-resolve {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #0f766e;
  cursor: pointer;
  user-select: none;
}
.wo-notes-resolve input {
  width: 1rem;
  height: 1rem;
  accent-color: #0d9488;
  cursor: pointer;
}
.wo-notes-bell-empty {
  margin: 0.25rem 0 0;
  font-size: 0.86rem;
  line-height: 1.45;
}
.wo-header-actions-scroll {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.28rem;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.wo-header-actions-scroll::-webkit-scrollbar {
  display: none;
}
/* Avtoshranjevanje + Shrani / Zaključi — pod nalogom, nad slikami */
.wo-detail-primary-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.85rem;
  margin: 1rem 0 0.75rem;
  padding: 0.75rem 0.95rem;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 55%);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 0.85rem;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.045);
}
.wo-detail-primary-actions .wo-autosave-status {
  flex: 1 1 auto;
  min-width: 5rem;
  font-size: 0.78rem;
  color: var(--color-muted, #64748b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wo-detail-primary-actions-btns {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}
.wo-detail-complete-form {
  display: inline-flex;
  margin: 0;
  vertical-align: middle;
}
.wo-detail-save-btn,
.wo-detail-complete-btn {
  white-space: nowrap;
  font-family: var(--font-sans);
  font-weight: 600;
}

@media (max-width: 640px) {
  .wo-detail-primary-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .wo-detail-primary-actions .wo-autosave-status {
    text-align: center;
    max-width: none;
  }
  .wo-detail-primary-actions-btns {
    width: 100%;
    flex-direction: column;
  }
  .wo-detail-complete-form {
    width: 100%;
    display: flex;
  }
  .wo-detail-save-btn,
  .wo-detail-complete-form .wo-detail-complete-btn {
    width: 100%;
    min-height: 44px;
  }
}
.wo-header-actions--compact-bar .wo-header-act {
  flex: 0 0 auto;
  white-space: nowrap;
  min-height: clamp(28px, 6vw, 32px);
  padding: 0.18em 0.42em;
  font-size: clamp(0.62rem, 0.4rem + 1.15vw, 0.75rem);
  font-weight: 600;
}
.wo-header-actions-more {
  margin-left: auto;
  flex-shrink: 0;
  position: relative;
  z-index: 25;
}
.wo-header-more-btn.wo-more-btn {
  min-width: 1.9rem;
  min-height: 30px;
  font-size: 1.05rem;
  line-height: 1;
  padding: 0.18rem 0.32rem;
}
.wo-header-more-dropdown.wo-more-dropdown {
  right: 0;
  left: auto;
  z-index: 400;
}

/* Layout: form + sidebar */
.wo-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 18vw);
  gap: clamp(0.65rem, 1.5vw, 1rem);
  align-items: start;
}

.wo-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Section cards */
.wo-section {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  padding: var(--panel-pad-y) var(--panel-pad-x);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.wo-section-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.1rem;
}

.wo-section-icon {
  width: 36px;
  height: 36px;
  border-radius: 0.55rem;
  background: var(--color-primary-soft);
  display: grid;
  place-items: center;
  font-size: 1rem;
  flex-shrink: 0;
  cursor: default;
  position: relative;
  /* CSS tooltip */
  transition: background-color var(--transition-fast);
}

.wo-section-icon:hover {
  background: #d6e6ff;
}

/* Tooltip via title attribute — styled with ::after */
.wo-section-icon[title]:hover::after {
  content: attr(title);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: #1e293b;
  color: #f1f5f9;
  font-size: 0.77rem;
  font-weight: 500;
  white-space: nowrap;
  padding: 0.3rem 0.65rem;
  border-radius: 0.45rem;
  pointer-events: none;
  z-index: 20;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  font-family: var(--font-sans);
}

.wo-section-head h2 {
  margin: 0;
  font-size: 0.97rem;
  font-weight: 700;
  color: var(--color-text);
  flex: 1;
}

.wo-section-head .btn-primary.btn-sm {
  margin-left: auto;
  flex-shrink: 0;
}

/* Field grids */
.wo-fields-grid {
  display: grid;
  gap: 0.85rem;
}

.wo-fields-2col {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.wo-fields-4col {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

/* ── Compact combined form panel ──────────────────────── */
.wo-form-compact {
  padding: 0;
  overflow: visible;
}

.wo-compact-group {
  padding: 0.85rem var(--panel-pad-x);
}

.wo-compact-divider {
  height: 1px;
  background: var(--color-border);
  margin: 0;
}

/* Oznaka sekcije znotraj compact grupe */
.wo-group-label {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* ── Header: "Več možnosti" dropdown ─────────────────── */
.wo-actions-more {
  position: relative;
}

.wo-more-btn {
  font-size: 1.35rem;
  line-height: 1;
  padding: 0.25rem 0.55rem;
  border-radius: 0.55rem;
  letter-spacing: 0.05em;
}

.wo-more-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 0.85rem;
  box-shadow: 0 12px 36px rgba(15,23,42,0.13);
  min-width: 210px;
  max-width: min(320px, calc(100vw - 1.5rem));
  padding: 0.35rem;
  z-index: 200;
}

.wo-more-divider {
  height: 1px;
  margin: 0.25rem 0.4rem;
  background: var(--color-border, #e2e8f0);
  border: none;
}

/* Zložljiv »Podatki naloga« v meniju ⋯ */
.wo-more-accordion {
  margin: 0;
  border-radius: 0.55rem;
  overflow: hidden;
}
.wo-more-accordion > summary.wo-more-accordion-sum {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.8rem;
  border-radius: 0.55rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  list-style: none;
  font-family: inherit;
  transition: background-color var(--transition-fast);
}
.wo-more-accordion > summary.wo-more-accordion-sum::-webkit-details-marker {
  display: none;
}
.wo-more-accordion > summary.wo-more-accordion-sum::after {
  content: "▸";
  margin-left: auto;
  font-size: 0.65rem;
  opacity: 0.5;
}
.wo-more-accordion[open] > summary.wo-more-accordion-sum::after {
  content: "▾";
}
.wo-more-accordion > summary.wo-more-accordion-sum:hover {
  background-color: rgba(31, 100, 255, 0.07);
}
.wo-more-accordion-body {
  padding: 0 0.65rem 0.65rem;
  border-top: 1px solid var(--color-border, #e2e8f0);
}
.wo-more-meta-hint {
  font-size: 0.68rem;
  margin: 0.45rem 0 0.35rem;
  line-height: 1.35;
}
.wo-info-rows--dropdown {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8rem;
}
.wo-info-rows--dropdown > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
}
.wo-info-rows--dropdown .muted {
  font-size: 0.72rem;
}
.wo-qr-wrap--dropdown {
  margin-top: 0.55rem;
}
.wo-qr-wrap--dropdown > summary {
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-primary, #1f64ff);
  list-style: none;
  padding: 0.25rem 0;
}
.wo-qr-wrap--dropdown > summary::-webkit-details-marker {
  display: none;
}
.wo-qrcode-host {
  margin: 0.45rem auto 0;
  width: 140px;
  min-height: 0;
}

.wo-more-item,
a.wo-more-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.8rem;
  border-radius: 0.55rem;
  font-size: 0.88rem;
  color: var(--color-text);
  border: none;
  background: none;
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--transition-fast);
  font-family: inherit;
}

.wo-more-item:hover,
a.wo-more-item:hover {
  background-color: rgba(31,100,255,0.07);
}

.wo-more-item:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Entiteta v glavi naloga (stranka / vozilo) ─────── */
.wo-meta-chip--entity {
  font-size: 0.92rem;
  padding: 0.25rem 0.85rem;
  background: #e8f0fe;
  border-color: #bdd0fb;
  font-weight: 600;
}
.wo-meta-chip--entity strong {
  color: var(--color-primary-dark, #1a56db);
}
.wo-regplate {
  display: inline-block;
  background: #1e293b;
  color: #fff;
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  padding: 0.05rem 0.45rem;
  border-radius: 0.3rem;
  vertical-align: baseline;
}
.wo-entity-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-primary, #1f64ff);
  background: none;
  border: 1px solid rgba(31, 100, 255, 0.3);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  cursor: pointer;
  transition: background 0.15s;
}
.wo-entity-edit-btn:hover {
  background: rgba(31, 100, 255, 0.07);
}
@media (max-width: 640px) {
  .wo-entity-edit-lbl { display: none; }
}

/* ── Stranka/vozilo — collapsible details sekci ja ──── */
.wo-entity-details {
  padding: 0;
}
.wo-entity-details > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem var(--panel-pad-x);
  cursor: pointer;
  list-style: none;
  gap: 1rem;
}
.wo-entity-summary--compact {
  padding: 0.45rem 0.75rem !important;
  gap: 0.5rem;
}
.wo-entity-summary-compact-text {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-muted, #64748b);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.wo-entity-summary--compact .wo-entity-summary-hint {
  font-size: 0.7rem;
  font-weight: 600;
}
.wo-entity-details > summary::-webkit-details-marker {
  display: none;
}
.wo-entity-summary-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  flex-wrap: wrap;
}
.wo-entity-sep {
  color: var(--color-muted, #94a3b8);
}
.wo-entity-summary-hint {
  font-size: 0.75rem;
  color: var(--color-primary, #1f64ff);
  white-space: nowrap;
}
.wo-entity-details[open] > summary {
  border-bottom: 1px solid var(--color-border, #e2e8f0);
}
.wo-entity-details > summary ~ * {
  padding: 0.85rem var(--panel-pad-x);
}

/* Termin · plan · status — zložljivo kot stranka/vozilo */
.wo-order-meta-details > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  list-style: none;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.wo-order-meta-details > summary::-webkit-details-marker { display: none; }
.wo-order-meta-details[open] > summary {
  border-bottom: 1px solid var(--color-border, #e2e8f0);
}
.wo-order-meta-details > summary ~ * {
  padding: 0.55rem 0.75rem 0.75rem;
}
.wo-order-meta-summary-chips {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  flex: 1 1 auto;
  min-width: 0;
}
.wo-order-meta-summary .wo-entity-summary-hint {
  margin-left: auto;
}
.wo-meta-chip--muted {
  opacity: 0.65;
  font-weight: 500;
}

/* ── Inline sidebar (dobiček + nevarne akcije) ───── */
/* Eno pod drugim: na širokem zaslonu 2×1fr mreža + overflow-x:hidden na body je odrezala
   desni stolpec (npr. »Zaključi in izdaj račun«). Flex stolpec = vedno viden kot na mobilniku. */
.wo-inline-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
  width: 100%;
  min-width: 0;
}
.wo-inline-sidebar .wo-calc,
.wo-inline-sidebar .wo-info-card {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.wo-inline-sidebar .wo-section--photos {
  width: 100%;
}
.wo-photos-section-head {
  margin-bottom: 0.45rem;
}
.wo-photos-section-title {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
}
.wo-photos-section-hint {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.35;
}

/* 6-col: stranka, vozilo, status, prioriteta, vrsta, tehnik */
.wo-compact-6col {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.65rem;
}

/* 4-col: termini + ure */
.wo-compact-4col {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}

.wo-compact-3col {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.wo-compact-1col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

.wo-service-type-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  margin-top: 0.35rem;
}

.wo-type-picker-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.45rem 0.6rem;
}
.wo-type-preset-select {
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
}
.wo-type-add-btn {
  flex-shrink: 0;
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.25rem 0.55rem;
}

/* Plan dela: najprej datumi, nato vrsta servisa; prioriteta v svoji vrstici */
.wo-plan-datetime-grid .wo-plan-priority-field,
.wo-duration-fields--plan .wo-plan-priority-field {
  grid-column: 1 / -1;
}
.wo-plan-service-type-field {
  margin-top: 0.45rem;
  margin-bottom: 0;
}
.wo-plan-term-section .wo-plan-duration-highlight {
  margin-bottom: 0;
}

@media (max-width: 640px) {
  .wo-plan-workflow .wo-plan-duration-highlight {
    padding: 0.5rem 0.55rem;
  }
  .wo-plan-workflow .form-field > .form-label {
    font-size: 0.74rem;
  }
  .wo-plan-workflow .input-field,
  .wo-plan-workflow select.input-field {
    font-size: 0.84rem;
    padding: 0.38rem 0.5rem;
  }
  .wo-plan-workflow .pick-slot-btn {
    font-size: 0.68rem;
    padding: 0.22rem 0.45rem;
    margin-top: 0.25rem;
  }
  .wo-plan-workflow .wo-plan-duration-hint {
    font-size: 0.72rem;
    margin-bottom: 0.4rem;
  }
  .wo-plan-term-section .wo-plan-duration-highlight {
    padding: 0.42rem 0.48rem;
  }
  .wo-plan-term-section .wo-compact-row .input-field,
  .wo-plan-term-section .wo-compact-row select.input-field {
    font-size: 0.8rem;
    padding: 0.3rem 0.45rem;
    height: auto;
    min-height: 32px;
  }
  .wo-plan-term-section .form-label {
    font-size: 0.68rem;
  }
}

/* ── Delovni nalog: kompakten blok termin + ure + vrsta + status ── */
.wo-order-meta-compact {
  padding: 0.65rem 0.85rem !important;
}
.wo-order-meta-compact .wo-compact-group {
  padding: 0.35rem 0.45rem;
}
.wo-group-label--dense {
  font-size: 0.72rem;
  margin-bottom: 0.2rem;
  letter-spacing: 0.04em;
}
.wo-plan-duration-highlight.wo-plan-duration-highlight--dense {
  padding: 0.35rem 0.45rem;
  margin: 0;
  border-radius: 0.5rem;
}
.wo-plan-duration-highlight.wo-plan-duration-highlight--dense.wo-plan-duration-highlight--on {
  padding: 0.42rem 0.5rem;
}
.wo-plan-duration-hint--dense {
  font-size: 0.66rem;
  color: #166534;
  margin: 0 0 0.3rem;
  line-height: 1.3;
}
.wo-order-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.32rem 0.42rem;
  align-items: end;
}
.wo-mf-span-type {
  grid-column: 1 / -1;
}
.wo-order-meta-compact .wo-mf-mini > .form-label {
  font-size: 0.62rem;
  margin-bottom: 0.06rem;
  line-height: 1.15;
}
.wo-type-picker-row--dense {
  gap: 0.28rem;
}
.wo-type-picker-row--dense .wo-type-preset-select {
  flex: 1;
  min-width: 0;
  font-size: 0.78rem;
}
.wo-type-picker-row--dense .wo-type-add-btn {
  padding: 0.18rem 0.42rem;
  font-size: 0.95rem;
  min-height: 30px;
}
.wo-mat-save-dot {
  font-size: 0.62rem;
  margin-left: 0.15rem;
  vertical-align: middle;
}

.wo-section-head--mat-actions {
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.7rem;
  align-items: center;
}
.wo-section-head--mat-actions h2 {
  flex: 1 1 auto;
  min-width: 120px;
}
.wo-mat-quick-actions {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
  margin-left: auto;
}
.wo-mat-ai-shortcut {
  white-space: nowrap;
  font-weight: 600;
  font-size: 0.76rem;
  padding: 0.32rem 0.5rem;
  border-radius: 0.45rem;
}

@media (max-width: 900px) {
  .wo-order-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .wo-mf-assigned {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .wo-page .wo-section:not(.wo-section--materials) {
    padding: 0.5rem 0.6rem;
    border-radius: 0.65rem;
    margin-bottom: 0.45rem;
  }
  .wo-order-meta-compact {
    padding: 0.45rem 0.5rem !important;
  }
  .wo-order-meta-compact .wo-compact-group {
    padding: 0.25rem 0.3rem;
  }
  .wo-order-meta-hint {
    font-size: 0.6rem !important;
    line-height: 1.3 !important;
    margin-top: 0 !important;
    margin-bottom: 0.3rem !important;
  }
  .wo-order-meta-compact .input-field,
  .wo-order-meta-compact select.input-field {
    font-size: 16px;
    padding: 0.28rem 0.38rem;
    min-height: 38px;
  }
  .wo-plan-duration-highlight.wo-plan-duration-highlight--dense {
    padding: 0.28rem 0.32rem;
  }
  .wo-group-label--dense {
    font-size: 0.65rem;
  }
  .wo-order-meta-compact .wo-mf-mini > .form-label {
    font-size: 0.58rem;
  }
  /* Material: gostejše kartice */
  .wo-section--materials #mat-cards-list {
    padding: 0.4rem 0.45rem 0.55rem;
    gap: 0.4rem;
  }
  .wo-section--materials .mat-card {
    padding: 0.5rem 0.55rem;
    gap: 0.25rem;
    border-radius: 0.55rem;
  }
  .wo-section--materials .mat-card-desc {
    font-size: 0.86rem;
    line-height: 1.28;
  }
  .wo-section--materials .mat-card-total {
    font-size: 0.86rem;
  }
  .wo-section--materials .mat-card-qty {
    font-size: 0.68rem;
    padding: 0.05rem 0.4rem;
  }
  .wo-section--materials .mat-card-meta {
    font-size: 0.72rem;
    gap: 0.35rem;
  }
  .wo-section--materials .mat-card-row2 {
    gap: 0.45rem;
  }
  .wo-section-head--mat-actions {
    margin-bottom: 0.45rem;
  }
  .wo-section-head--mat-actions .wo-section-icon {
    width: 30px;
    height: 30px;
    font-size: 0.82rem;
  }
  .wo-section-head--mat-actions h2 {
    font-size: 0.78rem;
  }
  .wo-mat-quick-actions .btn-sm {
    font-size: 0.74rem;
    padding: 0.32rem 0.45rem;
  }
  .wo-mat-ai-shortcut {
    font-size: 0.72rem;
    padding: 0.3rem 0.42rem;
  }
  /* Opis dela — nižji textareas, ostane 16px */
  .wo-page .wo-form-compact textarea.input-field {
    min-height: 48px;
    padding: 0.4rem 0.5rem;
    line-height: 1.35;
  }
  .wo-page .wo-work-desc-section textarea.input-field {
    min-height: 0 !important;
    padding: 0.35rem 0.45rem;
  }
  .wo-page .wo-reading-section .input-field {
    min-height: 36px;
  }

  /* Glava naloga — polna širina, večji dotik */
  .wo-page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    margin-bottom: 0.85rem;
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
  }
  .wo-header-main {
    min-width: 0;
  }
  .wo-header-title-row {
    gap: 0.5rem;
  }
  .wo-code {
    font-size: 1.22rem;
  }
  .wo-header-meta {
    gap: 0.35rem;
  }
  a.wo-meta-chip--link,
  .wo-meta-chip {
    min-height: 40px;
    padding: 0.28rem 0.65rem;
    font-size: 0.8rem;
  }
  .wo-entity-edit-btn {
    min-height: 40px;
    padding: 0.25rem 0.55rem;
  }
  .wo-header-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
    width: 100%;
    gap: 0.4rem;
    align-items: stretch;
  }
  .wo-header-actions > .btn-primary,
  .wo-header-actions > .btn-secondary {
    min-height: 44px;
    font-size: 0.82rem;
    padding: 0.45rem 0.55rem;
  }
  .wo-header-actions .wo-actions-more {
    grid-column: span 1;
  }
  .wo-header-actions .wo-more-btn {
    width: 100%;
    min-height: 44px;
    font-size: 1.25rem;
  }
  .wo-header-actions .wo-header-photo-slot {
    grid-column: 1 / -1;
    margin-left: 0 !important;
    justify-content: center;
  }

  /* Kompaktna glava: ena vrstica gumbov + drsanje (ne mreža 3+⋯) */
  .wo-page-header--compact {
    padding-left: max(0.45rem, env(safe-area-inset-left, 0));
    padding-right: max(0.45rem, env(safe-area-inset-right, 0));
    margin-bottom: 0.65rem;
  }
  .wo-header-actions.wo-header-actions--compact-bar {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    width: 100%;
    grid-template-columns: unset !important;
    align-items: center;
    gap: 0.28rem;
  }
  .wo-header-actions--compact-bar .wo-header-act {
    min-height: 30px !important;
    font-size: 0.7rem !important;
    padding: 0.18rem 0.38rem !important;
  }
  .wo-header-actions--compact-bar .wo-header-more-btn.wo-more-btn {
    width: auto !important;
    min-height: 30px !important;
    min-width: 1.85rem !important;
  }
  .wo-page-header--compact .wo-meta-chip--dense,
  .wo-page-header--compact a.wo-meta-chip--link.wo-meta-chip--dense {
    min-height: 0 !important;
  }
  .wo-page-header--compact .wo-entity-edit-btn--dense {
    min-height: 28px !important;
    padding: 0.1rem 0.4rem !important;
  }

  /* Mobil: fotka vozila kot ozadje pod blokom »Stranka in vozilo« (ne majhna sličica v glavi) */
  .wo-page--veh-header-photo .wo-page-header--compact .wo-header-media {
    display: none !important;
  }
  .wo-page .wo-entity-details.wo-entity-details--veh-photo-bg {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    /* Drugače modri gradient (!important) prekrije ::before s fotko */
    background: transparent !important;
  }
  .wo-page .wo-entity-details.wo-entity-details--veh-photo-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: inherit;
    background-color: #eef4ff;
    background-image: var(--wo-veh-photo-url);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.88;
    pointer-events: none;
  }
  .wo-page .wo-entity-details.wo-entity-details--veh-photo-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(
      160deg,
      rgba(255, 255, 255, 0.42) 0%,
      rgba(220, 233, 255, 0.38) 45%,
      rgba(238, 244, 255, 0.48) 100%
    );
  }
  .wo-page .wo-entity-details.wo-entity-details--veh-photo-bg > summary,
  .wo-page .wo-entity-details.wo-entity-details--veh-photo-bg > .wo-compact-group {
    position: relative;
    z-index: 1;
  }
  /* Berljivost nad fotko — delovni nalog / stranka+vozilo */
  .wo-page .wo-entity-details.wo-entity-details--veh-photo-bg .wo-entity-summary.wo-entity-summary--compact {
    color: #0f172a;
    font-weight: 800;
    text-shadow:
      0 0 0.35em rgba(255, 255, 255, 1),
      0 0 0.65em rgba(255, 255, 255, 0.95),
      0 0.05em 0.1em rgba(255, 255, 255, 0.98);
  }
  .wo-page .wo-entity-details.wo-entity-details--veh-photo-bg .form-label {
    color: #0f172a !important;
    font-weight: 700;
    text-shadow: 0 0 0.3em rgba(255, 255, 255, 1), 0 0 0.5em rgba(255, 255, 255, 0.9);
  }
  .wo-page .wo-entity-details.wo-entity-details--veh-photo-bg .input-field,
  .wo-page .wo-entity-details.wo-entity-details--veh-photo-bg select.input-field {
    background: rgba(255, 255, 255, 0.96) !important;
    border-color: rgba(15, 23, 42, 0.22) !important;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1);
    color: #0f172a;
    font-weight: 600;
  }

  /* Mreža dobička — ostane 3×2, gostejše */
  .wo-calc {
    padding: 0.65rem 0.7rem;
  }
  .wo-calc-head {
    margin-bottom: 0.5rem;
    padding-bottom: 0.4rem;
  }
  .wo-calc-head h3 {
    font-size: 0.78rem;
  }
  .wo-calc-grid {
    gap: 0.32rem;
  }
  .wo-calc-tile {
    padding: 0.38rem 0.4rem;
  }
  .wo-calc-tile-label {
    font-size: 0.62rem;
  }
  .wo-calc-tile-val {
    font-size: 0.82rem;
  }
  .wo-calc-tile--rvc .wo-calc-tile-val {
    font-size: 0.92rem;
  }
  .wo-inline-sidebar {
    gap: 0.65rem;
    margin-top: 1rem;
  }
  .wo-inline-sidebar .wo-info-card {
    padding: 0.75rem 0.85rem;
  }
  .wo-delete-nalog-code {
    flex: 1 1 140px;
    max-width: none;
  }

  /* Opis dela — tipke za razširitev, lažji dotik */
  .wo-desc-expand--chip > summary {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

.wo-plan-duration-highlight {
  border-radius: 0.65rem;
  padding: 0.5rem 0.65rem 0.65rem;
  margin: 0.25rem 0 0;
  border: 1px solid transparent;
  background: transparent;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.wo-plan-duration-highlight--on {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.12) 0%, rgba(59, 130, 246, 0.1) 100%);
  border-color: rgba(34, 197, 94, 0.45);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.12);
}
.wo-plan-duration-hint {
  font-size: 0.78rem;
  color: #166534;
  margin: 0 0 0.5rem;
  line-height: 1.35;
}

.wo-st-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1300;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.wo-st-modal-box {
  background: #fff;
  border-radius: 0.85rem;
  padding: 1.1rem 1.25rem;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
}
.wo-st-modal-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}
.wo-st-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* 2x2: textareas */
.wo-compact-2col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

/* Compact form labels */
.wo-form-compact .form-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8899b8;
  margin-bottom: 0.15rem;
}

/* Compact inputs & selects */
.wo-form-compact .input-field,
.wo-form-compact select.input-field,
.wo-form-compact input.input-field {
  padding: 0.35rem 0.55rem;
  font-size: 0.865rem;
  height: 34px;
}

.wo-order-meta-compact.wo-form-compact .input-field,
.wo-order-meta-compact.wo-form-compact select.input-field,
.wo-order-meta-compact.wo-form-compact input.input-field {
  height: auto;
  min-height: 30px;
  padding: 0.26rem 0.38rem;
  font-size: 0.8rem;
}

/* Compact textareas */
.wo-form-compact textarea.input-field {
  height: auto;
  min-height: 62px;
  padding: 0.4rem 0.55rem;
  font-size: 0.865rem;
  resize: vertical;
}

/* Stanje km/ure in naslednji servis */
.wo-reading-section { background: linear-gradient(180deg, rgba(34, 197, 94, 0.06), transparent); }
.wo-reading-hint { font-size: 0.8rem; color: var(--color-muted); margin: 0 0 0.65rem; line-height: 1.4; }
.wo-reading-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.6rem 1rem; }
.wo-reading-summary { margin-top: 0.5rem; padding: 0.5rem 0.65rem; background: rgba(34, 197, 94, 0.08); border-radius: 0.5rem; font-size: 0.82rem; display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; }
.wo-reading-summary span { color: var(--color-text); }

/* Stanje pod postavkami materiala — kompaktno */
.wo-reading-below-mat {
  margin-top: 0.65rem;
  padding: 0.45rem 0.55rem 0.5rem;
  border-top: 1px solid var(--color-border, rgba(0, 0, 0, 0.08));
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.04), transparent);
  border-radius: 0 0 0.5rem 0.5rem;
}
.wo-reading-below-mat .wo-group-label--dense { margin-bottom: 0.25rem; font-size: 0.72rem; }
.wo-reading-fields--dense {
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 0.3rem 0.55rem;
}
.wo-reading-below-mat .form-label { font-size: 0.68rem; }
.wo-reading-below-mat .input-field {
  font-size: 0.78rem;
  padding: 0.22rem 0.4rem;
  min-height: 0;
}
.wo-reading-summary--dense {
  margin-top: 0.3rem;
  padding: 0.3rem 0.45rem;
  font-size: 0.7rem;
  gap: 0.45rem 0.75rem;
}
.wo-km-quick--dense {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.45rem;
  margin-top: 0.05rem;
}
.wo-km-quick-hint { font-size: 0.65rem; color: var(--color-muted); }

/* Stanje km / naslednji servis — ena vrstica polj + ožji povzetek */
.wo-reading-below-mat--tight {
  margin-top: 0.45rem;
  padding: 0.28rem 0.42rem 0.32rem;
}
.wo-compact-group--reading-tight {
  padding: 0.22rem 0.32rem 0.28rem;
}
.wo-reading-tight-head {
  margin-bottom: 0.15rem !important;
  font-size: 0.66rem !important;
}
.wo-reading-line {
  display: grid;
  gap: 0.2rem 0.38rem;
  align-items: end;
}
/* Vrstica 1: trenutne km | naslednji servis km | datum; vrstica 2: +15k / +20k … (ne »vmes« datumom) */
.wo-reading-line--km {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(10rem, 1.25fr);
  grid-template-rows: auto auto;
  align-items: end;
}
.wo-reading-line--km > .wo-reading-cell:nth-child(1) {
  grid-column: 1;
  grid-row: 1;
}
.wo-reading-line--km > .wo-reading-cell:nth-child(2) {
  grid-column: 2;
  grid-row: 1;
}
.wo-reading-line--km > .wo-reading-cell--date {
  grid-column: 3;
  grid-row: 1;
}
.wo-reading-line--km > .wo-reading-quick {
  grid-column: 1 / -1;
  grid-row: 2;
  justify-content: flex-start;
  padding-top: 0.15rem;
}
/* Ure: vrstica 1 = stanje | naslednji ob urah; 2 = +h gumbi; 3 = datum */
.wo-reading-line--hours {
  grid-template-columns: minmax(5rem, 1fr) minmax(5rem, 1fr) minmax(9rem, 1.35fr);
  grid-template-rows: auto auto auto;
}
.wo-reading-line--hours > .wo-reading-cell:nth-child(1) {
  grid-column: 1;
  grid-row: 1;
}
.wo-reading-line--hours > .wo-reading-cell:nth-child(2) {
  grid-column: 2;
  grid-row: 1;
}
.wo-reading-line--hours > .wo-reading-quick--hours {
  grid-column: 1 / -1;
  grid-row: 2;
  justify-content: flex-start;
  padding-top: 0.12rem;
}
.wo-reading-line--hours > .wo-reading-cell--date {
  grid-column: 1 / -1;
  grid-row: 3;
}
.wo-reading-date-field-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}
.wo-reading-date-field-row input[type="date"].input-field {
  flex: 1 1 9rem;
  min-width: 0;
}
.wo-reading-date-field-row .wo-next-svc-date-6mo {
  flex: 0 0 auto;
  font-weight: 800;
  font-size: 0.82rem;
  padding: 0.2rem 0.55rem;
  min-height: 34px;
}
.wo-h-interval-input {
  width: 6.75rem;
  min-width: 5.25rem;
  max-width: 8rem;
  box-sizing: border-box;
}
.wo-h-next-offset {
  font-size: 0.72rem;
  font-weight: 700;
  color: #0f766e;
  border-color: #5eead4;
  background: #ecfdf5;
}
.wo-reading-below-mat--tight .wo-reading-cell .form-label {
  font-size: 0.58rem;
  margin-bottom: 0.05rem;
}
.wo-reading-below-mat--tight .wo-reading-cell .input-field {
  font-size: 0.72rem;
  padding: 0.14rem 0.3rem;
  min-height: 28px;
}
.wo-reading-quick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.1rem 0.18rem;
  padding-bottom: 0.04rem;
}
.wo-reading-quick .wo-km-quick-hint {
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--color-muted);
  margin-right: 0.04rem;
}
.wo-reading-below-mat--tight .wo-reading-quick .btn-ghost.btn-sm {
  padding: 0.06rem 0.2rem;
  font-size: 0.56rem;
  min-height: 22px;
  line-height: 1.15;
}
.wo-reading-quick .wo-km-interval-input {
  width: 6.25rem;
  min-width: 5rem;
  max-width: 8rem;
  box-sizing: border-box;
  font-size: 0.72rem;
  padding: 0.14rem 0.28rem;
  min-height: 28px;
}
.wo-reading-below-mat--tight .wo-reading-quick .wo-km-interval-input {
  min-height: 22px;
  font-size: 0.56rem;
  padding: 0.06rem 0.22rem;
}
.wo-reading-summary--strip {
  margin-top: 0.12rem;
  padding: 0.12rem 0.3rem;
  font-size: 0.6rem;
  line-height: 1.2;
  gap: 0.25rem 0.5rem;
  border-radius: 0.32rem;
}
@media (max-width: 620px) {
  .wo-reading-line--km {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
  }
  .wo-reading-line--km > .wo-reading-cell:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
  }
  .wo-reading-line--km > .wo-reading-cell:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
  }
  .wo-reading-line--km > .wo-reading-quick {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
  }
  .wo-reading-line--km > .wo-reading-cell--date {
    grid-column: 1 / -1;
    grid-row: 3;
  }
  .wo-reading-line--hours {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
  }
  .wo-reading-line--hours > .wo-reading-cell:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
  }
  .wo-reading-line--hours > .wo-reading-cell:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
  }
  .wo-reading-line--hours > .wo-reading-quick--hours {
    grid-column: 1 / -1;
    grid-row: 2;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.08rem 0.1rem;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding-top: 0.08rem;
    padding-bottom: 0.12rem;
    margin-left: -0.1rem;
    margin-right: -0.1rem;
    padding-left: 0.1rem;
    padding-right: 0.1rem;
    scrollbar-width: thin;
  }
  .wo-reading-line--hours > .wo-reading-quick--hours .wo-km-quick-hint {
    flex: 0 0 auto;
    margin-right: 0;
  }
  .wo-reading-line--hours > .wo-reading-quick--hours .btn-ghost.btn-sm {
    flex: 0 0 auto;
    padding: 0.04rem 0.14rem;
    font-size: 0.5rem;
    min-height: 24px;
    line-height: 1.1;
  }
  .wo-reading-line--hours > .wo-reading-quick--hours .wo-h-interval-input {
    flex: 0 0 auto;
    width: 4.85rem;
    min-width: 4.25rem;
    max-width: 5.5rem;
    padding: 0.08rem 0.22rem;
    font-size: 0.62rem;
    min-height: 26px;
  }
  .wo-reading-line--hours > .wo-reading-cell--date {
    grid-column: 1 / -1;
    grid-row: 3;
  }
  .wo-reading-date-field-row .wo-next-svc-date-6mo {
    font-size: 0.78rem;
    font-weight: 800;
    padding: 0.18rem 0.5rem;
    min-height: 34px;
  }
}

/* Opis dela — višino nastavi JS (2–8 vrstic + drsnik); tipografija odzivna */
.wo-work-desc-section .wo-group-label--dense { margin-bottom: 0.3rem; }
.wo-work-desc-section .wo-work-desc-main.wo-compact-2col {
  gap: clamp(0.55rem, 2.2vw, 1.2rem);
}
.wo-work-desc-section textarea.input-field {
  min-height: 0;
  resize: none;
  line-height: 1.4;
  box-sizing: border-box;
  width: 100%;
  overflow-x: hidden;
}
.wo-work-desc-main textarea.input-field {
  font-size: clamp(0.78rem, 0.28vw + 0.7rem, 0.95rem);
  padding: clamp(0.3rem, 0.9vw, 0.5rem) clamp(0.4rem, 1.1vw, 0.65rem);
}
.wo-desc-expand {
  margin-top: 0.4rem;
  border: 1px solid var(--color-border, rgba(0, 0, 0, 0.1));
  border-radius: 0.45rem;
  background: var(--surface-elevated, rgba(0, 0, 0, 0.02));
}
.wo-desc-expand > summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.32rem 0.5rem;
  color: var(--color-text);
}
.wo-desc-expand > summary::-webkit-details-marker { display: none; }
.wo-desc-expand > summary::after {
  content: "▸";
  float: right;
  font-size: 0.65rem;
  opacity: 0.55;
}
.wo-desc-expand[open] > summary::after { content: "▾"; }
.wo-desc-expand-body {
  padding: 0 0.5rem 0.45rem;
  border-top: 1px solid var(--color-border, rgba(0, 0, 0, 0.06));
}
.wo-desc-expand-body .form-label { font-size: 0.72rem; }
.wo-work-desc-section .wo-desc-expand-body textarea.input-field {
  font-size: clamp(0.74rem, 0.22vw + 0.68rem, 0.88rem);
  padding: 0.32rem 0.48rem;
}

/* Čipi v eni vrstici: flex, desni (QR + Načrt) gredo desno */
.wo-desc-expand-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
  width: 100%;
  align-items: center;
}
.wo-desc-expand-row .wo-desc-expand {
  margin-top: 0;
  flex: 0 0 auto;
}
.wo-desc-expand-row .wo-desc-expand[open] {
  flex: 1 1 100%;
  margin-left: 0 !important;
}
.wo-desc-expand--chip {
  border-radius: 999px;
  border: 1px solid var(--color-border, rgba(0, 0, 0, 0.12));
  background: var(--surface-elevated, rgba(31, 100, 255, 0.04));
}
.wo-desc-expand--chip > summary {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.2rem 0.4rem;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-primary, #1f64ff);
}
.wo-desc-expand--chip > summary::after {
  display: none;
}
.wo-desc-expand--chip .wo-desc-chip-q {
  opacity: 0.45;
  font-weight: 700;
  margin-left: 0.1rem;
}
.wo-desc-expand--chip[open] {
  border-radius: 0.45rem;
  background: var(--surface-elevated, rgba(0, 0, 0, 0.02));
}
.wo-desc-expand--chip[open] > summary {
  color: var(--color-text);
  border-radius: 0.45rem 0.45rem 0 0;
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.68rem;
  padding: 0.28rem 0.45rem;
}
@media (max-width: 520px) {
  .wo-desc-expand-row {
    gap: 0.2rem;
  }
  .wo-desc-expand--chip > summary {
    font-size: 0.52rem;
    padding: 0.16rem 0.2rem;
    letter-spacing: 0.02em;
  }
}

/* Responsive: compact grid breakpoints */
@media (max-width: 1100px) {
  .wo-compact-6col {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .wo-compact-6col,
  .wo-compact-4col,
  .wo-compact-3col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .wo-compact-2col {
    grid-template-columns: 1fr;
  }
}


/* Materials table overrides */
.wo-section--materials .materials-table th {
  background: rgba(31, 100, 255, 0.08);
  color: var(--color-primary);
}

/* ── Material cards list (ena pod drugo = vrstice, ne mreža kvadratkov) ─ */
#mat-cards-list {
  padding: 0.65rem clamp(0.75rem, 2.2vw, 1.5rem) 1rem;
  display: flex;
  flex-direction: column;
  gap: clamp(0.5rem, 1.8vw, 0.95rem);
}

.mat-cards-empty {
  color: var(--color-muted);
  font-size: 0.88rem;
  padding: 0.75rem 0;
  margin: 0;
}

.mat-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  box-sizing: border-box;
  gap: clamp(0.28rem, 0.8vw, 0.42rem);
  padding: clamp(0.65rem, 1.4vw, 0.95rem) clamp(0.7rem, 1.8vw, 1.15rem);
  border-radius: 0.72rem;
  background: #f8fafc;
  border: 1px solid #dbe4f1;
  border-left: 3px solid #bfd4ff;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, border-color 0.15s;
  outline: none;
  position: relative;
}
.mat-card:hover,
.mat-card:focus {
  background: #eef4ff;
  border-color: #b9cdf4;
  box-shadow: 0 0 0 2px rgba(31, 100, 255, 0.12);
}
.mat-card:active {
  background: rgba(31, 100, 255, 0.1);
}

.mat-card-row1 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
}
.mat-card-desc {
  font-weight: 700;
  font-size: clamp(0.86rem, 0.4vw + 0.78rem, 1.06rem);
  color: var(--color-text);
  flex: 1 1 0;
  min-width: 0;
  overflow: visible;
  text-overflow: unset;
  white-space: normal;
  line-height: 1.35;
}
.mat-card-total {
  font-size: clamp(0.86rem, 0.4vw + 0.78rem, 1.06rem);
  font-weight: 800;
  color: #1e40af;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;
  text-align: right;
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
}
.mat-card-total-final {
  color: #1e40af;
  font-weight: 800;
}
.mat-card-total-orig {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 600;
  margin-left: 0.25rem;
}

/* Desna stran row1: količina + skupaj */
.mat-card-row1-right {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  flex-shrink: 0;
}

.mat-card-qty {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  background: var(--color-primary);
  border-radius: 999px;
  padding: 0.08rem 0.55rem;
  white-space: nowrap;
  line-height: 1.4;
}

.mat-qty-unit {
  font-size: 0.7rem;
  font-weight: 600;
  opacity: 0.85;
}

.mat-card-row2 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.mat-card-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: var(--color-muted);
  flex: 1 1 0;
  min-width: 0;
  flex-wrap: wrap;
}
.mat-card-sku {
  background: rgba(0,0,0,0.06);
  border-radius: 0.3rem;
  padding: 0 0.35rem;
  font-size: 0.75rem;
  font-family: monospace;
}
.mat-card-disc {
  color: var(--color-warning, #e67e22);
}
.mat-card-rvc {
  color: var(--color-muted);
}
.mat-card-status {
  flex-shrink: 0;
  font-size: 0.85rem;
}
.mat-card-right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}
.mat-card-date {
  font-size: 0.75rem;
  color: var(--color-muted);
}
.mat-card-note {
  font-size: 0.83rem;
  color: var(--color-muted);
  padding: 0.35rem 0 0.1rem;
  border-top: 1px solid var(--color-border);
  margin-top: 0.25rem;
  font-style: italic;
  overflow: visible;
  text-overflow: unset;
  white-space: normal;
  line-height: 1.35;
}

/* Namizna dodatna vrstica — skrita na mobilnem */
.mat-card-row-desk {
  display: none;
}
@media (min-width: 768px) {
  .mat-card-row-desk {
    display: flex;
    gap: 1rem;
    font-size: 0.82rem;
    color: var(--color-muted);
    padding-top: 0.2rem;
    flex-wrap: wrap;
  }
  .mat-desk-qty   { color: var(--color-text); font-variant-numeric: tabular-nums; }
  .mat-desk-orig  { color: #64748b; }
  .mat-desk-disc  { color: var(--color-warning, #e67e22); }
  .mat-desk-cost  { }
  .mat-desk-marza { color: var(--color-success, #27ae60); }
}
.mat-modal-field--note { margin-top: 0.5rem; }
.mat-modal-field--note textarea { resize: vertical; min-height: 2.5rem; }
.mat-modal-label-opt { font-weight: 400; color: var(--color-muted); font-size: 0.85em; }

/* mat-modal-calc */
.mat-modal-calc {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: rgba(31,100,255,0.05);
  border-radius: 0.5rem;
  font-size: 0.92rem;
}
.mat-modal-calc-label { color: var(--color-muted); }
.mat-modal-calc-val { font-weight: 700; color: var(--color-primary); }
.mat-modal-calc-rvc { color: var(--color-muted); font-size: 0.85rem; }


/* Full-width materials section (outside wo-layout grid) */
.wo-section--fullwidth {
  margin-top: 1.25rem;
  width: 100%;
  border-radius: 0.9rem;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.07);
}

/* ── Invoice detail layout ───────────────────────────── */
.inv-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(288px, 24vw);
  gap: clamp(0.65rem, 1.5vw, 1rem);
  align-items: start;
}

/* Račun / ponudba: večja barvna podlaga (ne samo bele kartice) */
.wo-page > .inv-layout,
.wo-page form#invoice-form > .inv-layout,
.wo-page form#quote-form > .inv-layout {
  padding: clamp(0.85rem, 1.8vw, 1.2rem);
  border-radius: 1rem;
  background: linear-gradient(
    155deg,
    rgba(238, 242, 255, 0.98) 0%,
    rgba(224, 242, 254, 0.72) 42%,
    rgba(236, 253, 245, 0.78) 100%
  );
  border: 1px solid rgba(147, 197, 253, 0.55);
  box-shadow: 0 8px 28px rgba(30, 64, 175, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.inv-main { display: flex; flex-direction: column; gap: 1rem; }

.inv-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: sticky;
  top: 86px;
}

.inv-col-num {
  text-align: right;
  white-space: nowrap;
  width: 100px;
}

.inv-totals {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
}

.inv-total-row {
  display: flex;
  justify-content: space-between;
  gap: 2.5rem;
  font-size: 0.9rem;
  min-width: 280px;
}

.inv-total-row--final {
  font-size: 1.05rem;
  font-weight: 700;
  border-top: 2px solid var(--color-text);
  padding-top: 0.4rem;
  margin-top: 0.15rem;
}

/* Račun (podrobnost): kompaktne postavke — ena vrstica opis + meta, desno znesek */
.inv-detail-lines-wrap {
  overflow-x: visible;
  -webkit-overflow-scrolling: touch;
}
.inv-lines-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.inv-lines-table th,
.inv-lines-table td {
  border-bottom: 1.5px solid var(--color-border);
  padding: 0.55rem 0.65rem;
  vertical-align: top;
}
.inv-lines-table th {
  text-align: left;
  background-color: rgba(31, 100, 255, 0.12);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.inv-lines-th-num {
  text-align: right;
  white-space: nowrap;
  width: 5.5rem;
}
.inv-lines-table tbody tr:nth-child(even) {
  background-color: #fbfdff;
}
.inv-line-stack {
  min-width: 0;
}
.inv-line-title {
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.35;
  margin: 0 0 0.2rem;
}
.inv-line-meta {
  font-size: 0.78rem;
  color: var(--color-muted);
  line-height: 1.45;
  display: flex;
  flex-wrap: wrap;
  gap: 0.12rem 0.28rem;
  align-items: baseline;
}
.inv-line-meta-sep {
  color: #cbd5e1;
  font-weight: 600;
}
.inv-line-sku {
  font-family: ui-monospace, monospace;
  font-weight: 600;
  color: #4338ca;
  font-size: 0.76rem;
}
.inv-line-price-struck {
  text-decoration: line-through;
  color: #94a3b8;
}
.inv-line-disc-badge {
  font-weight: 600;
  color: #b45309;
  font-size: 0.76rem;
}
.inv-line-total-num {
  text-align: right;
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
}
.inv-lines-empty {
  text-align: center;
  color: var(--color-muted);
  padding: 1rem !important;
}
.inv-fill-from-wo-banner {
  margin: 0 0 0.85rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid #bfdbfe;
  border-radius: 0.6rem;
  background: #eff6ff;
}
.inv-fill-from-wo-banner p {
  margin: 0 0 0.55rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #1e3a8a;
}
.inv-fill-from-wo-banner form {
  margin: 0;
}
.inv-fill-from-wo-form {
  margin: 0;
  display: inline-flex;
}

@media (max-width: 640px) {
  .inv-lines-table th,
  .inv-lines-table td {
    padding: 0.45rem 0.5rem;
  }
  .inv-line-title {
    font-size: 0.9rem;
  }
  .inv-line-meta {
    font-size: 0.74rem;
  }
  .inv-line-total-num {
    font-size: 0.92rem;
  }
}

.inv-totals--detail {
  flex-direction: column !important;
  align-items: stretch !important;
  width: 100%;
  max-width: 100%;
}
.inv-totals--detail .inv-total-row {
  width: 100%;
  min-width: 0 !important;
  box-sizing: border-box;
}
.inv-total-row--discount {
  color: #b45309 !important;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 0.5rem;
  padding: 0.45rem 0.55rem !important;
  margin: 0.1rem 0;
}
.inv-total-row--discount strong {
  color: #92400e;
}

.inv-wo-discount-box {
  margin: 0.65rem 0 0.5rem;
  padding: 0.65rem 0.75rem;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fde68a;
  border-radius: 0.55rem;
  font-size: 0.88rem;
}
.inv-wo-discount-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #92400e;
  margin-bottom: 0.45rem;
}
.inv-wo-discount-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 1rem;
  align-items: baseline;
}
.inv-wo-discount-grid strong {
  font-variant-numeric: tabular-nums;
  color: #b45309;
}

.inv-summary-row--discount {
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 0.45rem;
  padding: 0.4rem 0.5rem !important;
  margin-bottom: 0.35rem;
  font-size: 0.88rem;
}
.inv-summary-row--discount strong {
  color: #92400e;
}
.inv-summary-card .inv-summary-row--discount {
  color: #fef9c3;
  background: rgba(15, 23, 42, 0.22);
  border: 1px solid rgba(253, 224, 71, 0.45);
  opacity: 1;
}
.inv-summary-card .inv-summary-row--discount strong {
  color: #fde047;
  font-weight: 800;
}

.inv-payment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem;
  background: #f5f8ff;
  border: 1px solid #dce6ff;
  border-radius: 0.55rem;
}

.inv-payment-amount {
  font-weight: 700;
  font-size: 0.95rem;
  color: #047857;
}

.inv-payment-meta {
  font-size: 0.78rem;
  color: var(--color-muted);
}

.inv-status-desc {
  font-size: .85rem;
  color: var(--color-text);
  margin: .2rem 0 .4rem;
  line-height: 1.45;
}

/* Pošlji račun — možnosti pod naslovom, polna širina stranskega stolpca */
.inv-email-send-wrap {
  width: 100%;
}
.inv-email-send-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}
.inv-email-options-hint {
  margin: 0 0 0.15rem;
  line-height: 1.35;
}
.inv-email-options {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  width: 100%;
}
.inv-email-opt {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0;
  padding: 0.45rem 0.55rem;
  border-radius: 0.5rem;
  border: 1px solid var(--color-border);
  background: #f8fafc;
  cursor: pointer;
  transition: background 0.12s ease;
}
.inv-email-opt:hover {
  background: #f1f5f9;
}
.inv-email-opt input {
  margin-top: 0.2rem;
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  accent-color: var(--color-primary, #1f64ff);
}
.inv-email-opt-text {
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--color-text);
  flex: 1;
  min-width: 0;
}
.inv-email-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin-top: 0.25rem;
}
.inv-email-actions .btn-primary {
  flex: 1 1 10rem;
  min-width: 0;
}
.inv-email-actions .btn-ghost {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* Račun – pošlji/tisk: privzeto zloženo (details) */
.inv-send-details {
  border: 1px solid var(--color-border);
  border-radius: 0.65rem;
  background: #fff;
  overflow: hidden;
}
.inv-send-details__summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.55rem 0.65rem;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--color-text);
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}
.inv-send-details__summary::-webkit-details-marker { display: none; }
.inv-send-details__title { min-width: 0; }
.inv-send-details__chev {
  flex: 0 0 auto;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  transform: rotate(45deg);
  margin: 0 0.15rem 0.2rem 0;
  transition: transform 0.15s ease;
}
.inv-send-details[open] .inv-send-details__chev {
  transform: rotate(-135deg);
  margin-bottom: 0.05rem;
}
.inv-send-details__body {
  padding: 0.15rem 0.65rem 0.65rem;
}

.inv-balance-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .6rem .85rem;
  background: #fff5f5;
  border: 1px solid #fca5a5;
  border-radius: .55rem;
  font-size: .88rem;
  color: var(--color-muted);
}

.inv-balance-card strong {
  font-size: 1.15rem;
  font-weight: 800;
  color: #dc2626;
}

/* ── Invoice summary card (top of sidebar) ─────────── */
.inv-summary-card {
  background: linear-gradient(135deg, #1f64ff 0%, #1048cc 100%);
  color: #fff;
  border-radius: .75rem;
  padding: 1rem 1.1rem .85rem;
}

.inv-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  padding: .18rem 0;
  font-size: .88rem;
  opacity: .9;
}

.inv-summary-row--primary {
  opacity: 1;
  padding-bottom: .5rem;
  margin-bottom: .35rem;
  border-bottom: 1px solid rgba(255,255,255,.18);
}

.inv-summary-row--primary strong {
  font-size: 1.45rem;
  font-weight: 800;
}

.inv-summary-row--paid { color: #bbf7d0; }
.inv-summary-row--paid strong { color: #86efac; font-weight: 700; }
.inv-summary-row--open { color: #fca5a5; }
.inv-summary-row--open strong { color: #f87171; font-weight: 700; }
.inv-summary-row--done { color: #bbf7d0; }
.inv-summary-row--done strong { color: #86efac; font-weight: 700; }

.inv-progress-wrap {
  height: 5px;
  background: rgba(255,255,255,.22);
  border-radius: 99px;
  overflow: hidden;
  margin: .65rem 0 .2rem;
}

.inv-progress-bar {
  height: 5px;
  background: #4ade80;
  border-radius: 99px;
}

.inv-progress-label {
  font-size: .7rem;
  opacity: .7;
  text-align: right;
  margin: 0;
}

.inv-payment-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
}

@media (max-width: 960px) {
  .inv-layout { grid-template-columns: 1fr; }
  .inv-sidebar { position: static; order: -1; }
  .inv-total-row { min-width: 0; }
  .inv-totals { align-items: stretch; }
  .inv-payment-grid { grid-template-columns: 1fr 1fr; }
}

.wo-section--materials .materials-table input,
.wo-section--materials .materials-table select {
  width: 100%;
  min-width: 0;
}

/* Compact inputs inside materials table */
.materials-table .input-field,
.materials-table select.input-field {
  padding: 0.32rem 0.45rem;
  font-size: 0.85rem;
  border-radius: 0.4rem;
  border-color: #9ab0d0;
  background-color: #f8faff;
  height: 32px;
  box-sizing: border-box;
}

.materials-table .input-field:focus,
.materials-table select.input-field:focus {
  border-color: var(--color-primary);
  background-color: #fff;
  box-shadow: 0 0 0 2px rgba(31,100,255,0.15);
}

/* Opis avtomatsko izpolnjen iz šifranta — vizualno readonly */
.materials-table .mat-desc-auto {
  background-color: #f0f4fb !important;
  color: var(--color-muted);
  cursor: default;
}

/* ── Autocomplete combo ─────────────────────────────────── */
.art-combo {
  position: relative;
}

.art-combo-wrap {
  display: flex;
  align-items: center;
  gap: 3px;
}

.art-combo-wrap .art-combo-input {
  flex: 1;
  min-width: 0;
}

/* Hide the Django select — only used for form submission */
.art-combo select {
  display: none;
}

.art-combo-clear {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--color-muted);
  font-size: 0.9rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}
.art-combo-clear:hover {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}

.art-combo-list {
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #bfd0ec;
  border-radius: 0.5rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.13);
  list-style: none;
  margin: 0;
  padding: 0.2rem 0;
  z-index: 300;
  max-height: 260px;
  overflow-y: auto;
  min-width: 260px;
}
/* Ko je lista portaliranana na body (position:fixed via inline), prepreči CSS spopad */
body > .art-combo-list {
  position: fixed !important;
  top: unset;
  background: #fff;
  min-width: 240px;
}

.art-combo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  gap: 0.4rem;
  font-size: 0.85rem;
  outline: none;
}
.art-combo-item:hover,
.art-combo-item:focus {
  background: rgba(31, 100, 255, 0.07);
}

.art-combo-name {
  font-weight: 500;
  color: var(--color-text);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.art-combo-meta {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}

.art-combo-sku {
  font-size: 0.74rem;
  color: var(--color-muted);
  background: rgba(31, 100, 255, 0.08);
  padding: 0.1rem 0.38rem;
  border-radius: 0.25rem;
  font-family: monospace;
  white-space: nowrap;
}

.art-combo-price {
  font-size: 0.8rem;
  color: #047857;
  font-weight: 600;
  white-space: nowrap;
}

.art-combo-empty {
  padding: 0.55rem 0.7rem;
  color: var(--color-muted);
  font-size: 0.82rem;
  font-style: italic;
}
.art-combo-loading { color: var(--color-primary); font-style: normal; }

/* ── Modal: dodaj artikel v šifrant ────────────────────── */
.art-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.48);
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.art-modal-overlay[hidden] { display: none; }

.art-modal {
  background: #fff;
  border-radius: 1rem;
  padding: 1.75rem 2rem 1.5rem;
  max-width: 460px;
  width: 92%;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.art-modal-head {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--color-text);
}

.art-modal p {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  color: var(--color-text);
}

.art-modal-items {
  margin: 0.5rem 0 0.75rem;
  padding: 0.5rem 0.85rem;
  background: #f5f8ff;
  border-radius: 0.5rem;
  border: 1px solid #dce8ff;
  list-style: none;
  font-size: 0.875rem;
}
.art-modal-items li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.28rem 0;
  border-bottom: 1px solid #e5eeff;
}
.art-modal-items li:last-child { border-bottom: none; }
.art-modal-row-price {
  font-size: 0.8rem;
  color: #047857;
  font-weight: 600;
}

.art-modal-note {
  color: var(--color-muted) !important;
  font-size: 0.8rem !important;
  margin-bottom: 1.25rem !important;
}

.art-modal-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* ── Inline "dodaj v šifrant" prompt vrstica ─────────── */
.art-inv-prompt-row td.art-inv-prompt-td {
  padding: 0.55rem 0.75rem;
  background: linear-gradient(135deg, #fffbea 0%, #fef9e0 100%);
  border-left: 3px solid var(--warning, #f59e0b);
  border-bottom: 1px solid #fde68a;
  font-size: 0.85rem;
}
.art-inv-prompt-td--form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}
.art-inv-prompt-title {
  color: var(--text-primary, #1e293b);
  white-space: nowrap;
  margin-right: 0.4rem;
}
.art-inv-prompt-title strong { color: var(--primary, #2563eb); }
.art-inv-fields {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: flex-end;
  flex: 1;
}
.art-inv-field-lbl {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
  font-weight: 500;
}
.art-inv-field-lbl .input-field {
  width: 130px;
  padding: 0.25rem 0.5rem;
  font-size: 0.82rem;
}
.art-inv-field-lbl .input-field[type=number] { width: 100px; }
.art-inv-actions {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  flex-shrink: 0;
}
.btn-xs {
  padding: 0.2rem 0.65rem;
  font-size: 0.78rem;
  line-height: 1.4;
  border-radius: 0.35rem;
  cursor: pointer;
}

.materials-table td {
  vertical-align: middle;
  padding: 0.4rem 0.45rem;
}

.materials-table th {
  padding: 0.45rem 0.45rem;
}

/* Column width definitions */
.materials-table .mat-col-desc   { min-width: 180px; width: 26%; }
.materials-table .mat-col-item   { min-width: 160px; width: 20%; }
.materials-table .mat-col-qty    { min-width: 80px;  width: 6%; }
.materials-table .mat-col-price  { min-width: 90px;  width: 8%; }
.materials-table .mat-col-disc   { min-width: 62px;  width: 5%; }
.materials-table .mat-col-marza  { min-width: 62px;  width: 5%; }
.materials-table .mat-col-cost   { min-width: 90px;  width: 8%; }
.materials-table .mat-col-rvc    { min-width: 80px;  width: 8%; }
.materials-table .mat-col-total  { min-width: 80px;  width: 8%; }
.materials-table .mat-col-date   { min-width: 68px;  width: 68px; text-align: center; }
.materials-table .mat-col-status { min-width: 28px;  width: 28px; text-align: center; }
.materials-table .mat-col-del    { min-width: 42px;  width: 42px; text-align: center; }
.materials-table th.mat-col-del,
.materials-table th.mat-col-status { background: none; }

.mat-date {
  font-size: 0.72rem;
  color: var(--color-muted);
  line-height: 1.3;
  white-space: nowrap;
}
.mat-date small { display: block; font-size: 0.67rem; opacity: 0.8; }

.mat-save-status { font-size: 0.85rem; display: block; text-align: center; }
.mat-save--saving { animation: mat-pulse 0.8s infinite alternate; }
@keyframes mat-pulse { from { opacity: 0.4; } to { opacity: 1; } }
.mat-save--error { color: #dc2626; }
.mat-save--saved { color: #059669; }

.mat-computed {
  display: block;
  text-align: right;
  font-size: 0.88rem;
  color: var(--color-muted);
  white-space: nowrap;
}

/* Delete button */
.del-label {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.del-label input[type="checkbox"] {
  display: none;
}

.del-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid #e0c8c8;
  background: #fff0f0;
  color: #dc2626;
  font-size: 0.8rem;
  font-weight: 700;
  transition: background-color var(--transition-fast);
}

.del-label:hover .del-icon {
  background: #fee2e2;
  border-color: #dc2626;
}

.del-label input:checked ~ .del-icon {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
}

/* Small button variant */
.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  border-radius: 0.55rem;
}

/* AI suggestions — nalog dropdown in checkbox stolpec */
.order-select,
.input-sm {
  font-size: 0.78rem;
  padding: 0.2rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  background: var(--surface);
  color: var(--text);
  max-width: 10rem;
}
.ai-suggestion-table td input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
  accent-color: var(--primary, #2563eb);
}
.ai-suggestion-table thead .select-all-cb {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
  accent-color: var(--primary, #2563eb);
}

/* AI uvoz — panel z možnostmi (DDV, rabat, marža) */
.ai-apply-options {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.75rem 1rem;
  background: var(--surface-alt, #f0f4ff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 0.5rem;
  margin-top: 0.75rem;
}
.ai-apply-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.ai-apply-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-secondary, #475569);
  white-space: nowrap;
  min-width: 5rem;
}
.ai-apply-row .input-sm {
  max-width: 7rem;
}

/* Art-combo: samo šifra (brez ujemanja v zalogi) */
.art-combo-sku-only {
  color: var(--color-text-secondary, #64748b);
  font-style: italic;
}

/* Sidebar */
.wo-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: sticky;
  top: 80px;
}

/* Calculator — dobiček v 2 vrsticah × 3 stolpci */
.wo-calc {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1rem 1.1rem;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}

.wo-calc-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid #e8ecf4;
}

.wo-calc-head span {
  font-size: 1.05rem;
}

.wo-calc-head h3 {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #475569;
}

.wo-calc-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.wo-calc-tile {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 0.2rem;
  min-width: 0;
  padding: 0.45rem 0.5rem;
  border-radius: 0.55rem;
  border: 1px solid transparent;
  font-size: 0.72rem;
}

.wo-calc-tile-label {
  color: #64748b;
  font-weight: 600;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  word-break: break-word;
}

.wo-calc-tile-val {
  font-variant-numeric: tabular-nums;
  font-size: 0.92rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.15;
}

.wo-calc-tile--gross {
  background: linear-gradient(145deg, #1e40af 0%, #1d4ed8 100%);
  border-color: #1e3a8a;
  color: #fff;
}
.wo-calc-tile--gross .wo-calc-tile-label {
  color: rgba(255,255,255,0.75);
  font-weight: 700;
}
.wo-calc-tile--gross .wo-calc-tile-val {
  color: #fff;
  font-size: 1.15rem;
}

.wo-calc-tile--discount {
  background: #fffbeb;
  border-color: #fde68a;
}
.wo-calc-tile--discount .wo-calc-tile-val {
  color: #b45309;
}

.wo-calc-tile--net {
  background: linear-gradient(145deg, #f0fdf4, #ecfdf5);
  border-color: #86efac;
}
.wo-calc-tile--net .wo-calc-tile-label {
  color: #15803d;
}
.wo-calc-tile--net .wo-calc-tile-val {
  color: #166534;
}

.wo-calc-tile--cost {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.wo-calc-tile--cost .wo-calc-tile-val {
  color: #475569;
}

.wo-calc-tile--rvc {
  background: linear-gradient(145deg, #ecfdf5, #d1fae5);
  border-color: #6ee7b7;
  grid-column: auto;
}
.wo-calc-tile--rvc .wo-calc-tile-label {
  color: #047857;
}
.wo-calc-tile--rvc .wo-calc-tile-val {
  font-size: 1.02rem;
  color: #065f46;
}

.wo-calc-tile--margin {
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.wo-calc-tile--margin .wo-calc-tile-label {
  color: #166534;
}
.wo-calc-tile--margin .wo-calc-tile-val {
  color: #15803d;
}

.wo-calc-note {
  margin: 0.65rem 0 0;
  font-size: 0.72rem;
  color: #94a3b8;
  line-height: 1.35;
}

/* Delovni nalog detail: ena polna širina — glavna dejanja + slike pod vsebino */
.wo-detail-layout.wo-layout {
  align-items: start;
  grid-template-columns: minmax(0, 1fr);
}
.wo-detail-post-main.wo-inline-sidebar {
  margin-top: 0.25rem;
}

/* Povzetek postavk — namizje: ena vrstica (material združen | delo | skupaj); telefon: 3 vrstice */
.wo-section--materials .wo-postavke-sum {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--color-border, #e2e8f0);
}
.wo-postavke-sum-head {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin-bottom: 0.65rem;
}
.wo-postavke-sum-icon {
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
}
.wo-postavke-sum-title {
  margin: 0 0 0.15rem;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.01em;
}
.wo-postavke-sum-hint {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.35;
  max-width: 42rem;
}
.wo-postavke-sum-strip {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  border: 1px solid #e2e8f0;
  border-radius: 0.55rem;
  overflow: hidden;
  background: #fafbfc;
}
.wo-sum-cell {
  flex: 1 1 0;
  min-width: 0;
  padding: 0.48rem 0.7rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.2rem;
  border-right: 1px solid #e8ecf4;
}
.wo-sum-cell:last-child {
  border-right: none;
}
.wo-sum-cell-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}
.wo-sum-material-pair {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.55rem;
  font-size: 0.82rem;
}
.wo-sum-material-sep {
  color: #cbd5e1;
  font-weight: 700;
}
.wo-sum-sub abbr {
  text-decoration: none;
  border-bottom: none;
  color: #94a3b8;
  font-weight: 600;
  font-size: 0.72rem;
}
.wo-sum-sub strong {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
}
.wo-sum-cell-val {
  font-size: 0.94rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
}
.wo-sum-cell--material {
  flex: 1.35 1 40%;
}
.wo-sum-cell--total {
  background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
  flex: 0 1 26%;
}
.wo-sum-cell--total .wo-sum-cell-label {
  color: #1e3a5f;
}
.wo-sum-cell--total .wo-sum-cell-val {
  color: #1e40af;
  font-size: 1.05rem;
}
.wo-postavke-sum-foot {
  margin: 0.4rem 0 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
}
.wo-inline-sidebar > .wo-info-card--complete-invoice:first-child,
.wo-inline-sidebar > .wo-section--photos:first-child,
.wo-detail-post-main > .wo-section--photos:first-child {
  margin-top: 0;
}
@media (max-width: 640px) {
  .wo-postavke-sum-strip {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
  }
  .wo-sum-cell {
    border-right: none;
    border-bottom: none;
  }
  .wo-sum-cell--material {
    grid-column: 1;
    grid-row: 1;
    border-right: 1px solid #e8ecf4;
    border-bottom: 1px solid #e8ecf4;
    flex-direction: column;
    align-items: stretch;
  }
  .wo-sum-cell--material .wo-sum-cell-label {
    align-self: flex-start;
  }
  .wo-sum-cell--material .wo-sum-material-pair {
    width: 100%;
    justify-content: flex-start;
  }
  .wo-sum-cell--labor {
    grid-column: 2;
    grid-row: 1;
    border-bottom: 1px solid #e8ecf4;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
  }
  .wo-sum-cell--total {
    grid-column: 1 / -1;
    grid-row: 2;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
  }
}

/* Zaključi nalog + račun */
.wo-info-card--complete-invoice {
  position: relative;
  z-index: 2;
  margin-top: 1rem;
  border-color: #bfdbfe;
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
}
.wo-info-card--complete-invoice-exists .wo-complete-invoice-open-existing {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  margin-top: 0.35rem;
}
.wo-info-card--complete-invoice .wo-info-card-title {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e40af;
}
.wo-info-card--complete-invoice .wo-info-card-hint {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  line-height: 1.4;
}
.wo-inv-default-note {
  margin: 0 0 0.6rem;
  font-size: 0.72rem;
  line-height: 1.35;
}
.wo-inv-advanced {
  margin: 0 0 0.65rem;
  border: 1px solid rgba(30, 64, 175, 0.2);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.45);
  overflow: hidden;
}
.wo-inv-advanced > summary.wo-inv-advanced-summary {
  list-style: none;
  cursor: pointer;
  padding: 0.5rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #1e40af;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  user-select: none;
}
.wo-inv-advanced > summary.wo-inv-advanced-summary::-webkit-details-marker {
  display: none;
}
.wo-inv-advanced > summary.wo-inv-advanced-summary::before {
  content: "▸";
  display: inline-block;
  font-size: 0.7rem;
  opacity: 0.8;
  transition: transform 0.15s ease;
}
.wo-inv-advanced[open] > summary.wo-inv-advanced-summary::before {
  transform: rotate(90deg);
}
.wo-inv-advanced-body {
  padding: 0 0.65rem 0.65rem;
  border-top: 1px solid rgba(30, 64, 175, 0.12);
}
.wo-inv-vat-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
}
.wo-inv-vat-check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  font-weight: 600;
  color: #334155;
}
.wo-inv-tax-select-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #475569;
}
.wo-inv-tax-select-label .input-field--sm {
  min-width: 5.5rem;
  padding: 0.22rem 0.4rem;
  font-size: 0.78rem;
}
.wo-inv-vat-hint {
  font-size: 0.74rem;
  margin: 0 0 0.5rem;
}
.wo-inv-extra-disc {
  margin: 0.5rem 0 0.35rem;
  padding: 0.45rem 0.5rem;
  border-radius: 0.45rem;
  background: rgba(255, 255, 255, 0.5);
  border: 1px dashed rgba(30, 64, 175, 0.2);
}
.wo-inv-extra-disc__title {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.wo-inv-extra-disc__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.65rem;
  margin-bottom: 0.35rem;
}
.wo-inv-extra-disc__lbl {
  flex: 1 1 10rem;
  min-width: 8rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: #475569;
}
.wo-inv-extra-disc .wo-inv-disc-input {
  width: 5rem;
  max-width: 100%;
}
.wo-inv-extra-disc__hint {
  margin: 0.15rem 0 0;
  font-size: 0.68rem !important;
  line-height: 1.35;
}
.wo-inv-preview {
  margin: 0.35rem 0 0.65rem;
  padding: 0.45rem 0.55rem;
  border-radius: 0.4rem;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(30, 64, 175, 0.12);
  font-size: 0.72rem;
  color: #475569;
}
.wo-inv-preview-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.2rem 0.75rem;
  align-items: baseline;
}
.wo-inv-preview-grid strong {
  font-variant-numeric: tabular-nums;
  color: #0f172a;
  justify-self: end;
}
.wo-inv-preview-grid .wo-inv-preview-sub {
  font-size: 0.68rem;
  color: #64748b;
  font-weight: 500;
}
.wo-inv-preview-grid strong.wo-inv-preview-sub {
  font-weight: 600;
  color: #475569;
}
.wo-complete-invoice-actions {
  margin-top: 0.15rem;
}
.wo-info-card--complete-invoice .wo-complete-invoice-form .btn-primary {
  width: 100%;
  box-sizing: border-box;
}

/* Izbriši nalog — kartica */
.wo-info-card--danger {
  margin-top: 1rem;
  border-color: #fecaca;
  background: #fffafa;
}
.wo-info-card--danger > summary.wo-info-card--danger-sum {
  cursor: pointer;
  list-style: none;
  font-size: 0.82rem;
  color: #dc2626;
  font-weight: 700;
}
.wo-info-card--danger > summary.wo-info-card--danger-sum::-webkit-details-marker {
  display: none;
}
.wo-info-card--danger-hint {
  font-size: 0.76rem;
  color: #64748b;
  margin: 0.5rem 0 0.55rem;
  line-height: 1.4;
}
.wo-delete-code-value {
  display: inline-block;
  margin-left: 0.25rem;
  padding: 0.12rem 0.4rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 0.3rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
}

.wo-delete-nalog-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}
.wo-delete-nalog-code {
  max-width: 160px;
  font-size: 0.82rem;
  font-family: ui-monospace, monospace;
  min-height: 44px;
}
.wo-delete-nalog-submit {
  color: #dc2626 !important;
  border-color: #fecaca !important;
  min-height: 44px;
}

/* Info card */
.wo-info-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  padding: 1rem 1.15rem;
}

.wo-info-rows {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.wo-info-rows > div {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.87rem;
}

.wo-info-rows .muted {
  font-size: 0.82rem;
}

/* Responsive */
@media (max-width: 960px) {
  .wo-layout {
    grid-template-columns: 1fr;
  }
  .wo-sidebar {
    position: static;
  }
  .wo-fields-4col {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
}

@media (max-width: 640px) {
  .page-header {
    flex-direction: column;
  }
  .page-header-actions {
    width: 100%;
  }
  .page-header-actions .btn-primary,
  .page-header-actions .btn-ghost {
    flex: 1;
    text-align: center;
  }
}

/* ── Work Order List Page ─────────────────────────────── */

/* Panel wrapper — white card */
.wo-list-panel {
  display: flex;
  flex-direction: column;
}

/* Glava: naslov + gumb */
.wo-list-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 1.2rem;
}

.wo-list-header .eyebrow {
  margin-bottom: 0.15rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
}

.wo-list-heading {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

/* KPI stats bar */
.wo-stats-bar {
  display: flex;
  gap: 1rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.wo-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 84px;
  padding: 0.7rem 1.1rem;
  border-radius: 0.75rem;
  border: 1.5px solid transparent;
  background: #f8fafc;
  box-shadow: 0 1px 4px rgba(15,23,42,0.07);
}

.wo-stat-num {
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.wo-stat-lbl {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-top: 0.15rem;
  white-space: nowrap;
}

.wo-stat--blue  { color: #1d4ed8; background: #dbeafe; border-color: rgba(29,78,216,0.30); }
.wo-stat--red   { color: #b91c1c; background: #fee2e2; border-color: rgba(185,28,28,0.28); }
.wo-stat--amber { color: #92400e; background: #fde68a; border-color: rgba(146,64,14,0.28); }
.wo-stat--green { color: #14532d; background: #bbf7d0; border-color: rgba(20,83,45,0.28);  }
.wo-stat--teal  { color: #134e4a; background: #99f6e4; border-color: rgba(19,78,74,0.28);  }

a.wo-stat {
  text-decoration: none;
  cursor: pointer;
  transition: transform 90ms ease, box-shadow 90ms ease;
  -webkit-tap-highlight-color: transparent;
}
a.wo-stat:hover  { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,0.10); }
a.wo-stat:active { transform: translateY(0);    box-shadow: none; }

.wo-stat--active {
  box-shadow: 0 0 0 2.5px currentColor !important;
}

/* Modern AI button */
.btn-ai {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  border-radius: 0.55rem;
  border: none;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 120ms ease, transform 120ms ease, box-shadow 120ms ease;
  box-shadow: 0 2px 8px rgba(99,102,241,0.35);
  vertical-align: middle;
}
.btn-ai:hover {
  opacity: 0.88;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(99,102,241,0.45);
  color: #fff;
}
.btn-ai:active { transform: translateY(0); opacity: 1; }

/* Filter bar */
.wo-filter-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 0.5rem;
}

.wo-filter-search {
  flex: 1 1 220px;
}

.wo-filter-select {
  flex: 0 1 160px;
}

.wo-filter-bar .input-field {
  height: 38px;
  font-size: 0.875rem;
  padding: 0.4rem 0.75rem;
}

.wo-filter-btn {
  height: 38px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Tabela */
.wo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.wo-table thead tr {
  border-bottom: 2.5px solid #1241b8;
  background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 100%);
}

.wo-table th {
  padding: 0.6rem 0.9rem;
  text-align: left;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
}

.wo-table td {
  padding: 0.8rem 0.9rem;
  vertical-align: middle;
  border-bottom: 2px solid var(--color-border);
}

.wo-row:last-child td {
  border-bottom: none;
}

.wo-row {
  cursor: pointer;
  transition: background 100ms ease;
}

.wo-row:hover {
  background-color: rgba(31,100,255,0.06) !important;
  box-shadow: inset 0 0 0 1px rgba(31,100,255,0.10);
}

/* Obarvana vrstica glede na status naloga */
.wo-table tbody tr.wo-row--new {
  box-shadow: inset 5px 0 0 #3b82f6;
  background: linear-gradient(90deg, rgba(59,130,246,0.07) 0%, transparent 60%);
}
.wo-table tbody tr.wo-row--scheduled {
  box-shadow: inset 5px 0 0 #8b5cf6;
  background: linear-gradient(90deg, rgba(139,92,246,0.08) 0%, transparent 60%);
}
.wo-table tbody tr.wo-row--in_progress {
  box-shadow: inset 5px 0 0 #f59e0b;
  background: linear-gradient(90deg, rgba(245,158,11,0.10) 0%, transparent 60%);
}
.wo-table tbody tr.wo-row--waiting_parts {
  box-shadow: inset 5px 0 0 #f97316;
  background: linear-gradient(90deg, rgba(249,115,22,0.10) 0%, transparent 60%);
}
.wo-table tbody tr.wo-row--completed {
  box-shadow: inset 5px 0 0 #22c55e;
  background: linear-gradient(90deg, rgba(34,197,94,0.07) 0%, transparent 60%);
}
.wo-table tbody tr.wo-row--paid {
  box-shadow: inset 5px 0 0 #14b8a6;
  background: linear-gradient(90deg, rgba(20,184,166,0.09) 0%, transparent 60%);
}
.wo-table tbody tr.wo-row--cancelled {
  box-shadow: inset 5px 0 0 #94a3b8;
  background: linear-gradient(90deg, rgba(148,163,184,0.07) 0%, transparent 60%);
  opacity: 0.75;
}

/* ── Kolumne ──────────────────────────────────────── */
.wo-th-main,
.wo-td-main {
  min-width: min(190px, 28vw);
  max-width: none;
}

.wo-code-chip {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #1e40af;
  background: #bfdbfe;
  border: 1px solid rgba(30,64,175,0.30);
  border-radius: 0.4rem;
  padding: 0.12rem 0.55rem;
  margin-bottom: 0.3rem;
  white-space: nowrap;
}

.wo-customer-name {
  display: block;
  font-weight: 600;
  font-size: 0.93rem;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wo-phone-link {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  margin-top: 0.3rem;
  font-size: 0.76rem;
  color: #16a34a;
  text-decoration: none;
  white-space: nowrap;
  background: rgba(22,163,74,0.07);
  border: 1px solid rgba(22,163,74,0.22);
  border-radius: 0.4rem;
  padding: 0.1rem 0.45rem;
  transition: background-color 100ms ease;
}
.wo-phone-link:hover {
  background: rgba(22,163,74,0.15);
  color: #15803d;
}

.wo-th-vehicle,
.wo-td-vehicle { min-width: 170px; }

.wo-list-created-mobile {
  display: none;
}

.wo-vehicle-main {
  display: block;
  font-size: 0.88rem;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wo-vehicle-meta {
  display: block;
  font-size: 0.75rem;
  color: var(--color-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.12rem;
}

.wo-th-sp,
.wo-td-sp { width: 140px; white-space: nowrap; }

.wo-td-sp .badge {
  display: block;
  width: fit-content;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wo-td-sp .badge + .badge { margin-top: 0.3rem; }

.wo-desc-text {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.73rem;
  color: #536179;
  line-height: 1.35;
  cursor: default;
  margin-top: 0.25rem;
}

.wo-th-opened { width: 108px; white-space: nowrap; font-size: 0.82rem; color: var(--color-muted); }
.wo-td-opened {
  width: 108px;
  padding: 0.5rem 0.75rem;
  vertical-align: middle;
}
.wo-opened-date {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
}
.wo-opened-time {
  display: block;
  font-size: 0.74rem;
  color: var(--color-muted);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.wo-th-date { width: 155px; white-space: nowrap; font-size: 0.82rem; color: var(--color-muted); }
.wo-td-date { width: 155px; padding: 0.5rem 0.9rem; }

/* ── Inline date-picker widget ─────────────────────── */
.wo-date-btn {
  background: none;
  border: none;
  padding: 0.25rem 0.4rem;
  margin: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  text-align: left;
  border-radius: 6px;
  transition: background 0.15s;
}
.wo-date-btn:hover {
  background: rgba(31,100,255,0.08);
}

.wo-date-day {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
}

.wo-date-time {
  font-size: 0.75rem;
  color: var(--color-primary);
  font-weight: 700;
  letter-spacing: 0.03em;
}

.wo-date-empty {
  font-size: 0.78rem;
  color: var(--color-muted);
  font-style: italic;
}

/* Hidden input — opened only via showPicker() JS call */
.wo-date-picker {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  border: none;
}

.wo-th-actions, .wo-td-actions { width: 110px; text-align: right; white-space: nowrap; }

.wo-td-actions a + a { margin-left: 0.3rem; }

/* Extra badge variants */
.badge-blue {
  color: var(--color-primary);
  border-color: rgba(31,100,255,0.35);
  background-color: rgba(31,100,255,0.08);
}

.badge-red-ghost {
  color: #dc2626;
  border-color: rgba(220,38,38,0.35);
}

.badge-amber-ghost {
  color: #b45309;
  border-color: rgba(245,158,11,0.35);
}

/* Majhen badge poleg oznake polja */
.badge-xs {
  font-size: 0.68rem;
  padding: 0.1rem 0.4rem;
  border-radius: 0.4rem;
  border: 1px solid rgba(99,102,241,0.4);
  color: #6366f1;
  background: rgba(99,102,241,0.07);
  vertical-align: middle;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* ── Field tip (?) tooltip ─────────────────────────────── */
.field-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-muted);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  cursor: help;
  position: relative;
  margin-left: 0.3rem;
  vertical-align: middle;
  opacity: 0.65;
  transition: opacity 0.15s;
  flex-shrink: 0;
  isolation: isolate;
}
.field-tip:hover {
  opacity: 1;
  z-index: 9998;
}
.field-tip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #f1f5f9;
  font-size: 0.78rem;
  font-weight: 400;
  padding: 0.4rem 0.65rem;
  border-radius: 0.45rem;
  width: max-content;
  max-width: min(34rem, calc(100vw - 2rem));
  white-space: normal;
  line-height: 1.35;
  text-wrap: pretty;
  overflow-wrap: anywhere;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.field-tip:hover::after {
  opacity: 1;
}

@media (max-width: 900px) {
  .field-tip::after {
    left: 0;
    transform: none;
    max-width: calc(100vw - 1.25rem);
  }
}

/* Ponudba: AI uvoz — pojasnilo pod vprašajem (ne nad) */
.q-quote-ai-strip .field-tip::after {
  bottom: auto;
  top: calc(100% + 6px);
}
.q-quote-ai-strip .field-tip:focus-visible {
  opacity: 1;
  z-index: 9998;
  outline: 2px solid var(--color-primary, #3478f6);
  outline-offset: 2px;
}
.q-quote-ai-strip .field-tip:focus-visible::after {
  opacity: 1;
}

/* Animacija ob avtomatski posodobitvi polja */
@keyframes fieldFlash {
  0%   { background: rgba(99,102,241,0.18); }
  100% { background: transparent; }
}
.field-auto-updated {
  animation: fieldFlash 1.5s ease-out;
  border-color: #6366f1 !important;
  outline: none;
}

/* btn-xs */
.btn-xs {
  padding: 0.25rem 0.6rem;
  font-size: 0.78rem;
  border-radius: 0.45rem;
  white-space: nowrap;
}

/* ── Workshop Team management ────────────────────────── */
.team-add-form { padding: 0 1rem 1rem; }
.team-add-row {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.team-table-wrap { overflow-x: auto; }
.team-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.team-table th {
  padding: 0.5rem 0.75rem;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-muted);
  border-bottom: 2px solid var(--color-border);
  white-space: nowrap;
}
.team-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
.team-row--suspended td { opacity: 0.5; }
.team-username { display: block; font-weight: 600; }
.team-email-link { color: var(--color-primary); text-decoration: none; }
.team-email-link:hover { text-decoration: underline; }

.team-inline-form { display: inline; }
.input-field--xs {
  padding: 0.2rem 0.4rem;
  font-size: 0.82rem;
  height: auto;
}

.team-col-actions { text-align: right; white-space: nowrap; }
.team-col-perms { vertical-align: top; min-width: 9.5rem; }
.team-perms-form { margin: 0; }
.team-perms-grid {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.76rem;
  line-height: 1.35;
}
.team-perm-chk {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  color: var(--color-text, #1e293b);
}
.team-perm-chk input { flex-shrink: 0; }

.btn-danger-sm {
  background: none;
  border: 1px solid rgba(220,38,38,0.4);
  color: #dc2626;
  border-radius: 6px;
  padding: 0.2rem 0.6rem;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-danger-sm:hover { background: rgba(220,38,38,0.08); }

/* Role badge variants */
.badge-role { font-size: 0.74rem; padding: 0.15rem 0.55rem; border-radius: 0.5rem; border: 1px solid; font-weight: 700; }
.badge-role--owner    { color: #1f64ff; border-color: rgba(31,100,255,0.4); background: rgba(31,100,255,0.08); }
.badge-role--admin    { color: #7c3aed; border-color: rgba(124,58,237,0.4); background: rgba(124,58,237,0.08); }
.badge-role--mechanic { color: #047857; border-color: rgba(4,120,87,0.4); background: rgba(4,120,87,0.08); }
.badge-role--office   { color: #374151; border-color: rgba(55,65,81,0.3); background: rgba(55,65,81,0.06); }
.badge-role--warehouse{ color: #b45309; border-color: rgba(180,83,9,0.35); background: rgba(180,83,9,0.07); }

/* Roles legend */
.team-roles-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem;
}
.role-card {
  flex: 1;
  min-width: 160px;
  max-width: 220px;
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
}
.role-card .badge-role { display: inline-block; margin-bottom: 0.4rem; }
.role-card p { margin: 0; font-size: 0.8rem; color: var(--color-muted); line-height: 1.4; }

/* ── Topbar quick-links wrapper ──────────────────────── */
.topbar-quick-links {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* ── Sidebar backdrop (mobile overlay) ───────────────── */
.sidebar-backdrop {
  display: none;            /* always hidden on desktop (overridden on mobile) */
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 45;
  cursor: pointer;
  transition: opacity 220ms ease;
}
.sidebar-backdrop.backdrop-hidden {
  opacity: 0;
  pointer-events: none;
}
@media (max-width: 960px) {
  .sidebar-backdrop { display: block; }
}

/* ── Sidebar mobile header ────────────────────────────── */
.sidebar-mobile-header {
  display: none;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 0.85rem 0.85rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}
.sidebar-brand-mark-sm {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: radial-gradient(circle at 30% 30%, #7bb3ff, var(--color-primary));
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.sidebar-brand-name {
  flex: 1;
  color: #f1f5f9;
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
}
.sidebar-close-btn {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.5);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.82rem;
  flex-shrink: 0;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}
.sidebar-close-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* ── Sidebar workshop tag (mobile) ───────────────────── */
.sidebar-workshop-tag {
  display: none;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0.4rem 0.35rem;
  padding: 0.4rem 0.8rem;
  border-radius: 0.5rem;
  background: rgba(31, 100, 255, 0.14);
  border: 1px solid rgba(31, 100, 255, 0.24);
  color: rgba(148, 163, 184, 0.9);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.sidebar-workshop-tag:hover {
  background: rgba(31, 100, 255, 0.24);
  border-color: rgba(31, 100, 255, 0.45);
  color: #fff;
}

@media (max-width: 960px) {
  .sidebar-mobile-header  { display: flex; }
  .sidebar-workshop-tag   { display: flex; }
}

/* ── Mobile bottom navigation ─────────────────────────── */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 62px;
  background: #fff;
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -6px 24px rgba(15, 23, 42, 0.1);
  z-index: 30;
}
@media (max-width: 960px) {
  .mobile-bottom-nav { display: flex; }
}
.mbn-link {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.18rem;
  color: #475569;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.5rem 0.25rem 0.7rem;
  transition: color var(--transition-fast), background-color var(--transition-fast);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.mbn-icon {
  font-size: 1.2rem;
  line-height: 1;
  display: block;
  transition: transform 120ms ease;
}
.mbn-link.active {
  color: var(--color-primary);
  font-weight: 800;
}
.mbn-link.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--color-primary);
  border-radius: 0 0 2px 2px;
}
.mbn-link.active .mbn-icon {
  transform: scale(1.1) translateY(-1px);
}
.mbn-link:active {
  background: rgba(31, 100, 255, 0.05);
}

/* ── Responsive: small screens (≤ 640px) ─────────────── */
@media (max-width: 640px) {

  /* Compact topbar */
  .app-topbar { padding: 0.6rem 1rem; }
  .user-menu-btn .user-name-text { display: none; }
  .user-menu-caret { display: none; }

  /* WO list panel */
  .wo-list-panel   { padding: 1rem; }
  .wo-list-header  { padding-bottom: 0.9rem; margin-bottom: 0.9rem; }
  .wo-list-heading { font-size: 1.2rem; }

  /* KPI stats — all in one row */
  .wo-stats-bar {
    gap: 0.35rem;
    padding-bottom: 0.85rem;
    margin-bottom: 0.75rem;
  }
  .wo-stat {
    flex: 1;
    min-width: 0;
    padding: 0.5rem 0.35rem;
    border-radius: 0.55rem;
  }
  .wo-stat-num { font-size: 1.25rem; }
  .wo-stat-lbl { font-size: 0.6rem; letter-spacing: 0.03em; }

  /* Filter bar stacking */
  .wo-filter-search { flex-basis: 100%; order: -1; }
  .wo-filter-select { flex: 1 1 130px; }
  .wo-filter-btn    { flex: 0 0 auto; }

  /* ── WO table → card layout on mobile ── */
  .wo-table thead { display: none; }
  .wo-table,
  .wo-table tbody { display: block; }

  .wo-row {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto auto;
    column-gap: 0.65rem;
    row-gap: 0;
    border: 1px solid var(--color-border);
    border-radius: 0.9rem;
    padding: 0.9rem 1rem;
    margin-bottom: 0.5rem;
    background: #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
    cursor: pointer;
  }
  .wo-row:hover { background-color: rgba(31,100,255,0.06) !important; }

  /* Stranka: koda chip + ime + tel */
  .wo-td-main {
    grid-column: 1; grid-row: 1;
    display: block;
    padding: 0;
    min-width: 0;
    max-width: none;
  }
  .wo-code-chip {
    margin-bottom: 0;
    font-size: 0.65rem;
    display: inline;
    vertical-align: baseline;
  }
  .wo-customer-name {
    font-size: 0.92rem;
    white-space: normal;
    display: inline;
    font-weight: 600;
    color: #1e293b;
  }
  .wo-code-chip + .wo-customer-name::before {
    content: " · ";
    font-weight: 600;
    color: #1e293b;
  }
  .wo-phone-link {
    margin-top: 0.35rem;
    font-size: 0.82rem;
    padding: 0.28rem 0.7rem;
    border-radius: 0.5rem;
  }

  /* Vozilo: znamka/model/reg + meta */
  .wo-td-vehicle {
    grid-column: 1 / 3; grid-row: 2;
    display: block;
    padding: 0.5rem 0 0;
    min-width: 0;
    max-width: none;
  }
  .wo-list-created-mobile {
    display: inline;
    font-weight: 500;
    color: #7a8fa8;
  }
  .wo-vehicle-main { white-space: normal; font-size: 0.74rem; color: #7a8fa8; }
  .wo-vehicle-meta { white-space: normal; font-size: 0.72rem; }
  .wo-desc-text {
    -webkit-line-clamp: 3;
    margin-top: 0.3rem;
    font-size: 0.73rem;
    color: #536179;
  }

  /* Status + Prioriteta (desno zgoraj) */
  .wo-td-sp {
    grid-column: 2; grid-row: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 0.28rem;
    padding: 0;
    width: auto;
  }
  .wo-td-sp .badge { display: inline-block; max-width: none; }
  .wo-td-sp .badge + .badge { margin-top: 0; }

  /* Termin */
  .wo-td-date {
    grid-column: 1 / 3; grid-row: 3;
    display: block;
    text-align: left;
    padding: 0.4rem 0 0;
  }
  .wo-date-day { font-size: 0.8rem; }
  .wo-date-time { font-size: 0.73rem; }
  .wo-td-actions { display: none; }

  /* WO detail */
  .wo-fields-4col { grid-template-columns: repeat(2, 1fr); }
  .wo-code        { font-size: 1.3rem; }

  /* Form page headers */
  .page-header              { flex-direction: column; gap: 0.75rem; }
  .page-header-actions      { width: 100%; }
  .page-header-actions .btn-primary,
  .page-header-actions .btn-ghost { flex: 1; text-align: center; justify-content: center; }
}

/* ══════════════════════════════════════════════════════════════
   TOPBAR – iskalnik + + Ustvari dropdown + ? gumb
══════════════════════════════════════════════════════════════ */

/* Iskalni gumb (Ctrl+K trigger) v topbaru */
.topbar-search-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: #fff;
  cursor: pointer;
  font-size: 0.87rem;
  color: var(--color-muted);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  white-space: nowrap;
  min-width: 0;
}
.topbar-search-btn:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
  color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(31,100,255,.1);
}
.topbar-search-icon { font-size: 0.9rem; }
.topbar-search-label { color: #94a3b8; }
.topbar-search-kbd {
  margin-left: 0.25rem;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
  font-size: 0.7rem;
  font-family: monospace;
  color: #64748b;
}
@media (max-width: 640px) {
  .topbar-search-label, .topbar-search-kbd { display: none; }
}

/* + Ustvari dropdown */
.topbar-create-wrap { position: relative; }
.topbar-create-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.38rem 1rem;
  border-radius: 8px;
  border: none;
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.87rem;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
  white-space: nowrap;
}
.topbar-create-btn:hover {
  background: #1451d6;
  box-shadow: 0 4px 14px rgba(31,100,255,.35);
  transform: translateY(-1px);
}
.topbar-create-label { /* shown on wider screens */ }
.topbar-create-caret { font-size: 0.7rem; opacity: .8; }
@media (max-width: 640px) {
  .topbar-create-label, .topbar-create-caret { display: none; }
  .topbar-create-btn { padding: 0.38rem 0.7rem; border-radius: 50%; width: 36px; height: 36px; justify-content: center; }
}

.topbar-create-dropdown {
  position: fixed;
  top: calc(var(--topbar-height) + env(safe-area-inset-top, 0px) + 6px);
  right: 12px;
  min-width: 240px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0,0,0,.13);
  overflow: hidden;
  z-index: 9999;
}
.topbar-dd-label {
  padding: 0.6rem 1rem 0.35rem;
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #3a4a5c;
  margin: 0;
}
.topbar-dd-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 1rem;
  text-decoration: none;
  color: var(--color-text);
  background: none;
  border: none;
  width: 100%;
  cursor: pointer;
  transition: background 0.12s;
}
.topbar-dd-item:hover {
  background: var(--color-primary-soft);
}
.topbar-dd-icon { font-size: 1.1rem; flex-shrink: 0; }
.topbar-dd-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  text-align: left;
}
.topbar-dd-text strong { font-size: 0.87rem; font-weight: 600; line-height: 1.3; }
.topbar-dd-text .muted { font-size: 0.75rem; color: #536179; }
.topbar-dd-hint { color: var(--color-muted); font-size: 0.85rem; }
.topbar-dd-divider { height: 1px; background: var(--color-border); margin: 0.3rem 0; }
.topbar-dd-item kbd {
  flex-shrink: 0;
  background: #e8edf5;
  border: 1px solid #a8bcd4;
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  font-size: 0.72rem;
  font-family: monospace;
  color: #1e3a5f;
  font-weight: 700;
}

/* ? Help gumb */
.topbar-help-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-muted);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.topbar-help-btn:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
  color: var(--color-primary);
}
/* ? gumb ostane v subnav-desno tudi na majhnih telefonih (dostop do bližnjic) */

/* ══════════════════════════════════════════════════════════════
   COMMAND PALETTE
══════════════════════════════════════════════════════════════ */

/* Ozadje */
.cmd-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 900;
  animation: cmdBackdropIn 0.15s ease;
}
@keyframes cmdBackdropIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Modalno okno */
.cmd-palette {
  position: fixed;
  top: 10vh;
  left: 50%;
  transform: translateX(-50%);
  width: min(640px, 96vw);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 32px 80px rgba(0,0,0,.22), 0 0 0 1px rgba(0,0,0,.06);
  z-index: 910;
  overflow: hidden;
  animation: cmdSlideIn 0.15s cubic-bezier(.175,.885,.32,1.1);
}
@keyframes cmdSlideIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-12px) scale(0.97); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0)     scale(1);    }
}

/* Glava z vnosom */
.cmd-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
}
.cmd-search-icon { font-size: 1.1rem; color: #7a8fa8; flex-shrink: 0; }
.cmd-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1.05rem;
  color: var(--color-text);
  background: transparent;
  font-family: inherit;
}
.cmd-input::placeholder { color: #8099b8; }
.cmd-esc-hint {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  padding: 0.1rem 0.45rem;
  font-size: 0.72rem;
  font-family: monospace;
  color: #64748b;
  flex-shrink: 0;
}

/* Rezultati */
.cmd-results {
  max-height: 380px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.cmd-group-label {
  padding: 0.5rem 1.25rem 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #536179;
}
.cmd-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 1.25rem;
  border: none;
  background: none;
  width: 100%;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--color-text);
  transition: background 0.1s;
}
.cmd-item:hover, .cmd-item--active {
  background: var(--color-primary-soft);
}
.cmd-item--active .cmd-item-label { color: var(--color-primary); font-weight: 600; }
.cmd-item-icon { font-size: 1.1rem; flex-shrink: 0; }
.cmd-item-label { flex: 1; }
.cmd-item-key {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  font-size: 0.72rem;
  font-family: monospace;
  color: #64748b;
  flex-shrink: 0;
}
.cmd-empty {
  padding: 1.5rem 1.25rem;
  color: #536179;
  font-size: 0.9rem;
  text-align: center;
  margin: 0;
}

/* Noga */
.cmd-footer {
  display: flex;
  gap: 1rem;
  padding: 0.6rem 1.25rem;
  border-top: 1.5px solid var(--color-border);
  background: #f0f4fa;
  font-size: 0.78rem;
  color: #536179;
}
.cmd-footer kbd {
  background: #fff;
  border: 1px solid #a8bcd4;
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
  font-size: 0.7rem;
  font-family: monospace;
  color: #475569;
}

/* ══════════════════════════════════════════════════════════════
   SHORTCUTS OVERLAY
══════════════════════════════════════════════════════════════ */

.shortcuts-overlay {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(700px, 96vw);
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 32px 80px rgba(0,0,0,.2);
  z-index: 910;
  animation: cmdSlideIn 0.15s cubic-bezier(.175,.885,.32,1.1);
}
.shortcuts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}
.shortcuts-title { font-size: 1.1rem; font-weight: 700; margin: 0; }
.shortcuts-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: #f8fafc;
  cursor: pointer;
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  color: var(--color-muted);
  transition: background 0.12s, color 0.12s;
}
.shortcuts-close:hover { background: #fee2e2; color: #ef4444; border-color: #fca5a5; }

.shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0;
  padding: 1rem 0.5rem 1.5rem;
}
.shortcuts-group {
  padding: 0.75rem 1rem;
}
.shortcuts-group-label {
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #94a3b8;
  margin: 0 0 0.6rem;
}
.shortcut-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0;
  font-size: 0.87rem;
  color: var(--color-text);
}
.shortcut-row kbd {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0.1rem 0.45rem;
  font-size: 0.75rem;
  font-family: monospace;
  color: #334155;
  min-width: 1.6rem;
  text-align: center;
  flex-shrink: 0;
}
.shortcut-row span { color: var(--color-muted); margin-left: 0.25rem; }

/* ══════════════════════════════════════════════════════════════
   KOLEDAR TERMINOV  – schedule.html
══════════════════════════════════════════════════════════════ */

.cal-page {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: var(--layout-pad-y) 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

/* Glava */
.cal-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.cal-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0.15rem 0 0;
  color: var(--color-text);
}
.cal-header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

/* Navigacija mesec */
.cal-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.cal-nav-btn {
  width: 34px; height: 34px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: var(--color-text);
  text-decoration: none;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  flex-shrink: 0;
}
.cal-nav-btn:hover { background: var(--color-primary-soft); border-color: var(--color-primary); color: var(--color-primary); }
.cal-month-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  min-width: 180px;
  text-align: center;
}
.cal-today-btn {
  padding: 0.28rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: 7px;
  background: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
  transition: background 0.12s, border-color 0.12s;
}
.cal-today-btn:hover { background: var(--color-primary-soft); border-color: var(--color-primary); }
.cal-count-badge {
  margin-left: auto;
  font-size: 0.82rem;
  color: var(--color-muted);
  background: var(--color-primary-soft);
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-weight: 600;
}

/* Legenda */
.cal-legend {
  display: flex;
  gap: 1.1rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--color-muted);
}
.cal-legend-item { display: flex; align-items: center; gap: 0.35rem; }
.cal-legend-dot {
  width: 10px; height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* Mreža */
.cal-grid-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  min-width: 840px;
}

/* Glave stolpcev */
.cal-col-head {
  padding: 0.55rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-muted);
  border-bottom: 2px solid var(--color-border);
  text-align: center;
  background: #f8fafc;
}
.cal-col-head--weekend { color: #94a3b8; }

/* Celice */
.cal-cell {
  min-height: 110px;
  border-right: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: 0.35rem 0.4rem;
  vertical-align: top;
  background: #fff;
  transition: background 0.1s;
}
.cal-cell:nth-child(7n) { border-right: none; }
.cal-grid > .cal-cell:nth-last-child(-n+7) { border-bottom: none; }

.cal-cell--empty { background: #fbfcfe; }
.cal-cell--weekend { background: #fafbfc; }
.cal-cell--today { background: #eff6ff !important; }
.cal-cell--has-events { }

/* Glava celice */
.cal-cell-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.3rem;
}
.cal-day-num {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-muted);
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
}
.cal-day-today {
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
}
.cal-event-count {
  font-size: 0.68rem;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
  font-weight: 700;
}

/* Dogodki */
.cal-cell-events {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}
.cal-ev {
  display: flex;
  flex-direction: column;
  padding: 0.25rem 0.45rem;
  border-radius: 5px;
  font-size: 0.73rem;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: filter 0.1s, transform 0.1s;
  overflow: hidden;
  cursor: pointer;
}
.cal-ev:hover { filter: brightness(0.95); transform: translateX(1px); }
.cal-ev-time { font-weight: 700; font-size: 0.68rem; opacity: .85; }
.cal-ev-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev-car  { font-size: 0.68rem; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev-desc { font-size: 0.65rem; opacity: .8; font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.cal-ev-hour-desc { font-size: 0.75rem; opacity: .85; font-style: italic; padding-top: 0.15rem; line-height: 1.35; }

/* + Gumb na dan celici (mesečni pogled) */
.cal-cell-add-btn {
  display: none;
  margin-left: auto;
  font-size: 1rem;
  line-height: 1;
  color: var(--color-primary);
  padding: 0 0.25rem;
  border-radius: 4px;
  text-decoration: none;
  opacity: .75;
  transition: opacity 0.15s;
}
.cal-cell:hover .cal-cell-add-btn { display: inline-flex; align-items: center; }
.cal-cell-add-btn:hover { opacity: 1; background: var(--color-primary-soft); }

/* + Gumb na dan stolpec (tedenski pogled) */
.cal-week-add-btn {
  display: none;
  font-size: 0.72rem;
  color: var(--color-primary);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  border: 1px dashed var(--color-primary);
  text-decoration: none;
  margin-top: 0.35rem;
  opacity: .75;
  transition: opacity 0.15s, background 0.15s;
  white-space: nowrap;
}
.cal-week-day-col:hover .cal-week-add-btn { display: inline-flex; align-items: center; gap: 0.25rem; }
.cal-week-add-btn:hover { opacity: 1; background: var(--color-primary-soft); }

/* Izbor termina iz tedna (pick mode) — vedno viden */
.cal-week-pick-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: #1e40af;
  background: #dbeafe;
  border: 1.5px solid #3b82f6;
  border-radius: 6px;
  padding: 0.2rem 0.45rem;
  text-decoration: none;
  margin-top: 0.35rem;
  transition: background 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.cal-week-pick-btn:hover {
  background: #bfdbfe;
  border-color: #2563eb;
}

/* Izbor termina iz meseca (pick mode) */
.cal-cell-pick-btn {
  display: inline-flex;
  align-items: center;
  font-size: 0.62rem;
  font-weight: 600;
  color: #1e40af;
  background: #dbeafe;
  border: 1px solid #3b82f6;
  border-radius: 4px;
  padding: 0.1rem 0.3rem;
  text-decoration: none;
  margin-left: 0.2rem;
  vertical-align: middle;
  line-height: 1.2;
}
.cal-cell-pick-btn:hover {
  background: #bfdbfe;
}

/* + Gumb na uro (dnevni pogled) */
.cal-hour-add-btn {
  display: none;
  font-size: 1rem;
  line-height: 1;
  color: var(--color-primary);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  text-decoration: none;
  opacity: .7;
  align-self: flex-start;
  transition: opacity 0.15s;
}
.cal-hour-events:hover .cal-hour-add-btn { display: inline-flex; align-items: center; }
.cal-hour-add-btn:hover { opacity: 1; background: var(--color-primary-soft); }

/* ── Picker mode ─────────────────────────────────────────── */
.pick-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1.5px solid #3b82f6;
  border-radius: 0.75rem;
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
}
.pick-banner-left {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}
.pick-banner-icon { font-size: 1.5rem; flex-shrink: 0; }
.pick-banner-left strong {
  display: block;
  font-size: 0.92rem;
  color: #1e40af;
  margin-bottom: 0.15rem;
}
.pick-banner-left span {
  font-size: 0.8rem;
  color: #1d4ed8;
}
.pick-banner-cancel {
  flex-shrink: 0;
  font-size: 0.8rem;
  color: #6b7280;
  text-decoration: none;
  padding: 0.3rem 0.65rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  transition: background 0.12s;
}
.pick-banner-cancel:hover { background: #f3f4f6; }

.pick-hour-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #1e40af;
  background: #dbeafe;
  border: 1.5px solid #3b82f6;
  border-radius: 6px;
  padding: 0.25rem 0.65rem;
  text-decoration: none;
  margin-left: 0.4rem;
  transition: background 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.pick-hour-btn:hover {
  background: #bfdbfe;
  border-color: #2563eb;
}

/* Gumb na novi nalog formi */
.pick-slot-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.45rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #1e40af;
  background: #eff6ff;
  border: 1.5px solid #93c5fd;
  border-radius: 6px;
  padding: 0.3rem 0.75rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.pick-slot-btn:hover {
  background: #dbeafe;
  border-color: #3b82f6;
}

/* 📋 Assign gumbi (📋 ikona) — mesec, teden, dan */
.cal-cell-assign-btn,
.cal-week-assign-btn,
.cal-day-assign-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--color-primary);
  padding: 0.1rem 0.25rem;
  border-radius: 4px;
  line-height: 1;
  opacity: .75;
  transition: opacity 0.15s, background 0.12s;
  flex-shrink: 0;
}
.cal-cell:hover .cal-cell-assign-btn        { display: inline-flex; align-items: center; }
.cal-week-day-head:hover .cal-week-assign-btn { display: inline-flex; align-items: center; }
.cal-cell-assign-btn:hover,
.cal-week-assign-btn:hover,
.cal-day-assign-btn:hover { opacity: 1; background: var(--color-primary-soft); }

/* Dan pogled: assign gumb vedno viden */
.cal-day-assign-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--color-primary);
  border-radius: 6px;
  margin-left: auto;
  opacity: 1;
}

/* ═══════════════ SLIDE-IN PANEL (SDP) ═══════════════ */
[x-cloak] { display: none !important; }

.sdp-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 900;
  display: flex;
  justify-content: flex-end;
}

.sdp-panel {
  width: 400px;
  max-width: 92vw;
  height: 100%;
  background: #fff;
  box-shadow: -6px 0 28px rgba(0, 0, 0, 0.16);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: sdp-slide-in 0.22s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
@keyframes sdp-slide-in {
  from { transform: translateX(100%); opacity: 0.6; }
  to   { transform: translateX(0);    opacity: 1;   }
}

.sdp-panel-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem 0.85rem;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}
.sdp-panel-title {
  flex: 1;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}
.sdp-panel-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
  color: var(--color-muted, #6b7280);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  line-height: 1;
  transition: background 0.12s, color 0.12s;
}
.sdp-panel-close:hover { background: #f3f4f6; color: #111; }

.sdp-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem 2rem;
}

/* ── Panel vsebina ── */
.sdp-date-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
  font-size: 0.92rem;
  color: var(--color-text);
}
.sdp-today-count {
  font-size: 0.78rem;
  color: var(--color-muted, #6b7280);
  background: #f3f4f6;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
}

.sdp-new-wrap {
  margin-bottom: 1rem;
}
.sdp-new-btn {
  display: inline-block;
  background: var(--color-primary);
  color: #fff;
  text-decoration: none;
  border-radius: 7px;
  padding: 0.45rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  transition: filter 0.15s;
}
.sdp-new-btn:hover { filter: brightness(1.1); }

.sdp-booking-quick {
  margin: 0 0 1.25rem;
  padding: 0.85rem 0.9rem;
  border: 1px dashed #94a3b8;
  border-radius: 10px;
  background: #f8fafc;
  display: grid;
  gap: 0.45rem;
}
.sdp-booking-quick .sdp-section-title { margin: 0 0 0.15rem; }
.sdp-booking-row {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.55fr;
  gap: 0.4rem;
}
@media (max-width: 420px) {
  .sdp-booking-row { grid-template-columns: 1fr; }
}

.sdp-section {
  margin-bottom: 1.25rem;
}
.sdp-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-muted, #6b7280);
  margin: 0 0 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: default;
}
.sdp-section-title--toggle { cursor: pointer; }
.sdp-toggle-icon { margin-left: auto; transition: transform 0.2s; }
.sdp-section--other.sdp-collapsed .sdp-toggle-icon  { transform: rotate(-90deg); }
.sdp-section--other.sdp-collapsed .sdp-section-body { display: none; }

.sdp-count-badge {
  background: var(--color-primary-soft, #e8f0ff);
  color: var(--color-primary);
  border-radius: 10px;
  padding: 0.05rem 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
}

/* Posamezna vrstica naloga */
.sdp-order-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.55rem 0.65rem;
  border-radius: 7px;
  border: 1px solid var(--color-border);
  margin-bottom: 0.45rem;
  background: #fafafa;
  transition: background 0.12s;
}
.sdp-order-row:hover { background: #f0f4ff; }
.sdp-order-row--today {
  background: #f0fdf4;
  border-color: #86efac;
}

.sdp-order-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}
.sdp-order-code {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 0.03em;
}
.sdp-order-time {
  font-size: 0.72rem;
  font-weight: 700;
  color: #16a34a;
}
.sdp-order-date {
  font-size: 0.7rem;
  color: var(--color-muted, #6b7280);
  font-weight: 600;
}
.sdp-order-customer {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sdp-order-car {
  font-size: 0.72rem;
  color: var(--color-muted, #6b7280);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sdp-order-desc {
  font-size: 0.72rem;
  font-style: italic;
  color: #374151;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sdp-order-link {
  color: var(--color-primary);
  text-decoration: none;
  font-size: 1rem;
  line-height: 1;
  padding: 0.2rem 0.3rem;
  border-radius: 4px;
  align-self: center;
  flex-shrink: 0;
}
.sdp-order-link:hover { background: var(--color-primary-soft); }

/* Assign gumbi v panelu */
.sdp-assign-btn {
  border: none;
  cursor: pointer;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  flex-shrink: 0;
  align-self: center;
  transition: filter 0.12s, background 0.12s;
  white-space: nowrap;
}
.sdp-assign-btn--primary {
  background: var(--color-primary);
  color: #fff;
}
.sdp-assign-btn--primary:hover { filter: brightness(1.1); }
.sdp-assign-btn--ghost {
  background: transparent;
  color: var(--color-primary);
  border: 1.5px solid var(--color-primary);
}
.sdp-assign-btn--ghost:hover { background: var(--color-primary-soft); }

/* Nalaganje in prazno stanje */
.sdp-loading {
  text-align: center;
  padding: 2rem;
  color: var(--color-muted, #6b7280);
  font-size: 0.9rem;
}
.sdp-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--color-muted, #6b7280);
}
.sdp-section--today .sdp-section-title { color: #16a34a; }



/* Barve po statusu */
.cal-ev--new {
  background: #eff6ff;
  border-left-color: #3b82f6;
  color: #1e3a8a;
}
.cal-ev--scheduled {
  background: #f0fdf4;
  border-left-color: #22c55e;
  color: #14532d;
}
.cal-ev--progress {
  background: #fff7ed;
  border-left-color: #f97316;
  color: #7c2d12;
}
.cal-ev--waiting {
  background: #fefce8;
  border-left-color: #eab308;
  color: #713f12;
}
.cal-ev--done {
  background: #f0fdf4;
  border-left-color: #16a34a;
  color: #166534;
  opacity: .75;
}
.cal-ev--paid {
  background: #f0fdfa;
  border-left-color: #14b8a6;
  color: #115e59;
  opacity: .85;
}
.cal-ev--cancelled {
  background: #fef2f2;
  border-left-color: #ef4444;
  color: #7f1d1d;
  opacity: .6;
}
.cal-ev--booking {
  background: #f8fafc;
  border-left-color: #64748b;
  border-style: dashed;
  color: #334155;
}
.cal-ev--booking .cal-ev-name { font-style: italic; }
.cal-ev--booking-stale {
  background: #fff7ed;
  border-left-color: #ea580c;
  color: #9a3412;
}

.cal-stale-banner {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-left: 4px solid #ea580c;
  border-radius: 10px;
}
.cal-stale-banner-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-bottom: 0.55rem;
}
.cal-stale-banner-text strong { font-size: 0.92rem; color: #9a3412; }
.cal-stale-banner-text span { font-size: 0.82rem; color: #c2410c; }
.cal-stale-list { display: flex; flex-direction: column; gap: 0.35rem; }
.cal-stale-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.84rem;
}
.cal-stale-item span { flex: 1; min-width: 140px; }

/* Iste barve za legendne pike */
.cal-legend-dot.cal-ev--new       { background: #3b82f6; }
.cal-legend-dot.cal-ev--scheduled { background: #22c55e; }
.cal-legend-dot.cal-ev--progress  { background: #f97316; }
.cal-legend-dot.cal-ev--waiting   { background: #eab308; }
.cal-legend-dot.cal-ev--done      { background: #16a34a; }
.cal-legend-dot.cal-ev--paid     { background: #14b8a6; }
.cal-legend-dot.cal-ev--booking  { background: #64748b; border: 1px dashed #94a3b8; }

.cal-ev-booking-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.2rem;
  flex-wrap: wrap;
}
.cal-ev-booking-actions a,
.cal-ev-booking-actions button {
  font-size: 0.72rem;
  padding: 0.05rem 0.3rem;
  border: none;
  background: transparent;
  color: #475569;
  cursor: pointer;
  text-decoration: underline;
}
.cal-ev-booking-actions form { display: inline; margin: 0; }
.cal-ev-booking-actions--hour { margin-top: 0.45rem; gap: 0.5rem; }
.cal-booking-pill {
  background: #e2e8f0 !important;
  color: #334155 !important;
}

.cal-booking-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 42, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.cal-booking-modal {
  background: #fff;
  border-radius: 12px;
  width: min(440px, 100%);
  padding: 1.25rem 1.35rem;
  box-shadow: 0 16px 40px rgba(0,0,0,.18);
}
.cal-booking-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}
.cal-booking-head h3 {
  margin: 0;
  font-size: 1.1rem;
}
.cal-booking-hint {
  margin: 0 0 1rem;
  color: var(--color-muted, #64748b);
  font-size: 0.88rem;
}
.cal-booking-form .form-label { margin-top: 0.65rem; display: block; }
.cal-booking-row {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 0.7fr;
  gap: 0.65rem;
  margin-top: 0.25rem;
}
@media (max-width: 520px) {
  .cal-booking-row { grid-template-columns: 1fr; }
}
.cal-booking-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1.1rem;
}

/* Nalogi brez termina */
.cal-unscheduled {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  overflow: hidden;
}
.cal-unscheduled-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  background: #fafbfd;
}
.cal-unscheduled-icon { font-size: 1.3rem; }
.cal-unscheduled-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.cal-unscheduled-sub { font-size: 0.8rem; color: var(--color-muted); margin: 0 0 0 auto; }

.cal-unscheduled-list {
  display: flex;
  flex-direction: column;
}
.cal-unsch-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 1.25rem;
  text-decoration: none;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
  transition: background 0.1s;
}
.cal-unsch-card:last-child { border-bottom: none; }
.cal-unsch-card:hover { background: var(--color-primary-soft); }
.cal-unsch-code {
  font-size: 0.75rem;
  font-family: monospace;
  color: var(--color-muted);
  background: #f1f5f9;
  padding: 0.15rem 0.5rem;
  border-radius: 5px;
  white-space: nowrap;
  flex-shrink: 0;
}
.cal-unsch-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.cal-unsch-body strong { font-size: 0.9rem; font-weight: 600; }
.cal-unsch-car { font-size: 0.78rem; color: var(--color-muted); }

/* Status pill za unscheduled */
.status-pill {
  font-size: 0.73rem;
  font-weight: 600;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}
.status-pill.status-new       { background: #eff6ff; color: #1d4ed8; }
.status-pill.status-scheduled { background: #f0fdf4; color: #15803d; }
.status-pill.status-in_progress { background: #fff7ed; color: #c2410c; }
.status-pill.status-waiting_parts { background: #fefce8; color: #a16207; }
.status-pill.status-completed { background: #f0fdf4; color: #166534; }
.status-pill.status-cancelled { background: #fef2f2; color: #b91c1c; }

.priority-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.priority-dot.priority-low    { background: #94a3b8; }
.priority-dot.priority-normal { background: #22c55e; }
.priority-dot.priority-high   { background: #f97316; }
.priority-dot.priority-urgent { background: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,.25); }

/* Mobilni odziv */
@media (max-width: 960px) {
  .cal-page { padding: 1rem; }
  .cal-month-title { min-width: 140px; font-size: 1rem; }
  .cal-unscheduled-sub { display: none; }
}
@media (max-width: 640px) {
  .cal-header { flex-direction: column; align-items: flex-start; }
  .cal-legend { gap: 0.65rem; }
  .cal-count-badge { margin-left: 0; }
}

/* ══════════════════════════════════════════════════════════════
   TOOLBAR  (nav + view-switch skupaj)
══════════════════════════════════════════════════════════════ */
.cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Stikalo pogled */
.cal-view-switch {
  display: flex;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  flex-shrink: 0;
}
.cal-view-btn {
  padding: 0.35rem 0.85rem;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--color-muted);
  text-decoration: none;
  border-right: 1px solid var(--color-border);
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
}
.cal-view-btn:last-child { border-right: none; }
.cal-view-btn:hover { background: var(--color-primary-soft); color: var(--color-primary); }
.cal-view-btn--active {
  background: var(--color-primary);
  color: #fff;
}

/* ══════════════════════════════════════════════════════════════
   TEDENSKI POGLED  (.cal-week-*)
══════════════════════════════════════════════════════════════ */
.cal-week-wrap {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow-x: auto;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  -webkit-overflow-scrolling: touch;
}

/* Skupna rešetka: gutter + 7 stolpcev */
.cal-week-head-row,
.cal-week-body-row {
  display: grid;
  grid-template-columns: 52px repeat(7, minmax(110px, 1fr));
  min-width: 820px;
}

/* Glava dni */
.cal-week-time-gutter { /* prazen prostor levo */ }
.cal-week-day-head {
  padding: 0.55rem 0.5rem;
  border-left: 1px solid var(--color-border);
  border-bottom: 2px solid var(--color-border);
  text-align: center;
  background: #f8fafc;
  position: relative;
}
.cal-week-day-head--today { background: #eff6ff; }
.cal-week-day-head--weekend { background: #fafbfc; }

.cal-week-day-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  text-decoration: none;
  color: var(--color-text);
}
.cal-week-day-name { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--color-muted); }
.cal-week-day-num {
  font-size: 1.15rem; font-weight: 700;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--color-text);
}
.cal-week-day-num--today { background: var(--color-primary); color: #fff; }
.cal-week-day-count {
  position: absolute;
  top: 0.3rem; right: 0.35rem;
  font-size: 0.65rem; font-weight: 700;
  background: var(--color-primary);
  color: #fff;
  border-radius: 999px;
  padding: 0.05rem 0.35rem;
}

/* Telo dni */
.cal-week-time-gutter--label {
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
  color: var(--color-muted); writing-mode: vertical-rl;
  padding: 0.75rem 0.4rem;
  border-bottom: 1px solid var(--color-border);
  letter-spacing: .05em;
}
.cal-week-day-col {
  border-left: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: 0.5rem 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-height: 80px;
  background: #fff;
}
.cal-week-day-col--today  { background: #eff6ff; }
.cal-week-day-col--weekend { background: #fafbfc; }
.cal-week-empty { color: #cbd5e1; font-size: 0.85rem; text-align: center; padding: 0.75rem 0; }
.cal-ev--week { padding: 0.35rem 0.55rem; }

/* ══════════════════════════════════════════════════════════════
   DNEVNI (URNI) POGLED  (.cal-day-*)
══════════════════════════════════════════════════════════════ */
.cal-day-wrap {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}

.cal-day-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.25rem;
  border-bottom: 2px solid var(--color-border);
  background: #f8fafc;
  flex-wrap: wrap;
}
.cal-day-big-name {
  font-size: 0.75rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .08em; color: var(--color-muted);
}
.cal-day-big-date {
  font-size: 1.1rem; font-weight: 700; color: var(--color-text);
}
.cal-day-big-date--today { color: var(--color-primary); }
.cal-day-empty-hint { font-size: 0.82rem; color: #94a3b8; margin-left: auto; }

/* Urna mreža */
.cal-day-grid {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  max-height: 70vh;
}

/* Cela ura */
.cal-hour-row {
  display: grid;
  grid-template-columns: 56px 1fr;
  border-bottom: 1px solid var(--color-border);
  min-height: 56px;
  transition: background 0.1s;
}
.cal-hour-row:hover { background: #fafcff; }
.cal-hour-row--current { background: #eff6ff; }
.cal-hour-row--current .cal-hour-label { color: var(--color-primary); font-weight: 700; }

/* Polura */
.cal-half-row {
  display: grid;
  grid-template-columns: 56px 1fr;
  min-height: 32px;
  border-bottom: 1px dashed #e2e8f0;
}

.cal-hour-label {
  padding: 0.35rem 0.6rem 0 0;
  font-size: 0.72rem; font-weight: 600;
  color: var(--color-muted);
  text-align: right;
  white-space: nowrap;
  user-select: none;
  border-right: 1px solid var(--color-border);
  padding-top: 0.45rem;
}
.cal-hour-label--half {
  font-size: 0.65rem; color: #cbd5e1; font-weight: 400;
}

.cal-hour-events {
  padding: 0.3rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.cal-hour-events--half { background: transparent; }
.cal-hour-empty { min-height: 16px; }

/* Urni event card */
.cal-ev--hour {
  padding: 0.45rem 0.65rem;
  border-radius: 7px;
  flex-direction: column;
  gap: 0.2rem;
}
.cal-ev-hour-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.cal-ev-hour-head .cal-ev-name {
  font-size: 0.9rem; font-weight: 700;
  white-space: normal;
}
.cal-ev-hour-body {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  font-size: 0.78rem;
}

/* Mobilni odziv za tedenski/dnevni */
@media (max-width: 960px) {
  .cal-toolbar { flex-direction: column; align-items: flex-start; }
  .cal-week-wrap { font-size: 0.8rem; }
  .cal-day-grid { max-height: 60vh; }
}
@media (max-width: 640px) {
  .cal-view-switch { width: 100%; }
  .cal-view-btn { flex: 1; text-align: center; }
  .cal-week-head-row, .cal-week-body-row { grid-template-columns: 36px repeat(7, minmax(80px,1fr)); }
}

/* ═══════════════════════════════════════════════════════
   COMBOBOX — stranka & vozilo (workorder_form)
═══════════════════════════════════════════════════════ */
.combo-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.combo-wrap .combo-input {
  flex: 1;
  min-width: 0;
  padding-right: 2.2rem;   /* prostor za × gumb */
}
.combo-clear {
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.05rem;
  color: var(--color-muted, #6b7280);
  width: 1.6rem;
  height: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding: 0;
  line-height: 1;
  transition: background 0.12s, color 0.12s;
}
.combo-clear:hover { background: #f3f4f6; color: #111; }

.combo-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 300;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 0.7rem;
  box-shadow: 0 8px 28px rgba(0,0,0,0.13);
  max-height: 340px;
  overflow-y: auto;
  padding: 0.3rem 0;
  scroll-behavior: smooth;
}
.combo-option {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.48rem 0.85rem;
  transition: background 0.1s;
}
.combo-option:hover,
.combo-option:focus { background: var(--color-primary-soft, #e8f0ff); outline: none; }
.combo-opt-main {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.combo-opt-sub {
  font-size: 0.75rem;
  color: var(--color-muted, #6b7280);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.combo-loading,
.combo-empty {
  padding: 0.75rem 0.9rem;
  font-size: 0.83rem;
  color: var(--color-muted, #6b7280);
  text-align: center;
}
.combo-empty a {
  color: var(--color-primary);
  text-decoration: none;
  margin-left: 0.3rem;
}
.combo-empty a:hover { text-decoration: underline; }

/* Gumb za podrobnosti pod comboboxom */
.combo-detail-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.45rem;
  font-size: 0.78rem;
  color: var(--color-primary);
  text-decoration: none;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--color-primary);
  border-radius: 6px;
  background: var(--color-primary-soft, #e8f0ff);
  font-weight: 500;
  transition: background 0.12s, filter 0.12s;
  align-self: flex-start;
}
.combo-detail-btn:hover {
  background: #d0e2ff;
  filter: brightness(0.97);
}

/* ═══════════════════════════════════════════════════════════════
   KANBAN TABLA
═══════════════════════════════════════════════════════════════ */

.kanban-board {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  overflow-x: auto;
  padding-bottom: 1.5rem;
  min-height: calc(100vh - 160px);
}

.kanban-col {
  flex: 0 0 280px;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.kanban-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.85rem;
  border-radius: 0.75rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.kanban-col-head--blue   { background: #dbeafe; color: #1e40af; }
.kanban-col-head--purple { background: #ede9fe; color: #6d28d9; }
.kanban-col-head--amber  { background: #fef3c7; color: #92400e; }
.kanban-col-head--orange { background: #ffedd5; color: #9a3412; }
.kanban-col-head--green  { background: #dcfce7; color: #166534; }
.kanban-col-head--teal   { background: #ccfbf1; color: #0f766e; }

.kanban-col-badge {
  background: rgba(0,0,0,.12);
  border-radius: 99px;
  padding: 0 0.55rem;
  font-size: 0.78rem;
  font-weight: 800;
  min-width: 1.6rem;
  text-align: center;
}

.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-height: 80px;
  border-radius: 0.75rem;
  padding: 0.35rem 0;
  transition: background .15s;
}
.kanban-cards.kanban-over {
  background: #f0f7ff;
  outline: 2px dashed #93c5fd;
  outline-offset: -2px;
}

.kanban-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-left: 4px solid #d1dce8;
  border-radius: 0.85rem;
  padding: 0.85rem 1rem;
  cursor: grab;
  box-shadow: 0 2px 8px rgba(15,23,42,.06);
  transition: box-shadow .15s, transform .1s;
  user-select: none;
}
.kanban-card:hover { box-shadow: 0 6px 20px rgba(15,23,42,.11); }
.kanban-card--dragging {
  opacity: 0.6;
  box-shadow: 0 12px 32px rgba(31,100,255,.18);
  transform: rotate(1.5deg) scale(1.02);
}
.kanban-card--urgent  { border-left-color: #dc2626; }
.kanban-card--high    { border-left-color: #f97316; }
.kanban-card--normal  { border-left-color: #2563eb; }
.kanban-card--low     { border-left-color: #6b7280; }

.kanban-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
}
.kanban-card-code {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--color-primary);
  text-decoration: none;
}
.kanban-card-code:hover { text-decoration: underline; }
.kanban-card-priority { font-size: 0.85rem; }

.kanban-card-desc {
  font-size: 0.82rem;
  color: var(--color-text);
  margin: 0 0 0.5rem;
  line-height: 1.45;
}

.kanban-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}
.kanban-meta-chip {
  font-size: 0.75rem;
  background: var(--color-surface, #f4f7fb);
  border: 1px solid var(--color-border);
  border-radius: 99px;
  padding: 0.15rem 0.55rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.kanban-card-footer {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.45rem;
}
.kanban-avatar {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.kanban-card-mechanic {
  font-size: 0.77rem;
  color: var(--color-muted);
}
.kanban-card-date {
  font-size: 0.75rem;
  color: var(--color-muted);
  margin-top: 0.35rem;
}
.kanban-empty {
  font-size: 0.82rem;
  color: var(--color-muted);
  text-align: center;
  padding: 1rem;
  border: 2px dashed var(--color-border);
  border-radius: 0.65rem;
}

/* ═══════════════════════════════════════════════════════════════
   SERVISNA KNJIŽICA TIMELINE
═══════════════════════════════════════════════════════════════ */

.service-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  padding-left: 1.5rem;
}
.service-timeline::before {
  content: '';
  position: absolute;
  left: 0.6rem;
  top: 0.75rem;
  bottom: 0.75rem;
  width: 2px;
  background: var(--color-border);
  border-radius: 2px;
}

.service-timeline-item {
  position: relative;
  padding-bottom: 1.25rem;
}
.service-timeline-item:last-child { padding-bottom: 0; }

.service-timeline-dot {
  position: absolute;
  left: -1.5rem;
  top: 0.7rem;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  background: var(--color-border);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--color-border);
}
.service-timeline-item--completed .service-timeline-dot { background: #16a34a; box-shadow: 0 0 0 2px #16a34a; }
.service-timeline-item--in_progress .service-timeline-dot { background: #2563eb; box-shadow: 0 0 0 2px #2563eb; animation: pulse-dot 1.5s infinite; }
.service-timeline-item--waiting_parts .service-timeline-dot { background: #d97706; box-shadow: 0 0 0 2px #d97706; }
.service-timeline-item--cancelled .service-timeline-dot { background: #9ca3af; box-shadow: 0 0 0 2px #9ca3af; }

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 2px #2563eb; }
  50% { box-shadow: 0 0 0 5px rgba(37,99,235,.25); }
}

.service-timeline-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 0.85rem;
  padding: 0.85rem 1rem;
  box-shadow: 0 2px 8px rgba(15,23,42,.04);
  transition: box-shadow .15s;
}
.service-timeline-card:hover { box-shadow: 0 6px 18px rgba(15,23,42,.09); }

.service-timeline-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.service-timeline-code {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--color-primary);
  text-decoration: none;
}
.service-timeline-code:hover { text-decoration: underline; }
.service-timeline-date { margin-left: auto; }

.service-timeline-desc {
  font-size: 0.86rem;
  color: var(--color-text);
  margin: 0 0 0.45rem;
}
.service-timeline-work {
  font-size: 0.82rem;
  color: #15803d;
  margin-bottom: 0.4rem;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.service-timeline-work-label {
  font-weight: 600;
  color: #166534;
}
.service-timeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}
.service-meta-chip {
  font-size: 0.75rem;
  background: var(--color-surface, #f4f7fb);
  border: 1px solid var(--color-border);
  border-radius: 99px;
  padding: 0.15rem 0.55rem;
}

/* ═══════════════════════════════════════════════════════════════
   FOTO GALERIJA
═══════════════════════════════════════════════════════════════ */

.wo-section--photos {
  border-radius: 0.65rem;
  background: #fff;
  border: 1px solid var(--color-border);
  padding: 0.35rem var(--panel-pad-x, 0.65rem) 0.45rem;
  margin-top: 0.85rem;
}

.photo-doc-form {
  margin: 0;
}

/* Ena kompaktna vrstica; ob izbiri datotek + napredek = druga vrstica (max ~2) */
.photo-doc-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.28rem 0.4rem;
  row-gap: 0.32rem;
  min-height: 2rem;
}

.photo-doc-icon {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
  opacity: 0.88;
}

.photo-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  padding: 0;
  border-radius: 0.5rem;
  font-size: 1.05rem;
  line-height: 1;
  flex-shrink: 0;
}

.photo-icon-btn.btn-primary:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.photo-upload-spinner {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
  animation: photo-spin 0.85s linear infinite;
}
@keyframes photo-spin {
  to { transform: rotate(360deg); }
}

.photo-file-input { display: none; }

.photo-caption-input {
  flex: 1 1 6rem;
  min-width: 4rem;
  max-width: 12rem;
  padding: 0.32rem 0.45rem;
  font-size: 0.82rem;
  min-height: 2.15rem;
}

.photo-file-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-top: 0.55rem;
  padding: 0.5rem 0.75rem;
  background: #f0f7ff;
  border: 1px solid #bfdbfe;
  border-radius: 0.6rem;
  font-size: 0.82rem;
}
.photo-file-list.photo-file-list--compact {
  margin-top: 0.28rem;
  padding: 0.2rem 0.35rem;
  gap: 0.22rem;
  border-radius: 0.45rem;
  font-size: 0.75rem;
  max-width: 100%;
}
.photo-file-count {
  font-weight: 800;
  color: var(--color-primary);
  margin-right: 0.15rem;
  white-space: nowrap;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}
.photo-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: #fff;
  border: 1px solid #bfdbfe;
  border-radius: 1rem;
  padding: 0.15rem 0.5rem;
  font-size: 0.78rem;
}
.photo-file-list--compact .photo-file-chip {
  padding: 0.06rem 0.2rem;
  border-radius: 0.35rem;
}
.photo-file-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-file-size { color: var(--color-muted); flex-shrink: 0; }
.photo-file-remove {
  background: none; border: none; cursor: pointer;
  font-size: 0.72rem; color: #6b7280; padding: 0.12rem 0.2rem;
  line-height: 1; flex-shrink: 0;
  border-radius: 0.25rem;
}
.photo-file-remove:hover { color: var(--color-danger, #dc2626); background: rgba(220,38,38,.08); }

/* Napredek nalaganja */
.photo-progress-wrap {
  position: relative;
  margin-top: 0.5rem;
  height: 22px;
  background: #e0f2fe;
  border-radius: 1rem;
  overflow: hidden;
}
.photo-progress-wrap.photo-progress-wrap--compact {
  margin-top: 0.28rem;
  height: 16px;
  border-radius: 0.5rem;
}
.photo-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #2563eb);
  border-radius: 1rem;
  transition: width 120ms linear;
}
.photo-progress-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #1e3a8a;
}
.photo-progress-wrap--compact .photo-progress-text {
  font-size: 0.62rem;
}

.photo-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.4rem;
  align-items: flex-start;
}
.photo-thumb {
  position: relative;
  width: 5.5rem;
  flex: 0 0 auto;
  border-radius: 0.45rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: #f8fafc;
  box-shadow: 0 1px 4px rgba(15,23,42,.06);
  transition: box-shadow .15s;
}
.photo-thumb:hover { box-shadow: 0 6px 18px rgba(15,23,42,.12); }

/* thumbnail button (ersetzt <a>) */
.photo-thumb-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: zoom-in;
  position: relative;
  overflow: hidden;
}
.photo-thumb-btn img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  transition: transform .2s;
}
.photo-thumb-btn:hover img { transform: scale(1.04); }
.photo-zoom-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.35);
  font-size: 0.95rem;
  opacity: 0;
  transition: opacity .15s;
}
.photo-thumb-btn:hover .photo-zoom-hint,
.photo-thumb:focus-within .photo-zoom-hint { opacity: 1; }

.photo-caption {
  font-size: 0.68rem;
  line-height: 1.3;
  padding: 0.25rem 0.35rem;
  color: #1e293b;
  font-weight: 600;
  margin: 0;
  background: rgba(255,255,255,0.92);
  border-top: 1px solid var(--color-border);
  border-radius: 0 0 0.45rem 0.45rem;
  word-break: break-word;
  max-height: 3.2em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
}

.photo-caption-tag {
  position: absolute;
  left: 0.15rem;
  bottom: 0.15rem;
  z-index: 2;
  font-size: 0.62rem;
  line-height: 1;
  padding: 0.1rem 0.18rem;
  border-radius: 0.25rem;
  background: rgba(255,255,255,.88);
  border: 1px solid rgba(0,0,0,.08);
  pointer-events: none;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}

.photo-delete-btn {
  position: absolute;
  top: 0.2rem;
  right: 0.2rem;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: rgba(220,38,38,.85);
  color: #fff;
  border: none;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .15s;
  z-index: 2;
}
.photo-thumb:hover .photo-delete-btn { opacity: 1; }
/* Na mobilnih napravah (touch) je delete gumb vedno viden */
@media (hover: none) {
  .photo-delete-btn { opacity: 1; background: rgba(220,38,38,.75); }
}
.photo-empty {
  flex: 1 1 100%;
  margin: 0;
  padding: 0.15rem 0;
  text-align: left;
  color: var(--color-muted);
  font-size: 0.72rem;
  line-height: 1.3;
}

/* ── Lightbox ─────────────────────────────────────────────── */
[x-cloak] {
  display: none !important;
}
.photo-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.88);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  animation: lb-in .12s ease;
}
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }
.photo-lightbox-img {
  max-width: min(95vw, 1200px);
  max-height: 90vh;
  object-fit: contain;
  border-radius: 0.5rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  cursor: default;
}
.photo-lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  border: 1.5px solid rgba(255,255,255,.3);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
  z-index: 9999;
}
.photo-lightbox-close:hover { background: rgba(255,255,255,.28); }

.photo-lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10000;
  width: 2.75rem;
  height: 3.25rem;
  border: none;
  border-radius: 0.35rem;
  background: rgba(0,0,0,.45);
  color: #fff;
  font-size: 2.1rem;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 0.15rem;
  transition: background .15s, transform .15s;
  box-shadow: 0 4px 14px rgba(0,0,0,.35);
}
.photo-lightbox-nav:hover {
  background: rgba(255,255,255,.22);
  color: #0f172a;
}
.photo-lightbox-prev { left: max(0.35rem, env(safe-area-inset-left)); }
.photo-lightbox-next { right: max(0.35rem, env(safe-area-inset-right)); }

.photo-lightbox-counter {
  position: fixed;
  bottom: 2.35rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(255,255,255,.92);
  background: rgba(0,0,0,.5);
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  pointer-events: none;
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.photo-lightbox-caption {
  position: fixed;
  bottom: 3.2rem;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(90vw, 560px);
  text-align: center;
  background: rgba(0,0,0,0.72);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  border-radius: 0.5rem;
  margin: 0;
  pointer-events: none;
}
.photo-lightbox-hint {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: .78rem;
  color: rgba(255,255,255,.5);
  pointer-events: none;
  margin: 0;
}

/* ── foto dokumentacija: ohranimo max ~2 vrstice orodja ───── */
@media (max-width: 540px) {
  .photo-caption-input {
    max-width: none;
    flex: 1 1 40%;
  }
  .photo-thumb {
    width: 4.8rem;
  }
}

/* ═══════════════════════════════════════════════════════════════
   STAFF / MEHANIKI
═══════════════════════════════════════════════════════════════ */

.staff-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 0.25rem;
}
.staff-kpi-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 0.85rem;
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  box-shadow: 0 2px 8px rgba(15,23,42,.05);
}
.staff-kpi-card--warn { border-left: 4px solid #d97706; }
.staff-kpi-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--color-text);
  line-height: 1.1;
}
.staff-kpi-label {
  font-size: 0.78rem;
  color: var(--color-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.staff-mechanic-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.staff-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.staff-avatar--sm {
  width: 1.75rem;
  height: 1.75rem;
  font-size: 0.66rem;
}

.staff-progress-bar {
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  margin-top: 3px;
  overflow: hidden;
}
.staff-progress-fill {
  height: 100%;
  background: #2563eb;
  border-radius: 2px;
  transition: width .4s;
}
.staff-progress-fill--over { background: #dc2626; }

/* Staff table + day strip + detail */
.staff-panel { overflow-x: auto; }
.staff-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.staff-table th, .staff-table td { padding: 0.65rem 0.75rem; text-align: left; border-bottom: 1px solid var(--color-border); }
.staff-table th { font-weight: 600; color: var(--color-muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.staff-table thead tr { background: #f8fafc; }
.staff-th-mechanic { min-width: 180px; }
.staff-th-calendar { min-width: 200px; }
.staff-td-money { font-variant-numeric: tabular-nums; font-weight: 600; }
.staff-day-strip { display: flex; flex-wrap: wrap; gap: 2px; }
.staff-day-cell {
  width: 28px; height: 36px; border-radius: 4px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #f1f5f9; color: var(--color-muted); font-size: 0.7rem; font-weight: 600;
  transition: background 0.15s, color 0.15s;
}
.staff-day-cell--has-work { background: rgba(31, 100, 255, 0.15); color: var(--color-primary); }
.staff-day-cell--has-work:hover { background: rgba(31, 100, 255, 0.3); }
.staff-day-cell--today { box-shadow: 0 0 0 2px var(--color-primary); }
.staff-day-num { font-size: 0.65rem; line-height: 1; }
.staff-day-badge { font-size: 0.6rem; background: var(--color-primary); color: #fff; border-radius: 999px; padding: 0 4px; margin-top: 1px; }
.staff-day-hours { font-size: 0.6rem; opacity: 0.85; }
.staff-detail-row { background: #f8fafc; }
.staff-detail-cell { padding: 1rem 1.25rem !important; border-bottom: 1px solid var(--color-border); }
.staff-detail-header { font-size: 0.9rem; margin-bottom: 0.75rem; color: var(--color-text); }
.staff-detail-list { display: flex; flex-direction: column; gap: 0.35rem; }
.staff-detail-item {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0.75rem;
  background: #fff; border-radius: 0.5rem; border: 1px solid var(--color-border);
  text-decoration: none; color: inherit; transition: background 0.15s, border-color 0.15s;
}
.staff-detail-item:hover { background: var(--color-primary-soft); border-color: rgba(31, 100, 255, 0.3); }
.staff-detail-code { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 6ch; }
.panel-subtitle { margin: 0.25rem 0 0; font-size: 0.82rem; }

/* ═══════════════════════════════════════════════════════════════
   PAGE HEADER (universal)
═══════════════════════════════════════════════════════════════ */

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.page-header-left { display: flex; flex-direction: column; gap: 0.2rem; }
.page-title { font-size: 1.45rem; font-weight: 800; margin: 0; }
.page-subtitle { margin: 0; }
.page-header-actions { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }

/* Badges extra classes */
.badge--new           { background: #bfdbfe; color: #1e3a8a; border-color: rgba(30,58,138,0.30); font-weight: 700; }
.badge--scheduled     { background: #ddd6fe; color: #4c1d95; border-color: rgba(76,29,149,0.28); font-weight: 700; }
.badge--in_progress   { background: #fde68a; color: #78350f; border-color: rgba(120,53,15,0.28); font-weight: 700; }
.badge--waiting_parts { background: #fed7aa; color: #7c2d12; border-color: rgba(124,45,18,0.28); font-weight: 700; }
.badge--completed     { background: #bbf7d0; color: #14532d; border-color: rgba(20,83,45,0.25); font-weight: 700; }
.badge--paid         { background: #99f6e4; color: #134e4a; border-color: rgba(19,78,74,0.28); font-weight: 700; }
.badge--cancelled     { background: #e2e8f0; color: #475569; border-color: rgba(71,85,105,0.22); font-weight: 600; }

/* ══════════════════════════════════════════════════════════════
   SUBNAV — temna tab vrstica pod topbarom (po celotni širini)
   ══════════════════════════════════════════════════════════════ */
.subnav {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 0;
  padding: 0 0.75rem 0 0.5rem;
  padding-top: env(safe-area-inset-top, 0px);
  box-sizing: border-box;
  min-height: calc(52px + env(safe-area-inset-top, 0px));
  background: linear-gradient(90deg, #0e1a2e 0%, #111827 100%);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
  position: sticky;
  top: 0;
  z-index: 41;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  flex-shrink: 0;
}
.subnav::-webkit-scrollbar { display: none; }

.subnav--platform {
  background: #1c1408;
  border-bottom-color: rgba(245,158,11,0.2);
}

/* Tri sekcije kombinirane vrstice */
.subnav-left {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
  padding-right: 0.5rem;
}
.subnav-right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  padding-left: 0.5rem;
}

/* Globalno iskanje (vrstica nad vsebino) */
.subnav-search {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 0 0.35rem;
  max-width: min(400px, 44vw);
}
.global-search-wrap {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 0.16rem 0.45rem 0.16rem 0.38rem;
  z-index: 60;
}
.global-search-icon {
  font-size: 0.82rem;
  opacity: 0.65;
  flex-shrink: 0;
  line-height: 1;
}
.global-quick-search-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: #f1f5f9;
  font-size: 0.78rem;
  font-family: inherit;
}
.global-quick-search-input::placeholder {
  color: rgba(148, 163, 184, 0.72);
}
/* Pozicijo (fixed + top/left/width) nastavi mehanik.js — sicer subnav overflow odreže panel */
.global-search-panel {
  max-height: min(72vh, 480px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.22);
  border: 1px solid #e2e8f0;
  text-align: left;
}
.global-search-panel .cmd-group-label {
  background: #fff;
}
.global-search-panel .cmd-item {
  text-decoration: none;
  color: var(--color-text, #0f172a);
}
@media (max-width: 900px) {
  .subnav-search {
    max-width: min(280px, 56vw);
  }
  .global-quick-search-input {
    font-size: 0.75rem;
  }
}

/* Brand v subnavу */
.subnav .brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
  gap: 0.1rem;
}
.subnav .brand-app {
  font-size: 0.78rem;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.subnav .brand-ws {
  font-size: 0.67rem;
  font-weight: 400;
  color: rgba(148,163,184,0.75);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}
/* Kompaktni brand (manjši font) */
.subnav .brand-text--compact .brand-app { font-size: 0.72rem; }
.subnav .brand-text--compact .brand-ws { font-size: 0.6rem; max-width: 100px; }
.subnav .brand-ws--link {
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s;
}
.subnav .brand-ws--link:hover {
  color: rgba(148,163,184,1);
}

/* Navpična ločilna črta med brandom in modulom */
.subnav-vdiv {
  display: inline-block;
  width: 1px;
  height: 18px;
  background: rgba(255,255,255,0.15);
  flex-shrink: 0;
  margin: 0 0.15rem;
}

/* Menjava delavnice v subnav-right */
.subnav-ws-switch select {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  color: #e2e8f0;
  font-size: 0.75rem;
  border-radius: 5px;
  padding: 0.2rem 0.45rem;
  cursor: pointer;
  outline: none;
}
.subnav-ws-switch select:hover {
  border-color: rgba(255,255,255,0.35);
}

/* Dark overrides za gumbe v subnav-right */
.subnav-right .topbar-search-btn {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.15);
  color: rgba(148,163,184,0.9);
}
.subnav-right .topbar-search-btn:hover {
  background: rgba(31,100,255,0.2);
  border-color: rgba(31,100,255,0.5);
  color: #fff;
  box-shadow: none;
}
.subnav-right .topbar-search-label { color: rgba(148,163,184,0.8); }
.subnav-right .topbar-search-kbd {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.15);
  color: rgba(148,163,184,0.7);
}
.subnav-right .user-menu-btn {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.15);
  color: #e2e8f0;
}
.subnav-right .user-menu-btn:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.3);
}
.subnav-right .user-name-text { color: #e2e8f0; }
.subnav-right .topbar-help-btn {
  color: rgba(148,163,184,0.8);
  border-color: rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.07);
}

/* Ime modula — levi tab z ikono */
.subnav-module {
  display: flex;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
  padding: 0 1.1rem 0 0.25rem;
  margin-right: 0.25rem;
  border-right: 1px solid rgba(255,255,255,0.1);
  letter-spacing: 0.01em;
  flex-shrink: 0;
}
.subnav--platform .subnav-module {
  color: #fcd34d;
  border-right-color: rgba(245,158,11,0.3);
}

.subnav-links {
  display: flex;
  align-items: stretch;
  gap: 0;
  flex: 1;
  min-width: 0;
}

/* Glavna navigacija — vidna samo na desktopu */
.subnav-main-nav {
  display: none;
  align-items: stretch;
  gap: 0;
  flex-wrap: nowrap;
}
@media (min-width: 961px) {
  .subnav-main-nav {
    display: flex;
  }
  .subnav-main-nav .subnav-link {
    padding: 0 0.75rem;
    font-size: 0.8rem;
  }
}
@media (max-width: 960px) {
  .subnav-main-nav {
    display: none !important;
  }
}

/* Tab-style link */
.subnav-link {
  display: flex;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0 0.95rem;
  color: rgba(148, 163, 184, 0.85);
  white-space: nowrap;
  position: relative;
  transition: color var(--transition-fast), background var(--transition-fast);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;   /* overlap the nav border */
}
.subnav-link:hover {
  color: #f1f5f9;
  background: rgba(255,255,255,0.05);
}
/* Active tab — underline indicator */
.subnav-link--on {
  color: #fff;
  font-weight: 600;
  border-bottom-color: var(--color-primary);
  background: rgba(31,100,255,0.12);
}

/* "+ Ustvari" gumb — pill stil, desno od linkov */
.subnav-link--add {
  display: flex;
  align-items: center;
  margin-left: 0.6rem;
  align-self: center;
  padding: 0.28rem 0.85rem;
  border-radius: 0.45rem;
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.78rem;
  border-bottom: none;
  transition: background var(--transition-fast);
}
.subnav-link--add:hover {
  background: var(--color-primary-dark);
  color: #fff;
}

.subnav--platform .subnav-link--on {
  color: #fcd34d;
  border-bottom-color: #f59e0b;
  background: rgba(245,158,11,0.1);
}
.subnav--platform .subnav-link--add {
  background: #d97706;
}
.subnav--platform .subnav-link--add:hover {
  background: #b45309;
}

/* Platform top nav: clearer tabs and contrast */
.subnav--platform .subnav-links {
  gap: 0.35rem;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: thin;
}
.subnav--platform .subnav-link {
  margin: 0.34rem 0;
  padding: 0.36rem 0.7rem;
  border-radius: 0.52rem;
  border-bottom: none;
  color: rgba(254, 243, 199, 0.92);
  background: rgba(245, 158, 11, 0.08);
}
.subnav--platform .subnav-link:hover {
  color: #fff7ed;
  background: rgba(245, 158, 11, 0.2);
}
.subnav--platform .subnav-link--on {
  color: #111827;
  background: #f59e0b;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25) inset;
}
.subnav--platform .subnav-link--add {
  margin-left: 0.25rem;
  color: #fff;
  background: #ea580c;
}
.subnav--platform .subnav-link--add:hover {
  background: #c2410c;
}

/* Usage index badges */
.usage-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  padding: 0.12rem 0.42rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
}
.usage-badge--high {
  background: #dcfce7;
  color: #166534;
}
.usage-badge--mid {
  background: #fef3c7;
  color: #92400e;
}
.usage-badge--low {
  background: #fee2e2;
  color: #991b1b;
}

/* ══════════════════════════════════════════════════════════════
   SIDEBAR – module context panel + improved nav labels
   ══════════════════════════════════════════════════════════════ */

/* Better section label readability on dark sidebar */
.app-sidebar .nav-section-label {
  color: rgba(148, 163, 184, 0.5);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 1.1rem 0.5rem 0.3rem;
  padding: 0;
}
.app-sidebar .nav-section-label:first-of-type {
  margin-top: 0.5rem;
}

/* Improved nav link — taller touch targets, better active */
.app-sidebar .nav-link {
  padding: 0.55rem 0.75rem;
  border-radius: 0.55rem;
  gap: 0.65rem;
  border-left: 2.5px solid transparent;
}
.app-sidebar .nav-link[data-active="true"] {
  background-color: var(--sb-active-bg);
  color: #fff;
  font-weight: 600;
  border-left-color: var(--color-primary);
}
.app-sidebar .nav-link[data-active="true"] .nav-icon {
  background-color: rgba(31, 100, 255, 0.35);
}

/* Platform section spacer */
.sb-platform-section {
  margin-top: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 0.25rem;
}

/* ── Module context panel ─────────────────────────────────── */
.sb-ctx {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 0.8rem;
  padding: 0.7rem 0.8rem 0.75rem;
  margin: 0.5rem 0 0.9rem;
  flex-shrink: 0;
}
.sb-ctx--platform {
  border-color: rgba(245, 158, 11, 0.25);
  background: rgba(245, 158, 11, 0.07);
}
.sb-ctx-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.65);
  margin: 0 0 0.55rem;
  padding: 0;
}
.sb-ctx-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.sb-ctx-link {
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.3rem 0.65rem;
  border-radius: 0.45rem;
  color: rgba(148, 163, 184, 0.85);
  background: rgba(255, 255, 255, 0.07);
  transition: background var(--transition-fast), color var(--transition-fast);
  white-space: nowrap;
  line-height: 1.3;
}
.sb-ctx-link:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #f1f5f9;
}
.sb-ctx-link--on {
  background: rgba(31, 100, 255, 0.3);
  color: #fff;
  font-weight: 600;
}
.sb-ctx-link--add {
  background: rgba(31, 100, 255, 0.15);
  color: #7bb3ff;
  font-weight: 600;
}
.sb-ctx-link--add:hover {
  background: rgba(31, 100, 255, 0.3);
  color: #fff;
}
.sb-ctx--platform .sb-ctx-link--on {
  background: rgba(245, 158, 11, 0.28);
  color: #fcd34d;
}

/* ══════════════════════════════════════════════════════════
   CUSTOMER DETAIL — mobile-first
   ══════════════════════════════════════════════════════════ */
.cust-page {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* Vozilo detail: polna širina glavne vsebine */
.veh-detail-page {
  max-width: none;
  width: 100%;
  gap: 0.8rem;
  box-sizing: border-box;
  min-width: 0;
}
.veh-detail-page .cust-header {
  gap: 0.45rem;
}
.veh-detail-page .cust-avatar {
  width: 44px;
  height: 44px;
  font-size: 1.15rem !important;
}
/* Naslovna fotografija vozila — cel avto, originalno razmerje (brez obrezovanja) */
.veh-cover-hero {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 0.85rem;
  overflow: hidden;
  border: 2px solid #5eead4;
  box-shadow: 0 4px 18px rgba(20, 184, 166, 0.16);
  background: #0f172a;
}
.veh-cover-hero-link {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  line-height: 0;
}
.veh-cover-hero-img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(70vh, 720px);
  object-fit: contain;
  object-position: center;
}
.veh-cover-hero-btn {
  right: 0.65rem !important;
  bottom: 0.65rem !important;
  width: 36px !important;
  height: 36px !important;
  font-size: 1rem !important;
}
.veh-head-photo-link {
  display: inline-flex;
  border-radius: 0.6rem;
  overflow: hidden;
  border: 2px solid #5eead4;
  box-shadow: 0 2px 8px rgba(20, 184, 166, 0.15);
}
.veh-head-photo {
  width: 44px;
  height: 44px;
  object-fit: cover;
  display: block;
}
.veh-head-media {
  position: relative;
  flex-shrink: 0;
}
.veh-head-media .veh-head-avatar-placeholder,
.veh-head-media .cust-avatar {
  width: 44px;
  height: 44px;
}
.veh-head-photo-btn {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--color-border, #cbd5e1);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.14);
  text-decoration: none;
  line-height: 1;
  z-index: 3;
}
.veh-head-photo-btn:hover {
  background: #f0fdfa;
  border-color: #14b8a6;
}
.veh-detail-page .cust-name {
  font-size: 1rem;
  margin-bottom: 0.1rem;
}
.veh-detail-page .cust-header-actions {
  gap: 0.35rem;
}
.veh-detail-page .cust-header-actions .btn-primary,
.veh-detail-page .cust-header-actions .btn-secondary,
.veh-detail-page .cust-header-actions .btn-ghost {
  min-height: 40px;
  padding: 0.42rem 0.65rem;
  font-size: 0.82rem;
}
.veh-detail-page .cust-section {
  padding: 0.75rem 0.8rem;
  border-radius: 0.75rem;
  border-color: #99f6e4;
  border-left: 4px solid #14b8a6;
}
/* Vozilo: načrt intervalov — sklop <details>, privzeto zaprt */
.veh-detail-page details.cust-section.veh-servisni-nacrt-details {
  padding: 0;
  border-left-color: #0d9488;
}
.veh-detail-page .veh-servisni-nacrt-summary {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  list-style: none;
  cursor: pointer;
  padding: 0.65rem 0.8rem;
  margin: 0;
  user-select: none;
}
.veh-detail-page .veh-servisni-nacrt-summary::-webkit-details-marker {
  display: none;
}
.veh-detail-page .veh-servisni-nacrt-details > .veh-servisni-nacrt-summary::marker {
  content: "";
}
.veh-detail-page .veh-servisni-nacrt-summary h2 {
  margin: 0;
  font-size: 0.9rem;
}
.veh-detail-page .veh-servisni-nacrt-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  font-size: 0.65rem;
  line-height: 1;
  border-radius: 0.25rem;
  background: var(--surface-accent, #eef2ff);
  color: var(--color-primary, #4f46e5);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}
.veh-detail-page .veh-servisni-nacrt-chevron::before {
  content: "\25B8";
}
.veh-detail-page .veh-servisni-nacrt-details[open] .veh-servisni-nacrt-chevron {
  transform: rotate(90deg);
}
.veh-detail-page .veh-servisni-nacrt-body {
  padding: 0 0.8rem 0.75rem;
  border-top: 1px solid var(--color-border, #e2e8f0);
}
.veh-detail-page .cust-section-head {
  margin-bottom: 0.5rem;
}
.veh-detail-page .cust-section-head h2 {
  font-size: 0.9rem;
}
.veh-detail-page .cust-info-card {
  padding: 0.52rem 0.58rem;
}
.veh-detail-page .cust-info-label {
  font-size: 0.66rem;
}
.veh-detail-page .cust-info-value {
  font-size: 0.84rem;
}
.veh-detail-page .cust-order-filters {
  margin-top: 0.15rem;
  margin-bottom: 0.45rem;
  grid-template-columns: minmax(140px, 2fr) minmax(130px, 1fr) auto;
  gap: 0.3rem;
}
.veh-detail-page .cust-order-filters .input-field,
.veh-detail-page .cust-order-filters select.input-field {
  min-height: 32px;
  font-size: 0.76rem;
  padding: 0.2rem 0.4rem;
}
.veh-detail-page .cust-order-filters .btn-sm {
  min-height: 32px;
  font-size: 0.74rem;
  padding: 0.22rem 0.45rem;
}
.veh-detail-page #veh-orders-list .cust-order-fin {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.veh-top-meta {
  border-color: #5eead4;
  border-left-color: #0d9488;
  background: linear-gradient(135deg, #f0fdfa 0%, #ecfdf5 100%);
}
.veh-detail-page .veh-top-meta.cust-section {
  padding: 0.5rem 0.52rem;
}
.veh-top-meta .cust-info-grid {
  grid-template-columns: repeat(auto-fill, minmax(142px, 1fr));
  gap: 0.28rem;
}
.veh-top-meta .cust-info-card {
  border-color: #99f6e4;
  border-left: 3px solid #14b8a6;
  background: linear-gradient(135deg, #f0fdfa, #ffffff);
}
.veh-top-meta .cust-info-card:not(.veh-meta-compact) {
  padding: 0.4rem 0.48rem;
}
.veh-top-meta .cust-info-card:not(.veh-meta-compact) .cust-info-label {
  font-size: 0.64rem;
  margin-bottom: 0.18rem;
}
.veh-top-meta .cust-info-card:not(.veh-meta-compact) .cust-info-value {
  font-size: 0.82rem;
}
.veh-top-meta .cust-info-card.veh-meta-compact {
  padding: 0.3rem 0.38rem;
}
.veh-top-meta .veh-meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.12rem 0.4rem;
  margin-top: 0.2rem;
  min-width: 0;
}
.veh-top-meta .veh-meta-line:first-child {
  margin-top: 0;
}
.veh-top-meta .veh-meta-line .cust-info-label {
  margin-bottom: 0;
  flex: 0 0 auto;
  min-width: 4.1rem;
  max-width: 46%;
  font-size: 0.57rem;
  line-height: 1.2;
}
.veh-top-meta .veh-meta-line .cust-info-value {
  flex: 1 1 0;
  min-width: 0;
  font-size: 0.76rem;
  line-height: 1.3;
  word-break: break-word;
}
.veh-top-meta .veh-meta-reg {
  font-weight: 700;
  color: #0f766e;
}

/* Vozilo — ključni podatki: namizje (≥641px); mobil ≤640 ostane nespremenjeno */
@media (min-width: 641px) {
  .veh-detail-page .veh-top-meta.cust-section {
    padding: 0.52rem 0.68rem 0.65rem;
  }
  .veh-top-meta .cust-info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.42rem 0.52rem;
    align-items: stretch;
  }
  .veh-top-meta .cust-info-card.veh-meta-compact {
    padding: 0.42rem 0.55rem;
    border-radius: 0.48rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  }
  .veh-top-meta .veh-meta-line {
    flex-direction: column;
    align-items: flex-start;
    align-self: stretch;
    gap: 0.05rem 0;
    margin-top: 0.28rem;
  }
  .veh-top-meta .veh-meta-line:first-child {
    margin-top: 0;
  }
  .veh-top-meta .veh-meta-line .cust-info-label {
    flex: none;
    min-width: 0;
    max-width: none;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #64748b;
    line-height: 1.25;
  }
  .veh-top-meta .veh-meta-line .cust-info-value {
    flex: none;
    width: 100%;
    font-size: 0.84rem;
    font-weight: 650;
    line-height: 1.32;
    color: #0f172a;
  }
  .veh-top-meta .veh-meta-reg {
    font-size: 0.92rem;
    letter-spacing: 0.015em;
  }
  .veh-top-meta .veh-meta-vin {
    font-size: 0.78rem !important;
  }
}
@media (min-width: 960px) {
  .veh-top-meta .cust-info-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.48rem 0.58rem;
  }
}

.veh-tech-summary {
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 700;
  color: #334155;
  list-style: none;
}
.veh-tech-summary::-webkit-details-marker { display: none; }
.veh-tech-summary::after {
  content: "▸";
  float: right;
  opacity: .55;
}
#veh-tech-details[open] .veh-tech-summary::after {
  content: "▾";
}

/* Galerija vozila: obrazec za nalaganje */
.veh-gallery-upload-form {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.55rem;
  align-items: end;
  margin-bottom: 0.95rem;
}
.veh-gallery-upload-file {
  min-width: 0;
}
@media (max-width: 640px) {
  .veh-gallery-upload-form {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
  }
  .veh-gallery-upload-file {
    grid-column: 1 / -1;
  }
}

/* Galerija vozila: vrstice po nalaganju, vodoravni drsnik */
.veh-detail-page .veh-gallery-batches {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.veh-detail-page .veh-gallery-batch {
  min-width: 0;
}
.veh-detail-page .veh-gallery-batch-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.65rem;
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
}
.veh-detail-page .veh-gallery-batch-date,
.veh-detail-page .veh-gallery-batch-label {
  font-weight: 600;
  color: var(--color-text, #1e293b);
}
.veh-detail-page .veh-gallery-batch-count {
  font-size: 0.74rem;
}
.veh-detail-page .veh-gallery-scroll {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0.35rem;
  margin-bottom: 0.05rem;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}
.veh-detail-page .veh-gallery-scroll--padded {
  margin-top: 0.5rem;
}
.veh-detail-page .veh-gallery-thumb {
  flex: 0 0 auto;
  width: 132px;
  scroll-snap-align: start;
  border: 2px solid #99f6e4;
  border-radius: 0.6rem;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  background: #fff;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.veh-detail-page .veh-gallery-thumb:hover {
  border-color: #14b8a6;
  box-shadow: 0 2px 8px rgba(20, 184, 166, 0.18);
}
.veh-detail-page .veh-gallery-thumb img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  display: block;
  vertical-align: middle;
}
.veh-detail-page .veh-gallery-thumb-cap {
  display: block;
  padding: 0.32rem 0.45rem 0.2rem;
  font-size: 0.68rem;
  color: var(--color-muted, #64748b);
  line-height: 1.25;
  word-break: break-word;
}
.veh-detail-page .veh-gallery-thumb-sub {
  display: block;
  padding: 0 0.45rem 0.35rem;
  font-size: 0.62rem;
  color: var(--color-muted, #94a3b8);
  font-variant-numeric: tabular-nums;
}

.veh-top-actions {
  margin-top: -0.15rem;
}
.veh-detail-page .veh-top-actions--bar {
  width: 100%;
}
/* Vozilo: glavna vrstica + meni ⋯ (scroll samo na gumbih, da dropdown ni obrezan) */
.veh-top-actions--bar {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.28rem;
  overflow: visible;
}
.veh-top-actions-scroll {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.veh-top-actions-scroll::-webkit-scrollbar {
  display: none;
}
.veh-top-actions--bar .veh-top-action-main {
  flex: 0 0 auto;
  white-space: nowrap;
  min-height: 30px;
  padding: 0.2rem 0.45rem;
  font-size: 0.7rem;
  font-weight: 600;
}
button.btn-secondary.veh-parts-mail-btn {
  font-family: inherit;
  line-height: inherit;
}
.veh-top-actions--bar .veh-top-actions-more {
  margin-left: auto;
  flex-shrink: 0;
  position: relative;
  z-index: 5;
}
.veh-top-actions--bar .veh-top-more-btn.wo-more-btn {
  min-width: 1.95rem;
  min-height: 30px;
  font-size: 1.05rem;
  line-height: 1;
  padding: 0.18rem 0.32rem;
}
.veh-top-more-dropdown.wo-more-dropdown {
  right: 0;
  left: auto;
  z-index: 400;
}
/* Kompaktni filtri + kartica nalogov (stran vozila) */
.veh-detail-page .veh-wo-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem;
  margin: 0.25rem 0 0.45rem;
}
.veh-detail-page .veh-wo-filters .input-field,
.veh-detail-page .veh-wo-filters select.input-field {
  min-height: 36px;
  font-size: 0.82rem;
  padding: 0.28rem 0.45rem;
}
.veh-detail-page .veh-wo-filters .btn-sm {
  grid-column: 1 / -1;
  min-height: 36px;
  justify-content: center;
}
.veh-detail-page .veh-wo-card {
  padding: 0.52rem 0.6rem;
  border-radius: 0.6rem;
  border: 1.5px solid #99f6e4;
  border-left: 4px solid #14b8a6;
  background: linear-gradient(135deg, #f0fdfa 0%, #fff 100%);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.veh-detail-page .veh-wo-card:hover {
  border-color: #5eead4;
  border-left-color: #0d9488;
  background: #f0fdfa;
  box-shadow: 0 2px 8px rgba(20, 184, 166, 0.13);
}
.veh-wo-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.38rem;
  margin-bottom: 0.25rem;
}
.veh-wo-card-head .cust-order-code {
  font-size: 0.72rem;
}
.veh-wo-card-head > .badge:not(.cust-order-code) {
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
}
.veh-wo-date {
  margin-left: auto;
  font-size: 0.68rem;
  color: var(--color-muted);
  white-space: nowrap;
}
.veh-wo-desc {
  font-size: 0.78rem;
  line-height: 1.32;
  color: var(--color-text);
  margin: 0 0 0.2rem;
  word-break: break-word;
}
.veh-wo-cust {
  color: var(--color-muted);
  font-size: 0.72rem;
}
.veh-wo-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.12rem 0.22rem;
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  color: #334155;
  line-height: 1.35;
}
.veh-wo-dot {
  opacity: 0.4;
  user-select: none;
}
.veh-wo-stat--rvc {
  color: #15803d;
  font-weight: 600;
}
@media (max-width: 380px) {
  .veh-top-mail-lbl {
    display: none;
  }
}
@media (max-width: 640px) {
  .veh-detail-page .cust-stats.veh-top-stats--row3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.18rem;
  }
  .veh-detail-page .veh-top-stats--row3 .cust-stat {
    padding: 0.28rem 0.18rem;
  }
  .veh-detail-page .veh-top-stats--row3 .cust-stat-num {
    font-size: 0.82rem;
  }
  .veh-detail-page .veh-top-stats--row3 .cust-stat-lbl {
    font-size: 0.5rem;
    line-height: 1.2;
  }
  .veh-detail-page .veh-top-stats--row3 .cust-stat-sub {
    font-size: 0.48rem;
  }
  .veh-detail-page .cust-name {
    font-size: 0.94rem;
  }
  .veh-detail-page .cust-avatar {
    width: 40px;
    height: 40px;
  }
  .veh-head-photo {
    width: 40px;
    height: 40px;
  }
  .veh-cover-hero-img {
    max-height: min(55vh, 480px);
  }
  .veh-cover-hero-btn {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.9rem !important;
  }
}

/* Vozilo: statistika — 3 stolpci v eni vrstici */
.cust-stats.veh-top-stats.veh-top-stats--row3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.3rem;
}
.veh-top-stats--row3 .cust-stat {
  padding: 0.5rem 0.4rem;
  border-radius: 0.55rem;
  min-width: 0;
  border: 1.5px solid #99f6e4;
  border-top: 3px solid #14b8a6;
  background: linear-gradient(180deg, #f0fdfa 0%, #ffffff 100%);
}
.veh-top-stats--row3 .cust-stat-num {
  font-size: 0.92rem;
  font-weight: 750;
  color: #0f766e;
}
.veh-top-stats--row3 .cust-stat-lbl {
  font-size: 0.58rem;
  margin-top: 0.1rem;
  line-height: 1.2;
  color: #334155;
  font-weight: 600;
}
.veh-top-stats--row3 .cust-stat-sub {
  font-size: 0.52rem;
  margin-top: 0.08rem;
  color: #16a34a;
  font-weight: 600;
}

/* Glava */
.cust-header {
  display: flex;
  flex-direction: column;
  gap: .65rem;
}
.cust-header-body {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
}
.cust-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: -.02em;
}
.cust-name {
  margin: 0 0 .2rem;
  font-size: 1.15rem;
  line-height: 1.2;
  word-break: break-word;
}
.cust-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .45rem;
}
.cust-chip {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  font-size: .78rem;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: .2rem .6rem;
  text-decoration: none;
  white-space: nowrap;
}
.cust-chip:hover { background: var(--color-primary-soft); }
.cust-chip--ddv { background: #d1fae5; color: #047857; }
.cust-chip--no-ddv { background: #f1f5f9; color: #64748b; }
.cust-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.cust-header-actions .btn-primary,
.cust-header-actions .btn-secondary,
.cust-header-actions .btn-ghost {
  flex: 1;
  text-align: center;
  min-width: 120px;
}

/* Stat vrstica */
.cust-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr));
  gap: .5rem;
}
.cust-stat {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: .65rem;
  padding: .7rem .5rem;
  text-align: center;
}
.cust-stat--warn .cust-stat-num { color: var(--color-warning, #f59e0b); }
.cust-stat-num {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1;
}
.cust-stat-lbl {
  font-size: .68rem;
  color: var(--color-muted);
  margin-top: .2rem;
}
.cust-stat-sub {
  font-size: .6rem;
  color: var(--color-muted);
  margin-top: .15rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.cust-stat-hint {
  margin: 0.35rem 0 0;
  font-size: 0.62rem;
  line-height: 1.3;
  color: var(--color-muted);
  text-align: center;
  font-weight: 400;
}
.cust-stat-hint--accent {
  color: #475569;
  font-weight: 500;
}

/* Sekcije */
.cust-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: .85rem;
  padding: .9rem 1rem;
}
.cust-section-head {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .75rem;
}
.cust-section-head h2 {
  font-size: .95rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: .4rem;
}

/* Info kartice */
.cust-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: .55rem;
}
.cust-info-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: .55rem;
  padding: .65rem .8rem;
}
.cust-info-label {
  font-size: .7rem;
  font-weight: 600;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .25rem;
}
.cust-info-value {
  font-size: .9rem;
  font-weight: 500;
  display: block;
  color: var(--color-text);
  text-decoration: none;
}
.cust-info-link { color: var(--color-primary); }
.cust-info-link:hover { text-decoration: underline; }
.cust-notes {
  margin-top: .75rem;
  padding: .75rem .9rem;
  background: var(--color-bg);
  border-radius: .55rem;
  border-left: 3px solid var(--color-primary);
}
.cust-notes-text {
  margin: .25rem 0 0;
  font-size: .9rem;
  white-space: pre-line;
  line-height: 1.55;
}

/* Vozila */
.cust-vehicles {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.cust-vehicle-card {
  display: flex;
  align-items: center;
  gap: .85rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: .65rem;
  padding: .75rem .9rem;
  text-decoration: none;
  color: inherit;
  transition: border-color .13s, box-shadow .13s;
}
.cust-vehicle-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-faint, rgba(99,102,241,.1));
}
.cust-veh-icon { font-size: 1.8rem; flex-shrink: 0; line-height: 1; }
.cust-veh-body { flex: 1; min-width: 0; }
.cust-veh-name { font-weight: 600; font-size: .93rem; }
.cust-veh-year { font-weight: 400; color: var(--color-muted); }
.cust-veh-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem;
  margin-top: .2rem;
}
.cust-veh-wo-material {
  margin-top: .25rem;
  font-size: .76rem;
  font-variant-numeric: tabular-nums;
}
.cust-veh-wo-material-rvc {
  font-size: .65rem;
  color: var(--color-muted);
  font-weight: 500;
}
.cust-reg {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: .3rem;
  padding: .15rem .5rem;
  font-size: .8rem;
  font-weight: 600;
  font-family: monospace;
}
.cust-veh-arrow {
  color: var(--color-muted);
  font-size: 1.3rem;
  flex-shrink: 0;
}

/* Nalogi */
.cust-orders {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.cust-order-card {
  display: block;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: .65rem;
  padding: .75rem .9rem;
  text-decoration: none;
  color: inherit;
  transition: border-color .13s;
}
.cust-order-card:hover { border-color: var(--color-primary); }
.cust-order-top {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: .3rem;
}
.cust-order-code { font-size: .85rem; }
.cust-order-type {
  font-size: .68rem;
  color: #1e40af;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: .1rem .45rem;
  line-height: 1.25;
}
.cust-order-date {
  font-size: .78rem;
  color: var(--color-muted);
  margin-left: auto;
  flex-shrink: 0;
}
.cust-order-top--wrap-date {
  align-items: flex-start;
}
.cust-order-desc {
  font-size: .85rem;
  color: var(--color-text);
  margin-bottom: .25rem;
  line-height: 1.4;
}
.cust-order-veh {
  font-size: .78rem;
  color: var(--color-muted);
}
.cust-order-fin {
  margin-top: .4rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .35rem;
}
.cust-order-fin--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.cust-order-fin-item {
  display: flex;
  flex-direction: column;
  gap: .08rem;
  min-width: 0;
  padding: .28rem .38rem;
  border-radius: .45rem;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}
.cust-order-fin-item > span {
  font-size: .64rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.cust-order-fin-item > strong {
  font-size: .78rem;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cust-order-fin-item--rvc {
  border-color: #86efac;
  background: #f0fdf4;
}
.cust-order-fin-item--rvc > span {
  color: #166534;
}
.cust-order-fin-item--rvc > strong {
  color: #15803d;
}
.cust-order-filters {
  display: grid;
  grid-template-columns: minmax(180px, 2fr) minmax(180px, 1fr) auto;
  gap: .45rem;
  margin: .35rem 0 .6rem;
}
.cust-order-filters .input-field,
.cust-order-filters select.input-field {
  min-height: 38px;
  font-size: .82rem;
}

@media (max-width: 640px) {
  /* Stranka / vozilo — brez dodatnega vodoravnega zamika (že app-content) */
  .cust-page,
  .veh-detail-page {
    padding: 0.35rem 0;
    gap: 0.65rem;
  }
  .veh-detail-page .cust-section {
    padding: 0.52rem 0.5rem;
  }
  .cust-section {
    padding: 0.52rem 0.5rem;
    border-radius: 0.65rem;
  }
  .cust-section-head h2 {
    font-size: 0.88rem;
    flex-wrap: wrap;
  }
  .cust-header-body {
    gap: 0.65rem;
  }
  .cust-name {
    font-size: 1.02rem;
  }
  /* Statistika: vedno 2 stolpca, ni premajhnega »mrežastega« šumu */
  .cust-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
  }
  .cust-stat {
    padding: 0.5rem 0.35rem;
    min-width: 0;
  }
  .cust-stat-num {
    font-size: 1.05rem;
  }
  .cust-stat-lbl {
    font-size: 0.6rem;
    line-height: 1.25;
    hyphens: auto;
  }
  .cust-stat-sub {
    font-size: 0.55rem;
  }
  .cust-header-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
  }
  .cust-header-actions .btn-primary,
  .cust-header-actions .btn-secondary,
  .cust-header-actions .btn-ghost {
    flex: none;
    min-width: 0;
    width: 100%;
    min-height: 44px;
    font-size: 0.78rem;
    padding: 0.42rem 0.5rem;
    box-sizing: border-box;
  }
  /* Vrstica z akcijami na vozilu — ena vrstica + ⋯ */
  .veh-top-actions--bar {
    display: flex !important;
    gap: 0.28rem;
  }
  .veh-top-actions--bar .veh-top-action-main {
    min-height: 30px !important;
    padding: 0.2rem 0.42rem !important;
    font-size: 0.7rem !important;
    width: auto !important;
  }
  .veh-top-actions--bar .veh-top-more-btn.wo-more-btn {
    min-height: 30px !important;
    width: auto !important;
    min-width: 1.9rem !important;
  }
  .cust-vehicle-card {
    padding: 0.6rem 0.7rem;
    gap: 0.6rem;
  }
  .cust-order-filters {
    grid-template-columns: 1fr;
    gap: .35rem;
  }
  .cust-order-filters .input-field,
  .cust-order-filters select.input-field {
    min-height: 44px;
    font-size: 0.85rem;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  .cust-order-filters .btn-sm {
    min-height: 44px;
    width: 100%;
    justify-content: center;
  }
  .cust-order-card {
    padding: 0.6rem 0.72rem;
    border-radius: 0.6rem;
  }
  .cust-order-top {
    gap: 0.35rem;
  }
  .cust-order-top--wrap-date .cust-order-date {
    margin-left: 0;
    width: 100%;
    flex-basis: 100%;
    text-align: left;
  }
  .cust-order-desc {
    font-size: 0.8rem;
    word-break: break-word;
  }
  .cust-order-fin,
  .cust-order-fin--4 {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }
  .veh-top-meta .cust-info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.22rem;
  }
  .veh-detail-page .veh-top-meta.cust-section {
    padding: 0.38rem 0.4rem;
  }
  .veh-top-meta .cust-info-card.veh-meta-compact {
    padding: 0.28rem 0.32rem;
  }
  .cust-order-fin-item {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
    padding: 0.32rem 0.42rem;
  }
  .cust-order-fin-item > span {
    flex-shrink: 0;
    max-width: 48%;
  }
  .cust-order-fin-item > strong {
    white-space: normal;
    word-break: break-word;
    font-size: 0.78rem;
    text-align: right;
  }
}

/* Zelo ozek telefon — podatki vozila v enem stolpcu */
@media (max-width: 400px) {
  .veh-top-meta .cust-info-grid {
    grid-template-columns: 1fr;
  }
}

/* Računi */
.cust-invoices {
  display: flex;
  flex-direction: column;
  gap: .45rem;
}
.cust-invoice-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: .65rem;
  padding: .7rem .9rem;
  text-decoration: none;
  color: inherit;
  transition: border-color .13s;
}
.cust-invoice-card:hover { border-color: var(--color-primary); }
.cust-inv-left {
  display: flex;
  flex-direction: column;
  gap: .1rem;
}
.cust-inv-date { font-size: .78rem; color: var(--color-muted); }
.cust-inv-right {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-shrink: 0;
}
.cust-inv-amount { font-size: .95rem; }
.cust-empty {
  color: var(--color-muted);
  font-size: .9rem;
  margin: 0;
}

/* Tablet+ (641+ da se ne prekriva s telefonom ≤640) */
@media (min-width: 641px) {
  .cust-page { padding: 1.5rem; }
  .cust-name { font-size: 1.35rem; }
  .cust-stats { gap: .75rem; }
  .cust-stat-num { font-size: 1.6rem; }
  .cust-stat-lbl { font-size: .75rem; }
  .cust-info-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .cust-header-actions .btn-primary,
  .cust-header-actions .btn-secondary,
  .cust-header-actions .btn-ghost { flex: 0 0 auto; }
  .veh-detail-page .cust-stats.veh-top-stats--row3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ═══ Material add modal ════════════════════════════════ */
.mat-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-end;       /* bottom sheet on mobile */
  justify-content: center;
  z-index: 1200;
  padding: 0;
}

.mat-modal-box {
  background: #fff;
  width: 100%;
  max-width: 560px;
  border-radius: 1.1rem 1.1rem 0 0;
  box-shadow: 0 -6px 32px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  max-height: 92dvh;
  overflow-y: auto;
  overflow-x: visible;
}

@media (min-width: 641px) {
  .mat-modal-overlay {
    align-items: center;
    padding: 1rem;
  }
  .mat-modal-box {
    border-radius: 1rem;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.22);
    max-height: 85vh;
  }
}

/* Header */
.mat-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem 0.8rem;
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
  border-radius: inherit;
}

.mat-modal-header h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.mat-modal-close {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--color-muted);
  padding: 0.3rem 0.55rem;
  border-radius: 0.4rem;
  line-height: 1;
  transition: background 120ms;
}
.mat-modal-close:hover { background: #f1f5f9; color: var(--color-text); }

/* Body */
.mat-modal-body {
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  /* NE overflow-y: auto — box-level scrolling handled by .mat-modal-box;
     auto bi porezal absolutno pozicioniran art-combo dropdown */
  overflow: visible;
}

.mat-modal-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.mat-modal-field label {
  font-size: 0.77rem;
  font-weight: 700;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mat-modal-row2 {
  display: grid;
  grid-template-columns: 1fr 0.7fr 1.1fr;
  gap: 0.75rem;
}
/* Enota — kompakten select */
.mat-modal-field--unit select.input-field {
  font-size: 0.85rem;
  padding-right: 1.4rem;
}

/* Advanced collapsible */
.mat-modal-advanced {
  border: 1px solid var(--color-border);
  border-radius: 0.6rem;
  padding: 0 0.75rem;
}

.mat-modal-advanced[open] { padding-bottom: 0.75rem; }

.mat-modal-advanced summary {
  font-size: 0.82rem;
  color: var(--color-primary);
  cursor: pointer;
  padding: 0.55rem 0;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.mat-modal-advanced summary::before { content: "▸"; transition: transform 180ms; }
.mat-modal-advanced[open] summary::before { transform: rotate(90deg); }

.mat-modal-row3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.75rem;
  padding-top: 0.65rem;
}

@media (max-width: 400px) {
  .mat-modal-row3 { grid-template-columns: 1fr 1fr; }
}

/* Footer */
.mat-modal-footer {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  align-items: center;
  padding: 0.85rem 1.25rem 1rem;
  border-top: 1px solid var(--color-border);
  position: sticky;
  bottom: 0;
  background: #fff;
  z-index: 1;
}
/* Gumb za brisanje je na levem robu */
.mat-modal-footer #mat-modal-delete {
  margin-right: auto;
}

@media (max-width: 640px) {
  .mat-modal-footer {
    flex-wrap: wrap;
    gap: 0.55rem;
  }
  .mat-modal-footer .btn-primary,
  .mat-modal-footer .btn-ghost {
    flex: 1 1 auto;
    text-align: center;
    justify-content: center;
    padding: 0.7rem 1rem;
  }
  .mat-modal-footer #mat-modal-delete {
    width: 100%;
    order: 99;
    margin-right: 0;
    text-align: center;
    justify-content: center;
  }
  .mat-modal-footer #mat-modal-add-another {
    flex: 1 1 auto;
    text-align: center;
    justify-content: center;
  }
}

/* art-combo inside modal — inline flow (no portal), modal scrolls to show results */
#mat-modal-combo { position: relative; overflow: visible; }
#mat-modal-desc-combo { position: relative; overflow: visible; }

/* Modal combo lista: NI absoluten — tece v normalnem toku (position:static via class) */
.art-combo-list--modal {
  position: static !important;
  display: none;
  margin-top: 3px;
  margin-bottom: 0;
  width: 100% !important;
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid #bfd0ec;
  border-radius: 0.5rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  background: #fff;
  list-style: none;
  padding: 0.2rem 0;
}

/* Večji font in padding za postavke v modalnem dropdownu */
#mat-modal-combo-list .art-combo-item,
#mat-modal-desc-list  .art-combo-item {
  padding: 0.65rem 0.9rem;
  font-size: 0.93rem;
}

/* Validation highlight */
#mat-modal-desc.input-error {
  border-color: var(--color-danger, #dc2626);
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.18);
  animation: shake 220ms ease;
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25%      { transform: translateX(-4px); }
  75%      { transform: translateX(4px); }
}

/* ═══════════════════════════════════════════════════════════
   DODATNE KOMPONENTE — SMS, Status select, AI, QR, Predloge
   ═══════════════════════════════════════════════════════════ */

/* SMS bližnjica */
.wo-sms-link {
  color: #2563eb !important;
  background: rgba(37,99,235,0.07) !important;
  border-color: rgba(37,99,235,0.22) !important;
  margin-left: 0.25rem;
}
.wo-sms-link:hover {
  background: rgba(37,99,235,0.14) !important;
}

/* Inline status dropdown */
.wo-status-select {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.2rem 1.45rem 0.2rem 0.65rem;
  border-radius: 99px;
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23666'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.4rem center;
  background-size: 8px;
  transition: filter 100ms ease;
}

.wo-status-select:hover {
  filter: brightness(0.95);
}

/* Badge statusne barve — vivid */
.badge.badge--completed     { background: #bbf7d0; color: #14532d; border-color: rgba(20,83,45,0.25); }
.badge.badge--paid          { background: #99f6e4; color: #134e4a; border-color: rgba(19,78,74,0.28); }
.badge.badge--scheduled     { background: #ddd6fe; color: #4c1d95; border-color: rgba(76,29,149,0.28); }
.badge.badge--in_progress   { background: #fde68a; color: #78350f; border-color: rgba(120,53,15,0.28); }
.badge.badge--waiting_parts { background: #fed7aa; color: #7c2d12; border-color: rgba(124,45,18,0.28); }
.badge.badge--cancelled     { background: #e2e8f0; color: #475569; border-color: rgba(71,85,105,0.22); }
.badge.badge--new           { background: #bfdbfe; color: #1e3a8a; border-color: rgba(30,58,138,0.25); }

/* QR wrap summary brez markice */
.wo-qr-wrap summary::-webkit-details-marker { display: none; }

/* Predloge kartice */
.predloga-card {
  display: flex;
  flex-direction: column;
  transition: box-shadow 120ms ease;
}
.predloga-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.09);
}

/* ═══════════════════════════════════════════════════════════
   MOBILNI POPRAVKI (640 px)
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  /* Header akcije — prelom */
  .wo-header-actions {
    flex-wrap: wrap;
    gap: 0.4rem;
  }
  .wo-header-actions .btn-ghost,
  .wo-header-actions .btn-secondary,
  .wo-header-actions .btn-primary {
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
  }

  /* SMS link krajši */
  .wo-sms-link { font-size: 0.7rem; }

  /* Sidebar pod obrazcem na detail strani */
  .wo-layout { flex-direction: column !important; }
  .wo-sidebar { width: 100% !important; min-width: 0 !important; }

  /* Tabela nalogov: skrij samo »Odprt« — vozilo, termin in opis morajo ostati (kartica kot »Zadnji nalogi«) */
  .wo-th-opened,
  .wo-td-opened { display: none; }
  .wo-td-main { min-width: 0; }

  /* Status select večji touch target */
  .wo-status-select {
    font-size: 0.8rem;
    padding: 0.3rem 1.4rem 0.3rem 0.6rem;
  }

  /* Predloge grid — 1 stolpec */
  .predloga-grid { grid-template-columns: 1fr !important; }
}


/* ═══════════════════════════════════════════════════════════
   MOBILNI POPRAVKI – DELOVNI NALOG IN RAČUN
   ≤ 960 px  (tableti + telefoni)
   ═══════════════════════════════════════════════════════════ */

/* ── Skupno: prepreči iOS zoom na vnosnih poljih ─── */
@media (max-width: 960px) {
  input.input-field,
  select.input-field,
  textarea.input-field,
  .combo-input,
  .art-combo-input {
    font-size: 16px !important;
    min-height: 44px;
  }
  /* Vsi inputi v formah – priročen tap na mobilu */
  .form-group .input-field,
  .form-group select,
  .form-group textarea,
  .form-group input[type="text"],
  .form-group input[type="number"],
  .form-group input[type="email"],
  .form-group input[type="tel"] {
    min-height: 44px;
    font-size: 16px;
  }
  .form-group textarea { min-height: 88px; }
  /* Račun – form-control tap target */
  .form-control { min-height: 44px; font-size: 16px; }
  /* Panel/card – na ozkem zaslonu en stolpec */
  .panel .form-group + .form-group { margin-top: 0.5rem; }
  /* Vozila / stranke – header z Nazaj kot celotna vrstica */
  .form-panel-header .page-header-actions { width: 100%; }
  .form-panel-header .page-header-actions .btn-ghost { width: 100%; text-align: center; min-height: 44px; }
  .form-panel-header .subtitle { display: none; }

  /* Višji touch-target za gumbe */
  .btn-primary, .btn-ghost, .btn-secondary {
    min-height: 44px;
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
  }
  .btn-sm { min-height: 36px; }

  /* ── Delovni nalog – forma ────────────────────── */
  .order-helper { display: none; }          /* pomočnik ni potreben na mobilu */
  .order-form-layout { gap: 0.6rem; }

  /* Panelni padding reduciran – manj gnezdenja */
  .form-panel.panel { padding: 0.8rem 0.75rem; }

  .form-section {
    padding: 0.8rem 0.85rem;
    margin-bottom: 0.6rem;
  }
  .form-section h2 { font-size: 0.9rem; margin-bottom: 0.55rem; }

  /* Skrij subtitle pod h1 – prihrani prostor */
  .form-panel .subtitle { display: none; }
  /* Compact page header */
  .form-panel .page-header { margin-bottom: 0.7rem; padding-bottom: 0.7rem; }
  .form-panel .page-header h1 { font-size: 1.15rem; }
  /* Gumb Nazaj – celotna vrstica */
  .form-panel .page-header-actions { width: 100%; }
  .form-panel .page-header-actions .btn-ghost { width: 100%; text-align: center; padding: 0.5rem; font-size: 0.85rem; }

  /* combo dropdown – višji na mobilu */
  .combo-dropdown { max-height: 220px; }
  .combo-option   { padding: 0.7rem 0.85rem; min-height: 44px; }
  /* Dolgi nazivi se lomijo, ne odrezani */
  .combo-opt-main { white-space: normal; line-height: 1.3; }

  /* Vsa polja polna širina */
  .form-field .input-field,
  .form-field select { width: 100%; box-sizing: border-box; }
  /* iOS: prepreči auto-zoom (font < 16px sproži zoom) */
  .input-field, .form-field select, textarea.input-field { font-size: 16px; }

  /* ── Račun – header polja ─────────────────────── */
  .form-grid-2 {
    grid-template-columns: 1fr !important;
  }

  /* ── Račun – sidebar zneskov nad tabelo ───────── */
  .inv-sidebar { order: -1; }
  .inv-totals  { flex-direction: row; flex-wrap: wrap; gap: 0.5rem 1.5rem; align-items: flex-end; }
  .inv-total-row { min-width: 0; gap: 0.5rem; }
  .inv-total-row--final { font-size: 1rem; }

  /* Predogled vrstic pri urejanju računa skrijemo na mobilu (invoice-form). */
  form#invoice-form .inv-sidebar .inv-sidebar-preview-lines { display: none; }
  .quote-detail-page .inv-sidebar .wo-section:nth-child(2),
  .quote-detail-page .inv-sidebar .wo-section:nth-child(3) {
    display: block !important;
  }

  /* DDV toggle gumb – cela vrstica */
  #ddv-toggle { width: 100%; text-align: center; margin-top: 0.5rem; }
  .wo-section-head { flex-wrap: wrap; gap: 0.4rem; }

  /* Gumb Shrani račun v headerju – skrit (je že v sidebar) */
  .wo-header-actions button[form="invoice-form"] { display: none; }
}

/* ── Obrazec: nova stranka + vozilo (desktop + skupni deli) ── */
.customer-form-mobile .customer-form-subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: var(--color-muted, #64748b);
}
.customer-form-mobile .customer-vehicle-heading {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 600;
}
.customer-form-mobile .customer-vehicle-extras {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border, #e5e7eb);
}
.customer-form-mobile .customer-vehicle-photo-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.customer-form-mobile .customer-vehicle-photo-name {
  font-size: 0.8rem;
  margin-left: 0.25rem;
}

/* ── Telefon ≤ 640 px ──────────────────────────────────── */
@media (max-width: 640px) {

  /* ── Delovni nalog – forma ────────────────────── */
  .form-grid.three-cols {
    grid-template-columns: 1fr !important;
  }
  .form-grid.two-cols {
    grid-template-columns: 1fr !important;
  }

  /* Panels še bolj kompaktni na telefonu */
  .form-panel.panel { padding: 0.55rem 0.6rem; }
  .form-section {
    padding: 0 0 0.5rem;
    margin-bottom: 0.5rem;
    border-left: none;
    border-right: none;
    border-top: none;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 0;
    background: transparent;
  }
  /* Sekcije h2 – vizualne ločnice (numerirani koraki) */
  .form-section h2 {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #1f64ff;
    background: #eff4ff;
    border-radius: 0.45rem;
    padding: 0.35rem 0.65rem;
    margin: 0 0 0.65rem;
  }
  /* Tighter field gaps */
  .form-field { gap: 0.2rem; }
  .form-grid  { gap: 0.55rem; }

  /* Termin — datetime inputi full width */
  input[type="datetime-local"].input-field {
    width: 100%;
    font-size: 16px;
    -webkit-appearance: none;
    appearance: none;
  }
  .pick-slot-btn {
    font-size: 0.8rem;
    display: block;
    margin-top: 0.25rem;
  }

  /* Combo detail link manj vsiljiv */
  .combo-detail-btn { font-size: 0.8rem; padding: 0.25rem 0; }

  /* Opomba stranke / vozila – bolj kompaktna */
  .form-field [x-show="customerNoteVisible"],
  .form-field [x-show="vehicleNoteVisible"] { font-size: 0.82rem; padding: 0.5rem 0.7rem; }

  /* Shrani nalog – sticky gumb na dnu */
  .form-actions {
    position: sticky;
    bottom: 0;
    z-index: 20;
    background: rgba(255,255,255,0.97);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.1);
    padding: 0.7rem 0.6rem;
    margin: 0.75rem -0.6rem -0.55rem;
    border-top: 1px solid var(--color-border);
  }
  .form-actions .btn-primary { width: 100%; text-align: center; font-size: 1rem; min-height: 48px; }

  /* ── Račun – postavke kot kartice ─────────────── */
  .materials-table-wrap { overflow-x: visible; }

  .materials-table thead { display: none; }

  .materials-table,
  .materials-table tbody,
  .materials-table tr,
  .materials-table td { display: block; width: 100%; }

  .invoice-line-row {
    background: #fff;
    border: 1px solid #dce6f5;
    border-radius: 0.65rem;
    padding: 0.65rem 0.75rem;
    margin-bottom: 0.6rem;
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem 0.6rem;
  }
  /* Opis – cela vrstica */
  .invoice-line-row td:first-child { grid-column: 1 / -1; }
  /* Skupaj in brisanje */
  .invoice-line-row .line-total   { text-align: left; font-size: 1rem; }
  .invoice-line-row td:last-child { grid-column: 1 / -1; display: flex; gap: 0.5rem; align-items: center; }

  /* Oznake pred polji (pseudo) */
  .invoice-line-row td[data-m]:before {
    content: attr(data-m);
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--color-muted);
    margin-bottom: 0.2rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  /* Vsi inputi v vrsticah full-width */
  .invoice-line-row .input-field,
  .invoice-line-row select.input-field {
    width: 100% !important;
    height: 40px;
    font-size: 16px;
  }

  /* Gumb + Dodaj postavko – cela vrstica */
  #add-line-btn { width: 100%; text-align: center; padding: 0.7rem; }

  /* Shrani račun – lepsi sticky gumb na dnu */
  .inv-layout ~ * { padding-bottom: 4.5rem; }
  .inv-sidebar > div:last-child {
    position: sticky;
    bottom: 0;
    z-index: 20;
    background: rgba(255,255,255,0.97);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.1);
    border-top: 1px solid var(--color-border);
    padding: 0.75rem 0;
    margin: 0;
  }

  /* Naslov strani manjši */
  .wo-code { font-size: 1.2rem; }
  .wo-page-header { gap: 0.5rem; margin-bottom: 1rem; }

  /* Popust – full width */
  .form-field[style*="grid-column"] { grid-column: auto !important; }

  /* Vozila / Stranke – gridi v en stolpec */
  .form-grid-inline,
  .mobile-stack-grid {
    grid-template-columns: 1fr !important;
  }
  .form-group input[type="number"],
  .form-group input[type="tel"],
  .form-group input[type="email"] {
    font-size: 16px !important;
  }
  /* Vozila / Stranke – Shrani gumb polna širina, po želji sticky */
  .vehicle-form-mobile .form-actions .btn-submit-full-mobile,
  .customer-form-mobile .form-actions .btn-submit-full-mobile {
    width: 100%;
    min-height: 48px;
  }

  /* ── Nova stranka (stranka + vozilo) — mobilna berljivost ── */
  .customer-form-mobile .customer-form-page-head.page-header {
    margin-bottom: 0.75rem;
    padding-bottom: 0.65rem;
  }
  .customer-form-mobile .customer-form-page-head .page-title {
    font-size: 1.12rem;
  }
  .customer-form-mobile .customer-form-page-head .page-header-actions {
    width: 100%;
    margin-top: 0.5rem;
  }
  .customer-form-mobile .customer-form-page-head .page-header-actions .btn-ghost {
    width: 100%;
    text-align: center;
    padding: 0.5rem;
    font-size: 0.88rem;
  }
  .customer-form-mobile > .mobile-stack-grid > .card {
    padding: 1rem !important;
  }
  .customer-form-mobile .customer-form-subtitle {
    font-size: 0.78rem;
    margin-top: 0.15rem !important;
  }
  .customer-form-mobile .customer-form-hint-desktop {
    display: none !important;
  }
  .customer-form-mobile .customer-vehicle-heading {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02em;
  }
  .customer-form-mobile .customer-form-label-hint {
    font-weight: 400;
    font-size: 0.72rem;
    color: var(--color-muted, #64748b);
  }
  .customer-form-mobile .customer-vehicle-extras {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border, #e5e7eb);
  }
  .customer-form-mobile .customer-form-engine-moc {
    grid-template-columns: 1fr !important;
  }
  .customer-form-mobile .customer-form-moc-field {
    min-width: 0 !important;
  }
  .customer-form-mobile .customer-form-moc-field .input-field {
    width: 100% !important;
    max-width: 10rem;
  }
  .customer-form-mobile .customer-vehicle-photo-btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    width: 100%;
  }
  .customer-form-mobile .customer-vehicle-photo-btns .btn-ghost {
    min-height: 48px;
    justify-content: center;
    text-align: center;
    font-size: 0.9rem;
    padding: 0.55rem 0.5rem;
  }
  .customer-form-mobile .customer-vehicle-photo-name {
    display: block;
    font-size: 0.75rem;
    margin-top: 0.45rem;
    word-break: break-all;
    line-height: 1.3;
    color: var(--color-muted, #64748b);
  }
  .customer-form-mobile .form-actions {
    position: sticky;
    bottom: 0;
    z-index: 15;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
    padding: 0.75rem 0.5rem calc(0.75rem + env(safe-area-inset-bottom, 0));
    margin: 1rem -0.5rem 0;
    border-top: 1px solid var(--color-border, #e5e7eb);
    flex-direction: column;
  }
  .customer-form-mobile .form-actions .btn-ghost {
    width: 100%;
    min-height: 44px;
    justify-content: center;
    text-align: center;
  }
}

/* ═══════════════════════════════════════════════════════════
   DASHBOARD GRID — responsiven
   ═══════════════════════════════════════════════════════════ */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 1.25rem;
  margin-top: 1.25rem;
}
@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}


/* ═══════════════════════════════════════════════════════════
   SUBNAV — horizontalen scroll na mobilu
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 700px) {
  .subnav-module { display: none; }       /* Modul label skrijemo — je v subnavigation */
  .subnav-vdiv   { display: none; }

  .subnav-links {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex: 1;
    flex-wrap: nowrap;
    min-width: 0;
  }
  .subnav-links::-webkit-scrollbar { display: none; }

  .subnav-link {
    flex-shrink: 0;
    padding: 0 0.75rem;
    font-size: 0.8rem;
  }

  /* Desni del: vsi kontrolniki ostanejo (ikone + meni); kompaktno za prste */
  .subnav-right {
    gap: 0.2rem;
    padding-left: 0.3rem;
  }
  .subnav-ws-switch select {
    max-width: 6.5rem;
    font-size: 0.65rem;
    padding: 0.18rem 0.32rem;
  }
  .subnav-right .topbar-search-btn--icon-only,
  .subnav-right .topbar-create-btn--icon-only {
    min-width: 42px;
    min-height: 42px;
    padding: 0.3rem;
    justify-content: center;
  }
  .subnav-right .topbar-help-btn {
    min-width: 40px;
    min-height: 40px;
    width: 40px;
    height: 40px;
  }
  .subnav-right .user-menu-btn--compact {
    min-width: 42px;
    min-height: 42px;
  }
  .subnav-search {
    max-width: min(150px, 32vw);
  }
}

/* Zelo ozek zaslon: skrij samo polje globalnega iskanja (ostane 🔍 ukazi + meni) */
@media (max-width: 380px) {
  .subnav-search {
    display: none;
  }
}


/* ═══════════════════════════════════════════════════════════
   MOBILNA SPODNJA NAVIGACIJSKA VRSTICA
   Vidna samo ≤ 768 px, skrita na desktopu
   ═══════════════════════════════════════════════════════════ */
.mob-bottom-nav {
  display: none;           /* privzeto skrita — prikažemo samo na mobilu */
}

/* ovojnica: spodnja vrstica + Alpine list »Več« */

@media (max-width: 768px) {
  /* Prikažemo spodnjo vrstico */
  .mob-bottom-nav {
    display: flex;
    align-items: center;
    justify-content: space-around;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--color-sidebar, #0f172a);
    border-top: 1px solid rgba(255,255,255,0.08);
    z-index: 200;
    padding: 0 0.5rem env(safe-area-inset-bottom);  /* iPhone notch */
  }

  /* Dodamo padding vsebini da je nav ne prekriva */
  .app-content {
    padding-bottom: calc(60px + env(safe-area-inset-bottom));
  }

  /* Posamezna postaja */
  .mob-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.18rem;
    flex: 1;
    padding: 0.4rem 0.25rem 0.3rem;
    color: rgba(203, 213, 225, 0.85);
    text-decoration: none;
    font-size: 0.64rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    border-radius: 0.5rem;
    transition: color 0.15s, background-color 0.15s;
    min-height: 44px;
  }
  .mob-nav-item--on {
    color: #60a5fa;
  }
  .mob-nav-item--on .mob-nav-icon {
    transform: scale(1.15);
  }
  .mob-nav-item:active {
    background: rgba(255,255,255,0.07);
  }
  .mob-nav-icon {
    font-size: 1.35rem;
    line-height: 1;
    display: block;
    transition: transform 0.15s;
  }
  .mob-nav-label {
    display: block;
    line-height: 1;
  }

  /* Osrednji FAB — odpre meni Ustvari (enako kot + v subnav) */
  .mob-nav-fab {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 50%;
    background: var(--color-primary, #1f64ff);
    color: #fff;
    font-size: 1.6rem;
    font-weight: 300;
    line-height: 1;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(31,100,255,0.45);
    margin-top: -18px;   /* dvigne se nad vrstico */
    transition: background 0.15s, box-shadow 0.15s, transform 0.15s;
  }
  .mob-nav-fab:hover,
  .mob-nav-fab:active {
    background: var(--color-primary-dark, #1753d4);
    box-shadow: 0 6px 18px rgba(31,100,255,0.5);
    transform: scale(1.06);
  }

  /* Sidebar toggle — ostane viden za odpiranje menija */
  .sidebar-toggle { display: inline-flex; }

  /* Ena spodnja vrstica — skrij podvojeno iz sidebara */
  .mobile-bottom-nav { display: none !important; }

  /* Gumb »Več« v spodnji vrstici */
  button.mob-nav-item--more {
    border: none;
    background: transparent;
    font-family: inherit;
    cursor: pointer;
    width: auto;
  }

  /* Skrij besedilo blagovne znamke samo v starem app-topbar (ne v subnav) */
  .app-topbar .brand-text,
  .app-topbar .brand-ws,
  .app-topbar .brand-app { display: none !important; }
}

/* Mobilni list »Več« (kontekstni podmeni + ostalo) */
.mob-more-root {
  position: fixed;
  inset: 0;
  z-index: 220;
  pointer-events: none;
}
.mob-more-root .mob-more-backdrop,
.mob-more-root .mob-more-sheet {
  pointer-events: auto;
}
.mob-more-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}
.mob-more-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: min(78vh, 560px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.65rem 1rem calc(1rem + env(safe-area-inset-bottom));
  background: #fff;
  border-radius: 1rem 1rem 0 0;
  box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.18);
}
.mob-more-sheet__handle {
  width: 2.5rem;
  height: 4px;
  margin: 0 auto 0.65rem;
  background: #cbd5e1;
  border-radius: 999px;
}
.mob-more-sheet__title {
  margin: 0 0 0.75rem;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}
.mob-more-sheet__title--sec {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e2e8f0;
}
.mob-more-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.65rem;
  margin-bottom: 0.25rem;
  border-radius: 0.65rem;
  text-decoration: none;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  min-height: 52px;
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.mob-more-link:active { background: #f1f5f9; }
.mob-more-link--primary {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-color: #93c5fd;
}
.mob-more-link--on {
  border-color: #60a5fa;
  background: #eff6ff;
}
.mob-more-link--danger {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #9f1239;
}
.mob-more-logout {
  margin: 0;
  padding: 0;
}
.mob-more-link__ico { font-size: 1.35rem; line-height: 1; flex-shrink: 0; }
.mob-more-link__text { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.mob-more-link__text strong { font-size: 0.92rem; }
.mob-more-link__text small { font-size: 0.76rem; color: #64748b; font-weight: 500; }

/* Nastavitve — opozorilo za vabilo */
.settings-team-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding: 1rem 1.1rem;
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  border: 1px solid #93c5fd;
  border-radius: 0.75rem;
}
.settings-team-cta__body { flex: 1 1 200px; }

/* Ekipa — sidro vabilo + mobilni obrazec */
#team-invite { scroll-margin-top: 5.5rem; }
.team-invite-panel .team-add-row .form-field { min-width: 0; }
@media (max-width: 640px) {
  .team-add-row {
    flex-direction: column;
    align-items: stretch;
  }
  .team-add-row .form-field[style*="min-width"] { min-width: 0 !important; width: 100%; }
  .team-add-row .btn-primary { width: 100%; justify-content: center; }
  .team-table { font-size: 0.8rem; }
  .team-table input.input-field--xs { width: 100% !important; max-width: 100%; }
}

/* ═══════════════════════════════════════════════════════════════
   PLATFORM ADMIN — mobilna preglednost
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .app-shell:has(.subnav--platform) .app-content {
    padding: var(--layout-pad-y) var(--layout-pad-x);
  }
  .app-shell:has(.subnav--platform) .panel,
  .app-shell:has(.subnav--platform) .platform-panel {
    padding: var(--panel-pad-y) var(--panel-pad-x);
    margin: 0;
  }
  /* Glava: stolpec na mobilu */
  .app-shell:has(.subnav--platform) .wo-list-header,
  .app-shell:has(.subnav--platform) .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  .app-shell:has(.subnav--platform) .wo-list-header .btn-primary,
  .app-shell:has(.subnav--platform) .page-header .btn-primary {
    width: 100%;
    text-align: center;
  }
  .app-shell:has(.subnav--platform) .page-header form {
    margin-left: 0 !important;
    flex-direction: column;
  }
  .app-shell:has(.subnav--platform) .wo-list-header {
    padding-bottom: 1rem;
  }
  /* KPI stats: 2 stolpca na mobilu */
  .app-shell:has(.subnav--platform) .wo-stats-bar {
    gap: 0.5rem;
    padding-bottom: 1rem;
  }
  .app-shell:has(.subnav--platform) .wo-stat {
    flex: 1 1 calc(50% - 0.5rem);
    min-width: 0;
    padding: 0.6rem 0.5rem;
  }
  .app-shell:has(.subnav--platform) .wo-stat-num {
    font-size: 1.2rem;
  }
  .app-shell:has(.subnav--platform) .wo-stat-lbl {
    font-size: 0.65rem;
  }
  /* Gridi: en stolpec na mobilu */
  .app-shell:has(.subnav--platform) .platform-grid-2,
  .app-shell:has(.subnav--platform) .platform-grid-3 {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }
  .app-shell:has(.subnav--platform) .platform-panel .card {
    padding: 1.25rem;
  }
  /* Header: gumb pod naslovom */
  .app-shell:has(.subnav--platform) .platform-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .app-shell:has(.subnav--platform) .platform-header-btn {
    width: 100%;
    text-align: center;
  }
  /* Stats: bolj pregledno */
  .app-shell:has(.subnav--platform) .platform-stats {
    gap: 0.6rem;
  }
  /* Tabele: horizontalni scroll */
  .app-shell:has(.subnav--platform) .platform-panel .card,
  .app-shell:has(.subnav--platform) .platform-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .app-shell:has(.subnav--platform) .platform-panel table.wo-table {
    min-width: 520px;
  }
}

/* Platform subnav: horizontalni scroll na mobilnem (fiksna višina 52px mora ostati) */
@media (max-width: 960px) {
  .subnav--platform .subnav-links {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
    gap: 0;
  }
  .subnav--platform .subnav-links::-webkit-scrollbar { display: none; }
  .subnav--platform .subnav-link {
    flex-shrink: 0;
    padding: 0 0.65rem;
    font-size: 0.78rem;
    white-space: nowrap;
  }
  .subnav--platform .subnav-link--add {
    flex-shrink: 0;
    margin-left: 0.4rem;
    padding: 0.28rem 0.65rem;
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .app-shell:has(.subnav--platform) .wo-stat {
    flex: 1 1 calc(50% - 0.3rem);
    min-width: 120px;
  }
  .app-shell:has(.subnav--platform) .platform-stats .wo-stat-num {
    font-size: 1.1rem;
  }
  .app-shell:has(.subnav--platform) .platform-stats .wo-stat-lbl {
    font-size: 0.6rem;
  }
  .app-shell:has(.subnav--platform) .app-content {
    padding: var(--layout-pad-y) var(--layout-pad-x);
  }
  .app-shell:has(.subnav--platform) .panel,
  .app-shell:has(.subnav--platform) .platform-panel {
    padding: var(--panel-pad-y) var(--panel-pad-x);
  }
  /* Dotikalne tarče: gumbi vsaj 44px */
  .app-shell:has(.subnav--platform) .btn-primary,
  .app-shell:has(.subnav--platform) .btn-ghost {
    min-height: 44px;
    padding: 0.6rem 1rem;
  }
  .app-shell:has(.subnav--platform) .wo-filter-bar {
    gap: 0.5rem;
    padding-bottom: 1rem;
  }
  .app-shell:has(.subnav--platform) .wo-filter-btn {
    flex: 1 1 100%;
    min-height: 44px;
    justify-content: center;
  }
  .subnav--platform .subnav-link {
    min-height: 40px;
    padding: 0.5rem 0.6rem;
    display: inline-flex;
    align-items: center;
  }
}

/* ═══════════════════════════════════════════════════════════════
   MODERN DESIGN REFRESH — enhanced clarity, hierarchy & emphasis
   ═══════════════════════════════════════════════════════════════ */

/* ── body baseline ── */
body {
  font-size: 0.9375rem; /* 15px */
  line-height: 1.55;
}

/* ── Better link transitions ── */
a {
  transition: color var(--transition-fast), opacity var(--transition-fast);
}

/* ── app-content: extra breathing room ── */
.app-content {
  padding: var(--layout-pad-y) var(--layout-pad-x);
}

/* ── Auth card polish ── */
.auth-card {
  box-shadow: 0 32px 72px rgba(15, 23, 42, 0.14), 0 0 0 1px rgba(255,255,255,0.6);
  border-radius: 1.5rem;
}

/* ── Dashboard grid more generous ── */
.dashboard-grid {
  gap: 1.5rem;
}

/* ── Panel head spacing ── */
.panel-head {
  margin-bottom: 1.1rem;
}

/* ── Form section improved ── */
.form-section {
  border: 1px solid #d0ddf0;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(31, 100, 255, 0.03), #fff);
}

.form-section h2 {
  font-size: 0.95rem;
  font-weight: 800;
  color: #162c60;
  letter-spacing: -0.01em;
}

/* ── Form control improved ── */
.form-control {
  gap: 0.4rem;
  margin-bottom: 1rem;
}

/* ── KPI grid ── */
.kpi-grid {
  gap: 0.85rem;
}

/* ── KPI colored variants enhanced ── */
.kpi-card--blue { border-left-width: 4px; }
.kpi-card--amber { border-left-width: 4px; }
.kpi-card--red { border-left-width: 4px; }
.kpi-card--green { border-left-width: 4px; }

/* ── Btn-sm sizing ── */
.btn-sm {
  padding: 0.42rem 0.9rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

/* ── Danger button ── */
.btn-danger-sm,
.btn-danger {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: #fff;
  border: none;
  box-shadow: 0 2px 6px rgba(185, 28, 28, 0.30);
}

.btn-danger-sm:hover,
.btn-danger:hover {
  background: linear-gradient(135deg, #b91c1c, #991b1b);
  box-shadow: 0 4px 12px rgba(185, 28, 28, 0.40);
  transform: translateY(-1px);
}

/* ── Priority card ── */
.priority-card {
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: #f8fbff;
}

/* ── Finance card ── */
.finance-card {
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(31, 100, 255, 0.06), rgba(31, 100, 255, 0.03));
}

/* ── Timeline cards ── */
.timeline-card {
  border-radius: var(--radius-md);
  transition: background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.timeline-card:hover {
  box-shadow: var(--shadow-sm);
}

/* ── List cards ── */
.list-cards li {
  border-radius: var(--radius-md);
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.list-cards li:hover {
  background-color: rgba(31, 100, 255, 0.03);
  border-color: rgba(31, 100, 255, 0.20);
}

/* ── Materials table header ── */
.materials-table th {
  background: linear-gradient(135deg, rgba(30, 64, 175, 0.12), rgba(30, 64, 175, 0.07));
  color: #1e40af;
  font-size: 0.72rem;
}

/* ── Materials table row hover ── */
.materials-table tbody tr:hover {
  background-color: rgba(31, 100, 255, 0.04);
}

/* ── Order calculator improved ── */
.order-calculator {
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #f5f8ff, #fff);
  box-shadow: var(--shadow-sm);
}

/* ── WO calc tile improved ── */
.wo-calc-tile {
  border-radius: 0.65rem;
}

/* ── Empty state improved ── */
.empty-state {
  padding: 3.5rem 2rem;
}

.empty-state-icon {
  font-size: 3rem;
  opacity: 0.7;
}

.empty-state-title {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

/* ── Page header ── */
.page-header {
  margin-bottom: 1.75rem;
}

/* ── Eyebrow ── */
.eyebrow {
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
}

/* ── Flash: auto-remove after animation ── */
.flash {
  min-width: 240px;
}

/* ── User avatar slightly larger ── */
.user-avatar {
  width: 30px;
  height: 30px;
}

/* ── User menu dropdown ── */
.user-menu-dropdown {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

/* ── User menu items ── */
.user-menu-dropdown a,
.user-menu-dropdown button.menu-item {
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}

/* ── Topbar create dropdown ── */
.topbar-create-dropdown {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
}

/* ── Topbar create items ── */
.topbar-dd-item {
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast);
}

.topbar-dd-item:hover {
  background-color: rgba(31, 100, 255, 0.07);
}

/* ── Global search panel ── */
.global-search-panel {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

/* ── CMD palette ── */
.cmd-palette {
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(31, 100, 255, 0.08);
}

/* ── Subnav link active indicator ── */
.subnav-link--on {
  font-weight: 700;
}

/* ── Subnav add button ── */
.subnav-link--add {
  font-weight: 700;
  letter-spacing: 0.01em;
}

/* ── Brand mark in sidebar ── */
.brand-mark {
  background: linear-gradient(135deg, #4a8eff, var(--color-primary) 50%, #1241b8);
  box-shadow: 0 2px 8px rgba(31, 100, 255, 0.35);
}

/* ── Better HR ── */
hr {
  margin: 1.5rem 0;
  opacity: 0.8;
}

/* ── Form actions: consistent spacing ── */
.form-actions {
  margin-top: 1.25rem;
  gap: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* ── Badge pill variants: bolder ── */
.badge-pill {
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.22rem 0.65rem;
}

/* ── WO header status badge: larger ── */
.wo-header-status-badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
}

/* ── Attachments grid ── */
.attachments-grid li {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.attachments-grid li:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(31, 100, 255, 0.25);
}

/* ── Dropzone improved ── */
.dropzone {
  border-radius: var(--radius-lg);
  transition: border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.dropzone:hover {
  box-shadow: 0 0 0 4px rgba(31, 100, 255, 0.10);
}

/* ── Mobile bottom nav: dark (consistent with subnav/sidebar) ── */
.mob-bottom-nav {
  background: linear-gradient(180deg, #0e1a2e, #0a1220);
  box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.35);
  border-top: 2px solid rgba(255,255,255,0.10);
}

/* ── Sidebar's mobile bottom nav: white ── */
.mobile-bottom-nav {
  background: #fff;
  box-shadow: 0 -2px 16px rgba(15, 23, 42, 0.12);
  border-top: 2px solid #a8bcd4;
}

/* ── Sidebar backdrop blur ── */
.sidebar-backdrop {
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

/* ── Micro heading ── */
.micro-heading {
  font-weight: 800;
  letter-spacing: 0.06em;
  font-size: 0.73rem;
  color: var(--color-muted);
}

/* ── Input-sm ── */
.input-sm {
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
  padding: 0.28rem 0.5rem;
  border: 1.5px solid #c2d0e5;
  background: var(--color-input-bg);
}

.input-sm:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(31, 100, 255, 0.15);
}

/* ── Scroll-y panel ── */
.panel:has(> .table-list) {
  padding: 0;
  overflow: hidden;
}

/* ── Section titles inside forms ── */
.form-section h2,
.form-section h3 {
  margin-bottom: 0.85rem;
}

/* ── Color KPI card left-border emphasis ── */
.kpi-card--blue,
.kpi-card--amber,
.kpi-card--red,
.kpi-card--green {
  box-shadow: var(--shadow-sm);
}

/* ── Hover elevation on panels ── */
.panel-hover:hover {
  box-shadow: var(--shadow-lg);
  transition: box-shadow var(--transition-fast);
}

/* ── Better responsive table styling ── */
.table-list {
  background: var(--color-panel);
}

/* ── Better global search input appearance ── */
.global-search-wrap {
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.global-search-wrap:focus-within {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(31, 100, 255, 0.55);
  box-shadow: 0 0 0 2px rgba(31, 100, 255, 0.20);
}

/* ── Topbar search button improved ── */
.topbar-search-btn {
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

/* ── Better create button ── */
.topbar-create-btn {
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

/* ── Help button ── */
.topbar-help-btn {
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast), color var(--transition-fast);
}

/* ── Form field gap ── */
.form-grid {
  gap: 1rem;
}

/* ── Calc list ── */
.calc-list > div {
  font-size: 0.9rem;
  padding: 0.15rem 0;
}

/* ── Order helper sidebar ── */
.order-helper {
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #f7f9ff, #fafcff);
  box-shadow: var(--shadow-sm);
}

/* ── Order filters ── */
.order-filters {
  margin: 1.25rem 0;
  gap: 0.85rem;
}

/* ── Scrollbar: thinner and prettier ── */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}

*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 3px;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.55);
}

/* Exception: sidebar keeps hidden scrollbar */
.app-sidebar { scrollbar-width: none; }
.app-sidebar::-webkit-scrollbar { display: none; }

/* ─── Responsive adjustments for modernization ─── */
@media (max-width: 960px) {
  body { font-size: 0.9375rem; }
  .page-header-left h1 { font-size: 1.35rem; }
  .app-content {
    padding: 0.75rem var(--layout-pad-x);
    padding-bottom: max(5.5rem, calc(5.25rem + env(safe-area-inset-bottom, 0px)));
  }
}

@media (max-width: 640px) {
  body { font-size: 0.9rem; }
  .page-header-left h1 { font-size: 1.2rem; }
  .kpi-value { font-size: 1.35rem; }
  .btn-primary, .btn-secondary { font-size: 0.88rem; }
}

/* ═══════════════════════════════════════════════════════════════
   BORDER EMPHASIS — poudarjene obrobe povsod
   ═══════════════════════════════════════════════════════════════ */

/* ── Topbar bottom border ── */
.app-topbar {
  border-bottom: 2px solid var(--color-border);
}

/* ── Subnav bottom separator ── */
.subnav {
  border-bottom: 2.5px solid rgba(255,255,255,0.14);
}

/* ── Sidebar right border ── */
@media (min-width: 961px) {
  .app-sidebar {
    border-right: 2px solid rgba(255,255,255,0.08);
  }
}

/* ── Sidebar separator between sections ── */
.nav-section-label {
  border-top: 1.5px solid rgba(255,255,255,0.09);
  margin-top: 1.3rem;
  padding-top: 0.6rem;
}
.nav-section-label:first-of-type {
  border-top: none;
  margin-top: 0.4rem;
  padding-top: 0;
}

/* ── Panel top accent border ── */
.panel {
  border-top: 3px solid var(--color-border-strong);
}

/* ── Form section ── */
.form-section {
  border: 2px solid var(--color-border);
  border-top: 3.5px solid var(--color-primary);
}

/* ── KPI card left accent ── */
.kpi-card {
  border: 2px solid var(--color-border);
  border-left: 4px solid var(--color-border-strong);
}
.kpi-card.highlight,
.kpi-card--blue  { border-left-color: var(--color-primary); }
.kpi-card--green { border-left-color: #16a34a; }
.kpi-card--amber { border-left-color: #d97706; }
.kpi-card--red   { border-left-color: #dc2626; }

/* ── wo-calc card ── */
.wo-calc {
  border: 2px solid var(--color-border);
  border-top: 3.5px solid #1d4ed8;
}

/* ── order-calculator ── */
.order-calculator {
  border: 2px solid var(--color-border);
  border-top: 3.5px solid var(--color-primary);
}

/* ── order-helper ── */
.order-helper {
  border: 2px solid var(--color-border);
  border-top: 3.5px solid var(--color-primary);
}

/* ── ai-suggestion cards ── */
.ai-suggestion {
  border: 2px solid var(--color-border);
}

/* ── AI form card ── */
.ai-form-card {
  border: 2px solid var(--color-border);
  border-top: 4px solid #2563eb;
}

/* ── Filter bar bottom line ── */
.wo-filter-bar {
  border-bottom: 2px solid var(--color-border);
}

/* ── Stats bar bottom line ── */
.wo-stats-bar {
  border-bottom: 2px solid var(--color-border);
}

/* ── WO list header ── */
.wo-list-header {
  border-bottom: 2px solid var(--color-border);
}

/* ── Panel head separator ── */
.panel-head {
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 0.85rem;
}
.panel-head:not(.panel-head--no-border) {
  border-bottom: 2px solid var(--color-border);
}

/* ── HR ── */
hr {
  border-top: 2px solid var(--color-border);
}

/* ── User menu divider ── */
.user-menu-divider {
  height: 2px;
  background: var(--color-border);
}

/* ── Topbar create dropdown divider ── */
.topbar-dd-divider {
  height: 2px;
  background: var(--color-border);
  margin: 0.3rem 0;
}

/* ── timeline-card ── */
.timeline-card {
  border: 2px solid var(--color-border);
}

/* ── list-cards li ── */
.list-cards li {
  border: 2px solid var(--color-border);
}

/* ── Badge ── */
.badge {
  border-width: 1.5px;
}

/* ── Global search wrap ── */
.global-search-wrap {
  border: 2px solid rgba(255,255,255,0.22);
}
.global-search-wrap:focus-within {
  border-color: rgba(31,100,255,0.7);
}

/* ══════════════════════════════════════════════════════
   FINANCE / BILLING — globalni stili
   ══════════════════════════════════════════════════════ */

/* ── Invoice list tabela — glava z emerald temo ── */
.invoice-table .table-head,
.finance-table .table-head {
  background: linear-gradient(135deg, #d1fae5 0%, #f0fdf4 100%);
  border-bottom: 2px solid #6ee7b7;
  color: #065f46;
  font-weight: 800;
}
.table-row.invoice-row {
  border-left: 4px solid transparent;
  transition: border-color 0.15s, background 0.15s;
}
.table-row.invoice-row:not(.table-head):hover {
  border-left-color: #10b981;
  background: #f0fdf4;
}
.table-row.invoice-row--overdue {
  background: #fff5f5 !important;
  border-left-color: #f87171 !important;
}

.inv-list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
  justify-content: flex-end;
}
.inv-list-pay,
.inv-list-remind {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  margin: 0;
}
.inv-list-pay__method {
  font-size: 0.75rem;
  padding: 0.2rem 0.35rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 6px;
  max-width: 9.5rem;
  background: #fff;
}
.inv-list-pay__btn {
  white-space: nowrap;
  background: #047857;
  border-color: #047857;
}
@media (max-width: 900px) {
  .inv-list-actions {
    justify-content: flex-start;
  }
}

/* ── Finance navigacija ── */
/* ── Finance page header ── */
.fin-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}
.fin-page-header__left { flex: 1; min-width: 0; }
.fin-page-header__actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.fin-page-lead {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  color: #64748b;
  max-width: 42rem;
  line-height: 1.45;
}
.fin-section-hint {
  font-size: 0.82rem;
  color: #64748b;
  margin: -0.35rem 0 0.85rem;
  line-height: 1.4;
}
.fin-section-title-period {
  font-size: 0.78rem;
  font-weight: 500;
  color: #64748b;
  margin-left: 0.5rem;
}
.fin-period-caption {
  font-size: 0.82rem;
  color: #475569;
  margin: -0.45rem 0 1rem;
}
.fin-now-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem;
}
.fin-now-grid .fin-kpi-tile {
  padding: 0.55rem 0.7rem;
  border-radius: 0.55rem;
}
.fin-now-grid .fin-kpi-tile__label {
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  margin: 0 0 0.08rem;
}
.fin-now-grid .fin-kpi-tile__value {
  font-size: 1.2rem;
}
.fin-now-grid .fin-kpi-tile__sub {
  font-size: 0.68rem;
  margin: 0.06rem 0 0;
  line-height: 1.25;
}
.fin-glossary {
  border: 1.5px solid #e2e8f0;
  border-radius: 0.65rem;
  background: #f8fafc;
  margin: 0 0 1rem;
  padding: 0.15rem 0.85rem;
}
.fin-glossary summary {
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
  padding: 0.55rem 0;
  list-style: none;
}
.fin-glossary summary::-webkit-details-marker { display: none; }
.fin-glossary summary::before {
  content: '?';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  margin-right: 0.4rem;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 800;
}
.fin-glossary__list {
  margin: 0 0 0.75rem;
  display: grid;
  gap: 0.65rem;
}
.fin-glossary__list dt {
  font-size: 0.78rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}
.fin-glossary__list dd {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: #475569;
  line-height: 1.4;
}
.fin-formula {
  border: 1.5px solid #dbeafe;
  border-radius: 0.85rem;
  background: linear-gradient(180deg, #f8fbff 0%, #fff 100%);
  padding: 0.35rem 1.1rem 0.85rem;
  margin-bottom: 0.85rem;
}
.fin-formula__row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  padding: 0.85rem 0 0.55rem;
}
.fin-formula__row--minus {
  border-top: 1px dashed #cbd5e1;
}
.fin-formula__row--result {
  border-top: 2px solid #0f172a;
  margin-top: 0.15rem;
}
.fin-formula__name {
  display: block;
  font-size: 0.92rem;
  font-weight: 800;
  color: #0f172a;
}
.fin-formula__help {
  display: block;
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.12rem;
}
.fin-formula__value {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
  white-space: nowrap;
}
.fin-formula__row--result .fin-formula__value {
  font-size: 1.85rem;
  color: #15803d;
}
.fin-formula__row--neg .fin-formula__value {
  color: #dc2626;
}
.fin-formula__split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin: 0 0 0.35rem;
}
.fin-formula__split-item {
  background: #f1f5f9;
  border-radius: 0.5rem;
  padding: 0.45rem 0.7rem;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #475569;
}
.fin-formula__split-item strong {
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}
.fin-origin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.fin-origin-card {
  border: 1.5px solid #bbf7d0;
  background: #f0fdf4;
  border-radius: 0.7rem;
  padding: 0.85rem 1rem;
}
.fin-origin-card--labor {
  border-color: #bae6fd;
  background: #f0f9ff;
}
.fin-origin-card__label {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}
.fin-origin-card__value {
  margin: 0.15rem 0 0;
  font-size: 1.4rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
}
.fin-origin-card__sub {
  margin: 0.2rem 0 0;
  font-size: 0.76rem;
  color: #64748b;
  line-height: 1.35;
}
.fin-funnel {
  margin: 0.85rem 0 1rem;
  padding: 0.85rem 1rem;
  border: 1.5px solid #99f6e4;
  border-radius: 0.75rem;
  background: linear-gradient(180deg, #f0fdfa 0%, #ffffff 100%);
}
.fin-funnel__title {
  margin: 0 0 0.2rem;
  font-size: 0.92rem;
  font-weight: 800;
  color: #0f766e;
}
.fin-funnel__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.45rem;
  margin-top: 0.55rem;
}
.fin-funnel__tile {
  background: #fff;
  border: 1px solid #ccfbf1;
  border-radius: 0.55rem;
  padding: 0.55rem 0.6rem;
}
.fin-funnel__tile--warn {
  border-color: #fde68a;
  background: #fffbeb;
}
.fin-funnel__tile--sky {
  border-color: #bae6fd;
  background: #f0f9ff;
}
.fin-funnel__label {
  margin: 0;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}
.fin-funnel__value {
  margin: 0.12rem 0 0;
  font-size: 1.15rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
}
.fin-funnel__sub {
  margin: 0.08rem 0 0;
  font-size: 0.68rem;
}
.fin-margin-break {
  margin: 0.85rem 0 1rem;
  padding: 0.85rem 1rem;
  border: 1.5px solid #bbf7d0;
  border-radius: 0.75rem;
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%);
}
.fin-margin-break__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.85rem;
  margin-top: 0.55rem;
}
.fin-margin-break__col-title {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #166534;
}
.fin-margin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.fin-margin-table th,
.fin-margin-table td {
  padding: 0.35rem 0.4rem;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  vertical-align: top;
}
.fin-margin-table th {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748b;
  font-weight: 700;
}
.fin-margin-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.fin-margin-table .neg {
  color: #dc2626;
}
.fin-margin-table__name {
  font-weight: 600;
  color: #0f172a;
}
.fin-margin-table__supp {
  display: block;
  margin-top: 0.1rem;
}
.fin-year-compare {
  font-size: 0.82rem;
  color: #475569;
  margin: 0.75rem 0 0;
}
.fin-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 800px) {
  .fin-formula__split,
  .fin-origin-grid,
  .fin-details-grid {
    grid-template-columns: 1fr;
  }
  .fin-formula__value {
    font-size: 1.3rem;
  }
  .fin-formula__row--result .fin-formula__value {
    font-size: 1.5rem;
  }
}

/* ── Finance period selector bar ── */
.fin-period-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding: 0.55rem 0.85rem;
  margin-bottom: 1rem;
  border: 1.5px solid #d1d5db;
  border-radius: 0.65rem;
  background: #f8fafc;
}
.fin-period-bar__label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 0.25rem;
  white-space: nowrap;
}
.fin-period-bar__btn {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  text-decoration: none;
  color: #374151;
  border: 1.5px solid #e5e7eb;
  background: #fff;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.fin-period-bar__btn:hover {
  background: #f0f9ff;
  border-color: #0ea5e9;
  color: #0369a1;
}
.fin-period-bar__btn--active {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}
.fin-period-bar__btn--active:hover {
  background: #1e40af;
  border-color: #1e40af;
  color: #fff;
}
.fin-period-bar__current {
  display: none;
}
.fin-period-bar__sep {
  color: #d1d5db;
  font-size: 1rem;
  margin: 0 0.1rem;
  user-select: none;
}
.fin-period-bar__month-form {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin: 0;
}
.fin-period-bar__month-select {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1.5px solid #e5e7eb;
  background: #fff;
  color: #374151;
  cursor: pointer;
  transition: border-color 0.15s;
  max-width: 130px;
}
.fin-period-bar__month-select:focus {
  outline: none;
  border-color: #1d4ed8;
}
/* Active state when a specific month is selected */
.fin-period-bar--month-active .fin-period-bar__month-select {
  border-color: #1d4ed8;
  background: #eff6ff;
  color: #1d4ed8;
}
.fin-period-bar__clear {
  font-size: 0.75rem;
  font-weight: 700;
  color: #6b7280;
  text-decoration: none;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  border: 1.5px solid #e5e7eb;
  background: #f9fafb;
  line-height: 1;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.fin-period-bar__clear:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}
@media (max-width: 480px) {
  .fin-period-bar__btn { font-size: 0.75rem; padding: 0.2rem 0.55rem; }
  .fin-period-bar__month-select { max-width: 110px; font-size: 0.75rem; }
  .fin-period-bar__sep { display: none; }
}

.finance-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding: 0.6rem 0.75rem;
  margin-bottom: 1rem;
  border: 1.5px solid #6ee7b7;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  position: sticky;
  top: 0;
  z-index: 10;
}
.finance-nav a {
  font-size: 0.78rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  text-decoration: none;
  color: #065f46;
  font-weight: 600;
  border: 1.5px solid transparent;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.finance-nav a:hover {
  background: #d1fae5;
  border-color: #6ee7b7;
}
.finance-nav a.active {
  background: #10b981;
  color: #fff;
  border-color: #059669;
}

/* ── Finance sekcija naslov ── */
.finance-section {
  margin-bottom: 1.5rem;
  scroll-margin-top: 3.5rem;
}
.finance-section-title {
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 0.85rem;
  padding: 0.55rem 0.85rem;
  border-left: 4px solid #10b981;
  background: linear-gradient(135deg, #f0fdf4 0%, #fff 100%);
  border-radius: 0 0.5rem 0.5rem 0;
  border: 1.5px solid #a7f3d0;
  border-left: 4px solid #10b981;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.finance-section-title .num {
  background: #10b981;
  color: #fff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  flex-shrink: 0;
}

/* ── Finance accordion (details) ── */
details.finance-details {
  border: 1.5px solid #a7f3d0;
  border-radius: 0.75rem;
  margin-bottom: 1rem;
  overflow: hidden;
}
details.finance-details summary {
  padding: 0.75rem 1rem;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #065f46;
  font-size: 0.9rem;
}
details.finance-details summary::-webkit-details-marker { display: none; }
details.finance-details summary::before {
  content: '';
  width: 0;
  height: 0;
  border: 5px solid transparent;
  border-left-color: #10b981;
  transition: transform 0.2s;
  flex-shrink: 0;
}
details.finance-details[open] summary::before { transform: rotate(90deg); }
details.finance-details .details-inner {
  padding: 1rem;
  background: #fff;
  border-top: 1.5px solid #a7f3d0;
}
details.finance-details--sub {
  border-color: #e2e8f0;
  margin: 0 0 0.65rem;
}
details.finance-details--sub summary {
  background: #f8fafc;
  color: #0f172a;
  font-size: 0.86rem;
}
details.finance-details--sub summary::before {
  border-left-color: #64748b;
}
details.finance-details--sub .details-inner {
  border-top-color: #e2e8f0;
  padding: 0.85rem 0.9rem 1rem;
}
.fin-subhead {
  margin: 0 0 0.5rem;
  font-size: 0.88rem;
  font-weight: 800;
  color: #0f172a;
}
.fin-detail-muted {
  color: #94a3b8;
  font-weight: 500;
  font-size: 0.75rem;
}
.fin-detail-total {
  font-weight: 800;
  background: #f8fafc;
  border-top: 1.5px solid #cbd5e1;
}
.fin-top-rank__name {
  text-decoration: none;
  color: inherit;
}
a.fin-top-rank__name:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

/* ── Finance KPI tiles ── */
.fin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
a.fin-kpi-tile--link {
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s ease, transform 0.1s ease;
}
a.fin-kpi-tile--link:hover {
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.12);
  transform: translateY(-1px);
}

.fin-kpi-tile {
  border-radius: 0.75rem;
  padding: 0.95rem 1rem;
  border: 1.5px solid #e2e8f0;
  border-top: 3px solid #94a3b8;
  background: #fff;
}
.fin-kpi-tile__label {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 0.2rem;
  color: #64748b;
}
.fin-kpi-tile__value {
  font-size: 1.55rem;
  font-weight: 850;
  margin: 0;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}
.fin-kpi-tile__sub {
  font-size: 0.74rem;
  color: #64748b;
  margin: 0.15rem 0 0;
  line-height: 1.35;
}
.fin-kpi-tile__trend {
  font-size: 0.76rem;
  font-weight: 700;
  margin: 0.1rem 0 0;
}
.fin-kpi-tile--green  { border-top-color: #22c55e; background: linear-gradient(135deg, #f0fdf4, #fff); }
.fin-kpi-tile--green .fin-kpi-tile__label { color: #15803d; }
.fin-kpi-tile--green .fin-kpi-tile__value { color: #16a34a; }
.fin-kpi-tile--amber  { border-top-color: #f59e0b; background: linear-gradient(135deg, #fffbeb, #fff); }
.fin-kpi-tile--amber .fin-kpi-tile__label { color: #92400e; }
.fin-kpi-tile--amber .fin-kpi-tile__value { color: #d97706; }
.fin-kpi-tile--red    { border-top-color: #dc2626; background: linear-gradient(135deg, #fff5f5, #fff); }
.fin-kpi-tile--red .fin-kpi-tile__label   { color: #b91c1c; }
.fin-kpi-tile--red .fin-kpi-tile__value   { color: #dc2626; }
.fin-kpi-tile--blue   { border-top-color: #6366f1; background: linear-gradient(135deg, #eef2ff, #fff); }
.fin-kpi-tile--blue .fin-kpi-tile__label  { color: #4f46e5; }
.fin-kpi-tile--blue .fin-kpi-tile__value  { color: #4f46e5; }
.fin-kpi-tile--sky    { border-top-color: #0ea5e9; background: linear-gradient(135deg, #f0f9ff, #fff); }
.fin-kpi-tile--sky .fin-kpi-tile__label   { color: #0369a1; }
.fin-kpi-tile--sky .fin-kpi-tile__value   { color: #0284c7; }
.fin-kpi-tile--gray   { border-top-color: #94a3b8; background: linear-gradient(135deg, #f8fafc, #fff); }
.fin-kpi-tile--gray .fin-kpi-tile__value  { color: #94a3b8; }
.fin-kpi-tile--star   { border-top-color: #eab308; border-width: 1.5px; border-top-width: 3px; background: linear-gradient(135deg, #fefce8, #fff); }
.fin-kpi-tile--star .fin-kpi-tile__label  { color: #a16207; }
.fin-kpi-tile--star .fin-kpi-tile__value  { color: #ca8a04; font-size: 1.65rem; font-weight: 900; }

/* ── Invoice / billing tables ── */
.billing-table th,
.billing-table td,
.invoice-table th,
.invoice-table td {
  border-bottom: 1.5px solid var(--color-border);
}

/* ── Finance sub-tiles (terjatve, ure) ── */
.fin-sub-tile {
  border-radius: 0.55rem;
  padding: 0.75rem;
  border: 1.5px solid #e2e8f0;
}
.fin-sub-tile__label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  margin: 0 0 0.15rem;
}
.fin-sub-tile__value {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.fin-sub-tile__note {
  font-size: 0.72rem;
  color: #64748b;
  margin: 0.1rem 0 0;
}
.fin-sub-tile--yellow { background: #fffbeb; border-color: #fde68a; }
.fin-sub-tile--yellow .fin-sub-tile__label { color: #92400e; }
.fin-sub-tile--yellow .fin-sub-tile__value { color: #d97706; }
.fin-sub-tile--orange { background: #fff7ed; border-color: #fed7aa; }
.fin-sub-tile--orange .fin-sub-tile__label { color: #c2410c; }
.fin-sub-tile--orange .fin-sub-tile__value { color: #ea580c; }
.fin-sub-tile--green  { background: #f0fdf4; border-color: #bbf7d0; }
.fin-sub-tile--green .fin-sub-tile__label  { color: #15803d; }
.fin-sub-tile--green .fin-sub-tile__value  { color: #16a34a; }
.fin-sub-tile--red    { background: #fff5f5; border-color: #fecaca; }
.fin-sub-tile--red .fin-sub-tile__label    { color: #b91c1c; }
.fin-sub-tile--red .fin-sub-tile__value    { color: #dc2626; }
.fin-sub-tile--blue   { background: #f0f9ff; border-color: #bae6fd; }
.fin-sub-tile--blue .fin-sub-tile__label   { color: #0369a1; }
.fin-sub-tile--blue .fin-sub-tile__value   { color: #0284c7; }

/* ── Aging tiles ── */
.fin-aging-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.6rem;
}

/* ── Finance section panel ── */
.fin-panel {
  background: #fff;
  border: 1.5px solid #a7f3d0;
  border-left: 4px solid #10b981;
  border-radius: 0.75rem;
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
}
.fin-panel--amber {
  border-color: #fde68a;
  border-left-color: #f59e0b;
}
.fin-panel--sky {
  border-color: #bae6fd;
  border-left-color: #0ea5e9;
}
.fin-panel--red {
  border-color: #fecaca;
  border-left-color: #dc2626;
}

/* ── Top stranke ranklist ── */
.fin-top-rank {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid #f1f5f9;
}
.fin-top-rank__num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #10b981;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.fin-top-rank__name {
  flex: 1;
  font-size: 0.84rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fin-top-rank__amount {
  font-weight: 750;
  font-size: 0.86rem;
  color: #16a34a;
  white-space: nowrap;
}
.fin-top-rank__cnt {
  font-size: 0.72rem;
  color: #94a3b8;
}

/* ══════════════════════════════════════════════════════════════
   FINANCE — INCOME TILES (sec-prihodki)
   ══════════════════════════════════════════════════════════════ */

.fin-income-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.fin-income-tile {
  border-radius: 0.65rem;
  padding: 1rem;
  border: 1.5px solid transparent;
}
.fin-income-tile__label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 0.15rem;
}
.fin-income-tile__value {
  font-size: 1.55rem;
  font-weight: 800;
  margin: 0;
}
.fin-income-tile__sub {
  font-size: 0.75rem;
  color: #475569;
  margin: 0.2rem 0 0;
}
.fin-income-tile__sub small { color: #94a3b8; }
.fin-income-tile__trend {
  font-size: 0.78rem;
  font-weight: 700;
  margin: 0.1rem 0 0.1rem;
}

/* Color variants */
.fin-income-tile--blue   { background: #eff6ff; border-color: #bfdbfe; }
.fin-income-tile--blue   .fin-income-tile__label,
.fin-income-tile--blue   .fin-income-tile__value { color: #1d4ed8; }

.fin-income-tile--slate  { background: #f8fafc; border-color: #e2e8f0; }
.fin-income-tile--slate  .fin-income-tile__label,
.fin-income-tile--slate  .fin-income-tile__value { color: #334155; }
.fin-income-tile--slate  .fin-income-tile__label { color: #475569; }

.fin-income-tile--orange { background: #fff7ed; border-color: #fed7aa; }
.fin-income-tile--orange .fin-income-tile__label,
.fin-income-tile--orange .fin-income-tile__value { color: #c2410c; }

.fin-income-tile--green  { background: #f0fdf4; border-color: #bbf7d0; }
.fin-income-tile--green  .fin-income-tile__label,
.fin-income-tile--green  .fin-income-tile__value,
.fin-income-tile--green  .fin-income-tile__trend { color: #16a34a; }

.fin-income-tile--red    { background: #fff5f5; border-color: #fecaca; }
.fin-income-tile--red    .fin-income-tile__label,
.fin-income-tile--red    .fin-income-tile__value,
.fin-income-tile--red    .fin-income-tile__trend { color: #dc2626; }

.fin-income-tile--sky    { background: #f0f9ff; border-color: #bae6fd; }
.fin-income-tile--sky    .fin-income-tile__label { color: #0369a1; }
.fin-income-tile--sky    .fin-income-tile__value { color: #0284c7; }

.fin-income-tile--star   { background: #fefce8; border: 2px solid #fde047; }
.fin-income-tile--star   .fin-income-tile__label { color: #a16207; }
.fin-income-tile--star   .fin-income-tile__value { font-size: 1.65rem; font-weight: 900; color: #ca8a04; }

/* ── Period comparison strip ── */
.fin-period-strip {
  background: #f1f5f9;
  border-radius: 0.5rem;
  padding: 0.6rem 1rem;
  font-size: 0.82rem;
  color: #475569;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.5rem;
}

/* ── Revenue breakdown bar ── */
.fin-breakdown-wrap {
  margin-top: 0.85rem;
  background: #f8fafc;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
}
.fin-breakdown-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #475569;
  margin: 0 0 0.5rem;
}
.fin-breakdown-bar {
  display: flex;
  gap: 0.25rem;
  height: 18px;
  border-radius: 6px;
  overflow: hidden;
  width: 100%;
}
.fin-breakdown-legend {
  display: flex;
  flex-wrap: wrap;
  font-size: 0.72rem;
  margin-top: 0.4rem;
  gap: 0.8rem;
}
.fin-breakdown-legend__item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.fin-breakdown-legend__dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
  flex-shrink: 0;
}

/* ── Terjatve 2-column grid ── */
.fin-terjatve-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
@media (max-width: 640px) {
  .fin-terjatve-grid { grid-template-columns: 1fr; }
}

/* ── Aging tiles ── */
.fin-aging-tile {
  border-radius: 0.5rem;
  padding: 0.75rem;
  border: 1.5px solid transparent;
}
.fin-aging-tile__label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  margin: 0 0 0.15rem;
}
.fin-aging-tile__value {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0;
}
.fin-aging-tile--amber  { background: #fef3c7; border-color: #fcd34d; }
.fin-aging-tile--amber  .fin-aging-tile__label,
.fin-aging-tile--amber  .fin-aging-tile__value { color: #b45309; }
.fin-aging-tile--amber  .fin-aging-tile__label { color: #92400e; }

.fin-aging-tile--orange { background: #fed7aa; border-color: #fb923c; }
.fin-aging-tile--orange .fin-aging-tile__label { color: #c2410c; }
.fin-aging-tile--orange .fin-aging-tile__value { color: #ea580c; }

.fin-aging-tile--red    { background: #fecaca; border-color: #f87171; }
.fin-aging-tile--red    .fin-aging-tile__label { color: #b91c1c; }
.fin-aging-tile--red    .fin-aging-tile__value { color: #dc2626; }

.fin-aging-tile--darkred { background: #fee2e2; border-color: #fca5a5; }
.fin-aging-tile--darkred .fin-aging-tile__label { color: #991b1b; }
.fin-aging-tile--darkred .fin-aging-tile__value { color: #b91c1c; }

/* ── Status rows (per-status breakdown) ── */
.fin-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.84rem;
}

/* ── Inactive customer warning strip ── */
.fin-missing-cost-warn {
  margin-top: 0.6rem;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 0.5rem;
  padding: 0.55rem 0.9rem;
  font-size: 0.8rem;
  color: #92400e;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ── Quote table header (amber theme) ── */
.quote-table .table-head.quote-row {
  background: linear-gradient(90deg, #fef3c7 0%, #fde68a 100%);
  border-bottom: 2px solid #f59e0b;
  color: #78350f;
  font-weight: 700;
  letter-spacing: 0.03em;
  font-size: 0.78rem;
  text-transform: uppercase;
}
.table-row.quote-row {
  border-left: 4px solid transparent;
  transition: border-color 0.15s, background 0.15s;
}
.table-row.quote-row:hover {
  border-left-color: #f59e0b;
  background: #fffbeb;
}

/* ── Invoice detail notes ── */
.inv-notes {
  margin-top: 1rem;
  padding: 0.75rem;
  background: #f8faff;
  border-radius: 0.6rem;
  border: 1.5px solid var(--color-border);
  font-size: 0.88rem;
  color: var(--color-muted);
}

/* ── Generic tables across the app ── */
table th,
table td {
  border-bottom: 1px solid var(--color-border);
}
table thead th {
  border-bottom: 2px solid var(--color-border-strong);
}

/* ── wo-stat cards ── */
.wo-stat {
  border-width: 2px;
}

/* ── input-sm ── */
.input-sm {
  border: 1.5px solid #96aec8;
}

/* ═══════════════════════════════════════════════════════════════
   DASHBOARD PANEL EMPHASIS
   ═══════════════════════════════════════════════════════════════ */

/* ── Dashboard sections get distinct accent colors on top ── */
#kpi-panel {
  border-top: 4px solid var(--color-primary);
}

#work-panel {
  border-top: 4px solid #8b5cf6;
}

#insights-panel {
  border-top: 4px solid #f59e0b;
}

#inventory-panel {
  border-top: 4px solid #16a34a;
}

/* ── Dashboard grid: tighter gap ── */
.dashboard-grid {
  gap: 1.25rem;
  margin-top: 1.25rem;
}

/* ── KPI panel spacing ── */
#kpi-panel {
  margin-bottom: 0;
}

/* ── KPI cards in dashboard: more prominent ── */
.kpi-card {
  transition: box-shadow var(--transition-fast), transform var(--transition-fast), border-color var(--transition-fast);
}

.kpi-card:hover {
  border-color: var(--color-primary);
}

/* ═══════════════════════════════════════════════════════════════
   TEXT VISIBILITY — temnejše besedilo na svetlih ozadjih
   ═══════════════════════════════════════════════════════════════ */

/* ── Placeholder text: bolj viden ── */
input::placeholder,
textarea::placeholder,
select::placeholder {
  color: #7a8fa8;
  opacity: 1;
}

/* ── kbd elementi na belem ── */
kbd {
  background: #e8edf5;
  border: 1px solid #a8bcd4;
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  font-size: 0.72rem;
  color: #1e3a5f;
  font-weight: 700;
  font-family: monospace;
}

/* ── shortcuts overlay ── */
.shortcuts-overlay {
  background: #fff;
  border: 1.5px solid #a8bcd4;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}
.shortcuts-group-label,
.shortcuts-title {
  color: #1e293b;
}
.shortcuts-group-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #536179;
  margin-bottom: 0.5rem;
}
.shortcut-row {
  color: #1e293b;
  font-size: 0.85rem;
}
.shortcut-row span {
  color: #1e293b;
}

/* ── Spodnja mobilna navigacija (.mob-bottom-nav v base.html) ── */
@media (max-width: 768px) {
  .mob-bottom-nav {
    background: linear-gradient(180deg, #0e1a2e 0%, #0a1220 100%) !important;
    border-top: 2px solid rgba(255,255,255,0.12) !important;
    box-shadow: 0 -3px 20px rgba(0,0,0,0.4) !important;
  }
  .mob-nav-item {
    color: #b8c8de !important;
    font-weight: 600 !important;
    font-size: 0.65rem !important;
  }
  .mob-nav-item--on {
    color: #60a5fa !important;
  }
  .mob-nav-label {
    color: inherit;
  }
}

/* ── Spodnja mobilna navigacija (.mobile-bottom-nav v sidebar.html) ── */
@media (max-width: 960px) {
  .mobile-bottom-nav {
    background: #fff !important;
    border-top: 2px solid #a8bcd4 !important;
    box-shadow: 0 -3px 16px rgba(15,23,42,0.14) !important;
  }
  .mbn-link {
    color: #3a4a5c !important;
  }
  .mbn-link.active {
    color: var(--color-primary) !important;
  }
  .mbn-link::before {
    height: 3px !important;
  }
}

/* ── User menu dropdown na belem ── */
.user-menu-username {
  color: #3a4a5c;
  font-weight: 700;
}

/* ── Eyebrow (section labels on white panels) ── */
.panel .eyebrow,
.wo-list-header .eyebrow {
  color: #1f64ff;
  font-weight: 700;
}

/* ── Muted text: darker on light backgrounds ── */
.panel .muted,
.wo-list-panel .muted {
  color: #536179;
}

/* ── Form hint text ── */
.form-hint,
.wo-new-order-internal-hint {
  color: #536179;
}

/* ── Ghost badge: visible ── */
.badge.ghost {
  color: #3a4a5c;
  border-color: #8099b8;
}

/* ── Table head: visible on white/light bg ── */
.table-row.table-head {
  color: #1e3a8a;
}

/* ── calendar weekend label: darker ── */
.cal-col-head--weekend {
  color: #536179;
}

/* ── Micro heading on white bg ── */
.micro-heading {
  color: #3a4a5c;
}

/* ── Global search input placeholder (dark bg — keep light) ── */
.global-quick-search-input::placeholder {
  color: rgba(203, 213, 225, 0.7);
}

/* ── AI/other sec labels on white ── */
.ai-apply-label,
.ai-form-card-hint {
  color: #3a4a5c;
}

/* ── Topbar search btn na subnav-right (dark bg — fine) ── */
/* Already handled by subnav-right overrides above */

/* ═══════════════════════════════════════════════════════════════
   ADDITIONAL BORDER STRENGTH — wo-section, wo-info-card, attachments
   ═══════════════════════════════════════════════════════════════ */

.wo-section,
.wo-info-card {
  border: 2px solid var(--color-border) !important;
}

.wo-section {
  border-top: 3px solid var(--color-border-strong) !important;
}

.attachments-grid li {
  border: 2px solid var(--color-border);
}

.list-cards li {
  border: 2px solid var(--color-border);
}

.timeline-card {
  border: 2px solid var(--color-border);
}

/* ── Page-header action bar bottom line ── */
.page-header {
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

/* ── topbar: slightly thicker ── */
.app-topbar {
  border-bottom: 2px solid var(--color-border-strong);
}

/* ── Input fields on work order — ensure clean font rendering ── */
.wo-page .input-field,
.wo-page select.input-field,
.wo-page textarea.input-field {
  font-family: var(--font-sans) !important;
  font-optical-sizing: auto;
  font-synthesis: none;
  -webkit-font-smoothing: subpixel-antialiased;
}

/* ═══════════════════════════════════════════════════════════════
   WO UX IMPROVEMENTS — vizualna hierarhija + sticky save + termin
   ═══════════════════════════════════════════════════════════════ */

/* ── A: Sekcija barvni levi akcenti + obarvana ozadja po tipu ── */
.wo-page .wo-entity-details {
  border-top-color: var(--color-primary) !important;
  background: linear-gradient(160deg, #c7d9fd 0%, #dce9ff 50%, #eef4ff 100%) !important;
}
.wo-page .wo-order-meta-compact {
  border-top-color: #7c3aed !important;
  background: linear-gradient(160deg, #ddd6fe 0%, #ede9fe 50%, #f5f3ff 100%) !important;
}
.wo-page .wo-work-desc-section {
  border-top-color: #059669 !important;
  background: linear-gradient(160deg, #a7f3d0 0%, #d1fae5 50%, #ecfdf5 100%) !important;
}
.wo-page .wo-section--materials {
  border-top-color: #d97706 !important;
  background: linear-gradient(160deg, #fde68a 0%, #fef3c7 50%, #fffbeb 100%) !important;
}
.wo-page .wo-reading-section {
  border-top-color: #475569 !important;
  background: linear-gradient(160deg, #cbd5e1 0%, #dde4ed 50%, #f1f5f9 100%) !important;
}

/* ── A: Input polja — obarvana ozadja po sekciji ── */
.wo-page .wo-entity-details .input-field,
.wo-page .wo-entity-details select.input-field {
  background: #dce9ff !important;
}
.wo-page .wo-order-meta-compact .input-field,
.wo-page .wo-order-meta-compact select.input-field {
  background: #ede9fe !important;
}
.wo-page .wo-work-desc-section .input-field,
.wo-page .wo-work-desc-section select.input-field,
.wo-page .wo-work-desc-section textarea.input-field {
  background: #d1fae5 !important;
}
.wo-page .wo-section--materials .input-field,
.wo-page .wo-section--materials select.input-field {
  background: #fef3c7 !important;
}

/* ── A: Sekcijski header — boljša tipografija ── */
.wo-page .wo-group-label.wo-group-label--dense {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #374151;
  margin-bottom: 0.7rem;
  padding-bottom: 0.45rem;
  border-bottom: 1.5px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ── A: Entity summary styling ── */
.wo-entity-summary.wo-entity-summary--compact {
  font-size: 0.78rem;
  font-weight: 700;
  color: #374151;
  padding: 0.3rem 0.1rem;
}

/* ── B: Termin block — subgroup visual divider ── */
.wo-meta-subgroup {
  display: contents;
}
.wo-meta-row-sep {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0 0.15rem;
  margin-top: 0.1rem;
  border-top: 1.5px solid var(--color-border);
}
.wo-meta-row-sep-label {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted);
  white-space: nowrap;
}
.wo-meta-row-sep::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

/* ── C: Notes banner styles ── */
.wo-notes-inline-banner {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, #fffbeb, #fef9f0);
  border: 2px solid #fbbf24;
  border-left: 4px solid #f59e0b;
  border-radius: var(--radius-md);
  box-shadow: 0 1px 4px rgba(251,191,36,0.15);
}
.wo-notes-inline-banner-row {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
}
.wo-notes-inline-banner-icon {
  font-size: 0.95rem;
  flex-shrink: 0;
  margin-top: 0.05rem;
}
.wo-notes-inline-banner-body {
  flex: 1;
  min-width: 0;
}
.wo-notes-inline-banner-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #92400e;
  display: block;
  margin-bottom: 0.2rem;
}
.wo-notes-inline-banner-text {
  font-size: 0.82rem;
  color: #451a03;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}
.wo-notes-inline-banner-hint {
  font-size: 0.7rem;
  color: #78350f;
  margin-top: 0.35rem;
}
.wo-notes-inline-banner-sep {
  height: 1.5px;
  background: rgba(251,191,36,0.4);
}

/* ── D: Mini RVC strip na desktopih ── */
.wo-rvc-mini-strip {
  display: none;
}
@media (min-width: 961px) {
  .wo-rvc-mini-strip {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 0.4rem 1rem;
    background: linear-gradient(135deg, #f0f6ff, #f8fafd);
    border: 1.5px solid var(--color-border);
    border-top: 3px solid var(--color-primary);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow-sm);
  }
  .wo-rvc-mini-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
  }
  .wo-rvc-mini-label {
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--color-muted);
  }
  .wo-rvc-mini-val {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
  }
  .wo-rvc-mini-val--rvc { color: #16a34a; }
  .wo-rvc-mini-val--margin { color: #2563eb; }
  .wo-rvc-mini-sep {
    width: 1px;
    height: 2rem;
    background: var(--color-border);
    flex-shrink: 0;
  }
  .wo-rvc-mini-hint {
    font-size: 0.65rem;
    color: var(--color-muted);
    margin-left: auto;
    font-style: italic;
  }
}

/* ── Expand chips — barvanje ko ima vsebino ── */
.wo-desc-expand--filled > summary {
  font-weight: 700;
}
.wo-desc-expand--filled-rec > summary {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  color: #065f46;
  border-color: #6ee7b7;
}
.wo-desc-expand--filled-int > summary {
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
  color: #9a3412;
  border-color: #fdba74;
}
.wo-desc-expand--filled-memo > summary {
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
  color: #0369a1;
  border-color: #7dd3fc;
}

/* ── Filled chips — open state keeps color ── */
.wo-desc-expand--filled-rec[open] { background: linear-gradient(135deg, #ecfdf5, #d1fae5); border-color: #6ee7b7; }
.wo-desc-expand--filled-int[open] { background: linear-gradient(135deg, #fff7ed, #ffedd5); border-color: #fdba74; }
.wo-desc-expand--filled-memo[open] { background: linear-gradient(135deg, #f0f9ff, #e0f2fe); border-color: #7dd3fc; }

/* QR pravila — desno poravnano z margin-left: auto */
.wo-desc-expand--qr {
  margin-left: auto;
}
.wo-desc-expand--qr > summary {
  background: #f8fafc;
  color: #475569;
  border-color: #cbd5e1;
}

/* Načrt intervalov — chip takoj za QR pravilami */
.wo-desc-expand--nacrt {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  background: #f0fdfa;
  color: #0f766e;
  border: 1px solid #5eead4;
  transition: background 0.15s, border-color 0.15s;
  flex: 0 0 auto;
}
.wo-desc-expand--nacrt:hover {
  background: #ccfbf1;
  border-color: #14b8a6;
}

/* ── wo-calc inline (po materialih) ── */
.wo-calc--inline {
  border-radius: var(--radius-lg);
  margin-bottom: 0;
}
.wo-calc--inline .wo-calc-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
@media (max-width: 900px) {
  .wo-calc--inline .wo-calc-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 480px) {
  .wo-calc--inline .wo-calc-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ── Stanje in servis — kot sekcija (zunaj materialov) ── */
.wo-reading-section:not(.wo-reading-below-mat) {
  border-radius: var(--radius-lg);
}
.wo-page .wo-reading-section {
  border-top-color: #475569 !important;
}

/* ── E: Akcijska vrstica ostane v glavi (ni sticky na dnu) ── */

/* ═══════════════════════════════════════════════════════════════
   MATERIALS + CALC + READING — vizualne izboljšave
   ═══════════════════════════════════════════════════════════════ */

/* ── 1. Materiali in izračun brez raze med njima ── */
.wo-section--materials {
  border-bottom-left-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
  border-bottom-color: transparent !important;
  margin-bottom: 0 !important;
}
.wo-calc--inline {
  border-top-left-radius: 0 !important;
  border-top-right-radius: 0 !important;
  border-top: none !important;
  margin-bottom: 0.6rem;
}

/* ── Gumb dodaj — spodaj levo pod karticami ── */
.mat-cards-add-bottom {
  padding: 0.35rem 0.65rem 0.5rem;
}
.mat-add-bottom-btn {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(31,100,255,0.25);
}
.mat-add-bottom-btn:hover {
  box-shadow: 0 4px 14px rgba(31,100,255,0.38);
  transform: scale(1.08);
}

/* ── 2. Mat-card — čistejši design z močnejšimi orobami ── */
.mat-card {
  background: linear-gradient(135deg, #fff8e1 0%, #fffdf5 60%);
  border: 1.5px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  border-radius: 0.65rem;
  box-shadow: 0 1px 4px rgba(15,23,42,0.06);
  padding: 0.7rem 0.9rem;
  gap: 0.35rem;
}
.mat-card:hover,
.mat-card:focus {
  border-color: var(--color-primary);
  border-left-color: var(--color-primary);
  background: #f4f8ff;
  box-shadow: 0 2px 10px rgba(31,100,255,0.10);
}
.mat-card-desc {
  font-size: clamp(0.88rem, 0.5vw + 0.8rem, 1.02rem);
  font-weight: 700;
  color: var(--color-text);
}
.mat-card-total {
  font-size: clamp(0.9rem, 0.5vw + 0.82rem, 1.06rem);
  font-weight: 800;
  color: #1e40af;
}
.mat-card-row2 {
  border-top: 1.5px solid var(--color-border);
  padding-top: 0.3rem;
  margin-top: 0.1rem;
}
.mat-card-meta {
  font-size: 0.78rem;
  color: #475569;
  font-weight: 500;
}
.mat-card-rvc {
  font-weight: 700;
  color: #059669;
}
.mat-card-date {
  font-size: 0.72rem;
  color: #64748b;
}
#mat-cards-list {
  gap: 0.5rem;
  padding: 0.5rem clamp(0.65rem, 2vw, 1.1rem) 0.7rem;
}

/* ── 3. Izračun (dobiček) — pritrjen pod seznam ── */
.wo-calc--inline {
  padding: 0.75rem 1rem;
  border: 2px solid var(--color-border);
  border-top: 2px solid #e2e8f0;
  background: #f8fafc;
}
.wo-calc--inline .wo-calc-note {
  margin: 0.35rem 0 0;
  font-size: 0.7rem;
  color: var(--color-muted);
}

/* ── 4. Stanje in naslednji servis — vidnejši napisi ── */
.wo-reading-section.wo-section {
  border-top-color: #475569 !important;
  margin-top: 0.8rem;
  padding: 0.75rem 1rem 0.9rem !important;
}
.wo-reading-section .wo-reading-tight-head {
  font-size: 0.85rem !important;
  font-weight: 800 !important;
  color: #1e293b !important;
  margin-bottom: 0.65rem !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.wo-reading-section .form-label,
.wo-reading-below-mat--tight .wo-reading-cell .form-label {
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  color: #334155 !important;
  margin-bottom: 0.18rem !important;
}
.wo-reading-section .input-field,
.wo-reading-below-mat--tight .wo-reading-cell .input-field {
  background: #dde4ed !important;
  border-color: #7a9ec0 !important;
  font-weight: 600 !important;
  color: var(--color-text) !important;
  font-size: 0.85rem !important;
  padding: 0.22rem 0.5rem !important;
  min-height: 34px !important;
}
.wo-reading-section .wo-km-interval-input {
  font-size: 0.72rem !important;
  min-height: 28px !important;
  width: 6.5rem !important;
  min-width: 5.25rem !important;
  max-width: 8.5rem !important;
  box-sizing: border-box !important;
}
.wo-reading-section .wo-h-interval-input {
  width: 6.75rem !important;
  min-width: 5.25rem !important;
  max-width: 8.5rem !important;
  box-sizing: border-box !important;
}
.wo-reading-section .wo-next-svc-date-6mo {
  font-size: 0.88rem !important;
  font-weight: 800 !important;
  padding: 0.22rem 0.6rem !important;
  min-height: 36px !important;
}
.wo-reading-section .wo-reading-quick .btn-ghost.btn-sm {
  font-size: 0.68rem !important;
  min-height: 28px !important;
  padding: 0.1rem 0.35rem !important;
}
.wo-reading-summary--strip {
  font-size: 0.75rem !important;
  color: #334155 !important;
  font-weight: 600 !important;
  gap: 0.5rem 0.8rem !important;
  background: rgba(71,85,105,0.08);
  border-radius: 0.4rem;
  padding: 0.35rem 0.7rem !important;
  margin-top: 0.6rem !important;
}
.wo-reading-summary--strip strong {
  color: #0f172a;
}
/* +km gumbi vidnejši */
.wo-km-next-offset {
  font-size: 0.75rem;
  font-weight: 700;
  color: #1d4ed8;
  border-color: #93c5fd;
  background: #eff6ff;
}
.wo-km-quick-hint {
  font-weight: 700 !important;
  color: #475569 !important;
  font-size: 0.75rem !important;
}

/* ── 5. Mobilni izračun — neto velik, ostalo drobno ── */
@media (max-width: 640px) {
  .wo-calc--inline .wo-calc-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.3rem;
  }
  /* Skupni znesek — premakni na vrh, cela vrstica, velik */
  .wo-calc--inline .wo-calc-tile--gross {
    order: -1;
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.9rem;
  }
  .wo-calc--inline .wo-calc-tile--gross .wo-calc-tile-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }
  .wo-calc--inline .wo-calc-tile--gross .wo-calc-tile-val {
    font-size: 1.45rem;
    font-weight: 900;
  }
  /* Ostale ploščice — drobne */
  .wo-calc--inline .wo-calc-tile:not(.wo-calc-tile--gross) {
    padding: 0.28rem 0.32rem;
  }
  .wo-calc--inline .wo-calc-tile:not(.wo-calc-tile--gross) .wo-calc-tile-label {
    font-size: 0.5rem;
    letter-spacing: 0.03em;
  }
  .wo-calc--inline .wo-calc-tile:not(.wo-calc-tile--gross) .wo-calc-tile-val {
    font-size: 0.72rem;
    font-weight: 700;
  }
  /* Mat-card — kompakten na mobilni */
  .mat-card {
    padding: 0.55rem 0.7rem;
    gap: 0.28rem;
  }
  .mat-card-row2 {
    padding-top: 0.25rem;
  }
  /* Reading section — večji vnosni tap target ostane */
  .wo-reading-section .form-label {
    font-size: 0.75rem !important;
  }
}

/* Gumb v stanju nalaganja (AI klici) */
button.is-loading,
.btn-primary.is-loading,
.btn-secondary.is-loading,
.btn-ghost.is-loading {
  position: relative;
  opacity: 0.7;
  cursor: progress;
  pointer-events: none;
}
button.is-loading::after {
  content: "";
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  margin-left: 0.45em;
  vertical-align: -0.1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: mehanik-spin 0.7s linear infinite;
}
@keyframes mehanik-spin {
  to { transform: rotate(360deg); }
}

/* AI lektoriranje opisnih polj */
.wo-desc-field-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 0.6rem;
  margin-bottom: 0.25rem;
}
.wo-desc-field-head .form-label {
  margin-bottom: 0;
}
.wo-ai-polish {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
}
.wo-ai-polish-btn,
.wo-ai-polish-undo {
  font-size: 0.72rem !important;
  padding: 0.18rem 0.5rem !important;
  line-height: 1.2;
  white-space: nowrap;
}
.wo-ai-polish-status {
  font-size: 0.72rem;
  max-width: 14rem;
}
.wo-ai-polish-status--error {
  color: #b91c1c;
}
textarea.wo-ai-polish-flash {
  outline: 2px solid #99f6e4;
  outline-offset: 1px;
  transition: outline-color 0.8s ease;
}

/* ══════════════════════════════════════════════════════
   Sticky mobilna akcijska vrstica na delovnem nalogu
   ══════════════════════════════════════════════════════ */
.wo-sticky-actions {
  display: none;
}
@media (max-width: 960px) {
  .wo-sticky-actions {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(62px + env(safe-area-inset-bottom, 0px));
    z-index: 35;
    gap: 0.35rem;
    padding: 0.4rem 0.55rem;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(6px);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -4px 18px rgba(15, 23, 42, 0.12);
  }
  .wo-sticky-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    min-height: 46px;
    padding: 0.3rem 0.2rem;
    border: 1px solid var(--color-border);
    border-radius: 0.6rem;
    background: #f8fafc;
    color: #1e293b;
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .wo-sticky-btn:active {
    background: #eef2f7;
  }
  .wo-sticky-ico {
    font-size: 1.15rem;
    line-height: 1;
  }
  .wo-sticky-btn[data-active="1"] {
    background: #dcfce7;
    border-color: #16a34a;
    color: #166534;
  }
  .wo-sticky-btn--loading {
    opacity: 0.6;
  }
  /* Prostor, da sticky vrstica ne prekrije zadnje vsebine (samo strani s sticky vrstico) */
  .wo-page:has(.wo-sticky-actions) {
    padding-bottom: 120px;
  }
}

/* ── AI sken: označena polja in ujemanja ─────────────────────────── */
.input-field.ai-filled {
  border-left: 3px solid #16a34a;
  background-image: linear-gradient(90deg, rgba(22, 163, 74, 0.07), transparent 2.5rem);
}
.input-field.ai-uncertain {
  border-left: 3px solid #f59e0b;
  background-image: linear-gradient(90deg, rgba(245, 158, 11, 0.12), transparent 2.5rem);
}
.ai-scan-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  font-size: 0.75rem;
  color: var(--color-muted, #64748b);
  margin: 0.5rem 0 0;
}
.ai-scan-legend span::before {
  content: "";
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 2px;
  margin-right: 0.35rem;
  vertical-align: middle;
}
.ai-scan-legend .lg-filled::before {
  background: #16a34a;
}
.ai-scan-legend .lg-uncertain::before {
  background: #f59e0b;
}
.ai-thumb-zoom {
  cursor: zoom-in;
}
.ai-vehicle-hit {
  margin-top: 0.75rem;
  padding: 0.75rem 0.85rem;
  background: #fff7ed;
  border: 1.5px solid #fdba74;
  border-radius: 0.6rem;
}
.ai-vehicle-hit__title {
  margin: 0 0 0.45rem;
  font-size: 0.85rem;
  font-weight: 800;
  color: #9a3412;
}
.ai-vehicle-hit__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding: 0.4rem 0;
  border-top: 1px solid #fed7aa;
  font-size: 0.84rem;
}
