:root {
  --green: #43d12d;
  --green2: #a4f28e;
  --dark: #111a1a;
  --dark2: #1b2928;
  --ink: #172322;
  --muted: #62716d;
  --light: #f5f8f5;
  --line: #e2eae4;
  --btn-ink: #10220e;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "DM Sans", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% -10%, rgba(67, 209, 45, 0.16), transparent 36%),
    linear-gradient(180deg, #f5f8f5 0%, #ffffff 42%, #f3f7f3 100%);
}
h1, h2, h3 {
  font-family: Manrope, system-ui, sans-serif;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 0.4rem;
}
a { color: inherit; text-decoration: none; }
a.link { color: #1d6b1a; text-decoration: underline; font-weight: 700; }
.shell { max-width: 1200px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
.entry-form .grid > div { min-width: 0; }
.topbar {
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: center;
  justify-content: space-between; margin-bottom: 1.75rem;
}
.brand { font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; }
.brand span { color: var(--green); }
.nav { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.nav a {
  font-size: 0.9rem; font-weight: 800; padding: 0.55rem 0.85rem;
  border-radius: 0.65rem; border: 1px solid transparent;
}
.nav a:hover, .nav a.active { background: #eaf9e8; border-color: var(--line); }
.eyebrow {
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--green); margin-bottom: 0.35rem;
}
.muted { color: var(--muted); }
.panel {
  background: #fff; border: 1px solid var(--line); border-radius: 1rem;
  padding: 1.25rem; box-shadow: 0 10px 35px #1b3d2510; margin-bottom: 1.25rem;
}
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 800px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
label { display: block; font-size: 0.9rem; font-weight: 700; margin-bottom: 0.35rem; }
input, select, textarea, button { font: inherit; }
input, select, textarea {
  width: 100%; border: 1px solid #d2ddd5; border-radius: 0.65rem;
  padding: 0.75rem 0.9rem; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--green); border-color: transparent;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 0.65rem; padding: 0.75rem 1rem;
  font-weight: 800; cursor: pointer; background: var(--green); color: var(--btn-ink);
}
.btn:hover { background: #7fe66e; }
.btn-dark { background: var(--dark); color: #fff; }
.btn-dark:hover { background: var(--dark2); }
.btn-ghost { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--light); }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: 1rem;
  padding: 1rem 1.1rem; box-shadow: 0 10px 35px #1b3d2510;
}
.stat .k { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.stat .v { margin-top: 0.35rem; font-family: Manrope, system-ui, sans-serif; font-size: 1.7rem; font-weight: 800; }
.flash-ok { background: #dff7dd; color: #1d6b1a; border-radius: 0.65rem; padding: 0.7rem 0.9rem; font-weight: 700; margin-bottom: 1rem; }
.flash-err { background: #ffe8e5; color: #8a2f24; border-radius: 0.65rem; padding: 0.7rem 0.9rem; font-weight: 700; margin-bottom: 1rem; }
table { width: 100%; border-collapse: collapse; min-width: 1100px; }
tfoot td { border-top: 2px solid #cfe8cb; padding: 0.9rem; }
th {
  text-align: left; background: #eaf9e8; font-size: 0.72rem; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 0.75rem 0.9rem;
}
td { padding: 0.75rem 0.9rem; border-top: 1px solid var(--line); vertical-align: top; font-size: 0.92rem; }
.badge { display: inline-block; background: #eaf9e8; color: #1d6b1a; border-radius: 0.4rem; padding: 0.2rem 0.45rem; font-size: 0.75rem; font-weight: 800; }
.table-wrap { overflow-x: auto; }
.login-wrap { max-width: 420px; margin: 4rem auto; }
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.pl-pos { color: #1d6b1a; }
.pl-neg { color: #8a2f24; }
tr.pl-pos td { background: #eaf9e8; }
tr.pl-neg td { background: #ffe8e5; }
.month-picks {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
}
.month-pick {
  display: inline-flex; align-items: center; gap: 0.35rem;
  margin: 0; padding: 0.4rem 0.55rem; border: 1px solid var(--line);
  border-radius: 0.55rem; background: #fff; font-weight: 700; font-size: 0.82rem;
  cursor: pointer; user-select: none;
}
.month-pick input { width: auto; margin: 0; accent-color: var(--green); }
.month-pick:has(input:checked) {
  background: #eaf9e8; border-color: #b7e5b0;
}
.page-rekap { display: flex; flex-direction: column; gap: 0.55rem; }
.rekap-head {
  display: flex; align-items: end; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap;
}
.page-rekap h1 { font-size: 1.35rem; margin: 0.1rem 0 0; }
.rekap-totals {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.4rem;
}
.rekap-totals > div {
  background: #fff; border: 1px solid var(--line); border-radius: 0.55rem;
  padding: 0.4rem 0.55rem; min-width: 0;
}
.rekap-totals span {
  display: block; font-size: 0.62rem; font-weight: 800; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rekap-totals strong {
  display: block; margin-top: 0.15rem; font-family: Manrope, system-ui, sans-serif;
  font-size: 0.95rem; font-weight: 800; white-space: nowrap;
}
.rekap-panel { padding: 0.35rem 0.45rem; margin: 0; border-radius: 0.7rem; overflow: auto; }
.rekap-table { min-width: 0 !important; width: 100%; }
.rekap-table th, .rekap-table td {
  padding: 0.22rem 0.35rem; font-size: 0.72rem; vertical-align: middle; line-height: 1.2;
}
.rekap-table th { padding-top: 0.35rem; padding-bottom: 0.35rem; }
.rekap-table .rekap-name {
  max-width: 11rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rekap-table tbody tr:hover { background: #f3faf2; }
.rekap-table tfoot td { background: #eaf9e8; font-weight: 800; border-top: 2px solid #cfe8cb; }
@media (max-width: 1100px) {
  .rekap-totals { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .rekap-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.report-sheet {
  background: #fff;
}
.report-sheet .eyebrow {
  margin-bottom: 0.25rem;
}
.page-jump {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 9999;
  display: flex !important;
  flex-direction: row;
  gap: 0.45rem;
}
body:has(.page-rekap) .page-jump {
  display: none !important;
}
.page-jump-btn {
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: #111a1a;
  color: #fff;
  font-size: 0.95rem;
  line-height: 1;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 28px #1b3d2530;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.page-jump-btn:hover { background: #1b2928; color: #fff; }
/* PDF predložak — skriven na ekranu, koristi se samo za Spremi PDF */
.pdf-source {
  position: absolute !important;
  left: -10000px !important;
  top: 0 !important;
  width: 774px !important;
  pointer-events: none;
}

@media print {
  body { background: #fff; }
  .no-print { display: none !important; }
  .panel { box-shadow: none; border: none; padding: 0; }
  .shell { max-width: none; padding: 0.5rem; }
  table { min-width: 0 !important; width: 100% !important; font-size: 0.78rem; table-layout: fixed; }
  .table-wrap { overflow: visible !important; }
  .nav, .topbar { display: none !important; }
  .grid { display: block !important; }
  .grid > .stat {
    display: inline-block;
    width: 48%;
    vertical-align: top;
    margin: 0 1% 0.5rem 0;
    box-shadow: none !important;
  }
  .rekap-table th, .rekap-table td { padding: 0.15rem 0.25rem; font-size: 0.65rem; }
  .rekap-totals strong { font-size: 0.8rem; }
  .report-sheet { border: none; box-shadow: none; }
  .report-sheet .stat > div[style*="display:flex"] {
    display: block !important;
  }
  .report-sheet .stat > div[style*="display:flex"] > div {
    display: inline-block;
    width: 32%;
    vertical-align: top;
    margin-bottom: 0.4rem;
  }
}
