/* Edit stranica: svijetla, jednostavna, radi na mobitelu i laptopu. */
:root {
  --bg: #f7f6f3; --surface: #ffffff; --line: #e8e6e1; --text: #23221f; --muted: #787774;
  --accent: #23221f; --accent-text: #ffffff;
  --red: #9f2f2d; --red-bg: #fdebec; --amber: #8a5a0b; --amber-bg: #fbf0d9; --green: #2f6b45; --green-bg: #e5f2e9;
  --sans: "Segoe UI Variable Text", "Segoe UI", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", "SF Mono", Consolas, monospace;
  --r: 8px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #161615; --surface: #1f1f1d; --line: #2e2d2a; --text: #eeece6; --muted: #9a978f; --accent: #eeece6; --accent-text: #161615;
    --red: #f0a19a; --red-bg: #3a2120; --amber: #e9c27a; --amber-bg: #392d17; --green: #9ad3ad; --green-bg: #1e3326; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2 { margin: 0; letter-spacing: -0.02em; line-height: 1.2; }
h1 { font-size: 28px; } h2 { font-size: 20px; }
.muted { color: var(--muted); font-size: 14px; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }

.top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding: 24px 24px 16px; max-width: 1000px; margin: 0 auto; }
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.btn { font: inherit; font-size: 15px; font-weight: 600; border-radius: var(--r); padding: 10px 16px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; min-height: 42px; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.btn.ghost { background: transparent; }
.btn.small { font-size: 14px; padding: 6px 12px; min-height: 36px; }
.btn.danger { color: var(--red); }
.btn:disabled { opacity: 0.5; cursor: wait; }
.link { font: inherit; background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; padding: 0; }

.demo { max-width: 952px; margin: 0 auto 8px; padding: 10px 14px; border-radius: var(--r); background: var(--amber-bg); color: var(--amber); font-size: 14px; }
@media (max-width: 1000px) { .demo { margin: 0 24px 8px; } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.gate { display: grid; place-items: center; padding: 48px 16px; }
.gate-card { width: 100%; max-width: 360px; padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.gate-card input { font: inherit; font-size: 24px; letter-spacing: 0.3em; text-align: center; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); color: var(--text); }

main { max-width: 1000px; margin: 0 auto; padding: 0 24px 64px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tab { font: inherit; font-size: 15px; font-weight: 600; color: var(--muted); background: none; border: 0; border-bottom: 2px solid transparent; padding: 12px 12px; cursor: pointer; white-space: nowrap; }
.tab.on { color: var(--text); border-bottom-color: var(--text); }
.tab .count { font-size: 12px; font-weight: 600; background: var(--line); color: var(--muted); border-radius: 4px; padding: 1px 6px; margin-left: 4px; }

.toolbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 24px 0 16px; flex-wrap: wrap; }
.toolbar-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.seg button { font: inherit; font-size: 14px; padding: 8px 12px; border: 0; background: none; color: var(--muted); cursor: pointer; min-height: 40px; }
.seg button.on { background: var(--bg); color: var(--text); font-weight: 600; }

.list { display: flex; flex-direction: column; gap: 8px; }
.row { display: grid; grid-template-columns: 4px 1fr auto; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px 12px 0; overflow: hidden; }
.row .flag { align-self: stretch; border-radius: 0 3px 3px 0; background: var(--line); }
.row.red .flag { background: var(--red); } .row.amber .flag { background: #d99a2b; } .row.green .flag { background: #5aa775; }
.row.done { opacity: 0.6; } .row.done .main { text-decoration: line-through; }
.main { font-weight: 600; font-size: 16px; overflow-wrap: anywhere; }
.meta { color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 2px; }
.pill { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 4px; background: var(--line); color: var(--muted); }
.pill.red { background: var(--red-bg); color: var(--red); } .pill.amber { background: var(--amber-bg); color: var(--amber); } .pill.green { background: var(--green-bg); color: var(--green); }
.actions { display: flex; gap: 6px; }
.empty { text-align: center; color: var(--muted); padding: 48px 16px; border: 1px dashed var(--line); border-radius: 12px; }
@media (max-width: 640px) {
  .top { padding: 16px; align-items: center; } main { padding: 0 16px 48px; }
  .top-actions .btn { font-size: 13px; padding: 6px 10px; min-height: 34px; }
  h1 { font-size: 22px; }
  .row { grid-template-columns: 4px 1fr; }
  .actions { grid-column: 2; }
  .toolbar-right { width: 100%; } .toolbar-right .btn.primary { flex: 1; justify-content: center; }
}

dialog { border: 0; border-radius: 14px; padding: 0; width: min(520px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,0.18); }
dialog::backdrop { background: rgba(20, 20, 18, 0.45); }
.form { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.fields { display: flex; flex-direction: column; gap: 14px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field label .req { color: var(--red); }
.field input, .field select, .field textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); color: var(--text); min-height: 44px; }
.field textarea { min-height: 88px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .gate-card input:focus { outline: 2px solid var(--text); outline-offset: 1px; }
.field .hint { font-size: 13px; color: var(--muted); margin-top: 4px; }
.quick { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.quick button { font: inherit; font-size: 13px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 6px; background: none; color: var(--muted); cursor: pointer; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; }
.err { color: var(--red); font-size: 14px; min-height: 0; }
.err:empty { display: none; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--accent); color: var(--accent-text); padding: 12px 18px; border-radius: var(--r); font-weight: 600; opacity: 0; transition: 0.25s; pointer-events: none; max-width: calc(100vw - 32px); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--red); color: #fff; }
