/* Agent portal style "Command Center": fixed indigo sidebar, compact data-dense pages. Loaded after portal.css
   (lib/portal_themes.php). Every rule is scoped to html.pt-command. The sidebar is desktop only (1000px+) and
   only when signed in (body.p-in); narrower screens get an indigo top bar. */
html.pt-command {
  --navy: #1e1b4b; --navy-2: #4f46e5; --ink: #181a2e; --ink-2: #4b4f6e; --muted: #7a7e9c;
  --line: #e3e4f0; --bg: #f2f3f9; --card: #fff; --cta: #6d28d9; --cta-hover: #5b21b6;
  --live: #e11d48; --focus: #6366f1; --radius: 6px;
  --cc-side: #1e1b4b; --cc-side-2: #2a2666; --cc-side-ink: #c7c9f5; --cc-w: 244px;
  --cc-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}
.pt-command body { font: 14px/1.5 "IBM Plex Sans", Inter, system-ui, sans-serif; }
.pt-command h1 { font-size: 1.35rem; font-weight: 700; letter-spacing: -.01em; }
.pt-command .p-card > h2:first-child, .pt-command .p-table-card > h2, .pt-command .p-today-h h2, .pt-command .p-section-head h2 {
  font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--muted);
}
.pt-command .p-main { padding-top: 20px; }

/* Numbers in mono, like a terminal */
.pt-command .p-balance strong, .pt-command .p-price strong, .pt-command .p-today-stat strong, .pt-command .p-balance-card strong, .pt-command .p-plan-price strong,
.pt-command .p-route-summary strong, .pt-command .p-num, .pt-command .p-buy .p-btn strong, .pt-command .p-live, .pt-command .ls-stat b { font-family: var(--cc-mono); letter-spacing: -.02em; }

/* Top bar (phones, tablets, and signed-out pages) */
.pt-command .p-top { background: var(--cc-side); border-bottom: 0; }
.pt-command .p-brand { color: #fff; }
.pt-command .p-brand em { color: #a5a8e6; }
.pt-command .p-brand svg path { fill: #a78bfa; }
.pt-command .p-brand svg .tick { stroke: var(--cc-side); }
.pt-command .p-balance { background: rgba(253, 230, 138, .12); color: #fde68a; }
.pt-command .p-me { color: var(--cc-side-ink); }
.pt-command .p-me:hover, .pt-command .p-me.on { background: var(--cc-side-2); color: #fff; }
.pt-command .p-logout button { border-color: rgba(255, 255, 255, .22); color: var(--cc-side-ink); }
.pt-command .p-burger { color: #fff !important; }
.pt-command .p-nav a { color: var(--cc-side-ink); }
.pt-command .p-nav a:hover { color: #fff; }
.pt-command .p-nav a.on { color: #fff; border-bottom-color: #a78bfa; }
@media (max-width: 759px) {
  .pt-command .p-top.p-js .p-nav a { border-top-color: rgba(255, 255, 255, .08); }
  .pt-command .p-top.p-js .p-nav a.on { background: var(--cc-side-2); border-left-color: #a78bfa; }
  .pt-command .p-nav-me small { color: #a5a8e6; }
  .pt-command .p-top.p-js .p-nav-logout { border-top-color: rgba(255, 255, 255, .08); }
  .pt-command .p-nav-logout button { color: #fda4af; }
}

/* Sidebar */
@media (min-width: 1000px) {
  .pt-command body.p-in { padding-left: var(--cc-w); }
  .pt-command body.p-in .p-top { position: fixed; top: 0; bottom: 0; left: 0; width: var(--cc-w); z-index: 40; display: flex; flex-direction: column; overflow-y: auto;
    background: linear-gradient(180deg, #1e1b4b 0%, #1a1740 100%); box-shadow: inset -1px 0 0 rgba(255, 255, 255, .06); }
  .pt-command body.p-in .p-top-inner { display: contents; }
  .pt-command body.p-in .p-brand { order: 0; margin: 0; padding: 18px 18px 16px; border-bottom: 1px solid rgba(255, 255, 255, .08); font-size: .95rem; }
  .pt-command body.p-in .p-brand span { white-space: normal; line-height: 1.25; }
  .pt-command body.p-in .p-brand em { display: block; margin: 2px 0 0; font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; }
  .pt-command body.p-in .p-nav { order: 1; flex: 1; display: flex; flex-direction: column; gap: 2px; max-width: none; width: auto; margin: 0; padding: 12px 10px; overflow: visible; }
  .pt-command body.p-in .p-nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 6px; font-weight: 500; font-size: .9rem; }
  .pt-command body.p-in .p-nav a:hover { background: rgba(255, 255, 255, .06); }
  .pt-command body.p-in .p-nav a.on { background: rgba(167, 139, 250, .16); color: #fff; box-shadow: inset 3px 0 0 #a78bfa; font-weight: 600; }
  .pt-command body.p-in .p-balance { order: 2; margin: 0 12px 8px; justify-content: space-between; padding: 10px 12px; border: 1px solid rgba(253, 230, 138, .25); }
  .pt-command body.p-in .p-balance span { display: inline; text-transform: uppercase; letter-spacing: .08em; font-size: .68rem; color: #d6c98a; }
  .pt-command body.p-in .p-me { order: 3; margin: 0 12px 8px; border-radius: 6px; padding: 6px 8px; }
  .pt-command body.p-in .p-me-name { max-width: 150px; }
  .pt-command body.p-in .p-logout { order: 4; margin: 0 12px 16px; }
  .pt-command body.p-in .p-logout button { width: 100%; padding: 7px 10px; }
  .pt-command body.p-in .p-main { max-width: 1320px; padding-left: 28px; padding-right: 28px; }
  .pt-command body.p-in .p-footer .p-wrap { max-width: 1320px; padding: 0 28px; }
  .pt-command body.p-in .p-bulk { left: var(--cc-w); }
  /* Menu icons */
  .pt-command body.p-in .p-nav a { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3C/svg%3E"); }
  .pt-command body.p-in .p-nav a::before { content: ""; flex: none; width: 17px; height: 17px; background: currentColor; opacity: .75;
    -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
  .pt-command body.p-in .p-nav a.on::before { opacity: 1; }
  .pt-command .p-nav a[href^="today"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 2v3M17 2v3M3 9h18M5 5h14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2z' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E") !important; }
  .pt-command .p-nav a[href^="index"], .pt-command .p-nav a[href="map.php"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 4h2l2.4 11h11.2L21 7H6.2M9 20a1 1 0 1 0 0-.1M18 20a1 1 0 1 0 0-.1' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E") !important; }
  .pt-command .p-nav a[href^="my-leads"], .pt-command .p-nav a[href^="map.php?view=mine"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M16 20v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2M9 10a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM22 20v-2a4 4 0 0 0-3-3.9M16 2.1a4 4 0 0 1 0 7.8' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E") !important; }
  .pt-command .p-nav a[href^="lead-match"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2 3 6v6c0 5 3.8 9.4 9 10 5.2-.6 9-5 9-10V6z M8.5 12l2.5 2.5 4.5-5' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E") !important; }
  .pt-command .p-nav a[href^="uw-library"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 19.5A2.5 2.5 0 0 1 6.5 17H20V3H6.5A2.5 2.5 0 0 0 4 5.5v14zM4 19.5A2.5 2.5 0 0 0 6.5 22H20v-5' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E") !important; }
  .pt-command .p-nav a[href^="results"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 3v18h18M7 15l4-4 3 3 6-6' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E") !important; }
  .pt-command .p-nav a[href^="auto-buy"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M13 2 4 14h7l-1 8 9-12h-7z' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E") !important; }
  .pt-command .p-nav a[href^="import"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E") !important; }
  .pt-command .p-nav a[href^="funds"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 7h18v12H3zM3 7l2-3h14l2 3M16 13h2' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E") !important; }
  .pt-command .p-nav a[href^="plans"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m12 2 3 6.3 7 1-5 4.8 1.2 6.9L12 17.8 5.8 21l1.2-6.9-5-4.8 7-1z' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E") !important; }
  .pt-command .p-nav a[href^="team"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3v6M12 9 5 15M12 9l7 6M5 15v3M19 15v3M12 9v9' fill='none' stroke='black' stroke-width='2'/%3E%3Ccircle cx='12' cy='3' r='2'/%3E%3Ccircle cx='5' cy='20' r='2'/%3E%3Ccircle cx='12' cy='20' r='2'/%3E%3Ccircle cx='19' cy='20' r='2'/%3E%3C/svg%3E") !important; }
  .pt-command .p-nav a[href^="areas"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 22s7-6.2 7-12a7 7 0 0 0-14 0c0 5.8 7 12 7 12z' fill='none' stroke='black' stroke-width='2'/%3E%3Ccircle cx='12' cy='10' r='2.5'/%3E%3C/svg%3E") !important; }
  .pt-command .p-nav a[href^="licenses"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 5h18v14H3zM7 10h6M7 14h4' fill='none' stroke='black' stroke-width='2'/%3E%3Ccircle cx='17' cy='12' r='2'/%3E%3C/svg%3E") !important; }
}

/* Dense surfaces */
.pt-command .p-card, .pt-command .p-lead, .pt-command .p-plan, .pt-command .p-today-stat, .pt-command .p-map-results, .pt-command .p-filters, .pt-command .p-price {
  border-color: var(--line); border-radius: 6px; box-shadow: 0 1px 2px rgba(24, 26, 46, .05);
}
.pt-command .p-card { padding: 16px 18px; }
.pt-command .p-lead { padding: 14px; }
.pt-command .p-table { font-size: .84rem; }
.pt-command .p-table th, .pt-command .p-table td { padding: 7px 12px; }
.pt-command .p-table th { background: #f7f7fc; color: var(--muted); font-size: .68rem; letter-spacing: .08em; }
.pt-command .p-table tbody tr:nth-child(even) td { background: #fafafe; }
.pt-command .p-table tbody tr:hover td { background: #f1f0ff; }
.pt-command .p-today-stat { border-left: 3px solid var(--navy-2); }
.pt-command .p-today-stat.p-alert-stat { border-left-color: var(--live); }
.pt-command .p-today-stat strong, .pt-command .p-price strong { color: var(--ink); }
.pt-command .p-today-stat span, .pt-command .p-price span { text-transform: uppercase; letter-spacing: .07em; font-size: .68rem; }
.pt-command .p-balance-card strong { color: var(--cta); }
.pt-command .p-price.on { background: #f3f1ff; }
.pt-command .p-facts { border-color: var(--line); }
.pt-command .p-lead h2 { font-size: 1.05rem; }

/* Controls: squarer, tighter */
.pt-command .p-btn { min-height: 36px; border-radius: 5px; border-color: #cfd1e4; font-weight: 600; font-size: .88rem; }
.pt-command .p-btn:hover { border-color: var(--navy-2); background: #f7f7ff; }
.pt-command .p-btn-primary { background: var(--cta); border-color: var(--cta); color: #fff; }
.pt-command .p-btn-primary:hover { background: var(--cta-hover); border-color: var(--cta-hover); }
.pt-command .p-btn-secondary { background: #eef0ff; border-color: #c9ccf7; color: #3730a3; }
.pt-command .p-buy .p-btn { min-height: 40px; }
.pt-command input[type=text], .pt-command input[type=email], .pt-command input[type=password], .pt-command input[type=tel], .pt-command input[type=number],
.pt-command input[type=date], .pt-command input:not([type]), .pt-command select, .pt-command textarea { min-height: 38px; border-radius: 5px; border-color: #cfd1e4; }
.pt-command input:focus, .pt-command select:focus, .pt-command textarea:focus { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(99, 102, 241, .18); }
.pt-command label, .pt-command legend { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.pt-command .p-check, .pt-command .p-check * { text-transform: none; letter-spacing: 0; }
.pt-command .p-tabs a, .pt-command .p-chips a { border-radius: 5px; }
.pt-command .p-tabs a.on, .pt-command .p-view-toggle a.on, .pt-command .p-seg a.on, .pt-command .p-seg label.on, .pt-command .p-chips .p-seg a.on { background: var(--navy); border-color: var(--navy); }
.pt-command .p-chips a.on { background: var(--cta); border-color: var(--cta); }
.pt-command .p-view-toggle, .pt-command .p-seg { border-radius: 5px; }
.pt-command .p-live { border-radius: 4px; }
.pt-command .p-tag, .pt-command .uw-tag { border-radius: 4px; }
.pt-command .p-plan-featured { border-color: var(--cta); }
.pt-command .p-plan-flag { background: var(--cta); border-radius: 4px; }
.pt-command .p-plan-list li::before { color: var(--cta); }
.pt-command .p-home-eyebrow { color: var(--cta); }
.pt-command .p-empty { border-radius: 6px; }
