/* ==========================================================================
   USAWI CONNECT — shell styles
   Brand: Ink #1A1A1A · Paper #FFFFFF · Crimson #C8102E (design/branding.html)
   Layout: sidebar on desktop, sticky bottom navigation on mobile.
   All spacing uses logical properties so Arabic mirrors without a second sheet.
   ========================================================================== */

@import url("https://cdn.jsdelivr.net/npm/@fontsource/noto-sans-jp@5.2.5/400.css");
@import url("https://cdn.jsdelivr.net/npm/@fontsource/noto-sans-jp@5.2.5/600.css");
@import url("https://cdn.jsdelivr.net/npm/@fontsource/noto-sans-jp@5.2.5/700.css");
@import url("https://cdn.jsdelivr.net/npm/@fontsource/tajawal@5.0.0/400.css");
@import url("https://cdn.jsdelivr.net/npm/@fontsource/tajawal@5.0.0/700.css");

:root {
  --ink: #1A1A1A;
  --bg: #FFFFFF;
  --card: #FFFFFF;
  --tint: #F7F7F7;
  --border: #E4E4E4;
  --muted: #6B6B6B;
  --faint: #9A9A9A;
  --red: #C8102E;
  --red-dark: #A00D24;
  --green: #1B7F4B;
  --amber: #B45309;
  --radius: 12px;
}

html[data-theme="dark"] {
  --ink: #F2F2F2;
  --bg: #121722;
  --card: #171D2A;
  --tint: #1D2431;
  --border: #2A3240;
  --muted: #9AA3B2;
  --faint: #74808F;
  --red: #E42B4B;
  --red-dark: #C81F3B;
  --green: #35B472;
  --amber: #E0A24A;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: 'Noto Sans JP', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

html.ar body { font-family: 'Tajawal', 'Noto Sans JP', sans-serif; }
html.ar [class*="tracking-"] { letter-spacing: 0; }

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
.hidden { display: none !important; }

/* ---------------------------------------------------------------- boot */
.boot {
  position: fixed; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px;
  background: var(--bg); z-index: 40;
}
.boot-mark {
  width: 44px; height: 44px; border-radius: 12px; background: var(--ink);
  color: var(--bg); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px;
}
.boot-text { font-size: 13px; color: var(--muted); }

/* ---------------------------------------------------------------- gate */
.gate {
  position: fixed; inset: 0; display: flex; align-items: center;
  justify-content: center; padding: 24px; background: var(--bg); z-index: 30;
}
.gate-card {
  max-width: 440px; text-align: center; display: flex; flex-direction: column;
  align-items: center; gap: 14px;
}
.gate-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--red);
}
html.ar .gate-eyebrow { letter-spacing: 0; }
.gate-title { font-size: 24px; line-height: 1.25; font-weight: 700; }
.gate-body { font-size: 14px; color: var(--muted); }

/* ---------------------------------------------------------------- layout */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }

.side {
  border-inline-end: 1px solid var(--border);
  padding: 20px 16px;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 18px;
  background: var(--bg);
}

.brand { display: flex; align-items: center; gap: 10px; padding-inline: 4px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; background: var(--ink);
  color: var(--bg); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.brand-name { font-size: 15px; font-weight: 700; line-height: 1.15; }
.brand-name span { color: var(--red); }
.brand-sub {
  font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--faint); margin-top: 2px;
}
html.ar .brand-sub { letter-spacing: 0; }

.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; padding-top: 14px; border-top: 1px solid var(--border); }
.side-link { font-size: 12.5px; color: var(--muted); padding: 8px 10px; border-radius: 8px; }
.side-link:hover { color: var(--ink); background: var(--tint); }

/* nav items (shared by sidebar and bottom bar) */
.nav-item {
  display: flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 8px 10px; border-radius: 10px;
  color: var(--muted); font-size: 13.5px; font-weight: 500;
}
.nav-item:hover { background: var(--tint); color: var(--ink); }
.nav-item.active { background: var(--tint); color: var(--ink); font-weight: 600; }
.nav-item.active .nav-ic { color: var(--red); }
.nav-ic { width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.nav-ic svg { width: 18px; height: 18px; }

.content { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 60px; display: flex; align-items: center; gap: 12px;
  padding-inline: 24px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--bg); z-index: 10;
}
.crumb { font-size: 13px; font-weight: 600; }
.top-actions { margin-inline-start: auto; display: flex; gap: 8px; }

.icon-btn {
  width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--border);
  background: transparent; color: var(--ink); display: inline-flex;
  align-items: center; justify-content: center; font-size: 12px; font-weight: 600;
}
.icon-btn:hover { border-color: var(--ink); }
.theme-moon { display: none; }
html[data-theme="dark"] .theme-sun { display: none; }
html[data-theme="dark"] .theme-moon { display: inline; }

.view { padding: 24px; max-width: 1080px; width: 100%; }

/* ---------------------------------------------------------------- type */
h1 { font-size: 26px; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 17px; font-weight: 700; }
.lede { color: var(--muted); font-size: 14px; margin-top: 8px; max-width: 620px; }
.section { margin-top: 28px; }
.section-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.section-head .count { font-size: 12px; color: var(--faint); }

/* ---------------------------------------------------------------- pieces */
.btn {
  min-height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 14px; font-weight: 600;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-ghost { border-color: var(--border); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--ink); }

.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
}

.offer { display: flex; flex-direction: column; gap: 6px; }
.offer-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.offer-name { font-size: 15px; font-weight: 700; }
.offer-rate { font-size: 13px; font-weight: 700; color: var(--red); }
.offer-meta { font-size: 12.5px; color: var(--muted); }
.offer-badge {
  font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; background: var(--tint); color: var(--muted);
}

.empty {
  border: 1px dashed var(--border); border-radius: var(--radius);
  padding: 34px 22px; text-align: center; color: var(--muted); font-size: 13.5px;
}
.empty strong { display: block; color: var(--ink); font-size: 14.5px; margin-bottom: 6px; }

.stat-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.stat-n { font-size: 24px; font-weight: 700; line-height: 1.1; }
.stat-l { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

/* ---------------------------------------------------------------- wizard */
.wz-progress {
  display: inline-block; margin-top: 14px; font-size: 11.5px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--faint);
}
html.ar .wz-progress { letter-spacing: 0; }

.wz-q { font-size: 16px; margin-bottom: 12px; }

.opt-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

.opt {
  text-align: start; background: var(--card); color: var(--ink);
  border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 16px; min-height: 64px; display: flex; flex-direction: column;
  gap: 4px; justify-content: center; transition: border-color .15s, background .15s;
}
.opt:hover { border-color: var(--faint); }
.opt.on { border-color: var(--red); background: color-mix(in srgb, var(--red) 6%, transparent); }
.opt-t { font-size: 14.5px; font-weight: 700; }
.opt-h { font-size: 12.5px; color: var(--muted); }

.wz-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.wz-actions .btn[disabled] { opacity: .45; cursor: not-allowed; }

.wz-result { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.wz-name { font-size: 26px; font-weight: 700; line-height: 1.15; }
.wz-line {
  display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap;
  font-size: 13.5px; color: var(--muted); width: 100%;
}
.wz-line b { color: var(--ink); font-weight: 600; }
.wz-reward { color: var(--red) !important; }
.wz-cta { width: 100%; }
.wz-disclosure { font-size: 11.5px; color: var(--faint); line-height: 1.5; }

.wz-code {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--tint); border: 1px dashed var(--border);
  border-radius: 10px; padding: 10px 14px; width: 100%;
}
.wz-code-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
html.ar .wz-code-label { letter-spacing: 0; }
.wz-code code { font-family: 'Noto Sans Mono', ui-monospace, monospace; font-size: 14px; font-weight: 700; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 12px; }

/* country picker */
.wz-field { display: flex; flex-direction: column; gap: 10px; max-width: 520px; }
.wz-search {
  width: 100%; min-height: 48px; padding: 0 14px; font-size: 15px;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  background: var(--card); color: var(--ink);
}
.wz-search:focus { outline: none; border-color: var(--red); }
.wz-search::placeholder { color: var(--faint); }
.country-list { display: flex; flex-direction: column; gap: 4px; }
.c-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 46px; padding: 8px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--card); color: var(--ink);
  text-align: start; font-size: 14px;
}
.c-item:hover { border-color: var(--red); }
.c-code { font-size: 11.5px; color: var(--faint); font-weight: 700; letter-spacing: .06em; }
.c-none { font-size: 13px; color: var(--muted); padding: 10px 2px; }
.wz-chosen {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; max-width: 520px;
  border: 1.5px solid var(--red); border-radius: var(--radius); padding: 12px 16px;
  background: color-mix(in srgb, var(--red) 6%, transparent);
}
.wz-chosen-name { font-weight: 700; font-size: 15px; }
.opt-global { width: 100%; }

/* recommendation + alternatives */
.wz-badge {
  display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: #fff; background: var(--red);
  padding: 4px 10px; border-radius: 999px;
}
html.ar .wz-badge { letter-spacing: 0; }
.alt-list { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.wz-alt { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.wz-alt-name { font-size: 17px; font-weight: 700; }
.wz-alt .btn { width: 100%; }
.klook { border-top: 1px solid var(--border); padding-top: 22px; }
.klook-host { margin: 8px 0 12px; min-height: 40px; }
.klook-host ins { display: block; }

/* third-party widgets (Aviasales flights + hotels) */
.widget-section { border-top: 1px solid var(--border); padding-top: 22px; }
.widget-host { margin: 8px 0 12px; min-height: 40px; }
.widget-host ins { display: block; }

/* ------------------------------------------------------------------ claims */
.claim-form { display: flex; flex-direction: column; gap: 16px; max-width: 560px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.field input[type="text"],
.field input[type="number"],
.field input[type="email"],
.field input[type="date"],
.field select {
  font: inherit; font-size: 14px; color: var(--ink); background: var(--bg);
  border: 1px solid var(--border); border-radius: 10px;
  min-height: 44px; padding: 0 12px; width: 100%;
}
.field input[type="file"] {
  font: inherit; font-size: 13px; color: var(--muted);
  border: 1px dashed var(--border); border-radius: 10px;
  padding: 12px; min-height: 44px; width: 100%;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--red); }
.field-hint { font-size: 11.5px; color: var(--faint); line-height: 1.5; }
.field-err { font-size: 12px; color: var(--red); min-height: 0; }
.field-err:empty { display: none; }
.claim-estimate {
  font-size: 13.5px; font-weight: 600; color: var(--red);
  background: var(--tint); border-radius: 10px; padding: 10px 12px;
}
.claim-ok {
  border: 1px solid var(--green); color: var(--green);
  background: color-mix(in srgb, var(--green) 8%, transparent);
  border-radius: 10px; padding: 12px 14px; font-size: 13.5px;
}
.claims-notes { font-size: 12px; color: var(--muted); line-height: 1.7; margin-top: 18px; }
.claims-notes li { margin-inline-start: 18px; }

.claim-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card); padding: 16px; display: flex; flex-direction: column; gap: 12px;
}
.claim-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.claim-provider { font-size: 15px; font-weight: 700; }
.claim-badge {
  font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; border: 1px solid currentColor;
}
html.ar .claim-badge { letter-spacing: 0; }
.claim-badge.s-pending  { color: var(--amber); }
.claim-badge.s-approved { color: var(--green); }
.claim-badge.s-paid     { color: var(--green); background: color-mix(in srgb, var(--green) 10%, transparent); }
.claim-badge.s-rejected { color: var(--red); }
.claim-rows { display: grid; gap: 6px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.claim-row { font-size: 12.5px; color: var(--muted); }
.claim-row b { display: block; color: var(--ink); font-size: 13.5px; font-weight: 600; word-break: break-word; }
.claim-receipt { margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.claim-receipt:empty { display: none; }
.claim-receipt-img { display: block; max-width: 100%; max-height: 280px; border-radius: 10px; margin-bottom: 8px; }

/* ---------------------------------------------------------------- bottom nav */
.bottom { display: none; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { display: none; }
  .view { padding: 18px 16px 92px; }
  .topbar { padding-inline: 16px; }

  .bottom {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    position: fixed; inset-inline: 0; bottom: 0; z-index: 20;
    background: var(--card); border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .bottom .nav-item {
    flex-direction: column; gap: 3px; justify-content: center;
    min-height: 56px; border-radius: 0; font-size: 10.5px; font-weight: 600;
    padding: 6px 4px;
  }
  .bottom .nav-item.active { background: transparent; color: var(--red); }
  .bottom .nav-item.active .nav-ic { color: var(--red); }
  .bottom .nav-ic svg { width: 20px; height: 20px; }
}
