:root {
  /* Vans Financial brand: deep green #041F1E + champagne gold #E7CFA0 */
  --navy: #041f1e; --navy-2: #0c3532; --gold: #e7cfa0; --gold-dk: #a8884f; --bg: #f6f4ee; --card: #fff;
  --ink: #14211f; --muted: #66726f; --line: #e5e1d6; --green: #1f9d61; --red: #d64545; --blue: #1f5e57; --orange: #e8833a;
  --serif: 'Trajan Pro', 'Cinzel', 'Cormorant Garamond', Garamond, Georgia, 'Times New Roman', serif;
  --r: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--blue); text-decoration: none; }
h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.hidden { display: none !important; }

/* layout */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: var(--navy); color: #d9d3c2; padding: 18px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.brand { color: var(--gold); font-family: var(--serif); font-weight: 400; font-size: 17px; letter-spacing: 1.5px; padding: 4px 10px 2px; text-align: center; }
.brand img { display: block; width: 92px; margin: 0 auto 8px; }
.brand span { color: var(--gold); }
h1, h2 { font-family: var(--serif); font-weight: 600; letter-spacing: .3px; color: var(--navy); }
.tagline { font-size: 9px; color: #b8ab88; padding: 0 4px 18px; letter-spacing: .9px; white-space: nowrap; font-family: var(--serif); text-align: center; }
.nav a { display: flex; justify-content: space-between; align-items: center; color: #d9d3c2; padding: 9px 10px; border-radius: 8px; margin-bottom: 2px; }
.nav a:hover { background: var(--navy-2); }
.nav a.on { background: var(--navy-2); color: var(--gold); font-weight: 600; box-shadow: inset 3px 0 0 var(--gold); }
.badge { background: var(--gold); color: var(--navy); border-radius: 99px; font-size: 11px; font-weight: 700; padding: 1px 7px; }
.side-foot { margin-top: auto; font-size: 12px; padding: 10px; color: #b8ab88; }
.side-foot a { color: var(--gold); }
.main { padding: 24px 28px; min-width: 0; }
.shell > div { min-width: 0; }
.banner { background: #fff7e0; border: 1px solid #f1d78e; color: #6b5310; padding: 9px 12px; border-radius: var(--r); margin-bottom: 16px; font-size: 13px; }

/* pieces */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.kpi .v { font-size: 26px; font-weight: 750; }
.kpi .l { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.btn { border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 8px 13px; border-radius: 8px; cursor: pointer; font: inherit; font-weight: 600; }
.btn:hover { border-color: #c8cfda; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: var(--gold); }
.btn.primary:hover { background: var(--navy-2); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--navy); }
.btn.danger { color: var(--red); }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: default; }
input, select, textarea { font: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; color: var(--ink); width: 100%; }
textarea { min-height: 90px; resize: vertical; }
label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 10px 0 4px; }
.inline label { display: inline-flex; align-items: center; gap: 6px; margin: 0 12px 0 0; color: var(--ink); font-weight: 500; font-size: 13px; }
.inline input[type=checkbox] { width: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr.click:hover td { background: #f8fafc; cursor: pointer; }
.chip { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; background: #eef1f6; color: #4b5668; }
.chip.hot { background: #fde4e4; color: #b42323; }
.chip.warm { background: #fff0dc; color: #a65b0d; }
.chip.cold { background: #e3eefc; color: #2557a8; }
.chip.dnc { background: #2b2f36; color: #fff; }
.chip.booked, .chip.sold { background: #dff5ea; color: #13724a; }
.chip.replied { background: #ece6fd; color: #5a3cc4; }
.chip.ok { background: #dff5ea; color: #13724a; }
.chip.no { background: #fde4e4; color: #b42323; }

/* inbox */
.inbox { display: grid; grid-template-columns: 320px 1fr; gap: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--r); height: calc(100vh - 110px); overflow: hidden; }
.ilist { border-right: 1px solid var(--line); overflow-y: auto; }
.iitem { padding: 11px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.iitem:hover { background: #f8fafc; }
.iitem.on { background: #f1ead9; }
.iitem .nm { font-weight: 650; display: flex; justify-content: space-between; gap: 8px; }
.iitem.unread .nm::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); display: inline-block; margin-right: 6px; align-self: center; }
.iitem .pv { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread { display: flex; flex-direction: column; min-width: 0; }
.thead { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.msgs { flex: 1; overflow-y: auto; padding: 16px; background: #fafbfd; }
.bub { max-width: 72%; padding: 8px 12px; border-radius: 14px; margin: 4px 0; white-space: pre-wrap; word-wrap: break-word; }
.bub.in { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bub.out { background: var(--navy); color: #fff; margin-left: auto; border-bottom-right-radius: 4px; }
.bub.out.ai { background: #1f5e57; }
.bub.out.blocked, .bub.out.failed { background: #fbeaea; color: #8a2a2a; border: 1px dashed #e6a8a8; }
.bub.out.queued { opacity: .65; }
.meta { font-size: 11px; color: var(--muted); margin: 0 4px 8px; }
.meta.r { text-align: right; }
.composer { border-top: 1px solid var(--line); padding: 10px; display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { min-height: 44px; height: 44px; }
.practice { border-top: 1px dashed #f1d78e; background: #fffbea; padding: 8px 10px; display: flex; gap: 8px; }
.empty { padding: 40px; text-align: center; color: var(--muted); }

/* modal & toast */
.modal { position: fixed; inset: 0; background: rgba(10, 20, 35, .45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 20; overflow-y: auto; }
.modal-card { background: #fff; border-radius: 12px; padding: 20px; width: 100%; max-width: 560px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 30; max-width: 90vw; }
.toast.err { background: var(--red); }

/* login */
.login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--navy); }
.login .card { width: 360px; }
.login .logo { display: block; width: 300px; max-width: 80vw; margin: 0 auto 18px; }
.sample { background: #f3f6fb; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; white-space: pre-wrap; }
.opt { border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 8px; cursor: pointer; }
.opt:hover { border-color: var(--blue); background: #f3f8f6; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tabs .btn.on { background: var(--navy); color: var(--gold); border-color: var(--navy); }
code { background: #eef1f6; padding: 1px 5px; border-radius: 4px; font-size: 12px; word-break: break-all; }

/* mobile */
.mnav { display: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .mnav { display: flex; overflow-x: auto; gap: 4px; background: var(--navy); padding: 8px; position: sticky; top: 0; z-index: 5; }
  .mnav a { color: #d9d3c2; padding: 6px 10px; border-radius: 6px; white-space: nowrap; font-size: 13px; }
  .mnav a.on { background: var(--navy-2); color: var(--gold); }
  .main { padding: 14px; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g2 { grid-template-columns: 1fr; }
  .inbox { grid-template-columns: 1fr; height: auto; }
  .inbox.has-thread .ilist { display: none; }
  .inbox:not(.has-thread) .thread { display: none; }
  .msgs { max-height: 60vh; }
  .hide-m { display: none; }
  .bub { max-width: 88%; }
}
