/* app.css — AETR tervező, iPad (portrait + landscape) */
:root {
  --bg: #14213D; --panel: #1E2A4A; --panel2: #263553; --text: #F1F5F9; --muted: #A7B3C8;
  --red: #E63946; --amber: #F4A261; --green: #2A9D8F; --green-dark: #1F6F66;
  --sky: #2B7DE9; --violet: #7C5CD6; --grey: #6B7A90;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, "SF Pro Display", "Segoe UI", system-ui, sans-serif; -webkit-text-size-adjust: 100%; }
body { padding: max(16px, env(safe-area-inset-top)) 16px 24px; user-select: none; -webkit-user-select: none; }
button { font: inherit; color: inherit; border: 0; cursor: pointer; border-radius: 16px; touch-action: manipulation; }
button:active { transform: scale(0.97); }
input { font: inherit; color: var(--text); background: var(--panel2); border: 0; border-radius: 8px; padding: 8px 10px; }
input[type=number] { width: 84px; text-align: right; }
input.delayed { background: rgba(244,162,97,.35); }
h2 { margin: 0 0 12px; font-size: 20px; }
b { color: var(--text); }
.panel { background: var(--panel); border-radius: 24px; padding: 20px; margin-bottom: 16px; }

/* --- jezik --- */
.lang-bar { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.lang-toggle { display: inline-flex; background: var(--panel); border-radius: 999px; padding: 4px; }
.lang-toggle button { display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; font-weight: 600; font-size: 14px; background: transparent; color: var(--muted); }
.lang-toggle button.active { background: var(--text); color: var(--bg); }
.lang-toggle .flag { font-size: 20px; line-height: 1; }

/* --- alarm --- */
.alarm { border-radius: 16px; padding: 12px 20px; font-size: 18px; font-weight: 600; margin-bottom: 16px; }
.alarm.crit { background: var(--red); animation: pulse 1.2s infinite; }
.alarm.warn { background: var(--amber); color: #111; }
.error { background: rgba(230,57,70,.35); border-radius: 16px; padding: 12px 20px; margin-bottom: 16px; }
@keyframes pulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .alarm.crit { animation: none; } }

/* --- hero --- */
.hero-top { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 8px; }
.hero-label { color: var(--muted); font-size: 14px; }
.hero-big { font-size: 64px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.hero-meta { text-align: right; font-size: 14px; color: var(--muted); line-height: 1.6; }
.bar { height: 20px; border-radius: 999px; background: #3A4763; overflow: hidden; margin-top: 16px; }
.bar > div { height: 100%; transition: width .5s; }
.bar .ok { background: var(--green); } .bar .warn { background: var(--amber); } .bar .crit { background: var(--red); }
.acts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 16px; }
.acts button { padding: 16px 4px; font-weight: 600; font-size: 15px; opacity: .8; }
.acts button.active { opacity: 1; box-shadow: 0 0 0 4px #fff; }
.acts small { display: block; font-weight: 400; font-size: 12px; margin-top: 2px; }
.a-driving { background: var(--sky); } .a-work { background: var(--violet); } .a-availability { background: var(--grey); }
.a-break { background: var(--green); } .a-rest { background: var(--green-dark); }

/* --- obaveze / mogućnosti --- */
.two-col { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 900px) { .two-col { grid-template-columns: 1fr 1fr; } }
.two-col .panel { margin: 0; }
h2.red { color: #FCA5A5; } h2.green { color: #86EFAC; }
ul.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
ul.list li { border-radius: 12px; padding: 12px 16px; border-left: 4px solid; }
ul.list li .d { font-size: 14px; color: var(--muted); margin-top: 2px; }
li.crit { border-color: var(--red); background: rgba(230,57,70,.12); }
li.warn { border-color: var(--amber); background: rgba(244,162,97,.12); }
li.info { border-color: var(--grey); background: rgba(107,122,144,.12); }
li.ok   { border-color: var(--green); background: rgba(42,157,143,.12); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; text-align: center; }
.stats div { background: var(--panel2); border-radius: 12px; padding: 12px; }
.stats span { display: block; font-size: 12px; color: var(--muted); }
.stats strong { font-size: 24px; }

/* --- planer --- */
.planner-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.planner-head label { font-size: 14px; }
.planner-head input { margin-left: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-weight: 500; padding: 4px; }
td { padding: 6px 4px; border-top: 1px solid #3A4763; font-variant-numeric: tabular-nums; }
td input.name { width: 100%; background: transparent; border-radius: 0; border-bottom: 1px solid #56658A; padding: 6px 2px; }
td button.del { background: transparent; color: #FCA5A5; padding: 4px 8px; font-size: 16px; }
.planner-foot { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 12px; font-size: 14px; color: var(--muted); }
.btn-grey { background: #3A4763; padding: 8px 16px; border-radius: 12px; }
.route-warn { margin-top: 8px; background: rgba(230,57,70,.3); border-radius: 12px; padding: 8px 16px; }
ul.timeline { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 4px; font-size: 14px; }
@media (min-width: 700px) { ul.timeline { grid-template-columns: 1fr 1fr; } }
ul.timeline li { border-radius: 8px; padding: 8px 12px; }
ul.timeline li.break { background: rgba(42,157,143,.4); } ul.timeline li.rest { background: rgba(31,111,102,.6); }

/* --- export --- */
.export { display: flex; flex-wrap: wrap; gap: 12px; }
.export button { padding: 16px 24px; font-size: 18px; font-weight: 600; }
.b-sky { background: var(--sky); } .b-grey { background: #4A5878; } .b-dark { background: var(--panel); font-weight: 400; }
