html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* Global (not layout-scoped): both MainLayout and PublicLayout render a #blazor-error-ui
   element, so this must hide it everywhere. Blazor sets display:block inline when an
   unhandled error actually occurs, which overrides the display:none below. */
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

.alt-row {
    background-color: rgba(0,0,0,0.05);
}

/* Running application version (Application:Version), shown in the top row of MainLayout and
   AccountsLayout. Global rather than layout-scoped so there is one copy for both layouts, and
   deliberately NOT in css/environment-*.css - those are only linked when the environment is not
   Production, which is where the version matters most. Understated on purpose: it is metadata,
   not a warning like the environment and read-only indicators it sits beside. */
.app-version {
    color: #6c757d;
    font-size: 0.75rem;
    margin-right: 0.75rem;
    white-space: nowrap;
}

/* An email's HTML, in its sandboxed iframe on the conversation page (EmailDetails). The frame
   cannot size itself - nothing runs inside it - so the page sets its height once it has loaded;
   this is the height until then, and the fallback if that fails. */
.email-frame {
    display: block;
    width: 100%;
    height: 24rem;
    min-height: 6rem;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    background: #fff;
}

/* The email compose editor and the signature editor (RichEditor). The body is contenteditable
   and written by rich-editor.js; these keep it readable and keep a quoted email visibly apart. */
.rich-editor-body {
    background: #fff;
    overflow-wrap: anywhere;
    max-height: 60vh;
    overflow-y: auto;
}

.rich-editor-body:focus {
    outline: none;
    box-shadow: inset 0 0 0 2px rgba(13, 110, 253, .25);
}

.rich-editor-body p {
    margin-bottom: .5rem;
}

.rich-editor-body blockquote {
    margin: 0 0 0 .8ex;
    border-left: 2px solid #ccc;
    padding-left: 1ex;
    color: #555;
}

/* Anonymous tenant issue-reporting portal (PublicLayout, served at site root) */
.public-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #f4f6f9;
}

.public-header {
    background-color: #1b6ec2;
    color: #fff;
}

.public-header-inner {
    max-width: 720px;
    margin: 0 auto;
    padding: 0.85rem 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.public-main {
    flex: 1;
    padding: 1.5rem 1rem;
}

.public-footer {
    text-align: center;
    padding: 1rem;
}

.report-issue .btn.text-start {
    white-space: normal;
}

/* In-app help (Components/Help). The offcanvas is hand-rolled - Bootstrap's JS isn't
   loaded - so it is made visible here rather than by Bootstrap's transition classes. */
.help-panel {
    visibility: visible;
    width: 480px;
    max-width: 100%;
}

.help-panel .offcanvas-body {
    overflow-y: auto;
}

.help-content h5 {
    margin-top: 1.25rem;
}

.help-content h5:first-of-type {
    margin-top: 0.75rem;
}

/* Hand-drawn charts (Components/Charts). Colours are Bootstrap's variables so the
   bars match the Income (success), Expenses (warning) and Net Profit (primary) cards
   above them on the Accounts overview. */
.chart {
    display: block;
    overflow: visible;
}

.chart-grid {
    stroke: var(--bs-border-color);
    stroke-width: 1;
}

.chart-axis {
    stroke: var(--bs-secondary-color);
    stroke-width: 1;
}

.chart-label {
    fill: var(--bs-secondary-color);
    font-size: 12px;
}

.chart-income {
    fill: var(--bs-success);
    background-color: var(--bs-success);
}

.chart-expense {
    fill: var(--bs-warning);
    background-color: var(--bs-warning);
}

.chart-hit {
    fill: transparent;
}

.chart a:hover .chart-hit {
    fill: var(--bs-tertiary-bg);
}

.chart-line {
    fill: none;
    stroke: var(--bs-primary);
    stroke-width: 2.5;
    pointer-events: none;
}

.chart-dot {
    fill: var(--bs-primary);
    pointer-events: none;
}

.chart-swatch {
    display: inline-block;
    width: 0.75rem;
    height: 0.75rem;
    margin-right: 0.35rem;
    vertical-align: -0.05rem;
    border-radius: 2px;
}

.chart-swatch-line {
    height: 3px;
    vertical-align: 0.2rem;
    background-color: var(--bs-primary);
}

.chart-hbar-row {
    display: block;
    padding: 0.35rem 0.25rem;
    border-radius: 0.25rem;
}

a.chart-hbar-row:hover {
    background-color: var(--bs-tertiary-bg);
}

.chart-hbar-track {
    position: relative;
    height: 0.75rem;
    margin-top: 0.2rem;
    background-color: var(--bs-secondary-bg);
    border-radius: 2px;
}

.chart-hbar-zero {
    position: absolute;
    top: -2px;
    bottom: -2px;
    width: 1px;
    background-color: var(--bs-secondary-color);
}

.chart-hbar {
    position: absolute;
    top: 0;
    bottom: 0;
    border-radius: 2px;
}

.chart-hbar-positive {
    background-color: var(--bs-success);
}

.chart-hbar-negative {
    background-color: var(--bs-danger);
}

.chart-hbar-muted {
    background-color: var(--bs-secondary);
}

/* Below this width the month labels would shrink past reading, so the chart keeps
   a minimum size and scrolls sideways inside its card instead. */
.chart-scroll {
    overflow-x: auto;
}

.chart-scroll .chart {
    min-width: 520px;
}
