:root {
    color-scheme: light;
    font: 16px/1.5 system-ui, sans-serif;
    color: #172a22;
    background: #f3f5f0;
    --green: #24543a;
    --line: #cfd9cf;
    --muted: #4a5b51;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body, h1, h2, p { margin: 0; }
header { background: #132d22; color: white; }
.wrap { width: min(1120px, calc(100% - 32px)); margin-inline: auto; }
.top, .title, .actions, .tabs { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.top { justify-content: space-between; padding-block: .8rem; }
.top a { color: white; text-decoration: none; font-weight: 750; }
main { padding-block: 1.5rem 3rem; }
h1 { font-size: clamp(1.9rem, 5vw, 3rem); line-height: 1.1; letter-spacing: -.04em; overflow-wrap: anywhere; }
h2 { font-size: 1.2rem; }
.panel, .request { background: white; border: 1px solid var(--line); border-radius: .8rem; padding: 1rem; min-width: 0; }
.narrow { max-width: 40rem; }
.columns, .requests, .flow { display: grid; gap: .8rem; margin-top: 1rem; }
.columns { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.tabs { margin-bottom: 1.3rem; }
.tabs a, button, .button { min-height: 44px; display: inline-flex; align-items: center; padding: .5rem .85rem; border: 1px solid var(--line); border-radius: .5rem; background: white; color: #172a22; text-decoration: none; font: inherit; font-weight: 650; cursor: pointer; }
.tabs a[aria-current="page"], .primary { background: var(--green); color: white; border-color: var(--green); }
button:hover, a.button:hover, .tabs a:hover, .request:hover { border-color: var(--green); }
.request { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: .65rem 1rem; color: inherit; text-decoration: none; overflow-wrap: anywhere; }
.badge { display: inline-block; background: #e8f0e8; color: #27563e; border-radius: .35rem; padding: .16rem .45rem; font-size: .85rem; font-weight: 650; }
.overdue { background: #fceee8; color: #832e11; margin-left: .35rem; }
.muted, small, dt { color: var(--muted); font-size: .9rem; }
dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
dd { margin: 0; overflow-wrap: anywhere; }
.preserve { white-space: pre-wrap; overflow-wrap: anywhere; }
input, textarea, select { font: inherit; min-width: 0; width: 100%; padding: .52rem; border: 1px solid #74887a; border-radius: .4rem; color: inherit; background: white; }
input, select { min-height: 44px; }
textarea { resize: vertical; }
label { display: grid; gap: .2rem; font-weight: 650; }
.switch { display: flex; min-height: 44px; align-items: center; gap: .65rem; }
.switch input { width: 1.4rem; min-height: 1.4rem; accent-color: var(--green); }
.flow > button { justify-self: start; }
.spaced, .pagination, .title + .muted { margin-top: .75rem; }
.notice { padding: .65rem .85rem; background: #e8f0e8; border-radius: .5rem; margin-bottom: .85rem; }
.error { background: #fceee8; color: #832e11; }
.history { padding-left: 1.4rem; }
.history li + li { margin-top: .65rem; }
.history small { display: block; }
:focus-visible { outline: 3px solid #98610e; outline-offset: 3px; }
@media (max-width: 700px) { .columns { grid-template-columns: minmax(0, 1fr); } }

.quote-panel { margin-top: 1rem; max-width: 50rem; }
.quote-summary { list-style: none; padding: 0; }
.quote-summary li, .quote-totals div { display: flex; justify-content: space-between; gap: .75rem; padding: .5rem 0; border-top: 1px solid var(--line); }
.quote-summary li > div { min-width: 0; overflow-wrap: anywhere; }
.quote-summary li > strong { flex-shrink: 0; }
.quote-totals { display: block; max-width: 24rem; margin-left: auto; }
.quote-line { margin: 0; min-width: 0; border: 1px solid var(--line); border-radius: .6rem; padding: .7rem; }
.quote-line-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; margin-top: .65rem; }
.quote-line input:disabled { background: #e8f0e8; }
@media (max-width: 420px) { .quote-line-grid { grid-template-columns: minmax(0, 1fr); } }

.today-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; }
.list-group { margin-top: 1.2rem; min-width: 0; }
.today-groups .requests { margin-top: .55rem; }
.reply-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
#reageren { scroll-margin-top: 1rem; }
@media (max-width: 700px) { .today-groups { grid-template-columns: minmax(0, 1fr); gap: .5rem; } }
@media (max-width: 420px) { .reply-fields { grid-template-columns: minmax(0, 1fr); } }

.request-flow { display: grid; align-items: start; gap: .85rem; margin-top: 1rem; }
.handling-panel {
    background: #dcecdf;
    border-color: #9fbea6;
}
.handling-panel .response-step {
    background: #fff;
    border: 1px solid #a6c1ab;
    border-radius: .6rem;
    margin-top: 1rem;
    padding: .8rem;
}
.response-step h3 { margin: 0; font-size: 1rem; }
.date-field { display: grid; gap: .45rem; }
.date-actions { gap: .4rem; }
.request-details summary { font-weight: 650; cursor: pointer; }

.next-action { max-width: 46rem; overflow-wrap: anywhere; }

.portal-name { overflow-wrap: anywhere; min-width: 0; }
.header-tools, .request-toolbar, .demo-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .55rem;
}
.header-tools { max-width: 100%; }
.header-tools .header-tool {
    gap: .55rem;
    color: #fff;
    border-color: #537365;
    background: #234437;
    font-size: .9rem;
    font-weight: 650;
}
.header-tools .header-tool:hover { background: #355a4a; border-color: #8bad9a; }
.header-tools .header-tool[aria-current] { background: #e2efe5; border-color: #e2efe5; color: #173b2a; }
.search-icon {
    position: relative;
    width: .75rem;
    height: .75rem;
    margin-right: .18rem;
    border: 2px solid currentColor;
    border-radius: 50%;
}
.search-icon::after {
    content: "";
    position: absolute;
    top: .48rem;
    left: .47rem;
    width: .34rem;
    height: 2px;
    background: currentColor;
    transform: rotate(45deg);
    transform-origin: left center;
}
.settings-icon { font-size: 1.15rem; line-height: 1; }
.request-toolbar { justify-content: space-between; margin-bottom: 1rem; }
.request-toolbar .tabs { margin: 0; gap: .4rem; }
.add-request { gap: .4rem; }
.add-request span { font-size: 1.2rem; line-height: 1; }
.demo-strip { justify-content: space-between; font-size: .9rem; }
.demo-strip a { display: inline-flex; align-items: center; min-height: 32px; color: var(--green); font-weight: 650; }
.admin-tabs { margin-top: 1rem; }

.today-groups .list-group {
    padding: .9rem;
    border: 1px solid #afc8b3;
    border-radius: .8rem;
    background: #e3efe4;
}
.today-groups :is(#opvolgen, #gepland) { background: #f5eddd; border-color: #d6c5a5; }
.request-overview { border-color: #aebfb2; }
.next-action { background: #f5eddd; border: 1px solid #dcc9a6; }
.secondary-actions { background: #edf2eb; border-color: #bac9b9; }
.close-request { background: #fbf3ef; border-color: #e1cfc3; }

@media (max-width: 600px) {
    .portal-header .top { align-items: flex-start; flex-direction: column; }
    .header-tools { gap: .32rem; }
    .header-tools .header-tool { padding-inline: .5rem; gap: .4rem; }
    .request-toolbar { align-items: flex-start; flex-direction: column; }
    .request-toolbar .tabs a { padding-inline: .65rem; }
}

.request-heading { display: grid; gap: .75rem 1.1rem; align-items: start; }
.request-heading > div { min-width: 0; }
.request-heading .next-action { margin: 0; max-width: none; }
.detail-back.button { display: none; }
@media (max-width: 600px) {
    .detail-toolbar .tabs, .detail-toolbar .add-request { display: none; }
    .detail-toolbar .detail-back { display: inline-flex; }
}
.request-description { margin-top: .65rem; }
.request-actions, .request-context { min-width: 0; display: grid; gap: .85rem; }
@media (min-width: 900px) {
    .request-heading, .request-flow { grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr); }
    .request-flow { grid-template-areas: "overview actions" "context actions"; grid-template-rows: auto 1fr; gap: .85rem 1.1rem; }
    .request-overview { grid-area: overview; }
    .request-actions { grid-area: actions; }
    .request-context { grid-area: context; }
    .jump-to-reply { display: none; }
}

.quote-preview { background: #e8f0e8; margin-top: 1rem; }
.quote-preview summary { font-weight: 650; cursor: pointer; }
.quote-line.quick-price .quote-line-label,
.quote-line.quick-price .quote-line-unit { display: none; }
.quote-line.quick-price .quote-line-grid { grid-template-columns: minmax(0, 1fr); margin: 0; }
#quote-rate-picker label { flex: 1 1 15rem; min-width: 0; }

.customer-fields { margin-top: 0; padding: .8rem; background: #e8f0e8; border-radius: .5rem; }

.address-fields, .customer-picker {
    margin: 0;
    min-width: 0;
    padding: .8rem;
    border: 1px solid #afc8b3;
    border-radius: .6rem;
}
.address-fields legend, .customer-picker legend { padding-inline: .3rem; font-weight: 700; }
.address-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.address-fields > label { margin-block: .5rem; }
.customer-picker { display: grid; gap: .55rem; background: #edf4ed; }
.customer-option { display: flex; align-items: flex-start; gap: .6rem; background: #fff; padding: .55rem; border: 1px solid var(--line); border-radius: .45rem; }
.customer-option:has(input:checked) { border-color: var(--green); }
.customer-option input { width: 1.15rem; min-height: 1.15rem; margin-top: .2rem; accent-color: var(--green); flex-shrink: 0; }
.customer-option span { min-width: 0; overflow-wrap: anywhere; }
.customer-option small { display: block; font-weight: 400; }
@media (max-width: 470px) { .address-grid { grid-template-columns: minmax(0, 1fr); } }

.duplicate-review {
    display: grid;
    gap: .65rem;
    padding: .85rem;
    border: 1px solid #d6ba84;
    border-radius: .65rem;
    background: #fff6e3;
}
.duplicate-review h2 { color: #5b3e17; scroll-margin-top: 1rem; }
.duplicate-matches { display: grid; gap: .5rem; list-style: none; padding: 0; margin: 0; }
.duplicate-matches li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .4rem;
    padding: .6rem;
    border: 1px solid #ddc89d;
    border-radius: .45rem;
    background: white;
}
.duplicate-matches li > div { min-width: 0; overflow-wrap: anywhere; }
.duplicate-matches small { display: block; }
.duplicate-override { display: grid; justify-items: start; gap: .4rem; }
.duplicate-override button:disabled { opacity: .63; cursor: default; }
