:root {
  /* Farbschema analog zu PREMIUM_APPz/myoffice */
  --bg: #eef4f5;
  --card: #fff;
  --ink: #263340;
  --muted: #5c6b78;
  --accent: #55b6c5;
  --accent-hover: #25717d;
  --accent-soft: #d4eef1;
  --line: #d4dde3;
  --err: #8b1c1c;
  --ok: #1f5a2f;
  --border: var(--line);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body.office {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
}

.office-top {
  position: relative;
  z-index: 100;
  padding: 0.85rem 1.25rem;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.office-top-bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  width: 100%;
}

.office-brand {
  min-width: 0;
  flex: 1 1 auto;
}

.office-brand a {
  min-width: 0;
}

.office-brand span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.office-top-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.office-top-actions .tenant-pill {
  white-space: nowrap;
  max-width: min(14rem, 42vw);
  overflow: hidden;
  text-overflow: ellipsis;
}

.office-system-link {
  white-space: nowrap;
}

.office-brand {
  margin: 0;
  font-weight: 700;
}

.office-brand a {
  color: var(--accent-hover);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  letter-spacing: 0.02em;
}

.office-logo {
  height: 44px;
  width: auto;
  flex: 0 0 auto;
  object-fit: contain;
}

.office-brand span {
  font-size: 1.35rem;
  font-weight: 800;
}

.office-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.office-menu-details {
  position: relative;
  flex-shrink: 0;
}

.office-nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(38, 51, 64, 0.06);
}

.office-nav-toggle::-webkit-details-marker {
  display: none;
}

.office-nav-toggle:hover {
  border-color: rgba(85, 182, 197, 0.65);
  color: var(--accent-hover);
}

.office-nav-toggle:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.office-nav-toggle-bars {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 1.35rem;
}

.office-nav-toggle-bars span {
  display: block;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}

.office-menu-details[open] > .office-nav-toggle {
  border-color: rgba(85, 182, 197, 0.75);
  background: var(--accent-soft);
}

.office-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem 0;
  margin: 0;
  padding: 0;
}

.office-menu-details[open] > .office-nav {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  left: auto;
  min-width: 14rem;
  width: max(14rem, min(22rem, calc(100vw - 2.5rem)));
  max-height: min(70vh, 28rem);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0.45rem 0.55rem 0.4rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(38, 51, 64, 0.18);
  z-index: 400;
}

.office-nav-scroll {
  overflow-x: hidden;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem 0;
  padding: 0.2rem 0.3rem 0.35rem;
}

.office-nav-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  margin-top: 0.15rem;
  padding: 0.4rem 0.3rem 0.2rem;
}

.office-nav-footer a {
  font-weight: 600;
}

.office-menu-details[open] > .office-nav a {
  display: block;
  padding: 0.5rem 0.35rem;
  border-radius: 6px;
}

.office-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}

.office-nav a:hover {
  color: var(--accent);
}

.tenant-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  background: var(--accent-soft);
  border: 1px solid rgba(85, 182, 197, 0.55);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-weight: 750;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(38, 51, 64, 0.06);
}

.tenant-pill:visited {
  color: var(--ink);
}

.tenant-pill:hover {
  color: var(--accent-hover);
  border-color: rgba(37, 113, 125, 0.6);
}

.office-menu-details[open] > .office-nav a.tenant-pill {
  align-self: flex-start;
  margin-bottom: 0.25rem;
}

.office-main {
  flex: 1 0 auto;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2rem;
}

.office-subnav {
  max-width: 960px;
  margin: 0.85rem auto 0;
  padding: 0 1.25rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.office-foot {
  flex-shrink: 0;
  width: 100%;
  margin-top: auto;
  padding: 1.25rem 1.25rem 1.5rem;
  background: var(--accent-soft);
  border-top: 3px solid var(--accent);
  font-size: 0.95rem;
  color: var(--ink);
  box-shadow: 0 -6px 20px rgba(38, 51, 64, 0.08);
}

.office-foot-meta {
  margin: 0 auto 0.65rem;
  max-width: 960px;
  text-align: center;
  font-size: 0.92rem;
}

.office-foot-link {
  color: var(--accent-hover);
  font-weight: 600;
  text-decoration: none;
}

.office-foot-link:hover {
  text-decoration: underline;
}

.office-foot-sep {
  color: rgba(28, 36, 32, 0.35);
  font-weight: 400;
}

.office-foot p {
  margin: 0 0 0.5rem;
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
}

.office-foot p:last-child {
  margin-bottom: 0;
}

.office-foot code {
  background: rgba(255, 255, 255, 0.65);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  font-size: 0.9em;
}

.office-release {
  margin-top: 0.65rem !important;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(28, 36, 32, 0.12);
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 500;
}

h1 {
  margin: 0 0 0.75rem;
  font-size: 1.65rem;
}

.lead {
  color: var(--muted);
  margin: 0 0 1.25rem;
}

.form label,
.form .check {
  display: block;
  margin-bottom: 1rem;
}

.form input[type="text"],
.form input[type="email"],
.form input[type="password"],
.form input[type="number"],
.form textarea {
  display: block;
  width: 100%;
  max-width: 28rem;
  margin-top: 0.35rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
}

.form--wide input,
.form--wide textarea {
  max-width: 40rem;
}

.check input {
  width: auto;
  margin-right: 0.35rem;
}

.btn {
  display: inline-block;
  padding: 0.5rem 1.1rem;
  border-radius: 6px;
  border: none;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover {
  filter: brightness(1.08);
}

.btn--ghost {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

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

.actions-inline a {
  white-space: nowrap;
}

.actions-inline form {
  display: inline;
}

.actions-inline button.linklike {
  white-space: nowrap;
}

.linklike {
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--accent);
  text-decoration: underline;
  font: inherit;
  cursor: pointer;
}

.linklike:hover {
  text-decoration: none;
}

.actions-inline a + a::before {
  content: "·";
  color: var(--muted);
  margin-right: 0.6rem;
}

.msg {
  padding: 0.65rem 0.85rem;
  border-radius: 6px;
  max-width: 40rem;
}

.msg--err {
  background: #fde8e8;
  color: var(--err);
}

.msg--ok {
  background: #e6f4ea;
  color: var(--ok);
}

.hint {
  color: var(--muted);
  font-size: 0.9rem;
}

.portfolio-desc {
  margin: 0.2rem 0 0;
  padding-left: 1.1rem;
}

.portfolio-desc li {
  margin: 0.05rem 0;
}

.cal-day {
  display: flex;
  justify-content: space-between;
  gap: 0.35rem;
  align-items: center;
  padding: 0.15rem 0.25rem;
  border-radius: 8px;
}

.cal-day--today {
  border: 2px solid rgba(85, 182, 197, 0.9);
  background: rgba(85, 182, 197, 0.12);
}

.cal-day--selected {
  border: 2px solid rgba(38, 51, 64, 0.25);
  background: rgba(38, 51, 64, 0.04);
}

.table-wrap {
  overflow-x: auto;
  margin-top: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

table.data th,
table.data td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

table.data th {
  background: #eef1ee;
  font-weight: 600;
}

table.data tr:last-child td {
  border-bottom: none;
}

table.data a {
  color: var(--accent);
  font-weight: 500;
}

.tiles {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.tiles li {
  background: linear-gradient(145deg, var(--accent-soft) 0%, #fff 72%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1rem 1.05rem;
  box-shadow: 0 4px 20px rgba(38, 51, 64, 0.07);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.tiles a {
  color: inherit;
  text-decoration: none;
  display: block;
}

.tiles a:hover {
  color: var(--accent-hover);
}

.tiles strong {
  display: block;
  font-size: 1.55rem;
  margin-bottom: 0.25rem;
}

.tiles small {
  color: var(--muted);
}

.kanban {
  margin-top: 1.25rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
}

.kanban-col {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.85rem 0.85rem 1rem;
  box-shadow: 0 4px 20px rgba(38, 51, 64, 0.06);
}

.kanban-title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
}

.kanban-count {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
}

.kanban-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 0.75rem 0.65rem;
  background: linear-gradient(145deg, var(--accent-soft) 0%, #fff 72%);
  margin-bottom: 0.75rem;
}

.kanban-card__top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
}

.kanban-card__title {
  margin-top: 0.35rem;
  font-weight: 650;
}

.kanban-card__actions {
  margin-top: 0.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.kanban-card__actions a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.kanban-card__actions a:hover {
  text-decoration: underline;
}

.kanban-card__actions select {
  padding: 0.35rem 0.45rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  font: inherit;
}

.tiles li:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(38, 51, 64, 0.11);
  border-color: rgba(85, 182, 197, 0.35);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.25rem;
  align-items: flex-end;
  margin: 1.25rem 0;
  padding: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.filters label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

.filters input,
.filters select {
  min-width: 12rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
}

.fieldset {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.1rem 1.1rem;
  margin-bottom: 1.25rem;
  background: var(--card);
}

.fieldset legend {
  padding: 0 0.35rem;
  font-weight: 600;
  color: var(--accent);
}

.data--compact th,
.data--compact td {
  padding: 0.45rem 0.5rem;
  font-size: 0.92rem;
}

.data--compact select,
.data--compact input[type="text"] {
  max-width: 100%;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.line-price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.line-price-row .js-price {
  flex: 1 1 5.5rem;
  min-width: 4rem;
}

.line-price-tiers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  white-space: nowrap;
}

.line-price-tiers .btn--sm {
  padding: 0.15rem 0.35rem;
  font-size: 0.78rem;
}

.btn--sm {
  padding: 0.2rem 0.45rem;
  font-size: 0.9rem;
  line-height: 1.2;
}

.input-readonly {
  background: #eef1ee;
  color: var(--muted);
}

/* Schmale Viewports (Handy): Navigation stapeln, etwas luftiger tippbar */
@media (max-width: 36rem) {
  .office-top-bar {
    flex-wrap: wrap;
    align-items: center;
  }

  .office-top-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .office-main {
    padding: 1rem 0.85rem 1.5rem;
  }

  .office-subnav {
    margin-top: 0.65rem;
    padding: 0 0.85rem;
  }

  h1 {
    font-size: 1.35rem;
  }

  .office-brand span {
    font-size: 1.15rem;
  }

  .office-logo {
    height: 40px;
    width: auto;
  }

  .office-menu-details[open] > .office-nav {
    position: fixed;
    top: 4.1rem;
    right: 0.85rem;
    left: 0.85rem;
    width: auto;
    min-width: 0;
    max-height: calc(100vh - 5.25rem);
  }

  .tiles {
    grid-template-columns: 1fr;
  }

  table.data {
    font-size: 0.88rem;
  }

  table.data th,
  table.data td {
    padding: 0.45rem 0.5rem;
  }

  .actions-inline {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .actions-inline a + a::before {
    content: "";
    margin-right: 0;
  }

  .btn {
    padding: 0.55rem 1rem;
  }
}

.work-section {
  margin-top: 1.75rem;
}

.work-section__title {
  margin: 0 0 0.85rem;
  font-size: 1.1rem;
}

.work-list {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.work-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1rem 0.9rem;
  box-shadow: 0 4px 20px rgba(38, 51, 64, 0.06);
}

.work-card__head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
  margin-bottom: 0.35rem;
}

.work-card__customer {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.work-card__status {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-hover);
  white-space: nowrap;
}

.work-card__title {
  margin: 0 0 0.45rem;
  font-size: 1.15rem;
  line-height: 1.35;
}

.work-card__meta {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.work-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.work-task-list {
  display: grid;
  gap: 0.55rem;
}

.work-task {
  display: grid;
  gap: 0.15rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(145deg, var(--accent-soft) 0%, #fff 72%);
  color: inherit;
  text-decoration: none;
  transition: border-color 160ms ease, transform 160ms ease;
}

.work-task:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.work-task__status {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-hover);
}

.work-task__title {
  font-weight: 600;
}

.work-task__meta {
  font-size: 0.9rem;
  color: var(--muted);
}

.work-breadcrumb {
  margin: 0 0 0.75rem;
}

.work-breadcrumb a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.work-hub__head {
  margin-bottom: 1rem;
}

.work-hub__customer {
  margin: 0 0 0.25rem;
  color: var(--muted);
}

.work-hub__title {
  margin: 0 0 0.35rem;
  font-size: 1.65rem;
  line-height: 1.25;
}

.work-hub__meta {
  margin: 0;
  color: var(--muted);
}

.work-hub__notes {
  margin: 0.85rem 0 0;
  padding: 0.75rem 0.85rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.work-hub__tiles {
  margin-top: 1.25rem;
}
