/* Flow's neutral look, in the style of the Microsoft 365 / Entra admin centers: greys, a dark top bar,
   a light sidebar, squarer controls. Loaded last on every Flow page. An organisation's own colours
   (Flow Admin > Organisation > Branding) still override the brand tokens; the app chrome stays grey. */
:root {
  --burgundy: #242424; --burgundy-2: #1b1b1b; --burgundy-3: #3d3d3d;
  --pink: #f0f0f0; --pink-soft: #f0f0f0; --pink-line: #d6d6d6;
  --on-burgundy: #ffffff; --on-burgundy-muted: #c8c8c8;
  --paper: #ffffff; --card: #ffffff; --sunk: #f5f5f5;
  --rule: #e6e6e6; --rule-strong: #d1d1d1;
  --ink: #242424; --ink-2: #424242; --muted: #616161;
  --focus: #0f6cbd;
  --r: 4px; --r-lg: 6px;
  --font-display: "Segoe UI Variable Display", "Segoe UI", "Aptos", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-body: "Segoe UI Variable Text", "Segoe UI", "Aptos", ui-sans-serif, system-ui, -apple-system, sans-serif;
}
body { font-size: 14px; background: #fff; }
.head h1, .brand b { text-transform: none; font-stretch: normal; font-weight: 600; letter-spacing: 0; color: var(--ink); }
.btn { border-radius: 4px; font-weight: 600; }
.btn:active { transform: none; }
.btn--primary { background: #242424; color: #fff; }
.btn--primary:hover { background: #3d3d3d; }
.btn--ghost { border-color: #d1d1d1; }
.btn--ghost:hover { background: #f5f5f5; border-color: #c2c2c2; }
.input:focus, .select:focus, .textarea:focus { border-color: #0f6cbd; box-shadow: inset 0 -2px 0 #0f6cbd; }
.panel { border-radius: 6px; border-color: #e6e6e6; box-shadow: 0 1px 2px rgb(0 0 0 / 0.08); }
.table th { font-weight: 600; color: #424242; }
.req { color: #c50f1f; font-style: normal; }
input[type=checkbox], input[type=radio] { accent-color: #0f6cbd; }
.creds { background: #242424; }
.creds h2 { color: #fff; text-transform: none; font-stretch: normal; font-weight: 600; }
.creds dl div { background: #333; }
.badge--admin { background: #242424; color: #fff; }
.row-sel { background: #f0f0f0 !important; }

/* Page titles sit in the page (the header shows the product), like Microsoft 365 */
.rl-body .head h1 { display: block; font: 600 28px/1.2 var(--font-display); color: #242424; }
.rl-body .head { margin: 4px 0 20px; }
.crumbs { display: flex; gap: 10px; font-size: 14px; color: #424242; margin-top: 4px; }
.layout { grid-template-columns: minmax(0, 1fr); }

/* Command bar and list, like Active users */
.cmdbar { display: flex; align-items: center; gap: 4px; padding: 10px 0; border-top: 1px solid #e6e6e6; margin-bottom: 14px; flex-wrap: wrap; }
.cmd { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border: 0; background: none; border-radius: 4px; font-size: 14px; color: #242424; cursor: pointer; }
.cmd svg { color: #0f6cbd; }
.cmd:hover { background: #f5f5f5; }
.cmd-search { display: inline-flex; align-items: center; gap: 8px; height: 36px; width: 280px; padding: 0 10px; border: 1px solid #d1d1d1; border-radius: 4px; color: #616161; }
.cmd-search input { border: 0; outline: 0; flex: 1; min-width: 0; background: none; font-size: 14px; }
.cmd-search:focus-within { border-color: #0f6cbd; }
.cmdbar .count { color: #616161; font-size: 13px; margin-right: 12px; }
.table { border: 0; border-radius: 0; }
.table th { background: none; text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 400; color: #242424; padding: 12px 14px; border-bottom: 1px solid #e0e0e0; }
.table td { padding: 14px; border-bottom: 1px solid #ececec; font-size: 14px; }
.table td b { font-weight: 600; }
.table tbody tr:hover { background: #f5f5f5; }
.table .ck { width: 44px; padding-right: 0; }
.box { display: block; width: 20px; height: 20px; border: 1px solid #616161; border-radius: 2px; background: #fff; }
.row-sel .box { background: #0f6cbd url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 8.2 2.6 2.6L12 5.4' fill='none' stroke='%23fff' stroke-width='1.6'/%3E%3C/svg%3E") center/100%; border-color: #0f6cbd; }
.pamid { color: #424242; font-weight: 400; }
@media (max-width: 800px) { .cmd-search { width: 100%; } }

/* People: command bar extras, filter chips, menus, checkboxes */
.crumbs a { color: #424242; text-decoration: none; } .crumbs a:hover { text-decoration: underline; }
.cmd[disabled] { color: #a0a0a0; cursor: default; background: none; }
.cmd[disabled] svg { color: #c0c0c0; }
.cmd em { font-style: normal; font-size: 11px; color: #707070; border: 1px solid #d1d1d1; border-radius: 4px; padding: 0 5px; }
.cmd-more { position: relative; }
.cmd-more > summary { list-style: none; } .cmd-more > summary::-webkit-details-marker { display: none; }
.cmd-menu { position: absolute; top: 40px; left: 0; z-index: 30; min-width: 220px; background: #fff; box-shadow: 0 8px 24px rgb(0 0 0 / 0.16); padding: 4px 0; display: grid; }
.cols .cmd-menu, .row-more .cmd-menu { left: auto; right: 0; }
.cmd-menu button, .cmd-menu label { display: flex; align-items: center; gap: 8px; text-align: left; border: 0; background: none; padding: 9px 14px; font-size: 14px; color: #242424; cursor: pointer; }
.cmd-menu button:hover:not([disabled]), .cmd-menu label:hover { background: #f5f5f5; }
.cmd-menu button[disabled] { color: #a0a0a0; cursor: default; }
.cmd-menu .danger { color: #c50f1f; }
.cmd-menu hr { border: 0; border-top: 1px solid #e6e6e6; margin: 4px 0; }
.linkish { border: 0; background: none; color: #0f6cbd; cursor: pointer; padding: 0 0 0 6px; font-size: 13px; }
.filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 14px; font-size: 14px; }
.filters__lbl { color: #424242; }
.filters b { font-weight: 600; margin-right: 8px; }
.chip select { appearance: none; border: 0; border-radius: 16px; background: #f0f0f0; padding: 6px 16px; font-size: 14px; color: #242424; cursor: pointer; }
.chip select:hover { background: #e6e6e6; }
.chip.is-on select { background: #ebf3fc; color: #0f6cbd; font-weight: 600; }
.th-sort { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; display: inline-flex; gap: 6px; }
.th-sort:hover { text-decoration: underline; }
.table.people input[type=checkbox] { width: 18px; height: 18px; margin: 0; cursor: pointer; }
.table .dots-col { width: 40px; padding: 0 4px; }
.row-more > summary { width: 32px; justify-content: center; padding: 0; font-size: 18px; opacity: 0; }
tr:hover .row-more > summary, .row-more[open] > summary, .row-more > summary:focus-visible { opacity: 1; }
dialog.many { width: min(560px, calc(100vw - 24px)); max-width: none; }
@media (max-width: 800px) { .cmd { font-size: 0; gap: 0; } .cmd svg { margin: 0; } .row-more > summary { opacity: 1; } }
.cmdbar > .cmd-more .cmd-menu { left: auto; right: 0; }
.cmdbar { flex-wrap: nowrap; overflow: visible; }
.cmdbar .cmd { white-space: nowrap; }
.chip select { max-width: 200px; }
@media (max-width: 1200px) { .cmdbar { flex-wrap: wrap; } }
.cmdbar .count { white-space: nowrap; }
.filters .cmd-search { width: 240px; }
.filters .spacer { min-width: 8px; }
.cmdbar { flex-wrap: wrap; }
.filters { flex-wrap: nowrap; }
.filters .chip select { max-width: 150px; }
.filters .cols .cmd { white-space: nowrap; }
@media (max-width: 1000px) { .filters { flex-wrap: wrap; } }
.filters__lbl, .filters b { white-space: nowrap; }
@media (min-width: 801px) { .table-wrap:has(.table.people) { overflow: visible; } }
.drawer .creds { align-content: start; }
.drawer .creds dl div { padding: 10px 12px; }

/* Org settings, like Microsoft 365's: tabs, a settings list, a panel from the right */
.tabs-row { display: flex; align-items: center; gap: 16px; border-bottom: 1px solid #e0e0e0; margin: 24px 0 0; }
.tabs { display: flex; gap: 28px; flex: 1; }
.tabs button { border: 0; background: none; padding: 12px 2px; font-size: 15px; color: #242424; cursor: pointer; position: relative; }
.tabs button:hover { color: #000; }
.tabs button[aria-selected="true"] { font-weight: 600; }
.tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; border-radius: 2px; background: #0f6cbd; }
.tabs-search { display: inline-flex; align-items: center; gap: 8px; color: #424242; }
.tabs-search input { border: 0; outline: 0; background: none; font-size: 15px; width: 180px; }
.tabs-search:focus-within { box-shadow: inset 0 -2px 0 #0f6cbd; }
.list-meta { text-align: right; color: #242424; font-size: 14px; padding: 18px 8px 22px; }
.table.settings td { padding: 16px 14px; }
.table.settings .ic { width: 56px; color: #0f6cbd; padding-right: 0; }
.table.settings .title { font-size: 15px; font-weight: 600; text-decoration: none; color: #242424; }
.table.settings td.muted { color: #424242; }
.table.settings .badge { margin-left: 6px; }
.org-panel { position: fixed; top: 48px; right: 0; bottom: 0; width: min(760px, calc(100vw - 120px)); z-index: 45; background: #fff; box-shadow: -8px 0 32px rgb(0 0 0 / 0.16); overflow-y: auto; padding: 40px 40px 60px; animation: wizin 200ms var(--ease); }
.org-panel .pp__x { display: grid; place-items: center; text-decoration: none; }
.org-panel .org-head { gap: 12px; color: #0f6cbd; }
.org-panel .org-head h2 { color: #242424; font-size: 24px; font-weight: 600; }
.org-panel .org-body { display: grid; gap: 16px; }
.org-panel .panel { box-shadow: none; border: 1px solid #e6e6e6; }
@media (max-width: 800px) { .org-panel { top: 54px; bottom: 62px; width: 100vw; padding: 24px 16px; } .tabs { gap: 16px; overflow-x: auto; } .tabs-search input { width: 120px; } .table.settings th:last-child, .table.settings td:last-child { display: none; } }

/* Getting started tour */
.tour { position: fixed; inset: 0; z-index: 90; pointer-events: none; }
.tour__ring { position: fixed; border-radius: 6px; box-shadow: 0 0 0 3px #0f6cbd, 0 0 0 9999px rgb(0 0 0 / 0.35); transition: all 220ms var(--ease); }
.tour__pop { position: fixed; pointer-events: auto; background: #fff; border-radius: 8px; box-shadow: 0 12px 40px rgb(0 0 0 / 0.25); padding: 18px 18px 14px; display: grid; gap: 8px; transition: top 220ms var(--ease), left 220ms var(--ease); }
.tour__pop.is-center { top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(380px, calc(100vw - 24px)); box-shadow: 0 0 0 9999px rgb(0 0 0 / 0.35), 0 12px 40px rgb(0 0 0 / 0.25); }
.tour__pop b { font-size: 16px; }
.tour__pop p { color: #424242; font-size: 14px; margin: 0; }
.tour__foot { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; color: #616161; }
.tour-hello form { text-align: center; }
.tour-hello .actions { justify-content: center; }
.tour-hello__ic { width: 56px; height: 56px; margin: 0 auto 4px; border-radius: 50%; background: #ebf3fc; color: #0f6cbd; display: grid; place-items: center; }
.rl-me__link { border: 0; background: none; padding: 2px 0; color: #0f6cbd; text-decoration: underline; font-size: 14px; cursor: pointer; text-align: left; }
button.rl-nav__item { border: 0; background: none; width: 100%; font: inherit; cursor: pointer; text-align: left; }

/* Flow Ultra */
.badge--ultra { background: #242424; color: #fff; font-size: 11px; letter-spacing: 0.02em; }
.ultra-lock { display: grid; gap: 10px; justify-items: start; padding: 24px; background: #fafafa; }
.ultra-lock h3 { font-size: 18px; font-weight: 600; margin: 0; }
.ultra-lock p { color: #424242; margin: 0; }

/* Admin levels */
.badge--admin2 { background: #ebf3fc; color: #0f6cbd; }
.badge--bad { background: #fde7e9; color: #b3261e; }

/* Wide side panels (invoices, templates) */
.org-panel.x-panel--wide { width: min(1000px, calc(100vw - 120px)); }
.inv-frame { width: 100%; height: 70vh; min-height: 480px; border: 1px solid #e6e6e6; background: #f5f5f5; }
.inv-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.btn.danger { color: #c50f1f; }
.small { font-size: 12px; }

/* Invoices: summary tiles, line editor, totals */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 220px)); gap: 12px; margin: 0 0 18px; }
.tiles div { border: 1px solid #e6e6e6; border-radius: 6px; padding: 12px 16px; display: grid; gap: 2px; }
.tiles span { color: #616161; font-size: 13px; }
.tiles b { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tiles .is-bad b { color: #b3261e; }
.table .num, .num { text-align: right; font-variant-numeric: tabular-nums; }
.inv-lines { display: grid; grid-template-columns: minmax(0, 1fr) 80px 120px 110px 32px; gap: 8px 10px; align-items: center; }
.inv-lines > span { font-size: 13px; font-weight: 600; }
.inv-x { position: static; width: 32px; height: 32px; font-size: 14px; }
.inv-totals { display: grid; grid-template-columns: auto auto; justify-content: end; gap: 4px 24px; text-align: right; font-variant-numeric: tabular-nums; }
.inv-totals .big { font-size: 20px; }
@media (max-width: 800px) { .tiles { grid-template-columns: 1fr; } .inv-lines { grid-template-columns: 1fr 60px 90px; } .inv-lines > span:nth-child(4), .inv-lines > span:nth-child(5), .inv-lines [data-amt] { display: none; } }

/* Email templates */
.tpl-list { padding: 0; }
.tpl-row { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border: 0; border-bottom: 1px solid #ececec; background: none; text-align: left; cursor: pointer; font: inherit; }
.tpl-row:last-child { border-bottom: 0; }
.tpl-row:hover { background: #f5f5f5; }
.tpl-row small { display: block; color: #616161; }
.tpl-edit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 20px; align-items: start; }
.tpl-frame { height: 60vh; background: #fff; }
.tpl-subj { margin-bottom: 6px; }
@media (max-width: 1000px) { .tpl-edit { grid-template-columns: 1fr; } }

/* My organisations */
.org-sites { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.org-sites a { color: #0f6cbd; }
.org-ini { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 6px; background: #f0f0f0; font-weight: 600; color: #242424; }
a.cmd { text-decoration: none; }

/* Remove Flow branding: the organisation's logo or name where Flow's wordmark was */
.wl-logo { max-height: 40px; max-width: 180px; object-fit: contain; }
.wl-name { font-size: 20px; font-weight: 600; letter-spacing: 0; }
.tpl-fields .field > span { font-size: 13px; }
.tpl-fields .input, .tpl-fields .textarea { padding: 6px 10px; }
.tpl-prev { position: sticky; top: 0; }
.tpl-frame { height: 75vh; }
