/* Jayce Plans & Add-ons admin — commercial packaging setup */

:root {
  --pp-bg: #0b1220;
  --pp-panel: #111827;
  --pp-panel-2: #1e293b;
  --pp-line: #334155;
  --pp-text: #e2e8f0;
  --pp-muted: #94a3b8;
  --pp-teal: #14b8a6;
  --pp-teal-btn: #0d9488;
  --pp-amber: #f59e0b;
  --pp-danger: #f87171;
  --pp-ok: #4ade80;
  --pp-input-bg: #0f172a;
  --pp-radius: 8px;
  --pp-font: "Segoe UI", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--pp-bg);
  color: var(--pp-text);
  font-family: var(--pp-font);
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.pp-banner {
  background: #422006;
  color: #fde68a;
  border-bottom: 1px solid #92400e;
  padding: 8px 16px;
  font-size: 0.78rem;
  line-height: 1.4;
}

.pp-banner strong {
  color: #fef3c7;
}

.pp-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--pp-line);
  background: #0f172a;
}

.pp-header-brand {
  min-width: 0;
}

.pp-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0 0 0.35rem;
  color: #5eead4;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 700;
}

.pp-back-link:hover {
  color: #99f6e4;
  text-decoration: underline;
}

.pp-header h1 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--pp-teal);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pp-header p {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: var(--pp-muted);
  max-width: 40rem;
  line-height: 1.4;
}

.pp-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.pp-status {
  font-size: 0.72rem;
  color: var(--pp-muted);
  min-height: 1.2em;
}

.pp-status.ok {
  color: var(--pp-ok);
}

.pp-status.warn {
  color: var(--pp-amber);
}

.pp-main {
  display: grid;
  grid-template-columns: minmax(240px, 300px) 1fr;
  gap: 0;
  flex: 1;
  min-height: 0;
}

@media (max-width: 860px) {
  .pp-main {
    grid-template-columns: 1fr;
  }
}

.pp-sidebar {
  border-right: 1px solid var(--pp-line);
  background: var(--pp-panel);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
}

.pp-section-tabs {
  display: flex;
  border-bottom: 1px solid var(--pp-line);
  flex-shrink: 0;
}

.pp-section-tabs button {
  flex: 1;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--pp-muted);
  padding: 12px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.pp-section-tabs button.active {
  color: var(--pp-teal);
  border-bottom-color: var(--pp-teal);
  background: rgba(20, 184, 166, 0.06);
}

.pp-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--pp-line);
}

.pp-list-head h2 {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pp-muted);
}

.pp-list {
  display: flex;
  flex-direction: column;
  padding: 8px;
  gap: 6px;
}

.pp-list-item {
  appearance: none;
  border: 1px solid var(--pp-line);
  background: var(--pp-input-bg);
  color: var(--pp-text);
  border-radius: var(--pp-radius);
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pp-list-item:hover {
  border-color: #475569;
}

.pp-list-item.active {
  border-color: var(--pp-teal);
  box-shadow: inset 0 0 0 1px rgba(20, 184, 166, 0.35);
}

.pp-list-item .pp-item-name {
  font-size: 0.9rem;
  font-weight: 600;
}

.pp-list-item .pp-item-meta {
  font-size: 0.72rem;
  color: var(--pp-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pp-badge {
  display: inline-block;
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid var(--pp-line);
  color: var(--pp-muted);
}

.pp-badge.off {
  color: var(--pp-danger);
  border-color: #7f1d1d;
}

.pp-badge.on {
  color: var(--pp-ok);
  border-color: #166534;
}

.pp-editor {
  padding: 16px 18px 28px;
  overflow: auto;
  background: var(--pp-bg);
}

.pp-editor-empty {
  color: var(--pp-muted);
  font-size: 0.9rem;
  padding: 24px 8px;
}

.pp-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 720px;
}

.pp-form-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.pp-form-title h2 {
  margin: 0;
  font-size: 1rem;
  color: var(--pp-text);
}

.pp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 640px) {
  .pp-grid {
    grid-template-columns: 1fr;
  }
}

.pp-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.pp-field label {
  font-size: 0.72rem;
  color: var(--pp-muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.pp-field input,
.pp-field select,
.pp-field textarea {
  background: var(--pp-input-bg);
  border: 1px solid var(--pp-line);
  border-radius: var(--pp-radius);
  color: var(--pp-text);
  padding: 8px 10px;
  font: inherit;
  font-size: 0.9rem;
}

.pp-field textarea {
  min-height: 88px;
  resize: vertical;
  line-height: 1.4;
}

.pp-field input:focus,
.pp-field select:focus,
.pp-field textarea:focus {
  outline: none;
  border-color: var(--pp-teal);
}

.pp-field .hint {
  font-size: 0.68rem;
  color: #64748b;
  line-height: 1.35;
}

.pp-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--pp-text);
}

.pp-check-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--pp-teal);
}

.pp-applies {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--pp-line);
  border-radius: var(--pp-radius);
  background: var(--pp-panel);
}

.pp-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
}

.action {
  appearance: none;
  border: 1px solid var(--pp-line);
  background: var(--pp-panel-2);
  color: var(--pp-text);
  border-radius: var(--pp-radius);
  padding: 7px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.action:hover {
  border-color: #64748b;
}

.action.primary {
  background: var(--pp-teal-btn);
  border-color: #0f766e;
  color: #ecfeff;
}

.action.primary:hover {
  background: #0f766e;
}

.action.back {
  border-color: rgba(20, 184, 166, 0.55);
  background: rgba(20, 184, 166, 0.12);
  color: #5eead4;
}

.action.back:hover {
  border-color: #14b8a6;
  background: rgba(20, 184, 166, 0.22);
  color: #99f6e4;
}

.action.danger {
  color: #fecaca;
  border-color: #7f1d1d;
  background: #450a0a;
}

.action.danger:hover {
  background: #7f1d1d;
}

.pp-id-line {
  font-size: 0.68rem;
  color: #64748b;
  font-family: Consolas, "Courier New", monospace;
}

.pp-preview {
  margin-top: 8px;
  padding: 12px 14px;
  border: 1px dashed var(--pp-line);
  border-radius: var(--pp-radius);
  background: rgba(15, 23, 42, 0.6);
}

.pp-preview h3 {
  margin: 0 0 6px;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pp-muted);
}

.pp-preview ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.82rem;
  color: var(--pp-text);
  line-height: 1.45;
}

.pp-currency-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  padding: 10px 18px;
  border-bottom: 1px solid var(--pp-line);
  background: var(--pp-panel);
}

.pp-currency-bar .pp-field {
  min-width: 7rem;
}
