:root {
  --pa-bg: #0f0f0f;
  --pa-surface: #1a1a1a;
  --pa-ink: #ffffff;
  --pa-ink-1: #ffffff;
  --pa-ink-2: #e0e0e0;
  --pa-muted: #bfbfbf;
  --pa-muted-2: #888888;
  --pa-line: rgba(255,255,255,0.08);
  --pa-line-2: rgba(255,255,255,0.12);
  --pa-rail: #111111;
  --pa-rail-hover: #1a1a1a;
  --pa-brand: #8B0101;
  --pa-brand-2: #a50101;
  --pa-brand-tint: rgba(139,1,1,0.15);
  --pa-accent: #c0392b;
  --pa-blue: #3b82f6;
  --pa-ok: #10B981;
  --pa-warn: #f59e0b;
  --pa-err: #ef4444;
}

body { background: var(--pa-bg); margin: 0; padding: 0; }

/* ---------- Shell ---------- */
.pa-app {
  display: grid;
  grid-template-columns: 68px 1fr;
  min-height: 100vh;
  font-family: 'Segoe UI', 'Inter', -apple-system, sans-serif;
  color: var(--pa-ink);
}
.pa-rail {
  background: var(--pa-rail);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0 14px;
  gap: 4px;
  position: sticky; top: 0; height: 100vh;
  z-index: 100;
}
.pa-rail-logo { background: #000; border: 1px solid var(--pa-line); border-radius: 6px; padding: 6px 5px; margin-bottom: 10px; }
.pa-rail-logo img { height: 26px; width: auto; display: block; }
.pa-rail-btn {
  background: transparent;
  border: 0;
  width: 54px;
  padding: 8px 4px;
  color: #d1d1d1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  border-radius: 6px;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 500;
  position: relative;
}
.pa-rail-btn:hover { background: var(--pa-rail-hover); color: white; }
.pa-rail-btn.active { color: white; background: var(--pa-rail-hover); }
.pa-rail-btn.active::before {
  content: ''; position: absolute; left: 3px; top: 14px; bottom: 14px;
  width: 2.5px; background: var(--pa-brand); border-radius: 3px;
}
.pa-rail-icon { display: flex; align-items: center; justify-content: center; }
.pa-rail-label { font-size: 10.5px; }
.pa-rail-user { margin-top: auto; padding-bottom: 20px; }
.pa-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--pa-brand); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; letter-spacing: .02em;
}
.pa-avatar.sm { width: 26px; height: 26px; font-size: 10.5px; }

.pa-main { min-width: 0; display: flex; flex-direction: column; }
.pa-appbar {
  height: 48px;
  background: rgba(26,26,26,0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--pa-line);
  display: flex; align-items: center;
  padding: 0 20px;
  gap: 16px;
  position: sticky; top: 0; z-index: 90;
}
.pa-appbar-left { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; }
.pa-appbar-title { display: flex; flex-direction: column; }
.pa-appbar-title strong { font-size: 13.5px; font-weight: 700; color: #fff; }
.pa-appbar-sub { font-size: 11.5px; color: var(--pa-muted); }
.pa-appbar-right { display: flex; align-items: center; gap: 14px; }

.pa-env {
  font-size: 11px; color: #fff; display: flex; align-items: center; gap: 5px;
  padding: 4px 10px; border: 1px solid rgba(255,255,255,0.1); border-radius: 4px; background: rgba(255,255,255,0.05);
}
.pa-env-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--pa-ok); display: inline-block; box-shadow: 0 0 6px var(--pa-ok); }

.pa-userchip { display: flex; align-items: center; gap: 8px; padding-left: 14px; border-left: 1px solid var(--pa-line); }
.pa-userchip-text { display: flex; flex-direction: column; line-height: 1.15; }
.pa-userchip-text strong { font-size: 12px; font-weight: 600; color: #fff; }
.pa-userchip-text span { font-size: 10.5px; color: var(--pa-muted); }

.pa-appbar-red {
  background: #8B0101;
  border-bottom: 1px solid #6b0000;
  color: white;
  height: 56px;
}
.pa-appbar-red .pa-appbar-title strong { color: white; }
.pa-appbar-red .pa-appbar-sub { color: rgba(255,255,255,0.75); }
.pa-appbar-logo { height: 28px; width: auto; margin-right: 14px; filter: brightness(0) invert(1); }

.pa-screen { flex: 1; background: var(--pa-bg); }

/* ---------- Form Screen Layout ---------- */
.pa-form-wrap { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 56px); }
.pa-sec-nav {
  background: var(--pa-surface); border-right: 1px solid var(--pa-line);
  padding: 16px 12px; position: sticky; top: 56px; height: calc(100vh - 56px);
  overflow-y: auto; display: flex; flex-direction: column; gap: 2px;
}
.pa-sec-nav-title { font-size: 10.5px; color: var(--pa-muted); font-weight: 600; text-transform: uppercase; padding: 4px 10px 8px; }
.pa-sec-nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 4px; color: var(--pa-ink-2); text-decoration: none; font-size: 13px; }
.pa-sec-nav a:hover { background: var(--pa-bg); }
.pa-sec-nav a.active { background: var(--pa-brand-tint); color: var(--pa-brand); font-weight: 600; }
.pa-sec-nav a .num { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: var(--pa-muted-2); min-width: 16px; }

.pa-form-main { min-width: 0; }
.pa-form-topbar {
  background: var(--pa-surface); border-bottom: 1px solid var(--pa-line);
  padding: 14px 28px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.pa-form-main .content { max-width: 1100px; padding: 24px 28px 120px; margin: 0 auto; }

/* ---------- Buttons & Actionbar ---------- */
.pa-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 16px; border-radius: 6px; border: 1px solid var(--pa-line-2);
  background: var(--pa-surface); color: white; cursor: pointer;
  font-family: inherit; font-size: 13.5px; font-weight: 500;
  transition: all 0.2s;
}
.pa-btn:hover { background: #2a2a2a; border-color: rgba(255,255,255,0.2); }
.pa-btn-primary { background: var(--pa-brand); border-color: var(--pa-brand-2); box-shadow: 0 4px 12px rgba(139,1,1,0.25); }
.pa-btn-primary:hover { background: var(--pa-brand-2); box-shadow: 0 6px 16px rgba(139,1,1,0.35); }

.pa-actionbar {
  position: fixed; bottom: 20px; left: calc(50% + 34px); transform: translateX(-50%);
  background: rgba(26, 26, 26, 0.9); backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 8px; padding: 12px 24px;
  display: flex; align-items: center; gap: 20px; z-index: 80;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.pa-actionbar .progress { font-size: 12px; color: var(--pa-muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Hamburger & Mobile ---------- */
.pa-hamburger {
  display: none;
  background: none; border: none; color: white; cursor: pointer; padding: 8px; margin-left: -8px; border-radius: 4px;
}
.pa-hamburger:hover { background: rgba(255,255,255,0.1); }

.pa-mobile-overlay {
  display: none;
  position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 95; backdrop-filter: blur(2px);
}

@media (max-width: 960px) {
  .pa-form-wrap { grid-template-columns: 1fr; }
  .pa-sec-nav { display: none; }
  .pa-actionbar { left: 50%; }
}

@media (max-width: 768px) {
  .pa-app { grid-template-columns: 1fr; }
  .pa-rail {
    position: fixed; left: -240px; top: 0; bottom: 0; width: 68px; z-index: 100;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 8px 0 24px rgba(0,0,0,0.5);
  }
  .pa-rail.open { left: 0; }
  .pa-hamburger { display: flex; align-items: center; justify-content: center; }
  .pa-mobile-overlay { display: none; }
  .mobile-menu-open .pa-mobile-overlay { display: block; }
  
  .pa-appbar { padding: 0 12px; }
  .pa-appbar-logo, .pa-appbar-right .pa-env, .pa-appbar-right .pa-userchip-text { display: none; }
  .pa-appbar-title strong { font-size: 13px; }
  
  .pa-form-topbar { padding: 12px 16px; flex-wrap: wrap; }
  .pa-form-main .content { padding: 16px 12px 100px; }
  
  .pa-actionbar {
    left: 12px; right: 12px; transform: none; bottom: 12px;
    padding: 10px 14px; gap: 12px;
    flex-direction: row; justify-content: space-between;
  }
  .pa-actionbar .progress { font-size: 10.5px; max-width: 140px; }
  .pa-btn { padding: 6px 12px; font-size: 12.5px; }
}

@media (max-width: 480px) {
  .pa-actionbar { flex-direction: column; align-items: stretch; gap: 8px; }
  .pa-actionbar .progress { max-width: none; text-align: center; }
  .pa-btn { width: 100%; }
}
