/* ==================================================================
   KEYPASS — ورقة الأنماط
   الرموز مأخوذة حرفياً من وثيقة التسليم (Design Tokens)
   ================================================================== */

:root {
    --bg:             #0A0D10;
    --surface:        #12171D;
    --surface-sunken: #0F1519;
    --surface-deep:   #0D1216;

    --border:        #1E242C;
    --border-strong: #262D36;
    --border-btn:    #2C3540;
    --border-card:   #33404D;

    --text:       #EDF1F5;
    --text-muted: #93A0AF;
    --text-dim:   #7E8A99;
    --text-faint: #6E7A88;

    --accent:      #FFB020;
    --accent-hi:   #FFC757;
    --danger:      #FF3B30;
    --danger-text: #FF6B62;
    --success:     #2FD46A;
    --success-brd: #22402F;
    --info:        #35C8E8;

    --r-sm: 7px;  --r-md: 12px; --r-lg: 14px;
    --r-xl: 18px; --r-hero: 22px; --r-pill: 999px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'IBM Plex Sans Arabic', 'IBM Plex Sans', sans-serif;
    font-size: 15px;
    line-height: 1.55;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hi); }
::selection { background: var(--accent); color: var(--bg); }

button { font-family: inherit; cursor: pointer; }
code { font-family: 'IBM Plex Sans', monospace; }

@keyframes sakPulse {
    0%   { box-shadow: 0 0 0 0 rgba(255,59,48,.55); }
    70%  { box-shadow: 0 0 0 18px rgba(255,59,48,0); }
    100% { box-shadow: 0 0 0 0 rgba(255,59,48,0); }
}
@keyframes sakSweep { 0% { transform: translateX(-100%); } 100% { transform: translateX(200%); } }
@keyframes sakRise  { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes sakSpin  { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------------- النقاط والوسوم المشتركة ---------------- */

.dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.dot-green { background: var(--success); }
.dot-amber { background: var(--accent); }
.dot-cyan  { background: var(--info); }

.nowrap { white-space: nowrap; }
.tone-green { color: var(--success); }
.tone-amber { color: var(--accent); }
.tone-dim   { color: var(--text-dim); }

/* ================= الرأس ================= */

.hdr {
    position: sticky; top: 0; z-index: 50;
    background: rgba(12,16,20,.86);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}
.hdr-in {
    display: flex; align-items: center; gap: 18px;
    padding: 14px 28px; max-width: 1400px; margin: 0 auto;
    flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 10px; color: inherit; }
.brand:hover { color: inherit; }
.brand-mark {
    width: 34px; height: 34px; border-radius: 10px;
    background: var(--accent); color: var(--bg);
    font: 700 16px/34px 'IBM Plex Sans', sans-serif;
    text-align: center; flex-shrink: 0;
}
.brand-txt { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-size: 16px; font-weight: 700; letter-spacing: .04em; }
.brand-sub  { font-size: 11px; color: var(--text-dim); }
.brand-lg { margin-bottom: 22px; }

.roles {
    display: flex; gap: 2px; padding: 4px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-md); margin-inline-start: auto;
}
.role-tab {
    padding: 8px 16px; border-radius: 9px;
    font-size: 13.5px; font-weight: 600;
    color: var(--text-muted); transition: .15s;
}
.role-tab:hover { color: var(--text); }
.role-tab.is-active { background: var(--accent); color: var(--bg); }
.role-tab.is-active:hover { color: var(--bg); }
.role-tab.is-locked { color: #4C5663; cursor: not-allowed; }

.hdr-end { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; }
.inline-form { display: inline; }

.online-pill {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 7px 13px; border-radius: var(--r-pill);
    background: var(--surface-sunken); border: 1px solid var(--border);
    font-size: 12px; color: #9AA6B4; white-space: nowrap;
}

.ghost-btn {
    padding: 8px 14px; border-radius: 10px;
    background: var(--surface); border: 1px solid var(--border-strong);
    color: var(--text); font-size: 13px; font-weight: 600; transition: .15s;
}
.ghost-btn:hover { background: #1B222A; color: var(--text); }

/* ================= تخطيط الصفحات ================= */

.page {
    max-width: 1240px; margin: 0 auto;
    padding: 28px 28px 80px;
    display: grid; grid-template-columns: minmax(0,1fr) 330px;
    gap: 24px; align-items: start;
}
.page-tech, .page-supplier { grid-template-columns: minmax(0,1fr) 300px; }
.page-admin { max-width: 1400px; grid-template-columns: minmax(0,1fr); gap: 20px; }

.col-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.rail { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 14px; }

@media (max-width: 900px) {
    .page { grid-template-columns: minmax(0,1fr); }
    .rail { position: static; }
    .hdr-in { padding: 12px 16px; }
    .page { padding: 20px 16px 60px; }
}

.panel {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-xl); padding: 24px; min-width: 0;
}
.panel-title { font-size: 19px; font-weight: 700; margin: 0; }
.panel-sub   { font-size: 13px; color: var(--text-dim); margin: 6px 0 20px; }

.group-lbl { display: block; font-size: 12px; font-weight: 600; color: var(--text-dim); margin-bottom: 8px; }
.group-lbl.mt { margin-top: 20px; }

.empty-box {
    border: 1px dashed var(--border-strong); border-radius: var(--r-lg);
    padding: 26px; text-align: center; font-size: 13.5px; color: var(--text-dim);
}

/* ================= Hero ================= */

.hero {
    position: relative; overflow: hidden;
    border: 1px solid #23292F; border-radius: var(--r-hero);
    background: var(--surface-deep);
}
.hero-grid-bg, .hero-glow-warm, .hero-glow-red, .hero-sweep {
    position: absolute; pointer-events: none;
}
.hero-grid-bg {
    inset: 0; opacity: .65;
    background-image:
        linear-gradient(#131A21 1px, transparent 1px),
        linear-gradient(90deg, #131A21 1px, transparent 1px);
    background-size: 46px 46px;
}
.hero-glow-warm {
    inset-inline-start: -12%; top: -70%; width: 70%; height: 220%;
    background: radial-gradient(circle, rgba(255,176,32,.20), transparent 62%);
}
.hero-glow-red {
    inset-inline-end: -10%; bottom: -80%; width: 60%; height: 200%;
    background: radial-gradient(circle, rgba(255,59,48,.14), transparent 62%);
}
.hero-sweep {
    top: 0; inset-inline-start: 0; width: 38%; height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    animation: sakSweep 3.6s linear infinite;
}

.hero-in {
    position: relative;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 26px; padding: 34px 32px 30px;
}
.hero-left { min-width: 0; }

.eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 13px; border-radius: var(--r-pill);
    border: 1px solid #2E2620; background: rgba(255,176,32,.07);
    font-size: 11.5px; font-weight: 600; color: var(--accent); white-space: nowrap;
}
.hero-h1 {
    font-size: clamp(27px, 3.6vw, 44px); line-height: 1.16; font-weight: 700;
    letter-spacing: -.02em; text-wrap: balance; margin: 16px 0 14px;
}
.hero-h1 .accent { color: var(--accent); }
.hero-body { font-size: 14.5px; color: var(--text-muted); max-width: 46ch; margin: 0 0 22px; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-stats {
    display: flex; flex-wrap: wrap; gap: 26px;
    border-top: 1px solid #1C2229; padding-top: 20px; margin-top: 24px;
}
.stat { display: flex; flex-direction: column; }
.stat-val { font-size: 22px; font-weight: 700; }
.stat-lbl { font-size: 11.5px; color: var(--text-dim); }

.hero-right { align-self: center; min-width: 0; }
.live-card {
    padding: 18px; border-radius: 16px;
    background: rgba(13,18,22,.72); border: 1px solid var(--border);
    backdrop-filter: blur(6px);
    display: flex; flex-direction: column; gap: 8px;
}
.live-head {
    display: flex; align-items: center; gap: 8px;
    font-size: 11.5px; font-weight: 600; color: var(--text-muted); margin-bottom: 4px;
}
.live-row {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px; border-radius: 11px;
    background: var(--surface); border: 1px solid var(--border);
}
.live-row .dot { width: 8px; height: 8px; }
.live-title { font-size: 13px; font-weight: 600; min-width: 0; }
.live-meta  { font-size: 11.5px; color: var(--text-dim); white-space: nowrap; margin-inline-start: auto; }

/* ================= الأزرار ================= */

.btn {
    display: inline-block; border: 1px solid transparent;
    border-radius: var(--r-lg); font-weight: 700; transition: .15s;
    padding: 15px 24px; font-size: 15px;
}
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover { background: var(--accent-hi); color: var(--bg); }
.btn-danger {
    background: var(--danger); color: #fff;
    padding: 17px 28px; font-size: 15.5px;
    animation: sakPulse 2.6s infinite;
}
.btn-outline {
    background: transparent; border-color: var(--border-btn); color: var(--text);
    padding: 17px 28px; font-size: 15.5px;
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost {
    background: transparent; border-color: var(--border-btn); color: var(--text-muted);
}
.btn-ghost:hover { border-color: var(--border-card); color: var(--text); }
.btn-soft {
    background: #1B222A; border-color: var(--border-btn); color: var(--text);
    padding: 9px 16px; font-size: 13px; border-radius: 10px;
}
.btn-soft:hover { background: #232C36; }
.btn-block { display: block; width: 100%; padding: 15px; border-radius: var(--r-md); margin-top: 8px; }

/* ================= المعالج ================= */

.stepper { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.step-pill form { margin: 0; }
.step-pill button {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 14px; border-radius: var(--r-pill);
    border: 1px solid var(--border); background: var(--surface);
    color: var(--text-muted); transition: .15s;
}
.step-pill button[disabled] { cursor: default; opacity: .75; }
.step-pill.is-active button {
    border-color: var(--accent); background: rgba(255,176,32,.1); color: var(--text);
}
.step-num {
    width: 19px; height: 19px; border-radius: 50%;
    background: var(--border); color: var(--text);
    font: 700 11px/19px 'IBM Plex Sans', sans-serif; text-align: center;
}
.step-pill.is-active .step-num { background: var(--accent); color: var(--bg); }
.step-pill.is-done   .step-num { background: var(--success); color: var(--bg); }
.step-lbl { font-size: 12.5px; font-weight: 600; }

.card-form { margin: 0; }
.card-form.block { display: block; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 720px) {
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

.sel-card {
    display: flex; flex-direction: column; gap: 5px; width: 100%; text-align: start;
    padding: 17px; border-radius: 13px;
    border: 1px solid var(--border-strong); background: transparent;
    color: var(--text); transition: .15s;
}
.sel-card:hover { border-color: var(--border-card); }
.sel-card.is-selected { border-color: var(--accent); background: rgba(255,176,32,.08); }
.sel-label { font-size: 15px; font-weight: 600; }
.sel-meta  { font-size: 12px; color: var(--text-dim); }
.pay-tile { align-items: center; text-align: center; padding: 15px 10px; }

.chip-group + .chip-group { margin-top: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 16px; border-radius: 10px;
    border: 1px solid var(--border-strong); background: var(--surface-sunken);
    color: #C3CCD6; font-size: 13.5px; transition: .15s;
}
.chip:hover { border-color: var(--border-card); }
.chip.is-selected, .chip:has(input:checked) {
    border-color: var(--accent); color: var(--accent); background: rgba(255,176,32,.12);
}
.chip input { accent-color: var(--accent); margin: 0; }

.radio-list { display: flex; flex-direction: column; gap: 10px; }
.radio-row {
    display: flex; align-items: center; gap: 12px; width: 100%; text-align: start;
    padding: 15px 17px; border-radius: var(--r-md);
    border: 1px solid var(--border-strong); background: transparent;
    color: var(--text); transition: .15s;
}
.radio-row:hover { border-color: var(--border-card); }
.radio-row.is-selected { border-color: var(--accent); background: rgba(255,176,32,.08); }
.radio-dot {
    width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid #3A434E; flex-shrink: 0; transition: .15s;
}
.radio-row.is-selected .radio-dot { border-color: var(--accent); background: var(--accent); }
.radio-lbl  { font-size: 14.5px; font-weight: 600; min-width: 0; }
.radio-note { font-size: 12px; color: var(--text-dim); margin-inline-start: auto; white-space: nowrap; }

.note-box {
    display: flex; align-items: center; gap: 10px; margin-top: 16px;
    padding: 14px 16px; border-radius: var(--r-md);
    background: var(--surface-sunken); border: 1px solid var(--border);
    font-size: 13px; color: var(--text-muted);
}

/* ================= الخرائط ================= */

.map {
    position: relative; overflow: hidden;
    border-radius: var(--r-lg); border: 1px solid var(--border-strong);
    background-color: var(--surface-deep);
    background-image:
        linear-gradient(#161D24 1px, transparent 1px),
        linear-gradient(90deg, #161D24 1px, transparent 1px);
    background-size: 38px 38px;
}
.map-pick  { height: 230px; }
.map-track { height: 250px; margin-bottom: 16px; }
.map-glow {
    position: absolute; inset: 0;
    background: radial-gradient(circle at 50% 46%, rgba(255,176,32,.18), transparent 60%);
}
.map-pin {
    position: absolute; top: 46%; left: 50%; transform: translate(-50%,-50%);
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--accent); box-shadow: 0 0 0 6px rgba(255,176,32,.2);
}
.map-chip {
    position: absolute; bottom: 14px; inset-inline-start: 14px;
    padding: 8px 12px; border-radius: 10px;
    background: rgba(10,13,16,.9); font-size: 13px; font-weight: 600;
}
.route { position: absolute; inset: 0; width: 100%; height: 100%; }
.route path { animation: sakDash 6s linear infinite; }
@keyframes sakDash { to { stroke-dashoffset: -260; } }

.track-dot { position: absolute; width: 12px; height: 12px; border-radius: 50%; }
.track-tech { background: var(--info);   left: 10%;  bottom: 16%; box-shadow: 0 0 0 5px rgba(53,200,232,.16); }
.track-cust { background: var(--accent); left: 86%;  top: 24%;    box-shadow: 0 0 0 5px rgba(255,176,32,.16); }
.eta-chip {
    position: absolute; bottom: 14px; inset-inline-start: 14px;
    padding: 8px 12px; border-radius: 10px; background: rgba(10,13,16,.9);
    font-size: 13px; font-weight: 600; color: var(--info);
}

/* ================= الطلب المباشر ================= */

.live-head-row { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.status-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--accent); box-shadow: 0 0 0 5px rgba(255,176,32,.16);
}
.status-dot.is-done { background: var(--success); box-shadow: 0 0 0 5px rgba(47,212,106,.16); }
.order-id {
    font-family: 'IBM Plex Sans', monospace; font-size: 13px;
    color: var(--text-dim); margin-inline-start: auto;
}

.src-box {
    border: 1px solid var(--border-strong); border-radius: var(--r-lg);
    padding: 18px; background: var(--surface-sunken);
    display: flex; flex-direction: column; gap: 8px;
}
.src-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.src-title { font-size: 13.5px; font-weight: 600; }
.src-count { font-size: 12px; color: var(--text-dim); margin-inline-start: auto; white-space: nowrap; }
.spinner {
    width: 15px; height: 15px; border-radius: 50%;
    border: 2px solid var(--border-strong); border-top-color: var(--accent);
    animation: sakSpin .8s linear infinite;
}
.bid-row {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; border-radius: 11px;
    background: var(--surface); border: 1px solid var(--border);
}
.bid-mask  { font-size: 13px; font-weight: 600; }
.bid-state { font-size: 12px; color: var(--accent); margin-inline-start: auto; white-space: nowrap; }
.bid-row.is-available, .bid-row.is-won { border-color: var(--success-brd); }
.bid-row.is-available .bid-state, .bid-row.is-won .bid-state { color: var(--success); }
.bid-row.is-unavailable .bid-state { color: var(--text-faint); }
.src-note { font-size: 12px; color: var(--text-dim); margin: 6px 0 0; }

.tech-card {
    display: flex; align-items: center; gap: 14px;
    padding: 16px; border-radius: var(--r-lg);
    background: var(--surface-sunken); border: 1px solid var(--border);
}
.avatar {
    width: 46px; height: 46px; border-radius: 50%;
    background: #1E262F; color: var(--accent);
    font: 700 18px/46px 'IBM Plex Sans Arabic', sans-serif; text-align: center; flex-shrink: 0;
}
.tech-info { display: flex; flex-direction: column; min-width: 0; }
.tech-name { font-size: 14.5px; font-weight: 600; }
.tech-meta { font-size: 12px; color: var(--text-dim); }
.tech-actions { display: flex; gap: 8px; margin-inline-start: auto; }

.done-box {
    background: var(--surface-sunken); border: 1px solid #1F3A2A;
    border-radius: var(--r-lg); padding: 30px; text-align: center;
}
.done-title { font-size: 20px; font-weight: 700; color: var(--success); margin: 0 0 8px; }
.done-note  { font-size: 13px; color: var(--text-muted); margin: 0 0 20px; }

/* ================= الشريط الجانبي ================= */

.rail-card { padding: 22px; }
.rail-title { font-size: 15px; font-weight: 700; margin: 0 0 16px; }
.rail-row { display: flex; align-items: center; gap: 12px; padding: 7px 0; }
.rail-lbl { font-size: 13px; color: var(--text-dim); flex-shrink: 0; }
.rail-val {
    font-size: 13.5px; font-weight: 600; margin-inline-start: auto;
    min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rail-div { height: 1px; background: var(--border); margin: 14px 0; }
.rail-total { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.rail-total-lbl { font-size: 14px; font-weight: 600; }
.rail-amount {
    font-size: 26px; font-weight: 700; color: var(--accent); margin-inline-start: auto;
}
.rail-amount small { font-size: 13px; color: var(--text-dim); font-weight: 400; margin-inline-start: 5px; }
.rail-foot { font-size: 11.5px; color: var(--text-faint); text-align: center; margin: 14px 0 0; }

.stat-card { display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: 16px; }
.stat-card-lbl { font-size: 12px; color: var(--text-dim); }
.stat-card-val { font-size: 24px; font-weight: 700; }

/* ================= واجهة الفني ================= */

.profile-bar {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    padding: 4px 2px;
}
.profile-name { font-size: 18px; font-weight: 700; margin: 0; }
.profile-sub  { font-size: 12.5px; color: var(--text-dim); margin: 2px 0 0; }
.avail-toggle {
    margin-inline-start: auto; padding: 9px 18px; border-radius: var(--r-pill);
    font-size: 13.5px; font-weight: 700; white-space: nowrap; transition: .15s;
}
.avail-toggle.is-on  { border: 1px solid var(--success-brd); background: rgba(47,212,106,.1); color: var(--success); }
.avail-toggle.is-off { border: 1px solid #3A2020; background: rgba(255,59,48,.1); color: var(--danger-text); }

.job-card {
    border: 1px solid var(--border-card); border-radius: var(--r-lg);
    padding: 20px; background: var(--surface-sunken);
    animation: sakRise .4s ease;
}
.job-card + .job-card { margin-top: 12px; }
.job-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.tag {
    padding: 5px 11px; border-radius: var(--r-sm);
    font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
.tag-danger { background: rgba(255,59,48,.12); color: var(--danger-text); }
.job-dist { font-size: 12.5px; color: var(--text-dim); }
.job-payout {
    margin-inline-start: auto; font-size: 20px; font-weight: 700; color: var(--success);
    display: flex; align-items: baseline; gap: 8px;
}
.job-payout small { font-size: 11.5px; color: var(--text-dim); font-weight: 400; }

.fact-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.fact { display: flex; flex-direction: column; min-width: 0; }
.fact-k { font-size: 11.5px; color: var(--text-dim); }
.fact-v { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }

.job-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.job-actions form { margin: 0; }

.log-row {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 15px; border-radius: 11px;
    background: var(--surface-sunken); border: 1px solid var(--border);
}
.log-row + .log-row { margin-top: 8px; }
.log-title  { font-size: 13.5px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.log-time   { font-size: 12px; color: var(--text-dim); margin-inline-start: auto; white-space: nowrap; }
.log-amount { font-size: 13.5px; font-weight: 600; color: var(--success); white-space: nowrap; }

/* ================= واجهة المورّد ================= */

.req-card {
    border: 1px solid var(--border-card); border-radius: var(--r-lg);
    padding: 20px; background: var(--surface-sunken);
    animation: sakRise .4s ease;
}
.req-card + .req-card { margin-top: 12px; }
.req-head { display: flex; align-items: center; gap: 8px; }
.req-tag { font-size: 11.5px; font-weight: 700; color: var(--accent); }
.req-order {
    font-family: 'IBM Plex Sans', monospace; font-size: 12px;
    color: var(--text-dim); margin-inline-start: auto;
}
.req-part { font-size: 19px; font-weight: 700; margin: 10px 0 18px; }
.req-form .group-lbl { margin-top: 14px; }

.res-box {
    display: flex; flex-direction: column; gap: 5px;
    background: var(--surface); border: 1px solid var(--border-strong);
    border-radius: var(--r-md); padding: 16px;
}
.res-box.is-win { border-color: var(--success-brd); }
.res-title { font-size: 14.5px; font-weight: 700; }
.res-sub   { font-size: 12.5px; color: var(--text-dim); }

.inv-row {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 15px; border-radius: 11px;
    background: var(--surface-sunken); border: 1px solid var(--border);
}
.inv-row + .inv-row { margin-top: 8px; }
.inv-name  { font-size: 13.5px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.inv-stock { font-size: 12px; color: var(--text-dim); margin-inline-start: auto; white-space: nowrap; }
.inv-stock.is-out { color: var(--danger-text); }
.inv-price { font-size: 13.5px; font-weight: 600; white-space: nowrap; }

/* ================= واجهة المدير ================= */

.admin-h1 { font-size: 22px; font-weight: 700; margin: 0 0 4px; }

.kpi-strip {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px; margin-bottom: 20px;
}
.kpi-card { display: flex; flex-direction: column; gap: 4px; padding: 20px; border-radius: 16px; }
.kpi-lbl   { font-size: 12px; color: var(--text-dim); }
.kpi-val   { font-size: 27px; font-weight: 700; white-space: nowrap; }
.kpi-delta { font-size: 12px; }

.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(440px, 1fr)); gap: 20px; }
@media (max-width: 560px) { .admin-grid { grid-template-columns: minmax(0,1fr); } }

.ord-row {
    display: grid; grid-template-columns: 62px minmax(0,1fr) 112px 78px 84px;
    gap: 10px; align-items: center;
    padding: 14px 16px; border-radius: var(--r-md);
    background: var(--surface-sunken); border: 1px solid var(--border);
}
.ord-row + .ord-row { margin-top: 8px; }
.ord-row.is-focus { border-color: #4A3A14; }
.ord-id      { font-family: 'IBM Plex Sans', monospace; font-size: 12px; color: var(--text-dim); }
.ord-service { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ord-tech    { font-size: 12.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ord-amount  { font-size: 13px; font-weight: 600; white-space: nowrap; }
.ord-badge {
    padding: 5px 11px; border-radius: var(--r-sm);
    font-size: 11.5px; font-weight: 700; text-align: center; white-space: nowrap;
}
.ord-badge.is-active    { background: rgba(255,176,32,.14); color: var(--accent); }
.ord-badge.is-done      { background: rgba(47,212,106,.12); color: var(--success); }
.ord-badge.is-cancelled { background: rgba(255,59,48,.12);  color: var(--danger-text); }

@media (max-width: 640px) {
    .ord-row { grid-template-columns: minmax(0,1fr) auto; }
    .ord-tech, .ord-id { display: none; }
}

.bid-mon {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 15px; border-radius: 11px;
    background: var(--surface-sunken); border: 1px solid var(--border);
}
.bid-mon + .bid-mon { margin-top: 8px; }
.bid-mon.is-win { border-color: var(--success-brd); }
.bid-shop  { font-size: 13.5px; font-weight: 600; min-width: 0; }
.bid-prep  { font-size: 12px; color: var(--text-dim); margin-inline-start: auto; white-space: nowrap; }
.bid-price { font-size: 13.5px; font-weight: 600; white-space: nowrap; }

.margin-box { display: flex; flex-direction: column; gap: 2px; }
.mg-row {
    display: flex; justify-content: space-between; gap: 12px;
    padding: 13px 15px; border-radius: 11px;
    background: var(--surface-sunken); border: 1px solid var(--border);
    font-size: 13.5px;
}
.mg-row.mg-net { border-color: var(--success-brd); font-weight: 700; }

/* ================= الدفع ================= */

.dot-red { background: var(--danger); }
.status-dot.is-cancelled { background: var(--danger); box-shadow: 0 0 0 5px rgba(255,59,48,.16); }

.note-box.is-error {
    border-color: #3A2020; background: rgba(255,59,48,.08); color: var(--danger-text);
}
.mt-form { margin-top: 18px; }

.done-receipt {
    font-size: 12.5px; color: var(--text-dim);
    margin: 0 0 18px; padding-top: 12px; border-top: 1px solid var(--border);
}

.sandbox-banner {
    display: flex; align-items: flex-start; gap: 10px; margin-bottom: 22px;
    padding: 12px 14px; border-radius: var(--r-md);
    background: rgba(255,176,32,.07); border: 1px solid #2E2620;
    font-size: 12.5px; color: var(--accent); line-height: 1.5;
}
.sandbox-banner .dot { margin-top: 6px; }

.pay-amount {
    display: flex; align-items: baseline; gap: 12px; margin: 18px 0 22px;
    padding: 18px; border-radius: var(--r-lg);
    background: var(--surface-sunken); border: 1px solid var(--border);
}
.pay-amount-lbl { font-size: 13px; color: var(--text-dim); }
.pay-amount-val {
    font-size: 28px; font-weight: 700; color: var(--accent);
    margin-inline-start: auto; white-space: nowrap;
}
.pay-actions { display: flex; flex-direction: column; gap: 4px; margin-top: 22px; }

/* ================= الدخول ================= */

body.bare { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-wrap { width: 100%; padding: 40px 20px; }
.login-card {
    max-width: 460px; margin: 0 auto; position: relative;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-xl); padding: 32px;
}
.login-title { font-size: 22px; font-weight: 700; margin: 0; }
.login-form { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.field { display: block; }
.field input {
    width: 100%; padding: 13px 15px; border-radius: var(--r-md);
    background: var(--surface-sunken); border: 1px solid var(--border-strong);
    color: var(--text); font-family: inherit; font-size: 14px;
}
.field input:focus { outline: none; border-color: var(--accent); }

.alert {
    padding: 12px 15px; border-radius: var(--r-md); margin-bottom: 14px;
    background: rgba(255,59,48,.1); border: 1px solid #3A2020;
    color: var(--danger-text); font-size: 13px;
}

.demo-list { display: flex; flex-direction: column; gap: 8px; }
.demo-row {
    display: flex; align-items: center; gap: 12px; width: 100%; text-align: start;
    padding: 12px 14px; border-radius: 11px;
    background: var(--surface-sunken); border: 1px solid var(--border);
    color: var(--text); transition: .15s;
}
.demo-row:hover { border-color: var(--accent); }
.demo-role {
    font-size: 11.5px; font-weight: 700; color: var(--accent);
    min-width: 58px; white-space: nowrap;
}
.demo-name { font-size: 13.5px; font-weight: 600; }
.demo-mail {
    font-size: 11.5px; color: var(--text-dim); margin-inline-start: auto;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lang-mini { position: absolute; top: 20px; inset-inline-end: 20px; }

/* ---------- شريط النموذج التجريبي ---------- */
.demo-strip {
    background: rgba(255,176,32,.1);
    border-bottom: 1px solid #2E2620;
    color: var(--accent);
    font-size: 12.5px;
    text-align: center;
    padding: 9px 20px;
    line-height: 1.5;
}
.demo-strip strong { font-weight: 700; }

/* ---------- تبويبا الدخول / الحساب الجديد ---------- */
.auth-tabs {
    display: flex; gap: 4px; padding: 4px; margin: 18px 0 20px;
    background: var(--surface-sunken); border: 1px solid var(--border);
    border-radius: var(--r-md);
}
.auth-tab {
    flex: 1; text-align: center; padding: 9px 12px; border-radius: 9px;
    font-size: 13.5px; font-weight: 600; color: var(--text-muted); transition: .15s;
}
.auth-tab:hover { color: var(--text); }
.auth-tab.is-active { background: var(--accent); color: var(--bg); }
.auth-tab.is-active:hover { color: var(--bg); }

.ghost-btn.is-cta { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.ghost-btn.is-cta:hover { background: var(--accent-hi); color: var(--bg); }

.rail-note {
    font-size: 11.5px; color: var(--text-dim);
    text-align: center; margin: 10px 0 0;
}

/* ================= الشعار ================= */

.brand-mark {
    width: 36px; height: 36px; border-radius: 11px;
    background: var(--accent); flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
}
.brand-mark svg { width: 23px; height: 23px; display: block; }
.brand-lg .brand-mark { width: 44px; height: 44px; border-radius: 13px; }
.brand-lg .brand-mark svg { width: 28px; height: 28px; }

/* ================= التذييل ================= */

.ftr { border-top: 1px solid var(--border); background: var(--surface-deep); }
.ftr-in {
    max-width: 1240px; margin: 0 auto; padding: 22px 28px;
    display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.ftr-copy { font-size: 12.5px; color: var(--text-dim); }
.ftr-links { display: flex; gap: 18px; margin-inline-start: auto; flex-wrap: wrap; }
.ftr-links a { font-size: 13px; font-weight: 600; }

/* ================= الانضمام وإدارة الشبكة ================= */

.join-card { max-width: 520px; }

.perk-list { list-style: none; margin: 18px 0 22px; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.perk-list li {
    display: flex; align-items: flex-start; gap: 10px;
    font-size: 13.5px; color: var(--text-muted); line-height: 1.5;
}
.perk-list .dot { margin-top: 7px; }

.note-box.mt { margin-top: 20px; }
.alert.is-ok {
    background: rgba(47,212,106,.1); border-color: var(--success-brd); color: var(--success);
}

.count-pill {
    display: inline-block; margin-inline-start: 8px;
    padding: 2px 9px; border-radius: var(--r-pill);
    background: var(--accent); color: var(--bg);
    font-size: 12px; font-weight: 700; vertical-align: middle;
}

.mem-row {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 15px; border-radius: 11px;
    background: var(--surface-sunken); border: 1px solid var(--border);
}
.mem-row + .mem-row { margin-top: 8px; }
.mem-name { font-size: 13.5px; font-weight: 600; min-width: 0; }
.mem-meta {
    font-size: 12px; color: var(--text-dim); margin-inline-start: auto;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%;
}
.panel-title.mt-lg { margin-top: 26px; }

.ghost-btn.is-on { border-color: var(--accent); color: var(--accent); }
