:root {
  color-scheme: light;
  --brand: #149fc8;
  --brand-dark: #087da1;
  --brand-soft: #eefaff;
  --ink: #17212b;
  --muted: #687785;
  --line: #e7edf2;
  --soft: #f7f9fb;
  --white: #fff;
  --danger: #c24545;
  --success: #168264;
  --warning: #a3670e;
  --shadow: 0 12px 36px rgba(23, 33, 43, .06);
  --radius: 16px;
}

* { box-sizing: border-box; }

html { min-width: 320px; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--white);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }

:focus-visible {
  outline: 3px solid rgba(20, 159, 200, .28);
  outline-offset: 3px;
}

[hidden] { display: none !important; }

.shell { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(12px);
}

.header-row {
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 30px;
}

.brand {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  font-size: 19px;
  font-weight: 760;
  letter-spacing: -.02em;
}

.brand-logo {
  display: block;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  object-fit: contain;
}

.brand small { margin-left: 6px; color: var(--muted); font-size: 12px; font-weight: 600; }

.main-nav { display: flex; align-items: stretch; gap: 4px; align-self: stretch; }

.main-nav a {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 14px;
  color: #566574;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--brand-dark); }

.main-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -1px;
  height: 2px;
  background: var(--brand);
}

.session-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.user-balance { white-space: nowrap; color: var(--muted); font-size: 13px; }
.user-balance strong { margin-left: 5px; color: var(--ink); }

.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 720;
  font-size: 14px;
  transition: background .18s ease, border-color .18s ease, transform .18s ease, color .18s ease;
}

.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .5; }
.button-small { min-height: 38px; padding: 8px 15px; }
.button-full { width: 100%; }
.button-primary { color: var(--white); background: var(--brand); }
.button-primary:hover:not(:disabled) { background: var(--brand-dark); }
.button-secondary { color: var(--brand-dark); border-color: #b9e3ef; background: var(--brand-soft); }
.button-quiet { color: #536271; border-color: var(--line); background: var(--white); }
.button-danger { color: var(--danger); border-color: #f0cece; background: #fffafa; }

.stats-bar { border-bottom: 1px solid var(--line); background: var(--soft); }
.stats-row { min-height: 58px; display: grid; grid-template-columns: repeat(3, 1fr); }
.stats-row > div { display: flex; align-items: center; justify-content: center; gap: 9px; }
.stats-row > div + div { border-left: 1px solid var(--line); }
.stats-row span { font-size: 18px; font-weight: 760; font-variant-numeric: tabular-nums; }
.stats-row small { color: var(--muted); font-size: 12px; }

.page-main { min-height: calc(100vh - 184px); padding-top: 54px; padding-bottom: 72px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.page-heading h1, .page-heading h2 { margin: 3px 0 8px; font-size: clamp(28px, 4vw, 40px); letter-spacing: -.035em; line-height: 1.12; }
.page-heading h2 { font-size: 26px; }
.page-heading p:not(.eyebrow) { margin: 0; color: var(--muted); line-height: 1.65; }
.compact-heading { margin-top: 45px; margin-bottom: 16px; }

.eyebrow { margin: 0; color: var(--brand-dark); font-size: 11px; font-weight: 800; letter-spacing: .14em; }

.balance-pill {
  flex: none;
  border: 1px solid #c8e8f1;
  border-radius: 999px;
  padding: 10px 15px;
  color: var(--muted);
  background: var(--brand-soft);
  font-size: 13px;
}
.balance-pill strong { margin-left: 6px; color: var(--brand-dark); }

.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.section-panel { padding: 24px; margin-bottom: 18px; }
.section-title-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-title-row > div { display: flex; align-items: center; gap: 10px; }
.section-title-row h2 { margin: 0; font-size: 17px; }
.section-title-row p { margin: 0; color: var(--muted); font-size: 12px; }

.step-number {
  width: 25px;
  height: 25px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--brand-dark);
  background: var(--brand-soft);
  font-size: 12px;
  font-weight: 800;
}

.country-grid, .route-grid { display: grid; gap: 12px; }
.country-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.route-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.country-card, .route-card {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 16px;
  text-align: left;
  color: var(--ink);
  background: var(--white);
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.country-card:hover, .route-card:hover:not(:disabled) { border-color: #9ed8e9; }
.country-card.selected, .route-card.selected { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand); }
.country-card { display: flex; align-items: center; gap: 13px; }
.flag { width: 42px; height: 30px; display: inline-flex; flex: none; overflow: hidden; border: 1px solid rgba(22, 34, 43, .12); border-radius: 6px; background: var(--soft); box-shadow: 0 3px 8px rgba(26, 40, 48, .1); }
.flag-eng, .flag-esp { background-position: center; background-repeat: no-repeat; background-size: cover; }
.flag-eng { background-image: url("/assets/img/flag-gb.svg?v=11"); }
.flag-esp { background-image: url("/assets/img/flag-es.svg?v=11"); }
.country-card strong, .route-card strong { display: block; font-size: 15px; }
.country-card small, .route-card small { display: block; margin-top: 4px; color: var(--muted); }
.route-card { position: relative; min-height: 126px; }
.route-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.route-price { color: var(--brand-dark); font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stock-line { margin-top: 22px; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; }
.stock { display: inline-flex; align-items: center; gap: 6px; }
.stock::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.stock.low::before { background: var(--warning); }
.stock.unavailable::before { background: #aab3ba; }

.rental-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.rental-card { min-height: 280px; padding: 25px; }
.rental-card h2 { margin: 8px 0 24px; font-size: 18px; }
.card-kicker { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.rental-content { min-height: 138px; display: flex; flex-direction: column; justify-content: center; }
.large-placeholder { margin: 0; color: #a3afb9; font-size: clamp(24px, 5vw, 34px); font-weight: 760; letter-spacing: .06em; }
.muted { color: var(--muted); }
.rental-content .muted { margin: 9px 0 0; font-size: 13px; }
.phone-button, .code-button { border: 0; padding: 0; text-align: left; color: var(--ink); background: transparent; font-weight: 800; font-variant-numeric: tabular-nums; }
.phone-button { font-size: clamp(25px, 4vw, 36px); letter-spacing: .01em; }
.code-button { font-size: clamp(34px, 7vw, 54px); letter-spacing: .14em; color: var(--brand-dark); }
.copy-hint { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.rental-meta { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 6px 9px; color: #556371; background: var(--soft); font-size: 11px; font-weight: 700; }
.badge.waiting { color: var(--warning); background: #fff7e8; }
.badge.success { color: var(--success); background: #eaf8f3; }
.sms-message { margin: 16px 0 0; padding: 12px; border-radius: 10px; color: #536271; background: var(--soft); font-size: 12px; line-height: 1.55; word-break: break-word; }
.flash { animation: flash 1.1s ease; }
@keyframes flash { 0%, 100% { box-shadow: none; } 45% { box-shadow: 0 0 0 5px rgba(20, 159, 200, .16); } }

.rental-actions { margin-top: 18px; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.rental-actions strong { display: block; font-size: 14px; }
.rental-actions p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.action-buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }

.empty-state { padding: 30px; border: 1px dashed #dce4ea; border-radius: 12px; color: var(--muted); text-align: center; background: var(--soft); }
.empty-state.compact { grid-column: 1 / -1; padding: 24px; }

.balance-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 18px; }
.metric-card { padding: 22px; }
.metric-card small { display: block; margin-bottom: 13px; color: var(--muted); }
.metric-card strong { font-size: 29px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.metric-card.accent { border-color: #b9e3ef; background: var(--brand-soft); }
.metric-card.accent strong { color: var(--brand-dark); }

.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.content-card { padding: 26px; }
.content-card h2 { margin: 5px 0 8px; font-size: 21px; }
.content-card > .muted { margin: 0 0 22px; font-size: 13px; line-height: 1.6; }

.stack-form { display: grid; gap: 9px; }
.stack-form label, .inline-form label { color: #536271; font-size: 12px; font-weight: 720; }
input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #d9e1e7;
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--white);
}
input:focus { border-color: var(--brand); outline: 3px solid rgba(20, 159, 200, .12); }
.stack-form .button { margin-top: 8px; }

.profile-list { margin: 22px 0 0; }
.profile-list div { display: flex; justify-content: space-between; gap: 20px; padding: 14px 0; border-top: 1px solid var(--line); }
.profile-list dt { color: var(--muted); }
.profile-list dd { margin: 0; max-width: 70%; text-align: right; word-break: break-word; }

.faq-list { display: grid; gap: 10px; }
.faq-list details { padding: 0 20px; }
.faq-list summary { padding: 17px 0; cursor: pointer; font-weight: 700; }
.faq-list p { margin: -2px 0 18px; color: var(--muted); line-height: 1.7; }

.table-panel { margin-bottom: 18px; overflow: hidden; }
.table-heading { min-height: 68px; padding: 18px 22px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.table-heading h2 { margin: 0; font-size: 17px; }
.table-heading .eyebrow + h2 { margin-top: 5px; }
.table-heading > span { color: var(--muted); font-size: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: 14px 18px; border-bottom: 1px solid var(--line); text-align: left; font-size: 12px; vertical-align: middle; }
th { color: var(--muted); background: #fbfcfd; font-weight: 700; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
.table-empty { padding: 32px; color: var(--muted); text-align: center; }
.amount-positive { color: var(--success); font-weight: 750; }
.amount-negative { color: var(--danger); font-weight: 750; }

.site-footer { border-top: 1px solid var(--line); }
.footer-row { min-height: 58px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; }
.link-button { border: 0; padding: 0; color: var(--brand-dark); background: transparent; text-decoration: underline; text-underline-offset: 3px; }

.modal {
  width: min(440px, calc(100% - 28px));
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 25px;
  color: var(--ink);
  background: var(--white);
  box-shadow: 0 24px 80px rgba(23, 33, 43, .2);
}
.modal::backdrop { background: rgba(16, 27, 36, .38); backdrop-filter: blur(3px); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.modal-header h2 { margin: 5px 0 0; font-size: 24px; }
.icon-button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: var(--white); font-size: 22px; line-height: 1; }
.auth-tabs { margin: 22px 0 20px; display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.auth-tabs button { border: 0; border-bottom: 2px solid transparent; padding: 11px; color: var(--muted); background: transparent; font-weight: 720; }
.auth-tabs button[aria-selected="true"] { border-bottom-color: var(--brand); color: var(--brand-dark); }
.auth-form { gap: 8px; }
.legal-hint { margin: 18px 0 0; color: var(--muted); font-size: 11px; text-align: center; }
.disclaimer-modal { width: min(620px, calc(100% - 28px)); }
.legal-copy { margin: 22px 0; color: #536271; font-size: 13px; line-height: 1.75; }
.legal-copy p { margin: 0 0 12px; }

.toast { position: fixed; z-index: 100; left: 50%; bottom: 26px; transform: translateX(-50%); max-width: calc(100% - 30px); border-radius: 10px; padding: 11px 16px; color: var(--white); background: #263641; box-shadow: var(--shadow); font-size: 13px; }
.toast.error { background: #923d3d; }
.toast.success { background: #126d55; }

.admin-body { background: var(--soft); }
.admin-main { padding-top: 46px; padding-bottom: 70px; }
.admin-login { width: min(430px, 100%); margin: 7vh auto 0; padding: 30px; box-shadow: var(--shadow); }
.admin-login h1 { margin: 6px 0 8px; font-size: 27px; }
.admin-login .muted { margin: 0 0 24px; }
.admin-metrics { margin-bottom: 20px; }
.admin-section { margin-bottom: 20px; }
.inline-form { display: flex; align-items: flex-end; gap: 13px; }
.inline-form > div { flex: 1; min-width: 0; }
.inline-form label { display: block; margin-bottom: 7px; }
.upstream-form, .card-form { margin-top: 22px; }
.form-note { margin: 12px 0 0; color: var(--muted); font-size: 11px; }
.card-output { margin: 18px 0 0; border-radius: 10px; padding: 15px; overflow-x: auto; color: #24424d; background: var(--brand-soft); line-height: 1.65; }
.route-admin-table input { min-width: 110px; min-height: 36px; padding: 7px 9px; }
.route-admin-table input[type="number"] { min-width: 85px; width: 85px; }
.route-admin-table input[type="checkbox"] { min-width: 18px; width: 18px; min-height: 18px; }
.route-admin-table .button { min-height: 36px; padding: 7px 12px; }
.route-admin-table code { font-size: 11px; color: #435361; white-space: nowrap; }

@media (max-width: 840px) {
  .header-row { min-height: auto; padding: 14px 0 0; flex-wrap: wrap; gap: 12px; }
  .brand { order: 1; }
  .session-actions { order: 2; }
  .main-nav { order: 3; width: 100%; height: 48px; overflow-x: auto; }
  .main-nav a { padding: 0 12px; white-space: nowrap; }
  .main-nav a[aria-current="page"]::after { left: 12px; right: 12px; }
  .route-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-column { grid-template-columns: 1fr; }
  .inline-form { align-items: stretch; flex-direction: column; }
  .inline-form .button { width: 100%; }
}

@media (max-width: 620px) {
  .shell { width: min(100% - 24px, 1120px); }
  .site-header { position: static; }
  .session-actions .button-quiet, .session-actions .button-small { padding-left: 11px; padding-right: 11px; }
  .user-balance { display: none; }
  .stats-row { min-height: 52px; }
  .stats-row > div { flex-direction: column; gap: 1px; }
  .stats-row span { font-size: 16px; }
  .stats-row small { font-size: 10px; }
  .page-main { padding-top: 32px; padding-bottom: 52px; }
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 20px; }
  .page-heading h1 { font-size: 29px; }
  .balance-pill { align-self: stretch; text-align: center; }
  .section-panel { padding: 18px; }
  .section-title-row { align-items: flex-start; flex-direction: column; gap: 8px; }
  .country-grid, .route-grid, .rental-grid, .balance-grid { grid-template-columns: 1fr; }
  .country-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .country-card { align-items: flex-start; padding: 13px; }
  .flag { width: 38px; height: 27px; }
  .route-card { min-height: 116px; }
  .rental-card { min-height: 240px; padding: 20px; }
  .rental-actions { align-items: stretch; flex-direction: column; }
  .rental-actions .button, .action-buttons { width: 100%; }
  .action-buttons .button { flex: 1; padding-left: 10px; padding-right: 10px; }
  .metric-card { padding: 18px; }
  .metric-card strong { font-size: 25px; }
  .content-card { padding: 21px; }
  .footer-row { min-height: 64px; }
  .modal { padding: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Refined application workspace */
body {
  background-color: #f8f7f3;
  background-image:
    radial-gradient(circle at 10% 3%, rgba(255, 222, 203, .34), transparent 26rem),
    radial-gradient(circle at 93% 6%, rgba(194, 237, 230, .34), transparent 28rem),
    linear-gradient(rgba(34, 63, 75, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 63, 75, .035) 1px, transparent 1px);
  background-size: auto, auto, 40px 40px, 40px 40px;
}

.shell { width: min(1180px, calc(100% - 40px)); }
.site-header { border-bottom-color: rgba(219, 225, 224, .82); background: rgba(250, 249, 246, .83); backdrop-filter: blur(18px) saturate(1.2); }
.header-row { min-height: 74px; }
.brand-logo { box-shadow: 0 8px 20px rgba(20, 159, 200, .16); }
.main-nav { align-self: center; height: 44px; border: 1px solid rgba(218, 225, 226, .9); border-radius: 14px; padding: 4px; background: rgba(255, 255, 255, .68); }
.main-nav a { border-radius: 10px; padding: 0 16px; }
.main-nav a[aria-current="page"] { color: #126f8b; background: #fff; box-shadow: 0 4px 16px rgba(34, 55, 67, .08); }
.main-nav a[aria-current="page"]::after { display: none; }
.button { border-radius: 12px; box-shadow: 0 6px 16px rgba(33, 53, 64, .04); }
.button-primary { background: linear-gradient(135deg, #13a7ce, #087f9f); box-shadow: 0 10px 22px rgba(20, 159, 200, .2); }
.button-primary:hover:not(:disabled) { background: linear-gradient(135deg, #0f97bc, #076f8d); box-shadow: 0 13px 28px rgba(20, 159, 200, .26); }

.stats-bar { border: 0; padding: 18px 0 0; background: transparent; }
.stats-row { min-height: auto; gap: 12px; }
.stats-row > div { min-height: 64px; border: 1px solid rgba(219, 224, 222, .92); border-radius: 16px; background: rgba(255, 253, 249, .76); box-shadow: 0 10px 32px rgba(44, 54, 59, .045); backdrop-filter: blur(10px); }
.stats-row > div + div { border-left: 1px solid rgba(219, 224, 222, .92); }
.stats-row em { border-radius: 999px; padding: 4px 7px; color: #8d6446; background: #fff3e9; font-size: 8px; font-style: normal; font-weight: 850; letter-spacing: .08em; }
.stats-row > div:nth-child(1) em { color: #5b68a4; background: #eff1ff; }
.stats-row > div:nth-child(3) em { color: #8a6517; background: #fff6d9; }
.stats-row span { font-size: 22px; letter-spacing: -.03em; }
.service-note { min-height: 42px; margin-top: 12px; display: flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid rgba(221, 225, 220, .88); border-radius: 14px; color: #69736f; background: rgba(255, 253, 249, .66); font-size: 11px; backdrop-filter: blur(10px); }
.service-note strong { color: #405059; }
.live-dot { width: 8px; height: 8px; display: inline-block; flex: none; border-radius: 50%; background: #40bc94; box-shadow: 0 0 0 4px rgba(64, 188, 148, .12); }
.live-dot.mini { width: 6px; height: 6px; box-shadow: 0 0 0 3px rgba(64, 188, 148, .1); }

.page-main { min-height: calc(100vh - 252px); padding-top: 14px; padding-bottom: 64px; }
.app-canvas { position: relative; overflow: hidden; border: 1px solid rgba(255, 255, 255, .88); border-radius: 27px; padding: 32px 22px 22px; background: rgba(250, 247, 241, .76); box-shadow: 0 28px 80px rgba(36, 46, 50, .11), inset 0 1px 0 #fff; backdrop-filter: blur(19px) saturate(1.08); }
.app-canvas::before { content: ""; position: absolute; z-index: -1; inset: auto -8rem -10rem auto; width: 25rem; height: 25rem; border-radius: 50%; background: radial-gradient(circle, rgba(190, 217, 241, .68), transparent 64%); pointer-events: none; }
.app-canvas::after { content: ""; position: absolute; z-index: -1; inset: 38% auto auto -10rem; width: 23rem; height: 23rem; border-radius: 50%; background: radial-gradient(circle, rgba(229, 241, 213, .44), transparent 66%); pointer-events: none; }
.workspace-heading { padding: 0 8px; }
.workspace-heading h1 { font-size: clamp(27px, 3.5vw, 39px); }
.eyebrow-dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: #f19c7a; box-shadow: 0 0 0 4px rgba(241, 156, 122, .13); }
.selection-board { display: grid; grid-template-columns: minmax(255px, .72fr) minmax(0, 1.28fr); gap: 12px; margin-bottom: 12px; }
.selection-board .section-panel { height: 100%; margin: 0; }
.section-panel, .rental-card, .rental-actions, .secondary-canvas .panel { border-color: rgba(218, 221, 216, .9); background: rgba(255, 253, 249, .72); box-shadow: 0 9px 30px rgba(52, 57, 56, .035), inset 0 1px 0 rgba(255, 255, 255, .92); backdrop-filter: blur(9px); }
.section-panel { padding: 18px; }
.section-label { display: block; margin-bottom: 3px; color: #75808a; font-family: Georgia, serif; font-size: 9px; font-weight: 700; letter-spacing: .16em; }
.step-number { color: #0c849f; background: rgba(221, 248, 250, .85); }
.country-grid { grid-template-columns: 1fr; max-height: 205px; overflow-y: auto; overscroll-behavior: contain; padding: 4px 7px 4px 2px; scrollbar-gutter: stable; }
.country-card, .route-card { border-color: rgba(222, 224, 220, .94); background: rgba(255, 255, 255, .67); box-shadow: 0 5px 18px rgba(50, 58, 61, .03); }
.country-card:hover, .route-card:hover:not(:disabled) { transform: translateY(-1px); border-color: rgba(20, 159, 200, .58); box-shadow: 0 12px 24px rgba(20, 89, 105, .08); }
.country-card.selected, .route-card.selected { border-color: rgba(20, 159, 200, .82); background: linear-gradient(145deg, rgba(239, 252, 255, .96), rgba(255, 255, 255, .82)); box-shadow: 0 0 0 1px rgba(20, 159, 200, .16), 0 12px 24px rgba(20, 89, 105, .08); }
.route-card { min-height: 119px; }
.route-grid { grid-auto-flow: column; grid-auto-columns: minmax(210px, 1fr); grid-template-columns: none; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; padding: 4px 3px 10px 2px; }
.selector-card-shell { position: relative; min-width: 0; scroll-snap-align: start; }
.selector-card-shell > .country-card, .selector-card-shell > .route-card { height: 100%; }
.country-card-shell .country-card { padding-right: 46px; }
.route-card-shell .route-card { padding-left: 44px; }
.favorite-toggle { position: absolute; z-index: 2; top: 10px; right: 10px; width: 28px; height: 28px; border: 1px solid rgba(221, 216, 204, .95); border-radius: 9px; padding: 0; color: #9c968b; background: rgba(255, 253, 249, .92); box-shadow: 0 4px 12px rgba(56, 55, 48, .08); font-size: 17px; line-height: 1; transition: color .18s ease, border-color .18s ease, transform .18s ease; }
.favorite-toggle:hover { transform: translateY(-1px); border-color: #e2bb5b; color: #b78516; }
.favorite-toggle.selected { border-color: rgba(226, 181, 72, .65); color: #b57909; background: #fff8e5; }
.route-card-shell .favorite-toggle { right: auto; left: 9px; }
.country-grid::-webkit-scrollbar { width: 7px; }
.route-grid::-webkit-scrollbar { height: 7px; }
.country-grid::-webkit-scrollbar-thumb, .route-grid::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(135, 151, 154, .35); }
.rental-grid { gap: 12px; }
.rental-card { position: relative; min-height: 256px; padding: 20px; }
.rental-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.rental-card-head h2 { margin: 5px 0 0; font-family: Georgia, "Songti SC", serif; font-size: 20px; font-weight: 520; }
.status-chip, .retention-chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid rgba(226, 222, 214, .9); border-radius: 999px; padding: 7px 10px; color: #767069; background: rgba(255, 252, 247, .82); font-size: 10px; font-weight: 720; white-space: nowrap; }
.rental-content { min-height: 175px; }
.number-content, #number-content { padding: 4px; }
.number-slot-list { width: 100%; max-height: 170px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; overflow-y: auto; overscroll-behavior: contain; padding: 2px 5px 2px 2px; }
.number-slot { min-width: 0; border: 1px solid rgba(219, 223, 220, .96); border-radius: 12px; padding: 10px 11px; text-align: left; color: var(--ink); background: rgba(255, 255, 255, .72); transition: border-color .18s ease, background .18s ease, box-shadow .18s ease; }
button.number-slot:hover { border-color: rgba(20, 159, 200, .55); }
.number-slot.selected { border-color: rgba(20, 159, 200, .9); background: linear-gradient(145deg, rgba(235, 251, 255, .96), rgba(255, 255, 255, .86)); box-shadow: 0 0 0 1px rgba(20, 159, 200, .13), 0 7px 17px rgba(20, 89, 105, .07); }
.number-slot.received { background: linear-gradient(145deg, rgba(237, 251, 246, .94), rgba(255, 255, 255, .86)); }
.number-slot.pending { border-style: dashed; }
.number-slot-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.number-slot-top small { color: #7d8990; font-size: 9px; font-weight: 760; letter-spacing: .08em; text-transform: uppercase; }
.slot-status { display: inline-flex; align-items: center; gap: 4px; color: #6c7b82; font-size: 9px; font-weight: 720; }
.slot-status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--success); }
.slot-status.code_received::before { box-shadow: 0 0 0 3px rgba(44, 168, 126, .12); }
.slot-status.allocating::before { background: var(--warning); animation: purchasingPulse 1.15s ease-in-out infinite alternate; }
.number-slot-phone { display: block; overflow: hidden; margin-top: 7px; font-size: 15px; font-weight: 820; font-variant-numeric: tabular-nums; letter-spacing: .01em; text-overflow: ellipsis; white-space: nowrap; }
.number-slot-meta { display: block; overflow: hidden; margin-top: 4px; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.slot-hint { padding-left: 3px; }
.code-card #code-content { position: relative; min-height: 142px; margin-top: 14px; overflow: hidden; border: 1px solid #32302d; border-radius: 15px; padding: 20px; color: #f9f8f4; background-color: #1d1c1a; background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px); background-size: 22px 22px; box-shadow: inset 0 1px rgba(255,255,255,.07), 0 14px 25px rgba(29, 28, 26, .14); text-align: center; }
.code-card #code-content::before { content: "●  ●  ●"; position: absolute; left: 13px; top: 9px; color: #ed8b68; font-size: 8px; letter-spacing: 3px; }
.code-card #code-content .large-placeholder { color: #f3f0e9; font-size: clamp(21px, 4vw, 30px); }
.code-card #code-content .muted, .code-card .copy-hint { color: #9f9c95; }
.code-card .code-button { width: 100%; color: #e9faff; text-align: center; text-shadow: 0 0 20px rgba(95, 220, 242, .36); }
.code-card .rental-meta { justify-content: center; }
.code-card .badge { color: #b6d6dc; background: rgba(97, 178, 192, .13); }
.code-card .sms-message { color: #c8cbc8; background: rgba(255, 255, 255, .06); }
.purchasing-text { color: var(--brand-dark); animation: purchasingPulse 1.15s ease-in-out infinite alternate; }
@keyframes purchasingPulse { from { opacity: .5; } to { opacity: 1; } }
.rental-actions { margin-top: 12px; border-color: rgba(232, 218, 208, .9); background: linear-gradient(100deg, rgba(255, 246, 239, .88), rgba(242, 250, 242, .8), rgba(246, 247, 255, .82)); }
.secondary-canvas { padding-top: 38px; }
.secondary-canvas > .page-heading { padding: 0 8px; }
.balance-grid { gap: 12px; }
.metric-card { border-radius: 16px; background: rgba(255, 253, 249, .73); }
.metric-card.accent { border-color: rgba(172, 218, 226, .86); background: linear-gradient(145deg, rgba(234, 252, 255, .85), rgba(249, 253, 250, .75)); }
.redeem-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.redeem-actions .button { margin-top: 8px; text-decoration: none; }
.purchase-hint { margin: 3px 0 0; color: var(--muted); font-size: 11px; }

input, select { width: 100%; min-height: 44px; border: 1px solid #d9e1e2; border-radius: 11px; padding: 10px 12px; color: var(--ink); background: rgba(255, 255, 255, .84); }
select { padding-right: 30px; }
input:focus, select:focus { border-color: var(--brand); outline: 3px solid rgba(20, 159, 200, .12); }
.filter-bar { display: flex; align-items: flex-end; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: rgba(250, 251, 249, .72); }
.filter-bar label { min-width: 125px; color: #66737a; font-size: 11px; font-weight: 720; }
.filter-bar label input, .filter-bar label select { min-height: 38px; margin-top: 6px; padding-top: 7px; padding-bottom: 7px; font-size: 12px; }
.filter-bar .filter-grow { flex: 1; }
.compact-filter label { max-width: 210px; }
.filter-actions { display: flex; gap: 7px; margin-left: auto; }
.pagination { min-height: 58px; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border-top: 1px solid var(--line); }
.pagination:empty { display: none; }
.pagination-button { min-width: 36px; min-height: 34px; border: 1px solid var(--line); border-radius: 9px; padding: 6px 10px; color: #607078; background: rgba(255, 255, 255, .8); font-size: 11px; font-weight: 720; }
.pagination-button:hover:not(:disabled), .pagination-button[aria-current="page"] { border-color: rgba(20, 159, 200, .5); color: var(--brand-dark); background: var(--brand-soft); }
.pagination-button:disabled { cursor: not-allowed; opacity: .42; }
.status-badge { display: inline-flex; border-radius: 999px; padding: 5px 8px; color: #6a767b; background: #f1f3f3; font-size: 10px; font-weight: 780; }
.status-active, .status-code_received, .status-unused { color: #14775d; background: #e9f8f2; }
.status-disabled, .status-expired { color: #a04444; background: #fff0f0; }
.status-used, .status-released { color: #676e74; background: #f0f2f3; }
.status-waiting, .status-renting, .status-releasing { color: #976415; background: #fff6e5; }
.table-subline { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }

.admin-body { background-color: #f4f6f5; }
.admin-main { padding-top: 28px; }
.admin-login { overflow: hidden; border-color: rgba(218, 224, 222, .9); border-radius: 22px; background: rgba(255, 253, 249, .8); box-shadow: 0 28px 70px rgba(29, 46, 52, .12); backdrop-filter: blur(18px); }
.control-layout { display: grid; grid-template-columns: 224px minmax(0, 1fr); align-items: start; gap: 18px; }
.control-sidebar { position: sticky; top: 96px; overflow: hidden; border-color: rgba(215, 222, 220, .88); background: rgba(255, 253, 249, .78); box-shadow: 0 18px 45px rgba(35, 49, 53, .06); backdrop-filter: blur(16px); }
.control-sidebar-title { display: flex; align-items: center; gap: 12px; padding: 20px; border-bottom: 1px solid var(--line); }
.control-sidebar-title strong, .control-sidebar-title small { display: block; }
.control-sidebar-title strong { font-size: 14px; }
.control-sidebar-title small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.control-nav { display: grid; gap: 5px; padding: 11px; }
.control-nav a { display: flex; align-items: center; gap: 11px; border-radius: 11px; padding: 12px; color: #59686e; text-decoration: none; font-size: 12px; font-weight: 730; }
.control-nav a span { color: #a4adb0; font-size: 9px; letter-spacing: .1em; }
.control-nav a:hover { color: var(--brand-dark); background: rgba(239, 249, 249, .75); }
.control-nav a[aria-current="page"] { color: #0a718e; background: linear-gradient(135deg, #e7f8fb, #f0f8f4); box-shadow: inset 0 0 0 1px rgba(20, 159, 200, .12); }
.control-nav a[aria-current="page"] span { color: var(--brand); }
.control-private-note { margin: 4px 18px 18px; border-top: 1px solid var(--line); padding-top: 15px; color: #9aa5a8; font-size: 8px; line-height: 1.7; letter-spacing: .11em; }
.control-content { min-width: 0; }
.control-page { animation: controlIn .22s ease; }
@keyframes controlIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.control-page-heading { align-items: center; margin: 3px 0 20px; }
.control-page-heading h1 { font-size: clamp(26px, 3vw, 34px); }
.admin-metrics .metric-card span { display: block; margin-top: 11px; color: #a1aaad; font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.status-overview-card { display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.status-overview-card h2 { margin-bottom: 8px; }
.status-overview-card .muted { margin: 0; }
.status-orb { flex: none; display: flex; align-items: center; gap: 10px; border: 1px solid #dce9e5; border-radius: 15px; padding: 14px 16px; background: #f5fbf8; }
.status-orb strong { font-size: 12px; }
.admin-section { border-color: rgba(215, 222, 220, .88); background: rgba(255, 253, 249, .76); box-shadow: 0 14px 36px rgba(35, 49, 53, .045); backdrop-filter: blur(12px); }
.route-admin-table code { color: #435361; }
.table-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 132px; }
.card-batch-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid rgba(20, 159, 200, .15); border-top: 0; border-radius: 0 0 12px 12px; padding: 11px 14px; color: #607078; background: rgba(235, 250, 252, .72); font-size: 11px; }
.balance-modal { width: min(540px, calc(100% - 28px)); }
.balance-user-summary { margin: 20px 0; border: 1px solid rgba(215, 225, 226, .9); border-radius: 14px; padding: 16px; background: linear-gradient(135deg, rgba(238, 251, 253, .86), rgba(250, 250, 246, .8)); }
.balance-user-summary > strong, .balance-user-summary > span { display: block; }
.balance-user-summary > strong { font-size: 15px; }
.balance-user-summary > span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.balance-user-summary > div { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.balance-user-summary > div span { border-radius: 10px; padding: 9px; color: #778388; background: rgba(255, 255, 255, .66); font-size: 9px; }
.balance-user-summary > div b { display: block; margin-top: 4px; color: #31454f; font-size: 13px; }
.balance-adjust-form { gap: 8px; }
.balance-adjust-form label { margin-top: 3px; font-size: 12px; font-weight: 720; }
.balance-preview { margin: 8px 0 2px; border-radius: 10px; padding: 10px 12px; color: #547077; background: #f2f8f8; font-size: 11px; }
.balance-preview.invalid { color: #9a4040; background: #fff0f0; }

@media (max-width: 940px) {
  .selection-board { grid-template-columns: 1fr; }
  .country-grid { grid-template-columns: 1fr; }
  .control-layout { grid-template-columns: 1fr; }
  .control-sidebar { position: static; }
  .control-sidebar-title, .control-private-note { display: none; }
  .control-nav { grid-template-columns: repeat(5, minmax(max-content, 1fr)); overflow-x: auto; }
  .control-nav a { justify-content: center; white-space: nowrap; }
}

@media (max-width: 760px) {
  .filter-bar { align-items: stretch; flex-wrap: wrap; }
  .filter-bar label { flex: 1 1 145px; }
  .filter-actions { width: 100%; margin-left: 0; }
  .filter-actions .button { flex: 1; }
  .route-grid { grid-template-columns: none; }
  .control-page-heading { align-items: flex-start; }
}

@media (max-width: 620px) {
  .shell { width: min(100% - 20px, 1180px); }
  .stats-bar { padding-top: 10px; }
  .stats-row { gap: 6px; }
  .stats-row > div { min-height: 60px; flex-direction: column; gap: 2px; }
  .stats-row em { display: none; }
  .stats-row span { font-size: 18px; }
  .service-note { justify-content: flex-start; overflow-x: auto; padding: 0 12px; white-space: nowrap; }
  .service-note strong { display: none; }
  .page-main { padding-top: 10px; }
  .app-canvas { border-radius: 20px; padding: 24px 12px 12px; }
  .workspace-heading { padding: 0 5px; }
  .selection-board { gap: 9px; }
  .country-grid { grid-template-columns: 1fr; max-height: 190px; }
  .route-grid { grid-auto-columns: minmax(220px, 82vw); grid-template-columns: none; }
  .rental-grid { grid-template-columns: 1fr; }
  .number-slot-list { grid-template-columns: 1fr; }
  .rental-card { min-height: 235px; }
  .code-card #code-content { padding: 18px 10px; }
  .redeem-actions { grid-template-columns: 1fr; }
  .filter-bar { padding: 12px; }
  .filter-bar label { flex-basis: 100%; }
  .pagination { justify-content: flex-start; overflow-x: auto; }
  .control-nav { grid-template-columns: repeat(5, auto); justify-content: start; }
  .control-nav a span { display: none; }
  .status-overview-card { align-items: stretch; flex-direction: column; }
  .status-orb { justify-content: center; }
  .card-batch-actions { align-items: stretch; flex-direction: column; }
  .balance-user-summary > div { grid-template-columns: 1fr; }
}
