/* ============ Panel-specific styles (extends styles.css) ============ */

.panel-app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

/* Sidebar */
.p-side {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 20px 16px;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.p-side .brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.p-side .brand .mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--a1), var(--a2));
  display: grid; place-items: center;
  box-shadow: 0 6px 20px -6px rgba(124, 92, 255, 0.5);
}
.p-side .brand b { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.p-side .brand small { display: block; font-size: 10.5px; font-family: var(--font-mono); color: var(--ink-3); letter-spacing: 0.06em; text-transform: uppercase; margin-top: 2px; }

.p-side .group-label {
  font-size: 10.5px; font-family: var(--font-mono);
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-4); margin: 16px 8px 6px;
}

.p-nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  font-size: 13.5px; color: var(--ink-2);
  cursor: pointer; background: transparent; border: none;
  width: 100%; text-align: left; font-family: inherit;
  transition: all .15s;
}
.p-nav-item:hover { background: var(--surface-2); color: var(--ink); }
.p-nav-item.on { background: var(--a-soft); color: var(--a1); }
.p-nav-item svg { width: 16px; height: 16px; flex: none; }
.p-nav-item .badge-mini {
  margin-left: auto;
  font-size: 9.5px; font-family: var(--font-mono);
  padding: 2px 6px; border-radius: 4px;
  background: linear-gradient(135deg, var(--a1), var(--a2));
  color: #fff; letter-spacing: 0.06em;
}

.p-side .footer {
  margin-top: auto; padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 8px;
}
.p-side .user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: 10px;
  background: var(--surface-2);
}
.p-side .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #5b6bff, var(--a2));
  display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 12px;
  flex: none;
}
.p-side .user-card .meta { min-width: 0; }
.p-side .user-card .name { font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-side .user-card .id { font-size: 10.5px; font-family: var(--font-mono); color: var(--ink-3); }

/* Main */
.p-main { padding: 0; min-width: 0; }
.p-topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: 16px 32px;
  background: rgba(246, 244, 239, 0.78);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--line);
}
[data-theme="dark"] .p-topbar { background: rgba(26, 24, 48, 0.78); }
.p-topbar .crumbs {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--ink-3);
  font-family: var(--font-mono);
}
.p-topbar .crumbs span.curr { color: var(--ink); }
.p-topbar .crumbs .sep { color: var(--ink-4); }

.p-topbar .server-pick {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
  font-size: 13px;
  margin-left: auto;
  flex-shrink: 0;
  white-space: nowrap;
  color: var(--ink);
  font-family: inherit;
}
.p-topbar .server-pick:hover { border-color: rgba(124, 92, 255, 0.3); }
.p-topbar .server-pick .gicon {
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, var(--a1), var(--a2));
  display: grid; place-items: center; color: #fff; font-size: 10px; font-weight: 700;
}

.p-content { padding: 32px; max-width: 1200px; }

.p-page-h {
  margin-bottom: 32px;
}
.p-page-h h1 {
  font-family: var(--font-display); font-weight: 400;
  font-size: 44px; letter-spacing: -0.02em; margin: 0 0 8px;
  line-height: 1.05;
}
.p-page-h h1 em { color: var(--a1); font-style: italic; }
.p-page-h p { color: var(--ink-2); font-size: 15px; max-width: 600px; margin: 0; line-height: 1.5; }

/* Cards */
.p-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset, 0 4px 16px -8px rgba(20,19,42,0.06);
}
[data-theme="dark"] .p-card { box-shadow: 0 8px 24px -16px rgba(0,0,0,0.4); }
.p-card-h {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
  gap: 14px;
}
.p-card-h h3 {
  margin: 0; font-size: 14px; font-weight: 600;
  display: flex; align-items: center; gap: 10px;
}
.p-card-h h3 svg { color: var(--a1); width: 16px; height: 16px; flex: none; }
.btn svg { width: 16px; height: 16px; flex: none; }
.p-card-h .sub { font-size: 12px; color: var(--ink-3); }

/* Stat tiles */
.p-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.p-stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  position: relative; overflow: hidden;
}
.p-stat .label { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; font-family: var(--font-mono); }
.p-stat .value {
  font-family: var(--font-display); font-weight: 400;
  font-size: 38px; line-height: 1; letter-spacing: -0.02em; margin-top: 8px;
}
.p-stat .value small { font-size: 14px; color: var(--ink-3); margin-left: 4px; font-family: var(--font-sans); }
.p-stat .delta {
  margin-top: 8px; font-size: 11.5px; font-family: var(--font-mono);
  display: inline-flex; align-items: center; gap: 4px;
}
.p-stat .delta.up { color: var(--good); }
.p-stat .delta.down { color: #ff5566; }
.p-stat.featured {
  background: linear-gradient(135deg, rgba(124,92,255,0.10), rgba(255,79,161,0.04));
  border-color: rgba(124,92,255,0.25);
}
.p-stat.featured .value { color: var(--a1); }
@media (max-width: 980px) { .p-stats { grid-template-columns: repeat(2, 1fr); } }

/* Two-col grid for cards */
.p-grid { display: grid; gap: 18px; }
.p-grid-2 { grid-template-columns: 1.4fr 1fr; }
.p-grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 980px) { .p-grid-2, .p-grid-3 { grid-template-columns: 1fr; } }

/* Toggle row */
.p-toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0;
  gap: 14px;
}
.p-toggle-row + .p-toggle-row { border-top: 1px solid var(--line); }
.p-toggle-row .info { min-width: 0; }
.p-toggle-row .info .name { font-size: 14px; font-weight: 500; margin-bottom: 2px; }
.p-toggle-row .info .desc { font-size: 12.5px; color: var(--ink-3); line-height: 1.45; }

/* Form fields */
.p-field {
  display: flex; flex-direction: column; gap: 6px;
}
.p-field label {
  font-size: 11.5px; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: 0.08em;
  font-family: var(--font-mono);
}
.p-input, .p-select {
  height: 40px; padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 14px; font-family: inherit;
  transition: border-color .15s;
}
.p-input:focus, .p-select:focus { outline: none; border-color: var(--a1); }

/* Activity feed */
.p-feed { display: flex; flex-direction: column; gap: 0; }
.p-feed-item {
  display: grid; grid-template-columns: 28px 1fr auto; gap: 12px;
  padding: 12px 0;
  align-items: center;
}
.p-feed-item + .p-feed-item { border-top: 1px solid var(--line); }
.p-feed-item .ic-w {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--a-soft); color: var(--a1);
  display: grid; place-items: center;
}
.p-feed-item .text { font-size: 13px; }
.p-feed-item .text b { font-weight: 600; }
.p-feed-item .time { font-size: 11.5px; color: var(--ink-4); font-family: var(--font-mono); }

/* Mini chart */
.p-chart {
  display: flex; align-items: flex-end; gap: 4px;
  height: 120px; padding: 8px 0;
}
.p-chart .bar {
  flex: 1; min-height: 4px;
  background: linear-gradient(180deg, var(--a1), var(--a2));
  border-radius: 4px 4px 0 0;
  opacity: 0.85;
  transition: opacity .15s;
}
.p-chart .bar:hover { opacity: 1; }
.p-chart .bar.muted { background: var(--ink-4); opacity: 0.3; }

/* Now playing strip */
.np-strip {
  display: flex; align-items: center; gap: 14px;
  padding: 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, #1a1838, #14132a);
  color: #fff;
  position: relative; overflow: hidden;
}
.np-strip .cover-mini {
  width: 56px; height: 56px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, #ff4fa1, #7c5cff 60%, #5b6bff);
}
.np-strip .info { flex: 1; min-width: 0; }
.np-strip .info .now { font-size: 10.5px; color: rgba(255,255,255,0.55); text-transform: uppercase; letter-spacing: 0.08em; font-family: var(--font-mono); margin-bottom: 4px; }
.np-strip .info .title { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-strip .info .artist { font-size: 12.5px; color: rgba(255,255,255,0.65); }
.np-strip .ctrls { display: flex; gap: 4px; }
.np-strip .ctrls button {
  width: 36px; height: 36px; border-radius: 10px;
  background: rgba(255,255,255,0.08); border: none;
  color: #fff; cursor: pointer; display: grid; place-items: center;
}
.np-strip .ctrls button.play { background: #fff; color: #14132a; }

/* Command builder */
.cmd-list { display: flex; flex-direction: column; gap: 10px; }
.cmd-list-item {
  display: grid; grid-template-columns: auto 1fr auto auto; gap: 14px;
  align-items: center;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.cmd-list-item .key {
  font-family: var(--font-mono); font-size: 12.5px;
  background: var(--bg-3); color: var(--a1);
  padding: 5px 10px; border-radius: 6px;
}
.cmd-list-item .desc { font-size: 13px; color: var(--ink-2); }
.cmd-list-item .role {
  font-size: 11px; font-family: var(--font-mono); color: var(--ink-3);
  padding: 4px 9px; border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
}

/* Plan card */
.plan-banner {
  background: linear-gradient(135deg, #1a1838, #2a274d 60%, #1a1838);
  color: #fff;
  padding: 32px;
  border-radius: 16px;
  display: grid; grid-template-columns: 1fr auto; gap: 20px;
  align-items: center;
  position: relative; overflow: hidden;
}
.plan-banner::before {
  content: ""; position: absolute;
  inset: -50% -20% auto auto; width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(124,92,255,0.4), transparent 60%);
  pointer-events: none;
}
.plan-banner .name {
  font-size: 11px; font-family: var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase;
  color: #b8a6ff; margin-bottom: 6px;
}
.plan-banner h2 {
  font-family: var(--font-display); font-weight: 400;
  font-size: 36px; letter-spacing: -0.02em; margin: 0 0 6px;
}
.plan-banner p { color: rgba(255,255,255,0.65); font-size: 13.5px; margin: 0; max-width: 500px; line-height: 1.5; }
.plan-banner .right { text-align: right; position: relative; z-index: 1; }
.plan-banner .renew { font-size: 12px; color: rgba(255,255,255,0.6); font-family: var(--font-mono); }
.plan-banner .days {
  font-family: var(--font-display); font-weight: 400;
  font-size: 64px; line-height: 1; letter-spacing: -0.03em;
  color: #fff;
}
.plan-banner .days small { font-size: 14px; color: rgba(255,255,255,0.6); margin-left: 4px; font-family: var(--font-sans); }

/* License box */
.license-input {
  display: flex; gap: 8px; align-items: center;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.license-input .key {
  flex: 1; font-family: var(--font-mono); font-size: 13px;
  color: var(--ink-2); letter-spacing: 0.04em;
  background: transparent; border: none; padding: 6px 8px;
}
.license-input .status {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-family: var(--font-mono);
  color: var(--good);
  padding: 5px 10px; border-radius: 999px;
  background: rgba(28, 183, 119, 0.10);
}
.license-input .status .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--good); box-shadow: 0 0 8px var(--good); }

/* Mobile */
@media (max-width: 880px) {
  .panel-app { grid-template-columns: 1fr; }
  .p-side {
    position: fixed; top: 0; left: -280px; width: 260px; height: 100vh; z-index: 100;
    transition: left .25s;
  }
  .p-side.open { left: 0; }
  .p-content { padding: 20px; }
  .p-topbar { padding: 14px 20px; }
}

/* burger button */
.burger {
  display: none;
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line-strong);
  align-items: center; justify-content: center;
  cursor: pointer; color: var(--ink);
}
@media (max-width: 880px) { .burger { display: inline-flex; } }
