/* Trip Vara advisor portal.
   Brand: navy #1b3a5f with a coral #f1705b accent, taken from the logo.
   Hand written, no build step, matching the no-toolchain deploy model. */

:root {
  --navy-950: #0a1a30;
  --navy-900: #12294a;
  --navy-800: #1b3a5f;
  --navy-700: #24476e;
  --navy-600: #2f5885;
  --navy-400: #6b91ba;
  --navy-300: #9db9d5;
  --navy-200: #c7d9e9;
  --navy-100: #e4edf5;
  --navy-50: #f3f7fb;

  --coral-600: #c94430;
  --coral-500: #e55942;
  --coral-400: #f1705b;
  --coral-200: #fbc0b5;
  --coral-50: #fef2ef;

  --sand-100: #f7f0e4;
  --shell: #fbf9f5;

  --ink-900: #0f1c2b;
  --ink-700: #2f4459;
  --ink-500: #5c7286;
  --ink-400: #8395a5;

  --green-600: #1f7a5a;
  --green-50: #e8f5f0;
  --amber-600: #9a6b12;
  --amber-50: #fdf4e3;
  --red-600: #b3382a;
  --red-50: #fdeeec;

  --radius: 12px;
  --sidebar-w: 232px;
  --shadow-sm: 0 1px 2px rgba(15, 28, 43, .06);
  --shadow-md: 0 8px 26px rgba(15, 28, 43, .10);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--shell);
  color: var(--ink-700);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { color: var(--navy-800); margin: 0; line-height: 1.25; font-weight: 650; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .8em; }
a { color: var(--navy-700); }
a:hover { color: var(--coral-500); }

:focus-visible { outline: 2px solid var(--coral-500); outline-offset: 2px; border-radius: 3px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------------------------------------------------------------- brand -- */
.wordmark { display: flex; align-items: center; gap: .65rem; text-decoration: none; }
.wordmark img { width: 32px; height: 32px; display: block; }
.wordmark b {
  font-weight: 650; font-size: .92rem; letter-spacing: .26em;
  text-transform: uppercase; color: var(--navy-800);
}
.wordmark small { display: block; font-size: .58rem; letter-spacing: .06em; color: var(--coral-400); }

/* The mark is drawn in navy, so on the navy sidebar it needs a light plate
   behind it or it simply disappears. */
.wordmark.on-dark b { color: #fff; font-size: 1rem; }
.wordmark.on-dark small { color: var(--coral-200); font-size: .62rem; }
.wordmark.on-dark img {
  width: 34px; height: 34px; padding: 5px; box-sizing: content-box;
  background: #fff; border-radius: 11px;
  box-shadow: 0 1px 0 rgba(255,255,255,.5), 0 6px 16px rgba(0,0,0,.35);
}
.wordmark.on-dark:hover img { box-shadow: 0 0 0 2px var(--coral-400), 0 6px 16px rgba(0,0,0,.35); }

/* ------------------------------------------------------------- controls -- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  border: 1px solid transparent; border-radius: 999px; cursor: pointer;
  font: inherit; font-weight: 600; font-size: .875rem; padding: .6rem 1.15rem;
  text-decoration: none; transition: background-color .15s, border-color .15s, color .15s;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--coral-400); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--coral-500); color: #fff; }
.btn-secondary { background: var(--navy-800); color: #fff; }
.btn-secondary:hover:not(:disabled) { background: var(--navy-700); color: #fff; }
.btn-ghost { background: #fff; border-color: var(--navy-200); color: var(--navy-800); }
.btn-ghost:hover:not(:disabled) { border-color: var(--navy-400); background: var(--navy-50); }
.btn-danger { background: #fff; border-color: var(--coral-200); color: var(--red-600); }
.btn-danger:hover:not(:disabled) { background: var(--red-50); }
.btn-sm { padding: .35rem .8rem; font-size: .8rem; }

label { display: block; font-size: .8rem; font-weight: 600; color: var(--navy-800); margin-bottom: .3rem; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--ink-900); background: #fff;
  border: 1px solid var(--navy-200); border-radius: 9px; padding: .55rem .7rem;
}
input:focus, select:focus, textarea:focus { border-color: var(--navy-400); outline-offset: 1px; }
textarea { min-height: 90px; resize: vertical; }
.field { margin-bottom: 1rem; }
.field-hint { font-size: .78rem; color: var(--ink-400); margin-top: .3rem; }
.field-row { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 620px) { .field-row { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- cards -- */
.card {
  background: #fff; border: 1px solid var(--navy-100);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card-pad { padding: 1.25rem; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--navy-100);
}

.badge {
  display: inline-block; border-radius: 999px; padding: .16rem .6rem;
  font-size: .7rem; font-weight: 650; letter-spacing: .02em; white-space: nowrap;
}
.badge-green { background: var(--green-50); color: var(--green-600); }
.badge-amber { background: var(--amber-50); color: var(--amber-600); }
.badge-red { background: var(--red-50); color: var(--red-600); }
.badge-navy { background: var(--navy-50); color: var(--navy-700); }
.badge-coral { background: var(--coral-50); color: var(--coral-600); }

.notice { border-radius: var(--radius); padding: .85rem 1rem; font-size: .875rem; margin-bottom: 1rem; }
.notice-error { background: var(--red-50); color: var(--red-600); }
.notice-ok { background: var(--green-50); color: var(--green-600); }
.notice-info { background: var(--navy-50); color: var(--navy-700); }
.notice-setup {
  background: var(--navy-50); border: 1px dashed var(--navy-300);
  color: var(--ink-700); padding: 1.5rem;
}
.notice[hidden], [hidden] { display: none !important; }

/* ----------------------------------------------------------------- shell -- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  background: var(--navy-900); color: var(--navy-200);
  display: flex; flex-direction: column; padding: 1.1rem .85rem;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .wordmark { padding: .2rem .5rem 1.4rem; }
.sidebar nav { display: flex; flex-direction: column; gap: .12rem; }
.sidebar nav a {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem .7rem; border-radius: 9px; text-decoration: none;
  color: var(--navy-200); font-size: .875rem; font-weight: 550;
}
.sidebar nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar nav a[aria-current="page"] { background: var(--coral-400); color: #fff; }
.sidebar nav a svg { width: 17px; height: 17px; flex: none; }
.sidebar-foot { margin-top: auto; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,.12); }
.sidebar-foot .who { font-size: .8rem; color: #fff; font-weight: 600; }
.sidebar-foot .who span { display: block; color: var(--navy-300); font-weight: 400; font-size: .72rem; }
.sidebar-foot button {
  margin-top: .6rem; background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--navy-300); font: inherit; font-size: .78rem; text-align: left;
}
.sidebar-foot button:hover { color: var(--coral-400); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.1rem 1.6rem; border-bottom: 1px solid var(--navy-100); background: #fff;
}
.topbar .sub { font-size: .82rem; color: var(--ink-500); margin-top: .15rem; }
.content { padding: 1.6rem; flex: 1; }
.content > section + section { margin-top: 1.5rem; }

.menu-toggle { display: none; }

@media (max-width: 860px) {
  .shell { display: block; }
  .sidebar {
    position: static; width: auto; height: auto; flex: none;
    flex-direction: row; align-items: center; justify-content: space-between;
    padding: .7rem 1rem;
  }
  .sidebar .wordmark { padding: 0; }
  .sidebar nav {
    display: none; position: absolute; top: 56px; left: 0; right: 0; z-index: 30;
    background: var(--navy-900); padding: .6rem 1rem 1rem;
  }
  .sidebar.open nav { display: flex; }
  .sidebar-foot { display: none; }
  .sidebar.open .sidebar-foot { display: block; position: absolute; top: 100%; }
  .menu-toggle {
    display: inline-flex; background: none; border: 1px solid rgba(255,255,255,.3);
    color: #fff; border-radius: 8px; width: 36px; height: 36px;
    align-items: center; justify-content: center; cursor: pointer;
  }
  .topbar { padding: 1rem; }
  .content { padding: 1rem; }
}

/* ---------------------------------------------------------------- stats -- */
.stat-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.stat { background: #fff; border: 1px solid var(--navy-100); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.stat .label { font-size: .72rem; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-400); }
.stat .value { font-size: 1.75rem; font-weight: 680; color: var(--navy-800); margin-top: .35rem; line-height: 1.1; }
.stat .meta { font-size: .8rem; color: var(--ink-500); margin-top: .25rem; }

/* --------------------------------------------------------------- tables -- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th {
  text-align: left; font-size: .7rem; letter-spacing: .09em; text-transform: uppercase;
  color: var(--ink-400); font-weight: 650; padding: .7rem 1rem; border-bottom: 1px solid var(--navy-100);
  white-space: nowrap;
}
td { padding: .8rem 1rem; border-bottom: 1px solid var(--navy-100); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--navy-50); }
td .name { font-weight: 600; color: var(--navy-800); }
td .muted { color: var(--ink-400); font-size: .82rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.empty { padding: 3rem 1.5rem; text-align: center; color: var(--ink-500); }
.empty h3 { margin-bottom: .4rem; }

/* ---------------------------------------------------------------- board -- */
.board { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: .5rem; align-items: flex-start; }
.board-col { flex: 0 0 264px; background: var(--navy-50); border-radius: var(--radius); padding: .8rem; }
.board-col h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-500); }
.board-col .col-meta { font-size: .75rem; color: var(--ink-400); margin: .2rem 0 .7rem; }
.opp {
  background: #fff; border: 1px solid var(--navy-100); border-radius: 10px;
  padding: .7rem .8rem; margin-bottom: .55rem; box-shadow: var(--shadow-sm);
}
.opp .t { font-weight: 600; color: var(--navy-800); font-size: .875rem; }
.opp .c { font-size: .78rem; color: var(--ink-500); margin-top: .15rem; }
.opp .v { font-size: .82rem; font-weight: 650; color: var(--coral-600); margin-top: .35rem; }

/* --------------------------------------------------------------- dialog -- */
dialog {
  border: 0; border-radius: 14px; padding: 0; width: min(620px, calc(100vw - 2rem));
  box-shadow: var(--shadow-md); color: var(--ink-700);
}
dialog::backdrop { background: rgba(10, 26, 48, .5); }
dialog .card-head { border-radius: 14px 14px 0 0; }
dialog form { margin: 0; }
.dialog-body { padding: 1.25rem; max-height: 65vh; overflow-y: auto; }
.dialog-foot {
  display: flex; justify-content: flex-end; gap: .6rem;
  padding: 1rem 1.25rem; border-top: 1px solid var(--navy-100); background: var(--navy-50);
  border-radius: 0 0 14px 14px;
}
.icon-btn { background: none; border: 0; cursor: pointer; color: var(--ink-400); font-size: 1.3rem; line-height: 1; padding: .2rem .4rem; }
.icon-btn:hover { color: var(--navy-800); }

/* ------------------------------------------------------------ auth pages -- */
/* One centred card under the mark, the way a back office signs you in. The
   marketing split that used to be here was hidden below 900px anyway, and a
   list of features is not what someone signing in at 7am is reading. */
.auth-page {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1.4rem;
  padding: 2.5rem 1rem;
}
.auth-brand { display: flex; align-items: center; gap: .9rem; text-decoration: none; }
.auth-brand img { width: 52px; height: 52px; }
.auth-brand b {
  display: block; font-size: 1.45rem; font-weight: 680; letter-spacing: .24em;
  text-transform: uppercase; color: var(--navy-800); line-height: 1.1;
}
.auth-brand small {
  display: block; font-size: .7rem; letter-spacing: .07em; color: var(--coral-500); margin-top: .25rem;
}

.auth-card {
  width: 100%; max-width: 440px; background: #fff;
  border: 1px solid var(--navy-100); border-radius: var(--radius);
  overflow: hidden; box-shadow: 0 10px 30px rgba(15, 28, 43, .07);
}
.auth-card-head { background: var(--navy-900); padding: 1.7rem 2rem; text-align: center; }
.auth-card-head h1 { color: #fff; font-size: 1.6rem; margin: 0; }
.auth-card-head p { color: var(--navy-200); font-size: .88rem; margin: .5rem 0 0; }
.auth-card-body { padding: 1.7rem 2rem 1.9rem; }
.auth-card-body .btn { width: 100%; }
.auth-foot { margin-top: 1.1rem; font-size: .85rem; color: var(--ink-500); text-align: center; }
.auth-legal {
  max-width: 440px; text-align: center; font-size: .74rem;
  color: var(--ink-400); line-height: 1.7; margin: 0;
}
@media (max-width: 460px) {
  .auth-card-head, .auth-card-body { padding-left: 1.25rem; padding-right: 1.25rem; }
  .auth-brand img { width: 42px; height: 42px; }
  .auth-brand b { font-size: 1.2rem; }
}

/* Password fields carry a reveal control. These passwords are ten characters
   minimum and typed on phones, and the alternative to showing them is people
   choosing shorter ones. */
.pw { position: relative; display: block; }
.pw input { padding-right: 3rem; }
.pw-toggle {
  position: absolute; top: 0; right: 0; height: 100%; width: 2.9rem;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 0; cursor: pointer; color: var(--ink-400);
}
.pw-toggle:hover { color: var(--navy-800); }
.pw-toggle svg { width: 18px; height: 18px; }

.row-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.toolbar { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.toolbar input, .toolbar select { width: auto; min-width: 150px; }
.spinner { color: var(--ink-400); font-size: .875rem; padding: 2rem; text-align: center; }

/* Two column content split that collapses on narrow screens. Kept in CSS
   rather than measured in JS so it reflows on resize, not just on load. */
.split { display: grid; gap: 1.5rem; grid-template-columns: 1.4fr 1fr; align-items: start; }
@media (max-width: 1000px) { .split { grid-template-columns: 1fr; } }

/* Contact record */
.contact-head { display: flex; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.avatar {
  width: 46px; height: 46px; border-radius: 50%; flex: none;
  background: var(--navy-800); color: #fff; display: flex; align-items: center;
  justify-content: center; font-weight: 650; font-size: .95rem; letter-spacing: .02em;
}
.kv { display: grid; grid-template-columns: 120px 1fr; gap: .5rem 1rem; font-size: .875rem; }
.kv dt { color: var(--ink-400); font-weight: 600; }
.kv dd { margin: 0; color: var(--ink-700); word-break: break-word; }
.stack > * + * { margin-top: 1.5rem; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: .85rem 1.25rem; border-bottom: 1px solid var(--navy-100); }
.timeline li:last-child { border-bottom: 0; }
.timeline .when { font-size: .75rem; color: var(--ink-400); margin-top: .3rem; }
.task { display: flex; gap: .7rem; align-items: flex-start; }
.task input[type="checkbox"] { width: auto; margin-top: .25rem; flex: none; }
.task.done .task-title { text-decoration: line-through; color: var(--ink-400); }
.back-link { font-size: .82rem; color: var(--ink-500); text-decoration: none; display: inline-block; margin-bottom: .4rem; }
.back-link:hover { color: var(--coral-500); }
tbody tr[data-href] { cursor: pointer; }

/* Inbox: thread list beside a message pane */
.inbox { display: grid; grid-template-columns: 320px 1fr; gap: 1rem; align-items: start; }
@media (max-width: 900px) { .inbox { grid-template-columns: 1fr; } .inbox.viewing .threads { display: none; } }
.threads { max-height: calc(100vh - 190px); overflow-y: auto; }
.thread {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  border-bottom: 1px solid var(--navy-100); padding: .85rem 1rem; cursor: pointer; font: inherit;
}
.thread:hover { background: var(--navy-50); }
.thread[aria-current="true"] { background: var(--navy-50); box-shadow: inset 3px 0 0 var(--coral-400); }
.thread .who { font-weight: 650; color: var(--navy-800); font-size: .875rem; }
.thread .snip {
  color: var(--ink-500); font-size: .8rem; margin-top: .2rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.thread .meta { color: var(--ink-400); font-size: .72rem; margin-top: .25rem; }
.unread { background: var(--coral-400); color: #fff; border-radius: 999px; padding: 0 .4rem; font-size: .68rem; font-weight: 650; }

.messages { padding: 1.1rem; max-height: calc(100vh - 340px); overflow-y: auto; display: flex; flex-direction: column; gap: .7rem; }
.msg { max-width: 76%; padding: .6rem .85rem; border-radius: 13px; font-size: .875rem; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.msg.in { align-self: flex-start; background: var(--navy-50); color: var(--ink-800); border-bottom-left-radius: 4px; }
.msg.out { align-self: flex-end; background: var(--navy-800); color: #fff; border-bottom-right-radius: 4px; }
.msg .stamp { display: block; font-size: .68rem; opacity: .7; margin-top: .3rem; }
.composer { border-top: 1px solid var(--navy-100); padding: 1rem; }
.composer textarea { min-height: 70px; }
.composer .row { display: flex; gap: .6rem; align-items: center; margin-top: .6rem; }
.composer select { width: auto; }

/* Pipeline drag and drop */
.opp { cursor: grab; }
.opp:active { cursor: grabbing; }
.opp.dragging { opacity: .45; }
.board-col.drop-target { outline: 2px dashed var(--coral-400); outline-offset: -2px; background: var(--coral-50); }
.opp .move { margin-top: .5rem; }
.opp .move select { font-size: .75rem; padding: .25rem .4rem; }
.picker { position: relative; }
.picker-results {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 20; background: #fff;
  border: 1px solid var(--navy-200); border-radius: 0 0 9px 9px; max-height: 190px;
  overflow-y: auto; box-shadow: var(--shadow-md);
}
.picker-results button {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  padding: .5rem .7rem; cursor: pointer; font: inherit; font-size: .85rem;
  border-bottom: 1px solid var(--navy-100);
}
.picker-results button:hover { background: var(--navy-50); }

/* Calendar agenda */
.day-head {
  position: sticky; top: 0; background: var(--sand-100); padding: .5rem 1.25rem;
  font-size: .72rem; font-weight: 650; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-500); border-bottom: 1px solid var(--navy-100); z-index: 2;
}
.event { display: flex; gap: 1rem; padding: .85rem 1.25rem; border-bottom: 1px solid var(--navy-100); }
.event .time { flex: 0 0 92px; font-variant-numeric: tabular-nums; font-weight: 650; color: var(--navy-800); font-size: .85rem; }
.event .what { flex: 1; min-width: 0; }
.event .what .title { font-weight: 600; color: var(--navy-800); }

/* Sidebar search. Lives here rather than in each page's topbar so there is
   one implementation, and so it is in the same place on all nineteen screens. */
.nav-search { position: relative; margin: 0 0 .9rem; }
.nav-search > svg {
  position: absolute; left: .62rem; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--navy-300); pointer-events: none;
}
.nav-search input {
  width: 100%; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14);
  color: #fff; border-radius: 9px; padding: .48rem 2rem .48rem 2rem; font-size: .84rem;
}
.nav-search input::placeholder { color: var(--navy-300); }
.nav-search input:focus { border-color: var(--coral-400); background: rgba(255,255,255,.12); }
.nav-search input::-webkit-search-cancel-button { display: none; }
.nav-search kbd {
  position: absolute; right: .5rem; top: 50%; transform: translateY(-50%);
  font: inherit; font-size: .68rem; color: var(--navy-300);
  border: 1px solid rgba(255,255,255,.18); border-radius: 4px; padding: 0 .3rem;
  pointer-events: none;
}
.nav-search input:focus ~ kbd { display: none; }

.search-results {
  position: absolute; top: calc(100% + .35rem); left: 0; right: 0; z-index: 40;
  background: #fff; border: 1px solid var(--navy-100); border-radius: 10px;
  box-shadow: 0 14px 34px rgba(15,28,43,.22); padding: .3rem;
  max-height: 60vh; overflow-y: auto;
}
.search-group {
  font-size: .62rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-400); padding: .5rem .55rem .25rem; margin: 0;
}
.search-results a {
  display: block; padding: .42rem .55rem; border-radius: 7px; text-decoration: none;
}
.search-results a:hover, .search-results a.on { background: var(--navy-50); }
.search-results a .t {
  display: flex; align-items: center; gap: .4rem;
  font-size: .84rem; font-weight: 600; color: var(--navy-800);
}
.search-results a .s {
  display: block; font-size: .74rem; color: var(--ink-500);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.search-empty { font-size: .82rem; color: var(--ink-500); padding: .7rem .6rem; margin: 0; }

/* Hub sidebar navigation: an area of the business, then the screens in it. */
.nav-hub { display: flex; flex-direction: column; }
.hub-toggle {
  display: flex; align-items: center; gap: .6rem; width: 100%;
  background: none; border: 0; cursor: pointer; font: inherit;
  padding: .55rem .7rem; border-radius: 9px;
  color: var(--navy-200); font-size: .875rem; font-weight: 550; text-align: left;
}
.hub-toggle:hover { background: rgba(255,255,255,.07); color: #fff; }
.hub-toggle span { flex: 1; }
.hub-toggle svg { width: 17px; height: 17px; flex: none; }
.hub-toggle svg:last-child { width: 14px; height: 14px; opacity: .55; transition: transform .15s; }
.nav-hub.open > .hub-toggle { color: #fff; }
.nav-hub.open > .hub-toggle svg:last-child { transform: rotate(180deg); }

.hub-items { display: none; flex-direction: column; gap: .1rem; padding: .15rem 0 .35rem; }
.nav-hub.open .hub-items { display: flex; }
.sidebar nav .hub-items a {
  padding: .42rem .7rem .42rem 2.05rem;
  font-size: .83rem; font-weight: 500; color: var(--navy-300);
}
.sidebar nav .hub-items a:hover { color: #fff; }
.sidebar nav .hub-items a[aria-current="page"] { background: var(--coral-400); color: #fff; font-weight: 600; }

/* Tabs */
.tabs { display: flex; gap: .3rem; flex-wrap: wrap; border-bottom: 1px solid var(--navy-100); margin-bottom: 1.3rem; }
.tab {
  background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer;
  font: inherit; font-size: .875rem; font-weight: 600; color: var(--ink-500);
  padding: .6rem .85rem; margin-bottom: -1px;
}
.tab:hover { color: var(--navy-800); }
.tab[aria-selected="true"] { color: var(--navy-800); border-bottom-color: var(--coral-400); }
.tab .n { font-weight: 400; color: var(--ink-400); font-size: .78rem; margin-left: .3rem; }

/* Simple record lists used across the data pages */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { padding: .8rem 1.25rem; border-bottom: 1px solid var(--navy-100); }
.rows li:last-child { border-bottom: 0; }
.rows .t { font-weight: 600; color: var(--navy-800); }
.rows .m { font-size: .8rem; color: var(--ink-500); margin-top: .2rem; word-break: break-word; }
.media-grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); padding: 1.1rem; }
.media-item { border: 1px solid var(--navy-100); border-radius: 10px; overflow: hidden; background: #fff; }
.media-item img { display: block; width: 100%; height: 96px; object-fit: cover; background: var(--navy-50); }
.media-item .cap { padding: .45rem .55rem; font-size: .72rem; color: var(--ink-500); word-break: break-all; }

/* Widget dashboard.
   Two columns of self-contained panels, each with its own tabs, in the shape
   an advisor already reads every morning in their franchise back office. */
.widgets { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; align-items: start; }
@media (max-width: 1100px) { .widgets { grid-template-columns: 1fr; } }
.widget { background: #fff; border: 1px solid var(--navy-100); border-radius: var(--radius); overflow: hidden; }
.widget > header {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  padding: .7rem 1rem; border-bottom: 1px solid var(--navy-100); background: var(--navy-50);
}
.widget > header h2 {
  font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--navy-700); margin: 0;
}
.widget > header a { font-size: .75rem; text-decoration: none; }
.wtabs { display: flex; gap: .1rem; padding: .5rem 1rem 0; border-bottom: 1px solid var(--navy-100); flex-wrap: wrap; }
.wtab {
  background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer;
  font: inherit; font-size: .78rem; font-weight: 600; color: var(--ink-500);
  padding: .35rem .6rem; margin-bottom: -1px; white-space: nowrap;
}
.wtab[aria-selected="true"] { color: var(--navy-800); border-bottom-color: var(--coral-400); }
.wtab:hover { color: var(--navy-800); }
.wbody { max-height: 320px; overflow-y: auto; }
.wbody table { font-size: .8rem; }
.wbody th { padding: .5rem .8rem; font-size: .62rem; }
.wbody td { padding: .5rem .8rem; }
.wbody .empty { padding: 1.8rem 1rem; }
.wempty { padding: 1.6rem 1rem; text-align: center; color: var(--ink-400); font-size: .82rem; }

/* Notices: the panel that tells you something is wrong. Tone is carried by a
   left edge rather than a filled background, so three of them in a row do not
   read as an emergency. */
.notice-list { list-style: none; margin: 0; padding: .3rem; }
.notice-list li {
  padding: .6rem .7rem; border-left: 3px solid var(--navy-200);
  border-radius: 0 7px 7px 0; margin-bottom: .3rem; background: var(--navy-50);
}
.notice-list li.tone-urgent { border-left-color: var(--red-600); background: var(--red-50); }
.notice-list li.tone-warn { border-left-color: var(--amber-600); background: var(--amber-50); }
.notice-list .t { font-size: .84rem; font-weight: 650; color: var(--navy-800); }
.notice-list .m { font-size: .76rem; color: var(--ink-500); margin: .15rem 0 .3rem; }
.notice-list a { font-size: .76rem; font-weight: 600; text-decoration: none; }

/* Production trend */
.trend { display: flex; align-items: flex-end; gap: .35rem; height: 118px; padding: .9rem 1rem 0; overflow-x: auto; }
.trend-col { flex: 0 0 30px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.trend-bar {
  display: block; width: 100%; border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, var(--navy-600), var(--navy-800));
}
.trend-label { font-size: .62rem; color: var(--ink-400); margin-top: .3rem; }
.trend-foot { font-size: .76rem; color: var(--ink-500); padding: .5rem 1rem .9rem; margin: 0; }

.stat-note {
  font-size: .8rem; color: var(--ink-500); margin: .9rem 0 0; line-height: 1.6;
  border-left: 3px solid var(--navy-100); padding-left: .8rem;
}
.stat-note strong { color: var(--navy-800); font-weight: 650; }

/* The To do button in the sidebar, and the drawer it opens */
.nav-todo {
  display: flex; align-items: center; gap: .6rem; width: 100%; margin-bottom: .6rem;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14);
  color: #fff; border-radius: 9px; padding: .48rem .7rem; cursor: pointer;
  font: inherit; font-size: .84rem; font-weight: 550; text-align: left;
}
.nav-todo:hover { background: rgba(255,255,255,.13); }
.nav-todo svg { width: 16px; height: 16px; flex: none; }
.nav-todo span:nth-child(2) { flex: 1; }
.todo-count {
  min-width: 20px; text-align: center; border-radius: 999px; font-size: .7rem;
  font-weight: 700; padding: .05rem .35rem; background: var(--navy-600); color: #fff;
}
.todo-count.late { background: var(--coral-500); }

.drawer {
  position: fixed; inset: 0; z-index: 60; background: rgba(10,26,48,.45);
  display: none;
}
.drawer.open { display: block; }
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(420px, 100%);
  background: var(--shell); display: flex; flex-direction: column;
  box-shadow: -14px 0 40px rgba(15,28,43,.28);
}
.drawer-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 1.1rem; background: #fff; border-bottom: 1px solid var(--navy-100);
}
.drawer-head h2 { font-size: 1.05rem; margin: 0; }
.drawer-add {
  display: grid; grid-template-columns: 1fr auto auto; gap: .4rem;
  padding: .8rem 1.1rem; background: #fff; border-bottom: 1px solid var(--navy-100);
}
.drawer-add input[type="date"] { width: auto; }
.drawer-body { flex: 1; overflow-y: auto; padding: .4rem 1.1rem 1.6rem; }
.drawer-group {
  font-size: .64rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-400); margin: 1.1rem 0 .4rem; display: flex; gap: .4rem; align-items: center;
}
.drawer-group span {
  background: var(--navy-100); color: var(--navy-700); border-radius: 999px;
  padding: 0 .35rem; letter-spacing: 0; font-size: .68rem;
}
.drawer-body .rows li { display: flex; align-items: flex-start; gap: .5rem; background: #fff;
  border: 1px solid var(--navy-100); border-radius: 9px; padding: .5rem .6rem; margin-bottom: .35rem; }
.drawer-body .rows li .task-tick { flex: 1; }
.drawer-body .wempty { padding: .5rem .2rem; text-align: left; }
.pin {
  background: none; border: 0; cursor: pointer; color: var(--ink-400); padding: .1rem;
  flex: none; line-height: 1;
}
.pin:hover { color: var(--navy-700); }
.pin.on { color: var(--coral-500); }

/* Definition pairs, for a record page */
.pairs { display: grid; grid-template-columns: auto 1fr; gap: .45rem 1.1rem; margin: 0; }
.pairs dt { font-size: .78rem; color: var(--ink-400); font-weight: 600; }
.pairs dd { margin: 0; font-size: .86rem; color: var(--navy-800); }

/* Editable grid: filling in what an import could not carry */
table.grid td { padding: .35rem .5rem; vertical-align: middle; }
table.grid input {
  padding: .35rem .45rem; font-size: .82rem; border-radius: 6px; min-width: 7rem;
}
table.grid td.num input { text-align: right; }
table.grid input.wanted { border-color: var(--coral-200); background: var(--coral-50); }
table.grid input:focus { border-color: var(--navy-400); background: #fff; }

/* Vendor duplicate groups */
.dupe-group {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  border: 1px solid var(--navy-100); border-radius: 9px; padding: .6rem .7rem; margin-bottom: .5rem;
}
.dupe-option { display: flex; align-items: center; gap: .45rem; margin: 0; font-weight: 400; cursor: pointer; }
.dupe-option input { width: auto; flex: none; }
.dupe-option .t { font-size: .86rem; font-weight: 600; color: var(--navy-800); }
.dupe-option .m { display: block; font-size: .72rem; color: var(--ink-400); }
.dupe-group button { margin-left: auto; }

/* Targets */
.goal-aim { font-size: 1.05rem; color: var(--navy-800); font-weight: 600; margin: 0; line-height: 1.5; }
.goal-edge { font-size: .88rem; color: var(--ink-500); margin: .5rem 0 0; }
.goal-row + .goal-row { margin-top: 1.2rem; }
.goal-row.compact + .goal-row.compact { margin-top: .8rem; }
.goal-label {
  display: flex; justify-content: space-between; gap: 1rem; align-items: baseline;
  font-size: .84rem; font-weight: 650; color: var(--navy-800); margin: 0 0 .35rem;
}
.goal-label span { font-weight: 400; color: var(--ink-500); font-size: .8rem; }
.goal-bar { position: relative; height: 10px; border-radius: 5px; background: var(--navy-100); }
.goal-bar .fill { position: absolute; inset: 0 auto 0 0; border-radius: 5px; }
.goal-bar .fill.ahead { background: var(--green-600); }
.goal-bar .fill.behind { background: var(--coral-400); }
.goal-bar .pace {
  position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--navy-800);
  border-radius: 1px;
}
.goal-meta { font-size: .76rem; margin: .35rem 0 0; display: flex; gap: .5rem; flex-wrap: wrap; }
.goal-meta .up { color: var(--green-600); }
.goal-meta .down { color: var(--coral-600); }
.goal-none { font-size: .8rem; color: var(--ink-400); margin: 0; }

/* Year on year comparison */
.cmp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
@media (max-width: 900px) { .cmp-grid { grid-template-columns: 1fr; } }
.cmp-title {
  font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--navy-800); margin: 0 0 .4rem; display: flex; gap: .5rem; align-items: baseline;
}
.cmp-title .muted { letter-spacing: 0; text-transform: none; font-weight: 400; font-size: .72rem; }
.cmp table { width: 100%; }
.cmp td, .cmp th { padding: .35rem .4rem; font-size: .82rem; }
.cmp .up { color: var(--green-600); font-weight: 650; }
.cmp .down { color: var(--red-600); font-weight: 650; }

/* Dashboard calendar */
.cal { padding: .5rem .8rem .8rem; }
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: .2rem 0 .6rem; }
.cal-head strong { font-size: .88rem; color: var(--navy-800); }
.cal-nav {
  width: 26px; height: 26px; border: 1px solid var(--navy-100); background: #fff;
  border-radius: 6px; cursor: pointer; color: var(--navy-700); font-size: 1rem; line-height: 1;
}
.cal-nav:hover { border-color: var(--navy-400); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-dow { text-align: center; font-size: .64rem; font-weight: 700; letter-spacing: .08em;
  color: var(--ink-400); padding-bottom: .3rem; }
.cal-day {
  position: relative; aspect-ratio: 1; border: 1px solid transparent; background: none;
  border-radius: 7px; cursor: pointer; font: inherit; padding: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.cal-day.empty { cursor: default; }
.cal-day .n { font-size: .78rem; color: var(--ink-700); line-height: 1; }
.cal-day:hover:not(.empty) { background: var(--navy-50); }
.cal-day.today { background: var(--navy-800); }
.cal-day.today .n { color: #fff; font-weight: 700; }
.cal-day.picked { border-color: var(--coral-400); }
.cal-day .dots { display: flex; gap: 2px; height: 5px; }
.dot { width: 5px; height: 5px; border-radius: 50%; display: inline-block; flex: none; }
.dot.depart { background: var(--navy-600); }
.dot.return { background: var(--navy-300); }
.dot.hard { background: var(--coral-500); }
.dot.soft { background: var(--amber-600); }
.dot.task { background: var(--green-600); }
.dot.option { background: var(--red-600); }
.cal-day.today .dot { outline: 1px solid rgba(255,255,255,.6); }
.cal-detail { border-top: 1px solid var(--navy-100); margin-top: .7rem; }
.cal-none { font-size: .8rem; color: var(--ink-400); padding: .8rem .2rem; margin: 0; }
.cal-event { display: flex; align-items: flex-start; gap: .5rem; text-decoration: none; padding: .1rem 0; }
.cal-event .dot { margin-top: .42rem; }
.cal-event .t { display: block; font-size: .83rem; font-weight: 600; color: var(--navy-800); }
.cal-event .m { display: block; font-size: .74rem; color: var(--ink-500); }

/* Tasks */
.task-rows .task-tick { display: flex; align-items: flex-start; gap: .6rem; margin: 0; cursor: pointer; font-weight: 400; }
.task-rows .task-tick input { width: auto; flex: none; margin-top: .2rem; }
.task-rows .t { display: block; font-size: .88rem; font-weight: 600; color: var(--navy-800); }
.task-rows .m { display: block; font-size: .76rem; color: var(--ink-500); margin-top: .15rem; }
.task-rows .m .late { color: var(--red-600); font-weight: 650; }
.task-rows li.done .t { text-decoration: line-through; color: var(--ink-400); }
.task-rows li.done .task-tick { cursor: pointer; }

/* The customiser */
.customise-split { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1.4rem; align-items: start; }
@media (max-width: 860px) { .customise-split { grid-template-columns: 1fr; } }
.preview-label {
  font-size: .64rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-400); margin: 0 0 .5rem;
}
.layout-preview { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; }
.preview-cell {
  display: flex; align-items: center; gap: .4rem; background: var(--navy-50);
  border: 1px dashed var(--navy-200); border-radius: 7px; padding: .5rem .55rem;
  font-size: .74rem; color: var(--navy-700); min-height: 2.6rem;
}
.preview-cell b {
  background: var(--navy-800); color: #fff; border-radius: 5px; font-size: .64rem;
  padding: .05rem .3rem; flex: none;
}
.panel-list .pos {
  min-width: 1.3rem; text-align: right; font-size: .74rem; color: var(--ink-400);
  font-variant-numeric: tabular-nums; flex: none;
}

.panel-list { list-style: none; margin: 0; padding: 0; }
.panel-list li {
  display: flex; align-items: center; gap: .6rem; background: #fff;
  border: 1px solid var(--navy-100); border-radius: 9px;
  padding: .55rem .7rem; margin-bottom: .4rem; cursor: grab;
}
.panel-list li.dragging { opacity: .45; }
.panel-list li.drop-target { border-color: var(--coral-400); box-shadow: 0 0 0 2px var(--coral-50); }
.panel-list .grip { color: var(--navy-300); display: flex; flex: none; }
.panel-list .panel-name { display: flex; align-items: center; gap: .6rem; flex: 1; margin: 0; cursor: pointer; }
.panel-list .panel-name input { width: auto; flex: none; }
.panel-list .panel-name b { display: block; font-size: .86rem; color: var(--navy-800); font-weight: 650; }
.panel-list .panel-name small { display: block; font-size: .74rem; color: var(--ink-400); font-weight: 400; }
.panel-list .move { display: flex; gap: .2rem; flex: none; }
.panel-list .move button {
  width: 26px; height: 26px; border: 1px solid var(--navy-100); background: #fff;
  border-radius: 6px; cursor: pointer; color: var(--navy-700); font-size: .8rem; line-height: 1;
}
.panel-list .move button:disabled { opacity: .35; cursor: default; }
.panel-list .move button:hover:not(:disabled) { border-color: var(--navy-400); }
.stage-row { display: flex; align-items: center; gap: .6rem; padding: .45rem 1rem; font-size: .82rem; }
.stage-row .bar { flex: 1; height: 6px; background: var(--navy-100); border-radius: 3px; overflow: hidden; }
.stage-row .bar span { display: block; height: 100%; background: var(--coral-400); }
.stage-row .n { font-variant-numeric: tabular-nums; color: var(--ink-500); font-size: .78rem; min-width: 3.5rem; text-align: right; }
