/* Berater-CRM */
.crm-body {
  background: #f3f6f2;
  color: #263029;
  --ink: #263029;
  --muted: #526158;
  --line: #dce5db;
  --green: #31583a;
  --lime: #83b541;
  --pale: #e7f0df;
  --surface: #fff;
}
.crm-body > header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 10px clamp(16px, 3vw, 46px);
}
.crm-body > header img { width: 144px; }
.crm-body > header #advisorNav, .crm-ready > header { display: none; }
.crm-body .advisor-layout {
  max-width: none;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: clamp(162px, 15vw, 216px) minmax(0, 1fr);
  gap: 0;
}
.crm-ready #workspace {
  background: #fbfdfa;
  border-right: 1px solid var(--line);
  min-width: 0;
}
.crm-sidebar { position: sticky; top: 0; padding: 23px 13px; }
.crm-brand { padding: 0 9px 27px; }
.crm-brand img { width: min(100%, 144px); height: auto; display: block; }
.crm-body .workspace-nav {
  position: static;
  border: 0;
  background: transparent;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 5px;
}
.crm-body .workspace-nav a {
  color: #3e5144;
  min-height: 41px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: .88rem;
  font-weight: 620;
  text-decoration: none;
}
.crm-body .workspace-nav a:hover { background: #f0f5ed; }
.crm-body .workspace-nav a[aria-current] {
  color: #25462d;
  background: #e7f0de;
  box-shadow: inset 3px 0 0 #5d9634;
  font-weight: 750;
}
.crm-ready #content { padding: 20px clamp(14px, 2.3vw, 34px) 46px; }
.crm-topbar {
  min-height: 56px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 15px;
  padding: 7px clamp(14px, 2.3vw, 34px);
  background: #fbfdfa;
  border-bottom: 1px solid var(--line);
  font-size: .84rem;
}
.crm-top-account { color: var(--muted); overflow-wrap: anywhere; }
.crm-top-link { color: var(--green); font-weight: 670; text-decoration: none; }
.crm-top-link:hover { text-decoration: underline; }
.crm-topbar .crm-top-logout { min-height: 34px; padding: 5px 10px; }
.crm-dashboard-metrics .metric { box-shadow: 0 3px 12px #26372c0a; }
.crm-home-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.crm-home-grid > section { min-width: 0; margin: 0; }
.crm-home-grid > section:last-child { grid-column: 1 / -1; }
.crm-body .status:not(:empty) {
  position: sticky;
  top: 8px;
  z-index: 4;
  margin: 8px clamp(14px, 2.3vw, 34px) 0;
  border: 1px solid #d4e0c6;
  box-shadow: 0 5px 14px #27392310;
  overflow-wrap: anywhere;
}
.crm-body .panel { border-radius: 15px; box-shadow: 0 4px 14px #2d3a2706; }
.crm-body h1 { font-size: clamp(1.65rem, 2.7vw, 2.2rem); margin: 0 0 6px; font-weight: 750; overflow-wrap: anywhere; }
.crm-body h2 { font-size: 1.09rem; letter-spacing: -.018em; }
.crm-body h3 { font-size: .97rem; }
.crm-body button, .crm-link-button { border-radius: 9px; font-size: .88rem; }
.crm-body button:hover, .crm-link-button:hover { border-color: #879c76; }
.crm-body button.primary { background: #355d3d; border-color: #355d3d; color: white; font-weight: 720; }
.crm-body button.primary:hover { background: #294a30; }
.crm-link-button {
  min-height: 42px;
  padding: 9px 13px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  color: #32452c;
  background: #fff;
  text-decoration: none;
  width: fit-content;
}
.crm-body input:not([type=checkbox]):not([type=file]), .crm-body select, .crm-body textarea {
  border-color: #b8c2b1;
  border-radius: 8px;
}
.crm-body label { color: #354032; overflow-wrap: anywhere; }
.crm-page-head, .crm-section-head, .crm-filter-foot, .crm-lane-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.crm-page-head { margin: 4px 0 17px; }
.crm-page-head p { margin: 4px 0 0; }
.crm-new-customer:not([open]) { display: none; }
.crm-filter-panel {
  background: white;
  padding: clamp(12px, 1.8vw, 22px);
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 15px;
}
.crm-filters { grid-template-columns: repeat(auto-fit, minmax(min(100%, 147px), 1fr)); }
.crm-filters > label:first-child { grid-column: span 2; }
.crm-filters > label { font-size: .81rem; }
.crm-filter-foot { margin-top: 15px; }
.crm-result-count { font-size: .87rem; color: var(--muted); }
.crm-segment { display: flex; padding: 3px; border-radius: 11px; background: #f0f2ed; }
.crm-segment button { min-height: 36px; border-color: transparent; background: transparent; }
.crm-segment button[aria-pressed="true"] { background: #fff; border-color: #d0d9c7; font-weight: 720; }
.crm-table { border: 1px solid var(--line); background: white; border-radius: 13px; }
.crm-table td, .crm-table th { padding: 12px 14px; }
.crm-table th { background: #f8faf5; font-size: .8rem; color: #536150; font-weight: 700; }
.crm-table td { font-size: .87rem; }
.crm-table tr:hover td { background: #fbfcf8; }
.crm-table tbody tr:last-child td { border-bottom: 0; }
.crm-table small { font-size: .75rem; }
.customer-name { color: #263421; text-decoration: none; font-weight: 730; }
.customer-name:hover { text-decoration: underline; }
.crm-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.crm-badge {
  display: inline-block;
  width: fit-content;
  border-radius: 20px;
  padding: 3px 8px;
  background: #edf0e9;
  color: #3d4937;
  font-size: .75rem;
  font-weight: 650;
  line-height: 1.45;
}
.crm-badge[data-state=closed], .crm-badge[data-state=approved], .crm-badge[data-state=linked] { color: #2b5c24; background: #e3f0db; }
.crm-badge[data-state=documents], .crm-badge[data-state=new], .crm-badge[data-state=queued] { color: #744b14; background: #fbefda; }
.crm-badge[data-state=lost], .crm-badge[data-state=replace], .crm-badge[data-state=failed], .crm-badge[data-state=uncertain] { color: #8b362d; background: #f9e9e5; }
.crm-badge[data-state=application], .crm-badge[data-state=consultation], .crm-badge[data-state=seen] { color: #315459; background: #e1eeed; }
.crm-board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(218px, 1fr);
  gap: 11px;
  overflow: auto;
  padding-bottom: 12px;
  align-items: stretch;
}
.crm-lane { min-width: 0; background: #e9ede4; border: 1px solid #dce3d5; border-radius: 13px; padding: 10px; }
.crm-lane-head { align-items: flex-start; gap: 5px; flex-wrap: nowrap; }
.crm-lane-head h2 { margin: 3px 0 9px; font-size: .9rem; }
.crm-lane-empty { padding: 6px 0; font-size: .8rem; }
.crm-lane.drop-target { background: #dbeacb; border-color: #8aaf75; }
.crm-board-card { background: white; padding: 12px; border: 1px solid var(--line); border-radius: 10px; margin: 8px 0; overflow-wrap: anywhere; }
.crm-board-card label { display: block; font-size: .78rem; margin-top: 10px; }
.crm-board-card select { margin-top: 4px; }
.crm-board-card .crm-tags { margin-top: 6px; }
.crm-empty { padding: 15px 12px; margin: 0; }
.crm-case-head { border-bottom: 1px solid var(--line); margin-bottom: 17px; }
.crm-case-head .crm-page-head { margin-top: 4px; }
.crm-back { display: inline-block; margin-bottom: 10px; color: var(--green); font-size: .87rem; font-weight: 670; text-decoration: none; }
.crm-back:hover { text-decoration: underline; }
.crm-meta { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); }
.crm-tabs { display: flex; gap: 20px; overflow: auto; white-space: nowrap; }
.crm-tabs a { padding: 11px 4px; text-decoration: none; color: #4c5549; border-bottom: 3px solid transparent; font-size: .9rem; }
.crm-tabs a[aria-current] { border-color: #6c9c41; color: #23431a; font-weight: 750; }
.crm-overview { display: grid; grid-template-columns: 1fr 1.25fr; gap: 14px; }
.crm-overview > section { margin-bottom: 0; min-width: 0; }
.crm-contact { display: grid; gap: 6px; margin: 10px 0; padding: 10px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.crm-contact a { color: var(--green); }
.crm-doc-pane form, .crm-doc-tools form, .crm-timeline-actions form { margin-top: 12px; }
.crm-body details summary { font-weight: 620; }
.crm-timeline-actions { display: flex; align-items: start; gap: 8px; flex-wrap: wrap; }
.crm-timeline-actions details { margin-top: 0; }
.crm-timeline-actions details[open] { flex: 1 1 100%; }
.crm-timeline-actions textarea { margin: 8px 0; }
.crm-activity-filter { display: flex; flex-wrap: wrap; gap: 5px; margin: 14px 0 5px; }
.crm-activity-filter button { min-height: 36px; padding: 6px 10px; }
.crm-activity-filter button[aria-pressed=true] { background: #e8f0de; border-color: #a7c095; }
.crm-timeline { list-style: none; padding: 0 0 0 13px; margin: 15px 0 0; border-left: 2px solid #dce6d4; }
.crm-timeline li { padding: 0 0 6px; border: 0; }
.crm-timeline details { margin: 0; }
.crm-timeline summary strong, .crm-timeline summary small, .crm-timeline summary .crm-badge { margin-left: 6px; }
.crm-timeline summary small { display: inline-block; }
.crm-timeline summary strong { overflow-wrap: anywhere; }
.crm-transcript { max-height: 26rem; overflow: auto; padding: 12px; border-radius: 8px; background: #f4f7f0; }
.crm-sync details > form { margin-top: 12px; }
.crm-application { display: grid; gap: 14px; }
.crm-app-people { display: grid; gap: 13px; justify-items: start; }
.crm-app-person {
  width: 100%;
  padding: 18px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 13px;
  display: grid;
  gap: 12px;
  min-width: 0;
}
.crm-app-person h2 { margin: 0; }
.crm-app-section { width: 100%; background: #fbfcfa; border-radius: 12px; }
.crm-app-section legend { font-size: .91rem; color: #30492a; }
.crm-app-person details .grid { margin-top: 10px; }
.crm-collection { display: grid; gap: 12px; margin-top: 8px; justify-items: start; }
.crm-collection fieldset { width: 100%; background: #fff; }
.crm-collection fieldset > button { margin-top: 10px; }
.crm-app-save { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; background: #f4f6f0; border-top: 1px solid var(--line); border-radius: 10px; }
.crm-conflict p { margin: 3px 0 11px; overflow-wrap: anywhere; }
.crm-doc-layout {
  display: grid;
  grid-template-columns: clamp(226px, 22vw, 302px) minmax(0, 1fr);
  gap: clamp(13px, 1.7vw, 23px);
  align-items: start;
}
.crm-doc-rail, .crm-doc-view {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: 0 3px 10px #29382c08;
}
.crm-doc-rail { position: sticky; top: 14px; }
.crm-doc-rail-head { display: grid; padding: 13px; border-bottom: 1px solid var(--line); }
.crm-doc-rail-head h2 { margin: 0; }
.crm-doc-rail-head small { margin: 3px 0 8px; }
.crm-doc-search { display: grid; gap: 5px; font-size: .79rem; }
.crm-doc-search input[type=search] { min-height: 36px; padding-block: 5px; font-size: .86rem; }
.crm-doc-categories { max-height: min(71vh, 780px); overflow: auto; padding: 0 9px; }
.crm-doc-group { padding: 10px 0; border-bottom: 1px solid var(--line); }
.crm-doc-group:last-child { border-bottom: 0; }
.crm-doc-group-head { padding: 7px 9px; margin: 0 0 4px; background: #f1f5ef; border-radius: 7px; }
.crm-doc-group-head h3 { margin: 0; font-size: .85rem; font-weight: 680; overflow-wrap: anywhere; }
.crm-doc-caption { color: var(--muted); display:block; font-size: .72rem; }
.crm-doc-rail button.crm-doc-category {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  width: 100%;
  min-height: 36px;
  padding: 5px 7px;
  border: 1px solid transparent;
  background: #fff;
  text-align: left;
  font-size: .82rem;
}
.crm-doc-category-name { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-doc-category .crm-badge { line-height: 1.3; font-size: .69rem; padding: 3px 6px; white-space: nowrap; }
.crm-doc-rail button.crm-doc-category:hover { background: #f6f8f4; }
.crm-doc-rail button.crm-doc-category[aria-pressed=true] { background: #e9f2e3; border-color: #b4cba9; }
.crm-doc-layout .crm-doc-main { min-width: 0; }
.crm-doc-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 9px 14px;
  flex-wrap: wrap;
  padding-bottom: 11px;
  margin-bottom: 11px;
  border-bottom: 1px solid var(--line);
}
.crm-doc-filters { flex-wrap: wrap; gap: 2px; }
.crm-doc-bar button, .crm-doc-bar .crm-link-button { min-height: 35px; font-size: .81rem; padding: 5px 9px; }
.crm-doc-bar .crm-segment button[aria-pressed=true] { background: #e2edda; border-color: #bad0ad; color: #2c5632; }
.crm-doc-list-actions { gap: 6px; }
.crm-doc-pane > h2 { margin-bottom: 4px; }
.crm-pane-meta { margin: 0 0 12px; font-size: .82rem; }
.crm-doc-view { padding: 14px; }
.crm-doc-heading {
  display: flex;
  gap: 9px;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}
.crm-doc-title { min-width: 0; }
.crm-doc-title-line { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.crm-doc-title-line h2 { margin: 0; overflow-wrap: anywhere; }
.crm-doc-title .crm-filename { margin: 4px 0 0; font-size: .82rem; overflow-wrap: anywhere; }
.crm-compact-button { min-height: 36px; padding: 5px 9px; }
.crm-doc-view > label {
  display: block;
  font-size: .82rem;
  padding: 0 0 8px;
}
.crm-doc-view > label select { margin-top: 4px; }
.crm-doc-empty, .crm-doc-drop {
  border: 1px dashed #b9ccba;
  border-radius: 9px;
  min-height: 134px;
  background: #f3f7f1;
  padding: 20px 10px;
  text-align: center;
}
.crm-doc-drop { display: grid; justify-items: center; align-content: center; min-height: 165px; gap: 6px; }
.crm-doc-drop p { margin: 0 0 5px; font-size: .85rem; }
.crm-doc-drop.drop-target { background: #e3efd9; border-color: #609855; }
.crm-pdf-actions { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin-bottom: 7px; }
.crm-pdf-actions .crm-link-button, .crm-pdf-actions button { min-height: 36px; }
.crm-pdf-actions label, .crm-sheet-count { font-size: .83rem; }
.crm-pdf-actions select { margin-top: 4px; min-height: 36px; padding-block: 5px; }
.crm-sheet {
  background: #eaf0eb;
  border: 1px solid var(--line);
  border-radius: 9px;
  min-height: 270px;
  padding: 18px 10px;
  overflow: auto;
  display: grid;
  place-items: center;
}
.crm-sheet-transform { position: relative; display: inline-block; line-height: 0; max-width: 100%; }
.crm-sheet img { display: block; width: auto; height: auto; max-width: 100%; max-height: min(68vh, 690px); box-shadow: 0 3px 12px #273c2e26; }
.crm-crop-overlay { position: absolute; border: 2px dashed #588437; box-shadow: 0 0 0 100vmax #25341938; pointer-events: none; clip-path: inset(-50px); }
.crm-pdf-edit { padding: 10px; background: #f4f7f3; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 7px; }
.crm-pdf-edit p { margin: 0; }
.crm-crop { grid-template-columns: repeat(auto-fit, minmax(min(100%, 78px), 1fr)); }
.crm-doc-tools { margin: 0 0 9px; padding: 7px 10px; background: #fbfcfa; font-size: .86rem; }
.crm-doc-tools[open] > button { margin-top: 8px; }
.crm-doc-tools > .row { margin-top: 10px; }
.crm-release-list .flag { min-height: 0; }
.crm-release-list li { padding: 8px 0; }
.crm-release-list small { margin-left: 28px; }
@media (max-width: 960px) {
  .crm-body .advisor-layout { grid-template-columns: minmax(145px, 158px) minmax(0,1fr); }
  .crm-overview { grid-template-columns: minmax(0, 1fr); }
  .crm-doc-layout { grid-template-columns: minmax(190px, 36%) minmax(0,1fr); }
}
@media (max-width: 760px) {
  .crm-body .advisor-layout { display: block; }
  .crm-ready #workspace { border-right: 0; border-bottom: 1px solid var(--line); }
  .crm-sidebar { position: static; padding: 8px 12px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
  .crm-brand { padding: 0; }
  .crm-brand img { width: 101px; }
  .crm-body .workspace-nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .crm-body .workspace-nav a { min-height: 36px; padding: 7px 9px; white-space: nowrap; }
  .crm-topbar { min-height: 43px; gap: 9px; }
  .crm-top-account { display: none; }
  .crm-tabs { gap: 12px; }
  .crm-doc-rail { position: static; }
}
@media (max-width: 630px) {
  .crm-filters > label:first-child { grid-column: auto; }
  .crm-doc-layout, .crm-home-grid { grid-template-columns: minmax(0, 1fr); }
  .crm-doc-categories { max-height: 240px; }
  .crm-board { grid-auto-columns: minmax(232px, 78%); }
  .crm-sheet { min-height: 210px; }
  .crm-app-person { padding: 10px; }
  .crm-app-save { position: static; }
}
.crm-saved-views { margin-top: 13px; }
.crm-saved-views form, .crm-saved-views .row { margin-top: 10px; }
.crm-saved-views label { min-width: 160px; display: block; }
.crm-saved-views select { margin-top: 4px; }

.crm-bulk form { margin-top: 10px; }
.crm-table input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--green); }
