/* UI refinement informed by unslop by Damir Sokolovsky (@heydamir), CC BY 4.0.
   Restricted to user, coupon, message and customer-service views. */
#content:has(#newUser,#newCoupon,#newMessage,[data-ticket]) .toolbar{gap:16px;margin-bottom:20px}
#content:has(#newUser,#newCoupon,#newMessage,[data-ticket]) .toolbar h2{margin:0 0 4px;font-size:18px;line-height:24px;font-weight:600;letter-spacing:0}
#content:has(#newUser,#newCoupon,#newMessage,[data-ticket]) .toolbar p{max-width:64em;color:#5d6b60;font-size:13px;line-height:20px;overflow-wrap:anywhere}
#content:has(#newUser,#newCoupon,#newMessage,[data-ticket]) .toolbar-actions>button{min-height:40px;padding:8px 16px;border-radius:8px;font-size:13px;line-height:20px;font-weight:600;white-space:nowrap}
#content:has(#newUser,#newCoupon,#newMessage,[data-ticket]) .tablewrap{max-width:100%;border:1px solid #dfe6df;border-radius:12px;background:#fff;overflow-x:auto}
#content:has(#newUser,#newCoupon,#newMessage,[data-ticket]) table{width:100%;min-width:720px;table-layout:fixed;border-collapse:collapse;font-size:13px;line-height:20px}
#content:has(#newUser,#newCoupon,#newMessage,[data-ticket]) thead th{padding:12px;background:#f4f7f3;color:#4f6555;font-size:12px;line-height:20px;font-weight:600;letter-spacing:0;text-align:left;white-space:normal}
#content:has(#newUser,#newCoupon,#newMessage,[data-ticket]) tbody td{min-width:0;padding:12px;vertical-align:top;border-bottom:1px solid #e8ede8;color:#26372d;line-height:20px;overflow-wrap:anywhere;word-break:normal}
#content:has(#newUser,#newCoupon,#newMessage,[data-ticket]) tbody tr:last-child td{border-bottom:0}
#content:has(#newUser,#newCoupon,#newMessage,[data-ticket]) tbody td.empty{padding:32px 16px;color:#617065;text-align:center}
#content:has(#newUser,#newCoupon,#newMessage,[data-ticket]) tbody tr:hover{background:#f8faf8}
#content:has(#newUser,#newCoupon,#newMessage,[data-ticket]) td strong{color:#26372d;font-size:13px;line-height:20px;font-weight:600;overflow-wrap:anywhere}
#content:has(#newUser,#newCoupon,#newMessage,[data-ticket]) td small{margin-top:4px;color:#617065;font-size:12px;line-height:20px;overflow-wrap:anywhere;word-break:normal}
#content:has(#newUser,#newCoupon,#newMessage,[data-ticket]) td .actions{display:flex;align-items:flex-start;gap:8px;flex-wrap:wrap}
#content:has(#newUser,#newCoupon,#newMessage,[data-ticket]) td button{min-height:40px;padding:8px 12px;border-radius:8px;font-size:13px;line-height:20px;font-weight:500;white-space:normal;overflow-wrap:anywhere}
#content:has(#newUser,#newCoupon,#newMessage,[data-ticket]) td .badge{min-height:28px;padding:4px 8px;border-radius:8px;font-size:12px;line-height:18px;font-weight:600;white-space:normal;word-break:normal}
/* Column proportions reflect the content, so controls and dates do not squeeze long names. */
#content:has(#newUser) :is(th,td):nth-child(1){width:32%}
#content:has(#newUser) :is(th,td):nth-child(2){width:14%}
#content:has(#newUser) :is(th,td):nth-child(3){width:12%;font-variant-numeric:tabular-nums}
#content:has(#newUser) :is(th,td):nth-child(4){width:18%;font-variant-numeric:tabular-nums}
#content:has(#newUser) :is(th,td):nth-child(5){width:24%}
#content:has(#newCoupon) table{min-width:900px}
#content:has(#newCoupon) :is(th,td):nth-child(1){width:25%}
#content:has(#newCoupon) :is(th,td):nth-child(2){width:20%;font-variant-numeric:tabular-nums}
#content:has(#newCoupon) tbody td:nth-child(2){color:#a52b24;font-weight:600}
#content:has(#newCoupon) tbody td:nth-child(2) small{color:#617065;font-weight:400}
#content:has(#newCoupon) :is(th,td):nth-child(3){width:13%;font-variant-numeric:tabular-nums}
#content:has(#newCoupon) :is(th,td):nth-child(4){width:17%}
#content:has(#newCoupon) :is(th,td):nth-child(5){width:15%}
#content:has(#newCoupon) :is(th,td):nth-child(6){width:10%}
#content:has(#newCoupon) tbody td:last-child button{min-width:60px;white-space:nowrap;overflow-wrap:normal}
#content:has(#newMessage) :is(th,td):nth-child(1){width:40%}
#content:has(#newMessage) :is(th,td):nth-child(2){width:25%}
#content:has(#newMessage) :is(th,td):nth-child(3){width:22%;font-variant-numeric:tabular-nums}
#content:has(#newMessage) :is(th,td):nth-child(4){width:13%;font-variant-numeric:tabular-nums}
#content:has(#newMessage) tbody td:first-child small{white-space:pre-wrap}
#content:has([data-ticket]) :is(th,td):nth-child(1){width:25%}
#content:has([data-ticket]) :is(th,td):nth-child(2){width:43%}
#content:has([data-ticket]) :is(th,td):nth-child(3){width:16%}
#content:has([data-ticket]) :is(th,td):nth-child(4){width:16%}
#content:has([data-ticket]) tbody td:nth-child(2) small{white-space:pre-wrap}
/* The user points drawer and coupon translation editors can wrap without clipping. */
#editor:has(.admin-points) .admin-points>p{margin:0 0 8px;line-height:20px}
#editor:has(.admin-points) .admin-points-balance{margin:16px 0;color:#294a37;font-size:14px;line-height:24px}
#editor:has(.admin-points) .admin-points-balance strong{font-size:20px;font-weight:600;font-variant-numeric:tabular-nums}
#editor:has(.admin-points) .admin-points-pagination{display:flex;justify-content:flex-end;align-items:center;gap:8px;margin-top:16px;flex-wrap:wrap;font-size:13px}
#editor:has(.admin-points) .admin-points-pagination button{min-height:44px;border-radius:8px}
#editor:has(form input[name="amount"]) .product-locales{margin:16px 0;padding:0 16px;border:1px solid #dfe6df;border-radius:10px;background:#fafbf9}
#editor:has(form input[name="amount"]) :is(.product-locales,.product-locale)>summary{min-height:44px;padding:12px 0;color:#1d6040;font-size:13px;line-height:20px;font-weight:600;overflow-wrap:anywhere}
#editor:has(form input[name="amount"]) .product-locale label{margin:0 0 16px}
#editor:has(form input[name="amount"]) .product-locale label.check{gap:8px;min-height:44px;line-height:20px}
#editor:has(form input[name="amount"]) .product-locale label.check input{flex:none;margin:0}
#editor:has(form textarea[name="reply"]) form>p{white-space:pre-wrap;overflow-wrap:anywhere}
#editor:has(form textarea[name="reply"]) form>h3{margin:0 0 8px;font-size:15px;line-height:24px;font-weight:600;overflow-wrap:anywhere}
@media(max-width:650px){
 #content:has(#newUser,#newCoupon,#newMessage,[data-ticket]) .toolbar{align-items:stretch;gap:12px;flex-wrap:wrap}
 #content:has(#newUser,#newCoupon,#newMessage,[data-ticket]) .toolbar-actions>button{max-width:100%;min-height:44px}
 #content:has(#newUser,#newCoupon,#newMessage,[data-ticket]) td button{min-height:44px}
 #editor:has(.admin-points) .admin-points-pagination{justify-content:flex-start}
}
/* Long notices remain readable without turning the message list into one giant row. */
#content:has(#newMessage) .admin-message-preview{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden;max-height:60px;white-space:pre-wrap}
#content:has(#newMessage) .admin-message-content{margin-top:8px}
#content:has(#newMessage) .admin-message-content summary{width:fit-content;min-height:36px;padding:8px 0;font-size:12px;line-height:20px;font-weight:500}
#content:has(#newMessage) .admin-message-full{max-height:280px;margin-top:8px;padding:12px;background:#f6f8f6;border:1px solid #e2e6e3;border-radius:8px;white-space:pre-wrap;overflow:auto;overscroll-behavior:contain;overflow-wrap:anywhere;line-height:20px;font-size:13px}
#content:has(#newMessage) td:has(>.admin-message-content[open])>.admin-message-preview{display:none}
