/* =========================================================
   R&E TRAVEL INTELLIGENCE PLATFORM — Shared Design System
   ========================================================= */

:root {
  /* Brand palette */
  --bg-page:        #f5efe3;
  --bg-paper:       #fbf7ec;
  --bg-paper-warm:  #f3ecd9;
  --bg-paper-tint:  #efe7d1;
  --bg-espresso:    #1f1611;
  --bg-espresso-2:  #2a1f18;
  --bg-briefing:    #1a120d;

  --ink-1:          #2a1f18;
  --ink-2:          #4a3b2e;
  --ink-3:          #6e5d4a;
  --ink-4:          #9c8a72;
  --ink-on-dark-1:  #f4e9d2;
  --ink-on-dark-2:  #c9b894;
  --ink-on-dark-3:  #8a7757;

  --gold:           #b8945f;
  --gold-2:         #c9954a;
  --gold-soft:      #e8d7a8;
  --gold-tint:      #f7eec9;

  --line:           #d9cfb8;
  --line-soft:      #e6dcc4;
  --line-strong:    #b8a988;

  --red:            #b3382c;
  --red-tint:       #f3dcd6;
  --amber:          #b67a0e;
  --amber-tint:     #f8e9c5;
  --green:          #2e6e3c;
  --green-tint:     #d8eadb;
  --blue:           #2a5b8a;
  --blue-tint:      #d8e6f1;
  --teal:           #2f7a72;
  --teal-tint:      #d4e9e5;

  /* Type */
  --font-serif:     'Cormorant Garamond', 'EB Garamond', Georgia, 'Times New Roman', serif;
  --font-sans:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono:      'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius-sm:      4px;
  --radius-md:      6px;
  --radius-lg:      10px;

  --shadow-sm:      0 1px 2px rgba(42,31,24,0.04);
  --shadow-md:      0 4px 14px rgba(42,31,24,0.07);
  --shadow-lg:      0 18px 48px rgba(42,31,24,0.18);
}

/* =========================================================
   Reset + base
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--bg-page);
  color: var(--ink-1);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* =========================================================
   Top navigation
   ========================================================= */
.topnav {
  background: var(--bg-espresso);
  color: var(--ink-on-dark-1);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 36px;
  border-bottom: 1px solid #000;
}
.topnav__brand {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.topnav__brand-mark {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-on-dark-1);
}
.topnav__brand-sub {
  font-size: 9px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-on-dark-3);
  margin-top: 4px;
}
.topnav__links {
  display: flex;
  gap: 28px;
  margin-left: auto;
  margin-right: auto;
}
.topnav__link {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-on-dark-2);
  padding: 4px 0;
  position: relative;
  transition: color 0.15s;
}
.topnav__link:hover { color: var(--ink-on-dark-1); }
.topnav__link.is-active {
  color: var(--ink-on-dark-1);
}
.topnav__link.is-active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -18px;
  height: 2px;
  background: var(--gold);
}
.topnav__right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.topnav__user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.topnav__avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--bg-espresso);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.05em;
}
.topnav__user-name { font-size: 12px; color: var(--ink-on-dark-1); }
.topnav__wf-tag {
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-on-dark-3);
  padding-left: 14px;
  border-left: 1px solid #3a2c20;
}

/* =========================================================
   Briefing / Live alerts strip
   ========================================================= */
.briefing {
  background: var(--bg-briefing);
  color: var(--ink-on-dark-2);
  font-size: 12px;
  padding: 11px 28px;
  border-bottom: 1px solid #000;
}
.briefing__greet { color: var(--ink-on-dark-1); font-weight: 500; }

.livealerts {
  background: var(--bg-briefing);
  color: var(--ink-on-dark-2);
  font-size: 11.5px;
  padding: 10px 28px;
  display: flex;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid #000;
  flex-wrap: wrap;
}
.livealerts__label {
  font-size: 9px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-on-dark-3);
}
.livealerts__dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.livealerts__dot--red    { background: #d75348; }
.livealerts__dot--amber  { background: #d4a13d; }
.livealerts__dot--green  { background: #4ea862; }
.livealerts__dot--blue   { background: #6a9ccc; }
.livealerts__dot--purple { background: #b07acb; }

/* =========================================================
   Attention strip (badges)
   ========================================================= */
.attention {
  background: var(--bg-paper-warm);
  border-bottom: 1px solid var(--line);
  padding: 12px 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.attention__label {
  font-size: 9px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-right: 6px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg-paper);
  border: 1px solid var(--line);
  color: var(--ink-1);
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 500;
  white-space: nowrap;
}
.badge:hover {
  border-color: var(--line-strong);
  background: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.badge--red    { border-color: #d8a59c; background: #f8e1dc; }
.badge--red:hover { border-color: var(--red); }
.badge--amber  { border-color: #d4b97e; background: #f5e6c1; }
.badge--amber:hover { border-color: var(--amber); }
.badge--green  { border-color: #9fc0a7; background: #dce9df; }
.badge--green:hover { border-color: var(--green); }
.badge--neutral { border-color: var(--line); background: var(--bg-paper); }
.badge__emoji { font-size: 13px; }

/* =========================================================
   Layout shells
   ========================================================= */
.shell { padding: 22px 28px 56px; }
.shell--detail { padding: 0; }

.grid-3 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
}
@media (max-width: 1280px) {
  .grid-3 { grid-template-columns: 1fr; }
}

.col-section { display: flex; flex-direction: column; gap: 18px; }
.col-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: -4px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ink-1);
}
.col-section__title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-1);
}
.col-section__sub {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-3);
}

/* =========================================================
   Card
   ========================================================= */
.card {
  background: var(--bg-paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line-soft);
}
.card__title {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink-1);
  letter-spacing: -0.01em;
}
.card__body { padding: 4px 0; }
.card__foot {
  padding: 10px 16px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink-3);
  background: var(--bg-paper-warm);
}
.card__foot a, .card__foot button {
  color: var(--blue);
  background: none;
  border: 0;
  padding: 0;
  text-decoration: underline;
  cursor: pointer;
  font-size: 12px;
}

/* Integration source badges */
.src {
  display: inline-flex;
  align-items: center;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 3px;
  border: 1px solid;
}
.src--sf    { color: var(--blue);  border-color: var(--blue);  background: var(--blue-tint); }
.src--axus  { color: var(--teal);  border-color: var(--teal);  background: var(--teal-tint); }
.src--asana { color: var(--red);   border-color: var(--red);   background: var(--red-tint); }
.src--ai    { color: var(--amber); border-color: var(--amber); background: var(--amber-tint); }
.src--plan  { color: var(--ink-3); border-color: var(--line-strong); background: var(--bg-paper-warm); }

/* =========================================================
   Trip list (numbered)
   ========================================================= */
.triplist { list-style: none; margin: 0; padding: 0; }
.triplist__item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background 0.12s;
}
.triplist__item:last-child { border-bottom: 0; }
.triplist__item:hover { background: var(--bg-paper-warm); }
.triplist__num {
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--ink-4);
  font-weight: 500;
  line-height: 1;
  padding-top: 2px;
}
.triplist__body { min-width: 0; }
.triplist__name {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-1);
  margin-bottom: 2px;
}
.triplist__meta {
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.5;
}
.triplist__meta-row { display: block; }
.triplist__chip {
  align-self: flex-start;
  margin-top: 2px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 4px 9px;
  border-radius: 3px;
  text-transform: uppercase;
}
.triplist__chip--dark   { background: var(--bg-espresso); color: var(--ink-on-dark-1); }
.triplist__chip--plan   { background: var(--bg-paper-warm); color: var(--ink-2); border: 1px solid var(--line); }
.triplist__chip--warn   { background: var(--amber-tint); color: var(--amber); }

.triplist__expand {
  grid-column: 1 / -1;
  padding: 12px 0 4px 40px;
  font-size: 12px;
  color: var(--ink-2);
  display: none;
  border-top: 1px dashed var(--line);
  margin-top: 12px;
}
.triplist__item.is-open .triplist__expand { display: block; }
.triplist__expand-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 18px;
  margin-top: 6px;
}
.triplist__expand-grid > div { font-size: 11.5px; }
.triplist__expand-grid b { font-weight: 600; color: var(--ink-1); }

/* =========================================================
   Itinerary list
   ========================================================= */
.itin { padding: 6px 16px 12px; }
.itin__row {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line-soft);
  font-size: 12px;
}
.itin__row:last-child { border-bottom: 0; }
.itin__date {
  font-family: var(--font-serif);
  font-size: 13px;
  color: var(--ink-3);
  font-style: italic;
}
.itin__text { color: var(--ink-1); }
.itin__text--ok { color: var(--green); }
.itin__text--warn { color: var(--amber); font-weight: 500; }

/* =========================================================
   Task list (checkbox)
   ========================================================= */
.tasks { padding: 4px 0; }
.tasks__item {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background 0.12s, opacity 0.3s;
}
.tasks__item:last-child { border-bottom: 0; }
.tasks__item:hover { background: var(--bg-paper-warm); }
.tasks__check {
  width: 16px; height: 16px;
  border: 1.5px solid var(--ink-4);
  border-radius: 3px;
  margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-paper);
  transition: all 0.15s;
}
.tasks__check svg { width: 12px; height: 12px; color: #fff; opacity: 0; transition: opacity 0.15s; }
.tasks__item.is-done .tasks__check { background: var(--green); border-color: var(--green); }
.tasks__item.is-done .tasks__check svg { opacity: 1; }
.tasks__item.is-done .tasks__title,
.tasks__item.is-done .tasks__meta {
  text-decoration: line-through;
  color: var(--ink-4);
}
.tasks__title { font-size: 13px; font-weight: 500; color: var(--ink-1); }
.tasks__meta { font-size: 11px; color: var(--ink-3); margin-top: 3px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tasks__due {
  font-weight: 600;
  color: var(--red);
}
.tasks__due--soon { color: var(--amber); }
.tasks__due--ok { color: var(--ink-3); font-weight: 500; }
.tasks__assignee {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  background: var(--bg-paper-warm);
  border: 1px solid var(--line);
  color: var(--ink-2);
  padding: 1px 6px;
  border-radius: 3px;
}
.tasks__pill {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--teal-tint);
  color: var(--teal);
  border: 1px solid var(--teal);
}

/* =========================================================
   Profile (key-value) table
   ========================================================= */
.kv { padding: 4px 0; }
.kv__row {
  display: grid;
  grid-template-columns: 122px 1fr;
  gap: 12px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12px;
}
.kv__row:last-child { border-bottom: 0; }
.kv__k {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.kv__v { color: var(--ink-1); }
.kv__v--alert { color: var(--red); font-weight: 500; }

/* =========================================================
   AI search widget (Knowledge Base)
   ========================================================= */
.ai {
  background: linear-gradient(180deg, #f7eec9 0%, #f3e3b1 100%);
  border: 1px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 14px 16px 16px;
}
.ai__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-2);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ai__row { display: flex; gap: 0; }
.ai__input {
  flex: 1;
  border: 1px solid var(--gold);
  background: #fffbed;
  padding: 9px 12px;
  font-size: 12.5px;
  color: var(--ink-1);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  border-right: 0;
  outline: none;
}
.ai__input:focus { border-color: var(--gold-2); background: #fff; }
.ai__ask {
  background: var(--bg-espresso);
  color: var(--ink-on-dark-1);
  border: 1px solid var(--bg-espresso);
  font-size: 12px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  letter-spacing: 0.04em;
  transition: background 0.15s;
}
.ai__ask:hover { background: #000; }
.ai__result {
  margin-top: 12px;
  padding: 12px 14px;
  background: rgba(255,251,237,0.7);
  border-left: 3px solid var(--gold-2);
  border-radius: 2px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-2);
  min-height: 30px;
}
.ai__result em { font-style: italic; color: var(--ink-2); }
.ai__result b { color: var(--ink-1); }
.ai__suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.ai__suggest {
  font-size: 11px;
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--gold);
  color: var(--ink-2);
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
}
.ai__suggest:hover { background: #fff; border-color: var(--gold-2); color: var(--ink-1); }

.ai__loading {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.ai__loading span {
  width: 6px; height: 6px;
  background: var(--gold-2);
  border-radius: 50%;
  animation: aiPulse 1.2s ease-in-out infinite;
}
.ai__loading span:nth-child(2) { animation-delay: 0.15s; }
.ai__loading span:nth-child(3) { animation-delay: 0.3s; }
@keyframes aiPulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1.1); }
}

/* =========================================================
   Quick actions grid
   ========================================================= */
.qa-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 14px 16px 4px;
}
.qa {
  background: var(--bg-paper);
  border: 1px solid var(--line);
  padding: 10px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  text-align: left;
  display: flex; align-items: center; gap: 8px;
  color: var(--ink-1);
  transition: all 0.15s;
}
.qa:hover {
  border-color: var(--ink-3);
  background: #fff;
  transform: translateY(-1px);
}
.qa svg { width: 14px; height: 14px; color: var(--ink-3); }
.qa-cta {
  margin: 4px 16px 14px;
  background: var(--bg-espresso);
  color: var(--ink-on-dark-1);
  border: 0;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  width: calc(100% - 32px);
  text-align: center;
  transition: all 0.15s;
}
.qa-cta:hover { background: #000; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.qa-cta__title { font-weight: 600; font-size: 13px; display: block; }
.qa-cta__sub { font-size: 10.5px; color: var(--ink-on-dark-3); margin-top: 3px; font-style: italic; }

/* =========================================================
   Commission tracker table
   ========================================================= */
.commish { padding: 4px 0 0; }
.commish__head {
  display: grid;
  grid-template-columns: 1.5fr 1fr 0.8fr;
  padding: 6px 16px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line);
}
.commish__head > div:last-child { text-align: right; }
.commish__row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 0.8fr;
  padding: 10px 16px;
  font-size: 12px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background 0.12s;
}
.commish__row:hover { background: var(--bg-paper-warm); }
.commish__row:last-child { border-bottom: 0; }
.commish__trip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-weight: 500;
}
.commish__status {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.commish__status--overdue  { color: var(--red); }
.commish__status--expected { color: var(--amber); }
.commish__status--received { color: var(--green); }
.commish__hotel { color: var(--ink-2); align-self: center; }
.commish__amount {
  font-weight: 700;
  text-align: right;
  font-family: var(--font-serif);
  font-size: 14px;
  align-self: center;
}
.commish__amount--overdue  { color: var(--red); }
.commish__amount--expected { color: var(--amber); }
.commish__amount--received { color: var(--green); }

/* =========================================================
   CLIENT DETAIL — Sidebar
   ========================================================= */
.app {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 280px;
  min-height: calc(100vh - 100px);
}
@media (max-width: 1300px) {
  .app { grid-template-columns: 220px 1fr 260px; }
}
@media (max-width: 1100px) {
  .app { grid-template-columns: 1fr; }
  .app__rail { display: none; }
}

.sidebar {
  background: var(--bg-paper-warm);
  border-right: 1px solid var(--line);
  padding: 16px 0 24px;
}
.sidebar__head {
  padding: 4px 18px 12px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.sidebar__title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-1);
}
.sidebar__count {
  font-size: 10px;
  color: var(--ink-4);
  letter-spacing: 0.16em;
}
.sidebar__search {
  margin: 0 14px 14px;
  position: relative;
}
.sidebar__search input {
  width: 100%;
  padding: 8px 10px 8px 30px;
  font-size: 12px;
  background: var(--bg-paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  color: var(--ink-1);
}
.sidebar__search input:focus { border-color: var(--ink-3); background: #fff; }
.sidebar__search svg {
  position: absolute;
  left: 9px; top: 50%;
  transform: translateY(-50%);
  width: 14px; height: 14px;
  color: var(--ink-4);
}
.sidebar__list { list-style: none; margin: 0; padding: 0; }
.clientcard {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  padding: 10px 18px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.15s;
}
.clientcard:hover { background: rgba(255,255,255,0.4); }
.clientcard.is-active {
  background: var(--bg-paper);
  border-left-color: var(--gold);
}
.clientcard__avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.06em;
}
.clientcard__name {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-1);
  display: flex; align-items: center; gap: 6px;
}
.clientcard__sub {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 1px;
}
.clientcard__status {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 2px;
}
.clientcard__status--vip      { background: var(--gold-tint); color: var(--amber); }
.clientcard__status--active   { background: var(--green-tint); color: var(--green); }
.clientcard__status--planning { background: var(--amber-tint); color: var(--amber); }

/* =========================================================
   CLIENT DETAIL — Main
   ========================================================= */
.main { padding: 22px 28px 56px; min-width: 0; }

.client-header { margin-bottom: 14px; }
.client-header__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 8px;
}
.client-header__name {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 600;
  color: var(--ink-1);
  letter-spacing: -0.01em;
}
.client-header__primary {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 3px;
}
.client-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-paper);
  color: var(--ink-1);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--ink-3); background: #fff; }
.btn svg { width: 13px; height: 13px; }
.btn--primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.btn--primary:hover { background: #1f4670; border-color: #1f4670; }
.btn--dark {
  background: var(--bg-espresso);
  border-color: var(--bg-espresso);
  color: var(--ink-on-dark-1);
}
.btn--dark:hover { background: #000; border-color: #000; }
.btn--gold {
  background: linear-gradient(180deg, #d4ad6c 0%, #b8945f 100%);
  border-color: var(--gold);
  color: #fff;
  font-weight: 600;
}
.btn--gold:hover { box-shadow: 0 2px 10px rgba(184,148,95,0.4); }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  padding: 5px 11px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--bg-paper);
  color: var(--ink-2);
}
.chip svg { width: 12px; height: 12px; color: var(--ink-3); }

.tabs {
  margin-top: 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 24px;
}
.tab {
  background: none;
  border: 0;
  padding: 10px 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color 0.15s;
}
.tab:hover { color: var(--ink-1); }
.tab.is-active {
  color: var(--ink-1);
  border-bottom-color: var(--ink-1);
  font-weight: 600;
}
.tab__count {
  background: var(--bg-paper-warm);
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  margin-left: 4px;
}

.tabpanel { display: none; padding-top: 18px; }
.tabpanel.is-active { display: block; }

.insight {
  background: var(--gold-tint);
  border: 1px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 18px;
}
.insight__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-2);
  margin-bottom: 6px;
  display: flex; align-items: center; gap: 6px;
}
.insight__body {
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.55;
}
.insight__body em { color: var(--ink-1); font-style: italic; }
.insight__actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}
.insight__btn {
  font-size: 11.5px;
  font-weight: 500;
  padding: 5px 11px;
  border: 1px solid var(--gold);
  background: rgba(255,255,255,0.5);
  color: var(--ink-1);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}
.insight__btn:hover { background: #fff; }

.cards2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 900px) {
  .cards2 { grid-template-columns: 1fr; }
}

.trip-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background 0.12s;
}
.trip-row:last-child { border-bottom: 0; }
.trip-row:hover { background: var(--bg-paper-warm); }
.trip-row__name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--blue);
}
.trip-row__name--past { color: var(--ink-3); }
.trip-row__sub { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.trip-row__status {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 3px;
}
.trip-row__status--upcoming { background: var(--green-tint); color: var(--green); }
.trip-row__status--planning { background: var(--amber-tint); color: var(--amber); }
.trip-row__status--past     { background: var(--bg-paper-warm); color: var(--ink-3); border: 1px solid var(--line); }

.prefs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 24px;
  padding: 14px 16px;
}
.prefs__k {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 3px;
}
.prefs__v { font-size: 12px; color: var(--ink-1); }
.prefs__v--alert { color: var(--red); font-weight: 500; }

.add-task {
  width: 100%;
  background: none;
  border: 1px dashed var(--line);
  border-top: 1px solid var(--line-soft);
  padding: 10px;
  font-size: 12px;
  color: var(--blue);
  text-align: center;
  cursor: pointer;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}
.add-task:hover { background: var(--bg-paper-warm); }

/* =========================================================
   CLIENT DETAIL — Right Rail
   ========================================================= */
.rail {
  background: var(--bg-paper-warm);
  border-left: 1px solid var(--line);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.rail__section {
  background: var(--bg-paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.rail__title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-1);
  padding: 12px 14px 8px;
  border-bottom: 1px solid var(--line-soft);
}
.rail__list { padding: 4px 0; }
.rail__item {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background 0.12s;
}
.rail__item:hover { background: var(--bg-paper-warm); }
.rail__item:last-child { border-bottom: 0; }
.rail__emoji { font-size: 14px; line-height: 1; }
.rail__name { font-size: 12px; font-weight: 600; color: var(--ink-1); margin-bottom: 1px; }
.rail__meta { font-size: 10.5px; color: var(--ink-3); line-height: 1.4; }

.rail__commish-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 11.5px;
}
.rail__commish-row:last-child { border-bottom: 0; }
.rail__commish-amt {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
  align-self: center;
}

.rail__check {
  padding: 4px 0;
}
.rail__check-item {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 8px;
  padding: 7px 14px;
  font-size: 11.5px;
  cursor: pointer;
  border-bottom: 1px dashed var(--line-soft);
}
.rail__check-item:last-child { border-bottom: 0; }
.rail__check-item input { margin: 0; }
.rail__check-item .ck {
  width: 14px; height: 14px;
  border: 1.5px solid var(--ink-4);
  border-radius: 3px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-paper);
  margin-top: 1px;
}
.rail__check-item .ck svg { width: 10px; height: 10px; color: #fff; opacity: 0; }
.rail__check-item.is-done .ck { background: var(--green); border-color: var(--green); }
.rail__check-item.is-done .ck svg { opacity: 1; }
.rail__check-item.is-done .rail__check-text { text-decoration: line-through; color: var(--ink-4); }
.rail__check-text { color: var(--ink-1); }
.rail__check-text--warn { color: var(--amber); font-weight: 500; }

.rail__quicklinks { padding: 4px 0; }
.rail__ql {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  font-size: 11.5px;
  color: var(--ink-1);
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background 0.12s;
}
.rail__ql:last-child { border-bottom: 0; }
.rail__ql:hover { background: var(--bg-paper-warm); color: var(--blue); }
.rail__ql svg { width: 14px; height: 14px; color: var(--ink-3); }

/* =========================================================
   Modal
   ========================================================= */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(20, 14, 10, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
  backdrop-filter: blur(2px);
}
.modal-backdrop.is-open { display: flex; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--bg-paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalIn 0.25s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.modal--wide { max-width: 720px; }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg-paper-warm);
}
.modal__title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink-1);
}
.modal__close {
  background: none;
  border: 0;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--ink-3);
  transition: all 0.15s;
}
.modal__close:hover { background: var(--bg-paper); color: var(--ink-1); }
.modal__body { padding: 20px 22px; overflow-y: auto; }
.modal__foot {
  padding: 14px 22px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: var(--bg-paper-warm);
}

.field { margin-bottom: 14px; }
.field__label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 5px;
}
.field__input, .field__select, .field__textarea {
  width: 100%;
  padding: 9px 12px;
  font-size: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink-1);
  outline: none;
}
.field__input:focus, .field__select:focus, .field__textarea:focus {
  border-color: var(--ink-3);
}
.field__textarea { min-height: 80px; resize: vertical; font-family: inherit; }
.field__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* AI modal */
.aimodal__suggest-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}
.aimodal__suggest {
  background: var(--bg-paper-warm);
  border: 1px solid var(--line);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  text-align: left;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1.4;
}
.aimodal__suggest:hover { background: #fff; border-color: var(--gold); color: var(--ink-1); }
.aimodal__history {
  margin-top: 16px;
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.aimodal__q {
  font-size: 12px;
  color: var(--ink-3);
  font-style: italic;
  padding: 8px 12px;
  background: var(--bg-paper-warm);
  border-radius: var(--radius-sm);
  align-self: flex-end;
  max-width: 80%;
}
.aimodal__a {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-1);
  padding: 12px 14px;
  background: var(--gold-tint);
  border-left: 3px solid var(--gold-2);
  border-radius: var(--radius-sm);
}
.aimodal__a b { color: var(--ink-1); }
.aimodal__a em { font-style: italic; color: var(--ink-2); }

/* =========================================================
   Drawer (slide in from right)
   ========================================================= */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(20, 14, 10, 0.45);
  display: none;
  z-index: 90;
  animation: fadeIn 0.2s ease;
}
.drawer-backdrop.is-open { display: block; }
.drawer {
  position: fixed;
  top: 0; right: 0;
  height: 100vh;
  width: 100%;
  max-width: 420px;
  background: var(--bg-paper);
  box-shadow: -10px 0 40px rgba(20, 14, 10, 0.25);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.3, 1);
  z-index: 91;
  display: flex;
  flex-direction: column;
}
.drawer.is-open { transform: translateX(0); }
.drawer__head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg-paper-warm);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.drawer__title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink-1);
}
.drawer__sub {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 3px;
}
.drawer__body { padding: 6px 0; overflow-y: auto; flex: 1; }
.drawer__item {
  padding: 14px 22px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background 0.12s;
}
.drawer__item:hover { background: var(--bg-paper-warm); }
.drawer__item-title { font-weight: 600; font-size: 13.5px; color: var(--ink-1); }
.drawer__item-meta { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }
.drawer__item-meta b { color: var(--red); }
.drawer__item-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.drawer__item-btn {
  font-size: 11px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  background: var(--bg-paper-warm);
  border-radius: 3px;
  color: var(--ink-2);
  cursor: pointer;
}
.drawer__item-btn:hover { background: #fff; border-color: var(--ink-3); color: var(--ink-1); }

/* =========================================================
   Toast
   ========================================================= */
.toast-wrap {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--bg-espresso);
  color: var(--ink-on-dark-1);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.3s ease;
  min-width: 240px;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.toast.is-leaving { animation: toastOut 0.25s ease forwards; }
@keyframes toastOut {
  to { opacity: 0; transform: translateY(20px); }
}
.toast__dot {
  width: 8px; height: 8px;
  background: var(--green);
  border-radius: 50%;
}

/* =========================================================
   Utility
   ========================================================= */
.text-red    { color: var(--red); }
.text-amber  { color: var(--amber); }
.text-green  { color: var(--green); }
.text-muted  { color: var(--ink-3); }
.font-serif  { font-family: var(--font-serif); }
.italic      { font-style: italic; }
.fw-600      { font-weight: 600; }

.divider-em {
  border-top: 1px solid var(--ink-1);
  margin: 0;
}
