:root {
  --bs-font-sans-serif: 'Manrope', system-ui, sans-serif;
  --bs-body-font-size: .875rem;
  --bs-body-color: #102036;
  --bs-body-color-rgb: 16, 32, 54;
  --bs-body-bg: #f5f6f8;
  --bs-secondary-color: #657184;
  --bs-tertiary-bg: #f4f6f8;
  --bs-border-color: #dce1e7;
  --bs-border-radius: 4px;
  --bs-border-radius-sm: 3px;
  --bs-border-radius-lg: 6px;
  --bs-primary: #102036;
  --bs-primary-rgb: 16, 32, 54;
  --bs-link-color: #102036;
  --bs-link-hover-color: #8a611d;
  --bs-focus-ring-color: rgba(201, 145, 51, .22);
}
body { min-height: 100vh; }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { font-weight: 700; letter-spacing: -.02em; }
.card { --bs-card-bg: #fff; --bs-card-border-color: var(--bs-border-color); }
.btn, .btn-sm { --bs-btn-border-radius: 4px; --bs-btn-font-weight: 600; box-shadow: none; }
.btn-sm { --bs-btn-padding-y: .25rem; --bs-btn-padding-x: .55rem; --bs-btn-font-size: .8125rem; }
.btn-primary {
  --bs-btn-color: #102036; --bs-btn-bg: #d4a34e; --bs-btn-border-color: #c59645;
  --bs-btn-hover-color: #102036; --bs-btn-hover-bg: #dfb262; --bs-btn-hover-border-color: #c59645;
  --bs-btn-active-color: #102036; --bs-btn-active-bg: #c99133; --bs-btn-active-border-color: #b4812d;
  --bs-btn-focus-shadow-rgb: 201, 145, 51;
}
.btn-outline-primary {
  --bs-btn-color: #102036; --bs-btn-bg: #fff; --bs-btn-border-color: #cbd2dc;
  --bs-btn-hover-color: #102036; --bs-btn-hover-bg: #f0f3f7; --bs-btn-hover-border-color: #aeb8c7;
  --bs-btn-active-color: #102036; --bs-btn-active-bg: #e7ecf2; --bs-btn-active-border-color: #aeb8c7;
  --bs-btn-focus-shadow-rgb: 201, 145, 51;
}
.form-control, .form-select { background-color: #fff; border-color: #cbd2dc; }
.form-control-sm, .form-select-sm { font-size: .8125rem; min-height: 30px; }
.form-control:focus, .form-select:focus { border-color: #ab7a2b; box-shadow: 0 0 0 .15rem var(--bs-focus-ring-color); }
.form-label { font-weight: 500; }
.table { --bs-table-color: #102036; --bs-table-border-color: #e2e6eb; }
.dropdown-menu { --bs-dropdown-font-size: .8125rem; --bs-dropdown-border-color: var(--bs-border-color); --bs-dropdown-link-active-bg: #102036; }
:where(a, button, select, input, textarea, [tabindex]):focus-visible { outline: 2px solid #9c6c1e; outline-offset: 2px; }
.portal-icon { width: 20px; height: 20px; flex: 0 0 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.portal-authenticated { --portal-sidebar-width: 184px; }
.portal-content { min-width: 0; }
.portal-content > main { max-width: none; }
.portal-sidebar { --bs-offcanvas-width: 224px; }
.portal-sidebar-inner { display: flex; flex-direction: column; height: 100dvh; padding: 8px; border-right: 1px solid var(--bs-border-color); background: #fff; }
.portal-sidebar-header { display: flex; align-items: center; justify-content: space-between; gap: 4px; min-height: 44px; margin-bottom: 16px; }
.portal-brand { display: block; min-width: 0; }
.portal-brand img { display: block; width: 126px; height: 24px; }
.portal-icon-button { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 30px; padding: 3px; color: #657184; border: 0; }
.portal-icon-button:hover { background: #f0f3f7; color: #102036; }
.portal-nav { gap: 3px; }
.portal-nav .nav-link, .portal-sidebar-action { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 8px 10px; border-radius: 4px; color: #526075; font-size: .8125rem; white-space: nowrap; }
.portal-nav .nav-link { border-left: 3px solid transparent; padding-left: 7px; }
.portal-nav .nav-link:hover, .portal-sidebar-action:hover { color: #102036; background: #f3f5f8; }
.portal-nav .nav-link.active { color: #102036; font-weight: 700; border-left-color: #c99133; background: #f8f2e7; }
.portal-nav-toggle { width: 100%; border-top: 0; border-right: 0; border-bottom: 0; background: transparent; text-align: left; }
.portal-subnav { gap: 3px; padding-left: 16px; margin-top: 3px; }
.portal-subnav .nav-link { min-height: 32px; padding-top: 6px; padding-bottom: 6px; }
.portal-subnav-chevron { flex: 0 0 12px; width: 12px; height: 12px; margin-left: auto; }
.portal-nav-toggle[aria-expanded="true"] .portal-subnav-chevron { transform: rotate(180deg); }
.portal-sidebar-footer { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--bs-border-color); }
.portal-sidebar-action { width: 100%; border: 0; text-align: left; font-weight: 500; }
.portal-mobile-header { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid var(--bs-border-color); background: #fff; }
.portal-public { background: #f5f6f8; }
.portal-login-main { min-height: 100dvh; }
.portal-login-card { max-width: 26rem; }
@media (min-width: 992px) {
  .portal-shell { display: grid; grid-template-columns: var(--portal-sidebar-width) minmax(0, 1fr); min-height: 100dvh; }
  .portal-sidebar { position: sticky; top: 0; z-index: 1030; height: 100dvh; min-width: 0; }
  .sidebar-collapsed { --portal-sidebar-width: 56px; }
  .sidebar-collapsed .portal-brand, .sidebar-collapsed .portal-nav-label { display: none; }
  .sidebar-collapsed .portal-sidebar-header { justify-content: center; }
  .sidebar-collapsed .portal-nav .nav-link, .sidebar-collapsed .portal-sidebar-action { justify-content: center; gap: 0; padding-left: 7px; padding-right: 7px; }
  .sidebar-collapsed #portal-sidebar-toggle .portal-icon { transform: scaleX(-1); }
  .sidebar-collapsed .portal-subnav { padding-left: 0; }
  .sidebar-collapsed .portal-subnav-chevron { display: none; }
}

@font-face {
  font-family: "Google Sans";
  src: url("/vendor/google-sans/GoogleSans-500-latin-ext.woff2") format("woff2");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Google Sans";
  src: url("/vendor/google-sans/GoogleSans-500-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

.google-sign-in {
  display: flex;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 3px 12px 3px 5px;
  border: 1px solid #747775;
  border-radius: 0.35rem;
  background: #fff;
  color: #1f1f1f;
  font-family: "Google Sans", sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
}

.google-sign-in:hover {
  border-color: #5f6368;
  background: #fff;
  color: #1f1f1f;
}

.google-sign-in:active {
  background: #fff;
}

.google-sign-in img {
  display: block;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
}

/* Compact dashboard, with role-specific work before historical activity. */
.dashboard-categories .nav-link { padding: .4rem .5rem; border: 1px solid transparent; border-radius: var(--bs-border-radius-sm); background: #fff; color: var(--bs-secondary-color); font-size: .75rem; }
.dashboard-categories .nav-link:hover { border-color: #aeb8c7; color: var(--bs-body-color); background: var(--bs-tertiary-bg); }
.dashboard-categories .nav-link.active { border-color: #c59645; background: #f8f2e7; color: var(--bs-body-color); }
.dashboard-category-count { font-variant-numeric: tabular-nums; color: var(--bs-body-color); font-weight: 700; }
#dashboard-rows, #dashboard-invoice-rows { --bs-list-group-bg: var(--bs-card-bg); --bs-list-group-action-color: var(--bs-body-color); --bs-list-group-action-hover-color: var(--bs-body-color); --bs-list-group-action-hover-bg: var(--bs-tertiary-bg); }
.dashboard-work-row { border-color: var(--bs-border-color); padding-top: .5rem; padding-bottom: .5rem; }
.dashboard-work-row:first-child { border-top: 1px solid var(--bs-border-color); }
.dashboard-work-row:last-child { border-bottom: 1px solid var(--bs-border-color); }
.dashboard-work-identity { min-width: 0; overflow-wrap: anywhere; }
.dashboard-work-main { flex: 1 1 18rem; min-width: 0; }
.dashboard-work-main strong { color: var(--bs-body-color); }
.dashboard-work-next { flex: 0 1 auto; text-align: right; }
@media (max-width: 575.98px) {
  .dashboard-work-next { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .25rem .75rem; width: 100%; text-align: left; }
}
.dashboard-metric-value { font-size: 1.1rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* One payment direction is expanded at a time; colours only describe urgency. */
.dashboard-invoice-direction { width: 100%; height: 100%; padding: .6rem .75rem; border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius-sm); background: #fff; color: var(--bs-body-color); text-align: left; }
.dashboard-invoice-direction:hover { border-color: #aeb8c7; background: var(--bs-tertiary-bg); }
.dashboard-invoice-direction.active { border-color: #c59645; background: #fcfaf5; }
.dashboard-invoice-bucket { width: 100%; padding: .35rem .45rem; border: 1px solid transparent; border-radius: var(--bs-border-radius-sm); background: transparent; color: var(--bs-body-color); text-align: left; }
.dashboard-invoice-bucket:hover, .dashboard-invoice-bucket.active { background: var(--bs-tertiary-bg); border-color: var(--bs-border-color); }
.dashboard-invoice-bucket svg { display: block; width: 100%; height: 10px; margin: .3rem 0; background: #e9edf2; }
.dashboard-invoice-bucket[data-urgency="overdue"] rect { fill: #b8413d; }
.dashboard-invoice-bucket[data-urgency="upcoming"] rect { fill: #9f7418; }
.dashboard-invoice-bucket[data-urgency="later"] rect { fill: #3a8155; }
.dashboard-invoice-direction:focus-visible, .dashboard-invoice-bucket:focus-visible { outline: 2px solid var(--bs-primary); outline-offset: 2px; }
.dashboard-invoice-row { padding-top: .5rem; padding-bottom: .5rem; border-color: var(--bs-border-color); }
.dashboard-invoice-row .dashboard-work-identity { flex: 1 1 10rem; }
#dashboard-invoice-review[aria-pressed="true"] { font-weight: 600; text-decoration: underline; }
.dashboard-activity-chart { display: block; width: 100%; height: auto; }
.dashboard-activity-chart text { fill: var(--bs-secondary-color); font: 11px var(--bs-body-font-family); }
.dashboard-chart-grid { stroke: var(--bs-border-color); stroke-width: 1; }
.dashboard-chart-baseline { stroke: var(--bs-secondary-color); stroke-width: 1; }
.dashboard-activity-bar { fill: var(--bs-primary); }
.dashboard-negative-bar { fill: var(--bs-danger); }
.dashboard-activity-chart .dashboard-chart-value { fill: var(--bs-body-color); font-weight: 600; }
#dashboard-count-chart-help, #dashboard-margin-chart-help { min-height: 2.5em; }
/* Bootstrap display utilities otherwise override the native hidden attribute. */
#dashboard-app [hidden] { display: none !important; }

/* Keep the compact CMR picker inside the modal focus trap and above its content. */
#dashboard-cmr-modal .flatpickr-calendar { z-index: 1080; border-radius: 4px; font-family: inherit; }
#dashboard-cmr-modal .flatpickr-day.selected { background: var(--bs-primary); border-color: var(--bs-primary); }
.dashboard-work-link:hover { background: var(--bs-tertiary-bg); }
.dashboard-work-link:focus-visible { outline: 2px solid var(--bs-primary); outline-offset: 2px; }
