:root {
  --bg-page: #eef3ef;
  --bg-soft: #f7faf8;
  --surface: #ffffff;
  --surface-border: #d9e4dd;
  --surface-overlay: rgba(255, 255, 255, 0.9);
  --surface-border-strong: rgba(43, 97, 94, 0.16);
  --text-main: #12303b;
  --text-muted: #557078;
  --bg-orb-a: rgba(31, 138, 131, 0.16);
  --bg-orb-b: rgba(192, 140, 66, 0.14);
  --accent-sea: #1f8a83;
  --accent-sand: #c08c42;
  --accent-ember: #c95b3d;
  --accent-slate: #4a6777;
  --header-bg: rgba(248, 251, 249, 0.84);
  --header-border: rgba(39, 90, 87, 0.12);
  --nav-pill-bg: rgba(255, 255, 255, 0.86);
  --nav-pill-text: #34545f;
  --nav-pill-hover-border: rgba(31, 138, 131, 0.25);
  --nav-pill-hover-text: #134a56;
  --badge-bg: rgba(31, 138, 131, 0.08);
  --badge-border: rgba(25, 94, 96, 0.28);
  --badge-text: #16505a;
  --user-badge-bg: rgba(67, 120, 125, 0.08);
  --user-badge-border: rgba(25, 94, 96, 0.22);
  --user-badge-text: #1f5058;
  --outline-bg: rgba(245, 250, 248, 0.86);
  --outline-border: rgba(35, 93, 94, 0.3);
  --outline-text: #19515f;
  --outline-hover-bg: #eff8f4;
  --outline-hover-border: rgba(18, 77, 84, 0.45);
  --outline-hover-text: #113843;
  --modal-bg: rgba(255, 255, 255, 0.96);
  --ui-font-scale: 1;
  --ui-density-factor: 1;
  --ui-radius-factor: 1;
  --radius-lg: calc(20px * var(--ui-radius-factor));
  --radius-md: calc(14px * var(--ui-radius-factor));
  --radius-sm: calc(11px * var(--ui-radius-factor));
  --radius-card: calc(12px * var(--ui-radius-factor));
  --radius-pill: calc(999px * var(--ui-radius-factor));
  --control-padding-y: 0.375rem;
  --control-padding-x: 0.75rem;
  --button-padding-y: 0.375rem;
  --button-padding-x: 0.75rem;
  --table-cell-y: 0.5rem;
  --table-cell-x: 0.5rem;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --text-xs: 0.78rem;
  --text-sm: 0.84rem;
  --text-md: 0.92rem;
  --bp-mobile: 576;
  --bp-tablet: 992;
  --bp-desktop: 1200;
  --shadow-soft: 0 10px 26px rgba(22, 66, 61, 0.08);
  --shadow-strong: 0 16px 36px rgba(20, 61, 68, 0.18);
}

:root[data-theme="sand"] {
  --bg-page: #f5efe4;
  --bg-soft: #fbf7ef;
  --surface: #fffaf2;
  --surface-border: #e6d9be;
  --surface-overlay: rgba(255, 250, 242, 0.92);
  --surface-border-strong: rgba(128, 94, 58, 0.19);
  --text-main: #3f3224;
  --text-muted: #7d6752;
  --bg-orb-a: rgba(176, 114, 47, 0.18);
  --bg-orb-b: rgba(208, 151, 78, 0.18);
  --accent-sea: #b1722f;
  --accent-sand: #d0974e;
  --accent-ember: #b8573a;
  --accent-slate: #6f5b48;
  --header-bg: rgba(255, 247, 235, 0.9);
  --header-border: rgba(134, 103, 64, 0.2);
  --nav-pill-bg: rgba(255, 248, 238, 0.92);
  --nav-pill-text: #6b4e2f;
  --nav-pill-hover-border: rgba(181, 114, 47, 0.35);
  --nav-pill-hover-text: #5d3f1f;
  --badge-bg: rgba(208, 151, 78, 0.18);
  --badge-border: rgba(154, 105, 49, 0.26);
  --badge-text: #6f4f2a;
  --user-badge-bg: rgba(127, 93, 55, 0.15);
  --user-badge-border: rgba(127, 93, 55, 0.24);
  --user-badge-text: #5f4526;
  --outline-bg: rgba(255, 250, 241, 0.95);
  --outline-border: rgba(154, 105, 49, 0.3);
  --outline-text: #6a4a25;
  --outline-hover-bg: rgba(255, 243, 228, 0.98);
  --outline-hover-border: rgba(137, 87, 34, 0.44);
  --outline-hover-text: #573b1d;
  --modal-bg: rgba(255, 250, 244, 0.97);
  --shadow-soft: 0 12px 24px rgba(95, 74, 52, 0.12);
  --shadow-strong: 0 16px 36px rgba(90, 68, 47, 0.2);
}

:root[data-theme="forest"] {
  --bg-page: #e8f2ec;
  --bg-soft: #f1f8f4;
  --surface: #f9fffb;
  --surface-border: #cae1d3;
  --surface-overlay: rgba(249, 255, 251, 0.92);
  --surface-border-strong: rgba(42, 105, 74, 0.18);
  --text-main: #1f3c31;
  --text-muted: #4d7262;
  --bg-orb-a: rgba(47, 143, 99, 0.2);
  --bg-orb-b: rgba(121, 156, 74, 0.18);
  --accent-sea: #2f8f63;
  --accent-sand: #799c4a;
  --accent-ember: #bf5e42;
  --accent-slate: #3f6f5d;
  --header-bg: rgba(241, 249, 244, 0.9);
  --header-border: rgba(53, 112, 82, 0.18);
  --nav-pill-bg: rgba(245, 253, 247, 0.94);
  --nav-pill-text: #2b5a49;
  --nav-pill-hover-border: rgba(47, 143, 99, 0.34);
  --nav-pill-hover-text: #1e4b3a;
  --badge-bg: rgba(47, 143, 99, 0.15);
  --badge-border: rgba(44, 116, 83, 0.28);
  --badge-text: #2b5f4b;
  --user-badge-bg: rgba(55, 111, 88, 0.14);
  --user-badge-border: rgba(55, 111, 88, 0.24);
  --user-badge-text: #24533f;
  --outline-bg: rgba(243, 252, 246, 0.95);
  --outline-border: rgba(44, 116, 83, 0.3);
  --outline-text: #275b46;
  --outline-hover-bg: rgba(236, 249, 240, 0.98);
  --outline-hover-border: rgba(37, 98, 70, 0.42);
  --outline-hover-text: #1b4736;
  --modal-bg: rgba(247, 255, 250, 0.97);
  --shadow-soft: 0 10px 24px rgba(32, 90, 62, 0.12);
  --shadow-strong: 0 16px 36px rgba(27, 84, 58, 0.2);
}

:root[data-theme="dark"] {
  --bg-page: #141a1f;
  --bg-soft: #1b252d;
  --surface: #1e2a33;
  --surface-border: #334654;
  --surface-overlay: rgba(30, 42, 51, 0.92);
  --surface-border-strong: rgba(86, 117, 136, 0.34);
  --text-main: #e5edf2;
  --text-muted: #a3bccb;
  --bg-orb-a: rgba(61, 183, 168, 0.2);
  --bg-orb-b: rgba(63, 119, 163, 0.22);
  --accent-sea: #3db7a8;
  --accent-sand: #d7b269;
  --accent-ember: #d97558;
  --accent-slate: #3f77a3;
  --header-bg: rgba(20, 30, 37, 0.9);
  --header-border: rgba(97, 130, 149, 0.25);
  --nav-pill-bg: rgba(31, 45, 55, 0.94);
  --nav-pill-text: #d3e2eb;
  --nav-pill-hover-border: rgba(81, 170, 160, 0.44);
  --nav-pill-hover-text: #ffffff;
  --badge-bg: rgba(61, 183, 168, 0.16);
  --badge-border: rgba(75, 173, 162, 0.35);
  --badge-text: #b8f2eb;
  --user-badge-bg: rgba(71, 119, 163, 0.2);
  --user-badge-border: rgba(90, 140, 186, 0.36);
  --user-badge-text: #d0e4f8;
  --outline-bg: rgba(33, 49, 60, 0.95);
  --outline-border: rgba(93, 126, 147, 0.38);
  --outline-text: #d5e7f2;
  --outline-hover-bg: rgba(39, 57, 70, 0.98);
  --outline-hover-border: rgba(111, 151, 176, 0.46);
  --outline-hover-text: #ffffff;
  --modal-bg: rgba(26, 37, 46, 0.97);
  --shadow-soft: 0 14px 28px rgba(0, 0, 0, 0.35);
  --shadow-strong: 0 18px 40px rgba(0, 0, 0, 0.5);
}

:root[data-theme="vivid"] {
  --bg-page: #fff5f2;
  --bg-soft: #fff9f8;
  --surface: #ffffff;
  --surface-border: #ffd6c9;
  --surface-overlay: rgba(255, 255, 255, 0.94);
  --surface-border-strong: rgba(235, 128, 98, 0.22);
  --text-main: #3a2030;
  --text-muted: #7f4e66;
  --bg-orb-a: rgba(255, 61, 110, 0.18);
  --bg-orb-b: rgba(111, 94, 246, 0.2);
  --accent-sea: #ff6f61;
  --accent-sand: #ffc857;
  --accent-ember: #ff3d6e;
  --accent-slate: #6f5ef6;
  --header-bg: rgba(255, 244, 241, 0.92);
  --header-border: rgba(238, 136, 109, 0.22);
  --nav-pill-bg: rgba(255, 255, 255, 0.9);
  --nav-pill-text: #65314a;
  --nav-pill-hover-border: rgba(255, 111, 97, 0.34);
  --nav-pill-hover-text: #462034;
  --badge-bg: rgba(255, 61, 110, 0.11);
  --badge-border: rgba(255, 61, 110, 0.28);
  --badge-text: #9f2148;
  --user-badge-bg: rgba(111, 94, 246, 0.1);
  --user-badge-border: rgba(111, 94, 246, 0.24);
  --user-badge-text: #4637c9;
  --outline-bg: rgba(255, 255, 255, 0.96);
  --outline-border: rgba(232, 132, 106, 0.34);
  --outline-text: #763a55;
  --outline-hover-bg: rgba(255, 243, 237, 0.98);
  --outline-hover-border: rgba(215, 84, 48, 0.44);
  --outline-hover-text: #57253d;
  --modal-bg: rgba(255, 249, 246, 0.98);
  --shadow-soft: 0 10px 26px rgba(206, 88, 62, 0.17);
  --shadow-strong: 0 18px 40px rgba(156, 59, 98, 0.27);
}

:root[data-theme="arctic"] {
  --bg-page: #eaf4fb;
  --bg-soft: #f4f9fe;
  --surface: #ffffff;
  --surface-border: #cde0ef;
  --surface-overlay: rgba(255, 255, 255, 0.93);
  --surface-border-strong: rgba(70, 112, 151, 0.2);
  --text-main: #173447;
  --text-muted: #547287;
  --bg-orb-a: rgba(47, 136, 200, 0.16);
  --bg-orb-b: rgba(61, 95, 151, 0.18);
  --accent-sea: #2f88c8;
  --accent-sand: #74bde8;
  --accent-ember: #de7f56;
  --accent-slate: #3d5f97;
  --header-bg: rgba(244, 250, 255, 0.92);
  --header-border: rgba(69, 108, 146, 0.2);
  --nav-pill-bg: rgba(251, 255, 255, 0.92);
  --nav-pill-text: #2a5475;
  --nav-pill-hover-border: rgba(47, 136, 200, 0.33);
  --nav-pill-hover-text: #1d415f;
  --badge-bg: rgba(47, 136, 200, 0.13);
  --badge-border: rgba(52, 120, 170, 0.28);
  --badge-text: #1f5a84;
  --user-badge-bg: rgba(61, 95, 151, 0.14);
  --user-badge-border: rgba(61, 95, 151, 0.24);
  --user-badge-text: #23486c;
  --outline-bg: rgba(247, 252, 255, 0.96);
  --outline-border: rgba(61, 95, 151, 0.3);
  --outline-text: #245073;
  --outline-hover-bg: rgba(238, 247, 255, 0.98);
  --outline-hover-border: rgba(41, 79, 127, 0.44);
  --outline-hover-text: #1a3d5e;
  --modal-bg: rgba(248, 253, 255, 0.97);
  --shadow-soft: 0 10px 24px rgba(49, 97, 140, 0.12);
  --shadow-strong: 0 16px 36px rgba(39, 85, 128, 0.21);
}

:root[data-theme="copper"] {
  --bg-page: #f8eee8;
  --bg-soft: #fdf6f2;
  --surface: #fffdfb;
  --surface-border: #ead2c4;
  --surface-overlay: rgba(255, 252, 249, 0.93);
  --surface-border-strong: rgba(137, 84, 62, 0.22);
  --text-main: #432b23;
  --text-muted: #7f5b4f;
  --bg-orb-a: rgba(190, 106, 71, 0.18);
  --bg-orb-b: rgba(125, 78, 99, 0.16);
  --accent-sea: #be6a47;
  --accent-sand: #e2a45e;
  --accent-ember: #cc4b3f;
  --accent-slate: #7d4e63;
  --header-bg: rgba(255, 247, 242, 0.92);
  --header-border: rgba(143, 89, 65, 0.2);
  --nav-pill-bg: rgba(255, 250, 246, 0.93);
  --nav-pill-text: #6b4436;
  --nav-pill-hover-border: rgba(190, 106, 71, 0.34);
  --nav-pill-hover-text: #553327;
  --badge-bg: rgba(190, 106, 71, 0.14);
  --badge-border: rgba(149, 84, 58, 0.29);
  --badge-text: #6f3e2d;
  --user-badge-bg: rgba(125, 78, 99, 0.12);
  --user-badge-border: rgba(125, 78, 99, 0.24);
  --user-badge-text: #5d3448;
  --outline-bg: rgba(255, 251, 248, 0.96);
  --outline-border: rgba(149, 84, 58, 0.3);
  --outline-text: #6d3f30;
  --outline-hover-bg: rgba(255, 245, 238, 0.98);
  --outline-hover-border: rgba(121, 67, 45, 0.44);
  --outline-hover-text: #532f22;
  --modal-bg: rgba(255, 250, 246, 0.97);
  --shadow-soft: 0 10px 24px rgba(119, 77, 60, 0.13);
  --shadow-strong: 0 16px 36px rgba(104, 62, 48, 0.22);
}

:root[data-theme="graphite"] {
  --bg-page: #eceff3;
  --bg-soft: #f6f8fb;
  --surface: #ffffff;
  --surface-border: #cfd7e0;
  --surface-overlay: rgba(255, 255, 255, 0.93);
  --surface-border-strong: rgba(74, 88, 106, 0.2);
  --text-main: #1f2c38;
  --text-muted: #5c6e7f;
  --bg-orb-a: rgba(44, 108, 141, 0.14);
  --bg-orb-b: rgba(77, 86, 117, 0.16);
  --accent-sea: #2c6c8d;
  --accent-sand: #8da96b;
  --accent-ember: #b85d48;
  --accent-slate: #4d5675;
  --header-bg: rgba(245, 248, 251, 0.92);
  --header-border: rgba(74, 88, 106, 0.19);
  --nav-pill-bg: rgba(252, 254, 255, 0.92);
  --nav-pill-text: #3f5365;
  --nav-pill-hover-border: rgba(44, 108, 141, 0.31);
  --nav-pill-hover-text: #2d4253;
  --badge-bg: rgba(44, 108, 141, 0.13);
  --badge-border: rgba(60, 101, 129, 0.27);
  --badge-text: #2d5c77;
  --user-badge-bg: rgba(77, 86, 117, 0.12);
  --user-badge-border: rgba(77, 86, 117, 0.23);
  --user-badge-text: #35405d;
  --outline-bg: rgba(250, 252, 255, 0.96);
  --outline-border: rgba(77, 86, 117, 0.3);
  --outline-text: #394864;
  --outline-hover-bg: rgba(241, 245, 250, 0.98);
  --outline-hover-border: rgba(57, 77, 105, 0.44);
  --outline-hover-text: #28374d;
  --modal-bg: rgba(248, 251, 254, 0.97);
  --shadow-soft: 0 10px 24px rgba(61, 78, 98, 0.12);
  --shadow-strong: 0 16px 36px rgba(50, 69, 88, 0.2);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

html {
  font-size: calc(16px * var(--ui-font-scale));
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(60rem 30rem at -10% -10%, var(--bg-orb-a), transparent),
    radial-gradient(50rem 26rem at 110% 8%, var(--bg-orb-b), transparent),
    var(--bg-page);
}

@media (min-width: 1200px) {
  .container {
    max-width: min(1840px, calc(100vw - 2.4rem));
  }
}

:root[data-ui-font-scale="small"] {
  --ui-font-scale: 0.94;
}

:root[data-ui-font-scale="normal"] {
  --ui-font-scale: 1;
}

:root[data-ui-font-scale="large"] {
  --ui-font-scale: 1.08;
}

:root[data-ui-density="compact"] {
  --ui-density-factor: 0.88;
  --control-padding-y: 0.3rem;
  --control-padding-x: 0.64rem;
  --button-padding-y: 0.3rem;
  --button-padding-x: 0.68rem;
  --table-cell-y: 0.35rem;
  --table-cell-x: 0.4rem;
}

:root[data-ui-density="normal"] {
  --ui-density-factor: 1;
}

:root[data-ui-density="spacious"] {
  --ui-density-factor: 1.12;
  --control-padding-y: 0.48rem;
  --control-padding-x: 0.86rem;
  --button-padding-y: 0.48rem;
  --button-padding-x: 0.9rem;
  --table-cell-y: 0.62rem;
  --table-cell-x: 0.64rem;
}

:root[data-ui-radius="sharp"] {
  --ui-radius-factor: 0.68;
}

:root[data-ui-radius="normal"] {
  --ui-radius-factor: 1;
}

:root[data-ui-radius="soft"] {
  --ui-radius-factor: 1.32;
}

h1,
h2,
h3,
.brand-copy strong {
  font-family: "Sora", sans-serif;
  letter-spacing: -0.02em;
}

.top-shell {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(12px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
}

.top-shell > .container.py-3 {
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
}

.top-shell > .container.pb-3 {
  padding-bottom: 0.5rem !important;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.58rem;
  color: inherit;
}

.brand-mark {
  width: 2.8rem;
  height: 2.8rem;
  display: grid;
  place-items: center;
  border-radius: 0.7rem;
  color: #fff;
  font-family: "Sora", sans-serif;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-sea), var(--accent-slate) 70%);
  box-shadow: 0 8px 20px rgba(26, 95, 103, 0.28);
}

.brand-mark--logo {
  background: transparent;
  box-shadow: none;
  padding: 0;
  overflow: hidden;
}

.brand-mark__img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 0.7rem;
}

.brand-copy {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-copy small {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.header-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.company-logo-header {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.6rem;
  overflow: hidden;
  border: 1px solid rgba(85, 122, 136, 0.35);
  background: rgba(255, 255, 255, 0.92);
  flex: 0 0 auto;
}

.company-logo-header--brand {
  width: clamp(5.6rem, 11vw, 8.2rem);
  height: clamp(3rem, 5.2vw, 4.3rem);
  max-width: 8.2rem;
  max-height: 4.3rem;
  margin-left: 0.45rem;
  border-radius: 0.9rem;
}

.company-logo-header__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.company-logo-header--brand .company-logo-header__img {
  object-fit: contain;
  object-position: center;
}

.global-search {
  position: relative;
  min-width: min(420px, 68vw);
}

.global-search__input {
  min-width: min(420px, 68vw);
}

.global-search__results {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  right: auto;
  width: max(100%, min(560px, 86vw));
  max-height: 60vh;
  overflow: auto;
  border: 1px solid var(--line-color);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  z-index: 70;
}

.global-search__item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.62rem 0.74rem;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--line-color);
}

.global-search__item:last-child {
  border-bottom: 0;
}

.global-search__item:hover {
  background: var(--outline-hover-bg);
}

.global-search__meta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.global-search__title {
  line-height: 1.25;
}

.global-search__subtitle,
.global-search__empty {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.global-search__empty {
  padding: 0.62rem 0.74rem;
}

.global-search__section {
  padding: 0.62rem 0.74rem;
  border-bottom: 1px solid var(--line-color);
}

.global-search__section:last-child {
  border-bottom: 0;
}

.global-search__section-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.global-search__chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.notif-center {
  position: relative;
}

.notif-center__toggle {
  position: relative;
}

.notif-center__badge {
  position: absolute;
  top: -0.35rem;
  right: -0.35rem;
  min-width: 1.05rem;
  height: 1.05rem;
  border-radius: 999px;
  padding: 0 0.2rem;
  font-size: 0.68rem;
  line-height: 1.05rem;
  text-align: center;
  background: #c95b3d;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.notif-center__panel {
  position: absolute;
  top: calc(100% + 0.45rem);
  left: 0;
  right: auto;
  width: min(420px, calc(100vw - 24px));
  max-height: min(68vh, 520px);
  border: 1px solid var(--line-color);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  z-index: 75;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.notif-center__foot {
  padding: 0.62rem 0.74rem;
  border-top: 1px solid var(--line-color);
}

.notif-center__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.62rem 0.74rem;
  border-bottom: 1px solid var(--line-color);
}

.notif-center__list {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.notif-center__row {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  border-bottom: 1px solid var(--line-color);
  background: var(--surface);
}

.notif-center__row:last-child {
  border-bottom: 0;
}

.notif-center__row:hover {
  background: var(--outline-hover-bg);
}

.notif-center__item {
  flex: 1;
  min-width: 0;
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 0.62rem 0.2rem 0.62rem 0.74rem;
  line-height: 1.2;
}

.notif-center__row.is-unread {
  border-left: 3px solid var(--accent-sea);
}

.notif-center__row.is-unread .notif-center__item {
  padding-left: calc(0.74rem - 3px);
}

.notif-center__row.is-inactive .notif-center__title {
  opacity: 0.86;
}

.notif-center__actions {
  position: relative;
  padding: 0.45rem 0.62rem 0.45rem 0.2rem;
  flex: 0 0 auto;
}

.notif-center__menu-toggle {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 999px;
  border: 1px solid var(--line-color);
  background: var(--surface);
  color: var(--text-main);
  font-size: 1.05rem;
  line-height: 1;
}

.notif-center__menu-toggle:hover {
  background: var(--outline-hover-bg);
}

.notif-center__menu {
  position: absolute;
  top: calc(100% + 0.2rem);
  right: 0;
  min-width: 12rem;
  border: 1px solid var(--line-color);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  z-index: 1355;
  overflow: hidden;
}

.notif-center__menu-item {
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line-color);
  background: var(--surface);
  color: var(--text-main);
  padding: 0.5rem 0.65rem;
  font-size: 0.85rem;
}

.notif-center__menu-item:last-child {
  border-bottom: 0;
}

.notif-center__menu-item:hover {
  background: var(--outline-hover-bg);
}

.notif-center__menu-item.is-danger {
  color: #b84444;
}

.notif-center__title {
  display: block;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.notif-center__text {
  display: block;
  margin-bottom: 0.2rem;
}

.notif-center__meta {
  display: block;
}

.notif-center__text,
.notif-center__meta,
.notif-center__empty {
  color: var(--text-muted);
  font-size: 0.83rem;
}

.notif-center__empty {
  padding: 0.65rem 0.74rem;
}

body.notif-modal-open {
  overflow: hidden;
}

.notif-modal {
  position: fixed;
  inset: 0;
  z-index: 1350;
  display: grid;
  place-items: center;
}

.notif-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 22, 31, 0.42);
}

.notif-modal__dialog {
  position: relative;
  width: min(980px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  background: var(--surface);
  border: 1px solid var(--line-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.notif-modal__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line-color);
  background: var(--surface);
}

.notif-modal__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line-color);
  background: var(--surface);
}

.notif-modal__tools .btn.active {
  background: var(--accent-sea);
  border-color: var(--accent-sea);
  color: #fff;
}

.notif-modal__push {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.85rem;
  margin-left: auto;
}

.notif-modal__push-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.notif-modal__push-option {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-main);
}

.notif-modal__push-option input[type="checkbox"] {
  width: 0.92rem;
  height: 0.92rem;
}

.notif-modal__push-status {
  font-size: 0.76rem;
  color: var(--text-muted);
  min-width: 10rem;
}

.notif-modal__push-status.is-error {
  color: #b14f38;
}

.notif-modal__list {
  flex: 1;
  min-height: 220px;
  overflow: auto;
  background: var(--surface);
}

.notif-modal__list .notif-center__item {
  padding: 0.75rem 1rem;
}

.notif-modal__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  border-top: 1px solid var(--line-color);
  background: var(--surface);
}

.notif-modal__summary {
  color: var(--text-muted);
  font-size: 0.84rem;
}

.connection-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--badge-border);
  border-radius: 999px;
  padding: 0.16rem 0.55rem;
  background: var(--badge-bg);
  color: var(--badge-text);
  font-size: 0.74rem;
}

.offline-banner {
  display: none;
  position: sticky;
  top: 0;
  z-index: 1300;
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid rgba(150, 53, 31, 0.35);
  background: rgba(201, 91, 61, 0.12);
  color: #6a2818;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
}

.offline-banner.is-visible {
  display: block;
}

.pwa-update-banner {
  display: none;
  position: sticky;
  top: 0;
  z-index: 1310;
  padding: 0.5rem 0.9rem;
  border-bottom: 1px solid rgba(31, 138, 131, 0.42);
  background: rgba(31, 138, 131, 0.12);
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
}

.pwa-update-banner.is-visible {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.65rem;
}

.user-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--user-badge-border);
  border-radius: 999px;
  padding: 0.14rem 0.5rem;
  background: var(--user-badge-bg);
  color: var(--user-badge-text);
  font-size: 0.74rem;
  font-weight: 600;
}

.header-logout {
  padding: 0.12rem 0.5rem;
  font-size: 0.8rem;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.mobile-nav-toggle,
.mobile-nav-overlay,
.mobile-nav-drawer {
  display: none;
}

.mobile-nav-toggle {
  align-items: center;
  gap: 0.42rem;
  margin-left: auto;
}

.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(11, 26, 32, 0.5);
  backdrop-filter: blur(2px);
}

.mobile-nav-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(86vw, 340px);
  z-index: 1210;
  background: var(--modal-bg);
  border-left: 1px solid var(--surface-border-strong);
  box-shadow: -20px 0 36px rgba(12, 36, 44, 0.22);
  padding: 0.85rem;
  overflow: auto;
  transform: translateX(100%);
  transition: transform 180ms ease;
}

.mobile-nav-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}

.mobile-nav-list {
  display: grid;
  gap: 0.45rem;
}

.mobile-nav-list__link {
  display: block;
  color: var(--nav-pill-text);
  text-decoration: none;
  border: 1px solid var(--surface-border-strong);
  border-radius: var(--radius-card);
  padding: 0.65rem 0.72rem;
  background: var(--nav-pill-bg);
  font-weight: 600;
}

.mobile-nav-list__link.is-active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent-sea), var(--accent-slate));
}

body.mobile-nav-open .mobile-nav-overlay {
  display: block;
}

body.mobile-nav-open .mobile-nav-drawer {
  transform: translateX(0);
}

.main-nav__link {
  color: var(--nav-pill-text);
  text-decoration: none;
  border: 1px solid transparent;
  background: var(--nav-pill-bg);
  padding: 0.38rem 0.78rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 180ms ease;
}

.main-nav__link:hover {
  transform: translateY(-1px);
  border-color: var(--nav-pill-hover-border);
  color: var(--nav-pill-hover-text);
}

.main-nav__link.is-active {
  background: linear-gradient(135deg, var(--accent-sea), var(--accent-slate));
  color: #fff;
  box-shadow: 0 8px 18px rgba(24, 87, 96, 0.25);
}

.main-nav__more {
  position: relative;
}

.main-nav__summary {
  list-style: none;
  cursor: pointer;
}

.main-nav__summary::-webkit-details-marker {
  display: none;
}

.main-nav__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  min-width: 190px;
  display: grid;
  gap: 0.35rem;
  padding: 0.5rem;
  border-radius: var(--radius-card);
  border: 1px solid var(--surface-border-strong);
  background: var(--modal-bg);
  box-shadow: 0 12px 30px rgba(12, 36, 44, 0.2);
  z-index: 20;
}

.main-nav__more:not([open]) .main-nav__menu {
  display: none;
}

.main-nav__menu .main-nav__link {
  display: block;
  text-align: left;
  font-size: 0.86rem;
  padding: 0.42rem 0.68rem;
}

:root[data-theme="dark"] .main-nav__menu {
  background: rgba(24, 38, 48, 0.96);
  border-color: rgba(90, 124, 143, 0.36);
}

.hero-panel,
.surface-card,
.kpi-card {
  animation: riseIn 420ms ease both;
}

.hero-panel {
  border-radius: var(--radius-lg);
  padding: clamp(0.72rem, 1.2vw, 0.95rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.72rem;
  color: #e9f4f3;
  background:
    linear-gradient(130deg, var(--accent-slate), var(--accent-sea)),
    radial-gradient(circle at 80% 30%, rgba(255, 255, 255, 0.08), transparent 60%);
  box-shadow: var(--shadow-strong);
}

.hero-panel h1 {
  margin: 0;
  font-size: clamp(1.08rem, 1.65vw, 1.3rem);
}

.hero-panel .lead {
  font-size: 0.82rem;
  color: rgba(232, 244, 241, 0.9);
  max-width: 78ch;
}

.hero-actions-stack {
  display: grid;
  gap: 0.55rem;
  justify-items: end;
}

.order-context-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}

.order-context-btn {
  border: 1px solid rgba(233, 244, 242, 0.34);
  background: rgba(16, 48, 66, 0.26);
  color: #e9f4f3;
  font-size: 0.82rem;
  border-radius: var(--radius-pill);
  padding: 0.32rem 0.72rem;
  font-weight: 600;
}

.order-context-btn:hover,
.order-context-btn:focus-visible {
  background: rgba(16, 48, 66, 0.45);
  border-color: rgba(233, 244, 242, 0.56);
}

.order-context-btn.is-primary {
  background: rgba(36, 157, 147, 0.38);
  border-color: rgba(145, 242, 233, 0.58);
}

.order-context-btn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.order-summary-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.7rem;
}

.order-summary-item {
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  padding: 0.62rem 0.68rem;
  min-width: 0;
}

.order-summary-item span {
  display: block;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.order-summary-item strong {
  display: block;
  font-size: 0.96rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-summary-item--tasks {
  display: grid;
  gap: 0.35rem;
}

.order-summary-progress {
  width: 100%;
  height: 0.34rem;
  border-radius: 999px;
  background: rgba(35, 88, 96, 0.14);
  overflow: hidden;
}

.order-summary-progress span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(140deg, var(--accent-sea), var(--accent-slate));
}

.order-workspace-tabs-wrap {
  padding: 0.55rem;
}

.order-workspace-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.45rem;
  overflow-x: auto;
  scrollbar-width: thin;
}

.order-workspace-tab {
  border: 1px solid var(--surface-border-strong);
  background: var(--bg-soft);
  color: var(--text-main);
  border-radius: var(--radius-pill);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  white-space: nowrap;
}

.order-workspace-tab.is-active {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(140deg, #1f8a83, #2c6f84);
}

.order-overview-meta__item {
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  background: var(--bg-soft);
  padding: 0.45rem 0.55rem;
}

.order-overview-meta__item span {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-muted);
}

.order-overview-meta__item strong {
  display: block;
  font-size: 0.86rem;
  margin-top: 0.12rem;
}

.order-compact-details {
  border: 1px dashed var(--surface-border-strong);
  border-radius: 10px;
  padding: 0.38rem 0.56rem;
}

.order-compact-details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-main);
}

.order-live-panel {
  padding: 0.4rem 0.52rem;
}

.order-live-panel .vstack {
  display: grid !important;
  grid-template-columns: minmax(120px, 1.08fr) repeat(3, minmax(146px, 1fr));
  align-items: center;
  gap: 0.3rem;
}

.order-live-panel .surface-card__head {
  margin-bottom: 0.26rem;
}

.order-live-panel .surface-card__head h2 {
  font-size: 1rem;
  margin: 0;
}

.order-live-panel__track {
  width: 100%;
  height: 0.32rem;
  border-radius: 999px;
  background: rgba(35, 88, 96, 0.16);
  overflow: hidden;
  align-self: center;
}

.order-live-panel__track > span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(140deg, var(--accent-sea), var(--accent-slate));
}

.order-live-panel__row {
  border: 1px solid var(--surface-border);
  border-radius: 9px;
  padding: 0.2rem 0.34rem;
  background: rgba(255, 255, 255, 0.46);
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}

.order-live-panel__row span {
  display: inline;
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.order-live-panel__row strong {
  display: inline;
  font-size: 0.76rem;
}

:root[data-theme="dark"] .order-live-panel__row {
  background: rgba(30, 44, 56, 0.72);
  border-color: rgba(90, 124, 143, 0.36);
}

[data-order-tab-panel][hidden],
[data-order-tab-content][hidden] {
  display: none !important;
}

@media (max-width: 1200px) {
  .order-live-panel .vstack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .order-live-panel__track {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .order-live-panel .vstack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .order-live-panel .vstack {
    grid-template-columns: 1fr;
  }
}

.calendar-filter-bar {
  min-width: min(480px, 92vw);
  padding: 0.5rem 0.6rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.calendar-filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.55rem;
  max-height: 132px;
  overflow: auto;
}

.calendar-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 0.18rem 0.58rem;
  color: #eaf4f3;
  font-size: 0.82rem;
  line-height: 1.1;
  white-space: nowrap;
}

.calendar-filter-chip input {
  margin: 0;
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: rgba(232, 244, 241, 0.84);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.08em;
  font-size: 0.73rem;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.9rem;
}

.kpi-grid--compact {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.kpi-card {
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow-soft);
  padding: 1rem 1.05rem;
  position: relative;
  overflow: hidden;
}

.kpi-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 4px;
  opacity: 0.85;
}

.kpi-card[data-accent="sea"]::after {
  background: linear-gradient(90deg, var(--accent-sea), #4db9a8);
}

.kpi-card[data-accent="sand"]::after {
  background: linear-gradient(90deg, var(--accent-sand), #d8b66f);
}

.kpi-card[data-accent="ember"]::after {
  background: linear-gradient(90deg, var(--accent-ember), #e8865d);
}

.kpi-card[data-accent="slate"]::after {
  background: linear-gradient(90deg, var(--accent-slate), #7090a0);
}

.kpi-card p {
  margin-bottom: 0.35rem;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.86rem;
}

.kpi-card strong {
  font-family: "Sora", sans-serif;
  font-size: 1.5rem;
}

.surface-card {
  background: var(--surface-overlay);
  border: 1px solid var(--surface-border-strong);
  border-radius: var(--radius-md);
  padding: calc(var(--space-4) * var(--ui-density-factor));
  box-shadow: var(--shadow-soft);
}

.surface-card h2 {
  margin: 0;
  font-size: 1.08rem;
}

:root[data-theme="dark"] .form-label,
:root[data-theme="dark"] .main-nav__link,
:root[data-theme="dark"] .surface-card h2,
:root[data-theme="dark"] .surface-card__head span,
:root[data-theme="dark"] .muted,
:root[data-theme="dark"] td,
:root[data-theme="dark"] th,
:root[data-theme="dark"] .table,
:root[data-theme="dark"] .empty-state {
  color: var(--text-main);
}

:root[data-theme="dark"] .form-control,
:root[data-theme="dark"] .form-select,
:root[data-theme="dark"] textarea {
  background: rgba(25, 38, 47, 0.92);
  border-color: rgba(101, 133, 151, 0.38);
  color: var(--text-main);
}

:root[data-theme="dark"] .table > :not(caption) > * > * {
  border-color: rgba(84, 114, 133, 0.34);
}

:root[data-theme="dark"] .table thead th {
  color: #b9ceda;
  border-bottom-color: rgba(90, 122, 142, 0.4);
}

:root[data-theme="dark"] .table tbody tr {
  border-color: rgba(76, 106, 126, 0.28);
}

:root[data-theme="dark"] .table tbody tr:hover {
  background: rgba(56, 84, 103, 0.28);
}

:root[data-theme="dark"] .status-chip {
  border-color: rgba(92, 129, 149, 0.44);
  background: rgba(34, 52, 64, 0.9);
  color: #d7e8f2;
}

:root[data-theme="dark"] .status-chip.is-active {
  color: #ffffff;
  border-color: rgba(173, 236, 230, 0.85);
  box-shadow: inset 0 0 0 2px rgba(125, 201, 193, 0.42);
}

:root[data-theme="dark"] .status-chip.is-upcoming::after {
  background: rgba(92, 129, 149, 0.58);
}

:root[data-theme="dark"] .status-chip.is-complete {
  border-color: rgba(80, 171, 163, 0.52);
  background: rgba(43, 87, 96, 0.65);
  color: #cfe8e4;
}

:root[data-theme="dark"] .stack-list li,
:root[data-theme="dark"] .history-list li,
:root[data-theme="dark"] .task-item,
:root[data-theme="dark"] .tasks-priority-col,
:root[data-theme="dark"] .checklist-section,
:root[data-theme="dark"] .checklist-item,
:root[data-theme="dark"] .availability-week,
:root[data-theme="dark"] .anw-cell {
  background: rgba(25, 38, 47, 0.9);
  border-color: rgba(90, 124, 143, 0.36);
}

:root[data-theme="dark"] .history-day-divider {
  background: transparent !important;
  border: 0 !important;
}

:root[data-theme="dark"] .history-day-divider span {
  color: #a8c0cd;
}

:root[data-theme="dark"] .history-day-divider span::after {
  background: rgba(90, 124, 143, 0.5);
}

:root[data-theme="dark"] .history-entry-icon {
  border-color: rgba(90, 124, 143, 0.5);
  background: rgba(28, 47, 58, 0.92);
  color: #c7deea;
}

:root[data-theme="dark"] .history-type-badge {
  border-color: rgba(90, 124, 143, 0.56);
  background: rgba(29, 49, 61, 0.92);
  color: #c7deea;
}

:root[data-theme="dark"] .history-type-status {
  border-color: rgba(92, 175, 155, 0.55);
  background: rgba(34, 74, 67, 0.9);
  color: #bde8dc;
}

:root[data-theme="dark"] .history-type-invoice {
  border-color: rgba(183, 161, 104, 0.58);
  background: rgba(82, 67, 35, 0.88);
  color: #edd9ad;
}

:root[data-theme="dark"] .history-type-time {
  border-color: rgba(95, 138, 181, 0.58);
  background: rgba(34, 60, 87, 0.88);
  color: #c5dcf5;
}

:root[data-theme="dark"] .history-type-document {
  border-color: rgba(143, 117, 189, 0.58);
  background: rgba(60, 43, 83, 0.88);
  color: #dccff4;
}

:root[data-theme="dark"] .order-list-status-text {
  color: #c7deea;
}

:root[data-theme="dark"] .tasks-priority-col > header h3,
:root[data-theme="dark"] .tasks-priority-col > header span {
  color: var(--text-main);
}

:root[data-theme="dark"] .task-view-switch {
  background: rgba(17, 30, 42, 0.65);
  border-color: rgba(91, 122, 141, 0.32);
}

:root[data-theme="dark"] .checklist-item-check span,
:root[data-theme="dark"] .task-item strong,
:root[data-theme="dark"] .task-item small,
:root[data-theme="dark"] .anw-cell strong,
:root[data-theme="dark"] .anw-cell small,
:root[data-theme="dark"] .stack-list span,
:root[data-theme="dark"] .history-list span {
  color: var(--text-main);
}

.surface-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.stammdaten-section {
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  padding: 0.72rem 0.78rem;
}

.stammdaten-section__title {
  margin: 0 0 0.55rem;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.surface-card__head span {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Keep inline span labels inside action buttons readable. */
.surface-card__head .btn span {
  color: inherit;
  font-size: inherit;
}

.muted {
  color: var(--text-muted);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: #355762;
}

.form-control,
.form-select,
textarea {
  border-radius: var(--radius-sm);
  border-color: #c7d9d2;
  background: #fbfdfc;
  color: var(--text-main);
  padding: var(--control-padding-y) var(--control-padding-x);
}

.form-control:focus,
.form-select:focus,
textarea:focus {
  box-shadow: 0 0 0 0.18rem rgba(31, 138, 131, 0.18);
  border-color: #67ada4;
}

.btn {
  border-radius: var(--radius-card);
  font-weight: 600;
  --bs-btn-padding-y: var(--button-padding-y);
  --bs-btn-padding-x: var(--button-padding-x);
}

.btn-primary {
  background: linear-gradient(140deg, var(--accent-sea), var(--accent-slate));
  border: 0;
  box-shadow: 0 8px 18px rgba(25, 90, 102, 0.25);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  filter: brightness(0.95);
}

.btn-outline-light {
  color: var(--outline-text);
  border-color: var(--outline-border);
  background: var(--outline-bg);
}

.btn-outline-light:hover,
.btn-outline-light:focus-visible {
  color: var(--outline-hover-text);
  border-color: var(--outline-hover-border);
  background: var(--outline-hover-bg);
}

.status-chip-group {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.7rem;
  overflow-x: auto;
  padding-bottom: 0.2rem;
}

.status-chip {
  position: relative;
  border: 1px solid #c2d3cc;
  background: #f7fbf9;
  color: #214b57;
  font-size: 0.83rem;
  border-radius: var(--radius-pill);
  padding: 0.44rem 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  flex: 0 0 auto;
}

.status-chip::after {
  content: "";
  position: absolute;
  top: 50%;
  left: calc(100% + 0.2rem);
  width: 0.5rem;
  height: 2px;
  background: #c5d5cf;
  transform: translateY(-50%);
}

.status-chip:last-child::after {
  display: none;
}

.status-chip.is-upcoming {
  background: #f7fbf9;
  border-color: #c2d3cc;
  color: #214b57;
}

.status-chip.is-complete {
  background: rgba(31, 138, 131, 0.14);
  border-color: rgba(31, 138, 131, 0.35);
  color: #1f6f74;
}

.status-chip.is-complete::after,
.status-chip.is-active::after {
  background: #1f8a83;
}

.status-chip:hover {
  border-color: rgba(31, 138, 131, 0.4);
}

.status-chip.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.status-chip.is-active {
  border-color: rgba(146, 242, 233, 0.75);
  color: #fff;
  background: linear-gradient(140deg, #1f8a83, #2c6f84);
  box-shadow: inset 0 0 0 2px rgba(205, 249, 243, 0.48);
  z-index: 1;
}

.status-chip-group--flow {
  scrollbar-width: thin;
}

.next-step-wrap {
  border-top: 1px dashed rgba(39, 96, 94, 0.2);
  padding-top: 0.7rem;
}

.next-step-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.next-step-btn {
  border: 1px solid #c2d3cc;
  background: #f7fbf9;
  color: #214b57;
  font-size: 0.84rem;
  border-radius: var(--radius-pill);
  padding: 0.38rem 0.78rem;
  font-weight: 600;
}

.next-step-btn.is-recommended {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(140deg, #1f8a83, #2c6f84);
}

.next-step-btn.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.table {
  color: var(--text-main);
  --bs-table-bg: transparent;
}

.table > :not(caption) > * > * {
  padding: var(--table-cell-y) var(--table-cell-x);
}

.table thead th {
  color: #40616a;
  font-size: 0.77rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom-color: #d4e2dd;
}

.table tbody tr {
  border-color: #e2ece7;
}

.table tbody tr:hover {
  background: rgba(230, 241, 237, 0.45);
}

.table tbody tr.is-selected {
  background: rgba(31, 138, 131, 0.14);
}

.order-list-row {
  cursor: pointer;
  --order-row-accent: transparent;
}

.order-list-row.is-selected {
  background: rgba(31, 138, 131, 0.14);
}

.order-list-row td:first-child strong {
  color: #0f4f56;
}

.order-list-row td:first-child {
  border-left: 4px solid var(--order-row-accent);
  padding-left: 0.6rem;
}

.order-list-row--offen {
  --order-row-accent: #4f82e6;
}

.order-list-row--in-bearbeitung {
  --order-row-accent: #1f8a83;
}

.order-list-row--wartend {
  --order-row-accent: #c08c42;
}

.order-list-row--leistung-erbracht {
  --order-row-accent: #6a73d8;
}

.order-list-row--re-versendet {
  --order-row-accent: #c95b3d;
}

.order-list-row--abgeschlossen,
.order-list-row--archiviert {
  --order-row-accent: #5f7680;
}

.order-list-row--storniert {
  --order-row-accent: #c34f4f;
}

.order-list-status-text {
  font-size: 0.79rem;
  font-weight: 700;
  color: #365d68;
}

.workspace-shell {
  display: grid;
  gap: calc(var(--space-4) * var(--ui-density-factor));
}

body[data-page="aufgaben"] .tasks-workspace.workspace-shell {
  display: flex;
}

.panel-list-card {
  min-width: 0;
}

.panel-filter-card {
  position: relative;
  z-index: 1;
}

.panel-filter-strip {
  border-top: 1px dashed rgba(39, 96, 94, 0.2);
  border-bottom: 1px dashed rgba(39, 96, 94, 0.2);
  padding: 0.72rem 0;
}

.panel-table-scroll {
  min-height: 0;
}

.editor-stack {
  display: grid;
  gap: calc(var(--space-4) * var(--ui-density-factor));
}

.order-workspace {
  display: grid;
  gap: calc(1rem * var(--ui-density-factor));
}

.order-list-card {
  min-width: 0;
}

.order-list-filters {
  border-top: 1px dashed rgba(39, 96, 94, 0.2);
  border-bottom: 1px dashed rgba(39, 96, 94, 0.2);
  padding: 0.72rem 0;
}

.order-list-filters .btn.is-active {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(140deg, #1f8a83, #2c6f84);
}

#orderListScopeTabs .btn {
  --bs-btn-padding-y: 0.26rem;
  --bs-btn-padding-x: 0.62rem;
  font-size: 0.78rem;
}

.order-list-table-wrap {
  min-height: 0;
}

.order-list-page-shell {
  min-width: 0;
}

.request-workspace {
  display: grid;
  gap: calc(1rem * var(--ui-density-factor));
}

.request-list-card {
  min-width: 0;
}

.request-list-filters {
  border-top: 1px dashed rgba(39, 96, 94, 0.2);
  border-bottom: 1px dashed rgba(39, 96, 94, 0.2);
  padding: 0.72rem 0;
}

.request-list-table-wrap {
  min-height: 0;
}

.request-list-page-shell {
  min-width: 0;
}

.request-list-page-shell tbody tr {
  cursor: pointer;
}

.request-editor-stack {
  display: grid;
  gap: calc(1rem * var(--ui-density-factor));
}

.request-editor-head {
  align-items: flex-start;
}

.request-editor-head span {
  max-width: 42ch;
  line-height: 1.3;
}

.request-form-actions {
  margin-top: 0.35rem;
  padding-top: 0.65rem;
  border-top: 1px dashed rgba(39, 96, 94, 0.24);
}

.request-task-table th {
  font-size: 0.73rem;
}

.request-task-table td {
  padding-top: 0.42rem;
  padding-bottom: 0.42rem;
  font-size: 0.9rem;
}

body[data-page="anfragen"] #requestForm .row.g-3 {
  --bs-gutter-x: 0.75rem;
  --bs-gutter-y: 0.65rem;
}

body[data-page="anfragen"] #requestForm textarea {
  min-height: 90px;
}

body[data-page="anfragen"] #requestNotes {
  min-height: 74px;
}

.tasks-filter-card {
  position: relative;
  z-index: 1;
}

.tasks-filter-sticky {
  position: sticky;
  top: 92px;
  z-index: 20;
  backdrop-filter: blur(6px);
}

.task-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.task-view-switch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.15rem;
  padding: 0.22rem;
  border: 1px solid rgba(37, 98, 112, 0.26);
  border-radius: 999px;
  background: rgba(22, 45, 60, 0.18);
}

.task-view-switch .btn {
  border-radius: 999px;
  min-width: 110px;
}

.task-view-switch .btn.is-active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent-sea), var(--accent-slate));
}

.task-scope-filters {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.task-scope-filters__label {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.tasks-list-card {
  min-width: 0;
}

.tasks-side-col {
  min-width: 0;
}

.tasks-priority-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.7rem;
}

.tasks-priority-col {
  border: 1px solid rgba(37, 98, 112, 0.18);
  border-radius: 12px;
  padding: 0.55rem;
  background: rgba(246, 252, 250, 0.88);
}

.tasks-priority-col > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.tasks-priority-col > header h3 {
  margin: 0;
  font-size: 0.84rem;
}

.tasks-priority-col > header span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.stack-list,
.task-column,
.history-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.stack-list li,
.history-list li {
  border: 1px solid #d6e4df;
  border-radius: 12px;
  padding: 0.75rem;
  margin-bottom: 0.7rem;
  background: #fcfefd;
}

.stack-list li:last-child,
.history-list li:last-child {
  margin-bottom: 0;
}

.stack-list strong,
.history-list strong {
  display: block;
  font-size: 0.94rem;
}

.stack-list li small {
  display: block;
  margin-top: 0.22rem;
  color: #56707a;
}

.calendar-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
  display: inline-block;
  margin-right: 0.5rem;
  vertical-align: middle;
}

.stack-list span,
.history-list span {
  font-size: 0.82rem;
  color: #557078;
}

.task-column {
  min-height: 260px;
  max-height: 520px;
  overflow: auto;
  padding-right: 0.25rem;
}

.task-column--priority {
  min-height: 180px;
  max-height: 70vh;
}

.task-item {
  background: #fbfffd;
  border: 1px solid #d4e3de;
  border-radius: 12px;
  padding: 0.72rem;
  margin-bottom: 0.65rem;
}

.task-item--compact {
  padding: 0.58rem 0.62rem;
}

.task-item:last-child {
  margin-bottom: 0;
}

.task-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.task-detail-timer-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.table-actions-inline {
  display: inline-flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.cloud-browser-pagination {
  width: 100%;
  align-items: center;
}

.cloud-browser-pagination .form-select {
  width: auto;
  min-width: 84px;
}

.cloud-file-module {
  background:
    linear-gradient(155deg, rgba(223, 242, 255, 0.72), rgba(239, 248, 255, 0.92) 46%, rgba(247, 252, 255, 0.96));
  border-color: rgba(108, 162, 196, 0.38);
  box-shadow: inset 0 0 0 1px rgba(205, 229, 247, 0.75);
}

.cloud-file-module .surface-card__head {
  padding-bottom: 0.25rem;
}

.cloud-file-module .table-responsive {
  border: 1px solid rgba(143, 188, 218, 0.35);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.68);
  padding: 0.2rem 0.25rem 0;
}

.cloud-file-module .empty-state {
  background: rgba(229, 242, 252, 0.62);
}

:root[data-theme="dark"] .cloud-file-module {
  background:
    linear-gradient(160deg, rgba(31, 58, 77, 0.8), rgba(23, 43, 61, 0.92) 52%, rgba(20, 38, 54, 0.96));
  border-color: rgba(87, 146, 181, 0.5);
  box-shadow: inset 0 0 0 1px rgba(73, 128, 162, 0.42);
}

:root[data-theme="dark"] .cloud-file-module .table-responsive {
  border-color: rgba(92, 146, 178, 0.45);
  background: rgba(12, 27, 39, 0.62);
}

:root[data-theme="dark"] .cloud-file-module .empty-state {
  background: rgba(17, 39, 56, 0.68);
}

.cloud-preview-overlay {
  z-index: 1320;
}

.cloud-preview-modal-window {
  width: min(1280px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cloud-preview-modal__body {
  flex: 1;
  min-height: 62vh;
  border: 1px solid rgba(74, 132, 168, 0.26);
  border-radius: 12px;
  background: rgba(245, 252, 255, 0.72);
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem;
}

.cloud-preview-frame {
  width: 100%;
  min-height: 68vh;
  border: 0;
  border-radius: 10px;
  background: #fff;
}

.cloud-preview-image {
  max-width: 100%;
  max-height: 76vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 22px rgba(12, 30, 42, 0.18);
}

.cloud-preview-message {
  width: 100%;
  min-height: 40vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.cloud-preview-message.is-error {
  color: #9a3d2a;
}

:root[data-theme="dark"] .cloud-preview-modal__body {
  border-color: rgba(83, 138, 170, 0.38);
  background: rgba(11, 28, 39, 0.76);
}

:root[data-theme="dark"] .cloud-preview-frame {
  background: rgba(11, 22, 31, 0.98);
}

.request-action-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.55rem 0.8rem;
}

.request-action-grid__left,
.request-action-grid__center,
.request-action-grid__right {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.request-action-grid__left {
  justify-content: flex-start;
}

.request-action-grid__center {
  justify-content: center;
}

.request-action-grid__right {
  justify-content: flex-end;
  margin-left: auto;
}

body[data-page="anfragen"] .request-action-grid .btn {
  min-height: 2.5rem;
  border-radius: 12px;
  padding-left: 0.92rem;
  padding-right: 0.92rem;
}

body[data-page="anfragen"] .request-action-grid .btn-outline-light {
  color: var(--outline-text);
  border-color: var(--outline-border);
  background: var(--outline-bg);
}

body[data-page="anfragen"] .request-action-grid .btn-outline-light:hover,
body[data-page="anfragen"] .request-action-grid .btn-outline-light:focus-visible {
  color: var(--outline-hover-text);
  border-color: var(--outline-hover-border);
  background: var(--outline-hover-bg);
}

body[data-page="anfragen"] .request-action-grid .btn:disabled {
  opacity: 0.6;
  filter: saturate(0.75);
}

body[data-page="anfragen"] .request-action-grid .btn-outline-light:disabled {
  color: var(--outline-text);
  border-color: var(--outline-border);
  background: var(--outline-bg);
}

.list-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.list-pagination__size {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.list-pagination__size .form-select {
  min-width: 86px;
}

.order-mobile-flow {
  display: none;
  border: 1px solid rgba(31, 138, 131, 0.28);
  border-radius: 12px;
  padding: 0.62rem 0.74rem;
  margin-bottom: 0.8rem;
  background: rgba(246, 252, 250, 0.94);
}

:root[data-theme="dark"] .order-mobile-flow {
  background: rgba(24, 38, 48, 0.94);
  border-color: rgba(90, 124, 143, 0.38);
}

.order-mobile-flow__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 0.55rem;
}

.order-mobile-flow__meta strong {
  font-size: 0.95rem;
}

.order-mobile-flow__meta span {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.order-mobile-flow__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.customer-picker-trigger {
  cursor: pointer;
}

.settings-workspace {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  gap: 1rem;
}

.settings-sidebar {
  position: sticky;
  top: 108px;
  align-self: start;
}

.settings-sidebar__title {
  margin: 0 0 0.9rem;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.settings-nav {
  display: grid;
  gap: 0.45rem;
}

.settings-nav__item {
  border: 1px solid var(--outline-border);
  background: var(--outline-bg);
  color: var(--outline-text);
  border-radius: 11px;
  text-align: left;
  padding: 0.55rem 0.7rem;
  font-weight: 600;
}

.settings-nav__item.is-active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent-sea), var(--accent-slate));
  box-shadow: 0 8px 16px rgba(24, 87, 96, 0.22);
}

.settings-main {
  min-width: 0;
}

.settings-panel {
  display: block;
}

.company-logo-preview-wrap {
  border: 1px dashed var(--surface-border-strong);
  border-radius: 12px;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-soft);
  padding: 0.6rem;
}

#companyLogoPreview {
  max-width: 100%;
  max-height: 110px;
  object-fit: contain;
  display: none;
}

#companyLogoPreview.is-visible {
  display: block;
}

body.app-dialog-open {
  overflow: hidden;
}

.app-notice-root {
  position: fixed;
  inset: 0;
  z-index: 1600;
  pointer-events: none;
}

.app-toast-host {
  position: fixed;
  top: 0.95rem;
  left: 50%;
  transform: translateX(-50%);
  width: min(94vw, 640px);
  display: grid;
  justify-items: center;
  gap: 0.45rem;
  pointer-events: none;
  z-index: 1610;
}

.app-toast {
  width: min(92vw, 460px);
  border-radius: 999px;
  border: 1px solid rgba(31, 138, 131, 0.26);
  background: rgba(255, 255, 255, 0.94);
  color: var(--text-main);
  box-shadow: var(--shadow-soft);
  padding: 0.52rem 0.95rem;
  font-size: 0.86rem;
  font-weight: 600;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-8px);
  animation: app-toast-in 180ms ease-out forwards;
}

.app-toast.is-success {
  border-color: rgba(46, 130, 84, 0.35);
  background: rgba(234, 249, 239, 0.97);
}

.app-toast.is-error {
  border-color: rgba(177, 76, 58, 0.4);
  background: rgba(255, 236, 232, 0.98);
}

.app-toast.is-warning {
  border-color: rgba(201, 123, 37, 0.4);
  background: rgba(255, 244, 227, 0.98);
}

.app-toast.is-leaving {
  animation: app-toast-out 180ms ease-in forwards;
}

@keyframes app-toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes app-toast-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-6px);
  }
}

.app-dialog {
  position: fixed;
  inset: 0;
  z-index: 1620;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  pointer-events: auto;
}

.app-dialog.is-open {
  display: flex;
}

.app-dialog__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 23, 29, 0.47);
  backdrop-filter: blur(2px);
}

.app-dialog__panel {
  position: relative;
  width: min(540px, 100%);
  border-radius: 14px;
  border: 1px solid var(--surface-border-strong);
  background: var(--modal-bg);
  box-shadow: 0 20px 42px rgba(16, 48, 56, 0.28);
  padding: 1rem 1rem 0.95rem;
}

.app-dialog__head h3 {
  margin: 0;
  font-size: 1.08rem;
  color: var(--text-main);
}

.app-dialog__body {
  margin-top: 0.7rem;
}

.app-dialog__body p {
  margin: 0;
  color: var(--text-main);
  font-size: 0.94rem;
  line-height: 1.5;
  white-space: pre-line;
}

.app-dialog__actions {
  margin-top: 1rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(12, 24, 30, 0.45);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-window {
  width: min(680px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: var(--modal-bg);
  border: 1px solid var(--surface-border-strong);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(12, 36, 44, 0.26);
  padding: 1rem;
}

.modal-window--md {
  width: min(760px, 100%);
}

.modal-window--xl {
  width: min(1280px, 100%);
}

#cloudDrivePickerBody tr {
  cursor: pointer;
}

#cloudDrivePickerBody tr.is-selected td {
  background: rgba(29, 136, 137, 0.12);
}

.doc-editor-modal {
  max-height: 92vh;
  padding: 1.15rem 1.2rem 1.1rem;
}

.doc-editor-modal .modal-window__head {
  position: sticky;
  top: -1.15rem;
  z-index: 2;
  background: var(--modal-bg);
  padding: 0.8rem 0 0.65rem;
  border-bottom: 1px solid rgba(35, 79, 92, 0.16);
  margin: -0.15rem 0 0.5rem;
}

.doc-editor-form-grid {
  margin-top: 0.15rem;
}

.doc-editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.9rem;
  align-items: start;
}

.doc-editor-main {
  min-width: 0;
}

.doc-preview-stage {
  display: none;
}

.doc-editor-side {
  display: none;
  gap: 0.7rem;
  position: sticky;
  top: 4.2rem;
}

.doc-editor-modal.is-preview-mode .doc-editor-layout {
  grid-template-columns: minmax(0, 1fr) 320px;
}

.doc-editor-modal.is-preview-mode .doc-editor-side {
  display: grid;
}

.doc-editor-modal.is-preview-mode .doc-editor-edit-content {
  display: none;
}

.doc-editor-modal.is-preview-mode .doc-preview-stage {
  display: block;
}

.doc-editor-section-title {
  margin: 0.1rem 0 0.2rem;
  font-size: 1.05rem;
  font-family: "Sora", sans-serif;
}

.doc-editor-side-card {
  border: 1px solid #d6e4df;
  border-radius: 12px;
  background: #fbfffd;
  padding: 0.7rem 0.75rem;
}

.doc-editor-side-card h4 {
  margin: 0 0 0.45rem;
  font-size: 0.88rem;
}

.doc-editor-side-card .form-check {
  margin-bottom: 0.42rem;
}

.doc-editor-side-card .form-check:last-child {
  margin-bottom: 0;
}

.doc-live-preview {
  border: 1px solid #d6e4df;
  border-radius: 12px;
  background: #eaf1f3;
  min-height: 78vh;
  max-height: 78vh;
  overflow: auto;
  padding: 0.75rem;
}

.doc-live-preview__frame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: calc(78vh - 1.5rem);
  border: 0;
  border-radius: 8px;
  background: #ffffff;
}

.doc-live-preview__canvas-host {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  align-items: center;
  min-height: calc(78vh - 1.5rem);
}

.doc-live-preview__canvas-page {
  border: 1px solid #cfd8dc;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(14, 34, 42, 0.12);
  width: fit-content;
}

.doc-live-preview__canvas {
  display: block;
  border-radius: 6px;
  background: #fff;
}

.doc-live-preview__sheet {
  width: min(210mm, 100%);
  min-height: 297mm;
  margin: 0 auto;
  border-radius: 2px;
  border: 1px solid #cfd8dc;
  background: #fff;
  color: #1d252b;
  padding: 18mm 14mm;
  box-shadow: 0 16px 36px rgba(14, 34, 42, 0.18);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
}

.doc-live-preview__brand {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.4rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--doc-accent, #2c6f84);
  padding-bottom: 0.65rem;
}

.doc-live-preview__logo {
  max-width: 180px;
  max-height: 72px;
  object-fit: contain;
}

.doc-live-preview__title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}

.doc-live-preview__meta {
  margin: 0.22rem 0 0;
  color: #4f5f67;
  font-size: 0.86rem;
}

.doc-live-preview__meta.is-error {
  color: #9f2c2c;
}

.doc-live-preview__recipient {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.doc-live-preview__body {
  margin: 0 0 1.1rem;
  white-space: pre-wrap;
  font-size: 0.92rem;
  line-height: 1.5;
}

.doc-live-preview__lines-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  margin-bottom: 0.9rem;
}

.doc-live-preview__lines-table th,
.doc-live-preview__lines-table td {
  padding: 0.35rem 0.2rem;
  border-bottom: 1px solid #d6dee2;
  vertical-align: top;
}

.doc-live-preview__lines-table th {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #4d5c63;
  text-align: left;
}

.doc-live-preview__line-desc {
  display: block;
  color: #4f5f67;
  font-size: 0.78rem;
  margin-top: 0.1rem;
}

.doc-live-preview__totals {
  margin-top: 0.2rem;
  padding-top: 0.5rem;
  border-top: 1px solid #cfd8dc;
  display: grid;
  gap: 0.2rem;
  font-size: 0.86rem;
}

.doc-live-preview__totals-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.doc-live-preview__totals-row.is-total {
  font-size: 1rem;
  font-weight: 700;
}

.doc-live-preview__footer {
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px dashed #cfd8dc;
  white-space: pre-wrap;
  font-size: 0.9rem;
  line-height: 1.5;
}

.doc-live-preview.is-hidden {
  display: none;
}

:root[data-theme="dark"] .doc-editor-side-card {
  background: rgba(25, 38, 47, 0.9);
  border-color: rgba(90, 124, 143, 0.36);
}

:root[data-theme="dark"] .doc-live-preview {
  background: rgba(17, 27, 35, 0.95);
  border-color: rgba(90, 124, 143, 0.36);
}

:root[data-theme="dark"] .doc-live-preview__sheet {
  background: #ffffff;
  color: #1d252b;
  border-color: #cfd8dc;
}

:root[data-theme="dark"] .doc-live-preview__title,
:root[data-theme="dark"] .doc-live-preview__body,
:root[data-theme="dark"] .doc-live-preview__recipient {
  color: #1d252b;
}

:root[data-theme="dark"] .doc-live-preview__meta {
  color: #4f5f67;
}

.doc-editor-modal .form-label {
  font-size: 0.79rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: #2f5663;
}

.doc-editor-modal .form-control,
.doc-editor-modal .form-select {
  min-height: 44px;
}

.doc-editor-modal textarea.form-control {
  min-height: 112px;
}

.create-flow-backdrop {
  z-index: 1090;
  background: rgba(12, 24, 30, 0.5);
}

.create-flow-banner {
  border: 1px solid rgba(31, 138, 131, 0.32);
  background:
    linear-gradient(135deg, rgba(31, 138, 131, 0.12), rgba(47, 111, 132, 0.08)),
    var(--surface);
}

body.order-create-open #orderForm {
  position: fixed;
  inset: 1rem;
  z-index: 1150;
  margin: 0;
  padding: 0.5rem;
  overflow: auto;
  border-radius: 14px;
  background: var(--surface-overlay);
  border: 1px solid var(--surface-border-strong);
  box-shadow: var(--shadow-strong);
}

body.request-create-open #requestEditorCard {
  position: fixed;
  inset: 1rem;
  width: auto;
  max-height: calc(100vh - 2rem);
  z-index: 1150;
  margin: 0;
  overflow: auto;
  border-radius: 14px;
  background: var(--surface-overlay);
  padding: 1rem;
  box-shadow: var(--shadow-strong);
  border: 1px solid var(--surface-border-strong);
}

body.request-create-open #requestEditorCard .surface-card__head {
  display: none;
}

body.request-create-open #requestEditorCard .surface-card__head span {
  opacity: 0.72;
}

body.request-create-open #requestCreateBanner h3 {
  margin: 0;
  font-size: 1.5rem;
  font-family: "Sora", sans-serif;
}

body.request-create-open #requestCreateBanner {
  margin-bottom: 1rem;
}

.modal-window__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 0.85rem;
}

.modal-window__head h3 {
  margin: 0;
  font-size: 1.02rem;
}

body.modal-open {
  overflow: hidden;
}

body.task-detail-open {
  overflow: hidden;
}

.modal-overlay.task-detail-overlay-active {
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.task-detail-overlay-active .surface-card.task-detail-modal {
  position: relative;
  z-index: 1;
  animation: none !important;
  width: min(880px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  height: auto;
  overflow: auto;
  margin: 0;
  border-radius: 14px;
  box-shadow: var(--shadow-strong);
  border-color: rgba(31, 138, 131, 0.42);
}

@media (max-width: 992px) {
  .doc-editor-layout {
    grid-template-columns: 1fr;
  }

  .doc-editor-side {
    position: static;
  }

  .modal-overlay.task-detail-overlay-active .surface-card.task-detail-modal {
    width: calc(100vw - 1rem);
    max-height: calc(100vh - 1rem);
  }
}

.hours-log-input {
  width: 5.4rem;
  min-width: 5.4rem;
}

body[data-page="aufgaben"] .tasks-list-card .hours-log-input {
  width: 4.8rem;
  min-width: 4.8rem;
}

body[data-page="aufgaben"] .tasks-list-card table {
  width: 100%;
  table-layout: fixed;
}

body[data-page="aufgaben"] .tasks-list-card th,
body[data-page="aufgaben"] .tasks-list-card td {
  white-space: normal;
  word-break: break-word;
}

body[data-page="aufgaben"] .tasks-list-card th:nth-child(1),
body[data-page="aufgaben"] .tasks-list-card td:nth-child(1) {
  width: 8%;
}

body[data-page="aufgaben"] .tasks-list-card th:nth-child(2),
body[data-page="aufgaben"] .tasks-list-card td:nth-child(2) {
  width: 19%;
}

body[data-page="aufgaben"] .tasks-list-card th:nth-child(3),
body[data-page="aufgaben"] .tasks-list-card td:nth-child(3) {
  width: 13%;
}

body[data-page="aufgaben"] .tasks-list-card th:nth-child(4),
body[data-page="aufgaben"] .tasks-list-card td:nth-child(4) {
  width: 10%;
}

body[data-page="aufgaben"] .tasks-list-card th:nth-child(5),
body[data-page="aufgaben"] .tasks-list-card td:nth-child(5) {
  width: 10%;
}

body[data-page="aufgaben"] .tasks-list-card th:nth-child(6),
body[data-page="aufgaben"] .tasks-list-card td:nth-child(6) {
  width: 12%;
}

body[data-page="aufgaben"] .tasks-list-card th:nth-child(7),
body[data-page="aufgaben"] .tasks-list-card td:nth-child(7) {
  width: 10%;
}

body[data-page="aufgaben"] .tasks-list-card th:nth-child(8),
body[data-page="aufgaben"] .tasks-list-card td:nth-child(8) {
  width: 18%;
}

body[data-page="aufgaben"] .tasks-list-card .task-table-main-cell strong {
  display: block;
}

body[data-page="aufgaben"] .tasks-list-card .task-effort-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
}

body[data-page="aufgaben"] .tasks-list-card .task-log-actions,
body[data-page="aufgaben"] .tasks-list-card .task-row-actions {
  display: flex;
  width: 100%;
  gap: 0.34rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

body[data-page="aufgaben"] .tasks-list-card .task-row-actions [data-live-elapsed] {
  flex: 1 0 100%;
  text-align: right;
}

body[data-page="aufgaben"] .tasks-list-card .task-log-actions .btn,
body[data-page="aufgaben"] .tasks-list-card .task-row-actions .btn {
  white-space: nowrap;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

body[data-page="aufgaben"] .table-sort-btn {
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

body[data-page="aufgaben"] .table-sort-btn:hover,
body[data-page="aufgaben"] .table-sort-btn:focus-visible {
  color: var(--accent-sea);
}

.source-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.3rem;
  padding: 0.12rem 0.48rem;
  border-radius: 999px;
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mini-progress {
  position: relative;
  height: 0.35rem;
  border-radius: 999px;
  background: rgba(36, 100, 108, 0.14);
  overflow: hidden;
  margin-bottom: 0.18rem;
}

body[data-page="auftrag"] #orderOverviewCard .table th,
body[data-page="auftrag"] #orderOverviewCard .table td {
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
}

body[data-page="auftrag"] #orderOverviewCard .table td {
  font-size: 0.82rem;
}

body[data-page="auftrag"] #orderOverviewCard .table .order-list-col-number strong {
  font-size: 0.84rem;
}

body[data-page="auftrag"] #orderOverviewCard .table .order-list-col-title,
body[data-page="auftrag"] #orderOverviewCard .table .order-list-col-customer {
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body[data-page="auftrag"] #orderOverviewCard .table .order-list-col-owner {
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-progress > span {
  position: absolute;
  inset: 0 auto 0 0;
  display: block;
  background: linear-gradient(90deg, var(--accent-sea), #2c6f84);
}

.task-item strong {
  display: block;
  font-size: 0.9rem;
}

.task-item small {
  color: var(--text-muted);
  font-size: 0.79rem;
  display: block;
}

.fc .fc-event.fc-private-block {
  border-style: dashed;
  opacity: 0.86;
}

.fc .fc-event.fc-private-block .fc-event-title {
  font-weight: 700;
}

.task-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.task-item--selectable {
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.task-item--selectable:hover {
  transform: translateY(-1px);
  border-color: rgba(32, 116, 114, 0.38);
  box-shadow: 0 8px 18px rgba(22, 82, 88, 0.1);
}

.task-item--selectable.is-selected {
  border-color: rgba(31, 138, 131, 0.6);
  background: rgba(31, 138, 131, 0.08);
}

.task-table-row {
  cursor: pointer;
}

.task-table-row.is-selected {
  background: rgba(31, 138, 131, 0.14);
}

.task-progress {
  position: relative;
  height: 0.4rem;
  border-radius: 999px;
  background: rgba(36, 100, 108, 0.14);
  overflow: hidden;
  margin-top: 0.28rem;
}

.task-progress > span {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, var(--accent-sea), var(--accent-slate));
}

.badge-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.73rem;
  font-weight: 700;
}

.badge-chip.status-offen,
.badge-chip.status-open {
  background: #fff2db;
  color: #9a6200;
}

.badge-chip.status-bezahlt,
.badge-chip.status-paid {
  background: #dff4e8;
  color: #1f6d44;
}

.badge-chip.status-faellig,
.badge-chip.status-fällig {
  background: #fde5e5;
  color: #a62f2f;
}

.badge-chip.status-in-bearbeitung,
.badge-chip.status-working {
  background: #e5edf5;
  color: #2f5678;
}

.badge-chip.status-wartend {
  background: #f4e9cf;
  color: #8a6626;
}

.badge-chip.status-warten-auf-dritte {
  background: #f4e9cf;
  color: #8a6626;
}

.badge-chip.status-in-arbeit {
  background: #e5edf5;
  color: #2f5678;
}

.badge-chip.status-archiviert {
  background: #ececec;
  color: #5c6066;
}

.badge-chip.status-re-versendet {
  background: #e9e8fb;
  color: #5045a3;
}

.badge-chip.status-festgeschrieben {
  background: #ddf0e0;
  color: #2f7b47;
}

.badge-chip.status-entwurf {
  background: #e5edf5;
  color: #2f5678;
}

.badge-chip.status-leistung-erbracht {
  background: #dff1e5;
  color: #2b6f49;
}

.badge-chip.status-geplant,
.badge-chip.status-bestaetigt {
  background: #e4edf9;
  color: #2f5678;
}

.badge-chip.status-durchgefuehrt {
  background: #ddf0e0;
  color: #2f7b47;
}

.badge-chip.status-abgesagt {
  background: #fde4da;
  color: #9a3d2a;
}

.badge-chip.status-erledigt,
.badge-chip.status-abgeschlossen {
  background: #ddf0e0;
  color: #2f7b47;
}

.badge-chip.status-kontaktiert {
  background: #d9f1ec;
  color: #1f6f68;
}

.badge-chip.status-angebot-erstellt {
  background: #e4edf9;
  color: #2f5678;
}

.badge-chip.status-zum-auftrag-weitergefuehrt {
  background: #ddf0e0;
  color: #2f7b47;
}

.badge-chip.status-angebot-abgelehnt {
  background: #fde4da;
  color: #9a3d2a;
}

.badge-chip.status-archiviert {
  background: #e8ebee;
  color: #5f6f79;
}

.badge-chip.status-storniert {
  background: #fde4da;
  color: #9a3d2a;
}

.badge-chip.prio-express,
.badge-chip.prio-dringend {
  background: #fde4da;
  color: #9a3d2a;
}

.badge-chip.prio-normal {
  background: #e7efeb;
  color: #4c6662;
}

.history-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
}

.invoice-history-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  flex-wrap: wrap;
  overflow: visible;
}

.history-entry-main {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.45rem;
  min-width: 0;
}

.history-entry-content {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.history-type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  border-radius: 999px;
  padding: 0.09rem 0.46rem;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  border: 1px solid #c7d9d3;
  background: #edf6f3;
  color: #3a6670;
}

.history-type-status {
  border-color: #9ecdc0;
  background: #e5f4ef;
  color: #2a6a5a;
}

.history-type-invoice {
  border-color: #d8c89d;
  background: #f9f1de;
  color: #796131;
}

.history-type-time {
  border-color: #a9c6e1;
  background: #e8f1fb;
  color: #355f8b;
}

.history-type-document {
  border-color: #c7b8de;
  background: #efe9f8;
  color: #604381;
}

.history-entry-icon {
  width: 1.4rem;
  min-width: 1.4rem;
  height: 1.4rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #c8d8d3;
  color: #2b6a78;
  background: #f1f8f5;
  margin-top: 0.06rem;
}

.history-day-divider {
  border: 0 !important;
  background: transparent !important;
  padding: 0.15rem 0.05rem !important;
  margin: 0.2rem 0 0.1rem !important;
}

.history-day-divider span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5f7a82;
}

.history-day-divider span::after {
  content: "";
  display: inline-block;
  width: 1.4rem;
  height: 1px;
  background: #c6d8d2;
}

.history-list time {
  color: #5f7880;
  font-size: 0.8rem;
  white-space: nowrap;
}

.empty-state {
  padding: 1rem;
  border: 1px dashed #c0d2ca;
  border-radius: 10px;
  text-align: center;
  color: #5b7680;
  font-size: 0.9rem;
}

.chart-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  min-height: 0;
}

.chart-wrap--sm {
  min-height: 260px;
  height: 260px;
}

.chart-wrap--md {
  min-height: 320px;
  height: 320px;
}

.chart-wrap--lg {
  min-height: 300px;
  height: 300px;
}

.chart-wrap > canvas {
  width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
  display: block;
}

.dashboard-scope-picker {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.dashboard-scope-picker .form-select {
  min-width: 180px;
}

#dashboardPlanOverflow {
  display: grid;
  gap: 0.55rem;
}

.plan-bars {
  display: grid;
  gap: 0.45rem;
}

.plan-bar-row {
  display: grid;
  gap: 0.16rem;
}

.plan-bar-row > small {
  color: #4f6872;
  font-size: 0.75rem;
}

.plan-bar-track {
  display: flex;
  height: 0.45rem;
  border-radius: 999px;
  background: rgba(60, 106, 116, 0.12);
  overflow: hidden;
}

.plan-bar-track span {
  display: block;
  height: 100%;
}

.plan-bar-track .is-blocked {
  background: linear-gradient(90deg, #c95b3d, #e78663);
}

.plan-bar-track .is-planned {
  background: linear-gradient(90deg, #4f82e6, #6ea3ff);
}

.plan-bar-track .is-focus {
  background: linear-gradient(90deg, #1f8a83, #55c5b4);
}

.plan-bar-track .is-reserve {
  background: rgba(34, 84, 97, 0.2);
}

.plan-overflow-item {
  border: 1px solid #d4e3de;
  border-radius: 12px;
  padding: 0.55rem 0.65rem;
  background: #fbfffd;
}

.plan-overflow-item strong {
  display: block;
  font-size: 0.9rem;
}

.plan-overflow-item span {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.anwesenheit-table th {
  text-align: center;
  min-width: 165px;
  white-space: nowrap;
}

.anwesenheit-table th:first-child {
  min-width: 220px;
  text-align: left;
}

.anwesenheit-table td {
  vertical-align: top;
}

.anwesenheit-summary-card h3 {
  margin: 0;
  font-size: 1rem;
}

.anwesenheit-summary-card p {
  margin: 0.28rem 0 0;
  font-size: 0.84rem;
  color: #496570;
}

.anwesenheit-summary-card small {
  display: block;
  margin-top: 0.22rem;
  color: #57727c;
  font-size: 0.76rem;
}

.anw-user-cell {
  min-width: 220px;
}

.anw-user-cell strong {
  display: block;
  font-size: 0.9rem;
}

.anw-user-cell small {
  display: block;
  color: #58737d;
  font-size: 0.78rem;
  margin-top: 0.1rem;
}

.anw-cell {
  min-width: 160px;
  display: grid;
  gap: 0.18rem;
}

.anw-cell.is-empty {
  min-height: 52px;
  place-items: center;
}

.anw-cell.is-off {
  opacity: 0.72;
}

.anw-cell strong {
  font-size: 0.76rem;
  color: #315c68;
}

.anw-cell small {
  color: #58727c;
  font-size: 0.72rem;
  line-height: 1.2;
}

.anw-cell-bar {
  display: flex;
  height: 0.38rem;
  border-radius: 999px;
  background: rgba(60, 106, 116, 0.12);
  overflow: hidden;
}

.anw-cell-bar.is-summary {
  margin-top: 0.25rem;
}

.anw-cell-bar span {
  display: block;
  height: 100%;
}

.anw-cell-bar .is-blocked {
  background: linear-gradient(90deg, #c95b3d, #e78663);
}

.anw-cell-bar .is-planned {
  background: linear-gradient(90deg, #4f82e6, #6ea3ff);
}

.anw-cell-bar .is-focus {
  background: linear-gradient(90deg, #1f8a83, #55c5b4);
}

.anw-cell-bar .is-reserve {
  background: rgba(34, 84, 97, 0.2);
}

.hero-panel__hint {
  margin: 0;
  font-size: 0.76rem;
  color: rgba(242, 251, 248, 0.95);
}

.checklist-board {
  display: grid;
  gap: 0.75rem;
}

.checklist-empty-cta {
  border: 1px dashed #c3d6d0;
  border-radius: 12px;
  background: var(--bg-soft);
  padding: 0.85rem;
}

.checklist-empty-cta h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.checklist-section {
  border: 1px solid #d2e2dd;
  border-radius: 12px;
  padding: 0.65rem;
  background: #fcfefd;
}

.checklist-section-head {
  display: flex;
  justify-content: space-between;
  gap: 0.55rem;
  align-items: center;
  margin-bottom: 0.45rem;
}

.checklist-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.38rem;
}

.checklist-item {
  border: 1px solid #dde9e4;
  border-radius: 10px;
  padding: 0.4rem 0.5rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
}

.checklist-item.is-done {
  background: rgba(42, 160, 143, 0.08);
}

.checklist-item-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.checklist-item-check span {
  color: #234b57;
  font-size: 0.89rem;
}

.compact-field-toggle {
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  background: rgba(245, 250, 248, 0.64);
  padding: 0.42rem 0.55rem;
}

.compact-field-toggle > summary {
  list-style: none;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
}

.compact-field-toggle > summary::-webkit-details-marker {
  display: none;
}

.compact-field-toggle > summary::before {
  content: "▸";
  font-size: 0.72rem;
  transform-origin: center;
  transition: transform 120ms ease;
}

.compact-field-toggle[open] > summary::before {
  transform: rotate(90deg);
}

:root[data-theme="dark"] .compact-field-toggle {
  border-color: rgba(90, 124, 143, 0.38);
  background: rgba(26, 39, 49, 0.92);
}

:root[data-theme="dark"] .compact-field-toggle > summary {
  color: #a9c1ce;
}

.order-progress-track {
  height: 0.56rem;
  border-radius: 999px;
  background: rgba(60, 106, 116, 0.14);
  overflow: hidden;
}

.order-progress-track > span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #1f8a83, #2c6f84);
}

.doc-editor-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  border-top: 1px dashed rgba(39, 96, 94, 0.2);
  padding-top: 0.75rem;
  margin-top: 0.25rem;
}

.doc-editor-toolbar .btn.is-active {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(140deg, #1f8a83, #2c6f84);
}

.doc-lines-table th {
  white-space: nowrap;
}

.doc-lines-table textarea,
.doc-lines-table input,
.doc-lines-table select {
  min-width: 0;
}

.doc-line-text {
  min-width: 220px;
}

.doc-line-title,
.doc-line-description {
  min-width: 220px;
}

.doc-line-delete {
  white-space: nowrap;
}

.doc-editor-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.55rem;
}

.doc-editor-summary__item {
  border: 1px solid #d6e4df;
  border-radius: 12px;
  background: #fbfffd;
  padding: 0.6rem 0.75rem;
  display: grid;
  gap: 0.12rem;
}

.doc-editor-summary__item span {
  color: #56707a;
  font-size: 0.78rem;
}

.doc-editor-summary__item strong {
  color: #1f2d38;
  font-family: "Sora", sans-serif;
  font-size: 1rem;
}

.doc-editor-summary__item.is-total {
  border-color: rgba(31, 138, 131, 0.5);
  background: linear-gradient(160deg, rgba(31, 138, 131, 0.13), rgba(44, 111, 132, 0.12));
}

:root[data-theme="dark"] .doc-editor-summary__item {
  background: rgba(25, 38, 47, 0.9);
  border-color: rgba(90, 124, 143, 0.36);
}

:root[data-theme="dark"] .doc-editor-summary__item span,
:root[data-theme="dark"] .doc-editor-summary__item strong {
  color: var(--text-main);
}

:root[data-theme="dark"] .doc-editor-toolbar {
  border-top-color: rgba(90, 124, 143, 0.36);
}

#userScheduleGrid {
  display: grid;
  gap: 0.4rem;
  max-width: 560px;
}

#availabilityScheduleGrid {
  display: grid;
  gap: 0.4rem;
  max-width: 560px;
}

.schedule-row {
  display: grid;
  grid-template-columns: minmax(170px, 240px) 110px 110px;
  gap: 0.45rem;
  align-items: center;
  justify-content: flex-start;
}

.schedule-day {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: #365b64;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.2rem;
}

.login-shell {
  width: 100%;
  max-width: 440px;
}

.login-card {
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(43, 97, 94, 0.16);
  box-shadow: var(--shadow-soft);
  padding: 1.3rem;
}

.login-card h1 {
  margin: 0;
  font-size: 1.4rem;
}

.availability-visual {
  display: grid;
  gap: 0.55rem;
}

.availability-week {
  border: 1px solid #d4e3de;
  border-radius: 12px;
  padding: 0.55rem 0.65rem;
  background: #fbfffd;
}

.availability-week strong {
  display: block;
  font-size: 0.86rem;
}

.availability-week > span {
  display: block;
  color: #5b7781;
  font-size: 0.76rem;
  margin-bottom: 0.36rem;
}

.availability-week-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.3rem;
}

#taskDetailCard.is-open {
  border-color: rgba(31, 138, 131, 0.42);
}

.availability-day {
  display: grid;
  gap: 0.12rem;
}

.availability-day small {
  text-align: center;
  color: #5f7b84;
  font-size: 0.68rem;
}

.availability-day-bar {
  height: 0.38rem;
  border-radius: 999px;
  background: rgba(36, 97, 109, 0.14);
  overflow: hidden;
}

.availability-day-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-sea), var(--accent-slate));
}

#teamCalendar {
  min-height: 610px;
}

.fc .fc-toolbar-title {
  font-family: "Sora", sans-serif;
  font-size: 1.1rem;
}

.fc .fc-button {
  background: var(--accent-slate);
  border-color: var(--accent-slate);
  border-radius: 8px;
  text-transform: capitalize;
  color: #fff;
}

.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active,
.fc .fc-button:hover {
  background: var(--accent-sea);
  border-color: var(--accent-sea);
}

.fc-theme-standard td,
.fc-theme-standard th,
.fc-theme-standard .fc-scrollgrid {
  border-color: var(--surface-border);
}

.fc .fc-col-header-cell-cushion,
.fc .fc-daygrid-day-number {
  color: var(--text-main);
  text-decoration: none;
}

.fc .fc-list-day-cushion {
  background: rgba(38, 98, 108, 0.08);
}

.fc .fc-list-day-cushion a,
.fc .fc-list-event-title a {
  color: var(--text-main);
  text-decoration: none;
}

.fc .fc-list-event-time {
  color: var(--text-main);
}

.fc .fc-list-event:hover td {
  background: rgba(43, 97, 94, 0.08);
}

:root[data-theme="dark"] .fc .fc-list-day-cushion {
  background: rgba(58, 92, 112, 0.28);
}

:root[data-theme="dark"] .fc .fc-list-day > * {
  background: rgba(28, 43, 55, 0.96) !important;
}

:root[data-theme="dark"] .fc .fc-list-day-cushion,
:root[data-theme="dark"] .fc .fc-list-day-cushion a {
  color: #d6e6f0 !important;
}

:root[data-theme="dark"] .fc .fc-list-event:hover td {
  background: rgba(63, 100, 123, 0.32);
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 992px) {
  .hero-panel {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-actions-stack {
    width: 100%;
    justify-items: stretch;
  }

  .order-context-actions {
    justify-content: flex-start;
  }

  .order-summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calendar-filter-bar {
    min-width: 100%;
    width: 100%;
  }

  #teamCalendar {
    min-height: 520px;
  }

  .chart-wrap--md {
    min-height: 280px;
    height: 280px;
  }

  .chart-wrap--lg {
    min-height: 260px;
    height: 260px;
  }

  .settings-workspace {
    grid-template-columns: 1fr;
  }

  .settings-sidebar {
    position: static;
  }

  .settings-nav {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  }
}

@media (min-width: 1200px) {
  .status-chip-group {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.15rem;
  }

  body[data-page="auftrag"] .order-workspace {
    grid-template-columns: minmax(440px, 0.46fr) minmax(720px, 1fr);
    align-items: start;
    gap: 1rem;
  }

  body[data-page="auftrag"] .order-list-card {
    position: sticky;
    top: 92px;
    max-height: calc(100vh - 108px);
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
  }

  body[data-page="auftrag"] .order-list-filters {
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--surface-overlay);
  }

  body[data-page="auftrag"] .order-list-table-wrap {
    overflow: auto;
    padding-right: 0.2rem;
  }

  body[data-page="auftrag"] #orderOverviewCard .table-mobile-cards thead {
    display: table-header-group;
  }

  body[data-page="auftrag"] #orderOverviewCard .table-mobile-cards tbody,
  body[data-page="auftrag"] #orderOverviewCard .table-mobile-cards tr,
  body[data-page="auftrag"] #orderOverviewCard .table-mobile-cards td {
    width: auto;
  }

  body[data-page="auftrag"] #orderOverviewCard .table-mobile-cards tbody {
    display: table-row-group;
  }

  body[data-page="auftrag"] #orderOverviewCard .table-mobile-cards tr {
    display: table-row;
  }

  body[data-page="auftrag"] #orderOverviewCard .table-mobile-cards td {
    display: table-cell;
  }

  body[data-page="auftrag"] #orderOverviewCard .table-mobile-cards tbody tr {
    border: 0;
    border-bottom: 1px solid var(--surface-border);
    border-radius: 0;
    margin-bottom: 0;
    background: transparent;
    padding: 0;
    transition: background 140ms ease;
  }

  body[data-page="auftrag"] #orderOverviewCard .table-mobile-cards tbody tr:hover {
    transform: none;
    border-color: var(--surface-border);
    box-shadow: none;
  }

  body[data-page="auftrag"] #orderOverviewCard .table-mobile-cards tbody tr.is-selected {
    border-color: var(--surface-border);
    background: rgba(31, 138, 131, 0.12);
  }

  body[data-page="auftrag"] #orderOverviewCard .table-mobile-cards tbody td {
    border: 0;
    padding: 0.42rem 0.5rem;
    text-align: left;
  }

  body[data-page="auftrag"] #orderListPaginationWrap {
    border-top: 1px solid rgba(39, 96, 94, 0.12);
    padding-top: 0.62rem;
  }

  body[data-page="auftrag"] #orderForm {
    margin-top: 0;
  }

  body[data-page="anfragen"] .request-workspace {
    grid-template-columns: minmax(390px, 0.33fr) minmax(0, 1fr);
    align-items: start;
    gap: 1rem;
  }

  body[data-page="anfragen"] .request-list-card {
    position: sticky;
    top: 92px;
    max-height: calc(100vh - 108px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  body[data-page="anfragen"] .request-list-filters {
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--surface-overlay);
  }

  body[data-page="anfragen"] .request-list-table-wrap {
    overflow: auto;
    padding-right: 0.2rem;
  }

  body[data-page="anfragen"] .request-workspace__detail #requestEditorCard,
  body[data-page="anfragen"] .request-workspace__detail .surface-card.h-100 {
    height: auto !important;
  }

  body[data-page="anfragen"] #requestForm .form-label {
    white-space: nowrap;
  }

  body[data-page="anfragen"] .request-action-grid__left {
    min-width: 240px;
  }

  body[data-page="anfragen"] .request-action-grid__center {
    border-left: 1px dashed rgba(39, 96, 94, 0.2);
    border-right: 1px dashed rgba(39, 96, 94, 0.2);
    padding: 0 0.65rem;
  }

  body[data-page="anfragen"] .request-list-card .table-mobile-cards thead {
    display: none;
  }

  body[data-page="anfragen"] .request-list-card .table-mobile-cards tbody,
  body[data-page="anfragen"] .request-list-card .table-mobile-cards tr,
  body[data-page="anfragen"] .request-list-card .table-mobile-cards td {
    display: block;
    width: 100%;
  }

  body[data-page="anfragen"] .request-list-card .table-mobile-cards tbody tr {
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    margin-bottom: 0.62rem;
    background: var(--surface);
    padding: 0.4rem 0.55rem;
  }

  body[data-page="anfragen"] .request-list-card .table-mobile-cards tbody tr.is-selected {
    border-color: rgba(31, 138, 131, 0.58);
    background: rgba(31, 138, 131, 0.09);
  }

  body[data-page="anfragen"] .request-list-card .table-mobile-cards tbody td {
    border: 0;
    padding: 0.3rem 0.15rem;
    display: grid;
    grid-template-columns: 105px minmax(0, 1fr);
    gap: 0.58rem;
    align-items: start;
    text-align: left !important;
  }

  body[data-page="anfragen"] .request-list-card .table-mobile-cards tbody td::before {
    content: attr(data-label);
    font-size: 0.71rem;
    letter-spacing: 0.02em;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
  }

  body[data-page="anfragen"] .request-list-card .table-mobile-cards tbody td:nth-child(5),
  body[data-page="anfragen"] .request-list-card .table-mobile-cards tbody td:nth-child(8),
  body[data-page="anfragen"] .request-list-card .table-mobile-cards tbody td:nth-child(9) {
    display: none;
  }

  body[data-page="aufgaben"] .tasks-filter-card {
    position: sticky;
    top: 92px;
  }

  body[data-page="aufgaben"] .tasks-workspace.workspace-shell {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(360px, 1fr);
    gap: 1rem;
    align-items: flex-start;
    margin-left: 0;
    margin-right: 0;
  }

  body[data-page="aufgaben"] .tasks-workspace.workspace-shell > [class*="col-"] {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
    flex: 0 0 auto;
  }

  body[data-page="aufgaben"] .tasks-workspace .tasks-list-card {
    max-height: calc(100vh - 126px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  body[data-page="aufgaben"] .tasks-workspace .tasks-list-card .table-responsive {
    overflow: auto;
    min-height: 0;
  }

  body[data-page="aufgaben"] .tasks-priority-board {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body[data-page="aufgaben"] .tasks-side-col {
    position: sticky;
    top: 164px;
    align-self: start;
  }
}

body[data-page="auftrag"] .order-workspace {
  gap: 0.78rem;
}

body[data-page="auftrag"] .surface-card {
  padding: 0.82rem;
}

body[data-page="auftrag"] .surface-card__head {
  margin-bottom: 0.6rem;
}

body[data-page="auftrag"] #orderForm {
  --bs-gutter-x: 0.78rem;
  --bs-gutter-y: 0.64rem;
}

body[data-page="auftrag"] #orderForm .row.g-3 {
  --bs-gutter-x: 0.78rem;
  --bs-gutter-y: 0.64rem;
}

body[data-page="auftrag"] .form-label {
  margin-bottom: 0.2rem;
  font-size: 0.79rem;
}

body[data-page="auftrag"] .form-control,
body[data-page="auftrag"] .form-select,
body[data-page="auftrag"] textarea {
  min-height: 2.22rem;
}

body[data-page="auftrag"] #orderOverviewCard .table td,
body[data-page="auftrag"] #orderOverviewCard .table th {
  padding-top: 0.34rem;
  padding-bottom: 0.34rem;
}

body[data-page="auftrag"] .order-summary-strip {
  gap: 0.5rem;
}

body[data-page="auftrag"] .checklist-empty-cta {
  padding: 0.62rem;
}

body[data-page="auftrag"] .empty-state {
  padding: 0.58rem;
  border-radius: 8px;
  font-size: 0.82rem;
}

body[data-page="auftrag"] .order-history-card #historyList {
  max-height: 430px;
  overflow: auto;
  padding-right: 0.2rem;
}

body[data-page="auftrag"] #invoiceHistoryWrap {
  max-height: 240px;
  overflow: auto;
}

body[data-page="auftrag"] .order-time-card .table-responsive {
  max-height: 280px;
  overflow: auto;
}

body[data-page="auftrag"] main > section.hero-panel .btn {
  --bs-btn-padding-y: 0.28rem;
  --bs-btn-padding-x: 0.62rem;
  font-size: 0.8rem;
}

body[data-page="auftrag"] main > section.order-summary-strip {
  margin-top: 0.5rem !important;
}

body[data-page="auftrag"] .order-summary-item {
  padding: 0.42rem 0.5rem;
}

body[data-page="auftrag"] .order-summary-item span {
  margin-bottom: 0.1rem;
  font-size: 0.67rem;
}

body[data-page="auftrag"] .order-summary-item strong {
  font-size: 0.84rem;
}

body[data-page="auftrag"] .order-summary-item--tasks {
  gap: 0.2rem;
}

body[data-page="auftrag"] .order-summary-progress {
  height: 0.26rem;
}

body[data-page="auftrag"] .status-chip-group {
  gap: 0.44rem;
  padding-bottom: 0.08rem;
}

body[data-page="auftrag"] .status-chip {
  font-size: 0.79rem;
  padding: 0.31rem 0.62rem;
}

body[data-page="auftrag"] .status-chip::after {
  width: 0.35rem;
  left: calc(100% + 0.1rem);
}

body[data-page="auftrag"] main > section.surface-card.mt-4 {
  margin-top: 0.62rem !important;
  padding-top: 0.62rem;
  padding-bottom: 0.62rem;
}

body[data-page="auftrag"] main > section.surface-card.mt-4 .form-label {
  margin-bottom: 0.14rem;
}

body[data-page="auftrag"] .order-invoice-card,
body[data-page="auftrag"] .order-history-card,
body[data-page="auftrag"] .order-time-card {
  background: rgba(255, 255, 255, 0.74);
  border-color: rgba(43, 97, 94, 0.14);
}

:root[data-theme="dark"] body[data-page="auftrag"] .order-invoice-card,
:root[data-theme="dark"] body[data-page="auftrag"] .order-history-card,
:root[data-theme="dark"] body[data-page="auftrag"] .order-time-card {
  background: rgba(22, 33, 42, 0.86);
  border-color: rgba(82, 112, 131, 0.28);
}

body[data-page="auftrag"] #detailTaskForm,
body[data-page="auftrag"] #detailTerminForm {
  margin-bottom: 0.55rem !important;
}

body[data-page="auftrag"] #detailTaskForm .form-label,
body[data-page="auftrag"] #detailTerminForm .form-label {
  margin-bottom: 0.12rem;
}

body[data-page="auftrag"] #detailTaskForm .btn,
body[data-page="auftrag"] #detailTerminForm .btn {
  --bs-btn-padding-y: 0.28rem;
}

body[data-page="auftrag"] .order-history-card .history-list li {
  margin-bottom: 0.45rem;
  padding: 0.55rem 0.62rem;
}

body[data-page="auftrag"] .order-history-card .history-list time {
  font-size: 0.76rem;
}

body[data-page="auftrag"] #invoiceHistoryWrap .table td,
body[data-page="auftrag"] #invoiceHistoryWrap .table th,
body[data-page="auftrag"] .order-time-card .table td,
body[data-page="auftrag"] .order-time-card .table th {
  padding-top: 0.32rem;
  padding-bottom: 0.32rem;
}

body[data-page="auftrag"][data-order-tab="docs"] #orderTabDocsPanel {
  flex: 0 0 100%;
  max-width: 100%;
}

.documents-shell {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  gap: 1rem;
}

.documents-sidebar {
  border: 1px solid var(--surface-border-strong);
  border-radius: 16px;
  padding: 0.85rem;
  background: linear-gradient(180deg, rgba(31, 138, 131, 0.12), rgba(31, 138, 131, 0.04));
}

.documents-sidebar__section + .documents-sidebar__section {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--surface-border);
}

.documents-sidebar__section h3 {
  margin: 0 0 0.55rem;
  font-size: 0.92rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.documents-nav-btn {
  width: 100%;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.58);
  color: var(--text-main);
  border-radius: 10px;
  padding: 0.48rem 0.6rem;
  margin-bottom: 0.35rem;
  font-weight: 600;
  text-align: left;
  transition: all 0.18s ease;
}

.documents-nav-btn:last-child {
  margin-bottom: 0;
}

.documents-nav-btn:hover {
  border-color: var(--surface-border-strong);
  background: rgba(255, 255, 255, 0.86);
}

.documents-nav-btn.is-active {
  border-color: color-mix(in srgb, var(--brand-primary) 40%, transparent);
  background: color-mix(in srgb, var(--brand-primary) 12%, white);
  color: color-mix(in srgb, var(--brand-primary) 85%, #0e1e2d);
}

.documents-main {
  min-width: 0;
}

body[data-page="dokumente"] #documentCreateBtn {
  color: #ffffff;
}

body[data-page="dokumente"] #documentCreateBtn:disabled {
  color: rgba(255, 255, 255, 0.78);
}

.documents-status-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.2rem 0 0.8rem;
}

.documents-status-tab {
  border-radius: 999px;
  border: 1px solid var(--surface-border-strong);
  color: var(--text-main);
  background: var(--surface-soft);
  font-weight: 600;
  padding-inline: 0.85rem;
}

.documents-status-tab.is-active {
  border-color: color-mix(in srgb, var(--brand-primary) 50%, transparent);
  background: color-mix(in srgb, var(--brand-primary) 18%, white);
  color: color-mix(in srgb, var(--brand-primary) 92%, #0e1e2d);
}

.document-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.56rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.document-status-pill--entwurf {
  color: #404b58;
  background: #eaedf2;
  border-color: #d7dee7;
}

.document-status-pill--festgeschrieben {
  color: #1f6d44;
  background: #dff4e8;
  border-color: #bde5cf;
}

.document-status-pill--bezahlt {
  color: #1f6d44;
  background: #dff4e8;
  border-color: #bde5cf;
}

.document-status-pill--offen {
  color: #9a6200;
  background: #fff2db;
  border-color: #f2d5a0;
}

.document-status-pill--faellig {
  color: #a62f2f;
  background: #fde5e5;
  border-color: #f0b8b8;
}

.document-status-pill--storniert {
  color: #9a3d2a;
  background: #fde8e2;
  border-color: #f2c8bc;
}

.doc-row-actions-wrap {
  justify-content: flex-end;
}

.doc-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.doc-row-menu {
  position: relative;
}

.doc-row-menu[open] {
  z-index: 2200;
}

.doc-row-menu > summary {
  list-style: none;
  cursor: pointer;
  min-width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: var(--surface-soft);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.doc-row-menu > summary::-webkit-details-marker {
  display: none;
}

.doc-row-menu__list {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  min-width: 15.5rem;
  background: #ffffff;
  background-color: #ffffff;
  opacity: 1;
  backdrop-filter: none;
  border: 1px solid var(--line-soft);
  border-radius: 0.75rem;
  box-shadow: 0 18px 32px rgba(15, 23, 42, 0.16);
  padding: 0.3rem;
  z-index: 2250;
}

.doc-row-menu__item {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text-main);
  text-align: left;
  padding: 0.48rem 0.62rem;
  border-radius: 0.5rem;
  font: inherit;
  font-size: 0.9rem;
}

.doc-row-menu__item:hover {
  background: var(--surface-soft);
}

.doc-row-menu__item--danger {
  color: #b42333;
}

.doc-row-menu__hint {
  margin-top: 0.2rem;
  padding: 0.3rem 0.62rem 0.1rem;
  font-size: 0.75rem;
  color: #9a3d2a;
}

.notes-history {
  display: grid;
  gap: 0.45rem;
  overflow: visible;
}

.notes-history__item {
  position: relative;
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  padding: 0.5rem 0.62rem;
  background: var(--surface);
  overflow: visible;
}

.notes-history__meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-bottom: 0.18rem;
}

.notes-history__text {
  margin: 0;
  white-space: pre-wrap;
}

.notes-history__menu {
  margin-left: auto;
}

.notes-history__menu > summary {
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  line-height: 1;
}

.mention-suggest {
  position: fixed;
  z-index: 2600;
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  background: #ffffff;
  background-color: #ffffff;
  opacity: 1;
  backdrop-filter: none;
  box-shadow: 0 8px 18px rgba(18, 28, 38, 0.14);
  padding: 0.18rem;
  display: grid;
  gap: 0.06rem;
  width: min(280px, calc(100vw - 16px));
  max-height: 220px;
  overflow: auto;
}

.mention-suggest__item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.04rem;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line-soft) 80%, transparent);
  width: 100%;
  border-radius: 6px;
  padding: 0.24rem 0.42rem;
  background: #ffffff;
  color: inherit;
  text-align: left;
  font-size: 0.78rem;
  line-height: 1.25;
}

.mention-suggest__item:last-child {
  border-bottom: 0;
}

.mention-suggest__item > strong {
  font-weight: 600;
}

.mention-suggest__item > span {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.mention-suggest__item:hover,
.mention-suggest__item.is-active {
  background: #e9f4f5;
}

.mention-suggest__item.is-active {
  background: #1f7a83;
  color: #ffffff;
  border-bottom-color: rgba(255, 255, 255, 0.22);
  box-shadow: inset 4px 0 0 #0f4e54;
}

.mention-suggest__item.is-active > strong,
.mention-suggest__item.is-active > span {
  color: #ffffff;
}

.note-edit-modal {
  max-width: min(900px, 92vw);
}

.note-edit-modal__body {
  padding: 0.75rem 1rem;
  display: grid;
  gap: 0.4rem;
}

.note-edit-modal__textarea {
  min-height: 240px;
  resize: vertical;
}

.notes-history__item:last-child .doc-row-menu__list {
  top: auto;
  bottom: calc(100% + 0.35rem);
}

body[data-page="dokumente"] .documents-main .table-responsive {
  overflow: visible;
}

body[data-page="dokumente"] #documentTableBody tr:last-child .doc-row-menu__list,
body[data-page="dokumente"] #documentTableBody tr:nth-last-child(2) .doc-row-menu__list {
  top: auto;
  bottom: calc(100% + 0.35rem);
}

body[data-page="auftrag"] #invoiceDocumentHistoryBody tr:last-child .doc-row-menu__list,
body[data-page="auftrag"] #invoiceDocumentHistoryBody tr:nth-last-child(2) .doc-row-menu__list {
  top: auto;
  bottom: calc(100% + 0.35rem);
}

body[data-page="auftrag-liste"] .order-list-table-wrap,
body[data-page="anfragen-liste"] .request-list-table-wrap {
  overflow: visible;
}

body[data-page="auftrag-liste"] #orderListBody tr:last-child .doc-row-menu__list,
body[data-page="auftrag-liste"] #orderListBody tr:nth-last-child(2) .doc-row-menu__list,
body[data-page="anfragen-liste"] #requestTableBody tr:last-child .doc-row-menu__list,
body[data-page="anfragen-liste"] #requestTableBody tr:nth-last-child(2) .doc-row-menu__list {
  top: auto;
  bottom: calc(100% + 0.35rem);
}

body[data-page="dokumente"] .documents-main .table tbody tr td {
  vertical-align: top;
}

:root[data-theme="dark"] .documents-sidebar {
  background: linear-gradient(180deg, rgba(45, 112, 157, 0.18), rgba(18, 40, 58, 0.5));
}

:root[data-theme="dark"] .documents-nav-btn {
  background: rgba(13, 26, 38, 0.6);
  color: var(--text-main);
}

:root[data-theme="dark"] .documents-nav-btn:hover {
  background: rgba(13, 26, 38, 0.88);
}

:root[data-theme="dark"] .documents-nav-btn.is-active {
  background: color-mix(in srgb, var(--brand-primary) 24%, rgba(13, 26, 38, 0.95));
  color: #eef8ff;
}

:root[data-theme="dark"] .documents-status-tab {
  background: rgba(13, 26, 38, 0.75);
  color: var(--text-main);
}

:root[data-theme="dark"] .documents-status-tab.is-active {
  background: color-mix(in srgb, var(--brand-primary) 26%, rgba(13, 26, 38, 0.95));
  color: #f1fbff;
}

:root[data-theme="dark"] .doc-row-menu__list {
  background: #1c2b35;
}

:root[data-theme="dark"] .mention-suggest {
  background: #1c2b35;
  background-color: #1c2b35;
}

.document-editor-bridge__body {
  width: min(98vw, 1560px);
  height: min(95vh, 1180px);
  overflow: hidden;
  background: #f5f8f7;
  border: 1px solid var(--surface-border);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
}

.document-editor-bridge__body iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #f7faf9;
}

.document-editor-bridge__close {
  position: fixed;
  right: max(1.2rem, env(safe-area-inset-right));
  top: max(1.2rem, env(safe-area-inset-top));
  z-index: 6;
}

body.doc-editor-embedded .top-shell {
  display: none !important;
}

body.doc-editor-embedded main.container {
  max-width: none !important;
  padding: 0 !important;
}

body.doc-editor-embedded main.container > section {
  display: none !important;
}

body.doc-editor-embedded .modal-overlay {
  position: static !important;
  inset: auto !important;
  padding: 0 !important;
  background: transparent !important;
}

body.doc-editor-embedded .modal-overlay .doc-editor-modal {
  width: 100% !important;
  max-width: none !important;
  height: 100vh !important;
  max-height: none !important;
  margin: 0 !important;
  border-radius: 0 !important;
  border: 0 !important;
  box-shadow: none !important;
}

@media (max-width: 1200px) {
  .documents-shell {
    grid-template-columns: 1fr;
  }

  .documents-sidebar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
  }

  .documents-sidebar__section + .documents-sidebar__section {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }
}

@media (max-width: 768px) {
  .documents-sidebar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1200px) {
  body[data-page="aufgaben"] .tasks-priority-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 992px) {
  body[data-page="aufgaben"] .tasks-workspace.workspace-shell {
    display: grid;
  }

  body[data-page="aufgaben"] .tasks-side-col {
    order: -1;
  }

  body[data-page="aufgaben"] .tasks-filter-sticky {
    position: static;
    top: auto;
  }
}

@media (max-width: 768px) {
  body[data-page="aufgaben"] .tasks-priority-board {
    grid-template-columns: 1fr;
  }

  body[data-page="aufgaben"] .tasks-list-card .panel-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  body[data-page="aufgaben"] .tasks-list-card table {
    min-width: 980px;
    table-layout: auto;
  }

  body[data-page="aufgaben"] .tasks-list-card th,
  body[data-page="aufgaben"] .tasks-list-card td {
    white-space: nowrap;
    word-break: normal;
  }

  body[data-page="aufgaben"] .tasks-list-card .task-table-main-cell strong,
  body[data-page="aufgaben"] .tasks-list-card .task-table-main-cell small {
    white-space: normal;
  }
}

@media (max-width: 576px) {
  .order-summary-strip {
    grid-template-columns: 1fr;
  }

  .top-shell {
    position: relative;
    z-index: 1200;
  }

  .top-shell > .container {
    align-items: center;
    position: relative;
  }

  .brand-copy small {
    display: none;
  }

  .header-meta {
    width: 100%;
    margin-left: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas:
      "search search search"
      "logout notif notif";
    align-items: center;
    gap: 0.26rem 0.34rem;
    padding-right: 3.4rem;
  }

  body[data-page="auftrag"] .order-live-panel {
    padding: 0.36rem 0.48rem;
  }

  body[data-page="auftrag"] .order-live-panel .surface-card__head {
    margin-bottom: 0.18rem;
  }

  body[data-page="auftrag"] .order-live-panel .surface-card__head h2 {
    font-size: 0.95rem;
  }

  body[data-page="auftrag"] .order-live-panel .vstack {
    gap: 0.24rem;
  }

  body[data-page="auftrag"] .order-live-panel__row {
    padding: 0.16rem 0.28rem;
  }

  .header-meta #todayLabel,
  .header-meta #connectionBadge {
    display: none;
  }

  .header-meta .user-badge {
    display: none;
    grid-area: user;
    max-width: 58vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border: 0;
    background: transparent;
    border-radius: 0;
    padding: 0;
    font-size: 0.8rem;
    font-weight: 600;
  }

  .header-meta .notif-center {
    grid-area: notif;
    justify-self: start;
  }

  .header-meta .global-search {
    grid-area: search;
  }

  .header-meta .global-search__input {
    min-height: 2.15rem;
    font-size: 0.98rem;
  }

  .header-meta .notif-center__toggle {
    min-width: 2.15rem;
    padding: 0.22rem 0.5rem;
  }

  .header-logout {
    grid-area: logout;
    padding: 0.18rem 0.58rem;
    line-height: 1.1;
    min-height: 2.1rem;
    justify-self: start;
  }

  .mobile-nav-toggle {
    display: inline-flex;
    position: absolute;
    top: 0.38rem;
    right: 0.72rem;
    margin-left: 0;
    padding: 0.2rem 0.55rem;
    min-height: 2.1rem;
    z-index: 2;
  }

  .mobile-nav-drawer {
    display: block;
    width: 100vw;
    max-width: 100vw;
    border-left: 0;
  }

  .main-nav {
    display: none;
  }

  .global-search,
  .global-search__input {
    min-width: 100%;
    width: 100%;
  }

  .global-search__results {
    width: 100%;
    right: auto;
    left: 0;
  }

  .company-logo-header--brand {
    width: 5rem;
    height: 2.8rem;
    max-width: 5rem;
    max-height: 2.8rem;
  }

  .notif-center__panel {
    position: absolute;
    top: calc(100% + 0.35rem);
    left: auto;
    right: 0;
    width: min(96vw, 420px);
    max-height: min(66vh, 460px);
    z-index: 1305;
  }

  .notif-modal__dialog {
    width: min(100vw - 1rem, 980px);
    max-height: calc(100vh - 1rem);
  }

  .notif-modal__foot {
    flex-direction: column;
    align-items: stretch;
  }

  .app-toast-host {
    top: 0.75rem;
    width: min(98vw, 640px);
  }

  .app-toast {
    width: min(96vw, 420px);
    border-radius: 14px;
    padding: 0.56rem 0.75rem;
  }

  .app-dialog {
    padding: 0.75rem;
    align-items: flex-end;
  }

  .app-dialog__panel {
    width: min(100%, 520px);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }

  .app-dialog__actions {
    justify-content: stretch;
  }

  .app-dialog__actions .btn {
    flex: 1;
  }

  .kpi-card strong {
    font-size: 1.25rem;
  }

  .schedule-row {
    grid-template-columns: 1fr 1fr;
  }

  .schedule-day {
    grid-column: 1 / -1;
  }

  .availability-week-days {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .doc-editor-toolbar {
    align-items: stretch;
  }

  .doc-editor-toolbar .table-actions-inline {
    width: 100%;
    justify-content: flex-start;
  }

  .request-action-grid__left,
  .request-action-grid__center,
  .request-action-grid__right {
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
  }

  .table-responsive {
    overflow: visible;
  }

  .table-mobile-cards {
    border-collapse: separate;
    border-spacing: 0;
  }

  .table-mobile-cards thead {
    display: none;
  }

  .table-mobile-cards tbody,
  .table-mobile-cards tr,
  .table-mobile-cards td {
    display: block;
    width: 100%;
  }

  .table-mobile-cards tbody tr {
    border: 1px solid var(--surface-border-strong);
    border-radius: 12px;
    margin-bottom: 0.65rem;
    background: var(--surface);
    padding: 0.35rem 0.5rem;
  }

  .table-mobile-cards tbody td {
    border: 0;
    padding: 0.36rem 0.2rem;
    display: grid;
    grid-template-columns: minmax(96px, 38%) minmax(0, 1fr);
    gap: 0.58rem;
    align-items: start;
    text-align: left !important;
  }

  .table-mobile-cards tbody td::before {
    content: attr(data-label);
    font-size: 0.73rem;
    letter-spacing: 0.02em;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
  }

  .list-pagination {
    gap: 0.45rem;
  }

  .list-pagination__size {
    width: 100%;
    justify-content: space-between;
  }

  .list-pagination__size .form-select {
    width: min(92vw, 300px);
  }

  .order-mobile-flow {
    display: block;
    position: sticky;
    top: 0.5rem;
    z-index: 15;
    box-shadow: var(--shadow-soft);
  }

  body[data-page="auftrag"] .order-mobile-flow {
    display: none !important;
  }

  body[data-page="aufgaben"] .tasks-filter-sticky {
    position: static;
    top: auto;
    z-index: auto;
    backdrop-filter: none;
  }

  body[data-page="aufgaben"] .task-column,
  body[data-page="aufgaben"] .task-column--priority {
    min-height: 0;
    max-height: none;
    overflow: visible;
  }

  body[data-page="aufgaben"] .tasks-priority-col {
    padding: 0.55rem 0.45rem;
  }

  #orderForm article.surface-card.is-mobile-section-hidden {
    display: none;
  }

  body[data-page="auftrag"] #orderForm article.surface-card.is-mobile-section-hidden {
    display: block !important;
  }

  .order-list-filters {
    border-top: 0;
    padding-top: 0.2rem;
  }

  body[data-page="aufgaben"] .tasks-priority-board {
    grid-template-columns: minmax(0, 1fr);
  }
}
