/* PTW-specific additions layered on top of the shared SWI design tokens. */

.ptw-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.ptw-toolbar__spacer {
  flex: 1;
}

.ptw-search {
  min-width: 220px;
  max-width: 320px;
}

/* ----- Overview dashboard ----- */

.ptw-overview-page {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
  max-width: none;
}

.ptw-overview-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.9fr);
  gap: 1.25rem;
  padding: 1.5rem 1.65rem;
  border-radius: 14px;
  border: 1px solid var(--swi-border);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--swi-accent) 12%, transparent), transparent 55%),
    var(--swi-surface);
  box-shadow: var(--swi-shadow-sm);
}

.ptw-overview-hero__eyebrow {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--swi-text-secondary);
  margin-bottom: 0.35rem;
}

.ptw-overview-hero__title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 700;
  color: var(--swi-text);
  line-height: 1.2;
}

.ptw-overview-hero__lead {
  margin: 0 0 1.1rem;
  max-width: 52ch;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--swi-text-secondary);
}

.ptw-overview-hero__cta {
  min-width: 10rem;
}

.ptw-overview-hero__active {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 1.1rem 1.2rem;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--swi-accent) 35%, var(--swi-border));
  background: var(--swi-surface-muted);
}

.ptw-overview-hero__active--empty p {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--swi-text-secondary);
}

.ptw-overview-hero__active-badge {
  align-self: flex-start;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--swi-accent) 18%, transparent);
  color: var(--swi-accent);
}

.ptw-overview-hero__active strong {
  font-size: 1.05rem;
  color: var(--swi-text);
}

.ptw-overview-hero__active-meta {
  font-size: 0.8125rem;
  color: var(--swi-text-secondary);
}

.ptw-overview-hero__active-actions {
  margin-top: 0.35rem;
}

.ptw-overview-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.ptw-overview-stat {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1.15rem 1.2rem;
  border-radius: 12px;
  border: 1px solid var(--swi-border);
  background: var(--swi-surface);
  box-shadow: var(--swi-shadow-sm);
  border-top-width: 3px;
}

.ptw-overview-stat.is-loading .ptw-overview-stat__value {
  opacity: 0.45;
}

.ptw-overview-stat--users { border-top-color: #4a7fd4; }
.ptw-overview-stat--forms { border-top-color: #7c5cbf; }
.ptw-overview-stat--permits { border-top-color: #2d9d6b; }
.ptw-overview-stat--tickets { border-top-color: #d4a017; }

.ptw-overview-stat__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  flex-shrink: 0;
  background: var(--swi-surface-muted);
  color: var(--swi-accent);
}

.ptw-overview-stat--users .ptw-overview-stat__icon { color: #4a7fd4; }
.ptw-overview-stat--forms .ptw-overview-stat__icon { color: #7c5cbf; }
.ptw-overview-stat--permits .ptw-overview-stat__icon { color: #2d9d6b; }
.ptw-overview-stat--tickets .ptw-overview-stat__icon { color: #d4a017; }

.ptw-overview-stat__body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.ptw-overview-stat__value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--swi-text);
}

.ptw-overview-stat__label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--swi-text);
}

.ptw-overview-stat__hint {
  font-size: 0.75rem;
  color: var(--swi-text-secondary);
  line-height: 1.35;
}

.ptw-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  gap: 1.25rem;
  align-items: start;
}

.ptw-overview-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 22rem;
}

.ptw-overview-panel .ptw-panel__title {
  flex-shrink: 0;
}

.ptw-overview-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  flex: 1;
}

.ptw-overview-action {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  flex: 1;
  min-height: 4.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--swi-border);
  border-radius: 10px;
  background: var(--swi-surface-muted);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.ptw-overview-action:hover,
.ptw-overview-action:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--swi-accent) 45%, var(--swi-border));
  background: color-mix(in srgb, var(--swi-accent) 6%, var(--swi-surface-muted));
}

.ptw-overview-action--primary {
  border-color: color-mix(in srgb, var(--swi-accent) 40%, var(--swi-border));
  background: color-mix(in srgb, var(--swi-accent) 10%, var(--swi-surface));
}

.ptw-overview-action__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 8px;
  background: var(--swi-surface);
  color: var(--swi-accent);
  border: 1px solid var(--swi-border);
}

.ptw-overview-action__text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.ptw-overview-action__text strong {
  font-size: 0.875rem;
  color: var(--swi-text);
}

.ptw-overview-action__text span {
  font-size: 0.75rem;
  color: var(--swi-text-secondary);
  line-height: 1.35;
}

.ptw-overview-action__arrow {
  color: var(--swi-text-secondary);
  opacity: 0.7;
}

.ptw-overview-recent {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.ptw-overview-recent__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--swi-border);
  border-radius: 10px;
  background: var(--swi-surface-muted);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.ptw-overview-recent__item:hover,
.ptw-overview-recent__item:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--swi-accent) 40%, var(--swi-border));
  background: color-mix(in srgb, var(--swi-accent) 5%, var(--swi-surface-muted));
}

.ptw-overview-recent__main {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.ptw-overview-recent__main strong {
  font-size: 0.875rem;
  color: var(--swi-text);
}

.ptw-overview-recent__main span {
  font-size: 0.75rem;
  color: var(--swi-text-secondary);
}

.ptw-overview-recent__empty {
  margin: 0;
  padding: 1.5rem 0.5rem;
  text-align: center;
  line-height: 1.5;
}

.ptw-overview-badge {
  flex-shrink: 0;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}

.ptw-overview-badge--active {
  background: color-mix(in srgb, #2d9d6b 18%, transparent);
  color: #1f7a52;
}

.ptw-overview-badge--expired {
  background: color-mix(in srgb, #c0392b 14%, transparent);
  color: #a93226;
}

.ptw-overview-badge--draft {
  background: var(--swi-surface);
  color: var(--swi-text-secondary);
  border: 1px solid var(--swi-border);
}

.ptw-overview-workflow__steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.ptw-overview-workflow__steps li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px dashed var(--swi-border);
  background: var(--swi-surface-muted);
}

.ptw-overview-workflow__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 700;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--swi-accent) 15%, transparent);
  color: var(--swi-accent);
}

.ptw-overview-workflow__steps li > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.ptw-overview-workflow__steps strong {
  font-size: 0.875rem;
  color: var(--swi-text);
}

.ptw-overview-workflow__steps li span span {
  font-size: 0.75rem;
  color: var(--swi-text-secondary);
  line-height: 1.4;
}

@media (max-width: 1100px) {
  .ptw-overview-hero {
    grid-template-columns: 1fr;
  }

  .ptw-overview-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ptw-overview-grid {
    grid-template-columns: 1fr;
  }

  .ptw-overview-workflow__steps {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .ptw-overview-stats {
    grid-template-columns: 1fr;
  }

  .ptw-overview-hero {
    padding: 1.15rem 1.2rem;
  }
}

/* Dashboard charts & analytics */
.ptw-overview-hero--compact {
  padding: 1.1rem 1.25rem;
}

.ptw-overview-hero--compact .ptw-overview-hero__title {
  font-size: 1.35rem;
}

.ptw-dash-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--swi-border);
  border-radius: 12px;
  background: var(--swi-surface);
}

.ptw-dash-filters__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 12rem;
}

.ptw-dash-filters__label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--swi-text-secondary);
}

.ptw-dash-filters__select {
  min-height: 2.5rem;
}

.ptw-dash-filters__hint {
  margin: 0;
  font-size: 0.88rem;
  color: var(--swi-text-secondary);
}

.ptw-permit-cards-section {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.ptw-permit-cards-section__head {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.ptw-permit-cards-section__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.ptw-permit-cards-section__desc {
  margin: 0;
  font-size: 0.88rem;
  color: var(--swi-text-secondary);
}

.ptw-permit-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 1rem;
  align-items: stretch;
}

.ptw-permit-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1rem 1.05rem 1.05rem;
  border: 1px solid var(--swi-border);
  border-radius: 14px;
  background: var(--swi-surface);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--swi-text) 4%, transparent);
  border-top: 3px solid var(--swi-border);
  min-height: 9.25rem;
  height: 100%;
  font: inherit;
  text-align: left;
  width: 100%;
}

.ptw-permit-card--clickable {
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.ptw-permit-card--clickable:hover:not(:disabled),
.ptw-permit-card--clickable:focus-visible:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--swi-text) 10%, transparent);
}

.ptw-permit-card--clickable:focus-visible {
  outline: 2px solid var(--portal-accent);
  outline-offset: 2px;
}

.ptw-permit-card--clickable:disabled {
  cursor: default;
}

.ptw-permit-card.is-loading .ptw-permit-card__value {
  opacity: 0.45;
}

.ptw-permit-card--mine { border-top-color: #4a7fd4; }
.ptw-permit-card--location { border-top-color: #7c5cbf; }
.ptw-permit-card--active { border-top-color: #2d9d6b; }
.ptw-permit-card--closed { border-top-color: #c0392b; }

.ptw-permit-card__index {
  position: absolute;
  top: 0.65rem;
  right: 0.75rem;
  width: 1.35rem;
  height: 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--swi-surface-muted) 85%, transparent);
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--swi-text-secondary);
}

.ptw-permit-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.55rem;
  height: 2.55rem;
  border-radius: 11px;
  background: color-mix(in srgb, var(--swi-surface-muted) 80%, transparent);
}

.ptw-permit-card--mine .ptw-permit-card__icon { color: #4a7fd4; }
.ptw-permit-card--location .ptw-permit-card__icon { color: #7c5cbf; }
.ptw-permit-card--active .ptw-permit-card__icon { color: #2d9d6b; }
.ptw-permit-card--closed .ptw-permit-card__icon { color: #c0392b; }

.ptw-permit-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  margin-top: auto;
}

.ptw-permit-card__value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  color: var(--swi-text);
}

.ptw-permit-card__label {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--swi-text);
  line-height: 1.3;
  min-height: 2.6em;
}

.ptw-permit-card__hint {
  font-size: 0.76rem;
  color: var(--swi-text-secondary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.ptw-dash-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.ptw-dash-stat {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 1rem 1.05rem;
  border: 1px solid var(--swi-border);
  border-radius: 12px;
  background: var(--swi-surface);
  border-top: 3px solid var(--swi-border);
}

.ptw-dash-stat.is-loading .ptw-dash-stat__value {
  opacity: 0.45;
}

.ptw-dash-stat--mine { border-top-color: #4a7fd4; }
.ptw-dash-stat--location { border-top-color: #7c5cbf; }
.ptw-dash-stat--active { border-top-color: #2d9d6b; }
.ptw-dash-stat--closed { border-top-color: #c0392b; }

.ptw-dash-stat__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  background: color-mix(in srgb, var(--swi-surface-muted) 80%, transparent);
  flex-shrink: 0;
}

.ptw-dash-stat--mine .ptw-dash-stat__icon { color: #4a7fd4; }
.ptw-dash-stat--location .ptw-dash-stat__icon { color: #7c5cbf; }
.ptw-dash-stat--active .ptw-dash-stat__icon { color: #2d9d6b; }
.ptw-dash-stat--closed .ptw-dash-stat__icon { color: #c0392b; }

.ptw-dash-stat__body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.ptw-dash-stat__value {
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--swi-text);
}

.ptw-dash-stat__label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--swi-text);
}

.ptw-dash-stat__hint {
  font-size: 0.78rem;
  color: var(--swi-text-secondary);
}

.ptw-dash-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ptw-dash-section__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.ptw-dash-charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.ptw-dash-charts-grid > * {
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.ptw-dash-bottom-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.ptw-dash-bottom-grid > * {
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.ptw-dash-chart,
.ptw-dash-trend {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  height: 100%;
  min-height: 22rem;
}

.ptw-dash-chart__head,
.ptw-dash-trend__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.ptw-dash-trend__eyebrow {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--swi-text-secondary);
}

.ptw-dash-trend__head-actions {
  display: flex;
  align-items: flex-end;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-left: auto;
}

.ptw-dash-trend__filter {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 10.5rem;
}

.ptw-dash-trend__filter-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--swi-text-secondary);
}

.ptw-dash-trend__filter-select {
  min-height: 2.35rem;
  font-size: 0.88rem;
}

.ptw-dash-chart__title,
.ptw-dash-trend__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.ptw-dash-chart__desc,
.ptw-dash-trend__desc {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: var(--swi-text-secondary);
}

.ptw-dash-chart__metric,
.ptw-dash-trend__metric {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
  flex-shrink: 0;
}

.ptw-dash-chart__metric strong,
.ptw-dash-trend__metric strong {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
}

.ptw-dash-chart__metric span,
.ptw-dash-trend__metric span {
  font-size: 0.75rem;
  color: var(--swi-text-secondary);
}

.ptw-dash-chart__empty {
  margin: 0;
  padding: 1rem 0;
}

.ptw-dash-chart .ptw-dash-chart__empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 12rem;
}

.ptw-dash-chart--clickable {
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.ptw-dash-chart--clickable:hover,
.ptw-dash-chart--clickable:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--swi-text) 8%, transparent);
  border-color: color-mix(in srgb, var(--portal-accent) 25%, var(--swi-border));
  outline: none;
}

.ptw-dash-chart--clickable:focus-visible {
  outline: 2px solid var(--portal-accent);
  outline-offset: 2px;
}

.ptw-dash-chart__empty-action {
  display: block;
  width: 100%;
  margin: 0;
  padding: 1rem 0;
  border: none;
  background: transparent;
  font: inherit;
  text-align: center;
  cursor: pointer;
}

.ptw-dash-chart .ptw-dash-chart__empty-action {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 12rem;
}

.ptw-dash-chart__empty-action:hover {
  color: var(--portal-accent);
}

.ptw-dash-chart__bar-hit {
  cursor: pointer;
}

.ptw-dash-chart__bar-hit:focus-visible {
  outline: 2px solid var(--portal-accent);
  outline-offset: 1px;
}

.ptw-dash-chart__canvas-wrap {
  width: 100%;
  flex: 1;
  min-height: 260px;
  display: flex;
  align-items: center;
  overflow-x: auto;
}

.ptw-dash-chart__svg {
  display: block;
  width: 100%;
  height: auto;
}

.ptw-dash-chart__grid-line {
  stroke: var(--swi-border);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.ptw-dash-chart__y-label,
.ptw-dash-chart__x-label,
.ptw-dash-chart__value-label {
  fill: var(--swi-text-secondary);
  font-size: 11px;
}

.ptw-dash-chart__value-label {
  fill: var(--swi-text);
  font-weight: 700;
}

.ptw-dash-trend__chart-wrap {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 0.5rem;
  min-height: 220px;
}

.ptw-dash-trend__y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0.25rem 0 2.2rem;
  font-size: 0.72rem;
  color: var(--swi-text-secondary);
}

.ptw-dash-trend__chart {
  display: flex;
  align-items: flex-end;
  gap: 0.35rem;
  min-height: 200px;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--swi-border);
  position: relative;
}

.ptw-dash-trend__col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  height: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  position: relative;
}

.ptw-dash-trend__col.is-active .ptw-dash-trend__bar {
  opacity: 1;
  filter: brightness(1.05);
}

.ptw-dash-trend__bar-track {
  width: 100%;
  max-width: 3rem;
  height: 160px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.ptw-dash-trend__bar {
  width: 72%;
  min-height: 2px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #e85d6b 0%, var(--portal-accent, #c41e2d) 100%);
  transition: height 0.25s ease, opacity 0.2s ease;
}

.ptw-dash-trend__x-label {
  font-size: 0.68rem;
  color: var(--swi-text-secondary);
  text-align: center;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ptw-dash-trend__count {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--swi-text);
  min-height: 1rem;
}

.ptw-dash-trend__tooltip {
  position: absolute;
  bottom: calc(100% + 0.35rem);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  background: var(--swi-text);
  color: var(--swi-surface);
  font-size: 0.72rem;
  white-space: nowrap;
  z-index: 2;
  pointer-events: none;
}

.ptw-dash-trend__tooltip strong {
  font-size: 0.95rem;
}

.ptw-dash-trend--wave .ptw-dash-trend__chart-wrap,
.ptw-dash-trend--wave .ptw-dash-trend__chart,
.ptw-dash-trend--wave .ptw-dash-trend__col,
.ptw-dash-trend--wave .ptw-dash-trend__bar-track,
.ptw-dash-trend--wave .ptw-dash-trend__bar {
  display: none;
}

.ptw-dash-wave__canvas-wrap {
  position: relative;
  width: 100%;
  min-height: 280px;
  overflow-x: auto;
}

.ptw-dash-wave__svg {
  display: block;
  width: 100%;
  height: auto;
}

.ptw-dash-wave__area {
  transition: opacity 0.25s ease;
}

.ptw-dash-wave__line {
  filter: drop-shadow(0 2px 6px color-mix(in srgb, var(--portal-accent, #c41e2d) 25%, transparent));
}

.ptw-dash-wave__dot {
  fill: var(--swi-surface, #fff);
  stroke: var(--portal-accent, #c41e2d);
  stroke-width: 2;
  transition: r 0.15s ease, stroke-width 0.15s ease;
}

.ptw-dash-wave__dot.is-active {
  stroke-width: 2.5;
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--portal-accent, #c41e2d) 40%, transparent));
}

.ptw-dash-wave__hit {
  cursor: crosshair;
}

.ptw-dash-wave__tooltip-bg {
  fill: var(--swi-text, #1a1a1a);
  opacity: 0.92;
}

.ptw-dash-wave__tooltip-value {
  fill: var(--swi-surface, #fff);
  font-size: 13px;
  font-weight: 700;
}

.ptw-dash-wave__tooltip-label {
  fill: color-mix(in srgb, var(--swi-surface, #fff) 75%, transparent);
  font-size: 10px;
}

.ptw-dash-wave__empty-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  pointer-events: none;
}

.ptw-overview-hero__active--clickable {
  cursor: pointer;
  text-align: left;
  font: inherit;
  width: 100%;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.ptw-overview-hero__active--clickable:hover,
.ptw-overview-hero__active--clickable:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--swi-text) 8%, transparent);
  border-color: color-mix(in srgb, var(--portal-accent) 30%, var(--swi-border));
  outline: none;
}

.ptw-overview-hero__active--clickable:focus-visible {
  outline: 2px solid var(--portal-accent);
  outline-offset: 2px;
}

.ptw-dash-activity {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 22rem;
}

.ptw-dash-activity__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex-shrink: 0;
}

.ptw-dash-activity__head .ptw-panel__title {
  margin-bottom: 0;
}

.ptw-dash-activity__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.ptw-dash-activity > .ptw-muted {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  min-height: 12rem;
}

.ptw-dash-activity__view-all {
  flex-shrink: 0;
}

.ptw-dash-activity__empty-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  flex: 1;
  margin: 0;
  padding: 0.75rem 0;
  border: none;
  background: transparent;
  font: inherit;
  text-align: center;
  cursor: pointer;
  min-height: 12rem;
}

.ptw-dash-activity__empty-action:hover {
  color: var(--portal-accent);
}

.ptw-permits-filter-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid color-mix(in srgb, var(--portal-accent) 25%, var(--swi-border));
  border-radius: 10px;
  background: color-mix(in srgb, var(--portal-accent) 6%, var(--swi-surface));
  font-size: 0.9rem;
}

.ptw-permits-filters {
  margin-bottom: 1rem;
}

.ptw-permits-filters__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.ptw-permits-filters__head .ptw-panel__title {
  margin: 0;
}

.ptw-permits-filters__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.85rem 1rem;
}

.ptw-permits-filters__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.ptw-permits-filters__label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--swi-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ptw-permits-filters__summary {
  margin: 0.85rem 0 0;
  font-size: 0.85rem;
  color: var(--swi-text-secondary);
}

.ptw-dash-activity__item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--swi-border);
  border-radius: 10px;
  background: var(--swi-surface);
  text-align: left;
  cursor: pointer;
}

.ptw-dash-activity__item:hover,
.ptw-dash-activity__item:focus-visible {
  border-color: color-mix(in srgb, var(--portal-accent) 35%, var(--swi-border));
  background: color-mix(in srgb, var(--portal-accent) 4%, var(--swi-surface));
}

.ptw-dash-activity__main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.ptw-dash-activity__main strong {
  font-size: 0.92rem;
}

.ptw-dash-activity__main span {
  font-size: 0.78rem;
  color: var(--swi-text-secondary);
}

.ptw-overview-badge--closed {
  background: color-mix(in srgb, #c0392b 12%, transparent);
  color: #c0392b;
}

@media (max-width: 1100px) {
  .ptw-permit-cards-grid,
  .ptw-dash-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ptw-dash-charts-grid,
  .ptw-dash-bottom-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .ptw-permit-cards-grid,
  .ptw-dash-cards {
    grid-template-columns: 1fr;
  }
}

/* Permits & Submissions â€” master-detail workspace */
.ptw-permits-page {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.ptw-permits-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.ptw-permits-stat {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.05rem 1.05rem;
  border: 1px solid var(--swi-border);
  border-radius: 14px;
  background: var(--swi-surface);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--swi-text) 4%, transparent);
  border-top-width: 3px;
  border-top-color: var(--swi-border);
  overflow: hidden;
}

.ptw-permits-stat__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 10px;
  margin-bottom: 0.15rem;
  background: var(--swi-surface-muted);
  color: var(--swi-text-secondary);
}

.ptw-permits-stat__value {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--swi-text);
}

.ptw-permits-stat__label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--swi-text-secondary);
}

.ptw-permits-stat--total {
  border-top-color: #4a7fd4;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, #4a7fd4 10%, var(--swi-surface)) 0%,
    var(--swi-surface) 72%
  );
}

.ptw-permits-stat--total .ptw-permits-stat__icon {
  background: color-mix(in srgb, #4a7fd4 14%, var(--swi-surface));
  color: #4a7fd4;
}

.ptw-permits-stat--total .ptw-permits-stat__value {
  color: #2f5f9e;
}

.ptw-permits-stat--draft {
  border-top-color: #94a3b8;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, #94a3b8 12%, var(--swi-surface)) 0%,
    var(--swi-surface) 72%
  );
}

.ptw-permits-stat--draft .ptw-permits-stat__icon {
  background: color-mix(in srgb, #94a3b8 16%, var(--swi-surface));
  color: #64748b;
}

.ptw-permits-stat--draft .ptw-permits-stat__value {
  color: #475569;
}

.ptw-permits-stat--active {
  border-top-color: #2d9d6b;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, #2d9d6b 12%, var(--swi-surface)) 0%,
    var(--swi-surface) 72%
  );
}

.ptw-permits-stat--active .ptw-permits-stat__icon {
  background: color-mix(in srgb, #2d9d6b 16%, var(--swi-surface));
  color: #2d9d6b;
}

.ptw-permits-stat--active .ptw-permits-stat__value {
  color: #1a6b38;
}

.ptw-permits-stat--closed {
  border-top-color: #c0392b;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, #c0392b 10%, var(--swi-surface)) 0%,
    var(--swi-surface) 72%
  );
}

.ptw-permits-stat--closed .ptw-permits-stat__icon {
  background: color-mix(in srgb, #c0392b 14%, var(--swi-surface));
  color: #c0392b;
}

.ptw-permits-stat--closed .ptw-permits-stat__value {
  color: #a93226;
}

.ptw-permits-shell {
  display: block;
}

.ptw-permits-list__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.ptw-permits-list__head .ptw-panel__title {
  margin: 0;
}

.ptw-permits-list__hint {
  margin: 0 0 0.85rem;
  font-size: 0.8125rem;
  color: var(--swi-text-secondary);
}

.ptw-permits-workspace {
  min-height: 0;
}

.ptw-permits-workspace__body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* Summary card â€” status + validity */
.ptw-permits-workspace__summary {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--swi-border);
  border-radius: 12px;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--swi-surface-muted) 70%, var(--swi-surface)),
    var(--swi-surface)
  );
}

.ptw-permits-workspace__summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.ptw-permits-workspace__ref {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--swi-text-secondary);
}

.ptw-permits-workspace__validity {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin: 0;
}

.ptw-permits-workspace__validity-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  background: var(--swi-surface);
  border: 1px solid color-mix(in srgb, var(--swi-border) 80%, transparent);
}

.ptw-permits-workspace__validity dt {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--swi-text-secondary);
}

.ptw-permits-workspace__validity dd {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--swi-text);
  line-height: 1.35;
}

.ptw-permits-workspace__note {
  margin: 0;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--swi-text-secondary);
  background: color-mix(in srgb, #64748b 6%, var(--swi-surface));
  border: 1px solid color-mix(in srgb, #64748b 18%, var(--swi-border));
}

/* Content cards */
.ptw-permits-workspace__card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--swi-border);
  border-radius: 12px;
  background: var(--swi-surface);
}

.ptw-permits-workspace__card-head {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.ptw-permits-workspace__card-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--swi-text);
  letter-spacing: -0.01em;
}

.ptw-permits-workspace__card-desc {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--swi-text-secondary);
}

.ptw-permits-workspace__field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.ptw-permits-workspace__field-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--swi-text-secondary);
}

.ptw-permits-workspace__select {
  width: 100%;
  min-height: 2.65rem;
  padding: 0.55rem 0.85rem;
  font-size: 0.9375rem;
  border-radius: 8px;
}

.ptw-permits-workspace__hint {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--swi-text-secondary);
}

.ptw-permits-workspace__hint--warn {
  color: #9a3412;
}

.ptw-permits-workspace__primary-btn {
  width: 100%;
  min-height: 2.65rem;
  margin-top: 0.15rem;
  font-weight: 600;
}

/* Lifecycle action tiles */
.ptw-permits-workspace__lifecycle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.ptw-permits-workspace__lifecycle-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--swi-border);
  border-radius: 10px;
  background: var(--swi-surface-muted);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.ptw-permits-workspace__lifecycle-btn:hover {
  border-color: color-mix(in srgb, var(--portal-accent, var(--swi-accent)) 35%, var(--swi-border));
  background: color-mix(in srgb, var(--portal-accent, var(--swi-accent)) 5%, var(--swi-surface));
  box-shadow: var(--swi-shadow-sm);
}

.ptw-permits-workspace__lifecycle-btn--close:hover {
  border-color: color-mix(in srgb, #64748b 40%, var(--swi-border));
  background: color-mix(in srgb, #64748b 6%, var(--swi-surface));
}

.ptw-permits-workspace__lifecycle-label {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--swi-text);
}

.ptw-permits-workspace__lifecycle-desc {
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--swi-text-secondary);
}

/* Administration footer */
.ptw-permits-workspace__admin {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  margin-top: 0.15rem;
  border-radius: 10px;
  background: color-mix(in srgb, var(--swi-surface-muted) 50%, var(--swi-surface));
  border: 1px dashed var(--swi-border);
}

.ptw-permits-workspace__admin-title {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--swi-text-secondary);
}

.ptw-permits-workspace__admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ptw-permits-workspace__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ptw-permits-workspace__empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  padding: 1.5rem 1rem;
  text-align: center;
}

.ptw-permits-workspace__empty p {
  margin: 0;
  max-width: 28ch;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--swi-text-secondary);
}

.ptw-permits-status-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid var(--swi-border);
  background: var(--swi-surface-muted);
  color: var(--swi-text-secondary);
}

.ptw-permits-status-chip--lg {
  font-size: 0.75rem;
  padding: 0.3rem 0.75rem;
}

.ptw-permits-status-chip--draft {
  background: color-mix(in srgb, #64748b 10%, var(--swi-surface));
  border-color: color-mix(in srgb, #64748b 30%, var(--swi-border));
}

.ptw-permits-status-chip--active {
  background: color-mix(in srgb, #1a6b38 10%, var(--swi-surface));
  border-color: color-mix(in srgb, #1a6b38 30%, var(--swi-border));
  color: #1a6b38;
}

.ptw-permits-status-chip--closed {
  background: color-mix(in srgb, var(--portal-accent, #c41e2d) 8%, var(--swi-surface));
  border-color: color-mix(in srgb, var(--portal-accent, #c41e2d) 28%, var(--swi-border));
  color: var(--portal-accent, #c41e2d);
}

.ptw-permits-advanced {
  margin-top: 0.5rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--swi-border);
}

.ptw-permits-advanced summary {
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--swi-text-secondary);
  user-select: none;
}

.ptw-permits-advanced__body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

@media (max-width: 560px) {
  .ptw-permits-workspace__validity,
  .ptw-permits-workspace__lifecycle {
    grid-template-columns: 1fr;
  }

  .ptw-permits-workspace__admin-actions {
    flex-direction: column;
  }

  .ptw-permits-workspace__admin-actions .swi-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Submitted forms preview */
.ptw-permit-preview-page {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.ptw-permit-preview-picker {
  padding: 1rem 1.1rem;
  border: 1px solid var(--swi-border);
  border-radius: 12px;
  background: var(--swi-surface);
}

.ptw-permit-preview-picker__field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-width: 28rem;
}

.ptw-permit-preview-picker__label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--swi-text-secondary);
}

.ptw-permit-preview-picker__select {
  min-height: 2.65rem;
}

.ptw-permit-preview-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.ptw-permit-preview-list__head {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.ptw-permit-preview-list__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.ptw-permit-preview-list__desc {
  margin: 0;
  color: var(--swi-text-secondary);
  font-size: 0.92rem;
}

.ptw-permit-preview-loading {
  margin: 0;
}

.ptw-permit-preview-summary {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--swi-border);
  border-radius: 12px;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--swi-surface-muted) 65%, var(--swi-surface)),
    var(--swi-surface)
  );
}

.ptw-permit-preview-summary__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.ptw-permit-preview-summary__number {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--swi-text);
}

.ptw-permit-preview-summary__meta {
  margin: 0.2rem 0 0;
  font-size: 0.875rem;
  color: var(--swi-text-secondary);
}

.ptw-permit-preview-summary__count {
  flex-shrink: 0;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--swi-text-secondary);
  background: var(--swi-surface);
  border: 1px solid var(--swi-border);
}

.ptw-permit-preview-summary__validity {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0;
}

.ptw-permit-preview-summary__validity div {
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  background: var(--swi-surface);
  border: 1px solid color-mix(in srgb, var(--swi-border) 80%, transparent);
}

.ptw-permit-preview-summary__validity dt {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--swi-text-secondary);
}

.ptw-permit-preview-summary__validity dd {
  margin: 0.15rem 0 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--swi-text);
}

.ptw-permit-preview-documents {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.ptw-permit-preview-document {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.ptw-permit-preview-document__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--swi-border);
  border-radius: 12px 12px 0 0;
  background: color-mix(in srgb, var(--swi-surface-muted) 55%, var(--swi-surface));
  border-bottom: none;
}

.ptw-permit-preview-document__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--swi-text);
}

.ptw-permit-preview-document__meta {
  margin: 0.2rem 0 0;
  font-size: 0.8125rem;
  color: var(--swi-text-secondary);
}

.ptw-permit-preview-document__time {
  flex-shrink: 0;
  font-size: 0.8125rem;
  color: var(--swi-text-secondary);
}

.ptw-permit-preview-document .ptw-doc-wrap {
  margin-top: 0;
}

.ptw-permit-preview-group {
  display: flex;
  flex-direction: column;
  margin: 1.25rem 0 0.75rem;
  border: 2px solid #000;
  border-radius: 0;
  background: #fff;
  overflow: hidden;
}

.ptw-permit-preview-group:first-child {
  margin-top: 0;
}

.ptw-permit-preview-group__banner {
  border-bottom: 2px solid #000;
}

.ptw-permit-preview-group__title {
  margin: 0;
  padding: 6px 8px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  color: #000;
  text-transform: uppercase;
}

.ptw-permit-preview-group--general .ptw-permit-preview-group__banner,
.ptw-permit-preview-group--specialized .ptw-permit-preview-group__banner {
  background: #ffff00;
}

.ptw-permit-preview-group--handover .ptw-permit-preview-group__banner {
  background: #bae6fd;
}

.ptw-permit-preview-group--handback .ptw-permit-preview-group__banner {
  background: #fecaca;
}

.ptw-permit-preview-group--closing .ptw-permit-preview-group__banner {
  background: #e2e8f0;
}

.ptw-permit-preview-group__body {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: color-mix(in srgb, var(--swi-surface-muted) 35%, #fff);
}

.ptw-permit-preview-group__head {
  min-width: 0;
}

.ptw-permit-preview-group__meta {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--swi-text-secondary);
}

.ptw-permit-preview-group__time {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--swi-text-secondary);
}

.ptw-permit-preview-steps {
  padding: 0.75rem 1rem;
  border: 1px solid var(--swi-border);
  border-radius: 12px;
  background: var(--swi-surface);
  overflow-x: auto;
}

.ptw-permit-preview-steps__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ptw-permit-preview-steps__item {
  flex: 0 0 auto;
}

.ptw-permit-preview-steps__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--swi-border);
  border-radius: 999px;
  background: transparent;
  color: var(--swi-text-secondary);
  font: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
}

.ptw-permit-preview-steps__btn:hover {
  border-color: var(--swi-primary);
  color: var(--swi-text);
}

.ptw-permit-preview-steps__btn--active {
  border-color: var(--swi-primary);
  background: color-mix(in srgb, var(--swi-primary) 12%, transparent);
  color: var(--swi-text);
  font-weight: 600;
}

.ptw-permit-preview-steps__index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: var(--swi-border);
  font-size: 0.6875rem;
  font-weight: 700;
}

.ptw-permit-preview-steps__btn--active .ptw-permit-preview-steps__index {
  background: var(--swi-primary);
  color: #fff;
}

.ptw-permit-preview-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0 0.25rem;
}

.ptw-permit-preview-nav__status {
  font-size: 0.875rem;
  color: var(--swi-text-secondary);
  text-align: center;
}

@media (max-width: 640px) {
  .ptw-permit-preview-nav {
    flex-direction: column;
  }
}

.ptw-permit-preview-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  padding: 1.5rem;
  border: 1px dashed var(--swi-border);
  border-radius: 12px;
  text-align: center;
}

.ptw-permit-preview-empty p {
  margin: 0;
  max-width: 36ch;
  color: var(--swi-text-secondary);
  line-height: 1.55;
}

.ptw-print-permit-meta {
  display: none;
}

.ptw-print-all-stack {
  position: fixed;
  top: 100vh;
  left: 0;
  width: 100%;
  pointer-events: none;
  z-index: -1;
}

.ptw-print-sheet__label {
  display: none;
}

.ptw-doc-section--preview {
  pointer-events: none;
}

.ptw-doc-section--preview .ptw-doc-media-row--preview,
.ptw-doc-section--preview .ptw-preview-media-list,
.ptw-doc-section--preview .ptw-preview-media-interactive,
.ptw-doc-section--preview video.ptw-preview-media {
  pointer-events: auto;
}

.ptw-doc-check-cell--readonly {
  cursor: default;
}

.ptw-preview-value {
  min-height: 2rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--swi-border);
  border-radius: 6px;
  background: color-mix(in srgb, var(--swi-surface-muted) 45%, var(--swi-surface));
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--swi-text);
  white-space: pre-wrap;
  word-break: break-word;
}

.ptw-preview-answer-stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ptw-preview-media-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ptw-preview-media {
  max-width: 100%;
  max-height: 180px;
  border: 1px solid var(--swi-border);
  border-radius: 8px;
  object-fit: contain;
  background: var(--swi-surface);
}

.ptw-preview-media--video {
  max-height: 240px;
}

.ptw-preview-media--section-video {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 200px;
  max-height: min(480px, 65vh);
  background: #000;
}

.ptw-doc-media-row--preview {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--swi-border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--swi-surface-muted) 50%, var(--swi-surface));
}

.ptw-preview-media-label {
  display: block;
  margin-bottom: 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--swi-text-secondary);
}

.ptw-preview-media__loading,
.ptw-preview-media__missing {
  font-size: 0.8125rem;
  color: var(--swi-text-secondary);
  font-style: italic;
}

.ptw-preview-skip-banner {
  padding: 0.85rem 1rem;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, #64748b 25%, var(--swi-border));
  background: color-mix(in srgb, #64748b 8%, var(--swi-surface));
}

.ptw-preview-skip-banner strong {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
}

.ptw-preview-skip-banner p {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--swi-text-secondary);
}

.ptw-preview-empty-section {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--swi-text-secondary);
  font-style: italic;
}

.ptw-text-answers-block__item--preview {
  gap: 0.35rem;
}

@media (max-width: 720px) {
  .ptw-permit-preview-summary__validity {
    grid-template-columns: 1fr;
  }

  .ptw-permit-preview-document__head {
    flex-direction: column;
  }
}

.ptw-permits-records {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.ptw-permits-records__panel {
  min-width: 0;
}

.ptw-permits-page .swi-table__row--selected td {
  background: color-mix(in srgb, var(--portal-accent, var(--swi-accent)) 8%, var(--swi-surface));
}

.ptw-permits-page .swi-table tr.swi-table__row--selected:hover td {
  background: color-mix(in srgb, var(--portal-accent, var(--swi-accent)) 12%, var(--swi-surface));
}

.ptw-panel__meta {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--swi-text-secondary);
  margin-left: auto;
}

.ptw-permits-page .swi-table-wrap {
  min-width: 0;
}

.ptw-permits-page .swi-table-wrap--empty {
  overflow-x: hidden;
}

.ptw-permits-page .swi-table__empty-row td {
  text-align: center;
  color: var(--swi-text-secondary);
  font-size: 0.85rem;
  padding: 1.25rem 1rem;
  cursor: default;
}

.ptw-permits-page .swi-table__empty-row:hover td {
  background: transparent;
}

@media (max-width: 1100px) {
  .ptw-permits-records {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .ptw-permits-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Two-column master/detail layout (forms, builder) */
.ptw-split {
  display: grid;
  grid-template-columns: minmax(260px, 360px) 1fr;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 900px) {
  .ptw-split {
    grid-template-columns: 1fr;
  }
}

.ptw-panel {
  background: var(--swi-surface);
  border: 1px solid var(--swi-border);
  border-radius: 12px;
  box-shadow: var(--swi-shadow-sm);
  padding: 1.1rem 1.2rem;
  width: 100%;
  box-sizing: border-box;
}

.ptw-panel__title {
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--swi-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.ptw-panel + .ptw-panel {
  margin-top: 1.1rem;
}

/* Chip list (roles, cities, locations) */
.ptw-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.ptw-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--swi-accent-soft);
  color: var(--swi-text);
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--swi-border);
}

.ptw-chip__remove {
  border: none;
  background: transparent;
  color: var(--swi-text-secondary);
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  padding: 0;
}

.ptw-chip__remove:hover {
  color: var(--swi-danger-text);
}

/* Builder sections */
.ptw-builder-section {
  border: 1px solid var(--swi-border);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1rem;
  background: var(--swi-surface-muted);
}

.ptw-builder-section__head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.ptw-builder-section__head .swi-input {
  flex: 1;
}

.ptw-builder-question {
  border: 1px dashed var(--swi-border-strong);
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 0.6rem;
  background: var(--swi-surface);
}

.ptw-builder-question__row {
  display: grid;
  grid-template-columns: 1fr 180px auto;
  gap: 0.5rem;
  align-items: center;
}

@media (max-width: 720px) {
  .ptw-builder-question__row {
    grid-template-columns: 1fr;
  }
}

.ptw-options-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.ptw-inline-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

/* Media thumbnails */
.ptw-media-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.ptw-media-thumb {
  width: 84px;
  height: 84px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--swi-border);
  background: var(--swi-surface-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ptw-media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ptw-key-value {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0.35rem 0.75rem;
  font-size: 0.82rem;
}

.ptw-key-value dt {
  color: var(--swi-text-secondary);
  font-weight: 600;
}

.ptw-key-value dd {
  margin: 0;
  color: var(--swi-text);
}

.ptw-form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

@media (max-width: 560px) {
  .ptw-form-grid-2 {
    grid-template-columns: 1fr;
  }
}

.ptw-muted {
  color: var(--swi-text-secondary);
  font-size: 0.85rem;
}

/* Raise ticket — formal request form */
.ptw-ticket-raise-page .portal-page-header {
  margin-bottom: 1.25rem;
}

.ptw-ticket-raise {
  display: grid;
  grid-template-columns: minmax(15rem, 17.5rem) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.ptw-ticket-raise__aside-card {
  padding: 1.15rem 1.2rem;
  border: 1px solid var(--swi-border);
  border-radius: 12px;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--portal-accent, #c41e2d) 5%, var(--swi-surface)) 0%,
    var(--swi-surface) 100%
  );
  border-left: 3px solid var(--portal-accent, #c41e2d);
  box-shadow: var(--swi-shadow-sm);
}

.ptw-ticket-raise__aside-title {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--swi-text);
}

.ptw-ticket-raise__aside-lead {
  margin: 0 0 0.85rem;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--swi-text-secondary);
}

.ptw-ticket-raise__aside-list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--swi-text-secondary);
}

.ptw-ticket-raise__aside-list li + li {
  margin-top: 0.45rem;
}

.ptw-ticket-raise__form {
  border: 1px solid var(--swi-border);
  border-radius: 14px;
  background: var(--swi-surface);
  box-shadow: var(--swi-shadow-sm);
  overflow: hidden;
}

.ptw-ticket-raise__form-head {
  padding: 1.15rem 1.35rem;
  border-bottom: 1px solid var(--swi-border);
  background: color-mix(in srgb, var(--swi-text) 2.5%, var(--swi-surface));
}

.ptw-ticket-raise__form-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--swi-text);
}

.ptw-ticket-raise__form-subtitle {
  margin: 0.3rem 0 0;
  font-size: 0.8125rem;
  color: var(--swi-text-secondary);
}

.ptw-ticket-raise__section {
  padding: 1.2rem 1.35rem;
  border-bottom: 1px solid var(--swi-border);
}

.ptw-ticket-raise__section-title {
  margin: 0 0 0.9rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--swi-text-secondary);
}

.ptw-ticket-raise__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem 1rem;
}

.ptw-ticket-raise__field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

.ptw-ticket-raise__field--full {
  width: 100%;
}

.ptw-ticket-raise__label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--swi-text);
}

.ptw-ticket-raise__required {
  color: var(--portal-accent, #c41e2d);
}

.ptw-ticket-raise__control {
  border: 1px solid var(--swi-border) !important;
  border-radius: 8px !important;
  background: var(--swi-surface) !important;
  padding: 0.62rem 0.8rem !important;
  font-size: 0.875rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ptw-ticket-raise__control:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--portal-accent, #c41e2d) 45%, var(--swi-border)) !important;
  box-shadow: var(--swi-focus-ring);
}

.ptw-ticket-raise textarea.ptw-ticket-raise__control {
  min-height: 7.5rem;
  resize: vertical;
  line-height: 1.5;
}

.ptw-ticket-raise__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem 1rem;
  padding: 1rem 1.35rem;
  background: color-mix(in srgb, var(--swi-text) 2.5%, var(--swi-surface));
}

.ptw-ticket-raise__footer-note {
  margin: 0;
  max-width: 28rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--swi-text-secondary);
}

.ptw-ticket-raise__footer-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-left: auto;
}

@media (max-width: 960px) {
  .ptw-ticket-raise {
    grid-template-columns: 1fr;
  }

  .ptw-ticket-raise__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .ptw-ticket-raise__footer {
    flex-direction: column;
    align-items: stretch;
  }

  .ptw-ticket-raise__footer-actions {
    margin-left: 0;
    justify-content: stretch;
  }

  .ptw-ticket-raise__footer-actions .swi-btn {
    flex: 1 1 auto;
    justify-content: center;
  }
}

.ptw-loading {
  padding: 2rem;
  text-align: center;
  color: var(--swi-text-secondary);
}

.ptw-row-actions {
  display: inline-flex;
  gap: 0.4rem;
}

.ptw-modal--wide {
  max-width: 720px;
}

.ptw-modal--xwide {
  max-width: 920px;
}

/* Entity detail / CRUD modals */
.ptw-modal-backdrop {
  backdrop-filter: blur(4px);
}

.ptw-entity-modal {
  position: relative;
  max-width: 720px;
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: var(--swi-shadow-md), 0 24px 48px rgba(28, 36, 48, 0.12);
}

.ptw-entity-modal--detail {
  max-width: 680px;
}

.ptw-entity-modal--detail .ptw-entity-modal__eyebrow {
  color: var(--swi-text-secondary);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.ptw-entity-modal--detail .ptw-entity-modal__title {
  font-size: 1.35rem;
}

.ptw-entity-modal--detail .ptw-entity-modal__body {
  max-height: min(70vh, 640px);
  padding-top: 1rem;
}

.ptw-entity-modal__accent {
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--portal-accent, var(--swi-accent)),
    color-mix(in srgb, var(--portal-accent, var(--swi-accent)) 55%, #ffffff)
  );
}

.ptw-entity-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.35rem 1rem;
  border-bottom: 1px solid var(--swi-border);
  background: color-mix(in srgb, var(--swi-surface-muted) 55%, var(--swi-surface));
}

.ptw-entity-modal__header-text {
  min-width: 0;
}

.ptw-entity-modal__eyebrow {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--portal-accent, var(--swi-accent));
}

.ptw-entity-modal__title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--swi-text);
}

.ptw-entity-modal__close {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--swi-border);
  border-radius: 8px;
  background: var(--swi-surface);
  color: var(--swi-text-secondary);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.ptw-entity-modal__close:hover {
  background: var(--swi-surface-muted);
  color: var(--swi-text);
  border-color: var(--swi-border-strong);
}

.ptw-entity-modal__body {
  padding: 1.25rem 1.35rem 1.35rem;
  max-height: min(70vh, 560px);
  overflow-y: auto;
}

.ptw-entity-modal__body .swi-modal h3 {
  margin-top: 0;
}

.ptw-entity-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.85rem 1.35rem 1.15rem;
  border-top: 1px solid var(--swi-border);
  background: var(--swi-surface-muted);
}

.ptw-entity-modal__loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2.5rem 1rem;
  color: var(--swi-text-secondary);
  text-align: center;
}

.ptw-entity-modal__loading p {
  margin: 0;
  font-size: 0.9rem;
}

.ptw-entity-modal__spinner {
  width: 1.75rem;
  height: 1.75rem;
  border: 2px solid var(--swi-border);
  border-top-color: var(--portal-accent, var(--swi-accent));
  border-radius: 999px;
  animation: ptw-modal-spin 0.7s linear infinite;
}

@keyframes ptw-modal-spin {
  to {
    transform: rotate(360deg);
  }
}

.ptw-status-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--swi-border);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  background: var(--swi-accent-soft);
  color: var(--swi-text);
  font-size: 0.76rem;
  font-weight: 600;
}

.ptw-status-badge--active {
  background: color-mix(in srgb, var(--swi-success, #16a34a) 12%, var(--swi-surface));
  border-color: color-mix(in srgb, var(--swi-success, #16a34a) 35%, var(--swi-border));
}

.ptw-status-badge--inactive {
  background: var(--swi-surface-muted);
  color: var(--swi-text-secondary);
}

.ptw-users-panel {
  width: 100%;
}

.ptw-users-table .swi-table-wrap {
  width: 100%;
}

.ptw-users-table .swi-table th,
.ptw-users-table .swi-table td {
  padding: 0.85rem 1.15rem;
}

.ptw-users-table__photo {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
}

.ptw-user-action-modal__summary {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.ptw-user-action-modal__avatar {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--swi-border);
  flex-shrink: 0;
}

.ptw-user-action-modal__actions {
  margin-bottom: 1rem;
}

.ptw-user-action-modal__section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--swi-border);
}

.ptw-user-action-modal__section h4 {
  margin: 0 0 0.65rem;
  font-size: 0.9rem;
}

.ptw-tab-bar {
  display: flex;
  gap: 0.4rem;
  border-bottom: 1px solid var(--swi-border);
  margin-bottom: 1rem;
}

.ptw-tab {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--swi-text-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.6rem 0.9rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.ptw-tab--active {
  color: var(--swi-accent);
  border-bottom-color: var(--swi-accent);
}

/* ---- Form / Section / Question management pages ---- */
.ptw-mgmt-page,
.ptw-form-management-page,
.ptw-mgmt-subpage {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.ptw-mgmt-cell-clip {
  display: inline-block;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.ptw-mgmt-field--check {
  align-self: end;
}

.ptw-mgmt-check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--swi-text);
  cursor: pointer;
}

.ptw-mgmt-check input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--portal-accent, var(--swi-accent));
}

.ptw-map-toolbar {
  margin-bottom: 1rem;
}

.ptw-map-toolbar__action {
  align-self: end;
}

.ptw-map-toolbar__action .swi-btn {
  width: 100%;
}

.ptw-map-order-input {
  max-width: 5.5rem;
  padding: 0.4rem 0.55rem;
}

.ptw-section-reorder-list__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ptw-section-reorder-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ptw-section-reorder-list__empty {
  margin: 0;
  padding: 1rem 0;
}

.ptw-section-reorder-list__item {
  display: grid;
  grid-template-columns: 2rem 2rem minmax(0, 1fr) auto auto auto auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--swi-border);
  border-radius: 10px;
  background: var(--swi-surface);
}

.ptw-section-reorder-list__item--dragging {
  opacity: 0.55;
}

.ptw-section-reorder-list__item--drag-over {
  border-color: var(--portal-accent, var(--swi-accent));
  box-shadow: 0 0 0 1px var(--portal-accent, var(--swi-accent));
}

.ptw-section-reorder-list__position {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  background: var(--swi-surface-muted, #f1f5f9);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--swi-text-secondary);
}

.ptw-section-reorder-list__handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 1px solid var(--swi-border);
  border-radius: 6px;
  background: var(--swi-surface-muted, #f8fafc);
  color: var(--swi-text-secondary);
  cursor: grab;
  font-size: 0.85rem;
  line-height: 1;
}

.ptw-section-reorder-list__handle:active {
  cursor: grabbing;
}

.ptw-section-reorder-list__handle:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.ptw-section-reorder-list__info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.ptw-section-reorder-list__id {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--swi-text-secondary);
}

.ptw-section-reorder-list__title {
  font-size: 0.9rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ptw-section-reorder-list__move {
  display: inline-flex;
  gap: 0.25rem;
}

.ptw-section-reorder-list__move-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 1px solid var(--swi-border);
  border-radius: 6px;
  background: var(--swi-surface);
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
}

.ptw-section-reorder-list__move-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ptw-section-reorder-list__skipable {
  white-space: nowrap;
}

.ptw-section-reorder-list__save-skip,
.ptw-section-reorder-list__remove {
  white-space: nowrap;
}

@media (max-width: 900px) {
  .ptw-section-reorder-list__item {
    grid-template-columns: 2rem 2rem minmax(0, 1fr) auto;
  }

  .ptw-section-reorder-list__skipable,
  .ptw-section-reorder-list__save-skip,
  .ptw-section-reorder-list__remove {
    grid-column: 1 / -1;
  }
}

.ptw-mgmt-shell {
  background: var(--swi-surface);
  border: 1px solid var(--swi-border);
  border-radius: 14px;
  box-shadow: var(--swi-shadow-sm);
  overflow: visible;
}

.ptw-mgmt-tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0.65rem 0.85rem;
  background: var(--swi-surface-muted);
  border-bottom: 1px solid var(--swi-border);
}

.ptw-mgmt-tab {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--swi-text-secondary);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ptw-mgmt-tab:hover {
  background: var(--swi-surface);
  color: var(--swi-text);
}

.ptw-mgmt-tab.is-active {
  background: var(--swi-surface);
  color: var(--portal-accent, var(--swi-accent));
  border-color: var(--swi-border);
  box-shadow: var(--swi-shadow-sm);
}

.ptw-mgmt-tab__count {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--portal-accent, var(--swi-accent)) 12%, transparent);
  color: var(--portal-accent, var(--swi-accent));
}

.ptw-mgmt-body {
  padding: 1.35rem 1.5rem 1.5rem;
}

.ptw-mgmt-card {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ptw-mgmt-card__header {
  margin-bottom: 1.25rem;
}

.ptw-mgmt-card__header--row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.ptw-mgmt-card__title {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--swi-text);
  letter-spacing: -0.02em;
}

.ptw-mgmt-card__desc {
  margin: 0;
  font-size: 0.875rem;
  color: var(--swi-text-secondary);
  line-height: 1.45;
  max-width: 52ch;
}

.ptw-mgmt-section {
  padding: 1.15rem 1.2rem;
  background: var(--swi-surface-muted);
  border: 1px solid var(--swi-border);
  border-radius: 10px;
  margin-bottom: 1.25rem;
}

.ptw-mgmt-section__title {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--swi-text-secondary);
}

.ptw-mgmt-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.15rem;
}

.ptw-mgmt-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

.ptw-mgmt-field--span2 {
  grid-column: span 2;
}

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

.ptw-mgmt-field__label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--swi-text);
}

.ptw-mgmt-required {
  font-style: normal;
  color: var(--portal-accent, var(--swi-accent));
}

.ptw-mgmt-input,
.ptw-mgmt-textarea {
  width: 100%;
  box-sizing: border-box;
  background: var(--swi-surface);
  border: 1px solid var(--swi-border);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--swi-text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ptw-mgmt-select {
  appearance: none;
  padding-right: 2.25rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%235a6575' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 0.65rem;
  cursor: pointer;
}

.ptw-mgmt-input:focus,
.ptw-mgmt-textarea:focus,
.ptw-mgmt-select:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--portal-accent, var(--swi-accent)) 55%, var(--swi-border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--portal-accent, var(--swi-accent)) 14%, transparent);
}

.ptw-mgmt-input::placeholder,
.ptw-mgmt-textarea::placeholder {
  color: var(--swi-text-tertiary, var(--swi-text-secondary));
}

.ptw-mgmt-textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.5;
}

/* Question type format panels (create / update question) */
.ptw-mgmt-type-format {
  margin-top: 0.25rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--swi-border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--swi-surface) 92%, var(--swi-border));
}

.ptw-mgmt-type-format__title {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--swi-text);
}

.ptw-mgmt-type-format__hint {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--swi-text-secondary);
}

.ptw-mgmt-colour-input {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.ptw-mgmt-colour-input__picker {
  width: 2.75rem;
  height: 2.25rem;
  padding: 0.15rem;
  border: 1px solid var(--swi-border, #d1d5db);
  border-radius: 0.375rem;
  background: var(--swi-surface, #fff);
  cursor: pointer;
}

.ptw-mgmt-colour-swatch {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.ptw-mgmt-colour-swatch__chip {
  width: 1rem;
  height: 1rem;
  border-radius: 0.2rem;
  border: 1px solid rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}

.ptw-mgmt-type-format__preview {
  margin-top: 0.5rem;
}

.ptw-mgmt-type-format__preview .ptw-mgmt-input {
  max-width: 320px;
  opacity: 0.85;
}

.ptw-mgmt-type-format__yesno {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.ptw-mgmt-type-format__radio {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.875rem;
  color: var(--swi-text-secondary);
  cursor: default;
}

.ptw-mgmt-check--muted {
  opacity: 0.85;
  color: var(--swi-text-secondary);
}

.ptw-options-builder {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ptw-options-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}

.ptw-option-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.ptw-option-number {
  flex-shrink: 0;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--swi-text-secondary);
  min-width: 1.5rem;
}

.ptw-option-input {
  flex: 1;
  min-width: 0;
}

.ptw-option-remove-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--swi-border);
  border-radius: 8px;
  background: var(--swi-surface);
  color: var(--swi-text-secondary);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.ptw-option-remove-btn:hover {
  border-color: var(--portal-accent, var(--swi-accent));
  color: var(--portal-accent, var(--swi-accent));
}

.ptw-option-add-btn {
  align-self: flex-start;
  padding: 0.55rem 1rem;
  border: 1px dashed var(--swi-border);
  border-radius: 8px;
  background: var(--swi-surface);
  color: var(--swi-text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.ptw-option-add-btn:hover {
  border-color: var(--portal-accent, var(--swi-accent));
  color: var(--portal-accent, var(--swi-accent));
}

.ptw-options-empty-msg {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--swi-text-tertiary, var(--swi-text-secondary));
}

.ptw-options-preview {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--swi-border);
}

.ptw-options-preview__title {
  margin: 0 0 0.65rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--swi-text-secondary);
}

.ptw-options-preview__list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.ptw-options-preview .ptw-mgmt-select {
  max-width: 360px;
  opacity: 0.9;
}

.ptw-options-preview select[multiple] {
  min-height: 6rem;
}

.ptw-mgmt-detail-options {
  margin: 0;
  padding-left: 1.15rem;
}

.ptw-mgmt-detail-options li {
  margin-bottom: 0.25rem;
}

.ptw-section-detail__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 1.15rem;
}

.ptw-section-detail__stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--swi-border);
  border-radius: 10px;
  background: var(--swi-surface-muted);
}

.ptw-section-detail__stat-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--swi-text-secondary);
}

.ptw-section-detail__stat-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--swi-text);
  line-height: 1.3;
}

.ptw-section-detail__stat-value--sm {
  font-size: 0.82rem;
  font-weight: 600;
}

.ptw-section-detail__questions {
  border: 1px solid var(--swi-border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--swi-surface-muted) 40%, var(--swi-surface));
  overflow: hidden;
}

.ptw-section-detail__questions-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--swi-border);
  background: var(--swi-surface);
}

.ptw-section-detail__questions-title {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--swi-text-secondary);
}

.ptw-section-detail__questions-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--portal-accent, var(--swi-accent));
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--portal-accent, var(--swi-accent)) 10%, transparent);
}

.ptw-section-detail__question-list {
  list-style: none;
  margin: 0;
  padding: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: 320px;
  overflow-y: auto;
}

.ptw-section-detail__question-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--swi-border);
  border-radius: 10px;
  background: var(--swi-surface);
  box-shadow: var(--swi-shadow-sm);
}

.ptw-section-detail__question-index {
  flex-shrink: 0;
  width: 1.65rem;
  height: 1.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--portal-accent-contrast, #fff);
  background: var(--portal-accent, var(--swi-accent));
}

.ptw-section-detail__question-body {
  min-width: 0;
  flex: 1;
}

.ptw-section-detail__question-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
}

.ptw-section-detail__question-text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--swi-text);
}

.ptw-section-detail__options {
  margin-top: 0.55rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--swi-border);
}

.ptw-section-detail__options-label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--swi-text-secondary);
}

.ptw-section-detail__options-list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.82rem;
  color: var(--swi-text-secondary);
}

.ptw-section-detail__options-list li {
  margin-bottom: 0.15rem;
}

.ptw-section-detail__empty {
  padding: 2rem 1.25rem;
  text-align: center;
  color: var(--swi-text-secondary);
}

.ptw-section-detail__empty p {
  margin: 0 0 0.35rem;
  font-weight: 600;
  color: var(--swi-text);
}

.ptw-section-detail__empty span {
  font-size: 0.82rem;
}

.ptw-section-questions-editor__add {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--swi-border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--portal-accent, var(--swi-accent)) 4%, var(--swi-surface));
}

.ptw-section-questions-editor__add-head {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.ptw-section-questions-editor__add-hint {
  margin: 0;
  font-size: 0.82rem;
  color: var(--swi-text-muted, #5c6670);
}

.ptw-section-questions-editor__pick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.ptw-section-questions-editor__pick-list {
  max-height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.5rem;
  border: 1px solid var(--swi-border);
  border-radius: 8px;
  background: var(--swi-surface);
}

.ptw-section-questions-editor__pick-row {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.4rem 0.45rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.88rem;
  line-height: 1.35;
}

.ptw-section-questions-editor__pick-row:hover {
  background: color-mix(in srgb, var(--portal-accent, var(--swi-accent)) 6%, transparent);
}

.ptw-section-questions-editor__pick-row input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.ptw-section-questions-editor__pick-text {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem;
}

.ptw-section-questions-editor__pool-empty {
  margin: 0;
  font-size: 0.85rem;
  color: var(--swi-text-muted, #5c6670);
}

.ptw-section-questions-editor__add-field {
  flex: 1;
  min-width: 200px;
  margin: 0;
}

.ptw-section-questions-editor__add-btn {
  flex-shrink: 0;
}

.ptw-section-questions-editor__error {
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--swi-error-text, #9c1c1c);
  background: var(--swi-error-bg, #fcefee);
  border: 1px solid var(--swi-error-border, #e8cacd);
}

.ptw-section-questions-editor__remove {
  margin-left: auto;
  color: var(--swi-danger-text, #b42318);
  border-color: color-mix(in srgb, var(--swi-danger-text, #b42318) 35%, var(--swi-border));
}

.ptw-section-detail__question-head {
  width: 100%;
}

.ptw-section-detail__question-list--readonly {
  max-height: 280px;
}

.ptw-section-update-questions {
  margin-top: 1.25rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--swi-border);
}

.ptw-section-update-questions__hint {
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
}

.ptw-entity-modal__update-actions {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--swi-border);
}

/* Full-page management sub-routes (view / update) */
.ptw-mgmt-subpage {
  width: 100%;
  max-width: none;
}

.ptw-mgmt-breadcrumb {
  margin-bottom: 0.5rem;
}

.ptw-mgmt-breadcrumb__link {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0.35rem 0;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--portal-accent, var(--swi-accent));
  cursor: pointer;
  transition: opacity 0.12s ease;
}

.ptw-mgmt-breadcrumb__link:hover {
  opacity: 0.85;
  text-decoration: underline;
}

.ptw-mgmt-subpage__card {
  margin-top: 0.25rem;
}

.ptw-mgmt-success-banner {
  margin: 0 0 1rem;
  padding: 0.65rem 0.9rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1a6b38;
  background: color-mix(in srgb, #1a6b38 8%, var(--swi-surface));
  border: 1px solid color-mix(in srgb, #1a6b38 22%, var(--swi-border));
}

.ptw-section-update-questions--page {
  margin-top: 1.5rem;
  padding-top: 0;
  border-top: none;
}

@media (max-width: 520px) {
  .ptw-section-detail__stats {
    grid-template-columns: 1fr;
  }

  .ptw-entity-modal__header,
  .ptw-entity-modal__body {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

.ptw-mgmt-card__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  padding-top: 0.25rem;
  margin-bottom: 1.25rem;
}

.ptw-mgmt-advanced {
  padding-top: 1rem;
  border-top: 1px dashed var(--swi-border);
}

.ptw-mgmt-advanced .ptw-panel {
  margin-top: 0;
  padding: 0;
  border: none;
  box-shadow: none;
  background: transparent;
}

.ptw-mgmt-advanced .swi-btn.swi-btn--ghost {
  width: 100%;
  justify-content: center;
  padding: 0.75rem 1rem;
  border: 1px dashed var(--swi-border);
  border-radius: 8px;
  background: var(--swi-surface);
}

.ptw-mgmt-advanced .swi-input,
.ptw-mgmt-advanced select,
.ptw-mgmt-advanced textarea {
  border: 1px solid var(--swi-border);
  border-radius: 8px;
  background: var(--swi-surface);
  padding: 0.6rem 0.85rem;
}

.ptw-mgmt-advanced .swi-input:focus,
.ptw-mgmt-advanced select:focus,
.ptw-mgmt-advanced textarea:focus {
  border-color: color-mix(in srgb, var(--portal-accent, var(--swi-accent)) 55%, var(--swi-border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--portal-accent, var(--swi-accent)) 14%, transparent);
}

.ptw-mgmt-card--list .swi-table-wrap {
  border-radius: 10px;
  max-width: 100%;
  overflow-x: auto;
}

.ptw-mgmt-list-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
  font-size: 0.85rem;
  color: var(--swi-text-secondary);
}

.ptw-mgmt-list-loading {
  margin: 0 0 0.75rem;
}

.ptw-mgmt-card--list .swi-table tbody tr {
  cursor: default;
}

.ptw-mgmt-tag {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  background: color-mix(in srgb, var(--portal-accent, var(--swi-accent)) 10%, var(--swi-surface));
  color: var(--swi-text);
  border: 1px solid var(--swi-border);
}

.ptw-mgmt-tag--muted {
  background: var(--swi-surface-muted);
  color: var(--swi-text-secondary);
}

.ptw-mgmt-table-actions {
  display: inline-flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.ptw-mgmt-btn {
  appearance: none;
  border: 1px solid var(--swi-border);
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.ptw-mgmt-btn--view {
  background: var(--swi-surface);
  color: var(--swi-text);
}

.ptw-mgmt-btn--view:hover {
  background: var(--swi-surface-muted);
}

.ptw-mgmt-btn--edit {
  background: color-mix(in srgb, var(--portal-accent, var(--swi-accent)) 10%, var(--swi-surface));
  color: var(--portal-accent, var(--swi-accent));
  border-color: color-mix(in srgb, var(--portal-accent, var(--swi-accent)) 35%, var(--swi-border));
}

.ptw-mgmt-btn--edit:hover {
  background: color-mix(in srgb, var(--portal-accent, var(--swi-accent)) 18%, var(--swi-surface));
}

.ptw-mgmt-detail {
  margin: 0;
}

.ptw-mgmt-success-msg {
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--swi-text);
}

