/* Bootstrap controls, cards, tabs and utilities provide component appearance. Only application layout remains here. */
.merchant-console{background:#f0f2f5;color:var(--bs-body-color);font-family:var(--bs-font-sans-serif)}
.console-shell{display:grid;grid-template-columns:232px minmax(0,1fr);min-height:100vh}
.sidebar{display:flex;flex-direction:column;padding:20px 12px;position:sticky;top:0;height:100vh;background:#fff;border-right:1px solid var(--bs-border-color)}
.sidebar-brand,.sidebar-account{display:flex;align-items:center;gap:12px;padding:8px 12px;color:inherit;text-decoration:none}
.sidebar-brand{margin-bottom:24px}
.brand-copy small{display:block;color:var(--bs-secondary-color);font-size:.8rem}
.brand-icon,.account-avatar{display:grid;place-items:center;width:36px;height:36px;background:var(--bs-primary);color:#fff;border-radius:var(--bs-border-radius);flex:none}
.account-avatar{background:var(--bs-secondary-bg);color:var(--bs-body-color)}
.tenant-picker{padding:0 12px;margin-bottom:24px}
.tenant-picker label{font-size:.8rem;color:var(--bs-secondary-color);margin-bottom:8px}
.sidebar-nav{flex:1;overflow:auto}
.nav-group{margin-bottom:16px}
.sidebar .nav-link{display:flex;align-items:center;gap:12px;padding:12px;color:var(--bs-body-color)}
.sidebar .nav-link.active{color:var(--bs-primary);background:var(--bs-primary-bg-subtle)}
.icon{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:none}
.sidebar-divider{margin:16px 0}
.workspace{min-width:0}
.topbar{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:16px 24px}
.breadcrumbs{display:flex;align-items:center;gap:12px}
.topbar-search{position:relative;display:flex;align-items:center;gap:8px;width:320px}
#main-content{padding:24px;min-width:0}
.tenant-mobile{display:none}
.nav-chevron{width:6px;height:6px;border-right:1px solid;border-bottom:1px solid;transform:rotate(45deg)}
[aria-expanded=false] .nav-chevron{transform:rotate(-45deg)}
.nav-collapsed .console-shell{grid-template-columns:76px minmax(0,1fr)}
.nav-collapsed .brand-copy,.nav-collapsed .nav-label,.nav-collapsed .tenant-picker,.nav-collapsed .nav-group>.btn,.nav-collapsed .account-name{display:none!important}
.skip-link{position:fixed;top:-100px;left:16px;z-index:1100;background:#fff;padding:12px}
.skip-link:focus{top:8px}
.loading-panel{display:flex;align-items:center;gap:12px;padding:32px;background:#fff;border-radius:var(--bs-border-radius)}
[hidden]{display:none!important}
.caption{color:var(--bs-secondary-color);font-size:.875rem}
.toolbar-card{display:flex;align-items:end;flex-wrap:wrap;gap:16px;padding:20px;background:#fff;border-radius:var(--bs-border-radius);margin-bottom:24px}
.field{margin-bottom:16px}
.toolbar-card .field{margin:0;flex:0 1 160px}
.toolbar-card .search-field{flex:1 1 260px}
.toolbar-card .btn{white-space:nowrap}
.data-panel{overflow:auto;max-height:70vh;border-color:var(--bs-border-color);box-shadow:none}
.data-panel .table{margin:0}
.data-panel th,.data-panel td{white-space:nowrap}
.data-panel th{position:sticky;top:0;z-index:1}
.action-cluster{display:flex;gap:8px;align-items:center}
.action-cluster .btn{font-size:.875rem;white-space:nowrap}
.amount-positive{color:var(--bs-success)}
.amount-negative{color:var(--bs-danger)}
.th-sortable{cursor:pointer}
.sort-caret{margin-left:8px;font-size:.65rem;color:var(--bs-secondary-color)}
.is-sorted{color:var(--bs-primary)}
.wb-empty{padding:48px 24px;text-align:center;color:var(--bs-secondary-color)}
.wb-empty strong{display:block;color:var(--bs-body-color);margin-bottom:8px}
.wb-pagination{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:12px;padding:16px 0}
.wb-page-size{display:flex;align-items:center;gap:8px}
.wb-page-size .form-select{width:auto}
.profile-avatar{width:88px;height:88px;display:grid;place-items:center;margin:0 auto 20px;object-fit:cover;background:var(--bs-secondary-bg);color:var(--bs-primary);font-size:2rem}
.profile-form{max-width:640px}
.search-results{position:absolute;top:100%;right:0;width:min(440px,85vw);max-height:480px;overflow:auto;background:#fff;border:1px solid var(--bs-border-color);border-radius:var(--bs-border-radius);z-index:1021}
.search-group,.search-empty{padding:12px;color:var(--bs-secondary-color)}
.search-hit{display:block;padding:12px;text-decoration:none;color:inherit;border-top:1px solid var(--bs-border-color)}
.search-hit:hover{background:var(--bs-tertiary-bg)}
.search-hit-copy small{display:block;color:var(--bs-secondary-color);margin-top:4px}
.filter-note{display:flex;gap:16px;align-items:center;margin-bottom:16px}
.filter-note .btn{margin-left:auto}
.form-section-title{font-size:1rem;margin:16px 0}
.wb-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px}
.checkout-layout{display:grid;grid-template-columns:minmax(0,1.22fr) minmax(420px,1fr);gap:16px;min-height:0;align-items:stretch}
.checkout-layout>*{min-width:0}
.checkout-footer{position:relative}
.chart-svg{display:block;width:100%;height:auto;max-height:320px}
.chart-svg text{fill:var(--bs-secondary-color);font-size:12px}
.chart-svg line{stroke:var(--bs-border-color)}
#page-caption:empty{display:none}
.modal dd{overflow-wrap:anywhere}
@media (min-width:992px){.sidebar.offcanvas-lg{display:flex!important;background:#fff!important;height:100vh!important}}
@media (max-width:991.98px){.console-shell,.nav-collapsed .console-shell{grid-template-columns:minmax(0,1fr)}
.sidebar{position:fixed;width:260px;z-index:1045;background:#fff!important}
.sidebar .brand-copy,.sidebar .nav-label,.sidebar .account-name{display:block!important}
.topbar{padding:12px 16px;flex-wrap:wrap}
.tenant-picker,#tenant-name{display:none}
.tenant-mobile{display:block}
.topbar-search{flex:1;min-width:200px}
#main-content{padding:16px}
.checkout-layout,.wb-grid{grid-template-columns:1fr}}
@media (max-width:575.98px){.heading-actions{max-width:55%}
.topbar-search{flex-basis:100%}}
.merchant-login-panel{max-width:480px}

/* Cashier workspace: select on the left, review and settle on the right. */
.checkout-selection{display:flex;flex-direction:column;min-height:0;gap:16px;}
.checkout-selection>.card{margin-bottom:0;padding:16px!important;}
.checkout-services{min-height:0;display:flex;flex-direction:column;}
.checkout-customer{flex:none;}
.checkout-customer>fieldset,.checkout-customer>.border{width:100%;max-width:32rem;}
.checkout-footer{min-height:0;display:flex;flex-direction:column;}
.checkout-order-scroll{min-height:0;overflow:auto;}
.checkout-submit-bar{flex:none;background:var(--bs-body-bg);}
.checkout-footer .field{margin-bottom:8px;}
.checkout-footer .list-group-item{padding-top:10px!important;padding-bottom:10px!important;}
.checkout-footer .mt-3{margin-top:12px!important;}
.checkout-service-list{min-height:0;overflow:auto;}
.checkout-services .data-panel{max-height:none;}
@media(min-width:1200px){
 #workbench-content.checkout-page{display:flex;flex:1 1 auto;min-height:300px;}
 .checkout-page>.checkout-layout{flex:1 1 auto;width:100%;}
 .checkout-selection>.checkout-services{flex:1 1 auto;}
 .checkout-footer .checkout-order-scroll{flex:1 1 auto;}
}
@media(max-width:1199.98px){
 .checkout-layout{grid-template-columns:minmax(0,1fr);}
 .checkout-services .data-panel{max-height:460px;}
 .checkout-footer{margin-bottom:84px;}
 .checkout-submit-bar{position:fixed;bottom:0;left:0;right:0;z-index:1025;margin:0!important;padding:12px 16px calc(12px + env(safe-area-inset-bottom))!important;background:#fff;}
}
@media(min-width:992px) and (max-width:1199.98px){.checkout-submit-bar{left:258px;} .nav-collapsed .checkout-submit-bar{left:76px;}}

/* Business table profiles set every column via colgroup. Long content wraps without clipping. */
.data-panel .table{table-layout:fixed;width:100%;}
.data-panel .table .column-wrap{white-space:normal;overflow-wrap:anywhere;}
.data-panel .action-head,.data-panel .action-cell{white-space:nowrap;}
.data-panel .action-cell>div{width:max-content;}

/* Commission summary and detail remain visible under one shared filter. */
.commission-layout{display:grid;grid-template-columns:minmax(340px,1fr) minmax(0,2fr);gap:16px;min-height:0;}
.commission-layout>.card{min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden;}
.commission-layout>.card>.data-panel{border:0;border-radius:0;max-height:none;min-height:140px;flex:1 1 auto;}
.commission-layout>.card>:not(.data-panel){flex:none;}
@media(min-width:1200px){#workbench-content.commission-page{display:flex;flex-direction:column;flex:1 1 auto;min-height:300px;}.commission-page>.toolbar-card{flex:none;}.commission-page>.commission-layout{flex:1 1 auto;}}
@media(max-width:1199.98px){.commission-layout{grid-template-columns:minmax(0,1fr);}.commission-layout>.card>.data-panel{max-height:480px;}}

/* Project catalog: native Bootstrap pills filter one full-width table. */
.service-catalog{min-height:0;overflow:hidden;display:flex;flex-direction:column;}
.service-catalog>div:first-child{flex:none;}
.service-catalog-items{min-width:0;min-height:0;display:flex;flex-direction:column;flex:1 1 auto;}
.console-frame #main-content .service-catalog-items>.data-panel{border:0!important;border-radius:0!important;max-height:none;flex:1 1 auto;}
@media(min-width:992px){#workbench-content.service-page{display:flex;flex-direction:column;min-height:240px;flex:1 1 auto;}.service-page>.service-catalog{flex:1 1 auto;}}

/* Merchant tables share centered headers, values and actions. */
.merchant-console .data-panel .table th,.merchant-console .data-panel .table td{text-align:center!important;vertical-align:middle;}
.merchant-console .data-panel .table td> .d-flex,.merchant-console .data-panel .table td> .d-inline-flex{justify-content:center;}

/* Tab state hierarchy: muted idle links, blue active tab, native Bootstrap interaction. */
.merchant-console .nav-tabs{--bs-nav-tabs-border-color:var(--bs-primary);--bs-nav-link-color:var(--bs-secondary-color);--bs-nav-link-hover-color:var(--bs-primary);--bs-nav-tabs-link-active-color:var(--bs-primary);--bs-nav-tabs-link-active-bg:var(--console-surface-bg);}
.merchant-console .nav-tabs .nav-link.active{font-weight:600;border-color:var(--bs-primary) var(--bs-primary) var(--console-surface-bg);}
.merchant-console #main-content .nav-pills{--bs-nav-link-color:var(--bs-secondary-color);--bs-nav-link-hover-color:var(--bs-primary);--bs-nav-pills-link-active-color:#fff;--bs-nav-pills-link-active-bg:var(--bs-primary);}

/* Align compound cell content consistently across rows of different lengths. */
.merchant-console .table td>.transaction-party{display:grid!important;grid-template-columns:36px minmax(0,1fr);width:100%;text-align:left!important;justify-content:normal;}
.transaction-party>.account-avatar{width:36px;height:36px;}
.transaction-party>span:last-child{min-width:0;overflow-wrap:anywhere;}
.data-panel .action-cell>div{width:100%;}
.data-panel .action-cell .btn{white-space:nowrap;}

.business-trend-chart{width:100%;height:340px;min-width:0;}
@media(max-width:575.98px){.business-trend-chart{height:300px;}}

/* Merchant dialogs use the table's column widths; only their body scrolls vertically. */
#editor-modal .modal-dialog{max-width:min(var(--bs-modal-width,500px),calc(100vw - 2rem));}
#editor-modal .modal-content{max-height:calc(100dvh - 3.5rem);}
#editor-modal .modal-header,#editor-modal .modal-footer{flex:none;}
#editor-modal .modal-body{min-height:0;overflow-y:auto;scrollbar-gutter:stable;scrollbar-width:auto;}
#editor-modal .modal-body::-webkit-scrollbar{width:10px;}
#editor-modal .modal-body::-webkit-scrollbar-track{background:#f8f9fa;}
#editor-modal .modal-body::-webkit-scrollbar-thumb{background:#adb5bd;border:2px solid #f8f9fa;border-radius:6px;}
#editor-modal .modal-body .data-panel{max-height:none;}
#editor-modal .wb-pagination{border:0!important;padding:0!important;}
.wb-pagination .pagination{flex-wrap:wrap;}
@media(max-width:575.98px){#editor-modal .modal-dialog{max-width:calc(100vw - 1rem);}#editor-modal .modal-content{max-height:calc(100dvh - 1rem);}}

.check-group-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));gap:12px;}
.check-group-grid>.list-group-item{min-width:0;margin:0;}
.check-group-grid>.list-group-item>span{overflow-wrap:anywhere;}

/* Normal-size status switches across merchant lists and forms. */
.merchant-console .form-switch{display:flex;align-items:center;gap:.5rem;min-height:1.25rem;padding-left:0;}
.merchant-console .form-switch .form-check-input{float:none;flex:0 0 2.25rem;width:2.25rem;height:1.25rem;margin:0;cursor:pointer;}
.merchant-console .form-switch .form-check-input:disabled{cursor:default;}
.merchant-console .form-switch .form-check-label,.merchant-console .form-switch+.form-check-label{font-size:inherit;line-height:1.5;}

/* Dashboard filters share one control baseline; chart fills the remaining desktop space. */
.trend-custom-dates .field{margin:0;}
.trend-custom-dates .text-danger:empty{display:none;}
@media(min-width:992px){
 .console-frame #workbench-content.dashboard-page{display:flex;flex-direction:column;flex:1 1 0;min-height:0;}
 .dashboard-page>:not(.dashboard-trend){flex:none;}
 .dashboard-page>.dashboard-trend{display:flex;flex-direction:column;flex:1 1 0;min-height:0;margin-bottom:0!important;}
 .dashboard-trend>:not(.business-trend-chart){flex:none;}
 .dashboard-trend>.business-trend-chart{height:auto;min-height:0;flex:1 1 0;}
}

.dashboard-shortcuts .col>.btn{padding:12px 16px!important;gap:12px!important;}
.dashboard-shortcuts .col>.btn>span{padding:10px!important;}
.dashboard-metrics .col>.btn{padding:12px 16px!important;}
.dashboard-metrics .col>.btn>span{margin-bottom:4px!important;}
.dashboard-metrics .col>.btn>strong{font-size:1.25rem!important;line-height:1.3;}

.merchant-console .data-panel .action-head,.merchant-console .data-panel .action-cell{text-align:left;}
.merchant-console .data-panel .action-cell>div{display:flex!important;justify-content:flex-start;align-items:center;gap:8px;}

/* Keep recharge selection visible on every card theme. */
.recharge-card-radio.form-check-input{background-color:#fff;border-color:#fff;}
.recharge-card-radio.form-check-input:checked{background-color:#fff;border-color:#fff;background-image:radial-gradient(circle,#0d6efd 0 35%,transparent 40%);}

/* Keep membership card radios visible, including before selection. */
.member-card-choice{cursor:pointer;position:relative;overflow:hidden;}
.member-card-choice .recharge-card-radio{opacity:1;}
.member-card-choice:has(.recharge-card-radio:focus-visible){outline:2px solid #0d6efd;outline-offset:2px;}

/* Merchant mini program: preserve the original scannable code. */
.merchant-console.console-frame .sidebar-nav{display:flex;flex-direction:column}
.merchant-console.console-frame .sidebar-nav>.nav-group{flex:0 0 auto}
.merchant-mini-sidebar{flex:0 0 auto;margin-top:auto}
.merchant-mini-sidebar img{display:block;width:110px;height:110px;max-width:100%;object-fit:contain;margin:auto;background:#fff}
.merchant-mini-header{flex:0 0 auto;margin-left:auto}
.merchant-mini-header img{display:block;background:#fff}
.merchant-mini-header .dropdown-menu{min-width:266px}
.console-frame .merchant-mini-header+.topbar-account{margin-left:0}
@media(min-width:992px){.nav-collapsed .merchant-mini-sidebar{display:none}}

/* Compact checkout member search: aligned columns and bounded scrolling. */
.checkout-member-matches{max-height:280px;overflow:auto;overscroll-behavior:contain;}
.checkout-member-matches:empty{display:none;}
.checkout-member-table{table-layout:fixed;width:100%;font-size:.875rem;}
.checkout-member-table th:first-child{width:30%;}
.checkout-member-table th:nth-child(2){width:42%;}
.checkout-member-table th:last-child{width:28%;text-align:right;}
.checkout-member-table>thead>tr>th{position:sticky;top:0;z-index:1;background:var(--bs-tertiary-bg);font-size:.75rem;white-space:nowrap;padding:8px;}
.checkout-member-table>tbody>tr>td{height:44px;padding:6px 8px;vertical-align:middle;cursor:pointer;}
.checkout-member-phone{white-space:nowrap;font-variant-numeric:tabular-nums;}
.checkout-member-table td:last-child{white-space:nowrap;font-variant-numeric:tabular-nums;}
.checkout-member-select{display:block;width:100%;min-height:32px;padding:0;border:0;border-radius:0;background:transparent;text-align:left;text-decoration:none;color:var(--bs-body-color);font-size:inherit;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.checkout-member-select:focus-visible{outline:2px solid var(--bs-primary);outline-offset:2px;}

/* Merchant miniapp card: 750 - 2*28 page gutters - 2*28 panel padding, height 256rpx. */
.member-card-face{width:100%;height:auto!important;aspect-ratio:638 / 256;min-height:min-content;}

/* Form text follows the surrounding merchant interface typography. */
.merchant-console :is(.form-control,.form-select,.form-control-plaintext,.input-group-text){font-size:inherit;}

/* Center navigation SVGs without inline baseline spacing. */
.merchant-console .sidebar .nav-link>[data-wb-icon]{display:inline-flex;align-items:center;justify-content:center;flex:none;line-height:1;}
.merchant-console .sidebar .nav-link>[data-wb-icon]>.icon{display:block;}

/* Size cashier cards by the order panel, not the browser viewport. */
.checkout-card-choices{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));gap:16px;}
.checkout-card-choices>.col{min-width:0;}
.checkout-card-choices .member-card-face{aspect-ratio:auto;min-height:160px;overflow:visible;}
.checkout-card-choices .member-card-face>div:first-child{flex-wrap:wrap;}
.checkout-card-choices .member-card-face>div:first-child>.fw-semibold{min-width:0;flex:1 1 160px;overflow-wrap:anywhere;}
.checkout-card-choices .member-card-face>div:first-child>.badge{max-width:100%;white-space:normal;text-align:left;}
.checkout-card-choices .member-card-face>div:last-child{overflow-wrap:anywhere;}
