/* Back office */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--ink); color: #DCE8E9; padding: 1rem .7rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { color: #fff; padding: 0 .4rem .9rem; }
.side .biz { width: 100%; margin: 0 0 1rem; background: rgba(255,255,255,.08); color: #fff; border-color: transparent; }
.side .biz option { color: #000; }
.side nav a { display: flex; align-items: center; gap: .6rem; color: inherit; text-decoration: none; padding: .5rem .6rem; border-radius: var(--r-s); font-weight: 500; font-size: .93rem; }
.side nav a:hover { background: rgba(255,255,255,.07); }
.side nav a[aria-current=page] { background: #fff; color: var(--ink); font-weight: 600; }
.side nav .grp { font-size: .78rem; opacity: .6; margin: 1rem .6rem .3rem; }
.side .foot { margin-top: 1.2rem; font-size: .8rem; opacity: .75; padding: 0 .6rem; }
.side .foot a { color: #fff; }
.main { padding: 1.4rem 1.6rem 3rem; min-width: 0; }
.page-head { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
.page-head .spacer { flex: 1; }
.toolbar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: .8rem; }
.toolbar input, .toolbar select { width: auto; min-width: 180px; }
.menu-btn { display: none; }

/* KPI row: numbers are the point, so they get the display face; no boxes */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-m); margin-bottom: 1rem; }
.kpi { padding: .9rem 1.1rem; border-right: 1px solid var(--line); }
.kpi:last-child { border-right: 0; }
.kpi .v { font-family: var(--display); font-size: 1.65rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.kpi .l { color: var(--muted); font-size: .85rem; }
.kpi .d { font-size: .8rem; font-weight: 600; }
.kpi .d.up { color: var(--ok); } .kpi .d.down { color: var(--bad); }
.panels { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-m); padding: 1rem 1.1rem; min-width: 0; }
.panel h3 { margin-bottom: .7rem; }
.bars { display: flex; align-items: flex-end; justify-content: space-between; gap: 3px; border-bottom: 1px solid var(--line); height: 180px; padding-top: 10px; }
.bars .b { flex: 1; max-width: 48px; background: var(--ink-2); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.bars .b:hover { background: var(--turmeric); }
.bars .b:hover::after { content: attr(data-t); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--paper); font-size: .75rem; padding: .2rem .4rem; border-radius: 4px; white-space: nowrap; margin-bottom: 4px; z-index: 2; }
.axis { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); margin-top: .3rem; }
.hbar { display: grid; grid-template-columns: 1fr auto; gap: .2rem .6rem; font-size: .9rem; margin-bottom: .55rem; }
.hbar .track { grid-column: 1 / -1; height: 6px; background: var(--floor); border-radius: 3px; overflow: hidden; }
.hbar .track i { display: block; height: 100%; background: var(--ink-2); }

.form-sec { border-top: 1px solid var(--line); padding-top: .9rem; margin-top: .4rem; }
.form-sec h3 { font-size: .95rem; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; max-height: 170px; overflow: auto; padding: .4rem; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--paper); }
.chips label { display: inline-flex; gap: .3rem; align-items: center; font-size: .85rem; padding: .2rem .5rem; border-radius: 99px; background: var(--floor); cursor: pointer; }
.chips input { width: 16px; height: 16px; min-height: 16px; }
.mod-group { border: 1px solid var(--line); border-radius: var(--r-s); padding: .6rem; margin-bottom: .5rem; }
.code { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: .85rem; background: var(--floor); padding: .15rem .4rem; border-radius: 4px; word-break: break-all; }
.endpoint { display: flex; gap: .5rem; align-items: center; margin: .25rem 0; }
.plan-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .8rem; }
.plan { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-m); padding: 1rem; }
.plan.cur { border: 2px solid var(--ink); }
.plan .price { font-family: var(--display); font-size: 1.6rem; font-weight: 700; }
.plan ul { padding-left: 1.1rem; margin: .5rem 0 1rem; font-size: .9rem; }
.meter { height: 8px; background: var(--floor); border-radius: 4px; overflow: hidden; margin: .25rem 0 .7rem; }
.meter i { display: block; height: 100%; background: var(--ink-2); }
.pager { display: flex; gap: .5rem; align-items: center; justify-content: flex-end; margin-top: .6rem; font-size: .9rem; }

@media (max-width: 960px) {
  .panels { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 30% 0 0; z-index: 50; transform: translateX(-105%); transition: transform .2s; height: 100%; }
  .side.open { transform: none; box-shadow: 0 0 0 100vw rgba(0,0,0,.4); }
  .menu-btn { display: inline-flex; }
  .main { padding: 1rem; }
  .kpi { border-right: 0; border-bottom: 1px solid var(--line); }
}
