:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  background: #f5f7fb;
}

.home-hero {
  position: relative;
  isolation: isolate;
  background: linear-gradient(118deg, #304f8a 0%, #3d63a8 52%, #498f9a 100%);
}

.home-hero::after {
  position: absolute;
  z-index: -1;
  right: -4rem;
  bottom: -10rem;
  width: 28rem;
  height: 28rem;
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: 50%;
  box-shadow: 0 0 0 2.5rem rgb(255 255 255 / 5%), 0 0 0 5rem rgb(255 255 255 / 4%);
  content: "";
}

.home-nav-link {
  border-radius: .7rem;
  padding: .6rem .8rem;
  color: #475569;
  font-size: .875rem;
  font-weight: 650;
  transition: .15s ease;
}

.home-nav-link:hover {
  background: rgb(128 195 75 / 14%);
  color: #345b2b;
}

.home-card {
  box-shadow: 0 2px 6px rgb(15 23 42 / 3%);
}

.home-card:hover {
  transform: translateY(-2px);
  border-color: rgb(61 99 168 / 35%);
  box-shadow: 0 12px 26px rgb(45 71 117 / 10%);
}

.home-icon-blue {
  background: rgb(61 99 168 / 10%);
  color: #3d63a8;
}

.home-icon-green {
  background: rgb(128 195 75 / 16%);
  color: #47752b;
}

/* Atribut hidden mora pobijediti Tailwind klase poput "grid" (npr. prozor za uređivanje dana). */
[hidden] {
  display: none !important;
}

/* Padajući izbornik profila (<details>) – bez zadane strelice preglednika. */
.profile-menu summary::-webkit-details-marker {
  display: none;
}

.profile-menu-item {
  display: block;
  width: 100%;
  border-radius: .55rem;
  padding: .55rem .7rem;
  color: #334155;
  font-size: .875rem;
  font-weight: 600;
  text-align: left;
}

.profile-menu-item:hover {
  background: #f1f5f9;
}

/* Uređivač obavijesti: okvir, alatna traka i područje za pisanje. */
.rich-editor {
  overflow: hidden;
  border: 1px solid #dbe2ed;
  border-radius: .75rem;
  background: white;
}

.rich-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  padding: .4rem;
}

.rich-toolbar button {
  border-radius: .45rem;
  padding: .3rem .55rem;
  color: #334155;
  font-size: .8rem;
  font-weight: 600;
}

.rich-toolbar button:hover {
  background: #e2e8f0;
}

.rich-content {
  min-height: 12rem;
  max-height: 32rem;
  overflow-y: auto;
  padding: .9rem 1rem;
  outline: none;
}

/* Siva uputa u praznom uređivaču. */
.rich-content:empty::before {
  color: #94a3b8;
  content: attr(data-placeholder);
}

/* Kartica obavijesti na popisu – cijela kartica je klikabilna (vidi noticeCard u app.js). */
.notice-card:hover {
  border-color: rgb(61 99 168 / 35%);
  box-shadow: 0 12px 26px rgb(45 71 117 / 10%);
}

/* Obavijest otvorena kao članak: veći tekst i razmaci radi lakšeg čitanja. */
.notice-article {
  font-size: 1rem;
  line-height: 1.75;
}

.notice-body.notice-article > * + * {
  margin-top: 1rem;
}

/* Prikaz HTML sadržaja obavijesti (naslovi, liste, slike, tablice) – isti stil u uređivaču i na popisu. */
.notice-body {
  color: #334155;
  font-size: .9rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.notice-body > * + * {
  margin-top: .6rem;
}

.notice-body h2 {
  color: #0f172a;
  font-size: 1.2rem;
  font-weight: 800;
}

.notice-body h3 {
  color: #0f172a;
  font-size: 1.02rem;
  font-weight: 700;
}

.notice-body ul {
  padding-left: 1.4rem;
  list-style: disc;
}

.notice-body ol {
  padding-left: 1.4rem;
  list-style: decimal;
}

.notice-body a {
  color: #3d63a8;
  text-decoration: underline;
}

.notice-body blockquote {
  border-left: 3px solid #80c34b;
  padding-left: .8rem;
  color: #475569;
}

.notice-body img {
  max-width: 100%;
  height: auto;
  border-radius: .6rem;
}

.notice-body table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

.notice-body th, .notice-body td {
  min-width: 5rem;
  border: 1px solid #cbd5e1;
  padding: .4rem .6rem;
  text-align: left;
  vertical-align: top;
}

.notice-body th {
  background: #f1f5f9;
  font-weight: 700;
}

button, input, select, textarea {
  font: inherit;
}

.sidebar-link {
  display: flex;
  width: 100%;
  align-items: center;
  gap: .75rem;
  border-radius: .8rem;
  padding: .72rem .85rem;
  color: #64748b;
  text-align: left;
  transition: .15s ease;
}

.sidebar-link:hover, .sidebar-link.active {
  background: #eef2ff;
  color: #4338ca;
}

/* Ima otvorenih ticketa: kategorija je crvena na svakoj stranici, i kad je odabrana. */
.sidebar-link.has-tickets, .sidebar-link.has-tickets:hover {
  background: #fef2f2;
  color: #dc2626;
  font-weight: 700;
}

.form-control {
  width: 100%;
  border: 1px solid #dbe2ed;
  border-radius: .7rem;
  background: #fff;
  padding: .7rem .85rem;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.form-control:focus {
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgb(99 102 241 / 13%);
}

.field-label {
  display: block;
  margin-bottom: .4rem;
  color: #475569;
  font-size: .82rem;
  font-weight: 650;
}

.primary-button {
  border-radius: .75rem;
  background: #3d63a8;
  padding: .72rem 1rem;
  color: white;
  font-weight: 650;
  transition: .15s ease;
}

.primary-button:hover {
  background: #304f8a;
}

.secondary-button {
  border: 1px solid #dbe2ed;
  border-radius: .7rem;
  background: white;
  padding: .62rem .85rem;
  color: #475569;
  font-weight: 600;
}

.secondary-button:hover {
  background: #f8fafc;
}

.toast {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 20;
  max-width: 24rem;
  transform: translateY(1rem);
  border-radius: .8rem;
  background: #0f172a;
  padding: .8rem 1rem;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: .2s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.error {
  background: #b91c1c;
}

.table-wrap {
  overflow-x: auto;
}

@media (max-width: 767px) {
  .sidebar {
    position: static;
    width: 100%;
  }

  .home-hero::after {
    right: -12rem;
  }
}

/* ---------- Overseas pomoćnik ---------- */

/* Obojena oznaka statusa pošiljke; boja dolazi iz .tone-* klase (vidi SHIPMENT_STATUS u app.js). */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border-radius: 999px;
  padding: .2rem .65rem;
  font-size: .75rem;
  font-weight: 700;
  white-space: nowrap;
}

.tone-slate { background: #f1f5f9; color: #475569; }
.tone-blue { background: rgb(61 99 168 / 12%); color: #2f5394; }
.tone-violet { background: #ede9fe; color: #6d28d9; }
.tone-green { background: rgb(128 195 75 / 18%); color: #3f6b25; }
.tone-amber { background: #fef3c7; color: #92400e; }
.tone-orange { background: #ffedd5; color: #9a3412; }
.tone-red { background: #fee2e2; color: #b91c1c; }

/* Dani odsutnosti u kalendaru rasporeda: cijeli dan jasno obojen prema vrsti
   (zeleno godišnji, crveno bolovanje, ljubičasto slobodno, narančasto odsutnost). */
.absence-green { border-color: #86efac !important; background: #dcfce7 !important; }
.absence-red { border-color: #fca5a5 !important; background: #fee2e2 !important; }
.absence-violet { border-color: #c4b5fd !important; background: #ede9fe !important; }
.absence-amber { border-color: #fcd34d !important; background: #fef3c7 !important; }

/* Pločice na vrhu (Na putu, Treba pažnju…) – klik mijenja prikaz. */
.overseas-tile {
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: white;
  padding: 1rem 1.1rem;
  text-align: left;
  box-shadow: 0 2px 6px rgb(15 23 42 / 3%);
  transition: .15s ease;
}

.overseas-tile:hover, .overseas-tile.is-active {
  border-color: rgb(61 99 168 / 45%);
  box-shadow: 0 10px 24px rgb(45 71 117 / 10%);
}

.overseas-tile.is-active {
  outline: 2px solid rgb(61 99 168 / 25%);
}

.overseas-tile-icon {
  display: grid;
  width: 3rem;
  height: 3rem;
  flex-shrink: 0;
  place-items: center;
  border-radius: .9rem;
  font-size: 1.3rem;
}

/* Filtar po statusu (oznaka + broj). */
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: white;
  padding: .2rem .65rem .2rem .25rem;
  font-size: .8rem;
}

.status-chip.is-active {
  border-color: #3d63a8;
  box-shadow: 0 0 0 2px rgb(61 99 168 / 18%);
}

/* Kartice prikaza iznad popisa pošiljki. */
.overseas-tab {
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  padding: .6rem .8rem;
  color: #64748b;
  font-size: .875rem;
  font-weight: 650;
}

.overseas-tab:hover {
  color: #334155;
}

.overseas-tab.is-active {
  border-color: #3d63a8;
  color: #3d63a8;
}

/* Redak pošiljke; pošiljke koje trebaju pažnju imaju crvenu crtu s lijeve strane. */
.shipment-row {
  cursor: pointer;
  border-left: 3px solid transparent;
  padding: 1rem 1.25rem;
  transition: background .15s ease;
}

.shipment-row:hover {
  background: #f8fafc;
}

.shipment-row.needs-attention {
  border-left-color: #ef4444;
}

/* Povijest pošiljke u bočnom panelu (vremenska crta). */
.shipment-timeline {
  border-left: 2px solid #e2e8f0;
  margin-left: .4rem;
}

.shipment-timeline li {
  position: relative;
  padding: 0 0 1rem 1.1rem;
}

.shipment-timeline li::before {
  position: absolute;
  top: .45rem;
  left: -.4rem;
  width: .7rem;
  height: .7rem;
  border: 2px solid white;
  border-radius: 50%;
  background: #3d63a8;
  content: "";
}

/* Tablice u A4 listi narudžbi (kraj smjene). */
.report-table th {
  border-bottom: 1px solid #94a3b8;
  padding: .45rem .5rem;
  color: #334155;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.report-table td {
  border-bottom: 1px solid #e2e8f0;
  padding: .45rem .5rem;
  font-size: .85rem;
  vertical-align: top;
}

/* Ispis: A4 papir; na stranici kraja smjene ispisuje se samo lista narudžbi (.print-area). */
@page {
  size: A4;
  margin: 12mm;
}

@media print {
  body {
    background: white;
  }

  .no-print, header {
    display: none !important;
  }

  .print-area {
    /* Duga lista smije se prelomiti na više A4 stranica. */
    break-inside: auto !important;
    border: none !important;
    padding: 0 !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .print-area .table-wrap {
    overflow: visible !important;
  }

  .print-area table {
    min-width: 0 !important;
  }

  .report-summary {
    grid-template-columns: 1fr 1fr !important;
  }

  .sidebar, button, a.secondary-button {
    display: none !important;
  }

  main {
    margin: 0 !important;
    padding: 0 !important;
  }

  main > div {
    max-width: none !important;
  }

  section {
    break-inside: avoid;
    box-shadow: none !important;
  }
}

/* Kreiranje pošiljke: redak paketa – kvačica, podaci kupca i akcije (na mobitelu akcije idu ispod). */
.shipping-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: .9rem 1rem;
  padding: 1rem 1.25rem;
  transition: background .15s ease;
}

.shipping-row:hover {
  background: #f8fafc;
}
