.mas-portal{max-width:1200px;margin:40px auto;padding:24px;color:#253041}
.mas-login{max-width:420px;margin:50px auto;padding:35px 30px;text-align:center;background:#edf0f5;border-radius:26px;box-shadow:9px 9px 20px #c4c7cf,-9px -9px 20px #fff}
.mas-login h2{color:#990d07}
.mas-login label{display:block;text-align:left;font-weight:600;margin:14px 0 6px}
.mas-login input[type=text],.mas-login input[type=password]{width:100%;box-sizing:border-box;border:0;background:#f3f4f7;border-radius:16px;padding:14px;box-shadow:inset 3px 3px 8px #c9cdd6,inset -3px -3px 8px #fff}
.mas-login input[type=submit]{margin:15px 0;border:0;background:#990d07;color:white;padding:13px 35px;border-radius:10px;font-weight:700;cursor:pointer}
.mas-header{display:flex;justify-content:space-between;align-items:center;border-bottom:3px solid #990d07;margin-bottom:25px}
.mas-header h2{color:#990d07}
.mas-scroll{overflow:auto}
.mas-table{width:100%;border-collapse:collapse;background:#fff;min-width:920px}
.mas-table th,.mas-table td{border-bottom:1px solid #d7dde6;padding:12px;text-align:left;vertical-align:top}
.mas-table th{background:#990d07;color:white}
.mas-table tr:nth-child(even){background:#f8f9fb}
.mas-table small{color:#667085}
.mas-pages{display:flex;gap:10px;margin:20px 0}
.mas-pages a{padding:8px 12px;border:1px solid #ddd;border-radius:5px}
.mas-pages a.current{background:#990d07;color:white}
.mas-foot{font-size:13px;color:#6b7280}
@media(max-width:600px){.mas-portal{padding:12px}.mas-header h2{font-size:20px}.mas-login{padding:24px 18px}}

/* Read-only order popups */
.mas-view-order,.mas-close-button{background:#990d07;color:#fff!important;border:0;border-radius:6px;padding:9px 14px;font:inherit;font-weight:600;cursor:pointer}
.mas-view-order:hover,.mas-close-button:hover{background:#750900}
.mas-modal[hidden]{display:none!important}
.mas-modal{position:fixed;inset:0;z-index:999999;display:flex;align-items:center;justify-content:center;padding:16px;box-sizing:border-box}
.mas-modal-backdrop{position:absolute;inset:0;background:rgba(8,14,26,.68)}
.mas-modal-panel{position:relative;display:flex;flex-direction:column;width:min(100%,940px);max-height:calc(100dvh - 32px);overflow:hidden;background:#fff;border-radius:14px;box-shadow:0 18px 70px #0005;color:#253041}
.mas-modal-top{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 24px;border-bottom:2px solid #990d07}
.mas-modal-top h2{margin:0;color:#990d07;font-size:22px}
.mas-modal-close{background:none;border:0;font-size:32px;cursor:pointer;color:#333;line-height:1;min-width:40px;min-height:40px}
.mas-modal-body{padding:20px 24px;overflow:auto;overscroll-behavior:contain}
.mas-modal-body h3{font-size:17px;margin:18px 0 10px;color:#990d07}
.mas-order-summary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;background:#f7f8fa;border-radius:8px;padding:15px}
.mas-order-summary>div{display:flex;flex-direction:column;gap:4px}
.mas-order-summary strong{font-size:12px;color:#606b7c}
.mas-order-addresses{display:grid;grid-template-columns:1fr 1fr;gap:22px}
.mas-order-addresses section{min-width:0;overflow-wrap:anywhere}
.mas-order-addresses p{margin:5px 0}
.mas-address-text{line-height:1.6}
.mas-order-items-scroll{overflow-x:auto}
.mas-order-items{border-collapse:collapse;width:100%;min-width:540px}
.mas-order-items th,.mas-order-items td{padding:10px;border-bottom:1px solid #e3e6eb;text-align:left}
.mas-order-items th{background:#f5f6f8}
.mas-order-totals{margin:14px 0 0 auto;max-width:390px}
.mas-order-totals>div{display:flex;justify-content:space-between;gap:15px;padding:8px;border-bottom:1px solid #e3e6eb}
.mas-modal-actions{display:flex;justify-content:flex-end;padding:13px 24px;border-top:1px solid #e3e6eb}
body.mas-dialog-open{overflow:hidden}
@media(max-width:640px){.mas-modal{padding:7px}.mas-modal-panel{max-height:calc(100dvh - 14px)}.mas-modal-top,.mas-modal-body,.mas-modal-actions{padding:12px}.mas-modal-top h2{font-size:19px}.mas-order-addresses,.mas-order-summary{grid-template-columns:1fr}.mas-order-totals{max-width:100%}}

/* v1.2: compact red X button, preserving the glyph size */
.mas-modal-close{width:32px!important;height:32px!important;min-width:32px!important;min-height:32px!important;padding:0!important;border:0!important;border-radius:7px!important;background:#990d07!important;color:#fff!important;font-size:32px!important;font-weight:500!important;line-height:28px!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;flex-shrink:0}
.mas-modal-close:hover,.mas-modal-close:focus-visible{background:#750900!important;outline:2px solid #efb0b0;outline-offset:2px}
.mas-green-dot,.mas-slip-success-icon{display:inline-grid;place-items:center;border-radius:50%;background:#16803c;color:#fff;font-weight:700;vertical-align:middle}
.mas-green-dot{width:16px;height:16px;box-shadow:0 0 0 2px #d8f3e1}
.mas-slip-success-icon{width:28px;height:28px;margin-right:8px}
.mas-slip-link{border:0!important;background:transparent!important;color:#17843d!important;padding:3px 2px!important;font:inherit!important;font-weight:700!important;text-decoration:underline!important;cursor:pointer!important}
.mas-slip-link:hover{color:#075d29!important}
.mas-confirmed{color:#16803c;font-weight:700}
.mas-pending{color:#985b00}
.mas-customer-confirm-state{padding:12px 14px;border-radius:9px;background:#f1f8f2;margin-bottom:14px;display:flex;gap:8px;flex-wrap:wrap}
.mas-slip-modal .mas-modal-panel{width:min(100%,650px)}
.mas-slip-preview{text-align:center}
.mas-slip-preview img{display:block;width:auto;max-width:100%;height:auto;max-height:65dvh;object-fit:contain;margin:0 auto;border-radius:16px;box-shadow:0 7px 22px #17253a35}
.mas-slip-preview p{color:#666;font-size:13px;margin:10px 0 0}
.mas-download-slip{background:#990d07;color:#fff!important;padding:9px 14px;border-radius:7px;text-decoration:none!important;margin-right:auto}
.mas-slip-uploaded{display:flex;align-items:center;color:#16803c;font-weight:700}
.mas-slip-upload-form{background:#fff8f8;border:1px dashed #b83b3b;border-radius:14px;padding:16px;margin:16px 0}
.mas-slip-upload-form input[type=file]{background:white;border:1px solid #e8c3c3;border-radius:10px;padding:12px;max-width:100%;box-sizing:border-box}
.mas-file-selected{color:#1a6940;font-size:13px}
.mas-customer-confirm{border-top:1px solid #e4e4e4;margin-top:22px;padding-top:18px}
.mas-customer-confirm h3{color:#990d07}
.mas-confirm-check{display:flex;align-items:center;gap:9px;margin:12px 0;font-size:14px}
.mas-confirm-submit{background:#990d07!important;color:white!important;border:0!important;border-radius:10px!important;padding:12px 22px!important;font-weight:700!important;cursor:pointer}
.mas-confirm-submit:hover{background:#750900!important}
.mas-customer-confirm small{display:block;color:#747474;margin-top:8px}
@media(max-width:600px){.mas-modal-close{width:30px!important;height:30px!important;min-width:30px!important;min-height:30px!important}.mas-customer-confirm-state{flex-direction:column}.mas-slip-preview img{max-height:55dvh}}
