/* Beheeromgeving — hergebruikt tokens en lettertypen uit styles.css */
body.admin{padding-bottom:0;background:#f4f1ea}
[hidden]{display:none!important}

/* Inloggen */
.login{min-height:100dvh;display:grid;place-items:center;padding:var(--gutter)}
.login-card{width:min(100%,400px);background:#fff;border:1px solid var(--line);padding:36px 28px;display:grid;gap:12px;box-shadow:var(--shadow)}
.login-card h1{font-size:2.25rem;margin-top:14px}
.login-lede{color:var(--muted);margin-bottom:8px}
.login-card label{font-size:.875rem;font-weight:700}
.login-card input[type=password],.login-card input[type=email]{width:100%;min-height:50px;padding:0 14px;border:1px solid #cfc9ba;border-radius:2px;background:#fff;font-size:1rem}
.login-card input[type=password]:focus,.login-card input[type=email]:focus{outline:0;border-color:var(--rust);box-shadow:0 0 0 3px rgba(169,83,47,.18)}
.remember{display:flex;align-items:center;gap:10px;font-weight:400!important;color:var(--muted);min-height:36px}
.remember input{width:18px;height:18px}
.login-error{min-height:20px;color:#a32a18;font-weight:600;font-size:.875rem}

/* Balk */
.admin-bar{background:var(--ink);color:#fff;position:sticky;top:0;z-index:20}
.admin-bar-inner{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;width:min(1280px,calc(100% - var(--gutter) * 2));margin-inline:auto;padding:12px 0}
.admin-bar .logo{font-size:1.375rem}
.admin-tag{margin-left:8px;padding:3px 9px;border:1px solid rgba(255,255,255,.35);font-family:var(--sans);font-size:.6875rem;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:#d6b787}
.admin-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.updated{font-size:.8125rem;color:#aab6ac;margin-right:4px}
.btn{min-height:40px;padding:0 14px;border:1px solid rgba(255,255,255,.3);background:transparent;color:#fff;font-size:.875rem;font-weight:600;cursor:pointer;border-radius:2px;transition:background .2s}
.btn:hover{background:rgba(255,255,255,.12)}
.btn-quiet{border-color:transparent;color:#aab6ac}

.admin-main{width:min(1280px,calc(100% - var(--gutter) * 2));margin:24px auto 64px;display:grid;gap:20px}

/* Statistieken = filters */
.stats{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}
.stat{display:grid;gap:2px;text-align:left;padding:14px 16px;background:#fff;border:1px solid var(--line);cursor:pointer;transition:border-color .2s,box-shadow .2s;font:inherit;color:inherit}
.stat:hover{border-color:var(--ink)}
.stat[aria-pressed="true"]{border-color:var(--rust);box-shadow:0 0 0 1px var(--rust)}
.stat strong{font-family:var(--serif);font-size:1.75rem;line-height:1.1}
.stat span{font-size:.8125rem;color:var(--muted);text-transform:uppercase;letter-spacing:.1em}

/* Zoeken */
.toolbar{display:grid;gap:10px}
.search input,.select select{width:100%;min-height:48px;padding:0 14px;border:1px solid #cfc9ba;border-radius:2px;background:#fff;font-size:1rem}
.search input:focus,.select select:focus{outline:0;border-color:var(--rust);box-shadow:0 0 0 3px rgba(169,83,47,.18)}
.state{color:var(--muted);min-height:20px}
.state.error{color:#a32a18;font-weight:600}

/* Status */
.status-select{min-height:38px;padding:0 8px;border:1px solid #cfc9ba;border-radius:2px;background:#fff;font-size:.875rem;font-weight:600;max-width:100%}

/* Kaarten (telefoon) */
.cards{list-style:none;margin:0;padding:0;display:grid;gap:12px}
.card{background:#fff;border:1px solid var(--line);padding:16px;display:grid;gap:10px}
.card-top{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.card h3{font-family:var(--serif);font-size:1.25rem}
.card small{color:var(--muted)}
.card .meta{display:grid;gap:2px;font-size:.9375rem}
.card-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.card.is-new{border-left:4px solid var(--rust)}

/* Tabel (desktop) */
.table-wrap{background:#fff;border:1px solid var(--line);overflow-x:auto}
.orders{width:100%;border-collapse:collapse;font-size:.9375rem}
.orders th{text-align:left;padding:12px 16px;font-size:.75rem;text-transform:uppercase;letter-spacing:.1em;color:var(--muted);border-bottom:1px solid var(--line);background:#faf8f3;white-space:nowrap}
.orders td{padding:14px 16px;border-bottom:1px solid #eee9dd;vertical-align:middle}
.orders tr:last-child td{border-bottom:0}
.orders tbody tr{cursor:pointer;transition:background .15s}
.orders tbody tr:hover{background:#faf6ee}
.orders tr.is-new td:first-child{box-shadow:inset 4px 0 0 var(--rust)}
.orders .name{font-weight:700}
.orders .sub{display:block;color:var(--muted);font-size:.8125rem}
.link-btn{border:0;background:none;color:var(--rust);font-weight:700;cursor:pointer;min-height:36px;padding:0 6px}

/* Details */
.detail{width:min(560px,calc(100% - 24px));max-height:calc(100dvh - 24px);border:0;padding:0;background:var(--paper);box-shadow:0 24px 70px rgba(20,28,22,.35)}
.detail::backdrop{background:rgba(20,28,22,.55)}
.detail-close{position:absolute;right:8px;top:8px;margin:0}
.detail-close button{width:44px;height:44px;border:0;background:none;font-size:2rem;line-height:1;cursor:pointer;border-radius:50%}
.detail-close button:hover{background:rgba(31,42,36,.07)}
.detail-body{padding:28px 24px 26px;display:grid;gap:18px}
.detail-body h2{font-size:1.875rem;padding-right:40px}
.detail-meta{margin:0;display:grid}
.detail-meta>div{display:grid;grid-template-columns:120px 1fr;gap:12px;padding:10px 0;border-top:1px solid var(--line)}
.detail-meta dt{color:var(--muted);font-size:.8125rem;text-transform:uppercase;letter-spacing:.08em;padding-top:2px}
.detail-meta dd{margin:0;overflow-wrap:anywhere;font-weight:500}
.detail-actions{display:flex;flex-wrap:wrap;gap:8px}
.detail-actions .btn-dark,.btn-dark{display:inline-flex;align-items:center;min-height:44px;padding:0 16px;border:1px solid var(--ink);background:var(--ink);color:#fff;font-size:.9375rem;font-weight:600;cursor:pointer;border-radius:2px}
.btn-dark:hover{background:var(--ink-soft)}
.btn-line{display:inline-flex;align-items:center;min-height:44px;padding:0 16px;border:1px solid var(--ink);background:transparent;color:var(--ink);font-size:.9375rem;font-weight:600;cursor:pointer;border-radius:2px}
.btn-line:hover{background:var(--ink);color:#fff}
.detail-status{display:grid;gap:6px}
.detail-status label{font-size:.875rem;font-weight:700}
.detail-status select{min-height:48px;padding:0 12px;border:1px solid #cfc9ba;border-radius:2px;background:#fff;font-size:1rem}

/* Lijst / kaart */
.view-switch{display:inline-flex;border:1px solid #cfc9ba;background:#fff;border-radius:2px;justify-self:start}
.view-switch button{min-height:46px;padding:0 18px;border:0;background:none;font:inherit;font-weight:700;color:var(--muted);cursor:pointer}
.view-switch button[aria-pressed="true"]{background:var(--ink);color:#fff}
.orders td.muted{color:var(--muted)}
.card .delivery{color:#2f6b4f;font-weight:700}
.day-switch{display:grid;grid-template-columns:repeat(2,1fr);justify-self:stretch}
.day-switch button{padding:0 6px}
@media (min-width:480px){.day-switch{grid-template-columns:repeat(4,1fr)}}
.day-select.d-none{color:var(--muted)}
.day-select.d-zaterdag{background:#dbe7f3;border-color:#9fbbd6;color:#1d4a73}
.day-select.d-zondag{background:#efdcef;border-color:#cfa6cf;color:#6a2a6a}
.day-select.d-beide{background:#ece8de;color:#1f2a24}
.orders .row-note{max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-style:italic}
.card-note{color:var(--muted);font-style:italic}
.detail-notes textarea{width:100%;padding:10px 12px;border:1px solid #cfc9ba;border-radius:2px;background:#fff;font:inherit;font-size:1rem;resize:vertical}
.detail-customer summary{justify-self:start;list-style:none}
.detail-customer summary::-webkit-details-marker{display:none}
.detail-customer[open] summary{background:var(--ink);color:#fff}
.customer-form{display:grid;gap:12px;margin-top:8px}
.detail-notes textarea:focus{outline:0;border-color:var(--rust);box-shadow:0 0 0 3px rgba(169,83,47,.18)}
.day-pill{display:inline-block;padding:2px 9px;border-radius:99px;font-size:.75rem;font-weight:700;white-space:nowrap;background:#ece8de;color:#1f2a24}
.day-pill.d-zaterdag{background:#dbe7f3;color:#1d4a73}
.day-pill.d-zondag{background:#efdcef;color:#6a2a6a}

/* Kaart */
.map-view{display:grid;gap:10px}
.map{height:min(70dvh,640px);min-height:360px;border:1px solid var(--line);background:#e8e4da;z-index:0}
.map-legend{display:flex;flex-wrap:wrap;gap:6px 16px;margin:0;font-size:.875rem;color:var(--muted)}
.map-legend span{display:inline-flex;align-items:center;gap:6px}
.dot{width:12px;height:12px;border-radius:50%;border:2px solid #fff;box-shadow:0 0 0 1px #cfc9ba}
.dot.s-Nieuw{background:#a9532f}.dot.s-Bevestigd{background:#b08d57}.dot.s-Ingepland{background:#2f6b4f}.dot.s-Geleverd{background:#8a8f88}
.map-note{margin:0;color:var(--muted);font-size:.875rem;min-height:20px}
.map-popup{display:grid;gap:2px;font-family:var(--sans);font-size:.875rem;min-width:180px}
.map-popup strong{font-size:1rem}
.map-popup .link-btn{justify-self:start;padding:0;min-height:32px}

/* Leverdatum */
.delivery-row{display:flex;flex-wrap:wrap;gap:8px}
.delivery-row input{flex:1 1 220px;min-height:48px;padding:0 12px;border:1px solid #cfc9ba;border-radius:2px;background:#fff;font-size:1rem}
.delivery-row input:focus{outline:0;border-color:var(--rust);box-shadow:0 0 0 3px rgba(169,83,47,.18)}
.detail-delivery small{color:var(--muted);font-size:.8125rem}

/* Nieuwe bestelling */
.btn-accent{background:var(--rust);border-color:var(--rust)}
.btn-accent:hover{background:var(--rust-dark)}
.new-order fieldset{margin:0;padding:0;border:0;display:grid;gap:12px;min-width:0}
.new-order legend{padding:0;margin-bottom:4px;font-family:var(--serif);font-size:1.25rem}
.new-order .hint{font-family:var(--sans);font-size:.8125rem;font-weight:400;color:var(--muted)}
.new-order-lede{margin:-6px 0 0;color:var(--muted);font-size:.9375rem;line-height:1.5}
.new-order .field select{width:100%;min-height:50px;padding:0 12px;border:1px solid #cfc9ba;border-radius:2px;background:#fff;font-size:1rem}
.new-order .field-row{gap:12px}
.qty-list{display:grid;gap:8px}
.qty-row{display:grid;grid-template-columns:1fr 64px auto 84px;align-items:center;gap:8px;padding:8px 12px;background:#fff;border:1px solid var(--line)}
.qty-row label{font-weight:600}
.qty-row input{min-height:44px;width:100%;padding:0 10px;border:1px solid #cfc9ba;border-radius:2px;font-size:1rem;text-align:center}
.qty-row input:focus{outline:0;border-color:var(--rust);box-shadow:0 0 0 3px rgba(169,83,47,.18)}
.new-order-submit{justify-content:center;width:100%;min-height:52px}
#new-order{width:min(640px,calc(100% - 24px))}

/* Prijzen per bestelling */
.detail-label{font-size:.875rem;font-weight:700}
.price-row{display:grid;grid-template-columns:1fr 120px auto;align-items:center;gap:10px;font-size:.9375rem}
.price-row small{color:var(--muted);font-size:.8125rem;min-width:84px}
.price-field{display:flex;align-items:center;gap:6px;font-weight:600}
.price-field input{width:100%;min-height:42px;padding:0 10px;border:1px solid #cfc9ba;border-radius:2px;background:#fff;font-size:1rem;text-align:right}
.price-field input:focus{outline:0;border-color:var(--rust);box-shadow:0 0 0 3px rgba(169,83,47,.18)}
.price-summary{margin:4px 0 0;padding:10px 12px;background:#fff;border-left:3px solid #47734a;font-weight:600}
.price-summary.error{border-color:#a32a18;color:#a32a18}
.new-order-total{margin:0;font-weight:700}
.new-order-total:empty{display:none}

/* Verwijderen */
.detail-danger{padding-top:16px;border-top:1px solid var(--line)}
.btn-danger{min-height:44px;padding:0 16px;border:1px solid #b3321f;background:transparent;color:#a32a18;font-size:.9375rem;font-weight:600;cursor:pointer;border-radius:2px}
.btn-danger:hover{background:#a32a18;color:#fff}

/* Tabbladen */
.admin-tabs{display:flex;gap:4px;order:3;width:100%}
.admin-tabs button{flex:1;min-height:40px;padding:0 14px;border:1px solid rgba(255,255,255,.25);background:transparent;color:#aab6ac;font:inherit;font-size:.875rem;font-weight:700;cursor:pointer;border-radius:2px}
.admin-tabs button[aria-pressed="true"]{background:#fff;color:var(--ink);border-color:#fff}

/* Producten */
.products-head{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:16px}
.products-title{font-size:2rem}
.products-lede{margin-top:6px;color:var(--muted);max-width:640px;line-height:1.5}
.product-editors{display:grid;gap:16px}
.product-editor{display:grid;gap:18px;padding:18px;background:#fff;border:1px solid var(--line)}
.product-editor.is-hidden{background:#f7f4ed}
.product-editor.is-hidden .pe-preview{opacity:.55}
.product-editor.is-dirty{border-color:var(--rust);box-shadow:0 0 0 1px var(--rust)}
.product-editor.is-new{border-style:dashed}
.pe-image{display:grid;gap:8px;align-content:start}
.pe-preview{width:100%;aspect-ratio:4/3;object-fit:cover;background:#ece9e1}
.pe-upload{justify-content:center;cursor:pointer}
.pe-image-status{color:var(--muted);font-size:.8125rem}
.pe-fields{display:grid;gap:12px;min-width:0}
.pe-row{display:grid;gap:12px;align-items:start}
.pe-field{display:grid;gap:5px;min-width:0}
.pe-label{font-size:.8125rem;font-weight:700}
.pe-field small{color:var(--muted);font-size:.75rem}
.pe-field input,.pe-field textarea{width:100%;min-height:44px;padding:9px 12px;border:1px solid #cfc9ba;border-radius:2px;background:#fff;font:inherit;font-size:.9375rem}
.pe-field textarea{resize:vertical}
.pe-field input:focus,.pe-field textarea:focus{outline:0;border-color:var(--rust);box-shadow:0 0 0 3px rgba(169,83,47,.18)}
.pe-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;grid-column:1/-1;padding-top:14px;border-top:1px solid var(--line)}
.pe-toggle{display:inline-flex;align-items:center;gap:10px;font-weight:600;min-height:44px;cursor:pointer}
.pe-toggle input{width:20px;height:20px;accent-color:var(--rust)}
.pe-buttons{display:flex;gap:8px}
.pe-move{width:44px;justify-content:center;padding:0;font-size:1.125rem}
.pe-move:disabled{opacity:.35;cursor:default}
.pe-move:disabled:hover{background:transparent;color:var(--ink)}
.pe-message{width:100%;margin:0;font-size:.875rem;color:var(--muted)}
.pe-message:empty{display:none}
.pe-message.error{color:#a32a18;font-weight:600}

.toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);z-index:100;background:var(--ink);color:#fff;padding:12px 20px;font-size:.9375rem;box-shadow:var(--shadow);max-width:calc(100% - 32px)}

@media (min-width:640px){
  .pe-row{grid-template-columns:1fr 1fr}
  .pe-row-3{grid-template-columns:1fr 1fr 1fr}
  .new-order .field-row{grid-template-columns:1fr 1fr}
  .stats{grid-template-columns:repeat(3,1fr)}
  .toolbar{grid-template-columns:1fr 1fr}
}
@media (min-width:1100px){
  .toolbar{grid-template-columns:auto 1fr 220px 200px}
}
@media (min-width:900px){
  .admin-tabs{order:0;width:auto}
  .admin-tabs button{flex:none}
  .product-editor{grid-template-columns:240px 1fr}
  .stats{grid-template-columns:repeat(6,1fr)}
}

/* Tabel op desktop, kaarten op telefoon */
@media (max-width:899px){.table-wrap{display:none!important}}
@media (min-width:900px){.cards{display:none!important}}
