/* PattonWealth Portal - design tokens from the existing brand (Design/WebsiteRebuild.md 6.8): ink navy on warm white, one orange
   accent for the primary action, sky blue for Patton data, warm grey for benchmarks. Open Sans body, Raleway display numbers. */
:root {
  --ink: #0d1b2a; --navy: #001e3d; --navy-2: #005696; --navy-3: #1c5c84;
  --paper: #faf8f5; --card: #ffffff; --line: #e6e2db; --line-2: #efece6; --muted: #6b7280; --muted-2: #9aa1ab;
  --accent: #e8930a; --accent-ink: #b56f00;
  --pf: #005696; --pf-2: #398bc7; --bm: #8c93a0; --sp: #c98b1e; --bond: #4f8a8b;
  --pos: #2e7d5b; --neg: #b5482a; --pos-bg: #e9f4ee; --neg-bg: #f8ebe7;
  --radius: 12px; --shadow: 0 1px 2px rgba(13, 27, 42, .06), 0 8px 24px -16px rgba(13, 27, 42, .18);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 'Open Sans', system-ui, sans-serif; }
a { color: var(--navy-2); text-decoration: none; }
button { font: inherit; }
h1, h2, h3 { font-family: 'Raleway', 'Open Sans', sans-serif; margin: 0; color: var(--navy); }
h1 { font-size: 26px; font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: 17px; font-weight: 600; }
h3 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.num { font-family: 'Raleway', 'Open Sans', sans-serif; font-variant-numeric: tabular-nums; font-weight: 600; }
.pos { color: var(--pos); } .neg { color: var(--neg); } .muted { color: var(--muted); } .small { font-size: 13px; }

.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 24px; height: 60px; padding: 0 24px; background: var(--card); border-bottom: 1px solid var(--line); }
.brand img { display: block; }
.who { font-family: 'Raleway', sans-serif; font-weight: 600; color: var(--navy); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tools { display: flex; align-items: center; gap: 12px; }
.asof { font-size: 13px; color: var(--muted); }
.ghost { background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; color: var(--navy); cursor: pointer; }
.ghost:hover { border-color: var(--navy-3); }
.primary { background: var(--accent); border: 0; border-radius: 999px; padding: 8px 18px; color: #fff; font-weight: 600; cursor: pointer; }
.primary:hover { background: var(--accent-ink); }

.shell { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 60px); }
.side { padding: 18px 12px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; background: var(--paper); }
.side a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--ink); font-weight: 600; font-size: 14px; }
.side a .ico { width: 18px; text-align: center; color: var(--muted-2); font-size: 15px; }
.side a:hover { background: var(--line-2); }
.side a.on { background: var(--navy); color: #fff; } .side a.on .ico { color: #fff; }
.side-foot { margin-top: auto; padding: 12px; font-size: 11px; line-height: 1.45; color: var(--muted-2); }
.main { padding: 24px 28px 48px; max-width: 1240px; }
.loading { color: var(--muted); padding: 40px; }

.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.pagehead .sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.switch { display: flex; gap: 6px; flex-wrap: wrap; }
.switch button { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 14px; cursor: pointer; color: var(--ink); font-weight: 600; font-size: 13px; }
.switch button.on { background: var(--navy); color: #fff; border-color: var(--navy); }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: 1fr 1fr; } .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); } .g32 { grid-template-columns: 3fr 2fr; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; min-width: 0; }
.card.hero { background: linear-gradient(135deg, var(--navy) 0%, #0a3b66 100%); color: #fff; border: 0; }
.card.hero h3 { color: rgba(255, 255, 255, .7); } .card.hero .muted { color: rgba(255, 255, 255, .7); } .card.hero .pos { color: #8fd8b0; } .card.hero .neg { color: #f2a58f; }
.card .head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.card .head a { font-size: 13px; }
.big { font-size: 34px; line-height: 1.1; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-top: 14px; }
.kpi .l { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; opacity: .75; }
.kpi .v { font-size: 22px; margin-top: 2px; }
.kpi .c { font-size: 12px; opacity: .8; margin-top: 2px; }
.decomp { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .18); }
.decomp .l { font-size: 12px; opacity: .75; } .decomp .v { font-size: 18px; }
.chartbox { position: relative; height: 300px; }
.chartbox.tall { height: 360px; } .chartbox.short { height: 220px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; cursor: pointer; user-select: none; }
th.r, td.r { text-align: right; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tr.group td { background: var(--paper); font-weight: 700; cursor: pointer; }
tr.group td .chev { display: inline-block; width: 14px; color: var(--muted-2); }
tr.sub td:first-child { padding-left: 34px; }
tr.pick { cursor: pointer; } tr.pick:hover td { background: #f3f7fb; }
tr.total td { font-weight: 700; border-top: 2px solid var(--line); border-bottom: 0; }
.bar { height: 6px; background: var(--line-2); border-radius: 3px; overflow: hidden; min-width: 70px; }
.bar > span { display: block; height: 100%; background: var(--pf-2); }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--line-2); color: var(--ink); }
.pill.pos { background: var(--pos-bg); } .pill.neg { background: var(--neg-bg); }
.search { border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font: inherit; min-width: 220px; background: var(--card); }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.heat { text-align: right; font-variant-numeric: tabular-nums; }
.note { font-size: 13px; color: var(--muted); margin-top: 10px; line-height: 1.45; }
.empty { color: var(--muted); padding: 24px; text-align: center; }
.detail { position: fixed; top: 60px; right: 0; bottom: 0; width: min(420px, 100vw); background: var(--card); border-left: 1px solid var(--line); box-shadow: -12px 0 32px -20px rgba(13, 27, 42, .3); padding: 20px 22px; overflow: auto; z-index: 6; }
.detail .close { float: right; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; font-size: 14px; margin-top: 12px; } .kv span { color: var(--muted); } .kv b { text-align: right; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; z-index: 9; box-shadow: var(--shadow); }
.modal { position: fixed; inset: 0; background: rgba(13, 27, 42, .45); display: flex; align-items: center; justify-content: center; z-index: 8; }
.modal .box { background: var(--card); border-radius: var(--radius); padding: 22px 24px; width: min(560px, 94vw); box-shadow: var(--shadow); }
.devpick { display: flex; gap: 8px; align-items: center; }
.devpick input { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font: inherit; }
.devlist { max-height: 300px; overflow: auto; margin-top: 10px; }
.devlist button { display: block; width: 100%; text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--line-2); padding: 8px 6px; cursor: pointer; }
.devlist button:hover { background: var(--line-2); }
.tag-dev { font-size: 11px; background: #fff3dc; color: var(--accent-ink); border: 1px solid #f3d9a4; border-radius: 999px; padding: 2px 8px; }

@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .side { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; gap: 4px; }
  .side a { white-space: nowrap; padding: 8px 10px; } .side .ico { display: none; } .side-foot { display: none; }
  .g2, .g3, .g4, .g32 { grid-template-columns: 1fr; }
  .main { padding: 16px; }
  .who { display: none; }
}

/* the hidden attribute must beat the display rules of the overlay and the toast */
.modal[hidden], .toast[hidden], #devbox[hidden] { display: none !important; }
