@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

───────────────────────────────────────────────────────────────── */
:root {
    --bv-burgundy: #722F37;
    --bv-burgundy-dark: #5e272d;
    --bv-burgundy-light: #8a3f47;
    --bv-slate: #5D7A8C;
    --bv-slate-dark: #4a6273;
    --bv-cream: #F4ECDC;
    --bv-cream-light: #FAF6EE;
    --bv-charcoal: #2D2A2E;
    --bv-gray-text: #4a5568;
    --bv-gray-border: #e2e8f0;
}


html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* Prevent MudSelect hover from bleeding onto other list items */
.mud-popover .mud-list-item-clickable {
    isolation: isolate;
}

.mud-list-item-clickable:not(.mud-selected):hover {
    background-color: var(--mud-palette-action-hover) !important;
}

.mud-select-popover .mud-list-item:hover {
    background-color: var(--mud-palette-action-hover) !important;
}

a, .btn-link {
    color: #0366d6;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    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;
    }

.chartCRN-icon {
    background: url('../images/chartcrn.svg') no-repeat center;
    width: 24px;
    height: 24px;
    display: inline-block;
}

/* MudTooltip popper renders in a global layer that sits below MudDialog by
   default. Bump it above the dialog's overlay so tooltips inside dialogs
   are visible. The MudBlazor dialog z-index is around 1300; tooltip
   popper defaults to ~1200. Setting tooltip to 1400 keeps it above
   dialogs without going so high it'd interfere with future Snackbar/Drawer. */
.mud-tooltip {
    z-index: 1400 !important;
}

.mud-popover-provider .mud-popover[role="tooltip"] {
    z-index: 1400 !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Nav menu group headings (e.g. Reports): bold so they read as sections, not plain links */
.bv-nav-group > .mud-nav-link .mud-nav-link-text {
    font-weight: 600;
}

/* Form dialogs read left to right. EntityEdit centres every input on its page (for the
   name boxes up top), and a dialog opened there picked that up: typed text and the cursor
   sat in the middle of each field. */
.mud-dialog.bv-form-dialog .mud-input > input.mud-input-root,
.mud-dialog.bv-form-dialog div.mud-input-slot.mud-input-root {
    text-align: start;
}

/* Same cause: EntityEdit pushes every field label down 6px, so in a dialog the label
   that sits on the field's border landed on top of the typed text. MudBlazor's own
   placement, in dialogs. */
.mud-dialog.bv-form-dialog .mud-input-label {
    margin-top: 0;
    padding-bottom: 0;
}

/* Form dialogs (contact + related-item editors). On phones the dialog is full width at
   the top of the screen and only as tall as its content (11/6: full height left a big gap
   above Save/Cancel). A long form still stops at the screen's height; title and actions
   stay put while the content scrolls (.mud-dialog-content scrolls inside the flex column). */
@media (max-width: 599.98px) {
    .mud-dialog-container:has(> .bv-form-dialog) {
        padding: 0 !important;
    }

    .mud-dialog.bv-form-dialog {
        width: 100%;
        height: auto;
        max-width: 100% !important;
        max-height: 100%;
        margin: 0;
        border-radius: 0 0 12px 12px;
    }

    .mud-dialog.bv-form-dialog .mud-dialog-content {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* Add contact, step 1: one tile per contact type (ContactEditDialog). Three across,
   two on phones; line icons in the primary colour, emergency in the error colour. */
.bv-type-tiles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

@media (max-width: 599.98px) {
    .bv-type-tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.bv-type-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 96px;
    padding: 12px 8px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 12px;
    background: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
    font: inherit;
    font-size: 0.9rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.12s, background-color 0.12s;
}

.bv-type-tile:hover,
.bv-type-tile:focus-visible {
    border-color: var(--mud-palette-primary);
    background: var(--mud-palette-action-default-hover);
    outline: none;
}

.bv-type-tile .bv-type-tile-icon {
    font-size: 2rem;
    color: var(--mud-palette-primary);
}

.bv-type-tile--urgent .bv-type-tile-icon {
    color: var(--mud-palette-error);
}

/* Person / system picker (PersonSystemSelector): a scrolling list of matches under the search
   box, each with initials, name and a second line; linked ones greyed; a create row last. */
.bv-pick-list {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    max-height: 320px;
    overflow-y: auto;
}

.bv-pick-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    background: transparent;
    color: var(--mud-palette-text-primary);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.bv-pick-row:last-child {
    border-bottom: 0;
}

.bv-pick-row:hover:not(:disabled),
.bv-pick-row:focus-visible {
    background: var(--mud-palette-action-default-hover);
    outline: none;
}

.bv-pick-row--linked {
    cursor: default;
    color: var(--mud-palette-text-disabled);
}

.bv-pick-row--create {
    color: var(--mud-palette-primary);
    font-weight: 500;
}

.bv-pick-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.bv-pick-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bv-pick-sub {
    font-size: 0.8rem;
    color: var(--mud-palette-text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bv-picked {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
}

.bv-picked-avatar {
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 500;
    background: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
}

.bv-picked-avatar--muted {
    background: var(--mud-palette-action-disabled-background);
    color: var(--mud-palette-text-disabled);
}

/* No tooltips on touch screens (owner 11/6): a tap pops them up over the content and they
   linger. Desktop keeps them. "hover: none" = a phone or tablet without a mouse. */
@media (hover: none) {
    .mud-tooltip,
    .mud-popover:has(> .mud-tooltip) {
        display: none !important;
    }
}

/* Confidential (PIN-protected) sections inside contact / link editors */
.bv-secure-section {
    border-left: 4px solid var(--mud-palette-error) !important;
}
