:root {
  --ink: #0b0b0b;
  --ink-2: #1a1a1a;
  --paper: #ffffff;
  --soft: #f4f4f4;
  --line: #e3e3e3;
  --mute: #6a6a6a;
  --green: #1faa59;
  --green-d: #138a43;
  --red: #d92d20;
  --amber: #b45309;
  --r: 14px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Cairo', Tahoma, 'Segoe UI', sans-serif;
  direction: rtl;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.7;
  min-width: 320px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.3; }
em { font-style: normal; opacity: 0.45; padding: 0 0.15em; }
.container { width: min(1160px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--mute); }
.small { font-size: 0.85rem; }
.link { text-decoration: underline; text-underline-offset: 3px; font-weight: 700; }
.loader { padding: 60px 0; text-align: center; color: var(--mute); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: 999px; border: 2px solid transparent; background: transparent;
  font-weight: 700; cursor: pointer; transition: transform .12s, background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-sm { padding: 6px 14px; font-size: .88rem; }
.btn-lg { padding: 13px 28px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #2c2c2c; }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { background: #e9e9e9; }
.btn-outline { border-color: var(--ink); background: transparent; }
.btn-outline:hover { background: var(--ink); color: #fff; }
.btn-outline-light { border-color: #fff; color: #fff; }
.btn-outline-light:hover { background: #fff; color: var(--ink); }
.btn-ghost-light { color: #fff; border-color: #555; }
.btn-ghost-light:hover { border-color: #fff; }
.btn-danger-ghost { color: var(--red); border-color: #f1c6c2; }
.btn-danger-ghost:hover { background: var(--red); color: #fff; border-color: var(--red); }

/* Navbar */
.navbar { background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 50; border-bottom: 3px solid #fff; }
.navbar-inner { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 48px; height: 48px; object-fit: contain; background: #fff; border-radius: 50%; padding: 2px; }
.brand strong { display: block; font-size: 1.15rem; font-weight: 800; line-height: 1.2; }
.brand span { font-size: .78rem; color: #aaa; }
.nav { display: flex; align-items: center; gap: 6px; }
.nav > a:not(.btn) { padding: 8px 14px; border-radius: 999px; font-weight: 600; color: #cfcfcf; }
.nav > a:not(.btn):hover { color: #fff; }
.nav > a.active { background: #fff; color: var(--ink); }
.nav-logout { margin-inline-start: 10px; }
.nav-user { font-size: .9rem; color: #ddd; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.burger { display: none; background: none; border: 0; width: 42px; height: 42px; cursor: pointer; flex-direction: column; justify-content: center; gap: 5px; align-items: center; }
.burger span { width: 24px; height: 2px; background: #fff; display: block; }

/* Hero */
.hero { background: var(--ink); color: #fff; position: relative; overflow: hidden; padding: 70px 0 0; }
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(115deg, transparent 0 46px, rgba(255,255,255,.035) 46px 92px);
}
.hero::after { content: ''; position: absolute; width: 520px; height: 520px; border-radius: 50%; border: 1px solid rgba(255,255,255,.08); left: -140px; bottom: -200px; box-shadow: 0 0 0 60px rgba(255,255,255,.015); }
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: center; padding-bottom: 54px; }
.pill { display: inline-flex; align-items: center; gap: 8px; border: 1px solid #484848; padding: 5px 16px; border-radius: 999px; font-size: .85rem; color: #ddd; margin-bottom: 22px; }
.pill i { width: 9px; height: 9px; border-radius: 50%; background: #777; display: inline-block; }
.pill-live i { background: #2ee27b; box-shadow: 0 0 0 0 rgba(46,226,123,.7); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(46,226,123,0); } 100% { box-shadow: 0 0 0 0 rgba(46,226,123,0); } }
.hero h1 { font-size: clamp(2.6rem, 7vw, 4.9rem); font-weight: 900; line-height: 1.2; letter-spacing: -.5px; }
.hero h1 span { background: #fff; color: var(--ink); padding: .02em .3em .12em; border-radius: 12px; display: inline-block; margin-top: 8px; line-height: 1.35; }
.hero p { color: #bdbdbd; font-size: 1.1rem; max-width: 520px; margin: 24px 0 30px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-badge { display: flex; justify-content: center; }
.hero-ring { width: min(300px, 70vw); aspect-ratio: 1; border-radius: 50%; background: #fff; display: grid; place-items: center; padding: 26px; box-shadow: 0 0 0 10px #1c1c1c, 0 0 0 12px #fff, 0 30px 60px rgba(0,0,0,.5); }
.hero-facts { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid #2b2b2b; padding-bottom: 70px; }
.hero-facts div { padding: 18px 8px; text-align: center; border-inline-start: 1px solid #2b2b2b; }
.hero-facts div:first-child { border-inline-start: 0; }
.hero-facts b { display: block; font-size: 1.5rem; font-weight: 900; line-height: 1.2; }
.hero-facts span { color: #9a9a9a; font-size: .85rem; }

/* Next trip card */
.next-wrap { margin-top: -48px; position: relative; z-index: 2; }
.next-card { display: grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items: center; background: #fff; border: 2px solid var(--ink); border-radius: 20px; box-shadow: 0 18px 40px rgba(0,0,0,.18); padding: 22px 28px; transition: transform .15s; }
.next-card:hover { transform: translateY(-3px); }
.next-label { background: var(--ink); color: #fff; border-radius: 999px; padding: 4px 16px; font-weight: 700; font-size: .85rem; }
.next-main h2 { font-size: 1.6rem; }
.next-main p { color: var(--mute); }
.next-side { display: flex; align-items: center; gap: 20px; }

.price { font-size: 1.3rem; font-weight: 800; line-height: 1.2; }
.price small { display: block; font-size: .75rem; font-weight: 400; color: var(--mute); }

/* Sections */
.section { padding: 64px 0; }
.section-soft { background: var(--soft); }
.section-title { font-size: 1.9rem; font-weight: 800; margin-bottom: 28px; position: relative; padding-bottom: 12px; }
.section-title::after { content: ''; position: absolute; bottom: 0; inset-inline-start: 0; width: 56px; height: 4px; background: var(--ink); border-radius: 4px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.step { border: 2px solid var(--ink); border-radius: var(--r); padding: 24px; background: #fff; }
.step-n { font-size: 2.4rem; font-weight: 900; -webkit-text-stroke: 1.5px var(--ink); color: transparent; line-height: 1; }
.step h3 { margin: 10px 0 4px; }
.step p { color: var(--mute); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 20px; }
.empty { border: 2px dashed #c9c9c9; border-radius: var(--r); padding: 44px 20px; text-align: center; background: #fff; }
.empty strong { font-size: 1.15rem; display: block; }
.empty p { color: var(--mute); }

/* Trip card (تذكرة) */
.trip-card { display: grid; grid-template-columns: 92px 1fr; background: #fff; border: 2px solid var(--ink); border-radius: 18px; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.trip-card:hover { transform: translateY(-4px); box-shadow: 6px 6px 0 var(--ink); }
.ticket-date { background: var(--ink); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 14px 6px; text-align: center; position: relative; border-inline-end: 2px dashed #fff; }
.ticket-date small { font-size: .72rem; color: #aaa; }
.ticket-date b { font-size: 2.6rem; font-weight: 900; line-height: 1.1; }
.ticket-date span { font-size: .9rem; font-weight: 700; }
.ticket-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.trip-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.trip-comp { color: var(--mute); font-size: .8rem; }
.trip-title { font-size: 1.45rem; font-weight: 900; }
.trip-where { color: var(--mute); margin-top: -4px; font-size: .92rem; }
.trip-facts { list-style: none; display: flex; gap: 8px 18px; flex-wrap: wrap; font-size: .88rem; font-weight: 600; }
.trip-facts i { font-style: normal; margin-inline-end: 4px; }
.trip-seats { font-size: .8rem; color: var(--mute); }
.bar { height: 7px; background: var(--soft); border-radius: 8px; overflow: hidden; margin-bottom: 4px; border: 1px solid var(--line); }
.bar i { display: block; height: 100%; background: var(--ink); }
.trip-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line); }

.badge { display: inline-block; font-size: .76rem; font-weight: 700; padding: 2px 12px; border-radius: 999px; }
.badge-open { background: #e8f7ee; color: var(--green-d); border: 1px solid #b6e4c8; }
.badge-warn { background: #fff4e0; color: var(--amber); border: 1px solid #f3d29a; }
.badge-dark { background: var(--ink); color: #fff; }
.badge-muted { background: var(--soft); color: var(--mute); border: 1px solid var(--line); }

/* Empty / lookup / demo */
.empty-trips { background: #fff; border: 2px dashed #bdbdbd; border-radius: 20px; padding: 56px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.empty-trips svg { color: var(--ink); margin-bottom: 8px; }
.empty-trips h3 { font-size: 1.6rem; font-weight: 900; }
.empty-trips p { color: var(--mute); }
.empty-trips.compact { padding: 30px 16px; }
.lookup { display: flex; gap: 10px; margin-bottom: 26px; flex-wrap: wrap; }
.lookup input { flex: 1; min-width: 220px; border: 2px solid var(--ink); border-radius: 999px; padding: 12px 22px; font-size: 1.05rem; background: #fff; }
.lookup input:focus { outline: 3px solid #d4d4d4; }

/* Pages */
.page { padding: 40px 0 70px; min-height: 60vh; }
.page-head { margin-bottom: 26px; }
.page-head h1 { font-size: 2.1rem; font-weight: 900; }
.page-head p { color: var(--mute); }
.page-head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.back { display: inline-block; margin-bottom: 16px; font-weight: 700; color: var(--mute); }
.back:hover { color: var(--ink); }

/* Detail */
.detail { display: grid; grid-template-columns: 1fr 1.05fr; gap: 24px; align-items: start; }
.detail-title { font-size: 2.4rem; font-weight: 900; margin: 10px 0 4px; }
.info-list { margin: 18px 0; border: 2px solid var(--ink); border-radius: var(--r); overflow: hidden; }
.info-list div { display: flex; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.info-list div:last-child { border-bottom: 0; }
.info-list dt { color: var(--mute); min-width: 110px; }
.info-list dd { font-weight: 700; }
.info-list .strong { font-size: 1.2rem; }
.note { background: var(--soft); border-inline-start: 5px solid var(--ink); padding: 14px 16px; border-radius: 8px; margin-bottom: 14px; }
.detail-book { display: grid; gap: 20px; }
.panel { border: 2px solid var(--ink); border-radius: 18px; padding: 22px; background: #fff; }
.panel h2 { font-size: 1.3rem; margin-bottom: 2px; }
.panel > .muted { margin-bottom: 16px; }

/* Seat map */
.seatmap { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.bus { width: min(330px, 100%); background: #fafafa; border: 3px solid var(--ink); border-radius: 46px 46px 22px 22px; padding: 14px 20px 18px; position: relative; }
.bus::before { content: ''; position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 55%; height: 5px; background: var(--ink); border-radius: 5px; opacity: .15; }
.windshield { margin: 6px 0 14px; text-align: center; font-size: .7rem; color: var(--mute); border: 2px solid #d9d9d9; border-radius: 40px 40px 6px 6px; padding: 6px 0; background: linear-gradient(#fff, #f0f0f0); }
.driver-row { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 2px dashed #cfcfcf; }
.seat.driver-seat { background: #2a2a2a; color: #fff; cursor: default; border-color: var(--ink); }
.seat.driver-seat::before { border-color: var(--ink); }
.driver-label { grid-column: 2; font-size: .72rem; color: var(--mute); padding-inline-start: 4px; }
.bus-body { display: grid; gap: 10px; }
.bus-row { display: grid; grid-template-columns: 1fr 1fr 30px 1fr 1fr; gap: 8px; align-items: center; }
.aisle { height: 100%; border-inline: 2px dotted #d7d7d7; }
/* الباب بالوسط: فتحة بجدار الباص (جهة اليمين) بين الصف 3 والصف 4 */
.door-row { position: relative; display: grid; grid-template-columns: 1fr 1fr 30px 1fr 1fr; align-items: center; height: 46px; margin-inline: -20px; padding-inline: 20px; }
.door-aisle { grid-column: 3; height: 100%; border-inline: 2px dotted #d7d7d7; }
.door-mark { grid-column: 4 / 6; display: flex; align-items: center; justify-content: center; gap: 6px; height: 100%; font-size: .78rem; font-weight: 800; background: repeating-linear-gradient(135deg, #fff 0 6px, #f1f1f1 6px 12px); border: 2px solid var(--ink); border-radius: 8px; position: relative; z-index: 1; }
.door-mark .door-arrow { font-size: 1rem; }
.door-row::after { content: ''; position: absolute; right: -3px; top: 6px; bottom: 6px; width: 6px; background: #fff; z-index: 2; border-radius: 2px; }
.door-row::before { content: ''; position: absolute; right: -3px; top: 6px; bottom: 6px; width: 30px; z-index: 0; }
.bus-rear { height: 4px; }

.seat { position: relative; aspect-ratio: 1 / 1; border-radius: 10px 10px 6px 6px; border: 2px solid var(--ink); background: #fff; cursor: pointer; font-weight: 800; transition: transform .1s, background .15s, color .15s; display: grid; place-items: center; }
.seat::before { content: ''; position: absolute; top: -5px; left: 22%; right: 22%; height: 6px; background: inherit; border: 2px solid var(--ink); border-bottom: 0; border-radius: 6px 6px 0 0; }
.seat:hover:not(:disabled) { transform: translateY(-2px); background: #ececec; }
.seat.selected { background: var(--ink); color: #fff; }
.seat.selected:hover { background: var(--ink-2) !important; }
.seat.taken { background: var(--green); border-color: var(--green-d); color: #fff; cursor: not-allowed; }
.seat.taken::before { border-color: var(--green-d); }
.seat.mine { background: var(--green); border-color: var(--ink); color: #fff; box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--ink); cursor: default; }
.seat:disabled:not(.taken):not(.mine) { opacity: .6; cursor: not-allowed; }
.seat-num { font-size: .95rem; }
.legend { list-style: none; display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; font-size: .85rem; color: var(--mute); }
.legend li { display: flex; align-items: center; gap: 6px; }
.seat-dot { width: 16px; height: 16px; border-radius: 4px; border: 2px solid var(--ink); display: inline-block; }
.seat-dot.selected { background: var(--ink); }
.seat-dot.taken { background: var(--green); border-color: var(--green-d); }

/* Forms */
.field { display: grid; gap: 4px; margin-bottom: 14px; }
.field span { font-weight: 700; font-size: .9rem; }
.field input, .field select, .field textarea { border: 2px solid #cfcfcf; border-radius: 12px; padding: 11px 14px; background: #fff; width: 100%; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ink); }
.summary { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); padding: 14px 0; margin-bottom: 14px; }
.summary span { font-size: .82rem; color: var(--mute); display: block; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; min-height: 30px; align-items: center; }
.chips em { font-size: .9rem; opacity: .6; padding: 0; }
.chip { background: var(--ink); color: #fff; min-width: 30px; text-align: center; border-radius: 8px; padding: 0 8px; }
.total { text-align: left; }
.total strong { font-size: 1.5rem; font-weight: 900; }
.panel .small { margin-top: 10px; }

.alert { border-radius: 12px; padding: 12px 16px; margin-bottom: 14px; font-weight: 600; font-size: .93rem; }
.alert-error { background: #fdecea; color: #a4261b; border: 1px solid #f5c2bd; }
.alert-ok { background: #e8f7ee; color: var(--green-d); border: 1px solid #b6e4c8; margin-top: 14px; }
.alert-warn { background: #fff4e0; color: var(--amber); border: 1px solid #f3d29a; }
.alert-info { background: var(--soft); border: 1px solid var(--line); }

/* Auth */
.auth { min-height: 78vh; display: grid; place-items: center; padding: 40px 16px; background: var(--soft); }
.auth-card { width: min(440px, 100%); background: #fff; border: 2px solid var(--ink); border-radius: 22px; padding: 32px 28px; box-shadow: 8px 8px 0 var(--ink); }
.auth-logo { width: 84px; margin: 0 auto 10px; }
.auth-card h1 { text-align: center; font-size: 1.7rem; }
.auth-card > .muted { text-align: center; margin-bottom: 20px; }
.auth-switch { text-align: center; margin-top: 16px; color: var(--mute); }

/* Bookings */
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 26px; }
.stats-4 { grid-template-columns: repeat(4, 1fr); }
.stat { background: var(--ink); color: #fff; border-radius: var(--r); padding: 18px 20px; }
.stat b { display: block; font-size: 2rem; font-weight: 900; line-height: 1.2; }
.stat span { color: #bbb; font-size: .88rem; }
.tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.tabs button { border: 2px solid var(--ink); background: #fff; padding: 8px 18px; border-radius: 999px; font-weight: 700; cursor: pointer; }
.tabs button span { display: inline-block; background: var(--soft); color: var(--ink); border-radius: 999px; min-width: 22px; text-align: center; font-size: .8rem; margin-inline-start: 4px; }
.tabs button.on { background: var(--ink); color: #fff; }
.bookings { display: grid; gap: 14px; }
.booking { display: flex; justify-content: space-between; gap: 20px; border: 2px solid var(--ink); border-radius: 18px; padding: 20px 22px; background: #fff; flex-wrap: wrap; }
.booking.is-cancelled { opacity: .6; border-style: dashed; }
.booking h3 { font-size: 1.3rem; }
.booking-meta { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 8px; font-size: .92rem; }
.booking-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.code { font-family: ui-monospace, Consolas, monospace; font-weight: 800; letter-spacing: 1px; border: 2px dashed var(--ink); border-radius: 8px; padding: 1px 10px; direction: ltr; display: inline-block; }

/* Tables */
.table-wrap { overflow-x: auto; border: 2px solid var(--ink); border-radius: var(--r); background: #fff; }
.panel .table-wrap { border-width: 1px; }
.table { width: 100%; border-collapse: collapse; min-width: 640px; }
.table th { background: var(--ink); color: #fff; text-align: right; padding: 10px 14px; font-size: .88rem; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.ltr-cell { text-align: right; }

/* Modal */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; z-index: 100; padding: 16px; overflow-y: auto; }
.modal { background: #fff; border-radius: 22px; padding: 28px; width: min(440px, 100%); border: 3px solid var(--ink); max-height: 94vh; overflow-y: auto; }
.modal-wide { width: min(760px, 100%); }
.modal-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; margin-top: 14px; }
.field-full { grid-column: 1 / -1; }
.success { text-align: center; }
.check { width: 76px; height: 76px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-size: 2.6rem; font-weight: 900; margin: 0 auto 12px; animation: pop .4s ease; }
@keyframes pop { 0% { transform: scale(.3); opacity: 0; } 70% { transform: scale(1.12); } 100% { transform: scale(1); opacity: 1; } }
.success h2 { font-size: 1.8rem; }
.success > p { color: var(--mute); margin-bottom: 14px; }
.ticket { text-align: right; border: 2px dashed var(--ink); border-radius: 14px; padding: 6px 16px; }
.ticket div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ticket div:last-child { border-bottom: 0; }
.ticket span { color: var(--mute); }
.ticket .code { font-size: 1.1rem; }

/* Toasts */
.toasts { position: fixed; bottom: 18px; inset-inline: 0; display: grid; gap: 8px; justify-items: center; z-index: 200; pointer-events: none; padding: 0 12px; }
.toast { background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 999px; font-weight: 700; box-shadow: var(--shadow); max-width: 520px; text-align: center; }
.toast-ok { background: var(--green-d); }
.toast-error { background: var(--red); }
.toast-warn { background: var(--amber); }

/* Footer */
.footer { background: var(--ink); color: #fff; padding: 36px 0 18px; border-top: 3px solid #fff; }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: center; }
.footer-brand { display: flex; gap: 14px; align-items: center; max-width: 520px; }
.footer-brand img { width: 56px; background: #fff; border-radius: 50%; padding: 3px; }
.footer-brand p { color: #aaa; font-size: .9rem; }
.footer-links { display: flex; gap: 14px; }
.footer-links a { border: 1px solid #555; border-radius: 999px; padding: 4px 16px; }
.footer-copy { color: #777; font-size: .8rem; margin-top: 22px; border-top: 1px solid #2a2a2a; padding-top: 14px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.footer-copy a { color: #999; text-decoration: underline; }

/* Responsive */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero p { margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .hero-badge { order: -1; }
  .hero-ring { width: 190px; padding: 16px; }
  .hero { padding: 40px 0 0; }
  .hero-inner { padding-bottom: 36px; }
  .next-card { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .next-side { flex-direction: column; gap: 10px; }
  .steps { grid-template-columns: 1fr; }
  .detail { grid-template-columns: 1fr; }
  .stats-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .burger { display: flex; }
  .nav { display: none; position: absolute; top: 100%; inset-inline: 0; background: var(--ink); flex-direction: column; align-items: stretch; padding: 14px 16px 20px; border-bottom: 3px solid #fff; gap: 4px; }
  .nav.open { display: flex; }
  .nav > a:not(.btn) { padding: 12px 14px; }
  .nav-logout { margin: 10px 0 0; }
  .navbar-inner { position: relative; }
}
@media (max-width: 560px) {
  .stats-row { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .stat { padding: 12px; } .stat b { font-size: 1.4rem; }
  .stats-4 { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  .trip-card { grid-template-columns: 74px 1fr; }
  .ticket-date b { font-size: 2rem; }
  .ticket-body { padding: 14px; }
  .hero-facts b { font-size: 1.15rem; }
  .detail-title { font-size: 1.9rem; }
  .booking-side { align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
  .modal { padding: 22px 18px; }
}

@media print {
  .no-print { display: none !important; }
  .navbar, .footer, .toasts { display: none !important; }
  body { background: #fff; }
  .panel, .table-wrap { border: 1px solid #000 !important; box-shadow: none; }
  .table th { background: #eee !important; color: #000 !important; }
  .detail { grid-template-columns: 1fr; }
}


/* Teams / logos */
.versus { display: flex; align-items: center; gap: 14px; }
.versus-team { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; min-width: 0; flex: 1; }
.versus-team b { font-size: .98rem; line-height: 1.25; }
.versus-x { font-size: 1.5rem; font-weight: 900; opacity: .35; }
.versus-inline { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 1.05rem; }
.versus-inline em { font-size: 1.2rem; }
.team-logo { object-fit: contain; flex: none; border-radius: 50%; background: #fff; }
.team-fallback { display: inline-grid; place-items: center; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 900; border: 2px solid var(--ink); }
.trip-card .versus { justify-content: center; padding: 6px 0 2px; }
.detail-versus { margin: 14px 0 10px; border: 2px solid var(--ink); border-radius: 18px; padding: 18px 10px; background: var(--soft); }
.detail-versus .versus-team b { font-size: 1.15rem; }
.detail-versus .versus-x { font-size: 2rem; }
.seats-left { text-align: center; line-height: 1.2; }
.seats-left b { display: block; font-size: 1.7rem; font-weight: 900; }
.seats-left small { color: var(--mute); }
.next-main .versus-inline { font-weight: 800; }
.logo-upload { display: flex; align-items: center; gap: 16px; border: 2px dashed #cfcfcf; border-radius: 14px; padding: 14px; }
.logo-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.logo-actions label { cursor: pointer; }
.booking-main h3 { line-height: 1.2; }
.table .versus-inline { font-size: .95rem; font-weight: 700; }

/* ===== إضافات نسخة PHP ===== */
[hidden] { display: none !important; }
.tabs a.tab { border: 2px solid var(--ink); background: #fff; padding: 8px 18px; border-radius: 999px; font-weight: 700; text-decoration: none; color: var(--ink); }
.tabs a.tab span { display: inline-block; background: var(--soft); color: var(--ink); border-radius: 999px; min-width: 22px; text-align: center; font-size: .8rem; margin-inline-start: 4px; }
.tabs a.tab.on { background: var(--ink); color: #fff; }
.nav-logout-form { display: contents; }
.booking-side form { display: contents; }
.seat:disabled:not(.taken):not(.mine):not(.driver-seat) { cursor: default; }
.print-only { display: none; }
@media print {
  .print-only { display: block; }
  body { background: #fff; }
}











/* ===== FINAL RESPONSIVE FIX ===== */

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden !important;
}

#trip-page {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

#trip-page .detail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 24px;
    width: 100%;
    min-width: 0;
}

#trip-page .detail-info,
#trip-page .detail-book {
    min-width: 0;
    width: 100%;
}

#trip-page .panel {
    width: 100%;
    min-width: 0;
}

#trip-page .seatmap {
    width: 100%;
    min-width: 0;
}

#trip-page .bus {
    width: min(330px, 100%);
    max-width: 100%;
    padding-inline: 12px;
}

#trip-page .bus-row,
#trip-page .door-row {
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr)) 22px repeat(2, minmax(0, 1fr));
    gap: 4px;
}

#trip-page .info-list dd {
    min-width: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 850px) {
    #trip-page .detail {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }

    #trip-page .detail-info,
    #trip-page .detail-book {
        width: 100%;
    }
}

@media (max-width: 480px) {
    #trip-page {
        padding-inline: 12px;
    }

    #trip-page .panel {
        padding: 14px 10px;
    }

    #trip-page .bus {
        max-width: 310px;
    }

    #trip-page .seat-num {
        font-size: 0.82rem;
    }

    #trip-page .summary {
        flex-wrap: wrap;
    }
}

/* إصلاح تجاوز عرض مخطط المقاعد */
#trip-page .bus {
    width: 100%;
    max-width: 330px;
    min-width: 0;
    padding-inline: 12px;
    overflow: hidden;
}

#trip-page .bus-row,
#trip-page .door-row {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-inline: 0;
    padding-inline: 0;
    box-sizing: border-box;
    grid-template-columns: repeat(2, minmax(0, 1fr)) 22px repeat(2, minmax(0, 1fr));
    gap: 4px;
}

#trip-page,
#trip-page .detail,
#trip-page .detail-info,
#trip-page .detail-book,
#trip-page .panel {
    min-width: 0;
    max-width: 100%;
}

@media (max-width: 850px) {
    #trip-page .detail {
        grid-template-columns: minmax(0, 1fr);
    }
}
.trip-img-container, .booking-preview-image {
    width: 100%;
    min-height: 200px; /* ضمان حجز مساحة للعنصر حتى قبل اكتمال التحميل */
    display: block;
    overflow: hidden;
}
.trip-img-container img {
    width: 100%;
    height: auto;
    object-fit: cover;
}
@media (max-width: 850px) {
    #trip-page .detail {
        display: grid;
        grid-template-columns: 1fr; /* جعل العناصر تصطف بعمود واحد متجاوب */
        gap: 15px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
}