/* SumiNord · quiet navy / warm ivory. Local system fonts, no remote assets. */
:root {
  --navy: #152d3b;
  --ink: #203846;
  --blue: #24566a;
  --gold: #b49457;
  --bg: #f6f7f5;
  --line: #e2e7e4;
  --border: #e2e7e4;
  --muted: #617278;
  --radius: 18px;
  color-scheme: light;
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter,
    "Segoe UI",
    system-ui,
    -apple-system,
    sans-serif;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3 {
  font-weight: 500;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
h1 {
  font-size: clamp(27px, 2.6vw, 38px);
}
h2 {
  font-size: 21px;
}
h3 {
  font-size: 17px;
}
b,
strong {
  font-weight: 550;
}
p {
  overflow-wrap: break-word;
}
button,
input,
select,
textarea {
  font-family: inherit;
}
label,
.field label {
  font-weight: 450;
  color: #50656e;
}
summary {
  font-weight: 500;
}
.app {
  grid-template-columns: 238px minmax(0, 1fr);
}
.sidebar {
  background: #152d3b;
  border-right: 0;
  padding: 32px 17px;
}
.brand {
  font-weight: 500;
  letter-spacing: -1px;
  font-size: 29px;
}
.brand::after {
  width: 27px;
  height: 2px;
  background: var(--gold);
  margin-top: 12px;
}
.subbrand {
  color: #acbcc2;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.06em;
  padding-top: 7px;
  padding-bottom: 33px;
}
.nav {
  gap: 5px;
}
.nav button,
.nav-link {
  font-size: 14px;
  font-weight: 400;
  min-height: 44px;
  border-radius: 9px;
  color: #bac9cf;
  padding: 11px 14px;
}
.nav button.active {
  background: #284450;
  border-left: 0;
  box-shadow: inset 2px 0 var(--gold);
  color: #fff;
  padding-left: 14px;
}
.nav button:hover,
.nav-link:hover {
  background: #223e4b;
  box-shadow: none;
}
.side-note {
  color: #aebfc6;
  font-weight: 400;
  font-size: 11px;
}
.main {
  padding: 38px clamp(22px, 3.3vw, 52px);
  max-width: 1580px;
}
.top {
  padding-bottom: 23px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.top h1 {
  font-weight: 500;
  font-size: clamp(28px, 2.8vw, 39px);
  margin-bottom: 7px;
}
.top p {
  font-size: 14px;
  color: var(--muted);
}
.tag {
  font-size: 10px;
  letter-spacing: 0.1em;
  font-weight: 500;
  background: #f1ede2;
  color: #756342;
  border: 1px solid #e3d8c0;
  padding: 7px 12px;
  border-radius: 6px;
  white-space: nowrap;
}
.stats,
.cards {
  gap: 18px;
  margin-bottom: 26px;
}
.stat,
.card,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px #172f3a03;
  background: #fff;
}
.stat,
.cards > .card {
  border-top: 1px solid var(--line);
  position: relative;
  padding: 25px;
}
.stat::after,
.cards > .card::after {
  content: "";
  position: absolute;
  left: 25px;
  bottom: 0;
  width: 28px;
  height: 2px;
  background: var(--gold);
}
.stat span,
.card > span {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}
.stat strong,
.cards .card strong {
  font-size: 34px;
  font-weight: 450;
  letter-spacing: -1.2px;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
}
.panel {
  padding: 27px;
  margin-bottom: 24px;
}
.panel h2 {
  font-weight: 500;
  font-size: 20px;
}
.panel-head,
.panel-heading {
  margin-bottom: 23px;
}
.actions {
  gap: 9px;
}
.btn,
.button,
button.primary,
.camera,
.gallery {
  border-radius: 9px;
  font-weight: 500;
  font-size: 14px;
  min-height: 44px;
  padding: 10px 16px;
  box-shadow: none;
}
.btn,
.button {
  border-color: #d9e1df;
  background: #fff;
  color: var(--ink);
}
.btn:hover,
.button:hover {
  background: #f3f6f4;
  border-color: #b3c3c2;
}
.btn.primary,
.button.primary,
button.primary {
  background: #24566a;
  border-color: #24566a;
  color: #fff;
}
.btn.primary:hover,
.button.primary:hover,
button.primary:hover {
  background: #1b4657;
  border-color: #1b4657;
}
.btn.danger,
.button.danger {
  color: #a43c35;
}
.btn:disabled,
.button:disabled {
  opacity: 0.55;
}
.field input,
.field select,
.field textarea,
input,
select,
textarea,
.search {
  border: 1px solid #d4ddda;
  border-radius: 9px;
  background: #fcfdfc;
  color: var(--ink);
  min-height: 45px;
  box-shadow: none;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  background: white;
}
.field label {
  font-size: 13px;
}
.formgrid,
.grid-form {
  gap: 21px;
}
.hint {
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted);
}
table {
  font-size: 14px;
}
th {
  font-size: 11px;
  font-weight: 500 !important;
  letter-spacing: 0.055em;
  background: #f7f9f7;
  color: #667a80;
  text-transform: uppercase;
}
th,
td {
  padding: 16px 13px;
  border-bottom: 1px solid #edf0ed;
}
td b,
td strong {
  font-weight: 500;
}
tbody tr:hover {
  background: #fafcfb;
}
.pill,
.badge {
  font-size: 12px;
  font-weight: 450;
  border-radius: 6px;
  background: #edf3f4;
  color: #365b69;
}
.pill.green,
.badge.good {
  background: #edf5ef;
  color: #326345;
}
.footer-note,
footer {
  font-size: 12px;
  font-weight: 400;
  color: #728288;
}
.empty {
  padding: 45px 20px;
  font-size: 14px;
}
.sn-recovery-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: #eef2ee;
  border-bottom: 1px solid #dfe6df;
  padding: 7px 24px;
  font-size: 12px;
  color: var(--muted);
}
.sn-recovery-bar .btn {
  min-height: 30px;
  padding: 4px 10px;
  font-size: 12px;
  background: transparent;
}
.sn-recovery-bar a {
  color: var(--blue);
}
.sn-css-1,
.sn-css-2 {
  font-weight: 450;
}
.eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.13em;
}
.tabs button {
  font-weight: 450;
}
.badge,
.definitions dt {
  font-weight: 500;
}
.toast {
  background: #173947;
  border-radius: 12px;
  font-size: 14px;
}
header {
  background: var(--navy);
  border-bottom-width: 1px;
}
header .brand {
  font-weight: 500;
}
.vehicle strong {
  font-weight: 500;
}
.vehicle {
  background: #fafcfb;
  border-color: var(--line);
  border-radius: 12px;
}
.vehicle.stop strong {
  font-weight: 500;
}
.map-panel {
  border-radius: 18px;
}
.map-panel .leaflet-control {
  box-shadow: 0 2px 10px #152d3b12;
}
.privacy {
  font-weight: 400;
}
.logo {
  font-weight: 500;
  border-bottom-width: 2px;
}
.trip-note,
.order-select,
.timeline li {
  font-weight: 450;
}
.wrap > .card {
  padding: 25px;
}
.tile {
  border-radius: 12px;
  overflow: hidden;
}
.timeline time {
  font-weight: 400;
}
.button:focus-visible,
.btn:focus-visible,
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid #9f813e;
  outline-offset: 3px;
}
/* Login uses the same restrained identity; retain proper visible labels. */
body.sn-login {
  margin: 0;
  min-height: 100svh;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at 15% 15%, #e9eeea, transparent 60%), #f6f7f5;
  padding: 24px;
}
.sn-login main {
  width: min(440px, 100%);
  padding: 42px;
  border: 1px solid #e0e6e0;
  border-radius: 22px;
  box-shadow: 0 18px 60px #203c4910;
  background: white;
}
.sn-login h1 {
  font-size: 35px;
  font-weight: 450;
  letter-spacing: -1.1px;
  margin: 0 0 10px;
}
.sn-login p {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
}
.sn-login label {
  font-size: 13px;
}
.sn-login input {
  min-height: 48px;
  padding: 12px;
  margin: 7px 0 19px;
  font-size: 16px;
}
.sn-login button {
  background: var(--blue);
  font-weight: 500;
  min-height: 48px;
  border-radius: 9px;
  margin-top: 24px;
}
.sn-login .login-caption {
  display: block;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: #8a754c;
  margin: 0 0 25px;
  text-transform: uppercase;
}
@media (max-width: 1000px) {
  .stats,
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .main {
    padding: 27px 22px;
  }
}
@media (max-width: 850px) {
  .app {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    height: auto;
    padding: 19px 18px;
    border-bottom: 1px solid #b4945760;
  }
  .brand::after {
    display: none;
  }
  .subbrand {
    padding-bottom: 17px;
  }
  .nav {
    display: flex;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 5px;
  }
  .table-wrap {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: auto;
  }
  .table-wrap::before {
    content: 'Povuci tabelu vodoravno za sve kolone →';
    display: block;
    position: sticky;
    left: 0;
    width: fit-content;
    max-width: 100%;
    padding: 0 0 12px;
    font-size: 12px;
    color: #50656e;
  }
  .table-wrap > table {
    min-width: 720px;
  }
  .nav button,
  .nav-link {
    flex: 0 0 auto;
    white-space: nowrap;
  }
  .nav button.active {
    box-shadow: inset 0 -2px var(--gold);
  }
  .main {
    padding: 24px 18px;
  }
  .formgrid,
  .grid-form {
    grid-template-columns: 1fr;
  }
  .field.full,
  .full {
    grid-column: auto;
  }
  .panel {
    padding: 21px;
  }
  .top {
    align-items: flex-start;
  }
  .side-note {
    display: none;
  }
}
@media (max-width: 550px) {
  .main {
    padding: 20px 13px;
  }
  .stats,
  .cards {
    gap: 10px;
  }
  .stat,
  .cards > .card {
    padding: 19px 16px;
  }
  .stat strong,
  .cards .card strong {
    font-size: 28px;
  }
  .panel {
    padding: 19px 15px;
    border-radius: 13px;
  }
  .top h1 {
    font-size: 29px;
  }
  .tag {
    font-size: 9px;
  }
  .sn-recovery-bar {
    padding: 8px 13px;
    gap: 8px;
  }
  .sn-login main {
    padding: 30px 24px;
  }
  .wrap > .card {
    padding: 21px 17px;
  }
  .actions .btn {
    flex-grow: 1;
  }
  .panel-head {
    gap: 15px;
    flex-wrap: wrap;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .btn,
  .button,
  .nav button,
  .nav-link {
    transition:
      background-color 0.15s,
      border-color 0.15s;
  }
  .panel {
    animation: sn-enter 0.18s ease-out;
  }
  @keyframes sn-enter {
    from {
      opacity: 0.7;
      transform: translateY(3px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}
@media print {
  body {
    background: #fff;
  }
  .sn-recovery-bar {
    display: none !important;
  }
  .panel,
  .card,
  .stat {
    box-shadow: none;
    border-radius: 0;
  }
  .stat::after,
  .cards > .card::after {
    display: none;
  }
}
header {
  color: #fff;
}
header .muted {
  color: #bdccd1;
}
.wrap > header {
  padding: 20px;
  border-radius: 16px;
  margin-bottom: 24px;
}
.wrap > header .brand {
  font-size: 20px;
  letter-spacing: -0.3px;
}
.wrap > header .brand b {
  font-weight: 500;
}
.wrap > header .badge {
  background: #2c4854;
  color: #e2eaed;
  border: 1px solid #4b646e;
}
.sn-map aside h1 {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.6px;
}
.invoice-preview .sn-css-9,
.invoice-preview .sn-css-13 {
  font-weight: 500;
}
.route-editor {
  display: grid;
  gap: 28px;
}
.route-point {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafcfb;
  margin: 12px 0;
}
.route-point-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  font-weight: 500;
}
.route-point-heading .btn {
  min-height: 34px;
  padding: 5px 12px;
  font-size: 12px;
}
.route-review {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: #78603c;
  margin-top: 15px;
}
.route-review input {
  min-height: 18px;
  width: 18px;
  flex: none;
  margin: 2px 0 0;
}
.route-editor h3 {
  font-size: 20px;
  font-weight: 500;
}
/* Stable desktop shell: only the navigation/content panes scroll, never the whole frame. */
html {
  scrollbar-gutter: stable;
}
* {
  scrollbar-width: thin;
  scrollbar-color: #a9b9bd transparent;
}
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #a9b9bd;
  border-radius: 8px;
  border: 1px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: #7c959f;
}
.sidebar {
  scrollbar-color: #5d7480 transparent;
}
.sidebar::-webkit-scrollbar-thumb {
  background: #5d7480;
}
@media (min-width: 851px) {
  body:has(> .app) {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  body > .sn-recovery-bar {
    flex: none;
  }
  body > .app {
    flex: 1;
    min-height: 0;
    min-height: 0;
    height: auto;
    overflow: hidden;
  }
  .app > .sidebar {
    position: static;
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
  }
  .app > .main {
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
    scrollbar-gutter: stable;
  }
  .sidebar {
    width: auto;
  }
  .app {
    grid-template-columns: 220px minmax(0, 1fr);
  }
}
@media (max-width: 850px) {
  html {
    scrollbar-gutter: auto;
  }
  .app > .main {
    overflow: visible;
    height: auto;
  }
  .sidebar {
    scrollbar-width: thin;
  }
  .nav {
    overscroll-behavior-x: contain;
  }
}
@media print {
  body:has(> .app) {
    display: block;
    height: auto;
    overflow: visible;
  }
  .app > .main {
    height: auto;
    overflow: visible;
  }
  .app {
    height: auto;
    overflow: visible;
    display: block;
  }
}

.integrated-map {
  display: block;
  width: 100%;
  height: calc(100dvh - 155px);
  min-height: 460px;
  border: 1px solid #dbe3ed;
  border-radius: 14px;
  background: #f3f6fa;
}
@media (max-width: 850px) {
  .integrated-map {
    height: 78dvh;
    min-height: 520px;
  }
}

.driver-integrated-map {
  display: block;
  width: 100%;
  height: 60dvh;
  min-height: 420px;
  border: 1px solid #dbe3ed;
  border-radius: 12px;
}
#driver-map-panel[hidden] {
  display: none !important;
}

/* Compact toolbar only while the application map is selected. */
.main.map-view {
  padding: 12px 18px;
  max-width: none;
}
.main.map-view .top {
  padding-bottom: 8px;
  margin-bottom: 8px;
  gap: 10px;
  align-items: center;
}
.main.map-view .top h1 {
  font-size: 22px;
  line-height: 1.25;
  margin: 0;
}
.main.map-view .top p,
.main.map-view .top .tag,
.main.map-view .footer-note {
  display: none;
}
.main.map-view > .actions {
  margin-bottom: 8px;
  gap: 6px;
}
.main.map-view > .actions .btn {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 12px;
}
.main.map-view .integrated-map {
  height: calc(100dvh - 130px);
  min-height: 320px;
  border-radius: 10px;
}
@media (max-width: 850px) {
  .main.map-view {
    padding: 10px;
  }
  .main.map-view .top {
    flex-direction: row;
  }
  .main.map-view .top h1 {
    font-size: 20px;
  }
  .main.map-view .integrated-map {
    height: 74dvh;
    min-height: 360px;
  }
}

.network-status {
  position: fixed;
  z-index: 10000;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #173947;
  color: #fff;
  padding: 14px 24px;
  border-radius: 12px;
  box-shadow: 0 8px 30px #152d3b30;
  font-size: 15px;
}
.network-status[hidden] {
  display: none;
}

/* A single order workspace; documents and invoices keep their original links. */
.workflow-summary {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.workflow-summary h2 { margin: 5px 0; overflow-wrap: anywhere; }
.workflow-summary p { margin: 4px 0 16px; color: #50656e; }
.workflow-state { display: grid; gap: 6px; align-content: start; font-size: 13px; }
.workflow-state span { padding: 5px 10px; background: #edf3f2; border-radius: 6px; }
.workflow-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.workflow-tabs [aria-pressed="true"] { background: #24566a; color: white; border-color: #24566a; }
[data-order-panel][hidden] { display: none !important; }
.workflow-queue-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.workflow-queue-row:last-child { border-bottom: 0; }
.workflow-queue-row span { display: block; font-size: 13px; color: #50656e; }
.workflow-queue-row .btn { flex-shrink: 0; }
.order-locations { margin-top: 20px; }
.order-locations li { margin-bottom: 12px; overflow-wrap: anywhere; }
.sidebar-menu > summary { display: none; }
.nav-group { width: 100%; }
.nav-group > summary { padding: 11px 13px; color: #d7e2ef; cursor: pointer; }
.nav-group > button { width: 100%; margin-top: 4px; }
@media (max-width: 550px) {
  .workflow-summary { gap: 10px; }
  .workflow-state { width: 100%; }
  .workflow-tabs .btn { flex: 1 1 130px; }
  .workflow-queue-row { align-items: flex-start; flex-direction: column; gap: 8px; }
}
@media (max-width: 850px) {
  .sidebar-menu > summary { display: block; padding: 10px 12px; border: 1px solid #5d7480; border-radius: 8px; color: #fff; cursor: pointer; }
  .sidebar-menu .nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; padding-top: 10px; }
  .sidebar-menu:not([open]) .nav { display: none; }
  .sidebar-menu .nav button, .sidebar-menu .nav-link { white-space: normal; min-width: 0; }
  .nav-group { grid-column: 1 / -1; }
  .workflow-cmr-list::before { display: none; }
  .workflow-cmr-list > table { min-width: 0; }
  .workflow-cmr-list thead { display: none; }
  .workflow-cmr-list tbody, .workflow-cmr-list tr, .workflow-cmr-list td { display: block; width: 100%; }
  .workflow-cmr-list tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .workflow-cmr-list td { border: 0; padding: 5px 0; }
  .workflow-cmr-list td .btn { margin: 4px 0; }
}
