/* The Saudi riyal sign (U+20C1): SAMA's official symbol (riyal.svg, unchanged) in a one-character font, so it can be
   written as text everywhere: prices, attributes, option lists, scripts. Used for that character only. */
@font-face { font-family: "SamatecRiyal"; src: url(/_content/Samatec.Accounts/riyal.woff) format("woff"); unicode-range: U+20C1; font-display: block; }
input, select, option, textarea, button { font-family: inherit; }

/* ==========================================================================
   Shared look of the three sites (Samatec, Anwiya, Tiskarnu) and their control panel.
   Each site gives its colours, font and corners in its own site.css (--brand, --surface, --radius...);
   everything here is drawn from those, so one file serves the three.
   ========================================================================== */

/* ---------- Tokens every site shares (a site's site.css may override any of them) ---------- */
:root {
  --success: #17603a; --success-soft: #e9f7ee; --success-line: #bfe5cd;
  --danger: #b42318;  --danger-soft: #fdecec;  --danger-line: #f3c4c4;
  --warning: #7a5600; --warning-soft: #fff4d6; --warning-line: #f2dd9b;
  --shadow-sm: 0 1px 2px #1018280d, 0 1px 3px #1018280f;
  --shadow: 0 4px 12px #1018280f, 0 1px 3px #1018280a;
  --shadow-lg: 0 16px 40px #10182824;
  --ring: 0 0 0 3px color-mix(in srgb, var(--brand-2, #383a8a) 22%, transparent);
  --field-h: 42px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; font-family: "SamatecRiyal", var(--font); background: var(--bg); color: var(--text); line-height: 1.7; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.35; }
.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
::selection { background: color-mix(in srgb, var(--brand) 18%, transparent); }

/* ---------- Header ---------- */
header.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; transition: box-shadow .2s; }
header.top .wrap { display: flex; align-items: center; gap: 20px; min-height: 70px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 1.15rem; flex: none; }
.brand:hover { text-decoration: none; }
.brand img { height: var(--logo-h, 40px); width: auto; display: block; }
nav.main { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; align-items: center; }
nav.main > a, details.nav-drop > summary { color: var(--text); font-weight: 500; padding: 7px 12px; border-radius: 10px; transition: background .15s, color .15s; }
nav.main > a:hover, details.nav-drop > summary:hover { background: var(--brand-soft); color: var(--brand); text-decoration: none; }
nav.main a { color: var(--text); }
nav.main a.on { color: var(--brand); background: var(--brand-soft); }
.account { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.account .who { color: var(--muted); font-size: .9rem; }
.account form { margin: 0; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 18px; border-radius: var(--radius);
       border: 1px solid var(--brand); background: var(--brand); color: var(--on-brand); font: inherit; font-weight: 600; line-height: 1.3;
       cursor: pointer; white-space: nowrap; transition: filter .15s, box-shadow .15s, background .15s, transform .1s; box-shadow: var(--shadow-sm); }
.btn:hover { filter: brightness(1.08); text-decoration: none; box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; filter: none; }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.btn.ghost { background: var(--surface); color: var(--brand); border-color: var(--line); box-shadow: none; }
.btn.ghost:hover { border-color: var(--brand); background: var(--brand-soft); filter: none; }
.btn.alt { background: var(--brand-2); border-color: var(--brand-2); }
.btn.small { min-height: 34px; padding: 4px 12px; font-size: .88rem; }
.btn.link { background: none; border: 0; color: var(--muted); padding: 4px 8px; box-shadow: none; min-height: 0; }
.btn.link:hover { color: var(--text); filter: none; box-shadow: none; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost.danger { background: var(--surface); color: var(--danger); border-color: var(--danger-line); }
.btn.ghost.danger:hover { background: var(--danger-soft); }

/* ---------- Hero, blocks, cards ---------- */
.hero { background: var(--hero-bg); color: var(--hero-text); padding: 80px 0 88px; position: relative; overflow: hidden; }
.hero h1 { font-size: clamp(1.9rem, 4.5vw, 3.1rem); line-height: 1.25; margin: 0 0 14px; color: inherit; }
.hero p { font-size: 1.15rem; max-width: 640px; opacity: .9; margin: 0 0 28px; }
.hero .btn { background: #fff; color: var(--brand); border-color: #fff; }
.hero .btn.ghost { background: transparent; color: #fff; border-color: #ffffff80; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; }

section.block { padding: 64px 0; }
section.block h2 { font-size: clamp(1.5rem, 3vw, 1.9rem); margin: 0 0 8px; }
section.block .lead { color: var(--muted); margin: 0 0 32px; max-width: 720px; }

.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); }
.card h3 { margin: 10px 0 6px; font-size: 1.1rem; }
.card p { margin: 0; color: var(--muted); }
a.card { color: var(--text); transition: border-color .15s, box-shadow .2s, transform .2s var(--ease); }
a.card:hover { text-decoration: none; border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); box-shadow: var(--shadow); transform: translateY(-2px); }
.icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Pages ---------- */
.page { padding: 44px 0 72px; }
.page h1 { font-size: clamp(1.5rem, 3vw, 1.9rem); margin: 0 0 6px; }
.page .lead { color: var(--muted); margin: 0 0 28px; max-width: 820px; }

/* ---------- Forms ---------- */
.form { background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--radius) + 2px); padding: 28px; max-width: 560px; box-shadow: var(--shadow-sm); }
.form.narrow { max-width: 440px; margin-inline: auto; }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 600; font-size: .93rem; }
.field input, .field select, .field textarea,
.cp-main :is(input:not([type]), input[type=text], input[type=email], input[type=url], input[type=tel], input[type=number], input[type=password], input[type=search], input[type=date], input[type=datetime-local], input[type=time], select, textarea) {
  font: inherit; min-height: var(--field-h); padding: 8px 12px; border: 1px solid color-mix(in srgb, var(--line) 70%, var(--muted)); border-radius: 10px;
  background: var(--surface); color: var(--text); max-width: 100%; transition: border-color .15s, box-shadow .15s; }
.field input, .field select, .field textarea { width: 100%; }
.field input:focus, .field select:focus, .field textarea:focus,
.cp-main :is(input, select, textarea):focus { outline: none; border-color: var(--brand-2); box-shadow: var(--ring); }
.field textarea, .cp-main textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
.field input[readonly], .cp-main input[readonly] { background: var(--bg); color: var(--muted); }
input[type=checkbox], input[type=radio] { accent-color: var(--brand); width: 18px; height: 18px; }
.check { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; cursor: pointer; }
.hint { color: var(--muted); font-size: .9rem; }

/* ---------- Messages ---------- */
.error, .ok, .warn-box { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; border: 1px solid; font-weight: 500; }
.error { background: var(--danger-soft); color: #8b1a1a; border-color: var(--danger-line); }
.ok { background: var(--success-soft); color: var(--success); border-color: var(--success-line); }
.warn-box { background: var(--warning-soft); color: var(--warning); border-color: var(--warning-line); }
.error::before, .ok::before { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 800; color: #fff; margin-top: 2px; }
.error::before { content: "!"; background: var(--danger); }
.ok::before { content: "✓"; background: var(--success); }
.for-site { background: var(--brand-2-soft); color: var(--brand-2); padding: 10px 14px; border-radius: 10px; margin-bottom: 18px; font-weight: 600; }

/* ---------- Tables ---------- */
table.list { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
table.list th, table.list td { padding: 11px 14px; text-align: start; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list th { background: color-mix(in srgb, var(--brand-soft) 60%, var(--surface)); color: var(--text); font-weight: 600; font-size: .86rem; white-space: nowrap; }
table.list tbody tr { transition: background .12s; }
table.list tbody tr:hover { background: color-mix(in srgb, var(--brand-soft) 40%, transparent); }
table.list tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); }

/* ---------- Badges, stats, empty states ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 99px; font-size: .8rem; font-weight: 600; background: var(--brand-soft); color: var(--brand); white-space: nowrap; }
.badge.new { background: var(--warning-soft); color: var(--warning); }
.badge.done, .badge.good { background: var(--success-soft); color: var(--success); }
.badge.closed { background: #eee; color: #555; }
.badge.bad { background: var(--danger-soft); color: #8b1a1a; }
.stats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); margin-bottom: 28px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.stat b { display: block; font-size: 1.7rem; line-height: 1.2; color: var(--brand); }
.stat span { color: var(--muted); font-size: .9rem; }
.empty { color: var(--muted); padding: 32px 24px; text-align: center; background: var(--surface); border: 1px dashed color-mix(in srgb, var(--line) 60%, var(--muted)); border-radius: var(--radius); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.inline { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.inline select, .inline input { font: inherit; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; }

footer.bottom { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: .9rem; background: var(--surface); }
footer.bottom .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- Menus, footer, legal pages, errors, store-wide helpers ---------- */
.skip { position: absolute; inset-inline-start: -999px; top: 8px; background: var(--surface); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { inset-inline-start: 16px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

details.menu { position: relative; }
details.menu > summary { list-style: none; cursor: pointer; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu > summary::after { content: "▾"; margin-inline-start: 6px; font-size: .8em; }
.menu-list { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); min-width: 220px; background: var(--surface); border: 1px solid var(--line);
             border-radius: calc(var(--radius) + 2px); box-shadow: var(--shadow-lg); padding: 6px; display: grid; z-index: 40; animation: pop .14s var(--ease); }
.menu-list a, .menu-list button { display: block; padding: 8px 12px; border-radius: 8px; color: var(--text); text-align: start; background: none; border: 0; font: inherit; cursor: pointer; }
.menu-list a:hover, .menu-list button:hover, .menu-list a.on { background: var(--brand-soft); color: var(--brand); text-decoration: none; }
.menu-list form { margin: 0; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }

.nav-toggle { display: none; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px; font: inherit; font-size: 1.1rem; cursor: pointer; color: var(--text); }

.site-footer { background: var(--surface); border-top: 1px solid var(--line); margin-top: 0; color: var(--muted); font-size: .93rem; }
.footer-grid { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); padding: 48px 0 28px; }
.site-footer h4 { color: var(--text); margin: 0 0 12px; font-size: 1rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--brand); }
.site-footer p { margin: 0; }
.footer-legal { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); padding: 18px 0 26px; font-size: .85rem; }

.split { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.split .form { max-width: none; }
.contact-info ul { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 10px; }
.contact-info li { display: grid; gap: 2px; }
.contact-info b { font-size: .85rem; color: var(--muted); font-weight: 600; }
.hp { position: absolute !important; inset-inline-start: -10000px; width: 1px; height: 1px; overflow: hidden; }

.narrow-text { max-width: 820px; }
.legal h2 { font-size: 1.25rem; margin: 32px 0 8px; }
.legal li { margin-bottom: 6px; }
.status-page { text-align: center; padding: 96px 0; }
.status-page .row { justify-content: center; }
.status-code { font-size: 4.5rem; font-weight: 800; margin: 0; color: var(--brand); line-height: 1; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.card.unread { border-inline-start: 4px solid var(--accent); }
.muted { color: var(--muted); }
.tag { display: inline-block; font-size: .78rem; padding: 2px 10px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { margin: 10px 0 0; color: var(--muted); }
.admin-nav { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 24px; }
.admin-nav a { padding: 6px 14px; border-radius: 99px; border: 1px solid var(--line); color: var(--text); background: var(--surface); }
.admin-nav a.on { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.admin-nav a:hover { text-decoration: none; border-color: var(--brand); }
.admin-nav:empty { display: none; }

@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
}

/* ---------- Header and footer from the control panel ---------- */
.announce { background: var(--an-bg, var(--brand)); color: var(--an-fg, var(--on-brand)); font-size: .92rem; position: relative; text-align: center; }
.announce-track { position: relative; min-height: 38px; display: grid; }
.announce-item { grid-area: 1 / 1; display: flex; align-items: center; justify-content: center; padding: 8px 48px; opacity: 0; transform: translateY(6px); transition: opacity .5s, transform .5s; pointer-events: none; }
.announce-item.on { opacity: 1; transform: none; pointer-events: auto; }
.announce a { color: inherit; text-decoration: underline; }
.announce-close { position: absolute; inset-inline-end: 10px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: inherit; font-size: 1.3rem; cursor: pointer; opacity: .8; }
header.top.sticky { position: sticky; top: 0; }
header.top.static { position: relative; }
header.top.scrolled { box-shadow: var(--shadow); }
header.top.glass { background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: saturate(1.6) blur(14px); }
details.nav-drop { position: relative; }
details.nav-drop > summary { list-style: none; cursor: pointer; }
details.nav-drop > summary::-webkit-details-marker { display: none; }
details.nav-drop > summary::after { content: "▾"; font-size: .75em; margin-inline-start: 4px; }
.nav-drop-list { position: absolute; top: calc(100% + 10px); inset-inline-start: 0; min-width: 230px; background: var(--surface); border: 1px solid var(--line);
                 border-radius: calc(var(--radius) + 2px); box-shadow: var(--shadow-lg); padding: 6px; display: grid; z-index: 40; animation: pop .14s var(--ease); }
.nav-drop-list a { padding: 8px 12px; border-radius: 8px; color: var(--text); }
.nav-drop-list a:hover { background: var(--brand-soft); color: var(--brand); text-decoration: none; }
.footer-social { display: flex; gap: 10px; flex-wrap: wrap; padding-bottom: 20px; }
.footer-social a { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); color: var(--text); transition: border-color .15s, color .15s, background .15s; }
.footer-social a:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.footer-social svg { width: 20px; height: 20px; fill: currentColor; }

@media (max-width: 760px) {
  header.top .wrap { gap: 10px; padding-block: 10px; min-height: 60px; }
  .nav-toggle { display: inline-block; margin-inline-start: auto; }
  nav.main { order: 3; width: 100%; display: none; flex-direction: column; align-items: stretch; gap: 2px; padding: 6px 0 10px; border-top: 1px solid var(--line); }
  header.top.open nav.main { display: flex; }
  header.top .account { order: 4; width: 100%; display: none; padding-bottom: 8px; }
  header.top.open .account { display: flex; }
  .nav-drop-list { position: static; box-shadow: none; border: 0; padding: 0 12px; animation: none; }
  .hero { padding: 52px 0 60px; }
  .form { padding: 20px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
}
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- The strip above the footer: ways to pay and certificates (control panel ← شعارات الدفع والتوثيق) ---------- */
.trust-strip { background: var(--surface); border-top: 1px solid var(--line); padding: 24px 0; }
.trust-grid { display: flex; justify-content: space-between; align-items: center; gap: 24px 40px; flex-wrap: wrap; }
.trust-group h4 { margin: 0 0 10px; font-size: .88rem; color: var(--muted); font-weight: 600; }
.trust-pay, .trust-certs { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.trust-pay li { height: 40px; min-width: 62px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; display: grid; place-items: center; }
.trust-pay img { max-height: 26px; max-width: 72px; width: auto; display: block; }
.trust-certs a { display: flex; align-items: center; gap: 10px; color: var(--text); padding: 6px 12px 6px 6px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.trust-certs a[href]:hover { border-color: var(--brand); text-decoration: none; }
.trust-certs img { height: 44px; width: auto; display: block; }
.trust-certs span { display: grid; line-height: 1.35; font-size: .88rem; }
.trust-certs small { color: var(--muted); font-size: .78rem; }
.trust-code { display: flex; align-items: center; }
.trust-code img { max-height: 64px; width: auto; }
.trust-code iframe { border: 0; max-width: 100%; }
@media (max-width: 640px) { .trust-grid { justify-content: center; text-align: center; } .trust-pay, .trust-certs { justify-content: center; } }

/* ==========================================================================
   Control panel: its own frame (top bar + side menu) around every page under /Admin
   ========================================================================== */
body.cp-body { background: color-mix(in srgb, var(--bg) 70%, #eef0f4); }
.cp-top { position: sticky; top: 0; z-index: 50; height: 60px; display: flex; align-items: center; gap: 12px; padding-inline: 16px;
          background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.cp-brand { display: flex; align-items: center; gap: 12px; color: var(--text); font-weight: 700; min-width: 0; }
.cp-brand:hover { text-decoration: none; }
.cp-brand img { height: 34px; width: auto; display: block; }
.cp-brand span { padding-inline-start: 12px; border-inline-start: 1px solid var(--line); color: var(--muted); font-weight: 600; font-size: .95rem; white-space: nowrap; }
.cp-top-end { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.cp-top .account { flex-wrap: nowrap; }
.cp-menu-btn { display: none; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; place-items: center; padding: 0; }
.cp-menu-btn svg, .cp-view svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.cp-shell { display: grid; grid-template-columns: 268px minmax(0, 1fr); min-height: calc(100vh - 60px); }
.cp-side { position: sticky; top: 60px; height: calc(100vh - 60px); overflow-y: auto; background: var(--surface); border-inline-end: 1px solid var(--line);
           padding: 14px 10px 24px; scrollbar-width: thin; }
.cp-main { min-width: 0; padding: 28px clamp(16px, 3vw, 40px) 72px; }
.cp-scrim { display: none; }

/* The side menu */
.cp-nav { display: grid; gap: 2px; }
.cp-group { display: grid; gap: 2px; margin-top: 14px; }
.cp-nav b { font-size: .76rem; font-weight: 700; color: var(--muted); padding: 4px 12px; letter-spacing: .2px; }
.cp-nav a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; color: var(--text); font-size: .94rem; line-height: 1.4;
            border-inline-start: 3px solid transparent; transition: background .12s, color .12s; }
.cp-nav a svg { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .7; }
.cp-nav a:hover { background: var(--brand-soft); text-decoration: none; }
.cp-nav a.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; border-inline-start-color: var(--brand); }
.cp-nav a.on svg { opacity: 1; }
.cp-nav-end { padding-top: 12px; border-top: 1px solid var(--line); }

/* The pages keep their old frame (.page > .wrap.cp with the menu partial): inside the panel it is just the content */
.cp-main .page { padding: 0; }
.cp-main .page > .wrap { width: auto; max-width: 1240px; margin: 0; }
.cp-main .wrap.cp { display: block; }
.cp-main .cp > .cp-nav { display: none; }

/* Page head, sections, panels */
.cp-main h1 { font-size: clamp(1.35rem, 2.4vw, 1.7rem); margin: 0 0 6px; }
.cp-main .lead { color: var(--muted); margin: 0 0 24px; max-width: 820px; }
.cp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.cp-head .lead { margin-bottom: 0; }
.cp-section { margin-bottom: 30px; }
.cp-section > h2 { font-size: 1rem; color: var(--muted); font-weight: 700; margin: 0 0 12px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); padding: 22px 24px; margin-bottom: 20px; box-shadow: var(--shadow-sm); scroll-margin-top: 130px; }
.panel > h2 { scroll-margin-top: 130px; font-size: 1.12rem; margin: 0 0 18px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.panel h3 { font-size: 1rem; }
.panel .two, .two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.cp-main details > summary { cursor: pointer; font-weight: 600; color: var(--brand); padding: 6px 0; width: fit-content; }
.cp-main details > summary:hover { text-decoration: underline; text-underline-offset: 3px; }
.cp-main hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

/* The bar of a long page's parts (built by site.js from the panels' titles) */
.cp-jump { position: sticky; top: 60px; z-index: 15; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: -8px 0 20px; padding: 10px 0;
           background: color-mix(in srgb, var(--bg) 70%, #eef0f4); }
.cp-jump::-webkit-scrollbar { display: none; }
.cp-jump a { flex: none; padding: 6px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: .88rem; white-space: nowrap; }
.cp-jump a:hover { border-color: var(--brand); text-decoration: none; }
.cp-jump a.on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }

/* The control panel's home */
.cp-tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.cp-tile { display: flex; gap: 14px; align-items: flex-start; padding: 18px; }
.cp-tile-icon { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.cp-tile-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cp-tile-text { display: grid; gap: 2px; }
.cp-tile-text small { color: var(--muted); font-size: .88rem; line-height: 1.55; }
.cp-tiles .card h3 { margin: 0 0 6px; }
.cp-tiles a { color: var(--text); }
/* Outside the panel's frame (never expected): the old two columns */
.cp { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 28px; align-items: start; }

/* Lists of sections, items and fields in the editors */
.sec-list { display: grid; gap: 8px; }
.sec-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; transition: border-color .15s, box-shadow .15s; }
.sec-row:hover { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); box-shadow: var(--shadow-sm); }
.sec-row.off { opacity: .55; }
.sec-row .no { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.sec-row .what b { display: block; }
.sec-row .tools { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.sec-row .tools form { margin: 0; }
.sec-row .tools button, .sec-row .tools a { font: inherit; font-size: .85rem; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.sec-row .tools a:hover, .sec-row .tools button:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.type-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.type-grid button { text-align: start; font: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; color: var(--text); transition: border-color .15s, box-shadow .15s; }
.type-grid button:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); }
.type-grid button b { display: block; } .type-grid button span { color: var(--muted); font-size: .85rem; }
.items { display: grid; gap: 10px; margin-bottom: 10px; }
fieldset.item { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 4px; margin: 0; background: color-mix(in srgb, var(--bg) 60%, var(--surface)); }
.item-tools { display: flex; gap: 6px; justify-content: flex-end; align-items: center; margin-bottom: 6px; }
.item-tools .item-no { margin-inline-end: auto; font-weight: 700; color: var(--muted); }
.item-tools button { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; cursor: pointer; padding: 2px 8px; }
.media-field { display: grid; gap: 8px; }
.media-preview { min-height: 60px; display: flex; align-items: center; }
.media-preview img, .media-preview video { max-height: 120px; max-width: 220px; border-radius: 10px; border: 1px solid var(--line); }
.gallery-field { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.g-pick { position: relative; }
.g-pick img, .g-pick video { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); display: block; }
.g-pick button { position: absolute; top: 4px; inset-inline-end: 4px; border: 0; border-radius: 50%; width: 22px; height: 22px; background: #000a; color: #fff; cursor: pointer; font-size: .7rem; }
.color-field { display: flex; gap: 8px; align-items: center; }
.color-field input[type=color] { width: 46px; height: var(--field-h); padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; }
.picker { position: fixed; inset: 0; background: #0009; z-index: 1000; display: grid; place-items: center; padding: 20px; }
.picker-panel { background: var(--surface); border-radius: calc(var(--radius) + 4px); width: min(920px, 100%); max-height: 86vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.picker-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.picker-grid { padding: 16px; overflow: auto; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.picker-item { padding: 0; border: 3px solid transparent; border-radius: 12px; overflow: hidden; cursor: pointer; background: #f3f3f3; aspect-ratio: 1; }
.picker-item.on { border-color: var(--brand); }
.picker-item img, .picker-item video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-lib { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.media-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: grid; box-shadow: var(--shadow-sm); }
.media-card img, .media-card video { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #f3f3f3; }
.media-card .body { padding: 8px 10px; display: grid; gap: 6px; font-size: .82rem; }
.media-card input { font: inherit; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; width: 100%; min-height: 0 !important; }
.menu-table input, .menu-table select { font: inherit; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; max-width: 100%; }
.sticky-save { position: sticky; bottom: 0; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--line);
               padding: 12px 0; display: flex; gap: 10px; z-index: 5; }

/* Tables and small inputs inside the panel stay compact */
.cp-main table.list :is(input, select) { min-height: 34px; padding: 4px 8px; }
.cp-main .inline :is(input, select) { min-height: 34px; padding: 4px 8px; }

/* A row's actions: the main one as a button, the rest under "المزيد" */
.row-actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: nowrap; }
.row-actions .menu-list { min-width: 220px; }
.row-actions .menu-list form { border: 0; margin: 0; padding: 0; }
.row-actions .menu-list button { width: 100%; }
.menu-list .danger-text { color: var(--danger); }
.menu-list .danger-text:hover { background: var(--danger-soft); color: var(--danger); }
table.list.has-menus { overflow: visible; }
.table-wrap:has(> table.has-menus) { overflow: visible; }
.cp-main table.list .btn { box-shadow: none; }

/* The logos' editor (شعارات الدفع والتوثيق) */
.badge-edit-list { display: grid; gap: 12px; }
.badge-edit { position: relative; border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--surface); }
.badge-edit.off { background: color-mix(in srgb, var(--bg) 60%, var(--surface)); }
.badge-edit-grid { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 16px; align-items: start; }
.badge-edit-image .media-preview { min-height: 80px; justify-content: center; border: 1px dashed var(--line); border-radius: 10px; background: #fff; padding: 8px; }
.badge-edit-image .media-preview img { max-height: 60px; max-width: 150px; border: 0; }
.badge-edit-delete { position: absolute; bottom: 14px; inset-inline-end: 14px; margin: 0; }
@media (max-width: 640px) { .badge-edit-grid { grid-template-columns: 1fr; } }
.badge-kind { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.badge-kind-opt { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 99px; cursor: pointer; font-size: .9rem; }
.badge-kind-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 600; }
/* Image and link, or the issuer's code: only the chosen one's fields show */
.badge-edit .badge-code { display: none; grid-column: 1 / -1; }
.badge-edit:has(input[name=kind][value=code]:checked) .badge-code { display: grid; }
.badge-edit:has(input[name=kind][value=code]:checked) :is(.badge-edit-image, .badge-url) { display: none; }
.badge-edit:has(input[name=kind][value=code]:checked) .badge-edit-grid { grid-template-columns: 1fr; }
.badge-code textarea { font-family: Consolas, "Cascadia Mono", monospace; font-size: .85rem; }
/* The ministry's requirements */
.req-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.req-list li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--warning-line); background: var(--warning-soft); border-radius: 10px; }
.req-list li.met { border-color: var(--success-line); background: var(--success-soft); }
.req-mark { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--warning); }
.req-list li.met .req-mark { background: var(--success); }
.req-text { display: grid; } .req-text small { color: var(--muted); }
.req-list form { margin: 0; }
@media (max-width: 640px) { .req-list li { grid-template-columns: 28px minmax(0, 1fr); } .req-list li > :last-child:not(.req-text) { grid-column: 2; justify-self: start; } }

/* The panel on narrower screens: the side menu becomes a drawer from the menu button */
@media (max-width: 1000px) {
  .cp-shell { grid-template-columns: 1fr; }
  .cp-menu-btn { display: grid; }
  .cp-side { position: fixed; top: 60px; bottom: 0; height: auto; width: min(300px, 86vw); inset-inline-start: -320px; z-index: 60; transition: inset-inline-start .22s var(--ease); box-shadow: var(--shadow-lg); visibility: hidden; }
  body.cp-open .cp-side { inset-inline-start: 0; visibility: visible; }
  body.cp-open .cp-scrim { display: block; position: fixed; inset: 60px 0 0; background: #0006; z-index: 55; }
  body.cp-open { overflow: hidden; }
}
@media (max-width: 760px) {
  .cp-brand span, .cp-view span { display: none; }
  .cp-top .lang-menu, .cp-top .cur-menu { display: none; }
  .cp-top { gap: 8px; padding-inline: 10px; }
  .cp-top details.menu > summary { max-width: 150px; }
}
@media (max-width: 640px) {
  .cp-main { padding: 18px 14px 56px; }
  .panel { padding: 16px; }
  .panel .two, .two-col { grid-template-columns: 1fr; }
  .sec-row { grid-template-columns: 1fr; }
}

/* ---------- Sign-in extras: passkeys, two-step setup ---------- */
.or-line { display: flex; align-items: center; gap: 10px; color: var(--muted); margin: 14px 0; font-size: .9rem; }
.or-line::before, .or-line::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.totp-setup { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; margin-top: 10px; }
.totp-setup img { border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 6px; image-rendering: pixelated; }
.secret { display: inline-block; font-size: 1rem; letter-spacing: 2px; background: var(--brand-soft); padding: 6px 10px; border-radius: 8px; word-break: break-all; }
.recovery-codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin: 12px 0; }
.recovery-codes code { background: var(--brand-soft); padding: 8px; border-radius: 8px; text-align: center; font-size: 1rem; }

/* ---------- Subscriptions: plans, periods, invoices ---------- */
.period-tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--brand-soft); border-radius: 999px; margin: 0 0 22px; flex-wrap: wrap; }
.period-tabs button { font: inherit; border: 0; background: none; padding: 7px 16px; border-radius: 999px; cursor: pointer; color: var(--brand); }
.period-tabs button.on { background: var(--brand); color: var(--on-brand); box-shadow: var(--shadow-sm); }
.plans-product { margin: 26px 0 4px; }
.plan-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin-top: 12px; }
.plan { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); padding: 24px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow-sm); transition: box-shadow .2s, transform .2s var(--ease); }
.plan:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.plan.featured { border: 2px solid var(--brand); box-shadow: var(--shadow); }
.plan h3 { margin: 0; }
.plan .btn { margin-top: auto; }
.plan-badge { position: absolute; top: -12px; inset-inline-start: 18px; background: var(--brand); color: var(--on-brand); font-size: .8rem; padding: 2px 12px; border-radius: 999px; }
.plan-price b { font-size: 1.7rem; display: inline-block; }
.plan-per { color: var(--muted); font-size: .9rem; margin-inline-start: 4px; }
.plan-note { display: block; color: var(--brand); font-size: .85rem; margin-top: 2px; min-height: 1.2em; }
.plan-free { background: var(--brand-soft); }
.period-save { font-size: .72rem; margin-inline-start: 6px; padding: 1px 7px; border-radius: 999px; background: #e6f6ec; color: #11703a; }
.period-tabs button.on .period-save { background: rgba(255,255,255,.22); color: inherit; }
.plans-trust { display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: center; margin-top: 22px; color: var(--muted); font-size: .9rem; }
.plans-trust span::before { content: "✓ "; color: #11703a; font-weight: 700; }
.plan-features { margin: 0; padding-inline-start: 18px; color: var(--muted); }
.plan-features li { margin: 3px 0; }
.choice { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; transition: border-color .15s, background .15s; }
.choice:hover { border-color: var(--brand); }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.choice input { margin-top: 5px; }
.choice.off { opacity: .55; cursor: not-allowed; }
.card-fields { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.invoice-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
@media (max-width: 560px) { .card-fields { grid-template-columns: 1fr 1fr; } }

/* ---------- Order tabs (orders pages): one row that scrolls sideways on a phone ---------- */
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 0 0 16px; padding-bottom: 0; scrollbar-width: thin; }
.tabs a { white-space: nowrap; padding: 9px 14px; border-radius: 10px 10px 0 0; color: var(--muted); border: 1px solid transparent; border-bottom: 0; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); text-decoration: none; background: var(--brand-soft); }
.tabs a.on { color: var(--brand); background: var(--surface); border-color: var(--line); font-weight: 600; }
.tabs .count { display: inline-block; min-width: 22px; padding: 0 6px; margin-inline-start: 4px; border-radius: 99px; background: var(--line); color: var(--text); font-size: .78rem; text-align: center; }
.tabs a.on .count { background: var(--brand); color: var(--on-brand); }

/* ---------- Payment gateways: one card each, its on/off switch in the corner ---------- */
.gw-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.gw-card { position: relative; margin: 0; padding-top: 18px; }
.gw-card.on { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.gw-card h3 { padding-inline-end: 64px; }
.gw-switch { position: absolute; top: 14px; inset-inline-end: 14px; margin: 0; }
.gw-switch button { width: 48px; height: 26px; border-radius: 99px; border: 0; padding: 3px; background: var(--line); cursor: pointer; display: flex; transition: background .2s; }
.gw-switch button span { width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: margin .2s; }
.gw-switch button[aria-checked="true"] { background: var(--brand); }
.gw-switch button[aria-checked="true"] span { margin-inline-start: auto; }
.gw-switch button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* The riyal sign: SAMA's official symbol (riyal.svg, unchanged) as a mask, so it takes the text's colour */
.sar { display: inline-block; width: .82em; height: .92em; vertical-align: -.08em; background-color: currentColor;
       -webkit-mask: url(/_content/Samatec.Accounts/riyal.svg) center / contain no-repeat; mask: url(/_content/Samatec.Accounts/riyal.svg) center / contain no-repeat; }

@media print {
  .cp-top, .cp-side, .cp-jump, header.top, .site-footer, .announce, .nav-toggle { display: none !important; }
  .cp-shell { display: block; }
  body, body.cp-body { background: #fff; }
}

/* Saudi prices: the one-time location question (Pay/SaudiCheck.cs) */
.geo-ask { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-content: center; padding: 8px 44px; position: relative;
           background: color-mix(in srgb, var(--brand) 10%, var(--bg)); border-bottom: 1px solid var(--line); font-size: .92rem; text-align: center; }
.geo-ask[hidden] { display: none; }
.geo-ask .hint { width: 100%; margin: 0; }
.geo-msg { width: 100%; font-weight: 600; }
.geo-close { position: absolute; inset-inline-end: 10px; top: 6px; background: none; border: 0; font-size: 1.3rem; cursor: pointer; color: inherit; }
