/* ═══════════════════════════════════════════════════════════════
   Freight Net Global — واجهة النظام
   ألوان الهوية: بنفسجي داكن (#2a1440) وذهبي (#fac348)
   ═══════════════════════════════════════════════════════════════ */

:root {
    --bg: #f5f3f9;
    --surface: #ffffff;
    --surface-2: #faf9fc;
    --ink: #1c1230;
    --ink-2: #4a4060;
    --muted: #7a7091;
    --line: #e7e2f0;
    --line-2: #d8d0e6;

    --brand: #5b2a86;
    --brand-dark: #2a1440;
    --brand-deep: #160b26;
    --brand-soft: #f0e9f8;
    --gold: #fac348;
    --gold-deep: #e9a816;
    --gold-soft: #fff4d6;
    --orange: #fd8d3b;
    --sea: #2b9ed8;
    --danger: #c53a4a;

    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(28, 18, 48, .04), 0 8px 24px rgba(28, 18, 48, .05);
    --shadow-lg: 0 18px 50px rgba(28, 18, 48, .14);
    --ring: 0 0 0 3px rgba(91, 42, 134, .18);
    --font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
    --font-latin: "Montserrat", "IBM Plex Sans Arabic", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.3; }
h1 { font-size: 23px; font-weight: 700; letter-spacing: -.2px; }
h2 { font-size: 16px; font-weight: 600; }
p { margin: 0; }
::selection { background: var(--gold); color: var(--brand-deep); }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
input.ltr { display: block; }
[dir="rtl"] input.ltr { text-align: right; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grow { flex: 1; }
.latin { font-family: var(--font-latin); }

/* ───────── هيكل لوحة المكتب ───────── */
.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }

.sidebar {
    background:
        radial-gradient(120% 60% at 100% 0%, rgba(250, 195, 72, .10), transparent 60%),
        linear-gradient(180deg, #2a1440 0%, #1a0d2b 100%);
    color: #d9cfe8;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 20px 14px 16px;
}
.brand { display: block; padding: 2px 6px 0; }
.brand:hover { text-decoration: none; }
.brand img { display: block; width: 168px; height: auto; }
.brand .brand-sub { display: block; color: #a996c4; font-size: 11.5px; margin-top: 8px; letter-spacing: .2px; }
.brand-mark { width: 36px; height: 36px; border-radius: 50%; display: block; flex: none; }

.nav { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; padding-top: 6px; }
.nav a { position: relative; display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: #cbbfe0; font-weight: 500; transition: background .15s, color .15s; }
.nav a:hover { background: rgba(255, 255, 255, .06); text-decoration: none; color: #fff; }
.nav a.active { background: linear-gradient(90deg, rgba(250, 195, 72, .06), rgba(250, 195, 72, .16)); color: #fff; }
.nav a.active::before { content: ""; position: absolute; inset-inline-start: -14px; top: 8px; bottom: 8px; width: 4px; border-radius: 4px; background: var(--gold); }
.nav a.active svg { color: var(--gold); opacity: 1; }
.nav svg { width: 19px; height: 19px; flex: none; opacity: .8; }
.nav-label { font-size: 11px; font-weight: 600; letter-spacing: .6px; color: #8c79a8; padding: 16px 12px 5px; }

.sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 14px 6px 0; border-top: 1px solid rgba(255, 255, 255, .08); font-size: 13px; }
.sidebar-foot .avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; background: linear-gradient(135deg, var(--gold), var(--orange)); color: var(--brand-deep); font-weight: 700; }
.sidebar-foot .name { color: #fff; font-weight: 600; line-height: 1.35; }
.sidebar-foot button { background: none; border: 0; padding: 0; color: #a996c4; cursor: pointer; font: inherit; font-size: 12.5px; }
.sidebar-foot button:hover { color: var(--gold); }

.content { padding: 26px 32px 56px; min-width: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .sub { color: var(--muted); font-size: 13.5px; margin-top: 3px; }

.mobile-bar, .tabbar, .nav-scrim { display: none; }
.credit { margin: 12px 6px 0; font-size: 11.5px; color: #8c79a8; }
.credit a { color: #c4b6db; }
.agent .credit, .guest .credit { margin: 0; }
.agent .credit { text-align: center; color: var(--muted); margin-top: 28px; }
.agent .credit a { color: var(--brand); }

.lang-switch { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .18); color: #e6dcf5 !important; font-size: 12.5px; font-weight: 600; white-space: nowrap; transition: background .15s, border-color .15s; }
.lang-switch:hover { background: rgba(255, 255, 255, .08); border-color: rgba(250, 195, 72, .5); text-decoration: none; }
.lang-switch svg { width: 15px; height: 15px; }
.sidebar-foot .lang-switch { padding: 5px 9px; }

.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .06); color: #fff; cursor: pointer; }
.icon-btn svg { width: 21px; height: 21px; }

/* الجوال أولاً: شريط علوي، تنقل سفلي، وقائمة جانبية منزلقة */
@media (max-width: 900px) {
    .app { display: block; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
    .hide-mobile { display: none; }

    .mobile-bar {
        display: flex; align-items: center; justify-content: space-between; gap: 10px;
        position: sticky; top: 0; z-index: 30;
        padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top));
        background: linear-gradient(135deg, rgba(42, 20, 64, .97), rgba(26, 13, 43, .97));
        backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
        box-shadow: 0 6px 20px rgba(22, 11, 38, .2);
    }
    .mobile-brand img { height: 34px; width: auto; display: block; }

    .sidebar {
        position: fixed; top: 0; bottom: 0; inset-inline-start: 0; z-index: 50;
        width: min(300px, 84vw); height: 100%;
        transform: translateX(var(--drawer-off, 100%));
        transition: transform .28s cubic-bezier(.2, .8, .2, 1);
        box-shadow: 0 0 60px rgba(0, 0, 0, .4);
        padding-top: calc(20px + env(safe-area-inset-top));
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }
    [dir="ltr"] .sidebar { --drawer-off: -100%; }
    .nav-open .sidebar { transform: none; }
    .nav-scrim:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(16, 8, 28, .55); backdrop-filter: blur(2px); }
    .nav-open { overflow: hidden; }

    .tabbar {
        display: flex; align-items: stretch; justify-content: space-around;
        position: fixed; inset-inline: 0; bottom: 0; z-index: 30;
        padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, .96);
        backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
        border-top: 1px solid var(--line);
        box-shadow: 0 -8px 24px rgba(28, 18, 48, .06);
    }
    .tabbar a, .tabbar button {
        flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
        min-height: 54px; padding: 4px 2px; border: 0; background: none; border-radius: 12px;
        color: var(--muted); font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer;
    }
    .tabbar a:hover { text-decoration: none; }
    .tabbar svg { width: 23px; height: 23px; }
    .tabbar .active { color: var(--brand); }
    .tabbar .active svg { color: var(--brand); }
    .tabbar .fab {
        flex: 0 0 58px; height: 58px; min-height: 0; margin-top: -24px; border-radius: 50%;
        background: linear-gradient(135deg, #ffd56b, #f4b324); color: var(--brand-deep);
        box-shadow: 0 10px 24px rgba(244, 179, 36, .45), 0 0 0 5px var(--bg);
    }
    .tabbar .fab svg { width: 26px; height: 26px; }

    .content { padding: 16px 14px 28px; }
    .page-head { margin-bottom: 14px; }
    .page-head h1 { font-size: 20px; }
    .hero-panel { border-radius: 18px; }
    .hero-panel .hero-text { padding: 20px; }
    .hero-panel h1 { font-size: 21px; }
    .hero-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .hero-panel .actions .btn { flex: 1; }
    .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .tile { padding: 13px 14px; }
    .tile .value { font-size: 23px; }
    input, select, textarea { font-size: 16px; }
    .btn { padding: 10px 16px; }
}

/* الجداول على الهاتف: كل صف بطاقة */
@media (max-width: 640px) {
    table.stacked thead { display: none; }
    table.stacked, table.stacked tbody, table.stacked tfoot { display: block; }
    table.stacked tr { display: block; padding: 12px 16px; border-bottom: 1px solid var(--line); }
    table.stacked tbody tr:last-child { border-bottom: 0; }
    table.stacked td { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 4px 0; border: 0; white-space: normal; text-align: end; min-width: 0; }
    table.stacked td::before { content: attr(data-label); flex: none; max-width: 45%; color: var(--muted); font-size: 12px; font-weight: 600; text-align: start; }
    table.stacked td[data-label=""]::before { display: none; }
    table.stacked td:empty { display: none; }
    table.stacked td.empty { display: block; text-align: center; }
    table.stacked td input:not([type="checkbox"]), table.stacked td select { min-width: 0; width: 60%; }
    table.stacked tfoot tr { display: flex; justify-content: space-between; background: var(--surface-2); }
    table.stacked tfoot td { padding: 0; background: none; }
    td .coords input { width: 50%; }
}

/* ───────── البطاقات والمؤشرات ───────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-body { padding: 20px; }
.card-foot { padding: 13px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }

.cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.cols.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1100px) { .cols, .cols.even { grid-template-columns: minmax(0, 1fr); } }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.tile { position: relative; display: block; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; color: inherit; box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s, border-color .18s; }
.tile::after { content: ""; position: absolute; inset-inline-end: -26px; top: -26px; width: 84px; height: 84px; border-radius: 50%; background: radial-gradient(circle, var(--tile-glow, rgba(91, 42, 134, .09)), transparent 70%); }
a.tile:hover { text-decoration: none; border-color: var(--line-2); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.tile .label { color: var(--ink-2); font-size: 13px; font-weight: 500; }
.tile .value { font-size: 28px; font-weight: 700; line-height: 1.25; margin-top: 6px; font-variant-numeric: tabular-nums; font-family: var(--font-latin); letter-spacing: -.5px; }
.tile .unit { font-size: 13px; font-weight: 500; color: var(--muted); font-family: var(--font); letter-spacing: 0; }
.tile .bar { position: absolute; inset-inline-start: 0; bottom: 0; height: 3px; width: 100%; background: var(--tile-accent, var(--brand)); opacity: .85; }
.section-title { font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 26px 0 10px; display: flex; align-items: center; gap: 8px; }
.section-title::before { content: ""; width: 14px; height: 3px; border-radius: 3px; background: var(--gold); }

/* ───────── لوحة الترحيب والشبكة ───────── */
.hero-panel {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-height: 250px;
    margin-bottom: 22px;
    border-radius: 20px;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(70% 120% at 0% 50%, rgba(91, 42, 134, .55), transparent 70%),
        radial-gradient(60% 90% at 100% 0%, rgba(250, 195, 72, .14), transparent 60%),
        linear-gradient(135deg, #2a1440, #160b26);
    box-shadow: var(--shadow-lg);
}
.hero-panel .hero-text { padding: 26px 30px; position: relative; z-index: 1; }
.hero-panel .eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--gold); font-size: 12.5px; font-weight: 600; letter-spacing: .3px; }
.hero-panel .eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(250, 195, 72, .2); animation: blink 2s infinite; }
.hero-panel h1 { font-size: 26px; margin-top: 10px; }
.hero-panel p { color: #cdbfe2; margin-top: 6px; font-size: 14px; max-width: 46ch; }
.hero-panel .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.hero-panel .globe { height: 270px; margin: -10px 0; }
.hero-stats { display: flex; gap: 22px; margin-top: 18px; flex-wrap: wrap; }
.hero-stats div { font-size: 12.5px; color: #b6a6d0; }
.hero-stats strong { display: block; color: #fff; font-size: 22px; font-family: var(--font-latin); font-weight: 700; }
@media (max-width: 900px) { .hero-panel { grid-template-columns: 1fr; } .hero-panel .globe { height: 230px; margin: 0; } }

@keyframes blink { 50% { opacity: .35; } }

/* ───────── الكرة الأرضية ───────── */
.globe { position: relative; width: 100%; min-height: 200px; cursor: grab; user-select: none; -webkit-user-select: none; }
.globe.is-dragging { cursor: grabbing; }
.globe-canvas, .globe-canvas canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; }
.globe-canvas { opacity: 0; transform: scale(.94); transition: opacity 1.2s ease, transform 1.4s cubic-bezier(.2, .8, .2, 1); }
.globe.is-ready .globe-canvas { opacity: 1; transform: none; }
.globe-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; direction: ltr; }
.globe-label { position: absolute; left: 0; top: 0; margin: -26px 0 0 8px; padding: 1px 7px; border-radius: 6px; font: 600 10.5px/1.6 var(--font-latin); letter-spacing: .6px; color: #fff; background: rgba(22, 11, 38, .72); border: 1px solid rgba(255, 255, 255, .14); backdrop-filter: blur(4px); white-space: nowrap; transition: opacity .2s; }
.globe-label.origin { color: var(--brand-deep); background: var(--gold); border-color: var(--gold); }
.globe-label.mode-sea { border-color: rgba(79, 195, 247, .55); }
.globe-label.mode-air { border-color: rgba(250, 195, 72, .55); }
.globe-label.mode-land { border-color: rgba(253, 141, 59, .55); }
.globe.no-webgl { background: radial-gradient(circle at 50% 50%, rgba(142, 92, 194, .35), transparent 60%); }

.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: #b6a6d0; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 18px; height: 3px; border-radius: 3px; background: currentColor; }
.legend .sea i { background: #4fc3f7; }
.legend .air i { background: #fac348; }
.legend .land i { background: #fd8d3b; }

/* ───────── الجداول ───────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 16px; text-align: start; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); white-space: nowrap; letter-spacing: .2px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #faf7fd; }
td.end, th.end { text-align: end; }
td { white-space: nowrap; }
td.wrap { white-space: normal; min-width: 180px; }
td select { min-width: 84px; }
td input:not([type="checkbox"]) { min-width: 90px; }
td .coords { display: flex; gap: 6px; }
td .coords input { min-width: 82px; width: 92px; }
td input.code-input { min-width: 64px; width: 72px; text-transform: uppercase; }
tfoot td { font-weight: 600; background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 0; }
.empty { padding: 34px 18px; text-align: center; color: var(--muted); }

/* ───────── الشارات ───────── */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--b-bg); color: var(--b-ink); border: 1px solid var(--b-line, transparent); }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--b-dot); }
.badge.gray { --b-bg: #f0eef4; --b-ink: #4d4560; --b-dot: #8e86a0; }
.badge.blue { --b-bg: #e5f2fb; --b-ink: #13557f; --b-dot: #2b9ed8; }
.badge.violet { --b-bg: #f0e9f8; --b-ink: #4b2273; --b-dot: #7c47b0; }
.badge.amber { --b-bg: #fff4d6; --b-ink: #7a5206; --b-dot: #e9a816; }
.badge.teal { --b-bg: #ddf3f0; --b-ink: #0c5e58; --b-dot: #14998e; }
.badge.orange { --b-bg: #ffeadb; --b-ink: #8b3f17; --b-dot: #fd8d3b; }
.badge.green { --b-bg: #e2f5e6; --b-ink: #1d6a2c; --b-dot: #2ea24a; }
.badge.red { --b-bg: #fce6e8; --b-ink: #8f2531; --b-dot: #d03b4b; }

/* ───────── الأزرار ───────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 17px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s, transform .1s; }
.btn:hover { text-decoration: none; border-color: #bfb2d3; box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn.primary { background: linear-gradient(135deg, #6a34a0, #4a1f73); border-color: #4a1f73; color: #fff; box-shadow: 0 6px 16px rgba(74, 31, 115, .25); }
.btn.primary:hover { background: linear-gradient(135deg, #5b2a86, #3a175c); }
.btn.gold { background: linear-gradient(135deg, #ffd56b, #f4b324); border-color: #f0ad1c; color: var(--brand-deep); box-shadow: 0 6px 18px rgba(250, 195, 72, .3); }
.btn.gold:hover { background: linear-gradient(135deg, #ffcf55, #e9a816); }
.btn.ghost { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .2); color: #fff; }
.btn.ghost:hover { background: rgba(255, 255, 255, .14); box-shadow: none; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); }
.btn.sm { padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; padding: 13px 16px; font-size: 16px; }
.btn.disabled { opacity: .45; pointer-events: none; }

/* ───────── النماذج ───────── */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px 18px; }
.field.wide { grid-column: 1 / -1; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field .req { color: var(--danger); margin-inline-start: 3px; }
input, select, textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; color: var(--ink); font: inherit; transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover, textarea:hover { border-color: #bfb2d3; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--brand); }
textarea { min-height: 80px; resize: vertical; }
.err { color: var(--danger); font-size: 12.5px; margin-top: 5px; }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 5px; }
.check { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.filters .field { min-width: 150px; }
.filters .field:first-child { flex: 1; min-width: 220px; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form select, .inline-form input { width: auto; min-width: 130px; flex: 1; }
.total-box { display: flex; align-items: baseline; justify-content: space-between; background: linear-gradient(135deg, var(--brand-soft), var(--gold-soft)); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; }
.total-box .value { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; font-family: var(--font-latin); color: var(--brand-dark); }

/* ───────── رسائل ───────── */
.flash { padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; font-weight: 500; border: 1px solid; animation: drop .35s ease; }
.flash.success { background: #e9f7ec; border-color: #bfe5c8; color: #1d5a2a; }
.flash.error { background: #fdecee; border-color: #f2c4ca; color: #8a2430; }
.flash ul { margin: 0; padding-inline-start: 18px; }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } }

/* ───────── تفاصيل ───────── */
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px 20px; margin: 0; }
.kv dt { font-size: 12.5px; color: var(--muted); }
.kv dd { margin: 2px 0 0; font-weight: 500; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding-block: 0 18px; padding-inline: 26px 0; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: 3px; top: 7px; width: 11px; height: 11px; border-radius: 50%; background: #fff; border: 3px solid var(--brand); }
.timeline li:first-child::before { border-color: var(--gold-deep); box-shadow: 0 0 0 4px rgba(250, 195, 72, .25); }
.timeline li::after { content: ""; position: absolute; inset-inline-start: 8px; top: 22px; bottom: 2px; width: 2px; background: var(--line); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::after { display: none; }
.timeline .when { color: var(--muted); font-size: 12.5px; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px; }

.steps { display: flex; list-style: none; margin: 0; padding: 0; gap: 6px; counter-reset: step; }
.steps li { flex: 1; text-align: center; font-size: 12px; color: var(--muted); padding-top: 12px; border-top: 4px solid var(--line); }
.steps li.done { border-color: var(--gold); color: var(--ink); font-weight: 600; }
@media (max-width: 640px) { .steps { flex-direction: column; gap: 0; } .steps li { text-align: start; border-top: 0; border-inline-start: 4px solid var(--line); padding: 6px 12px; } }

/* ═══════════════ صفحات الزوار (البوابة، الدخول، التتبع) ═══════════════ */
.guest {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: #ece6f6;
    background:
        radial-gradient(60% 50% at 85% 10%, rgba(91, 42, 134, .45), transparent 70%),
        radial-gradient(50% 40% at 10% 90%, rgba(250, 195, 72, .08), transparent 70%),
        linear-gradient(180deg, #1b0e2e 0%, #110820 100%);
    background-attachment: fixed;
}
.guest a { color: var(--gold); }
.guest .muted { color: #a898c2; }

.guest-nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; max-width: 1200px; margin: 0 auto; padding: 20px 24px; }
.guest-nav img { height: 44px; width: auto; display: block; }
.guest-nav .links { display: flex; align-items: center; gap: 22px; font-size: 14px; }
.guest-nav .links a { color: #d6cbe7; }
.guest-nav .links a:hover { color: #fff; text-decoration: none; }
@media (max-width: 720px) { .guest-nav .links .hide-sm { display: none; } .guest-nav img { height: 36px; } }

.guest-body { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; flex: 1; }
.guest-body.narrow { max-width: 1100px; }

.glass { background: linear-gradient(160deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .03)); border: 1px solid rgba(255, 255, 255, .12); border-radius: 18px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 24px 60px rgba(0, 0, 0, .3); }

/* البوابة الرئيسية */
.landing { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: center; gap: 24px; min-height: calc(100vh - 200px); padding: 10px 0 30px; }
.landing .globe { height: min(620px, 72vh); }
.landing .eyebrow { display: inline-flex; align-items: center; gap: 9px; padding: 5px 12px; border-radius: 999px; background: rgba(250, 195, 72, .1); border: 1px solid rgba(250, 195, 72, .3); color: var(--gold); font-size: 12.5px; font-weight: 600; }
.landing .eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); animation: blink 2s infinite; }
.landing h1 { font-size: clamp(30px, 4.2vw, 50px); line-height: 1.2; margin-top: 18px; color: #fff; letter-spacing: -.5px; }
.landing h1 em { font-style: normal; background: linear-gradient(90deg, #ffd56b, #fd8d3b); -webkit-background-clip: text; background-clip: text; color: transparent; }
.landing .lead { color: #c4b6db; font-size: 16.5px; margin-top: 14px; max-width: 52ch; }
.landing .tagline { font-family: var(--font-latin); font-size: 13px; letter-spacing: 1.4px; text-transform: uppercase; color: #8f7cad; margin-top: 10px; direction: ltr; text-align: right; }
.landing .legend { margin-top: 12px; justify-content: center; }
@media (max-width: 960px) {
    .landing { grid-template-columns: 1fr; min-height: 0; }
    .landing-visual { order: -1; }
    .landing .globe { height: 360px; margin-bottom: -10px; }
}

.track-panel { margin-top: 26px; padding: 8px; display: flex; gap: 8px; border-radius: 16px; max-width: 520px; }
.track-panel input { flex: 1; background: transparent; border: 0; color: #fff; font-size: 16px; padding: 12px 14px; font-family: var(--font-latin); letter-spacing: .5px; }
.track-panel input::placeholder { color: #8f7cad; }
.track-panel input:focus { box-shadow: none; }
.track-panel:focus-within { border-color: rgba(250, 195, 72, .55); box-shadow: 0 0 0 4px rgba(250, 195, 72, .12), 0 24px 60px rgba(0, 0, 0, .3); }

.stats { display: flex; gap: 30px; flex-wrap: wrap; margin-top: 30px; }
.stats div { color: #a898c2; font-size: 13px; }
.stats strong { display: block; font-family: var(--font-latin); font-size: 30px; font-weight: 700; color: #fff; line-height: 1.2; }
.stats strong small { color: var(--gold); font-size: 18px; margin-inline-start: 2px; }

.portals-section { padding: 34px 0 20px; }
.portals-section .head { display: flex; align-items: end; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.portals-section h2 { font-size: 20px; color: #fff; }
.portals { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.portal { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 20px; color: inherit; overflow: hidden; transition: transform .2s, border-color .2s, background .2s; }
.portal::after { content: "←"; position: absolute; inset-inline-end: 18px; top: 20px; color: rgba(255, 255, 255, .3); transition: transform .2s, color .2s; }
.portal:hover { text-decoration: none; transform: translateY(-4px); border-color: rgba(250, 195, 72, .45); background: linear-gradient(160deg, rgba(250, 195, 72, .12), rgba(255, 255, 255, .03)); }
.portal:hover::after { color: var(--gold); transform: translateX(-4px); }
.portal .icon { width: 46px; height: 46px; border-radius: 13px; background: linear-gradient(135deg, rgba(250, 195, 72, .22), rgba(253, 141, 59, .12)); color: var(--gold); display: grid; place-items: center; border: 1px solid rgba(250, 195, 72, .25); }
.portal .icon svg { width: 23px; height: 23px; }
.portal .title { font-weight: 700; color: #fff; font-size: 16px; }
.portal .desc { color: #a898c2; font-size: 13px; line-height: 1.6; }

.services { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; padding: 18px 0 10px; }
.service { padding: 20px; display: flex; gap: 14px; align-items: flex-start; }
.service .chip { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.service .chip svg { width: 22px; height: 22px; }
.service.sea .chip { background: rgba(79, 195, 247, .14); color: #4fc3f7; }
.service.air .chip { background: rgba(250, 195, 72, .14); color: var(--gold); }
.service.land .chip { background: rgba(253, 141, 59, .14); color: var(--orange); }
.service h3 { font-size: 15.5px; color: #fff; }
.service h3 span { font-family: var(--font-latin); font-size: 11px; letter-spacing: 1px; color: #8f7cad; margin-inline-start: 6px; }
.service p { color: #a898c2; font-size: 13px; margin-top: 4px; }

.guest-foot { width: 100%; max-width: 1200px; margin: 30px auto 0; padding: 22px 24px 28px; border-top: 1px solid rgba(255, 255, 255, .08); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: #8f7cad; font-size: 13px; }
.guest-foot .contact { display: flex; gap: 20px; flex-wrap: wrap; }
.guest-foot a { color: #c4b6db; }

/* الدخول */
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 30px; align-items: center; min-height: calc(100vh - 210px); padding-bottom: 20px; }
.auth .globe { height: min(560px, 66vh); }
.auth-card { padding: 30px; }
.auth-card .role-chip { display: inline-flex; align-items: center; gap: 8px; color: var(--gold); font-size: 13px; font-weight: 600; }
.auth-card .role-chip svg { width: 18px; height: 18px; }
.auth-card h1 { color: #fff; font-size: 24px; margin-top: 8px; }
.auth-card .sub { color: #a898c2; font-size: 14px; margin-top: 4px; margin-bottom: 22px; }
.auth-card .field label { color: #d6cbe7; }
.auth-card input { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .16); color: #fff; padding: 12px 14px; }
.auth-card input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(250, 195, 72, .18); }
.auth-card .err { color: #ffb4bc; }
.auth-card .note { color: #8f7cad; font-size: 12.5px; text-align: center; margin-top: 14px; }
.auth-aside h2 { font-size: 15px; color: #c4b6db; font-weight: 500; text-align: center; }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth .globe { height: 300px; order: -1; } .auth-aside h2 { display: none; } }

/* التتبع */
.track-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: center; padding: 10px 0 20px; }
.track-hero .globe { height: 440px; }
.track-hero h1 { color: #fff; font-size: 30px; }
.track-hero .route { display: flex; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.track-hero .port { padding: 10px 14px; border-radius: 12px; min-width: 120px; }
.track-hero .port b { display: block; font-family: var(--font-latin); font-size: 22px; color: #fff; letter-spacing: 1px; }
.track-hero .port span { font-size: 12.5px; color: #a898c2; }
.track-hero .arrow { flex: 1; min-width: 40px; height: 2px; background: linear-gradient(90deg, var(--gold), rgba(250, 195, 72, .15)); position: relative; }
.track-hero .arrow::after { content: ""; position: absolute; left: -2px; top: -4px; border: 5px solid transparent; border-right-color: var(--gold); }
@media (max-width: 960px) { .track-hero { grid-template-columns: 1fr; } .track-hero .globe { height: 320px; order: -1; } .track-hero .route { flex-wrap: nowrap; gap: 8px; } .track-hero .port { min-width: 0; flex: 1; } .track-hero .arrow { flex: 0 0 28px; min-width: 28px; } }

.guest .card { background: linear-gradient(160deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .03)); border-color: rgba(255, 255, 255, .12); box-shadow: 0 24px 60px rgba(0, 0, 0, .25); backdrop-filter: blur(12px); }
.guest .card-head, .guest .card-foot { border-color: rgba(255, 255, 255, .1); background: transparent; }
.guest .card h2, .guest .strong { color: #fff; }
.guest .kv dt { color: #a898c2; }
.guest .kv dd { color: #fff; }
.guest .timeline li::before { background: #1b0e2e; border-color: #8e5cc2; }
.guest .timeline li:first-child::before { border-color: var(--gold); }
.guest .timeline li::after { background: rgba(255, 255, 255, .12); }
.guest .timeline .when { color: #a898c2; }
.guest .steps li { border-color: rgba(255, 255, 255, .12); color: #8f7cad; }
.guest .steps li.done { border-color: var(--gold); color: #fff; }
.guest .empty { color: #c4b6db; }
.guest .flash.error { background: rgba(197, 58, 74, .15); border-color: rgba(255, 140, 150, .35); color: #ffc9cf; }
.guest .flash.success { background: rgba(46, 162, 74, .15); border-color: rgba(120, 220, 140, .35); color: #c8f2d1; }

/* ───────── واجهة المندوب والوكيل (جوال) ───────── */
.agent-bar { background: linear-gradient(135deg, #2a1440, #1a0d2b); color: #fff; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; position: sticky; top: 0; z-index: 5; box-shadow: 0 6px 20px rgba(22, 11, 38, .25); }
.agent-bar .who-wrap { display: flex; align-items: center; gap: 10px; }
.agent-bar .who { font-weight: 700; }
.agent-bar .role { font-size: 12.5px; color: #b6a6d0; }
.agent-bar button { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .15); color: #fff; padding: 6px 12px; border-radius: 9px; font: inherit; cursor: pointer; }
.agent-main { max-width: 580px; margin: 0 auto; padding: 18px 14px 48px; }
.agent-main h2 { margin: 22px 0 10px; }
.task { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 17px; color: inherit; margin-bottom: 10px; box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
a.task:hover { text-decoration: none; border-color: var(--line-2); transform: translateY(-1px); }
.task .top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.task .name { font-weight: 700; font-size: 16px; }
.task .meta { color: var(--ink-2); font-size: 13.5px; margin-top: 4px; }
.task label.pick { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.task label.pick input { margin-top: 6px; width: 18px; height: 18px; }
.agent-main input, .agent-main select, .agent-main textarea { font-size: 16px; padding: 12px 13px; }
.agent-main .field + .field { margin-top: 12px; }
.custody { background: linear-gradient(135deg, var(--brand-soft), var(--gold-soft)); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; display: flex; justify-content: space-between; align-items: baseline; }
.custody .value { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; font-family: var(--font-latin); color: var(--brand-dark); }

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

/* ───────── مسافات (آخر الملف لتغلب هوامش المكوّنات) ───────── */
.stack > * + * { margin-top: 18px; }

/* ───────── الواجهة الإنجليزية (من اليسار لليمين) ───────── */
[dir="ltr"] body { font-family: "IBM Plex Sans Arabic", "Segoe UI", system-ui, sans-serif; }
[dir="ltr"] .portal::after { content: "→"; }
[dir="ltr"] .portal:hover::after { transform: translateX(4px); }
[dir="ltr"] .landing .tagline { text-align: left; }
[dir="ltr"] .track-hero .arrow { background: linear-gradient(90deg, rgba(250, 195, 72, .15), var(--gold)); }
[dir="ltr"] .track-hero .arrow::after { left: auto; right: -2px; border-right-color: transparent; border-left-color: var(--gold); }
[dir="ltr"] .landing h1, [dir="ltr"] .hero-panel h1 { letter-spacing: -.8px; }

/* ───────── منطقة الإجراءات الحساسة ───────── */
.danger-zone { border-color: #f2c4ca; }
.danger-zone .card-head { background: #fdf3f4; border-radius: var(--radius) var(--radius) 0 0; }
.danger-zone h2 { color: #8a2430; }
.btn.danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger-solid:hover { background: #a92f3d; }

/* ───────── حسابات التجربة في صفحة الدخول ───────── */
.demo-accounts { margin-top: 18px; padding-top: 16px; border-top: 1px dashed rgba(255, 255, 255, .16); }
.demo-accounts h3 { font-size: 13px; color: var(--gold); display: flex; align-items: center; gap: 8px; }
.demo-accounts .list { display: grid; gap: 8px; margin-top: 10px; }
.demo-accounts button { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .05); color: #fff; font: inherit; cursor: pointer; text-align: start; transition: border-color .15s, background .15s; }
.demo-accounts button:hover { border-color: rgba(250, 195, 72, .5); background: rgba(250, 195, 72, .08); }
.demo-accounts .who { font-size: 13.5px; font-weight: 600; }
.demo-accounts .creds { font-family: var(--font-latin); font-size: 12px; color: #c4b6db; direction: ltr; }
.demo-accounts .use { font-size: 12px; color: var(--gold); font-weight: 600; white-space: nowrap; }

/* ───────── رأس القائمة الجانبية وزر الإغلاق ───────── */
.brand-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding-bottom: 18px; margin-bottom: 6px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.drawer-close { display: none; flex: none; }
@media (max-width: 900px) {
    .drawer-close { display: grid; width: 36px; height: 36px; }
    .brand-row .brand { padding-top: 0; }
    .mobile-bar .row { gap: 12px; flex-wrap: nowrap; }
}
