:root {
  color-scheme: light;
  --accent: #df001f;
  --accent-strong: #bf001a;
  --accent-soft: #fff1f3;
  --ink: #141416;
  --ink-soft: #2f3034;
  --muted: #74757c;
  --paper: #f5f5f7;
  --card: rgba(255, 255, 255, 0.84);
  --card-solid: #ffffff;
  --line: rgba(20, 20, 22, 0.1);
  --line-strong: rgba(20, 20, 22, 0.18);
  --shadow: 0 18px 55px rgba(12, 14, 18, 0.1);
  --shadow-soft: 0 10px 30px rgba(12, 14, 18, 0.08);
  --green: #0f8f63;
  --green-soft: #e7f7f0;
  --amber: #b87510;
  --amber-soft: #fff5dc;
  --orange: #c24d20;
  --orange-soft: #fff0e8;
  --blue: #2468d8;
  --blue-soft: #edf4ff;
  --danger: #a60f23;
  --danger-soft: #ffe8ec;
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --sidebar-width: 292px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at 84% 8%, rgba(223, 0, 31, 0.1), transparent 26%),
    linear-gradient(180deg, #ffffff 0%, var(--paper) 44%, #eeeeef 100%);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: transparent;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
}

button,
a,
select {
  -webkit-tap-highlight-color: transparent;
}

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
  height: 100vh;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(24px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
}

.brand-logo {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  overflow: hidden;
  border-radius: 16px;
  background: var(--accent);
  box-shadow: 0 14px 30px rgba(223, 0, 31, 0.22);
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-copy {
  min-width: 0;
}

.brand-name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 760;
  letter-spacing: 0;
}

.brand-subtitle {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.role-panel,
.side-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-soft);
}

.mini-label {
  display: block;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 720;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f0f0f2;
}

.segmented button {
  min-height: 38px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 720;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.segmented button.active {
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.nav-button {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  min-height: 48px;
  padding: 7px 10px 7px 7px;
  border-radius: 17px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  text-align: left;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-button:hover {
  background: rgba(20, 20, 22, 0.05);
}

.nav-button.active {
  background: var(--ink);
  color: #ffffff;
  box-shadow: 0 16px 32px rgba(20, 20, 22, 0.18);
}

.nav-button .nav-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 13px;
  background: rgba(20, 20, 22, 0.06);
  color: currentColor;
  font-size: 0.82rem;
  font-weight: 820;
}

.nav-button.active .nav-icon {
  background: rgba(255, 255, 255, 0.14);
}

.nav-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.94rem;
  font-weight: 720;
}

.nav-count {
  min-width: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.74rem;
  font-weight: 760;
  text-align: center;
}

.nav-button.active .nav-count {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.side-card {
  margin-top: auto;
}

.side-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.main {
  min-width: 0;
  padding: 26px clamp(18px, 3.2vw, 46px) 42px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}

.search {
  position: relative;
  flex: 1;
  max-width: 520px;
}

.search input {
  width: 100%;
  height: 48px;
  padding: 0 18px 0 46px;
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: 0;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-soft);
  color: var(--ink);
}

.search::before {
  position: absolute;
  top: 50%;
  left: 18px;
  width: 13px;
  height: 13px;
  border: 2px solid var(--muted);
  border-radius: 50%;
  content: "";
  transform: translateY(-58%);
}

.search::after {
  position: absolute;
  top: 29px;
  left: 30px;
  width: 8px;
  height: 2px;
  border-radius: 999px;
  background: var(--muted);
  content: "";
  transform: rotate(45deg);
}

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

.icon-button,
.pill-button,
.primary-button,
.secondary-button,
.quiet-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 760;
  max-width: 100%;
  min-width: 0;
  line-height: 1.15;
  white-space: normal;
  text-align: center;
  overflow-wrap: anywhere;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease, color 150ms ease;
}

.icon-button:hover,
.pill-button:hover,
.primary-button:hover,
.secondary-button:hover,
.quiet-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
}

.icon-button {
  width: 44px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.button-symbol {
  position: relative;
  display: block;
  width: 16px;
  height: 16px;
}

.button-symbol.plus::before,
.button-symbol.plus::after,
.button-symbol.upload::before,
.button-symbol.upload::after,
.button-symbol.mail::before,
.button-symbol.mail::after,
.button-symbol.check::before,
.button-symbol.check::after {
  position: absolute;
  content: "";
}

.button-symbol.plus::before {
  top: 7px;
  left: 1px;
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.button-symbol.plus::after {
  top: 1px;
  left: 7px;
  width: 2px;
  height: 14px;
  border-radius: 999px;
  background: currentColor;
}

.button-symbol.upload::before {
  top: 2px;
  left: 7px;
  width: 2px;
  height: 11px;
  border-radius: 999px;
  background: currentColor;
}

.button-symbol.upload::after {
  top: 2px;
  left: 4px;
  width: 7px;
  height: 7px;
  border-top: 2px solid currentColor;
  border-left: 2px solid currentColor;
  transform: rotate(45deg);
}

.button-symbol.mail {
  border: 2px solid currentColor;
  border-radius: 4px;
}

.button-symbol.mail::before {
  top: 3px;
  left: 0;
  width: 11px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

.button-symbol.check::before {
  top: 7px;
  left: 2px;
  width: 5px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(40deg);
}

.primary-button {
  padding: 0 18px;
  background: var(--ink);
  color: #ffffff;
  box-shadow: 0 14px 30px rgba(20, 20, 22, 0.18);
}

.secondary-button {
  padding: 0 18px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  text-decoration: none;
}

.quiet-button {
  min-height: 38px;
  padding: 0 14px;
  background: rgba(20, 20, 22, 0.06);
  color: var(--ink-soft);
}

.danger-button {
  padding: 0 16px;
  background: var(--danger-soft);
  color: var(--danger);
}

.view {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.view > *,
.hero-inner > *,
.grid > * {
  min-width: 0;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(24px, 4vw, 44px);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.64)),
    linear-gradient(135deg, rgba(223, 0, 31, 0.1), rgba(20, 20, 22, 0.05));
  box-shadow: var(--shadow);
}

.hero::after {
  position: absolute;
  right: clamp(18px, 4vw, 48px);
  bottom: -34px;
  width: 230px;
  height: 230px;
  border: 1px solid rgba(223, 0, 31, 0.16);
  border-radius: 50%;
  background: rgba(223, 0, 31, 0.04);
  content: "";
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  gap: 28px;
  align-items: end;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 30px;
  margin: 0 0 14px;
  padding: 0 11px;
  border: 1px solid rgba(223, 0, 31, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 760;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 740px;
  margin-bottom: 14px;
  font-size: clamp(2.2rem, 5vw, 5rem);
  line-height: 0.97;
  letter-spacing: 0;
  overflow-wrap: break-word;
}

h1 span {
  display: block;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(1.5rem, 2.6vw, 2.2rem);
  line-height: 1.1;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
  line-height: 1.22;
}

.lead {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.3vw, 1.18rem);
  line-height: 1.55;
  overflow-wrap: break-word;
}

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

.hero-metric {
  min-height: 122px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
}

.metric-value {
  display: block;
  font-size: clamp(1.35rem, 1.55vw, 1.45rem);
  font-weight: 820;
  letter-spacing: 0;
  white-space: nowrap;
}

.metric-label {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-top: 2px;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.grid {
  display: grid;
  gap: 16px;
}

.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));
}

.card {
  overflow: hidden;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.card.solid {
  background: var(--card-solid);
}

.property-card {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 0;
}

.property-visual {
  position: relative;
  min-height: 156px;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(20, 20, 22, 0.86), rgba(20, 20, 22, 0.5)),
    var(--visual-bg);
  background-size: cover;
  background-position: center;
  color: #ffffff;
}

.property-visual::after {
  position: absolute;
  inset: auto 20px 20px auto;
  width: 74px;
  height: 74px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.16);
  content: "";
  backdrop-filter: blur(8px);
}

.status-pill,
.tiny-pill,
.state-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  gap: 7px;
  border-radius: 999px;
  font-weight: 760;
}

.status-pill {
  min-height: 31px;
  padding: 0 11px;
  background: rgba(255, 255, 255, 0.16);
  color: inherit;
  font-size: 0.78rem;
}

.tiny-pill {
  min-height: 27px;
  padding: 0 10px;
  background: rgba(20, 20, 22, 0.06);
  color: var(--muted);
  font-size: 0.76rem;
}

.state-pill {
  min-height: 30px;
  padding: 0 11px;
  font-size: 0.78rem;
}

.state-pill.approved,
.state-pill.paid,
.state-pill.active,
.state-pill.green {
  background: var(--green-soft);
  color: var(--green);
}

.state-pill.pending,
.state-pill.review,
.state-pill.customer_paid,
.state-pill.open,
.state-pill.orange {
  background: var(--amber-soft);
  color: var(--amber);
}

.state-pill.due,
.state-pill.rejected,
.state-pill.overdue,
.state-pill.red {
  background: var(--danger-soft);
  color: var(--danger);
}

.state-pill.blue,
.state-pill.ready {
  background: var(--blue-soft);
  color: var(--blue);
}

.property-title {
  position: relative;
  z-index: 1;
  margin: 22px 0 0;
  font-size: 1.45rem;
}

.property-address {
  position: relative;
  z-index: 1;
  margin: 5px 0 0;
  color: rgba(255, 255, 255, 0.76);
}

.property-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 16px;
  padding: 0 20px 20px;
}

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

.stat {
  min-height: 76px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(20, 20, 22, 0.045);
}

.stat strong {
  display: block;
  font-size: 1.05rem;
  letter-spacing: 0;
}

.stat span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.28;
}

.progress-block {
  display: grid;
  gap: 8px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 680;
}

.progress-track {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(20, 20, 22, 0.08);
}

.progress-fill {
  width: var(--progress);
  height: 100%;
  border-radius: inherit;
  background: var(--fill, var(--accent));
}

.next-task {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #ffffff;
}

.next-task span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.module-tile {
  min-height: 154px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
}

.module-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.module-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 15px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 820;
}

.module-tile p,
.card p {
  color: var(--muted);
  line-height: 1.45;
}

.action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}

.project-card,
.offer-card,
.invoice-card,
.inbox-card,
.document-card,
.insurance-card,
.studio-card,
.audit-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.card-header p {
  margin: 4px 0 0;
}

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

.timeline-step {
  min-height: 72px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(20, 20, 22, 0.035);
}

.timeline-step.done {
  border-color: rgba(15, 143, 99, 0.24);
  background: var(--green-soft);
}

.timeline-step.current {
  border-color: rgba(223, 0, 31, 0.22);
  background: var(--accent-soft);
}

.timeline-step strong {
  display: block;
  font-size: 0.78rem;
  line-height: 1.2;
}

.timeline-step span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.72rem;
}

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

.detail {
  padding: 13px;
  border-radius: var(--radius-md);
  background: rgba(20, 20, 22, 0.045);
}

.detail span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.25;
}

.detail strong {
  display: block;
  margin-top: 5px;
  font-size: 0.96rem;
}

.offer-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 176px;
  gap: 16px;
  align-items: stretch;
}

.pdf-tile {
  display: grid;
  min-height: 178px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(223, 0, 31, 0.08), rgba(255, 255, 255, 0.9)),
    #ffffff;
  color: var(--accent-strong);
  font-weight: 840;
}

.event-list,
.task-list,
.audit-list {
  display: grid;
  gap: 10px;
}

.event,
.task-item,
.audit-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 13px;
  border-radius: var(--radius-md);
  background: rgba(20, 20, 22, 0.045);
}

.event span,
.task-item span,
.audit-item span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.invoice-amount {
  font-size: 2.1rem;
  font-weight: 830;
  letter-spacing: 0;
}

.invoice-amount small {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 680;
}

.drop-zone {
  min-height: 132px;
  display: grid;
  place-items: center;
  padding: 22px;
  border: 1.5px dashed rgba(20, 20, 22, 0.18);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.58);
  text-align: center;
}

.drop-zone strong {
  display: block;
  margin-bottom: 6px;
}

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

.field {
  display: grid;
  gap: 7px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 720;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 15px;
  outline: 0;
  background: #ffffff;
  color: var(--ink);
}

.field textarea {
  min-height: 96px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.search input:focus {
  border-color: rgba(223, 0, 31, 0.36);
  box-shadow: 0 0 0 4px rgba(223, 0, 31, 0.08);
}

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

.type-button {
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--ink-soft);
  cursor: pointer;
  font-weight: 740;
  text-align: left;
}

.type-button.active {
  border-color: rgba(223, 0, 31, 0.28);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.inbox-card {
  border-left: 5px solid var(--accent);
}

.approval-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.document-card {
  min-height: 180px;
}

.doc-icon {
  display: grid;
  width: 48px;
  height: 58px;
  place-items: center;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 820;
}

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

.coverage-item {
  min-height: 104px;
  padding: 13px;
  border-radius: var(--radius-md);
  background: rgba(20, 20, 22, 0.045);
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
}

.coverage-item.green {
  color: var(--green);
}

.coverage-item.orange {
  color: var(--amber);
}

.coverage-item.red {
  color: var(--danger);
}

.coverage-item.gray {
  color: var(--muted);
}

.coverage-item strong {
  display: block;
  margin-top: 14px;
  color: var(--ink);
}

.coverage-item span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.78rem;
}

.warranty-list {
  display: grid;
  gap: 12px;
}

.warranty-item {
  display: grid;
  gap: 8px;
  padding: 13px;
  border-radius: var(--radius-md);
  background: rgba(20, 20, 22, 0.045);
}

.mail-preview {
  white-space: pre-wrap;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #ffffff;
  color: var(--ink-soft);
  line-height: 1.5;
}

.studio-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(20, 20, 22, 0.045);
}

.toggle {
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: rgba(20, 20, 22, 0.16);
}

.toggle::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  content: "";
  transition: transform 150ms ease;
}

.toggle.on {
  background: var(--accent);
}

.toggle.on::after {
  transform: translateX(20px);
}

.empty-state {
  display: grid;
  min-height: 220px;
  place-items: center;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.7);
  text-align: center;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 44px));
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 18px;
  background: rgba(20, 20, 22, 0.92);
  color: #ffffff;
  box-shadow: var(--shadow);
  animation: toast-in 220ms ease;
}

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

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

  .sidebar {
    position: relative;
    z-index: 4;
    height: auto;
    padding: 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    max-width: 100vw;
    overflow: hidden;
  }

  .brand,
  .role-panel,
  .side-card {
    display: none;
  }

  .nav {
    flex-direction: row;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .nav-button {
    min-width: 188px;
  }

  .main {
    padding-top: 18px;
  }
}

@media (max-width: 880px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .search {
    max-width: none;
  }

  .top-actions {
    justify-content: space-between;
  }

  .hero-inner,
  .grid.two,
  .grid.three,
  .grid.four,
  .offer-preview {
    grid-template-columns: 1fr;
  }

  .hero-metrics,
  .detail-list,
  .coverage-grid,
  .type-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 560px) {
  .main {
    padding-inline: 14px;
  }

  .hero,
  .card {
    border-radius: 22px;
  }

  .hero {
    padding: 22px;
  }

  .hero-metrics,
  .stat-row,
  .detail-list,
  .coverage-grid,
  .form-grid,
  .type-grid,
  .approval-grid {
    grid-template-columns: 1fr;
  }

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

  .section-heading,
  .card-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .action-bar,
  .top-actions {
    flex-wrap: wrap;
    width: 100%;
  }

  .top-actions .icon-button {
    flex: 0 0 44px;
  }

  .top-actions .primary-button {
    flex: 1 1 calc(100% - 58px);
  }

  .top-actions [data-reset] {
    flex: 1 1 100%;
  }

  h1 {
    font-size: 2rem;
    line-height: 1.05;
    width: min(100%, calc(100vw - 72px));
  }

  .lead {
    width: min(100%, calc(100vw - 72px));
    overflow-wrap: anywhere;
  }

  .primary-button,
  .secondary-button,
  .danger-button {
    flex: 1;
  }
}

/* SwissBauArchiv v2 portal */
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(380px, 0.9fr);
  gap: clamp(24px, 4vw, 54px);
  padding: clamp(18px, 4vw, 58px);
  align-items: stretch;
}

.login-brand-panel,
.auth-card {
  border: 1px solid rgba(20, 20, 22, 0.08);
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.login-brand-panel {
  min-height: 680px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(26px, 4vw, 52px);
}

.login-logo-row,
.logo-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-logo-image {
  width: 76px;
  height: 76px;
  flex: 0 0 76px;
  border-radius: 22px;
  object-fit: cover;
  box-shadow: 0 18px 42px rgba(217, 0, 27, 0.24);
  animation: logoBreath 5s ease-in-out infinite;
}

.brand-mini-logo {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 11px;
  object-fit: cover;
  box-shadow: 0 10px 24px rgba(217, 0, 27, 0.16);
}

@keyframes logoBreath {
  0%,
  100% {
    transform: translateY(0);
    box-shadow: 0 18px 42px rgba(217, 0, 27, 0.22);
  }
  50% {
    transform: translateY(-3px);
    box-shadow: 0 24px 58px rgba(217, 0, 27, 0.34);
  }
}

.login-logo-row strong,
.logo-lockup strong {
  display: block;
  font-size: 1.25rem;
  letter-spacing: 0;
}

.login-logo-row span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}

.swiss-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 1.55rem;
  font-weight: 860;
  line-height: 1;
}

.login-hero-copy h1 {
  max-width: 760px;
  margin-bottom: 18px;
}

.login-hero-copy p {
  max-width: 580px;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.55;
}

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

.login-feature-grid div {
  min-height: 120px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
}

.login-feature-grid span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  margin-bottom: 16px;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent);
}

.auth-card {
  align-self: center;
  padding: 22px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 5px;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f1f1f3;
}

.auth-tabs button {
  min-height: 42px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 780;
}

.auth-tabs button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 8px 22px rgba(20, 20, 22, 0.09);
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-form h2 {
  margin-bottom: 6px;
}

.auth-form p,
.auth-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.form-error {
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--danger-soft);
  color: var(--danger) !important;
  font-weight: 720;
}

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

.role-card {
  min-height: 96px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 780;
}

.role-card svg {
  color: var(--accent);
}

.role-card.active {
  border-color: rgba(223, 0, 31, 0.32);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.funnel-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.portal-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 276px minmax(0, 1fr);
  background: #fafafa;
}

.portal-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 28px 20px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  min-width: 0;
}

.portal-nav {
  display: grid;
  gap: 8px;
}

.portal-nav-item {
  position: relative;
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 13px;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  font-weight: 690;
}

.portal-nav-item::before {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: -20px;
  width: 3px;
  border-radius: 999px;
  background: transparent;
  content: "";
}

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

.portal-nav-item em {
  min-width: 24px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-style: normal;
  font-size: 0.74rem;
  text-align: center;
}

.portal-nav-item.active {
  background: linear-gradient(90deg, rgba(223, 0, 31, 0.1), rgba(223, 0, 31, 0.03));
  color: var(--accent);
}

.portal-nav-item.active::before {
  background: var(--accent);
}

.premium-card {
  margin-top: auto;
  padding: 18px;
  border: 1px solid rgba(223, 0, 31, 0.14);
  border-radius: 14px;
  background: linear-gradient(135deg, #fff, #fff6f7);
  box-shadow: var(--shadow-soft);
}

.premium-card > svg {
  width: 30px;
  height: 30px;
  margin-bottom: 14px;
  color: var(--accent);
}

.premium-card strong {
  display: block;
  margin-bottom: 8px;
}

.premium-card p {
  margin: 0 0 14px;
  color: var(--ink-soft);
  line-height: 1.42;
}

.premium-card button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-weight: 780;
}

.portal-main {
  min-width: 0;
  padding: 0 clamp(20px, 2.6vw, 38px) 36px;
}

.portal-topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  border-bottom: 1px solid var(--line);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.version-chip,
.language-select {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 780;
}

.version-chip {
  padding: 0 10px;
}

.language-select {
  padding: 0 8px;
}

.premium-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-weight: 780;
}

.top-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  cursor: pointer;
}

.account-chip {
  display: flex;
  align-items: center;
  gap: 12px;
}

.account-chip > span,
.avatar-large,
.avatar-circle {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: #111217;
  color: #fff;
  font-weight: 820;
}

.avatar-circle {
  object-fit: cover;
}

.topbar-avatar {
  width: 44px;
  height: 44px;
}

.profile-avatar-editor {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: fit-content;
  max-width: 100%;
  margin-bottom: 18px;
  padding: 12px 14px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #fff, #fbfbfc);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.profile-avatar-editor input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  font-size: 1.15rem;
  box-shadow: 0 16px 34px rgba(20, 20, 22, 0.14);
}

.profile-avatar-editor strong,
.profile-avatar-editor small {
  display: block;
}

.profile-avatar-editor small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.account-chip strong,
.account-chip small {
  display: block;
}

.account-chip small {
  margin-top: 2px;
  color: var(--muted);
}

.customer-dashboard,
.stack-view {
  display: grid;
  gap: 18px;
  padding-top: 22px;
}

.property-header-card,
.admin-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.property-selector {
  display: flex;
  align-items: center;
  gap: 18px;
}

.property-cover {
  width: 180px;
  height: 96px;
  overflow: hidden;
  border-radius: 12px;
  background: #ececef;
}

.property-cover img,
.project-thumb img,
.manage-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.title-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 1.8rem;
  font-weight: 820;
}

.title-select-control {
  max-width: min(540px, 62vw);
  padding: 0 34px 0 0;
  border: 0;
  outline: 0;
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, var(--ink) 50%) right 13px center / 8px 8px no-repeat,
    linear-gradient(135deg, var(--ink) 50%, transparent 50%) right 7px center / 8px 8px no-repeat;
}

.property-selector p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.02rem;
}

.image-upload-button,
.small-file-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 740;
  overflow: hidden;
}

.image-upload-button input,
.small-file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

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

.metric-card-ref {
  min-height: 150px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.metric-icon {
  display: grid;
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}

.metric-icon.green {
  background: rgba(31, 157, 85, 0.1);
  color: #147943;
}

.metric-card-ref span,
.metric-card-ref small {
  display: block;
  color: var(--muted);
  line-height: 1.35;
}

.metric-card-ref strong {
  display: block;
  margin: 12px 0 8px;
  font-size: 1.7rem;
  letter-spacing: 0;
}

.metric-message {
  font-size: 0.95rem !important;
}

.ring {
  position: relative;
  display: grid;
  flex: 0 0 86px;
  width: 86px;
  height: 86px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--accent) var(--value), #e6e6e8 0);
}

.ring::before {
  position: absolute;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: #fff;
  content: "";
}

.ring strong {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 1.5rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: 16px;
}

.panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.panel.wide {
  grid-row: span 2;
}

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

.panel-heading h2,
.panel h3 {
  margin: 0;
}

.panel-heading button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-weight: 740;
}

.reference-project {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.reference-project:first-of-type {
  border-top: 0;
}

.project-thumb {
  height: 142px;
  overflow: hidden;
  border-radius: 12px;
  background: #ececef;
}

.project-row,
.offer-mini-head,
.project-meta-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.project-row h3,
.offer-mini h3 {
  margin: 0 0 6px;
}

.green-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--green);
}

.kebab {
  background: transparent;
  font-size: 1.4rem;
  cursor: pointer;
}

.project-progress-line,
.mini-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6e7ea;
}

.project-progress-line span,
.mini-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.project-meta-line {
  margin: 12px 0;
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.project-actions,
.offer-actions,
.decision-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.project-actions {
  flex-wrap: wrap;
}

.project-actions button,
.offer-actions button {
  flex: 1 1 140px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.project-actions .small-file-button {
  flex: 1 1 120px;
  min-height: 40px;
  padding: 0 10px;
  border-radius: 10px;
}

.offer-mini {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.status-badge {
  display: inline-flex;
  width: fit-content;
  min-height: 25px;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  background: #eef1f5;
  color: var(--muted);
  font-size: 0.77rem;
  font-weight: 780;
}

.status-badge.ready {
  background: #dff6e8;
  color: var(--green);
}

.status-badge.active {
  background: var(--green-soft);
  color: var(--green);
}

.status-badge.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.decision-row button {
  flex: 1 1 160px;
  min-height: 46px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 780;
}

.decision-row .accept {
  background: #23964d;
  color: #fff;
}

.decision-row .reject {
  border: 1px solid var(--accent);
  background: #fff;
  color: var(--accent);
}

.decision-row button:disabled {
  border-color: var(--line);
  background: #f0f0f2;
  color: var(--muted);
  cursor: not-allowed;
}

.coverage-line,
.task-line,
.module-line,
.audit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  min-height: 42px;
  border-bottom: 1px solid var(--line);
}

.coverage-line strong.green {
  color: var(--green);
}

.coverage-line strong.orange {
  color: #f08a24;
}

.coverage-line strong.red {
  color: var(--accent);
}

.coverage-line strong.gray {
  color: var(--muted);
}

.panel-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
  color: var(--muted);
}

.warranty-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.warranty-line span {
  display: block;
  margin-top: 6px;
  color: var(--green);
}

.warranty-line .mini-progress {
  grid-column: 1 / -1;
}

.task-line {
  justify-content: start;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto auto;
  display: grid;
}

.task-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}

.task-icon.orange {
  background: var(--orange-soft);
  color: var(--orange);
}

.task-icon.blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.task-line em {
  color: var(--accent);
  font-style: normal;
  font-weight: 780;
}

.grey-empty {
  min-height: 148px;
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 22px;
  border: 1px dashed rgba(20, 20, 22, 0.16);
  border-radius: 14px;
  background: #f6f6f7;
  color: var(--muted);
  text-align: center;
}

.grey-empty > span {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: var(--muted);
}

.grey-empty button {
  color: var(--accent);
  background: transparent;
  cursor: pointer;
  font-weight: 780;
}

.image-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #ececef, #fafafa);
  color: var(--muted);
  text-align: center;
  font-size: 0.8rem;
}

.empty-dashboard {
  display: grid;
  gap: 22px;
  padding-top: 28px;
}

.empty-hero {
  min-height: 360px;
  display: grid;
  place-items: center;
  gap: 14px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  text-align: center;
  box-shadow: var(--shadow-soft);
}

.empty-hero > span {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border-radius: 24px;
  background: var(--accent-soft);
  color: var(--accent);
}

.empty-hero h1 {
  max-width: 640px;
  margin: 0;
  font-size: clamp(2rem, 5vw, 4rem);
}

.empty-hero p {
  max-width: 620px;
  color: var(--muted);
}

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

.empty-module {
  min-height: 128px;
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f0f0f2;
  color: var(--muted);
  filter: grayscale(1);
  opacity: 0.78;
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.75fr) minmax(0, 1.25fr);
  gap: 16px;
}

.card-list {
  display: grid;
  gap: 14px;
}

.manage-card,
.request-row,
.list-card {
  display: grid;
  grid-template-columns: 138px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.manage-image {
  height: 96px;
  overflow: hidden;
  border-radius: 12px;
  background: #ececef;
}

.manage-card h3,
.request-row h3 {
  margin: 0 0 6px;
}

.manage-card p,
.request-row p,
.request-row span {
  margin: 0 0 8px;
  color: var(--muted);
}

.phase-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.phase-chips span {
  padding: 5px 8px;
  border-radius: 999px;
  background: #f0f0f2;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 720;
}

.phase-chips .done {
  background: var(--accent-soft);
  color: var(--accent);
}

.embedded-modules {
  display: grid;
  gap: 14px;
}

.list-card {
  grid-template-columns: auto 1fr auto;
}

.list-card > svg,
.module-line > svg,
.audit-row > svg {
  color: var(--accent);
}

.admin-shell .portal-sidebar {
  background: #fff;
}

.admin-hero {
  align-items: stretch;
  padding: 28px;
}

.admin-hero h1 {
  font-size: clamp(2.2rem, 5vw, 4.5rem);
}

.admin-hero p {
  color: var(--muted);
  line-height: 1.5;
}

.admin-stat-grid {
  min-width: 560px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-stat-grid .metric-card-ref {
  min-height: 122px;
}

.user-row {
  grid-template-columns: auto minmax(0, 1fr) minmax(280px, 1.3fr) auto;
}

.avatar-large {
  width: 56px;
  height: 56px;
}

.request-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-width: 0;
}

.request-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 18px;
  background: var(--accent-soft);
  color: var(--accent);
}

.request-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  min-width: 0;
}

.clean-select {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.form-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid .full,
.primary-button.full {
  grid-column: 1 / -1;
}

.svg-icon {
  flex: 0 0 auto;
}

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

.compact-actions {
  margin-top: 10px;
  gap: 8px;
}

.stack-actions {
  display: grid;
  gap: 8px;
}

.expert-box {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  background: #f6f6f7;
  color: var(--ink-soft);
}

.expert-box p {
  margin: 6px 0 0;
}

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

.admin-work-board {
  display: grid;
  grid-template-columns: minmax(180px, 0.68fr) minmax(210px, 0.82fr) minmax(0, 1.9fr);
  gap: 16px;
}

.admin-work-column {
  align-self: start;
}

.admin-work-main {
  grid-column: span 1;
}

.admin-card-list,
.admin-project-list {
  display: grid;
  gap: 10px;
}

.admin-pick-card,
.admin-project-card {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfbfc;
  color: var(--ink);
  text-align: left;
}

.admin-pick-card {
  cursor: pointer;
}

.admin-pick-card.active,
.admin-project-card:hover {
  border-color: rgba(223, 0, 31, 0.28);
  background: linear-gradient(135deg, rgba(223, 0, 31, 0.06), #fff);
}

.admin-pick-card span,
.admin-project-card p,
.admin-project-card span {
  color: var(--muted);
}

.admin-project-card {
  grid-template-columns: minmax(0, 1fr) minmax(92px, auto);
  align-items: center;
}

.admin-project-card span,
.admin-project-card button {
  grid-column: 1 / -1;
}

.quick-project-form,
.admin-secondary-tools {
  margin-top: 16px;
}

.admin-secondary-tools summary {
  cursor: pointer;
  font-weight: 780;
  color: var(--ink);
}

.project-dashboard-view {
  --planning-color: #1f9d55;
}

.project-dashboard-view.planning-mode .section-heading h2::after {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-left: 10px;
  padding: 0 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--planning-color) 14%, white);
  color: var(--planning-color);
  content: "Planung";
  font-size: 0.74rem;
  font-weight: 780;
  vertical-align: middle;
}

.project-dashboard-view.planning-mode .project-progress-line span,
.project-dashboard-view.planning-mode .mini-progress span {
  background: var(--planning-color);
}

.project-dashboard-view.planning-mode .panel:first-of-type,
.admin-project-control {
  border-color: color-mix(in srgb, var(--planning-color) 22%, var(--line));
  box-shadow: 0 22px 58px color-mix(in srgb, var(--planning-color) 10%, transparent);
}

.admin-project-control {
  margin-bottom: 16px;
}

.admin-project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.admin-project-actions > *,
.form-actions > *,
.funnel-actions > *,
.compact-actions > *,
.action-bar > *,
.request-actions > * {
  flex: 1 1 160px;
}

.admin-project-actions .top-icon,
.action-bar .top-icon,
.compact-actions .top-icon {
  flex: 0 0 42px;
}

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

.single-upload-hub {
  margin-top: 14px;
  border-color: color-mix(in srgb, var(--planning-color) 18%, var(--line));
}

.project-upload-launcher {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.upload-main-button {
  justify-self: start;
}

.upload-choice-menu {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.upload-choice-menu button {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8f8fa;
  color: var(--ink);
  font-weight: 780;
  text-align: left;
}

.upload-choice-menu button.active {
  border-color: color-mix(in srgb, var(--planning-color) 35%, var(--accent));
  background: color-mix(in srgb, var(--planning-color) 12%, white);
  color: color-mix(in srgb, var(--planning-color) 70%, var(--accent));
}

.unified-upload-form {
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.05);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.selected-file-name {
  display: block;
  padding: 9px 11px;
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  font-weight: 700;
}

.upload-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfbfc;
}

.upload-card h3 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.lock-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--amber-soft);
  color: var(--amber);
  font-weight: 760;
}

.project-work-form {
  margin-top: 12px;
}

.project-title-tools,
.property-doc-upload {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.property-doc-upload {
  grid-template-columns: minmax(0, 1fr) auto auto;
  margin: 12px 0;
}

.project-title-tools input,
.property-doc-upload input {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.value-total {
  padding: 10px 14px;
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.property-mini-section {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.value-increase-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid rgba(31, 157, 85, 0.18);
  border-radius: 999px;
  background: rgba(31, 157, 85, 0.09);
  color: #147943;
  font-weight: 820;
}

.property-history-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.property-history-mini span {
  padding: 7px 9px;
  border-radius: 999px;
  background: #f4f5f7;
  color: var(--muted);
  font-weight: 750;
  font-size: 0.84rem;
}

.compact-history-line {
  padding: 8px 0;
}

.property-import-form {
  margin-top: 14px;
}

.code-share-box {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  padding: 12px;
  margin: 8px 0 12px;
  border: 1px solid rgba(217, 0, 27, 0.12);
  border-radius: 16px;
  background: linear-gradient(180deg, #fff, #fbfbfc);
}

.code-share-box span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-weight: 780;
}

.code-share-box strong {
  overflow-wrap: anywhere;
  font-size: 0.98rem;
}

.code-share-box small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.inline-code-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.inline-code-row span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #f4f5f7;
  color: var(--muted);
  font-weight: 780;
}

.tiny-button {
  min-height: 34px;
  padding: 0 10px;
}

.property-access-tools {
  margin: 12px 0;
}

.property-access-tools summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 820;
}

.property-access-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.linked-list {
  display: grid;
  gap: 5px;
  padding: 10px;
  border-radius: 12px;
  background: #f8f8fa;
  color: var(--muted);
}

.linked-list strong {
  color: var(--ink);
}

.admin-link-tools {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfbfc;
}

.admin-link-tools h3 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.inline-link {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 820;
  cursor: pointer;
}

.danger-inline {
  color: var(--danger);
}

.defect-card {
  display: grid;
  gap: 6px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.defect-deadline-bar {
  position: relative;
  height: 22px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef0f4;
}

.defect-deadline-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #1f9d55;
}

.defect-deadline-bar.orange i {
  background: #f08a24;
}

.defect-deadline-bar.red i {
  background: var(--danger);
}

.defect-deadline-bar.blue i {
  background: #1f7ae0;
}

.defect-deadline-bar span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 820;
}

.document-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.document-gallery.large {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.document-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfbfc;
}

.document-preview-tile {
  display: grid;
  gap: 8px;
  min-height: 122px;
  padding: 12px;
  border: 0;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.document-preview-tile:disabled {
  cursor: default;
  opacity: 0.8;
}

.document-mini-thumb {
  width: 100%;
  height: 86px;
  object-fit: cover;
  border-radius: 12px;
  background: #f4f5f7;
  box-shadow: inset 0 0 0 1px rgba(20, 20, 22, 0.06);
}

.document-kind {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  color: #fff;
}

.document-kind.pdf,
.document-kind.file {
  background: var(--accent);
}

.document-kind.image {
  background: #1f7ae0;
}

.document-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.document-actions > *,
.action-bar > *,
.compact-actions > *,
.project-actions > *,
.offer-actions > *,
.decision-row > * {
  min-width: 0;
}

.document-actions select {
  flex: 1 1 160px;
  min-height: 42px;
}

.line-doc-thumb {
  display: grid;
  flex: 0 0 auto;
  width: 54px;
  height: 46px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  color: var(--accent);
  cursor: pointer;
}

.line-doc-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.line-doc-thumb:disabled {
  cursor: default;
  opacity: 0.75;
}

.disabled-link {
  pointer-events: none;
  opacity: 0.5;
}

.file-preview-modal {
  width: min(1060px, 100%);
  max-height: min(900px, calc(100vh - 40px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
}

.file-preview-body {
  min-height: 420px;
  overflow: auto;
  padding: 14px;
  background: #f4f5f7;
}

.preview-pdf,
.preview-pdf iframe {
  width: 100%;
  height: min(70vh, 720px);
  border: 0;
  border-radius: 16px;
  background: #fff;
}

.preview-image {
  display: block;
  max-width: 100%;
  max-height: min(70vh, 720px);
  margin: 0 auto;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.preview-fallback {
  min-height: 360px;
  display: grid;
  place-items: center;
  gap: 12px;
  text-align: center;
}

.document-thumb {
  display: grid;
  gap: 6px;
  min-height: 108px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8f8f9;
  color: var(--ink);
  text-decoration: none;
}

.document-thumb span {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 999px;
  background: #fff;
  color: var(--accent);
}

.project-ledger-line {
  display: grid;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.project-ledger-line .module-line {
  min-height: 0;
  border-bottom: 0;
}

.delivery-line {
  display: grid;
  grid-template-columns: auto minmax(100px, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 720;
}

.delivery-line div {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf5;
}

.delivery-line i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #1f7ae0;
}

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

.delivery-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfbfc;
}

.sia-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(31, 157, 85, 0.22);
  border-radius: 16px;
  background: rgba(31, 157, 85, 0.08);
  color: #147943;
  box-shadow: var(--shadow-soft);
}

.pilot-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(31, 122, 224, 0.2);
  border-radius: 16px;
  background: rgba(31, 122, 224, 0.08);
  color: #1758a8;
  box-shadow: var(--shadow-soft);
}

.pilot-share-panel,
.archive-panel {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfbfc;
}

.property-archive-panel {
  border-color: rgba(31, 157, 85, 0.18);
  background: linear-gradient(135deg, rgba(31, 157, 85, 0.05), #fff);
}

.archive-transfer-row .request-actions {
  min-width: min(440px, 100%);
}

.archive-assign-form {
  grid-template-columns: minmax(160px, 1fr) auto;
  width: 100%;
}

.archive-panel summary {
  cursor: pointer;
  font-weight: 820;
}

.muted-archive {
  opacity: 0.86;
}

.paid-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(31, 157, 85, 0.2);
  border-radius: 12px;
  background: rgba(31, 157, 85, 0.1);
  color: #147943;
  font-weight: 820;
}

.project-close-form {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.comment-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.sia-seal,
.external-seal {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 850;
  vertical-align: middle;
}

.sia-seal {
  background: rgba(31, 157, 85, 0.11);
  color: #147943;
}

.sia-seal.small,
.external-seal {
  min-height: 22px;
  padding: 0 8px;
}

.external-seal {
  background: #eef0f2;
  color: #6b7280;
}

.external-project {
  background: linear-gradient(180deg, rgba(248, 249, 250, 0.98), rgba(242, 244, 247, 0.92));
}

.account-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.flow-backdrop.soft {
  z-index: 60;
  background: rgba(20, 20, 22, 0.18);
}

.project-edit-line {
  grid-template-columns: minmax(110px, 0.7fr) minmax(96px, 0.5fr) minmax(140px, 1fr) auto;
}

.project-task-add {
  margin-top: 12px;
  grid-template-columns: minmax(0, 1fr) minmax(110px, 0.35fr) auto;
}

.admin-search-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.object-result-grid {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.rich-line {
  align-items: start;
}

.rich-line span {
  color: var(--muted);
  line-height: 1.35;
}

.inline-admin-controls {
  display: grid;
  grid-template-columns: 150px minmax(140px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.inline-admin-controls input,
.inline-admin-controls select,
.partner-info-row input,
.mini-request-form input,
.mini-request-form select {
  min-height: 40px;
  width: 100%;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}

.partner-info-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) repeat(4, minmax(110px, 1fr)) minmax(120px, auto);
  gap: 10px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.tenant-property-panel {
  grid-column: 1 / -1;
}

.tenant-property-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.tenant-property-card {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, #fff, #fbfbfc);
  box-shadow: var(--shadow-soft);
}

.tenant-property-image {
  min-height: 238px;
  background: #ececef;
}

.tenant-property-image img,
.tenant-property-image .image-placeholder {
  width: 100%;
  height: 100%;
  min-height: 238px;
  object-fit: cover;
}

.tenant-property-body {
  display: grid;
  align-content: space-between;
  gap: 14px;
  padding: 18px;
}

.tenant-property-body h3 {
  margin: 0 0 5px;
  font-size: 1.45rem;
}

.tenant-property-body p {
  margin: 0;
  color: var(--muted);
}

.tenant-contact-strip {
  display: grid;
  gap: 5px;
  padding: 12px;
  border-radius: 14px;
  background: #f6f7f8;
}

.tenant-contact-strip span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-weight: 780;
}

.tenant-contact-strip small {
  color: var(--muted);
}

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

.tenant-mini-stats span {
  display: grid;
  gap: 3px;
  padding: 12px;
  border-radius: 14px;
  background: #f7f7f8;
}

.tenant-mini-stats strong {
  font-size: 1.25rem;
}

.tenant-mini-stats small {
  color: var(--muted);
  line-height: 1.25;
}

.partner-info-row span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.partner-offer-row,
.offer-detail-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.partner-offer-row + .partner-offer-row,
.offer-detail-card + .offer-detail-card {
  margin-top: 12px;
}

.partner-offer-row span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.offer-detail-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.offer-detail-head h3,
.offer-detail-head p {
  margin: 0;
}

.offer-detail-head p {
  margin-top: 4px;
  color: var(--muted);
}

.offer-thread {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: #f7f7f8;
}

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

.message-bubble {
  max-width: 82%;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
}

.message-bubble.own {
  justify-self: end;
  background: var(--accent-soft);
  color: var(--accent);
}

.message-bubble strong,
.message-bubble span,
.message-bubble small {
  display: block;
}

.message-bubble span {
  margin: 4px 0;
  color: var(--ink-soft);
}

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

.mini-request-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.notification-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px 12px;
  width: 100%;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.notification-line small {
  grid-column: 2 / 4;
  color: var(--muted);
  line-height: 1.35;
}

.notification-line em {
  color: var(--accent);
  font-style: normal;
  font-weight: 760;
}

.compact-modal {
  width: min(620px, 100%);
}

.flow-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(20, 20, 22, 0.24);
  backdrop-filter: blur(16px);
}

.flow-modal {
  width: min(820px, 100%);
  max-height: min(860px, calc(100vh - 44px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.flow-header,
.flow-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.flow-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.flow-footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.flow-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  overflow: auto;
  padding: 22px;
}

.flow-grid .full,
.camera-drop.full {
  grid-column: 1 / -1;
}

.camera-drop {
  position: relative;
  min-height: 78px;
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 16px;
  border: 1px dashed rgba(20, 20, 22, 0.2);
  border-radius: 14px;
  background: #f7f7f8;
  color: var(--muted);
  text-align: center;
  font-weight: 720;
}

.camera-drop input,
.file-drop input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-drop {
  position: relative;
  min-height: 84px;
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 16px;
  border: 1px dashed rgba(20, 20, 22, 0.2);
  border-radius: 14px;
  background: #f7f7f8;
  color: var(--muted);
  text-align: center;
  font-weight: 720;
}

.system-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.system-status-grid div {
  padding: 12px;
  border-radius: 12px;
  background: #f7f7f8;
}

.system-status-grid strong,
.system-status-grid small {
  display: block;
}

.system-status-grid small {
  margin-top: 4px;
  color: var(--muted);
}

.review-panel {
  border-color: rgba(217, 0, 27, 0.18);
}

.warning-summary {
  display: grid;
  gap: 16px;
  padding: 22px;
}

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

.warning-summary p {
  color: var(--muted);
  line-height: 1.45;
}

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

.warning-summary dl div {
  padding: 12px;
  border-radius: 12px;
  background: #f6f6f7;
}

.warning-summary dt {
  color: var(--muted);
  font-size: 0.78rem;
}

.warning-summary dd {
  margin: 4px 0 0;
  font-weight: 760;
}

.damage-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.damage-card > svg {
  color: var(--accent);
}

.damage-card h3,
.damage-card p {
  margin: 0 0 6px;
}

.damage-card p {
  color: var(--muted);
}

.damage-status {
  position: relative;
  height: 28px;
  display: flex;
  align-items: center;
  overflow: hidden;
  border-radius: 999px;
  background: #f0f0f2;
}

.damage-status span {
  position: relative;
  z-index: 1;
  padding-left: 10px;
  font-size: 0.78rem;
  font-weight: 760;
}

.damage-status i {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, rgba(223, 0, 31, 0.18), rgba(223, 0, 31, 0.36));
}

@media (max-width: 1180px) {
  .login-shell,
  .portal-shell {
    grid-template-columns: 1fr;
  }

  .portal-sidebar {
    position: relative;
    height: auto;
    max-width: 100vw;
    overflow: hidden;
  }

  .portal-nav {
    display: flex;
    max-width: 100%;
    overflow-x: auto;
  }

  .portal-nav-item {
    flex: 0 0 190px;
  }

  .premium-card {
    display: none;
  }

  .metric-grid.reference,
  .dashboard-grid,
  .split-grid,
  .admin-hero {
    grid-template-columns: 1fr;
  }

  .admin-hero {
    display: grid;
  }

  .admin-stat-grid {
    min-width: 0;
  }
}

@media (max-width: 760px) {
  .login-shell {
    padding: 14px;
  }

  .login-brand-panel {
    min-height: auto;
    gap: 30px;
  }

  .login-feature-grid,
  .metric-grid.reference,
  .empty-module-grid,
  .admin-stat-grid {
    grid-template-columns: 1fr 1fr;
  }

  .portal-main {
    padding-inline: 14px;
  }

  .portal-topbar {
    align-items: flex-start;
    justify-content: stretch;
    padding: 14px 0;
  }

  .topbar-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .account-chip {
    min-width: 0;
  }

  .account-chip div {
    min-width: 0;
  }

  .account-chip strong,
  .account-chip small {
    max-width: 148px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .property-header-card,
  .property-selector,
  .reference-project,
  .manage-card,
  .request-row {
    grid-template-columns: 1fr;
    display: grid;
  }

  .property-cover,
  .project-thumb,
  .manage-image {
    width: 100%;
    height: 190px;
  }

  .dashboard-grid,
  .split-grid,
  .admin-work-board,
  .admin-work-grid,
  .tenant-property-card,
  .project-upload-grid,
  .property-access-grid,
  .upload-choice-menu,
  .project-task-add,
  .project-title-tools,
  .property-doc-upload,
  .delivery-line,
  .form-grid.compact,
  .admin-search-strip,
  .inline-admin-controls,
  .partner-info-row,
  .mini-request-form {
    grid-template-columns: 1fr;
  }

  .flow-grid,
  .warning-summary dl {
    grid-template-columns: 1fr;
  }

  .flow-modal {
    border-radius: 20px;
  }

  .project-actions,
  .offer-actions,
  .decision-row,
  .document-actions {
    flex-direction: column;
  }

  .project-actions > *,
  .offer-actions > *,
  .decision-row > *,
  .document-actions > *,
  .action-bar > *,
  .compact-actions > *,
  .request-actions > *,
  .admin-project-actions > * {
    width: 100%;
    flex-basis: auto;
  }

  .tenant-property-image,
  .tenant-property-image img,
  .tenant-property-image .image-placeholder {
    min-height: 190px;
  }

  .profile-avatar-editor {
    width: 100%;
  }

  .code-share-box {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .auth-card,
  .login-brand-panel,
  .panel,
  .property-header-card,
  .admin-hero {
    border-radius: 20px;
  }

  .role-grid,
  .metric-grid.reference,
  .empty-module-grid,
  .admin-stat-grid {
    grid-template-columns: 1fr;
  }

  .portal-nav {
    display: flex;
  }

  .title-select {
    font-size: 1.45rem;
  }

  .metric-card-ref {
    min-height: 126px;
  }
}
