/* Encomiendafacil.com — navy sidebar, blue actions, white cards on a cool gray page. */
:root {
  --blue: #0b6cf2;
  --blue-600: #0a5cd1;
  --blue-50: #eaf2ff;
  --blue-100: #d6e6ff;
  --navy: #0b1f3d;
  --navy-2: #12305c;
  --ink: #0f1c2e;
  --ink-2: #2b3a52;
  --muted: #5d6c83;
  --line: #e2e8f1;
  --line-2: #eef2f7;
  --bg: #f2f5fa;
  --card: #ffffff;
  --green: #128a4b;
  --green-50: #e6f6ed;
  --amber: #f5a524;
  --amber-50: #fff5e0;
  --red: #e5484d;
  --red-50: #fdecec;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 14px rgba(16, 24, 40, 0.05);
  --shadow-lg: 0 10px 40px rgba(11, 31, 61, 0.18);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --sidebar: 208px;
  --rail: 340px;
  --top: 68px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; color: var(--navy); }
p { margin: 0; }
.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.i.sm { width: 15px; height: 15px; }
.i.lg { width: 22px; height: 22px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--top);
  display: flex; align-items: center; gap: 24px;
  padding: 0 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--navy); text-decoration: none !important; min-width: 0; }
.brand-mark { width: 42px; height: 42px; flex: none; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text b { font-size: 23px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; color: var(--navy); white-space: nowrap; }
.brand-text b span { color: var(--blue); }
.brand-text small { font-size: 11.5px; color: var(--blue-600); font-weight: 500; white-space: nowrap; }
.topnav { display: flex; gap: 6px; margin-left: auto; }
.topnav a { padding: 8px 12px; border-radius: 8px; color: var(--ink-2); font-weight: 500; font-size: 13.5px; text-decoration: none; }
.topnav a:hover, .topnav a.active { background: var(--blue-50); color: var(--blue-600); }
.top-actions { display: flex; align-items: center; gap: 10px; margin-left: 18px; }
.topbar .menu-btn { display: none; }
.lang-btn { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 9px; font-size: 12px; font-weight: 700; color: var(--muted); cursor: pointer; }
.lang-btn:hover { color: var(--blue); border-color: var(--blue-100); }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border: 1px solid var(--line); border-radius: 99px; color: var(--ink); text-decoration: none !important; font-weight: 600; font-size: 13px; }
.user-chip:hover { border-color: var(--blue-100); background: var(--blue-50); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px;
  border-radius: 8px; border: 1px solid transparent;
  font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap;
  text-decoration: none !important; transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-600); }
.btn.outline { background: #fff; color: var(--blue-600); border-color: #b7d0f8; }
.btn.outline:hover { background: var(--blue-50); }
.btn.ghost { background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--line-2); }
.btn.danger { background: #fff; color: var(--red); border-color: #f4c2c3; }
.btn.danger:hover { background: var(--red-50); }
.btn.success { background: var(--green); color: #fff; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 12.5px; }
.btn.lg { height: 48px; padding: 0 22px; font-size: 15px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px;
  border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { color: var(--blue); border-color: var(--blue-100); }
.icon-btn.plain { border: 0; background: transparent; border-radius: 8px; }
.fav-btn { border: 0; background: transparent; color: #9aa7b8; cursor: pointer; padding: 6px; border-radius: 50%; display: grid; place-items: center; }
.fav-btn:hover { color: var(--red); background: var(--red-50); }
.fav-btn.on { color: var(--red); }
.fav-btn.on .i { fill: var(--red); }

/* ---------- layout ---------- */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr) var(--rail);
  min-height: calc(100vh - var(--top));
}
.shell.no-rail { grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.shell.no-rail .rail { display: none; }
.main { min-width: 0; padding: 0 0 32px; outline: none; }
.main > .page { padding: 24px; }
.rail { padding: 14px 14px 32px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* ---------- sidebar ---------- */
.sidebar {
  position: sticky; top: var(--top); height: calc(100vh - var(--top));
  background: linear-gradient(180deg, var(--navy) 0%, #0d2548 100%);
  color: #fff; padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto;
}
.side-link {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px;
  color: rgba(255, 255, 255, 0.86); font-weight: 500; font-size: 14px; text-decoration: none !important;
}
.side-link .i { width: 20px; height: 20px; }
.side-link:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.side-link.active { background: rgba(94, 160, 255, 0.16); color: #fff; box-shadow: inset 0 0 0 1px rgba(94, 160, 255, 0.18); }
.side-link .badge { margin-left: auto; }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; }
.side-sep { height: 1px; background: rgba(255, 255, 255, 0.08); margin: 10px 6px; }
.side-spacer { flex: 1; min-height: 16px; }
.side-secure {
  border: 1px solid rgba(94, 160, 255, 0.45); border-radius: 12px; padding: 14px; margin: 8px 2px;
  background: rgba(94, 160, 255, 0.06);
}
.side-secure h4 { color: #fff; font-size: 13.5px; display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.side-secure h4 .i { color: #3ddc97; width: 26px; height: 26px; }
.side-secure p { font-size: 11.5px; color: rgba(255, 255, 255, 0.75); line-height: 1.5; }
.side-connect { display: flex; gap: 10px; align-items: center; padding: 10px 8px 4px; color: #fff; font-weight: 600; font-size: 13px; line-height: 1.3; }
.side-connect .i { width: 30px; height: 30px; stroke-width: 1.6; }
.side-plane { width: 100%; height: 46px; color: rgba(255, 255, 255, 0.6); }

/* ---------- mobile tab bar ---------- */
.tabbar { display: none; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.card-head h2, .card-head h3 { font-size: 16px; }
.card-body { padding: 20px; }
.section { margin: 18px 18px 0; }
.page-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-title h1 { font-size: 24px; letter-spacing: -0.01em; }
.page-title p { color: var(--muted); margin-top: 4px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.strong { font-weight: 700; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.divider { height: 1px; background: var(--line-2); margin: 16px 0; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff;
  min-height: 252px; padding: 30px 32px 22px;
  background: var(--navy) url('/img/hero.jpg') 62% 40% / cover no-repeat;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(8, 26, 54, 0.92) 0%, rgba(8, 26, 54, 0.72) 38%, rgba(8, 26, 54, 0.12) 72%, rgba(8, 26, 54, 0) 100%);
}
.hero > * { position: relative; }
.hero h1 { color: #fff; font-size: 36px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.08; max-width: 560px; }
.hero p { margin-top: 12px; font-size: 15px; color: rgba(255, 255, 255, 0.9); max-width: 470px; }
.hero-feats { display: flex; gap: 26px; margin-top: 22px; flex-wrap: wrap; }
.hero-feat { display: flex; align-items: center; gap: 10px; font-size: 12.5px; font-weight: 500; line-height: 1.25; max-width: 150px; }
.hero-feat span.ic { width: 36px; height: 36px; border-radius: 50%; background: #fff; color: var(--navy); display: grid; place-items: center; flex: none; }

/* ---------- search ---------- */
.search-card { margin: 18px 18px 0; padding: 20px 20px 18px; }
.search-card h2 { font-size: 19px; }
.search-card > p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.search-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.search-grid-2 { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 14px; margin-top: 14px; align-items: end; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 11.5px; color: var(--muted); }
.field .err { font-size: 12px; color: var(--red); }
.control {
  position: relative; display: flex; align-items: center; height: 42px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff;
}
.control:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(11, 108, 242, 0.12); }
.control.invalid { border-color: var(--red); }
.control .lead { position: absolute; left: 12px; pointer-events: none; color: var(--muted); display: flex; font-size: 17px; line-height: 1; }
.control input, .control select {
  width: 100%; height: 100%; border: 0; background: transparent; padding: 0 12px; outline: none; min-width: 0;
  -webkit-appearance: none; appearance: none;
}
.control.has-lead input, .control.has-lead select { padding-left: 40px; }
.control select { padding-right: 34px; cursor: pointer; }
.control .chev { position: absolute; right: 10px; pointer-events: none; color: var(--muted); }
.control input:disabled { color: #a8b3c3; }
.control.disabled { background: #f7f9fc; }
textarea.input, .input {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; background: #fff; outline: none; resize: vertical;
}
textarea.input:focus, .input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(11, 108, 242, 0.12); }
.radios { display: flex; gap: 22px; height: 42px; align-items: center; }
.radio { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; }
.radio input { width: 18px; height: 18px; accent-color: var(--blue); margin: 0; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--blue); margin: 0; }

/* ---------- results ---------- */
.results-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 22px 18px 10px; flex-wrap: wrap; }
.results-head h2 { font-size: 18px; }
.sort { display: flex; align-items: center; gap: 8px; }
.sort .control { height: 36px; min-width: 190px; }
.sort .control select { font-size: 13px; padding-left: 92px; }
.sort .control .lead { font-size: 12.5px; color: var(--muted); }
.notice { margin: 0 18px 10px; padding: 10px 14px; border-radius: 10px; background: var(--blue-50); color: var(--blue-600); font-size: 13px; display: flex; gap: 8px; align-items: center; }
.notice.amber { background: var(--amber-50); color: #8a5a00; }
.notice.green { background: var(--green-50); color: var(--green); }
.list { display: flex; flex-direction: column; gap: 10px; margin: 0 18px; }
.agent-card {
  display: grid; grid-template-columns: 76px minmax(0, 1fr) auto auto 34px; gap: 18px; align-items: center;
  padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.agent-card:hover { border-color: #c9daf5; }
.logo-box {
  width: 76px; height: 64px; border-radius: 10px; border: 1px solid var(--line-2); overflow: hidden; display: grid; place-items: center; background: #fff;
}
.logo-box img { width: 100%; height: 100%; object-fit: contain; }
.avatar { display: grid; place-items: center; font-weight: 800; color: #fff; letter-spacing: 0.02em; }
.logo-box .avatar { width: 100%; height: 100%; font-size: 22px; }
.avatar.round { border-radius: 50%; }
.agent-main { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.agent-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.agent-name a, .agent-name b { font-size: 15.5px; font-weight: 700; color: var(--navy); }
.verified-dot { color: var(--blue); display: inline-flex; }
.verified-dot .i { width: 17px; height: 17px; fill: var(--blue); stroke: #fff; }
.stars { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12.5px; }
.stars .star { color: var(--amber); display: inline-flex; }
.stars .star .i { width: 15px; height: 15px; fill: var(--amber); stroke: var(--amber); }
.stars b { color: var(--ink); }
.route { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); flex-wrap: wrap; }
.route .arrow { color: var(--muted); }
.flag { font-size: 15px; line-height: 1; }
.avail { font-size: 12.5px; color: var(--muted); }
.avail b { color: var(--green); font-weight: 600; }
.agent-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.agent-facts { display: flex; gap: 18px; font-size: 12.5px; color: var(--muted); }
.agent-facts span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.agent-facts b { color: var(--ink); font-size: 13.5px; }
.agent-actions { display: flex; flex-direction: column; gap: 8px; min-width: 116px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.pill .i { width: 14px; height: 14px; }
.pill.green { background: var(--green-50); color: var(--green); }
.pill.blue { background: var(--blue-50); color: var(--blue-600); }
.pill.gray { background: #eef1f5; color: #5d6c83; }
.pill.amber { background: var(--amber-50); color: #9a6200; }
.pill.red { background: var(--red-50); color: var(--red); }
.pill.navy { background: var(--navy); color: #fff; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .i { width: 40px; height: 40px; color: #b4c2d6; margin: 0 auto 12px; display: block; stroke-width: 1.5; }
.empty h3 { color: var(--ink); font-size: 16px; margin-bottom: 6px; }
.pager { display: flex; justify-content: center; gap: 8px; margin: 16px 18px 0; }
.trust { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 22px 18px 0; padding: 14px 6px; border-top: 1px solid var(--line); }
.trust-item { display: flex; gap: 10px; align-items: flex-start; }
.trust-item .i { color: var(--navy); width: 22px; height: 22px; margin-top: 2px; }
.trust-item b { display: block; font-size: 12.5px; color: var(--navy); }
.trust-item span { font-size: 11.5px; color: var(--muted); }

/* ---------- rail ---------- */
.map-card { position: relative; overflow: hidden; min-height: 210px; background: #e9f2fd url('/img/map.jpg') center 30% / cover no-repeat; border-color: #dbe7f7; }
.map-card .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 16px 14px; background: linear-gradient(180deg, rgba(234, 243, 253, 0) 0%, rgba(234, 243, 253, 0.96) 55%); }
.map-card h3 { font-size: 15px; }
.map-card p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.member-card { padding: 16px; }
.member-head { display: flex; align-items: center; gap: 12px; }
.member-head .ic { width: 38px; height: 38px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; flex: none; }
.member-head h3 { font-size: 13.5px; }
.price { font-size: 26px; font-weight: 800; color: var(--navy); letter-spacing: -0.02em; }
.price small { font-size: 13px; font-weight: 500; color: var(--muted); }
.benefits { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 7px; font-size: 12.5px; color: var(--ink-2); }
.benefits li { display: flex; gap: 8px; align-items: center; }
.benefits .i { color: var(--green); width: 16px; height: 16px; }

/* ---------- chat ---------- */
.chat { display: flex; flex-direction: column; min-height: 0; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.chat-head .who { min-width: 0; flex: 1; }
.chat-head .who b { display: flex; align-items: center; gap: 6px; color: var(--navy); font-size: 14px; }
.chat-head .who small { color: var(--muted); font-size: 11.5px; display: flex; align-items: center; gap: 5px; }
.online-dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; display: inline-block; }
.chat-av { width: 38px; height: 38px; border-radius: 50%; overflow: hidden; flex: none; border: 1px solid var(--line-2); background: #fff; }
.chat-av img { width: 100%; height: 100%; object-fit: cover; }
.chat-av .avatar { width: 100%; height: 100%; font-size: 14px; }
.chat-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: #fbfcfe; min-height: 180px; }
.msg { max-width: 82%; display: flex; flex-direction: column; gap: 3px; }
.msg .bubble { padding: 9px 12px; border-radius: 12px; font-size: 13px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }
.msg.them { align-self: flex-start; }
.msg.them .bubble { background: #eef3fa; color: var(--ink); border-top-left-radius: 4px; }
.msg.me { align-self: flex-end; align-items: flex-end; }
.msg.me .bubble { background: var(--blue); color: #fff; border-top-right-radius: 4px; }
.msg time { font-size: 10.5px; color: #8a97a9; display: flex; gap: 4px; align-items: center; }
.msg.system { align-self: center; max-width: 92%; }
.msg.system .bubble { background: #fff; border: 1px dashed #c9d7ea; color: var(--ink-2); font-size: 12.5px; text-align: center; border-radius: 10px; }
.file-chip { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink) !important; text-decoration: none !important; font-size: 12.5px; min-width: 200px; }
.file-chip .i { color: var(--red); }
.file-chip .dl { margin-left: auto; color: var(--blue); }
.file-chip small { display: block; color: var(--muted); font-size: 11px; }
.msg .thumb { border-radius: 10px; max-width: 220px; max-height: 220px; border: 1px solid var(--line); }
.chat-foot { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line-2); background: #fff; border-radius: 0 0 var(--radius) var(--radius); }
.chat-foot .input-wrap { flex: 1; display: flex; align-items: center; border: 1px solid var(--line); border-radius: 99px; padding: 0 6px 0 14px; height: 40px; }
.chat-foot .input-wrap:focus-within { border-color: var(--blue); }
.chat-foot input[type='text'] { flex: 1; border: 0; outline: none; background: transparent; min-width: 0; font-size: 13px; }
.send-btn { width: 40px; height: 40px; border-radius: 10px; border: 0; background: var(--blue); color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; }
.send-btn:hover { background: var(--blue-600); }
.send-btn[disabled] { opacity: 0.5; }
.chat-warn { font-size: 11.5px; color: #8a5a00; background: var(--amber-50); padding: 6px 12px; }
.rail .chat-card .chat-body { height: 300px; flex: none; }
.chat-preview-tag { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--blue-600); background: var(--blue-50); padding: 3px 8px; border-radius: 99px; }

/* messages page */
.inbox { display: grid; grid-template-columns: 300px minmax(0, 1fr); height: calc(100vh - var(--top) - 48px); min-height: 460px; overflow: hidden; }
.inbox-list { border-right: 1px solid var(--line-2); overflow-y: auto; }
.inbox-item { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); color: var(--ink); text-decoration: none !important; align-items: center; }
.inbox-item:hover { background: #f7faff; }
.inbox-item.active { background: var(--blue-50); }
.inbox-item .txt { min-width: 0; flex: 1; }
.inbox-item b { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; color: var(--navy); }
.inbox-item b time { font-weight: 500; font-size: 11px; color: var(--muted); flex: none; }
.inbox-item p { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-item.unread p { color: var(--ink); font-weight: 600; }
.inbox .chat { height: 100%; }
.inbox .chat-body { min-height: 0; }

/* ---------- tabs, tables ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; font-size: 13.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none !important; display: inline-flex; gap: 8px; align-items: center; }
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--blue-600); border-bottom-color: var(--blue); }
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.stat { padding: 16px; }
.stat b { display: block; font-size: 24px; font-weight: 800; color: var(--navy); letter-spacing: -0.02em; }
.stat span { font-size: 12.5px; color: var(--muted); }

/* ---------- checklist, timeline ---------- */
.checklist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.checklist li { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line-2); }
.checklist li:last-child { border-bottom: 0; }
.checklist .dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; background: #eef1f5; color: #9aa7b8; }
.checklist li.done .dot { background: var(--green-50); color: var(--green); }
.checklist li .txt { flex: 1; min-width: 0; }
.checklist li .txt b { display: block; font-size: 13.5px; }
.checklist li .txt span { font-size: 12px; color: var(--muted); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 6px; }
.timeline li { position: relative; padding: 0 0 18px 24px; border-left: 2px solid var(--line); }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before { content: ''; position: absolute; left: -7px; top: 1px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--blue); }
.timeline li b { display: block; font-size: 13.5px; }
.timeline li span { font-size: 12px; color: var(--muted); }
.progress { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 10px; }
.progress div { height: 6px; border-radius: 99px; background: #e7ecf3; }
.progress div.on { background: var(--blue); }
.progress-labels { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 6px; font-size: 11px; color: var(--muted); }

/* ---------- profile page ---------- */
.profile-hero { display: flex; gap: 20px; align-items: center; }
.profile-hero .logo-box { width: 96px; height: 96px; border-radius: 16px; }
.profile-hero h1 { font-size: 24px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }
.trip-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.trip-row:last-child { border-bottom: 0; }
.review { padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.review:last-child { border-bottom: 0; }
.rating-input { display: flex; gap: 4px; }
.rating-input button { border: 0; background: none; cursor: pointer; padding: 2px; color: #cfd8e3; }
.rating-input button.on { color: var(--amber); }
.rating-input button .i { width: 28px; height: 28px; fill: currentColor; stroke: currentColor; }

/* ---------- content pages ---------- */
.prose { max-width: 760px; }
.prose h2 { font-size: 19px; margin: 26px 0 10px; }
.prose p { color: var(--ink-2); margin-bottom: 10px; line-height: 1.6; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.step { padding: 18px; }
.step .n { width: 32px; height: 32px; border-radius: 50%; background: var(--blue-50); color: var(--blue-600); display: grid; place-items: center; font-weight: 800; margin-bottom: 10px; }
.step h3 { font-size: 14.5px; margin-bottom: 6px; }
.step p { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
details.faq { border-bottom: 1px solid var(--line-2); }
details.faq summary { cursor: pointer; padding: 16px 4px; font-weight: 600; color: var(--navy); list-style: none; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary .i { transition: transform 0.2s; color: var(--muted); }
details.faq[open] summary .i { transform: rotate(180deg); }
details.faq p { padding: 0 4px 16px; color: var(--ink-2); line-height: 1.6; }

/* ---------- auth ---------- */
.auth-wrap { display: grid; place-items: start center; padding: 40px 18px; }
.auth-card { width: 100%; max-width: 440px; padding: 28px; }
.auth-card h1 { font-size: 22px; margin-bottom: 6px; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice label { border: 1px solid var(--line); border-radius: 10px; padding: 12px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.choice label b { font-size: 13.5px; display: flex; align-items: center; gap: 8px; color: var(--navy); }
.choice label span { font-size: 11.5px; color: var(--muted); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label:has(input:checked) { border-color: var(--blue); background: var(--blue-50); box-shadow: 0 0 0 1px var(--blue); }
.form-error { background: var(--red-50); color: var(--red); padding: 10px 12px; border-radius: 8px; font-size: 13px; }

/* ---------- modal, toast ---------- */
.modal-back { position: fixed; inset: 0; z-index: 80; background: rgba(11, 31, 61, 0.45); display: grid; place-items: center; padding: 18px; animation: fade 0.15s ease; }
.modal { width: 100%; max-width: 560px; max-height: calc(100vh - 36px); overflow-y: auto; background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line-2); position: sticky; top: 0; background: #fff; z-index: 1; }
.modal-head h2 { font-size: 17px; }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line-2); position: sticky; bottom: 0; background: #fff; }
.toasts { position: fixed; z-index: 90; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--navy); color: #fff; padding: 11px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: 13.5px; animation: up 0.2s ease; max-width: 90vw; }
.toast.error { background: #b4232a; }
.toast.ok { background: #0f7a43; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { opacity: 0; transform: translateY(8px); } }
.skeleton { background: linear-gradient(90deg, #eef2f7 0%, #f7f9fc 50%, #eef2f7 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius); height: 92px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.spinner { width: 18px; height: 18px; border: 2px solid rgba(255, 255, 255, 0.4); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- responsive ---------- */
@media (max-width: 1240px) {
  .shell { grid-template-columns: var(--sidebar) minmax(0, 1fr); }
  .rail { grid-column: 2; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); padding: 0 18px 32px; }
  .topnav a { padding: 8px 9px; }
}
@media (max-width: 1080px) {
  .agent-card { grid-template-columns: 64px minmax(0, 1fr) auto 30px; }
  .agent-card .agent-meta { grid-column: 2 / 4; flex-direction: row; justify-content: space-between; align-items: center; }
  .agent-card .agent-actions { grid-column: 3; grid-row: 1; }
  .agent-card .fav-btn { grid-column: 4; grid-row: 1; }
  .logo-box { width: 64px; height: 56px; }
  .search-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search-grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .trust { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  :root { --top: 60px; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .topbar { padding: 0 12px; gap: 10px; }
  .topbar .menu-btn { display: inline-grid; border: 0; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-text b { font-size: 18px; }
  .brand-text small { display: none; }
  .topnav { display: none; position: absolute; top: var(--top); left: 0; right: 0; background: #fff; flex-direction: column; padding: 8px 12px 14px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .topnav.open { display: flex; }
  .top-actions { margin-left: auto; gap: 6px; }
  .top-actions .btn { height: 34px; padding: 0 12px; font-size: 12.5px; }
  .top-actions .hide-m { display: none; }
  .shell, .shell.no-rail { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .rail { grid-column: 1; padding: 0 12px 24px; grid-template-columns: minmax(0, 1fr); }
  .main > .page { padding: 16px 12px; }
  .section, .search-card, .list, .results-head, .notice, .trust, .pager { margin-left: 12px; margin-right: 12px; }
  .hero { min-height: 0; padding: 22px 18px 18px; background-image: url('/img/hero-m.jpg'); background-position: 70% 50%; }
  .hero::before { background: linear-gradient(90deg, rgba(8, 26, 54, 0.9) 0%, rgba(8, 26, 54, 0.6) 70%, rgba(8, 26, 54, 0.35) 100%); }
  .hero h1 { font-size: 26px; max-width: 320px; }
  .hero p { font-size: 13.5px; max-width: 320px; }
  .hero-feats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
  .hero-feat { font-size: 12px; }
  .hero-feat span.ic { width: 30px; height: 30px; }
  .search-grid, .search-grid-2 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .search-grid-2 .radios { grid-column: 1 / -1; height: auto; }
  .search-grid-2 .btn { grid-column: 1 / -1; }
  .agent-card { grid-template-columns: 56px minmax(0, 1fr) 30px; gap: 12px; padding: 12px; }
  .logo-box { width: 56px; height: 52px; }
  .agent-card .agent-meta { grid-column: 1 / -1; align-items: flex-start; flex-direction: column; gap: 8px; }
  .agent-card .agent-actions { grid-column: 1 / -1; grid-row: auto; flex-direction: row; }
  .agent-card .agent-actions .btn { flex: 1; }
  .agent-card .fav-btn { grid-column: 3; grid-row: 1; }
  .agent-facts { gap: 14px; flex-wrap: wrap; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .inbox { grid-template-columns: 1fr; height: calc(100vh - var(--top) - 96px); }
  .inbox.has-chat .inbox-list { display: none; }
  .inbox:not(.has-chat) .chat { display: none; }
  .trip-row { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .profile-hero { flex-direction: column; align-items: flex-start; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; z-index: 50; left: 0; right: 0; bottom: 0;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: var(--navy); border-top: 1px solid rgba(255, 255, 255, 0.08);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; color: rgba(255, 255, 255, 0.7); font-size: 10.5px; font-weight: 600; text-decoration: none !important; position: relative; padding: 4px 0; }
  .tabbar a.active { color: #fff; }
  .tabbar a .i { width: 22px; height: 22px; }
  .tabbar .badge { position: absolute; top: -2px; left: 50%; margin-left: 6px; min-width: 17px; height: 17px; font-size: 10px; }
  .toasts { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .modal-back { place-items: end center; padding: 0; }
  .modal { border-radius: 16px 16px 0 0; max-height: 92vh; }
}
@media (max-width: 420px) {
  .topbar { gap: 6px; padding: 0 8px; }
  .brand { gap: 7px; }
  .brand-mark { width: 28px; height: 28px; }
  .brand-text b { font-size: 15.5px; letter-spacing: -0.03em; }
  .lang-btn { padding: 5px 7px; }
  .search-grid, .search-grid-2 { grid-template-columns: 1fr; }
  .top-actions .btn.outline { display: none; }
  .choice { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
