/* Ryadoo merchant app — professional UI layer (loaded last, overrides legacy patches) */
:root{--r-card:20px;--r-btn:14px;--sh-1:0 1px 2px rgba(42,8,84,.06),0 6px 18px -8px rgba(42,8,84,.14);--sh-2:0 10px 30px -12px rgba(91,18,166,.45);--grad:linear-gradient(135deg,#8B2BE2 0%,#5B12A6 100%)}
[data-theme="dark"]{--sh-1:0 1px 2px rgba(0,0,0,.4),0 6px 18px -8px rgba(0,0,0,.6)}
body{font-family:'Tajawal',system-ui,-apple-system,sans-serif;-webkit-font-smoothing:antialiased;line-height:1.5}
svg{flex:none}
:focus-visible{outline:2px solid var(--v-500);outline-offset:2px}
button,.round-btn,.nav-item,.more-row,.ad-item{-webkit-user-select:none;user-select:none;transition:transform .12s,background .15s,box-shadow .15s}
button:active,.round-btn:active,.more-row:active,.ad-item:active{transform:scale(.97)}

/* ---------- Header ---------- */
body .b-header{background:var(--grad);padding:calc(env(safe-area-inset-top,0px) + 18px) 18px 62px;border-radius:0 0 30px 30px;box-shadow:0 14px 34px -18px rgba(91,18,166,.7)}
body .b-top{display:flex;align-items:center;justify-content:space-between;gap:12px}
body .store-id{display:flex;align-items:center;gap:12px;min-width:0}
body .avatar{width:46px;height:46px;border-radius:15px;background:rgba(255,255,255,.18);border:1px solid rgba(255,255,255,.28);color:#fff;font-weight:800;font-size:19px;display:flex;align-items:center;justify-content:center;backdrop-filter:blur(6px)}
body .store-txt{min-width:0}
body .store-txt .nm{color:#fff;font-weight:800;font-size:17px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body .store-txt .sb{color:rgba(255,255,255,.75);font-size:12px;font-weight:500}
body .top-actions{display:flex;gap:8px}
body .round-btn{width:40px;height:40px;border-radius:13px;background:rgba(255,255,255,.16);border:1px solid rgba(255,255,255,.22);display:flex;align-items:center;justify-content:center;cursor:pointer;color:#fff}
body .round-btn svg{width:19px;height:19px;fill:none;stroke:#fff;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
body .b-body{margin-top:-42px;gap:14px;padding-bottom:110px}

/* ---------- Cards ---------- */
body .summary-card,body .link-card,body .card,body .p-card,body .more-section,body .login-card,body .feature-card,body .ad-list{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-card);box-shadow:var(--sh-1)}
body .summary-card{padding:18px}
body .summary-top{display:flex;align-items:baseline;justify-content:space-between;gap:10px;margin-bottom:14px}
body .summary-top h3{margin:0;font-size:16px;font-weight:800;color:var(--ink)}
body .summary-top p{margin:0;font-size:12px;color:var(--muted)}
body .metric-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
body .metric{position:relative;background:var(--v-100);border:0;border-radius:16px;padding:13px 14px;display:flex;flex-direction:column;gap:3px;overflow:hidden}
body .metric .mi{width:30px;height:30px;border-radius:10px;background:var(--surface);color:var(--v-600);display:flex;align-items:center;justify-content:center;margin-bottom:6px;box-shadow:var(--sh-1)}
body .metric .mi svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
body .metric .lbl{font-size:12px;font-weight:600;color:var(--muted)}
body .metric .val{font-size:21px;font-weight:800;color:var(--ink);letter-spacing:-.2px;direction:ltr;text-align:start;unicode-bidi:plaintext}
body .metric.good{background:var(--good-bg)}body .metric.good .mi{color:var(--good)}
body .metric.bad{background:var(--bad-bg)}body .metric.bad .mi{color:var(--bad)}
body .period-tabs{display:flex;gap:4px;margin-top:14px;background:var(--bg);padding:4px;border-radius:14px}
body .period-tabs button{flex:1;padding:9px 0;border-radius:11px;font-size:13px;font-weight:700;color:var(--muted)}
body .period-tabs button.active{background:var(--surface);color:var(--v-600);box-shadow:var(--sh-1)}

body .link-card{padding:14px 16px;display:flex;flex-wrap:wrap;align-items:center;gap:10px}
body .link-card .url{flex:1 1 100%;display:flex;align-items:center;gap:8px;background:var(--bg);border-radius:12px;padding:10px 12px;font-size:13px;font-weight:600;color:var(--v-700);direction:ltr;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body .link-card .msg{flex:1;font-size:13px;color:var(--muted)}
body .share-btn{display:inline-flex;align-items:center;gap:7px;background:var(--grad);color:#fff;font-weight:800;font-size:13px;padding:10px 16px;border-radius:var(--r-btn);box-shadow:var(--sh-2)}
body .share-btn svg{width:16px;height:16px;fill:none;stroke:#fff;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}

/* ---------- Section titles ---------- */
body .section-head{display:flex;align-items:center;justify-content:space-between;padding:4px 2px 0}
body .section-head .title{font-size:17px;font-weight:800;color:var(--ink);display:flex;align-items:center;gap:8px}
body .section-head .title::before{content:"";width:4px;height:18px;border-radius:4px;background:var(--grad)}
body .section-head .see-all{display:inline-flex;align-items:center;gap:4px;font-size:13px;font-weight:700;color:var(--v-600);cursor:pointer;padding:6px 10px;border-radius:10px;background:var(--v-100)}
body .section-head .see-all::after{content:"";width:7px;height:7px;border:solid currentColor;border-width:2px 0 0 2px;transform:rotate(-45deg)}
html[dir="rtl"] body .section-head .see-all::after{transform:rotate(-45deg)}
html[dir="ltr"] body .section-head .see-all::after{transform:rotate(135deg)}
body .section-head .see-all[onclick*="'more'"]::after{display:none}
body .section-head .see-all[onclick*="'more'"]::before{content:"";width:7px;height:7px;border:solid currentColor;border-width:2px 0 0 2px;transform:rotate(135deg)}
html[dir="ltr"] body .section-head .see-all[onclick*="'more'"]::before{transform:rotate(-45deg)}

/* ---------- Order cards ---------- */
body .card{padding:14px}
body .card-top{display:flex;justify-content:space-between;gap:10px}
body .card-id{display:flex;gap:11px;min-width:0}
body .avatar-sm{width:42px;height:42px;border-radius:14px;background:var(--grad);color:#fff;font-weight:800;display:flex;align-items:center;justify-content:center;flex:none}
body .card-name{font-weight:800;font-size:15px}
body .card-phone a{font-size:13px;color:var(--v-600);font-weight:600;direction:ltr;unicode-bidi:plaintext}
body .card-date{font-size:11.5px;color:var(--muted)}
body .card-right{display:flex;flex-direction:column;align-items:flex-end;gap:6px}
body .card-total{font-weight:800;font-size:15px;direction:ltr}
body .badge{display:inline-flex;align-items:center;gap:5px;font-size:11.5px;font-weight:800;padding:4px 10px;border-radius:99px;background:var(--warn-bg);color:#9a6a00}
body .badge svg{width:13px;height:13px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
body .badge-confirmed{background:var(--blue-bg);color:var(--blue)}
body .badge-shipped{background:var(--v-100);color:var(--v-600)}
body .badge-delivered{background:var(--good-bg);color:var(--good)}
body .badge-cancelled{background:var(--bad-bg);color:var(--bad)}
body .products-box{margin-top:12px;background:var(--bg);border-radius:12px;padding:10px 12px;font-size:13px;color:var(--muted)}
body .status-row{display:flex;gap:6px;margin-top:12px;padding-top:12px;border-top:1px dashed var(--line)}
body .status-btn{flex:1;height:38px;border-radius:12px;background:var(--bg);border:1px solid var(--line);color:var(--muted);display:flex;align-items:center;justify-content:center}
body .status-btn svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
body .status-btn[class*="on-"]{color:#fff;border-color:transparent;background:var(--v-600)}
body .status-btn.on-confirmed{background:var(--blue)}body .status-btn.on-delivered{background:var(--good)}body .status-btn.on-cancelled{background:var(--bad)}body .status-btn.on-pending{background:var(--warn);color:#4a3300}

/* ---------- Products ---------- */
body .product-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
body .p-card{padding:10px;display:flex;flex-direction:column;gap:6px}
body .p-img{aspect-ratio:1/1;border-radius:14px;background:var(--v-100) center/cover no-repeat;display:flex;align-items:center;justify-content:center;color:var(--v-400)}
body .p-img svg{width:34px;height:34px;fill:none;stroke:currentColor;stroke-width:1.6}
body .p-name{font-weight:700;font-size:13.5px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:2.9em}
body .p-price{font-weight:800;color:var(--v-600);direction:ltr;text-align:start;unicode-bidi:plaintext}
body .p-foot{display:flex;align-items:center;justify-content:space-between;gap:6px;font-size:11.5px;color:var(--muted)}
body .status-pill{padding:3px 9px;border-radius:99px;font-weight:800;font-size:11px}
body .status-pill.is-on{background:var(--good-bg);color:var(--good)}body .status-pill.is-off{background:var(--bad-bg);color:var(--bad)}

/* ---------- Buttons & forms ---------- */
body .btn{display:flex;align-items:center;justify-content:center;gap:9px;min-height:50px;border-radius:var(--r-btn);font-weight:800;font-size:15px;width:100%}
body .btn-primary{background:var(--grad);color:#fff;box-shadow:var(--sh-2)}
body .btn-primary:disabled{opacity:.6;box-shadow:none}
body #login-btn::after{content:"";width:18px;height:18px;background:currentColor;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center/contain no-repeat}
html[dir="rtl"] body #login-btn::after{transform:scaleX(-1)}
body .field{display:flex;flex-direction:column;gap:7px}
body .field label{font-size:13px;font-weight:700;color:var(--ink)}
body .field-wrap{position:relative}
body .field-wrap input{width:100%;height:52px;border-radius:14px;border:1.5px solid var(--line);background:var(--bg);color:var(--ink);padding-inline:44px 14px;font-size:15px;transition:border-color .15s,box-shadow .15s}
body .field-wrap input:focus{outline:0;border-color:var(--v-500);box-shadow:0 0 0 4px rgba(139,43,226,.14);background:var(--surface)}
body .field-wrap>svg{position:absolute;inset-inline-start:14px;top:50%;transform:translateY(-50%);width:19px;height:19px;fill:none;stroke:var(--muted);stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
body .login-error{background:var(--bad-bg);color:var(--bad);border-radius:12px;padding:10px 12px;font-size:13px;font-weight:700}
body .login-error:empty{display:none}

/* ---------- Login ---------- */
body #screen-login{background:radial-gradient(120% 60% at 50% 0%,var(--v-200) 0%,var(--bg) 60%);gap:18px}
body .a-hero{text-align:center}body .a-hero img{max-width:210px;height:auto}
body .a-tag{color:var(--muted);font-size:14px;margin:10px 0 0}
body .login-card{padding:20px;display:flex;flex-direction:column;gap:14px}
body .signup-note{margin:0;font-size:12.5px;color:var(--muted);text-align:center}
body .signup-note a{color:var(--v-600);font-weight:800}
body .feature-card{padding:6px 14px}
body .feature-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 0}
body .feature-row+.feature-row{border-top:1px solid var(--line)}
body .feature-txt .t1{font-weight:800;font-size:14px}body .feature-txt .t2{font-size:12.5px;color:var(--muted)}
body .icon-sq{width:42px;height:42px;border-radius:14px;background:var(--v-100);color:var(--v-600);display:flex;align-items:center;justify-content:center}
body .icon-sq svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
body .lang-top{align-self:flex-end}
.lang-pick{display:flex;gap:6px;background:var(--surface);border:1px solid var(--line);padding:4px;border-radius:14px;width:max-content}
.lang-pick button{border:0;border-radius:10px;padding:7px 12px;font:800 12px Tajawal,sans-serif;color:var(--muted);background:transparent}
.lang-pick button.on{background:var(--grad);color:#fff}

/* ---------- More / lists ---------- */
body .more-section,body .ad-list{overflow:hidden;padding:0}
body .more-row,body .ad-item{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px;cursor:pointer}
body .more-row+.more-row,body .ad-item+.ad-item{border-top:1px solid var(--line)}
body .more-row .l{display:flex;align-items:center;gap:12px;font-weight:700;font-size:14.5px}
body .more-row .l svg{width:34px;height:34px;padding:8px;border-radius:11px;background:var(--v-100);color:var(--v-600);fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
body .more-row:not(.danger):not([data-no-i18n-wrap])::after{content:"";width:8px;height:8px;border:solid var(--muted);border-width:2px 0 0 2px;transform:rotate(-45deg);opacity:.6}
html[dir="ltr"] body .more-row:not(.danger)::after{transform:rotate(135deg)}
body .more-row.danger{color:var(--bad)}body .more-row.danger .l svg{background:var(--bad-bg);color:var(--bad)}
body .more-row[data-no-i18n-wrap]{cursor:default;flex-wrap:wrap}
body .ad-ic{width:42px;height:42px;border-radius:13px;background:var(--v-100);color:var(--v-600);display:flex;align-items:center;justify-content:center;font-size:20px;flex:none}
body .ad-tx{flex:1;display:flex;flex-direction:column;gap:2px}body .ad-tx b{font-size:14.5px}body .ad-tx span{font-size:12.5px;color:var(--muted)}
body .ad-tx i{font-style:normal;background:var(--good-bg);color:var(--good);font-size:10.5px;padding:2px 8px;border-radius:99px;margin-inline-start:6px}

/* ---------- Bottom nav + FAB ---------- */
body .bottom-nav{background:color-mix(in srgb,var(--surface) 92%,transparent);backdrop-filter:blur(14px);border-top:1px solid var(--line);padding:8px 10px calc(env(safe-area-inset-bottom,0px) + 10px);gap:4px}
body .nav-item{flex:1;display:flex;flex-direction:column;align-items:center;gap:4px;padding:7px 0;border-radius:14px;color:var(--muted);font-size:11px;font-weight:700;cursor:pointer}
body .nav-item svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
body .nav-item.active{color:var(--v-600);background:var(--v-100)}
body .nav-item.active svg{stroke-width:2.2}
body .fab{position:fixed;inset-inline-end:max(16px,calc(50% - 214px));bottom:calc(env(safe-area-inset-bottom,0px) + 86px);width:52px;height:52px;border-radius:17px;background:var(--grad);box-shadow:var(--sh-2);display:flex;align-items:center;justify-content:center;z-index:34}
body .fab svg{width:24px;height:24px;fill:none;stroke:#fff;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}

/* ---------- Support chat + toast ---------- */
body .chat-hint{background:var(--v-100);color:var(--v-700);border-radius:14px;padding:12px 14px;font-size:13px}
body .chat-input-row{display:flex;gap:8px}
body .chat-input-row input{flex:1;height:48px;border-radius:14px;border:1.5px solid var(--line);background:var(--surface);color:var(--ink);padding:0 14px;font-size:14.5px}
body .chat-input-row input:focus{outline:0;border-color:var(--v-500)}
body .chat-send{width:auto;min-width:84px;min-height:48px}
body .toast{border-radius:14px;font-weight:700;box-shadow:var(--sh-2)}
html[dir="ltr"] body{direction:ltr}
