/* Travel company — design system */
:root {
  --gold: #d6a638;
  --gold-deep: #a77b20;
  --gold-soft: #f4e4bc;
  --sunset: #f59b38;
  --blue: #168bc4;
  --ocean: #075b86;
  --navy: #102a43;
  --navy-2: #173652;
  --ink: #252525;
  --muted: #5e6d7b;
  --line: rgba(16, 42, 67, 0.1);
  --sand: #fff8ea;
  --sand-2: #f6efe0;
  --white: #ffffff;
  --danger: #9d3b32;
  --ok: #1f7a4d;
  --warn: #9a6412;
  --shadow: 0 16px 40px rgba(16, 42, 67, 0.08);
  --shadow-sm: 0 8px 24px rgba(16, 42, 67, 0.06);
  --radius: 18px;
  --radius-sm: 12px;
  --font: "Poppins", "Segoe UI", sans-serif;
  --display: "Playfair Display", Georgia, serif;
  --ease: cubic-bezier(0.22, 0.8, 0.28, 1);
  --header: 76px;
  --sidebar: 268px;
  --app-bg: #f6f3ec;
  color-scheme: light;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-x: clip; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--sand);
  line-height: 1.6;
  font-size: 16px;
  min-height: 100vh;
}

img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, .display { font-family: var(--display); font-weight: 600; letter-spacing: -0.02em; }

::selection { background: var(--gold-soft); color: var(--navy); }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  background: white;
  color: var(--navy);
  padding: 10px 14px;
  border-radius: 10px;
  z-index: 100;
}
.skip-link:focus { top: 12px; }

.container { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.container-wide { width: min(1280px, calc(100% - 40px)); margin-inline: auto; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--gold-deep);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--gold);
}

.section { padding: 88px 0; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 32px;
}
.section-head h2 { font-size: clamp(32px, 4vw, 48px); color: var(--navy); line-height: 1.15; }
.lede { color: var(--muted); max-width: 46ch; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: transparent;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease), border-color 0.25s;
  white-space: nowrap;
}
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-gold {
  background: linear-gradient(120deg, #a77b20 0%, #d6a638 42%, #f0d488 50%, #d6a638 58%, #a77b20 100%);
  background-size: 220% 100%;
  color: #1c1404;
  box-shadow: 0 8px 20px rgba(167, 123, 32, 0.22);
}
.btn-gold.is-shimmer { animation: gold-shimmer 5.5s linear infinite; }
.btn-navy { background: var(--navy); color: white; }
.btn-line { border-color: rgba(16, 42, 67, 0.2); background: white; color: var(--navy); }
.btn-ghost { border-color: rgba(255, 255, 255, 0.45); color: white; background: transparent; }
.btn-ocean { background: var(--ocean); color: white; }
.btn:hover { transform: translateY(-2px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.brand { display: flex; align-items: center; gap: 10px; color: white; min-width: max-content; }
.brand-mark { width: 38px; height: 38px; flex: none; }
.brand strong { display: block; font-family: var(--display); font-size: 20px; font-weight: 600; line-height: 1; white-space: nowrap; }
.brand small { display: block; letter-spacing: 0.22em; font-size: 9px; text-transform: uppercase; color: var(--gold-soft); }
.brand.dark { color: var(--navy); }
.brand.dark small { color: var(--gold-deep); }
.sidebar .brand { min-width: 0; position: relative; z-index: 1; padding-bottom: 12px; }
.sidebar .brand::after {
  content: "";
  position: absolute;
  left: 48px;
  right: 8px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: white;
  display: grid;
  place-items: center;
  position: relative;
  color: var(--navy);
}
.icon-btn svg, .btn svg { width: 18px; height: 18px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--sand-2);
  color: var(--navy);
}
.badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.badge-pending { background: #fff4df; color: var(--warn); }
.badge-confirmed, .badge-paid, .badge-active { background: #e7f6ee; color: var(--ok); }
.badge-processing { background: #e7f3fa; color: var(--ocean); }
.badge-completed { background: #e8eef6; color: var(--navy); }
.badge-cancelled, .badge-inactive, .badge-refunded { background: #f8ecea; color: var(--danger); }
.badge-partial { background: #fff1e4; color: #b85a12; }
.badge-plain::before { display: none; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field span, .label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
input, select, textarea {
  width: 100%;
  border: 1px solid #e6dcc8;
  background: white;
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  border-color: #8ec4e2;
  box-shadow: 0 0 0 4px rgba(22, 139, 196, 0.12);
}
.field.has-error input,
.field.has-error select,
.field.has-error textarea { border-color: #d7a29c; }
.field-error { color: var(--danger); font-size: 12px; min-height: 0; }
.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
}
.check input { width: auto; margin-top: 3px; }

.card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(16, 42, 67, 0.05);
}
.pad { padding: 22px; }

.rating {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--gold-deep);
  font-weight: 600;
  font-size: 13px;
}
.rating::before { content: "★"; }

.price { font-family: var(--display); font-size: 28px; color: var(--navy); line-height: 1; }
.price small, .per { display: block; font-family: var(--font); font-size: 12px; color: var(--muted); font-weight: 500; margin-top: 4px; }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table td {
  padding: 14px;
  border-bottom: 1px solid rgba(16, 42, 67, 0.06);
  vertical-align: middle;
}
.data-table tr:hover td { background: #fffdf8; }
.data-table a.row-link { color: var(--ocean); font-weight: 600; }

.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 18px; }
.pager button {
  min-width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: white;
}
.pager button.is-active { background: var(--navy); color: white; border-color: var(--navy); }
.pager button:disabled { opacity: 0.4; }

.empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
}
.empty strong { display: block; color: var(--navy); font-size: 18px; margin-bottom: 6px; }

.toast-stack {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(360px, calc(100% - 40px));
}
.toast {
  background: white;
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 14px 16px;
  border-left: 4px solid var(--gold);
  animation: fade-up 0.35s var(--ease);
}
.toast strong { display: block; color: var(--navy); font-size: 14px; }
.toast p { color: var(--muted); font-size: 13px; }
.toast.success { border-left-color: var(--ok); }
.toast.warn { border-left-color: var(--sunset); }

.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(16, 42, 67, 0.58);
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
}
.modal {
  width: min(560px, 100%);
  background: white;
  border-radius: 22px;
  padding: 28px;
  box-shadow: var(--shadow);
  animation: scale-in 0.35s var(--ease);
}
.modal.wide { width: min(980px, 100%); }
.modal h3 { font-size: 30px; color: var(--navy); margin-bottom: 8px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.lightbox-img { width: 100%; border-radius: 16px; max-height: 72vh; object-fit: cover; }

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--navy);
  color: #f6e2ad;
  font-size: 12px;
  font-weight: 600;
  flex: none;
}
.avatar.lg { width: 72px; height: 72px; font-size: 22px; }

.stars { color: var(--gold-deep); letter-spacing: 2px; font-size: 14px; }

hr.faint { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

.tag {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--sand);
  color: var(--navy);
  font-size: 12px;
  font-weight: 500;
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.grid-2 { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 12px; align-items: center; }
.spread { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.muted { color: var(--muted); }
.navy { color: var(--navy); }
.right { text-align: right; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.hidden { display: none !important; }

.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tab-btn { border-radius: 999px; border: 1px solid var(--line); background: white; padding: 8px 14px; }
.tab-btn.is-active { background: var(--navy); color: white; border-color: var(--navy); }

/* App shell shared by member + admin — same navy, gold and sand as the public site */
.app {
  --app-bg: #fff8ea;
  background:
    radial-gradient(980px 460px at 110% -8%, rgba(214, 166, 56, 0.22), transparent 58%),
    radial-gradient(720px 420px at -12% 8%, rgba(22, 139, 196, 0.1), transparent 52%),
    var(--app-bg);
  min-height: 100vh;
}
.theme-member { --sidebar: 280px; }
.theme-admin { --sidebar: 288px; }

.app-shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background:
    linear-gradient(180deg, rgba(16, 42, 67, 0.94) 0%, rgba(16, 42, 67, 0.9) 48%, rgba(16, 42, 67, 0.62) 100%),
    url("../images/destinations/bangkok.jpg") center bottom/cover;
  color: white;
  padding: 22px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: auto;
  z-index: 30;
  box-shadow: 16px 0 40px rgba(16, 42, 67, 0.08);
}
.sidebar::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), #f4e4bc, var(--gold), transparent);
}
.side-nav { display: flex; flex-direction: column; gap: 4px; position: relative; z-index: 1; }
.side-label {
  margin: 16px 12px 6px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #f3d78a;
}
.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 14px;
  font-weight: 500;
}
.side-link svg { width: 18px; height: 18px; opacity: 0.85; }
.side-link:hover { background: rgba(255, 255, 255, 0.1); color: white; }
.side-link.is-active {
  background: linear-gradient(120deg, #a77b20 0%, #d6a638 42%, #f0d488 50%, #d6a638 58%, #a77b20 100%);
  background-size: 220% 100%;
  color: #1c1404;
  box-shadow: 0 8px 18px rgba(167, 123, 32, 0.35);
}
.side-foot {
  margin-top: auto;
  padding: 14px 12px 4px;
  border-top: 1px solid rgba(244, 228, 188, 0.28);
  position: relative;
  z-index: 1;
}
.side-foot a { color: #f4e4bc; font-size: 13px; letter-spacing: 0.02em; }
.side-foot a:hover { color: white; }

.app-body { min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 28px;
  background: rgba(255, 248, 234, 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(167, 123, 32, 0.16);
  box-shadow: 0 10px 30px rgba(16, 42, 67, 0.04);
}
.topbar::after {
  content: "";
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.search-mini { flex: 1; max-width: 460px; position: relative; }
.search-mini input {
  background: white;
  border-color: rgba(16, 42, 67, 0.08);
  border-radius: 999px;
  padding-left: 42px;
  box-shadow: 0 8px 22px rgba(16, 42, 67, 0.05);
}
.search-mini svg { position: absolute; left: 16px; top: 13px; width: 16px; height: 16px; color: var(--gold-deep); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.profile { position: relative; }
.profile-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(16, 42, 67, 0.08);
  background: white;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(16, 42, 67, 0.06);
}
.profile-btn small { display: block; color: var(--gold-deep); font-size: 11px; letter-spacing: 0.04em; }
.dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: white;
  min-width: 200px;
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 8px;
  display: none;
  z-index: 25;
}
.dropdown.is-open { display: block; animation: fade-up 0.25s var(--ease); }
.dropdown a, .dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
}
.dropdown a:hover, .dropdown button:hover { background: var(--sand); }
.note-dot {
  position: absolute;
  top: 8px; right: 8px;
  width: 8px; height: 8px;
  background: var(--sunset);
  border-radius: 50%;
}
.menu-toggle { display: none; }
.scrim {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(16, 42, 67, 0.45);
  z-index: 25;
}
.app-content { padding: 32px 36px 48px; animation: fade-up 0.55s var(--ease); }
.page-title { margin-bottom: 22px; }
.page-title h1 { font-size: clamp(36px, 4vw, 52px); color: var(--navy); line-height: 1.05; }
.app .page-title .lede { max-width: 62ch; }
.crumb {
  font-size: 12px;
  color: var(--gold-deep);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.crumb a { color: var(--ocean); }

.app .card,
.app .chart-card,
.app .doc,
.app .wish-card,
.app .notice,
.app .invoice-sheet,
.app .table-wrap.card {
  border-radius: 22px;
  box-shadow: 0 16px 40px rgba(16, 42, 67, 0.07);
  border-color: rgba(167, 123, 32, 0.12);
}
.app .data-table th {
  background: #fff8ea;
  color: var(--gold-deep);
  letter-spacing: 0.12em;
}
.app .data-table tr:hover td { background: #fffaf0; }
.app .icon-btn {
  background: white;
  border-color: rgba(167, 123, 32, 0.2);
  box-shadow: 0 8px 18px rgba(16, 42, 67, 0.05);
}

.stat {
  background:
    linear-gradient(180deg, #ffffff 0%, #fffaf0 100%);
  border-radius: 22px;
  padding: 20px 20px 18px 22px;
  box-shadow: 0 16px 36px rgba(16, 42, 67, 0.07);
  border: 1px solid rgba(167, 123, 32, 0.14);
  position: relative;
  overflow: hidden;
}
.stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 3px;
  border-radius: 99px;
  background: linear-gradient(180deg, var(--gold), var(--gold-deep));
}
.stat span { color: var(--muted); font-size: 13px; }
.stat strong {
  display: block;
  margin-top: 8px;
  font-family: var(--display);
  font-size: 32px;
  color: var(--navy);
  font-weight: 600;
}
.stat em { font-style: normal; color: var(--ok); font-size: 12px; font-weight: 600; }
.stat.accent {
  background:
    radial-gradient(circle at 100% 0%, rgba(214, 166, 56, 0.38), transparent 46%),
    linear-gradient(160deg, #173652, #102a43 58%);
  color: white;
  border-color: transparent;
}
.stat.accent::before { background: #f6e2ad; }
.stat.accent span, .stat.accent em { color: rgba(255,255,255,0.72); }
.stat.accent strong { color: #f6e2ad; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.filters .field { min-width: 160px; flex: 1; }
.filters input, .filters select { background: white; }

.timeline { display: flex; flex-direction: column; gap: 0; }
.t-item { display: grid; grid-template-columns: 16px 1fr; gap: 14px; }
.t-rail { display: flex; flex-direction: column; align-items: center; }
.t-rail i {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--gold); display: block; margin-top: 4px;
  box-shadow: 0 0 0 4px rgba(214, 166, 56, 0.2);
}
.t-rail b { width: 1px; flex: 1; background: rgba(16, 42, 67, 0.12); }
.t-item:last-child .t-rail b { display: none; }

.progress-track { height: 8px; background: #efe7d6; border-radius: 99px; overflow: hidden; }
.progress-track span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-deep), var(--gold)); }

.notice {
  background: #fff;
  border-radius: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(16, 42, 67, 0.06);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
}

.portal-home {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 48px 16px;
  background:
    linear-gradient(105deg, rgba(16, 42, 67, 0.82) 0%, rgba(16, 42, 67, 0.42) 58%, rgba(16, 42, 67, 0.2)),
    var(--hero, url("../images/banners/hero-bangkok.jpg")) center/cover;
  color: white;
}
.portal-card {
  width: min(1100px, calc(100% - 32px));
  background: rgba(255, 248, 234, 0.96);
  color: var(--ink);
  border-radius: 28px;
  padding: 36px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(244, 228, 188, 0.7);
}
@media (prefers-reduced-motion: reduce) {
  .app-content { animation: none; }
}
.portal-card .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.entry-card .btn { white-space: normal; }

@media print {
  .no-print { display: none !important; }
  body { background: white; }
  .invoice-sheet { box-shadow: none; }
}
