/*
 * ESNO Workspace vNext — Operations
 * ---------------------------------
 * Feature-specific visual layer for offers, master data, workforce,
 * import/export and administration. Shared shell, controls and dialog
 * primitives live in workspace-vnext-core.css.
 */

/* --------------------------------------------------------------------------
   Offers: editor
   -------------------------------------------------------------------------- */

.app-shell #view-offer {
  gap: 24px;
}

.app-shell #view-offer > .grid.two {
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  gap: 20px;
}

.app-shell #view-offer #offerForm,
.app-shell #view-offer .offer-picker-panel {
  height: fit-content;
}

.app-shell #view-offer #offerForm {
  position: relative;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding-top: 28px;
}

.app-shell #view-offer #offerForm::before {
  content: "Kunde & Angebotsdaten";
  grid-column: 1 / -1;
  margin: -7px 0 2px;
  color: var(--esno-ink);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.015em;
}

.app-shell #view-offer .document-customer-picker {
  display: grid;
  gap: 13px;
  padding: 16px;
  border: 1px solid var(--esno-line);
  border-radius: 12px;
  background: var(--esno-surface-muted);
}

.app-shell #view-offer .document-customer-company-fields,
.app-shell #view-offer .document-customer-fields {
  gap: 11px;
}

.app-shell #view-offer .document-customer-fields {
  grid-template-columns: .72fr .72fr repeat(2, minmax(0, 1fr));
}

.app-shell #view-offer .document-customer-fields label:nth-last-child(-n + 2) {
  grid-column: span 2;
}

.app-shell #view-offer .offer-picker-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.app-shell #view-offer .offer-picker-section {
  margin: 0;
  padding: 15px;
  border: 1px solid var(--esno-line);
  border-radius: 12px;
  background: var(--esno-surface-muted);
}

.app-shell #view-offer .offer-picker-section[data-offer-picker-section="electrical"] {
  border-color: color-mix(in srgb, var(--esno-blue) 30%, var(--esno-line));
  background: var(--esno-blue-soft);
}

.app-shell #view-offer .offer-picker-section-head {
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.app-shell #view-offer .offer-picker-section-title span,
.app-shell #view-offer .section-kicker {
  color: var(--esno-blue);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.app-shell #view-offer .offer-picker-section-title h3 {
  margin-top: 3px;
  font-size: 16px;
}

.app-shell #view-offer .offer-picker-collapse {
  width: 44px;
  min-width: 44px;
  height: 44px;
  border: 1px solid var(--esno-line);
  border-radius: 10px;
  background: var(--esno-surface);
  color: var(--esno-ink);
}

.app-shell #view-offer .offer-picker-control-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 78px auto;
  gap: 9px;
}

.app-shell #view-offer .offer-picker-control-row > input[type="search"] {
  grid-column: 1 / -1;
}

.app-shell #view-offer .offer-picker-control-row > select {
  min-width: 0;
}

.app-shell #view-offer .offer-picker-control-row .icon-text {
  white-space: nowrap;
}

.app-shell #view-offer .totals-box {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 16px 18px;
  border: 0;
  border-radius: 12px;
  background: color-mix(in srgb, var(--esno-yellow) 24%, var(--esno-surface));
  box-shadow: inset 4px 0 0 var(--esno-yellow);
  color: var(--esno-ink);
}

.app-shell #view-offer .totals-box > div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.app-shell #view-offer .totals-box > div:last-child {
  margin-top: 3px;
  padding-top: 9px;
  border-top: 1px solid color-mix(in srgb, var(--esno-warning) 24%, transparent);
  font-size: 17px;
  font-weight: 900;
}

.app-shell #view-offer .summary-project-type {
  padding: 4px 0 0;
  border: 0;
}

.app-shell #view-offer .summary-project-type > legend {
  margin-bottom: 9px;
  color: var(--esno-ink);
  font-size: 14px;
}

.app-shell #view-offer .document-project-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.app-shell #view-offer .document-project-option {
  min-width: 0;
  min-height: 76px;
  padding: 10px;
  border: 1px solid var(--esno-line);
  border-radius: 12px;
  background: var(--esno-surface);
  box-shadow: none;
}

.app-shell #view-offer .document-project-option:hover {
  border-color: var(--esno-blue);
  background: var(--esno-blue-soft);
}

.app-shell #view-offer .document-project-option:has(input:checked) {
  border-color: var(--esno-blue);
  background: var(--esno-blue-soft);
  box-shadow: inset 0 0 0 1px var(--esno-blue);
}

.app-shell #view-offer .document-project-option img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}

.app-shell #view-offer .document-project-subtype {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--esno-line);
  border-radius: 12px;
  background: var(--esno-surface-muted);
}

.app-shell #view-offer .offer-commercial-panel,
.app-shell #view-offer .table-panel {
  margin: 0;
}

.app-shell #view-offer .offer-commercial-panel {
  display: grid;
  gap: 18px;
}

.app-shell #view-offer .combined-offer-fields,
.app-shell #view-offer .offer-subsidy-builder,
.app-shell #view-offer .package-offer-panel {
  padding: 17px;
  border: 1px solid var(--esno-line);
  border-radius: 12px;
  background: var(--esno-surface-muted);
}

.app-shell #view-offer .offer-section-checks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 14px;
}

.app-shell #view-offer .offer-section-checks label {
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--esno-line);
  border-radius: 10px;
  background: var(--esno-surface);
}

.app-shell #view-offer .table-panel > .panel-head {
  position: sticky;
  top: 0;
  z-index: 4;
  padding: 6px 0 15px;
  background: var(--esno-surface);
}

.app-shell #view-offer .table-panel > .panel-head .action-row {
  justify-content: flex-end;
}

.app-shell #view-offer .offer-items-table {
  min-width: 920px;
}

.app-shell #view-offer .offer-item-main-row > td,
.app-shell #view-offer .offer-item-commercial-row > td {
  background: var(--esno-surface);
}

.app-shell #view-offer .offer-item-commercial-row > td {
  padding-top: 0;
}

.app-shell #view-offer .offer-commercial-grid {
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--esno-line);
  border-radius: 10px;
  background: var(--esno-surface-muted);
}

.app-shell #view-offer .offer-description-edit {
  min-height: 92px;
  border-color: var(--esno-control-line);
  border-radius: 10px;
}

.app-shell #view-offer .offer-closing-field {
  margin-top: 16px;
}

/* --------------------------------------------------------------------------
   Offer history and customer records
   -------------------------------------------------------------------------- */

.app-shell #view-offer-history > .panel,
.app-shell #view-customer-history > .grid,
.app-shell #view-article-history > .panel {
  width: 100%;
}

.app-shell #view-offer-history #offerList {
  gap: 8px;
}

.app-shell #view-offer-history .offer-history-status-filter {
  display: grid;
  grid-template-columns: auto minmax(190px, 240px);
  align-items: center;
  gap: 10px;
  min-width: min(100%, 320px);
}

.app-shell #view-offer-history #offerHistorySummary {
  min-height: 22px;
  margin: -5px 0 12px;
  font-size: 13px;
  font-weight: 700;
}

.app-shell #view-offer-history .pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 18px;
}

.app-shell #view-offer-history .pagination .ghost {
  min-width: 44px;
  padding-inline: 12px;
}

.app-shell #view-offer-history .pagination .ghost.active,
.app-shell #view-offer-history .pagination .ghost[aria-current="page"] {
  border-color: var(--esno-primary);
  background: var(--esno-primary);
  color: #fff;
}

.app-shell #view-offer-history .pagination-gap {
  min-width: 24px;
  color: var(--esno-muted);
  text-align: center;
}

.app-shell #view-offer-history .offer-list-item {
  position: relative;
  grid-template-columns: minmax(220px, 1fr) minmax(240px, .9fr);
  min-height: 86px;
  gap: 18px;
  padding: 16px 18px 16px 22px;
  border: 1px solid var(--esno-line);
  border-radius: 12px;
  background: var(--esno-surface);
  box-shadow: none;
}

.app-shell #view-offer-history .offer-list-item::before {
  content: "";
  position: absolute;
  inset: 13px auto 13px 0;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--esno-blue);
}

.app-shell #view-offer-history .offer-list-item:hover {
  border-color: color-mix(in srgb, var(--esno-blue) 36%, var(--esno-line));
  background: var(--surface-hover);
}

.app-shell #view-offer-history .offer-list-item .row-title {
  margin-bottom: 5px;
  color: var(--esno-ink);
  font-size: 15px;
  font-weight: 850;
}

.app-shell #view-offer-history .offer-list-item .action-row {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.app-shell #view-offer-history .offer-list-item .icon-only,
.app-shell #view-customer-history .list-item .icon-only,
.app-shell #view-article-history .catalog-item .icon-only,
.app-shell #view-packages .list-item .icon-only {
  width: 44px;
  min-width: 44px;
  height: 44px;
  border: 1px solid var(--esno-line);
  border-radius: 10px;
  background: var(--esno-surface);
  color: var(--esno-ink);
}

.app-shell #view-customers #customerForm {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(940px, 100%);
}

.app-shell #view-customers #customerForm::before,
.app-shell #view-articles #articleForm::before,
.app-shell #view-packages #packageForm::before {
  grid-column: 1 / -1;
  color: var(--esno-ink);
  font-size: 18px;
  font-weight: 850;
  letter-spacing: -.02em;
}

.app-shell #view-customers #customerForm::before {
  content: "Kundendaten";
}

.app-shell #view-customer-history > .grid.two {
  grid-template-columns: minmax(0, .78fr) minmax(0, 1.22fr);
}

.app-shell #view-customer-history .customer-history-panel {
  max-height: calc(100dvh - 180px);
  overflow: auto;
  scrollbar-gutter: stable;
}

.app-shell #view-customer-history .list-item,
.app-shell #view-packages .list-item {
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--esno-line);
  border-radius: 12px;
  background: var(--esno-surface);
  box-shadow: none;
}

.app-shell #view-customer-history .list-item.selected {
  border-color: var(--esno-blue);
  background: var(--esno-blue-soft);
  box-shadow: inset 4px 0 0 var(--esno-blue);
}

.app-shell #view-customer-history .customer-summary {
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--esno-blue) 30%, var(--esno-line));
  border-radius: 12px;
  background: var(--esno-blue-soft);
}

.app-shell #view-customer-history .customer-documents {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--esno-line);
}

/* --------------------------------------------------------------------------
   Articles and packages
   -------------------------------------------------------------------------- */

.app-shell #view-articles #articleForm {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(1180px, 100%);
}

.app-shell #view-articles #articleForm::before {
  content: "Artikelstammdaten";
}

.app-shell #view-articles .article-climate-fields,
.app-shell #view-articles .article-electrical-fields,
.app-shell #view-articles .article-pv-fields,
.app-shell #view-articles .article-compatibility-field,
.app-shell #view-articles .article-image-paste,
.app-shell #view-articles .rich-field {
  padding: 16px;
  border: 1px solid var(--esno-line);
  border-radius: 12px;
  background: var(--esno-surface-muted);
}

.app-shell #view-articles .article-climate-fields,
.app-shell #view-articles .article-electrical-fields,
.app-shell #view-articles .article-pv-fields {
  gap: 12px;
}

.app-shell #view-articles .article-image-paste {
  min-height: 108px;
  border-style: dashed;
  border-color: var(--esno-control-line);
}

.app-shell #view-articles .article-image-paste:focus,
.app-shell #view-articles .article-image-paste:hover {
  border-color: var(--esno-blue);
  background: var(--esno-blue-soft);
}

.app-shell #view-articles .article-image-preview img {
  width: 112px;
  height: 86px;
  object-fit: contain;
  background: #fff;
}

.app-shell #view-articles .rich-editor {
  overflow: hidden;
  border: 1px solid var(--esno-control-line);
  background: var(--esno-surface);
}

.app-shell #view-articles .rich-toolbar {
  padding: 7px;
  border-bottom: 1px solid var(--esno-line);
  background: var(--esno-surface-muted);
}

.app-shell #view-articles .rich-toolbar button {
  min-width: 38px;
  min-height: 38px;
  border-radius: 8px;
}

.app-shell #view-articles .rich-content {
  min-height: 118px;
  padding: 13px;
}

.app-shell #view-article-history .catalog-category {
  position: sticky;
  top: 0;
  z-index: 2;
  margin-top: 10px;
  padding: 11px 13px;
  border-radius: 9px;
  background: var(--esno-nav);
  color: #fff;
  font-size: 11px;
  letter-spacing: .08em;
}

.app-shell #view-article-history .catalog-item {
  grid-template-columns: 88px minmax(0, 1fr) auto;
  min-height: 94px;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--esno-line);
  border-radius: 12px;
  box-shadow: none;
}

.app-shell #view-article-history .catalog-item > img {
  width: 88px;
  height: 68px;
  padding: 4px;
  object-fit: contain;
  border: 1px solid var(--esno-line);
  border-radius: 9px;
  background: #fff;
}

.app-shell #view-article-history .catalog-item.article-inactive {
  border-style: dashed;
  background: var(--esno-surface-muted);
}

.app-shell #view-article-history .article-title-status {
  margin-bottom: 4px;
}

.app-shell #view-article-history .catalog-pagination {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--esno-line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--esno-surface) 94%, transparent);
  box-shadow: 0 -8px 24px rgb(16 43 56 / 8%);
  backdrop-filter: blur(12px);
}

.app-shell #view-packages > .grid.two {
  grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
}

.app-shell #view-packages #packageForm::before {
  content: "Paket zusammenstellen";
}

.app-shell #view-packages .package-builder {
  padding: 15px;
  border: 1px solid var(--esno-line);
  border-radius: 12px;
  background: var(--esno-surface-muted);
}

.app-shell #view-packages .package-builder .picker-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px auto;
  gap: 8px;
}

.app-shell #view-packages .package-draft-row {
  grid-template-columns: 44px minmax(0, 1fr) 82px 44px;
  min-height: 58px;
  padding: 7px;
  border-radius: 10px;
}

.app-shell #view-packages .drag-handle {
  width: 44px;
  height: 44px;
  border: 1px solid var(--esno-line);
  border-radius: 9px;
  background: var(--esno-surface);
  cursor: grab;
}

.app-shell #view-packages .list-item .row-sub {
  margin-top: 5px;
  line-height: 1.55;
}

/* --------------------------------------------------------------------------
   Workforce
   -------------------------------------------------------------------------- */

.app-shell #view-workforce {
  gap: 18px;
}

.app-shell #view-workforce .workforce-hero {
  align-items: center;
  padding: 24px;
  border: 1px solid var(--esno-line);
  border-radius: 16px;
  background: var(--esno-surface);
  box-shadow: var(--esno-shadow-card);
}

.app-shell #view-workforce .workforce-hero h2 {
  color: var(--esno-ink);
  font-size: clamp(24px, 2.2vw, 34px);
  letter-spacing: -.03em;
}

.app-shell #view-workforce .workforce-employee-switch {
  min-width: 280px;
  padding: 13px;
  border: 1px solid var(--esno-line);
  border-radius: 12px;
  background: var(--esno-surface-muted);
}

.app-shell #view-workforce .workforce-tabs {
  gap: 2px;
  padding: 5px;
  border: 1px solid var(--esno-line);
  border-radius: 12px;
  background: var(--esno-surface);
  box-shadow: 0 5px 16px rgb(16 43 56 / 4%);
}

.app-shell #view-workforce .workforce-tabs button {
  min-height: 44px;
  padding: 0 15px;
  border-radius: 9px;
  color: var(--esno-muted);
}

.app-shell #view-workforce .workforce-tabs button.active {
  background: var(--esno-nav-raised);
  color: #fff;
}

.app-shell #view-workforce .workforce-notifications > div {
  border-color: color-mix(in srgb, var(--esno-yellow) 52%, var(--esno-line));
  background: color-mix(in srgb, var(--esno-yellow) 14%, var(--esno-surface));
}

.app-shell #view-workforce .workforce-timer-card {
  position: relative;
  overflow: hidden;
  padding: 24px;
  border: 1px solid var(--esno-nav-raised);
  border-radius: 16px;
  background: var(--esno-nav);
  box-shadow: 0 18px 38px rgb(16 43 56 / 14%);
}

.app-shell #view-workforce .workforce-timer-card::after {
  content: "";
  position: absolute;
  top: -52px;
  right: -36px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--esno-yellow) 18%, transparent);
  pointer-events: none;
}

.app-shell #view-workforce .workforce-timer-card h3,
.app-shell #view-workforce .workforce-timer-card p,
.app-shell #view-workforce .workforce-timer-card .workforce-eyebrow,
.app-shell #view-workforce .workforce-timer-card label,
.app-shell #view-workforce .workforce-timer-card small {
  color: #fff;
}

.app-shell #view-workforce .workforce-timer-card p,
.app-shell #view-workforce .workforce-timer-card small,
.app-shell #view-workforce .workforce-timer-card label {
  color: rgb(238 247 251 / 72%);
}

.app-shell #view-workforce .workforce-timer-clock {
  position: relative;
  z-index: 1;
  color: #fff;
  font-size: clamp(34px, 4vw, 52px);
  font-variant-numeric: tabular-nums;
  letter-spacing: .025em;
}

.app-shell #view-workforce .workforce-timer-setup input,
.app-shell #view-workforce .workforce-timer-setup select {
  border-color: rgb(255 255 255 / 32%);
  background: rgb(255 255 255 / 9%);
  color: #fff;
}

.app-shell #view-workforce .workforce-timer-types button {
  min-height: 44px;
  border-color: rgb(255 255 255 / 22%);
  background: rgb(255 255 255 / 7%);
  color: rgb(255 255 255 / 78%);
}

.app-shell #view-workforce .workforce-timer-types button:hover {
  border-color: rgb(255 255 255 / 48%);
  color: #fff;
}

.app-shell #view-workforce .workforce-timer-types button.active {
  border-color: var(--esno-yellow);
  background: var(--esno-yellow);
  color: #152630;
  box-shadow: none;
}

.app-shell #view-workforce .workforce-timer-meta span {
  border: 1px solid rgb(255 255 255 / 14%);
  background: rgb(255 255 255 / 7%);
  color: #fff;
}

.app-shell #view-workforce .workforce-timer-actions .primary {
  border-color: var(--esno-yellow);
  background: var(--esno-yellow);
  color: #152630;
  box-shadow: none;
}

.app-shell #view-workforce .workforce-layout {
  grid-template-columns: minmax(0, .72fr) minmax(0, 1.28fr);
  gap: 18px;
}

.app-shell #view-workforce .workforce-entry-form,
.app-shell #view-workforce .workforce-content-card {
  padding: 20px;
  border-radius: 14px;
}

.app-shell #view-workforce .workforce-summary > span,
.app-shell #view-workforce .workforce-balance-cards > span {
  min-height: 92px;
  padding: 15px;
  border: 1px solid var(--esno-line);
  border-radius: 12px;
  background: var(--esno-surface-muted);
}

.app-shell #view-workforce .workforce-summary strong,
.app-shell #view-workforce .workforce-balance-cards strong {
  color: var(--esno-ink);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.app-shell #view-workforce .workforce-table-wrap {
  border-radius: 12px;
}

.app-shell #view-workforce .workforce-request-card,
.app-shell #view-workforce .workforce-document-row {
  padding: 15px;
  border: 1px solid var(--esno-line);
  border-radius: 12px;
  background: var(--esno-surface);
  box-shadow: 0 5px 16px rgb(16 43 56 / 4%);
}

.app-shell #view-workforce .workforce-request-card:hover,
.app-shell #view-workforce .workforce-document-row:hover {
  border-color: color-mix(in srgb, var(--esno-blue) 32%, var(--esno-line));
}

.app-shell #view-workforce .workforce-request-body blockquote {
  border-left-color: var(--esno-yellow);
  background: color-mix(in srgb, var(--esno-yellow) 13%, var(--esno-surface));
}

.app-shell #view-workforce .workforce-audit-filters {
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--esno-line);
  border-radius: 12px;
  background: var(--esno-surface-muted);
}

.app-shell #view-workforce .workforce-audit-row {
  padding: 14px 6px;
}

.app-shell #view-workforce .workforce-audit-dot {
  background: var(--esno-blue);
  box-shadow: 0 0 0 4px var(--esno-blue-soft);
}

/* --------------------------------------------------------------------------
   Import / export
   -------------------------------------------------------------------------- */

.app-shell #view-import {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 18px;
}

.app-shell #view-import .import-panel {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.app-shell #view-import .import-panel:nth-child(n + 3) {
  grid-column: 1 / -1;
}

.app-shell #view-import .panel-head {
  padding-bottom: 15px;
  border-bottom: 1px solid var(--esno-line);
}

.app-shell #view-import .panel-head .action-row {
  justify-content: flex-end;
}

.app-shell #view-import input[type="file"] {
  min-height: 44px;
  max-width: 340px;
  padding: 6px;
  border: 1px dashed var(--esno-control-line);
  border-radius: 10px;
  background: var(--esno-surface-muted);
}

.app-shell #view-import input[type="file"]::file-selector-button {
  min-height: 30px;
  margin-right: 9px;
  border: 0;
  border-radius: 7px;
  background: var(--esno-nav-raised);
  color: #fff;
  font-weight: 800;
}

.app-shell #view-import .import-meta {
  display: flex;
  min-height: 0;
  flex-wrap: wrap;
  gap: 7px;
}

.app-shell #view-import .import-meta:empty {
  display: none;
}

.app-shell #view-import .import-meta .pill {
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid var(--esno-line);
  border-radius: 999px;
  background: var(--esno-surface-muted);
  color: var(--esno-copy);
  font-size: 12px;
  font-weight: 750;
}

.app-shell #view-import .subpanel {
  padding: 18px;
  border: 1px solid var(--esno-line);
  border-radius: 12px;
  background: var(--esno-surface-muted);
}

/* --------------------------------------------------------------------------
   Administration
   -------------------------------------------------------------------------- */

.app-shell #view-admin .admin-panel {
  display: grid;
  gap: 18px;
}

.app-shell #view-admin .admin-panel > .panel-head {
  padding-bottom: 17px;
  border-bottom: 1px solid var(--esno-line);
}

.app-shell #view-admin .admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.app-shell #view-admin .admin-stat {
  min-height: 108px;
  padding: 17px;
  border: 1px solid var(--esno-line);
  border-radius: 12px;
  background: var(--esno-surface-muted);
}

.app-shell #view-admin .admin-stat strong {
  display: block;
  margin-top: 8px;
  color: var(--esno-ink);
  font-size: clamp(24px, 2.2vw, 34px);
  font-variant-numeric: tabular-nums;
}

.app-shell #view-admin .admin-backup-panel,
.app-shell #view-admin .admin-system-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
  align-items: center;
  gap: 24px;
  margin: 0;
  padding: 20px;
  border: 1px solid var(--esno-line);
  border-radius: 14px;
  background: var(--esno-surface-muted);
}

.app-shell #view-admin .admin-system-panel.admin-product-panel {
  border-color: color-mix(in srgb, var(--esno-blue) 30%, var(--esno-line));
  background: var(--esno-blue-soft);
}

.app-shell #view-admin .section-kicker {
  margin-bottom: 5px;
  color: var(--esno-blue);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.app-shell #view-admin .admin-system-copy h3,
.app-shell #view-admin .admin-backup-panel h3 {
  margin: 0 0 7px;
}

.app-shell #view-admin .admin-system-copy p,
.app-shell #view-admin .admin-backup-panel p {
  max-width: 760px;
  margin: 0;
  color: var(--esno-muted);
  line-height: 1.55;
}

.app-shell #view-admin .admin-current-version {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin-top: 13px !important;
  padding: 6px 10px;
  border: 1px solid var(--esno-line);
  border-radius: 9px;
  background: var(--esno-surface);
}

.app-shell #view-admin .admin-current-version strong {
  margin-left: 5px;
  color: var(--esno-ink);
}

.app-shell #view-admin .admin-system-actions {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--esno-line);
  border-radius: 12px;
  background: var(--esno-surface);
}

.app-shell #view-admin .admin-system-actions label {
  display: grid;
  gap: 6px;
}

.app-shell #view-admin .admin-system-actions .action-row,
.app-shell #view-admin .admin-backup-panel .action-row {
  flex-wrap: wrap;
}

.app-shell #view-admin .admin-transfer-progress {
  padding: 12px;
  border: 1px solid var(--esno-line);
  border-radius: 10px;
  background: var(--esno-surface-muted);
}

.app-shell #view-admin .admin-transfer-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--esno-copy);
  font-size: 12px;
  font-weight: 800;
}

.app-shell #view-admin .admin-transfer-progress progress {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: var(--esno-line);
  accent-color: var(--esno-blue);
}

.app-shell #view-admin .admin-palette-danger-actions {
  margin-top: 5px;
  padding-top: 12px;
  border-top: 1px solid var(--esno-line);
}

.app-shell #view-admin .admin-grid,
.app-shell #view-admin .admin-activity-panel {
  margin: 0;
  padding: 20px;
  border: 1px solid var(--esno-line);
  border-radius: 14px;
  background: var(--esno-surface);
}

.app-shell #view-admin .admin-grid {
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
}

.app-shell #view-admin .admin-activity-panel {
  display: grid;
  gap: 17px;
}

.app-shell #view-admin .admin-rights-block {
  padding: 14px;
  border: 1px solid var(--esno-line);
  border-radius: 11px;
  background: var(--esno-surface-muted);
}

.app-shell #view-admin .admin-rights-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 9px;
}

.app-shell #view-admin .admin-right-option {
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid var(--esno-line);
  border-radius: 9px;
  background: var(--esno-surface);
}

/* --------------------------------------------------------------------------
   Feature dialog specifics
   -------------------------------------------------------------------------- */

.app-shell .offer-share-dialog,
.app-shell .offer-approval-dialog,
.app-shell .admin-version-dialog,
.app-shell .admin-backup-dialog,
.app-shell .admin-password-reset-dialog {
  width: min(680px, calc(100vw - 24px));
}

.app-shell .offer-share-dialog form,
.app-shell .offer-approval-dialog form,
.app-shell .admin-version-dialog form,
.app-shell .admin-backup-dialog form,
.app-shell .admin-password-reset-dialog form {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.app-shell .offer-share-hint,
.app-shell .offer-approval-hint,
.app-shell .admin-password-security-note,
.app-shell .admin-password-once-warning,
.app-shell .admin-upload-help {
  margin: 0;
  padding: 13px 14px;
  border: 1px solid var(--esno-line);
  border-radius: 10px;
  background: var(--esno-surface-muted);
  color: var(--esno-copy);
  line-height: 1.5;
}

.app-shell .offer-share-user-list {
  display: grid;
  gap: 8px;
  max-height: min(46dvh, 420px);
  overflow: auto;
  scrollbar-gutter: stable;
}

.app-shell .offer-share-user {
  min-height: 64px;
  padding: 11px 12px;
  border: 1px solid var(--esno-line);
  border-radius: 11px;
  background: var(--esno-surface);
}

.app-shell .offer-share-user:hover,
.app-shell .offer-share-user:has(input:checked) {
  border-color: var(--esno-blue);
  background: var(--esno-blue-soft);
}

.app-shell .offer-share-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--esno-nav-raised);
  color: #fff;
}

.app-shell .admin-password-once-warning,
.app-shell .admin-restore-warning {
  border-color: color-mix(in srgb, var(--esno-warning) 42%, var(--esno-line));
  background: var(--esno-warning-soft);
  color: var(--esno-warning);
}

.app-shell .admin-password-once-value code,
.app-shell .admin-upload-help code {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 4px 7px;
  border: 1px solid var(--esno-line);
  border-radius: 6px;
  background: var(--esno-surface);
  color: var(--esno-ink);
}

/* --------------------------------------------------------------------------
   Responsive behaviour
   -------------------------------------------------------------------------- */

@media (max-width: 1380px) {
  .app-shell #view-offer > .grid.two {
    grid-template-columns: 1fr;
  }

  .app-shell #view-offer .offer-picker-panel {
    order: -1;
  }

  .app-shell #view-offer .document-customer-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .app-shell #view-offer > .grid.two,
  .app-shell #view-customer-history > .grid.two,
  .app-shell #view-packages > .grid.two,
  .app-shell #view-workforce .workforce-layout,
  .app-shell #view-admin .admin-grid {
    grid-template-columns: 1fr;
  }

  .app-shell #view-offer .offer-picker-panel {
    order: -1;
  }

  .app-shell #view-import {
    grid-template-columns: 1fr;
  }

  .app-shell #view-import .import-panel:nth-child(n + 3) {
    grid-column: auto;
  }

  .app-shell #view-admin .admin-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-shell #view-admin .admin-backup-panel,
  .app-shell #view-admin .admin-system-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell #view-offer-history .panel-head,
  .app-shell #view-offer-history .offer-history-status-filter {
    align-items: stretch;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .app-shell #view-offer #offerForm,
  .app-shell #view-customers #customerForm,
  .app-shell #view-articles #articleForm {
    grid-template-columns: 1fr;
  }

  .app-shell #view-offer #offerForm > *,
  .app-shell #view-customers #customerForm > *,
  .app-shell #view-articles #articleForm > * {
    grid-column: 1 / -1;
  }

  .app-shell #view-offer .document-customer-fields,
  .app-shell #view-offer .offer-section-checks,
  .app-shell #view-offer .document-project-options,
  .app-shell #view-workforce .workforce-summary,
  .app-shell #view-workforce .workforce-balance-cards,
  .app-shell #view-workforce .workforce-audit-filters {
    grid-template-columns: 1fr;
  }

  .app-shell #view-offer .document-customer-fields label,
  .app-shell #view-offer .document-customer-fields label:nth-last-child(-n + 2) {
    grid-column: auto;
  }

  .app-shell #view-offer .offer-picker-control-row,
  .app-shell #view-packages .package-builder .picker-row {
    grid-template-columns: minmax(0, 1fr) 84px;
  }

  .app-shell #view-offer .offer-picker-control-row > input[type="search"],
  .app-shell #view-offer .offer-picker-control-row > button,
  .app-shell #view-packages .package-builder .picker-row > button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .app-shell #view-offer .table-panel > .panel-head {
    position: static;
  }

  .app-shell #view-offer-history .offer-list-item,
  .app-shell #view-article-history .catalog-item {
    grid-template-columns: 1fr;
  }

  .app-shell #view-offer-history .offer-list-item .action-row,
  .app-shell #view-customer-history .list-item .action-row,
  .app-shell #view-article-history .catalog-item .action-row,
  .app-shell #view-packages .list-item .action-row {
    justify-content: flex-start;
  }

  .app-shell #view-article-history .catalog-item > img {
    width: 118px;
    height: 88px;
  }

  .app-shell #view-article-history .catalog-pagination {
    position: static;
    flex-wrap: wrap;
  }

  .app-shell #view-workforce .workforce-hero,
  .app-shell #view-workforce .workforce-timer-heading,
  .app-shell #view-workforce .workforce-panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .app-shell #view-workforce .workforce-employee-switch {
    min-width: 0;
    width: 100%;
  }

  .app-shell #view-workforce .workforce-timer-setup,
  .app-shell #view-workforce .workforce-form-row,
  .app-shell #view-workforce .workforce-date-filter {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .app-shell #view-import .panel-head,
  .app-shell #view-admin .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .app-shell #view-import .panel-head .action-row,
  .app-shell #view-import .action-row.end {
    justify-content: flex-start;
  }

  .app-shell #view-import input[type="file"] {
    width: 100%;
    max-width: none;
  }

  .app-shell #view-admin .admin-stats,
  .app-shell #view-admin .admin-rights-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .app-shell #view-offer .offer-picker-panel,
  .app-shell #view-offer .offer-commercial-panel,
  .app-shell #view-offer .table-panel,
  .app-shell #view-workforce .workforce-timer-card,
  .app-shell #view-workforce .workforce-entry-form,
  .app-shell #view-workforce .workforce-content-card,
  .app-shell #view-import .import-panel,
  .app-shell #view-admin .admin-panel {
    padding: 14px;
  }

  .app-shell #view-offer .offer-picker-section,
  .app-shell #view-offer .combined-offer-fields,
  .app-shell #view-offer .offer-subsidy-builder,
  .app-shell #view-admin .admin-backup-panel,
  .app-shell #view-admin .admin-system-panel,
  .app-shell #view-admin .admin-grid,
  .app-shell #view-admin .admin-activity-panel {
    padding: 14px;
  }

  .app-shell #view-offer .offer-picker-section-head,
  .app-shell #view-offer .panel-head,
  .app-shell #view-customer-history .list-item,
  .app-shell #view-packages .list-item {
    align-items: stretch;
    flex-direction: column;
  }

  .app-shell #view-workforce .workforce-timer-clock {
    min-width: 0;
    text-align: left;
  }

  .app-shell #view-workforce .workforce-timer-types button,
  .app-shell #view-workforce .workforce-timer-actions button {
    flex: 1 1 calc(50% - 5px);
  }

  .app-shell #view-workforce .workforce-request-card,
  .app-shell #view-workforce .workforce-document-row {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .app-shell #view-workforce .workforce-request-actions,
  .app-shell #view-workforce .workforce-document-row > button {
    grid-column: 1 / -1;
  }

  .app-shell #view-packages .package-draft-row {
    grid-template-columns: 44px minmax(0, 1fr) 70px;
  }

  .app-shell #view-packages .package-draft-row > :last-child {
    grid-column: 1 / -1;
    width: 100%;
  }

  .app-shell .offer-share-dialog form,
  .app-shell .offer-approval-dialog form,
  .app-shell .admin-version-dialog form,
  .app-shell .admin-backup-dialog form,
  .app-shell .admin-password-reset-dialog form {
    padding: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-shell #view-offer .table-panel > .panel-head,
  .app-shell #view-article-history .catalog-pagination {
    scroll-behavior: auto;
  }
}
