:root {
  --bg: #05070a;
  --bg-elev: #090d12;

  --panel: #10151d;
  --panel-alt: #151b22;

  --text: #f5f7ff;
  --text-muted: #9ea6bb;

  --border-soft: rgba(255,255,255,.04);
  --border: rgba(255,255,255,.08);
  --border-strong: rgba(255,255,255,.16);

/* Input underline + glow tuning (ported from site.css) */
--underline-thickness: 2px;
--input-glow-alpha: .24;
--input-glow-height: 10%;
--input-bloom-blur: 12px;
--input-bloom-offset: -10px;
--input-bloom-alpha: .22;


  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --accent: #ff6a2a;        /* warm */
  --accent-cyan: #22d3ee;   /* neon */

/* Aliases to support legacy underline glow styles */
--accent-2: var(--accent-cyan);
--accent-2-rgb: 34,211,238;

  --success: #22c55e;
  --danger:  #ef4444;

  --t-fast: 0.14s ease-out;
  --t-med:  0.20s ease-out;

  /* Honeycomb */
  --hc-size: 24px;
  --hc-fill: rgba(245,73,39,.032);

  color-scheme: dark;
}

/* ---------------------- Reset ---------------------- */

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

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

/* ---------------------- Background ---------------------- */

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);

  background:
    radial-gradient(900px 600px at 75% -10%, rgba(34,211,238,.08), transparent 65%),
    radial-gradient(800px 600px at -10% 110%, rgba(255,106,42,.06), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 173' width='100' height='173'%3E%3Cpolygon fill='rgba(255,255,255,.032)' points='50,34.75 93.5,59.75 93.5,109.75 50,134.75 6.5,109.75 6.5,59.75'/%3E%3Cpolygon fill='rgba(255,255,255,.032)' points='0,-50 43.5,-25 43.5,25 0,50 -43.5,25 -43.5,-25'/%3E%3Cpolygon fill='rgba(255,255,255,.032)' points='100,-50 143.5,-25 143.5,25 100,50 56.5,25 56.5,-25'/%3E%3Cpolygon fill='rgba(255,255,255,.032)' points='0,123 43.5,148 43.5,198 0,223 -43.5,198 -43.5,148'/%3E%3Cpolygon fill='rgba(255,255,255,.032)' points='100,123 143.5,148 143.5,198 100,223 56.5,198 56.5,148'/%3E%3C/svg%3E")
      center / var(--hc-size) auto repeat,
    linear-gradient(180deg, var(--bg), #020306);
  background-attachment: fixed;
}

/* ---------------------- Shell Layout ---------------------- */

.pm-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------------------- Topbar ---------------------- */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 1.3rem;
  background: rgba(3,4,6,.98);
  border-bottom: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 14px 30px rgba(0,0,0,.9);
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-pill {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 30% 15%, #ffffff, transparent 55%),
    radial-gradient(circle at 0 100%, #22d3ee, transparent 65%),
    radial-gradient(circle at 100% 100%, #ff6a2a, transparent 60%);
  box-shadow: 0 0 10px rgba(34,211,238,.7);
}

.top-title {
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.top-subtitle {
  font-size: 12px;
  font-weight: 600;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.badge {
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: rgba(0,0,0,.96);
}

.user-button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(4,5,7,.98);
  color: var(--text);
  font-size: 11px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0,0,0,.8);
  transition: all var(--t-med);
}
.user-button:hover {
  border-color: var(--accent);
  box-shadow: 0 10px 26px rgba(0,0,0,.9);
  transform: translateY(-1px);
}

.user-avatar-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34,197,94,.9);
}

/* dropdown */

.user-menu {
  position: absolute;
  right: 1.3rem;
  top: 2.6rem;
  min-width: 160px;
  padding: 0.3rem 0;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(3,4,6,.98);
  box-shadow: 0 18px 40px rgba(0,0,0,.9);
  backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: all var(--t-med);
  z-index: 45;
}
.user-menu.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.user-menu-item {
  padding: 0.3rem 0.7rem;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
}
.user-menu-item .label {
  font-weight: 600;
  color: var(--text);
}
.user-menu-item:hover {
  background: rgba(255,255,255,.04);
  color: var(--text);
}
.user-menu-sep {
  margin: 0.2rem 0.5rem;
  border-top: 1px solid var(--border-soft);
}

/* ---------------------- Main Layout ---------------------- */

.pm-main {
  flex: 1;
  display: flex;
  align-items: stretch;
}

/* Sidebar with fade */

.leftbar {
  flex: 0 0 185px;
  padding: 0.75rem 0.45rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;

  /* this is the important fade */
  background: linear-gradient(
    90deg,
    rgba(0,0,0,0.98) 0%,
    rgba(0,0,0,0.9) 30%,
    rgba(0,0,0,0.65) 55%,
    rgba(0,0,0,0.35) 80%,
    rgba(0,0,0,0) 100%
  );
  border-right: 1px solid rgba(255,255,255,.06);
  box-shadow: 12px 0 28px rgba(0,0,0,.9);
  z-index: 10;
}

.section-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--text-muted);
  padding: 0.3rem 0.6rem 0.15rem;
}

.nav-list {
  list-style: none;
  padding: 0.1rem 0.4rem 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;        /* to allow outline look */
  transition: all var(--t-fast);
}

.nav-item-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(148,163,253,.28);
}

.nav-item:hover {
  color: var(--text);
  background: rgba(255,255,255,.04);
}

.nav-item.active {
  color: var(--text);
  background: rgba(10,12,16,.98);
  border-color: var(--border-strong);     /* outlined pill like before */
  box-shadow: 0 6px 16px rgba(0,0,0,.9);
}

.nav-item.active .nav-item-dot {
  background: var(--accent);
  box-shadow: 0 0 7px rgba(255,106,42,.95);
}

/* Main content */

.main {
  flex: 1;
  padding: 1.6rem 2.0rem 2.4rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  overflow-y: auto;
}

/* ---------------------- Cards ---------------------- */

.card {
  position: relative;
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-soft);
  padding: 1.1rem 1.35rem 1.25rem;
  background:
    radial-gradient(circle at 0 0, rgba(255,255,255,.04), transparent 70%),
    radial-gradient(circle at 100% 0, rgba(34,211,238,.03), transparent 70%),
    linear-gradient(180deg, var(--panel), var(--panel-alt));
  box-shadow: 0 14px 32px rgba(0,0,0,.7);
}

.card h1,
.card h2,
.card h3 {
  margin: 0 0 0.4rem;
  font-weight: 600;
  letter-spacing: .02em;
}

.card p {
  margin: 0.1rem 0 0.3rem;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.row > .card {
  flex: 1 1 260px;
  margin: 0;
  box-shadow: none;
  background:
    radial-gradient(circle at 0 0, rgba(255,255,255,.02), transparent 70%),
    linear-gradient(180deg, #0b0f16, #090c12);
}

/* For SPA view switching */
.view-hidden {
  display: none;
}

/* ---------------------- Forms ---------------------- */

label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text-muted);
  margin: 0 0 0.18rem;
}

/* Base field (fill) shared by .input/.select/textarea; underline + glow layered in background */
.input,.select,textarea{
  width:100%; display:block;
  border:1px solid var(--border);
  color:var(--text);
  padding:.70rem .85rem;
  border-radius:12px;
  outline:none;
  background: linear-gradient(180deg, #0c1117, #0b0f14);
  transition: background-size .20s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
  box-shadow: inset 0 -1px 0 rgba(255,255,255,.06);
}
.theme-light .input,.theme-light .select,.theme-light textarea{
  background: linear-gradient(180deg,#fff,#f7fafc);
}

/* Bottom-only inner glow + animated underline */
.input{
  background:
    /* 1) inner gradient glow (hidden by height 0; revealed on focus) */
    linear-gradient(
      to top,
      rgba(var(--accent-2-rgb), var(--input-glow-alpha)) 0%,
      rgba(var(--accent-2-rgb), 0) var(--input-glow-height)
    ) 0 100% / 100% 0 no-repeat,
    /* 2) underline (hidden by width 0; animates on focus) */
    linear-gradient(var(--accent-2), var(--accent-2)) 0 100% / 0 var(--underline-thickness) no-repeat,
    /* 3) field fill */
    linear-gradient(180deg, #0c1117, #0b0f14);
}
.theme-light .input{
  background:
    linear-gradient(
      to top,
      rgba(var(--accent-2-rgb), var(--input-glow-alpha)) 0%,
      rgba(var(--accent-2-rgb), 0) var(--input-glow-height)
    ) 0 100% / 100% 0 no-repeat,
    linear-gradient(var(--accent-2), var(--accent-2)) 0 100% / 0 var(--underline-thickness) no-repeat,
    linear-gradient(180deg,#fff,#f7fafc);
}

.input:hover{border-color:var(--border-strong)}
.input:focus{
  border-color:var(--border);
  background-size: 100% 100%, 100% var(--underline-thickness), auto;
  box-shadow:
    inset 0 -1px 0 rgba(255,255,255,.08),
    inset 0 var(--input-bloom-offset) var(--input-bloom-blur) rgba(var(--accent-2-rgb), var(--input-bloom-alpha));
}



/* ---------------------- Buttons ---------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.46rem 1.15rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #090d14, #05070b);
  color: var(--text);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .12em;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--t-med);
}
.btn:hover {
  border-color: var(--border-strong);
  box-shadow: 0 8px 20px rgba(0,0,0,.8);
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(0,0,0,.9);
}

.btn-primary {
  border-color: transparent;
  background: radial-gradient(80% 150% at 50% 0%, #ff874c, #ff6a2a);
  color: #fff;
  box-shadow: 0 8px 22px rgba(255,106,42,.42);
  font-weight: 700;
}
.btn-primary:hover {
  box-shadow: 0 12px 30px rgba(255,106,42,.5);
}

.btn-danger {
  background: linear-gradient(180deg, #ef4444, #b91c1c);
  border-color: transparent;
  color: #fff;
}

/* Actions row */
.actions {
  display: flex;
  gap: 0.55rem;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}

/* ---------------------- Tables & misc ---------------------- */

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.75rem;
  font-size: 12px;
}
.table th,
.table td {
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
}
.table th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--text-muted);
}

.toast-container {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1000;
}

.muted { color: var(--text-muted); }

a {
  color: #9b8cff;
  text-decoration: none;
}
a:hover { text-decoration: underline; }

/* ---------------------- Responsive ---------------------- */

@media (max-width: 768px) {
  .topbar {
    padding: 0.4rem 0.9rem;
  }

  .pm-main {
    flex-direction: column;
  }

  .leftbar {
    flex: 0 0 auto;
    width: 100%;
    flex-direction: row;
    align-items: center;
    padding: 0.5rem 0.5rem;
    background: radial-gradient(circle at 0 0, rgba(0,0,0,.98), transparent 85%);
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,.06);
    box-shadow: 0 10px 24px rgba(0,0,0,.9);
    overflow-x: auto;
  }

  .section-label {
    display: none;
  }

  .nav-list {
    flex-direction: row;
    gap: 0.3rem;
    padding: 0;
    width: 100%;
  }

  .nav-item {
    padding: 0.25rem 0.7rem;
  }

  .main {
    padding: 1.1rem 0.9rem 1.6rem;
  }
}
