/* ═══════════════════════════════════════════════════════════════
   A.S.A Logistics — واجهة النظام
   هوية بحرية صناعية: كحلي ASA (#21176D) وأزرق كهربائي (#0067FF)،
   مع برتقالي الإشارات البحرية للتنبيهات، وتفاصيل من عالم الحاويات.
   ═══════════════════════════════════════════════════════════════ */

:root {
    --bg: #f2f4f9;
    --surface: #ffffff;
    --surface-2: #f7f8fc;
    --ink: #0f1433;
    --ink-2: #3c4468;
    --muted: #6b7394;
    --line: #e1e5ef;
    --line-2: #cfd5e4;

    --navy: #21176d;
    --navy-deep: #120c47;
    --navy-ink: #0b0733;
    --blue: #0067ff;
    --blue-deep: #0050c8;
    --blue-soft: #e8f0ff;
    --signal: #ff6a13;
    --signal-soft: #fff0e6;
    --green: #2fa36b;
    --danger: #d63a2f;

    --radius: 10px;
    --notch: 14px;
    --shadow: 0 1px 0 rgba(15, 20, 51, .04), 0 10px 30px -12px rgba(15, 20, 51, .12);
    --shadow-lg: 0 30px 60px -20px rgba(18, 12, 71, .35);
    --ring: 0 0 0 3px rgba(0, 103, 255, .22);

    --font: "Readex Pro", "Segoe UI", Tahoma, sans-serif;
    --font-display: "Archivo", "Readex Pro", sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
    --blueprint: linear-gradient(rgba(33, 23, 109, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(33, 23, 109, .045) 1px, transparent 1px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    background-image: var(--blueprint);
    background-size: 28px 28px;
    color: var(--ink);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.3; }
h1 { font-size: 24px; font-weight: 700; letter-spacing: -.3px; }
h2 { font-size: 16px; font-weight: 600; }
p { margin: 0; }
::selection { background: var(--blue); color: #fff; }

.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; }
.mono, input.mono { font-family: var(--font-mono); letter-spacing: .4px; }
input.mono { text-transform: uppercase; }
.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; }
.eyebrow-code { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--blue); }

/* ═══════════════ هيكل لوحة المكتب: شريط أيقونات ═══════════════ */
.app { display: grid; grid-template-columns: 96px minmax(0, 1fr); min-height: 100vh; }

.sidebar {
    position: sticky; top: 0; height: 100vh;
    display: flex; flex-direction: column; align-items: stretch;
    padding: 14px 8px 12px;
    background:
        repeating-linear-gradient(90deg, rgba(255, 255, 255, .025) 0 6px, transparent 6px 12px),
        linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
    color: #c9c6ee;
    z-index: 20;
}
.brand-row { display: flex; align-items: center; justify-content: center; padding-bottom: 12px; margin-bottom: 8px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.brand { display: flex; flex-direction: column; align-items: center; gap: 6px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand img { width: 46px; height: auto; display: block; transition: transform .6s cubic-bezier(.2, .8, .2, 1); }
.brand:hover img { transform: rotate(45deg); }
.brand .brand-sub { display: none; }
.drawer-close { display: none; }

.nav { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 9px 4px; border-radius: 12px; color: #b8b4e6; font-size: 11px; font-weight: 500; text-align: center; line-height: 1.25;
    transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.nav a.active { background: var(--blue); color: #fff; box-shadow: 0 8px 20px -6px rgba(0, 103, 255, .7); }
.nav a.active::after { content: ""; position: absolute; top: 7px; inset-inline-end: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 3px rgba(255, 106, 19, .25); }
.nav svg { width: 22px; height: 22px; }
.nav-label { display: block; height: 1px; margin: 8px 14px; background: rgba(255, 255, 255, .1); font-size: 0; }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: 11px; text-align: center; }
.sidebar-foot .avatar { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, var(--blue), #5b8cff); color: #fff; font-weight: 700; font-size: 16px; }
.sidebar-foot .grow { display: none; }
.sidebar-foot .lang-switch { padding: 4px 8px; font-size: 11px; }
.sidebar .credit { display: none; }

.content { padding: 28px 34px 60px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; padding-bottom: 16px; border-bottom: 1px dashed var(--line-2); }
.page-head h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); font-size: 13.5px; margin-top: 4px; }

/* ═══════════════ البطاقات: ركن مقصوص كركن الحاوية ═══════════════ */
.card {
    position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow);
    clip-path: polygon(0 0, calc(100% - var(--notch)) 0, 100% var(--notch), 100% 100%, 0 100%);
}
[dir="rtl"] .card { clip-path: polygon(var(--notch) 0, 100% 0, 100% 100%, 0 100%, 0 var(--notch)); }
.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-head h2 { display: flex; align-items: center; gap: 9px; }
.card-head h2::before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: var(--blue); }
.card-body { padding: 20px; }
.card-foot { padding: 13px 20px; border-top: 1px solid var(--line); background: var(--surface-2); }

.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: 12px; }
.tile {
    position: relative; display: block; overflow: hidden; padding: 16px 18px 14px; color: inherit;
    background:
        repeating-linear-gradient(90deg, rgba(33, 23, 109, .028) 0 5px, transparent 5px 10px),
        var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
    transition: transform .18s, box-shadow .18s, border-color .18s;
}
.tile::before { content: ""; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 4px; background: var(--tile-accent, var(--blue)); }
a.tile:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--line-2); }
.tile .label { color: var(--ink-2); font-size: 12.5px; font-weight: 500; }
.tile .value { font-family: var(--font-display); font-size: 30px; font-weight: 800; line-height: 1.15; margin-top: 6px; letter-spacing: -.5px; font-variant-numeric: tabular-nums; color: var(--navy); }
.tile .unit { font-family: var(--font); font-size: 12.5px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.tile .bar { display: none; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 28px 0 12px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.section-title::after { content: ""; flex: 1; height: 1px; background: repeating-linear-gradient(90deg, var(--line-2) 0 6px, transparent 6px 10px); }

/* ═══════════════ لوحة الترحيب: الساحة ثلاثية الأبعاد ═══════════════ */
.hero-panel {
    position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: stretch;
    min-height: 300px; margin-bottom: 24px; border-radius: 16px; overflow: hidden; color: #fff;
    background:
        radial-gradient(70% 90% at 85% 20%, rgba(0, 103, 255, .45), transparent 65%),
        linear-gradient(135deg, var(--navy) 0%, var(--navy-deep) 70%);
    box-shadow: var(--shadow-lg);
}
.hero-panel::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px); background-size: 32px 32px; pointer-events: none; }
.hero-panel .hero-text { position: relative; z-index: 1; padding: 28px 32px; display: flex; flex-direction: column; }
.hero-panel .eyebrow { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 1.4px; text-transform: uppercase; color: #9fc2ff; }
.hero-panel .eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--signal); animation: blink 1.6s infinite; }
.hero-panel h1 { font-size: 27px; margin-top: 12px; }
.hero-panel p { color: #c9c6ee; margin-top: 8px; font-size: 14px; max-width: 48ch; }
.hero-panel .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; padding-top: 18px; }

.hero-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.hero-stats div { padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); font-size: 11.5px; color: #b8b4e6; line-height: 1.35; }
.hero-stats strong { display: block; font-family: var(--font-display); font-size: 24px; font-weight: 800; color: #fff; margin-bottom: 3px; }
@media (max-width: 1100px) { .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .hero-panel { grid-template-columns: 1fr; } .hero-panel .depth-scene { min-height: 240px; order: -1; } }

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

/* ═══════════════ الصور الحقيقية في عمق ثلاثي الأبعاد ═══════════════ */
.gallery3d { position: relative; cursor: grab; user-select: none; -webkit-user-select: none; }
.gallery3d.is-dragging { cursor: grabbing; }
.gallery-canvas, .gallery-canvas canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; }
.gallery-canvas { opacity: 0; transition: opacity 1.4s ease; }
.gallery3d.is-ready .gallery-canvas { opacity: 1; }
.gallery3d.no-webgl { background: center / cover no-repeat url("../images/photos/port-aerial.jpg"); }

.depth-scene { position: relative; overflow: hidden; perspective: 900px; isolation: isolate; }
.depth-scene .layer { position: absolute; will-change: transform; transition: opacity .8s ease; }
.depth-scene .layer.bg { inset: -6%; width: 112%; height: 112%; object-fit: cover; }
.depth-scene::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(180deg, rgba(11, 7, 51, .05) 30%, rgba(11, 7, 51, .55)); }
.depth-scene.full { position: absolute; inset: 0; }
.depth-scene.full::after { background: linear-gradient(180deg, rgba(18, 12, 71, .35), rgba(11, 7, 51, .92) 85%); }
.depth-scene.rounded { min-height: 380px; border-radius: 16px; box-shadow: var(--shadow-lg); }

.hero-panel .depth-scene { min-height: 300px; }
.hero-panel .depth-scene::after { background: linear-gradient(90deg, rgba(18, 12, 71, .85), transparent 40%), linear-gradient(0deg, rgba(11, 7, 51, .65), transparent 50%); }
[dir="ltr"] .hero-panel .depth-scene::after { background: linear-gradient(270deg, rgba(18, 12, 71, .85), transparent 40%), linear-gradient(0deg, rgba(11, 7, 51, .65), transparent 50%); }
.depth-scene .layer.ship { z-index: 2; width: 78%; inset-inline-end: 4%; bottom: 14%; filter: drop-shadow(0 30px 30px rgba(0, 0, 0, .45)); }
.depth-scene .layer.hud { z-index: 3; inset-inline: 16px; bottom: 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.depth-scene .hud span { display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 10px; border-radius: 6px; font-size: 11.5px; color: #e9e7ff; background: rgba(11, 7, 51, .62); border: 1px solid rgba(255, 255, 255, .14); backdrop-filter: blur(6px); }
.depth-scene .hud span::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--c); align-self: center; }
.depth-scene .hud b { font: 800 15px var(--font-display); color: #fff; }

.auth-aside .aside-mark { position: relative; z-index: 2; width: 54px; height: auto; margin-bottom: 16px; }
.auth-aside h2, .auth-aside p { z-index: 2; }

/* مسار الرحلة فوق صورة جوية حقيقية */
.depth-scene.voyage { min-height: 440px; }
.voyage .route { inset: 0; width: 100%; height: 100%; z-index: 2; overflow: visible; }
.voyage .route path { fill: none; stroke: rgba(255, 255, 255, .7); stroke-width: 3; stroke-dasharray: 2 12; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.voyage .route path.done { stroke: var(--signal); stroke-width: 4; stroke-linecap: butt; filter: drop-shadow(0 0 6px rgba(255, 106, 19, .8)); }
.voyage .pins { inset: 0; z-index: 3; direction: ltr; }
.voyage .pin { position: absolute; transform: translate(-50%, calc(-100% - 14px)); padding: 6px 10px; border-radius: 8px; background: #fff; color: var(--navy); font-size: 11.5px; white-space: nowrap; box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .5); }
.voyage .pin b { display: block; font: 800 16px/1.1 var(--font-display); letter-spacing: 1px; }
.voyage .pin::after { content: ""; position: absolute; left: 50%; bottom: -12px; width: 12px; height: 12px; border-radius: 50%; transform: translateX(-50%); background: var(--navy); border: 3px solid #fff; }
.voyage .pin.from { left: 9%; top: 76.8%; }
.voyage .pin.to { left: 91%; top: 30.4%; background: var(--signal); color: #fff; }
.voyage .pin.to::after { background: var(--signal); }
.vessel-marker { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.vessel-marker i { width: 18px; height: 18px; border-radius: 50%; background: var(--signal); border: 3px solid #fff; box-shadow: 0 0 0 0 rgba(255, 106, 19, .7); animation: ping 1.8s infinite; }
.vessel-marker b { padding: 4px 9px; border-radius: 6px; background: rgba(11, 7, 51, .82); color: #fff; font: 600 11px var(--font-mono); letter-spacing: .5px; backdrop-filter: blur(6px); white-space: nowrap; }
.vessel-marker small { color: #fff; font-size: 11px; text-shadow: 0 1px 6px rgba(0, 0, 0, .7); }
@keyframes ping { 70% { box-shadow: 0 0 0 16px rgba(255, 106, 19, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 106, 19, 0); } }
@media (max-width: 760px) { .depth-scene.voyage { min-height: 300px; } .voyage .pin { font-size: 10.5px; padding: 4px 8px; } .voyage .pin b { font-size: 13px; } }

/* ═══════════════ الجداول ═══════════════ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: start; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
[lang="ar"] th { font-family: var(--font); font-size: 12px; letter-spacing: 0; text-transform: none; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #f5f8ff; }
tbody tr:last-child td { border-bottom: 0; }
td.end, th.end { text-align: end; }
td { white-space: nowrap; }
td.wrap { white-space: normal; min-width: 180px; }
td a.ltr.strong { font-family: var(--font-mono); font-weight: 600; letter-spacing: .3px; }
td select { min-width: 84px; }
td input:not([type="checkbox"]) { min-width: 90px; }
td .coords { display: flex; gap: 6px; }
td .coords input { min-width: 80px; width: 90px; }
td input.code-input { min-width: 64px; width: 72px; text-transform: uppercase; font-family: var(--font-mono); }
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: 7px; padding: 3px 10px 3px 9px; border-radius: 4px; white-space: nowrap;
    font-size: 12px; font-weight: 600; background: var(--b-bg); color: var(--b-ink); border: 1px solid var(--b-line, transparent);
}
.badge::before { content: ""; width: 6px; height: 14px; border-radius: 1px; background: var(--b-dot); }
.badge.gray { --b-bg: #eef0f6; --b-ink: #464e6e; --b-dot: #8a96ad; }
.badge.blue { --b-bg: #e8f0ff; --b-ink: #0047b3; --b-dot: #0067ff; }
.badge.violet { --b-bg: #ebe9fb; --b-ink: #21176d; --b-dot: #21176d; }
.badge.amber { --b-bg: #fff4dc; --b-ink: #7a5206; --b-dot: #ffb21a; }
.badge.teal { --b-bg: #ffefe5; --b-ink: #a8400a; --b-dot: #ff6a13; }
.badge.orange { --b-bg: #fff0e6; --b-ink: #a8400a; --b-dot: #ff6a13; }
.badge.green { --b-bg: #e3f6ec; --b-ink: #1c6a43; --b-dot: #2fa36b; }
.badge.red { --b-bg: #fde8e6; --b-ink: #97281f; --b-dot: #d63a2f; }

/* ═══════════════ الأزرار ═══════════════ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 18px; border-radius: 8px;
    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: var(--navy); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 8px 20px -8px rgba(0, 103, 255, .8); }
.btn.primary:hover { background: var(--blue-deep); border-color: var(--blue-deep); }
.btn.gold, .btn.signal { background: var(--signal); border-color: var(--signal); color: #fff; box-shadow: 0 8px 22px -8px rgba(255, 106, 19, .9); }
.btn.gold:hover, .btn.signal:hover { background: #e85a06; border-color: #e85a06; }
.btn.ghost { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .25); color: #fff; }
.btn.ghost:hover { background: rgba(255, 255, 255, .16); border-color: #fff; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); }
.btn.danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.sm { padding: 5px 11px; font-size: 13px; border-radius: 6px; }
.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: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field .req, legend .req { color: var(--signal); margin-inline-start: 3px; }
input, select, textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; color: var(--ink); font: inherit; transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover, textarea:hover { border-color: #aab4cc; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: var(--ring); }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--blue); }
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; padding: 16px 20px; border-radius: 10px; color: #fff;
    background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .04) 0 6px, transparent 6px 12px), linear-gradient(135deg, var(--navy), var(--navy-deep));
}
.total-box .value { font-family: var(--font-display); font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }

/* اختيار نوع الحاوية: رسمة بحجم نسبي (40 قدم = ضعف 20 قدم) */
.container-picker { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.container-picker legend { font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; padding: 0; }
.container-picker .hint { grid-column: 1 / -1; margin: 0; }
.container-option input { position: absolute; opacity: 0; pointer-events: none; }
.container-option .box {
    display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 14px; align-items: center;
    padding: 14px 16px; border: 1.5px solid var(--line-2); border-radius: 10px; background: #fff; cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s;
}
.container-option .mini-container { grid-row: 1 / 3; }
.container-option .size { font-family: var(--font-display); font-weight: 800; font-size: 20px; color: var(--navy); line-height: 1.1; }
.container-option .name { font-size: 12.5px; color: var(--muted); }
.container-option input:checked + .box { border-color: var(--blue); background: var(--blue-soft); box-shadow: var(--ring); }
.container-option input:focus-visible + .box { box-shadow: var(--ring); }

.mini-container { position: relative; display: inline-block; width: 38px; height: 24px; border-radius: 3px; background: repeating-linear-gradient(90deg, #0067ff 0 3px, #0a5ae0 3px 6px); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18), inset 0 3px 0 rgba(255, 255, 255, .15); }
.mini-container.long { width: 76px; background: repeating-linear-gradient(90deg, #21176d 0 3px, #2c2186 3px 6px); }
.mini-container i { position: absolute; inset-inline-end: 4px; top: 5px; width: 2px; height: 14px; background: rgba(255, 255, 255, .55); box-shadow: -4px 0 0 rgba(255, 255, 255, .55); }

.cargo-tag { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 12px; border-radius: 10px; background: var(--blue-soft); border: 1px dashed #9fbfff; }

/* ═══════════════ رسائل وتفاصيل ═══════════════ */
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-weight: 500; border: 1px solid; border-inline-start-width: 4px; animation: drop .35s ease; }
.flash.success { background: #e9f8ef; border-color: #2fa36b; color: #1c5a39; }
.flash.error { background: #fdecea; border-color: #d63a2f; color: #8a241c; }
.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: 12px; 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: 28px 0; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: 2px; top: 6px; width: 13px; height: 13px; border-radius: 3px; background: #fff; border: 3px solid var(--navy); }
.timeline li:first-child::before { border-color: var(--signal); background: var(--signal); box-shadow: 0 0 0 4px rgba(255, 106, 19, .2); }
.timeline li::after { content: ""; position: absolute; inset-inline-start: 8px; top: 22px; bottom: 2px; border-inline-start: 2px dashed var(--line-2); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::after { display: none; }
.timeline .when { color: var(--muted); font-size: 12.5px; font-family: var(--font-mono); }

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

.steps { display: flex; list-style: none; margin: 0; padding: 0; gap: 0; counter-reset: step; }
.steps li { position: relative; flex: 1; text-align: center; font-size: 11.5px; color: var(--muted); padding-top: 30px; counter-increment: step; }
.steps li::before { content: counter(step); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; font: 700 11px var(--font-mono); background: #fff; border: 2px solid var(--line-2); color: var(--muted); z-index: 1; }
.steps li::after { content: ""; position: absolute; top: 11px; inset-inline-start: 50%; width: 100%; height: 2px; background: var(--line-2); }
.steps li:last-child::after { display: none; }
.steps li.done { color: var(--ink); font-weight: 600; }
.steps li.done::before { background: var(--blue); border-color: var(--blue); color: #fff; }
.steps li.done::after { background: var(--blue); }
@media (max-width: 640px) {
    .steps { flex-direction: column; gap: 6px; }
    .steps li { text-align: start; padding: 2px 0; padding-inline-start: 36px; min-height: 24px; }
    .steps li::before { left: auto; inset-inline-start: 0; transform: none; }
    .steps li::after { display: none; }
}

/* ═══════════════════════ صفحات الزوار ═══════════════════════ */
.guest { min-height: 100vh; display: flex; flex-direction: column; background-color: var(--bg); }
.topline { background: var(--navy-deep); color: #b8b4e6; font-size: 12px; }
.topline .inner { max-width: 1240px; margin: 0 auto; padding: 7px 24px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.topline a { color: #fff; }
.topline span + span::before { content: "·"; margin-inline: 10px; opacity: .5; }

.guest-nav { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .86); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.guest-nav .inner { max-width: 1240px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.wordmark { display: flex; align-items: center; gap: 12px; color: var(--navy); }
.wordmark:hover { text-decoration: none; }
.wordmark img { height: 42px; width: auto; transition: transform .7s cubic-bezier(.2, .8, .2, 1); }
.wordmark:hover img { transform: rotate(90deg); }
.wordmark b { display: block; font-family: var(--font-display); font-size: 18px; font-weight: 800; letter-spacing: 1.5px; line-height: 1.1; }
.wordmark small { display: block; font-family: var(--font-mono); font-size: 10px; letter-spacing: 2.2px; color: var(--muted); text-transform: uppercase; }
.guest-nav .links { display: flex; align-items: center; gap: 18px; font-size: 14px; }
.guest-nav .links a:not(.btn):not(.lang-switch) { color: var(--ink-2); font-weight: 500; }
.guest-nav .links a:not(.btn):not(.lang-switch):hover { color: var(--blue); text-decoration: none; }
@media (max-width: 760px) { .guest-nav .links .hide-sm, .topline { display: none; } .wordmark img { height: 36px; } .wordmark small { display: none; } }

.guest-body { width: 100%; flex: 1; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.guest .flash { max-width: 1240px; margin: 16px auto; }

/* البطل: مشهد الميناء بعرض الشاشة */
.port-hero { position: relative; height: min(780px, calc(100vh - 110px)); min-height: 580px; overflow: hidden; background: radial-gradient(ellipse 70% 60% at 50% 45%, #2a1f8f 0%, #120c47 60%, #0b0733 100%); }
.port-hero .gallery3d { position: absolute; inset: 0; }
.port-hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 140px; background: linear-gradient(0deg, var(--bg), transparent); pointer-events: none; }
.hero-card {
    position: absolute; z-index: 2; top: 50%; inset-inline-start: max(24px, calc((100vw - 1240px) / 2 + 24px)); transform: translateY(-52%);
    width: min(520px, calc(100% - 48px)); padding: 30px 30px 26px; color: #fff; border-radius: 16px;
    background: linear-gradient(160deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .05));
    border: 1px solid rgba(255, 255, 255, .2);
    backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .7);
    clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 0 100%);
}
[dir="rtl"] .hero-card { clip-path: polygon(22px 0, 100% 0, 100% 100%, 0 100%, 0 22px); }
.hero-card .stamp { display: inline-flex; gap: 8px; align-items: center; font-family: var(--font-mono); font-size: 11px; letter-spacing: 1.6px; padding: 4px 10px; border: 1px solid rgba(255, 255, 255, .3); border-radius: 4px; color: #9fc2ff; }
.hero-card .stamp i { width: 7px; height: 7px; border-radius: 1px; background: var(--signal); animation: blink 1.4s infinite; }
.hero-card h1 { font-size: clamp(28px, 3.6vw, 44px); line-height: 1.15; margin-top: 16px; letter-spacing: -.6px; }
.hero-card h1 em { font-style: normal; color: #6aa6ff; }
.hero-card .lead { color: #cfccf2; margin-top: 12px; font-size: 15.5px; }

.plate-search { display: flex; gap: 8px; margin-top: 22px; padding: 6px; border-radius: 10px; background: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, .12); }
.plate-search input { flex: 1; border: 0; font-family: var(--font-mono); font-size: 15px; letter-spacing: 1px; text-transform: uppercase; color: var(--navy); padding: 10px 12px; background: transparent; }
.plate-search input:focus { box-shadow: none; }
.plate-search .btn { border-radius: 7px; }
.plate-hint { margin-top: 8px; font-size: 12px; color: #a9a5dd; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chips span { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 11px; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); font-size: 12px; color: #cfccf2; }
.chips b { font-family: var(--font-display); font-size: 16px; color: #fff; }

.scene-hint { position: absolute; z-index: 2; top: 22px; inset-inline-end: 28px; display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; background: rgba(255, 255, 255, .85); color: var(--navy); font-size: 12px; font-weight: 600; box-shadow: var(--shadow); }
.scene-hint svg { width: 16px; height: 16px; }
@media (max-width: 760px) {
    .port-hero { height: auto; min-height: 0; padding-bottom: 20px; }
    .port-hero .gallery3d { position: relative; height: 340px; }
    .hero-card { position: relative; inset: auto; transform: none; margin: -40px 16px 0; width: auto; }
    .scene-hint { display: none; }
}

/* لوحة المغادرة */
.board { margin-top: -40px; position: relative; z-index: 3; border-radius: 14px; overflow: hidden; background: var(--navy-ink); color: #e9e7ff; box-shadow: var(--shadow-lg); }
.board-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.board-head h2 { font-size: 15px; display: flex; align-items: center; gap: 10px; }
.board-head h2::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #2fd47a; box-shadow: 0 0 0 4px rgba(47, 212, 122, .2); animation: blink 2s infinite; }
.board-head .clock { font-family: var(--font-mono); font-size: 13px; color: #ffc21a; letter-spacing: 1px; }
.board-row { display: grid; grid-template-columns: 1.6fr 1.3fr .7fr .7fr .6fr 1fr; gap: 12px; align-items: center; padding: 12px 20px; border-bottom: 1px solid rgba(255, 255, 255, .05); font-family: var(--font-mono); font-size: 13px; }
.board-row:last-child { border-bottom: 0; }
.board-row.head { font-size: 10.5px; letter-spacing: 1.5px; color: #7f7ab8; text-transform: uppercase; padding-block: 10px; }
.board-row .vessel { color: #fff; font-weight: 600; }
.flap { display: inline-flex; gap: 2px; direction: ltr; }
.flap b { display: inline-grid; place-items: center; min-width: 18px; height: 24px; padding: 0 3px; border-radius: 3px; background: #1d1863; color: #ffc21a; font-weight: 700; box-shadow: inset 0 -12px 0 rgba(0, 0, 0, .18); animation: flap .5s ease both; }
.board-row .route { color: #cfccf2; font-family: var(--font); }
.board-status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 4px; font-family: var(--font); font-size: 12px; font-weight: 600; }
.board-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.board-status.loading { background: rgba(255, 194, 26, .14); color: #ffc21a; }
.board-status.departed { background: rgba(0, 103, 255, .2); color: #6aa6ff; }
.board-status.arrived { background: rgba(255, 106, 19, .18); color: #ff9a5c; }
.board-status.closed { background: rgba(47, 212, 122, .14); color: #4fe29a; }
@keyframes flap { from { transform: rotateX(90deg); } }
@media (max-width: 760px) {
    .board { margin-top: 0; }
    .board-row { grid-template-columns: 1fr auto; row-gap: 4px; }
    .board-row.head { display: none; }
    .board-row .route { grid-column: 1; }
    .board-row .etd, .board-row .eta, .board-row .boxes { display: none; }
}

/* الأقسام */
.section { padding: 64px 0 8px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(22px, 2.6vw, 30px); letter-spacing: -.4px; color: var(--navy); }
.section-head p { color: var(--muted); max-width: 60ch; margin-top: 6px; }

.services { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.service {
    position: relative; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
    transition: transform .2s, box-shadow .2s, border-color .2s;
}
.service:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--line-2); }
.service .num { position: absolute; top: 14px; inset-inline-end: 16px; font: 800 38px/1 var(--font-display); color: rgba(33, 23, 109, .07); }
.service .chip { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); }
.service .chip svg { width: 24px; height: 24px; }
.service h3 { margin-top: 16px; font-size: 16.5px; color: var(--navy); }
.service h3 span { display: block; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 1.6px; color: var(--muted); font-weight: 500; margin-top: 3px; }
.service p { color: var(--ink-2); font-size: 13.5px; margin-top: 8px; }
@media (max-width: 1000px) { .services { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .services { grid-template-columns: 1fr; } }

.specialty { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.spec { position: relative; display: flex; align-items: center; gap: 18px; padding: 22px 24px; border-radius: 14px; color: #fff; overflow: hidden; }
.spec.marble { background: radial-gradient(120% 140% at 0% 0%, #f7f7fb 0%, #c9cfe0 35%, #5b647f 100%); color: var(--navy-ink); }
.spec.marble::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(115deg, transparent 0 40px, rgba(255, 255, 255, .25) 40px 42px, transparent 42px 90px); mix-blend-mode: overlay; }
.spec.furniture { background: linear-gradient(135deg, #7a4a22, #3d2210); }
.spec.furniture::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .05) 0 3px, transparent 3px 9px); }
.spec h3 { position: relative; z-index: 1; font-size: 20px; }
.spec p { position: relative; z-index: 1; font-size: 13.5px; opacity: .85; margin-top: 4px; }
.spec .badge-fcl { position: relative; z-index: 1; margin-inline-start: auto; font: 700 12px var(--font-mono); letter-spacing: 1.2px; padding: 6px 10px; border-radius: 6px; border: 1.5px solid currentColor; }
@media (max-width: 760px) { .specialty { grid-template-columns: 1fr; } }

.ports { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.port {
    padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); position: relative; overflow: hidden;
}
.port::before { content: ""; position: absolute; inset-inline-start: 0; top: 0; width: 100%; height: 4px; background: repeating-linear-gradient(90deg, var(--blue) 0 14px, var(--navy) 14px 28px); }
.port b { display: block; font: 800 26px/1.1 var(--font-display); color: var(--navy); letter-spacing: 1px; margin-top: 6px; }
.port span { font-size: 13.5px; color: var(--ink-2); }
.port small { display: block; font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); letter-spacing: 1px; margin-top: 4px; }
@media (max-width: 860px) { .ports { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.faq { display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 18px; transition: border-color .15s, box-shadow .15s; }
.faq details[open] { border-color: var(--blue); box-shadow: var(--shadow); }
.faq summary { list-style: none; cursor: pointer; padding: 16px 0; font-weight: 600; color: var(--navy); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); font: 700 18px/1 var(--font-display); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 0 16px; color: var(--ink-2); }

.portals { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.portal {
    position: relative; display: flex; flex-direction: column; gap: 12px; padding: 20px; color: inherit; background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform .2s, border-color .2s, box-shadow .2s;
}
.portal::after { content: "→"; position: absolute; top: 18px; inset-inline-end: 18px; color: var(--line-2); font-weight: 700; transition: transform .2s, color .2s; }
[dir="rtl"] .portal::after { content: "←"; }
.portal:hover { text-decoration: none; transform: translateY(-3px); border-color: var(--blue); box-shadow: var(--shadow-lg); }
.portal:hover::after { color: var(--blue); transform: translateX(4px); }
[dir="rtl"] .portal:hover::after { transform: translateX(-4px); }
.portal .icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--navy); color: #fff; }
.portal .icon svg { width: 23px; height: 23px; }
.portal .title { font-weight: 700; color: var(--navy); font-size: 16px; }
.portal .desc { color: var(--muted); font-size: 13px; line-height: 1.6; }

.cta-band { margin: 64px 0 0; padding: 30px 32px; border-radius: 16px; color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .04) 0 8px, transparent 8px 16px), linear-gradient(120deg, var(--blue), var(--navy)); }
.cta-band h2 { font-size: 22px; }
.cta-band p { opacity: .85; margin-top: 4px; }

.guest-foot { margin-top: 64px; background: var(--navy-ink); color: #a9a5dd; font-size: 13px; }
.guest-foot .inner { max-width: 1240px; margin: 0 auto; padding: 34px 24px 26px; display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 24px; }
.guest-foot h4 { color: #fff; font-size: 13px; margin: 0 0 10px; font-family: var(--font-mono); letter-spacing: 1.5px; text-transform: uppercase; }
.guest-foot a { color: #e9e7ff; }
.guest-foot .contact { display: grid; gap: 6px; }
.guest-foot .credit { grid-column: 1 / -1; margin: 0; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .08); color: #7f7ab8; }
.guest-foot .credit a { color: #c9c6ee; }
@media (max-width: 760px) { .guest-foot .inner { grid-template-columns: 1fr; } }

/* صفحة الدخول */
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); min-height: calc(100vh - 120px); }
.auth-aside {
    position: relative; display: flex; flex-direction: column; justify-content: flex-end; padding: 36px; color: #fff; overflow: hidden;
    background: radial-gradient(60% 60% at 50% 40%, rgba(0, 103, 255, .55), transparent 70%), linear-gradient(160deg, var(--navy), var(--navy-ink));
}
.auth-aside::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px); background-size: 34px 34px; }

.auth-aside h2 { position: relative; font-size: 22px; }
.auth-aside p { position: relative; color: #c9c6ee; margin-top: 4px; }
.auth-panel { display: flex; align-items: center; padding: 36px; background: var(--surface); }
.auth-card { width: 100%; }
.auth-card .role-chip { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--blue); padding: 4px 10px; background: var(--blue-soft); border-radius: 4px; }
.auth-card .role-chip svg { width: 15px; height: 15px; }
.auth-card h1 { font-size: 28px; margin-top: 14px; color: var(--navy); }
.auth-card .sub { color: var(--muted); margin: 6px 0 24px; }
.auth-card .note { color: var(--muted); font-size: 12.5px; text-align: center; margin-top: 14px; }
@media (max-width: 900px) {
    .auth { grid-template-columns: 1fr; }
    .auth-aside { min-height: 260px; padding: 22px; }
    .auth-panel { padding: 24px 18px 30px; }
}

.demo-accounts { margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--line-2); }
.demo-accounts h3 { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--signal); }
.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 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font: inherit; cursor: pointer; text-align: start; transition: border-color .15s, background .15s; }
.demo-accounts button:hover { border-color: var(--blue); background: var(--blue-soft); }
.demo-accounts .who { font-size: 13.5px; font-weight: 600; }
.demo-accounts .creds { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); direction: ltr; }
.demo-accounts .use { font-size: 12px; color: var(--blue); font-weight: 700; white-space: nowrap; }

/* صفحة التتبع */
.track-hero { position: relative; display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 0; margin-top: 24px; border-radius: 16px; overflow: hidden; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-lg); }

.track-info { padding: 26px; display: flex; flex-direction: column; gap: 14px; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .03) 0 6px, transparent 6px 12px), linear-gradient(170deg, var(--navy), var(--navy-ink)); color: #fff; }
.track-info .bl { font-family: var(--font-mono); font-size: 11px; letter-spacing: 1.6px; color: #9fc2ff; text-transform: uppercase; }
.track-info h1 { font-family: var(--font-mono); font-size: 26px; letter-spacing: 1px; }
.route-line { display: flex; align-items: center; gap: 10px; }
.route-line .port-code { flex: 1; padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); }
.route-line .port-code b { display: block; font: 800 22px/1.1 var(--font-display); letter-spacing: 1px; }
.route-line .port-code span { font-size: 12px; color: #b8b4e6; }
.route-line .arrow { flex: 0 0 30px; height: 2px; background: repeating-linear-gradient(90deg, #6aa6ff 0 5px, transparent 5px 9px); position: relative; }
.route-line .arrow::after { content: ""; position: absolute; top: -4px; inset-inline-end: -2px; border: 5px solid transparent; border-inline-start-color: #6aa6ff; }
[dir="rtl"] .route-line .arrow::after { border-inline-start-color: transparent; border-inline-end-color: #6aa6ff; inset-inline-end: auto; inset-inline-start: -2px; }
.track-info .plate-search { margin-top: auto; }
.container-plate { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: #fff; color: var(--navy); }
.container-plate .mini-container { flex: none; }
.container-plate b { font-family: var(--font-mono); font-size: 15px; letter-spacing: 1px; }
.container-plate span { display: block; font-size: 11.5px; color: var(--muted); }
@media (max-width: 900px) { .track-hero { grid-template-columns: 1fr; } .track-hero .depth-scene { min-height: 300px; order: -1; } }

.track-empty { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: center; margin-top: 40px; }

.track-empty h1 { font-size: 34px; color: var(--navy); }
.track-empty .plate-search { border: 1px solid var(--line-2); }
@media (max-width: 900px) { .track-empty { grid-template-columns: 1fr; } .track-empty .depth-scene { min-height: 260px; order: -1; } }

/* ═══════════════ عناصر مشتركة ═══════════════ */
.lang-switch { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--ink-2) !important; font-size: 12.5px; font-weight: 600; white-space: nowrap; background: #fff; }
.lang-switch:hover { border-color: var(--blue); color: var(--blue) !important; text-decoration: none; }
.lang-switch svg { width: 15px; height: 15px; }
.sidebar .lang-switch, .mobile-bar .lang-switch, .agent-bar .lang-switch { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .2); color: #fff !important; }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .08); color: #fff; cursor: pointer; }
.icon-btn svg { width: 21px; height: 21px; }
.credit { font-size: 12px; color: var(--muted); }
.credit a { color: inherit; font-weight: 600; }

.danger-zone { border-color: #f1c4bf; }
.danger-zone .card-head { background: #fdf2f1; }
.danger-zone h2 { color: #97281f; }
.danger-zone .card-head h2::before { background: var(--danger); }

.mobile-bar, .tabbar, .nav-scrim { display: none; }

/* ═══════════════ الجوال أولاً ═══════════════ */
@media (max-width: 900px) {
    .app { display: block; padding-bottom: calc(84px + 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: repeating-linear-gradient(90deg, rgba(255, 255, 255, .03) 0 6px, transparent 6px 12px), linear-gradient(135deg, var(--navy), var(--navy-deep));
        box-shadow: 0 8px 24px -10px rgba(18, 12, 71, .5);
    }
    .mobile-bar .row { gap: 12px; flex-wrap: nowrap; }
    .mobile-brand { display: flex; align-items: center; gap: 9px; color: #fff; }
    .mobile-brand:hover { text-decoration: none; }
    .mobile-brand img { height: 32px; width: auto; display: block; }
    .mobile-brand b { font: 800 16px/1 var(--font-display); letter-spacing: 1.5px; }

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

    .brand-row { justify-content: space-between; }
    .brand { flex-direction: row; gap: 12px; }
    .brand img { width: 40px; }
    .brand .brand-sub { display: block; font-size: 12px; color: #b8b4e6; line-height: 1.4; }
    .drawer-close { display: grid; width: 36px; height: 36px; }
    .nav a { flex-direction: row; gap: 12px; padding: 11px 12px; font-size: 14.5px; text-align: start; }
    .nav a.active::after { top: 50%; transform: translateY(-50%); }
    .nav-label { height: auto; margin: 12px 12px 4px; background: none; font-size: 11px; color: #8f8ac8; letter-spacing: .5px; }
    .sidebar-foot { flex-direction: row; text-align: start; gap: 10px; }
    .sidebar-foot .grow { display: block; }
    .sidebar-foot .name { color: #fff; font-weight: 600; font-size: 13px; }
    .sidebar-foot button { background: none; border: 0; padding: 0; color: #b8b4e6; font: inherit; font-size: 12px; cursor: pointer; }
    .sidebar .credit { display: block; margin-top: 10px; color: #8f8ac8; font-size: 11px; }
    .sidebar .credit a { color: #c9c6ee; }

    .tabbar {
        display: flex; align-items: stretch; justify-content: space-around; position: fixed; z-index: 30;
        inset-inline: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); padding: 6px; border-radius: 20px;
        background: rgba(18, 12, 71, .94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
        box-shadow: 0 16px 40px -10px rgba(11, 7, 51, .6);
    }
    .tabbar a, .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px; padding: 4px 2px; border: 0; background: none; border-radius: 14px; color: #8f8ac8; font: inherit; font-size: 11px; font-weight: 600; cursor: pointer; }
    .tabbar a:hover { text-decoration: none; color: #fff; }
    .tabbar svg { width: 22px; height: 22px; }
    .tabbar .active { color: #fff; background: rgba(0, 103, 255, .35); }
    .tabbar .fab { flex: 0 0 56px; height: 56px; min-height: 0; margin-top: -26px; border-radius: 16px; background: var(--signal); color: #fff; box-shadow: 0 12px 24px -6px rgba(255, 106, 19, .7), 0 0 0 5px var(--bg); transform: rotate(45deg); }
    .tabbar .fab svg { transform: rotate(-45deg); width: 26px; height: 26px; }

    .content { padding: 18px 14px 28px; }
    .page-head h1 { font-size: 20px; }
    .hero-panel .hero-text { padding: 20px; }
    .hero-panel h1 { font-size: 21px; }
    .hero-panel .actions .btn { flex: 1; }
    .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .tile .value { font-size: 24px; }
    input, select, textarea { font-size: 16px; }
    .container-picker { grid-template-columns: 1fr 1fr; }
    .container-option .box { grid-template-columns: 1fr; text-align: center; justify-items: center; row-gap: 6px; padding: 12px 8px; }
    .container-option .mini-container { grid-row: auto; }
}

@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%; }
}

/* ═══════════════ واجهة المشرف والوكيل (جوال) ═══════════════ */
.agent-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; color: #fff; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .03) 0 6px, transparent 6px 12px), linear-gradient(135deg, var(--navy), var(--navy-deep)); box-shadow: 0 8px 24px -10px rgba(18, 12, 71, .5); }
.agent-bar .who-wrap { display: flex; align-items: center; gap: 10px; }
.agent-bar .brand-mark { width: 34px; height: auto; }
.agent-bar .who { font-weight: 700; }
.agent-bar .role { font-size: 12px; color: #b8b4e6; }
.agent-bar button { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2); color: #fff; padding: 6px 12px; border-radius: 8px; font: inherit; cursor: pointer; }
.agent-main { max-width: 580px; margin: 0 auto; padding: 18px 14px 48px; }
.agent-main h2 { margin: 22px 0 10px; display: flex; align-items: center; gap: 8px; }
.agent-main h2::before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: var(--signal); }
.task { display: block; position: relative; padding: 15px 17px; margin-bottom: 10px; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.task::before { content: ""; position: absolute; inset-inline-start: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 2px; background: var(--blue); }
a.task:hover { text-decoration: none; border-color: var(--blue); transform: translateY(-1px); }
.task .top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.task .name { font-weight: 700; font-size: 16px; color: var(--navy); }
.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 { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 18px; border-radius: var(--radius); color: #fff; background: linear-gradient(135deg, var(--blue), var(--navy)); }
.custody .value { font: 800 26px var(--font-display); font-variant-numeric: tabular-nums; }
.agent .credit { text-align: center; margin-top: 28px; }

/* ═══════════════ الواجهة الإنجليزية ═══════════════ */
[dir="ltr"] .route-line .arrow::after { border-inline-start-color: #6aa6ff; }

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

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

/* الخط الأحادي للأكواد اللاتينية فقط — العربي يبقى بخطه */
[lang="ar"] .auth-card .role-chip, [lang="ar"] .hero-panel .eyebrow { font-family: var(--font); letter-spacing: 0; text-transform: none; font-size: 12px; }

/* زر إغلاق القائمة يظهر على الجوال فقط */
.sidebar .drawer-close { display: none; }
@media (max-width: 900px) { .sidebar .drawer-close { display: grid; } }
[lang="ar"] .guest-foot h4 { font-family: var(--font); letter-spacing: 0; text-transform: none; font-size: 14px; }
.voyage .route path.done { vector-effect: none; stroke-width: 5; }
[dir="rtl"] .route-line .arrow::after { inset-inline-start: auto; inset-inline-end: auto; left: -2px; right: auto; border: 5px solid transparent; border-right-color: #6aa6ff; }
[dir="ltr"] .route-line .arrow::after { right: -2px; left: auto; border: 5px solid transparent; border-left-color: #6aa6ff; }

/* زر الخروج في شريط الأيقونات */
.rail-logout button { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 64px; padding: 7px 4px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 12px; background: rgba(255, 255, 255, .05); color: #c9c6ee; font: inherit; font-size: 11px; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.rail-logout button:hover { background: rgba(214, 58, 47, .22); border-color: rgba(255, 140, 130, .5); color: #fff; }
.rail-logout svg { width: 20px; height: 20px; }
[dir="rtl"] .rail-logout svg { transform: scaleX(-1); }
@media (max-width: 900px) { .rail-logout { display: none; } }

/* شريط المشرف والوكيل: الاسم يتقلّص، واللغة والخروج في صف واحد آخر الشريط */
.agent-bar .who-wrap { min-width: 0; flex: 1; }
.agent-bar .brand-mark { flex: none; }
.agent-bar .who-text { min-width: 0; }
.agent-bar .who, .agent-bar .role { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agent-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.agent-actions .lang-switch, .agent-actions .agent-logout { height: 36px; padding: 0 11px; border-radius: 9px; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; }
.agent-logout { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2); color: #fff; font: inherit; cursor: pointer; }
.agent-logout:hover { background: rgba(214, 58, 47, .3); border-color: rgba(255, 140, 130, .6); }
.agent-logout svg { width: 17px; height: 17px; }
[dir="rtl"] .agent-logout svg { transform: scaleX(-1); }
.agent-logout span { display: none; }
.agent-actions .agent-logout { width: 36px; padding: 0; justify-content: center; }

/* بانر الترحيب بلا صور: التحية والأزرار في جهة والأرقام في الجهة الأخرى */
.hero-panel.solo { grid-template-columns: 1fr; min-height: 0; }
.hero-panel.solo .hero-text { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 28px; align-items: center; padding: 28px 32px; }
.hero-panel.solo .hero-intro { display: flex; flex-direction: column; }
.hero-panel.solo .actions { margin-top: 18px; padding-top: 0; }
.hero-panel.solo .hero-stats { margin-top: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hero-panel.solo .hero-stats div { padding: 14px 16px; }
.hero-panel.solo .hero-stats strong { font-size: 28px; }
@media (max-width: 900px) {
    .hero-panel.solo .hero-text { grid-template-columns: 1fr; gap: 18px; padding: 20px; }
}
/* زر الخروج في شريط الأيقونات: أيقونة فقط */
.rail-logout button span { display: none; }
.rail-logout button { width: 44px; height: 44px; padding: 0; justify-content: center; }
