/* app.toser.site: the panel's own design system, laid out as a desktop console. A sidebar holds the sections, the
   screen gets room to breathe, and every route change rises in. Below 900px the sidebar folds into a top bar. */
html, body { height: 100%; }
.app.console-shell { height: 100dvh; display: grid; grid-template-columns: 264px minmax(0, 1fr); grid-template-rows: none; }

/* ---------- Sidebar ---------- */
.cnav { position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; min-height: 0;
  border-right: 1px solid var(--line); background: linear-gradient(180deg, var(--bg-2), var(--bg) 60%); }
.cnav-lamp { position: absolute; z-index: -1; top: -46px; left: -58px; pointer-events: none; animation: cnav-lamp 1.2s var(--ease) both; }
@keyframes cnav-lamp { from { opacity: 0; transform: scale(.92); } }
.cnav-head { display: flex; align-items: center; gap: 10px; padding: 22px 20px 16px; }
.cnav-logo .wm { font-size: 27px; }
.cnav-tag { font-family: var(--mono); font-size: 9.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--text-2);
  padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(13,13,15,.5); }
.cnav-toggle { display: none; margin-left: auto; }
.cnav-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 14px; padding: 0 12px 14px; overflow-y: auto; }
.cnav-ws { display: grid; gap: 2px; padding: 11px 12px; border-radius: var(--r); border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 80%, transparent); }
.cnav-ws-name { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cnav-ws-plan { font-family: var(--mono); font-size: 10.5px; letter-spacing: .03em; color: var(--muted); }
.cnav-ws-plan.warn { color: var(--internal); } .cnav-ws-plan.bad { color: var(--redline); }
.cnav-brand { position: relative; }
.cnav-groups { display: grid; gap: 14px; }
.cnav-group { display: grid; gap: 2px; }
.cnav-group-title { margin: 0 10px 4px; font-family: var(--mono); font-size: 9.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.cnav-link { position: relative; display: flex; align-items: center; gap: 11px; width: 100%; padding: 8px 10px; border: 0; border-radius: 9px;
  background: none; color: var(--text-2); text-align: left; font-size: 13.5px; cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease), transform .18s var(--ease); }
.cnav-link svg { color: var(--muted); transition: color .18s var(--ease); }
.cnav-link:hover { background: var(--surface); color: var(--text); }
.cnav-link:hover svg { color: var(--text-2); }
.cnav-link:active { transform: scale(.985); }
.cnav-link[aria-current="page"] { background: var(--marker-soft); color: var(--text); }
.cnav-link[aria-current="page"] svg { color: var(--marker); }
.cnav-link[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--marker); box-shadow: 0 0 14px var(--marker); animation: cnav-mark .35s var(--ease) both; }
@keyframes cnav-mark { from { transform: scaleY(0); } }
.cnav-foot { margin-top: auto; display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.cnav-user { display: flex; align-items: center; gap: 10px; padding: 6px 4px 0 6px; min-width: 0; }
.cnav-avatar { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 600;
  color: var(--marker-ink); background: var(--marker); }
.cnav-user-main { flex: 1; min-width: 0; display: grid; }
.cnav-user-name, .cnav-user-mail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cnav-user-name { font-size: 13px; color: var(--text); }
.cnav-user-mail { font-size: 11.5px; color: var(--muted); }

/* ---------- Content ---------- */
.console-body { min-width: 0; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.console-shell .app-main { min-height: 0; overflow-y: auto; }
.console-shell .screen { max-width: 1040px; margin: 0 auto; padding: 44px 48px 80px; animation: console-in .42s var(--ease) both; }
@keyframes console-in { from { opacity: 0; transform: translateY(10px); } }
.console-shell .title { font-size: 46px; line-height: 1.02; }
.console-shell .sub { font-size: 15px; max-width: 62ch; }
.console-shell .composer { width: 100%; max-width: 1040px; margin: 0 auto; padding-inline: 48px; border-top: 0; }
.console-shell .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.console-shell .kpi { padding: 18px; }
.console-shell .kpi b { font-size: 38px; }
.console-shell .paper, .console-shell .admin-row, .console-shell .rel-paper { max-width: 80ch; }
.console-shell .card { transition: border-color .2s var(--ease); }

/* ---------- Overview ---------- */
.ov-kpis { margin-top: 28px; }
.ov-kpi { display: grid; gap: 4px; text-align: left; border: 0; cursor: pointer; color: inherit; transition: background .2s var(--ease); }
.ov-kpi:hover { background: var(--surface); }
.ov-kpi b { margin-top: 4px; min-height: 1em; animation: ov-num .5s var(--ease) both; }
@keyframes ov-num { from { opacity: 0; transform: translateY(6px); } }
.ov-hint { font-size: 11.5px; color: var(--muted); }
.ov-wait { display: inline-block; width: 48px; height: .7em; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: ov-shimmer 1.2s linear infinite; }
@keyframes ov-shimmer { to { background-position: -200% 0; } }
.ov-grid { display: grid; gap: 16px; margin-top: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.ov-steps { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 4px; }
.ov-steps button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 8px; border: 0; border-radius: 9px; background: none; color: var(--text); text-align: left; cursor: pointer; }
.ov-steps button:hover { background: var(--surface-2); }
.ov-check { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line-2); color: var(--marker-ink); transition: background .3s var(--ease), border-color .3s var(--ease); }
.ov-check svg { width: 13px; height: 13px; }
.ov-steps .done .ov-check { background: var(--marker); border-color: var(--marker); }
.ov-steps .done button > span:nth-child(2) { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-2); }
.ov-actions { display: grid; gap: 2px; }
.ov-actions .card-title { margin-bottom: 8px; }
.ov-action { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 8px; border: 0; border-radius: 9px; background: none; color: var(--text); text-align: left; cursor: pointer; }
.ov-action > span:nth-child(2) { flex: 1; }
.ov-action > :first-child { color: var(--marker); }
.ov-action > :last-child { color: var(--muted); transition: transform .2s var(--ease); }
.ov-action:hover { background: var(--surface-2); }
.ov-action:hover > :last-child { transform: translateX(3px); color: var(--text-2); }

/* ---------- Sign in screens: centred, with room ---------- */
.app:not(.console-shell) .auth { max-width: 460px; margin: 0 auto; width: 100%; }

/* ---------- Phones and narrow windows ---------- */
@media (max-width: 900px) {
  .app.console-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  /* The drawer is fixed inside the sidebar, so the sidebar itself must sit above the screen it covers. */
  .cnav { overflow: visible; z-index: 50; border-right: 0; border-bottom: 1px solid var(--line); background: var(--bg-2); }
  .cnav-lamp { display: none; }
  .cnav-head { padding: 12px 16px; }
  .cnav-logo .wm { font-size: 22px; }
  .cnav-toggle { display: inline-flex; }
  .cnav-body { display: none; }
  .cnav.open .cnav-body { display: flex; position: fixed; z-index: 40; inset: 57px 0 0 0; padding: 14px 16px 20px; background: var(--bg); animation: cnav-drawer .26s var(--ease) both; }
  @keyframes cnav-drawer { from { opacity: 0; transform: translateY(-8px); } }
  .cnav-link[aria-current="page"]::before { left: -16px; }
  .console-shell .screen { padding: 24px 16px 56px; }
  .console-shell .title { font-size: 34px; }
  .console-shell .composer { padding-inline: 16px; }
  .console-shell .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ov-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .cnav-lamp, .cnav-link[aria-current="page"]::before, .console-shell .screen, .ov-kpi b, .ov-wait { animation: none; }
}

/* Editing a policy's text: the console has the room for it. */
[data-surface="console"] .sheet { left: 264px; max-width: 880px; margin: 0 auto; }
[data-surface="console"] .replace-text { min-height: 52vh; font-size: 14.5px; line-height: 1.6; }
@media (max-width: 900px) { [data-surface="console"] .sheet { left: 0; } }
