.entity-card {
  width: 100%;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  text-align: left;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 20px;
  padding: 14px;
  color: var(--text);
}
.entity-card:active {
  transform: scale(0.995);
}
.entity-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
}
.entity-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.entity-copy strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.entity-copy small,
.entity-value small {
  color: var(--muted);
}
.entity-value {
  text-align: right;
  display: grid;
  gap: 2px;
}
.chevron {
  color: var(--muted);
}
.badge {
  font-size: 0.72rem;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}
.hero-card {
  background: linear-gradient(
    145deg,
    var(--color-brand-700),
    var(--color-brand-highlight)
  );
  color: #fff;
  border-radius: 24px;
  padding: 22px;
}
.hero-card h2 {
  margin: 8px 0 5px;
}
.hero-card p {
  margin: 0 0 14px;
}
.hero-card .metric {
  background: color-mix(in srgb, white 12%, transparent);
  border-color: color-mix(in srgb, white 24%, transparent);
}
.hero-card .metric span {
  color: color-mix(in srgb, white 84%, transparent);
}
.metric {
  padding: 16px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: grid;
  gap: 7px;
}
.metric span {
  font-size: 0.82rem;
  color: var(--muted);
}
.metric strong {
  font-size: 1.16rem;
  justify-self: end;
  text-align: right;
}
.eyebrow {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-weight: 780;
}
.hero-card .eyebrow {
  color: #fff;
}
.summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 17px 2px;
  border-bottom: 1px solid var(--border);
}
.summary-line strong {
  text-align: right;
}
.computed {
  display: flex;
  justify-content: space-between;
  padding: 15px;
  border-radius: 15px;
  background: var(--accent-soft);
}

.hero-card .metric {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}
.hero-card .metric span {
  text-align: left;
}
.hero-card .metric strong {
  justify-self: end;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Stacked monetary cards keep long names readable and preserve right alignment. */
.entity-card-stacked {
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
}

.entity-card-body {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
  align-items: baseline;
}

.entity-card-title {
  grid-column: 1 / -1;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.entity-card-amount {
  grid-column: 1 / -1;
  justify-self: end;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.entity-card-meta {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
}

.entity-card-meta small:last-child {
  margin-left: auto;
  text-align: right;
}

/* Project dashboard card: full title and localized modification date. */
.project-card {
  grid-template-columns: 44px minmax(0, 1fr) auto auto;
  align-items: center;
}
.project-card-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.project-card-name {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.2;
}
.project-card-main small,
.project-card-value small {
  color: var(--muted);
}
.project-card-date {
  font-size: 0.76rem;
}
.project-card-value {
  align-self: center;
}
@media (max-width: 390px) {
  .project-card {
    grid-template-columns: 44px minmax(0, 1fr) auto;
  }
  .project-card .chevron {
    display: none;
  }
}

/* Progressive selection */
.selection-row{width:100%;display:flex;align-items:center;gap:12px;padding:14px;border:1px solid var(--border);border-radius:14px;background:var(--surface);text-align:left;font:inherit;color:inherit}
.selection-row.selected{border-color:var(--accent);background:color-mix(in srgb,var(--accent) 10%,var(--surface))}
.selection-box{width:24px;height:24px;border:1.5px solid var(--muted);border-radius:7px;display:grid;place-items:center;font-weight:800;flex:0 0 auto}
.selection-row.selected .selection-box{background:var(--accent);border-color:var(--accent);color:white}
.compact-empty{padding:18px;margin:0}
.selected-task-row{padding:13px 14px;border:1px solid var(--border);border-radius:12px;background:var(--surface)}

/* Inspection First narrative */
.inspection-status {
  font-weight: 700;
  color: var(--accent);
}
.inspection-dock {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Inspection continuity and hierarchy polish */
.inspection-hero-status{display:grid;gap:5px;margin:0 0 14px}
.inspection-hero-status strong{font-size:1.28rem;line-height:1.15;text-transform:uppercase;letter-spacing:.035em}
.inspection-hero-status span{font-size:.8rem;color:color-mix(in srgb,#fff 82%,transparent)}
.work-row-title{display:flex;align-items:center;gap:8px;min-width:0}
.work-trash-btn{width:34px;height:34px;display:grid;place-items:center;border:0;border-radius:10px;background:transparent;color:var(--danger);padding:7px;flex:0 0 auto}
.work-trash-btn:active{background:color-mix(in srgb,var(--danger) 12%,transparent)}
.work-trash-btn svg{width:19px;height:19px}

/* Reusable swipe-to-delete cards. */
.swipe-row {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  touch-action: pan-y;
}
.swipe-row .swipe-card {
  position: relative;
  z-index: 2;
  will-change: transform;
  transition: transform 220ms cubic-bezier(.22,.75,.24,1);
}
.swipe-delete {
  position: absolute;
  inset: 0 0 0 auto;
  margin-left: 10px;
  z-index: 1;
  width: 84px;
  border: 0;
  border-radius: 16px;
  background: var(--danger, #c52a24);
  color: #fff;
  display: grid;
  place-content: center;
  gap: 4px;
  font-weight: 750;
}
.swipe-delete svg {
  width: 22px;
  height: 22px;
  margin-inline: auto;
}
.swipe-delete small { color: inherit; font-size: .72rem; }
.inline-add-building {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 18px;
}
.inline-add-building svg { width: 22px; height: 22px; }

/* Clear contextual and in-sheet add actions. */
.inline-add-building.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 22%, transparent);
}
.inline-add-building.primary:active {
  background: color-mix(in srgb, var(--accent) 88%, #000);
  transform: translateY(1px);
}

.sheet-add-action {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--border));
  border-radius: 15px;
  background: var(--accent-soft);
  color: var(--accent);
  font: inherit;
  font-weight: 760;
  padding: 12px 16px;
}
.sheet-add-action svg { width: 20px; height: 20px; }
.sheet-add-action:active {
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
  transform: translateY(1px);
}

.selected-task-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 10px;
  align-items: center;
}
.selected-task-row > span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.task-trash-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 11px;
  background: var(--danger-soft);
  color: var(--danger);
  padding: 9px;
}
.task-trash-btn svg { width: 19px; height: 19px; }
.task-trash-btn:active {
  background: color-mix(in srgb, var(--danger) 18%, var(--danger-soft));
}

/* Destructive swipe action uses the same soft language as dialogs and sheets. */
.swipe-delete {
  background: var(--danger-soft);
  color: var(--danger);
}
.swipe-delete:active {
  background: color-mix(in srgb, var(--danger) 18%, var(--danger-soft));
}
