/* Medicatiebeheer HCV. Huisstijl: teal #006e62, goud #ce9e24. Systeemfonts, niets extern. */
:root {
  --teal: #006e62;
  --teal-donker: #00534a;
  --teal-licht: #e6f1ef;
  --goud: #ce9e24;
  --goud-licht: #faf3e0;
  --tekst: #1d2a28;
  --zacht: #5b6b68;
  --lijn: #d7e0de;
  --achter: #f5f7f6;
  --wit: #fff;
  --rood: #b3261e;
  --rood-licht: #fbe9e7;
  --oranje: #a35a00;
  --oranje-licht: #fff1dc;
  --geel-licht: #fdf7d9;
  --grijs-licht: #eef1f0;
  --radius: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--tekst);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--achter); padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
a { color: var(--teal); }
h1 { font-size: 1.35rem; margin: .2rem 0 .8rem; }
h2 { font-size: 1.05rem; margin: 1.4rem 0 .5rem; color: var(--teal-donker); }
h3 { font-size: .95rem; margin: 1rem 0 .4rem; }
p { line-height: 1.45; }

.kop { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .6rem 1rem; padding-top: calc(.6rem + env(safe-area-inset-top)); background: var(--teal); color: #fff; }
.merk { display: flex; align-items: center; gap: .5rem; color: #fff; text-decoration: none; font-weight: 600; }
.merk span { color: var(--goud); }
.merk img { background: #fff; border-radius: 6px; }
.wie { font-size: .85rem; opacity: .9; }

main { max-width: 980px; margin: 0 auto; padding: 1rem; }
.laden { color: var(--zacht); }

.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 5; display: flex; background: #fff; border-top: 1px solid var(--lijn);
  padding-bottom: env(safe-area-inset-bottom); }
.tabs[hidden] { display: none; }
.tabs a { flex: 1; text-align: center; padding: .85rem .2rem; text-decoration: none; color: var(--zacht); font-size: .9rem; font-weight: 500; }
.tabs a.actief { color: var(--teal); box-shadow: inset 0 3px 0 var(--goud); }

/* Overzicht: tegels met de werkstappen */
.tegels { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; margin: .4rem 0 1.2rem; }
.tegel { display: flex; flex-direction: column; gap: .15rem; padding: .8rem .9rem; border-radius: var(--radius); text-decoration: none;
  background: #fff; border: 1px solid var(--lijn); border-left: 5px solid var(--lijn); color: var(--tekst); }
.tegel .getal { font-size: 1.7rem; font-weight: 700; line-height: 1.1; }
.tegel .label { font-size: .88rem; color: var(--zacht); }
.tegel .sub { font-size: .8rem; font-weight: 600; color: var(--rood); }
.tegel.rood { border-left-color: var(--rood); } .tegel.rood .getal { color: var(--rood); }
.tegel.oranje { border-left-color: var(--oranje); } .tegel.oranje .getal { color: var(--oranje); }
.tegel.blauw { border-left-color: var(--teal); } .tegel.blauw .getal { color: var(--teal); }
.tegel.paars { border-left-color: #5b2a86; } .tegel.paars .getal { color: #5b2a86; }
.tegel.groen { border-left-color: #2c6b36; } .tegel.groen .getal { color: #2c6b36; }
.tegel.rustig .getal { color: var(--zacht); }

/* Lijsten: één regel per ding, knop altijd op dezelfde plek rechts */
.lijst { background: #fff; border: 1px solid var(--lijn); border-radius: var(--radius); overflow: hidden; }
.lijst.vlak { border: 0; border-radius: 0; }
.rij { display: flex; align-items: center; gap: .75rem; padding: .7rem 1rem; border-bottom: 1px solid var(--lijn); }
.rij:last-child { border-bottom: 0; }
.rij-tekst { flex: 1; min-width: 0; }
.rij .naam { font-weight: 600; }
.rij .meta { color: var(--zacht); font-size: .85rem; margin-top: .15rem; display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .4rem; }
.rij .opm { font-size: .85rem; color: var(--zacht); margin-top: .25rem; font-style: italic; }
.rij-actie:empty { display: none; }
.rij-actie { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: .3rem; min-width: 6.5rem; }
.rij-actie .knop, .rij-actie button.knop { width: 7rem; text-align: center; white-space: normal; line-height: 1.2; }
.link-rij { text-decoration: none; color: inherit; }
.link-rij:hover { background: var(--achter); }
.link-rij .rij-actie { flex-direction: row; align-items: center; min-width: 0; }
.pijl { font-size: 1.4rem; color: var(--zacht); line-height: 1; }
.besteld { color: var(--teal-donker); font-weight: 600; }
.gedaan { color: #2c6b36; font-weight: 600; }
.nodig { color: var(--zacht); }
.te-laat { color: var(--oranje); font-weight: 600; }
button.link { background: none; border: 0; padding: 0; color: var(--zacht); font-size: .8rem; text-decoration: underline; cursor: pointer; }
.stappen { margin: 0 0 1rem; padding-left: 1.3rem; color: var(--zacht); font-size: .9rem; line-height: 1.5; }
.ruimte { padding: .6rem 1rem; margin: 0; }

/* Locatie: volledige inhoud, batches rechts en aantikbaar */
.rij.inhoud { align-items: flex-start; }
.batches { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; }
.batchregel { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .55rem; border-radius: 8px; background: var(--achter);
  font-size: .9rem; color: var(--tekst); text-decoration: none; white-space: nowrap; }
a.batchregel:hover { background: var(--teal-licht); }

.badge { display: inline-block; padding: .12rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap;
  background: var(--grijs-licht); color: var(--zacht); }
.badge.verlopen { background: var(--rood-licht); color: var(--rood); }
.badge.deze_maand { background: var(--oranje-licht); color: var(--oranje); }
.badge.binnenkort { background: var(--geel-licht); color: #7a6100; }
.badge.ontbreekt { background: #efe7f6; color: #5b2a86; }
.badge.plannen { background: var(--teal-licht); color: var(--teal-donker); }
.badge.ok { background: #e8f3ea; color: #2c6b36; }
.badge.opium { background: var(--goud-licht); color: #7a5a00; border: 1px solid var(--goud); }

.knoppen { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0 1rem; }
button, .knop { font: inherit; font-size: .95rem; border-radius: 8px; border: 1px solid var(--teal); background: var(--teal); color: #fff;
  padding: .55rem .95rem; cursor: pointer; text-decoration: none; display: inline-block; line-height: 1.2; }
button.tweede, .knop.tweede { background: #fff; color: var(--teal); }
button.klein, .knop.klein { padding: .3rem .6rem; font-size: .85rem; }
button.gevaar { background: #fff; color: var(--rood); border-color: var(--rood); }
button:disabled { opacity: .5; cursor: default; }

.blok { background: #fff; border: 1px solid var(--lijn); border-radius: var(--radius); margin-bottom: .75rem; overflow: hidden; }
/* Naar een groep springen: niet onder de vaste kopbalk verdwijnen */
.blok { scroll-margin-top: 4.5rem; }
.blok > h2 { margin: 0; padding: .7rem 1rem; border-bottom: 1px solid var(--lijn); font-size: .95rem; }
.regel .afwijking, .afwijking { color: var(--oranje); font-weight: 600; }
.punt .naam { font-weight: 600; }
.sub { color: var(--zacht); }

.formulier { background: #fff; border: 1px solid var(--lijn); border-radius: var(--radius); padding: 1rem; max-width: 560px; }
label { display: block; font-weight: 600; font-size: .9rem; margin: .8rem 0 .3rem; }
label:first-child { margin-top: 0; }
label.inline { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
input, select, textarea { font: inherit; font-size: 1rem; width: 100%; padding: .55rem .65rem; border: 1px solid var(--lijn); border-radius: 8px; background: #fff; color: var(--tekst); }
input[type=checkbox] { width: auto; }
textarea { min-height: 5rem; }
.hint { font-size: .82rem; color: var(--zacht); margin-top: .25rem; }
.fout { color: var(--rood); font-weight: 600; }
.vorige { background: var(--achter); border-radius: 8px; padding: .55rem .7rem; font-size: .9rem; }

table { width: 100%; border-collapse: collapse; background: #fff; font-size: .9rem; }
th, td { text-align: left; padding: .5rem .55rem; border-bottom: 1px solid var(--lijn); vertical-align: top; }
th { background: var(--teal-licht); color: var(--teal-donker); font-size: .8rem; text-transform: uppercase; letter-spacing: .02em; }
td.getal, th.getal { text-align: right; white-space: nowrap; }
tr.nul td { color: #9aa7a4; }
.tabelwrap { overflow-x: auto; border: 1px solid var(--lijn); border-radius: var(--radius); margin-bottom: 1rem; }
.tabelwrap table { border: 0; }

.lijst-meer a { display: block; padding: .9rem 1rem; border-bottom: 1px solid var(--lijn); text-decoration: none; color: var(--tekst); background: #fff; }
.lijst-meer a:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.lijst-meer a:last-child { border-bottom: 0; border-radius: 0 0 var(--radius) var(--radius); }
.lijst-meer { border: 1px solid var(--lijn); border-radius: var(--radius); }

.melding { position: fixed; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 10;
  background: var(--tekst); color: #fff; padding: .6rem 1rem; border-radius: 8px; font-size: .9rem; max-width: 90vw; }
.melding.fout { background: var(--rood); }

.inlog { max-width: 380px; margin: 2rem auto; }
.leeg { color: var(--zacht); font-style: italic; }
.terug { display: inline-block; margin-bottom: .4rem; font-size: .9rem; }
.alleen-print { display: none; }

@media print {
  body { background: #fff; padding: 0; }
  .kop, .tabs, .knoppen, .melding, .niet-print, .terug { display: none !important; }
  .alleen-print table { border: 1px solid #999; }
  .alleen-print { display: block; }
  main { max-width: none; padding: 0; }
  table { font-size: 9.5pt; }
  th { background: #eee !important; color: #000; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .tabelwrap { border: 0; overflow: visible; }
  tr { break-inside: avoid; }
  h2 { break-after: avoid; color: #000; }
  .badge { border: 1px solid #999; background: none !important; color: #000 !important; }
  .handtekening { margin-top: 2rem; display: flex; gap: 3rem; }
  .handtekening div { flex: 1; border-top: 1px solid #000; padding-top: .3rem; font-size: 9pt; }
}
