/* Shared cabinet finish: preserve the SAVAGEPAY palette and existing workflows. */
.app-body { --border:var(--line); --accent:var(--primary); --panel:var(--card); }
.app-body .page-head>div:first-child { min-width:0; }
.app-body .page-head h1 { overflow-wrap:anywhere; }
.app-body .card { border-color:var(--line); }
.app-body .card-head h2 { margin-bottom:0; }
.app-body .btn { line-height:1.35; }
.app-body .btn-row,.app-body .page-actions,.app-body .modal-actions { row-gap:10px; }
.app-body .settings-followup-action { margin-top:12px; }
.app-body .table-wrap { scrollbar-gutter:stable; overscroll-behavior-x:contain; }
.app-body .table-wrap::-webkit-scrollbar { height:8px; }
.app-body .table-wrap::-webkit-scrollbar-track { background:var(--surface); border-radius:8px; }
.app-body .table-wrap::-webkit-scrollbar-thumb { background:#52525b; border-radius:8px; }
.app-body .table-wrap:focus-visible { outline:2px solid var(--primary); outline-offset:4px; }
.table-scroll-hint { margin:8px 0 12px; color:var(--muted); font-size:12px; line-height:1.5; }
.table-scroll-hint[hidden] { display:none; }
.app-body table.kv td { overflow-wrap:anywhere; }
.app-body .doc .table-wrap table { min-width:720px; }
.app-body .doc td:first-child { white-space:nowrap; overflow-wrap:normal; word-break:normal; }
.app-body .doc td:nth-child(2) { overflow-wrap:normal; word-break:normal; }
.app-body .doc td code { word-break:normal; overflow-wrap:normal; }
.app-body .doc pre { line-height:1.65; }
.app-body .doc p,.app-body .doc li { line-height:1.65; }
.app-body .req-hist-title { min-width:0; max-width:100%; flex-wrap:wrap; }
.app-body .req-hist-title>div { min-width:0; flex:1 1 180px; overflow-wrap:anywhere; }
.app-body .req-hist-title .mono { white-space:normal; overflow-wrap:anywhere; }
.app-body .req-hist-title>.badge { flex-shrink:0; }
.app-body .receipts,.app-body .receipt-list,.app-body .receipt-item { min-width:0; max-width:100%; }
.app-body .receipt-open>span:last-child { min-width:0; overflow-wrap:anywhere; }
.app-body .receipt-open small { display:block; line-height:1.5; }
.app-body .receipt-item>.icon-btn { flex:0 0 32px; }
.app-body .receipt-viewer { min-width:0; }
.app-body .stat-sub { overflow-wrap:anywhere; }
.app-body .empty-state { overflow-wrap:anywhere; }
.app-body .modal-head h2 { min-width:0; overflow-wrap:anywhere; }
.app-body .modal-head>.icon-btn { flex-shrink:0; }
.app-body .modal-actions>.btn { max-width:100%; }
.app-body .modal-actions .btn-primary { white-space:normal; height:auto; min-height:40px; padding-block:10px; }
@media(max-width:640px) {
  .app-body .table-wrap.is-wide-table>table { min-width:640px; }
  .app-body .table-wrap.is-wide-table>table.kv { min-width:0; }
  .app-body .req-hist-title { gap:10px; align-items:flex-start; }
  .app-body .req-hist-title>.badge { margin-left:0; }
  .app-body .receipt-ico { width:32px; height:36px; }
  .app-body .receipt-open { padding:8px 4px; gap:8px; }
  .app-body .modal-actions { justify-content:flex-end; }
  .app-body .saved-filters { position:static; margin:0 16px 16px; max-width:none; box-shadow:none; }
  .app-body .page-actions .btn { white-space:normal; height:auto; min-height:40px; padding-block:10px; }
}
@media(prefers-reduced-motion:reduce) {
  .app-body .stat,.app-body .btn,.app-body .req-card { transition:none; }
  .app-body .stat:hover { transform:none; }
  .app-body .fade-in,.app-body .modal-card { animation:none; }
}

/* Keep five overview cards balanced instead of leaving one card alone. */
.app-body .teamlead-dashboard-stats{grid-template-columns:repeat(6,minmax(0,1fr));align-items:stretch}
.app-body .teamlead-dashboard-stats>.stat{grid-column:span 2;min-width:0}
.app-body .teamlead-dashboard-stats>.stat:nth-last-child(-n+2){grid-column:span 3}
@media(min-width:1600px){.app-body .teamlead-dashboard-stats{grid-template-columns:repeat(5,minmax(0,1fr))}.app-body .teamlead-dashboard-stats>.stat,.app-body .teamlead-dashboard-stats>.stat:nth-last-child(-n+2){grid-column:auto}}
@media(max-width:1000px){.app-body .teamlead-dashboard-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.app-body .teamlead-dashboard-stats>.stat,.app-body .teamlead-dashboard-stats>.stat:nth-last-child(-n+2){grid-column:auto}.app-body .teamlead-dashboard-stats>.stat:last-child{grid-column:1/-1}}
@media(max-width:600px){.app-body .teamlead-dashboard-stats{grid-template-columns:minmax(0,1fr)}}

@media(max-width:900px){
  .app-body .sidebar{visibility:hidden;transition:transform .25s ease,visibility 0s linear .25s}
  .app-body.nav-open .sidebar{visibility:visible;transition-delay:0s}
  .app-body.nav-open{overflow:hidden}
}
