/* Tandartspraktijk v1.0 */
:root {
  --teal: #0d7480; --teal-d: #0a5c66; --teal-l: #e6f3f4; --inkt: #1d2b30; --grijs: #6b7b80; --lijn: #dfe7e9;
  --achter: #f4f7f8; --wit: #fff; --rood: #c8362f; --groen: #2a8a4a; --oranje: #c77700; --blauw: #2f6fdb;
  --radius: 10px; --schaduw: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(13,60,70,.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.45 "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif; color: var(--inkt); background: var(--achter); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--teal); }
h1 { font-size: 1.55rem; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 1.08rem; margin: 0 0 .7rem; color: var(--teal-d); }
h3 { font-size: .98rem; margin: 1rem 0 .4rem; }
code, .mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .93em; }
.klein { font-size: .85rem; } .grijs { color: var(--grijs); } .rood { color: var(--rood); } .groen { color: var(--groen); }
.r { text-align: right; } .midden { text-align: center; } .rechts { text-align: right; margin-top: .6rem; }
.verborgen { display: none !important; }
hr { border: 0; border-top: 1px solid var(--lijn); margin: 1rem 0; }

/* Topbalk */
.topbalk { background: linear-gradient(90deg, var(--teal-d), var(--teal)); color: #fff; display: flex; align-items: center; gap: 1.5rem; padding: .55rem 1.4rem; position: sticky; top: 0; z-index: 20; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.modus-beheer .topbalk { background: linear-gradient(90deg, #233a46, #34525f); }
.merk { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; }
.merk span { display: flex; flex-direction: column; line-height: 1.15; }
.merk b { font-size: 1.02rem; } .merk small { opacity: .8; font-size: .75rem; }
.hoofdmenu { display: flex; gap: .2rem; flex: 1; }
.hoofdmenu a { color: #fff; text-decoration: none; padding: .45rem .85rem; border-radius: 8px; opacity: .85; }
.hoofdmenu a:hover { background: rgba(255,255,255,.12); opacity: 1; }
.hoofdmenu a.actief { background: rgba(255,255,255,.2); opacity: 1; font-weight: 600; }
.wie { display: flex; align-items: center; gap: .6rem; margin-left: auto; font-size: .9rem; }
.rolbadge { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; padding: .15rem .5rem; border-radius: 99px; background: rgba(255,255,255,.2); }
.rolbadge.tandarts { background: #ffd36b; color: #4a3500; } .rolbadge.assistente { background: #bfe9ff; color: #08364d; } .rolbadge.beheer { background: #ffb4a8; color: #4a120b; }

.inhoud { width: 100%; max-width: 1320px; margin: 0 auto; padding: 1.3rem 1.4rem 3rem; flex: 1; }
.voet { text-align: center; font-size: .8rem; color: var(--grijs); padding: 1rem; display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; }

/* Knoppen */
.knop { display: inline-flex; align-items: center; gap: .35rem; background: var(--teal); color: #fff; border: 1px solid var(--teal); border-radius: 8px; padding: .5rem 1rem; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.knop:hover { background: var(--teal-d); }
.knop.licht { background: #fff; color: var(--teal-d); border-color: var(--lijn); }
.knop.licht:hover { background: var(--teal-l); }
.topbalk .knop.licht { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.3); }
.knop.klein { padding: .28rem .65rem; font-size: .85rem; font-weight: 500; }
.knop.groot { padding: .65rem 1.4rem; font-size: 1rem; }
.knop.groen { background: var(--groen); border-color: var(--groen); }
.knop.licht.rood { color: var(--rood); }
.icoonknop { background: none; border: 0; cursor: pointer; font-size: 1rem; padding: .2rem .4rem; border-radius: 6px; color: var(--grijs); }
.icoonknop:hover { background: #fdeaea; color: var(--rood); }
.knoppenbalk { display: flex; align-items: center; gap: .7rem; margin-top: 1rem; flex-wrap: wrap; }
.knoppenbalk.vast { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--achter) 30%); padding: 1.2rem 0 .6rem; }

/* Kaarten & raster */
.kaart { background: var(--wit); border: 1px solid var(--lijn); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--schaduw); margin-bottom: 1.1rem; }
.kaartkop { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .5rem; flex-wrap: wrap; }
.kaartkop h2 { margin: 0; }
.paginakop { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.paginakop h1 .label { vertical-align: middle; font-size: .8rem; }
.raster-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.raster-2-1 { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(260px, 1fr); gap: 1.1rem; align-items: start; }
.kruimel { margin: 0 0 .6rem; font-size: .9rem; } .kruimel a { text-decoration: none; }

/* Meldingen & labels */
.melding { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid; }
.melding.ok { background: #eaf7ee; border-color: #bfe3c9; color: #17572c; }
.melding.fout { background: #fdeceb; border-color: #f3c3bf; color: #7d1c16; }
.melding.info { background: #eef5fd; border-color: #c8dcf5; color: #1d4370; }
.label { display: inline-block; font-size: .75rem; font-weight: 600; padding: .12rem .5rem; border-radius: 99px; background: #eef1f2; color: #45555a; white-space: nowrap; }
.label.groen { background: #e2f4e7; color: #1c6b37; } .label.rood { background: #fde2e0; color: #a3221b; }
.label.oranje { background: #fff0d9; color: #8a5200; } .label.blauw { background: #e3edfd; color: #1f4f9f; } .label.grijs { background: #eceeef; color: #6b7b80; }

/* Formulieren */
label { display: flex; flex-direction: column; gap: .25rem; font-size: .84rem; font-weight: 600; color: #3b4b50; margin-bottom: .7rem; flex: 1; min-width: 0; }
label small { font-weight: 400; color: var(--grijs); }
input, select, textarea { font: inherit; font-weight: 400; color: var(--inkt); border: 1px solid #cdd8db; border-radius: 7px; padding: .45rem .6rem; background: #fff; width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(13,116,128,.25); border-color: var(--teal); }
input[disabled] { background: #f2f4f5; color: #aab; }
textarea { resize: vertical; }
label.check, label.radio { flex-direction: row; align-items: center; gap: .45rem; font-weight: 500; flex: 0 0 auto; }
label.check input, label.radio input { width: auto; }
label.check.onder { align-self: flex-end; margin-bottom: 1.1rem; }
.rij { display: flex; gap: .8rem; align-items: flex-end; flex-wrap: wrap; }
.rij > label.s { flex: 0 0 90px; } .rij > label.m { flex: 0 0 150px; }
.rij > .knop { margin-bottom: .7rem; }
.keuze-rij { display: flex; gap: 1.2rem; margin-bottom: .6rem; flex-wrap: wrap; }
fieldset { border: 1px solid var(--lijn); border-radius: var(--radius); padding: .8rem 1rem .4rem; margin: 0; min-width: 0; background: #fff; }
legend { font-weight: 700; color: var(--teal-d); padding: 0 .4rem; }
.velden-raster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.velden-raster .breed { grid-column: 1 / -1; }
.formulier.kaart .velden-raster fieldset { box-shadow: none; }
.zoekbalk { display: flex; gap: .6rem; margin-bottom: 1rem; flex-wrap: wrap; }
.zoekbalk input[type=search] { flex: 1 1 300px; }
.zoekbalk select { width: auto; }
.zoekbalk.compact { margin: 0; } .zoekbalk.compact input { flex: 0 1 200px; }
.zoekbalk.kaart { padding: .8rem; }

/* Tabellen */
.tabel { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tabel th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--grijs); font-weight: 600; padding: .5rem .55rem; border-bottom: 2px solid var(--lijn); white-space: nowrap; }
.tabel td { padding: .5rem .55rem; border-bottom: 1px solid #edf1f2; vertical-align: top; }
.tabel.compact td, .tabel.compact th { padding: .3rem .45rem; }
.tabel.klikbaar tbody tr { cursor: pointer; }
.tabel.klikbaar tbody tr:hover td, .tabel tbody tr:hover td { background: #f6fafb; }
.tabel tfoot td { border-bottom: 0; padding-top: .7rem; }
.tabel .leeg { text-align: center; color: var(--grijs); padding: 1.5rem; }
.tabel tr.nieuwe-dag td { border-top: 2px solid #e4ecee; }
.tabel tr.groepkop td { background: var(--teal-l); color: var(--teal-d); font-weight: 700; font-size: .82rem; cursor: default; }
.tabel.invoer input, .tabel.invoer select { padding: .3rem .45rem; }
.tabel.invoer select { min-width: 125px; }
.flex1 { flex: 1; text-align: left; }
.tabel tr.nieuw td { background: #fbfdf6; }
.geslacht { color: var(--grijs); }
.lijstje { list-style: none; padding: 0; margin: 0; }
.lijstje li { padding: .4rem 0; border-bottom: 1px solid #edf1f2; display: flex; justify-content: space-between; gap: .5rem; align-items: center; }

/* Login */
.modus-login .inhoud { display: flex; align-items: flex-start; justify-content: center; padding-top: 8vh; }
.loginvak { background: #fff; width: 100%; max-width: 410px; padding: 2rem; border-radius: 14px; box-shadow: var(--schaduw); border: 1px solid var(--lijn); }
.loginvak h1 { margin-bottom: .2rem; } .loginvak .sub { color: var(--grijs); margin: 0 0 1.3rem; }
.loginvak .knop { width: 100%; justify-content: center; margin: .4rem 0 1rem; }

/* Patiëntkop */
.patientkop { display: flex; gap: 1.1rem; align-items: center; background: #fff; border: 1px solid var(--lijn); border-radius: var(--radius); padding: 1rem 1.2rem; box-shadow: var(--schaduw); margin-bottom: .9rem; }
.avatar { width: 58px; height: 58px; border-radius: 50%; background: var(--teal-l); color: var(--teal-d); display: grid; place-items: center; font-size: 1.5rem; font-weight: 700; flex: none; }
.avatar.man { background: #e2edfb; color: #22508e; } .avatar.vrouw { background: #fbe6ef; color: #8e2253; }
.patientkop .info { flex: 1; min-width: 0; }
.patientkop h1 { font-size: 1.35rem; }
.feiten { display: flex; flex-wrap: wrap; gap: .35rem 1rem; color: #3b4b50; font-size: .9rem; margin-top: .3rem; align-items: center; }
.medisch-alert { margin-top: .5rem; background: #fff3f2; border: 1px solid #f5c6c2; color: #8a1d17; padding: .35rem .7rem; border-radius: 7px; font-size: .88rem; display: inline-block; }
.recall { text-align: right; display: flex; flex-direction: column; gap: .1rem; }
.recall small { color: var(--grijs); font-size: .75rem; } .recall b { font-size: 1.1rem; }
.recall b.rood { color: var(--rood); }

.tabs { display: flex; gap: .3rem; margin-bottom: 1rem; border-bottom: 2px solid var(--lijn); flex-wrap: wrap; }
.tabs a { padding: .6rem 1.1rem; text-decoration: none; color: #3b4b50; border-radius: 8px 8px 0 0; font-weight: 600; margin-bottom: -2px; border-bottom: 2px solid transparent; }
.tabs a:hover { background: #fff; }
.tabs a.actief { color: var(--teal-d); border-bottom-color: var(--teal); background: #fff; }

/* Odontogram */
#odontogram { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 1rem 0 .6rem; overflow-x: auto; }
.odo-rij { display: flex; gap: 22px; }
.odo-rij.melk { opacity: .92; }
.odo-rij.melk .tand { transform: scale(.86); }
.odo-helft { display: flex; gap: 3px; }
.odo-kaaklijn { width: 100%; max-width: 820px; border-top: 2px dashed #b9c8cc; margin: 6px 0; display: flex; justify-content: space-between; color: var(--grijs); font-size: .72rem; font-weight: 700; }
.odo-kaaklijn span { padding: 0 .3rem; }
.tand { background: none; border: 1px solid transparent; border-radius: 8px; padding: 2px 1px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 0; transition: background .12s; }
.tand:hover { background: var(--teal-l); border-color: #b8dadd; }
.tand.gekozen { background: #fff6d6; border-color: #f0c84b; }
.tand .nr { font-size: .74rem; font-weight: 700; color: #3b4b50; font-family: ui-monospace, Consolas, monospace; }
.tand svg { display: block; }
.legenda { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; font-size: .8rem; color: #3b4b50; justify-content: center; border-top: 1px solid var(--lijn); padding-top: .7rem; }
.legenda span { display: inline-flex; align-items: center; gap: .35rem; }
.lg { width: 14px; height: 14px; border-radius: 3px; display: inline-block; border: 1px solid #6b7b80; }
.lg.vulling { background: #2f6fdb; } .lg.caries { background: #e0453a; } .lg.kroon { border: 3px solid #d4a017; border-radius: 4px; }
.lg.implantaat { border: 3px solid #7b4bc4; } .lg.brugdeel { background: linear-gradient(#fff 35%, #1f4e79 35% 65%, #fff 65%); }
.lg.prothese { background: #fbe3ef; border: 2px dashed #d0508f; } .lg.ontbreekt { background: #f2f4f5; position: relative; }
.lg.ontbreekt::after { content: "✕"; position: absolute; inset: -3px 0 0 1px; font-size: 12px; color: #8a979b; }
.lg.trekken { border: 2px dashed #e0453a; } .lg.wkb { border: 0; width: 3px; background: #c0262d; }
.lg.notitie { border-radius: 50%; background: #f0a500; border: 0; width: 9px; height: 9px; }

.tand-editor { position: fixed; right: 22px; top: 90px; width: 300px; background: #fff; border: 1px solid var(--lijn); border-radius: 12px; box-shadow: 0 12px 40px rgba(10,40,50,.22); padding: 1rem 1.1rem; z-index: 50; }
.te-kop { display: flex; justify-content: space-between; align-items: center; }
.te-kop h3 { margin: 0 0 .6rem; }
.sluit { background: none; border: 0; font-size: 1.5rem; cursor: pointer; color: var(--grijs); line-height: 1; }
.te-vlakken { text-align: center; margin-bottom: .6rem; }
.te-vlakken svg .vlak:hover { opacity: .75; }

.dpsi { border-collapse: separate; border-spacing: 6px; margin-bottom: .4rem; }
.dpsi td { background: var(--teal-l); border-radius: 8px; padding: .35rem .5rem; text-align: center; }
.dpsi small { display: block; font-size: .7rem; color: var(--grijs); font-weight: 700; }
.dpsi select { width: 70px; }

/* Behandelregels */
.favorieten { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin: .2rem 0 .9rem; }
.fav { border: 1px solid #c4dfe2; background: var(--teal-l); color: var(--teal-d); border-radius: 99px; padding: .25rem .7rem; font: inherit; font-size: .8rem; cursor: pointer; }
.fav:hover { background: #d3ebee; }
.regels td { vertical-align: middle; }
.regels input { padding: .32rem .45rem; }
.regels tr.onbekend .oms { color: var(--rood); font-weight: 600; }
.regels .oms { color: #3b4b50; }

/* Beheer */
.tegels { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .8rem; margin-bottom: 1.1rem; }
.tegel { background: #fff; border: 1px solid var(--lijn); border-radius: var(--radius); padding: .8rem 1rem; box-shadow: var(--schaduw); }
.tegel small { display: block; color: var(--grijs); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.tegel b { font-size: 1.35rem; }
.tegel.alarm { border-color: #f3c3bf; background: #fff8f7; } .tegel.alarm b { color: var(--rood); }
.acties-kolom form { display: flex; flex-direction: column; gap: .4rem; }
.acties-kolom .knop { justify-content: center; }
.staven { display: flex; align-items: flex-end; gap: 10px; height: 170px; padding-top: 10px; }
.staaf { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; max-width: 70px; }
.staaf i { display: block; width: 100%; background: linear-gradient(var(--teal), var(--teal-d)); border-radius: 5px 5px 0 0; }
.staaf .bedrag { font-size: .68rem; color: var(--grijs); white-space: nowrap; }
.staaf small { font-weight: 700; color: #3b4b50; }

/* Codes */
.codekop { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.codekop h1 { font-size: 1.3rem; } .codekop p { margin: .2rem 0 0; }
.codebadge { font: 700 1.3rem ui-monospace, Consolas, monospace; background: var(--teal); color: #fff; padding: .6rem .9rem; border-radius: 10px; }
.toelichting { background: var(--teal-l); border-left: 4px solid var(--teal); padding: .8rem 1rem; border-radius: 0 8px 8px 0; }

/* Factuur (HTML) */
.factuurpagina { background: #e9eef0; display: block; }
.factuurknoppen { text-align: center; padding: 1rem; display: flex; gap: .6rem; justify-content: center; }
.a4 { width: 210mm; min-height: 297mm; margin: 0 auto 2rem; background: #fff; padding: 16mm 18mm; box-shadow: 0 4px 30px rgba(0,0,0,.12); font-size: 10pt; color: #111; position: relative; }
.fk { display: flex; justify-content: space-between; border-top: 6px solid var(--teal); padding-top: 6mm; margin-top: -16mm; }
.fk-naam { font-size: 16pt; font-weight: 700; } .fk-titel { font-size: 18pt; font-weight: 700; color: var(--teal); }
.fk-adres { color: #444; font-size: 9pt; margin-top: 2mm; }
.fk-midden { display: flex; justify-content: space-between; margin: 14mm 0 10mm; }
.fk-deb { font-size: 11pt; line-height: 1.5; }
.fk-meta td { padding: 1px 0 1px 8mm; font-size: 9pt; } .fk-meta td:first-child { color: #666; padding-left: 0; } .fk-meta td:last-child { font-weight: 700; text-align: right; }
.fk-regels { width: 100%; border-collapse: collapse; font-size: 9pt; }
.fk-regels th { background: #e8f4f5; color: #0d5a64; text-align: left; padding: 2mm; }
.fk-regels td { padding: 2mm; border-bottom: 1px solid #e5e5e5; vertical-align: top; }
.fk-regels tfoot td { font-weight: 700; font-size: 11pt; border-top: 2px solid var(--teal); border-bottom: 0; }
.fk-voet { position: absolute; left: 18mm; right: 18mm; bottom: 12mm; border-top: 1px solid #ccc; padding-top: 2mm; font-size: 7.5pt; color: #777; }
.betaald { color: var(--groen); font-weight: 700; }

@media (max-width: 980px) {
  .raster-2, .raster-2-1, .velden-raster { grid-template-columns: 1fr; }
  .topbalk { flex-wrap: wrap; gap: .6rem; }
  .tand-editor { left: 10px; right: 10px; width: auto; top: auto; bottom: 10px; }
  .patientkop { flex-wrap: wrap; }
}
@media print {
  .topbalk, .voet, .tabs, .geen-print, .kruimel, .knop, .tand-editor, .factuurknoppen { display: none !important; }
  body, .factuurpagina { background: #fff; }
  .kaart { box-shadow: none; border: 0; }
  .a4 { box-shadow: none; margin: 0; width: auto; min-height: auto; padding: 0 0 20mm; }
  .fk { margin-top: 0; }
  @page { size: A4; margin: 14mm; }
}
