:root {
  color-scheme: light;
  --bg: #f4f7f6;
  --surface: #ffffff;
  --surface-2: #f9fbfb;
  --surface-3: #eef4f3;
  --ink: #141719;
  --muted: #68737c;
  --line: #d8e0df;
  --black: #050505;
  --teal: #0f766e;
  --teal-strong: #095c56;
  --teal-soft: #dff4ef;
  --amber: #d98212;
  --amber-soft: #fff1d6;
  --blue: #2f66d0;
  --blue-soft: #e4edff;
  --coral: #e15c4f;
  --coral-soft: #ffe8e5;
  --shadow: 0 18px 50px rgba(18, 34, 40, 0.13);
  --shadow-soft: 0 10px 28px rgba(18, 34, 40, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(15, 118, 110, 0.08), transparent 32%),
    linear-gradient(210deg, rgba(225, 92, 79, 0.08), transparent 26%),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
}

button:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
}

.auth-locked .app-shell {
  display: block;
}

.auth-locked .sidebar,
.auth-locked .topbar {
  display: none;
}

.sidebar {
  min-height: 100vh;
  padding: 20px 16px;
  background: #101416;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: sticky;
  top: 0;
}

.brand {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: #fff;
  color: #050505;
  display: grid;
  place-items: center;
  font-weight: 900;
  letter-spacing: 0;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 17px;
}

.brand small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  width: 100%;
  min-height: 44px;
  border-radius: var(--radius);
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.nav-item svg {
  width: 18px;
  height: 18px;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  transform: translateX(2px);
}

.nav-item.active {
  box-shadow: inset 3px 0 0 var(--teal);
}

.sidebar-note {
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--radius);
  padding: 14px;
  background: linear-gradient(145deg, rgba(15, 118, 110, 0.24), rgba(255, 255, 255, 0.06));
}

.sidebar-note span,
.sidebar-note small {
  display: block;
  color: rgba(255, 255, 255, 0.64);
  font-size: 12px;
}

.sidebar-note strong {
  display: block;
  margin: 5px 0;
  font-size: 20px;
}

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

.topbar {
  min-height: 82px;
  padding: 18px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.eyebrow,
.section-heading span,
.panel-intro span,
.plan-modal > span {
  margin: 0 0 4px;
  color: var(--teal-strong);
  font-size: 12px;
  line-height: 1.2;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.05;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-box {
  width: min(380px, 34vw);
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  box-shadow: var(--shadow-soft);
}

.search-box svg {
  width: 17px;
  height: 17px;
  color: var(--muted);
}

.search-box input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
}

.primary,
.secondary,
.ghost-button,
.filter-button,
.icon-close {
  min-height: 40px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.primary svg,
.secondary svg,
.ghost-button svg {
  width: 17px;
  height: 17px;
}

.compact-action {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
}

.primary {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 10px 24px rgba(20, 23, 25, 0.18);
}

.primary:hover {
  background: var(--teal-strong);
  transform: translateY(-1px);
}

.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.secondary:hover,
.ghost-button:hover,
.filter-button:hover {
  border-color: rgba(15, 118, 110, 0.32);
  background: var(--teal-soft);
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.auth-logout {
  max-width: 260px;
}

.auth-logout span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.view-root {
  padding: 0 26px 28px;
}

.auth-locked .view-root {
  min-height: 100vh;
  padding: 24px;
  display: grid;
  place-items: center;
}

.auth-screen {
  width: min(100%, 460px);
}

.auth-card {
  border: 1px solid rgba(216, 224, 223, 0.94);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  padding: 24px;
}

.auth-mark {
  width: 54px;
  height: 54px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
  margin-bottom: 18px;
}

.auth-card h2 {
  font-size: 34px;
  line-height: 1;
}

.auth-card > p:not(.eyebrow) {
  color: var(--muted);
  margin-top: 10px;
  line-height: 1.45;
}

.auth-form {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.auth-note {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--muted);
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.35;
}

.auth-note svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--teal);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) 360px;
  grid-template-areas:
    "calendar detail"
    "orders workload"
    "tasks workload";
  gap: 16px;
}

.command-panel,
.panel-surface,
.detail-panel,
.orders-panel,
.workload-panel,
.task-panel,
.mini-panel,
.preview-pane {
  border: 1px solid rgba(216, 224, 223, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
}

.command-panel {
  grid-area: calendar;
  padding: 16px;
}

.detail-panel {
  grid-area: detail;
  padding: 16px;
  min-width: 0;
}

.orders-panel {
  grid-area: orders;
  padding: 16px;
}

.workload-panel {
  grid-area: workload;
  padding: 16px;
}

.task-panel {
  grid-area: tasks;
  padding: 16px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-heading h2,
.detail-panel h2,
.panel-intro h2,
.plan-modal h2 {
  font-size: 22px;
  line-height: 1.12;
}

.compact-heading h2 {
  font-size: 18px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.filter-button {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}

.filter-button.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.ghost-button {
  min-height: 32px;
  padding: 6px 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--teal-strong);
  font-size: 12px;
}

.calendar {
  display: grid;
  gap: 9px;
}

.calendar.expanded {
  gap: 14px;
}

.calendar-hours,
.calendar-day {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 12px;
}

.calendar-hours {
  grid-template-columns: 84px repeat(5, minmax(0, 1fr));
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.calendar-hours span + span {
  display: block;
}

.day-label {
  min-height: 62px;
  display: grid;
  align-content: center;
  gap: 3px;
}

.day-label strong {
  font-size: 18px;
}

.day-label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.day-track {
  position: relative;
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(216, 224, 223, 0.65) 1px, transparent 1px) 0 0 / 20% 100%,
    #fbfdfd;
  overflow: hidden;
}

.calendar.expanded .day-track,
.calendar.expanded .day-label {
  min-height: 88px;
}

.timeline-block {
  position: absolute;
  top: calc(8px + var(--lane, 0) * 64px);
  bottom: auto;
  height: 55px;
  min-width: 118px;
  border-radius: var(--radius);
  color: #fff;
  padding: 9px 10px;
  display: grid;
  align-content: center;
  gap: 2px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 12px 20px rgba(20, 23, 25, 0.16);
  transition: transform 0.18s ease, box-shadow 0.18s ease, outline-color 0.18s ease;
}

.timeline-block strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.timeline-block span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.82);
  font-size: 11px;
  font-weight: 700;
}

.timeline-block:hover,
.timeline-block.selected {
  transform: translateY(-2px);
  box-shadow: 0 16px 28px rgba(20, 23, 25, 0.22);
  outline: 2px solid rgba(20, 23, 25, 0.18);
}

.timeline-block.teal,
.load-meter .teal {
  background: var(--teal);
}

.timeline-block.amber,
.load-meter .amber {
  background: var(--amber);
}

.timeline-block.blue,
.load-meter .blue {
  background: var(--blue);
}

.timeline-block.coral,
.load-meter .coral,
.load-meter .over {
  background: var(--coral);
}

.status-chip {
  min-height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.status-chip svg {
  width: 13px;
  height: 13px;
}

.status-chip.teal {
  color: var(--teal-strong);
  background: var(--teal-soft);
}

.status-chip.amber {
  color: #925405;
  background: var(--amber-soft);
}

.status-chip.blue {
  color: #1f4fa8;
  background: var(--blue-soft);
}

.status-chip.coral {
  color: #a7372f;
  background: var(--coral-soft);
}

.order-list {
  display: grid;
  gap: 9px;
  min-width: 0;
}

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

.order-card {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  display: grid;
  gap: 8px;
  padding: 12px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.order-card:hover,
.order-card.selected {
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: var(--shadow-soft);
  transform: translateY(-2px);
}

.order-card.selected {
  background: linear-gradient(180deg, #fff, #f4fbfa);
}

.order-topline {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.order-card strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.22;
}

.order-card > span:not(.order-topline):not(.progress-track) {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.priority {
  font-size: 11px;
  font-weight: 900;
}

.priority.hoch {
  color: var(--coral);
}

.priority.mittel {
  color: var(--blue);
}

.priority.niedrig {
  color: var(--muted);
}

.progress-track,
.load-meter {
  height: 7px;
  border-radius: 999px;
  background: #e8eeee;
  overflow: hidden;
}

.progress-track i,
.load-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), #49b390);
}

.progress-track.large {
  height: 9px;
  margin: 14px 0 4px;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.detail-header > span:first-child {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.detail-panel p,
.panel-intro p,
.plan-modal p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.detail-metrics {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.detail-metrics span {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 10px;
  color: var(--muted);
  font-size: 12px;
}

.detail-metrics strong {
  color: var(--ink);
  font-size: 18px;
}

.order-meta-panel {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.order-meta-panel span {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 9px 10px;
}

.order-meta-panel small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.order-meta-panel strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.detail-section {
  margin-top: 16px;
  display: grid;
  gap: 8px;
}

.detail-section h3 {
  font-size: 13px;
  text-transform: uppercase;
  color: var(--muted);
}

.line-item,
.task-check {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-size: 13px;
}

.line-item svg {
  width: 14px;
  height: 14px;
  color: var(--teal);
}

.task-check input {
  accent-color: var(--teal);
}

blockquote {
  margin: 16px 0 0;
  border-left: 3px solid var(--teal);
  padding: 8px 0 8px 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.offer-panel {
  margin-top: 16px;
  border: 1px solid rgba(47, 102, 208, 0.22);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #f7faff, #fff);
  padding: 12px;
}

.offer-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.offer-heading span:first-child {
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.offer-heading h3 {
  margin-top: 2px;
  font-size: 16px;
}

.offer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.offer-grid span {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.offer-grid strong {
  color: var(--ink);
  font-size: 13px;
}

.offer-terms-preview {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}

.offer-terms-preview span {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.offer-terms-preview strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 12px;
}

.offer-comment {
  margin-top: 10px;
  background: #fff;
  border-radius: 6px;
}

.offer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.offer-actions .primary,
.offer-actions .secondary {
  flex: 1 1 150px;
}

.mail-modal textarea {
  min-height: 190px;
}

.offer-settings-modal textarea {
  min-height: 86px;
}

.approval-preview-modal {
  width: min(760px, calc(100vw - 28px));
}

.approval-preview-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 42px;
}

.brand-mark.small {
  width: 42px;
  height: 42px;
  font-size: 13px;
}

.approval-preview-brand span:not(.brand-mark) {
  color: var(--teal-strong);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.approval-preview-brand h2 {
  margin-top: 2px;
}

.approval-copy {
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.approval-copy p + p {
  margin-top: 6px;
}

.approval-copy.terms {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 12px;
}

.approval-copy.terms strong {
  display: block;
  margin: 10px 0 2px;
  color: var(--ink);
}

.approval-copy.terms strong:first-child {
  margin-top: 0;
}

.approval-preview-list {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.approval-line {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px 120px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
}

.approval-line.optional {
  background: #fffaf1;
}

.approval-line strong,
.approval-line small,
.approval-line span {
  min-width: 0;
}

.approval-line small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.approval-line > span:nth-child(2),
.approval-line > strong:last-child {
  text-align: right;
}

.approval-optional {
  margin-top: 16px;
}

.approval-optional h3 {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.approval-total-box {
  margin-top: 14px;
  border-radius: var(--radius);
  background: #101416;
  color: #fff;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
}

.approval-total-box span {
  display: grid;
  gap: 3px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
  font-weight: 800;
}

.approval-total-box strong {
  color: #fff;
  font-size: 16px;
}

.mail-compose-note {
  margin-top: 12px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: var(--radius);
  background: var(--teal-soft);
  color: var(--teal-strong);
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.mail-compose-note svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.calc-panel {
  margin-top: 16px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #f8fdfc, #fff);
  padding: 12px;
}

.calc-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.calc-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.calc-heading span {
  color: var(--teal-strong);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.calc-heading h3 {
  margin-top: 2px;
  font-size: 16px;
}

.calc-source {
  min-height: 32px;
  border-radius: 6px;
  background: var(--teal-soft);
  color: var(--teal-strong);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.calc-source svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.calc-table {
  margin-top: 10px;
  display: grid;
  gap: 6px;
}

.calc-row {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  display: grid;
  grid-template-columns: minmax(150px, 1.35fr) 50px 70px 76px 56px 58px 58px 62px;
  align-items: center;
  gap: 8px;
  padding: 8px;
  font-size: 12px;
}

.calc-head {
  min-height: 30px;
  background: transparent;
  border: 0;
  color: var(--muted);
  font-weight: 900;
  text-transform: uppercase;
  padding-top: 0;
  padding-bottom: 0;
}

.calc-row strong,
.calc-row small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calc-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.risk-text {
  color: var(--coral);
  font-weight: 900;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}

.icon-mini {
  width: 28px;
  min-height: 28px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.icon-mini:hover {
  background: var(--coral-soft);
  color: var(--coral);
}

.icon-mini svg {
  width: 14px;
  height: 14px;
}

.calc-summary,
.calc-preview {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.calc-summary span,
.calc-preview span {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.calc-summary strong,
.calc-preview strong {
  color: var(--ink);
  font-size: 14px;
}

.calc-preview small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.calc-switch {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 8px 10px;
}

.calc-switch input {
  accent-color: var(--teal);
}

.files-panel {
  margin-top: 16px;
  border: 1px solid rgba(217, 130, 18, 0.24);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fffaf1, #fff);
  padding: 12px;
}

.files-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.files-heading span {
  color: #925405;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.files-heading h3 {
  margin-top: 2px;
  font-size: 16px;
}

.file-upload-action {
  position: relative;
  overflow: hidden;
}

.file-upload-action input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-list {
  display: grid;
  gap: 8px;
}

.file-row {
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) max-content 30px;
  align-items: center;
  gap: 9px;
  padding: 8px;
}

.file-icon {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: var(--amber-soft);
  color: var(--amber);
  display: grid;
  place-items: center;
}

.file-icon svg {
  width: 17px;
  height: 17px;
}

.file-row strong,
.file-row small {
  min-width: 0;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-row strong {
  font-size: 13px;
}

.file-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.file-row .icon-mini {
  grid-column: 4;
}

.file-open-link {
  grid-column: 3;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.file-open-link:hover {
  text-decoration: underline;
}

.customer-layout {
  display: grid;
  grid-template-columns: minmax(270px, 0.36fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.customer-list-panel {
  position: sticky;
  top: 20px;
}

.customer-list {
  display: grid;
  gap: 10px;
}

.customer-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  padding: 10px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.customer-card:hover,
.customer-card.selected {
  border-color: rgba(15, 118, 110, 0.4);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.customer-card strong,
.customer-card small {
  min-width: 0;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-card strong {
  font-size: 14px;
}

.customer-card small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.customer-card svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.customer-detail {
  display: grid;
  gap: 16px;
}

.customer-hero {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) max-content;
  align-items: center;
  gap: 14px;
}

.customer-hero span:not(.customer-avatar) {
  color: var(--teal);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.customer-hero h2 {
  margin-top: 2px;
  font-size: clamp(24px, 3vw, 34px);
}

.customer-hero p {
  margin-top: 3px;
  color: var(--muted);
  font-weight: 700;
}

.customer-avatar {
  width: 58px;
  height: 58px;
  border-radius: var(--radius);
  background: #101416;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 950;
  letter-spacing: 0;
}

.customer-avatar.small {
  width: 38px;
  height: 38px;
  background: var(--teal-soft);
  color: var(--teal-strong);
  font-size: 13px;
}

.customer-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.customer-metrics span {
  min-height: 68px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fff, var(--surface-2));
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.customer-metrics strong {
  color: var(--ink);
  font-size: 17px;
}

.customer-contact-grid,
.customer-section-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.customer-contact-grid > div,
.customer-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px;
}

.customer-contact-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.customer-contact-grid strong,
.customer-contact-grid small {
  min-width: 0;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-contact-grid strong {
  margin-top: 5px;
  font-size: 14px;
}

.customer-contact-grid small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.customer-section-grid {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
}

.customer-order-list {
  display: grid;
  gap: 8px;
}

.customer-order-row {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  padding: 9px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.customer-order-row:hover,
.customer-order-row.selected {
  border-color: rgba(47, 102, 208, 0.42);
  background: #fff;
}

.customer-order-row strong,
.customer-order-row small {
  min-width: 0;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-order-row strong {
  font-size: 13px;
}

.customer-order-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.activity-panel {
  margin-top: 16px;
  border: 1px solid rgba(47, 102, 208, 0.2);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #f7faff, #fff);
  padding: 12px;
}

.activity-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.activity-heading span {
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.activity-heading h3 {
  margin-top: 2px;
  font-size: 16px;
}

.activity-list {
  display: grid;
  gap: 8px;
}

.activity-row {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 8px;
}

.activity-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--blue-soft);
  color: var(--blue);
  display: grid;
  place-items: center;
}

.activity-icon svg {
  width: 16px;
  height: 16px;
}

.activity-row strong,
.activity-row small {
  min-width: 0;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-row strong {
  font-size: 13px;
}

.activity-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.mail-match-list {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.mail-match {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  display: grid;
  gap: 7px;
  padding: 12px;
}

.mail-match.imported {
  border-color: rgba(15, 118, 110, 0.32);
  background: #f6fcfa;
}

.mail-match-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mail-match h3 {
  font-size: 15px;
}

.mail-match p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.42;
}

.mail-match > small,
.mail-match-top small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.mail-match-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.detail-actions,
.action-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.status-select {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-select span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.status-select select {
  min-height: 34px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: var(--radius);
  background: var(--teal-soft);
  color: var(--teal-strong);
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 900;
}

.person-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 90px 74px;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  border-bottom: 1px solid var(--line);
}

.person-row:last-child {
  border-bottom: 0;
}

.people-grid.expanded {
  display: grid;
  gap: 10px;
}

.person-row.expanded {
  grid-template-columns: 42px minmax(0, 1fr) minmax(120px, 0.6fr) 82px 130px;
  min-height: 70px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: #fff;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
}

.avatar.teal {
  background: var(--teal);
}

.avatar.blue {
  background: var(--blue);
}

.avatar.amber {
  background: var(--amber);
}

.avatar.coral {
  background: var(--coral);
}

.person-copy {
  min-width: 0;
  display: grid;
}

.person-copy strong,
.person-copy small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-copy small,
.load-text,
.task-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.task-list {
  display: grid;
  gap: 8px;
}

.task-row {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
}

.task-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.task-row small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.tasks-view {
  display: grid;
  gap: 14px;
}

.task-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.task-kpis span {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.task-kpis strong {
  color: var(--ink);
  font-size: 19px;
}

.task-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(240px, 1fr));
  gap: 12px;
  align-items: start;
}

.task-column {
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 10px;
}

.task-column-head {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.task-column-head small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.task-column-list {
  display: grid;
  gap: 9px;
}

.task-card-board {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  display: grid;
  gap: 8px;
  padding: 10px;
  box-shadow: 0 8px 20px rgba(18, 34, 40, 0.05);
}

.task-card-top,
.task-card-meta,
.task-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.task-card-top {
  justify-content: space-between;
}

.task-card-board h3 {
  font-size: 15px;
  line-height: 1.25;
}

.task-card-board p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.task-card-meta span {
  min-height: 26px;
  border-radius: 6px;
  background: var(--surface-2);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.task-card-meta svg {
  width: 13px;
  height: 13px;
}

.task-card-actions {
  margin-top: 2px;
}

.split-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 16px;
}

.split-view > .command-panel,
.split-view > .detail-panel,
.split-view > .panel-surface {
  grid-area: auto;
}

.split-view.wide-right {
  grid-template-columns: minmax(0, 1fr) 350px;
}

.split-view.calendar-view {
  align-items: start;
  grid-template-columns: minmax(0, 1fr);
}

.calendar-view .command-panel,
.calendar-view .detail-panel {
  min-width: 0;
  position: relative;
  z-index: 1;
}

.calendar-view .detail-panel {
  background: #fff;
}

.calendar-view .detail-panel.tall {
  position: static;
  width: 100%;
}

.panel-surface {
  padding: 16px;
}

.detail-panel.tall {
  align-self: start;
  position: sticky;
  top: 16px;
}

.approval-list {
  display: grid;
  gap: 10px;
}

.approval-row {
  width: 100%;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  display: grid;
  grid-template-columns: auto 1fr 150px minmax(180px, 0.8fr) 20px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
}

.approval-row.selected,
.approval-row:hover {
  border-color: rgba(15, 118, 110, 0.4);
  background: #f7fcfb;
}

.approval-row span {
  color: var(--muted);
  font-size: 13px;
}

.mockup-layout {
  display: grid;
  grid-template-columns: minmax(330px, 440px) minmax(0, 1fr);
  gap: 16px;
}

.mockup-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel-intro {
  border-radius: var(--radius);
  padding: 16px;
  background: #101416;
  color: #fff;
  box-shadow: var(--shadow-soft);
}

.panel-intro span {
  color: #8bd8ce;
}

.panel-intro p {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.72);
}

.mini-panel {
  padding: 14px;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.panel-title svg {
  width: 17px;
  height: 17px;
  color: var(--teal);
}

.panel-title h3 {
  font-size: 15px;
}

.field {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.field span,
.switch-row > span,
.tuning-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="file"],
.field input[type="number"],
.field input[type="date"],
.field input[type="datetime-local"],
.field input:not([type]),
.field textarea,
.field select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 8px 10px;
  color: var(--ink);
}

.field input:disabled {
  background: var(--surface-2);
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
}

.field textarea {
  resize: vertical;
  line-height: 1.45;
}

.compact {
  grid-template-columns: 102px minmax(0, 1fr);
  align-items: center;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--teal);
}

input[type="color"] {
  width: 52px;
  height: 34px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.color-row {
  grid-template-columns: 102px 64px;
}

.status-pill,
.preview-state {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 5px 10px;
  margin-top: 10px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill.ready {
  border-color: rgba(15, 118, 110, 0.28);
  color: var(--teal-strong);
  background: var(--teal-soft);
}

.status-pill.error,
.preview-state.error {
  border-color: rgba(217, 130, 18, 0.35);
  color: #925405;
  background: var(--amber-soft);
}

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

.upload-tile {
  min-height: 112px;
  border: 1px dashed #b6c4c2;
  border-radius: var(--radius);
  background: var(--surface-2);
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 8px;
  padding: 10px;
  cursor: pointer;
}

.upload-tile input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-tile > span:last-of-type {
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.logo-preview {
  min-height: 66px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 6px;
  background: var(--surface-3);
}

.logo-preview img {
  max-width: 100%;
  max-height: 64px;
  display: block;
}

.logo-preview svg {
  width: 26px;
  height: 26px;
  color: var(--muted);
}

.switch-row {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.switch {
  position: relative;
  display: inline-flex;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  background: #c8d4d2;
  border-radius: 999px;
  transition: 0.16s ease;
}

.switch span::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
  transition: 0.16s ease;
}

.switch input:checked + span {
  background: var(--teal);
}

.switch input:checked + span::after {
  transform: translateX(20px);
}

.tuning-grid {
  display: grid;
  gap: 10px;
}

.tuning-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--surface-2);
}

.tuning-card h4 {
  font-size: 13px;
  margin-bottom: 8px;
}

.tuning-card label {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.placement-tuning {
  margin-top: 10px;
}

.placement-tuning label {
  grid-template-columns: 72px minmax(0, 1fr);
}

.full-button {
  width: 100%;
  margin-top: 10px;
}

.preview-pane {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: calc(100vh - 126px);
  overflow: hidden;
}

.preview-toolbar {
  min-height: 56px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.preview-title {
  font-weight: 900;
  font-size: 14px;
}

.preview-state {
  margin-top: 0;
}

.preview-shell {
  position: relative;
  min-height: 0;
  background: #111;
  overflow: hidden;
}

#pdfFrame {
  width: 100%;
  height: 100%;
  min-height: 640px;
  border: 0;
  display: none;
  background: #1a1a1a;
}

#pdfFrame.ready {
  display: block;
}

.empty-preview {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 12px;
  color: #d6dbe0;
  text-align: center;
  padding: 24px;
}

.empty-preview[hidden] {
  display: none;
}

.empty-preview svg {
  width: 40px;
  height: 40px;
  margin: 0 auto;
  color: #90a0ae;
}

.modal-root[hidden],
.toast[hidden] {
  display: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 18, 20, 0.42);
  z-index: 20;
}

.plan-modal {
  position: fixed;
  z-index: 21;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(620px, calc(100vw - 28px));
  max-height: min(92vh, 900px);
  overflow: auto;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  padding: 20px;
}

.plan-modal > .detail-actions {
  position: sticky;
  bottom: -20px;
  margin: 14px -20px -20px;
  padding: 12px 20px 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), #fff 34%);
  border-top: 1px solid var(--line);
}

.icon-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  min-height: 36px;
  padding: 0;
  background: var(--surface-2);
  color: var(--ink);
}

.icon-close svg {
  width: 18px;
  height: 18px;
}

.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  border-radius: var(--radius);
  background: #101416;
  color: #fff;
  box-shadow: var(--shadow);
  padding: 12px 14px;
  font-weight: 800;
  animation: toast-in 0.22s ease;
}

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

.empty-state {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 18px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.mail-hub {
  display: grid;
  gap: 16px;
}

.mail-toolbar {
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: end;
}

.mail-toolbar h2 {
  font-size: 24px;
  line-height: 1.1;
}

.mail-toolbar p:not(.eyebrow) {
  color: var(--muted);
  margin-top: 6px;
}

.mail-toolbar-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.compact-field {
  min-width: 240px;
  margin-top: 0;
}

.inline-switch {
  align-self: center;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.mail-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.mail-status-grid .mini-panel {
  padding: 14px;
}

.mail-shell {
  display: grid;
  grid-template-columns: minmax(240px, 0.72fr) minmax(0, 1.25fr) minmax(300px, 0.82fr);
  gap: 16px;
  align-items: start;
}

.hub-mail-list,
.hub-mail-reader,
.hub-reply-panel {
  padding: 14px;
  min-width: 0;
}

.mail-list-head .field {
  margin-top: 0;
}

.mail-list-scroll {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 330px);
  min-height: 360px;
  overflow: auto;
  padding-right: 2px;
}

.hub-mail-row {
  width: 100%;
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  text-align: left;
  padding: 12px;
  display: grid;
  gap: 6px;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.hub-mail-row:hover,
.hub-mail-row.active {
  border-color: rgba(28, 135, 123, 0.45);
  box-shadow: 0 12px 24px rgba(16, 24, 24, 0.08);
  transform: translateY(-1px);
}

.hub-mail-row strong,
.hub-mail-row small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-mail-row small {
  color: var(--muted);
}

.mail-priority {
  width: fit-content;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  background: rgba(39, 118, 210, 0.12);
  color: #285db8;
}

.mail-priority.hoch {
  background: rgba(224, 85, 73, 0.13);
  color: #b23b35;
}

.mail-priority.niedrig {
  background: rgba(28, 135, 123, 0.12);
  color: var(--teal-dark);
}

.mail-reader-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.mail-reader-head h2 {
  margin-top: 10px;
  font-size: 22px;
  line-height: 1.14;
}

.mail-reader-head p {
  color: var(--muted);
  margin-top: 6px;
  word-break: break-word;
}

.mail-summary-list {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.mail-system-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid rgba(214, 156, 61, 0.35);
  border-radius: var(--radius);
  background: rgba(245, 176, 65, 0.11);
  color: #7b5523;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 13px;
  line-height: 1.35;
}

.mail-system-note svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.mail-summary-list li {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 10px 12px;
  color: var(--ink);
}

.mail-body-text {
  margin: 0;
  max-height: calc(100vh - 360px);
  min-height: 360px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink);
  font: 14px/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}

.mail-reply-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.mail-reply-actions .compact-action {
  justify-content: center;
}

.mail-safety-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  margin-top: 12px;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .brand span:not(.brand-mark),
  .nav-item span,
  .sidebar-note {
    display: none;
  }

  .brand {
    justify-content: center;
  }

  .nav-item {
    justify-content: center;
  }

  .dashboard-grid,
  .split-view,
  .split-view.wide-right,
  .mockup-layout,
  .customer-layout,
  .customer-section-grid {
    grid-template-columns: 1fr;
    grid-template-areas: none;
  }

  .customer-list-panel {
    position: static;
  }

  .command-panel,
  .detail-panel,
  .orders-panel,
  .workload-panel,
  .task-panel,
  .mail-toolbar {
    grid-area: auto;
  }

  .mail-toolbar,
  .mail-shell,
  .mail-status-grid {
    grid-template-columns: 1fr;
  }

  .mail-toolbar-actions {
    justify-content: flex-start;
  }

  .mail-list-scroll,
  .mail-body-text {
    max-height: none;
    min-height: 220px;
  }

  .detail-panel.tall {
    position: static;
  }

  .orders-view .section-heading {
    display: grid;
  }

  .orders-view .filter-row {
    justify-content: flex-start;
  }

  .orders-view .order-list.large {
    grid-template-columns: 1fr;
  }

  .calendar-view {
    gap: 18px;
  }

  .calendar-view .detail-panel.tall {
    position: static;
    width: 100%;
  }

  .calendar-view .calendar.expanded {
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .calendar-view .calendar.expanded .calendar-hours,
  .calendar-view .calendar.expanded .calendar-day {
    min-width: 760px;
  }

  .preview-pane {
    min-height: 70vh;
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    min-height: auto;
    position: static;
    padding: 12px;
  }

  .brand span:not(.brand-mark),
  .nav-item span {
    display: block;
  }

  .brand {
    justify-content: flex-start;
  }

  .nav-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .nav-item {
    justify-content: center;
    min-height: 48px;
    padding: 8px;
    font-size: 12px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    padding: 16px;
  }

  .top-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .search-box {
    width: 100%;
  }

  .view-root {
    padding: 0 12px 18px;
  }

  .section-heading,
  .preview-toolbar {
    display: grid;
  }

  .filter-row {
    justify-content: flex-start;
  }

  .calendar-hours {
    display: none;
  }

  .calendar-day {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .day-label {
    min-height: auto;
    grid-template-columns: auto 1fr;
    align-items: baseline;
    justify-content: start;
  }

  .day-track {
    min-height: 92px;
    overflow-x: auto;
  }

  .timeline-block {
    min-width: 138px;
  }

  .calendar-view .calendar.expanded .calendar-hours,
  .calendar-view .calendar.expanded .calendar-day {
    min-width: 680px;
  }

  .order-list.large,
  .detail-metrics,
  .detail-actions,
  .action-row,
  .modal-grid,
  .logo-grid,
  .offer-grid,
  .calc-summary,
  .calc-preview,
  .task-kpis,
  .customer-metrics,
  .customer-contact-grid {
    grid-template-columns: 1fr;
  }

  .customer-hero {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .customer-hero .compact-action {
    grid-column: 1 / -1;
    justify-content: center;
  }

  .customer-avatar {
    width: 48px;
    height: 48px;
    font-size: 15px;
  }

  .file-row {
    grid-template-columns: 34px minmax(0, 1fr) 30px;
  }

  .file-open-link {
    grid-column: 2;
  }

  .file-row .icon-mini {
    grid-column: 3;
  }

  .task-board {
    display: flex;
    overflow-x: auto;
    padding-bottom: 6px;
  }

  .task-column {
    min-width: 282px;
  }

  .calc-table {
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .calc-row {
    min-width: 840px;
  }

  .approval-line,
  .approval-total-box {
    grid-template-columns: 1fr;
  }

  .approval-line > span:nth-child(2),
  .approval-line > strong:last-child {
    text-align: left;
  }

  .person-row,
  .person-row.expanded {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .load-meter,
  .load-text,
  .task-count {
    grid-column: 2;
    width: 100%;
  }

  .task-row,
  .approval-row {
    grid-template-columns: 1fr;
  }

  .compact,
  .color-row,
  .tuning-card label {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
