/* Shared Fluent surfaces for the application shell. Printable documents use their own layout. */
:root {
  --fl-ink: #162346;
  --fl-muted: #53617a;
  --fl-line: #d3daf0;
  --fl-accent: #394acb;
  --fl-selected: #e8ecff;
  --fl-shadow: 0 2px 5px #23316b08, 0 12px 32px -18px #35488e42;
  --fl-art: url("/assets/baufaden-architektur.webp");
  --ink: var(--fl-ink);
  --muted: var(--fl-muted);
  --line: var(--fl-line);
  --blue: var(--fl-accent);
}
body, #app .layout, #app .workspace {
  background: #edf1fa;
  color: var(--fl-ink);
}
#app {
  --workspace-accent: var(--fl-accent);
  --workspace-bg: #edf1fa;
  --workspace-line: var(--fl-line);
  --workspace-text: var(--fl-ink);
  --workspace-muted: var(--fl-muted);
}
#app .workspace {
  background: radial-gradient(ellipse at 95% 0, #d9e0fc 0, transparent 54%), linear-gradient(130deg,#eef4fc,#f5f5fb);
}
#app #content { background: transparent; color: var(--fl-ink); }
#app #content :is(h1,h2,h3,h4) { color: var(--fl-ink); }
#app #content :is(.page-head p,.help,.muted,.small,.count,.stat-label,.stat-hint) { color: var(--fl-muted); }
#app .layout .next-rail {
  --nav-accent: #b9c7ff;
  background: linear-gradient(156deg,#242957 0%,#202952 40%,#171e39 100%);
  border-right: 1px solid #515b86;
  box-shadow: 4px 0 18px #202e5812;
}
#app .next-brand-caption { display: none; }
#app .next-rail .next-brand { padding-block: 26px; }
#app .next-rail .next-nav-search input { background: #ffffff12; border: 1px solid #ffffff35; }
#app .next-rail :is(.next-nav-group-toggle,.next-nav-link) { border-radius: 10px; }
#app .next-rail .next-nav-link.active, #app .next-rail .next-nav-group.current>.next-nav-group-toggle {
  background: #465397; color: #fff; box-shadow: inset 3px 0 #b8caff;
}
#app .next-rail .next-nav-link.active>.ico { color: #fff; }
#app .next-rail .next-help { background: linear-gradient(100deg,#354581,#443e79); border: 1px solid #7180b2; }
#app .next-help-dot { background: #a5cdff; }
#app .topbar {
  background: #f8faffea;
  backdrop-filter: blur(16px);
  border-color: var(--fl-line);
  min-height: 58px;
}
#app .topbar :is(#project-filter,.scan-top) { border-color: var(--fl-line); border-radius: 10px; color: var(--fl-ink); }
#app .offline-strip:not([data-disconnected=true]) {
  background: #edf2fa; border-color: #dce3f1; color: #405473; padding-block: 3px;
}
#app .offline-strip:not([data-disconnected=true]) p::before {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #008362;
}
#app .offline-strip:not([data-disconnected=true]) button { background: transparent; border-color: transparent; color: #384c79; }
#app .offline-strip[data-disconnected=true] { border-bottom: 2px solid #1179bd; }
#app #content :is(.panel,.card,.stat,.project-card,.vehicle-card,.plan-register-card,.profile-panel,.company-section,.project-summary,.planning-shell,.pc-panel,.fb-card,.fb-canvas,.shop-sidebar,.table-wrap,.desk-inbox,.desk-side section) {
  border: 1px solid var(--fl-line); border-radius: 16px; box-shadow: var(--fl-shadow); background-color: #fff;
}
#app #content :is(.page-head,.pc-header,.fb-header) {
  padding: 12px 0 19px; border-bottom: 1px solid #ccd5ea; margin-bottom: 20px; gap: 12px;
}
#app #content :is(.page-head,.pc-header,.fb-header) h1 { font-size: clamp(26px,3vw,40px); letter-spacing: -.045em; }
#app #content :is(.pc-workspace,.fb-workspace) { --pc-green: var(--fl-accent); --pc-soft: #eef1ff; --pc-line: var(--fl-line); }
#app #content :is(.pc-metric,.fb-field-card,.shop-filter-panel) { border-color: var(--fl-line); border-radius: 12px; }
#app #content thead th { background: #f1f4fb; color: #495b77; }
#app #content tbody tr:hover { background: #f0f3ff; }
#app #content a { color: #3248ac; }
#app #content :is(input,select,textarea), #editor :is(input,select,textarea) { border-color: #bac6df; accent-color: var(--fl-accent); }
#app #content :is(input,textarea)::placeholder { color: #687792; }
#app #content :is(button.primary,.pc-primary,.fb-primary), #editor button.primary, .login-shell .login-form button.primary {
  background: linear-gradient(160deg,#5365e1,#3445ba); color: #fff; border: 1px solid #3446b3; border-radius: 10px; box-shadow: 0 2px 4px #30388c24;
}
#app #content :is(button.primary,.pc-primary,.fb-primary):hover, #editor button.primary:hover { background: #3040a9; }
#app #content :is(.plans-tabs button[aria-pressed=true],.form-template-tabs button.active,.library-tabs button[aria-pressed=true],.pc-tab[aria-selected=true],.fb-tab[aria-selected=true],.desk-tabs button[aria-pressed=true],.next-segmented button[aria-pressed=true]) {
  color: #283f9c; background: var(--fl-selected); border-color: #899be1;
}
#app #content .shop-page { --border: var(--fl-line); }
#app #content .shop-page .product-card { border-radius: 14px; box-shadow: var(--fl-shadow); }
#editor[open], .next-capture-sheet[open] { border: 1px solid #c9d3ed; box-shadow: 0 24px 90px #18255440; }
dialog::backdrop { background: #131c374f; backdrop-filter: blur(4px); }
#app :is(button,a,input,select,textarea,summary):focus-visible, #editor :focus-visible {
  outline: 3px solid #5873d6; outline-offset: 3px;
}
#app .login-shell .login-brand {
  background: linear-gradient(0deg,#0d145ce8,#111a6214),var(--fl-art) center / cover,#121958;
}
#app .login-shell .login-form-wrap { background: linear-gradient(140deg,#e4ebfb,#f6f6fc); }
#app .login-shell .login-form { border-radius: 20px; box-shadow: var(--fl-shadow); }
#app .login-shell .login-brand .eyebrow { color: #c6d8ff; }

#app #content .desk-header {
  min-height: 196px; padding: clamp(22px,3vw,42px); position: relative; isolation: isolate; overflow: hidden;
  border: 1px solid #34428b; border-radius: 19px; color: white; box-shadow: 0 8px 22px -12px #222e83a1;
  background: linear-gradient(104deg,#181e5e 0%,#292a88 46%,#0d095c 74%);
}
.desk-header::before {
  content: ""; position: absolute; inset: 0 0 0 28%; z-index: -1;
  background: var(--fl-art) right 48% / cover no-repeat;
  mask-image: linear-gradient(to right,transparent,#000 37%);
}
#app #content .desk-header>div { max-width: 72%; }
#app #content .desk-header h1 { color: white; font-size: clamp(32px,4vw,54px); line-height: 1.09; }
#app #content .desk-header p { color: #e0e6ff; margin: 0 0 8px; font-weight: 550; }
#app #content .desk-header button.primary {
  margin-top: 18px; min-height: 42px; padding-inline: 17px; color: #222e72; background: #f4f6ff; border-color: white;
}
#app #content .desk-header button.primary:hover { background: #dfe6ff; }
.desk-commands { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(160px,100%),1fr)); gap: 10px; margin: 14px 0 0; }
#app #content .desk-commands button[data-workspace-create] {
  min-width: 0; min-height: 64px; display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  text-align: left; background: #ffffffed; border: 1px solid var(--fl-line); border-radius: 12px;
  color: var(--fl-ink); font-size: 14px; font-weight: 600; box-shadow: var(--fl-shadow);
}
#app #content .desk-commands button:hover { border-color: #8e9dd9; background: #f7f8ff; }
.command-icon,.desk-commands button[data-workspace-create] .command-icon {
  display: grid; flex: 0 0 34px; height: 34px; place-items: center; background: #e5ebff; color: #3445ae; border-radius: 10px;
}
.desk-commands button[data-workspace-create=workReports] .command-icon { color: #6b3cad; background: #efe6ff; }
.desk-commands button[data-workspace-create=annotations] .command-icon { color: #1e4c9a; background: #fff0df; }
.desk-commands button[data-workspace-create=dailyReports] .command-icon { color: #007362; background: #def3ee; }
.desk-columns { padding-top: 18px; gap: 16px; }
.desk-section { padding: 20px 20px 14px; }
.desk-tabs { gap: 6px; padding: 5px 16px 11px; }
#app #content .desk-tabs button[data-home-kind] { border-radius: 8px; padding: 7px 10px; border: 1px solid transparent; min-height: 37px; }
#app #content .desk-tabs button[data-home-kind][aria-pressed=true] { background: var(--fl-selected); color: #2f4095; }
.desk-filter { border-bottom: 1px solid #e0e5f2; }
.desk-filter summary { width: fit-content; min-height: 40px; padding: 9px 20px; cursor: pointer; color: #42527a; font-size: 13px; }
.desk-filter summary .ico { width: 15px; height: 15px; margin: 0 7px; vertical-align: middle; }
.desk-tools { padding-top: 3px; }
#app #content .next-queue-row .next-kind-icon { color: #4157b2; background: #eef1ff; border-color: #dce3f8; }
#app #content .next-queue-subject strong { font-size: 15px; line-height: 1.4; }
#app #content .next-queue-subject small { color: var(--fl-muted); font-size: 12px; }
#app #content .next-queue-row .next-status { color: #384b74; background: #edf2fb; border-color: #d4def0; }
#app .next-bottom>button.active { color: #2f409b; background: #e8ecff; }
#app .next-bottom>.next-capture-trigger>.ico { color: white; background: #4354c7; }

@media (max-width:760px) {
  #app .topbar { min-height: 54px; padding: 6px 14px; }
  #app #content { padding: 14px 12px calc(100px + env(safe-area-inset-bottom)); }
  #app .topbar #project-filter { min-height: 42px; font-size: 14px; }
  #app .offline-strip:not([data-disconnected=true]) { padding: 0 14px; }
  #app .offline-strip button { min-height: 40px; }
  #app #content .desk-header { min-height: 148px; padding: 18px; border-radius: 15px; }
  #app #content .desk-header h1 { font-size: clamp(26px,8vw,36px); }
  #app #content .desk-header p { font-size: 12px; }
  #app #content .desk-header button.primary { min-height: 44px; margin-top: 12px; }
  .desk-commands { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; margin-top: 8px; }
  #app #content .desk-commands button[data-workspace-create] { gap: 8px; padding: 8px; min-height: 48px; font-size: 13px; overflow-wrap: anywhere; }
  .desk-commands button[data-workspace-create] .command-icon { flex-basis: 29px; height: 29px; }
  .desk-section { padding: 13px 14px 4px; }
  .desk-tabs { padding: 4px 10px 8px; }
  #app #content .desk-tabs button[data-home-kind],.desk-filter summary { min-height: 44px; }
  #app #content .next-queue-row { padding: 12px; }
  #app .next-bottom { background: #f9fafff2; border-top: 1px solid #cad3ed; backdrop-filter: blur(14px); }
}
@media (prefers-reduced-transparency: reduce) {
  #app .topbar, #app .next-bottom { background: #f8faff; backdrop-filter: none; }
}
@media (forced-colors: active) {
  #app #content .desk-header h1, #app #content .desk-header p { color: CanvasText; }
  .desk-header::before { display: none; }
  #app [aria-pressed=true], #app .next-rail .next-nav-link.active { outline: 2px solid Highlight; }
}

/* Readable ordering controls across the site and office layouts. */
#app #content .shop-page .shop-products { gap: 10px; }
#app #content .shop-page .product-card {
  background: #fff; color: #203049; border: 1px solid #c4cfdf;
  border-inline-start: 4px solid #5266bc; border-radius: 12px; padding: 14px;
}
#app #content .shop-page .catalog-buy .order-scope,
#app #content .shop-page .catalog-code,
#app #content .shop-page .catalog-subtitle { color: #43546a; }
#app #content .shop-page .catalog-title { color: #172a48; }
#app #content .shop-page .catalog-stock.available { color: #16613f; }
#app #content .shop-page .catalog-price { color: #182d4e; }
@media (max-width:760px) {
  #app #content .shop-page .catalog-body,
  #app #content .shop-page .catalog-buy,
  #app #content .shop-page .catalog-order { grid-template-columns: minmax(0,1fr); }
  #app #content .shop-page .catalog-order button,
  #app #content .shop-page :is(input,select) { min-height: 44px; font-size: 16px; }
  #app #content .shop-page .product-card { align-items: start; }
  #app .next-bottom > button { overflow-wrap: anywhere; }
  #editor :is(input:not([type=checkbox]):not([type=radio]),textarea,select) { font-size: 16px; }
}

#app #content .shop-page .shop-sidebar.is-open {
  display: grid; grid-template-columns: minmax(0,1fr); gap: 8px;
  max-height: min(66vh,42rem); overscroll-behavior: contain;
}
#app #content .shop-sidebar .shop-facets { position: static; width: auto; }
#app #content .shop-sidebar .shop-category-tree button { text-align: start; }
#app #content .shop-sidebar .shop-category-tree button.selected {
  color: #223781; background: #e9edff; box-shadow: inset 3px 0 #4354ba;
}
#app #content .planning-view-tabs button[aria-selected=true] {
  color: white; background: #354899; border-color: #354899;
}
@media (min-width:1000px) {
  #app #content .shop-layout:has(.shop-sidebar.is-open) {
    display: grid; grid-template-columns: minmax(250px,23%) minmax(0,1fr);
    gap: 18px; align-items: start;
  }
}
@media (max-width:760px) {
  #app #content :is(.plans-tabs,.planning-view-tabs,.form-template-tabs) {
    display: flex; max-width: 100%; flex-wrap: nowrap; overflow-x: auto;
    gap: 6px; padding: 4px 2px; scroll-padding-inline: 8px;
  }
  #app #content :is(.plans-tabs,.planning-view-tabs,.form-template-tabs) > button {
    flex: 0 0 auto; min-height: 44px; white-space: nowrap;
  }
  #app #content .dispatch-controls { display: grid; grid-template-columns: minmax(0,1fr); }
  #app #content .dispatch-controls :is(select,button) { width: 100%; min-height: 44px; }
  #help-chat.helmut-mode .help-composer textarea { font-size: 16px; }
  #editor .article-commerce-grid { grid-template-columns: minmax(0,1fr); }
  #editor .article-add { min-height: 48px; width: 100%; }
}
.home-screen-hint { padding: 4px 12px; }
.home-screen-hint summary { padding: 10px 0; cursor: pointer; font-weight: 650; }
.home-screen-hint details p { margin-bottom: 10px; }
.home-screen-hint button { margin: 0 -6px 0 4px; }

/* The same plan controls become a touch-friendly register on narrow screens. */
@media (max-width:760px) {
  #plan-register { border: 0; overflow: visible; }
  #plan-register .plans-table { display:block; width:100%; min-width:0; background:transparent; }
  #plan-register thead { display:block; overflow-x:auto; margin-bottom:10px; border-radius:9px; }
  #plan-register thead tr { display:flex; align-items:center; }
  #plan-register th { display:block; flex:none; }
  #plan-register th button { min-height:38px; }
  #plan-register tbody { display:grid; gap:10px; }
  #plan-register tbody tr {
    display:grid; grid-template-columns:minmax(0,1fr) auto;
    gap:8px 14px; padding:14px; border:1px solid #c4cfdf; border-radius:12px; background:white;
  }
  #plan-register tbody tr:has(:checked) { border-color:#465ab5; background:#f1f4ff; }
  #plan-register tbody td {
    display:block; grid-column:1/-1; max-width:none; width:auto; padding:0; border:0; font-size:14px;
  }
  #plan-register td:first-child { grid-column:2; grid-row:1; align-self:center; }
  #plan-register td:first-child input { width:24px; height:24px; }
  #plan-register td:nth-child(2) { grid-column:1; grid-row:1; }
  #plan-register td:nth-child(3) { grid-column:2; grid-row:2; }
  #plan-register td:nth-child(4) { grid-column:1; grid-row:2; }
  #plan-register td:nth-child(5) { order:1; }
  #plan-register td[data-mobile-label]::before {
    content:attr(data-mobile-label); display:block; font-size:12px; font-weight:600; color:#52617b;
  }
  #plan-register .plan-detail-link { font-size:16px; }
  #plan-register .subline { font-size:12px; margin-top:2px; }
  #plan-register .plans-pdf { width:100%; min-height:44px; }
}

#app #content .shop-quick-filters {
  display:flex; gap:6px; overflow-x:auto; margin:0 0 12px; padding:3px;
}
#app #content .shop-quick-filters button {
  display:inline-flex; align-items:center; gap:6px; flex:none; min-height:44px;
  padding:6px 12px; border-radius:22px; background:white; color:#273d62; border:1px solid #bdcadd;
}
#app #content .shop-quick-filters button[aria-pressed=true] { background:#354899; color:white; }
@media (min-width:761px) {
  #app #content .shop-page .shop-products:not(.is-list) {
    grid-template-columns:repeat(auto-fit,minmax(min(100%,340px),1fr));
  }
  #app #content .shop-page .product-card { display:flex; flex-direction:column; gap:12px; }
  #app #content .shop-page .catalog-body { flex:1; display:flex; flex-direction:column; width:100%; gap:5px; }
  #app #content .shop-page .catalog-buy {
    display:flex; flex-direction:column; gap:6px; margin-top:auto; padding-top:10px; align-items:stretch;
  }
  #app #content .shop-page .catalog-order { grid-template-columns:minmax(0,1fr); }
  #app #content .shop-page .catalog-buy button.primary { margin:0; }
}
