/* TravelPack.pro — agency (B2B) portal. Hand-written, dependency-free. */
:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --line: #e1e6ef;
  --text: #16213a;
  --muted: #64748b;
  --brand: #1d4ed8;
  --brand-2: #1e40af;
  --brand-soft: #e8efff;
  --accent: #d03000;
  --top: #0f1d3d;
  --top-2: #172a57;
  --ok: #15803d; --ok-bg: #e9f8ee;
  --warn: #b45309; --warn-bg: #fff4e5;
  --err: #b91c1c; --err-bg: #fdecec;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Noto Sans Arabic", "Noto Naskh Arabic", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); font-size: 14.5px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5em; font-weight: 650; line-height: 1.25; }
h1 { font-size: 24px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0 0 1em; }
img { max-width: 100%; }
[dir="rtl"] { text-align: right; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.right { text-align: right; } [dir="rtl"] .right { text-align: left; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* ---------- top bar ---------- */
.topbar { background: linear-gradient(90deg, var(--top), var(--top-2)); color: #fff; position: sticky; top: 0; z-index: 20; box-shadow: 0 2px 10px rgba(0,0,0,.15); }
.topbar__in { max-width: 1240px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 22px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; font-weight: 700; font-size: 15px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand img { height: 38px; width: auto; max-width: 150px; border-radius: 6px; background: #fff; padding: 3px; }
.brand__logo { width: 38px; height: 38px; border-radius: 10px; background: linear-gradient(135deg, #3b82f6, #60a5fa); display: grid; place-items: center; font-size: 17px; }
.brand__text small { display: block; font-weight: 400; font-size: 11px; color: #9fb3d9; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { color: #d6e0f5; padding: 9px 13px; border-radius: 8px; font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.nav a.active { background: var(--brand); color: #fff; }
.nav-toggle { display: none; background: transparent; border: 1px solid rgba(255,255,255,.3); color: #fff; border-radius: 8px; padding: 6px 10px; font-size: 16px; cursor: pointer; margin-left: auto; }
.topbar__right { display: flex; align-items: center; gap: 14px; }
.topbar__right form { margin: 0; }
.lang select { background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.25); border-radius: 8px; padding: 6px 8px; font: inherit; font-weight: 600; cursor: pointer; }
.lang select option { color: #111; }
.who { line-height: 1.15; }
.who b { display: block; font-size: 13.5px; }
.who small { color: #9fb3d9; font-size: 11.5px; }
@media (max-width: 960px) {
  .topbar__in { flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
  .nav-toggle { display: block; }
  .nav { display: none; flex-direction: column; width: 100%; order: 3; }
  .nav.open { display: flex; }
  .topbar__right { order: 2; margin-left: auto; }
  .who { display: none; }
  .brand__text small { display: none; }
}
[dir="rtl"] .nav-toggle { margin-left: 0; margin-right: auto; }
[dir="rtl"] .topbar__right { margin-left: 0; margin-right: auto; }

/* ---------- layout ---------- */
.content { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 26px 20px 48px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin: 2px 0 0; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.grid { display: grid; gap: 18px; }
.grid--2 { grid-template-columns: 1fr 1fr; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--side { grid-template-columns: 1fr 360px; align-items: start; }
@media (max-width: 1000px) { .grid--4 { grid-template-columns: 1fr 1fr; } .grid--side { grid-template-columns: 1fr; } }
@media (max-width: 680px) { .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 18px; }
.card > h2 { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card > h2 .small { font-weight: 400; }
.card--flat { box-shadow: none; }
.card--brand { background: linear-gradient(135deg, var(--top), var(--brand-2)); color: #fff; border: 0; }
.card--brand .muted { color: #b8c7ea; }
.card--brand a { color: #fff; }
.sticky { position: sticky; top: 84px; }
.foot { max-width: 1240px; margin: 0 auto; padding: 14px 20px 24px; width: 100%; display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12.5px; flex-wrap: wrap; }

/* ---------- alerts / badges ---------- */
.alert { border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; border: 1px solid transparent; }
.alert--ok { background: var(--ok-bg); color: var(--ok); border-color: #bfe8cc; }
.alert--err { background: var(--err-bg); color: var(--err); border-color: #f5c2c2; }
.alert--warn { background: var(--warn-bg); color: var(--warn); border-color: #f7dcb5; }
.alert--info { background: var(--brand-soft); color: var(--brand-2); border-color: #c7d7fb; }
.alert ul { margin: 4px 0 0; padding-left: 18px; } [dir="rtl"] .alert ul { padding-left: 0; padding-right: 18px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; letter-spacing: .02em; background: #eef1f6; color: var(--muted); white-space: nowrap; }
.badge--ok { background: var(--ok-bg); color: var(--ok); }
.badge--warn { background: var(--warn-bg); color: var(--warn); }
.badge--err { background: var(--err-bg); color: var(--err); }
.badge--muted { background: #eef1f6; color: var(--muted); }
.badge--brand { background: var(--brand-soft); color: var(--brand-2); }

/* ---------- stats ---------- */
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat .label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.stat .value { font-size: 26px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .value small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.stat--brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.stat--brand .label, .stat--brand .value small { color: #c9d8fb; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
@media (max-width: 1000px) { .kpis { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .kpis { grid-template-columns: 1fr; } }
.terms { display: flex; gap: 22px; flex-wrap: wrap; }
.terms > div { min-width: 120px; }
.terms .label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: #b8c7ea; }
.terms .value { font-size: 20px; font-weight: 700; }

/* ---------- forms ---------- */
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.field { margin-bottom: 14px; }
.input, select, textarea, input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date], input[type=number], input[type=search] {
  width: 100%; height: 42px; border: 1px solid #cfd6e2; border-radius: 9px; padding: 0 12px; font: inherit; color: var(--text); background: #fff;
}
textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; }
select { padding-right: 30px; -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
[dir="rtl"] select { padding-right: 12px; padding-left: 30px; background-position: left 10px center; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
.is-invalid { border-color: var(--err) !important; }
.err { color: var(--err); font-size: 12.5px; margin-top: 4px; }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--text); font-weight: 400; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; flex: 0 0 18px; accent-color: var(--brand); }
.check .price { margin-left: auto; font-weight: 700; white-space: nowrap; } [dir="rtl"] .check .price { margin-left: 0; margin-right: auto; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row--3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 680px) { .form-row, .form-row--3 { grid-template-columns: 1fr; } }
.inline { display: flex; gap: 8px; } .inline .input, .inline input { flex: 1; }

/* search bar */
.search-bar { display: grid; grid-template-columns: 2.2fr 1fr 1fr .6fr .7fr .7fr auto; gap: 12px; align-items: end; }
.search-bar .more { grid-column: 1 / -1; display: flex; gap: 12px; flex-wrap: wrap; }
.search-bar .more > div { min-width: 200px; }
@media (max-width: 1000px) { .search-bar { grid-template-columns: 1fr 1fr; } .search-bar .btn { grid-column: 1 / -1; } }
@media (max-width: 560px) { .search-bar { grid-template-columns: 1fr; } }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 42px; padding: 0 18px; border-radius: 9px; border: 1px solid var(--brand); background: var(--brand); color: #fff; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--brand-2); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--ghost { background: transparent; color: var(--brand); }
.btn--ghost:hover { background: var(--brand-soft); }
.topbar .btn--ghost { color: #fff; border-color: rgba(255,255,255,.35); } .topbar .btn--ghost:hover { background: rgba(255,255,255,.1); }
.btn--sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn--lg { height: 48px; padding: 0 26px; font-size: 15.5px; }
.btn--accent { background: var(--accent); border-color: var(--accent); } .btn--accent:hover { background: #b52a00; }
.btn--danger { background: #fff; color: var(--err); border-color: #f2b8b8; } .btn--danger:hover { background: var(--err-bg); }
.btn--ok { background: var(--ok); border-color: var(--ok); }
.btn--block { width: 100%; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
[dir="rtl"] .table th, [dir="rtl"] .table td { text-align: right; }
.table th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: #f8fafd; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fafbfe; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; } [dir="rtl"] .table td.num, [dir="rtl"] .table th.num { text-align: left; }
.table .ref { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 6px 12px; border-radius: 8px; background: #fff; border: 1px solid var(--line); color: var(--text); font-size: 13px; }
.pagination .current { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- search results ---------- */
.result { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; display: grid; grid-template-columns: 240px 1fr; overflow: hidden; }
.result__img { background: #d8dee9 center/cover no-repeat; min-height: 170px; position: relative; }
.result__img[data-letter]::after { content: attr(data-letter); position: absolute; inset: 0; display: grid; place-items: center; font-size: 64px; font-weight: 700; color: rgba(0,0,0,.12); }
.result__body { padding: 16px 20px; min-width: 0; }
.result__head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 8px; }
.result__title { font-size: 18px; margin: 0; }
.result__addr { color: var(--muted); font-size: 13px; margin: 2px 0 0; }
.result__from { text-align: right; } [dir="rtl"] .result__from { text-align: left; }
.result__from small { display: block; color: var(--muted); font-size: 12px; }
.result__from b { font-size: 22px; color: var(--brand); }
.stars { color: #f59e0b; letter-spacing: 1px; font-size: 13px; }
.offers { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.offers th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); text-align: left; padding: 6px 10px; }
[dir="rtl"] .offers th { text-align: right; }
.offers td { padding: 9px 10px; border-top: 1px solid var(--line); vertical-align: middle; }
.offers .room { font-weight: 650; }
.offers .sub { display: block; font-size: 12px; color: var(--muted); }
.offers .price { font-weight: 700; font-size: 16px; white-space: nowrap; }
.offers .price small { display: block; font-weight: 400; font-size: 11.5px; color: var(--muted); }
.offers td.act { text-align: right; white-space: nowrap; } [dir="rtl"] .offers td.act { text-align: left; }
.offers tr.more { display: none; } .offers.open tr.more { display: table-row; }
.linkbtn { background: none; border: 0; color: var(--brand); font: inherit; font-weight: 600; cursor: pointer; padding: 6px 0; }
@media (max-width: 760px) { .result { grid-template-columns: 1fr; } .offers thead { display: none; } .offers tr { display: grid; grid-template-columns: 1fr auto; } .offers td { border-top: 0; } .offers tr td:first-child { grid-column: 1 / -1; border-top: 1px solid var(--line); } }

/* ---------- booking details ---------- */
.kv { display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); text-transform: capitalize; } .kv dd { margin: 0; font-weight: 600; }
.price-list { list-style: none; margin: 0; padding: 0; }
.price-list li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.price-list li.total { border: 0; font-size: 19px; font-weight: 700; padding-top: 12px; }
.price-list li.total .approx { display: block; font-size: 12px; font-weight: 400; color: var(--muted); text-align: right; } [dir="rtl"] .price-list li.total .approx { text-align: left; }
.price-list .neg { color: var(--ok); }
.card--brand .price-list li { border-color: rgba(255,255,255,.15); }
.card--brand .price-list li.total .approx { color: #b8c7ea; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); }
[dir="rtl"] .timeline { padding: 0 18px 0 0; border-left: 0; border-right: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 14px; font-size: 13.5px; }
.timeline li::before { content: ''; position: absolute; left: -24px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); border: 2px solid #fff; }
[dir="rtl"] .timeline li::before { left: auto; right: -24px; }
.timeline li.muted::before { background: #cbd5e1; }
.timeline li.err::before { background: var(--err); }
.timeline li.ok::before { background: var(--ok); }
.timeline .when { display: block; color: var(--muted); font-size: 12px; }
.ref-big { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 22px; font-weight: 700; letter-spacing: .04em; }
.hotel-line { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.hotel-line .thumb { width: 72px; height: 54px; border-radius: 8px; background: #d8dee9 center/cover no-repeat; flex: 0 0 72px; }
.hotel-line b { display: block; font-size: 16px; }

/* ---------- login ---------- */
body.guest { background: radial-gradient(1200px 600px at 20% -10%, #dbe7ff, transparent), var(--bg); }
.login-wrap { min-height: calc(100vh - 80px); display: grid; place-items: center; padding: 30px 16px; }
.login { width: 100%; max-width: 420px; background: #fff; border-radius: 16px; box-shadow: 0 20px 60px rgba(15, 29, 61, .15); padding: 34px 34px 28px; }
.login .brand { color: var(--text); margin-bottom: 18px; }
.login .brand__logo { background: linear-gradient(135deg, var(--top), var(--brand)); color: #fff; }
.login .brand__text small { color: var(--muted); }
.login h1 { font-size: 20px; margin-bottom: 4px; }
.login .sub { color: var(--muted); margin-bottom: 20px; font-size: 13.5px; }
.login .links { display: flex; justify-content: space-between; margin-top: 18px; font-size: 13px; flex-wrap: wrap; gap: 8px; }
.login .lang-row { display: flex; justify-content: center; gap: 6px; margin-top: 16px; }
.login .lang-row a { padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; color: var(--muted); }
.login .lang-row a.active { background: var(--brand-soft); color: var(--brand-2); }

/* ---------- misc ---------- */
.copy { display: flex; align-items: center; gap: 10px; background: #0f172a; color: #d1fae5; border-radius: 10px; padding: 12px 14px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 15px; }
.copy .btn { margin-left: auto; } [dir="rtl"] .copy .btn { margin-left: 0; margin-right: auto; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.filters > div { min-width: 150px; }
.filters .grow { flex: 1; min-width: 220px; }
@media print { .topbar, .foot, .no-print { display: none !important; } }

/* ---------- RTL: keep dates, amounts and references readable ---------- */
[dir="rtl"] .nowrap, [dir="rtl"] .num, [dir="rtl"] .price, [dir="rtl"] .price-list li > span:last-child, [dir="rtl"] .when, [dir="rtl"] .ref-big, [dir="rtl"] .table .ref, [dir="rtl"] .stat .value, [dir="rtl"] .terms .value, [dir="rtl"] .result__from b, [dir="rtl"] .kv dd { unicode-bidi: plaintext; }
[dir="rtl"] .table td.nowrap { text-align: right; }
