:root {
    /* FounderPipe brand blue, sampled from the logo mark's gradient. */
    --fp-blue: #0B63F6;
    --fp-blue-dark: #063094;
    --fp-navy: #0A1730;
}

html, body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

a, .btn-link {
    color: var(--fp-blue);
}

.btn-primary {
    color: #fff;
    background-color: var(--fp-blue);
    border-color: var(--fp-blue-dark);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--fp-blue-dark);
    border-color: var(--fp-blue-dark);
}

.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 var(--fp-blue);
}

.form-control:focus {
    border-color: var(--fp-blue);
}

.form-check-input:checked {
    background-color: var(--fp-blue);
    border-color: var(--fp-blue);
}

/* App bar brand mark, next to the "FounderPipe" wordmark. */
.app-bar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.app-bar-brand-mark {
    height: 28px;
    width: 28px;
    border-radius: 6px;
}

/* MudButton default-cases its label; a person's name reads better as typed. */
.app-bar-user,
.app-bar-user .mud-button-root {
    text-transform: none;
}

.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,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcF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5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.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;
}
/* Deals board */
.board {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    align-items: flex-start;
    padding-bottom: 12px;
}

.board-column {
    flex: 0 0 260px;
    display: flex;
    flex-direction: column;
    background: var(--mud-palette-background-gray);
}

.board-zone {
    min-height: 120px;
    flex-grow: 1;
}

.board-card {
    cursor: pointer;
}

/* Workspace colour dot in the navigation */
.workspace-group > .mud-nav-link .mud-nav-link-icon {
    color: var(--workspace-colour);
    font-size: 0.9rem;
}

.colour-swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
}

.colour-swatch.selected {
    border-color: #212121;
    box-shadow: 0 0 0 2px #fff inset;
}

/* Workbook print sheet. Plain black on white, sized for A4, one person never
   split across two pages. */
.print-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px;
    background: #fff;
    color: #000;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 12.5px;
    line-height: 1.4;
}

.print-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 14px;
    margin-bottom: 20px;
    background: #eef1fb;
    border-radius: 6px;
}

.print-toolbar button {
    padding: 6px 18px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: var(--fp-blue);
    border: 0;
    border-radius: 4px;
    cursor: pointer;
}

.print-toolbar span {
    color: #555;
    font-size: 12px;
}

.print-header h1 {
    margin: 0;
    font-size: 22px;
}

.print-header p {
    margin: 2px 0 0;
    color: #444;
}

.print-notes {
    white-space: pre-wrap;
    font-style: italic;
}

.print-company {
    margin-top: 22px;
}

.print-company h2 {
    margin: 0;
    padding-bottom: 3px;
    font-size: 16px;
    border-bottom: 2px solid #000;
    break-after: avoid;
}

.print-company-facts {
    margin: 3px 0 0;
    color: #444;
}

.print-person {
    padding: 9px 0 10px;
    border-bottom: 1px solid #bbb;
    break-inside: avoid;
}

.print-name {
    font-size: 14px;
    font-weight: 700;
}

.print-title {
    margin-left: 8px;
    color: #444;
}

.print-details {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 22px;
    margin-top: 2px;
}

.print-details b,
.print-context b {
    font-weight: 600;
    color: #444;
}

.print-context {
    margin: 2px 0 0;
}

.print-outcome {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
    margin-top: 7px;
}

/* Two ruled lines to write on. */
.print-lines {
    height: 44px;
    margin-top: 4px;
    background: repeating-linear-gradient(to bottom, transparent 0 21px, #999 21px 22px);
}

/* Rich text compose box, used to write an email to a contact. */
.rte-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 12px;
    margin-bottom: 4px;
}

.rte-btn {
    min-width: 34px;
    padding: 4px 8px;
    font-size: 13px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.rte-btn:hover {
    background: #ebebeb;
}

.rte-editor {
    min-height: 180px;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow-y: auto;
}

.rte-editor:focus {
    outline: none;
    border-color: var(--fp-blue);
}

.rte-content p {
    margin: 0 0 0.6em;
}

.rte-content ul,
.rte-content ol {
    margin: 0 0 0.6em;
    padding-left: 1.4em;
}

@media print {
    .print-toolbar,
    #blazor-error-ui,
    #components-reconnect-modal {
        display: none !important;
    }

    .print-page {
        max-width: none;
        padding: 0;
    }

    .print-lines {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    @page {
        margin: 14mm;
    }
}

/* Softphone: a panel and button fixed to the corner, on every signed-in page. */
.softphone {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 1300;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.softphone-panel {
    width: min(320px, calc(100vw - 32px));
}

.softphone-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

/* Command palette */
.palette-input { width: 100%; border: 0; outline: 0; font-size: 1.1rem; padding: 8px 4px; background: transparent; color: inherit; }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 6px; cursor: pointer; }
.palette-item.active { background: var(--mud-palette-action-default-hover); }
.palette-kind { min-width: 72px; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--mud-palette-text-secondary); }

/* ---- App chrome: the same look as the account pages ---- */

/* Cards and panels: hairline border, no heavy shadow. */
.mud-paper-outlined {
    border-color: var(--mud-palette-lines-default);
}

/* Tables: quiet headers, room to breathe, readable cells. */
.mud-table-root .mud-table-head .mud-table-cell {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
}

.mud-table-dense .mud-table-body .mud-table-cell {
    font-size: 0.9rem;
    padding: 9px 14px;
}

/* Buttons: sentence case, firm weight. */
.mud-button-root {
    font-weight: 600;
    letter-spacing: 0;
}

/* The nav drawer reads as part of the page, not a slab. */
.mud-drawer {
    border-right: 1px solid var(--mud-palette-lines-default);
}

/* Small screens: the search shortcut hint means nothing without a keyboard. */
@media (max-width: 600px) {
    .app-bar-search .search-hint {
        display: none;
    }

    .mud-main-content .mud-container {
        padding-left: 12px;
        padding-right: 12px;
    }
}

/* ---- Reports: charts built from plain HTML. Colours come from the app theme, so light and dark follow it. ---- */

.viz-card {
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 10px;
    padding: 16px 18px;
    height: 100%;
}

.viz-title {
    font-weight: 600;
    margin-bottom: 12px;
}

.viz-empty {
    color: var(--mud-palette-text-secondary);
    padding: 24px 0;
}

/* Tooltip: the same on hover and keyboard focus. */
.viz-hrow[data-tip],
.viz-col[data-tip] {
    position: relative;
    outline: none;
}

.viz-hrow[data-tip]:hover::after,
.viz-hrow[data-tip]:focus-visible::after,
.viz-col[data-tip]:hover::after,
.viz-col[data-tip]:focus-visible::after {
    content: attr(data-tip);
    position: absolute;
    z-index: 5;
    left: 50%;
    bottom: calc(100% + 4px);
    transform: translateX(-50%);
    white-space: nowrap;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    background: var(--mud-palette-text-primary);
    color: var(--mud-palette-surface);
    pointer-events: none;
}

/* Horizontal bars */
.viz-hbars {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.viz-hrow {
    display: grid;
    grid-template-columns: minmax(90px, 30%) 1fr 56px;
    align-items: center;
    gap: 10px;
    min-height: 28px;
}

.viz-hlabel {
    font-size: 0.85rem;
    color: var(--mud-palette-text-secondary);
    overflow-wrap: anywhere;
}

.viz-htrack {
    display: block;
    height: 16px;
}

.viz-hbar {
    display: block;
    height: 100%;
    background: var(--mud-palette-primary);
    border-radius: 0 4px 4px 0;
}

.viz-hrow:hover .viz-hbar,
.viz-hrow:focus-visible .viz-hbar {
    filter: brightness(1.15);
}

.viz-hvalue {
    font-size: 0.85rem;
    font-weight: 600;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Columns */
.viz-cols {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 6px;
    height: 190px;
    padding: 4px 0 22px 36px;
}

.viz-grid {
    position: absolute;
    inset: 4px 0 22px 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
}

.viz-gridline {
    border-top: 1px solid var(--mud-palette-lines-default);
    position: relative;
    height: 0;
}

.viz-gridline span {
    position: absolute;
    left: 0;
    top: -9px;
    font-size: 0.7rem;
    color: var(--mud-palette-text-secondary);
    font-variant-numeric: tabular-nums;
}

.viz-col {
    position: relative;
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    min-width: 0;
}

.viz-colbar {
    display: block;
    width: min(100%, 24px);
    background: var(--mud-palette-primary);
    border-radius: 4px 4px 0 0;
}

.viz-col:hover .viz-colbar,
.viz-col:focus-visible .viz-colbar {
    filter: brightness(1.15);
}

.viz-colvalue {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.viz-collabel {
    position: absolute;
    bottom: -20px;
    font-size: 0.7rem;
    color: var(--mud-palette-text-secondary);
    white-space: nowrap;
}

/* Table view under each chart */
.viz-table {
    margin-top: 12px;
    font-size: 0.85rem;
}

.viz-table summary {
    cursor: pointer;
    color: var(--mud-palette-text-secondary);
}

.viz-table table {
    border-collapse: collapse;
    margin-top: 6px;
    width: 100%;
}

.viz-table th,
.viz-table td {
    text-align: left;
    padding: 4px 8px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.viz-table td:nth-child(n+2),
.viz-table th:nth-child(n+2) {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Stat tiles */
.viz-tile {
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 10px;
    padding: 12px 16px;
    height: 100%;
}

.viz-tile-label {
    font-size: 0.8rem;
    color: var(--mud-palette-text-secondary);
}

.viz-tile-value {
    font-size: 1.7rem;
    font-weight: 600;
    line-height: 1.2;
}

.viz-tile-sub {
    font-size: 0.78rem;
    color: var(--mud-palette-text-secondary);
}

/* ---- Phones and tablets: bottom bar, safe areas, bigger touch targets ---- */

.bottom-nav {
    display: none;
}

@media (max-width: 959.98px) {
    .bottom-nav {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1200;
        background: var(--mud-palette-surface);
        border-top: 1px solid var(--mud-palette-lines-default);
        padding-bottom: env(safe-area-inset-bottom);
    }

    .bottom-nav .bn-item {
        flex: 1 1 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        min-height: 56px;
        padding: 6px 0;
        border: 0;
        background: transparent;
        color: var(--mud-palette-text-secondary);
        font: inherit;
        font-size: 0.7rem;
        font-weight: 600;
        text-decoration: none;
        cursor: pointer;
    }

    .bottom-nav .bn-item.active {
        color: var(--mud-palette-primary);
    }

    /* Room for the bar, so the last row of a page is never under it. */
    .mud-main-content {
        padding-bottom: calc(64px + env(safe-area-inset-bottom));
    }

    /* The notch, when the phone is on its side. */
    .mud-appbar,
    .mud-main-content {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    /* Fingers are bigger than pointers. */
    .mud-icon-button {
        min-width: 40px;
        min-height: 40px;
    }

    .mud-nav-link {
        min-height: 44px;
    }

    .mud-table-dense .mud-table-body .mud-table-cell {
        padding-top: 12px;
        padding-bottom: 12px;
    }

    /* The mobile Today has no use for a keyboard shortcut button; Search is on the bar. */
    .app-bar-search {
        display: none;
    }
}

@media (max-width: 599.98px) {
    /* Today's three stat tiles sit side by side on a phone: keep their text inside them. */
    .mud-grid-item-xs-4 .mud-typography-caption {
        font-size: 0.65rem;
        line-height: 1.2;
        overflow-wrap: anywhere;
    }

    .mud-grid-item-xs-4 .mud-typography-h5 {
        font-size: 1.15rem;
    }
}


/* Phone: page headers and table toolbars wrap instead of squeezing */
@media (max-width: 959.98px) {
    .page-head { flex-wrap: wrap; row-gap: 8px; }
    .page-head > .flex-grow-1 { flex: 1 1 100%; }
    .page-head > .mud-button-root, .page-head > .mud-menu, .page-head > .mud-toggle-group { margin-right: 8px !important; }
    .mud-table-toolbar { height: auto !important; min-height: 0; flex-wrap: wrap; row-gap: 4px; padding: 8px 12px; }
    .mud-table-toolbar > .mud-input-control { flex: 1 1 100%; margin-left: 0 !important; max-width: none !important; }
    .mud-table-toolbar > * { margin-left: 0 !important; margin-right: 8px; }
}
