/* Shared page geometry and reusable UI primitives. */

.page-shell {
  width: min(var(--app-width), calc(100% - 40px));
  margin: 0 auto;
  padding: 26px 0 80px;
}

.breadcrumb-shell {
  width: min(var(--app-width), calc(100% - 40px));
  margin: 0 auto;
  padding-top: 18px;
}

.breadcrumbs {
  overflow-x: auto;
  padding: 4px 4px 2px;
  scrollbar-width: none;
}

.breadcrumbs::-webkit-scrollbar {
  display: none;
}

.breadcrumbs ol {
  display: flex;
  width: max-content;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  color: var(--muted-ink);
  font-size: 12px;
  font-weight: 850;
  list-style: none;
  white-space: nowrap;
}

.breadcrumb-item {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.breadcrumb-item + .breadcrumb-item::before {
  color: var(--muted-ink);
  content: "→";
  font-weight: 950;
}

.breadcrumb-link,
.breadcrumb-current {
  display: block;
  min-height: 32px;
  padding: 6px 8px;
  border-radius: 8px;
  line-height: 20px;
}

.breadcrumb-link {
  max-width: min(280px, 28vw);
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 150ms ease, background-color 150ms ease;
}

.breadcrumb-link:hover {
  color: var(--ink);
  background: var(--surface);
}

.breadcrumb-current {
  max-width: min(420px, 60vw);
  overflow: hidden;
  color: var(--ink);
  font-weight: 950;
  text-overflow: ellipsis;
}

.email-break {
  overflow-wrap: anywhere;
}

.inline-link {
  color: var(--primary-dark);
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.inline-message {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3px;
  margin-top: 22px;
  padding: 11px 13px;
  border: 1.5px solid currentcolor;
  border-radius: 9px;
  font-size: 13px;
  line-height: 1.4;
}

.inline-message strong {
  font-weight: 950;
}

.inline-message.form-errors,
.inline-message.page-message {
  margin: 0 0 24px;
}

.inline-message.category-form-errors {
  margin: 0;
}

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

.page-heading {
  max-width: 820px;
  padding: 48px 0 28px;
}

.page-title {
  max-width: 900px;
  margin: 14px 0 10px;
  font-size: var(--page-title-size);
  line-height: 0.98;
  overflow-wrap: anywhere;
}

.page-description,
.page-heading > p,
.page-heading > div > p:last-child {
  max-width: 720px;
  margin: 0;
  color: var(--muted-ink);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
}

.app-page-heading {
  display: flex;
  max-width: none;
  align-items: flex-start;
  justify-content: space-between;
  gap: 30px;
  margin: 0 0 28px;
  padding: 48px 0 0;
}

.breadcrumb-shell + .page-shell {
  padding-top: 0;
}

.breadcrumb-shell + .page-shell > .page-heading:first-child {
  padding-top: 26px;
}

.breadcrumb-shell + .auth-shell {
  min-height: calc(100svh - 118px);
}

.page-heading-main {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: center;
  gap: 18px;
}

.page-heading-copy {
  min-width: 0;
}

.page-heading-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  padding-top: 14px;
}

.form-field {
  display: grid;
  gap: 8px;
}

.form-label {
  width: fit-content;
  font-size: 13px;
  font-weight: 950;
}

.form-input {
  width: 100%;
  min-height: 50px;
  padding: 11px 13px;
  border: 2px solid var(--ink);
  border-radius: 9px;
  outline: none;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 16px;
  font-weight: 700;
  transition: border-color 150ms ease, box-shadow 150ms ease, translate 150ms ease;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 5px 5px 0 var(--primary);
  translate: -1px -1px;
}

.form-input.error {
  border-color: var(--danger);
  box-shadow: 3px 3px 0 var(--danger);
}

.form-help {
  margin: 0;
  color: var(--muted-ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border: 2px solid var(--ink);
  border-radius: 9px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 900;
  transition: translate 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.button:hover {
  translate: -1px -1px;
}

.button:active {
  translate: 3px 3px;
  box-shadow: none;
}

.button-primary {
  color: white;
  background: var(--primary);
  box-shadow: var(--shadow-control);
}

.button-primary:hover {
  background: var(--primary-dark);
}

.button-outline {
  background: var(--surface);
  box-shadow: 3px 3px 0 var(--ink);
}

.button-danger {
  color: white;
  background: var(--danger);
  box-shadow: var(--shadow-control);
}

.button-danger:hover {
  background: oklch(0.43 0.18 28);
}

.button-ghost {
  border-color: transparent;
  background: transparent;
}

.button-ghost:hover {
  border-color: var(--ink);
  background: var(--interactive-soft);
  box-shadow: 2px 2px 0 var(--ink);
}

.button:disabled,
.button:disabled:hover {
  border-color: var(--muted-ink);
  cursor: not-allowed;
  color: var(--muted-ink);
  background: var(--surface-sunk);
  box-shadow: none;
  opacity: 1;
  translate: none;
}

.text-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.button-small {
  min-height: 36px;
  padding: 7px 11px;
  font-size: 12px;
}

.text-button {
  padding: 6px 0;
  border: 0;
  cursor: pointer;
  color: var(--primary-dark);
  background: transparent;
  font-size: 13px;
  font-weight: 900;
  text-decoration: underline;
}

.working-panel {
  overflow: hidden;
  margin: 0;
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: 15px 11px 16px 12px;
  background: var(--surface);
  box-shadow: var(--shadow-panel);
}

.panel-heading {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px var(--panel-inline);
  border-bottom: 1px solid var(--border);
}

.panel-body {
  padding: var(--panel-body) var(--panel-inline);
}

.panel-heading h2 {
  margin: 0;
  font-size: 20px;
}

.panel-heading > span,
.panel-heading p,
.document-row p,
.package-row p {
  margin: 3px 0 0;
  color: var(--muted-ink);
  font-size: 13px;
  font-weight: 650;
}

.row-count {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  color: var(--muted-ink);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.directory-pagination,
.panel-pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 16px var(--panel-inline);
  border-top: 1px solid var(--border);
}

.directory-pagination .button,
.panel-pagination .button {
  min-height: 44px;
}

.pagination-previous {
  grid-column: 1;
  justify-self: start;
}

.pagination-current {
  grid-column: 2;
  color: var(--muted-ink);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.panel-pagination .pagination-current {
  font-size: 12px;
}

.pagination-next {
  grid-column: 3;
  justify-self: end;
}

.package-row:hover {
  background: var(--interactive-soft);
}

.package-row:last-child,
.document-row:last-child {
  border-bottom: 0;
}

.client-name,
.access-row > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 3px;
}
