/* GiftCard design system — ported from prototype/backend-app/styles.css.
   Loaded after bootstrap.min.css: shared class names (.card/.btn/.table/.badge…)
   are deliberately overridden so existing pages pick up the prototype look. */

/* Multi-language overflow protection */
.metric .label, .nav-pills .nav-link, .side-nav a,
.step-card h6, .step-card p,
.notif-item .body h6, .notif-item .body p,
.faq-list summary, .faq-list p,
.trust-strip span, .trust-strip strong,
.form-label, .form-check-label, .alert,
.btn, .badge, .table td, .table th,
.landing-hero h1, .landing-hero .sub,
.download-hero h1, .download-hero p,
.sub-nav li { overflow-wrap: break-word; word-break: break-word; }

:root {
  --bg: #f5f7fb;
  --card: #fff;
  --ink: #101828;
  --muted: #667085;
  --line: #e4e7ec;
  --primary: var(--brand-color, #2563eb);
  --sidebar-bg: #0f172a;
  --sidebar-text: #98a2b3;
  --sidebar-active: #182230;
  --green: #16a34a;
  --warn: #f59e0b;
  --danger: #ef4444;
  --soft: #eff6ff;
  --shadow: 0 16px 40px rgba(16, 24, 40, .08);
  --radius: 18px;
}

/* Theme presets */
body.theme-sapphire { --bg: #f0f4ff; --soft: #eff6ff; }
body.theme-emerald  { --bg: #f0fdf4; --soft: #f0fdf4; }
body.theme-amber    { --bg: #fffbeb; --soft: #fffbeb; }
body.theme-violet   { --bg: #f5f3ff; --soft: #f5f3ff; }
body.theme-rose     { --bg: #fff1f2; --soft: #fff1f2; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
}

h1, h2, h3, h4 { color: var(--ink); font-weight: 800; }
a { text-decoration: none; }
.text-muted, .muted { color: var(--muted) !important; }

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card .card-header {
  background: transparent;
  border-bottom: 1px solid var(--line);
  font-weight: 800;
  font-size: 15px;
  padding: 14px 20px;
}
.card .card-body { padding: 18px 20px; }

/* Metric tiles (dashboard) */
.metric { position: relative; overflow: hidden; }
.metric .label { color: var(--muted); font-size: 13px; }
.metric .num { font-size: 28px; font-weight: 850; margin: 6px 0 2px; }
.metric .delta { font-size: 12px; color: var(--green); }
.metric:after {
  content: ""; position: absolute; right: -26px; top: -26px;
  width: 92px; height: 92px; border-radius: 50%; background: var(--soft);
}

/* Ad cards (prototype ad-card) */
.ad-card {
  display: flex; gap: 14px; align-items: center;
  border: 1px solid var(--line); border-radius: 16px;
  padding: 14px; margin-bottom: 12px; background: #fff;
}
.ad-logo {
  width: 52px; height: 52px; border-radius: 15px; flex: 0 0 52px;
  background: var(--soft); display: grid; place-items: center;
  font-weight: 900; color: var(--primary); font-size: 18px;
}
.ad-card h4 { margin: 0 0 5px; font-size: 15.5px; }
.ad-card .meta { color: var(--muted); font-size: 13px; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.section-head h3 { margin: 0; font-size: 16.5px; }
.section-head span { font-size: 12.5px; color: var(--muted); }
.page-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.notice {
  background: #fffbeb; border: 1px solid #fedf89; color: #92400e;
  border-radius: 14px; padding: 11px 14px; font-size: 13px;
}

/* ---------- Tenant landing ---------- */
.landing-hero {
  border-radius: 28px; padding: 44px 36px; color: #fff; margin-bottom: 20px;
  background:
    radial-gradient(circle at 85% 10%, rgba(255,255,255,.16), transparent 34%),
    linear-gradient(135deg, var(--brand-color), #0f172a);
}
.landing-hero h1 { color: #fff; font-size: 34px; margin: 0 0 10px; }
.landing-hero .sub { color: rgba(255,255,255,.85); max-width: 520px; line-height: 1.6; }
.calc-card {
  background: #fff; border-radius: 20px; padding: 20px;
  box-shadow: 0 24px 60px rgba(16,24,40,.28); color: var(--ink);
}
.calc-card .est {
  font-size: 30px; font-weight: 850; color: var(--green);
}
.brand-wall { display: flex; gap: 10px; flex-wrap: wrap; }
.brand-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 14px; font-weight: 700; font-size: 13.5px; color: var(--ink);
}
.brand-chip i {
  width: 26px; height: 26px; border-radius: 8px; font-style: normal;
  background: var(--soft); color: var(--primary); font-weight: 900;
  display: grid; place-items: center; font-size: 13px;
}
.why-card { text-align: center; padding: 20px 14px; }
.why-card .emoji { font-size: 30px; }
.why-card h4 { font-size: 15px; margin: 10px 0 6px; }
.why-card p { font-size: 12.5px; color: var(--muted); margin: 0; line-height: 1.5; }
.trust-strip {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
  margin-bottom: 20px;
}
.trust-strip .cell {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 14px; text-align: center;
}
.trust-strip strong { font-size: 21px; display: block; }
.trust-strip span { font-size: 12px; color: var(--muted); }
.support-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 999;
  display: flex; flex-direction: column; gap: 10px;
}
.support-fab a {
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center; font-size: 24px; color: #fff;
  box-shadow: 0 12px 28px rgba(16,24,40,.3); text-decoration: none;
}
.support-fab .tg { background: #229ed9; }
.support-fab .wa { background: #25d366; }
.faq-list details {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 13px 16px; margin-bottom: 10px;
}
.faq-list summary { font-weight: 700; cursor: pointer; font-size: 14.5px; }
.faq-list p { color: var(--muted); font-size: 13.5px; margin: 10px 0 0; }
@media (max-width: 700px) {
  .landing-hero { padding: 28px 20px; }
  .landing-hero h1 { font-size: 26px; }
  .trust-strip { grid-template-columns: 1fr; }
}

/* ---------- Buttons ---------- */
.btn {
  border-radius: 12px;
  font-weight: 700;
  padding: 9px 15px;
  border: none;
}
.btn-brand, .btn-primary {
  background: var(--primary); color: #fff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, .18);
}
.btn-brand:hover, .btn-primary:hover { filter: brightness(1.07); color: #fff; background: var(--primary); }
.btn-success { background: var(--green); box-shadow: 0 8px 20px rgba(22, 163, 74, .18); }
.btn-outline-secondary, .btn-outline-primary, .btn-outline-warning,
.btn-outline-danger, .btn-outline-success, .btn-outline-light {
  background: #fff; border: 1px solid var(--line); color: #344054; box-shadow: none;
}
.btn-outline-danger { color: var(--danger); }
.btn-outline-success { color: var(--green); }
.btn-outline-warning { color: #b54708; }
.btn-outline-primary { color: var(--primary); }
.btn-sm { padding: 6px 11px; border-radius: 10px; font-size: 13px; }

/* ---------- Tables ---------- */
.table { border-color: var(--line); }
.table th {
  color: var(--muted); font-weight: 700; background: #f9fafb;
  font-size: 12.5px; border-bottom: 1px solid var(--line);
}
.table td { font-size: 13.5px; border-bottom: 1px solid var(--line); padding: 12px 10px; vertical-align: middle; }
.table-hover tbody tr:hover { background: #f9fafb; }
.table-responsive {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px 14px;
}

/* ---------- Tags / badges ---------- */
.badge {
  border-radius: 999px; font-weight: 700; font-size: 12px; padding: 5px 10px;
}
.badge.bg-secondary { background: #f2f4f7 !important; color: #344054; }
.badge.bg-success { background: #ecfdf3 !important; color: #047857; }
.badge.bg-primary { background: #eff6ff !important; color: #1d4ed8; }
.badge.bg-danger { background: #fef3f2 !important; color: #b42318; }
.badge.bg-warning { background: #fffaeb !important; color: #b54708; }
.badge.bg-info { background: #eff8ff !important; color: #175cd3; }
.badge.bg-light { background: #f2f4f7 !important; color: #344054; }

/* ---------- Forms ---------- */
.form-label { font-size: 12.5px; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.form-control, .form-select {
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.form-text { font-size: 12px; }

/* ---------- Pills / tabs ---------- */
.nav-pills .nav-link {
  border-radius: 999px; background: #fff; border: 1px solid var(--line);
  color: #344054; font-size: 13px; padding: 8px 13px; margin: 0 3px 6px 0;
}
.nav-pills .nav-link.active { background: #0b1220; color: #fff; border-color: #0b1220; }

/* ---------- Alerts ---------- */
.alert { border-radius: 14px; border: 1px solid var(--line); font-size: 13.5px; }
.alert-success { background: #ecfdf3; border-color: #a6f4c5; color: #047857; }
.alert-danger { background: #fef3f2; border-color: #fecdca; color: #b42318; }
.alert-info { background: #eff8ff; border-color: #b2ddff; color: #175cd3; }
.alert-warning { background: #fffbeb; border-color: #fedf89; color: #92400e; }

/* ---------- Admin shell (agent / platform areas) ---------- */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 250px; background: var(--sidebar-bg, #0b1220); color: var(--sidebar-text, #d0d5dd);
  padding: 22px 14px; position: fixed; inset: 0 auto 0 0; overflow: auto; z-index: 100;
}
.admin-sidebar .brand { display: flex; align-items: center; gap: 12px; margin: 0 6px 24px; }
.admin-sidebar .logo {
  width: 40px; height: 40px; border-radius: 13px; flex: 0 0 40px;
  background: linear-gradient(135deg, var(--primary), #21c55d);
  display: grid; place-items: center; color: #fff; font-weight: 800;
  box-shadow: 0 10px 24px rgba(37, 99, 235, .35); overflow: hidden;
}
.admin-sidebar .logo img { width: 100%; height: 100%; object-fit: cover; }
.admin-sidebar .brand h1 { font-size: 15px; margin: 0; color: #fff; }
.admin-sidebar .brand p { font-size: 11.5px; margin: 2px 0 0; color: #98a2b3; }
.admin-sidebar .nav-section {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: #667085; margin: 18px 12px 8px;
}
.admin-sidebar a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 12px; color: #d0d5dd; margin: 3px 0; font-size: 14px;
}
.admin-sidebar a.active, .admin-sidebar a:hover { background: #182230; color: #fff; }
.admin-main { margin-left: 250px; width: calc(100% - 250px); min-height: 100vh; }
.admin-topbar {
  height: 64px; background: rgba(255, 255, 255, .86); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center;
  justify-content: space-between; padding: 0 26px; position: sticky; top: 0; z-index: 10;
}
.admin-content { padding: 24px; }

/* ---------- User-facing shell ---------- */
.user-topbar {
  background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 55%, #0f172a));
}

/* Ad cards on the user home */
.ad-rate { font-size: 26px; font-weight: 850; color: var(--green); }
.card.border-warning { border-color: #fedf89; }

/* Portal hero */
.hero {
  background: radial-gradient(circle at 0 0, #dbeafe, transparent 28%),
    linear-gradient(135deg, #0f172a, #1d4ed8);
  color: #fff; border-radius: 28px; padding: 40px 34px; margin-bottom: 8px;
}
.hero h1 { color: #fff; font-size: 34px; margin: 0 0 12px; }
.hero p { color: #dbeafe; max-width: 760px; line-height: 1.65; margin: 0 auto; }

/* ---------- Timeline (order detail) ---------- */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: ''; position: absolute; left: 9px; top: 4px; bottom: 4px;
  width: 2px; background: var(--line);
}
.timeline-item { position: relative; padding-bottom: 24px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item .dot {
  position: absolute; left: -24px; top: 4px;
  width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line);
  background: var(--card); display: grid; place-items: center; font-size: 10px;
}
.timeline-item.completed .dot { background: var(--green); border-color: var(--green); color: #fff; }
.timeline-item.active .dot { background: var(--primary); border-color: var(--primary); color: #fff; }
.timeline-item .time { font-size: 12px; color: var(--muted); }
.timeline-item .title { font-weight: 600; margin: 2px 0; }
.timeline-item .desc { font-size: 13px; color: var(--muted); }

/* ---------- Review panel (agent) ---------- */
.review-panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.review-panel h3, .review-panel h6 { font-size: 15px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.review-field { margin-bottom: 12px; }
.review-field label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 2px; }
.review-field .value { font-size: 16px; font-weight: 700; word-break: break-all; }

/* ---------- Filter bar ---------- */
.filter-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 16px 20px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); margin-bottom: 20px;
}

/* ---------- Step cards (user home) ---------- */
.step-card { text-align: center; padding: 28px 20px; border: 1px solid var(--line); border-radius: var(--radius); }
.step-card .num { width: 40px; height: 40px; border-radius: 50%; background: var(--soft); color: var(--primary); font-weight: 800; font-size: 16px; display: grid; place-items: center; margin: 0 auto 12px; }
.step-card h6 { font-size: 15px; font-weight: 700; margin: 0 0 4px; }
.step-card p { font-size: 13px; color: var(--muted); margin: 0; }

/* ---------- Notification list ---------- */
.notif-item { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: var(--soft); }
.notif-item .icon { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 16px; color: #fff; flex-shrink: 0; }
.notif-item .body { flex: 1; }
.notif-item .body h6 { font-size: 14px; font-weight: 600; margin: 0 0 2px; }
.notif-item .body p { font-size: 13px; color: var(--ink); margin: 0; line-height: 1.5; }
.notif-item .time { font-size: 12px; color: var(--muted); flex-shrink: 0; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex-shrink: 0; }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 0; list-style: none; padding: 0; margin: 0; }
.page-link { display: flex; align-items: center; justify-content: center; padding: 6px 12px; font-size: 13px; color: var(--ink); border: 1px solid var(--line); min-width: 32px; }
.page-link:hover { background: var(--line); }
.page-item.active .page-link { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-item.disabled .page-link { color: var(--muted); pointer-events: none; opacity: .5; }

/* ---------- Side nav (settings pages) ---------- */
.side-nav { width: 200px; flex-shrink: 0; }
.side-nav .nav-section {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: #667085; margin: 0 12px 8px;
}
.side-nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 12px; color: #344054; margin: 3px 0; font-size: 14px; text-decoration: none;
}
.side-nav a:hover { background: #f0f2f5; }
.side-nav a.active { background: #0b1220; color: #fff; font-weight: 600; }

/* ---------- App download & PWA page ---------- */
.download-hero { background: linear-gradient(135deg,#0b1220,#1a2744); color: #fff; padding: 60px 0; text-align: center; }
.download-hero h1 { font-size: 36px; font-weight: 800; color: #fff; margin-bottom: 12px; }
.download-hero p { color: #94a3b8; font-size: 16px; max-width: 500px; margin: 0 auto; }
.pwa-step { display: flex; gap: 14px; margin-bottom: 16px; }
.pwa-step .num { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0; margin-top: 2px; }
.pwa-step h6 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.pwa-step p { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.6; }

/* ---------- Currency rate matrix ---------- */
.rate-matrix { display: grid; gap: 0; }
.rate-matrix .header { display: grid; grid-template-columns: 80px repeat(5,1fr); gap: 0; padding: 12px 16px; font-size: 13px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); }
.rate-matrix .row { display: grid; grid-template-columns: 80px repeat(5,1fr); gap: 0; padding: 14px 16px; border-bottom: 1px solid var(--line); align-items: center; }
.rate-matrix .row.alt { background: #f8f9fd; }
.rate-matrix .row .ccy { font-weight: 700; }
.rate-matrix .row .val { text-align: right; }
.rate-matrix .row .val input { width: 100px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; text-align: right; font-weight: 600; }
.rate-matrix .row .val input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }

/* ---------- Site nav (tenant portal) ---------- */
.site-nav { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.site-nav .inner { max-width: 1200px; margin: 0 auto; padding: 0 24px; height: 64px; display: flex; align-items: center; justify-content: space-between; }
.site-nav .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; color: var(--ink); text-decoration: none; }
.site-nav .links { display: flex; gap: 24px; align-items: center; }
.site-nav .links a { font-size: 14px; font-weight: 500; color: var(--muted); text-decoration: none; }
.site-nav .links a:hover, .site-nav .links a.active { color: var(--primary); }

/* ---------- Rate listing ---------- */
.rate-row { display: flex; align-items: center; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.rate-row:last-child { border-bottom: none; }
.rate-row .icon { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 18px; flex-shrink: 0; }
.rate-row .info { flex: 1; }
.rate-row .info h4 { font-size: 15px; font-weight: 700; margin: 0 0 2px; }
.rate-row .info small { font-size: 13px; color: var(--muted); }
.rate-row .rate { font-size: 24px; font-weight: 800; color: var(--primary); min-width: 80px; text-align: right; }

/* ---------- Theme presets ---------- */
.theme-selector { display: flex; gap: 10px; flex-wrap: wrap; }
.theme-selector label { cursor: pointer; text-align: center; }
.theme-selector .swatch { display: inline-block; width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; }

/* ---------- Sub nav tabs ---------- */
.sub-nav { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin-bottom: 20px; padding: 0; list-style: none; }
.sub-nav li { padding: 10px 18px; font-size: 14px; font-weight: 500; color: var(--muted); cursor: pointer; }
.sub-nav li a { text-decoration: none; color: inherit; }
.sub-nav li.active a { color: var(--primary); font-weight: 700; border-bottom: 2px solid var(--primary); }

@media (max-width: 900px) {
  .admin-sidebar { position: relative; width: 100%; inset: auto; }
  .admin-layout { display: block; }
  .admin-main { margin-left: 0; width: 100%; }
  .admin-topbar { position: relative; }
}
