/* Flexi Tour Centre - application styles. Tokens follow UI_CONVENTIONS section 3 (gold/bronze), WCAG AA contrast, light and dark. */
:root {
  /* ---- THEME: change the look here (and in templates/base.html + web/views.py BRAND for the name and logo). Nothing below hard-codes a colour, font, size or radius. ---- */
  --font-body: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; --font-mono: ui-monospace, Consolas, monospace;
  --fs-base: 16px; --fs-h1: 22px; --fs-h2: 18px; --fs-h3: 16px; --fs-figure: 22px; --fs-figure-sm: 20px; --fs-table: 15px; --fs-small: 14px; --fs-caps: 13px; --fs-key: 12px; --fs-micro: 11px; --fs-code: 18px;
  --radius-xs: 4px; --radius-round: 50%; --radius-sm: 6px; --radius: 8px; --radius-lg: 10px; --radius-xl: 12px; --radius-pill: 999px;
  --tap: 44px; --sidebar-w: 232px; --content-w: 1180px; --narrow-w: 640px; --field-w: 460px; --dialog-w: 560px; --logo-h: 36px; --search-w: 700px; --search-h: 34px; --avatar: 27px; --avatar-header: 32px; --avatar-large: 108px;
  --on-demo: #1f1300; --on-danger: var(--white); --backdrop: rgba(0, 0, 0, .45);
  /* The desktop app's palette (ui/design_tokens.py), name for name, as the single source of colour; the role variables below point at it. */
  --primary: #5e4b2a; --primary-hover: #4d3d22; --primary-pressed: #3c3019; --primary-light: #8a6d3f; --accent: #c9a96e;
  --success: #16a34a; --success-bg: #dcfce7; --success-text: #166534; --success-hover: #15803d; --success-pressed: #166534;
  --warning: #b45309; --warning-bg: #fef3c7; --warning-text: #92400e; --warning-strong: #f59e0b;
  --danger: #dc2626; --danger-bg: #fee2e2; --danger-text: #c1121f; --info-bg: #efe7d8; --info-text: #5e4b2a;
  --grey-50: #f5f6fa; --grey-100: #f8fafc; --grey-150: #eef2f7; --grey-200: #e5e7eb; --grey-250: #e2e8f0; --grey-300: #cbd5e1; --grey-400: #9ca3af;
  --grey-600: #475569; --grey-700: #334155; --grey-800: #1e293b; --grey-900: #111827; --text-dark: #1f2937; --white: #ffffff;
  --selection-bg: #efe4c9; --selection-text: #111827;
  --bg: var(--grey-50); --fg: var(--text-dark); --card: var(--white); --line: var(--grey-300); --muted: var(--grey-600);
  --ok: var(--success-text); --ok-bg: var(--success-bg); --warn: var(--warning-text); --warn-bg: var(--warning-bg); --bad: var(--danger-text); --bad-bg: var(--danger-bg);
  --info: var(--info-text); --neutral: var(--grey-700); --neutral-bg: var(--grey-200); --select-bg: var(--selection-bg);
  --on-primary: var(--white); --focus: #1d4ed8; --demo: var(--warning-strong);
  /* the help icon ("?") and its text */
  --help-icon-bg: var(--neutral-bg); --help-icon-fg: var(--neutral); --help-icon-line: var(--line); --help-tip-bg: var(--fg); --help-tip-fg: var(--card); --fs-help: 13px; --help-w: 22rem;
  --ms-gray: #888780; --ms-teal: #1d9e75; --ms-purple: #534ab7; --ms-amber: #ba7517; --ms-blue: #378add; --ms-coral: #d85a30; --ms-green: #639922; --ms-pink: #d4537e;
  --chart-1: var(--ms-teal); --chart-2: var(--ms-purple); --chart-3: var(--ms-amber); --chart-4: var(--ms-blue); --chart-5: var(--ms-coral); --chart-6: var(--ms-green); --chart-7: var(--ms-pink); --chart-8: var(--ms-gray); --chart-gap: var(--card); --pie-size: 220px;   /* charts: a legend of text always goes with them */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --primary: #c9a96e; --primary-hover: #dbbf8a; --primary-light: #8a6d3f; --accent: #c9a96e;
    --bg: #14161b; --fg: #e8eaf0; --card: #1d2027; --line: #343944; --muted: #aab1bf;
    --ok: #86efac; --ok-bg: #123a22; --warn: #fcd34d; --warn-bg: #3a2c0a; --bad: #ff8a8a; --bad-bg: #4a1519;
    --info: #e9d7b0; --info-bg: #3a3122; --neutral: #cbd5e1; --neutral-bg: #2b303a; --select-bg: #3a3122;
    --on-primary: #14161b; --focus: #93b4ff;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: var(--fs-base)/1.5 var(--font-body); background: var(--bg); color: var(--fg); }
a { color: var(--primary); } a:hover { color: var(--primary-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-xs); }
h1 { font-size: var(--fs-h1); margin: 0 0 var(--s3); } h2 { font-size: var(--fs-h2); margin: var(--s4) 0 var(--s2); } h3 { font-size: var(--fs-h3); margin: var(--s3) 0 var(--s1); }
.sr { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.skip { position: absolute; left: -999px; top: 0; background: var(--card); padding: var(--s2) var(--s3); z-index: 100; }
.skip:focus { left: var(--s2); top: var(--s2); }

/* ---- shell ---- */
.banner { background: var(--demo); color: var(--on-demo); padding: var(--s2) var(--s4); font-weight: 700; text-align: center; }
.topbar { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) var(--s4); background: var(--primary); color: var(--on-primary); flex-wrap: wrap; }
.topbar a, .topbar button.link { color: var(--on-primary); }
.brand { font-weight: 700; font-size: var(--fs-h2); text-decoration: none; letter-spacing: .2px; }
.spacer { flex: 1; }
.who { font-size: var(--fs-small); opacity: .95; }
.topbar form { margin: 0; }
.gsearch { display: flex; gap: var(--s2); align-items: center; } .gsearch input { width: var(--search-w); max-width: 100%; margin: 0; min-height: var(--search-h); height: var(--search-h); padding-top: 0; padding-bottom: 0; }
.gsearch button { min-height: var(--search-h); height: var(--search-h); }
.gsearch button { margin: 0; }
.shell { display: flex; align-items: flex-start; min-height: calc(100vh - 56px); }
.sidebar { width: var(--sidebar-w); flex: 0 0 var(--sidebar-w); padding: var(--s3); background: var(--card); border-right: 1px solid var(--line); position: sticky; top: 0; align-self: stretch; }
.sidebar h2 { font-size: var(--fs-caps); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: var(--s4) var(--s2) var(--s1); }
.sidebar a { display: flex; align-items: center; gap: var(--s2); min-height: var(--tap); padding: 0 var(--s3); border-radius: var(--radius); text-decoration: none; color: var(--fg); }
.sidebar a:hover { background: var(--info-bg); }
.sidebar a[aria-current="page"] { background: var(--select-bg); font-weight: 700; box-shadow: inset 3px 0 0 var(--primary); }
kbd { font: 600 var(--fs-key)/1 var(--font-mono); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: var(--radius-xs); padding: 2px 5px; background: var(--bg); color: var(--muted); }
.sidebar .sample { font-size: var(--fs-micro); color: var(--muted); }
.menu-toggle { display: none; }
main { flex: 1; min-width: 0; max-width: var(--content-w); margin: 0 auto; padding: var(--s5) var(--s4) 64px; }
main.narrow { max-width: var(--narrow-w); }
.crumbs { color: var(--muted); font-size: var(--fs-small); margin-bottom: var(--s2); }

/* ---- cards, messages ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--s4) var(--s5); margin-bottom: var(--s4); }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: var(--s3); margin-bottom: var(--s4); }
@media (max-width: 1000px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cards.cards-five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.cards.cards-five .figure { padding: var(--s3); }
@media (max-width: 1000px) { .cards.cards-five { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .cards.cards-five { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rowactions { display: flex; justify-content: space-between; gap: var(--s5); min-width: 11em; }
.cards > * { min-width: 0; }
.cards .figure { height: 100%; }
.card-link { display: block; color: inherit; text-decoration: none; height: 100%; }
.card-link[aria-current="true"] .figure { outline: 2px solid var(--primary); background: var(--select-bg); }
.figure .hint-open { font-size: var(--fs-small); color: var(--muted); margin-top: var(--s1); }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--s3) var(--s4); margin-bottom: var(--s4); }
.panel header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--s2); margin-bottom: var(--s2); }
.panel h2 { margin: 0; } .panel .more { font-weight: 600; }
tr[data-href] { cursor: pointer; }
a.open-link { font-weight: 600; white-space: nowrap; display: inline-block; min-height: var(--tap); line-height: var(--tap); }
/* ---- the ONE compact period bar (components/period_bar.html): one row, wraps only when the screen is narrow ---- */
.card.period { padding: var(--s2) var(--s3); }
.pbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s2) var(--s3); }
.pbar .pf { display: flex; flex-direction: column; } .pbar .pf[hidden] { display: none; }
.pbar label { margin: 0 0 var(--s1); font-size: var(--fs-small); font-weight: 600; }
.pbar select, .pbar input, .pbar button { width: auto; margin: 0; min-height: var(--tap); }
.pbar .pshow { margin: 0; align-self: center; font-size: var(--fs-small); }
.pbar-embedded { margin: var(--s2) 0; }
.card-link:hover .figure, .card-link:focus-visible .figure { outline: 2px solid var(--accent, currentColor); }
.figure { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--s3) var(--s4); }
.figure .label { font-size: var(--fs-small); color: var(--muted); } .figure .value { font-size: var(--fs-figure); font-weight: 700; }
.error { color: var(--bad); font-weight: 600; } .ok { color: var(--ok); font-weight: 600; } .muted { color: var(--muted); }
.notice, .alert { border-radius: var(--radius); padding: var(--s3) var(--s4); margin-bottom: var(--s3); font-weight: 600; }
.notice { background: var(--ok-bg); color: var(--ok); } .alert { background: var(--bad-bg); color: var(--bad); }
.empty { text-align: center; padding: var(--s5); color: var(--muted); } .empty strong { display: block; color: var(--fg); font-size: var(--fs-h2); }
code.codes { display: block; font: 600 var(--fs-code)/1.8 var(--font-mono); letter-spacing: 1px; word-break: break-all; }
dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; margin: 0; }

/* ---- forms and buttons ---- */
label { display: block; margin: var(--s3) 0 var(--s1); font-weight: 600; }
.req::after { content: " *"; color: var(--bad); }
input[type=text], input[type=password], input[type=email], input[type=date], input[type=search], input[type=number], select, textarea {
  width: 100%; max-width: var(--field-w); min-height: var(--tap); padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--fg); font: inherit; }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--bad); outline: 1px solid var(--bad); }
.field-error { color: var(--bad); font-size: var(--fs-small); font-weight: 600; }
.help { color: var(--muted); font-size: var(--fs-small); }
input[type=checkbox] { width: 20px; height: 20px; vertical-align: middle; margin-right: var(--s2); }
button, .btn { display: inline-flex; align-items: center; justify-content: center; min-height: var(--tap); padding: 0 var(--s4); margin-top: var(--s3); border-radius: var(--radius);
  border: 1px solid var(--primary); background: var(--primary); color: var(--on-primary); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
button:hover, .btn:hover { background: var(--primary-hover); color: var(--on-primary); }
button.secondary, .btn.secondary { background: transparent; color: var(--primary); }
.btn.small, button.small { min-height: 30px; padding: 0 var(--s3); font-size: var(--fs-small); }
button.danger, .btn.danger { background: var(--bad); border-color: var(--bad); color: var(--on-danger); }
button.link { background: none; border: none; min-height: 0; padding: 0; margin: 0; font-weight: 400; text-decoration: underline; }
.htmx-request button[type=submit] { opacity: .6; cursor: progress; }
.htmx-indicator { opacity: 0; transition: opacity .2s; } .htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }

/* ---- tables ---- */
.tablebox { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--s3); margin-bottom: var(--s4); }
.tablebar { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; margin-bottom: var(--s2); }
.tablebar form { margin: 0; flex: 1 1 260px; } .tablebar input[type=search] { max-width: 360px; }
.perpage { display: flex; gap: var(--s1); align-items: center; font-size: var(--fs-small); color: var(--muted); }
.perpage a { padding: 4px 10px; border-radius: var(--radius-sm); text-decoration: none; border: 1px solid var(--line); }
.perpage a[aria-current="true"] { background: var(--select-bg); font-weight: 700; color: var(--fg); }
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.grid { border-collapse: collapse; width: 100%; font-size: var(--fs-table); }
table.grid th, table.grid td { border-bottom: 1px solid var(--line); padding: 10px 10px; text-align: left; vertical-align: top; }
table.grid th { white-space: nowrap; font-size: var(--fs-caps); text-transform: uppercase; letter-spacing: .03em; color: var(--muted); position: sticky; top: 0; background: var(--card); }
#tbl-bookings table.grid th, #tbl-bookings table.grid td { padding: var(--s2) var(--s2); font-size: var(--fs-small); }
#tbl-bookings table.grid th { white-space: normal; vertical-align: bottom; }
#tbl-bookings table.grid td.num, #tbl-bookings table.grid td:nth-child(3), #tbl-bookings table.grid td:nth-child(4) { white-space: nowrap; }
@media (max-width: 1100px) { .hide-tablet { display: none; } }
table.grid th a { color: inherit; text-decoration: none; display: inline-block; min-height: 24px; }
table.grid th[aria-sort="ascending"] a::after { content: " \25B2"; } table.grid th[aria-sort="descending"] a::after { content: " \25BC"; }
table.grid tbody tr:hover { background: var(--select-bg); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.danger { color: var(--bad); font-weight: 600; }
.pager { display: flex; gap: var(--s1); align-items: center; flex-wrap: wrap; margin-top: var(--s3); }
.pager a, .pager span.page { min-width: var(--tap); min-height: var(--tap); display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; padding: 0 var(--s2); }
.pager a[aria-current="page"], .pager span.current { background: var(--primary); color: var(--on-primary); border-color: var(--primary); font-weight: 700; }
.pager .count { margin-left: auto; color: var(--muted); font-size: var(--fs-small); }
.pill { display: inline-block; padding: 2px 10px; border-radius: var(--radius-pill); font-size: var(--fs-caps); font-weight: 600; }
.pill.ready { border: 2px solid var(--ok); box-shadow: 0 0 0 2px var(--ok-bg); padding: 0 8px; }
.pill.success { background: var(--ok-bg); color: var(--ok); } .pill.warning { background: var(--warn-bg); color: var(--warn); }
.pill.danger { background: var(--bad-bg); color: var(--bad); } .pill.info { background: var(--info-bg); color: var(--info); } .pill.neutral { background: var(--neutral-bg); color: var(--neutral); }

/* ---- dialogs ---- */
dialog { border: 1px solid var(--line); border-radius: var(--radius-xl); padding: 0; max-width: min(var(--dialog-w), calc(100vw - 24px)); width: 100%; background: var(--card); color: var(--fg); }
dialog::backdrop { background: var(--backdrop); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 0; font-size: var(--fs-h2); } .dialog-body { padding: var(--s4); }
.dialog-actions { display: flex; gap: var(--s2); justify-content: flex-end; flex-wrap: wrap; }
.keys { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.hint { position: fixed; right: var(--s4); bottom: var(--s4); background: var(--primary); color: var(--on-primary); padding: var(--s2) var(--s3); border-radius: var(--radius); font-weight: 600; z-index: 50; }

/* ---- tablet and phone ---- */
@media (max-width: 900px) {
  .shell { display: block; }
  .sidebar { display: none; width: auto; position: static; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar.open { display: block; }
  .menu-toggle { display: inline-flex; margin: 0; background: transparent; border-color: var(--on-primary); color: var(--on-primary); }
  main { padding: var(--s4) var(--s3) 48px; }
  .card { padding: var(--s3) var(--s4); }
  .who { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print { .topbar, .sidebar, .pager, .tablebar { display: none; } }

fieldset.group { border: 1px solid var(--line); border-radius: var(--radius-sm); margin-top: var(--s3); }
.group-title { margin: 10px 0 2px; } label.plain { font-weight: 400; margin: 2px 0; } .after { margin-top: var(--s4); } table.grid.spaced { margin-top: var(--s4); }
.figure.inline { display: inline-block; }

.tabs { display: flex; flex-wrap: wrap; gap: var(--s1); margin: var(--s4) 0 0; }
.tabs a { min-height: var(--tap); display: inline-flex; align-items: center; padding: 0 var(--s3); border: 1px solid var(--line); border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0; text-decoration: none; background: var(--bg); }
.tabs a[aria-current="page"] { background: var(--card); font-weight: 700; box-shadow: inset 0 3px 0 var(--primary); }
#tab-panel { border-top-left-radius: 0; }
.pre { white-space: pre-wrap; } ul.notes, ul.checklist { list-style: none; padding: 0; } ul.notes li, ul.checklist li { padding: var(--s2) 0; border-bottom: 1px solid var(--line); }
form.inline { display: inline; margin: 0; } form.inline button { margin: 0 0 0 var(--s2); min-height: 0; padding: var(--s1) var(--s2); }

/* Calendar work notes */
.done-note { text-decoration: line-through; }
.inline-form { display: inline; }

/* W11.10 Milestones timeline */
.ms-bar { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.ms-seg a { display: inline-block; padding: var(--s1) var(--s3); border: 1px solid var(--line); text-decoration: none; }
.ms-seg a[aria-current="page"] { background: var(--accent); color: var(--on-demo); font-weight: 600; }
.ms-goal { display: flex; gap: var(--s3); align-items: center; padding: var(--s1) 0; }
.ms-goal > span:first-child { flex: 1; }
.ms-goal progress { width: 140px; height: var(--s2); accent-color: var(--accent); }
.ms-year { margin-top: var(--s4); }
.ms-line { list-style: none; margin: 0 0 var(--s4) var(--s3); padding: 0 0 0 var(--s5); border-left: 2px solid var(--line); }
.ms-item { position: relative; margin: 0 0 var(--s3); padding: var(--s3); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); --dot: var(--ms-gray); }
.ms-item::before { content: ""; position: absolute; left: calc(-1 * var(--s5) - var(--s2)); top: var(--s4); width: var(--s3); height: var(--s3); border-radius: var(--radius-pill); background: var(--dot); border: 2px solid var(--card); }
.ms-teal { --dot: var(--ms-teal); } .ms-purple { --dot: var(--ms-purple); } .ms-amber { --dot: var(--ms-amber); } .ms-blue { --dot: var(--ms-blue); }
.ms-coral { --dot: var(--ms-coral); } .ms-green { --dot: var(--ms-green); } .ms-pink { --dot: var(--ms-pink); }
.ms-date { font-size: var(--fs-small); color: var(--muted); }
.ms-title { font-weight: 600; }
.ms-star { color: var(--accent); font-size: var(--fs-h2); }
.ms-tag { display: inline-block; padding: 1px var(--s3); margin-right: var(--s2); border-radius: var(--radius); border: 1px solid var(--dot); font-size: var(--fs-small); }
.ms-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--s3); } .ms-item > * { grid-column: 1; } .ms-item > .ms-act { grid-column: 2; grid-row: 1 / span 3; align-self: start; white-space: nowrap; }

.spaced-form { margin-top: var(--s3); }

/* ---- Booking detail: a compact summary and an action bar with Edit apart from Complete and Cancel ---- */
.actionbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--s4); margin: 0 0 var(--s3); }
.actions-end { display: flex; gap: var(--s4); flex-wrap: wrap; margin-left: auto; }
.summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3) var(--s5); }
.summary .sgroup h2 { margin: 0 0 var(--s2); font-size: var(--fs-small); color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.sgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2) var(--s4); margin: 0; }
.sgrid dt { font-size: var(--fs-small); color: var(--muted); } .sgrid dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.summary .swide { grid-column: 1 / -1; } .sreq { margin: 0; white-space: pre-wrap; }
@media (max-width: 700px) { .summary { grid-template-columns: minmax(0, 1fr); } }

/* ---- Calendar: a month grid, Monday to Sunday ---- */
.calbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); margin-bottom: var(--s2); }
.callabel { font-size: var(--fs-h2); min-width: 7em; text-align: center; }
.seg { display: inline-flex; margin-left: auto; } .seg a { padding: var(--s2) var(--s3); border: 1px solid var(--line); text-decoration: none; }
.seg a[aria-current="page"] { background: var(--select-bg); font-weight: 700; }
.calgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); background: var(--card); margin-bottom: var(--s4); }
.calhead { padding: var(--s2); font-size: var(--fs-caps); text-transform: uppercase; color: var(--muted); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; }
.calday { min-height: 6.5rem; padding: var(--s1); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.calday.out { background: var(--bg); color: var(--muted); } .calday.has { background: var(--warn-bg); } .calday.out.has { background: var(--bg); }
.calday.today { box-shadow: inset 0 0 0 2px var(--primary); }
.calnum { font-weight: 700; text-decoration: none; align-self: flex-start; padding: 0 var(--s1); }
.calchip { display: block; font-size: var(--fs-micro); line-height: 1.3; padding: 1px var(--s1); border-radius: var(--radius-xs); background: var(--card); border: 1px solid var(--line); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg); }
.calchip.departure { border-left: 3px solid var(--ok); } .calchip.return { border-left: 3px solid var(--primary-light); } .calchip.task { border-left: 3px solid var(--bad); } .calchip.note { border-left: 3px solid var(--accent); }
.calmore { font-size: var(--fs-micro); font-weight: 700; }
@media (max-width: 700px) { .calday { min-height: 4rem; } .calchip { color: transparent; height: 6px; padding: 0; border-radius: var(--radius-pill); } .calmore { font-size: var(--fs-micro); } }

/* ---- Company Funds ---- */
.ledgeractions { display: flex; gap: var(--s2); margin: var(--s2) 0 var(--s4); } .ledgeractions .btn { margin: 0; }
.ledgerbar { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; }

/* Calendar (UI batch E, C): month and year selectors, day cells that open a pop-up, the pop-up's items */
.calpick { display: inline-flex; gap: var(--s2); align-items: center; margin: 0; }
.calpick select { width: auto; min-width: 5em; }
.calday[data-day] { cursor: pointer; }
ul.dayitems { list-style: none; padding: 0; margin: 0 0 var(--s3); }
.dayitem { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: var(--s2); border-bottom: 1px solid var(--line); }
.dayitem:focus-within, .dayitem:focus { outline: 2px solid var(--primary); outline-offset: -2px; }
.dayactions { display: inline-flex; gap: var(--s2); flex: none; }
.dayrow { display: flex; gap: var(--s2); }
.dayrow input { flex: 1; }

/* Compact forms (UI batch E): two columns, long fields span both; a field can be hidden until another field has a value (data-show-when) */
form.compact { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--s5); align-items: start; }
form.compact > .fld.wide, form.compact > .formbtns { grid-column: 1 / -1; }
form.compact .fld input, form.compact .fld select, form.compact .fld textarea { margin-bottom: var(--s2); }
form.compact textarea { min-height: 4.5em; }
@media (max-width: 700px) { form.compact { grid-template-columns: 1fr; } }
/* The tight form (UI batch I: Add expense / Add income): three narrow columns, smaller fields, a narrow panel */
.card.tightcard { max-width: 860px; padding: var(--s3) var(--s4); } .tightcard h1 { margin-bottom: var(--s2); }
form.compact.tight { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 var(--s4); }
form.compact.tight .fld label { font-size: var(--fs-small); }
form.compact.tight .fld input, form.compact.tight .fld select, form.compact.tight .fld textarea { min-height: 32px; padding: 4px 8px; margin-bottom: var(--s1); }
form.compact.tight textarea { min-height: 3em; }
@media (max-width: 700px) { form.compact.tight { grid-template-columns: 1fr; } }
.formbtns { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; margin-top: var(--s2); }
.fld[hidden] { display: none; }
td.danger a { color: inherit; text-decoration: underline; }

/* One compact row for a list page's own controls (UI batch E, G) */
.actionrow { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); margin: 0 0 var(--s3); }
.actionrow .btn { margin: 0; }

/* Finance and list pages (UI batch E, H): figures side by side */
.sumrow { display: flex; flex-wrap: wrap; gap: var(--s3); margin: 0 0 var(--s3); }
.sumrow .figure { flex: 1 1 12rem; padding: var(--s2) var(--s3); display: flex; flex-direction: column; gap: 2px; }
.sumrow .figure .value { font-size: var(--fs-figure); }
.flines { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: var(--s3); }
.fline { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--s2) var(--s3); background: var(--card); min-width: 0; }
.fline .label { font-size: var(--fs-small); color: var(--muted); }
.fline .value { font-size: var(--fs-figure); font-weight: 700; }
.fline .value.danger { color: var(--bad); }
.fline .note { font-size: var(--fs-small); color: var(--muted); }
.fline.total { border-color: var(--primary); background: var(--select-bg); }

/* Collapsible left-menu groups (UI batch E, I): click the group, the items show; the group with the current page starts open */
.sidebar details.navgroup { margin: 0; }
.sidebar details.navgroup > summary { display: flex; align-items: center; gap: var(--s2); min-height: var(--tap); padding: 0 var(--s3); border-radius: var(--radius); cursor: pointer; list-style: none; color: var(--fg); }
.sidebar details.navgroup > summary::-webkit-details-marker { display: none; }
.sidebar details.navgroup > summary::before { content: "\25B8"; font-size: var(--fs-small); color: var(--muted); }
.sidebar details.navgroup[open] > summary::before { content: "\25BE"; }
.sidebar details.navgroup > summary:hover { background: var(--info-bg); }
.sidebar details.navgroup > a { padding-left: calc(var(--s3) + var(--s4)); }

/* Goals & Performance (owner, 2026-11-24): FY bar, progress table, compact settings */
.kpibar { padding: var(--s3) var(--s4); }
.fybar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); margin: 0; }
.fybar select { width: auto; min-width: 9em; margin: 0; }
.fyactions { margin-left: auto; display: inline-flex; gap: var(--s2); }
table.kpitable th[scope="row"] { font-weight: 600; text-align: left; }
.kpiprog progress { width: 9rem; height: .8rem; vertical-align: middle; accent-color: var(--primary); }
.kpiform table input { margin: 0; max-width: 16rem; }
.kpiform .kpiadd { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); max-width: 44rem; }
@media (max-width: 700px) { .kpiform .kpiadd { grid-template-columns: 1fr; } .fyactions { margin-left: 0; } }
.cards.cards-five .figure .value { font-size: var(--fs-figure-sm); } .cards.cards-five .figure .label { font-size: var(--fs-caps); }

/* ---- Special requirements (batch S): one slim line in coloured text, the same size as the rest - no framed or filled box ---- */
.sreqline { margin: 0; font-size: inherit; color: var(--warning-text); }
.summary .sreqline { grid-column: 1 / -1; }
.sreqline .sreqmark { font-weight: 600; }
.sreqline .sreq { white-space: pre-wrap; }

/* ---- ONE back-link pattern (UI batch F1 F): a text link above the heading, the same on every page ---- */
.backrow { margin: 0 0 var(--s2); font-size: var(--fs-small); }
a.back { text-decoration: none; font-weight: 600; }
a.back:hover, a.back:focus-visible { text-decoration: underline; }

/* ---- Company Expenses / Income (UI batch F1 F): the period total sits in the period bar's free space; a reversed entry is struck through ---- */
.pbar .ptotal { flex-direction: row; align-items: baseline; gap: var(--s2); margin-left: auto; order: 9; }
.pbar .ptotal .value { font-size: var(--fs-figure); }
tr.reversed td, tr.reversed td a { text-decoration: line-through; color: var(--muted); }

/* ---- Finance statements as compact tables (UI batch F1 G): P&L (both bases) and Cash Flow ---- */
table.statement { width: auto; min-width: min(100%, 32rem); }
table.statement td, table.statement th { padding: 4px var(--s3); }
table.statement tr.total td { font-weight: 700; background: var(--select-bg); }

/* ---- UI batch F2 A: closed tasks, reminders and notes stay where they are, struck through, with the initials of who closed them ---- */
.closed, a.closed { text-decoration: line-through; color: var(--muted); }
.by { display: inline-block; font-size: var(--fs-small); font-weight: 700; color: var(--muted); letter-spacing: .03em; }
tr.taskdone td { background: var(--ok-bg); }
tr.taskdone td .by { color: var(--ok); display: block; }
tr.reversed td .by { display: block; text-decoration: none; }
.warnbox { background: var(--warn-bg); color: var(--warn); border-radius: var(--radius); padding: var(--s2) var(--s3); margin: 0 0 var(--s3); } .warnbox[hidden] { display: none; }

/* ---- Add Booking: Import from PDF and the Brief itinerary draft ---- */
.pdfimport { margin-bottom: var(--s3); }
fieldset.itinrow { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s2) var(--s3); margin: 0 0 var(--s2); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s1) var(--s2); }
fieldset.itinrow legend { font-size: var(--fs-small); color: var(--muted); padding: 0 var(--s1); }
@media (max-width: 900px) { fieldset.itinrow { grid-template-columns: minmax(0, 1fr); } }

/* ---- Add Booking (UI batch H): the choice, plain payment lines, the read-only itinerary ---- */
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); margin-bottom: var(--s3); }
@media (max-width: 700px) { .choices { grid-template-columns: minmax(0, 1fr); } }
a.choice { display: flex; flex-direction: column; gap: var(--s2); text-decoration: none; color: var(--fg); padding: var(--s4); }
a.choice strong { font-size: var(--fs-h2); }
a.choice:hover, a.choice:focus-visible { outline: 2px solid var(--primary); }
ul.paylines { margin: 0 0 var(--s2); padding-left: var(--s4); }
ol.itinread, ol.itinplain { margin: 0; padding-left: var(--s5); }
ol.itinread li, ol.itinplain li { margin: 0 0 var(--s1); }
.card details > summary { cursor: pointer; font-weight: 600; }
[data-when-checked][hidden] { display: none; }

/* ---- The help icon: ONE component for every explanation (THEME variables --help-*) ---- */
.helptip { display: inline-block; position: relative; vertical-align: middle; margin-left: 0; white-space: nowrap; font-size: var(--fs-small); font-weight: 400; text-transform: none; letter-spacing: normal; }
button.helpicon { display: inline-flex; align-items: center; justify-content: center; width: 1.4em; height: 1.4em; min-height: 0; padding: 0; margin: 0; border-radius: var(--radius-pill);
  border: 1px solid var(--help-icon-line); background: var(--help-icon-bg); color: var(--help-icon-fg); font-size: var(--fs-help); font-weight: 700; line-height: 1; cursor: help; }
button.helpicon:hover, button.helpicon[aria-expanded="true"] { border-color: var(--primary); }
.helptext { position: fixed; z-index: 30; max-width: min(var(--help-w), calc(100vw - 2 * var(--s3))); padding: var(--s2) var(--s3); border-radius: var(--radius); background: var(--help-tip-bg); color: var(--help-tip-fg);
  font-size: var(--fs-small); font-weight: 400; line-height: 1.4; text-align: left; box-shadow: 0 2px 8px var(--backdrop);
  clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; white-space: nowrap; }
.helptip.open .helptext, .helpicon:focus-visible + .helptext { clip-path: none; width: max-content; height: auto; overflow: visible; white-space: normal; }
@media (hover: hover) { .helptip:hover .helptext { clip-path: none; width: max-content; height: auto; overflow: visible; white-space: normal; } }
.bignumber { font-size: var(--fs-figure); font-weight: 700; margin: 0 0 var(--s3); }
.actionrow .far { margin-left: auto; padding-left: var(--s5); border-left: 1px solid var(--line); } .actionrow .far .btn { margin: 0; }
.actionrow .toggle { margin-left: auto; font-size: var(--fs-small); padding: 2px var(--s2); border: 1px solid var(--line); border-radius: var(--radius-pill); text-decoration: none; background: var(--card); }
/* ---- Export page (batch J): period and format on top, the reports as tick boxes in columns ---- */
.exporttop .exportrow { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); align-items: flex-end; margin-top: var(--s2); }
.exporttop .exportrow input, .exporttop .exportrow select { width: auto; min-width: 12rem; }
.exportlist { columns: 2 16rem; column-gap: var(--s5); } .exportlist label { display: block; break-inside: avoid; }
/* ---- Add booking (batch J): the customer's details first, and the "Is this the same person?" question ---- */
.custfields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--s4); }
@media (max-width: 700px) { .custfields { grid-template-columns: 1fr; } }
.dupask { border: 1px solid var(--warn); background: var(--warn-bg); border-radius: var(--radius); padding: var(--s3) var(--s4); margin-top: var(--s3); }
.dupask label { display: block; margin: var(--s1) 0; }
/* ---- The header clocks (batch J): Sydney at the left, Vietnam at the right, each with its date; the difference in small text ---- */
.clock { display: grid; grid-template-columns: auto auto; column-gap: var(--s2); align-items: baseline; line-height: 1.15; font-size: var(--fs-small); }
.clock .clabel { font-size: var(--fs-caps); opacity: .9; } .clock .ctime { font-size: var(--fs-h3); font-variant-numeric: tabular-nums; }
.clock .cdate { grid-column: 1 / -1; font-size: var(--fs-caps); opacity: .9; }
@media (max-width: 700px) { .clock .cdate { display: none; } }
/* ---- Round avatars (batch J): a person's photo, or their initials inside the same circle ---- */
.avatar { display: inline-flex; align-items: center; justify-content: center; width: var(--avatar); height: var(--avatar); border-radius: var(--radius-round); overflow: hidden; flex: 0 0 auto;
  background: var(--neutral-bg); color: var(--neutral); font-size: var(--fs-micro); font-weight: 700; letter-spacing: 0; vertical-align: middle; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.large { width: var(--avatar-large); height: var(--avatar-large); font-size: var(--fs-h2); }
.topbar .who { display: inline-flex; align-items: center; gap: var(--s2); text-decoration: none; }
.topbar .who .avatar { width: var(--avatar-header); height: var(--avatar-header); border: 1px solid var(--accent); }
.photoshow { display: flex; align-items: center; gap: var(--s4); margin: var(--s3) 0; }
.narrowcard { max-width: var(--narrow-w); }
/* ---- Compact form grids (batch L): Add Booking's booking details, the customer and every supplier cost line; one column on a narrow screen ---- */
.grid3, .grid4 { display: grid; gap: 0 var(--s4); align-items: start; margin-bottom: var(--s2); }
.grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid3 > *, .grid4 > * { min-width: 0; }
.grid3 .span2, .grid4 .span2 { grid-column: span 2; } .grid3 .span3 { grid-column: 1 / -1; }
.grid3 input, .grid3 select, .grid3 textarea, .grid4 input, .grid4 select { max-width: none; }
.grid4 fieldset.group { margin: 0; } label.inline { display: inline-flex; margin-right: var(--s4); }
.costrow { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s2) var(--s3) var(--s3); margin: 0 0 var(--s3); }
.costrow > legend { font-weight: 700; padding: 0 var(--s1); }
.costrow .audfigs p, .costrow .recorded { margin: var(--s2) 0 0; }
textarea.autogrow { min-height: var(--tap); resize: vertical; overflow: hidden; }
@media (max-width: 800px) { .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .grid3, .grid4 { grid-template-columns: minmax(0, 1fr); } .grid3 .span2, .grid4 .span2 { grid-column: auto; } }
/* ---- The paid-now calculation of a supplier cost line (batch M): Paid now (VND) ÷ Exchange rate = Paid now (AUD), boxes on one row with the operators ---- */
.calcrow { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s2) var(--s3); margin-bottom: var(--s2); }
.calcrow .calcbox { flex: 1 1 10rem; min-width: 0; } .calcrow .calcbox input { max-width: none; }
.calcrow .calcop { font-size: var(--fs-h2); font-weight: 700; padding-bottom: var(--s3); color: var(--muted); }
input.readonly { background: var(--bg); color: var(--fg); border-style: dashed; }
/* ---- Goals & Performance (batch N): goals with a horizontal progress bar; theme variables only, light and dark ---- */
.goalpick { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); } .goalpick select { width: auto; min-width: 16rem; } .goalpick button, .goalpick label { margin: 0; }
.goalhead { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); } .goalhead .btn { margin: 0; }
.goallist { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.goalitem h3 { margin: 0; display: inline; } .goaltop { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s2) var(--s3); }
.goalclosed { opacity: .8; } .goaldesc { margin: var(--s2) 0; white-space: pre-line; } .goalnote { margin: var(--s2) 0 0; white-space: pre-line; } .goallinks { margin: var(--s2) 0 0; }
.goalprogress { display: flex; align-items: center; gap: var(--s3); margin-top: var(--s2); } .goalpct { white-space: nowrap; }
/* batch AG: the reward of a company goal, and the one line style of the small inline icons */
.icon { vertical-align: -0.15em; flex: none; } .goalreward { margin: var(--s3) 0 0; padding: var(--s3); border: 1px solid var(--line); border-radius: var(--radius); }
.goalreward h4 { margin: 0 0 var(--s2); display: flex; align-items: center; gap: var(--s2); } .rewarddesc { margin: 0 0 var(--s2); white-space: pre-line; }
.rewardimg { display: block; max-width: 100%; height: auto; margin: var(--s2) 0; border-radius: var(--radius); } .rewardown { font-weight: 600; }
.rewardoverride { display: flex; flex-wrap: wrap; align-items: end; gap: var(--s2); margin-top: var(--s3); }
/* batch AH: the Balance Sheet in the accountant's layout */
.bstitle { margin-bottom: 0; } .bssub { margin-top: var(--s1); color: var(--muted); } .bstable th.ind0, .bstable td.ind0 { padding-left: var(--s2); }
.bstable .ind1 { padding-left: var(--s4); } .bstable .ind2 { padding-left: var(--s5); } .bstable tr.bssection th { padding-top: var(--s3); }
.bstable tr.bssub th { font-weight: 600; } .bstable tr.bstotal td { font-weight: 700; } .bsnote h3 { margin-bottom: var(--s1); }
progress.goalbar { flex: 1 1 auto; appearance: none; -webkit-appearance: none; height: var(--s3); border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--neutral-bg); overflow: hidden; }
progress.goalbar::-webkit-progress-bar { background: var(--neutral-bg); }
progress.goalbar::-webkit-progress-value { background: var(--primary); border-radius: var(--radius-pill); }
progress.goalbar::-moz-progress-bar { background: var(--primary); border-radius: var(--radius-pill); }
.goalentities form.inline { display: inline-flex; flex-wrap: wrap; gap: var(--s2); align-items: center; margin: 0 var(--s3) var(--s2) 0; } .goalentities input[type=text] { width: auto; min-width: 14rem; }
.goalentities button { margin: 0; } .entityrow { margin-top: var(--s2); } .entityrow.archived { color: var(--muted); }
.sumrow.compact { gap: var(--s2); margin: 0 0 var(--s2); } .sumrow.compact .figure { flex: 0 1 auto; min-width: 9rem; padding: var(--s1) var(--s3); } .sumrow.compact .figure .label { font-size: var(--fs-caps); } .sumrow.compact .figure .value { font-size: var(--fs-h3); }
/* ---- Goals & Performance, batch O: real buttons (History, Update progress) and Edit apart on the far right; the ONE period control ---- */
.goalactions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin-top: var(--s3); } .goalactions .btn { margin: 0; text-decoration: none; }
.goalactions .goaledit { margin-left: auto; }
.goalpick { margin-bottom: var(--s3); } .goalpick select { width: auto; min-width: 18rem; }
.goalcompleted { margin-top: var(--s4); } .goalcompleted summary { cursor: pointer; } .goalcompleted .goalitem { padding: var(--s3) 0; border-top: 1px solid var(--line); }
.periodctl .monthgrid { margin-top: var(--s2); } .periodctl .monthrow { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s3); margin-bottom: var(--s1); } .periodctl .monthrow .muted { min-width: 6.5rem; }
.ms-withdrawn .ms-title { text-decoration: line-through; opacity: .7; }

/* Batch P: ONE size for a note box everywhere (one line that grows as you type), also inside the compact form grids; a plain figure ("Still owing: ...") above a payment form. */
form.compact textarea.autogrow, form.compact.tight textarea.autogrow { min-height: var(--tap); }
p.owing { margin: 0 0 var(--s2); } p.overpay { margin: 0 0 var(--s2); }

/* Batch R: Company funds - settled lines lighter (still readable); the two actions on the left of the ledger bar, the Hide settled toggle on the right */
tr.settled td { color: var(--muted); }
.ledgerbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s3); margin: 0 0 var(--s2); }
.ledgerbar .ledgeractions { display: flex; flex-wrap: wrap; gap: var(--s2); }

/* Batch R: the booking page's money tabs - every block a title with its action on the same line; the itinerary adds no numbers; the cost row's dates far apart */
.blockhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s3); margin: var(--s4) 0 var(--s2); }
.blockhead:first-child { margin-top: 0; } .blockhead h2 { margin: 0; } .blockactions { display: flex; flex-wrap: wrap; gap: var(--s2); }
ul.itinread, ul.itinplain { list-style: none; margin: 0; padding-left: 0; } ul.itinread li, ul.itinplain li { margin: 0 0 var(--s1); }
.grid4 > .at-end { grid-column: -2 / -1; }
@media (max-width: 560px) { .grid4 > .at-end { grid-column: auto; } }

/* ---- Edit schedule line (batch S): a small "Remove this line" under the form, only for a line without payments ---- */
.after .removeline { margin-top: var(--s3); display: flex; gap: var(--s2); align-items: baseline; flex-wrap: wrap; }

/* ---- Calendar selector (batch T): Company / My calendar / (administrator) each staff member, the same look as the goals selector ---- */
.calwho { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); margin-bottom: var(--s2); }
.calwho select { width: auto; min-width: 16rem; } .calwho label, .calwho button { margin: 0; }

/* ---- Record a payment (batch U1): the one small line under the AUD box of a VND full payment ---- */
.recordpay .ratediff { margin: 0; font-size: var(--fs-small); }

/* ---- FX Gain/Loss (batch U1): one row per rate difference, one button; the rest counted in a small Needs checking line ---- */
.fxsuggest ul.fxlist { margin: var(--s1) 0 var(--s2); padding-left: var(--s4); } .fxsuggest li { margin: var(--s1) 0; }
.fxcheck { font-size: var(--fs-small); } .fxcheck a { margin-right: var(--s1); }

/* ---- Bookings (batch U1): "Bookings of" selector (a filter only) in place of All / My bookings ---- */
.bookwho { display: inline-flex; align-items: center; gap: var(--s2); margin: 0; } .bookwho select { width: auto; min-width: 14rem; } .bookwho label { margin: 0; }

/* ---- Dashboard (batch U2): the welcome message on the same line as the title, to its right ---- */
.dashhead { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s1) var(--s4); } .dashhead h1 { margin: 0; }
.dashhead .welcome { margin: 0; color: var(--muted); }

/* ---- Settings > Welcome messages (batch U2) ---- */
.welcomelist { list-style: none; padding: 0; margin: var(--s2) 0; } .welcomelist li { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; margin: var(--s1) 0; }
.welcomeform { display: inline-flex; gap: var(--s2); align-items: center; margin: 0; } .welcomeform input[type=text] { min-width: 28rem; max-width: 100%; margin: 0; } .welcomeform button, .welcomeform label { margin: 0; }

/* ---- Milestones (batch U2): the Actions column of the timeline lines up on the right, under one "Actions" heading per year ---- */
.ms-year { display: flex; align-items: baseline; gap: var(--s2); } .ms-actions-head { margin-left: auto; font-size: var(--fs-small); font-weight: 600; color: var(--muted); padding-right: var(--s3); }

/* ---- Customer Source (batch U2): wider cards so the value line ("AUD 12,345.00 (45% of the value)") never wraps; one column on a narrow screen, where it may wrap ---- */
.flines.wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); } .flines.wide .fline .note { white-space: nowrap; }
@media (max-width: 420px) { .flines.wide .fline .note { white-space: normal; } }

/* ---- Dashboard tables (batch W): a bolder figure row (Expected profit) ---- */
.panel td.strong { font-weight: 700; }
.ms-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); } .ms-bar .ms-add { margin-left: auto; }   /* batch W: Add milestone on the right of its row */

/* ---- Goals (batch W): a small "Show completed" link at the top right of the list ---- */
.goalhead { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); } .goalhead .goalshow { margin-left: auto; font-size: var(--fs-small); }

/* ---- Header search (batch W): about 35% wider; narrower on a small screen ---- */
@media (max-width: 1300px) { :root { --search-w: 520px; } }
@media (max-width: 800px) { :root { --search-w: 100%; } .gsearch { flex: 1 1 100%; } }

/* ---- Team Performance (batch AA): the table and, for the whole company, the share-of-revenue pie side by side ---- */
.teamgrid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s4); align-items: start; }
.teamgrid.withpie { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 900px) { .teamgrid.withpie { grid-template-columns: minmax(0, 1fr); } }
.piewrap { display: flex; flex-wrap: wrap; gap: var(--s4); align-items: center; }
.pie { width: var(--pie-size); height: var(--pie-size); flex: 0 0 auto; }
.pie .slice { stroke: var(--chart-gap); stroke-width: 2; }
.legend { flex: 1 1 14rem; width: auto; }
.swatch { display: inline-block; width: 0.9em; height: 0.9em; margin-right: var(--s2); border-radius: var(--radius-xs); vertical-align: -0.1em; }
.pie .c1, .swatch.c1 { fill: var(--chart-1); background: var(--chart-1); } .pie .c2, .swatch.c2 { fill: var(--chart-2); background: var(--chart-2); }
.pie .c3, .swatch.c3 { fill: var(--chart-3); background: var(--chart-3); } .pie .c4, .swatch.c4 { fill: var(--chart-4); background: var(--chart-4); }
.pie .c5, .swatch.c5 { fill: var(--chart-5); background: var(--chart-5); } .pie .c6, .swatch.c6 { fill: var(--chart-6); background: var(--chart-6); }
.pie .c7, .swatch.c7 { fill: var(--chart-7); background: var(--chart-7); } .pie .c8, .swatch.c8 { fill: var(--chart-8); background: var(--chart-8); }

/* Batch AC: the KPI page's two admin panels, Monthly entries (left) and Targets (right); one column on a narrow screen */
.kpipanels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); margin-bottom: var(--s4); }
.kpipanels .kpipanel { margin-bottom: 0; } .kpipanels .kpipanel h2 { margin-top: 0; }
@media (max-width: 700px) { .kpipanels { grid-template-columns: minmax(0, 1fr); } }
