/* Admin entry layout and shared vertical alignment. */
body #app .shell .main .settings-page{display:grid;gap:1px!important}
body #app .shell .main .settings-page>.settings-panel{margin:0!important}

/* Names, region/count and disclosure all share the same vertical centre. */
body #app .shell .main .tev-order-composer :is(.tev-order-domain-toggle,.tev-platform-domain-head)>div:first-child{
  align-items:center!important;
}
body #app .shell .main .tev-order-composer :is(.tev-order-domain-toggle,.tev-platform-domain-head) h2,
body #app .shell .main .tev-order-composer :is(.tev-order-domain-toggle,.tev-platform-domain-head)>div:first-child>:is(.muted,small){
  line-height:24px!important;
  margin:0!important;
  padding:0!important;
}
body #app .shell .main .tev-order-composer :is(.tev-order-domain-chevron,.tev-platform-domain-head>.chev){
  display:grid!important;
  place-items:center!important;
  height:24px!important;
  line-height:24px!important;
}
body #app .shell .main .tev-cat-head{align-items:center!important}
body #app .shell .main .tev-cat-head .tev-cat-title{display:flex;align-items:center;gap:9px;min-width:0}
body #app .shell .main .tev-cat-head .tev-cat-title :is(h2,small){margin:0!important;line-height:24px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body #app .shell .main .tev-cat-head .tev-domain-actions{align-items:center!important}

body #app .shell .main .tev-ap-modal{
  position:fixed;inset:0;z-index:15000;
  display:flex;align-items:center;justify-content:center;
  padding:18px;background:rgba(24,14,22,.38);
}
body #app .shell .main .tev-ap-modal-card{
  box-sizing:border-box;
  width:min(1280px,calc(100vw - 36px));max-height:94vh;
  overflow:auto;overscroll-behavior:contain;
  margin:0;padding:12px;
  background:var(--tev-bg,#f3f0e9);
  border:1px solid var(--tev-border,#ddd6cb);border-radius:16px;
  box-shadow:0 18px 55px rgba(24,14,22,.2);
}
body #app .shell .main .tev-ap-modal-card>.tev-admin-order-modal-head{
  position:sticky;top:-12px;z-index:4;
  display:grid;grid-template-columns:1fr auto 1fr;align-items:center;
  margin:-12px -12px 12px;padding:8px 12px;
  border-bottom:1px solid var(--tev-border,#ddd6cb);
  background:var(--tev-bg,#f3f0e9);
}
body #app .shell .main .tev-ap-modal-card>.tev-admin-order-modal-head>strong{font:600 13px/1.2 Inter,Arial,sans-serif}
body #app .shell .main .tev-ap-modal-card .tev-admin-order-modal-close{justify-self:end;display:grid;place-items:center;width:30px;height:30px;min-height:30px;border:0;border-radius:50%;background:transparent;font-size:20px!important;padding:0;color:#512044;cursor:pointer}
body #app .shell .main .tev-ap-modal-card .tev-order-back-list{justify-self:start;min-height:30px;height:30px;padding:0 4px;font-size:11px!important;border:0;background:transparent;color:#512044;cursor:pointer}
body #app .shell .main .tev-ap-modal-card .tev-admin-order-composer{margin:0}
body #app .shell .main .tev-ap-modal-card .tev-order-composer-admin-head{margin:0 0 10px}
body #app .shell .main .tev-ap-modal-card .tev-order-composer-admin-head select{width:100%;height:36px!important;min-height:36px!important}
body #app .shell .main .tev-ap-composer{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:12px;align-items:start}
body #app .shell .main .tev-ap-composer>div:first-child{min-width:0}
body #app .shell .main .tev-ap-composer .tev-order-composer-tools{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:0 0 8px;padding:0;border:0;background:transparent;box-shadow:none}
body #app .shell .main .tev-ap-composer .tev-order-composer-tools>input{flex:1 1 240px;min-width:0;width:auto;height:36px;margin:0;padding:0 11px;border:1px solid var(--tev-border,#ddd6cb);border-radius:10px;background:#fff}
body #app .shell .main .tev-ap-composer .tev-order-composer-tools>select{flex:0 1 210px;max-width:100%;min-width:0;height:36px;margin:0;padding:0 28px 0 11px;border:1px solid var(--tev-border,#ddd6cb);border-radius:10px;background:#fff}
body #app .shell .main .tev-ap-composer .tev-order-composer-tools>:is(input,select):focus-visible{outline:2px solid rgba(73,52,148,.3);outline-offset:1px}
body #app .shell .main .tev-ap-composer .tev-ap-list-head{
  display:grid;grid-template-columns:minmax(0,1fr) 46px 84px 110px;gap:8px;
  align-items:center;padding:0 12px 5px;
  color:var(--tev-text-muted,#77736f);font:500 9px/1.2 Inter,Arial,sans-serif;
  text-transform:uppercase;letter-spacing:.04em;
}
body #app .shell .main .tev-ap-list-head>span:not(:first-child){text-align:center}
body #app .shell .main .tev-ap-composer #tev-ap-products{display:block;min-width:0}
body #app .shell .main .tev-ap-composer .tev-order-composer-domain{margin:0 0 1px!important;padding:8px 12px!important}
body #app .shell .main .tev-ap-composer .tev-order-domain-toggle{min-height:28px!important;margin:0!important}
body #app .shell .main .tev-ap-composer .tev-order-domain-toggle h2{font-size:14px!important}
body #app .shell .main .tev-ap-composer .tev-order-composer-product.tev-ap-product{
  grid-template-columns:minmax(0,1fr) 46px 84px 110px!important;
  grid-template-rows:34px!important;min-height:38px!important;gap:8px!important;
}
body #app .shell .main .tev-ap-composer .tev-ap-product>.price{grid-column:3!important;grid-row:1!important}
body #app .shell .main .tev-ap-composer .tev-ap-product>.qty{grid-column:4!important;grid-row:1!important;gap:3px!important}
body #app .shell .main .tev-ap-composer .tev-ap-product>.tev-ap-stock{grid-column:2;grid-row:1;display:flex;align-items:center;justify-content:center;gap:3px;font:500 11px/1.2 Inter,Arial,sans-serif;color:#512044;white-space:nowrap}
body #app .shell .main .tev-ap-stock>small{font-size:9px!important;color:var(--tev-text-muted,#77736f)}
body #app .shell .main .tev-ap-product .tev-order-cuvee-name{min-width:0;flex:1 1 auto!important}
body #app .shell .main .tev-ap-product .product-meta{max-width:35%;font-size:9px!important}
body #app .shell .main .tev-ap-product .tev-ap-quantity{
  box-sizing:border-box;width:44px!important;min-width:0!important;
  min-height:28px!important;height:28px!important;margin:0!important;padding:0 2px!important;
  border:1px solid var(--tev-border,#ddd6cb)!important;border-radius:7px!important;
  background:#fff!important;text-align:center!important;font:500 11px/1.2 Inter,Arial,sans-serif!important;
  appearance:textfield;-moz-appearance:textfield;
}
body #app .shell .main .tev-ap-quantity::-webkit-inner-spin-button,body #app .shell .main .tev-ap-quantity::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
body #app .shell .main .tev-ap-summary{position:sticky;top:48px;min-width:0;padding:12px!important;background:#fff;border:1px solid var(--tev-border,#ddd6cb);border-radius:14px}
body #app .shell .main .tev-ap-summary h3{margin:0 0 4px}
body #app .shell .main .tev-ap-summary p{margin:5px 0}
body #app .shell .main .tev-ap-summary .sumline{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:7px 0;font-size:11px;border-bottom:1px solid var(--tev-border,#ddd6cb)}
body #app .shell .main .tev-ap-summary .sumline>b{white-space:nowrap}
body #app .shell .main .tev-ap-summary .total-line{font-weight:600;border-bottom:0}
body #app .shell .main .tev-ap-summary .field{margin:8px 0}
body #app .shell .main .tev-ap-summary .field textarea{resize:vertical;min-height:70px!important}
body #app .shell .main .tev-ap-error{color:#9a3f3f;line-height:1.3}
body #app .shell .main .tev-ap-error:empty{display:none}
body #app .shell .main .tev-ap-submit{width:100%;min-height:36px}
body #app .shell .main .tev-ap-empty{padding:14px!important}
@media(max-width:1000px){
  body #app .shell .main .tev-ap-composer{grid-template-columns:minmax(0,1fr) 270px}
  body #app .shell .main .tev-ap-product .product-meta{display:none!important}
}
@media(max-width:800px){
  body #app .shell .main .tev-ap-modal{padding:8px}
  body #app .shell .main .tev-ap-modal-card{width:calc(100vw - 16px);padding:8px;border-radius:14px;max-height:96vh}
  body #app .shell .main .tev-ap-modal-card>.tev-admin-order-modal-head{top:-8px;margin:-8px -8px 10px;padding:8px}
  body #app .shell .main .tev-ap-composer{grid-template-columns:1fr}
  body #app .shell .main .tev-ap-summary{position:static}
}
@media(max-width:500px){
  body #app .shell .main .tev-ap-modal-card>.tev-admin-order-modal-head{grid-template-columns:1fr auto}
  body #app .shell .main .tev-ap-modal-card>.tev-admin-order-modal-head>strong{grid-column:1;grid-row:2;margin:4px 0 0 4px;justify-self:start}
  body #app .shell .main .tev-ap-modal-card .tev-admin-order-modal-close{grid-column:2;grid-row:1 / span 2}
  body #app .shell .main .tev-ap-composer .tev-order-composer-tools>:is(input,select){flex:1 1 100%;width:100%}
  body #app .shell .main .tev-ap-composer .tev-order-composer-domain{padding:6px 8px!important}
  body #app .shell .main .tev-ap-composer .tev-ap-list-head{grid-template-columns:minmax(0,1fr) 29px 60px 90px;gap:4px;padding-right:8px;padding-left:8px}
  body #app .shell .main .tev-ap-composer .tev-order-composer-product.tev-ap-product{grid-template-columns:minmax(0,1fr) 29px 60px 90px!important;gap:4px!important}
  body #app .shell .main .tev-ap-stock>small{display:none!important}
  body #app .shell .main .tev-ap-composer .tev-ap-product>.price{font-size:11px!important;gap:1px!important}
  body #app .shell .main .tev-ap-composer .tev-ap-product>.price>b{font-size:11px!important}
  body #app .shell .main .tev-ap-composer .tev-ap-product>.price>small{font-size:8px!important}
  body #app .shell .main .tev-ap-composer .tev-ap-product>.qty>button{width:25px!important;height:25px!important;min-width:25px!important;min-height:25px!important;flex-basis:25px!important}
  body #app .shell .main .tev-ap-product .tev-ap-quantity{width:34px!important}
}

/* V459 - yearly order archives */
body #app .tev-orders-archives{margin-top:22px;display:grid;gap:1px}
body #app .tev-orders-archives-title{margin:0 0 2px;font-size:14px;letter-spacing:.06em;text-transform:uppercase}
body #app .tev-orders-archive{border:1px solid var(--tev-border,#ddd6cb);border-radius:12px;background:var(--card,#fff);overflow:hidden}
body #app .tev-orders-archive>summary{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 14px;cursor:pointer;list-style:none;font-weight:700;background:var(--bg,#f7f4ef)}
body #app .tev-orders-archive>summary::-webkit-details-marker{display:none}
body #app .tev-orders-archive>summary:after{content:'+';margin-left:4px;font-size:18px;font-weight:400}
body #app .tev-orders-archive[open]>summary:after{content:'−'}
body #app .tev-orders-archive-body{padding:0}
body #app .tev-orders-archive-body .tablewrap{margin:0;border:0;border-radius:0}

/* V460 - order domain spacing and editable instructions */
body #app .shell .main .tev-order-composer-domain{margin-bottom:1px!important}
body #app .shell .main .tev-order-composer-domain:last-child{margin-bottom:0!important}
body #app .tev-order-note-edit{margin-top:12px}
body #app .tev-order-note-edit textarea{width:100%;box-sizing:border-box}

/* V461 - compact order archives + standard quantity steppers */
body #app .tev-order-line-controls{display:flex;align-items:center;gap:10px}
body #app .tev-order-line-qty{display:grid;grid-template-columns:30px 44px 30px;align-items:center;gap:3px}
body #app .tev-order-line-qty>button{width:30px;height:30px;min-height:30px;padding:0;border:1px solid var(--tev-border,#ddd6cb);border-radius:50%;background:#fff;color:#512044;font-size:16px;line-height:1;cursor:pointer}
body #app .tev-order-line-qty>button:disabled{opacity:.35;cursor:not-allowed}
body #app .tev-order-line-qty>input{width:44px!important;height:30px!important;min-height:30px!important;padding:0 3px!important;text-align:center!important;border:1px solid var(--tev-border,#ddd6cb)!important;border-radius:7px!important;background:#fff!important;box-sizing:border-box!important}
body #app .tev-order-line-qty>input::-webkit-inner-spin-button,
body #app .tev-order-line-qty>input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
body #app .tev-order-line-qty>input{-moz-appearance:textfield}

/* V465 - vertically center catalogue/admin table rows */
body #app .catalogue-table td,
body #app .catalogue-table th,
body #app .tev-catalogue-table td,
body #app .tev-catalogue-table th,
body #app .admin-catalogue-table td,
body #app .admin-catalogue-table th{
  vertical-align:middle!important;
}
body #app .catalogue-table td>div,
body #app .tev-catalogue-table td>div,
body #app .admin-catalogue-table td>div{
  align-items:center;
}
