.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;
    }

.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."
    }

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

/* SOF/CP/Laytime/Claims detail-style pages: every action button gets a square (no rounded corners) light-gray look,
   overriding MudBlazor's per-Variant/Color styling. Longhand border properties (not the
   shorthand) plus the class repeated at higher specificity, since MudBlazor's own
   mud-button-root/mud-icon-button rules were winning the border property outright -
   box-shadow is also cleared since MudBlazor's elevation shadow can visually mask a
   thin border even when it IS being applied. */
.page-action-btn,
.page-action-btn.mud-button-root,
.page-action-btn.mud-icon-button {
    background-color: #e0e0e0 !important;
    border-width: 1px !important;
    border-style: solid !important;
    border-color: #9e9e9e !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    /* MudIconButton and MudButton (e.g. Finalize) have different default vertical padding,
       so mixed in the same row they render at different heights - fix the box height and
       zero the vertical padding (mud-button-root is already display:inline-flex with
       align-items:center, so content stays vertically centered on its own). */
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    box-sizing: border-box !important;
}

/* SoF event table: the date/time inputs are narrow, but the pop-up calendar/clock must keep its natural width. The width
   lives on a wrapper (not on the picker's own Style, which MudBlazor also applies to the pop-up). */
.sof-date-cell { width: 140px; min-width: 140px; }
.sof-time-cell { width: 124px; min-width: 124px; }

/* Fixed column widths so the date/time columns hug their inputs and Remarks takes all the remaining width. */
.sof-events table { table-layout: fixed; width: 100%; min-width: 1850px; }
.sof-events .mud-table-container { overflow-x: auto; }

/* Calculation trace rows that need review (e.g. a custom event no charter party clause matches). */
tr.mud-theme-warning-row > td { background-color: rgba(255, 152, 0, 0.12); }

/* SoF event table: a row just added or inserted, until saved. */
tr.sof-row-new > td { background-color: rgba(33, 150, 243, 0.08); }
tr.sof-row-missing > td { background-color: rgba(244, 67, 54, 0.14); }

/* Charter party exception clauses: fixed narrow columns so Clause text takes the remaining width. */
.cp-clauses table { table-layout: fixed; width: 100%; min-width: 1400px; }
.cp-clauses .mud-table-container { overflow-x: auto; }
.cp-clauses .mud-table-cell { vertical-align: top; }

/* Clause "on demurrage & despatch" cell: two fields, then one checkbox per line with its text beside it. */
.clause-dem { display: flex; flex-direction: column; gap: 4px; }
.clause-dem-flags { display: flex; flex-direction: column; gap: 2px; margin-top: 2px; }
.clause-flag { display: flex; align-items: center; gap: 2px; }
.clause-flag .mud-checkbox { margin: 0; }
.clause-flag .mud-input-control { margin: 0; flex: 0 0 auto; width: auto; }
.clause-flag > span { font-size: 0.8125rem; line-height: 1.3; cursor: pointer; user-select: none; }

/* ---------------- Customer dashboard ----------------
   Series colours are validated (blue/aqua, ΔE 23 for colour-blind readers); aqua is light on white, so every bar also has its
   value as text. Text never uses a series colour. Status colours (red/orange/green) only with an icon and words. */
.dash-root, .mud-main-content {
  --dash-s1: #2a78d6; --dash-s1-dark: #1c5cab; --dash-s1-track: #cde2fb; --dash-s2: #1baf7a;
  --dash-text: #1f2328; --dash-text-2: #5b6168; --dash-line: #e3e6e9;
  --dash-critical: #C62828; --dash-warning: #B45309; --dash-ok: #2E7D32;
}
.dash-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.dash-tile { padding: 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dash-tile-wide { grid-column: span 3; }
@media (max-width: 960px) { .dash-tile-wide { grid-column: auto; } }
.dash-tile-critical { box-shadow: inset 3px 0 0 var(--dash-critical) !important; }
.dash-label { font-size: 0.8rem; color: var(--dash-text-2); }
.dash-value { font-size: 1.75rem; font-weight: 600; color: var(--dash-text); line-height: 1.2; display: flex; align-items: center; }
.dash-sub { font-size: 0.78rem; color: var(--dash-text-2); }
.dash-status-critical { color: var(--dash-critical) !important; }
.dash-status-warning { color: var(--dash-warning) !important; }
.dash-status-ok { color: var(--dash-ok) !important; }
.dash-muted-icon { color: var(--dash-text-2) !important; }
.dash-upgrade { background: #f4f9fc !important; }

.dash-meter { margin: 4px 0; }
.dash-meter-head { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--dash-text); gap: 8px; }
.dash-meter-track { height: 6px; border-radius: 3px; background: var(--dash-s1-track); margin-top: 3px; overflow: hidden; }
.dash-meter-fill { height: 100%; background: var(--dash-s1); border-radius: 3px; }
.dash-meter-full { background: var(--dash-critical); }

.dash-card { padding: 16px; height: 100%; min-width: 0; }
.dash-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.dash-card-title { font-size: 1rem; font-weight: 600; color: var(--dash-text); }
.dash-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.78rem; color: var(--dash-text-2); }
.dash-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dash-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.dash-s1, .dash-s1-bg { background: var(--dash-s1); }
.dash-s1-dark-bg { background: var(--dash-s1-dark); }
.dash-s2, .dash-s2-bg { background: var(--dash-s2); }
.dash-tick-key { display: inline-block; width: 2px; height: 12px; background: var(--dash-text); }
.dash-empty { font-size: 0.85rem; color: var(--dash-text-2); padding: 12px 0; display: flex; align-items: center; }

/* hover / keyboard-focus tooltip shared by every chart row and column */
.dash-row, .dash-month { position: relative; }
.dash-tip { display: none; position: absolute; z-index: 5; left: 50%; bottom: calc(100% + 4px); transform: translateX(-50%);
  background: #1f2328; color: #fff; font-size: 0.75rem; line-height: 1.5; padding: 6px 10px; border-radius: 6px; white-space: nowrap;
  pointer-events: none; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.dash-tip .dash-swatch { box-shadow: 0 0 0 1px #fff; }
.dash-row:hover .dash-tip, .dash-row:focus .dash-tip, .dash-month:hover .dash-tip, .dash-month:focus .dash-tip { display: block; }
.dash-row:focus, .dash-month:focus { outline: 2px solid var(--dash-s1); outline-offset: 2px; border-radius: 4px; }

/* horizontal bar rows: label | bar + value at the tip */
.dash-row { display: grid; grid-template-columns: minmax(90px, 34%) 1fr; align-items: center; gap: 10px; padding: 5px 0; cursor: default; }
.dash-row:hover { background: #f6f8fa; }
.dash-row-label { font-size: 0.8rem; color: var(--dash-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-row-track { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dash-bar, .dash-stack { height: 14px; border-radius: 0 4px 4px 0; min-width: 2px; }
.dash-stack { display: flex; gap: 2px; overflow: hidden; }
.dash-seg { height: 100%; min-width: 2px; }
.dash-bar-area { position: relative; flex: 1; display: flex; align-items: center; height: 18px; max-width: 75%; }
.dash-bar-area .dash-bar { height: 14px; }
.dash-tick { position: absolute; top: 0; width: 2px; height: 18px; background: var(--dash-text); margin-left: -1px; }
.dash-row-track > .dash-bar, .dash-row-track > .dash-stack { max-width: 75%; }
.dash-row-value { font-size: 0.75rem; color: var(--dash-text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* monthly diverging columns: demurrage up, despatch down, one shared scale */
.dash-months { display: grid; grid-template-columns: auto 1fr; gap: 8px; }
.dash-axis { display: flex; flex-direction: column; justify-content: space-between; font-size: 0.7rem; color: var(--dash-text-2);
  text-align: right; height: 200px; padding-bottom: 18px; font-variant-numeric: tabular-nums; }
.dash-month-plot { display: grid; grid-template-columns: repeat(12, 1fr); height: 200px; border-left: 1px solid var(--dash-line); }
.dash-month { display: grid; grid-template-rows: 1fr 1fr 18px; justify-items: center; cursor: default; }
.dash-month:hover { background: #f6f8fa; }
.dash-month-up { display: flex; align-items: flex-end; width: 100%; justify-content: center; border-bottom: 1px solid #b9c0c7; }
.dash-month-down { display: flex; align-items: flex-start; width: 100%; justify-content: center; }
.dash-col { width: min(18px, 70%); border-radius: 4px 4px 0 0; }
.dash-col-down { border-radius: 0 0 4px 4px; }
.dash-month-label { font-size: 0.7rem; color: var(--dash-text-2); align-self: end; }
@media (max-width: 600px) { .dash-month-label { font-size: 0.6rem; } }

/* lists */
.dash-attention { display: flex; gap: 10px; align-items: flex-start; padding: 8px 6px; border-radius: 6px; text-decoration: none; color: inherit; }
.dash-attention:hover { background: #f6f8fa; }
.dash-attention-title { font-size: 0.85rem; color: var(--dash-text); font-weight: 500; }
.dash-list-row { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 1px solid var(--dash-line); text-decoration: none; color: inherit; }
.dash-list-row:last-child { border-bottom: 0; }
.dash-list-row:hover { background: #f6f8fa; }
.dash-list-main { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.85rem; color: var(--dash-text); }
.dash-list-amount { font-size: 0.78rem; color: var(--dash-text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.dash-list-date { font-size: 0.75rem; color: var(--dash-text-2); white-space: nowrap; width: 48px; text-align: right; }
@media (max-width: 600px) { .dash-list-amount { display: none; } }

/* ---- Admin dashboard ---- */
.dash-section-title { margin: 28px 0 10px; }
.dash-card { height: 100%; padding: 16px; }
.dash-card-link { cursor: pointer; transition: box-shadow .15s; }
.dash-card-link:hover { box-shadow: 0 0 0 2px var(--mud-palette-primary) inset; }
.dash-label { color: var(--mud-palette-text-secondary); font-size: .8rem; }
.dash-value { font-size: 1.5rem; font-weight: 500; line-height: 1.3; font-variant-numeric: tabular-nums; }
.dash-value-sm { font-size: 1.05rem; font-weight: 500; line-height: 1.4; font-variant-numeric: tabular-nums; }
.dash-sub { color: var(--mud-palette-text-secondary); font-size: .78rem; }
.dash-up { color: var(--mud-palette-success-darken); }
.dash-down { color: var(--mud-palette-error); }
.dash-attention-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-top: 1px solid var(--mud-palette-lines-default); }
.dash-attention-row:first-of-type { border-top: none; }
.dash-health { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; padding: 10px 16px; }
.dash-health-item { display: inline-flex; align-items: center; gap: 4px; font-size: .82rem; }
.dash-funnel-bar { height: 10px; border-radius: 0 4px 4px 0; background: var(--mud-palette-primary); min-width: 2px; }
.dash-funnel-track { background: var(--mud-palette-background-gray); border-radius: 0 4px 4px 0; }
.dash-table td, .dash-table th { padding: 6px 8px !important; font-variant-numeric: tabular-nums; }
.dash-feed-row { display: flex; gap: 10px; padding: 7px 0; border-top: 1px solid var(--mud-palette-lines-default); align-items: flex-start; }
.dash-feed-row:first-child { border-top: none; }

.trend-chart { height: 100%; }
.trend-muted { color: var(--mud-palette-text-secondary); }
.trend-svg { width: 100%; height: 130px; display: block; margin-top: 6px; overflow: visible; }
.trend-axis { stroke: var(--mud-palette-lines-default); stroke-width: 1; }
.trend-grid { stroke: var(--mud-palette-lines-default); stroke-width: 1; stroke-dasharray: 3 3; opacity: .7; }
.trend-tick { fill: var(--mud-palette-text-secondary); font-size: 10px; }
.trend-bar { fill: var(--mud-palette-primary); opacity: .85; }
.trend-line { fill: none; stroke: var(--mud-palette-primary); stroke-width: 2; vector-effect: non-scaling-stroke; }
.trend-dot { fill: var(--mud-palette-primary); stroke: var(--mud-palette-surface); stroke-width: 2; opacity: 0; }
.trend-hit { fill: transparent; }
.trend-day:hover .trend-bar { opacity: 1; }
.trend-day:hover .trend-dot { opacity: 1; }
.trend-day:hover .trend-hit { fill: var(--mud-palette-action-default-hover); }
.trend-dates { font-size: .72rem; margin-top: 2px; }
.trend-empty { height: 130px; display: flex; align-items: center; justify-content: center; color: var(--mud-palette-text-secondary); font-size: .85rem; }

/* Public Support page: the SaaS company's contact details beside the form. */
.support-contact { background: #f7fbfb; border: 1px solid var(--mud-palette-lines-default); border-radius: 8px; padding: 20px; height: 100%; }
.support-contact-row { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; }
.support-contact-row address { font-style: normal; line-height: 1.5; }
