* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #f4f5f8;
  --card: #ffffff;
  --ink: #1d2430;
  --muted: #6b7482;
  --line: #e6e9ee;
  --red: #e03131;
  --red-bg: #fff0f0;
  --amber: #e8a308;
  --amber-bg: #fff8e1;
  --green: #2f9e44;
  --green-bg: #ebfbee;
  --blue: #1971c2;
  --blue-bg: #e7f3fc;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(20,30,50,.07), 0 6px 18px rgba(20,30,50,.05);
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}
.hidden { display: none !important; }

/* ---------- PIN ---------- */
.pin-screen {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1e3a8a 0%, #1971c2 45%, #2f9e44 100%);
  z-index: 100;
}
.pin-card {
  background: #fff; border-radius: 20px; padding: 42px 46px; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.35); width: 320px;
}
.pin-logo { font-size: 34px; font-weight: 800; letter-spacing: 4px; color: #1d2430; }
.pin-sub { color: var(--muted); font-size: 13px; margin: 6px 0 22px; }
.pin-card input {
  width: 100%; font-size: 26px; text-align: center; letter-spacing: 10px;
  padding: 10px; border: 2px solid var(--line); border-radius: 10px; outline: none;
}
.pin-card input:focus { border-color: var(--blue); }
.pin-card button {
  margin-top: 14px; width: 100%; padding: 12px; font-size: 16px; font-weight: 700;
  background: var(--blue); color: #fff; border: 0; border-radius: 10px; cursor: pointer;
}
.pin-card button:hover { filter: brightness(1.08); }
.pin-err { color: var(--red); font-size: 13px; margin-top: 10px; min-height: 16px; }

/* ---------- header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 26px; flex-wrap: wrap;
  background: #fff; border-bottom: 1px solid var(--line);
  padding: 14px 28px;
}
.brand { display: flex; align-items: baseline; gap: 9px; }
.brand-dot {
  width: 13px; height: 13px; border-radius: 50%; align-self: center;
  background: conic-gradient(#e03131 0 20%, #e8590c 20% 40%, #e8a308 40% 60%, #2f9e44 60% 80%, #1971c2 80% 100%);
}
.brand-name { font-size: 21px; font-weight: 800; letter-spacing: 2.5px; }
.brand-sub { font-size: 13px; color: var(--muted); }
.tabs { display: flex; gap: 6px; }
.tab {
  border: 0; background: transparent; padding: 8px 15px; font-size: 14.5px; font-weight: 600;
  color: var(--muted); border-radius: 99px; cursor: pointer;
}
.tab:hover { background: var(--bg); color: var(--ink); }
.tab.active { background: var(--ink); color: #fff; }
.fresh { margin-left: auto; font-size: 12.5px; color: var(--muted); }

main { max-width: 1200px; margin: 0 auto; padding: 26px 28px 60px; }
.foot { text-align: center; color: #9aa2ae; font-size: 12px; padding: 18px 0 30px; }

/* ---------- kartice projekata ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; }
.pcard {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease;
  display: flex; flex-direction: column;
}
.pcard:hover { transform: translateY(-3px); box-shadow: 0 4px 10px rgba(20,30,50,.1), 0 14px 30px rgba(20,30,50,.1); }
.pcard-top { padding: 16px 18px 12px; color: #fff; }
.pcard-top .row1 { display: flex; align-items: center; gap: 10px; }
.pcard-akr { font-size: 21px; font-weight: 800; letter-spacing: .5px; }
.pcard-chips { margin-left: auto; display: flex; gap: 6px; }
.chip {
  font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 99px;
  background: rgba(255,255,255,.22); color: #fff; white-space: nowrap;
}
.pcard-naziv { font-size: 12.5px; opacity: .92; margin-top: 3px; }
.pcard-body { padding: 14px 18px 16px; display: flex; flex-direction: column; gap: 11px; flex: 1; }
.pcard-meta { font-size: 13px; color: var(--muted); line-height: 1.5; }
.pcard-meta b { color: var(--ink); font-weight: 600; }
.semafor {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700;
  padding: 5px 12px; border-radius: 99px; width: fit-content;
}
.semafor .dot { width: 9px; height: 9px; border-radius: 50%; }
.semafor.crveno { background: var(--red-bg); color: var(--red); }
.semafor.crveno .dot { background: var(--red); animation: puls 1.4s infinite; }
.semafor.zuto { background: var(--amber-bg); color: #b3810a; }
.semafor.zuto .dot { background: var(--amber); }
.semafor.zeleno { background: var(--green-bg); color: var(--green); }
.semafor.zeleno .dot { background: var(--green); }
@keyframes puls { 0%,100% { opacity: 1 } 50% { opacity: .35 } }
.sem-razlog { font-size: 12.5px; color: var(--ink); line-height: 1.45; }

.tl { margin-top: 2px; }
.tl-bar { height: 8px; border-radius: 99px; background: var(--line); position: relative; overflow: hidden; }
.tl-fill { height: 100%; border-radius: 99px; }
.tl-lbl { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; }
.tl-pct { font-weight: 700; }

.pcard-next { border-top: 1px dashed var(--line); padding-top: 10px; }
.pcard-next .nx-title { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 6px; }
.nx-item { display: flex; gap: 8px; font-size: 13px; line-height: 1.4; margin-bottom: 5px; align-items: baseline; }
.nx-date { font-weight: 700; white-space: nowrap; font-size: 12px; }
.pcard-stats { display: flex; gap: 8px; margin-top: auto; padding-top: 4px; }
.stat-pill { font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: var(--bg); color: var(--muted); }
.stat-pill.hot { background: var(--red-bg); color: var(--red); }

/* ---------- detalj projekta ---------- */
.back {
  border: 0; background: #fff; box-shadow: var(--shadow); border-radius: 99px;
  padding: 8px 16px; font-size: 13.5px; font-weight: 600; cursor: pointer; color: var(--ink);
  margin-bottom: 16px;
}
.back:hover { background: var(--bg); }
.det-head { border-radius: var(--radius); padding: 22px 26px; color: #fff; box-shadow: var(--shadow); }
.det-head .row1 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.det-akr { font-size: 28px; font-weight: 800; }
.det-naziv { font-size: 14px; opacity: .95; margin-top: 2px; }
.det-meta {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px 22px;
  margin-top: 16px; font-size: 13px;
}
.det-meta .k { opacity: .78; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
.det-meta .v { font-weight: 600; margin-top: 2px; line-height: 1.4; }
.det-alert {
  margin-top: 16px; border-radius: var(--radius); padding: 14px 18px; font-size: 13.5px; line-height: 1.5;
  display: flex; gap: 10px; align-items: flex-start; box-shadow: var(--shadow);
}
.det-alert.crveno { background: var(--red-bg); color: #8f1d1d; }
.det-alert.zuto { background: var(--amber-bg); color: #7a5a05; }
.det-alert.zeleno { background: var(--green-bg); color: #205c2c; }

.sec { margin-top: 26px; }
.sec-title { font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.sec-title .cnt { font-size: 12px; font-weight: 700; background: var(--bg); border: 1px solid var(--line); border-radius: 99px; padding: 2px 9px; color: var(--muted); }

/* rok / stavka */
.item {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 13px 16px; margin-bottom: 9px; display: flex; gap: 13px; align-items: flex-start;
}
.item.done { opacity: .55; }
.item.done .it-name { text-decoration: line-through; }
.it-check {
  width: 21px; height: 21px; min-width: 21px; margin-top: 2px; cursor: pointer; accent-color: var(--green);
}
.it-main { flex: 1; }
.it-top { display: flex; gap: 9px; align-items: baseline; flex-wrap: wrap; }
.it-name { font-size: 14.5px; font-weight: 650; line-height: 1.35; }
.it-det { font-size: 12.5px; color: var(--muted); line-height: 1.5; margin-top: 3px; }
.it-note { font-size: 12.5px; margin-top: 6px; background: var(--blue-bg); color: #14507e; padding: 6px 10px; border-radius: 8px; line-height: 1.4; }
.it-note b { font-weight: 700; }
.it-side { text-align: right; min-width: 108px; }
.it-date { font-size: 13px; font-weight: 700; white-space: nowrap; }
.it-date .fuzzy { display: block; font-size: 11px; color: var(--muted); font-weight: 500; white-space: normal; max-width: 150px; }
.it-tko { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.note-btn {
  border: 0; background: transparent; color: var(--muted); font-size: 12px; cursor: pointer;
  padding: 2px 4px; margin-top: 4px; text-decoration: underline; text-underline-offset: 2px;
}
.note-btn:hover { color: var(--blue); }
.note-input { width: 100%; margin-top: 6px; padding: 7px 10px; font-size: 13px; border: 1.5px solid var(--blue); border-radius: 8px; outline: none; font-family: inherit; }

.st {
  font-size: 10.5px; font-weight: 800; letter-spacing: .4px; padding: 2.5px 8px; border-radius: 6px; white-space: nowrap;
}
.st.hitno { background: var(--red); color: #fff; }
.st.provjeriti { background: var(--amber-bg); color: #96700a; border: 1px solid #f2d48c; }
.st.predstoji { background: var(--blue-bg); color: var(--blue); }
.st.u-tijeku { background: #e5dbff; color: #6741d9; }
.st.gotovo { background: var(--green-bg); color: var(--green); }
.st.proslo { background: var(--bg); color: var(--muted); }

/* WP grupe */
.wp-group { margin-bottom: 18px; }
.wp-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.wp-name { font-size: 13px; font-weight: 800; letter-spacing: .5px; }
.wp-bar { flex: 1; height: 7px; background: var(--line); border-radius: 99px; overflow: hidden; max-width: 220px; }
.wp-fill { height: 100%; background: var(--green); border-radius: 99px; }
.wp-pct { font-size: 11.5px; color: var(--muted); font-weight: 700; }

/* partneri */
.part-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.part-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; border-top: 4px solid var(--line); }
.part-name { font-size: 15px; font-weight: 800; }
.part-role { font-size: 12.5px; color: var(--muted); margin: 3px 0 8px; line-height: 1.4; }
.part-kontakt { font-size: 12.5px; margin-bottom: 10px; color: var(--ink); }
.part-block { font-size: 12.5px; line-height: 1.5; padding: 8px 11px; border-radius: 9px; margin-top: 6px; }
.part-block.oni { background: var(--blue-bg); color: #14507e; }
.part-block.mi { background: var(--amber-bg); color: #7a5a05; }
.part-block b { font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; display: block; margin-bottom: 2px; }

/* sto gori */
.gori-proj { margin-bottom: 24px; }
.gori-head {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 11px;
  color: #fff; font-weight: 800; font-size: 15px; margin-bottom: 9px; cursor: pointer;
}
.gori-head .sub { font-weight: 500; font-size: 12.5px; opacity: .93; }
.gori-empty {
  background: var(--green-bg); color: var(--green); border-radius: var(--radius);
  padding: 22px; text-align: center; font-weight: 700; font-size: 15px;
}

/* kalendar */
.mj-head {
  font-size: 14px; font-weight: 800; text-transform: capitalize; margin: 22px 0 10px;
  display: flex; align-items: center; gap: 10px;
}
.mj-head:first-child { margin-top: 0; }
.mj-head .line { flex: 1; height: 1px; background: var(--line); }
.kal-item {
  background: var(--card); border-radius: 11px; box-shadow: var(--shadow);
  padding: 11px 15px; margin-bottom: 7px; display: flex; gap: 12px; align-items: center; cursor: pointer;
}
.kal-item:hover { background: #fbfcfe; }
.kal-dot { width: 11px; height: 11px; min-width: 11px; border-radius: 50%; }
.kal-proj { font-size: 11.5px; font-weight: 800; min-width: 86px; }
.kal-name { font-size: 13.5px; flex: 1; line-height: 1.35; }
.kal-date { font-size: 12.5px; font-weight: 700; white-space: nowrap; color: var(--muted); }

/* brifing */
.brif-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px 30px; max-width: 860px; }
.brif-title { font-size: 19px; font-weight: 800; margin-bottom: 4px; }
.brif-date { font-size: 12.5px; color: var(--muted); margin-bottom: 18px; }
.brif-item { display: flex; gap: 12px; margin-bottom: 14px; font-size: 14px; line-height: 1.55; }
.brif-num {
  min-width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff;
  font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center; margin-top: 1px;
}
.brif-note { font-size: 12px; color: var(--muted); margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); }

/* putovanja */
.put-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 15px 18px; margin-bottom: 10px; display: flex; gap: 15px; align-items: center;
  border-left: 5px solid var(--line); cursor: pointer;
}
.put-card:hover { background: #fbfcfe; }
.put-card.past { opacity: .55; }
.put-flag { font-size: 30px; line-height: 1; }
.put-main { flex: 1; }
.put-mjesto { font-size: 15.5px; font-weight: 800; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.put-naziv { font-size: 13px; color: var(--ink); margin-top: 2px; line-height: 1.4; }
.put-tko { font-size: 12px; color: var(--muted); margin-top: 3px; }
.put-side { text-align: right; min-width: 130px; }
.put-datum { font-size: 13.5px; font-weight: 800; }
.put-proj { font-size: 11px; font-weight: 800; margin-top: 3px; }
.put-domacin {
  font-size: 10.5px; font-weight: 800; background: var(--green-bg); color: var(--green);
  padding: 2.5px 9px; border-radius: 99px; letter-spacing: .3px;
}
.put-sec-title { font-size: 15px; font-weight: 800; margin: 22px 0 10px; }
.put-sec-title:first-child { margin-top: 0; }

/* partneri globalno */
.pglob-head {
  display: flex; align-items: center; gap: 10px; padding: 9px 16px; border-radius: 11px;
  color: #fff; font-weight: 800; font-size: 14.5px; margin: 20px 0 10px; cursor: pointer;
}
.pglob-head:first-child { margin-top: 0; }
.pglob-head .sub { font-weight: 500; font-size: 12px; opacity: .93; }
.part-osoba { display: flex; align-items: baseline; gap: 7px; font-size: 12.5px; margin-bottom: 4px; flex-wrap: wrap; }
.part-osoba a { color: var(--blue); text-decoration: none; font-weight: 600; word-break: break-all; }
.part-osoba a:hover { text-decoration: underline; }
.part-zastava { font-size: 16px; }

/* kalendar mreza */
.kal-mjesec { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px 14px; margin-bottom: 18px; }
.kal-mj-naslov { font-size: 15px; font-weight: 800; text-transform: capitalize; margin-bottom: 10px; }
.kal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.kal-cell { min-width: 0; }
.kal-dan-h { font-size: 10.5px; font-weight: 800; color: var(--muted); text-align: center; text-transform: uppercase; padding-bottom: 3px; }
.kal-cell { min-height: 52px; border-radius: 8px; background: var(--bg); padding: 3px 4px; font-size: 11px; }
.kal-cell.prazna { background: transparent; }
.kal-cell.danas { outline: 2px solid var(--ink); }
.kal-cell .broj { font-size: 10.5px; font-weight: 700; color: var(--muted); }
.kal-cell.danas .broj { color: var(--ink); }
.kal-pill {
  display: block; color: #fff; border-radius: 5px; padding: 1.5px 5px; margin-top: 2px;
  font-size: 10px; font-weight: 700; line-height: 1.25; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; cursor: pointer;
}
.kal-pill.done-pill { opacity: .45; text-decoration: line-through; }

.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: 13.5px; font-weight: 600;
  padding: 10px 20px; border-radius: 99px; box-shadow: 0 8px 24px rgba(0,0,0,.25); z-index: 200;
}

@media (max-width: 720px) {
  .topbar { padding: 12px 14px; gap: 10px; }
  .fresh { display: none; }
  main { padding: 16px 14px 50px; }
  .grid { grid-template-columns: 1fr; }
  .it-side { min-width: 84px; }
}
