/* NextStore — صفحات الترخيص ولوحة المالك (HQ) وموبايل Cloud: نفس هوية الكاشير (كحلي + أخضر + كروت بيضاء)، ومتجاوبة مع الموبايل */
:root { --navy: #17283d; --navy2: #1e3a5f; --green: #119744; --green-d: #0d7a36; --bg: #eef2f6; --line: #cbd5e1; --soft: #e2e8f0; --text: #1e293b; --muted: #64748b; --red: #b91c1c; --amber: #b45309; }
* { box-sizing: border-box; }
body.lc { background: var(--bg); font-family: Cairo, Arial, sans-serif; color: var(--text); margin: 0; min-height: 100vh; font-size: 14px; }
.num, .fp { font-family: Arial, sans-serif; direction: ltr; unicode-bidi: isolate; }

/* ===== الشريط العلوي ===== */
.lc-top { background: var(--navy); color: #fff; display: flex; align-items: center; gap: 6px; padding: 0 16px; min-height: 56px; position: sticky; top: 0; z-index: 20; }
.lc-brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 16px; white-space: nowrap; margin-inline-end: 14px; color: #fff; text-decoration: none; }
.lc-brand i, .lc-logo { width: 34px; height: 34px; border-radius: 8px; background: var(--green); display: inline-flex; align-items: center; justify-content: center; font-size: 16px; color: #fff; flex: none; }
.lc-brand small { display: block; font-size: 11px; color: #94a3b8; font-weight: 700; line-height: 1.1; }
.lc-nav { display: flex; gap: 4px; flex: 1; min-width: 0; }
.lc-nav a { color: #cbd5e1; text-decoration: none; font-weight: 700; font-size: 13.5px; padding: 0 12px; height: 38px; border-radius: 7px; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.lc-nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.lc-nav a.on { background: #fff; color: var(--navy); }
.lc-nav a.on i { color: var(--green); }
.lc-badge { background: #f59e0b; color: #1e293b; border-radius: 9px; padding: 0 7px; font-size: 11.5px; font-weight: 800; font-family: Arial, sans-serif; line-height: 18px; }
.lc-user { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; white-space: nowrap; }
.lc-user span { color: #94a3b8; font-size: 12.5px; font-weight: 700; }
.lc-out { height: 34px; border: 1px solid rgba(255, 255, 255, .25); background: none; color: #fff; border-radius: 7px; padding: 0 12px; font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.lc-out:hover { background: rgba(255, 255, 255, .08); }

/* ===== المحتوى ===== */
.lc-wrap { max-width: 1200px; margin: 16px auto 28px; padding: 0 16px; display: grid; gap: 14px; }
.lc-wrap.narrow { max-width: 560px; }
.lc-wrap > *, .lc-tools, .chips { min-width: 0; } /* عناصر الـ grid ما تكبرش الصفحة على الموبايل */
.lc-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lc-head h1 { margin: 0; font-size: 19px; font-weight: 800; }
.lc-head p { margin: 0; color: var(--muted); font-weight: 600; font-size: 13px; width: 100%; }
.lc-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-inline-start: auto; }
.lc-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; min-width: 0; }
.lc-card > h2 { margin: 0; background: #f8fafc; border-bottom: 1px solid var(--line); font-size: 14.5px; font-weight: 800; padding: 10px 14px; display: flex; align-items: center; gap: 8px; }
.lc-card > h2 i { color: var(--green); }
.lc-card > h2 small { margin-inline-start: auto; color: var(--muted); font-weight: 700; font-size: 12px; }
.lc-body { padding: 14px; display: grid; gap: 10px; }
.lc-body label, .lc-field { font-size: 12.5px; font-weight: 700; color: var(--muted); display: grid; gap: 4px; }
.lc input, .lc select, .lc textarea { height: 40px; border: 1px solid var(--line); border-radius: 7px; padding: 0 10px; font-family: inherit; font-weight: 700; font-size: 14px; width: 100%; background: #fff; color: var(--text); min-width: 0; }
.lc input:focus, .lc select:focus, .lc textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(17, 151, 68, .12); }
.lc textarea { height: 70px; padding: 8px 10px; }
.lc .btn-g, .lc .btn-w, .lc .btn-r { height: 38px; border-radius: 7px; padding: 0 14px; font: inherit; font-weight: 800; font-size: 13.5px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; text-decoration: none; }
.lc .btn-g { background: var(--green); color: #fff; border: 1px solid var(--green); }
.lc .btn-g:hover { background: var(--green-d); }
.lc .btn-w { background: #fff; color: #334155; border: 1px solid var(--line); }
.lc .btn-w:hover { background: #f8fafc; }
.lc .btn-r { background: #fff; color: var(--red); border: 1px solid #fecaca; }
.lc .btn-r:hover { background: #fef2f2; }
.lc .sm { height: 32px; padding: 0 10px; font-size: 12.5px; }

/* ===== كروت الأرقام ===== */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 10px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px; display: flex; align-items: center; gap: 11px; min-width: 0; }
.kpi i { width: 38px; height: 38px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: #f1f5f9; color: var(--navy); flex: none; font-size: 15px; }
.kpi span { display: block; color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi b { display: block; font-family: Arial, sans-serif; font-size: 21px; font-weight: 800; line-height: 1.2; }
.kpi.g i { background: #dcfce7; color: var(--green); } .kpi.r i { background: #fee2e2; color: var(--red); } .kpi.y i { background: #fef3c7; color: var(--amber); } .kpi.b i { background: #dbeafe; color: #1d4ed8; }

/* ===== جداول (بتتحول كروت على الموبايل) ===== */
.lc table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.lc th { background: #f1f5f9; text-align: right; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; color: #475569; font-size: 12.5px; }
.lc td { padding: 9px 12px; border-bottom: 1px solid var(--soft); vertical-align: middle; font-weight: 600; }
.lc tr:last-child td { border-bottom: 0; }
.lc-empty { text-align: center; color: var(--muted); padding: 30px 12px !important; font-weight: 700; }

/* ===== كروت المتاجر والطلبات ===== */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.sc { background: #fff; border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; min-width: 0; }
.sc.pending { border-color: #f59e0b; box-shadow: inset 0 3px 0 #f59e0b; }
.sc-h { padding: 12px 14px 8px; display: flex; gap: 10px; align-items: flex-start; }
.sc-av { width: 40px; height: 40px; border-radius: 9px; background: var(--navy); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 17px; flex: none; }
.sc-t { min-width: 0; flex: 1; }
.sc-t b { display: block; font-size: 15px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-t small { color: var(--muted); font-weight: 700; font-size: 12.5px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; padding: 4px 14px 12px; font-size: 12.5px; }
.sc-meta div { min-width: 0; }
.sc-meta > div > span:first-child { display: block; color: var(--muted); font-weight: 700; font-size: 11.5px; }
.sc-meta .sc-left { display: block; }
.sc-meta b { display: block; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-left { font-size: 11.5px; font-weight: 800; }
.sc-left.r { color: var(--red); } .sc-left.y { color: var(--amber); } .sc-left.g { color: var(--green); }
.sc details { border-top: 1px solid var(--soft); padding: 8px 14px; font-size: 12.5px; }
.sc summary { cursor: pointer; color: #475569; font-weight: 800; list-style: none; display: flex; align-items: center; gap: 6px; }
.sc summary::-webkit-details-marker { display: none; }
.sc summary::before { content: '\f078'; font-family: 'Font Awesome 6 Free'; font-weight: 900; font-size: 10px; transition: transform .15s; }
.sc details[open] summary::before { transform: rotate(180deg); }
.sc details .fp { margin-top: 6px; }
.sc-act { border-top: 1px solid var(--soft); padding: 10px 14px; display: grid; gap: 8px; margin-top: auto; background: #fbfcfd; border-radius: 0 0 10px 10px; }
.sc-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.sc-row select, .sc-row input { width: auto; flex: 1 1 120px; height: 34px; font-size: 13px; }
.sc-row .btn-g, .sc-row .btn-w, .sc-row .btn-r { height: 34px; }

.fp { font-size: 12px; word-break: break-all; background: #f8fafc; border: 1px solid var(--soft); border-radius: 6px; padding: 7px 9px; display: block; user-select: all; color: #334155; }
.lc-msg { padding: 10px 14px; border-radius: 8px; font-weight: 700; word-break: break-word; display: flex; gap: 8px; align-items: center; }
.lc-msg.ok { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.lc-msg.err { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.pill { border-radius: 10px; padding: 1px 9px; font-size: 11.5px; font-weight: 800; background: var(--soft); color: #334155; white-space: nowrap; display: inline-block; }
.pill.g { background: #dcfce7; color: #166534; } .pill.r { background: #fee2e2; color: #991b1b; } .pill.y { background: #fef3c7; color: #92400e; } .pill.b { background: #dbeafe; color: #1e40af; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 32px; padding: 0 12px; border: 1px solid var(--line); background: #fff; border-radius: 16px; font: inherit; font-weight: 700; font-size: 12.5px; color: #475569; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.chip b { font-family: Arial, sans-serif; }
.search { position: relative; flex: 1 1 220px; max-width: 320px; }
.search i { position: absolute; top: 50%; transform: translateY(-50%); right: 11px; color: #94a3b8; }
.search input { padding-inline-start: 32px; height: 36px; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.plans div { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #f8fafc; }
.plans b { display: block; font-size: 12.5px; color: var(--muted); } .plans span { color: var(--green); font-weight: 800; font-size: 20px; }

/* ===== صفحات الترخيص (فورم في النص) ===== */
.lc-box { max-width: 460px; margin: 6vh auto 24px; padding: 0 16px; display: grid; gap: 12px; }
.lc-box .lc-card > h2 { font-size: 16px; justify-content: center; padding: 13px 14px; }
.lc-box .lc-body { padding: 16px; }
.lc-box table th { width: 40%; }
.lc-box small { color: var(--muted); font-weight: 600; text-align: center; line-height: 1.7; }
.lc-msg.c { justify-content: center; text-align: center; }

/* ===== صفحة دخول (لوحة كحلي + فورم) زي دخول الكاشير ===== */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.auth-side { background: var(--navy); color: #fff; padding: 40px 48px; display: flex; flex-direction: column; gap: 22px; }
.auth-side .lc-brand { font-size: 20px; }
.auth-side .lc-brand i { width: 44px; height: 44px; font-size: 20px; border-radius: 10px; }
.auth-side h1 { font-size: 30px; font-weight: 800; margin: auto 0 0; line-height: 1.4; }
.auth-side p { color: #94a3b8; font-weight: 600; margin: 0; max-width: 440px; line-height: 1.8; }
.auth-feat { display: grid; gap: 10px; margin: 6px 0 auto; padding: 0; list-style: none; }
.auth-feat li { display: flex; gap: 10px; align-items: center; font-weight: 700; color: #e2e8f0; }
.auth-feat i { width: 30px; height: 30px; border-radius: 8px; background: rgba(255, 255, 255, .08); color: #4ade80; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.auth-foot { color: #64748b; font-size: 12px; font-weight: 700; font-family: Arial, sans-serif; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.auth-form { width: 100%; max-width: 380px; display: grid; gap: 14px; }
.auth-form h2 { margin: 0; font-size: 22px; font-weight: 800; }
.auth-form > p { margin: -8px 0 4px; color: var(--muted); font-weight: 600; }
.auth-form .btn-g { height: 44px; font-size: 15px; width: 100%; }
.pw { position: relative; }
.pw button { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: #94a3b8; cursor: pointer; width: 32px; height: 32px; }
.pw input { padding-inline-end: 40px; }

/* ===== الموبايل ===== */
@media (max-width: 900px) {
    .lc-top { flex-wrap: wrap; padding: 8px 12px 0; gap: 0; }
    .lc-brand { margin: 0; min-height: 40px; }
    .lc-user span { display: none; }
    .lc-nav { order: 3; flex-basis: 100%; overflow-x: auto; scrollbar-width: none; padding: 8px 0; gap: 6px; }
    .lc-nav::-webkit-scrollbar { display: none; }
    .lc-nav a { height: 34px; font-size: 13px; padding: 0 11px; flex: none; }
    .auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .auth-side { padding: 22px 20px; gap: 12px; }
    .auth-side h1 { font-size: 20px; margin: 4px 0 0; }
    .auth-feat, .auth-foot { display: none; }
    .auth-main { align-items: flex-start; padding: 24px 16px; }
}
@media (max-width: 700px) {
    .lc-wrap { padding: 0 10px; margin-top: 12px; gap: 12px; }
    .kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
    .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
    .lc-tools .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
    .lc-tools .chips::-webkit-scrollbar { display: none; }
    .chip { flex: none; }
    .kpi { padding: 9px 10px; gap: 8px; }
    .kpi i { width: 32px; height: 32px; font-size: 13px; }
    .kpi b { font-size: 17px; }
    .cards { grid-template-columns: 1fr; }
    .search { max-width: none; }
    .lc-tools { width: 100%; }
    /* جدول ← كروت: كل سطر كارت وكل خانة باسم العمود (data-l) */
    .rt thead { display: none; }
    .rt, .rt tbody, .rt tr, .rt td { display: block; width: 100%; }
    .rt tr { border-bottom: 1px solid var(--line); padding: 6px 0; }
    .rt td { border: 0; padding: 5px 12px; display: flex; gap: 10px; justify-content: space-between; align-items: center; text-align: left; }
    .rt td::before { content: attr(data-l); color: var(--muted); font-weight: 700; font-size: 12px; text-align: right; flex: none; }
    .rt td input { max-width: 60%; }
    .lc-box { margin-top: 20px; }
}
/* التجار: فروع كل تاجر وأجهزته */
.cards.wide { grid-template-columns: repeat(auto-fill, minmax(520px, 1fr)); }
.br { border-top: 1px solid var(--soft); padding: 8px 0 4px; }
.br-h { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 0 14px 4px; font-size: 13.5px; }
.br-h b { margin-inline-end: auto; }
.br .sc-meta { grid-template-columns: repeat(3, 1fr); }
.rt.dev { font-size: 12px; margin: 0 14px 6px; width: calc(100% - 28px); }
.txt-r { color: #dc2626 !important; }
@media (max-width: 700px) { .cards.wide { grid-template-columns: 1fr; } .br .sc-meta { grid-template-columns: 1fr 1fr; } }
