:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #657282;
  --line: #dfe5ec;
  --line-strong: #c9d2dc;
  --panel: #ffffff;
  --bg: #f6f8fb;
  --soft: #f9fbfd;
  --brand: #6c4eff;
  --brand-2: #25d6b1;
  --ok: #2d7a46;
  --warn: #9b661b;
  --error: #a53030;
  --shadow: 0 10px 32px rgba(20, 34, 50, .06);
}

* { box-sizing: border-box; }
html {
  margin: 0;
  padding: 0;
  background: var(--bg);
}
body {
  margin: 0;
  padding: 0;
  font-family: "Inter", "Segoe UI", Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 7px 18px 6px;
  background:
    linear-gradient(135deg, #ecebff 0%, #f3f9fc 58%, #f7faff 100%);
  border-top: 0;
  border-bottom: 1px solid #b8c4d4;
  position: sticky;
  top: 0;
  z-index: 80;
  isolation: isolate;
}

header::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -24px;
  height: 24px;
  background: linear-gradient(135deg, #ecebff 0%, #f3f9fc 58%, #f7faff 100%);
  pointer-events: none;
}

header strong { display: block; font-size: 18px; }
header span { color: var(--muted); font-size: 13px; }
.app-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}
.app-brand:hover strong {
  color: var(--brand);
}
.app-logo {
  width: 66px;
  height: 52px;
  object-fit: contain;
  flex: 0 0 auto;
}
.app-brand-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 10px;
  object-fit: contain;
  box-shadow: 0 10px 24px rgba(108, 76, 255, .18);
}
.app-product-mark {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 999px;
  background:
    radial-gradient(circle at center, #fff 0 37%, transparent 39%),
    conic-gradient(from 20deg, #c75cff, #6c4cff, #2f7fd8, #f1bd74, #c75cff);
  box-shadow: 0 10px 24px rgba(108, 76, 255, .16);
}
.app-product-mark::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 999px;
  background: #fff;
}
.app-product-mark span {
  position: relative;
  width: 19px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #6c4cff, #1d6f8f);
  box-shadow:
    0 -8px 0 -1px #c75cff,
    0 8px 0 -1px #f1bd74;
}
.header-right {
  display: grid;
  justify-items: end;
  align-items: center;
  min-width: 0;
}
nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; }
nav a { color: var(--ink); text-decoration: none; font-size: 13px; }
nav a:hover { color: var(--brand); }
.project-tab-shell {
  display: grid;
  grid-template-columns: 24px minmax(120px, 1fr) 24px;
  align-items: end;
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 5px 22px 7px;
  background:
    linear-gradient(180deg, #f2f7ff 0%, #e7eff9 100%),
    linear-gradient(135deg, #ecebff 0%, #eefbf8 100%);
  border-bottom: 1px solid #aebed0;
  box-shadow: 0 11px 24px rgba(38, 54, 78, .09);
  position: relative;
  z-index: 70;
}
.project-tab-shell.is-empty {
  display: none;
}
.project-tab-list {
  display: flex;
  align-items: end;
  gap: 4px;
  min-width: 0;
  min-height: 30px;
  overflow-x: auto;
  overflow-y: clip;
  scrollbar-width: none;
  scroll-behavior: smooth;
}
.project-tab-list::-webkit-scrollbar {
  display: none;
}
.project-tab {
  display: grid;
  grid-template-columns: 8px minmax(78px, 1fr) 18px;
  align-items: center;
  gap: 6px;
  min-width: 138px;
  max-width: 210px;
  height: 30px;
  padding: 3px 5px 3px 8px;
  border: 1px solid rgba(186, 199, 216, .84);
  border-radius: 7px;
  background: #f8fbff;
  color: var(--ink);
  text-decoration: none;
  box-shadow: none;
}
.project-tab.active {
  background: #fff;
  border-color: rgba(108, 78, 255, .48);
  box-shadow: 0 4px 12px rgba(38, 54, 78, .055);
}
.project-tab-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.14);
}
.project-tab-text {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--ink);
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.05;
}
.project-tab-text small {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  line-height: 1.05;
  font-size: 10px;
  font-weight: 700;
}
.project-tab-close,
.project-tab-scroll {
  appearance: none;
  display: inline-grid;
  place-items: center;
  min-height: 0;
  width: 20px;
  height: 20px;
  margin: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}
.project-tab-close {
  opacity: .42;
}
.project-tab:hover .project-tab-close,
.project-tab-close:focus-visible {
  opacity: 1;
}
.project-tab-close:hover,
.project-tab-scroll:hover {
  border-color: var(--line-strong);
  background: #fff;
  color: var(--error);
}
.project-tab-scroll {
  width: 20px;
  height: 22px;
  align-self: center;
  color: var(--ink);
  opacity: .58;
}

main {
  width: min(1500px, calc(100% - 28px));
  margin: 12px auto 48px;
}
body.public-minimal main {
  margin-top: 0;
}
body.public-minimal {
  background:
    linear-gradient(135deg, rgba(108,76,255,.08), transparent 34%),
    linear-gradient(315deg, rgba(0,105,220,.07), transparent 38%),
    #f7f9fc;
}

h1, h2 { margin: 0 0 14px; letter-spacing: 0; }
h1 { font-size: 24px; line-height: 1.15; }
h2 { font-size: 17px; }
p { line-height: 1.5; }
small, .muted { color: var(--muted); }
code {
  background: #eef1f5;
  border: 1px solid var(--line);
  padding: 2px 5px;
  border-radius: 4px;
}

.panel, .card, .event-head, .alert, .empty {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}
.panel {
  box-shadow: 0 1px 0 rgba(20, 34, 50, .02);
}
.narrow { max-width: 520px; margin: 0 auto; }
.auth-screen {
  min-height: calc(100vh - 130px);
  display: grid;
  place-items: center;
  padding: 28px 0;
}
.auth-card {
  width: min(440px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 26px;
  box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 30px; }
.signup-page {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 0 54px;
}
.signup-hero {
  display: grid;
  grid-template-columns: minmax(280px, 440px) minmax(0, 1fr);
  align-items: center;
  gap: 34px;
  margin-bottom: 22px;
  padding: 28px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(37, 63, 92, .08);
  border-radius: 8px;
  background:
    linear-gradient(125deg, rgba(255,255,255,.96), rgba(248,251,255,.88)),
    repeating-linear-gradient(135deg, rgba(108,76,255,.07) 0 1px, transparent 1px 26px);
  box-shadow: 0 18px 54px rgba(21, 34, 56, .08);
}
.signup-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(108,76,255,.12), transparent 26%),
    linear-gradient(270deg, rgba(0,105,220,.10), transparent 34%);
}
.signup-logo-panel,
.signup-hero-copy {
  position: relative;
  z-index: 1;
}
.signup-logo-panel {
  display: grid;
  gap: 12px;
  justify-items: center;
  padding: 24px 22px;
  border: 1px solid rgba(108, 76, 255, .12);
  border-radius: 8px;
  background: rgba(255,255,255,.82);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}
.signup-logo {
  display: block;
  width: min(100%, 360px);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 18px 28px rgba(33, 49, 83, .10));
}
.signup-logo-note {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 12px;
  color: #425166;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.signup-logo-note span {
  color: #6c4cff;
  font-weight: 800;
}
.signup-logo-note strong {
  color: #101927;
}
.signup-hero-copy {
  display: grid;
  gap: 12px;
  max-width: 650px;
}
.signup-hero-copy h1 {
  font-size: 44px;
  line-height: 1.04;
  max-width: 620px;
  margin-bottom: 4px;
}
.signup-hero-copy p {
  max-width: 720px;
  margin: 0;
  color: #4f5f70;
  font-size: 16px;
}
.signup-hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.signup-hero-points span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #405062;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
}
.signup-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  align-items: start;
  gap: 18px;
}
.signup-plans,
.signup-account-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.signup-plans {
  padding: 16px;
}
.signup-account-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  position: sticky;
  top: 78px;
}
.signup-section-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.signup-section-head > span {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #e9f5f8;
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
  flex: 0 0 auto;
}
.signup-section-head h2 {
  margin-bottom: 2px;
}
.signup-section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.signup-plan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.signup-plan-card {
  position: relative;
  display: block;
  min-width: 0;
  color: var(--ink);
  cursor: pointer;
}
.signup-plan-card input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}
.signup-plan-main {
  display: grid;
  gap: 12px;
  min-height: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfe;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.signup-plan-card:hover .signup-plan-main {
  border-color: var(--line-strong);
  background: #fff;
}
.signup-plan-card input:checked + .signup-plan-main {
  border-color: #6c4cff;
  background: #f8f6ff;
  box-shadow: inset 0 0 0 1px rgba(108, 76, 255, .30), 0 10px 28px rgba(108, 76, 255, .12);
}
.signup-plan-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.signup-plan-top small {
  display: block;
  color: #6c4cff;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.signup-plan-top strong {
  display: block;
  margin-top: 3px;
  font-size: 17px;
  color: var(--ink);
}
.signup-plan-badge {
  height: fit-content;
  border-radius: 999px;
  background: #edf8f0;
  color: var(--ok);
  padding: 4px 8px;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}
.signup-plan-badge.accent {
  background: #fff1e9;
  color: var(--brand-2);
}
.signup-plan-price {
  display: flex;
  align-items: baseline;
  gap: 7px;
}
.signup-plan-price strong {
  font-size: 28px;
  line-height: 1;
}
.signup-plan-price em {
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}
.signup-plan-desc {
  color: #405062;
  font-size: 13px;
  line-height: 1.45;
}
.signup-plan-modules {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.signup-plan-modules span {
  border-radius: 999px;
  background: #eef3f7;
  color: #405062;
  padding: 4px 7px;
  font-size: 11px;
  font-weight: 800;
}
.signup-plan-main ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.signup-plan-main li {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  font-size: 12px;
}
.signup-plan-main li strong {
  color: var(--ink);
}
.signup-plan-main li span {
  color: var(--muted);
}
.signup-account-panel button {
  width: 100%;
  min-height: 38px;
}
.signup-account-panel .muted {
  margin: 0;
}
.auth-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}
.public-minimal {
  background:
    radial-gradient(circle at 16% 5%, rgba(108, 78, 255, .24), transparent 26%),
    radial-gradient(circle at 88% 16%, rgba(37, 214, 177, .18), transparent 30%),
    linear-gradient(135deg, #f4f7fb 0%, #ffffff 48%, #f2f4f7 100%);
}
.stagedock-signup {
  max-width: 1340px;
  padding: 22px 18px 58px;
}
.signup-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.signup-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #0d0f14;
  text-decoration: none;
}
.signup-wordmark strong {
  font-size: 24px;
  letter-spacing: 0;
}
.signup-wordmark-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  object-fit: contain;
  box-shadow: 0 10px 24px rgba(108, 76, 255, .18);
}
.signup-topbar nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.signup-topbar nav a {
  border: 1px solid rgba(13, 15, 20, .10);
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  color: #202737;
  padding: 9px 13px;
  text-decoration: none;
  font-weight: 800;
}
.signup-topbar nav a[href*="public_events"] {
  display: none;
}
.staff-page-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(520px, 1.35fr);
  gap: 14px;
  align-items: start;
}
.staff-side-stack {
  display: grid;
  gap: 14px;
}
.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.panel-title-row h2 {
  margin: 0;
}
.staff-admin-table th,
.staff-admin-table td {
  vertical-align: top;
}
.staff-category-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 4px;
}
.staff-category-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #f8fbfd;
}
.staff-category-choice {
  margin: 0;
}
.staff-admin-modal-card {
  max-width: min(760px, calc(100vw - 32px));
}
.staff-admin-modal-card form {
  margin: 0;
}
@media (max-width: 1100px) {
  .staff-page-layout {
    grid-template-columns: 1fr;
  }
}
.stagedock-signup .signup-hero {
  display: block;
  position: relative;
  min-height: 0;
  margin-bottom: 18px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .56);
  border-radius: 18px;
  background: #0d0f14;
  box-shadow: 0 24px 80px rgba(13, 15, 20, .16);
  overflow: hidden;
}
.stagedock-signup .signup-hero::before {
  display: none;
}
.stagedock-signup .signup-hero-copy {
  display: none;
}
.stagedock-signup .signup-hero-copy .eyebrow {
  width: fit-content;
  background: rgba(108, 78, 255, .18);
  color: #bbaeff;
  border: 1px solid rgba(108, 78, 255, .36);
  border-radius: 999px;
  padding: 7px 12px;
}
.stagedock-signup .signup-hero-copy h1 {
  max-width: 560px;
  margin: 0;
  color: #fff;
  font-size: 58px;
  line-height: 1;
}
.stagedock-signup .signup-hero-copy p {
  max-width: 600px;
  color: rgba(255, 255, 255, .78);
  font-size: 18px;
  line-height: 1.55;
}
.stagedock-signup .signup-hero-points {
  max-width: 620px;
}
.stagedock-signup .signup-hero-points span {
  border-color: rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  backdrop-filter: blur(14px);
}
.stagedock-signup .signup-logo-panel {
  display: block;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.stagedock-signup .signup-logo {
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: 16 / 5.2;
  display: block;
  object-fit: cover;
  object-position: center;
  filter: none;
}
.stagedock-signup .signup-form {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  gap: 18px;
}
.stagedock-signup .signup-plans,
.stagedock-signup .signup-account-panel {
  border-color: rgba(16, 24, 40, .10);
  border-radius: 16px;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 22px 64px rgba(26, 32, 47, .08);
}
.stagedock-signup .signup-plans {
  padding: 20px;
}
.stagedock-signup .signup-account-panel {
  padding: 22px;
  top: 18px;
}
.stagedock-signup .signup-section-head > span {
  background: #ede9ff;
  color: #6c4eff;
}
.stagedock-signup .signup-plan-main {
  border-color: rgba(16, 24, 40, .10);
  border-radius: 14px;
  background: #fff;
}
.stagedock-signup .signup-plan-card input:checked + .signup-plan-main {
  border-color: #6c4eff;
  background: linear-gradient(180deg, #fbfaff, #ffffff);
  box-shadow: inset 0 0 0 1px rgba(108, 78, 255, .30), 0 16px 36px rgba(108, 78, 255, .12);
}
.stagedock-signup .signup-plan-top small {
  color: #6c4eff;
}
.stagedock-signup .signup-account-panel button {
  min-height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6c4eff, #2f7fd8);
}
.inline-user-form input,
.inline-user-form select,
td > input[form^="user-form-"],
td > select[form^="user-form-"] {
  width: 100%;
  min-width: 92px;
}
.event-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}
.compact-head p {
  margin: 4px 0 0;
  color: var(--muted);
}
.eyebrow {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  background: #e9f5f8;
  color: var(--brand);
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 5px;
}
.metrics {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.metrics span {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.dashboard-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff 0%, #f6fbfd 62%, #fff7f3 100%);
  box-shadow: var(--shadow);
}
.dashboard-hero p {
  margin: 0;
  color: var(--muted);
}
.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.dashboard-kpi {
  display: grid;
  gap: 5px;
  min-height: 96px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(20, 34, 50, .02);
}
.dashboard-kpi span,
.dashboard-card-head small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.dashboard-kpi strong {
  font-size: 25px;
  line-height: 1.1;
}
.dashboard-kpi small {
  color: var(--muted);
}
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(340px, .8fr);
  gap: 12px;
  align-items: start;
}
.dashboard-card {
  min-height: 280px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(20, 34, 50, .02);
}
.dashboard-card-wide {
  min-height: 260px;
}
.dashboard-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.dashboard-card-head h2 {
  margin: 0;
}
.dashboard-card-head a {
  color: var(--brand);
  font-weight: 800;
  text-decoration: none;
}
.dashboard-chart {
  padding: 16px 18px 18px;
}
.dashboard-chart-legend,
.dashboard-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 6px;
  border-radius: 999px;
  vertical-align: middle;
}
.dot.blue,
.dashboard-progress .blue { background: #2f80ed; }
.dot.violet,
.dashboard-progress .violet { background: #5146b5; }
.dot.rose,
.dashboard-progress .rose { background: #ec6f9f; }
.dashboard-bars {
  display: grid;
  grid-template-columns: repeat(12, minmax(34px, 1fr));
  align-items: end;
  gap: 10px;
  min-height: 250px;
  margin-top: 14px;
  padding: 16px 6px 0;
  border-bottom: 1px solid var(--line);
  background: repeating-linear-gradient(to top, transparent 0, transparent 48px, #edf1f5 49px, transparent 50px);
}
.dashboard-month {
  display: grid;
  gap: 8px;
  align-items: end;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}
.dashboard-month-bars {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 4px;
  height: 200px;
}
.dashboard-month-bars i {
  width: 12px;
  min-height: 4px;
  border-radius: 6px 6px 0 0;
}
.dashboard-month-bars .offer { background: #7c6ff0; }
.dashboard-month-bars .invoice { background: #2f80ed; }
.dashboard-donut-wrap {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 26px 18px;
}
.dashboard-donut {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  position: relative;
}
.dashboard-donut::after {
  content: "";
  position: absolute;
  inset: 42px;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
}
.dashboard-donut-legend {
  display: grid;
  gap: 13px;
}
.dashboard-donut-legend span {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 6px;
  align-items: center;
}
.dashboard-donut-legend small {
  grid-column: 2;
  color: var(--muted);
  font-weight: 800;
}
.dashboard-balance {
  display: grid;
  gap: 24px;
  padding: 20px 18px 26px;
}
.dashboard-balance > div:first-child span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.dashboard-balance > div:first-child strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}
.dashboard-progress {
  display: flex;
  overflow: hidden;
  height: 14px;
  border-radius: 999px;
  background: #edf2f7;
}
.dashboard-progress i {
  min-width: 0;
}
.dashboard-list,
.dashboard-events {
  display: grid;
  gap: 0;
}
.dashboard-list-row,
.dashboard-event-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}
.dashboard-list-row:hover,
.dashboard-event-row:hover {
  background: #f8fbfd;
}
.dashboard-list-row span,
.dashboard-event-row span {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.dashboard-list-row strong,
.dashboard-event-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dashboard-event-row {
  justify-content: flex-start;
}
.dashboard-event-row i {
  width: 12px;
  height: 36px;
  border-radius: 999px;
  flex: 0 0 auto;
}
.dashboard-empty {
  padding: 28px 18px;
}

.billing-documents-shell {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.billing-doc-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 14px 18px 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.billing-doc-tabs button {
  appearance: none;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  background: transparent;
  color: var(--brand);
  padding: 12px 14px;
  font-weight: 800;
  cursor: pointer;
}
.billing-doc-tabs button.active {
  background: #f8fbfd;
  border-color: var(--line);
  color: var(--ink);
}
.billing-doc-tabs span {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 20px;
  margin-left: 7px;
  border-radius: 999px;
  background: #e8f3f7;
  color: var(--brand);
  font-size: 12px;
}
.billing-document-panel {
  display: none;
  background: #fff;
}
.billing-document-panel.active {
  display: block;
}
.billing-document-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
}
.billing-document-toolbar h2 {
  margin-bottom: 3px;
}
.billing-document-toolbar p {
  margin: 0;
}
.billing-document-search {
  display: grid;
  gap: 5px;
  min-width: min(320px, 100%);
}
.billing-document-search span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.billing-document-totals {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 8px;
  padding: 0 18px 16px;
}
.billing-document-totals div {
  display: grid;
  gap: 5px;
  min-height: 66px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
}
.billing-document-totals span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.billing-document-totals strong {
  font-size: 17px;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.billing-document-table-wrap {
  overflow-x: auto;
}
.billing-document-table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
  font-size: 14px;
}
.billing-document-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f4f8fb;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-align: left;
  white-space: nowrap;
}
.billing-document-table th[data-sort-column] {
  cursor: pointer;
}
.billing-document-table th[data-sort-column]::after {
  content: " ";
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 5px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #9aa8b7;
  vertical-align: middle;
  opacity: .55;
}
.billing-document-table th[data-sort-direction="asc"]::after {
  border-top: 0;
  border-bottom: 5px solid var(--brand);
  opacity: 1;
}
.billing-document-table th[data-sort-direction="desc"]::after {
  border-top-color: var(--brand);
  opacity: 1;
}
.billing-document-table th,
.billing-document-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #edf1f5;
  vertical-align: top;
}
.billing-document-table tbody tr:nth-child(odd) {
  background: #fbfcfe;
}
.billing-document-table tbody tr:hover {
  background: #eef8fb;
}
.billing-document-table .number {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.billing-document-table a {
  color: #2688c7;
  font-weight: 800;
  text-decoration: none;
}
.billing-document-table a:hover {
  text-decoration: underline;
}
.doc-status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 4px;
  padding: 3px 7px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}
.doc-status.pending { background: #348aa0; }
.doc-status.open { background: #54a24b; }
.doc-status.late { background: #b64646; }
.doc-status.sent { background: #8b98a7; }
.doc-actions {
  text-align: right;
  white-space: nowrap;
}
.document-action-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: start center;
  padding: 80px 18px 24px;
  background: rgba(15, 23, 42, .28);
}
.document-action-modal[hidden] {
  display: none;
}
.document-action-card {
  width: min(680px, 100%);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(15, 23, 42, .22);
  padding: 16px;
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 {
  margin-bottom: 4px;
}
.modal-head p {
  margin: 0;
  color: var(--muted);
}
.modal-close {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  width: 32px;
  height: 32px;
  cursor: pointer;
}
.modal-close:hover {
  border-color: var(--error);
  color: var(--error);
}
.contact-create-modal {
  width: min(1040px, calc(100% - 28px));
  max-height: calc(100vh - 44px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
}
.contact-create-modal::backdrop {
  background: rgba(15, 23, 42, .34);
}
.contact-create-card {
  max-height: calc(100vh - 44px);
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(15, 23, 42, .24);
  padding: 16px;
}
.icon-button {
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  border-color: var(--line);
  background: #fff;
  color: var(--brand);
}
.icon-button:hover {
  border-color: var(--brand);
  background: #eef8fb;
  filter: none;
}
.selected-document-row {
  background: #e8f5fb !important;
  box-shadow: inset 4px 0 0 var(--brand);
}
.project-details summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 8px;
  align-items: center;
  cursor: pointer;
  list-style: none;
}
.project-details summary::-webkit-details-marker {
  display: none;
}
.project-details summary a {
  font-weight: 900;
}
.project-details summary small {
  grid-column: 2;
}
.color-chip {
  width: 14px;
  height: 14px;
  display: inline-block;
  border: 1px solid rgba(0,0,0,.15);
  border-radius: 4px;
  vertical-align: middle;
}
.project-drawer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 10px 0 0 22px;
  padding: 10px;
  border-left: 3px solid var(--line-strong);
  background: #fbfdfe;
}
.project-drawer-content div {
  display: grid;
  gap: 2px;
}
.project-drawer-content strong {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
}
.project-drawer-content span {
  font-size: 13px;
}
.project-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.project-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
}
.project-nav a.active {
  border-color: var(--brand);
  background: #e9f5f8;
  color: var(--brand);
}
.subproject-bar {
  display: grid;
  grid-template-columns: auto 24px minmax(0, 1fr) 24px;
  gap: 8px;
  align-items: center;
  margin: -4px 0 12px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfe;
}
.subproject-bar > strong {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}
.subproject-tab-list {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  overflow-y: clip;
  padding-bottom: 1px;
  scrollbar-width: none;
  scroll-behavior: smooth;
}
.subproject-tab-list::-webkit-scrollbar {
  display: none;
}
.subproject-tab-scroll {
  justify-self: center;
}
.subproject-bar a {
  flex: 0 0 auto;
  display: inline-grid;
  grid-template-columns: auto auto;
  gap: 0 6px;
  align-items: center;
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}
.subproject-bar a small {
  grid-column: 2;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}
.subproject-bar a.active {
  border-color: var(--brand);
  background: #e9f5f8;
  color: var(--brand);
}
.project-general-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
  gap: 18px;
}
.compact-dl {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0;
}
.compact-dl dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.compact-dl dd {
  margin: 0;
}
.vertical-toolbar {
  align-items: stretch;
  flex-direction: column;
}
.alert {
  margin-bottom: 16px;
  border-color: #b7d1be;
  background: #edf8f0;
  color: var(--ok);
}
.alert.error {
  border-color: #e0b1b1;
  background: #fff0f0;
  color: var(--error);
}
.grid { display: grid; gap: 10px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.span-two { grid-column: span 2; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

form { display: grid; gap: 10px; }
form.inline { display: flex; gap: 8px; margin: 0; }
label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 700; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  outline: 3px solid rgba(29, 111, 143, .14);
}
textarea { min-height: 54px; resize: vertical; }

.field-with-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}
.field-with-action .button {
  display: inline-flex;
  align-items: center;
  margin: 0;
  white-space: nowrap;
}
.address-sections {
  margin-top: 10px;
}
.address-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfdfe;
}
.address-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(70px, .7fr) minmax(90px, .9fr) minmax(0, 1.4fr) minmax(90px, .9fr);
  gap: 8px;
  margin-top: 8px;
}
.address-grid input[readonly] {
  background: #f3f6f9;
  color: #405062;
}
.contact-address-editor {
  display: grid;
  gap: 2px;
  margin-top: 14px;
  padding: 12px 0 0 34px;
  border-top: 1px solid var(--line);
}
.contact-address-editor h3 {
  margin: 0 0 4px -34px;
}
.contact-address-row,
.contact-address-extra-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  gap: 8px;
  align-items: end;
}
.contact-address-row.country-row {
  grid-template-columns: minmax(180px, 240px);
}
.contact-address-extra-line {
  grid-template-columns: minmax(0, 1fr) 28px;
  margin: 2px 0;
}
.contact-address-slot {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
  min-height: 18px;
}
.contact-address-slot::before {
  content: "";
  position: absolute;
  left: 0;
  right: 4px;
  top: 50%;
  border-top: 1px dashed transparent;
  transform: translateY(-50%);
  pointer-events: none;
}
.contact-address-slot:hover::before,
.contact-address-slot:focus-within::before {
  border-top-color: #9bc6d8;
}
.tiny-add-button {
  width: 24px;
  min-width: 24px;
  min-height: 24px;
  height: 24px;
  padding: 0;
  border-radius: 999px;
  font-size: 14px;
  line-height: 1;
}
.contact-address-add {
  position: absolute;
  left: -31px;
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
  border-color: #c8d7e2;
  background: #fff;
  color: var(--brand);
  opacity: .58;
}
.contact-address-add:hover {
  border-color: var(--brand);
  background: #eaf6fb;
  opacity: 1;
  filter: none;
}
.color-field {
  display: grid;
  grid-template-columns: 52px 34px minmax(74px, 1fr);
  gap: 8px;
  align-items: center;
}
.color-field input[type="color"] {
  height: 34px;
  min-height: 34px;
  padding: 2px;
  cursor: pointer;
}
.color-preview {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.55);
}
.color-field strong {
  color: var(--ink);
  font-size: 13px;
}

.logo-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfe;
}
.logo-preview img {
  width: 110px;
  height: 54px;
  object-fit: contain;
  object-position: left center;
  flex: 0 0 auto;
}
.logo-preview span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

button, .button {
  appearance: none;
  border: 1px solid var(--brand);
  border-radius: 5px;
  background: var(--brand);
  color: #fff;
  padding: 7px 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 32px;
}
button.secondary, .button.secondary {
  background: #fff;
  color: var(--brand);
}
button:hover, .button:hover { filter: brightness(0.95); }
button:focus-visible,
.button:focus-visible {
  outline: 3px solid rgba(29, 111, 143, .18);
  outline-offset: 2px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 10px;
}
thead th {
  background: #f7fafc;
  border-bottom-color: var(--line-strong);
}
th, td {
  border-bottom: 1px solid var(--line);
  padding: 7px 8px;
  text-align: left;
  vertical-align: top;
}
th { color: var(--muted); font-size: 13px; }
tbody tr:hover > td {
  background: #fbfdfe;
}
.contact-people-preview {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.contact-people-preview small {
  display: block;
  margin-top: 1px;
}
.contact-people-editor {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.contact-people-editor h3 {
  margin: 0;
}
.contact-people-table-wrap {
  width: 100%;
  overflow-x: auto;
}
.contact-people-table {
  min-width: 860px;
  margin-bottom: 8px;
}
.contact-people-table th,
.contact-people-table td {
  padding: 6px;
}
.contact-people-table input,
.contact-people-table select {
  min-height: 34px;
  padding: 6px 8px;
}
.contact-primary-check {
  min-height: 34px;
  white-space: nowrap;
}
.row-action,
td:last-child {
  text-align: right;
}
.row-action {
  white-space: nowrap;
}
.badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 3px 8px;
  background: #eef1f5;
  color: var(--muted);
  font-size: 12px;
}
.badge.pending {
  background: #fff5df;
  color: var(--warn);
}
.badge.confirmed {
  background: #edf8f0;
  color: var(--ok);
}
.badge.neutral {
  background: #edf2f7;
  color: #536579;
}
.check-row {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}
.check-row input {
  width: 16px;
  height: 16px;
}
.material-picker {
  position: relative;
}
.material-picker-list {
  display: none;
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  box-shadow: var(--shadow);
  padding: 4px;
}
.material-picker.open .material-picker-list {
  display: grid;
  gap: 3px;
}
.material-picker-list button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  background: #fff;
  color: var(--ink);
  border: 0;
  border-radius: 5px;
  padding: 7px 8px;
  text-align: left;
}
.material-picker-list button:hover {
  background: #eef6f8;
  filter: none;
}
.material-picker-list strong,
.material-picker-list small {
  display: block;
}
.material-picker-list em {
  flex: 0 0 auto;
  font-style: normal;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}
.material-workbench {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-height: calc(100vh - 150px);
}
.material-sidebar {
  position: sticky;
  top: 58px;
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 72px);
  overflow: auto;
  padding-right: 3px;
}
.material-config-panel,
.material-catalog,
.material-timeline {
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 12px;
}
.material-config-panel h2,
.material-catalog h2,
.material-base h2,
.material-timeline h2 {
  margin-bottom: 8px;
}
.compact-form {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.material-catalog-head {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}
.material-tree {
  display: grid;
  gap: 4px;
}
.material-tree-folder {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.material-tree-folder > summary {
  cursor: pointer;
  padding: 7px 8px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
  list-style: none;
  text-transform: uppercase;
}
.material-tree-folder > summary::-webkit-details-marker {
  display: none;
}
.material-tree-children {
  display: grid;
  gap: 4px;
  padding: 0 6px 6px 12px;
}
.material-category {
  border-top: 1px solid var(--line);
  padding-top: 8px;
  margin-top: 8px;
}
.material-category h3 {
  margin: 0 0 6px;
  color: var(--brand);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}
.material-category-items {
  display: grid;
  gap: 4px;
}
.material-catalog-item {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: grab;
}
.material-catalog-item:hover {
  background: #eef6f8;
  filter: none;
}
.material-catalog-item.dragging {
  opacity: .55;
}
.material-base tr.dragging {
  opacity: .5;
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}
.material-base tbody tr[data-material-allocation].selected {
  background: #eef6f8;
  outline: 2px solid rgba(11, 95, 122, .22);
  outline-offset: -2px;
}
.material-base tbody tr[data-material-allocation].material-row-selected td {
  background: #e8f4f7;
  box-shadow: inset 3px 0 0 var(--brand);
}
.planning-position-table tbody tr[data-planning-position-row] {
  cursor: pointer;
}
.planning-position-table tbody tr.planning-position-selected td {
  background: #e8f4f7;
  box-shadow: inset 3px 0 0 var(--brand);
}
.planning-position-select-cell {
  width: 34px;
  text-align: center;
}
.planning-position-select-cell input {
  width: 16px;
  height: 16px;
  min-height: 16px;
}
.material-base tbody tr[data-material-allocation] {
  cursor: grab;
}
.material-catalog-item.selected {
  border-color: var(--brand);
  background: #e9f5f8;
}
.material-catalog-item strong,
.material-catalog-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.material-catalog-item small {
  color: var(--muted);
  font-size: 11px;
}
.material-catalog-item em {
  min-width: 48px;
  padding: 3px 6px;
  border-radius: 999px;
  background: #edf8f0;
  color: var(--ok);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  text-align: center;
  cursor: text;
}
.material-catalog-item em.low {
  background: #fff5df;
  color: var(--warn);
}
.material-catalog-item em input {
  width: 54px;
  min-height: 22px;
  border: 0;
  border-radius: 999px;
  padding: 1px 4px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}
.material-catalog-item em input:focus {
  outline: 2px solid rgba(84, 162, 75, .28);
}
.material-base {
  position: sticky;
  top: 58px;
  min-width: 0;
  max-height: calc(100vh - 72px);
  overflow: auto;
}
.material-base-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.material-transport-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 8px;
}
.material-transport-summary span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fbfc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.material-transport-summary strong {
  color: var(--ink);
  font-size: 13px;
}
.material-dropzone {
  min-height: 320px;
  border: 1px dashed transparent;
  border-radius: 8px;
}
.material-dropzone.drop-target {
  border-color: var(--brand);
  background: #eef8fb;
}
.material-dropzone.saving {
  opacity: .65;
  pointer-events: none;
}
.inline-cell {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 2px 4px;
  color: var(--ink);
  font-weight: 500;
  cursor: text;
}
.inline-cell:hover {
  border-color: #c9e0e8;
  background: #eef6f8;
}
.inline-cell.editing {
  padding: 0;
  background: transparent;
}
.inline-cell.multiline {
  display: inline-block;
  max-width: min(520px, 100%);
  white-space: pre-line;
  line-height: 1.35;
  vertical-align: top;
}
.inline-cell.multiline.editing {
  display: block;
  width: 100%;
}
.inline-cell-input {
  min-width: 70px;
  max-width: 240px;
  padding: 4px 6px;
  font-size: 13px;
}
.inline-cell textarea.inline-cell-input,
textarea.inline-cell-input {
  width: min(520px, 100%);
  max-width: 100%;
  min-height: 78px;
  resize: vertical;
  line-height: 1.35;
  white-space: pre-wrap;
}
.inline-cell select.inline-cell-input,
select.inline-cell-input {
  min-width: 120px;
  padding-right: 28px;
}
.planning-inline {
  max-width: 260px;
}
.project-inline {
  max-width: min(520px, 100%);
  white-space: normal;
}
.timeline-title {
  display: grid;
  gap: 2px;
  margin-bottom: 8px;
}
.timeline-title small,
.timeline-row-head small {
  color: var(--muted);
  font-size: 11px;
}
.timeline-row {
  display: grid;
  gap: 5px;
  padding: 7px 0;
  border-top: 1px solid var(--line);
}
.timeline-row-head {
  display: grid;
  gap: 2px;
}
.timeline-row-head strong {
  font-size: 12px;
  font-weight: 800;
}
.timeline-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: #eef1f5;
  overflow: hidden;
}
.timeline-track span {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 999px;
  background: var(--brand);
}
.stock-timeline-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 10px;
  margin-bottom: 8px;
}
.stock-timeline {
  display: grid;
  grid-template-columns: 220px minmax(680px, 1fr);
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
}
.stock-timeline-left {
  position: sticky;
  left: 0;
  z-index: 4;
  background: #fff;
  border-right: 1px solid var(--line-strong);
}
.stock-timeline-corner {
  grid-column: 1;
  grid-row: 1 / span 2;
  display: flex;
  align-items: end;
  padding: 10px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
.stock-month-row,
.stock-day-row,
.stock-availability-row,
.stock-timeline-bars {
  display: grid;
  grid-template-columns: repeat(var(--day-count), minmax(38px, 1fr));
  min-width: calc(var(--day-count) * 38px);
}
.stock-month-row {
  grid-column: 2;
  padding: 7px 0 3px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}
.stock-day-row {
  grid-column: 2;
  border-bottom: 1px solid var(--line-strong);
}
.stock-day-row span,
.stock-availability-row span {
  min-height: 28px;
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line);
  font-size: 12px;
  font-weight: 800;
}
.stock-timeline-availability {
  grid-column: 1;
  display: grid;
  align-content: center;
  gap: 2px;
  min-height: 36px;
  padding: 7px 10px;
  border-top: 1px solid var(--line);
}
.stock-timeline-availability small,
.stock-timeline-label small {
  color: var(--muted);
  font-size: 11px;
}
.stock-availability-row {
  grid-column: 2;
  border-bottom: 1px solid var(--line-strong);
}
.stock-availability-row .ok {
  background: #c7f1d9;
  color: #17623a;
}
.stock-availability-row .partial {
  background: #d9f4e5;
  color: #17623a;
}
.stock-availability-row .empty {
  background: #ffd8ad;
  color: #8f4a00;
}
.stock-timeline-row {
  display: contents;
}
.stock-timeline-label {
  position: sticky;
  left: 0;
  z-index: 3;
  display: grid;
  align-content: center;
  gap: 2px;
  min-height: 42px;
  padding: 7px 10px;
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line-strong);
  background: #fff;
}
.stock-timeline-label strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stock-timeline-bars {
  position: relative;
  align-items: center;
  min-height: 42px;
  border-top: 1px solid var(--line);
  background-image: repeating-linear-gradient(to right, transparent 0, transparent calc(100% / var(--day-count) - 1px), var(--line) calc(100% / var(--day-count) - 1px), var(--line) calc(100% / var(--day-count)));
}
.stock-bar {
  height: 24px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 5px;
  color: #17623a;
  font-size: 12px;
  font-weight: 900;
  background: #bdeecf;
  box-shadow: inset 0 0 0 1px rgba(23, 98, 58, .08);
}
.stock-bar.over {
  color: #8f4a00;
  background: #ffd3a1;
}
.stock-bar.unreserved {
  color: #5c6570;
  background: #dbe3ec;
  border-style: dashed;
}
.material-category-row th {
  position: relative;
  background: #f2f7fa;
  color: var(--brand);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0;
}
.section-title-text {
  margin-left: 6px;
}
.section-row-actions {
  float: right;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.section-row-actions details {
  display: inline-block;
}
.section-row-actions .document-action > summary {
  min-height: 28px;
  padding: 5px 8px;
  font-size: 11px;
  text-transform: none;
}
.material-category-row[draggable="true"] th {
  cursor: grab;
  user-select: none;
}
.material-category-row.dragging th,
.invoice-section-empty.dragging td {
  opacity: .55;
}
.invoice-section-empty td {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  border-bottom: 1px dashed var(--line-strong);
  background: #fbfdfe;
}
.danger-icon {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid #efb5a8;
  border-radius: 6px;
  background: #fff;
  color: #b54735;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}
.danger-icon:hover {
  background: #fff1ee;
  color: #8f2f22;
  filter: none;
}
.compact-inline-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.compact-inline-form select {
  min-height: 28px;
  padding: 4px 28px 4px 8px;
}
.compact-inline-form button {
  min-height: 28px;
  padding: 4px 8px;
}
.project-calendar-toggle {
  margin-top: 8px;
}
.project-calendar-toggle .check-row {
  min-height: 28px;
  margin: 0;
  color: var(--ink);
  font-size: 13px;
}
.hidden-form {
  display: none;
}
.line-description .inline-cell {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.billing-workbench {
  position: relative;
  top: auto;
  max-height: none;
}
.billing-staff-workbench tr.dragging {
  opacity: .5;
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}
[data-billing-staff-dropzone].drop-target {
  border-radius: 8px;
  background: #eef8fb;
  outline: 1px dashed var(--brand);
}
.drag-cell {
  width: 34px;
}
.drag-handle {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  cursor: grab;
  font-weight: 900;
  letter-spacing: -2px;
}
.drag-handle:hover {
  background: #eef6f8;
  color: var(--brand);
  filter: none;
}
.billing-summary {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.document-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
  margin: 0 0 12px;
}
.document-actions-with-send {
  justify-content: space-between;
}
.document-generate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
  min-width: 0;
}
.document-send-action {
  display: grid;
  justify-items: end;
  gap: 4px;
  align-self: flex-start;
  margin-left: auto;
  min-width: 148px;
}
.document-send-action small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  min-height: 15px;
  text-align: right;
}
.toolbar .inline-form {
  margin: 0;
}
.toolbar .document-send-action {
  align-self: flex-start;
}
.document-row-actions {
  justify-content: flex-end;
  gap: 6px;
}
.project-document-group table {
  table-layout: auto;
}
.document-history-row > td {
  background: #fbfdff;
  border-top: 0;
  padding-top: 0;
}
.document-history-drawer {
  margin: 2px 0 8px;
}
.document-history-drawer summary {
  color: var(--brand);
  cursor: pointer;
  font-weight: 800;
}
.document-history-payload {
  display: block;
  max-width: 720px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.send-document-card {
  width: min(760px, calc(100vw - 32px));
}
.send-document-card .send-mail-editor {
  margin-top: 4px;
}
.send-mail-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}
.send-mail-footer button {
  min-width: 160px;
}
.document-action {
  position: relative;
}
.document-action-stack {
  display: grid;
  gap: 6px;
  align-items: start;
  min-width: 250px;
  width: 250px;
}
.document-action-stack > .button,
.document-action-stack > button,
.document-action-stack .preview-button {
  justify-content: center;
  width: 100%;
  min-height: 36px;
  white-space: nowrap;
}
.document-action-stack .muted-button,
.document-action-stack button:disabled {
  border-color: #ccd6de;
  background: #edf2f6;
  color: #8492a1;
  cursor: not-allowed;
  opacity: .72;
}
@media (max-width: 760px) {
  .document-action-stack {
    min-width: 100%;
    width: 100%;
  }
}
.document-edit-action {
  align-self: stretch;
}
.document-edit-action button {
  min-height: 37px;
}
.invoice-final-drop td {
  padding: 10px 12px;
  border-top: 1px dashed #b8c7d3;
  color: #64748b;
  font-size: 12px;
  text-align: center;
}
.document-action > summary {
  list-style: none;
  cursor: pointer;
}
.document-action > summary::-webkit-details-marker {
  display: none;
}
.document-action form {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  width: min(520px, calc(100vw - 32px));
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}
.billing-line-action form {
  width: min(720px, calc(100vw - 32px));
}
.document-attachments-card {
  width: min(860px, 100%);
}
.document-config-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.document-attachment-upload {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}
.document-attachment-list {
  display: grid;
  gap: 8px;
  min-height: 64px;
  padding: 10px;
  border: 1px dashed #c8d7e2;
  border-radius: 8px;
  background: #f8fbfd;
}
.document-attachment-list.drop-target {
  border-color: var(--brand);
  background: #eef8fb;
}
.document-attachment-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  cursor: grab;
}
.document-attachment-row.dragging {
  opacity: .55;
}
.document-attachment-row form {
  margin: 0;
}
.document-attachment-marker {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid #b7cad6;
  border-radius: 7px;
  background: #eaf4f8;
  color: var(--brand);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 900;
}
.document-attachment-marker small {
  color: var(--muted);
  text-transform: none;
}
.document-attachment-applies {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
}
.document-attachment-applies label {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  margin: 0;
  font-size: 12px;
}
.document-attachment-empty {
  padding: 12px;
  text-align: center;
}
.invoice-table {
  table-layout: fixed;
}
.invoice-table th,
.invoice-table td {
  vertical-align: top;
}
.billing-material-table .billing-col-designation { width: 42%; }
.billing-material-table .billing-col-qty { width: 7%; }
.billing-material-table .billing-col-price { width: 12%; }
.billing-material-table .billing-col-coef { width: 9%; }
.billing-material-table .billing-col-discount { width: 10%; }
.billing-material-table .billing-col-money { width: 9%; }
.billing-material-table .billing-col-action { width: 2.5rem; }
.billing-material-table td:first-child {
  overflow-wrap: anywhere;
}
.billing-lines-workbench .document-actions {
  margin: 8px 0 12px;
  align-items: center;
}
.billing-empty-section-toggle {
  margin-left: auto;
}
.billing-empty-section-toggle .check-row {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.billing-lines-workbench.billing-locked {
  opacity: .84;
}
.billing-lines-workbench.billing-locked form,
.billing-lines-workbench.billing-locked .billing-selection-toolbar,
.billing-lines-workbench.billing-locked .billing-line-actions,
.billing-lines-workbench.billing-locked .row-action,
.billing-lines-workbench.billing-locked .section-row-actions {
  display: none;
}
.billing-lines-workbench.billing-locked [draggable="true"] {
  cursor: default;
}
.invoice-row-selected td {
  background: #e8f4f7 !important;
  box-shadow: inset 3px 0 0 var(--brand);
}
.billing-selection-toolbar {
  margin: 8px 0 10px;
}
.billing-selection-toolbar input {
  width: 110px;
}
.billing-text-line td,
.billing-page-break-line td {
  background: #fbfdfe;
}
.rich-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}
.rich-toolbar button {
  width: 30px;
  min-height: 30px;
  padding: 0;
}
.rich-toolbar select,
.rich-toolbar input[type="color"] {
  min-height: 30px;
}
.rich-toolbar select {
  width: auto;
  min-width: 92px;
}
.rich-toolbar select[data-rich-font] {
  min-width: 150px;
}
.rich-toolbar .color-field {
  width: auto;
  min-width: 126px;
  margin: 0;
}
.rich-toolbar .color-field input[type="color"] {
  min-height: auto;
}
.rich-surface {
  min-height: 120px;
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  line-height: 1.35;
}
.rich-surface:focus {
  outline: 2px solid rgba(29, 111, 143, .18);
  border-color: var(--brand);
}
.rich-output {
  margin-top: 4px;
  line-height: 1.35;
}
.doc-text-line td {
  padding-top: 10px;
  padding-bottom: 10px;
}
.doc-page-break td {
  height: 0;
  padding: 0;
  border: 0;
}
.invoice-page-break {
  margin: 18px 0;
  border-top: 2px dashed #9aa8b7;
  color: #5f6b7a;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}
.invoice-page-break::after {
  content: "Saut de page";
  display: inline-block;
  position: relative;
  top: -8px;
  padding: 0 8px;
  background: #fff;
}
.section-subtotal td,
.section-subtotal th {
  border-top: 2px solid var(--line-strong);
  background: #fbfdfe;
  color: var(--ink);
  font-weight: 900;
}
.invoice-total-panel {
  display: flex;
  justify-content: flex-end;
  margin: 12px 0;
}
.invoice-total-panel table,
.document-totals table {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.invoice-total-panel th,
.invoice-total-panel td,
.document-totals th,
.document-totals td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
.invoice-total-panel th,
.document-totals th {
  text-align: left;
  color: var(--muted);
}
.invoice-total-panel td,
.document-totals td {
  text-align: right;
  font-weight: 800;
}
.grand-total th,
.grand-total td {
  background: #eef6f8;
  color: var(--ink);
  font-size: 16px;
}
.invoice-document {
  position: relative;
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 38px;
  color: #111827;
  font-family: var(--document-font, "Inter", "Segoe UI", Arial, Helvetica, sans-serif);
}
.document-company {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  color: #5f6b7a;
  font-size: 12px;
}
.document-logo {
  width: 120px;
  max-height: 58px;
  object-fit: contain;
  object-position: left center;
}
.document-company .document-logo {
  width: 140px;
  max-height: 64px;
}
.print-logo-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.document-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid #111827;
}
.document-head p {
  margin: 0 0 8px;
}
.document-client {
  padding-top: 10px;
}
.document-meta {
  text-align: right;
}
.document-meta h1 {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 900;
}
.document-table {
  table-layout: fixed;
  margin-bottom: 22px;
  border: 0;
  border-collapse: collapse;
}
.document-table th,
.document-table td {
  border-right: 0;
  border-bottom: 1px solid #d8dee7;
  padding: 7px 6px;
  vertical-align: top;
}
.document-table thead th {
  background: var(--document-table-head-bg, #f5f8fb);
  color: var(--document-table-head-color, #1f2937);
  font-size: 11px;
  font-weight: 900;
  text-align: left;
}
.document-line-table {
  font-size: 12px;
  width: calc(100% - var(--document-lines-offset-x, 0mm));
  margin-left: var(--document-lines-offset-x, 0mm);
  margin-right: 0;
  break-inside: auto;
  page-break-inside: auto;
}
.document-line-table thead {
  display: table-header-group;
}
.document-line-table tbody {
  display: table-row-group;
}
.document-line-table tr {
  break-inside: avoid;
  page-break-inside: avoid;
}
.doc-section td {
  padding-top: 15px;
  border-bottom: 1px solid var(--document-accent, #111827);
  color: var(--document-accent, #111827);
  font-weight: 900;
}
.doc-section .doc-section-label {
  text-align: left;
}
.doc-section-subtotal td {
  padding-top: 8px;
  border-top: 1px solid var(--document-accent, #111827);
  border-bottom: 1px solid #d8dee7;
  color: var(--document-accent, #111827);
  font-weight: 900;
}
.doc-section-subtotal .doc-subtotal-label {
  text-align: right;
}
.doc-desc strong,
.doc-desc small,
.doc-desc span {
  display: block;
}
.doc-desc small {
  margin-top: 2px;
  color: #5f6b7a;
}
.doc-desc span {
  margin-top: 2px;
  color: #374151;
  line-height: 1.35;
}
.doc-num {
  text-align: right;
  white-space: nowrap;
}
.doc-pos {
  color: #4b5563;
}
.doc-col-pos { width: 6%; }
.doc-col-desc { width: 50%; }
.doc-col-price { width: 10.56%; }
.doc-col-qty { width: 7.48%; }
.doc-col-coef { width: 7.48%; }
.doc-col-discount { width: 7.92%; }
.doc-col-total { width: 10.56%; }
.doc-col-date { width: 32%; }
.document-totals {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
  margin-left: var(--document-totals-offset-x, 0mm);
  margin-right: 0;
}
.print-sheet {
  background: #fff;
  padding: 32px;
  border: 1px solid var(--line);
}
.print-sheet.invoice-document {
  padding: 32px 38px;
  border: 0;
  font-family: var(--document-font, "Inter", "Segoe UI", Arial, Helvetica, sans-serif);
}
.invoice-top {
  width: 100%;
  display: table;
  table-layout: fixed;
  border-collapse: collapse;
  align-items: start;
  font-family: var(--document-font, "Inter", "Segoe UI", Arial, Helvetica, sans-serif);
}
.invoice-top > tbody {
  display: table-row-group;
}
.invoice-top > tbody > tr {
  display: table-row;
}
.invoice-top td {
  display: table-cell;
  width: 50%;
  padding: 0;
  border: 0;
  vertical-align: top;
}
.invoice-company {
  width: 48%;
}
.invoice-client {
  width: 48%;
  padding-top: 42mm;
}
.invoice-logo-box {
  min-height: 0;
  height: auto;
  margin: 0 0 var(--document-logo-text-gap, 0.5mm) var(--document-logo-offset-x, 0mm);
  overflow: visible;
}
.invoice-company p,
.invoice-client p {
  margin: 0;
  font-size: 14px;
  line-height: 1.22;
}
.invoice-company p {
  margin-left: var(--document-company-text-offset-x, 0mm);
}
.invoice-logo {
  width: 300px;
  max-height: 115px;
  object-fit: contain;
  object-position: left top;
}
.invoice-client-inner {
  margin-left: var(--document-client-offset-x, 0mm);
}
.invoice-return-line {
  display: inline-block;
  min-width: 320px;
  padding-bottom: 2px;
  border-bottom: 2px solid var(--document-accent, #111827);
  font-size: 12px;
  font-weight: 500;
}
.invoice-title-block {
  margin: 82px 0 12px var(--document-title-offset-x, 0mm);
  border-bottom: 1px solid var(--document-accent, #111827);
  font-family: var(--document-font, "Inter", "Segoe UI", Arial, Helvetica, sans-serif);
}
.invoice-title-block h1 {
  margin: 0 0 14px;
  font-size: 24px;
  font-weight: 900;
}
.invoice-title-block h2 {
  margin: 0;
  padding: 12px 0;
  border-top: 1px solid var(--document-accent, #111827);
  font-size: 23px;
  font-weight: 900;
}
.invoice-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px 80px;
  margin: 0 0 18px var(--document-meta-offset-x, 0mm);
  padding: 0 0 12px;
  border-bottom: 1px solid var(--document-accent, #111827);
  font-size: 13px;
  line-height: 1.15;
  font-family: var(--document-font, "Inter", "Segoe UI", Arial, Helvetica, sans-serif);
}
.invoice-meta-grid div {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr);
  gap: 10px;
  min-height: 18px;
}
.invoice-meta-grid span {
  color: var(--document-accent, #111827);
}
.invoice-meta-grid strong {
  font-weight: 500;
}
.invoice-document .document-totals table {
  width: 320px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.invoice-document .document-totals th,
.invoice-document .document-totals td {
  padding: 6px 4px;
  border-bottom: 1px solid #d8dee7;
}
.invoice-document .document-totals th {
  text-align: left;
}
.invoice-document .document-totals td {
  text-align: right;
}
.invoice-document .document-totals .grand-total th,
.invoice-document .document-totals .grand-total td {
  border-top: 2px solid var(--document-accent, #111827);
  background: transparent;
  font-size: 15px;
}
.invoice-document .document-totals + .document-end-block {
  margin-top: 52px;
}
.invoice-document .document-totals + .document-end-block + .document-end-block {
  margin-top: 14px;
}
.invoice-document .document-end-block {
  color: #111827;
  font-family: var(--document-font, "Inter", "Segoe UI", Arial, Helvetica, sans-serif);
  font-size: 11px;
  line-height: 1.3;
}
.invoice-document .document-end-block h2 {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.15;
  font-weight: 900;
}
.invoice-document .document-end-block p {
  margin: 0;
  max-width: 720px;
}
.document-cover-page {
  min-height: 920px;
  display: flex;
  flex-direction: column;
  gap: 34px;
}
.document-cover-page .cover-top {
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: 54px;
  align-items: start;
  margin-top: 18px;
}
.document-cover-page h1 {
  margin: 10px 0 8px;
  font-size: 34px;
  line-height: 1.08;
  font-weight: 900;
}
.document-cover-page p {
  margin: 0;
  color: #475569;
  line-height: 1.35;
}
.cover-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: auto;
  padding-top: 20px;
  border-top: 2px solid var(--document-accent, #111827);
}
.cover-meta span {
  display: block;
  margin-bottom: 8px;
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.cover-meta strong {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
}
.cover-body {
  max-width: 760px;
  margin-top: 28px;
  font-size: 13px;
  line-height: 1.45;
}
.cover-file-state {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.cover-designer-shell {
  display: grid;
  grid-template-columns: 260px minmax(420px, 1fr) 280px;
  gap: 14px;
  align-items: start;
}
.cover-designer-panel,
.cover-designer-work {
  background: #fff;
  border: 1px solid #d8e2ec;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
}
.cover-designer-panel {
  position: sticky;
  top: 86px;
  padding: 14px;
}
.cover-designer-panel h2 {
  margin-top: 0;
}
.cover-field-palette {
  display: grid;
  gap: 8px;
}
.cover-field-palette button {
  justify-content: flex-start;
}
.cover-designer-work {
  padding: 18px;
  overflow: auto;
  background: #eef3f8;
}
.cover-designer-page {
  position: relative;
  width: min(100%, 794px);
  aspect-ratio: 210 / 297;
  margin: 0 auto;
  background: #fff;
  border: 1px solid #cbd5e1;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.14);
  overflow: hidden;
}
.cover-designer-pdf,
.cover-designer-pdf-canvas,
.document-cover-pdf-background {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}
.cover-designer-pdf,
.cover-designer-pdf-canvas,
.document-cover-pdf-canvas {
  pointer-events: none;
  width: 100%;
  height: 100%;
  transform: none;
  display: block;
}
.cover-designer-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 8px;
  color: #64748b;
  text-align: center;
}
.cover-designer-layer,
.document-cover-field-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
}
.cover-designer-field {
  position: absolute;
  display: flex;
  align-items: center;
  padding: 4px 6px;
  border: 1px dashed rgba(29, 111, 143, 0.75);
  background: rgba(224, 242, 254, 0.56);
  cursor: move;
  user-select: none;
  overflow: hidden;
}
.cover-designer-field.selected {
  border-style: solid;
  box-shadow: 0 0 0 2px rgba(29, 111, 143, 0.18);
}
.cover-designer-field-label {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cover-designer-field i {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 12px;
  height: 12px;
  border-left: 2px solid #1d6f8f;
  border-top: 2px solid #1d6f8f;
  background: #fff;
  cursor: nwse-resize;
}
.cover-designer-panel.is-empty label,
.cover-designer-panel.is-empty .toolbar,
.cover-designer-panel.is-empty button[data-cover-field-delete] {
  opacity: 0.45;
}
.document-cover-page-visual {
  position: relative;
  min-height: 0;
  height: 1122px;
  padding: 0;
  overflow: hidden;
}
.document-cover-field {
  position: absolute;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  padding: 4px 6px;
  line-height: 1.15;
  overflow: hidden;
  white-space: normal;
  word-break: break-word;
}
@media (max-width: 1100px) {
  .cover-designer-shell {
    grid-template-columns: 1fr;
  }
  .cover-designer-panel {
    position: static;
  }
}
@media print {
  .document-cover-page-visual {
    height: calc(297mm - 1px);
    page-break-after: always;
  }
}
.complete-document-toolbar {
  max-width: 980px;
  margin: 0 auto 10px;
}
.document-print-toolbar {
  position: sticky;
  top: 74px;
  z-index: 20;
  width: min(100%, 980px);
  margin: 0 auto 10px;
  padding: 8px 0;
  background: rgba(246, 249, 252, 0.92);
  backdrop-filter: blur(8px);
}
.document-reader-panel {
  padding: 0;
  overflow: hidden;
  min-height: calc(100vh - 230px);
}
.document-pdf-reader {
  display: block;
  width: 100%;
  height: calc(100vh - 230px);
  min-height: 760px;
  border: 0;
  background: #1f2933;
}
.complete-project-cover-head {
  min-height: 210px;
}
.complete-project-summary .invoice-logo {
  width: 240px;
  max-height: 90px;
  margin-bottom: 18px;
}
.complete-project-title {
  margin-top: 28px;
}
.complete-project-title h1 {
  font-size: 26px;
}
.complete-project-title h2 {
  font-size: 20px;
}
.complete-project-section-title {
  margin: 26px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--document-accent, #111827);
  font-size: 16px;
  font-weight: 900;
}
.complete-project-info th,
.complete-project-list th {
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.complete-project-info td,
.complete-project-info th,
.complete-project-list td,
.complete-project-list th {
  padding: 8px 6px;
}
.complete-summary-table,
.complete-project-total-table {
  width: 100%;
  font-size: 12px;
}
.complete-summary-table th,
.complete-summary-table td,
.complete-project-total-table td {
  text-align: right;
}
.complete-summary-table th:first-child,
.complete-summary-table td:first-child,
.complete-project-total-table td:first-child {
  text-align: left;
}
.complete-project-total-table {
  margin: 0;
}
.complete-project-total-table td:last-child {
  font-weight: 800;
  text-align: right;
}
.complete-document-action label {
  min-width: 210px;
}
.complete-document-card {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 120px);
  overflow: hidden;
}
.complete-document-card .modal-head {
  flex: 0 0 auto;
}
.complete-document-form {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}
.complete-document-projects {
  display: grid;
  gap: 6px;
  margin: 12px 0;
  min-height: 0;
  max-height: min(52vh, 520px);
  overflow-y: auto;
  padding: 10px;
  border: 1px solid #d8e2ec;
  border-radius: 8px;
}
.complete-document-projects legend {
  padding: 0 6px;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}
.complete-document-project-choice {
  align-items: flex-start;
  min-width: 0;
  margin: 0;
  padding: 6px 8px;
  border-radius: 7px;
}
.complete-document-project-choice.child-choice {
  margin-left: 18px;
}
.complete-document-footer {
  position: sticky;
  bottom: 0;
  flex: 0 0 auto;
  margin-top: 8px;
  padding-top: 10px;
  background: #fff;
  border-top: 1px solid var(--line);
}
.complete-document-footer button {
  width: 100%;
}
.complete-document-project-choice span {
  display: grid;
  gap: 2px;
}
.complete-document-project-choice small {
  color: #64748b;
  font-size: 11px;
}
.complete-project-costs {
  break-before: page;
  page-break-before: always;
}
.complete-project-costs h1,
.complete-project-schedule h1,
.complete-project-final h1 {
  margin: 0 0 24px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--document-accent, #111827);
  font-size: 25px;
  font-weight: 900;
}
.complete-project-schedule,
.complete-project-final {
  break-before: page;
  page-break-before: always;
}
.complete-project-schedule-table {
  font-size: 11px;
}
.complete-project-schedule-table th,
.complete-project-schedule-table td {
  padding: 5px 6px;
}
.complete-project-table-section td {
  padding-top: 12px;
  border-top: 2px solid var(--document-accent, #111827);
  background: #fff;
  font-weight: 900;
}
.complete-project-cost-grid {
  display: block;
}
.complete-project-cost-block {
  break-inside: avoid;
  page-break-inside: avoid;
  width: 100%;
  margin: 0 0 18px;
  padding-bottom: 8px;
  border-bottom: 1px solid #d8dee7;
}
.complete-project-cost-block h2 {
  display: flex;
  justify-content: flex-start;
  gap: 12px;
  align-items: baseline;
  text-align: left;
  margin: 0;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--document-accent, #111827);
  font-size: 14px;
  font-weight: 900;
}
.complete-project-cost-block h2 span {
  flex: 0 0 auto;
  margin-left: auto;
  color: #64748b;
  font-size: 10px;
  text-transform: uppercase;
}
.complete-project-cost-block p {
  margin: 7px 0 8px;
  color: #64748b;
  font-size: 11px;
  line-height: 1.25;
}
.complete-project-cost-block .document-table td {
  padding: 5px 4px;
}
.complete-project-cost-block .amount-line td {
  border-top: 1px solid #aeb8c5;
  font-weight: 800;
}
.complete-project-cost-block .grand-total td {
  border-top: 2px solid var(--document-accent, #111827);
  background: #f4f8fa;
  font-weight: 900;
}
.complete-project-grand-total {
  max-width: 520px;
  margin: 24px 0 0 auto;
}
.complete-project-details {
  break-before: page;
  page-break-before: always;
}
.complete-project-details h1 {
  margin: 0 0 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--document-accent, #111827);
  font-size: 24px;
  font-weight: 900;
}
.complete-project-detail-block {
  break-inside: avoid;
  page-break-inside: avoid;
  margin: 0 0 24px;
}
.complete-project-detail-block h2 {
  margin: 0 0 4px;
  text-align: left;
  font-size: 15px;
  font-weight: 900;
}
.complete-project-detail-block p {
  margin: 0 0 8px;
  color: #64748b;
  font-size: 11px;
}
.complete-project-detail-table {
  font-size: 10px;
}
.complete-project-detail-table th,
.complete-project-detail-table td {
  padding: 5px 6px;
}
.document-print-frame {
  display: block;
  width: min(980px, 100%);
  margin: 0 auto;
  border: 0;
  border-collapse: collapse;
  border-spacing: 0;
  background: #fff;
  font-family: var(--document-font, "Inter", "Segoe UI", Arial, Helvetica, sans-serif);
}
.document-print-frame > tbody,
.document-print-frame > tbody > tr,
.document-print-frame > tbody > tr > td,
.document-print-frame > tfoot,
.document-print-frame > tfoot > tr,
.document-print-frame > tfoot > tr > td {
  display: block;
}
.document-print-frame > tbody > tr > td,
.document-print-frame > tfoot > tr > td {
  padding: 0 !important;
  border: 0 !important;
  text-align: left !important;
  vertical-align: top;
  background: transparent !important;
}
.document-print-frame tbody tr:hover > td {
  background: transparent !important;
}
.document-print-body,
.print-sheet.invoice-document {
  text-align: left;
}
.print-sheet.invoice-document {
  box-sizing: border-box;
  width: 100%;
}
.invoice-company,
.invoice-client,
.invoice-title-block,
.invoice-title-block h1,
.invoice-title-block h2,
.invoice-meta-grid {
  text-align: left;
}
.document-footer {
  width: 100%;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--document-accent, #111827);
  color: #334155;
  font-size: 9px;
  line-height: 1.22;
}
.document-footer p,
.document-footer div {
  margin: 0 0 2px;
}
.qr-bill-page {
  position: relative;
  z-index: 1000;
  min-height: 297mm;
  max-width: 980px;
  margin: 0 auto;
  background: #fff;
  break-before: page;
  page-break-before: always;
  color: #111827;
  font-family: var(--document-font, "Inter", "Segoe UI", Arial, Helvetica, sans-serif);
}
.qr-bill-warning {
  padding: 18px;
  border: 1px solid #efb5a8;
  background: #fff1ee;
  color: #8f2f22;
  font-weight: 800;
}
.qr-bill-slip {
  position: absolute;
  z-index: 1200;
  left: 0;
  right: 0;
  bottom: 0;
  height: 105mm;
  display: grid;
  grid-template-columns: 62mm minmax(0, 1fr);
  border-top: 1px solid #111827;
  background: #fff;
}
.qr-receipt,
.qr-payment {
  padding: 6mm;
  font-size: 10px;
  line-height: 1.25;
}
.qr-receipt {
  border-right: 1px dashed #111827;
  padding-left: 1mm;
}
.qr-bill-slip h2 {
  margin: 0 0 6mm;
  font-size: 16px;
  font-weight: 900;
}
.qr-bill-slip h3 {
  margin: 3mm 0 1mm;
  font-size: 10px;
  font-weight: 900;
}
.qr-bill-slip p {
  margin: 0 0 2mm;
}
.qr-payment-main {
  display: grid;
  grid-template-columns: 52mm minmax(0, 1fr);
  gap: 10mm;
  align-items: start;
}
.qr-code-box {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 4mm;
}
.qr-payment-info {
  font-size: 14px;
  line-height: 1.18;
  margin-top: -27px;
}
.qr-payment-info h3 {
  font-size: 11px;
}
.swiss-qr-svg {
  width: 46mm;
  height: 46mm;
}
.qr-amount-row {
  display: flex;
  gap: 12mm;
  margin-top: 4mm;
  font-size: 10px;
}
.qr-amount-row strong {
  font-size: 12px;
}
.qr-acceptance {
  position: absolute;
  left: 6mm;
  bottom: 6mm;
}
.compact-print {
  font-size: 12px;
  line-height: 1.35;
}
.compact-print h1 { font-size: 21px; margin-bottom: 8px; }
.compact-print h2 { font-size: 14px; margin: 0; }
.compact-print h3 {
  font-size: 12px;
  margin: 10px 0 4px;
  color: var(--brand);
}
.compact-print p { margin: 5px 0; }
.compact-print table {
  table-layout: fixed;
  border: 1px solid var(--line-strong);
  margin: 0 0 8px;
}
.compact-print th,
.compact-print td {
  border-right: 1px solid var(--line);
  font-size: 11px;
  padding: 4px 6px;
  overflow-wrap: anywhere;
}
.compact-print th:last-child,
.compact-print td:last-child {
  border-right: 0;
}
.route-summary {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding: 8px 0 12px;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 12px;
}
.route-phase {
  border: 2px solid var(--line-strong);
  border-radius: 6px;
  margin: 0 0 12px;
  padding: 8px;
  break-inside: avoid;
  page-break-inside: avoid;
}
.route-phase-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  padding: 0 0 6px;
  margin-bottom: 8px;
  border-bottom: 2px solid var(--brand);
}
.route-phase-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.route-table thead th {
  background: #eef4f7;
  color: var(--ink);
}
.route-schedule {
  background: #fbfdfe;
}
.route-col-date { width: 18%; }
.route-col-time { width: 14%; }
.route-col-name { width: 24%; }
.route-col-role { width: 28%; }
.route-col-hours { width: 32%; }
.route-col-phone { width: 16%; }
.route-notes {
  border-top: 2px solid var(--ink);
  padding-top: 8px;
  margin-top: 6px;
}
.planner-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(150px, 1fr));
  gap: 8px;
  align-items: start;
}
.calendar-month-grid {
  display: grid;
  gap: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.calendar-weekday-row,
.calendar-week-cells,
.calendar-week-ranges {
  display: grid;
  grid-template-columns: repeat(7, minmax(150px, 1fr));
}
.calendar-weekday-row {
  background: #f7fafc;
  border-bottom: 1px solid var(--line-strong);
}
.calendar-weekday-row span {
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-weight: 900;
}
.calendar-week {
  position: relative;
  border-bottom: 1px solid var(--line-strong);
  --range-space: calc((var(--range-lanes) * 28px) + 16px);
}
.calendar-week:last-child {
  border-bottom: 0;
}
.calendar-week-cells {
  min-height: calc(92px + var(--range-space));
}
.calendar-week-ranges {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  top: 38px;
  grid-auto-rows: 26px;
  gap: 2px 0;
  pointer-events: none;
  padding: 0 6px;
}
.calendar-range-item {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  margin: 0 1px;
  padding: 0 8px;
  border: 0;
  border-left: 4px solid var(--project-color, var(--brand));
  border-radius: 4px;
  background: color-mix(in srgb, var(--project-color, var(--brand)) 18%, #fff);
  color: color-mix(in srgb, var(--project-color, var(--brand)) 55%, #111827);
  box-shadow: inset 0 0 0 1px rgba(17, 24, 39, .04);
  cursor: pointer;
  pointer-events: auto;
}
.calendar-range-item:hover {
  filter: brightness(.98);
}
.calendar-range-item strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.calendar-range-icon {
  flex: 0 0 auto;
  font-size: 13px;
}
.calendar-controls {
  margin-bottom: 10px;
}
.calendar-controls form {
  align-items: end;
}
.calendar-cell {
  min-height: calc(92px + var(--range-space));
  border-right: 1px solid var(--line);
  background: #fff;
  overflow: visible;
}
.calendar-cell.empty {
  background: #f9fbfd;
}
.calendar-date {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  background: #f2f7fa;
  border-radius: 0;
}
.calendar-date strong {
  font-size: 13px;
}
.calendar-date span,
.calendar-empty {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.calendar-empty {
  padding: 8px;
}
.calendar-item {
  margin: 7px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--project-color, var(--brand));
  border-radius: 6px;
  background: #fff;
  cursor: grab;
  user-select: none;
}
.calendar-phase-item {
  background: #fff;
}
.calendar-item:hover {
  background: #f7fbfd;
}
.calendar-range-item.calendar-item {
  margin: 0 1px;
  padding: 0 8px;
  border: 0;
  border-left: 4px solid var(--project-color, var(--brand));
  border-radius: 4px;
  background: color-mix(in srgb, var(--project-color, var(--brand)) 18%, #fff);
  cursor: pointer;
}
.calendar-range-item.calendar-item:hover {
  background: color-mix(in srgb, var(--project-color, var(--brand)) 24%, #fff);
}
.calendar-item.dragging {
  opacity: .45;
}
.calendar-item.saving {
  opacity: .55;
  pointer-events: none;
}
.calendar-cell.drop-target {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
  background: #eef8fb;
}
.calendar-source {
  display: block;
  margin-bottom: 3px;
  color: var(--project-color, var(--brand));
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.calendar-phase-name {
  display: block;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.calendar-detail {
  display: none;
}
.calendar-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 10px;
}
.calendar-detail-head span {
  display: block;
  color: var(--brand);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.calendar-detail-head h2 {
  margin-bottom: 4px;
}
.calendar-detail-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.calendar-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(17, 28, 40, .38);
}
.calendar-modal.open {
  display: grid;
}
.calendar-modal-panel {
  position: relative;
  width: min(980px, calc(100vw - 40px));
  max-height: calc(100vh - 72px);
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(20, 34, 50, .22);
}
.calendar-modal-close {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}
.calendar-modal-body {
  padding-right: 26px;
}
.calendar-modal .calendar-detail {
  display: block;
}
.calendar-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.calendar-detail-grid section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfe;
  padding: 10px;
}
.calendar-detail-grid h3 {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 12px;
  text-transform: uppercase;
}
.calendar-detail-grid ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.calendar-detail-grid li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 8px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
}
.calendar-detail-grid li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}
.calendar-detail-grid li small {
  grid-column: 1 / -1;
  color: var(--muted);
}
.calendar-detail-grid li span {
  color: var(--brand);
  font-weight: 900;
}
.calendar-item-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 6px;
}
.calendar-item-head strong,
.calendar-position strong,
.calendar-position small {
  display: block;
}
.calendar-item-head small,
.calendar-position small {
  color: var(--muted);
  font-size: 11px;
}
.calendar-position {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
  font-size: 12px;
}
.calendar-position > span {
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}
.calendar-people {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.calendar-person {
  display: inline-flex;
  border-radius: 999px;
  padding: 2px 6px;
  background: #edf8f0;
  color: var(--ok);
  font-size: 11px;
  font-weight: 800;
}
.calendar-person.pending {
  background: #fff5df;
  color: var(--warn);
}
.phase-sidebar {
  position: sticky;
  top: 58px;
  z-index: 30;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: visible;
}
.phase-sidebar-head {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}
.phase-sidebar-head h2 {
  margin: 4px 0 0;
}
.phase-list {
  display: grid;
}
.phase-row-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.phase-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  color: var(--ink);
  text-decoration: none;
  background: #fff;
}
.phase-row:hover {
  background: #f2f7fa;
}
.phase-row-wrap:has(.phase-row.active) {
  background: #e9f5f8;
}
.phase-row.active {
  background: #e9f5f8;
  box-shadow: inset 3px 0 0 var(--brand);
}
.phase-row strong,
.phase-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.phase-row strong {
  font-size: 13px;
}
.phase-row small,
.phase-row em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}
.phase-row em {
  white-space: nowrap;
  font-weight: 800;
}
.empty-row {
  pointer-events: none;
}
.phase-delete {
  display: grid;
  place-items: center;
  margin: 0;
  border-left: 1px solid var(--line);
}
.phase-delete button {
  width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  border-color: #e5c7c1;
  background: #fff;
  color: var(--brand-2);
  font-size: 16px;
  line-height: 1;
}
.phase-delete button:hover {
  background: #fff2ef;
}
.planner-main {
  min-width: 0;
}
.phase-empty {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}
.phase-block {
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: visible;
}
.phase-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 12px;
  margin-bottom: 0;
  background: #fff;
}
.phase-title h2 {
  margin-bottom: 3px;
}
.phase-title p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.phase-actions {
  margin-bottom: 0;
}
.phase-actions button {
  min-width: 36px;
}
.day-list {
  display: grid;
  gap: 0;
}
.phase-day {
  border-top: 1px solid var(--line);
  padding: 0;
  margin-top: 0;
  background: var(--soft);
}
.day-head {
  display: grid;
  grid-template-columns: 330px 1fr;
  align-items: start;
  gap: 10px;
  padding: 8px 12px 0;
}
.day-head strong {
  display: block;
  font-size: 14px;
}
.day-head span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
.compact-table {
  margin: 6px 0 0;
  background: #fff;
}
.compact-table th,
.compact-table td {
  font-size: 13px;
  padding: 6px 12px;
}
details.drawer {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
details.drawer > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  padding: 7px 10px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
}
details.drawer > summary::-webkit-details-marker {
  display: none;
}
details.drawer[open] {
  padding-bottom: 10px;
}
details.drawer[open] > summary {
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}
details.drawer form {
  padding: 0 10px;
}
.billing-coefficient-drawer {
  margin-bottom: 12px;
}
.billing-coefficient-drawer > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.billing-coefficient-drawer > summary small {
  color: var(--muted);
  font-weight: 700;
}
.billing-coefficient-drawer > .grid {
  padding: 0 10px;
}

.document-layout-preview {
  position: relative;
  width: min(100%, 420px);
  aspect-ratio: 210 / 297;
  margin: 12px 0 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: inset 0 0 0 8px #f8fafc;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.document-layout-preview > div {
  position: absolute;
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.08);
  padding: 6px;
}

.document-layout-preview .layout-logo {
  left: 8%;
  top: 7%;
  width: 38%;
  height: 17%;
}

.document-layout-preview .layout-client {
  right: 8%;
  top: 22%;
  width: 38%;
  height: 18%;
}

.document-layout-preview .layout-title {
  left: 8%;
  right: 8%;
  top: 46%;
  height: 9%;
}

.document-layout-preview .layout-meta {
  left: 8%;
  right: 8%;
  top: 58%;
  height: 9%;
}

.document-layout-preview .layout-table {
  left: 8%;
  right: 8%;
  top: 70%;
  bottom: 8%;
}

.icon-drawer {
  display: inline-grid;
  margin: 0;
  border: 0 !important;
  background: transparent !important;
}
.icon-drawer > summary {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0 !important;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--brand);
  font-size: 16px !important;
  line-height: 1;
}
.icon-drawer > summary:hover {
  background: #eef8fb;
}
.phase-edit-drawer[open],
.position-edit-drawer[open],
.manual-assignment-drawer[open],
.staff-allocation-drawer[open],
.row-drawer[open] {
  position: fixed;
  right: 24px;
  top: 84px;
  z-index: 1000;
  width: min(760px, calc(100vw - 48px));
  max-height: calc(100vh - 110px);
  overflow: auto;
  padding: 0 0 10px;
  border: 1px solid var(--line-strong) !important;
  border-radius: 8px;
  background: #fff !important;
  box-shadow: 0 18px 54px rgba(20, 34, 50, .18);
  text-align: left;
}
.phase-edit-drawer[open] > summary,
.position-edit-drawer[open] > summary,
.manual-assignment-drawer[open] > summary,
.staff-allocation-drawer[open] > summary,
.row-drawer[open] > summary {
  width: auto;
  height: auto;
  justify-content: start;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  padding: 9px 10px !important;
}
.phase-edit-drawer[open] > summary::after { content: " Modifier la phase"; }
.position-edit-drawer[open] > summary::after { content: " Modifier le poste"; }
.manual-assignment-drawer[open] > summary::after { content: " Allouer un technicien"; }
.staff-allocation-drawer[open] > summary::after { content: ""; }
.row-drawer[open] > summary::after { content: ""; }
.phase-edit-drawer[open] form,
.position-edit-drawer[open] form,
.manual-assignment-drawer[open] form,
.staff-allocation-drawer[open] form,
.row-drawer[open] form {
  padding: 10px;
}
.position-title-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.compact-button {
  min-height: 26px;
  padding: 4px 8px;
  font-size: 12px;
}
.staff-allocation-drawer {
  display: inline-block;
  margin: 0;
}
.staff-allocation-drawer h3 {
  margin: 10px 0 6px;
  font-size: 13px;
}
.staff-date-list {
  display: grid;
  gap: 6px;
  max-height: 280px;
  overflow: auto;
  padding: 2px;
}
.staff-date-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfe;
}
.staff-date-choice:hover {
  border-color: var(--brand);
  background: #eef8fb;
}
.position-time-card {
  display: grid;
  gap: 8px;
  margin: 10px 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
}
.position-date-row,
.position-slot-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  gap: 8px;
  align-items: end;
}
.position-slot-list {
  display: grid;
  gap: 6px;
}
.position-slot-row {
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 1fr) 32px 32px;
}
.position-slot-row button {
  min-width: 32px;
  height: 32px;
  padding: 0;
}
.position-slot-row:only-child [data-position-slot-remove] {
  visibility: hidden;
  pointer-events: none;
}
@media (max-width: 720px) {
  .position-date-row,
  .position-slot-row {
    grid-template-columns: 1fr 1fr;
  }
  .position-slot-row button {
    width: 100%;
  }
}
.staff-date-choice input {
  width: auto;
}
.staff-date-choice span {
  display: grid;
  gap: 2px;
}
.staff-date-choice small {
  color: var(--muted);
}
.small-drawer {
  margin: 8px 12px 10px;
}
.row-drawer {
  background: #fff;
}
.day-inline-edit {
  display: block;
  margin: 0;
}
.day-read {
  display: block;
  width: 100%;
  min-height: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  padding: 5px 6px;
}
.day-read:hover {
  background: #e9f5f8;
}
.day-native-edit {
  display: none !important;
  grid-template-columns: 132px 82px 82px;
  gap: 6px;
  align-items: center;
  width: 308px;
}
.day-inline-edit:not(.editing) .day-native-edit {
  display: none !important;
}
.day-native-edit input {
  min-width: 0;
  padding: 5px 6px;
  font-weight: 800;
  color: var(--ink);
}
.day-inline-edit.editing .day-read {
  display: none;
}
.day-inline-edit.editing .day-native-edit {
  display: grid !important;
}
.day-inline-edit.saving {
  opacity: .6;
  pointer-events: none;
}
.day-tools {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.day-delete {
  display: grid;
  place-items: center;
  margin: 0;
}
.day-delete button {
  width: 26px;
  min-height: 30px;
  padding: 0;
  border-color: #e5c7c1;
  background: #fff;
  color: var(--brand-2);
  font-size: 16px;
}
.day-delete button:hover {
  background: #fff2ef;
}
.row-action {
  width: 108px;
  position: relative;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 4px;
  text-align: right;
}
.planning-drawers {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}
.vertical-drawer {
  padding: 0;
}
.vertical-drawer > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
}
.vertical-drawer > summary::-webkit-details-marker {
  display: none;
}
.vertical-drawer > summary h2 {
  margin: 0;
}
.vertical-drawer > summary span {
  min-width: 28px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #eef6f8;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}
.vertical-drawer[open] > summary {
  border-bottom: 1px solid var(--line);
}
.vertical-drawer table {
  margin: 0;
}
.position-delete {
  display: inline-grid;
  margin: 0;
}
.position-delete button {
  width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  border-color: #e5c7c1;
  background: #fff;
  color: var(--brand-2);
  font-size: 16px;
  line-height: 1;
}
.position-delete button:hover {
  background: #fff2ef;
}
.plus-drawer {
  min-width: 34px;
}
.plus-drawer > summary {
  width: 34px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0 !important;
  font-size: 20px !important;
  line-height: 1;
}
.plus-drawer[open] {
  position: absolute;
  left: 10px;
  right: auto;
  top: 48px;
  z-index: 1400;
  width: min(360px, calc(100vw - 40px));
  max-height: calc(100vh - 140px);
  overflow: auto;
  box-shadow: var(--shadow);
}
.public-apply {
  max-width: 980px;
}
.public-apply-form {
  gap: 12px;
}
.position-choice-list {
  display: grid;
  gap: 8px;
}
.position-choice {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}
.position-choice input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}
.position-choice strong,
.position-choice small,
.position-choice em {
  display: block;
}
.position-choice small {
  color: var(--muted);
  margin-top: 2px;
}
.position-choice em {
  margin-top: 5px;
  color: var(--muted);
  font-style: normal;
  font-weight: 500;
}
.bundle-builder {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfe;
}
.bundle-builder h3 {
  margin: 0 0 8px;
  font-size: 14px;
}
.bundle-summary {
  display: grid;
  gap: 3px;
  color: var(--ink);
}
.bundle-summary small {
  color: var(--muted);
  max-width: 520px;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  line-height: 1.35;
}
.kit-component-list {
  display: inline-block;
  line-height: 1.35;
  white-space: normal;
}
.bundle-modal-card {
  width: min(1040px, 100%);
}
.bundle-modal-grid {
  display: grid;
  grid-template-columns: minmax(280px, .9fr) minmax(360px, 1.1fr);
  gap: 14px;
  align-items: start;
}
.bundle-modal-grid h3 {
  margin: 0 0 8px;
  font-size: 15px;
}
.bundle-search {
  margin-bottom: 8px;
}
.bundle-dropzone {
  min-height: 340px;
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 8px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: #fff;
}
.bundle-dropzone.drop-target {
  border-color: var(--brand);
  background: #eef8fb;
}
.bundle-component-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px 28px;
  gap: 6px;
  align-items: center;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7fafc;
}
.bundle-component-row strong,
.bundle-component-row small {
  display: block;
}
.bundle-component-row small {
  color: var(--muted);
  font-size: 11px;
}
.bundle-component-row input {
  min-width: 0;
  padding: 6px;
}
.bundle-source-list {
  display: grid;
  gap: 6px;
  max-height: 420px;
  overflow: auto;
}
.bundle-source-item {
  display: block;
  width: 100%;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: grab;
}
.bundle-source-item:hover,
.bundle-source-item.dragging {
  border-color: var(--brand);
  background: #eef8fb;
}
.bundle-source-item strong,
.bundle-source-item small {
  display: block;
}
.bundle-source-item small {
  color: var(--muted);
  font-size: 11px;
}

.sending-center-shell {
  display: grid;
  gap: 14px;
}
.sending-center-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 18px;
  align-items: start;
}
.sending-center-head h2 {
  margin-bottom: 6px;
}
.mail-center-note,
.mail-center-controls {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
  padding: 12px;
}
.mail-center-controls label {
  margin: 0;
}
.mail-center-note p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.35;
}
.mail-tag-palette {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .05);
}
.mail-tag-palette strong {
  display: inline-flex;
  align-items: center;
  margin-right: 4px;
}
.mail-tag {
  min-height: 30px;
  padding: 5px 9px;
  border-color: #c9dceb;
  background: #eef7fb;
  color: var(--brand);
  font-size: 12px;
}
.mail-tag:hover {
  border-color: var(--brand);
  background: #dff1f8;
}
.mail-template-document {
  margin-top: 10px;
}
.mail-server-config {
  margin-top: 12px;
}
.mail-server-config summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.mail-server-config summary small {
  color: var(--muted);
}
.mail-server-layout {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}
.mail-server-layout section {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.mail-server-layout h3 {
  margin: 0;
  font-size: 16px;
}
.mail-server-layout p {
  margin: 0;
}
.mail-template-document summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.mail-template-document summary small {
  color: var(--muted);
}
.mail-template-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-top: 12px;
  min-width: 0;
}
.mail-template-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  min-width: 0;
  overflow: hidden;
}
.mail-template-card[hidden] {
  display: none !important;
}
.mail-template-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}
.mail-template-card h3 {
  margin: 2px 0 0;
  font-size: 16px;
}
.mail-template-card textarea {
  min-height: 170px;
  font-family: inherit;
  line-height: 1.45;
}
.mail-body-editor .rich-toolbar {
  padding: 8px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: #f8fbfd;
  overflow: visible;
}
.mail-body-editor .rich-surface {
  min-height: 260px;
  border-radius: 0 0 8px 8px;
  overflow-wrap: anywhere;
}
.mail-preview-dialog {
  max-width: 720px;
}
.mail-preview-dialog h2 {
  margin-top: 6px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 21px;
}
.mail-preview-body {
  white-space: pre-wrap;
  min-height: 180px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
  color: var(--ink);
  line-height: 1.5;
}

@media (max-width: 1080px) {
  .signup-hero {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .stagedock-signup .signup-hero {
    grid-template-columns: 1fr;
  }
  .stagedock-signup .signup-logo-panel {
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, .14);
  }
  .signup-logo-panel {
    justify-self: stretch;
  }
  .signup-form {
    grid-template-columns: 1fr;
  }
  .signup-account-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  header, .event-head { display: grid; }
  header { grid-template-columns: 1fr; }
  .header-right { justify-items: stretch; }
  nav { justify-content: flex-start; }
  .project-tab-shell { width: 100%; min-width: 0; }
  .planner-shell { grid-template-columns: 1fr; }
  .material-workbench { grid-template-columns: 1fr; }
  .project-general-grid { grid-template-columns: 1fr; }
  .subproject-bar { grid-template-columns: 24px minmax(0, 1fr) 24px; }
  .subproject-bar > strong { grid-column: 1 / -1; }
  .calendar-grid { grid-template-columns: 1fr; }
  .phase-sidebar, .material-sidebar, .material-base { position: static; max-height: none; }
  .grid.two, .grid.three, .grid.four, .grid.five { grid-template-columns: 1fr; }
  .signup-page { padding: 18px 0 36px; }
  .signup-hero {
    padding: 18px;
  }
  .stagedock-signup {
    padding: 14px 12px 34px;
  }
  .stagedock-signup .signup-topbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .stagedock-signup .signup-hero {
    padding: 0;
    border-radius: 14px;
  }
  .stagedock-signup .signup-hero-copy {
    padding: 28px 22px;
  }
  .stagedock-signup .signup-hero-copy h1 {
    font-size: 40px;
  }
  .stagedock-signup .signup-hero-copy p {
    font-size: 15px;
  }
  .signup-logo-panel {
    padding: 16px;
  }
  .stagedock-signup .signup-logo-panel {
    padding: 0;
  }
  .signup-logo {
    width: min(100%, 280px);
  }
  .stagedock-signup .signup-logo {
    width: 100%;
    min-height: 0;
    aspect-ratio: 16 / 5.2;
  }
  .signup-logo-note {
    font-size: 10px;
    letter-spacing: .05em;
  }
  .signup-hero-copy h1 { font-size: 30px; }
  .signup-plan-grid { grid-template-columns: 1fr; }
  .signup-plan-main li { grid-template-columns: 1fr; gap: 2px; }
  .signup-hero-points span,
  .signup-plan-modules span { font-size: 11px; }
  .address-grid { grid-template-columns: 1fr 90px; }
  .address-grid label:nth-child(1),
  .address-grid label:nth-child(4) { grid-column: 1 / -1; }
  .field-with-action { grid-template-columns: 1fr; }
  .span-two { grid-column: auto; }
  .phase-title { display: grid; }
  .day-head { grid-template-columns: 1fr; }
  .bundle-builder { align-items: stretch; flex-direction: column; }
  .bundle-modal-grid { grid-template-columns: 1fr; }
  .sending-center-head,
  .mail-template-grid { grid-template-columns: 1fr; }
  .metrics { flex-wrap: wrap; }
  .dashboard-hero,
  .dashboard-card-head,
  .dashboard-list-row { display: grid; }
  .dashboard-kpi-grid,
  .dashboard-grid,
  .dashboard-donut-wrap { grid-template-columns: 1fr; }
  .billing-document-toolbar { display: grid; }
  .billing-document-search { min-width: 0; }
  .billing-document-totals { grid-template-columns: 1fr; }
  .dashboard-bars {
    overflow-x: auto;
    grid-template-columns: repeat(12, 52px);
  }
  main { width: min(100% - 20px, 1280px); }
  table { font-size: 14px; }
}

.prep-return-board {
  display: grid;
  gap: 18px;
}

.prep-day {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.prep-day > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
  padding-bottom: 10px;
}

.prep-day > header > div:first-child {
  min-width: 0;
}

.prep-day h2,
.prep-column h3,
.prep-card h3 {
  margin: 0;
}

.prep-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.prep-column {
  display: grid;
  align-content: start;
  gap: 10px;
}

.prep-column > h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 18px;
}

.prep-column > h3 span {
  background: #eaf6fb;
  color: var(--accent);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 13px;
}

.prep-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 6px solid #2f7f9d;
  border-radius: 8px;
  padding: 14px;
  background: #f8fbfd;
}

.prep-card-return {
  border-left-color: #be6a34;
}

.prep-card p,
.prep-card small {
  margin: 4px 0 0;
  color: var(--muted);
}

.prep-metrics {
  display: grid;
  gap: 6px;
  min-width: 118px;
  text-align: right;
}

.prep-metrics strong {
  font-size: 20px;
}

.prep-card .toolbar {
  grid-column: 1 / -1;
  justify-content: flex-end;
}

.prep-card a {
  color: inherit;
  text-decoration: none;
}

.prep-date-form {
  align-items: end;
}

.prep-schedule-form {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(260px, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.prep-work-panel {
  overflow-x: auto;
}

.prep-work-table {
  min-width: 980px;
}

.prep-work-table td {
  vertical-align: middle;
}

.prep-work-table input[type="number"] {
  width: 110px;
}

.prep-work-table input[name^="notes"] {
  min-width: 220px;
}

.prep-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
}

.prep-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 800;
}

.prep-status-complete {
  background: #e8f6e8;
  color: #2d7d32;
}

.prep-status-partial {
  background: #fff4db;
  color: #9a5d00;
}

.prep-status-missing,
.prep-status-pending {
  background: #fdecea;
  color: #b33a2f;
}

.prep-work-missing-row {
  background: #fff8f6;
}

.prep-work-metrics span:first-child {
  border-color: #2f7f9d;
  color: #1f6178;
}

.printable-material-list table {
  font-size: 14px;
}

.prep-daily-list {
  overflow-x: auto;
}

.prep-daily-list table {
  min-width: 1180px;
}

.upcoming-returns-panel {
  margin-top: 18px;
  overflow-x: auto;
}

.upcoming-returns-panel header {
  margin-bottom: 12px;
}

.upcoming-returns-panel table {
  min-width: 820px;
}

.project-prep-lists {
  display: grid;
  gap: 18px;
}

.prep-project-actions {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.prep-kind-switch {
  display: inline-flex;
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
}

.prep-kind-switch .button {
  min-height: 32px;
  padding: 7px 12px;
}

.prep-kind-switch .button.active {
  background: #2f7f9d;
  border-color: #2f7f9d;
  color: #fff;
}

.prep-planning-notice {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  border-left: 4px solid #2f7f9d;
}

.prep-planning-notice h2,
.prep-planning-notice p {
  margin: 0;
}

.prep-planning-notice p {
  color: var(--muted);
  margin-top: 5px;
}

.prep-planning-notice.warning {
  border-left-color: #d99222;
  background: #fffaf1;
}

.prep-planning-notice.ok {
  border-left-color: #2d7d32;
  background: #f3fbf3;
}

.project-prep-panel {
  overflow-x: auto;
}

.project-prep-list-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 14px;
}

.project-prep-list-head h2,
.project-prep-list-head p {
  margin: 0;
}

.project-prep-list-head p {
  color: var(--muted);
  margin-top: 4px;
}

.project-prep-list-head .project-prep-audit {
  color: #1f6178;
  font-weight: 800;
}

.project-prep-schedule {
  min-width: min(100%, 640px);
  margin-bottom: 0;
}

.project-prep-table {
  min-width: 1120px;
}

.project-prep-missing {
  color: #b33a2f;
  font-weight: 900;
}

.project-prep-ok {
  color: #2d7d32;
  font-weight: 900;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin: 12px 0;
}

.permission-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f8fbfd;
}

.permission-group legend {
  padding: 0 6px;
  font-weight: 800;
  color: var(--accent);
}

@media print {
  @page {
    size: A4 portrait;
    margin: 9mm 11mm 9mm;
  }
  header, .print-hide { display: none !important; }
  html, body { margin: 0; padding: 0; background: #fff; }
  main { width: 100%; margin: 0; padding: 0; }
  .prep-work-panel { border: 0; box-shadow: none; padding: 0; overflow: visible; }
  .prep-work-table { min-width: 0; width: 100%; font-size: 11px; }
  .prep-work-table input { border: 0; padding: 0; background: transparent; }
  .prep-status { border: 1px solid #999; background: transparent !important; color: #111 !important; }
  .print-sheet { border: 0; padding: 0; }
  .print-sheet.invoice-document {
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0 0 0 18px;
  }
  .document-print-frame {
    display: table;
    width: 100%;
    max-width: none;
    margin: 0;
    table-layout: fixed;
    border-collapse: collapse;
  }
  .document-print-frame > tbody {
    display: table-row-group;
  }
  .document-print-frame > tfoot {
    display: table-footer-group;
  }
  .document-print-frame > tbody > tr,
  .document-print-frame > tfoot > tr {
    display: table-row;
    page-break-inside: auto;
    break-inside: auto;
  }
  .document-print-frame > tbody > tr > td,
  .document-print-frame > tfoot > tr > td {
    display: table-cell;
    padding: 0 !important;
    border: 0 !important;
    text-align: left !important;
    background: transparent !important;
  }
  .qr-bill-page {
    width: auto;
    max-width: none;
    height: calc(297mm - 18mm);
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    break-after: avoid;
    page-break-after: avoid;
  }
  .document-footer {
    min-height: 11mm;
    margin: 3mm 0 0 18px;
    padding: 2mm 0 0;
    background: #fff;
    font-size: 7.4px;
    line-height: 1.16;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .document-line-table tr,
  .document-totals tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .route-notes {
    break-inside: auto;
    page-break-inside: auto;
  }
  .invoice-document .document-end-block {
    font-size: 10.5px;
    line-height: 1.28;
    margin-bottom: 0;
    break-inside: auto;
    page-break-inside: auto;
  }
  .invoice-document .document-end-block + .document-end-block {
    margin-top: 8mm;
  }
  .invoice-document .document-end-block h2 {
    font-size: 12px;
    margin-bottom: 5mm;
  }
  .invoice-document .document-end-block p {
    max-width: 165mm;
  }
  .invoice-logo {
    margin-left: -18px;
    width: 300px;
    max-height: 115px;
  }
  .doc-page-break {
    break-after: page;
    page-break-after: always;
  }
  .invoice-page-break {
    break-after: page;
    page-break-after: always;
    height: 0;
    margin: 0;
    border: 0;
  }
  .invoice-page-break::after {
    content: "";
    display: none;
  }
}
