:root {
  --brand: #0a3d8f; --brand-2: #0b5ed7; --accent: #f5b400; --accent-ink: #3a2a00; --deal: #d6336c; --ok: #0f7b4b; --warn: #b54708;
  --ink: #1b2333; --muted: #5d6779; --line: #e2e6ee; --bg: #f3f5f9; --card: #fff; --radius: 14px; --shadow: 0 2px 10px rgba(16, 30, 60, .08);
  font-family: Inter, Cairo, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg);
}
[dir=rtl] { font-family: Cairo, Inter, system-ui, sans-serif; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; padding-bottom: 40px; }
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: .2em 0 .5em; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; } .spacer { flex: 1; }
.grid { display: grid; gap: 16px; }

/* header */
.top { background: var(--brand); color: #fff; position: sticky; top: 0; z-index: 1000; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.top-row { display: flex; align-items: center; gap: 18px; min-height: 60px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 700; font-size: 1.35rem; }
.logo:hover { text-decoration: none; } .logo small { font-weight: 400; font-size: .75rem; opacity: .8; }
.main-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.main-nav a { color: #fff; padding: 8px 12px; border-radius: 999px; font-weight: 600; font-size: .95rem; }
.main-nav a:hover, .main-nav a.on { background: rgba(255,255,255,.15); text-decoration: none; }
.main-nav .deal-link { color: var(--accent); }
.top-tools { margin-inline-start: auto; display: flex; gap: 8px; align-items: center; white-space: nowrap; }
#userBox { font-size: .92rem; }
.top-tools select, .top .ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.4); border-radius: 8px; padding: 6px 10px; font: inherit; cursor: pointer; }
.top-tools select option { color: var(--ink); }
#installBtn { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 700; }
#userBox a { color: #fff; font-weight: 600; }
@media (max-width: 760px) {
  .logo small { display: none; }
  .top-row { gap: 8px; padding-top: 6px; }
  .top-tools select { width: 74px; padding: 5px; }
  .top .ghost { padding: 5px 8px; }
  .main-nav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 6px; }
  .main-nav a { white-space: nowrap; }
}

/* buttons & forms */
button, .btn { font: inherit; border: 0; border-radius: 10px; padding: 10px 18px; font-weight: 700; cursor: pointer; background: var(--brand-2); color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
button:hover, .btn:hover { filter: brightness(1.08); text-decoration: none; }
button:disabled { opacity: .5; cursor: not-allowed; }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-line { background: #fff; color: var(--brand-2); border: 1px solid var(--brand-2); }
.btn-danger { background: #fff; color: #b42318; border: 1px solid #f0b5b0; }
.btn-sm { padding: 6px 12px; font-size: .88rem; }
label { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
input, select, textarea { font: inherit; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-2); outline-offset: -1px; border-color: transparent; }
input[type=checkbox], input[type=radio] { width: auto; }
.check { display: flex; align-items: center; gap: 8px; font-size: .92rem; color: var(--ink); font-weight: 400; margin: 6px 0; cursor: pointer; }
.field { flex: 1 1 140px; min-width: 120px; }

/* hero / search box */
.hero { margin: 0 -16px; padding: 34px 16px 70px; color: #fff; background: linear-gradient(120deg, rgba(10,61,143,.92), rgba(11,94,215,.7)), var(--hero-img) center/cover; }
.hero h1 { font-size: clamp(1.6rem, 4vw, 2.5rem); max-width: 760px; }
.hero p { max-width: 680px; opacity: .92; }
.searchbox { background: #fff; color: var(--ink); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 14px 16px 18px; margin-top: -50px; position: relative; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs button { background: none; color: var(--muted); border-radius: 0; padding: 10px 14px; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--brand-2); border-bottom-color: var(--brand-2); }
.sform { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.sform .go { flex: 0 0 auto; min-width: 120px; height: 44px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin-bottom: 10px; }
.seg button { background: #fff; color: var(--ink); border-radius: 0; padding: 6px 14px; font-weight: 600; }
.seg button.on { background: var(--brand-2); color: #fff; }

/* cards */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.pad { padding: 16px; }
.section { margin-top: 34px; }
.cities { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.city-card { position: relative; color: #fff; min-height: 160px; display: flex; align-items: flex-end; background-size: cover; background-position: center; }
.city-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 35%, rgba(0,0,0,.6)); }
.city-card div { position: relative; z-index: 1; padding: 12px 14px; }
.city-card b { font-size: 1.1rem; display: block; }
.city-card:hover { text-decoration: none; transform: translateY(-2px); transition: transform .15s; }
.promo { display: flex; gap: 18px; align-items: center; background: linear-gradient(110deg, #3b0b59, var(--deal)); color: #fff; padding: 22px; border-radius: var(--radius); flex-wrap: wrap; }
.promo h2 { margin: 0 0 4px; }
.why { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.why div { background: #fff; border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); font-weight: 600; display: flex; gap: 10px; align-items: center; }
.why i { font-style: normal; font-size: 1.4rem; }

/* results */
.layout { display: grid; grid-template-columns: 270px 1fr; gap: 20px; margin-top: 18px; align-items: start; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } .filters { order: 2; } .filters.collapsed .fbody { display: none; } }
.filters { position: sticky; top: 76px; }
@media (max-width: 900px) { .filters { position: static; } }
.filters h4 { margin: 14px 0 6px; font-size: .9rem; }
.summary-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 14px 0; }
.result { display: grid; grid-template-columns: 260px 1fr auto; gap: 0; margin-bottom: 14px; }
.result .img { background-size: cover; background-position: center; min-height: 190px; }
.result .body { padding: 14px 16px; }
.result .price { padding: 14px 16px; text-align: end; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; min-width: 190px; border-inline-start: 1px solid var(--line); }
.result h3 { margin: 0 0 4px; font-size: 1.15rem; }
@media (max-width: 760px) { .result { grid-template-columns: 1fr; } .result .img { min-height: 170px; } .result .price { border: 0; border-top: 1px solid var(--line); text-align: start; } }
.big { font-size: 1.5rem; font-weight: 700; }
.stars { color: #f5a400; letter-spacing: 1px; font-size: .95rem; }
.score { display: inline-flex; align-items: center; gap: 8px; }
.score b { background: var(--brand); color: #fff; border-radius: 8px 8px 8px 2px; padding: 3px 7px; font-size: .9rem; }
.tag { display: inline-block; font-size: .78rem; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: #eef3fb; color: var(--brand); margin: 2px; }
.tag.ok { background: #e6f6ee; color: var(--ok); } .tag.warn { background: #fff1e6; color: var(--warn); } .tag.deal { background: #fde7ef; color: var(--deal); }
.amen { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.strike { text-decoration: line-through; color: var(--muted); }
#map, .map { height: 520px; border-radius: var(--radius); }
.small-map { height: 260px; border-radius: var(--radius); }
.pin { background: #fff; border: 2px solid var(--brand); color: var(--brand); font-weight: 700; border-radius: 999px; padding: 2px 8px; white-space: nowrap; font-size: 12px; box-shadow: var(--shadow); width: auto !important; height: auto !important; }

/* hotel page */
.gallery { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 150px 150px; gap: 6px; border-radius: var(--radius); overflow: hidden; margin: 14px 0; }
.gallery div { background-size: cover; background-position: center; }
.gallery div:first-child { grid-row: span 2; }
@media (max-width: 700px) { .gallery { grid-template-columns: 1fr 1fr; grid-template-rows: 180px 100px; } .gallery div:first-child { grid-column: span 2; grid-row: auto; } .gallery div:nth-child(n+4) { display: none; } }
.two { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
@media (max-width: 900px) { .two { grid-template-columns: 1fr; } }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
th { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.rooms-table td:last-child { text-align: end; }
@media (max-width: 700px) { .rooms-table thead { display: none; } .rooms-table tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; } .rooms-table td { display: block; border: 0; padding: 4px 10px; text-align: start !important; } }
.review { border-bottom: 1px solid var(--line); padding: 12px 0; }

/* flights */
.flight { display: grid; grid-template-columns: 150px 1fr auto; gap: 16px; align-items: center; padding: 14px 16px; margin-bottom: 10px; }
.flight .times { display: flex; align-items: center; gap: 12px; font-size: 1.2rem; font-weight: 700; }
.flight .line { flex: 1; height: 2px; background: var(--line); position: relative; min-width: 50px; }
.flight .line span { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: .75rem; color: var(--muted); font-weight: 400; white-space: nowrap; }
.airline { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.airline i { width: 28px; height: 28px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-style: normal; font-size: .75rem; }
@media (max-width: 700px) { .flight { grid-template-columns: 1fr; } }
.picked { border: 2px solid var(--ok); }

/* tiles (activities/cars) */
.tiles { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.tile .img { height: 150px; background-size: cover; background-position: center; }
.tile .pad { display: flex; flex-direction: column; gap: 6px; }

/* checkout & trips */
.summary { position: sticky; top: 76px; }
.sum-line { display: flex; justify-content: space-between; padding: 4px 0; }
.sum-total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; font-weight: 700; font-size: 1.15rem; }
.pay-opt { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 8px 0; display: flex; gap: 10px; cursor: pointer; }
.pay-opt.on { border-color: var(--brand-2); background: #f4f8ff; }
.status { font-weight: 700; } .status.confirmed { color: var(--ok); } .status.cancelled { color: #b42318; } .status.pending_payment { color: var(--warn); }
.trip { display: grid; grid-template-columns: 120px 1fr auto; gap: 14px; align-items: center; margin-bottom: 12px; }
.trip .img { height: 100%; min-height: 90px; background-size: cover; background-position: center; }
.trip .pad { padding: 12px 0; }
.trip .act { padding: 12px 16px; }
@media (max-width: 600px) { .trip { grid-template-columns: 1fr; } .trip .img { min-height: 110px; } .trip .pad { padding: 0 14px; } }
.auth { max-width: 420px; margin: 40px auto; }
.auth form > * + * { margin-top: 12px; }
.alert { padding: 10px 14px; border-radius: 10px; background: #fef3f2; color: #b42318; margin: 10px 0; }
.alert.info { background: #eef4ff; color: var(--brand); }
.loading { padding: 60px 0; text-align: center; color: var(--muted); }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #1b2333; color: #fff; padding: 10px 18px; border-radius: 10px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 2000; }
#toast.show { opacity: 1; }

/* admin */
.kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.kpi { padding: 16px; } .kpi b { display: block; font-size: 1.5rem; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding-top: 10px; }
.bars div { flex: 1; background: var(--brand-2); border-radius: 3px 3px 0 0; min-height: 2px; }
.tbl-wrap { overflow-x: auto; }
.tbl-wrap td input { width: 90px; padding: 5px 8px; }
dialog { border: 0; border-radius: var(--radius); padding: 0; width: min(760px, 95vw); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(10,20,40,.5); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }

.foot { background: #0d1b33; color: #c9d3e6; padding: 22px 0; margin-top: 30px; }
.foot .muted { color: #8d9ab3; }
@media print { .top, .foot, button, .btn { display: none !important; } body { background: #fff; } .card { box-shadow: none; border: 1px solid #ccc; } }
