/* Shared admin visual layer. Existing page controls and responsive navigation stay in place. */
body[data-authed="1"]{
  --ued-ink:#24362d;--ued-muted:#58685f;--ued-line:#e1e8e0;
  --ued-wash:#f3f6f1;--ued-forest:#20372b;--ued-active:#41634e;
  --ued-accent:#a34421;--ued-ring:#37784e;
}
body[data-authed="1"] .content{background:#f7f7f2}
body[data-authed="1"] .sidebar{background:var(--ued-forest);border-color:transparent}
body[data-authed="1"] .sidebar :is(.brand-title,.brand-sub,.nav-group-title){color:#e0ebe2}
body[data-authed="1"] .sidebar .nav-item{color:#f1f7f2;border-radius:9px;min-height:40px}
body[data-authed="1"] .sidebar .nav-item:hover{background:#314e3d}
body[data-authed="1"] .sidebar .nav-item.active{background:var(--ued-active);color:white}
body[data-authed="1"] .studio-page-head h1{color:var(--ued-ink);line-height:1.17;font-size:clamp(25px,3vw,36px)}
body[data-authed="1"] .studio-page-head p{color:var(--ued-muted);line-height:1.6}
body[data-authed="1"] .studio-eyebrow{color:#52675a;letter-spacing:.045em}
body[data-authed="1"] .studio-page :is(.card,.studio-surface){border-color:var(--ued-line);border-radius:14px}
body[data-authed="1"] .studio-page :is(.card-head,.studio-section-head){border-color:var(--ued-line)}
body[data-authed="1"] .studio-page :is(.filters,.voucher-date-filters){background:var(--ued-wash);border-color:var(--ued-line)}
body[data-authed="1"] .studio-page .filters :is(.filters-left,.filters-right){gap:8px;flex-wrap:wrap;min-width:0}
body[data-authed="1"] .studio-page .table th{background:#eef3ed;color:#40564a}
body[data-authed="1"] .studio-page .table :is(th,td){border-color:var(--ued-line)}
body[data-authed="1"] .studio-page .table tbody tr:hover td{background:#f5f8f3}
body[data-authed="1"] .studio-page .btn-primary{background:var(--ued-accent);border-color:var(--ued-accent);color:white}
body[data-authed="1"] .studio-page .btn-primary:not(:disabled):hover{background:#873719;border-color:#873719}
body[data-authed="1"] :is(.studio-page,.sidebar,.studio-editor-modal) :is(button,a,input,select,textarea):focus-visible{outline:2px solid var(--ued-ring);outline-offset:2px}
body[data-authed="1"] .studio-page .msel-caret{display:inline-flex;align-items:center;justify-content:center;align-self:center;line-height:1}
@media(max-width:600px){
 body[data-authed="1"] .studio-page-head{flex-wrap:wrap;gap:10px}
 body[data-authed="1"] .studio-head-actions{display:flex;flex-wrap:wrap;gap:8px;max-width:100%}
 body[data-authed="1"] .studio-page :is(.filters,.studio-head-actions) :is(.btn,.input,.select,.msel-trigger){min-height:40px}
 body[data-authed="1"] .studio-page :is(.filters,.studio-head-actions) > *{max-width:100%;min-width:0}
}
/* Transaction pages: filters are a distinct workspace above the results. */
body[data-authed="1"] .studio-query-panel{
  margin:14px 16px;padding:16px 18px;background:#f1f5ef;
  border:1px solid #dce7dc;border-radius:14px;min-width:0;
}
body[data-authed="1"] .studio-query-title{margin:0 0 12px;color:#243d30;font-size:16px;font-weight:750}
body[data-authed="1"] .studio-page .studio-query-panel > :is(.filters,.voucher-date-filters){
  margin:0;padding:0;border:0;background:transparent;box-shadow:none;
}
body[data-authed="1"] .studio-query-panel > .voucher-date-filters{margin-top:14px!important}
body[data-authed="1"] .studio-query-panel .voucher-date-filters fieldset{
  border:1px solid #dce7dc;border-radius:10px;background:#fff;padding:8px;
}
body[data-authed="1"] .studio-products .studio-catalog-filters{
  padding:12px;border-radius:12px;background:#eff4ee;border:1px solid #dce7dc;
}
@media(max-width:600px){
  body[data-authed="1"] .studio-query-panel{margin:10px;padding:12px}
  body[data-authed="1"] .studio-page .studio-query-panel :is(.filters-left,.filters-right){
    display:flex;flex-wrap:wrap;width:100%;
  }
  body[data-authed="1"] .studio-query-panel .filters-left > :is(.input,.select,.msel){flex:1 1 126px;min-width:0;max-width:100%!important}
  body[data-authed="1"] .studio-query-panel .voucher-date-filters fieldset{min-width:0}
  body[data-authed="1"] .studio-query-panel .voucher-date-filters input{min-width:0}
  body[data-authed="1"] .studio-products .studio-catalog-filters{flex-wrap:wrap}
}
body[data-authed="1"] .studio-workspace{
  display:flex;align-items:center;justify-content:space-between;gap:16px;
  margin:0 0 16px;padding:14px 18px;border:1px solid #dce7dc;
  border-radius:12px;background:#edf3ec;color:#263f30;
}
.studio-workspace h2{font-size:15px;margin:0 0 4px}
.studio-workspace p{color:#52675a;margin:0;line-height:1.55}
.studio-workspace-nav{display:flex;gap:8px;flex-wrap:wrap}
.studio-workspace-nav .btn{min-height:38px}
body[data-authed="1"] .studio-page :is(.vi-controls,.rush-filters,.gc-toolbar,.beta-toolbar,.tw-toolbar,.banner-page-filters){
  padding:12px;gap:10px;min-width:0;background:#f2f6ef;border-radius:12px;
}
body[data-authed="1"] .studio-page :is(.af-tabs,.tw-tabs,.beta-tabs,.gc-tabs,.permissions-tabs){
  display:flex;flex-wrap:wrap;gap:8px;align-items:stretch;padding:8px;border-radius:12px;background:#eaf1e9;
}
body[data-authed="1"] .studio-page :is(.vi-summary,.gc-metrics,.af-stats){
  display:grid;grid-template-columns:repeat(auto-fit,minmax(min(145px,100%),1fr));gap:10px;
}
body[data-authed="1"] .studio-page :is(.af-stats>div,.gc-metrics>div){
  background:#edf4ed;border-radius:10px;padding:12px;min-width:0;
}
body[data-authed="1"] .studio-page :is(.vi-summary,.vi-controls,.vi-results,.category-settings,.banner-page-filters,.security-audit-insights,.filters){scroll-margin-top:88px}
body[data-authed="1"] .studio-page .af-panel{padding:16px;max-width:100%;border-color:#dce7dc}
@media(max-width:600px){
  body[data-authed="1"] .studio-workspace{align-items:stretch;flex-direction:column;gap:10px;padding:12px}
  body[data-authed="1"] .studio-workspace-nav .btn{flex:1 1 auto;min-height:42px}
  body[data-authed="1"] .studio-page :is(.af-tabs,.tw-tabs,.beta-tabs,.gc-tabs,.permissions-tabs) > button{
    flex:1 1 116px;min-height:42px;white-space:normal;
  }
  body[data-authed="1"] .studio-page :is(.vi-controls,.rush-filters,.gc-toolbar,.beta-toolbar,.tw-toolbar){
    display:flex;flex-wrap:wrap;
  }
  body[data-authed="1"] .studio-page :is(.vi-controls,.rush-filters,.gc-toolbar,.beta-toolbar,.tw-toolbar)>:is(input,select,label){
    flex:1 1 130px;max-width:100%;min-width:0;
  }
  body[data-authed="1"] .studio-page :is(.security-audit-insights,.category-settings-grid,.banner-grid){grid-template-columns:minmax(0,1fr)}
  body[data-authed="1"] .studio-page :is(.gc-dialog,.tw-dialog,.af-root dialog){
    box-sizing:border-box;max-width:calc(100vw - 24px);max-height:calc(100dvh - 32px);overflow:auto;
  }
}
.studio-visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
body[data-authed="1"] .studio-query-panel{padding:10px 12px;margin-block:10px}
body[data-authed="1"] .orders-bulk-bar [hidden]{display:none!important}
@media(max-width:767px){
 body.mobile-admin .studio-query-panel .filters:not(.mobile-filters-open) .filters-left:has(.studio-list-search){display:flex!important}
 body.mobile-admin .studio-query-panel .filters:not(.mobile-filters-open) .filters-left>:not(.studio-list-search){display:none!important}
 body.mobile-admin .studio-query-panel .studio-list-search{width:100%;max-width:100%!important}
 body.mobile-admin .voucher-date-filters:not(.mobile-filters-open)>:not(.mobile-filter-toggle,.mobile-filter-summary,.voucher-date-error){display:none!important}
 body.mobile-admin .voucher-date-filters>.mobile-filter-toggle{display:block;width:100%;min-height:42px}
}
body[data-authed="1"] :is(.comments-page,.vouchers-page) button[hidden]{display:none!important}
body[data-authed="1"] :is(.coupons-page,.comments-page) .studio-workspace{display:none}
@media(max-width:767px){
 body.mobile-admin :is(.comments-page,.coupons-page,.flash-page) :is(.btn,.input,.select){min-height:42px}
 body.mobile-admin .flash-page .rush-filters > input{flex-basis:100%}
}
body[data-authed="1"] .home-page .studio-workspace{margin-bottom:12px}
body[data-authed="1"] .security_audit-page .security-audit-insights{gap:12px}
body[data-authed="1"] .openapi-page .tw-tabs .btn-primary{box-shadow:inset 0 0 0 1px currentColor}
@media(max-width:767px){
 body.mobile-admin .security-audit-shell .filters :is(input,select){min-height:42px}
 body.mobile-admin .security-audit-shell .filters-right>.btn{flex:1 1 125px}
 body.mobile-admin .openapi-page .tw-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
 body.mobile-admin .openapi-page .tw-toolbar>:is(label,select){flex-basis:100%}
 body.mobile-admin .openapi-page dialog{max-width:calc(100vw - 24px);max-height:calc(100dvh - 32px);overflow:auto}
}
@media(max-width:767px){
 body.mobile-admin .home-page .category-settings-grid{grid-template-columns:minmax(0,1fr)}
 body.mobile-admin .home-page :is(.banner-body,.banner-pending-grid,.category-settings){min-width:0}
 body.mobile-admin .home-page .banner-pending-grid{grid-template-columns:minmax(0,1fr)}
 body.mobile-admin .home-page .studio-workspace-nav .btn{flex:1}
}
.order-more-actions summary{cursor:pointer;list-style:none}
.order-more-actions summary::-webkit-details-marker{display:none}
.order-more-options{display:flex;flex-wrap:wrap;gap:6px;padding-top:6px}
body[data-authed="1"] .studio-workspace:not(:has(.studio-workspace-nav)){display:none}
@media(max-width:767px){
 body.mobile-admin .studio-query-panel .filters:has(.studio-list-search){display:flex;flex-direction:column}
 body.mobile-admin .studio-query-panel .filters:has(.studio-list-search) .filters-left{order:-1}
 body.mobile-admin .order-more-actions[open]{flex-basis:100%}
}
.ticket-bulk-preview-list{max-height: min(40vh, 320px);overflow:auto;padding-inline-start:24px;overflow-wrap:anywhere}
.vi-import-result{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.vi-import-result [hidden]{display:none!important}
@media(max-width:767px){
 .report-detail-table{display:block;width:100%;min-width:0!important}
 .report-detail-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
 .report-detail-table tbody{display:grid;gap:8px}
 .report-detail-table tbody tr{display:grid;min-width:0;border:1px solid var(--border);border-radius:10px;padding:8px}
 .report-detail-table td{min-width:0;overflow-wrap:anywhere;white-space:normal!important;border:0}
 .report-detail-table td::before{content:attr(data-label);display:block;color:var(--muted);font-size:12px}
 .report-detail-table td:nth-child(2){order:1}
}


body[data-authed="1"] .studio-structured-query{background:#fff;border:0;padding:8px 12px}
body[data-authed="1"] .studio-structured-query .filters,
body[data-authed="1"] .studio-structured-query .filters-left{display:flex!important;flex-wrap:nowrap;align-items:center;gap:8px;min-width:0}
.studio-structured-query .filters-left{flex:1}
body[data-authed="1"] .studio-structured-query .filters-left > .studio-list-search {
  flex: 1 1 240px; width: auto !important; min-width: min(100%, 190px) !important; max-width: none !important;
}
body[data-authed="1"] .studio-structured-query .filters-left > :not(.studio-list-search) {
  flex: 0 1 144px; min-width: 0 !important; max-width: 144px !important;
}
.studio-structured-query .filters-right{flex:none}
.studio-query-dates{position:relative;flex:none}
.studio-query-dates[hidden]{display:none!important}
.studio-query-dates summary{cursor:pointer;white-space:nowrap;padding:9px 10px;color:#40564a;border:1px solid #dce7dc;border-radius:8px}
.studio-advanced-fields{position:absolute;z-index:8;right:0;top:calc(100% + 6px);width:min(500px,calc(100vw - 44px));padding:12px;display:flex;flex-wrap:wrap;gap:10px;background:white;border:1px solid #dce7dc;border-radius:10px;box-shadow:0 8px 24px #20372b20}
.studio-advanced-fields .voucher-date-filters{width:100%;padding:0}
.studio-advanced-fields .order-query-dates{flex-wrap:wrap}
.order-query-dates label{display:grid;gap:4px;color:#52675a;font-size:13px}
.studio-structured-query .mobile-filter-toggle,.studio-structured-query .mobile-filter-summary{display:none!important}
body.mobile-admin[data-authed="1"] .studio-structured-query .filters-left > .studio-list-search {
  display: block !important; width: 100% !important; min-width: 0 !important; flex: 1 1 100%;
}
body.mobile-admin .studio-advanced-fields :is(select,input[type=date],.msel,fieldset){display:revert!important}

body[data-authed="1"] #view :is(.studio-catalog-filters,.data-tools,.vi-controls,.rush-filters,.gc-toolbar,.beta-toolbar,.tw-toolbar,.banner-page-filters) > :is(input[type=search],input[type=text],input:not([type])) {
  flex: 1 1 min(100%, 260px);
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
}
.studio-editor-stage .purchase-notice-text { display: block; width: 100%; min-height: 220px; resize: vertical; box-sizing: border-box; line-height: 1.7; }
.purchase-notice-hint { margin: 0 0 10px; }

/* Keep the status and export together even when the result summary wraps. */
body[data-authed="1"] .orders-results-bar { align-items: center; flex-wrap: wrap; }
body[data-authed="1"] .orders-results-left { flex: 1 1 150px; min-width: 0; }
body[data-authed="1"] .orders-results-left .orders-filter-chips { justify-content: flex-start; }
body[data-authed="1"] .orders-results-right { margin-inline-start: auto; width: auto; flex: 0 0 auto; flex-flow: row nowrap; align-items: center; gap: 8px; white-space: nowrap; }
body[data-authed="1"] .orders-results-right > :is(.badge,.btn) { flex: none; }

body[data-authed="1"] .studio-advanced-fields .voucher-single-date {
  display: grid; grid-template-columns: minmax(96px, auto) minmax(0, 1fr);
  align-items: center; gap: 8px; background: transparent; border: 0;
}
.voucher-single-date .voucher-date-range { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 6px; }
.voucher-single-date .voucher-date-range input[type=date] { width: 100%; min-width: 0; max-width: 100%; }
.voucher-single-date :is(.voucher-date-hint,.voucher-date-error) { grid-column: 1 / -1; margin: 0; }
body.mobile-admin .studio-advanced-fields .voucher-single-date { grid-template-columns: minmax(0,1fr); }
body.mobile-admin .studio-advanced-fields .voucher-single-date:not(.mobile-filters-open) > :is(select,.voucher-date-range,.voucher-date-hint) { display: revert !important; }
body.mobile-admin .studio-advanced-fields .voucher-single-date:not(.mobile-filters-open) > .voucher-date-range { display: grid !important; }
body.mobile-admin .studio-advanced-fields .voucher-single-date > :is(.mobile-filter-toggle,.mobile-filter-summary) { display: none !important; }

@media (max-width: 600px) {
  body[data-authed="1"] #view :is(.vi-controls,.rush-filters,.gc-toolbar,.beta-toolbar,.tw-toolbar) > :is(input[type=search],input[type=text],input:not([type])) { flex-basis: 100%; width: 100% !important; }
}
body[data-theme].mobile-admin #view .studio-structured-query .filters:not(.mobile-filters-open) .studio-advanced-fields input.input[type=date] { display: block !important; }
body[data-theme].mobile-admin #view .studio-structured-query .filters:not(.mobile-filters-open) > .filters-right { display: flex !important; width: auto; }

.role-route-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(132px,100%),1fr));
  gap: 8px; padding: 10px; border: 1px solid var(--border); border-radius: 10px;
}
.role-route-grid > .check-item {
  display: flex; align-items: center; gap: 8px; min-width: 0; margin: 0; padding: 8px 10px;
  min-height: 40px; border-radius: 7px; box-sizing: border-box;
}
.role-route-grid > .check-item > input { flex: none; margin: 0; }
.role-route-grid > .check-item > span { white-space: nowrap !important; word-break: normal !important; }
.role-route-grid > .check-item:has(input:checked) { border-color: var(--primary); }
.role-route-grid > .check-item:has(input:disabled) { opacity: .65; }
