/* D-ADMIN-SHELL-1 / D69 — left sidebar app shell (Explee clone tokens). */
:root {
  color-scheme: dark;
  --bg: #0d1213;
  --panel: #141b1d;
  --line: #2a3639;
  --text: #eff3ee;
  --muted: #a5b4b5;
  --green: #d5f879;
  --danger: #ffb4b4;
  --sidebar: 240px;
  --rail: 56px;
}
* { box-sizing: border-box; }
html, body { margin: 0; max-width: 100%; overflow-x: hidden; }
body.app-shell {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}
.skip {
  position: absolute; left: 12px; top: -80px; z-index: 40;
  padding: 10px 12px; background: var(--green); color: var(--bg); text-decoration: none;
}
.skip:focus { top: 10px; }

.app-frame { display: flex; min-height: 100vh; }
.app-sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar);
  display: flex; flex-direction: column;
  background: #101618; border-right: 1px solid var(--line); z-index: 20;
  padding: 18px 12px 14px;
}
.app-sidebar-top { padding: 4px 8px 18px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.app-brand {
  display: flex; align-items: center; gap: 10px; text-decoration: none;
  font-size: 20px; font-weight: 650; letter-spacing: -1px;
}
.brandmark {
  background: var(--green); color: var(--bg); height: 30px; width: 30px;
  border-radius: 8px; text-align: center; line-height: 31px;
  font-size: 20px; font-weight: 800; letter-spacing: -2px; flex: 0 0 auto;
}
.branddot { color: var(--green); }
.app-switcher {
  margin: 10px 0 0; font-size: 11px; color: var(--muted); letter-spacing: 0.04em;
}
.app-sidebar-nav { display: flex; flex-direction: column; gap: 16px; overflow: auto; flex: 1; }
.app-nav-heading {
  margin: 0 0 8px 10px; font-size: 10px; letter-spacing: 1.5px;
  text-transform: uppercase; color: #7f9193; font-weight: 600;
}
.app-nav-group { display: flex; flex-direction: column; gap: 4px; }
.app-nav-item {
  display: flex; align-items: center; gap: 10px; text-decoration: none;
  color: var(--muted); padding: 10px 12px; border-radius: 8px; font-size: 13px;
  border: 1px solid transparent;
}
.app-nav-item:hover { color: var(--text); background: #1a2325; }
.app-nav-item[aria-current="page"] {
  color: var(--green); background: #243126; border-color: #34432b;
}
.app-nav-icon {
  width: 28px; height: 22px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; letter-spacing: 0.04em; color: inherit; flex: 0 0 auto;
}
.app-sidebar-bottom { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.app-account summary {
  list-style: none; cursor: pointer; display: flex; gap: 10px; align-items: center;
  padding: 8px; border-radius: 8px;
}
.app-account summary::-webkit-details-marker { display: none; }
.app-avatar {
  width: 34px; height: 34px; border-radius: 50%; background: #243126; color: var(--green);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
}
.app-account-meta { display: flex; flex-direction: column; min-width: 0; }
.app-account-meta strong { font-size: 12px; font-weight: 600; }
.app-account-meta span {
  font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px;
}
.app-account ul {
  list-style: none; margin: 8px 0 0; padding: 8px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--panel);
}
.app-account li a {
  display: block; text-decoration: none; color: var(--muted); font-size: 12px; padding: 7px 8px; border-radius: 6px;
}
.app-account li a:hover { color: var(--text); background: #1a2325; }

.app-main-wrap {
  margin-left: var(--sidebar); flex: 1; min-width: 0;
  display: flex; flex-direction: column; min-height: 100vh;
}
.app-mobile-bar { display: none; }
.app-main {
  flex: 1; width: 100%; max-width: none; padding: 28px 32px 40px;
}
.app-footer {
  border-top: 1px solid var(--line); display: flex; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; padding: 18px 32px 28px; font-size: 12px; color: var(--muted);
}
.app-footer nav { display: flex; gap: 14px; }
.app-footer a { text-decoration: none; }
.app-footer strong { color: var(--text); font-weight: 500; }

.app-status, .notice {
  background: #2a1c1c; border: 1px solid #5a3030; color: var(--danger);
  padding: 0.7rem 1rem; border-radius: 8px; margin: 0 0 16px;
}
.app-status.ok {
  background: #1a2618; border-color: #34432b; color: var(--green);
}
.eyebrow {
  color: var(--green); font-size: 10px; letter-spacing: 1.8px; font-weight: 600; margin: 0 0 12px;
}
h1 { font-size: clamp(28px, 3.2vw, 38px); font-weight: 550; letter-spacing: -1.2px; margin: 0 0 10px; line-height: 1.15; }
h2 { font-size: 1.25rem; font-weight: 550; margin: 0 0 12px; }
h3 { font-size: 1.05rem; font-weight: 550; margin: 1.1rem 0 0.4rem; }
p { color: var(--muted); margin: 0 0 0.85rem; }
.subtitle { font-size: 15px; max-width: 48rem; }
.hint { font-size: 13px; color: var(--muted); }
.empty {
  border: 1px dashed var(--line); border-radius: 10px; padding: 18px 16px;
  color: var(--muted); background: #101618;
}
.module {
  border: 1px solid var(--line); border-radius: 14px; background: var(--panel);
  padding: 22px 22px; margin: 0 0 18px;
}
.paper-banner {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12px;
  color: var(--muted); margin: 0 0 14px;
}
.dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--green);
}
.bt-form {
  display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: end; margin: 0 0 8px;
}
.bt-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 550; color: var(--text); }
.bt-form select, .bt-form input {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: #0d1213; color: var(--text); font: inherit;
}
.primary {
  display: inline-flex; align-items: center; background: var(--green); border: 1px solid var(--green);
  color: #172110; text-decoration: none; border-radius: 8px; font-weight: 550; font-size: 13px;
  padding: 11px 16px; cursor: pointer; font-family: inherit;
}
.bt-metrics {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 14px 0;
}
.bt-metrics div {
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #101618;
}
.bt-metrics dt { font-size: 11px; color: var(--muted); margin: 0 0 4px; }
.bt-metrics dd { margin: 0; font-size: 20px; font-weight: 550; color: var(--text); font-variant-numeric: tabular-nums; }
.bt-curve svg { width: 100%; height: auto; display: block; background: #0a0f10; border-radius: 8px; }
.bt-curve polyline { fill: none; stroke: var(--green); stroke-width: 2; }
.bt-curve figcaption { font-size: 12px; color: var(--muted); margin-top: 8px; }
.bt-trades { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.bt-trades th, .bt-trades td {
  text-align: left; padding: 0.5rem 0.4rem; border-bottom: 1px solid var(--line); vertical-align: top;
}
.bt-trades th { color: var(--muted); font-weight: 500; }
.app-paper-pill { font-size: 10px; letter-spacing: 0.8px; color: var(--muted); }

/* Collapsed rail on mid widths */
@media (max-width: 1100px) and (min-width: 861px) {
  :root { --sidebar: var(--rail); }
  .app-brand-text, .app-switcher, .app-nav-heading, .app-nav-label,
  .app-account-meta, .app-account ul { display: none; }
  .app-nav-item { justify-content: center; padding: 10px 8px; }
  .app-sidebar { padding: 14px 8px; }
  .app-account summary { justify-content: center; }
}

/* Phone: left drawer */
@media (max-width: 860px) {
  .app-sidebar {
    position: fixed; transform: translateX(-105%); transition: transform 0.18s ease;
    width: min(280px, 86vw); box-shadow: none;
  }
  .app-sidebar:target { transform: translateX(0); box-shadow: 8px 0 24px rgba(0, 0, 0, 0.35); }
  .app-main-wrap { margin-left: 0; }
  .app-mobile-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0;
    background: var(--bg); z-index: 15;
  }
  .app-menu-btn {
    text-decoration: none; border: 1px solid var(--line); border-radius: 8px;
    padding: 8px 12px; font-size: 13px; color: var(--text);
  }
  .app-main { padding: 22px 16px 36px; }
  .app-footer { padding: 16px; flex-direction: column; }
  .app-brand-text, .app-switcher, .app-nav-heading, .app-nav-label, .app-account-meta { display: initial; }
  .app-nav-label { display: inline; }
  :root { --sidebar: 240px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
