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

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

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5I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I2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

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

/* Branded boot splash. Replaces the default Blazor circular spinner with a stacked
   logo + wordmark + linear progress bar that matches the app theme. Shown while
   blazor.webassembly.js downloads the runtime + bundles. The Blazor host writes
   --blazor-load-percentage and --blazor-load-percentage-text as CSS vars on :root,
   which tt-splash-fill and tt-splash-status read. */
.tt-splash {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    background: #ffffff;
    /* Use the system font during boot — Roboto may still be downloading. */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    color: #1F2933;
}

.tt-splash-logo {
    width: 6.5rem;
    height: 6.5rem;
    filter: drop-shadow(0 6px 18px rgba(37, 99, 235, 0.25));
    /* Gentle breathing animation so the page doesn't look frozen during a slow boot. */
    animation: tt-splash-pulse 2.4s ease-in-out infinite;
}

@keyframes tt-splash-pulse {
    0%, 100% { transform: scale(1);    opacity: 1;    }
    50%      { transform: scale(1.04); opacity: 0.92; }
}

.tt-splash-title {
    font-size: 1.6rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.tt-splash-bar {
    width: min(16rem, 60vw);
    height: 6px;
    background: rgba(37, 99, 235, 0.12);
    border-radius: 999px;
    overflow: hidden;
}

.tt-splash-fill {
    height: 100%;
    width: var(--blazor-load-percentage, 0%);
    background: #2563EB;
    border-radius: 999px;
    transition: width 0.1s linear;
}

.tt-splash-status {
    font-size: 0.85rem;
    color: #6b7280;
    min-height: 1.2em;
}

.tt-splash-status:after {
    content: var(--blazor-load-percentage-text, "Loading…");
}

/* Honor the OS dark-mode preference during boot. The app's persisted DarkMode
   preference isn't available until after /api/me resolves, which is after the
   splash hides — so OS-level prefers-color-scheme is the only signal we have. */
@media (prefers-color-scheme: dark) {
    .tt-splash {
        background: #1f2933;
        color: #f3f4f6;
    }
    .tt-splash-bar {
        background: rgba(91, 141, 239, 0.25);
    }
    .tt-splash-fill {
        background: #5B8DEF;
    }
    .tt-splash-status {
        color: #9ca3af;
    }
}

code {
    color: #c02d76;
}

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

/* Log Time group-header band. Tinted background + accent border so the period dividers
   read clearly against the white entry cards on either side. Works in light + dark via
   MudBlazor palette vars; text uses the default palette so contrast stays high. */
.tt-group-header {
    background: var(--mud-palette-primary-hover) !important; /* very light primary tint */
    border-left: 3px solid var(--mud-palette-primary) !important;
    border-radius: 4px;
}

/* Outlook-style tasks list — columnar first line + description that wraps the full row width. */
.tt-tasks {
    --tt-col-pri: 24px;
    --tt-col-title: 220px;
    --tt-col-assignee: 120px;
    --tt-col-project: 140px;
    --tt-col-due: 72px;
    --tt-col-est: 56px;
    --tt-col-progress: 140px;
    --tt-col-actions: 124px;
    --tt-col-gap: .5rem;
    overflow: hidden;
    /* Container query reference: child media queries below trigger based on THIS element's
       width, not the viewport. Without this, tablet portrait (768px viewport) hits the page
       with a ~250px sidebar leaving ~500px for the table — too narrow for the 8-column row,
       so the actions column got clipped by overflow:hidden. */
    container-type: inline-size;
    container-name: tt-tasks-container;
}

.tt-tasks__head,
.tt-tasks__line {
    display: grid;
    grid-template-columns:
        var(--tt-col-pri) minmax(var(--tt-col-title), 1fr)
        var(--tt-col-assignee) var(--tt-col-project)
        var(--tt-col-due) var(--tt-col-est)
        var(--tt-col-progress) var(--tt-col-actions);
    column-gap: var(--tt-col-gap);
    align-items: center;
}

.tt-tasks__head {
    padding: .5rem .75rem;
    border-bottom: 1px solid var(--mud-palette-table-lines);
    background: var(--mud-palette-table-striped);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    font-size: .72rem;
    color: var(--mud-palette-text-secondary);
}

.tt-tasks__head .tt-col {
    cursor: pointer;
    user-select: none;
}

.tt-tasks__row {
    padding: .45rem .75rem .6rem;
    border-bottom: 1px solid var(--mud-palette-table-lines);
}

.tt-tasks__row:hover {
    background: var(--mud-palette-action-default-hover);
}

.tt-tasks__row:last-child {
    border-bottom: none;
}

.tt-tasks__preview {
    /* Indent under the title column so the eye lines up under the bold title text;
       wraps freely across the full remaining width of the row. */
    margin-top: .2rem;
    padding-left: calc(var(--tt-col-pri) + var(--tt-col-gap));
    color: var(--mud-palette-text-secondary);
    font-size: .85rem;
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
}

.tt-tasks__title {
    /* Allow the title to truncate gracefully if a row gets tight — chips still sit beside it. */
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tt-tasks__ellipsis {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tt-tasks__empty {
    padding: 1rem;
    text-align: center;
}

.tt-col {
    min-width: 0; /* let cells shrink so ellipsis works */
}

.tt-col--pri      { width: var(--tt-col-pri); text-align: center; }
.tt-col--assignee { width: var(--tt-col-assignee); }
.tt-col--project  { width: var(--tt-col-project); }
.tt-col--due      { width: var(--tt-col-due); }
.tt-col--est      { width: var(--tt-col-est); }
.tt-col--progress { width: var(--tt-col-progress); }
.tt-col--actions  { width: var(--tt-col-actions); text-align: right; white-space: nowrap; }

/* Collapse the secondary columns under the title when the table itself is too narrow to fit
   the full 8-column row. The grid's natural minimum is ~976px (24 priority + 220 title min
   + 120 assignee + 140 project + 72 due + 56 est + 140 progress + 124 actions + 56 gaps +
   24 row padding). Anything below that forces the title past its minmax floor and overflows
   the right, clipping actions. 1000px = the natural minimum plus a small safety margin so
   iPad-landscape-with-sidebar (~1024 viewport - ~250 sidebar = ~770 table width) collapses
   cleanly. Container query (not @media) so this fires from sidebar narrowing too. */
@container tt-tasks-container (max-width: 1000px) {
    .tt-tasks__head,
    .tt-tasks__line {
        grid-template-columns: var(--tt-col-pri) minmax(0, 1fr) var(--tt-col-actions);
    }
    .tt-tasks__head .tt-col--assignee,
    .tt-tasks__head .tt-col--project,
    .tt-tasks__head .tt-col--due,
    .tt-tasks__head .tt-col--est,
    .tt-tasks__head .tt-col--progress { display: none; }
    .tt-tasks__line .tt-col--assignee,
    .tt-tasks__line .tt-col--project,
    .tt-tasks__line .tt-col--due,
    .tt-tasks__line .tt-col--est,
    .tt-tasks__line .tt-col--progress {
        grid-column: 2 / -1;
    }
}