/* Light workspace: shared visual language, without changing data or permissions. */
:root { --color-bg:#f0f1ee; --color-ink-muted:#62665d; --color-border:#e8eae4; --radius-card:24px; --radius-input:12px; }
body { font-family:"Avenir Next",Avenir,"Trebuchet MS",sans-serif; -webkit-font-smoothing:antialiased; }
[hidden] { display:none !important; }
:focus-visible { outline:3px solid #ab3a15; outline-offset:3px; }
.app-shell { margin:18px; min-height:calc(100vh - 36px); border-radius:28px; background:#f8f9f6; border:1px solid #fff; }
.brand-mark { display:grid; place-items:center; width:100%; height:100%; font-size:20px; line-height:1; }
.app-topbar { background:transparent; border-bottom:0; min-height:56px; padding:10px 30px 16px; font-size:14px; }
.topbar-context { display:flex; align-items:center; gap:15px; }
.app-content { max-width:1600px; margin:0 auto; padding:12px 30px 36px; }
.page-header { margin-bottom:25px; align-items:center; }
h1,h2,h3 { letter-spacing:-.035em; }
.page-header h1 { font-weight:600; font-size:32px; }
h2 { font-size:20px; font-weight:600; }
.page-header p { font-size:14px; }
.card { border:1px solid #fff; box-shadow:0 3px 18px #20231d03; padding:24px; }
.btn { border-radius:999px; padding:10px 17px; font-family:inherit; font-size:14px; line-height:1.4; transition:background .15s; }
.btn:hover { background:#e95124; }
.btn-secondary { background:#f5f6f2; border-color:#e7e9e2; }
.btn-secondary:hover { background:#e8ece2; }
.btn-danger { background:#b43d1d; }
.btn-danger:hover { background:#943015; }
.input { background:#fafbf8; }
.input:focus { border-color:#aab29f; }
table.data-table th { background:#f6f7f3; font-weight:500; font-size:12px; border:0; padding:13px 14px; }
table.data-table th:first-child { border-radius:12px 0 0 12px; }
table.data-table th:last-child { border-radius:0 12px 12px 0; }
table.data-table td { padding:17px 14px; font-size:14px; border-bottom-color:#edf0e8; }
table.data-table tbody tr:last-child td { border-bottom:0; }
table.data-table tbody tr:hover { background:#fafbf8; }
table.data-table td a { text-decoration-color:#c5cbbd; text-underline-offset:4px; }
.badge { font-size:12px; padding:3px 9px; font-weight:500; }
.stat-card { position:relative; padding:25px; margin:0; min-height:134px; display:flex; flex-direction:column-reverse; justify-content:space-between; }
.stat-card .stat-value { font-size:38px; font-weight:500; letter-spacing:-1.5px; line-height:1.15; font-variant-numeric:tabular-nums; }
.stat-card .stat-label { font-size:14px; }
.dashboard-metrics .stat-card:first-child { background:#ff8e64; color:#20231d; border-color:#ff8e64; }
.dashboard-metrics .stat-card:first-child .stat-label { color:#40271b; }
.customer-workspace { max-width:none; }
.customer-workspace .detail-layout { gap:22px; }
.customer-workspace .customer-header { padding:27px; align-items:flex-start; }
.customer-avatar { width:58px; height:58px; border-radius:20px; background:#ffdecf; color:#903313; font-size:20px; font-weight:600; margin-top:24px; }
.eyebrow { font-size:10px; font-weight:600; letter-spacing:1.5px; text-transform:uppercase; color:var(--color-ink-muted); margin:0 0 6px; }
.eyebrow span { letter-spacing:.4px; margin-left:9px; color:#6c7263; }
.customer-header h1 { font-size:29px; line-height:1.2; font-weight:600; overflow-wrap:anywhere; }
.customer-header-meta { font-size:14px; margin-top:6px; }
.customer-facts { display:grid; grid-template-columns:.8fr 1.25fr 1fr; gap:22px; padding:20px 0; margin:15px 0 0; border-top:1px solid #eff1eb; }
.customer-facts dt { color:#62665d; font-size:12px; margin-bottom:6px; }
.customer-facts dd { margin:0; font-size:14px; overflow-wrap:anywhere; }
.document-status-list { margin:3px 0 16px; gap:7px; }
.document-status { border:0; border-radius:8px; padding:6px 9px; font-size:12px; background:#f4f5f0; color:#5b6153; }
.document-status::before { content:'○'; margin-right:5px; }
.document-status-geprueft { color:#286139; background:#eef6ed; }
.document-status-geprueft::before { content:'✓'; }
.document-status-abgelehnt { color:#963b24; background:#fff0e9; }
.document-status-abgelehnt::before { content:'×'; }
.tag-chip { background:#f0f2ec; font-size:12px; padding:4px 10px; }
.tag-editor { margin-top:12px; font-size:12px; }
.tag-editor summary { cursor:pointer; color:#62594d; width:fit-content; padding:4px 0; }
.tag-editor .inline-form { max-width:420px; }
.dossier-tabs { background:white; border:0; border-radius:18px; padding:7px; gap:4px; margin:0 0 18px; }
.dossier-tabs a { border:0; padding:11px 13px; border-radius:12px; font-size:12px; flex:1; text-align:center; white-space:nowrap; }
.dossier-tabs a:hover { background:#f1f3ed; }
.dossier-tabs a.active { background:#25281f; color:white; }
.dossier-tabs .badge { background:#f0f2ec; color:#5c6352; margin-left:4px; padding:1px 6px; }
.dossier-tabs a.active .badge { background:#454b3c; color:white; }
.customer-workspace .detail-context { width:clamp(310px,26vw,410px); padding:18px; position:sticky; top:18px; max-height:calc(100vh - 36px); overflow-y:auto; scrollbar-width:thin; }
.panel-tabs { padding:4px; background:#f4f5f1; border-radius:14px; gap:3px; margin-bottom:25px; }
.panel-tabs a { font-size:12px; padding:10px 5px; border-radius:10px; background:transparent; }
.panel-tabs a.active { background:white; box-shadow:0 2px 5px #20231d0c; color:#8c3215; }
.panel-tabs a span { margin-left:3px; }
.context-panel-section h3 { font-size:10px; font-weight:600; letter-spacing:1.2px; margin:0 0 18px; color:#62665d; }
.activity-item { padding:15px 4px; font-size:14px; overflow-wrap:anywhere; }
.activity-item a { text-underline-offset:3px; text-decoration-color:#c4c9bc; }
.activity-item .activity-meta { font-size:12px; margin:6px 0; color:#62665d; }
.activity-timeline .activity-item { position:relative; margin-left:8px; padding:0 0 23px 23px; border-bottom:0; border-left:1px solid #e1e7d9; }
.activity-timeline .activity-item::before { content:''; position:absolute; top:5px; left:-5px; width:9px; height:9px; background:#e9ede3; border:2px solid white; box-shadow:0 0 0 1px #cbd4bf; border-radius:50%; }
.activity-timeline .activity-item:first-of-type::before { background:#f56336; box-shadow:0 0 0 1px #f56336; }
.activity-timeline .activity-item:last-of-type { border-left-color:transparent; }
.activity-timeline .activity-item a { text-decoration:none; font-weight:500; }
.customer-workspace .contract-register { min-width:590px; }
.contract-register .contract-meta { font-size:12px; }
.customer-workspace .inline-form .field { min-width:110px; }
.customer-workspace .inline-form label { font-size:12px; color:var(--color-ink-muted); font-weight:500; }
.customer-workspace .inline-form .input { font-size:12px; padding:9px; }
@media (min-width:761px) and (max-width:1240px) {
  .app-content { padding-left:20px; padding-right:20px; }
  .customer-workspace .detail-layout { flex-direction:column; }
  .customer-workspace .detail-context { width:100%; position:static; max-height:none; }
}
@media (max-width:760px) {
  .app-shell { margin:0; border:0; border-radius:0; min-height:100vh; }
  .app-topbar { min-height:auto; padding:10px 16px 15px; gap:12px; }
  .topbar-context { gap:9px; }
  .app-content { padding:8px 14px 25px; }
  .account-menu { gap:7px; }
  .card { padding:18px; border-radius:20px; }
  .page-header h1 { font-size:27px; }
  .customer-workspace .customer-header { padding:20px; flex-direction:row; gap:12px; }
  .customer-avatar { width:42px; height:42px; border-radius:14px; font-size:16px; margin-top:25px; }
  .customer-header h1 { font-size:23px; }
  .customer-facts { grid-template-columns:1fr; gap:13px; padding:15px 0; }
  .customer-workspace .detail-layout { flex-direction:column; }
  .customer-workspace .detail-context { width:100%; position:static; max-height:none; }
  .dossier-tabs { flex-wrap:nowrap; overflow:auto; }
  .dossier-tabs a { padding:10px; }
  .dashboard-metrics { gap:10px; }
  .stat-card { min-height:115px; padding:18px; }
  .stat-card .stat-value { font-size:31px; }
}
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { transition:none !important; scroll-behavior:auto !important; } }

.activity-filters { margin-bottom:24px; }
.activity-filters .input { font-size:12px; }
.activity-filters details { margin:10px 0; }
.activity-filters summary { cursor:pointer; font-size:12px; color:var(--color-ink-muted); width:fit-content; }
.activity-filter-fields { display:grid; grid-template-columns:1fr 1fr; gap:0 10px; margin-top:12px; }
.activity-filter-fields .field:nth-child(-n+2) { grid-column:1 / -1; }
.activity-filters .toolbar { font-size:12px; margin:10px 0 0; }
.activity-filters .btn { font-size:12px; padding:6px 12px; }
.activity-item a.activity-contract { display:block; width:fit-content; max-width:100%; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; padding:4px 8px; margin-top:7px; border:1px solid var(--color-border); border-radius:7px; color:var(--color-ink-muted); font-size:11px; font-weight:400; }
.activity-item a.activity-contract:hover { color:var(--color-ink); border-color:var(--color-accent); }

.linked-row { cursor:pointer; }
.linked-row:focus-within { outline:1px solid var(--color-accent); outline-offset:-1px; }
.row-primary-link { text-decoration:none; font-weight:500; }
.row-primary-link:hover { text-decoration:underline; }
.row-edit-link { display:inline-flex; align-items:center; justify-content:center; width:34px; height:34px; border-radius:10px; color:var(--color-ink-muted); border:1px solid var(--color-border); }
.row-edit-link:hover { color:var(--color-ink); border-color:var(--color-accent); }

.contract-total { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 14px; margin:16px 0 6px; background:var(--color-bg); border-radius:10px; font-variant-numeric:tabular-nums; }
.contract-total small { display:block; font-size:11px; color:var(--color-ink-muted); }
.insurer-identity { display:flex; gap:12px; align-items:center; }
.insurer-logo { flex-shrink:0; object-fit:contain; border-radius:7px; }
.insurer-placeholder { display:grid; place-items:center; flex-shrink:0; width:40px; height:36px; color:var(--color-ink-muted); background:var(--color-bg); border-radius:7px; }
.contract-title-row { display:flex; justify-content:space-between; gap:18px; margin-top:24px; }
.contract-title-row h1 { margin:5px 0; font-size:29px; overflow-wrap:anywhere; }
.contract-title-row .large { float:left; margin:0 18px 8px 0; }
.contract-head-premium { text-align:right; min-width:150px; }
.contract-head-premium strong { display:block; font-size:26px; font-variant-numeric:tabular-nums; }
.contract-head-premium span,.contract-head-premium small { display:block; color:var(--color-ink-muted); }
.contract-facts { display:grid; grid-template-columns:1fr 1fr; gap:18px; }
.contract-facts dt { font-size:12px; color:var(--color-ink-muted); }
.contract-facts dd { margin:4px 0; overflow-wrap:anywhere; }
.contract-workspace .dossier-tabs { flex-wrap:wrap; }
@media (max-width:1180px) {
  input,select,textarea,.input,.customer-workspace .inline-form .input,.activity-filters .input { font-size:16px; }
  .btn,.row-edit-link,.panel-tabs a,.dossier-tabs a,.search-choice-option,.search-choice-toggle { min-height:44px; }
  .search-choice-toggle { top:0; min-width:40px; }
  .detail-main,.app-main,.field { min-width:0; }
  .form-grid { grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr)); }
  .search-choice-list { max-height: min(260px,40dvh); }
}
@media (max-width:760px) {
  .page-header,.app-topbar { flex-wrap:wrap; }
  .contract-title-row { flex-direction:column; }
  .contract-head-premium { text-align:left; }
  .contract-facts { grid-template-columns:1fr; }
  .customer-workspace .contract-register { min-width:0; display:block; }
  .contract-register thead { display:none; }
  .contract-register tbody { display:grid; gap:14px; }
  .contract-register tr { display:grid; grid-template-columns:1fr auto; gap:12px; padding:14px; border:1px solid var(--color-border); border-radius:14px; }
  .contract-register tr td { display:block; border:0!important; padding:0!important; overflow-wrap:anywhere; }
  .contract-register tr td:nth-child(1),.contract-register tr td:nth-child(2) { grid-column:1/-1; }
  .contract-register tr td:nth-child(3) { grid-column:1; }
  .contract-register tr td:nth-child(4) { grid-column:2; text-align:right; }
  .contract-register tr td:last-child { grid-column:2; justify-self:end; }
  .contract-total { align-items:flex-start; }
  .contract-total strong { white-space:nowrap; }
  .activity-item a.activity-contract { white-space:normal; min-height:44px; display:flex; align-items:center; }
  .dossier-tabs { flex-wrap:wrap; overflow:visible; }
  .dossier-tabs a { flex:1 1 40%; }
}
.mobile-workspace-jump { display:none; }
@media (max-width:1240px) {
  .mobile-workspace-jump { display:flex; flex-wrap:wrap; gap:6px; margin:0 0 14px; }
  .mobile-workspace-jump a { min-height:44px; padding:11px 14px; border:1px solid var(--color-border); border-radius:12px; text-decoration:none; font-size:12px; }
  #kundenkontext { scroll-margin-top:16px; }
  .document-status { min-height:44px; display:inline-flex; align-items:center; }
}
@media (max-width:1050px) {
  .customer-workspace .contract-register { min-width:0; display:block; }
  .contract-register thead { display:none; }
  .contract-register tbody { display:grid; gap:14px; }
  .contract-register tr { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:12px; padding:14px; border:1px solid var(--color-border); border-radius:14px; }
  .contract-register tr td { display:block; border:0!important; padding:0!important; overflow-wrap:anywhere; }
  .contract-register tr td:nth-child(1),.contract-register tr td:nth-child(2) { grid-column:1/-1; }
  .contract-register tr td:nth-child(3) { grid-column:1; }
  .contract-register tr td:nth-child(4) { grid-column:2; text-align:right; }
  .contract-register tr td:last-child { grid-column:2; justify-self:end; }
}
@media(max-width:760px) { .contract-title-row h1 { font-size:25px; line-height:1.2; } .contract-title-row { gap:10px; } }
@media(max-width:760px) {
  .contract-register tr td.contract-dates,
  .contract-register tr td.contract-premium { grid-column:1/-1; text-align:left; min-width:0; white-space:normal; }
  .app-topbar .account-menu { flex-wrap:wrap; max-width:100%; }
  .app-topbar .account-menu .btn { flex:0 1 auto; white-space:nowrap; }
}
@media(min-width:761px) and (max-width:1050px) {
  .customer-workspace .contract-register { display:table; table-layout:fixed; width:100%; min-width:0; }
  .contract-register thead { display:table-header-group; }
  .contract-register tbody { display:table-row-group; }
  .contract-register tr { display:table-row; }
  .contract-register tr td { display:table-cell; padding:13px 6px!important; border-bottom:1px solid var(--color-border)!important; font-size:12px; overflow-wrap:anywhere; }
  .contract-register th { padding:10px 6px!important; font-size:11px!important; }
  .contract-register th:nth-child(1) { width:24%; }.contract-register th:nth-child(2) { width:29%; }.contract-register th:nth-child(3) { width:20%; }.contract-register th:nth-child(4) { width:19%; }.contract-register th:nth-child(5) { width:8%; }
  .contract-register .insurer-logo { width:36px;height:24px; }
  .contract-register .insurer-identity { gap:6px; }
  .contract-register .contract-meta { font-size:10px; }
  .contract-register .contract-premium { white-space:normal; }
}

/* Record editors: one calm reading column at every viewport size. */
.record-form { width:100%; max-width:820px; padding:32px 36px; }
.record-form .form-grid { grid-template-columns:minmax(0,1fr); gap:22px; }
.record-form .field { min-width:0; margin-bottom:22px; }
.record-form .form-grid .field { margin-bottom:0; }
.record-form label { display:block; margin-bottom:8px; font-size:14px; font-weight:600; }
.record-form .input { min-height:48px; width:100%; padding:12px 14px; font-size:16px; border-radius:12px; }
.record-form textarea.input { min-height:128px; resize:vertical; line-height:1.6; }
.record-form input[type="checkbox"],.record-form input[type="radio"] { width:auto; min-height:0; }
.record-form .help { margin-top:7px; line-height:1.5; font-size:13px; }
.record-form .search-choice-toggle { top:0; right:2px; height:48px; width:44px; }
.record-form .search-choice-input { padding-right:48px; }
.record-form h2 { margin:32px 0 20px; padding-bottom:14px; border-bottom:1px solid var(--color-border); }
.record-form h2:first-child { margin-top:0; }
.record-form .form-actions { display:flex; gap:12px; flex-wrap:wrap; margin-top:28px; padding-top:24px; border-top:1px solid var(--color-border); }
.record-form .form-actions .btn { min-height:46px; min-width:136px; }
@media(max-width:760px) {
 .record-form { padding:23px 19px; border-radius:20px; }
 .record-form .form-grid { gap:20px; }
 .record-form .form-actions .btn { width:100%; }
}

.qualification-context { margin-bottom:18px; padding:22px 32px; }
.qualification-context summary { cursor:pointer; font-weight:600; font-size:14px; }
.qualification-context summary span { display:block; margin:5px 0 0 17px; font-weight:400; color:var(--color-ink-muted); font-size:12px; }
.qualification-context .table-scroll { margin-top:18px; }
.qualification-note { font-size:13px; color:var(--color-ink-muted); line-height:1.6; padding:0 0 18px; margin:0 0 20px; border-bottom:1px solid var(--color-border); }

/* Operational overview: compact controls, more room for the actual work. */
.workday-page .page-header { margin-bottom:20px; }
.workday-filters .toolbar { margin:0; align-items:flex-end; gap:14px; }
.workday-filters .field { flex:1 1 190px; min-width:0; margin:0; }
.workday-filters .input { width:100%; max-width:none; min-height:44px; }
.workday-filters label { margin-bottom:7px; }
.workday-filters .btn { min-height:44px; }
.workday-results .workday-undated { margin:0 0 16px; padding-bottom:16px; border-bottom:1px solid var(--color-border); }
.workday-note { margin:12px 0 0; line-height:1.5; }
@media(max-width:600px) {
 .workday-filters .toolbar { display:flex; flex-direction:column; align-items:stretch; }
 .workday-filters .field { flex:auto; width:100%; }
 .workday-filters .btn { width:100%; }
}

/* Campaign report: stat cards double as metric filter links. */
.campaign-report-metrics a.stat-card { text-decoration:none; color:inherit; display:block; transition:border-color .15s,background .15s; }
.campaign-report-metrics a.stat-card:hover { background:var(--dark-hover, #fafbf8); }
.campaign-report-metrics a.stat-card { min-width:0; }
.campaign-report-metrics .stat-value { overflow-wrap:anywhere; }
.campaign-report-metrics a.stat-card:not(:first-child) .stat-value { font-size:clamp(22px, 2.6vw, 32px); letter-spacing:-.8px; }
.campaign-report-metrics .stat-label { margin-top:8px; }
.campaign-report-metrics a.stat-card.active { border-color:#e95124; box-shadow:0 0 0 1px #e95124 inset; }
.campaign-report-page .badge { margin:0 4px 4px 0; }
.campaign-report-page td .badge:last-child { margin-right:0; }
