:root {
    --wv-primary: #0F766E;
    --wv-secondary: #14B8A6;
    --wv-accent: #A7F3D0;
    --wv-background: #F8FAFC;
    --wv-text: #172033;
    --wv-danger: #DC2626;
    --wv-warning: #D97706;
    --wv-sidebar-width: 240px;
}

body {
    background: var(--wv-background);
    color: var(--wv-text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* --- Auth pages (no sidebar) --- */
.wv-auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, var(--wv-primary), var(--wv-secondary));
}

.wv-auth-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 20px 50px rgba(15, 118, 110, 0.25);
    padding: 2.5rem;
}

/* --- App shell --- */
.wv-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--wv-sidebar-width);
    background: var(--wv-primary);
    color: #fff;
    display: flex;
    flex-direction: column;
    z-index: 1030;
    transition: transform 0.2s ease;
}

.wv-sidebar-brand {
    padding: 0.85rem 1rem;
    font-weight: 700;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    white-space: nowrap;
}

.wv-sidebar-collapse {
    background: none;
    border: 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.15rem;
    line-height: 1;
    padding: 0.15rem 0.35rem;
    border-radius: 0.25rem;
    flex-shrink: 0;
}

.wv-sidebar-collapse:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.wv-brand-icon {
    font-size: 1.15rem;
}

/* Fixed, so it stays put while the tree scrolls under it -- a filter box
   that scrolls away is one you have to hunt for to clear. */
.wv-nav-filter {
    position: relative;
    padding: 0.5rem 0.75rem 0.25rem;
    flex: 0 0 auto;
}

.wv-nav-filter .bi {
    position: absolute;
    left: 1.35rem;
    top: 50%;
    transform: translateY(-40%);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
    pointer-events: none;
}

.wv-nav-filter input {
    width: 100%;
    padding: 0.35rem 0.5rem 0.35rem 1.85rem;
    font-size: 0.82rem;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 6px;
}

.wv-nav-filter input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.wv-nav-filter input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.4);
}

/* The tree scrolls on its own, independently of the page. */
.wv-nav {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.5rem 0;
    /* Keeps the restored scroll position from animating on every page load. */
    scroll-behavior: auto;
}

.wv-nav-empty {
    padding: 1rem 1.25rem;
    font-size: 0.8rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.55);
}

.wv-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 1.1rem;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
    white-space: nowrap;
    /* Anchors the unread dot when the sidebar is collapsed to the icon rail. */
    position: relative;
}

.wv-nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.wv-nav-link.active {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    border-left-color: var(--wv-accent);
    font-weight: 600;
}

.wv-nav-link i {
    font-size: 1.05rem;
    width: 1.25rem;
    text-align: center;
    flex-shrink: 0;
}

/* --- Two-level nav ----------------------------------------------------- */
.wv-nav-group.open > .wv-nav-parent .wv-nav-caret {
    transform: rotate(180deg);
}

.wv-nav-parent {
    width: 100%;
    background: none;
    border: 0;
    border-left: 3px solid transparent;
    text-align: left;
}

.wv-nav-parent.has-active {
    color: #fff;
    font-weight: 600;
}

.wv-nav-caret {
    margin-left: auto;
    font-size: 0.7rem !important;
    width: auto !important;
    opacity: 0.7;
    transition: transform 0.15s ease;
}

/* Children sit on a darker ground and are indented, so the hierarchy reads
   at a glance rather than needing the indent alone to carry it. */
.wv-nav-children {
    background: rgba(0, 0, 0, 0.16);
    padding: 0.15rem 0;
}

.wv-nav-child {
    padding-left: 2.4rem;
    font-size: 0.865rem;
}

.wv-nav-child i {
    font-size: 0.95rem;
}

/* --- Collapsed rail --------------------------------------------------- */
body.wv-nav-collapsed {
    --wv-sidebar-width: 56px;
}

body.wv-nav-collapsed .wv-brand-text,
body.wv-nav-collapsed .wv-brand-icon,
body.wv-nav-collapsed .wv-nav-text,
body.wv-nav-collapsed .wv-nav-caret,
body.wv-nav-collapsed .wv-nav-empty {
    display: none;
}

/* Sub-links are hidden entirely on the rail -- clicking a parent expands the
   sidebar back out rather than trying to nest inside 56px. */
body.wv-nav-collapsed .wv-nav-children {
    display: none;
}

/* No room for it on a 56px rail, and nowhere to show the results. */
body.wv-nav-collapsed .wv-nav-filter {
    display: none;
}

body.wv-nav-collapsed .wv-nav-link {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

body.wv-nav-collapsed .wv-sidebar-brand {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

.wv-main {
    margin-left: var(--wv-sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* An explicit gap rather than space-between: the mobile menu button is a
   zero-width flex child on desktop, and space-between distributed the slack
   around it, pushing the heading and search out of alignment. */
.wv-topbar {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.6rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 1020;
    min-height: 60px;
}

.wv-page-heading {
    white-space: nowrap;
    flex-shrink: 0;
}

/* The search takes the middle, and the actions are pinned right by the
   auto margin -- so the toolbar keeps its shape whatever the heading says. */
.wv-topbar-actions {
    margin-left: auto;
    flex-shrink: 0;
}

.wv-content {
    padding: 1.5rem;
    flex: 1;
}

.wv-user-chip {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
}

.wv-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--wv-secondary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    overflow: hidden;
}

.wv-avatar-lg {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: var(--wv-secondary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 2rem;
    overflow: hidden;
    flex-shrink: 0;
}

.wv-avatar img,
.wv-avatar-lg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 991.98px) {
    .wv-sidebar {
        transform: translateX(-100%);
    }

    .wv-sidebar.show {
        transform: translateX(0);
    }

    .wv-main {
        margin-left: 0;
    }
}

/* --- Shared components --- */
.wv-stat-card {
    background: #fff;
    border-radius: 0.6rem;
    border: 1px solid #e2e8f0;
    padding: 1.25rem;
    height: 100%;
}

.wv-stat-card .wv-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--wv-primary);
}

.wv-stat-card .wv-stat-label {
    color: #64748b;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.wv-panel {
    background: #fff;
    border-radius: 0.6rem;
    border: 1px solid #e2e8f0;
    padding: 1.25rem;
}

.wv-badge-status {
    text-transform: capitalize;
}

.btn-wv-primary {
    background: var(--wv-primary);
    border-color: var(--wv-primary);
    color: #fff;
}

.btn-wv-primary:hover {
    background: #0b5d56;
    border-color: #0b5d56;
    color: #fff;
}

.table-hover tbody tr {
    cursor: pointer;
}

.wv-placeholder {
    text-align: center;
    padding: 4rem 1rem;
    color: #64748b;
}

.wv-placeholder i {
    font-size: 3rem;
    color: var(--wv-secondary);
}

.wv-toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1080;
}

/* --- Communications: chat --- */
.wv-room-list {
    max-height: 70vh;
    overflow-y: auto;
}

.wv-room-item {
    cursor: pointer;
    border-radius: 0.5rem;
    padding: 0.6rem 0.75rem;
}

.wv-room-item:hover {
    background: #f1f5f9;
}

.wv-room-item.active {
    background: #e6f2f0;
}

.wv-chat-messages {
    height: 55vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.wv-chat-bubble {
    max-width: 70%;
    padding: 0.5rem 0.75rem;
    border-radius: 0.75rem;
    background: #f1f5f9;
    align-self: flex-start;
}

.wv-chat-bubble.mine {
    background: var(--wv-primary);
    color: #fff;
    align-self: flex-end;
}

.wv-chat-bubble .wv-chat-meta {
    font-size: 0.72rem;
    opacity: 0.7;
    margin-bottom: 0.15rem;
}

/* --- Public (candidate-facing) onboarding page ---------------------------
   Standalone chrome: this page is opened from an email by someone with no
   account, so it deliberately shares nothing with the authenticated shell
   beyond the panel styling. */
.wv-public-body {
    background: var(--wv-background);
    min-height: 100vh;
}

.wv-public-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.wv-public-header {
    background: var(--wv-primary);
    color: #fff;
    padding: 0.9rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.wv-public-main {
    flex: 1;
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 1.5rem 1rem 2.5rem;
}

.wv-public-footer {
    background: #fff;
    border-top: 1px solid #e2e8f0;
    padding: 1rem 1.5rem;
    text-align: center;
    color: #64748b;
}

.wv-public-banner {
    position: fixed;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    background: #198754;
    color: #fff;
    padding: 0.65rem 1.25rem;
    border-radius: 999px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    z-index: 1080;
}

/* --- Topbar actions: notifications, action items, profile --------------- */
.wv-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: auto;
    flex-shrink: 0;
}

.wv-icon-btn {
    position: relative;
    background: none;
    border: 0;
    color: #475569;
    font-size: 1.15rem;
    line-height: 1;
    padding: 0.45rem 0.55rem;
    border-radius: 0.4rem;
}

.wv-icon-btn:hover {
    background: #f1f5f9;
    color: var(--wv-primary);
}

/* The counter deliberately sits on the icon rather than beside it -- a badge
   that moves the layout when it appears makes the toolbar jump. */
.wv-icon-badge {
    position: absolute;
    top: 0.1rem;
    right: 0.1rem;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--wv-danger);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 17px;
    text-align: center;
}

.wv-dropdown-panel {
    width: 340px;
    max-width: 92vw;
    padding: 0;
    max-height: 70vh;
    overflow-y: auto;
}

.wv-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
    font-size: 0.9rem;
    position: sticky;
    top: 0;
    background: #fff;
}

.wv-dropdown-item {
    display: flex;
    align-items: start;
    gap: 0.65rem;
    width: 100%;
    text-align: left;
    background: none;
    border: 0;
    border-bottom: 1px solid #f1f5f9;
    padding: 0.6rem 0.9rem;
    color: inherit;
    text-decoration: none;
    font-size: 0.875rem;
}

.wv-dropdown-item:hover {
    background: #f8fafc;
    color: inherit;
}

.wv-dropdown-item i {
    font-size: 1rem;
    margin-top: 0.1rem;
}

.wv-dropdown-empty {
    padding: 1.25rem 0.9rem;
    margin: 0;
    text-align: center;
    color: #64748b;
    font-size: 0.875rem;
}

.wv-profile-menu {
    min-width: 250px;
}

.wv-profile-head {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 1rem 0.35rem;
}

.wv-avatar-md {
    width: 44px;
    height: 44px;
    font-size: 1rem;
    flex-shrink: 0;
}

/* --- Global search ------------------------------------------------------ */
.wv-search {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 420px;
}

.wv-search-icon {
    position: absolute;
    left: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.9rem;
    pointer-events: none;
}

.wv-search .form-control {
    padding-left: 2rem;
    padding-right: 2rem;
    background: #f1f5f9;
    border-color: transparent;
}

.wv-search .form-control:focus {
    background: #fff;
    border-color: var(--wv-secondary);
    box-shadow: 0 0 0 0.15rem rgba(20, 184, 166, 0.2);
}

.wv-search-kbd {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 0.25rem;
    color: #64748b;
    font-size: 0.7rem;
    padding: 0 0.35rem;
    pointer-events: none;
}

.wv-search .form-control:focus ~ .wv-search-kbd {
    display: none;
}

.wv-search-results {
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
    max-height: 65vh;
    overflow-y: auto;
    z-index: 1050;
}

.wv-search-group {
    padding: 0.55rem 0.9rem 0.25rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #94a3b8;
    background: #f8fafc;
}

@media (max-width: 767.98px) {
    .wv-search {
        display: none;
    }

    .wv-page-heading {
        flex: 1;
    }
}

/* Charts sit in a fixed-height wrapper because Chart.js with
   maintainAspectRatio:false takes its height from the container -- that is
   what keeps the donuts compact instead of growing with the column width. */
.wv-chart-sm {
    position: relative;
    height: 190px;
}

.wv-chart-md {
    position: relative;
    height: 260px;
}

/* --- Rota week grid ----------------------------------------------------- */
.wv-rota-table {
    table-layout: fixed;
    min-width: 1000px;
}

.wv-rota-table th,
.wv-rota-table td {
    vertical-align: top;
    padding: 0.5rem;
    border-color: #e2e8f0;
}

.wv-rota-table thead th {
    background: #f8fafc;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    position: sticky;
    top: 0;
    z-index: 1;
}

.wv-rota-staff {
    width: 190px;
    background: #f8fafc;
    position: sticky;
    left: 0;
    z-index: 2;
}

.wv-rota-today {
    background: rgba(20, 184, 166, 0.07);
}

/* A draft shift must never be mistaken for a published one -- a worker
   cannot see drafts, so the difference is the whole point of the view. */
.wv-shift-chip {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.35rem 0.5rem;
    margin-bottom: 0.3rem;
    border-radius: 0.35rem;
    font-size: 0.78rem;
    line-height: 1.25;
    cursor: pointer;
    border-left: 3px solid var(--wv-primary);
    background: rgba(15, 118, 110, 0.1);
}

.wv-shift-chip:hover {
    background: rgba(15, 118, 110, 0.18);
}

.wv-shift-chip.draft {
    border-left-color: var(--wv-warning);
    background: rgba(217, 119, 6, 0.1);
    border-style: dashed;
    border-width: 1px 1px 1px 3px;
}

.wv-shift-time {
    font-weight: 600;
}

.wv-shift-meta,
.wv-shift-residents {
    color: #64748b;
    font-size: 0.72rem;
}

/* What actually happened on a shift, under what was planned. Muted by
   default: on a well-run week every chip carries one of these, and a rota
   where every line shouts is one nobody reads. */
.wv-shift-attend {
    display: block;
    font-size: 0.7rem;
    color: #475569;
    margin-top: 0.15rem;
}

.wv-shift-attend.on_shift {
    color: #0f766e;
    font-weight: 600;
}

/* A past shift nobody clocked into is a gap in the record, which is the one
   state on this chip worth interrupting somebody for. */
.wv-shift-attend.missing {
    color: #b91c1c;
    font-weight: 600;
}

.wv-shift-late {
    display: inline-block;
    font-size: 0.66rem;
    padding: 0 0.3rem;
    border-radius: 0.25rem;
    margin-top: 0.1rem;
}

.wv-shift-late.late {
    background: #fef3c7;
    color: #92400e;
}

/* Early is information, not a problem -- shown in a neutral colour so it
   reads as a fact rather than a fault. */
.wv-shift-late.early {
    background: #e2e8f0;
    color: #475569;
}

.wv-rota-add {
    width: 100%;
    border: 1px dashed #cbd5e1;
    background: none;
    color: #94a3b8;
    border-radius: 0.35rem;
    font-size: 0.85rem;
    line-height: 1.4;
    opacity: 0;
    transition: opacity 0.12s ease;
}

.wv-rota-table td:hover .wv-rota-add {
    opacity: 1;
}

.wv-rota-add:hover {
    border-color: var(--wv-primary);
    color: var(--wv-primary);
}

/* --- Calendar -------------------------------------------------------------
   Shifts and approved leave overlaid on the same grid -- the whole point is
   that a manager sees the gap leave creates on the day it creates it,
   rather than checking two separate lists and doing the subtraction in
   their head. */
.wv-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(120px, 1fr));
    min-width: 900px;
}

.wv-cal-weekday {
    background: #f8fafc;
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
    text-align: center;
    padding: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.wv-cal-day {
    min-height: 110px;
    padding: 0.4rem;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.wv-cal-day-number {
    font-size: 0.78rem;
    font-weight: 600;
    color: #475569;
}

.wv-cal-other-month {
    background: #f8fafc;
}

.wv-cal-other-month .wv-cal-day-number {
    color: #cbd5e1;
}

.wv-cal-today {
    background: rgba(20, 184, 166, 0.07);
}

.wv-cal-today .wv-cal-day-number {
    color: var(--wv-primary);
}

.wv-cal-shift-item {
    font-size: 0.7rem;
    line-height: 1.3;
    padding: 0.05rem 0.3rem;
    border-radius: 0.25rem;
    border-left: 2px solid var(--wv-primary);
    background: rgba(15, 118, 110, 0.08);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wv-cal-leave-item {
    font-size: 0.7rem;
    line-height: 1.3;
    padding: 0.05rem 0.3rem;
    border-radius: 0.25rem;
    border-left: 2px solid var(--wv-warning);
    background: rgba(217, 119, 6, 0.08);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wv-cal-more {
    font-size: 0.68rem;
    color: #94a3b8;
}

.wv-cal-dot {
    display: inline-block;
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    margin-right: 0.3rem;
}

.wv-cal-dot-shift { background: var(--wv-primary); }
.wv-cal-dot-leave { background: var(--wv-warning); }

/* --- Resident photo -----------------------------------------------------
   The photo and the initials fallback share one slot so the header does not
   jump when a photo is added. */
.wv-photo-slot {
    position: relative;
    width: 72px;
    height: 72px;
}

.wv-photo {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e2e8f0;
}

.wv-photo-edit {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: var(--wv-primary);
    color: #fff;
    font-size: 0.7rem;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.wv-photo-edit:hover {
    background: #0b5e57;
}

/* --- Activity log -------------------------------------------------------
   Each entry is a card rather than a table row: an entry carries a variable
   set of answers, a note, photographs and a shift context strip, and none of
   that survives being squeezed into fixed columns.

   Severity is carried on the left border. Colour alone would be the only
   signal for a red/green colour-blind reader, so the Incident badge in the
   heading says it in words too. */
.wv-entry {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-left: 3px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.85rem 1rem;
    margin-bottom: 0.6rem;
}

.wv-entry-notable {
    border-left-color: var(--wv-warning);
}

.wv-entry-incident {
    border-left-color: var(--wv-danger);
    background: #fef7f7;
}

/* Handover carries no severity of its own -- it is routine by definition --
   so it needs a visual identity independent of the severity border above,
   or it is indistinguishable from any other routine entry in a 35-type
   catalogue. */
.wv-entry-handover {
    border-left-color: var(--wv-primary);
}

.wv-entry-outstanding {
    background: #fff8e6;
    border: 1px solid var(--wv-warning);
    border-radius: 0.35rem;
    padding: 0.5rem 0.65rem;
    margin-top: 0.5rem;
}

.wv-entry-icon {
    font-size: 1.15rem;
    color: var(--wv-primary);
    width: 1.5rem;
    text-align: center;
}

.wv-entry-context {
    margin-top: 0.6rem;
    padding-top: 0.5rem;
    border-top: 1px dashed #e2e8f0;
    font-size: 0.75rem;
    color: #64748b;
}

.wv-entry-thumb {
    width: 68px;
    height: 68px;
    object-fit: cover;
    border-radius: 0.35rem;
    border: 1px solid #e2e8f0;
    cursor: pointer;
}

.wv-entry-thumb:hover {
    border-color: var(--wv-primary);
}

.wv-day-heading {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #475569;
    padding-bottom: 0.35rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
}

/* The emotion picker: an outline button that fills in when chosen, so the
   selected state survives without relying on colour alone. */
.wv-emotion {
    font-size: 1.35rem;
    line-height: 1;
    padding: 0.35rem 0.75rem;
}

.wv-emotion.active {
    box-shadow: inset 0 0 0 2px currentColor;
}

/* --- Summary tiles ------------------------------------------------------ */
.wv-tile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
}

.wv-tile i {
    font-size: 1.4rem;
    opacity: 0.85;
}

.wv-tile-value {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.1;
}

.wv-tile-label {
    font-size: 0.75rem;
    color: #64748b;
}

.wv-tile-primary i { color: var(--wv-primary); }
.wv-tile-danger i { color: var(--wv-danger); }
.wv-tile-warning i { color: var(--wv-warning); }
.wv-tile-muted i { color: #94a3b8; }

.wv-tile-clickable {
    cursor: pointer;
    transition: box-shadow 0.15s ease;
}
.wv-tile-clickable:hover {
    box-shadow: 0 0 0 1px var(--wv-primary);
}

/* --- Notification badges ------------------------------------------------
   The bell takes the colour of the worst thing behind it. A red alert sitting
   as one grey number among several reads as routine, which is the one thing
   it must never do. */
.wv-icon-badge.wv-badge-critical {
    background: var(--wv-danger);
    animation: wv-pulse 2s ease-in-out infinite;
}

.wv-icon-badge.wv-badge-high {
    background: var(--wv-warning);
}

@keyframes wv-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.5); }
    50% { box-shadow: 0 0 0 4px rgba(220, 38, 38, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .wv-icon-badge.wv-badge-critical { animation: none; }
}

.wv-dropdown-item.wv-item-critical {
    background: #fef2f2;
    border-left: 3px solid var(--wv-danger);
}

.wv-dropdown-footer {
    display: block;
    padding: 0.5rem 0.9rem;
    border-top: 1px solid #e2e8f0;
    font-size: 0.82rem;
    text-align: center;
    color: var(--wv-primary);
    text-decoration: none;
}

.wv-dropdown-footer:hover {
    background: #f8fafc;
}

/* Unread count on a sidebar link. Pushed to the right edge so it lines up
   down the column rather than trailing each label at a different offset. */
.wv-nav-badge {
    margin-left: auto;
    min-width: 1.25rem;
    padding: 0 0.35rem;
    border-radius: 0.65rem;
    background: var(--wv-danger);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.25rem;
    text-align: center;
    flex-shrink: 0;
}

/* Collapsed to the icon rail there is no room for a number, so it becomes a
   dot -- still says "something here", without overlapping the icon. */
.wv-nav-collapsed .wv-nav-badge {
    position: absolute;
    top: 0.35rem;
    right: 0.5rem;
    min-width: 0.5rem;
    width: 0.5rem;
    height: 0.5rem;
    padding: 0;
    line-height: 0;
    font-size: 0;
    border-radius: 50%;
}

/* The company mark. Sized to match the glyph it replaced so the sidebar
   header keeps its rhythm, and object-fit:contain so a logo with a different
   aspect ratio is letterboxed rather than squashed. */
.wv-brand-logo{width:28px;height:28px;object-fit:contain;flex-shrink:0}
.wv-login-logo{width:72px;height:72px;object-fit:contain}

/* Scrollable modals whose header/body/footer are wrapped in a <form>.

   Bootstrap's .modal-dialog-scrollable assumes .modal-body is a direct flex
   child of .modal-content: it bounds the content and lets the body scroll.
   Most of our modals put a <form> in between, which is a plain block, so the
   chain breaks -- the body grows to fit its content and no scrollbar ever
   appears, leaving the bottom of a long form unreachable.

   Making the form the flex column restores it. Scoped to scrollable modals so
   ordinary ones are untouched. */
.modal-dialog-scrollable .modal-content > form {
    display: flex;
    flex-direction: column;
    max-height: 100%;
    overflow: hidden;
}
.modal-dialog-scrollable .modal-content > form > .modal-body {
    overflow-y: auto;
}
/* The header and footer stay put; only the middle moves. */
.modal-dialog-scrollable .modal-content > form > .modal-header,
.modal-dialog-scrollable .modal-content > form > .modal-footer {
    flex-shrink: 0;
}

/* --- Calendar ------------------------------------------------------------
   The grid is a fixed size in every view. A busy fortnight must not stretch
   the page downwards: the cells stay put and carry marks, and the names,
   times and service users go in the detail pane beside the grid. */

.wv-cal-grid-head {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 4px;
}
.wv-cal-grid-head > div {
    text-align: center;
    font-size: 0.72rem;
    font-weight: 600;
    color: #94A3B8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Six rows of equal height, so every month is the same height as every
   other -- including the ones that span six weeks. */
.wv-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(6, 1fr);
    gap: 4px;
    height: 420px;
}

.wv-cal-cell {
    position: relative;
    border: 1px solid #E9ECF1;
    border-radius: 8px;
    padding: 4px 5px;
    cursor: pointer;
    overflow: hidden;
    background: #fff;
    transition: border-color 0.12s, background 0.12s;
}
.wv-cal-cell:hover { border-color: #0F766E; background: #F8FDFC; }
.wv-cal-cell.is-outside { background: #FAFBFC; }
.wv-cal-cell.is-outside .wv-cal-num { color: #CBD5E1; }
.wv-cal-cell.is-today .wv-cal-num {
    background: #0F766E;
    color: #fff;
    border-radius: 50%;
    width: 20px; height: 20px;
    display: inline-flex; align-items: center; justify-content: center;
}
.wv-cal-cell.is-selected {
    border-color: #0F766E;
    box-shadow: inset 0 0 0 1px #0F766E;
    background: #F0FDFA;
}

.wv-cal-num { font-size: 0.78rem; font-weight: 600; color: #475569; line-height: 20px; }
.wv-cal-marks { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; }
.wv-cal-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.wv-cal-count {
    position: absolute; right: 5px; bottom: 3px;
    font-size: 0.62rem; color: #94A3B8; font-weight: 600;
}

/* Week: seven columns, each scrolling inside the same fixed height. */
.wv-cal-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    height: 420px;
}
.wv-cal-col {
    display: flex;
    flex-direction: column;
    border: 1px solid #E9ECF1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: #fff;
}
.wv-cal-col.is-today .wv-cal-col-head { background: #0F766E; color: #fff; }
.wv-cal-col.is-today .wv-cal-col-head .text-muted { color: #D9F2EE !important; }
.wv-cal-col.is-selected { border-color: #0F766E; box-shadow: inset 0 0 0 1px #0F766E; }
.wv-cal-col-head {
    text-align: center;
    padding: 4px 2px;
    border-bottom: 1px solid #E9ECF1;
    background: #F8FAFC;
    line-height: 1.2;
}
.wv-cal-col-body { flex: 1; overflow-y: auto; padding: 4px 3px; }

/* Day: one wide panel, same height as the other two views. */
.wv-cal-day-view {
    height: 420px;
    overflow-y: auto;
    border: 1px solid #E9ECF1;
    border-radius: 8px;
    background: #fff;
}

.wv-cal-chip {
    font-size: 0.66rem;
    line-height: 1.3;
    border-radius: 4px;
    padding: 3px 5px;
    margin-bottom: 3px;
}

/* Detail pane: matches the grid's height and scrolls on its own, so the
   page as a whole keeps a constant height whatever is on the rota. */
.wv-cal-detail {
    border: 1px solid #E9ECF1;
    border-radius: 8px;
    padding: 12px;
    background: #FCFCFD;
    height: 452px;
    display: flex;
    flex-direction: column;
}
.wv-cal-detail-body { overflow-y: auto; flex: 1; }

.wv-cal-swatch {
    display: inline-block; width: 10px; height: 10px;
    border-radius: 2px; margin-right: 4px; vertical-align: middle;
}

/* On a phone the two panes stack, so the fixed heights come off and the
   detail pane is allowed to be as long as it needs. */
@media (max-width: 991.98px) {
    .wv-cal-grid, .wv-cal-week, .wv-cal-day-view { height: 320px; }
    .wv-cal-detail { height: auto; max-height: 420px; }
}

/* --- Compliance dashboard -------------------------------------------------
   Built around scanning rather than reading. A manager opening this wants to
   know in about two seconds whether anything needs them today, and the old
   layout answered that with a donut and a wall of ten identical tick
   columns. */

.wv-kpi-strip {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
    gap: 12px;
}
@media (max-width: 991.98px) {
    .wv-kpi-strip { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 575.98px) {
    .wv-kpi-strip { grid-template-columns: 1fr; }
}

.wv-kpi {
    background: #fff;
    border: 1px solid #E9ECF1;
    border-radius: 12px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.wv-kpi-hero {
    background: linear-gradient(135deg, #0F766E 0%, #0D5F59 100%);
    border-color: #0D5F59;
    color: #fff;
}
.wv-kpi-hero .wv-kpi-label,
.wv-kpi-hero .wv-kpi-sub { color: rgba(255, 255, 255, 0.78); }
.wv-kpi-hero .wv-kpi-value,
.wv-kpi-hero .wv-kpi-unit { color: #fff; }

.wv-kpi-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94A3B8;
    margin-bottom: 4px;
}
.wv-kpi-value { font-size: 2rem; font-weight: 700; line-height: 1.1; color: #0F172A; }
.wv-kpi-unit { font-size: 1rem; font-weight: 600; opacity: 0.75; }
.wv-kpi-sub { font-size: 0.72rem; color: #94A3B8; margin-top: 4px; }

.wv-kpi-bar {
    height: 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.25);
    margin-top: 10px;
    overflow: hidden;
}
.wv-kpi-bar-fill {
    height: 100%;
    background: #fff;
    border-radius: 3px;
    transition: width 0.4s ease;
}

/* Ten checks as cards rather than ten table columns. A column per check
   made the table wider than the screen and told you nothing until you
   hovered each tick for its tooltip. */
/* --- Compliance donut ------------------------------------------------- */

/* The canvas and the figure are stacked rather than side by side: the number
   in the hole is the thing people read, and putting it beside the ring makes
   them look twice. */
.wv-donut-wrap {
    position: relative;
    height: 150px;
    margin: 0.25rem 0 0.5rem;
}

.wv-donut-centre {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    pointer-events: none;
}

.wv-donut-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    color: #fff;
}

.wv-donut-unit {
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    align-self: flex-start;
    margin-top: 0.25rem;
}

.wv-donut-wrap.is-empty::after {
    content: 'No staff to report on';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}
.wv-donut-wrap.is-empty .wv-donut-centre { display: none; }

/* --- By check, as horizontal bars -------------------------------------- */

/* Horizontal because the labels are things like "Professional registration".
   Vertical bars would rotate or truncate those, and a chart you have to tilt
   your head to read is one nobody reads. */
.wv-check-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wv-check-row {
    display: grid;
    /* Fixed name column so every bar starts at the same x -- ragged starts
       make lengths impossible to compare at a glance, which is the only
       reason to draw bars at all. */
    grid-template-columns: 190px 1fr 104px;
    align-items: center;
    gap: 12px;
}

.wv-check-row-name {
    font-size: 0.82rem;
    font-weight: 500;
    color: #1F2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wv-check-row-track {
    height: 16px;
    background: #EEF1F5;
    border-radius: 8px;
    overflow: hidden;
}

.wv-check-row-fill {
    height: 100%;
    border-radius: 8px;
    transition: width 0.35s ease;
}

.wv-check-row-value {
    font-size: 0.8rem;
    text-align: right;
    line-height: 1.2;
}

.wv-check-row-note {
    display: block;
    font-size: 0.68rem;
    color: #6B7280;
}

@media (max-width: 640px) {
    /* Stack rather than squeeze: a 190px label column on a phone leaves the
       bar too short to read as a length. */
    .wv-check-row {
        grid-template-columns: 1fr 76px;
        grid-template-areas: 'name value' 'track value';
        row-gap: 4px;
    }
    .wv-check-row-name { grid-area: name; white-space: normal; }
    .wv-check-row-track { grid-area: track; }
    .wv-check-row-value { grid-area: value; }
}

.wv-check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
    gap: 10px;
}
.wv-check-card {
    border: 1px solid #E9ECF1;
    border-radius: 10px;
    padding: 10px 12px;
    background: #fff;
}
.wv-check-card.is-clear { border-left: 3px solid #16A34A; }
.wv-check-card.is-warn { border-left: 3px solid #F59E0B; }
.wv-check-card.is-bad { border-left: 3px solid #DC2626; }
.wv-check-name { font-size: 0.8rem; font-weight: 600; color: #334155; }
.wv-check-count { font-size: 1.15rem; font-weight: 700; color: #0F172A; line-height: 1.2; }
.wv-check-track {
    height: 4px;
    border-radius: 2px;
    background: #EEF1F5;
    margin-top: 7px;
    overflow: hidden;
}
.wv-check-fill { height: 100%; border-radius: 2px; }

/* Staff rows: identity on the left, what is wrong on the right, nothing in
   between. Only failing checks are named -- listing the passing ones is
   noise, and there are now ten of them. */
.wv-staff-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border: 1px solid #E9ECF1;
    border-radius: 10px;
    margin-bottom: 8px;
    background: #fff;
    transition: border-color 0.12s, box-shadow 0.12s;
}
.wv-staff-row:hover { border-color: #0F766E; box-shadow: 0 1px 4px rgba(15, 118, 110, 0.1); }
.wv-staff-row.is-bad { border-left: 3px solid #DC2626; }
.wv-staff-row.is-warn { border-left: 3px solid #F59E0B; }
.wv-staff-row.is-clear { border-left: 3px solid #16A34A; }

.wv-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: #E6F4F2;
    color: #0F766E;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.78rem; font-weight: 700;
    flex-shrink: 0;
}
.wv-staff-name { font-size: 0.9rem; font-weight: 600; color: #0F172A; text-decoration: none; }
.wv-staff-name:hover { color: #0F766E; text-decoration: underline; }
.wv-staff-meta { font-size: 0.72rem; color: #94A3B8; }

.wv-score {
    font-size: 0.78rem; font-weight: 700;
    padding: 3px 9px; border-radius: 20px;
    white-space: nowrap;
}
.wv-score.is-clear { background: #DCFCE7; color: #166534; }
.wv-score.is-warn { background: #FEF3C7; color: #92400E; }
.wv-score.is-bad { background: #FEE2E2; color: #991B1B; }

.wv-fail-chip {
    display: inline-block;
    font-size: 0.68rem;
    padding: 2px 7px;
    border-radius: 5px;
    background: #FEE2E2;
    color: #991B1B;
    margin: 1px 2px 1px 0;
}
.wv-fail-chip.is-warn { background: #FEF3C7; color: #92400E; }

/* --- Dashboard: sections ----------------------------------------------- */

/* Eyebrow, title, supporting line. The eye lands on what this section is
   before it lands on the numbers, which is the difference between a report
   and a wall of figures. */
.wv-section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 2px solid #E3E8EF;
}

.wv-section-head-plain {
    border-bottom-width: 1px;
    margin-top: 8px;
}

.wv-eyebrow {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--wv-primary);
    margin-bottom: 4px;
}

.wv-section-title {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
    color: #0B1220;
}

.wv-section-sub {
    font-size: 0.84rem;
    color: #4B5565;
    margin: 4px 0 0;
    max-width: 62ch;
}

.wv-updated {
    font-size: 0.72rem;
    color: #697586;
    white-space: nowrap;
}

.wv-loading {
    font-size: 0.85rem;
    color: #697586;
    padding: 8px 0;
}

/* --- Dashboard: the callout -------------------------------------------- */

/* NHS-style: a heavy left bar and a filled heading. This is the component
   that has to survive being scanned past, so it does not share the visual
   language of the tiles underneath it. */
.wv-callout {
    border-left: 8px solid var(--wv-danger);
    background: #fff;
    border-radius: 4px;
    margin-bottom: 18px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(11, 18, 32, 0.06);
}

.wv-callout-head {
    background: var(--wv-danger);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 8px 16px;
    letter-spacing: 0.01em;
}

.wv-callout-body {
    padding: 12px 16px 14px;
    font-size: 0.88rem;
    color: #1F2937;
}

.wv-callout-list {
    margin: 8px 0 0;
    padding-left: 18px;
}

.wv-callout-list li { margin-bottom: 3px; }

/* Nothing late is worth saying plainly, rather than showing an empty space
   somebody has to interpret. */
.wv-callout.is-clear { border-left-color: #047857; }
.wv-callout.is-clear .wv-callout-head { background: #047857; }

/* --- Dashboard: duty tiles --------------------------------------------- */

.wv-duty-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 12px;
}

.wv-duty {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 118px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #E3E8EF;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wv-duty:hover {
    color: inherit;
    border-color: #CDD5DF;
    box-shadow: 0 4px 14px rgba(11, 18, 32, 0.09);
}

.wv-duty:focus-visible {
    outline: 3px solid #FFB703;
    outline-offset: 2px;
}

.wv-duty-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.wv-duty-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
    color: #0B1220;
}

/* A word, not just a colour. Legible to somebody who cannot tell red from
   amber, and to anybody reading this printed in black and white. */
.wv-duty-tag {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 3px 7px;
    border-radius: 3px;
    white-space: nowrap;
}

.wv-duty-label {
    font-size: 0.86rem;
    font-weight: 600;
    color: #1F2937;
    margin-top: 10px;
    line-height: 1.3;
}

.wv-duty-note {
    font-size: 0.73rem;
    color: #697586;
    margin-top: 3px;
    line-height: 1.35;
}

.wv-duty-foot {
    margin-top: auto;
    padding-top: 10px;
    font-size: 0.73rem;
    font-weight: 600;
    color: var(--wv-primary);
}

/* Three states. A clock that has run out, work outstanding, and nothing to
   do are different situations -- rendering them alike is how the late one
   gets read as routine. */
.wv-duty.is-bad {
    border-color: #FBD5D5;
    background: linear-gradient(180deg, #FEF6F6 0%, #fff 42%);
}
.wv-duty.is-bad .wv-duty-value { color: var(--wv-danger); }
.wv-duty.is-bad .wv-duty-tag { background: #FEE2E2; color: #991B1B; }

.wv-duty.is-warn {
    border-color: #FDE8C8;
    background: linear-gradient(180deg, #FFFAF1 0%, #fff 42%);
}
.wv-duty.is-warn .wv-duty-value { color: #B45309; }
.wv-duty.is-warn .wv-duty-tag { background: #FEF3C7; color: #92400E; }

.wv-duty.is-clear .wv-duty-value { color: #9AA4B2; }
.wv-duty.is-clear .wv-duty-tag { background: #ECFDF5; color: #047857; }
.wv-duty.is-clear .wv-duty-label { color: #4B5565; }

@media (max-width: 480px) {
    .wv-duty-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .wv-duty { min-height: 104px; padding: 12px; }
    .wv-duty-value { font-size: 1.6rem; }
}

/* --- Dashboard: masthead ------------------------------------------------ */

.wv-masthead {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
    padding-bottom: 14px;
    margin-bottom: 20px;
    border-bottom: 4px solid var(--wv-primary);
}

.wv-masthead-title {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin: 0;
    color: #0B1220;
}

.wv-masthead-sub {
    font-size: 0.85rem;
    color: #4B5565;
    margin: 4px 0 0;
}

.wv-masthead-date {
    font-size: 0.8rem;
    font-weight: 600;
    color: #4B5565;
    white-space: nowrap;
}

/* --- Dashboard: panels -------------------------------------------------- */

/* One rule for every panel head, so the heading and its link are never the
   same weight and no two panels drift apart. */
.wv-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 1px solid #EEF2F6;
}

.wv-panel-title {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 0;
    color: #0B1220;
}

.wv-panel-link {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--wv-primary);
    text-decoration: none;
    white-space: nowrap;
}

.wv-panel-link:hover { text-decoration: underline; }

.wv-panel {
    border-color: #E3E8EF;
    box-shadow: 0 1px 2px rgba(11, 18, 32, 0.05);
}

/* --- Dashboard: figures ------------------------------------------------- */

.wv-stat-card {
    border-color: #E3E8EF;
    box-shadow: 0 1px 2px rgba(11, 18, 32, 0.05);
    padding: 16px 18px;
}

.wv-stat-card .wv-stat-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #697586;
    margin-bottom: 6px;
}

/* Tabular figures so a column of numbers lines up down the page instead of
   wandering with the digit widths. */
.wv-stat-card .wv-stat-value {
    font-size: 2rem;
    line-height: 1;
    letter-spacing: -0.02em;
    color: #0B1220;
    font-variant-numeric: tabular-nums;
}

/* --- Bar rows inside a narrow panel ------------------------------------- */

.wv-check-row-tight {
    grid-template-columns: 1fr 74px;
    grid-template-areas: 'name value' 'track value';
    row-gap: 4px;
}

.wv-check-row-tight .wv-check-row-name { grid-area: name; white-space: normal; }
.wv-check-row-tight .wv-check-row-track { grid-area: track; }
.wv-check-row-tight .wv-check-row-value { grid-area: value; }

/* Nothing to do is worth one plain sentence. An empty panel reads as a
   widget that failed to load. */
.wv-note-clear {
    font-size: 0.82rem;
    color: #047857;
    padding: 6px 0;
}

/* The tail of a truncated bar list. Says what was left out and why it was
   safe to leave out, rather than just stopping. */
.wv-check-more {
    display: block;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--wv-primary);
    text-decoration: none;
    padding-top: 4px;
}

.wv-check-more:hover { text-decoration: underline; }

/* --- Page access grid ---------------------------------------------------- */

.wv-perm-group { margin-bottom: 18px; }

.wv-perm-group-head {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #697586;
    padding-bottom: 6px;
    margin-bottom: 4px;
    border-bottom: 1px solid #EEF2F6;
}

.wv-perm-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 10px;
    border-radius: 7px;
    cursor: pointer;
    margin: 0;
}

.wv-perm-row:hover { background: #F6F8FA; }

/* A granted page reads as granted at a glance, without having to find the
   tick. The tint is the summary; the checkbox is the control. */
.wv-perm-row.is-on { background: #F2FBF9; }
.wv-perm-row.is-on:hover { background: #E8F7F4; }

.wv-perm-row input {
    width: 17px;
    height: 17px;
    accent-color: var(--wv-primary);
    flex: none;
    cursor: pointer;
}

.wv-perm-row input:disabled { cursor: not-allowed; opacity: 0.55; }

.wv-perm-label { flex: 1; min-width: 0; }

.wv-perm-name {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: #1F2937;
}

.wv-perm-note {
    display: block;
    font-size: 0.74rem;
    color: #697586;
    line-height: 1.35;
    margin-top: 1px;
}

/* Chosen and inherited look identical as a tick, and they are not the same:
   only the second changes when the capability flags are retuned. */
.wv-perm-tag {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 3px 7px;
    border-radius: 3px;
    white-space: nowrap;
    flex: none;
}

.wv-perm-tag.chosen    { background: #E5F3F1; color: #0F766E; }
.wv-perm-tag.inherited { background: #F1F3F7; color: #697586; }
.wv-perm-tag.identity  { background: #FEF3C7; color: #92400E; }

/* --- Ofsted quality standards board ----------------------------------- */
/* Nine cards, and the colour is the message: grey means nothing was asked of
   them, which must not look like the red that means they failed. */

.wv-standard-card {
    border-width: 1px;
    border-left-width: 4px;
    background: #fff;
    transition: box-shadow .18s ease, transform .12s ease;
    cursor: pointer;
}
.wv-standard-card:hover {
    box-shadow: 0 6px 20px rgba(15, 23, 42, .08);
    transform: translateY(-1px);
}
.wv-standard-card:focus-visible {
    outline: 3px solid var(--wv-primary, #0F766E);
    outline-offset: 2px;
}
.wv-standard-icon {
    display: grid; place-items: center;
    width: 40px; height: 40px; flex: none;
    border-radius: 10px; font-size: 1.15rem;
    background: rgba(15, 118, 110, .08);
}
@media (prefers-reduced-motion: reduce) {
    .wv-standard-card:hover { transform: none; }
}

/* Nine pips, one per standard, on a child's card. The shape of a day at a
   glance: a run of green with one red says which standard to open, without
   opening any of them. */
.wv-std-strip { display: flex; gap: 3px; }
.wv-std-pip {
    flex: 1 1 0;
    height: 5px;
    border-radius: 99px;
    min-width: 6px;
}
