/* ─── Custom layer on top of Bootstrap 5 ───────────────────────────────────── */

:root {
  --green:       #22c55e;
  --green-dark:  #16a34a;
  --green-light: #dcfce7;
  --text:        #111827;
  --text-2:      #6b7280;
  --border:      #e5e7eb;
  --radius:      14px;
  --shadow:      0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.07);
}

/* ── Body gradient background ───────────────────────────────────────────────── */
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--text);
  min-height: 100vh;
  background-color: #e8e4d8;
  background-image:
    radial-gradient(ellipse at 0% 50%,   #c8dfc8 0%, transparent 55%),
    radial-gradient(ellipse at 100% 20%, #e8d0c8 0%, transparent 55%),
    radial-gradient(ellipse at 50% 100%, #d8e0c8 0%, transparent 60%);
  background-attachment: fixed;
}

/* ── Top accent bar ─────────────────────────────────────────────────────────── */
body::before {
  content: "";
  display: block;
  height: 3px;
  background: var(--text);
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1050;
}

/* ── Navbar ─────────────────────────────────────────────────────────────────── */
.navbar {
  background: rgba(255,255,255,.92) !important;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  margin-top: 3px;
}

.logo-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-weight: 700;
  font-size: .95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.navbar-brand { font-weight: 700; font-size: 1.05rem; letter-spacing: -.3px; }

/* ── Hero ───────────────────────────────────────────────────────────────────── */
.hero { padding: 48px 0 32px; }

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: .82rem;
  color: var(--text-2);
  background: rgba(255,255,255,.6);
  margin-bottom: 18px;
}
.badge-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }

.hero-title {
  font-size: clamp(1.9rem, 5vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -.5px;
  line-height: 1.15;
  margin-bottom: 12px;
}

.hero-sub { font-size: 1.05rem; color: var(--text-2); line-height: 1.6; }

/* ── Cards ──────────────────────────────────────────────────────────────────── */
.card {
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow) !important;
  border: 1px solid rgba(255,255,255,.8) !important;
}

.card-header {
  background: #fff !important;
  border-bottom: 1px solid var(--border) !important;
  border-radius: var(--radius) var(--radius) 0 0 !important;
  padding: 18px 24px !important;
}

.card-label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* ── Form controls ──────────────────────────────────────────────────────────── */
.form-control, .form-select {
  background: #fafafa !important;
  border-color: var(--border) !important;
  font-size: .95rem !important;
}
.form-control:focus, .form-select:focus {
  border-color: var(--green) !important;
  box-shadow: 0 0 0 3px rgba(34,197,94,.14) !important;
  background: #fff !important;
}
.form-label { font-size: .85rem; font-weight: 500; color: var(--text-2); }

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn-green {
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 24px;
  font-weight: 600;
  padding: 10px 22px;
  transition: opacity .15s, transform .1s;
}
.btn-green:hover { opacity: .88; color: #fff; }
.btn-green:active { transform: scale(.97); }

.btn-outline-muted {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: 24px;
  font-size: .9rem;
  padding: 8px 18px;
  transition: background .15s;
}
.btn-outline-muted:hover { background: var(--green-light); border-color: var(--green); color: var(--green-dark); }

.btn-add {
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  padding: 10px 18px;
  white-space: nowrap;
}
.btn-add:hover { opacity: .88; color: #fff; }

/* ── Item list ──────────────────────────────────────────────────────────────── */
.item-list-label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 10px;
}

.item-empty {
  padding: 20px;
  text-align: center;
  color: var(--text-2);
  font-size: .9rem;
  border: 1.5px dashed var(--border);
  border-radius: 8px;
}

.item-row {
  display: flex;
  align-items: center;
  padding: 11px 14px;
  border-radius: 8px;
  background: #f9fafb;
  border: 1px solid var(--border);
  margin-bottom: 8px;
  gap: 12px;
}
.item-cat  { font-size: .9rem; font-weight: 500; flex: 1; }
.item-amount { font-size: .9rem; color: var(--text-2); font-variant-numeric: tabular-nums; }
.item-remove { background: none; border: none; color: #d1d5db; font-size: 1.1rem; padding: 0 4px; transition: color .15s; }
.item-remove:hover { color: #ef4444; }

/* ── Verdict ────────────────────────────────────────────────────────────────── */
.verdict {
  border-radius: 10px;
  padding: 22px 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.verdict.free { background: #f0fdf4; border: 1px solid #bbf7d0; }
.verdict.due  { background: #fef2f2; border: 1px solid #fecaca; }
.verdict-icon { font-size: 2rem; line-height: 1; flex-shrink: 0; }
.verdict-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; }
.verdict.free .verdict-title { color: #15803d; }
.verdict.due  .verdict-title { color: #b91c1c; }
.verdict-duty { font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.verdict.free .verdict-duty { color: #15803d; }
.verdict.due  .verdict-duty { color: #b91c1c; }
.verdict-desc { font-size: .88rem; color: var(--text-2); margin-top: 2px; }

/* ── Stat boxes ─────────────────────────────────────────────────────────────── */
.stat-box {
  padding: 18px 20px;
  border-radius: 8px;
  background: #f9fafb;
  border: 1px solid var(--border);
}
.stat-label { font-size: .78rem; color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; font-weight: 500; margin-bottom: 6px; }
.stat-value { font-size: 1.45rem; font-weight: 700; letter-spacing: -.4px; font-variant-numeric: tabular-nums; }
.stat-sub   { font-size: .8rem; color: var(--text-2); margin-top: 4px; }

/* ── Breakdown table ────────────────────────────────────────────────────────── */
.breakdown { width: 100%; border-collapse: collapse; }
.breakdown th {
  text-align: left; font-size: .78rem; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-2); font-weight: 500;
  padding: 8px 12px; border-bottom: 1px solid var(--border);
}
.breakdown td { padding: 12px 12px; font-size: .9rem; border-bottom: 1px solid #f3f4f6; vertical-align: middle; }
.breakdown tr:last-child td { border-bottom: none; }
.rate-badge {
  display: inline-block; padding: 2px 8px;
  border-radius: 12px; font-size: .78rem; font-weight: 600;
  background: #f3f4f6; color: var(--text-2);
}
.duty-cell { font-weight: 600; color: #b91c1c; font-variant-numeric: tabular-nums; }
.duty-cell.zero { color: var(--green-dark); }

/* ── Notes & disclaimer ─────────────────────────────────────────────────────── */
.notes {
  background: #fffbeb; border: 1px solid #fde68a;
  border-radius: 8px; padding: 16px 20px;
}
.notes-title { font-size: .85rem; font-weight: 600; color: #92400e; margin-bottom: 10px; }
.notes ul { padding-left: 18px; }
.notes li { font-size: .85rem; color: #78350f; line-height: 1.6; margin-bottom: 4px; }

.disclaimer {
  font-size: .82rem; color: var(--text-2);
  padding: 14px 18px; background: #f9fafb;
  border-radius: 8px; border: 1px solid var(--border);
  line-height: 1.5;
}

.exrate-note { font-size: .78rem; color: var(--text-2); text-align: right; }

/* ── Traveler type buttons ───────────────────────────────────────────────────── */
.traveler-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer;
  font-size: .88rem; background: #fafafa;
  transition: border-color .15s, background .15s;
  user-select: none;
}
.traveler-btn:has(input:checked) {
  border-color: var(--green); background: var(--green-light); color: var(--green-dark);
}
.traveler-btn input { accent-color: var(--green); }

/* ── Items column header ─────────────────────────────────────────────────────── */
.col-label { font-size: .75rem; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .05em; }

/* ── Calc row ────────────────────────────────────────────────────────────────── */
.calc-row select, .calc-row input { font-size: .88rem !important; }
.btn-row-remove {
  background: none; border: none; color: #d1d5db; font-size: 1rem;
  padding: 0; width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px; transition: color .15s, background .15s;
}
.btn-row-remove:hover { color: #ef4444; background: #fee2e2; }
.btn-row-placeholder { display: inline-block; width: 28px; }

/* ── Add-row button + total ──────────────────────────────────────────────────── */
.btn-add-row {
  background: none; border: 1.5px dashed var(--border);
  color: var(--green-dark); font-size: .88rem; font-weight: 600;
  padding: 7px 16px; border-radius: var(--radius-sm);
  transition: border-color .15s, background .15s;
}
.btn-add-row:hover { border-color: var(--green); background: var(--green-light); }
.total-bar { font-size: .9rem; color: var(--text-2); }
.total-bar strong { color: var(--text); font-size: 1rem; }

/* ── Result placeholder ──────────────────────────────────────────────────────── */
.result-placeholder {
  border: 2px dashed var(--border) !important;
  background: transparent !important;
  box-shadow: none !important;
  min-height: 260px;
}

/* ── Estimated rates notice ──────────────────────────────────────────────────── */
.estimated-note {
  font-size: .82rem;
  color: #1e40af;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 10px 16px;
  line-height: 1.55;
}

/* ── Footer ─────────────────────────────────────────────────────────────────── */
.site-footer {
  text-align: center; padding: 32px 24px;
  font-size: .82rem; color: var(--text-2);
  border-top: 1px solid rgba(0,0,0,.06);
  margin-top: 32px;
}
