/* ============ RO International CRM — stylesheet ============
   Huisstijl overgenomen van rointernational.pl:
   - Monument Grotesk (regular 400 / medium 500)
   - warm gebroken wit #ece9df, antraciet #353330, okergeel accent #efbf3c
*/
@font-face {
  font-family: "Monument Grotesk";
  src: url("../fonts/MonumentGrotesk-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Monument Grotesk";
  src: url("../fonts/MonumentGrotesk-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --accent: #efbf3c;            /* brand yellow */
  --accent-dark: #e0ad22;
  --accent-ink: #353330;        /* tekst op geel */
  --accent-light: #f8ecc9;
  --sidebar-bg: #353330;        /* grey-950 */
  --sidebar-hover: #504e4a;     /* grey-900 */
  --bg: #ece9df;                /* grey-200 */
  --card: #ffffff;
  --border: #dedbd4;            /* grey-300 */
  --border-strong: #cfcdca;     /* grey-400 */
  --text: #353330;
  --muted: #86837a;             /* grey-700 */
  --green: #0e9f6e;
  --orange: #b45309;
  --red: #b91c1c;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(53, 51, 48, .07);
  --shadow-lg: 0 10px 40px rgba(53, 51, 48, .22);
}

html, body { height: 100%; }
body {
  font-family: "Monument Grotesk", "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.app { display: flex; height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: 236px; min-width: 236px;
  background: var(--sidebar-bg);
  color: #dedbd4;
  display: flex; flex-direction: column;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 18px; border-bottom: 1px solid rgba(236,233,223,.12); }
.brand-logo-img { height: 40px; width: auto; display: block; }
.brand-text { min-width: 0; }
.brand-name { color: #ece9df; font-weight: 500; font-size: 14px; }
.brand-sub { font-size: 11px; color: #9e9c95; margin-top: 1px; }
.nav { flex: 1; padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 8px;
  color: #cfcdca; text-decoration: none; font-size: 13.5px;
  transition: background .12s, color .12s;
}
.nav-item svg { width: 18px; height: 18px; fill: currentColor; opacity: .8; }
.nav-item:hover { background: var(--sidebar-hover); color: #fff; text-decoration: none; }
.nav-item.active { background: var(--accent); color: var(--accent-ink); font-weight: 500; }
.nav-item.active svg { opacity: 1; }
.sidebar-footer { padding: 14px 18px; font-size: 11px; color: #86837a; border-top: 1px solid rgba(236,233,223,.12); }

/* ---------- Topbar ---------- */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 60px; min-height: 60px;
  background: var(--card); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
  padding: 0 22px;
}
.search-wrap { position: relative; flex: 1; max-width: 460px; }
.search-icon { position: absolute; left: 10px; top: 8px; width: 17px; height: 17px; fill: var(--muted); }
#global-search {
  width: 100%; padding: 8px 12px 8px 34px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 13.5px; background: var(--bg); outline: none; color: var(--text);
  font-family: inherit;
}
#global-search:focus { border-color: var(--accent-dark); background: #fff; }
.search-results {
  position: absolute; top: 44px; left: 0; right: 0; z-index: 60;
  background: #fff; border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); max-height: 420px; overflow-y: auto;
}
.search-group-title { padding: 8px 14px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 500; }
.search-item { display: block; padding: 8px 14px; cursor: pointer; text-decoration: none; color: var(--text); }
.search-item:hover { background: var(--accent-light); text-decoration: none; }
.search-item .sub { font-size: 12px; color: var(--muted); }
.search-empty { padding: 14px; color: var(--muted); }

/* Taalwissel */
.lang-switch {
  display: flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden;
}
.lang-switch button {
  border: none; background: #fff; padding: 7px 11px; font-size: 12px; font-weight: 500;
  color: var(--muted); cursor: pointer; font-family: inherit; transition: all .12s;
}
.lang-switch button + button { border-left: 1px solid var(--border); }
.lang-switch button:hover { background: #faf9f5; color: var(--text); }
.lang-switch button.active { background: var(--sidebar-bg); color: #ece9df; }

/* ---------- Layout / view ---------- */
.view { flex: 1; overflow-y: auto; padding: 22px; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.page-title { font-size: 22px; font-weight: 500; letter-spacing: -.2px; }
.page-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.grid { display: grid; gap: 16px; }
.grid-kpi { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px; }
.card-title { font-weight: 500; font-size: 14.5px; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; }
.card-title a { font-size: 12.5px; font-weight: 400; }

/* KPI tiles */
.kpi { padding: 16px 18px; }
.kpi-label { font-size: 11.5px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .5px; }
.kpi-value { font-size: 25px; font-weight: 500; margin-top: 6px; letter-spacing: -.3px; }
.kpi-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.kpi-accent { border-top: 3px solid var(--accent); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  text-align: left; padding: 10px 14px; font-size: 11px; text-transform: uppercase;
  letter-spacing: .5px; color: var(--muted); border-bottom: 1px solid var(--border);
  white-space: nowrap; font-weight: 500;
}
table.data td { padding: 11px 14px; border-bottom: 1px solid #f1efe8; vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr { cursor: pointer; transition: background .1s; }
table.data tbody tr:hover { background: #faf9f5; }
table.data tr.no-link { cursor: default; }
.td-main { font-weight: 500; }
.td-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
th.num { text-align: right; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block; padding: 3px 9px; border-radius: 20px;
  font-size: 11.5px; font-weight: 500; white-space: nowrap;
}
.badge.b-slate  { background: #ece9df; color: #6b6962; }
.badge.b-blue   { background: #dbe7f5; color: #1d4f8f; }
.badge.b-cyan   { background: #d5eef0; color: #0e6a74; }
.badge.b-green  { background: #cef5ca; color: #114e0b; }
.badge.b-orange { background: #f8ecc9; color: #815e0b; }
.badge.b-red    { background: #f8e4e4; color: #8f1d1d; }
.badge.b-purple { background: #e9e4f5; color: #55388f; }
.badge.b-pink   { background: #f5e0eb; color: #94275e; }
.badge.b-navy   { background: #e0e3f0; color: #333e7a; }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }

/* Offertenummer-label */
.kcard-quote {
  display: inline-block; padding: 1px 8px; border-radius: 5px;
  background: var(--bg); border: 1px solid var(--border);
  color: #504e4a; font-size: 11.5px; font-weight: 500;
  font-variant-numeric: tabular-nums; letter-spacing: .3px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 15px; border-radius: 8px; border: 1px solid var(--border-strong);
  background: #fff; color: var(--text); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all .12s; text-decoration: none; font-family: inherit;
}
.btn:hover { background: #faf9f5; border-color: #b6b4b0; text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-danger { color: var(--red); }
.btn-danger:hover { background: #f8e4e4; border-color: #ecc8c8; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--bg); }

/* Filter pills */
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill {
  padding: 6px 13px; border-radius: 20px; border: 1px solid var(--border-strong);
  background: #fff; font-size: 12.5px; font-weight: 500; cursor: pointer; color: var(--muted);
  font-family: inherit; transition: all .12s;
}
.pill:hover { border-color: var(--accent-dark); color: var(--text); }
.pill.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

input.input, select.input, textarea.input {
  width: 100%; padding: 8px 11px; border: 1px solid var(--border-strong); border-radius: 8px;
  font-size: 13.5px; font-family: inherit; outline: none; background: #fff; color: var(--text);
}
input.input:focus, select.input:focus, textarea.input:focus { border-color: var(--accent-dark); }
textarea.input { resize: vertical; min-height: 70px; }
.input-inline { width: auto; }

/* ---------- Kanban ---------- */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 10px; align-items: flex-start; }
.kanban-col {
  min-width: 268px; width: 268px; flex-shrink: 0;
  background: #e2ded2; border-radius: var(--radius); padding: 10px;
}
.kanban-col-header { display: flex; justify-content: space-between; align-items: center; padding: 2px 6px 10px; }
.kanban-col-title { font-weight: 500; font-size: 13px; }
.kanban-col-meta { font-size: 11.5px; color: #6b6962; font-variant-numeric: tabular-nums; }
.kanban-cards { display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.kanban-col.drag-over { outline: 2px dashed var(--accent-dark); outline-offset: -2px; background: #ded6bd; }
.kcard {
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  padding: 11px 12px; cursor: pointer; box-shadow: var(--shadow);
}
.kcard:hover { border-color: #b6b4b0; }
.kcard.dragging { opacity: .45; }
.kcard-title { font-weight: 500; font-size: 13px; line-height: 1.35; }
.kcard-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.kcard-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 9px; gap: 6px; }
.kcard-value { font-weight: 500; font-size: 12.5px; }
.kcard-tag { font-size: 11px; color: var(--muted); }

/* ---------- Planning ---------- */
.planning-grid { display: grid; border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; background: #fff; }
.pg-cell { border-right: 1px solid #f1efe8; border-bottom: 1px solid #f1efe8; min-height: 74px; padding: 5px; position: relative; }
.pg-cell:hover { background: #faf9f5; }
.pg-cell.droppable.drag-over { background: var(--accent-light); outline: 2px dashed var(--accent-dark); outline-offset: -2px; }
.pg-head {
  background: #f6f4ee; font-weight: 500; font-size: 12.5px; padding: 9px 10px;
  border-right: 1px solid #f1efe8; border-bottom: 1px solid var(--border);
  text-align: center; min-height: 0;
}
.pg-head.today { color: #815e0b; }
.pg-head .d { font-size: 11px; color: var(--muted); font-weight: 400; display: block; }
.pg-emp {
  background: #f6f4ee; padding: 9px 12px; border-right: 1px solid var(--border); border-bottom: 1px solid #f1efe8;
  display: flex; align-items: center; gap: 8px; min-height: 74px;
}
.pg-emp-name { font-weight: 500; font-size: 13px; }
.pg-emp-role { font-size: 11px; color: var(--muted); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; color: #fff; font-size: 11.5px; font-weight: 500;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.asg {
  border-radius: 6px; padding: 5px 7px; font-size: 11.5px; margin-bottom: 4px;
  cursor: pointer; color: #fff; line-height: 1.3; overflow: hidden;
}
.asg .t { font-weight: 500; }
.asg .s { opacity: .85; font-size: 10.5px; }
.asg.afgerond { opacity: .55; }
.asg.gepland { background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.13) 0 6px, transparent 6px 12px); }
.pg-add {
  position: absolute; right: 4px; bottom: 3px; width: 20px; height: 20px; border-radius: 5px;
  border: none; background: transparent; color: #b6b4b0; font-size: 15px; cursor: pointer;
  display: none; align-items: center; justify-content: center; line-height: 1;
}
.pg-cell:hover .pg-add { display: flex; }
.pg-add:hover { background: var(--accent); color: var(--accent-ink); }
.cell-today { background: #fdf9ec; }

/* ---------- Detailpagina ---------- */
.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .detail-grid { grid-template-columns: 1fr; } }
.prop-list { display: grid; grid-template-columns: 130px 1fr; gap: 7px 12px; font-size: 13.5px; }
.prop-list dt { color: var(--muted); }
.prop-list dd { font-weight: 400; word-break: break-word; }
.backlink { font-size: 13px; color: var(--muted); text-decoration: none; display: inline-block; margin-bottom: 8px; }
.backlink:hover { color: var(--text); }

/* Status-stepper */
.stepper { display: flex; gap: 4px; flex-wrap: wrap; margin: 4px 0 2px; }
.step {
  padding: 6px 12px; font-size: 12px; font-weight: 500; background: var(--bg); color: var(--muted);
  border: none; cursor: pointer; border-radius: 6px; font-family: inherit; transition: all .12s;
}
.step.done { background: #f3e3b0; color: #5e5515; }
.step.current { background: var(--accent); color: var(--accent-ink); }
.step:hover:not(.current) { background: var(--border); color: var(--text); }
.step.done:hover { background: #eeda99; }

/* Timeline / activiteiten */
.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-item { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid #f1efe8; }
.tl-item:last-child { border-bottom: none; }
.tl-icon {
  width: 30px; height: 30px; border-radius: 50%; background: #f5f0de;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 13px;
}
.tl-body { flex: 1; min-width: 0; }
.tl-desc { font-size: 13px; line-height: 1.45; }
.tl-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.tl-item.task-done .tl-desc { text-decoration: line-through; color: var(--muted); }
.tl-actions { display: flex; gap: 4px; align-items: flex-start; }

/* Vertaling van ingevoerde tekst */
.tr-text { white-space: pre-wrap; }
.tr-btn {
  border: none; background: transparent; cursor: pointer; padding: 0 3px;
  font-size: 12px; line-height: 1; opacity: .45; vertical-align: baseline;
  font-family: inherit; margin-left: 4px;
}
.tr-btn:hover { opacity: 1; }
.tr-btn:disabled { cursor: wait; }
.tr-wrap.translated .tr-text { color: #504e4a; font-style: italic; }

/* Productie-voortgang */
.prog { height: 7px; background: var(--border); border-radius: 4px; overflow: hidden; min-width: 70px; }
.prog > div { height: 100%; background: var(--green); border-radius: 4px; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(53, 51, 48, .55); z-index: 100;
  display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px;
  overflow-y: auto;
}
.modal {
  background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px; animation: modal-in .15s ease-out;
}
.modal.modal-lg { max-width: 760px; }
@keyframes modal-in { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-title { font-weight: 500; font-size: 15.5px; }
.modal-close { border: none; background: none; font-size: 20px; cursor: pointer; color: var(--muted); padding: 2px 6px; border-radius: 6px; }
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-body { padding: 18px 20px; }
.modal-footer { display: flex; justify-content: space-between; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); }
.modal-footer .right { display: flex; gap: 8px; margin-left: auto; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 4px; }

/* ---------- Toast ---------- */
#toast-root { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--sidebar-bg); color: #ece9df; padding: 11px 16px; border-radius: 8px;
  box-shadow: var(--shadow-lg); font-size: 13px; animation: toast-in .2s ease-out; max-width: 380px;
}
.toast.error { background: #8f1d1d; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Diversen ---------- */
a { color: #504e4a; text-decoration: underline; text-decoration-color: rgba(80,78,74,.35); text-underline-offset: 2px; }
a:hover { color: #353330; text-decoration-color: currentColor; }
.card-title a, .backlink, .search-item, .nav-item { text-decoration: none; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.empty-state { padding: 34px; text-align: center; color: var(--muted); font-size: 13.5px; }
.mt { margin-top: 16px; }
.mb-sm { margin-bottom: 8px; }
.flex { display: flex; align-items: center; gap: 8px; }
.spread { justify-content: space-between; }
.value-strong { font-weight: 500; font-variant-numeric: tabular-nums; }
.deadline-late { color: var(--red); font-weight: 500; }
.deadline-soon { color: var(--orange); font-weight: 500; }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #b6b4b0; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #9e9c95; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Workflow (Contacten → Offertes → Order → Montage) ---------- */
.nav-flow { padding: 12px 12px 4px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; color: #86837a; font-weight: 500; }
.nav-step {
  width: 18px; height: 18px; border-radius: 50%; font-size: 10.5px; font-weight: 500; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(236,233,223,.12); color: #cfcdca; margin-right: -3px;
}
.nav-step:empty { visibility: hidden; }
.nav-item.active .nav-step { background: var(--accent-ink); color: var(--accent); }
.workflow { display: flex; align-items: stretch; gap: 8px; flex-wrap: wrap; }
.wf-step {
  flex: 1; min-width: 180px; display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px;
  text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: border-color .12s;
}
.wf-step:hover { border-color: var(--accent-dark); text-decoration: none; }
.wf-num {
  width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  font-weight: 500; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.wf-title { font-weight: 500; font-size: 14px; }
.wf-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.wf-arrow { align-self: center; color: var(--muted); font-size: 18px; }
@media (max-width: 900px) { .wf-arrow { display: none; } }

/* Aannemers op een aanvraag */
.bidder {
  display: inline-block; padding: 2px 8px; border-radius: 5px; font-size: 11.5px; margin: 1px 0;
  background: var(--bg); border: 1px solid var(--border); color: #504e4a; white-space: nowrap;
}
.bidder.gewonnen { background: #cef5ca; border-color: #a9e2a3; color: #114e0b; font-weight: 500; }
.bidder.verloren { opacity: .5; text-decoration: line-through; }
.bidder.onderhandeling { border-color: #c7b7ea; background: #e9e4f5; color: #55388f; }

.step.lost { background: #f8e4e4; color: #8f1d1d; }
a.pill { text-decoration: none; display: inline-flex; align-items: center; }
.field-hint { font-size: 11.5px; color: var(--muted); margin-top: 4px; line-height: 1.4; }
.field-info { font-size: 12.5px; }
