:root {
  --brand: #2262a9;
  --brand-dark: #174879;
  --brand-soft: #edf5fc;
  --ink: #151b23;
  --muted: #667085;
  --line: #e3e8ef;
  --surface: #ffffff;
  --canvas: #f4f6f8;
  --success: #1f7a4d;
  --success-bg: #eaf7f0;
  --warning: #a8640a;
  --warning-bg: #fff4dd;
  --danger: #b42318;
  --danger-bg: #fff0ee;
  --radius: 16px;
  --shadow: 0 14px 34px rgba(17, 24, 39, .07);
  --sidebar: 278px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 15px; line-height: 1.55; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { font-size: clamp(1.75rem, 2.6vw, 2.45rem); letter-spacing: -.04em; line-height: 1.1; }
h2 { font-size: 1.4rem; letter-spacing: -.025em; }
h3 { font-size: 1.05rem; }
small, .text-muted { color: var(--muted); }

/* Auth */
.auth-page { min-height: 100vh; background: #fff; }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(390px, 1.05fr) minmax(460px, .95fr); }
.auth-brand-panel { position: relative; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; padding: 46px 64px; color: #fff; background: radial-gradient(circle at 80% 15%, rgba(255,255,255,.14), transparent 30%), linear-gradient(145deg, #123c67 0%, #2262a9 58%, #2c79c5 100%); }
.auth-brand-panel::after { content: ""; position: absolute; right: -140px; bottom: -200px; width: 520px; height: 520px; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; box-shadow: 0 0 0 70px rgba(255,255,255,.04), 0 0 0 140px rgba(255,255,255,.035); }
.auth-logo { position: relative; z-index: 1; width: 270px; padding: 13px 18px; border-radius: 12px; background: #fff; }
.auth-brand-copy { position: relative; z-index: 1; max-width: 610px; margin: auto 0; }
.auth-brand-copy h1 { max-width: 600px; margin: 14px 0 20px; font-size: clamp(2.6rem, 5vw, 5rem); color: #fff; }
.auth-brand-copy p { max-width: 560px; color: rgba(255,255,255,.82); font-size: 1.08rem; }
.eyebrow { display: inline-block; color: var(--brand); font-size: .76rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.auth-brand-panel .eyebrow { color: #b9daf7; }
.auth-benefits { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 18px 28px; color: rgba(255,255,255,.87); font-size: .9rem; }
.auth-form-panel { display: grid; place-items: center; padding: 48px; }
.login-card { width: min(100%, 480px); }
.login-heading { margin-bottom: 28px; }
.login-heading h2 { margin: 8px 0 10px; font-size: 2rem; }
.login-heading p { color: var(--muted); }
.login-help { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.login-help p { margin: 4px 0 0; color: var(--muted); }

/* Portal shell */
.portal-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 50; width: var(--sidebar); display: flex; flex-direction: column; padding: 22px 18px 18px; background: #fff; border-right: 1px solid var(--line); }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 5px 18px; }
.logo-link img { width: 210px; display: block; }
.sidebar-close { display: none; }
.sidebar-nav { display: flex; flex: 1; flex-direction: column; gap: 5px; padding-top: 10px; }
.nav-section { margin: 13px 12px 7px; color: #99a1ae; font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: 10px; color: #3c4655; font-weight: 650; transition: .16s ease; }
.nav-link > span { width: 22px; color: #818a98; text-align: center; font-weight: 800; }
.nav-link:hover { color: var(--brand); background: #f5f8fb; }
.nav-link.is-active { color: #fff; background: var(--brand); box-shadow: 0 7px 16px rgba(34,98,169,.23); }
.nav-link.is-active > span { color: #fff; }
.sidebar-support { margin: 15px 4px; padding: 17px; border-radius: 13px; background: var(--brand-soft); }
.sidebar-support strong { color: var(--brand-dark); }
.sidebar-support p { margin: 3px 0 7px; color: #61758d; font-size: .84rem; }
.sidebar-support a { font-weight: 750; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 14px 6px 2px; border-top: 1px solid var(--line); }
.avatar { display: grid; flex: 0 0 40px; width: 40px; height: 40px; place-items: center; border-radius: 50%; color: #fff; background: var(--brand); font-size: .78rem; font-weight: 800; }
.avatar-sm { width: 34px; height: 34px; min-width: 34px; }
.user-copy { min-width: 0; flex: 1; }
.user-copy strong, .user-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-copy strong { font-size: .87rem; }
.user-copy small { font-size: .75rem; }
.logout-button { padding: 7px; border: 0; color: var(--muted); background: transparent; font-size: 1.1rem; }
.portal-main { grid-column: 2; min-width: 0; display: flex; min-height: 100vh; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 34px; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.topbar-context span { color: var(--muted); font-size: .85rem; font-weight: 700; }
.topbar-actions { display: flex; align-items: center; gap: 13px; }
.menu-button { display: none; }
.content-area { width: 100%; max-width: 1540px; margin: 0 auto; flex: 1; padding: 34px; }
.portal-footer { display: flex; justify-content: space-between; gap: 20px; padding: 20px 34px; color: #8992a0; border-top: 1px solid var(--line); font-size: .78rem; }
.sidebar-backdrop { display: none; }

/* Headers and cards */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.page-header h1 { margin-bottom: 6px; }
.page-header p { margin: 0; color: var(--muted); }
.page-actions { display: flex; align-items: center; gap: 10px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 3px 10px rgba(17,24,39,.025); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { margin: 0; }
.card-body { padding: 22px; }
.card-footer { padding: 15px 22px; border-top: 1px solid var(--line); }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, .8fr); gap: 22px; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 17px; margin-bottom: 22px; }
.stat-card { display: flex; align-items: center; gap: 16px; min-height: 116px; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.stat-icon { display: grid; width: 50px; height: 50px; place-items: center; border-radius: 13px; color: var(--brand); background: var(--brand-soft); font-size: 1.25rem; font-weight: 800; }
.stat-value { display: block; font-size: 1.75rem; font-weight: 800; line-height: 1; }
.stat-label { display: block; margin-top: 5px; color: var(--muted); font-size: .84rem; }

/* Forms */
.form-stack { display: flex; flex-direction: column; gap: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 7px; color: #344054; font-size: .86rem; font-weight: 700; }
.field input, .field textarea, .field select, .input { width: 100%; min-height: 45px; padding: 10px 12px; color: var(--ink); background: #fff; border: 1px solid #ccd3dd; border-radius: 9px; outline: none; font-weight: 500; transition: border .15s, box-shadow .15s; }
.field textarea { min-height: 125px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus, .input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(34,98,169,.12); }
.field-note { color: var(--muted); font-size: .76rem; font-weight: 500; }
.password-field { position: relative; }
.password-field input { padding-right: 94px; }
.password-field button { position: absolute; top: 5px; right: 5px; bottom: 5px; padding: 0 12px; border: 0; border-radius: 7px; color: var(--brand); background: var(--brand-soft); font-size: .78rem; font-weight: 750; }
.checkbox { display: flex; align-items: center; gap: 9px; color: #44505f; font-size: .87rem; }
.checkbox input { width: 17px; height: 17px; accent-color: var(--brand); }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding-top: 5px; }
.search-form { display: flex; gap: 9px; }
.search-form .input { min-width: 280px; }

/* Buttons, badges, alerts */
.btn { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border: 1px solid transparent; border-radius: 9px; font-size: .86rem; font-weight: 750; line-height: 1.2; transition: transform .12s, background .15s, border .15s; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { color: #fff; background: var(--brand); }
.btn-primary:hover { color: #fff; background: var(--brand-dark); }
.btn-secondary { color: #344054; background: #fff; border-color: #cfd6df; }
.btn-secondary:hover { color: var(--brand); border-color: var(--brand); }
.btn-ghost { color: var(--brand); background: var(--brand-soft); }
.btn-danger { color: var(--danger); background: var(--danger-bg); }
.btn-sm { min-height: 34px; padding: 7px 11px; font-size: .78rem; }
.btn-lg { min-height: 50px; padding: 13px 20px; }
.btn-block { width: 100%; }
.icon-button { display: grid; width: 40px; height: 40px; place-items: center; padding: 0; border: 0; border-radius: 9px; background: transparent; font-size: 1.25rem; }
.icon-button:hover { background: #f1f4f7; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px; color: #4f5968; background: #eef1f4; font-size: .72rem; font-weight: 800; white-space: nowrap; }
.badge-open, .badge-in_progress { color: #17558f; background: #e9f3fc; }
.badge-paid, .badge-completed, .badge-resolved { color: var(--success); background: var(--success-bg); }
.badge-overdue, .badge-urgent, .badge-closed { color: var(--danger); background: var(--danger-bg); }
.badge-waiting_customer, .badge-delayed, .badge-high { color: var(--warning); background: var(--warning-bg); }
.badge-draft, .badge-planned, .badge-normal { color: #526071; background: #eef1f4; }
.alert { margin-bottom: 20px; padding: 13px 16px; border: 1px solid transparent; border-radius: 10px; font-weight: 650; }
.alert-success { color: var(--success); background: var(--success-bg); border-color: #c7e9d6; }
.alert-warning { color: #7a4b00; background: #fff8e6; border-color: #f0d58c; }
.alert-error { color: var(--danger); background: var(--danger-bg); border-color: #f4cac5; }

/* Tables and list items */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 12px 15px; color: #7a8493; background: #fafbfc; border-bottom: 1px solid var(--line); font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 14px 15px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fbfcfd; }
.cell-title { color: var(--ink); font-weight: 750; }
.cell-subtitle { display: block; margin-top: 2px; color: var(--muted); font-size: .78rem; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-icon { display: grid; flex: 0 0 42px; width: 42px; height: 42px; place-items: center; border-radius: 10px; color: var(--brand); background: var(--brand-soft); font-weight: 800; }
.list-copy { min-width: 0; flex: 1; }
.list-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-copy small { display: block; margin-top: 2px; }
.empty-state { padding: 46px 25px; color: var(--muted); text-align: center; }
.empty-state strong { display: block; margin-bottom: 5px; color: var(--ink); font-size: 1rem; }

/* Timelines, tickets and contacts */
.timeline { position: relative; display: flex; flex-direction: column; gap: 0; }
.timeline::before { content: ""; position: absolute; top: 20px; bottom: 20px; left: 17px; width: 2px; background: #dce3eb; }
.timeline-item { position: relative; display: grid; grid-template-columns: 36px 1fr; gap: 15px; padding: 0 0 24px; }
.timeline-dot { position: relative; z-index: 1; width: 36px; height: 36px; border: 7px solid #fff; border-radius: 50%; background: #a5afbc; box-shadow: 0 0 0 2px #dce3eb; }
.timeline-item.is-completed .timeline-dot { background: var(--success); box-shadow: 0 0 0 2px #bde2cd; }
.timeline-item.is-current .timeline-dot { background: var(--brand); box-shadow: 0 0 0 2px #b9d5ee; }
.timeline-content { padding: 3px 0 0; }
.timeline-content h3 { margin: 0 0 4px; }
.timeline-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 7px; color: var(--muted); font-size: .78rem; }
.project-section { margin-bottom: 24px; }
.project-section > h2 { margin: 0 0 14px; }
.contact-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.contact-card { padding: 21px; }
.contact-head { display: flex; align-items: center; gap: 13px; margin-bottom: 17px; }
.contact-head .avatar { width: 48px; height: 48px; flex-basis: 48px; }
.contact-head h3 { margin: 0; }
.contact-details { display: flex; flex-direction: column; gap: 9px; padding-top: 15px; border-top: 1px solid var(--line); }
.ticket-thread { display: flex; flex-direction: column; gap: 18px; }
.message { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 12px; }
.message-bubble { max-width: 820px; padding: 15px 17px; background: #fff; border: 1px solid var(--line); border-radius: 4px 15px 15px 15px; }
.message.staff .message-bubble { background: var(--brand-soft); border-color: #cfe2f4; }
.message.internal .message-bubble { background: var(--warning-bg); border-color: #f0d39c; }
.message-head { display: flex; justify-content: space-between; gap: 15px; margin-bottom: 8px; }
.message-head strong { font-size: .85rem; }
.message-head time { color: var(--muted); font-size: .75rem; }
.message-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.attachment { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; color: #42526a; background: #fff; border: 1px solid var(--line); border-radius: 8px; font-size: .78rem; font-weight: 700; }
.ticket-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; }
.ticket-meta { display: flex; flex-direction: column; gap: 14px; }
.meta-row { display: flex; justify-content: space-between; gap: 15px; padding-bottom: 11px; border-bottom: 1px solid var(--line); }
.meta-row:last-child { border-bottom: 0; }
.meta-row span:first-child { color: var(--muted); }
.reply-box { margin-top: 22px; }

/* Tabs, utilities */
.tabs { display: flex; gap: 5px; overflow-x: auto; margin-bottom: 22px; padding: 5px; background: #e9edf2; border-radius: 10px; }
.tab { padding: 8px 13px; color: #596575; border-radius: 7px; font-size: .82rem; font-weight: 750; white-space: nowrap; }
.tab:hover, .tab.is-active { color: var(--brand); background: #fff; }
.section-anchor { scroll-margin-top: 90px; }
.inline-form { display: flex; align-items: center; gap: 7px; }
.inline-form select, .inline-form input { min-height: 34px; padding: 6px 8px; border: 1px solid #cfd6df; border-radius: 7px; }
.kpi-highlight { color: var(--brand); }
.divider { height: 1px; margin: 20px 0; background: var(--line); }
.note { padding: 13px 15px; color: #51606f; background: #f6f8fa; border-left: 3px solid var(--brand); border-radius: 7px; font-size: .84rem; }

/* Error */
.error-page { min-height: 100vh; display: grid; place-items: center; padding: 25px; background: linear-gradient(145deg, #edf4fa, #fff); }
.error-card { width: min(100%, 560px); padding: 42px; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.brand-mark { display: grid; width: 62px; height: 62px; place-items: center; margin: 0 auto 18px; color: #fff; background: var(--brand); border-radius: 16px; font-weight: 900; }

@media (max-width: 1180px) {
  .stats-grid, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-grid, .ticket-layout { grid-template-columns: 1fr; }
  .auth-brand-panel { padding: 42px; }
}
@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand-panel { min-height: 360px; padding: 30px; }
  .auth-brand-copy { margin: 55px 0; }
  .auth-brand-copy h1 { font-size: 2.7rem; }
  .auth-benefits { display: none; }
  .auth-form-panel { padding: 40px 25px; }
  .portal-shell { display: block; }
  .sidebar { transform: translateX(-102%); box-shadow: 20px 0 45px rgba(17,24,39,.15); transition: transform .2s ease; }
  .sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-close, .menu-button { display: grid; }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 40; display: block; visibility: hidden; background: rgba(12,19,29,.45); opacity: 0; transition: opacity .2s; }
  .sidebar-open .sidebar-backdrop { visibility: visible; opacity: 1; }
  .portal-main { min-height: 100vh; }
  .topbar { padding: 0 20px; }
  .content-area { padding: 25px 20px; }
  .portal-footer { padding: 18px 20px; }
}
@media (max-width: 680px) {
  body { font-size: 14px; }
  .page-header { align-items: stretch; flex-direction: column; }
  .page-actions { flex-wrap: wrap; }
  .page-actions .btn { flex: 1; }
  .stats-grid, .grid-2, .grid-3, .grid-4, .form-grid, .contact-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 96px; }
  .content-area { padding: 22px 14px; }
  .card-head, .card-body { padding: 17px; }
  .portal-footer { align-items: flex-start; flex-direction: column; }
  .topbar-context { display: none; }
  .search-form { width: 100%; }
  .search-form .input { min-width: 0; }
  .hide-mobile { display: none !important; }
  .message { grid-template-columns: 32px minmax(0, 1fr); }
  .message .avatar { width: 32px; height: 32px; min-width: 32px; font-size: .65rem; }
  .message-head { flex-direction: column; gap: 2px; }
  .auth-brand-panel { min-height: 300px; }
  .auth-logo { width: 220px; }
  .auth-brand-copy h1 { font-size: 2.1rem; }
}
.max-w-900 { max-width: 900px; }
.max-w-960 { max-width: 960px; }
.max-w-980 { max-width: 980px; }
.mt-22 { margin-top: 22px; }
.mt-8 { margin-top: 8px; }
.mt-4 { margin-top: 4px; }
.mb-0 { margin-bottom: 0; }

/* Portaalgebruiker: automatische welkomstmail */
.info-note{padding:12px 14px;border:1px solid #d8e6f4;border-radius:9px;background:#eef6fd;color:#536170;font-size:13px;line-height:1.5}.info-note strong{color:#2c6fb4}

/* Destructive admin actions */
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 17px; border: 1px solid #f4cac5; border-radius: 10px; background: var(--danger-bg); }
.danger-zone strong { display: block; color: var(--danger); margin-bottom: 3px; }
.danger-zone p { margin: 0; color: #7a342d; font-size: .82rem; }
@media (max-width: 720px) { .danger-zone { align-items: stretch; flex-direction: column; } .danger-zone .btn { width: 100%; } }

/* Handmatig wachtwoordbeheer portaalgebruikers */
.portal-user-item { border-bottom: 1px solid var(--line); }
.portal-user-item:last-child { border-bottom: 0; }
.portal-user-item > .list-item { border-bottom: 0; padding-bottom: 10px; }
.password-admin { margin: 0 0 14px 56px; }
.password-admin summary { display: inline-flex; align-items: center; min-height: 34px; padding: 6px 10px; color: var(--brand); background: var(--brand-soft); border: 1px solid #d4e5f5; border-radius: 7px; font-size: .78rem; font-weight: 750; cursor: pointer; list-style: none; }
.password-admin summary::-webkit-details-marker { display: none; }
.password-admin summary::before { content: "🔑"; margin-right: 7px; font-size: .82rem; }
.password-admin[open] summary { color: var(--brand-dark); background: #e4f0fa; }
.password-admin-form { margin-top: 12px; padding: 15px; background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; }
.password-admin-form .form-actions { padding-top: 12px; }
@media (max-width: 680px) { .portal-user-item > .list-item { align-items: flex-start; flex-wrap: wrap; } .portal-user-item .row-actions { width: 100%; justify-content: flex-start; padding-left: 54px; flex-wrap: wrap; } .password-admin { margin-left: 54px; margin-right: 0; } }


/* Live projectzoeker planning (zonder select-dropdown) */
.project-picker { position: relative; }
.project-search-results { position: absolute; z-index: 30; top: 52px; right: 0; left: 0; max-height: 330px; overflow-y: auto; padding: 6px; background: #fff; border: 1px solid #cfd8e3; border-radius: 10px; box-shadow: 0 15px 35px rgba(17, 24, 39, .14); }
.project-search-result { display: flex; width: 100%; flex-direction: column; gap: 2px; padding: 11px 12px; color: var(--ink); background: transparent; border: 0; border-radius: 7px; text-align: left; }
.project-search-result:hover, .project-search-result.is-active { background: var(--brand-soft); }
.project-search-result-main { overflow: hidden; font-size: .86rem; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.project-search-result-meta { overflow: hidden; color: var(--muted); font-size: .75rem; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.project-search-empty { padding: 14px 12px; color: var(--muted); font-size: .8rem; font-weight: 500; text-align: center; }
.project-selected { display: flex; align-items: center; gap: 10px; margin-top: 9px; padding: 10px 11px; color: #344054; background: #f7fafc; border: 1px solid #d8e2ec; border-radius: 9px; }
.project-selected-icon { display: grid; flex: 0 0 28px; width: 28px; height: 28px; place-items: center; color: var(--success); background: var(--success-bg); border-radius: 50%; font-weight: 900; }
.project-selected > span:nth-child(2) { min-width: 0; flex: 1; }
.project-selected small, .project-selected strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-selected small { color: var(--muted); font-size: .68rem; font-weight: 600; }
.project-selected strong { color: var(--ink); font-size: .8rem; }
.project-selected-clear { padding: 5px 7px; color: var(--brand); background: transparent; border: 0; font-size: .74rem; font-weight: 750; }
.project-selected-clear:hover { color: var(--brand-dark); text-decoration: underline; }
@media (max-width: 680px) { .project-search-results { max-height: 280px; } }

/* Vaste contactpersonen: centraal beheer + toewijzing per klant */
.contact-manager-layout { grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr); }
.fixed-contact-list { display: flex; flex-direction: column; gap: 14px; }
.fixed-contact-row { padding: 16px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.fixed-contact-summary { display: flex; align-items: center; gap: 13px; }
.fixed-contact-copy { min-width: 0; flex: 1; }
.fixed-contact-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.fixed-contact-copy > small { display: block; margin-top: 3px; color: var(--muted); }
.fixed-contact-meta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 7px; font-size: .78rem; }
.fixed-contact-meta a { color: var(--brand); }
.fixed-contact-actions { flex-wrap: wrap; }
.fixed-contact-edit { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.fixed-contact-edit summary { display: inline-flex; align-items: center; min-height: 34px; padding: 6px 10px; color: var(--brand); background: var(--brand-soft); border: 1px solid #d4e5f5; border-radius: 7px; font-size: .78rem; font-weight: 750; cursor: pointer; list-style: none; }
.fixed-contact-edit summary::-webkit-details-marker { display: none; }
.fixed-contact-edit[open] summary { margin-bottom: 14px; }
.contact-assignment-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.contact-assignment-option { display: flex; align-items: center; gap: 10px; min-height: 68px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; transition: border-color .15s, background .15s; }
.contact-assignment-option:hover { border-color: #b9d5ee; background: #fbfdff; }
.contact-assignment-option:has(input:checked) { border-color: #a9cbea; background: var(--brand-soft); }
.contact-assignment-option input { flex: 0 0 auto; width: 18px; height: 18px; accent-color: var(--brand); }
.contact-assignment-copy { min-width: 0; flex: 1; }
.contact-assignment-copy strong, .contact-assignment-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-assignment-copy small { margin-top: 2px; color: var(--muted); font-size: .75rem; }
.assigned-contact-grid { margin-top: 12px; }
.contact-card.is-muted { opacity: .68; background: #fafbfc; }
.contact-head > .badge { margin-left: auto; }
.compact-empty { padding: 22px 18px; margin-top: 10px; background: #fafbfc; border: 1px dashed #d7dee7; border-radius: 10px; }
.legacy-contacts > summary { color: var(--brand); font-weight: 750; cursor: pointer; }
.legacy-contacts .contact-grid { margin-top: 14px; }
@media (max-width: 1180px) { .contact-manager-layout { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .fixed-contact-summary { align-items: flex-start; flex-wrap: wrap; } .fixed-contact-actions { width: 100%; justify-content: flex-start; padding-left: 55px; } .contact-assignment-list { grid-template-columns: 1fr; } }

/* Contactpersonen per klant: overzichtelijke toewijzing */
.contact-assignment-head small { display: block; margin-top: 3px; }
.contact-assignment-intro { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 13px; margin-bottom: 16px; padding: 14px 16px; background: #f7fafc; border: 1px solid var(--line); border-radius: 11px; }
.contact-assignment-intro-icon { display: grid; width: 42px; height: 42px; place-items: center; color: var(--brand); background: var(--brand-soft); border-radius: 10px; font-size: 1.15rem; font-weight: 900; }
.contact-assignment-intro strong { display: block; margin-bottom: 2px; }
.contact-assignment-intro p { margin: 0; color: var(--muted); font-size: .8rem; }
.contact-assignment-count { display: inline-flex; align-items: center; min-height: 29px; padding: 5px 10px; color: var(--brand-dark); background: var(--brand-soft); border-radius: 999px; font-size: .72rem; font-weight: 800; white-space: nowrap; }
.contact-assignment-form { display: block; }
.contact-assignment-table { overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 11px; }
.contact-assignment-row { position: relative; display: grid; grid-template-columns: 24px 38px minmax(150px, .85fr) minmax(190px, 1fr) 112px; align-items: center; gap: 12px; min-height: 70px; padding: 12px 15px; background: #fff; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .15s ease, box-shadow .15s ease; }
.contact-assignment-row:last-child { border-bottom: 0; }
.contact-assignment-row:hover { background: #fbfcfd; }
.contact-assignment-row.is-selected, .contact-assignment-row:has(.contact-assignment-checkbox:checked) { background: #f5f9fd; box-shadow: inset 3px 0 0 var(--brand); }
.contact-assignment-checkbox { width: 18px; height: 18px; margin: 0; accent-color: var(--brand); }
.contact-assignment-avatar { width: 38px; height: 38px; min-width: 38px; flex-basis: 38px; font-size: .72rem; }
.contact-assignment-person, .contact-assignment-details { min-width: 0; }
.contact-assignment-person strong, .contact-assignment-person small, .contact-assignment-details span, .contact-assignment-details small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-assignment-person strong { color: var(--ink); font-size: .86rem; }
.contact-assignment-person small { margin-top: 2px; color: var(--muted); font-size: .75rem; }
.contact-assignment-details span { color: #465365; font-size: .78rem; }
.contact-assignment-details small { margin-top: 2px; color: var(--muted); font-size: .72rem; }
.contact-assignment-state { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; color: #7b8491; font-size: .74rem; font-weight: 750; white-space: nowrap; }
.contact-assignment-check { display: grid; width: 23px; height: 23px; place-items: center; color: transparent; background: #f0f2f5; border: 1px solid #d7dce3; border-radius: 50%; font-size: .72rem; font-weight: 900; }
.contact-assignment-row.is-selected .contact-assignment-check, .contact-assignment-row:has(.contact-assignment-checkbox:checked) .contact-assignment-check { color: #fff; background: var(--brand); border-color: var(--brand); }
.contact-assignment-row.is-selected .contact-assignment-state, .contact-assignment-row:has(.contact-assignment-checkbox:checked) .contact-assignment-state { color: var(--brand); }
.contact-assignment-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 14px; padding: 14px 16px; background: #fafbfc; border: 1px solid var(--line); border-radius: 11px; }
.contact-assignment-footer-copy strong, .contact-assignment-footer-copy small { display: block; }
.contact-assignment-footer-copy strong { font-size: .82rem; }
.contact-assignment-footer-copy small { margin-top: 2px; color: var(--muted); font-size: .74rem; }
.contact-assignment-inactive-note { display: flex; flex-direction: column; gap: 2px; margin-top: 14px; padding: 11px 13px; color: #675229; background: #fffaf0; border: 1px solid #f0dfb6; border-radius: 9px; font-size: .76rem; }
.contact-assignment-inactive-note strong { color: #805c13; }
.contact-assignment-empty { padding: 28px 20px; background: #fafbfc; border: 1px dashed #d7dee7; border-radius: 11px; }
.contact-assignment-empty > span { display: block; }

@media (max-width: 980px) {
  .contact-assignment-row { grid-template-columns: 24px 38px minmax(0, 1fr) 104px; }
  .contact-assignment-details { display: none; }
}
@media (max-width: 680px) {
  .contact-assignment-head { align-items: flex-start; flex-direction: column; }
  .contact-assignment-head .btn { width: 100%; }
  .contact-assignment-intro { grid-template-columns: 38px minmax(0, 1fr); }
  .contact-assignment-intro-icon { width: 38px; height: 38px; }
  .contact-assignment-count { grid-column: 2; justify-self: start; }
  .contact-assignment-row { grid-template-columns: 22px 36px minmax(0, 1fr); gap: 10px; min-height: 66px; padding: 11px 12px; }
  .contact-assignment-state { grid-column: 3; justify-content: flex-start; margin-top: -5px; }
  .contact-assignment-check { width: 20px; height: 20px; }
  .contact-assignment-footer { align-items: stretch; flex-direction: column; }
  .contact-assignment-footer .btn { width: 100%; }
}


/* Contactpersonen per klant v2 - compacte selecteerkaarten */
.contact-assignment-table {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  overflow: visible;
  background: transparent;
  border: 0;
  border-radius: 0;
}
.contact-assignment-row {
  position: relative;
  display: grid;
  grid-template-columns: 22px 44px minmax(0, 1fr);
  grid-template-areas:
    "check avatar person"
    "check avatar details"
    "check avatar state";
  align-items: start;
  column-gap: 12px;
  row-gap: 3px;
  min-height: 112px;
  padding: 15px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .02);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease, transform .15s ease;
}
.contact-assignment-row:last-child { border-bottom: 1px solid var(--line); }
.contact-assignment-row:hover {
  background: #fbfdff;
  border-color: #b9d5ee;
  box-shadow: 0 3px 10px rgba(20, 76, 128, .06);
}
.contact-assignment-row.is-selected {
  background: #f4f9fd;
  border-color: #9fc6e8;
  box-shadow: inset 3px 0 0 var(--brand), 0 3px 10px rgba(20, 76, 128, .06);
}
.contact-assignment-checkbox {
  grid-area: check;
  align-self: center;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--brand);
}
.contact-assignment-avatar {
  grid-area: avatar;
  width: 44px;
  height: 44px;
  min-width: 44px;
  font-size: .74rem;
}
.contact-assignment-person { grid-area: person; min-width: 0; padding-top: 1px; }
.contact-assignment-person strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: .88rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.contact-assignment-person small {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-size: .74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.contact-assignment-details {
  grid-area: details;
  min-width: 0;
  padding-top: 4px;
}
.contact-assignment-details span,
.contact-assignment-details small {
  display: block;
  overflow: hidden;
  color: #526071;
  font-size: .74rem;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.contact-assignment-details small { color: var(--muted); }
.contact-assignment-state {
  grid-area: state;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  margin-top: 5px;
  color: #758092;
  font-size: .72rem;
  font-weight: 800;
}
.contact-assignment-check {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  color: transparent;
  background: #f1f3f6;
  border: 1px solid #d8dee6;
  border-radius: 50%;
  font-size: .68rem;
}
.contact-assignment-row.is-selected .contact-assignment-state { color: var(--brand); }
.contact-assignment-row.is-selected .contact-assignment-check {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}
.contact-assignment-intro {
  margin-bottom: 18px;
}
.contact-assignment-footer {
  position: sticky;
  bottom: 14px;
  z-index: 3;
  margin-top: 16px;
  background: rgba(250, 251, 252, .96);
  box-shadow: 0 6px 20px rgba(16, 24, 40, .06);
  backdrop-filter: blur(8px);
}
@media (max-width: 980px) {
  .contact-assignment-table { grid-template-columns: 1fr; }
  .contact-assignment-row {
    grid-template-columns: 22px 42px minmax(0, 1fr);
    grid-template-areas:
      "check avatar person"
      "check avatar details"
      "check avatar state";
  }
  .contact-assignment-details { display: block; }
  .contact-assignment-state { grid-column: auto; }
}
@media (max-width: 620px) {
  .contact-assignment-row { min-height: 102px; padding: 13px; }
  .contact-assignment-details span,
  .contact-assignment-details small { white-space: normal; overflow-wrap: anywhere; }
  .contact-assignment-footer { position: static; }
}

/* Tickets: zoeken en toegangscontext */
.ticket-search-card { margin-bottom: 16px; }
.ticket-search-form { display: grid; grid-template-columns: minmax(280px, 1fr) 210px auto; align-items: end; gap: 12px; }
.ticket-search-form-customer { grid-template-columns: minmax(280px, 1fr) auto; }
.ticket-search-field, .ticket-status-field { margin: 0; }
.ticket-search-actions { display: flex; align-items: center; gap: 8px; padding-bottom: 1px; }
.ticket-access-note { margin-top: 12px; }
@media (max-width: 860px) {
  .ticket-search-form, .ticket-search-form-customer { grid-template-columns: 1fr; }
  .ticket-search-actions { align-items: stretch; }
  .ticket-search-actions .btn { flex: 1; }
}

/* Admin document/invoice list search */
.admin-list-search { padding: 14px 22px; background: #fbfcfd; border-bottom: 1px solid var(--line); }
.admin-list-search-form { align-items: center; }
.admin-list-search-form .input { min-width: 0; flex: 1; }
@media (max-width: 680px) {
  .admin-list-search-form { flex-wrap: wrap; }
  .admin-list-search-form .input { flex-basis: 100%; }
  .admin-list-search-form .btn { flex: 1; }
}

/* Planning beheren per project */
.planning-project-search-card { margin-bottom: 18px; overflow: visible; }
.planning-project-search-head { align-items: center; }
.planning-project-search-head small { display: block; margin-top: 3px; color: var(--muted); font-size: .76rem; font-weight: 500; }
.planning-project-picker { max-width: 760px; }
.planning-project-picker .project-search-results { top: 45px; }
.planning-project-empty-card { margin-top: 18px; }
.planning-project-empty { padding: 42px 20px; }
.planning-project-empty strong { display: block; margin-bottom: 5px; color: var(--ink); font-size: .94rem; }
.planning-project-context { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin-bottom: 18px; padding: 18px 20px; }
.planning-project-context-main { display: flex; align-items: center; min-width: 0; gap: 14px; }
.planning-project-context-icon { display: grid; flex: 0 0 46px; width: 46px; height: 46px; place-items: center; color: var(--brand); background: var(--brand-soft); border-radius: 11px; font-size: 1rem; font-weight: 900; }
.planning-project-context-copy { min-width: 0; }
.planning-project-context-copy .eyebrow { margin-bottom: 2px; }
.planning-project-context-copy h2 { margin: 0; overflow: hidden; color: var(--ink); font-size: 1.05rem; text-overflow: ellipsis; white-space: nowrap; }
.planning-project-context-copy p { margin: 4px 0 0; overflow: hidden; color: var(--muted); font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.planning-project-context-meta { display: flex; align-items: center; flex: 0 0 auto; gap: 10px; }
.planning-project-stat { display: flex; min-width: 62px; flex-direction: column; align-items: center; padding: 7px 9px; background: #f8fafc; border: 1px solid var(--line); border-radius: 9px; }
.planning-project-stat strong { color: var(--ink); font-size: .9rem; line-height: 1; }
.planning-project-stat small { margin-top: 3px; color: var(--muted); font-size: .65rem; font-weight: 600; }
.planning-project-grid { align-items: start; }
.planning-project-grid .card { min-width: 0; }
.planning-project-table .planning-update-form { min-width: 390px; }
.planning-new-step-card { position: sticky; top: 86px; }
@media (max-width: 1080px) {
  .planning-project-context { align-items: flex-start; flex-direction: column; }
  .planning-project-context-meta { width: 100%; flex-wrap: wrap; }
  .planning-new-step-card { position: static; }
}
@media (max-width: 680px) {
  .planning-project-search-head { align-items: flex-start; flex-direction: column; gap: 10px; }
  .planning-project-context { padding: 15px; }
  .planning-project-context-main { align-items: flex-start; }
  .planning-project-context-copy h2, .planning-project-context-copy p { white-space: normal; }
  .planning-project-context-meta { gap: 7px; }
  .planning-project-stat { min-width: 58px; }
}
