* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--fg1);
}

body,
button,
input,
select,
textarea {
  font-family: var(--font-sans);
}

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.pf-shell {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  min-height: 100vh;
  background:
    linear-gradient(rgba(19, 19, 22, 0.026) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgba(19, 19, 22, 0.026) 1px, transparent 1px) 0 0 / 28px 28px,
    radial-gradient(circle at 86% 8%, rgba(216, 155, 0, 0.14), transparent 34%),
    radial-gradient(circle at 10% 92%, rgba(216, 155, 0, 0.08), transparent 38%),
    var(--bg);
}

.pf-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100vh;
  padding: 18px;
  overflow: auto;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent 34%),
    linear-gradient(rgba(255, 255, 255, 0.036) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--neutral-950);
}

.pf-brand,
.pf-nav a,
.pf-action,
.pf-row,
.pf-card-head,
.pf-top-actions,
.pf-breadcrumbs,
.pf-status {
  display: flex;
  align-items: center;
}

.pf-brand {
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
}

.pf-brand img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(216, 155, 0, 0.3));
}

.pf-nav {
  display: grid;
  gap: 6px;
}

.pf-nav-section {
  margin: 12px 2px 3px;
  color: rgba(255, 255, 255, 0.42);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
}

.pf-nav a {
  min-height: 39px;
  padding: 0 12px;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.062);
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 800;
}

.pf-nav a.is-active {
  color: var(--fg-on-accent);
  background: var(--accent);
  border-color: var(--accent);
}

.pf-side-card {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding: 14px;
  background: rgba(255, 255, 255, 0.072);
  border: 1px solid rgba(255, 255, 255, 0.095);
  border-radius: var(--radius-lg);
}

.pf-kicker,
.pf-side-card span:first-child,
.pf-mono,
.pf-badge,
.pf-status {
  font-family: var(--font-mono);
}

.pf-kicker,
.pf-side-card span:first-child {
  color: var(--accent-fg);
  font-size: 11px;
  font-weight: 800;
}

.pf-side-card span:first-child {
  color: rgba(255, 255, 255, 0.5);
}

.pf-side-card strong {
  color: #fff;
}

.pf-side-card small {
  color: var(--gold-300);
}

.pf-action {
  justify-content: center;
  min-height: 44px;
  color: var(--fg-on-accent);
  background: var(--accent);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-accent);
  font-weight: 800;
}

.pf-main {
  min-width: 0;
  padding: 26px;
}

.pf-top,
.pf-content {
  width: min(1180px, 100%);
  margin-inline: auto;
}

.pf-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.pf-top h1 {
  margin: 8px 0 0;
  font-size: clamp(30px, 3.7vw, 48px);
  line-height: 1.12;
  letter-spacing: 0;
}

.pf-top p {
  max-width: 760px;
  margin: 10px 0 0;
  color: var(--fg2);
  line-height: 1.75;
}

.pf-top-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.pf-button,
.pf-ghost,
.pf-tab,
.pf-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 15px;
  border: 0;
  border-radius: var(--radius-md);
  font-weight: 800;
}

.pf-button {
  color: var(--fg-on-accent);
  background: var(--accent);
  box-shadow: var(--shadow-accent);
}

.pf-ghost,
.pf-tab,
.pf-mini {
  color: var(--fg1);
  background: var(--surface);
  border: 1px solid var(--border);
}

.pf-mini {
  min-height: 32px;
  padding: 0 11px;
  font-size: 12px;
}

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

.pf-card {
  grid-column: span 6;
  min-width: 0;
  padding: 20px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.pf-card.is-wide {
  grid-column: 1 / -1;
}

.pf-card.is-third {
  grid-column: span 4;
}

.pf-card.is-quarter {
  grid-column: span 3;
}

.pf-card-head {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.pf-card h2,
.pf-card h3 {
  margin: 0;
  line-height: 1.25;
}

.pf-card p {
  color: var(--fg2);
  line-height: 1.7;
}

.pf-stat {
  display: grid;
  gap: 8px;
}

.pf-stat strong {
  font-size: clamp(26px, 3.2vw, 40px);
  letter-spacing: 0;
}

.pf-stat span {
  color: var(--fg3);
  font-size: 13px;
}

.pf-list,
.pf-table {
  width: 100%;
}

.pf-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.pf-list li,
.pf-row {
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.pf-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.pf-row {
  justify-content: space-between;
}

.pf-list li:last-child,
.pf-row:last-child {
  border-bottom: 0;
}

.pf-list b,
.pf-row b {
  color: var(--fg1);
}

.pf-list span,
.pf-row span {
  color: var(--fg3);
  font-size: 13px;
  text-align: end;
}

.pf-table-wrap {
  overflow-x: auto;
}

.pf-table {
  border-collapse: collapse;
  min-width: 640px;
  font-size: 13.5px;
}

.pf-table th,
.pf-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border-subtle);
  text-align: start;
  white-space: nowrap;
}

.pf-table th {
  color: var(--fg3);
  font-family: var(--font-mono);
  font-size: 11px;
}

.pf-badge,
.pf-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  min-height: 26px;
  padding: 0 9px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 800;
}

.pf-badge {
  color: var(--accent-fg);
  background: var(--accent-soft);
}

.pf-status {
  color: var(--fg2);
  background: var(--surface-inset);
  border: 1px solid var(--border);
}

.pf-status::before {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--success);
  border-radius: 50%;
}

.pf-status.warn::before {
  background: var(--warning);
}

.pf-status.danger::before {
  background: var(--danger);
}

.pf-status.info::before {
  background: var(--info);
}

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

.pf-form label {
  display: grid;
  gap: 7px;
  color: var(--fg3);
  font-size: 13px;
  font-weight: 700;
}

.pf-form label.is-wide {
  grid-column: 1 / -1;
}

.pf-form input,
.pf-form select,
.pf-form textarea {
  width: 100%;
  min-height: 43px;
  padding: 0 12px;
  color: var(--fg1);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.pf-form textarea {
  min-height: 112px;
  padding-block: 12px;
  resize: vertical;
}

.pf-note {
  display: flex;
  gap: 10px;
  padding: 14px;
  color: var(--fg2);
  background: var(--surface-inset);
  border: 1px solid var(--border);
  border-inline-start: 3px solid var(--accent);
  border-radius: var(--radius-md);
  line-height: 1.65;
}

.pf-price {
  display: grid;
  gap: 12px;
  min-height: 100%;
}

.pf-price strong {
  font-size: 34px;
}

.pf-toast {
  position: fixed;
  right: 50%;
  bottom: 22px;
  z-index: 40;
  max-width: min(460px, calc(100vw - 32px));
  padding: 12px 14px;
  color: #fff;
  background: var(--neutral-950);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  transform: translateX(50%) translateY(18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}

.pf-toast.show {
  transform: translateX(50%);
  opacity: 1;
}

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

  .pf-sidebar {
    position: static;
    height: auto;
  }

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

  .pf-nav-section,
  .pf-side-card,
  .pf-action {
    grid-column: 1 / -1;
  }

  .pf-top {
    flex-direction: column;
  }

  .pf-top-actions {
    justify-content: flex-start;
  }

  .pf-card,
  .pf-card.is-third,
  .pf-card.is-quarter {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .pf-shell {
    background:
      linear-gradient(rgba(19, 19, 22, 0.026) 1px, transparent 1px) 0 0 / 24px 24px,
      linear-gradient(90deg, rgba(19, 19, 22, 0.026) 1px, transparent 1px) 0 0 / 24px 24px,
      var(--bg);
  }

  .pf-sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    gap: 10px;
    padding: 10px 12px;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .pf-brand {
    justify-content: flex-start;
    font-size: 18px;
  }

  .pf-brand img {
    width: 36px;
    height: 36px;
  }

  .pf-nav {
    display: flex;
    gap: 8px;
    padding-bottom: 4px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  .pf-nav-section,
  .pf-side-card,
  .pf-action {
    display: none;
  }

  .pf-nav a {
    flex: 0 0 auto;
    min-height: 35px;
    padding: 0 12px;
    scroll-snap-align: start;
    white-space: nowrap;
  }

  .pf-main {
    padding: 18px 14px 28px;
  }

  .pf-form {
    grid-template-columns: 1fr;
  }

  .pf-top h1 {
    font-size: 30px;
  }
}
