/* Dashboard shell + dense panels. Tokens shared with the site. */

.dash {
  --d-bg: #F4F7FC; --d-panel: #fff; --d-rail: #0C1A2B; --d-rail-2: #16263A;
  --d-ink: #0C1A2B; --d-ink-2: #46586E; --d-ink-3: #7B8CA3;
  --d-rule: #DCE4F0; --d-rule-soft: #EBF0F8; --d-accent: #1554F0; --d-accent-soft: #E9EFFE;
  --s1: #3B6CBF; --s2: #B47825; --s3: #0C6944; --s4: #BC6ECE; --s5: #C74C3D; --s6: #5C6B7A;
  --good: #0F7B3D; --bad: #A62B22; --warn: #A66A00;
  display: grid; grid-template-columns: 200px minmax(0, 1fr);
  border: 1px solid var(--d-rule); border-radius: 18px; overflow: hidden;
  background: var(--d-bg); box-shadow: 0 2px 4px rgba(12,26,43,.04), 0 28px 64px -24px rgba(21,84,240,.25);
  font-family: "Archivo", "Helvetica Neue", Arial, sans-serif; color: var(--d-ink);
  font-size: 13px; line-height: 1.4;
}
@media (max-width: 1000px) { .dash { grid-template-columns: 1fr; } .dash-rail { display: none; } }

/* ---- rail ---- */
.dash-rail { background: var(--d-rail); color: #fff; padding: 1.1rem .9rem; display: flex; flex-direction: column; gap: .2rem; }
.dash-rail .brand { display: flex; align-items: center; gap: .55rem; margin: 0 .3rem 1.1rem; }
.dash-rail .brand img { height: 22px; width: auto; }
.dash-rail .brand b { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; }
.dash-rail a {
  color: rgba(255,255,255,.62); text-decoration: none; padding: .48rem .65rem; border-radius: 8px;
  font-size: 12.5px; font-weight: 500; display: flex; align-items: center; gap: .55rem;
}
.dash-rail a svg { width: 15px; height: 15px; opacity: .8; }
.dash-rail a[data-on] { background: var(--d-rail-2); color: #fff; }
.dash-rail .practice { margin-top: auto; padding: .7rem .65rem 0; font-size: 11px; color: rgba(255,255,255,.5); line-height: 1.45; }
.dash-rail .practice b { color: #fff; display: block; font-size: 12px; }

/* ---- top bar ---- */
.dash-main { min-width: 0; display: flex; flex-direction: column; }
.dash-top {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  padding: .8rem 1.1rem; background: var(--d-panel); border-bottom: 1px solid var(--d-rule);
}
.dash-top h2 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.dash-top .chips { display: flex; gap: .4rem; flex-wrap: wrap; margin-left: .5rem; }
.chip {
  display: inline-flex; align-items: center; gap: .35rem; font-size: 11.5px; font-weight: 500;
  padding: .3rem .6rem; border-radius: 999px; border: 1px solid var(--d-rule); background: var(--d-bg); color: var(--d-ink-2);
}
.chip svg { width: 10px; height: 10px; opacity: .6; }
.chip.on { background: var(--d-accent-soft); border-color: #BBD0FC; color: #0B3FC4; font-weight: 600; }
.dash-top .right { margin-left: auto; display: flex; gap: .5rem; align-items: center; font-size: 11.5px; color: var(--d-ink-3); }
.dash-top .btn-x {
  font-size: 11.5px; font-weight: 600; color: #fff; background: var(--d-accent);
  border-radius: 999px; padding: .38rem .8rem;
}

/* ---- body grid ---- */
.dash-body { padding: 1rem 1.1rem 1.2rem; display: grid; gap: .8rem; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.kpis { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .6rem; }
@media (max-width: 1000px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px)  { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { background: var(--d-panel); border: 1px solid var(--d-rule); border-radius: 10px; padding: .65rem .8rem .55rem; display: grid; gap: .1rem; min-width: 0; }
.kpi span { font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--d-ink-3); }
.kpi b { font-size: 19px; font-weight: 700; letter-spacing: -.025em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi i { font-style: normal; font-size: 11px; font-weight: 600; }
.kpi i.up { color: var(--good); } .kpi i.down { color: var(--bad); }
.kpi svg { width: 100%; height: 22px; margin-top: .25rem; display: block; }

.panel { background: var(--d-panel); border: 1px solid var(--d-rule); border-radius: 12px; padding: .8rem .95rem .7rem; min-width: 0; display: flex; flex-direction: column; gap: .5rem; }
.panel.w12 { grid-column: span 12; } .panel.w8 { grid-column: span 8; } .panel.w7 { grid-column: span 7; }
.panel.w6 { grid-column: span 6; } .panel.w5 { grid-column: span 5; } .panel.w4 { grid-column: span 4; }
@media (max-width: 1000px) { .panel.w8, .panel.w7, .panel.w6, .panel.w5, .panel.w4 { grid-column: span 12; } }
.panel-h { display: flex; align-items: baseline; justify-content: space-between; gap: .8rem; }
.panel-h h3 { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: -.005em; }
.panel-h small { font-size: 11px; color: var(--d-ink-3); white-space: nowrap; }
.panel-f { font-size: 11.5px; color: var(--d-ink-2); margin: 0; }
.panel-f b { color: var(--d-ink); font-weight: 600; }
.panel svg { display: block; width: 100%; height: auto; overflow: visible; }
.legend { display: flex; flex-wrap: wrap; gap: .25rem .8rem; font-size: 11px; color: var(--d-ink-2); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: .35rem; vertical-align: -1px; }

/* svg text */
.ax { font-size: 10px; fill: var(--d-ink-3); font-weight: 500; }
.ax-b { font-size: 10px; fill: var(--d-ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.grid { stroke: rgba(12,26,43,.07); stroke-width: 1; }

/* table */
.tbl { width: 100%; border-collapse: collapse; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { text-align: right; padding: .38rem .45rem; border-bottom: 1px solid var(--d-rule-soft); white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child, .tbl th:nth-child(2), .tbl td:nth-child(2) { text-align: left; }
.tbl thead th { color: var(--d-ink-3); font-weight: 600; font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.pill { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: .12rem .45rem; border-radius: 999px; }
.pill.warn { background: #FBF1DC; color: var(--warn); } .pill.bad { background: #FBE4E1; color: var(--bad); } .pill.ok { background: #E1F3E8; color: var(--good); }

/* chat loop sits in a panel with no padding */
.panel.chat { padding: 0; overflow: hidden; }
.panel.chat .demo { border: 0; border-radius: 12px; box-shadow: none; flex: 1; min-height: 0; height: auto; }
.panel.chat .demo-stage { min-height: 0; }

/* first row: fixed height so neither panel stretches the other */
.panel.trend, .panel.chat { height: 27rem; }
.panel.trend > svg { flex: 1; min-height: 0; height: 100%; }
@media (max-width: 1000px) { .panel.trend { height: auto; } .panel.trend > svg { height: auto; } }
