/* Layout pass over every workspace page. Loaded last; only spacing, grids and sizing change, never colours or
   behaviour. Selectors start with "body #app#app #content" where the theme (yumi-fx.css) already uses that weight. */

/* Top bar: shorter, so the page starts higher. */
body #app .workspace{padding-top:22px!important}
body #app .workspace>header{align-items:center!important;margin-bottom:18px!important;padding-bottom:12px!important}
body #app .workspace>header h2{margin:2px 0 0!important;font-size:26px!important}

/* The in-page heading repeated the top-bar title on almost every page (layout.js marks it). */
body #app#app #content>.page-head{margin:0 0 20px!important}
body #app#app #content>.page-head.ly-empty,body #app#app #content>.page-head .ly-dup{display:none!important}
body #app#app #content>.page-head h3{margin:0!important;font-size:20px!important;line-height:1.3!important}

/* Number cards: one even row, no orphan on a second line, no tall empty boxes. */
body #app#app #content .cards{grid-template-columns:repeat(auto-fit,minmax(160px,1fr))!important;gap:12px!important;margin:0 0 16px!important}
body #app#app #content .cards:has(>.card:only-child){grid-template-columns:minmax(0,320px)!important}
body #app#app #content .cards>.card{min-height:0!important;padding:14px 16px!important}
body #app#app #content .cards>.card .value{margin:6px 0 0!important;font-size:24px!important;line-height:1.2!important}
body #app#app #content .dashboard-group{margin:0 0 20px!important}
body #app#app #content .dashboard-group .cards{grid-template-columns:repeat(4,minmax(0,1fr))!important;margin:0!important}
body #app#app #content .company-cash-card{grid-template-columns:repeat(2,minmax(0,1fr));column-gap:8px;align-content:start}
body #app#app #content .company-cash-card>:not(button){grid-column:1/-1}
body #app#app #content .company-cash-card>button{min-width:0;margin-top:6px;padding:6px 8px!important;font-size:12px!important;white-space:nowrap}

/* Role filter on 账户管理: all roles on one line. */
body #app#app #content .account-tabs{grid-template-columns:repeat(auto-fit,minmax(130px,220px))!important;gap:10px!important;margin:0 0 16px!important}
body #app#app #content .account-tabs button{padding:9px 14px!important}

/* Segmented tabs (审核, 入职审核): every option on one row, sized evenly. */
body #app#app #content .review-tabs{display:flex!important;flex-wrap:wrap;gap:8px!important;margin:0 0 14px!important;padding:6px!important}
body #app#app #content .review-tabs>button{flex:1 1 140px;min-height:40px;padding:8px 14px!important}
body #app#app #content .coupon-tabs{margin:0 0 14px!important}

/* Recent recharges (派单 / 会员充值): the fill-in button is a small action, not a full-width bar. */
body #app#app #content .recent-recharge-buttons{display:flex!important;justify-content:flex-end;flex-wrap:wrap;gap:6px}
body #app#app #content .recent-recharge-list button{width:auto!important;min-height:0!important;padding:5px 12px!important;border-radius:12px!important;box-shadow:0 2px 0 #b9b2d6!important;font-size:12px!important}
body #app#app #content .compact-recharges .recent-recharge-buttons{margin-top:auto}

/* 派单 form: fields that stood alone in half a row take the full row. */
body #app#app #content .dispatch-workbench .dispatch-cascade>:is(.dispatch-business-field,.dispatch-direct-field,.dispatch-note-field){grid-column:1/-1}

/* Wide single-column forms (创建优惠券, 赠礼派单): two fields per row; previews and buttons span the row. */
body #app#app #content .gift-dispatch-panel{width:auto!important;margin:0!important}
body #app#app #content :is(form[data-form=coupon-create],form[data-form=gift-dispatch]){grid-template-columns:repeat(2,minmax(0,1fr));column-gap:16px}
body #app#app #content :is(form[data-form=coupon-create],form[data-form=gift-dispatch])>:not(label){grid-column:1/-1}

/* 时长排行榜 month picker: a full-width toolbar instead of a small floating card. */
body #app#app #content .leaderboard-filter{display:flex!important;width:auto!important;margin:0 0 16px!important;padding:14px 18px!important}
body #app#app #content .leaderboard-filter label{flex:0 1 280px}
body #app#app #content .leaderboard-filter input{min-width:0!important;width:100%}
body #app#app #content .leaderboard-filter button{height:auto!important;min-height:42px}

/* Tables: toolbars and pagers sit tight against their table. */
body #app#app #content .table-toolbar{margin-bottom:10px!important}
body #app#app #content .pagination-bar{margin-top:12px!important}

@media (max-width:760px){
  body #app .workspace>header h2{font-size:22px!important}
  body #app#app #content .dashboard-group .cards{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body #app#app #content :is(form[data-form=coupon-create],form[data-form=gift-dispatch]){grid-template-columns:1fr}
  body #app#app #content .cards>.card .value{font-size:20px!important}
  body #app#app #content .company-cash-card{grid-template-columns:1fr}
  body #app#app #content .company-cash-card>button{margin-top:2px;white-space:normal}
  body #app#app #content .account-tabs{grid-template-columns:repeat(auto-fit,minmax(96px,1fr))!important;gap:8px!important}
  body #app#app #content .account-tabs button{padding:8px 10px!important}
}
