:root {
    --brand-primary: #0f4c81;
    --brand-secondary: #1f2937;
    --brand-accent: #10b981;
}

html, body {
    margin: 0;
    font-family: Inter, "Segoe UI", sans-serif;
    background: #f8fafc;
    color: #1f2937;
}

/* Blazor's FocusOnNavigate moves keyboard focus to the page h1 after each
   navigation for screen-reader users. The focus itself is still applied
   (so assistive tech announces the new page), but we suppress the visible
   outline entirely since it reads as an accidental selection. */
h1:focus,
h1:focus-visible {
    outline: none;
    box-shadow: none;
}

.client-shell {
    min-height: 100vh;
}

.client-header {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1rem 1.25rem;
}

.client-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.brand-logo {
    max-height: 40px;
    max-width: 120px;
    object-fit: contain;
    background: #fff;
    border-radius: 8px;
    padding: 0.2rem;
}

.client-nav {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.client-nav-link {
    color: var(--brand-primary);
    font-weight: 600;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
}

.client-nav-link.active {
    background: rgba(15, 76, 129, 0.1);
}

.client-main {
    padding: 1.25rem;
}

.client-session {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.client-session-profile {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.client-session-label {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.8;
}

.client-session-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.landing-shell {
    min-height: 100vh;
    background: radial-gradient(circle at top right, #dbeafe, #f8fafc 50%);
    padding: 3rem 2rem;
}

.landing-hero {
    max-width: 900px;
    margin: 0 auto 2rem;
}

.landing-hero h1 {
    margin: 1rem 0;
    font-size: clamp(2rem, 6vw, 3.25rem);
    line-height: 1.08;
}

.landing-hero p {
    font-size: 1.05rem;
    color: #334155;
    max-width: 65ch;
}

.landing-actions {
    margin-top: 1.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.landing-grid {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.landing-card,
.bento-card,
.profile-card,
.office-card,
.auth-card {
    background: #fff;
    border-radius: 18px;
    padding: 1rem;
    box-shadow: 0 10px 30px rgba(15, 76, 129, 0.08);
}

.bento-grid,
.profile-grid,
.office-list,
.detail-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.profile-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.office-list {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.detail-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.profile-meta {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: #e0f2fe;
    color: #075985;
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 600;
    width: fit-content;
}

.status-message {
    margin-top: 0.8rem;
    color: #166534;
    font-weight: 600;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: #f8fafc;
    padding: 1rem;
}

.auth-card-wide {
    width: min(640px, 94vw);
}

.access-checklist {
    padding-left: 1.2rem;
}

.access-facts {
    display: grid;
    gap: 0.65rem;
    margin: 1rem 0;
}

.access-facts div {
    display: grid;
    gap: 0.15rem;
}

.access-facts dt {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #64748b;
}

.access-facts dd {
    margin: 0;
}

.content-logo {
    display: block;
    margin-top: 1rem;
    margin-bottom: 1rem;
    max-width: 180px;
    max-height: 80px;
    object-fit: contain;
}

#blazor-error-ui {
    background: #b91c1c;
    color: #fff;
}

/* ─── Shift list toolbar (tabs + view toggle + cancel reason filter) ─────── */

.shifts-list-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.shifts-list-toolbar-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
}

.shifts-filter-label {
    font-size: 0.85rem;
    color: #374151;
    font-weight: 600;
}

.shifts-reason-filter {
    width: auto;
    min-width: 12rem;
}

.shifts-code-search {
    width: 10.5rem;
    min-width: 8rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.shift-table-wrap {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(15, 76, 129, 0.08);
    overflow: auto;
}

.shift-table {
    margin-bottom: 0;
}

.shift-table thead th {
    border-top: none;
    color: #374151;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

/* ─── Shift cards ─────────────────────────────────────────────────────────── */

.shift-list {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.shift-card {
    background: #fff;
    border-radius: 14px;
    padding: 1rem 1.1rem;
    box-shadow: 0 4px 16px rgba(15, 76, 129, 0.07);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.shift-card--new {
    border: 2px solid #198754;
    box-shadow: 0 0 0 4px rgba(25, 135, 84, 0.18), 0 8px 24px rgba(15, 76, 129, 0.1);
    animation: shift-new-pulse 1.6s ease-out 1;
}

.shift-row--new {
    background: #ecfdf5 !important;
    box-shadow: inset 3px 0 0 #198754;
}

.shift-row--new > td {
    background: transparent;
}

@keyframes shift-new-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(25, 135, 84, 0.45), 0 8px 24px rgba(15, 76, 129, 0.1);
    }
    100% {
        box-shadow: 0 0 0 4px rgba(25, 135, 84, 0.18), 0 8px 24px rgba(15, 76, 129, 0.1);
    }
}

.shift-badge-new {
    background: #198754;
    color: #fff;
    letter-spacing: 0.04em;
    font-weight: 700;
}

.shift-code-inline {
    display: inline-block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #0f172a;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.1rem 0.4rem;
    font-size: 0.85em;
}

.shift-new-banner {
    border-radius: 12px;
    border: 1px solid #bbf7d0;
    background: #ecfdf5;
    color: #14532d;
}

.shift-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

/* Success popup after create shift */
.shift-created-modal {
    z-index: 1055;
}

.shift-created-content {
    border: none;
    border-radius: 18px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
}

.shift-created-icon {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 999px;
    background: #d1fae5;
    color: #047857;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
    margin: 0 auto;
}

.shift-created-code {
    display: inline-block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    color: #0f172a;
    background: #f8fafc;
    border: 2px dashed #94a3b8;
    border-radius: 12px;
    padding: 0.65rem 1.1rem;
}

.shift-created-backdrop {
    z-index: 1050;
}

.shift-office {
    color: #374151;
}

.shift-date {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    color: #111827;
}

.shift-time {
    font-size: 0.9rem;
    color: #374151;
    margin: 0;
}

/* Status badge colours */
.shift-status-open       { background-color: #0d6efd; color: #fff; }
.shift-status-scheduled  { background-color: #0dcaf0; color: #000; }
.shift-status-signoff    { background-color: #fd7e14; color: #fff; }
.shift-status-completed  { background-color: #198754; color: #fff; }
.shift-status-paid       { background-color: #6f42c1; color: #fff; }
.shift-status-cancelled  { background-color: #6c757d; color: #fff; }

.status-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 1rem;
    list-style: none;
    padding: 0.75rem 0.9rem;
    margin: 0 0 1rem;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(15, 76, 129, 0.07);
}

.status-legend li {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: #374151;
    font-size: 0.92rem;
}

.next-step {
    margin: 0 0 1rem;
    padding: 0.8rem 0.95rem;
    background: #fff;
    border-radius: 14px;
    border-left: 4px solid var(--brand-primary, #0f4c81);
    box-shadow: 0 4px 16px rgba(15, 76, 129, 0.07);
    color: #374151;
    max-width: 70ch;
}

.next-step strong {
    display: block;
    margin-bottom: 0.15rem;
    color: #1f2937;
}

/* At-a-glance shift status flow (Shift Details header) */
.shift-status-flow {
    margin: 0 0 1.25rem;
    padding: 0.85rem 1rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    overflow-x: auto;
}

.shift-status-flow__list {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0.15rem 0;
    min-width: min-content;
}

.shift-status-flow__step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 6.5rem;
    max-width: 9rem;
    padding: 0 0.35rem;
}

.shift-status-flow__badge {
    display: inline-block;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    box-shadow: 0 0 0 2px transparent;
}

.shift-status-flow__step.is-current .shift-status-flow__badge {
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.18);
    transform: scale(1.04);
}

.shift-status-flow__step.is-future .shift-status-flow__badge {
    background-color: #f3f4f6 !important;
    color: #9ca3af !important;
    border: 1px dashed #d1d5db;
}

.shift-status-flow__step.is-cancelled .shift-status-flow__badge {
    /* keep cancelled grey; emphasize as terminal */
    box-shadow: 0 0 0 3px rgba(108, 117, 125, 0.25);
}

.shift-status-flow__when {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.72rem;
    line-height: 1.25;
    color: #4b5563;
    max-width: 8.5rem;
}

.shift-status-flow__when--muted {
    color: #9ca3af;
}

.shift-status-flow__connector {
    flex: 0 0 auto;
    width: 1.75rem;
    min-width: 1.25rem;
    height: 0;
    margin-top: 0.85rem;
    border-top: 2px solid #d1d5db;
    align-self: flex-start;
}

.shift-status-flow__connector.is-reached {
    border-top-color: #6b7280;
}

@media (max-width: 576px) {
    .shift-status-flow__list {
        justify-content: flex-start;
    }

    .shift-status-flow__step {
        min-width: 5.5rem;
    }

    .shift-status-flow__connector {
        width: 1rem;
    }
}

/* Shift timing badges (shown when an Open/Scheduled shift's window has started or passed) */
.shift-timing-inprogress { background-color: #fd7e14; color: #fff; }
.shift-timing-past       { background-color: #dc3545; color: #fff; }
.shift-timing-signoff    { background-color: #fd7e14; color: #fff; }

.signoff-confirm-card {
    border: 2px solid #fd7e14;
    box-shadow: 0 4px 16px rgba(253, 126, 20, 0.12);
}

/* Side-by-side time pairs (start/end, lunch start/end); stack on small screens */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1rem;
    margin-bottom: 0.75rem;
}

.form-row > .form-group {
    margin-bottom: 0;
    min-width: 0;
}

@media (max-width: 575.98px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.shift-detail-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.85rem 1.25rem;
    margin-bottom: 1.25rem;
}

.shift-detail-title-block {
    min-width: 0;
    flex: 1 1 16rem;
}

.shift-detail-office-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 0.85rem;
}

.shift-detail-office-name {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: #1f2937;
}

.shift-detail-page-label {
    margin: 0.3rem 0 0;
    font-size: 0.9rem;
    color: #6b7280;
}

.shift-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.shift-details-list {
    margin: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.35rem 0.75rem;
}

.shift-details-list dt,
.shift-details-list dd {
    margin: 0;
}

.shift-details-list dt {
    color: #374151;
    font-weight: 600;
}

/* Assigned professional callout on shift summary card */
.shift-assigned {
    margin-top: 0.9rem;
    padding: 0.75rem 0.85rem;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.shift-assigned.is-assigned {
    background: #ecfdf5;
    box-shadow: inset 0 0 0 1px #86efac;
}

.shift-assigned.is-unassigned {
    background: #f8fafc;
    box-shadow: inset 0 0 0 1px #e5e7eb;
}

.shift-assigned-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #6b7280;
}

.shift-assigned.is-assigned .shift-assigned-label {
    color: #166534;
}

.shift-assigned-name {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.25;
}

.shift-assigned-contact {
    font-size: 0.85rem;
    color: #6b7280;
    line-height: 1.35;
    word-break: break-word;
}

.applicant-timeline {
    display: grid;
    gap: 1rem;
}

.timeline-filter-seg {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.25rem;
    background: #f1f5f9;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
}

.timeline-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: none;
    background: transparent;
    color: #475569;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.timeline-filter-btn:hover {
    color: #0f172a;
    background: rgba(255, 255, 255, 0.65);
}

.timeline-filter-btn.is-active {
    background: #fff;
    color: #0f172a;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.timeline-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.4rem;
    height: 1.25rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: #e2e8f0;
    color: #334155;
    font-size: 0.75rem;
    font-weight: 700;
}

.timeline-filter-btn.is-active .timeline-filter-count {
    background: #dbeafe;
    color: #1d4ed8;
}

.timeline-outreach-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.15rem;
    margin: 0;
    padding: 0.65rem 0.85rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    color: #334155;
    font-size: 0.9rem;
    line-height: 1.35;
}

.timeline-empty-state {
    padding: 0.25rem 0;
}

.timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 14px 1fr;
    gap: 0.85rem;
    align-items: start;
}

.timeline-item:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 14px;
    bottom: -1rem;
    width: 2px;
    background: #dbeafe;
}

.timeline-marker {
    width: 14px;
    height: 14px;
    margin-top: 0.25rem;
    border-radius: 999px;
    background: #0d6efd;
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.12);
}

.timeline-item--accepted .timeline-marker {
    background: #198754;
    box-shadow: 0 0 0 4px rgba(25, 135, 84, 0.16);
}

.timeline-item--accepted:not(:last-child)::before {
    background: #bbf7d0;
}

.timeline-card {
    background: #f8fbff;
    border: 1px solid #dbeafe;
    border-radius: 14px;
    padding: 0.9rem 1rem;
}

.timeline-card--accepted {
    background: #f0fdf4;
    border: 2px solid #198754;
    box-shadow: 0 4px 14px rgba(25, 135, 84, 0.12);
}

.timeline-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.timeline-header-toggle {
    width: 100%;
    background: none;
    border: none;
    padding: 0;
    margin-bottom: 0;
    text-align: left;
    cursor: pointer;
}

.timeline-header-toggle:hover .timeline-title {
    color: #0d6efd;
}

.timeline-item--accepted .timeline-header-toggle:hover .timeline-title {
    color: #166534;
}

.timeline-toggle-chevron {
    font-size: 0.7rem;
    color: #6b7280;
}

.timeline-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    color: #111827;
}

.timeline-subtitle {
    font-size: 0.88rem;
    color: #6b7280;
}

.timeline-accepted-callout {
    margin-top: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #166534;
}

.timeline-meta {
    margin: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.35rem 0.75rem;
}

.timeline-meta dt,
.timeline-meta dd {
    margin: 0;
}

.timeline-meta dt {
    color: #374151;
    font-weight: 600;
}

/* Nudge confirmation (manager shift detail — resend invitation) */
.nudge-confirm-modal {
    z-index: 1055;
}

.nudge-confirm-content {
    border: none;
    border-radius: 18px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
}

.nudge-confirm-icon {
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 1.15rem;
    line-height: 1;
}

.nudge-confirm-summary {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.85rem 1rem;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.nudge-confirm-summary-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.35rem 1rem;
    font-size: 0.9rem;
}

.nudge-confirm-summary-row strong {
    text-align: right;
    color: #1f2937;
}

.nudge-confirm-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}

.nudge-confirm-backdrop {
    z-index: 1050;
}

/* ─── Shifts section header ───────────────────────────────────────────────── */
.shifts-section {}

/* ─── Managed offices (dashboard) ─────────────────────────────────────────── */

.offices-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.offices-toolbar-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
}

.offices-sort-label {
    font-size: 0.85rem;
    color: #374151;
    font-weight: 600;
}

.offices-sort-select {
    width: auto;
}

.view-toggle {
    display: inline-flex;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}

.view-toggle-btn {
    border: none;
    background: #fff;
    color: #374151;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.35rem 0.85rem;
    cursor: pointer;
}

.view-toggle-btn.active {
    background: var(--brand-primary);
    color: #fff;
}

.office-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.favorite-toggle {
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 1.35rem;
    line-height: 1;
    padding: 0.1rem 0.3rem;
    cursor: pointer;
    border-radius: 999px;
    transition: color 0.15s ease, transform 0.1s ease;
}

.favorite-toggle:hover {
    color: var(--brand-accent);
}

.favorite-toggle:active {
    transform: scale(0.9);
}

.favorite-toggle.is-favorite {
    color: var(--brand-accent);
}

.office-table-wrap {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(15, 76, 129, 0.08);
    overflow: hidden;
}

.office-table {
    margin-bottom: 0;
}

.office-table thead th {
    border-top: none;
    color: #374151;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.office-table-fav-col {
    width: 2.5rem;
}
