/* ═══════════════════════════════════════════════════════════
   RECIPE Rx — Gedeelde stijlen
   ═══════════════════════════════════════════════════════════ */

:root {
    --navy:       #0f2942;
    --navy-mid:   #1a3f63;
    --teal:       #0e8c7a;
    --teal-light: #12a68f;
    --teal-pale:  #e6f5f3;
    --slate:      #4a6080;
    --silver:     #e8edf3;
    --white:      #ffffff;
    --text:       #1a2b3c;
    --text-muted: #6b7e94;
    --radius:     8px;
    --shadow:     0 2px 12px rgba(15,41,66,0.10);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'DM Sans', sans-serif;
    background: #f0f4f8;
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main { flex: 1; }

/* ─── Buttons ─────────────────────────────────────────────── */
.btn {
    padding: 9px 18px;
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn:active { transform: scale(0.98); }
.btn-teal    { background: var(--teal); color: var(--white); }
.btn-teal:hover { background: var(--teal-light); }
.btn-teal:disabled {
    background: var(--silver);
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}
.btn-outline {
    background: transparent;
    color: #a8c4dd;
    border: 1.5px solid #a8c4dd;
}
.btn-outline:hover { color: var(--white); border-color: var(--white); }
.btn-navy { background: var(--navy-mid); color: var(--white); }
.btn-navy:hover { background: var(--navy); }
.btn-danger { background: #c0392b; color: var(--white); border: none; }
.btn-danger:hover { background: #e74c3c; }

/* ─── Header ─────────────────────────────────────────────── */
header {
    background: var(--navy);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 50;
    height: 64px;
}
.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.header-logo-mark {
    background: var(--teal);
    color: var(--white);
    font-family: 'DM Mono', monospace;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    letter-spacing: 0.04em;
}
.header-logo-text {
    color: var(--white);
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    font-weight: 600;
    letter-spacing: 0.02em;
}
.header-logo-sub {
    color: #7fa8cc;
    font-size: 0.75rem;
    font-weight: 400;
    display: block;
    margin-top: 1px;
}

/* Hamburger */
.hamburger {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    border-radius: 6px;
    transition: background 0.15s;
}
.hamburger:hover { background: rgba(255,255,255,0.1); }
.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--white);
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Dropdown nav */
.nav-menu {
    position: fixed;
    top: 64px;
    right: 0;
    background: var(--navy);
    border-top: 2px solid var(--teal);
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    min-width: 240px;
    display: none;
    flex-direction: column;
    z-index: 49;
}
.nav-menu.open { display: flex; }

/* Align dropdown with header content on wide screens */
@media (min-width: 1148px) {
    .nav-menu {
        right: calc((100vw - 1100px) / 2);
    }
}

.nav-menu a, .nav-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    color: #c8d8e8;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    background: none;
    border: none;
    font-family: inherit;
    cursor: pointer;
    width: 100%;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    transition: background 0.15s, color 0.15s;
}
.nav-menu a:last-child,
.nav-menu button:last-child { border-bottom: none; }
.nav-menu a:hover,
.nav-menu button:hover {
    background: rgba(255,255,255,0.08);
    color: var(--white);
}
.nav-menu a.active { color: var(--teal-light); }
.nav-menu .nav-icon { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; }
.nav-divider { height: 1px; background: rgba(255,255,255,0.1); margin: 4px 0; }

.recept-badge {
    margin-left: auto;
    background: var(--teal);
    color: var(--white);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

/* ─── Toevoegen banner ────────────────────────────────────── */
.toevoegen-banner {
    background: var(--teal);
    color: var(--white);
    padding: 12px 24px;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}
.toevoegen-banner a {
    color: var(--white);
    font-weight: 600;
    text-decoration: underline;
}

/* ─── Footer ──────────────────────────────────────────────── */
footer {
    background: var(--navy);
    color: #7fa8cc;
    padding: 0;
    font-size: 0.8rem;
    margin-top: auto;
}
.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}
.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.footer-logo-img {
    height: 36px;
    width: auto;
    display: block;
    background: var(--white);
    padding: 6px 12px;
    border-radius: 6px;
}
.footer-brand p {
    color: #5a7a99;
    font-size: 0.78rem;
    line-height: 1.5;
}
.footer-link {
    color: var(--teal-light);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    width: fit-content;
}
.footer-link:hover { text-decoration: underline; }
.footer-bottom {
    max-width: 1100px;
    margin: 0 auto;
    padding: 10px 24px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.76rem;
    color: #4a6478;
}
.footer-bottom a { color: #4a6478; text-decoration: none; }
.footer-bottom a:hover { color: #7fa8cc; }

/* ─── Page layout ─────────────────────────────────────────── */
.page-main,
.page-main-narrow,
.page-main-medium {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 24px 0;
    box-sizing: border-box;
}

/* Alle kaarten: altijd 860px breed, nooit smaller */
.medicijn-card,
.voorschrift-card,
.acties,
.recept-card,
.intro,
.search-card,
.table-card {
    width: 100%;
    max-width: 860px;
    min-width: 0;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

/* ─── Cards ───────────────────────────────────────────────── */
.intro {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 16px;
    border-left: 4px solid var(--teal);
}
.intro h2 { font-size: 1rem; font-weight: 600; color: var(--navy); margin-bottom: 8px; }
.intro p  { font-size: 0.88rem; color: var(--text-muted); line-height: 1.6; }

/* ─── Search ──────────────────────────────────────────────── */
.search-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 16px;
}
.search-row { display: flex; gap: 10px; flex-wrap: wrap; }
.search-input-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
}
.search-input-wrap svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}
input[type="text"] {
    width: 100%;
    padding: 10px 12px 10px 38px;
    border: 1.5px solid var(--silver);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text);
    background: #f8fafc;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
input[type="text"]:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(14,140,122,0.12);
    background: var(--white);
}
input[type="text"]::placeholder { color: var(--text-muted); }

button[type="submit"] {
    padding: 10px 22px;
    background: var(--teal);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    white-space: nowrap;
}
button[type="submit"]:hover { background: var(--teal-light); }
button[type="submit"]:active { transform: scale(0.98); }

/* ─── Toolbar ─────────────────────────────────────────────── */
.toolbar {
    width: 100%;
    max-width: 860px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}
.result-count { font-size: 0.85rem; color: var(--text-muted); }
.result-count strong { color: var(--navy); font-weight: 600; }
.filter-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-wrap label { font-size: 0.85rem; font-weight: 500; color: var(--slate); white-space: nowrap; }

/* ─── Select ──────────────────────────────────────────────── */
select {
    padding: 8px 32px 8px 12px;
    border: 1.5px solid var(--silver);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--text);
    background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7e94' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
    appearance: none;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}
select:focus { border-color: var(--teal); }

/* ─── Table ───────────────────────────────────────────────── */
.table-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; min-width: 420px; }
thead tr { background: var(--navy); }
th {
    padding: 13px 16px;
    text-align: left;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #a8c4dd;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: color 0.15s;
}
th:hover { color: var(--white); }
th.sort-asc, th.sort-desc { color: var(--white); }
th .sort-icon { display: inline-block; margin-left: 6px; font-size: 0.7em; opacity: 0.5; }
th.sort-asc .sort-icon::after  { content: '▲'; opacity: 1; color: var(--teal-light); }
th.sort-desc .sort-icon::after { content: '▼'; opacity: 1; color: var(--teal-light); }
th:not(.sort-asc):not(.sort-desc) .sort-icon::after { content: '⇅'; }
tbody tr { border-bottom: 1px solid var(--silver); transition: background 0.15s; cursor: pointer; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--teal-pale); }
tbody tr:hover td:first-child { color: var(--teal); }
tbody tr td:last-child::after {
    content: '+ toevoegen aan recept';
    float: right;
    font-size: 0.75rem;
    color: var(--teal);
    opacity: 0;
    transition: opacity 0.15s;
    font-weight: 500;
}
tbody tr:hover td:last-child::after { opacity: 1; }
td { padding: 12px 16px; font-size: 0.9rem; color: var(--text); vertical-align: top; }
td:first-child { font-family: 'DM Mono', monospace; font-size: 0.85rem; color: var(--navy-mid); font-weight: 500; }
.trade-name { color: var(--teal); font-size: 0.8em; }
.no-results { text-align: center; padding: 48px 16px; color: var(--text-muted); font-size: 0.95rem; }
.no-results svg { display: block; margin: 0 auto 12px; opacity: 0.3; }

/* ─── Voorschrift form ────────────────────────────────────── */
.medicijn-card {
    background: var(--navy);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}
.medicijn-card .label { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #7fa8cc; margin-bottom: 6px; }
.medicijn-naam { font-family: 'DM Mono', monospace; font-size: 1.1rem; font-weight: 500; color: var(--white); margin-bottom: 4px; }
.medicijn-naam .trade { color: var(--teal-light); font-size: 0.85em; }
.medicijn-meta { font-size: 0.82rem; color: #a8c4dd; display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.medicijn-meta span + span::before { content: '·'; margin-right: 6px; opacity: 0.5; }

.voorschrift-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-section { width: 100%; padding: 20px 24px; border-bottom: 1.5px solid var(--silver); box-sizing: border-box; }
.card-section:last-child { border-bottom: none; }
.section-title { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 14px; }

.optioneel {
    font-size: 0.7rem; font-weight: 400; text-transform: none; letter-spacing: 0;
    color: var(--teal); background: var(--teal-pale); border: 1px solid #b2ddd7;
    border-radius: 10px; padding: 2px 8px; margin-left: 6px; vertical-align: middle;
}

.tooltip-wrap { position: relative; display: inline-block; margin-left: 6px; vertical-align: middle; }
.tooltip-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%; background: var(--slate);
    color: var(--white); font-size: 0.65rem; font-weight: 700; cursor: default;
}
.tooltip-tekst {
    display: none; position: absolute; bottom: calc(100% + 6px); left: 50%;
    transform: translateX(-50%); background: var(--navy); color: var(--white);
    font-size: 0.75rem; font-weight: 400; text-transform: none; letter-spacing: 0;
    line-height: 1.5; padding: 8px 12px; border-radius: 6px; width: 240px;
    white-space: normal; z-index: 10; box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.tooltip-tekst::after {
    content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
    border: 5px solid transparent; border-top-color: var(--navy);
}
.tooltip-wrap:hover .tooltip-tekst { display: block; }

.mode-btn {
    padding: 8px 16px; border: 1.5px solid var(--silver); border-radius: var(--radius);
    background: var(--white); color: var(--text-muted); font-family: inherit;
    font-size: 0.85rem; font-weight: 500; cursor: pointer; transition: all 0.2s;
}
.mode-btn:hover { border-color: var(--teal); color: var(--teal); }
.mode-btn.active { background: var(--navy); border-color: var(--navy); color: var(--white); }

.veld-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.veld { display: flex; flex-direction: column; gap: 5px; }
.veld label { font-size: 0.78rem; font-weight: 500; color: var(--slate); }
.veld select,
.veld input[type="number"],
.veld input[type="text"] {
    padding: 9px 12px; border: 1.5px solid var(--silver); border-radius: 6px;
    font-family: inherit; font-size: 0.9rem; color: var(--text); background: #f8fafc;
    outline: none; transition: border-color 0.2s, box-shadow 0.2s; appearance: none;
}
.veld select {
    background: #f8fafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7e94' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
    padding-right: 30px; cursor: pointer;
}
.veld select:focus,
.veld input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(14,140,122,0.10); background: var(--white); }
.veld input.fout { border-color: #c0392b; box-shadow: 0 0 0 3px rgba(192,57,43,0.10); }
.veld input[readonly] { background: var(--silver); cursor: default; color: var(--slate); }
.veld textarea {
    padding: 9px 12px; border: 1.5px solid var(--silver); border-radius: 6px;
    font-family: inherit; font-size: 0.9rem; color: var(--text); background: #f8fafc;
    outline: none; resize: vertical; transition: border-color 0.2s, box-shadow 0.2s; width: 100%;
}
.veld textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(14,140,122,0.10); background: var(--white); }

.duur-wrap { display: flex; align-items: center; gap: 8px; }
.duur-wrap input { flex: 1; }
.duur-wrap span { font-size: 0.9rem; color: var(--slate); white-space: nowrap; }

.toggle-wrap { display: flex; align-items: center; cursor: pointer; width: fit-content; }
.toggle-wrap input[type="checkbox"] { display: none; }
.toggle { width: 44px; height: 24px; background: var(--silver); border-radius: 12px; position: relative; transition: background 0.2s; flex-shrink: 0; }
.toggle::after { content: ''; position: absolute; width: 18px; height: 18px; background: var(--white); border-radius: 50%; top: 3px; left: 3px; transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.toggle-wrap input:checked + .toggle { background: var(--teal); }
.toggle-wrap input:checked + .toggle::after { transform: translateX(20px); }

.berekend-hint { margin-top: 8px; font-size: 0.78rem; color: var(--teal); display: none; }
.opiaat-sectie { background: #fdf6f0; border-bottom: 1.5px solid #f0d9c8; }

.preview-sectie { background: var(--teal-pale); border-top: 2px solid #b2ddd7; padding: 18px 24px; }
.preview-label { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--teal); margin-bottom: 12px; }
.preview-inhoud { display: flex; flex-direction: column; gap: 6px; }
.preview-regel { display: flex; gap: 12px; align-items: baseline; line-height: 1.5; }
.preview-code { font-family: 'DM Mono', monospace; font-size: 0.82rem; font-weight: 600; color: var(--teal); min-width: 28px; flex-shrink: 0; }
#previewRxTekst { font-size: 0.95rem; font-weight: 600; color: var(--navy); }
#previewDaTekst, #previewSTekst { font-size: 0.95rem; font-weight: 500; color: var(--navy); }

.acties { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; flex-direction: column; align-items: stretch; }
.acties .btn-teal { width: 100%; justify-content: center; padding: 12px; font-size: 0.95rem; }
.toevoegen-hint { font-size: 0.78rem; color: var(--text-muted); text-align: center; display: none; }

/* ─── Recept pagina ───────────────────────────────────────── */
.recept-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 24px; }
.recept-header { background: var(--navy); padding: 20px 24px 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.recept-header-block h3 { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #7fa8cc; margin-bottom: 8px; }
.recept-header-block p { font-size: 0.88rem; color: var(--white); line-height: 1.6; }
.recept-header-block p span { color: #a8c4dd; font-size: 0.8rem; }
.recept-datum { background: var(--teal); padding: 10px 24px; font-size: 0.82rem; color: var(--white); display: flex; justify-content: space-between; align-items: center; }

.voorschriften { padding: 20px 24px; }
.voorschriften-titel { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1.5px solid var(--silver); }
.voorschrift-item { background: #f8fafc; border: 1.5px solid var(--silver); border-radius: var(--radius); padding: 16px 16px 16px 20px; margin-bottom: 12px; position: relative; }
.voorschrift-item:last-child { margin-bottom: 0; }
.voorschrift-item.opiaat       { border-left: 4px solid #e07b39; padding-left: 16px; }
.voorschrift-item.pediatrisch  { border-left: 4px solid #2c5da8; padding-left: 16px; }
.voorschrift-item.handmatig    { border-left: 4px solid #c0392b; padding-left: 16px; }
.voorschrift-item.hoog-risico  { border-left: 4px solid #7b3fb5; padding-left: 16px; }
.opiaat-badge { display: inline-block; background: #fdf0e6; color: #a0522d; font-size: 0.68rem; font-weight: 600; padding: 2px 8px; border-radius: 10px; border: 1px solid #f0c8a0; margin-left: 8px; vertical-align: middle; }
.recept-type-badge { display: inline-block; font-size: 0.68rem; font-weight: 600; padding: 2px 8px; border-radius: 10px; margin-left: 6px; vertical-align: middle; }
.badge-pediatrisch  { background: #eef4ff; color: #2c5da8;  border: 1px solid #b0c8f0; }
.badge-handmatig    { background: #fdf0f0; color: #c0392b;  border: 1px solid #f0b0b0; }
.badge-hoog-risico  { background: #f5eeff; color: #7b3fb5;  border: 1px solid #cba8f0; }
.voorschrift-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.voorschrift-naam-recept { font-family: 'DM Mono', monospace; font-size: 0.9rem; font-weight: 500; color: var(--navy-mid); line-height: 1.4; }
.voorschrift-meta-recept { font-size: 0.78rem; color: var(--text-muted); font-family: 'DM Sans', sans-serif; font-weight: 400; margin-top: 2px; }
.voorschrift-nummer { background: var(--navy); color: var(--white); font-size: 0.7rem; font-weight: 600; padding: 3px 10px; border-radius: 12px; font-family: 'DM Sans', sans-serif; white-space: nowrap; flex-shrink: 0; }
.voorschrift-regels { display: flex; flex-direction: column; gap: 5px; }
.voorschrift-regel { display: flex; gap: 12px; align-items: baseline; line-height: 1.5; }
.regel-code { font-family: 'DM Mono', monospace; font-size: 0.78rem; font-weight: 600; color: var(--teal); min-width: 26px; flex-shrink: 0; }
.regel-tekst { font-size: 0.88rem; color: var(--text); line-height: 1.5; }
.regel-tekst.rx { font-weight: 600; color: var(--navy); }
.verwijder-btn { background: none; border: none; cursor: pointer; color: #c0392b; font-size: 1rem; line-height: 1; padding: 3px 7px; border-radius: 4px; transition: background 0.15s; flex-shrink: 0; }
.verwijder-btn:hover { background: #fdecea; }
.toevoegen-wrap { padding: 0 24px 20px; }
.add-btn { width: 100%; padding: 11px; border: 2px dashed var(--silver); border-radius: var(--radius); background: none; color: var(--text-muted); font-family: inherit; font-size: 0.88rem; font-weight: 500; cursor: pointer; transition: border-color 0.2s, color 0.2s; display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.add-btn:hover { border-color: var(--teal); color: var(--teal); }
.max-bereikt { text-align: center; padding: 10px; font-size: 0.82rem; color: var(--text-muted); font-style: italic; }
.leeg-melding { color: var(--text-muted); font-size: 0.88rem; padding: 8px 0 16px; font-style: italic; }

.recept-acties { width: 100%; max-width: 860px; margin: 0 auto; padding: 4px 0 32px; display: flex; justify-content: flex-end; gap: 8px; }

.ondertekend-banner { display: none; background: #eafaf1; border: 1.5px solid #a9dfbf; border-radius: var(--radius); padding: 14px 20px; margin: 0 24px 20px; align-items: center; gap: 12px; }
.ondertekend-banner.zichtbaar { display: flex; }
.ondertekend-banner .check { font-size: 1.4rem; flex-shrink: 0; }
.ondertekend-banner p { font-size: 0.88rem; color: #1e7e4a; line-height: 1.4; }
.ondertekend-banner p strong { font-weight: 600; }
.handtekening-preview { margin-top: 8px; border: 1px solid #a9dfbf; border-radius: 4px; background: white; max-width: 200px; }

/* ─── Modal ───────────────────────────────────────────────── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(15,41,66,0.6); z-index: 100; align-items: center; justify-content: center; padding: 16px; }
.modal-overlay.open { display: flex; }
.modal { background: var(--white); border-radius: var(--radius); box-shadow: 0 8px 40px rgba(0,0,0,0.25); width: 100%; max-width: 520px; overflow: hidden; }
.modal-header { background: var(--navy); padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; }
.modal-header h2 { color: var(--white); font-size: 1rem; font-weight: 600; }
.modal-close { background: none; border: none; color: #a8c4dd; font-size: 1.3rem; cursor: pointer; line-height: 1; padding: 2px 6px; border-radius: 4px; transition: color 0.15s; }
.modal-close:hover { color: var(--white); }
.modal-body { padding: 20px; }
.modal-body p { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 16px; line-height: 1.5; }
.controlelijst { list-style: none; margin-bottom: 20px; display: flex; flex-direction: column; gap: 8px; }
.controlelijst li { display: flex; align-items: flex-start; gap: 10px; font-size: 0.88rem; color: var(--text); line-height: 1.4; }
.controlelijst li input[type="checkbox"] { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--teal); cursor: pointer; flex-shrink: 0; }
.controlelijst li label { cursor: pointer; }
.handtekening-wrap { margin-bottom: 16px; }
.handtekening-label { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
.canvas-container { position: relative; border: 1.5px solid var(--silver); border-radius: var(--radius); overflow: hidden; background: #fafcff; cursor: crosshair; }
.canvas-container canvas { display: block; width: 100%; height: 140px; touch-action: none; }
.canvas-hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 0.82rem; color: #c0ccd8; pointer-events: none; transition: opacity 0.2s; }
.canvas-wis { margin-top: 6px; background: none; border: none; font-family: inherit; font-size: 0.78rem; color: var(--text-muted); cursor: pointer; padding: 0; text-decoration: underline; }
.canvas-wis:hover { color: #c0392b; }
.modal-footer { padding: 14px 20px; background: #f8fafc; border-top: 1.5px solid var(--silver); display: flex; gap: 10px; justify-content: flex-end; }

/* ─── Print ───────────────────────────────────────────────── */
@media print {
    body { background: white; }
    header, footer, .no-print, .modal-overlay { display: none !important; }
    main { padding: 0; }
    .recept-card { box-shadow: none; border: 1px solid #ccc; }
    .voorschrift-item { break-inside: avoid; }
    .ondertekend-banner { display: flex !important; border: 1px solid #aaa; }
}

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .header-logo-sub { display: none; }
}

@media (max-width: 540px) {
    .header-inner        { padding: 0 16px; }
    .page-main,
    .page-main-narrow,
    .page-main-medium    { padding: 16px 16px 0; }
    .recept-header       { grid-template-columns: 1fr; }
    .recept-acties       { padding: 4px 16px 24px; }
    .search-card         { padding: 14px; }
    .medicijn-card       { padding: 16px; }
    .card-section        { padding: 16px; }
    .veld-grid           { grid-template-columns: 1fr 1fr; }
    .preview-sectie      { padding: 14px 16px; }
    .toolbar             { flex-direction: column; align-items: flex-start; }
    th                   { padding: 11px 12px; font-size: 0.72rem; }
    td                   { padding: 10px 12px; font-size: 0.85rem; }
    tbody tr td:last-child::after { display: none; }
    .voorschriften       { padding: 16px; }
    .toevoegen-wrap      { padding: 0 16px 16px; }
    .footer-inner,
    .footer-bottom       { padding-left: 16px; padding-right: 16px; }
}