/* GVT portals: shared look. Brand colours from the GVT logo: blue #1F5FD6, green #17A673, navy #14213D.
   Phone first: everything works at 360 px wide; wider screens get more columns. */
:root {
  --blue: #1F5FD6; --blue-dark: #174BAA; --green: #17A673; --green-dark: #11815A; --navy: #14213D;
  --ink: #1b2536; --muted: #5a6779; --line: #dce2ea; --bg: #f4f6fa; --card: #fff;
  --bad: #b3261e; --bad-bg: #fdecea; --warn: #8a5a00; --warn-bg: #fff4d6; --ok: #11815A; --ok-bg: #e5f6ee;
  font-size: 16px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Lato, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); line-height: 1.5; }
a { color: var(--blue); }
main { max-width: 1100px; margin: 0 auto; padding: 1rem .9rem 4rem; }
h1 { font-size: 1.5rem; margin: .3rem 0 1rem; color: var(--navy); }
h2 { font-size: 1.15rem; margin: 1.8rem 0 .6rem; color: var(--navy); }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
[hidden] { display: none !important; }

/* Header */
.top { background: var(--navy); color: #fff; padding: .55rem .9rem 0; display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 1rem; }
.brand { color: #fff; text-decoration: none; display: inline-flex; align-items: center; gap: .5rem; font-size: 1.1rem; }
.brand img { background: #fff; border-radius: 8px; padding: 3px; }
.brand b { color: #7fb0ff; }
.org-name { color: #c9d4e6; font-size: .95rem; }
.who { margin-left: auto; display: flex; gap: .8rem; align-items: center; font-size: .92rem; }
.who a, .who button.link { color: #dfe7f5; }
.main-nav { flex-basis: 100%; display: flex; gap: .2rem; overflow-x: auto; margin-top: .3rem; scrollbar-width: none; }
.main-nav a { color: #dfe7f5; text-decoration: none; padding: .55rem .8rem; border-radius: 8px 8px 0 0; white-space: nowrap; }
.main-nav a.active { background: var(--bg); color: var(--navy); font-weight: 700; }
.main-nav a:hover:not(.active) { background: rgba(255,255,255,.1); }
.foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 1rem 0 2rem; }
.foot a { color: var(--muted); }

/* Buttons */
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; font: inherit; font-weight: 600; padding: .6rem 1.1rem; min-height: 44px;
  border: 1px solid transparent; border-radius: 8px; background: var(--blue); color: #fff; cursor: pointer; text-decoration: none; }
button:hover, .button:hover { background: var(--blue-dark); }
.button.green, button.green { background: var(--green); }
.button.green:hover, button.green:hover { background: var(--green-dark); }
.button.secondary, button.secondary { background: #fff; color: var(--ink); border-color: #c5cfdc; }
.button.secondary:hover, button.secondary:hover { background: #eef2f8; }
.button.wa { background: #1fa855; }
.button.wa:hover { background: #178a45; }
.button.small, button.small { padding: .3rem .7rem; min-height: 34px; font-size: .9rem; }
button.link { background: none; border: 0; color: var(--blue); padding: 0; min-height: 0; text-decoration: underline; font-weight: 400; }
button.danger, .button.danger { background: #fff; color: var(--bad); border-color: #e9b9b5; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #8db4f0; outline-offset: 1px; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: .8rem 0; }
form.inline { display: inline; }

/* Forms */
.form { display: flex; flex-direction: column; gap: .9rem; max-width: 520px; }
.form.wide { max-width: 820px; }
.form label { display: flex; flex-direction: column; gap: .25rem; font-weight: 600; }
.form input:not([type=radio]):not([type=checkbox]):not([type=file]), .form select, .form textarea {
  font: inherit; font-weight: 400; padding: .55rem .65rem; min-height: 44px; border: 1px solid #b9c4d2; border-radius: 8px; background: #fff; width: 100%; }
.form [aria-invalid=true] { border-color: var(--bad); background: #fffafa; }
.form .row { display: grid; grid-template-columns: 1fr; gap: .9rem; }
.form label.choice { flex-direction: row; align-items: flex-start; gap: .5rem; font-weight: 400; }
.form label.choice input { margin-top: .35rem; width: 1.1rem; height: 1.1rem; }
.form button { align-self: flex-start; }
.hint { font-weight: 400; color: var(--muted); font-size: .88rem; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 1rem; background: var(--card); display: flex; flex-direction: column; gap: .9rem; margin: 0; }
legend { font-weight: 700; padding: 0 .3rem; color: var(--navy); }
.field-error { color: var(--bad); font-weight: 400; font-size: .9rem; }
.error-box { background: var(--bad-bg); color: var(--bad); padding: .7rem 1rem; border-radius: 8px; }
.flash { background: var(--ok-bg); color: var(--ok); padding: .7rem 1rem; border-radius: 8px; }
.note { background: var(--warn-bg); color: var(--warn); padding: .7rem 1rem; border-radius: 8px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.pre { white-space: pre-line; }
.narrow { max-width: 440px; margin: 1.5rem auto; background: var(--card); padding: 1.4rem 1.5rem; border-radius: 12px; border: 1px solid var(--line); }
.qr img { display: block; margin: 0 auto; background: #fff; }
code { background: var(--bg); padding: .1rem .3rem; border-radius: 4px; word-break: break-all; }
.password-box { font-size: 1.4rem; font-family: ui-monospace, Menlo, monospace; background: #fff; border: 2px dashed var(--green); padding: .4rem .8rem; border-radius: 8px; display: inline-block; letter-spacing: .05em; }

/* Lists and cards */
.title-row { display: flex; align-items: center; justify-content: space-between; gap: .6rem 1rem; flex-wrap: wrap; }
.title-row h1 { margin-bottom: .4rem; }
.search { display: flex; gap: .5rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.search input[type=search], .search input[type=date] { font: inherit; padding: .5rem .6rem; min-height: 44px; border: 1px solid #b9c4d2; border-radius: 8px; flex: 1; min-width: 0; max-width: 420px; }
.search select { font: inherit; padding: .5rem; min-height: 44px; border: 1px solid #b9c4d2; border-radius: 8px; }
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem; }
.card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .8rem 1rem; text-decoration: none; color: var(--ink); }
.card strong { font-size: 1.7rem; display: block; color: var(--navy); line-height: 1.2; }
.card.alert strong { color: var(--bad); }
.card.good strong { color: var(--green-dark); }
.card span { color: var(--muted); font-size: .9rem; }
.box { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1rem; margin-bottom: .8rem; }
.items { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .6rem; }
.item { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .8rem 1rem; }
.item.overdue { border-left: 5px solid var(--bad); }
.item.soon { border-left: 5px solid #e0a400; }
.item.done { opacity: .75; }
.item h3 { margin: 0 0 .2rem; font-size: 1.05rem; }
.item h3 a { color: var(--navy); }
.item .meta { color: var(--muted); font-size: .92rem; }
.item .actions { margin: .5rem 0 0; }
table.list { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
table.list th, table.list td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list th { background: #eef2f8; font-weight: 700; font-size: .9rem; }
table.list .num { text-align: right; white-space: nowrap; }
table.list tfoot th { background: #eef2f8; }
.table-wrap { overflow-x: auto; }
dl.details { display: grid; grid-template-columns: 1fr; gap: .1rem 1rem; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1rem; margin: 0 0 .8rem; }
dl.details dt { color: var(--muted); font-size: .88rem; margin-top: .4rem; }
dl.details dd { margin: 0; }
.tag { font-size: .8rem; background: #eef2f8; border: 1px solid var(--line); border-radius: 999px; padding: .08rem .55rem; white-space: nowrap; font-weight: 600; vertical-align: middle; }
.tag.bad { background: var(--bad-bg); color: var(--bad); border-color: #f1c4c0; }
.tag.warn { background: var(--warn-bg); color: var(--warn); border-color: #f0dca2; }
.tag.ok { background: var(--ok-bg); color: var(--ok); border-color: #b8e3cf; }
.tag.blue { background: #e7efff; color: var(--blue-dark); border-color: #c4d6fb; }
nav.tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; overflow-x: auto; }
nav.tabs a { padding: .5rem .9rem; text-decoration: none; color: var(--ink); border-radius: 8px 8px 0 0; white-space: nowrap; }
nav.tabs a.active { background: var(--card); border: 1px solid var(--line); border-bottom-color: var(--card); margin-bottom: -1px; font-weight: 700; }
.pager { display: flex; gap: 1rem; margin-top: 1rem; align-items: center; }
details.more summary { cursor: pointer; color: var(--blue); margin: .6rem 0; }
details.more[open] summary { margin-bottom: .8rem; }
.photo img { max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); }
.big-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin: .8rem 0; }
.big-actions .button, .big-actions button { width: 100%; min-height: 52px; font-size: 1.05rem; }
.big-actions form { display: contents; }
.plan-form { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; margin-top: .5rem; }
.plan-form select, .plan-form input { font: inherit; padding: .4rem; min-height: 40px; border: 1px solid #b9c4d2; border-radius: 8px; width: 100%; background: #fff; }
.plan-form button { grid-column: 1 / -1; }
.tech-col h2 { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.bar { display: block; height: 6px; border-radius: 3px; margin: 3px 0; background: var(--blue); }
.bar.received { background: var(--green); }
.bar.w0 { display: none; } .bar.w5 { width: 5%; } .bar.w10 { width: 10%; } .bar.w15 { width: 15%; } .bar.w20 { width: 20%; }
.bar.w25 { width: 25%; } .bar.w30 { width: 30%; } .bar.w35 { width: 35%; } .bar.w40 { width: 40%; } .bar.w45 { width: 45%; }
.bar.w50 { width: 50%; } .bar.w55 { width: 55%; } .bar.w60 { width: 60%; } .bar.w65 { width: 65%; } .bar.w70 { width: 70%; }
.bar.w75 { width: 75%; } .bar.w80 { width: 80%; } .bar.w85 { width: 85%; } .bar.w90 { width: 90%; } .bar.w95 { width: 95%; } .bar.w100 { width: 100%; }
.legend .bar { display: inline-block; width: 14px; vertical-align: middle; margin: 0 .2rem 0 .6rem; }

/* Wider screens */
@media (min-width: 700px) {
  main { padding: 1.5rem 1.2rem 4rem; }
  h1 { font-size: 1.7rem; }
  .form .row { grid-template-columns: 1fr 1fr; }
  .form .row.three { grid-template-columns: 1fr 1fr 1fr; }
  .cards { grid-template-columns: repeat(4, 1fr); }
  dl.details { grid-template-columns: 11rem 1fr; }
  dl.details dt { margin-top: 0; }
  .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; align-items: start; }
  .big-actions { grid-template-columns: repeat(4, auto); justify-content: start; }
  .plan-form { grid-template-columns: 1fr 1fr 1fr auto; }
  .plan-form button { grid-column: auto; }
}
@media (max-width: 699px) {
  table.list.collapse thead { display: none; }
  table.list.collapse, table.list.collapse tbody, table.list.collapse tr, table.list.collapse td { display: block; width: 100%; }
  table.list.collapse tr { border-bottom: 1px solid var(--line); padding: .4rem 0; }
  table.list.collapse td { border: 0; padding: .15rem .8rem; }
  table.list.collapse td.num { text-align: left; }
  table.list.collapse td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: .88rem; }
}
.terms { max-width: 760px; }
.terms li { margin-bottom: .4rem; }
