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

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.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;
}

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

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

/* ---------- Boot splash (wwwroot/index.html) ----------
   Shown while the WASM runtime downloads, before MudBlazor's CSS variables exist, so colours are
   hard-coded to the Trawlwise light theme (Primary #245476, Background #F8FAFC).
   Layout mirrors Shared/LoadingScreen.razor (64px logo, mb-6, large MudProgressCircular). */
.boot-splash {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: #f8fafc;
    font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.boot-splash-logo {
    height: 64px;
    margin-bottom: 24px;
}

.boot-splash-spinner {
    width: 70px;
    height: 70px;
    animation: boot-splash-rotate 1.4s linear infinite;
}

    .boot-splash-spinner circle {
        stroke: #245476;
        stroke-linecap: round;
        stroke-dasharray: 80px, 200px;
        stroke-dashoffset: 0;
        animation: boot-splash-dash 1.4s ease-in-out infinite;
    }

/* Download progress reported by blazor.webassembly.js via --blazor-load-percentage-text. */
.boot-splash-progress {
    margin-top: 16px;
    min-height: 1.25rem;
    font-size: 0.875rem;
    color: #64748b;
}

    .boot-splash-progress:after {
        content: var(--blazor-load-percentage-text, "");
    }

@keyframes boot-splash-rotate {
    100% { transform: rotate(360deg); }
}

@keyframes boot-splash-dash {
    0% { stroke-dasharray: 1px, 200px; stroke-dashoffset: 0; }
    50% { stroke-dasharray: 100px, 200px; stroke-dashoffset: -15px; }
    100% { stroke-dasharray: 100px, 200px; stroke-dashoffset: -125px; }
}

code {
    color: #c02d76;
}

/* ---------- In-app help (Markdown-rendered guides) ---------- */
/* The guide HTML is injected raw, so it needs explicit typography. Colours use MudBlazor
   theme variables so help content follows the active (light/dark) theme. */
.help-content {
    color: var(--mud-palette-text-primary);
    line-height: 1.65;
    font-size: 1rem;
    max-width: 72ch;
}

.help-content h1 {
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.2;
    margin: 0 0 1rem;
}

.help-content h2 {
    font-size: 1.4rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 2.25rem 0 0.75rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--mud-palette-divider);
}

.help-content h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 1.75rem 0 0.5rem;
}

.help-content p {
    margin: 0 0 1rem;
}

.help-content h1 + p,
.help-content h2 + p,
.help-content h3 + p {
    margin-top: 0;
}

.help-content ul,
.help-content ol {
    margin: 0 0 1rem;
    padding-left: 1.5rem;
}

.help-content li {
    margin-bottom: 0.4rem;
}

.help-content li > ul,
.help-content li > ol {
    margin-top: 0.4rem;
}

.help-content a {
    color: var(--mud-palette-primary);
    text-decoration: none;
}

.help-content a:hover {
    text-decoration: underline;
}

.help-content code {
    background: var(--mud-palette-background-grey);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-size: 0.875em;
    color: var(--mud-palette-text-primary);
}

.help-content pre {
    background: var(--mud-palette-background-grey);
    padding: 0.9rem 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 0 0 1rem;
}

.help-content pre code {
    background: none;
    padding: 0;
}

.help-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 0 0 1.25rem;
    font-size: 0.95rem;
}

.help-content th,
.help-content td {
    border: 1px solid var(--mud-palette-lines-default);
    padding: 0.5rem 0.75rem;
    text-align: left;
    vertical-align: top;
}

.help-content thead th {
    background: var(--mud-palette-background-grey);
    font-weight: 600;
}

.help-content tbody tr:nth-child(even) {
    background: var(--mud-palette-background-grey);
}

/* Screenshot-needed callouts are authored as "> 📷 ..." blockquotes. */
.help-content blockquote {
    margin: 0 0 1rem;
    padding: 0.6rem 1rem;
    border-left: 4px solid var(--mud-palette-primary);
    background: var(--mud-palette-background-grey);
    border-radius: 0 4px 4px 0;
    color: var(--mud-palette-text-secondary);
}

.help-content blockquote p {
    margin: 0;
}

.help-content hr {
    border: none;
    border-top: 1px solid var(--mud-palette-divider);
    margin: 2rem 0;
}

/* Print-friendly reports: strip the app chrome (top bar, side nav) and anything explicitly marked
   `.no-print` (filter controls, action buttons), leaving just the report content. Triggered by the
   Print button on the report pages, which calls window.print(). */
@media print {
    .mud-appbar,
    .mud-drawer,
    .mud-overlay,
    .no-print {
        display: none !important;
    }

    /* The drawer normally offsets the content; reclaim the full width once it's hidden. */
    .mud-main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }

    body {
        background: #fff !important;
    }

    /* Keep cards, tables and chart panels from being split awkwardly across pages. */
    .mud-card,
    .mud-paper,
    .mud-table-container,
    .mud-simple-table tr {
        break-inside: avoid;
    }
}

/* ---------- Account & Fleet Settings side-navigation layout ---------- */
.settings-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: stretch;
}

@media (min-width: 960px) {
    .settings-layout {
        flex-direction: row;
        align-items: flex-start;
    }
}

.settings-sidenav {
    width: 100%;
    background-color: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 12px;
    padding: 0.5rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

@media (min-width: 960px) {
    .settings-sidenav {
        width: 260px;
        flex-shrink: 0;
    }
}

.settings-sidenav-section {
    padding: 0.375rem 0.75rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--mud-palette-text-secondary);
}

.settings-sidenav-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--mud-palette-text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.settings-sidenav-btn:hover {
    background-color: var(--mud-palette-action-default-hover);
    color: var(--mud-palette-text-primary);
}

.settings-sidenav-btn.active {
    background-color: var(--mud-palette-secondary);
    color: var(--mud-palette-primary);
    font-weight: 600;
}

.settings-sidenav-btn-label {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-width: 0;
    white-space: nowrap;
}

.settings-sidenav-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    background-color: var(--mud-palette-background);
    color: var(--mud-palette-text-secondary);
    border: 1px solid var(--mud-palette-lines-default);
    line-height: 1.3;
    white-space: nowrap;
}

.settings-sidenav-btn.active .settings-sidenav-badge {
    background-color: var(--mud-palette-surface);
    color: var(--mud-palette-primary);
}

.settings-sidenav-badge-success {
    background-color: rgba(16, 185, 129, 0.14);
    color: #065f46;
    border-color: rgba(16, 185, 129, 0.3);
}

.settings-sidenav-divider {
    height: 1px;
    background-color: var(--mud-palette-lines-default);
    margin: 0.375rem 0.25rem;
}

.settings-content-card {
    flex: 1 1 0%;
    min-width: 0;
    width: 100%;
    background-color: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    min-height: 460px;
}

@media (min-width: 960px) {
    .settings-content-card {
        padding: 1.5rem;
    }
}

.settings-tab-pane {
    display: block;
    width: 100%;
}

.settings-tab-pane.d-none {
    display: none !important;
}


/* Dashboard stat tiles that open the detail behind their number */
.stat-tile-clickable {
    cursor: pointer;
    transition: box-shadow 0.15s ease-in-out;
}

.stat-tile-clickable:hover {
    box-shadow: var(--mud-elevation-4);
}

.stat-tile-clickable:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
}

/* Keep the leading label column visible while scrolling wide report/schedule tables horizontally. */
.sticky-first-col th:first-child,
.sticky-first-col td:first-child {
    position: sticky;
    left: 0;
    background-color: var(--mud-palette-surface);
    z-index: 1;
}
