
.mx-coupon, .mx-coupon-page { --ink:#16365b; --blue:#1f4c92; --paper:#f3f6fa; --line:#ccd7e5; --muted:#52647b; font:15px/1.6 "Microsoft JhengHei",system-ui,sans-serif; color:var(--ink); }
.mx-coupon-page { margin:0; background:var(--paper); }
.mx-coupon-page header { background:var(--ink); color:white; padding:24px max(24px,calc((100vw - 1200px)/2)); }
.mx-coupon-page header a {color:white;}
.mx-coupon-page h1 {font-size:28px;margin:6px 0;font-weight:700;letter-spacing:.04em;}
.mx-coupon-page main {max-width:1200px;margin:24px auto;padding:0 20px;}
.mx-coupon-page section {background:white;border:1px solid var(--line);border-radius:10px;padding:24px;margin:20px 0;}
.mx-coupon-page h2 {margin:0 0 16px;font-size:20px;}
.mx-coupon-page .grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;}
.mx-coupon-page label,.mx-coupon label {display:block;font-weight:600;}
.mx-coupon-page input,.mx-coupon-page select,.mx-coupon-page textarea,.mx-coupon input {box-sizing:border-box;width:100%;padding:10px;border:1px solid var(--line);border-radius:5px;font:inherit;color:inherit;background:white;}
.mx-coupon-page button,.mx-coupon button,.mx-coupon-link {padding:9px 15px;border:1px solid #1f4c92;border-radius:5px;background:#1f4c92;color:white;font:inherit;cursor:pointer;}
.mx-coupon-page button.secondary,.mx-coupon button.secondary {background:white;color:var(--blue);}
.mx-coupon-page button:disabled,.mx-coupon button:disabled {opacity:.5;cursor:wait;}
.mx-coupon-page :focus-visible,.mx-coupon :focus-visible {outline:3px solid #dd930b;outline-offset:3px;}
.mx-coupon-page .actions,.mx-coupon .actions {display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-top:18px;}
.mx-coupon-page .scroll {overflow:auto;}
.mx-coupon-page table {border-collapse:collapse;width:100%;white-space:nowrap;text-align:left;}
.mx-coupon-page th,.mx-coupon-page td {border-bottom:1px solid var(--line);padding:12px 10px;}
.mx-coupon-page th {background:var(--paper);}
.mx-coupon-page code {font:13px Consolas,monospace;letter-spacing:.03em;}
.mx-coupon-page .hint,.mx-coupon .hint {color:var(--muted);}
.mx-coupon-page [role=status],.mx-coupon [role=status] {white-space:pre-line;padding:10px 0;min-height:24px;}
.mx-coupon-page #notice {position:sticky;top:0;background:#e9f0fb;padding:12px;border-left:4px solid var(--blue);z-index:1;}
.mx-coupon {box-sizing:border-box;border:1px solid var(--line);border-radius:12px;padding:28px;width:min(540px,calc(100vw - 32px));max-height:90vh;overflow:auto;}
.mx-coupon::backdrop {background:rgba(12,30,50,.65);}
.mx-coupon h2 {margin:0 0 10px;font-size:24px;}
.mx-coupon output {display:block;background:var(--paper);padding:15px;margin-top:16px;white-space:pre-line;border-left:4px solid var(--blue);}
.mx-coupon input {font-family:Consolas,monospace;}
@media(max-width:760px){.mx-coupon-page .grid{grid-template-columns:1fr}.mx-coupon-page section{padding:16px}}

.mx-coupon [hidden], .mx-coupon-page [hidden] {display:none !important;}

.mx-coupon-page td button + button {margin-left:8px;}
.mx-coupon-page #detail h2:not(:first-child) {margin-top:24px;}

/* Separate task views keep creation, codes and history out of each other's way. */
.mx-coupon-page .admin-nav {display:flex;gap:6px;flex-wrap:wrap;border-bottom:1px solid var(--line);margin:22px 0 16px;}
.mx-coupon-page .admin-nav a {padding:12px 18px;color:var(--muted);text-decoration:none;border-bottom:3px solid transparent;font-weight:600;}
.mx-coupon-page .admin-nav a[aria-current="page"] {color:var(--blue);border-color:var(--blue);background:#e9f0fb;}
.mx-coupon-page .section-heading {display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;}
.mx-coupon-page .section-heading h2 {margin:0;}
.mx-coupon-page a.mx-coupon-link {display:inline-block;text-decoration:none;}
.mx-coupon-page .cancel-link {margin-left:18px;color:var(--blue);}
.mx-coupon-page #batch-name {margin:16px 0 4px;}
.mx-coupon-page #notice:empty {display:none;}
.mx-coupon-page #batch-nav {margin-top:24px;}

#pricingModal .header {display:flex;align-items:center;justify-content:space-between;gap:20px;flex-wrap:wrap;}
#pricingModal .header .coupon-pricing-entry {display:inline-flex;align-items:center;justify-content:center;width:auto;min-width:0;flex:0 0 auto;padding:9px 16px;margin:0;border:1px solid #cbd8ec;border-radius:8px;background:white;color:#245298;font:500 14px system-ui;cursor:pointer;box-shadow:none;}
#pricingModal .header .coupon-pricing-entry:hover {background:#f2f6fc;}
.mx-coupon {font-family:system-ui,"Microsoft JhengHei",sans-serif;padding:28px 30px;}
.mx-coupon .hint {margin:10px 0 22px;}
.mx-coupon .actions {justify-content:flex-end;margin-top:20px;}
.mx-coupon [role=status]:empty {display:none;}
.mx-coupon [data-confirm] {margin-top:18px;}

html:not(.coupon-available) [data-coupon-open], html:not(.coupon-available) [data-coupon-label="label"] { display:none !important; }
