/* =============================================================
   TimeBook styles
   Mobile-first: the base rules are for phones; @media blocks
   further down add layout for tablets, laptops and big screens.
   ============================================================= */

/* ---------- 1. Design tokens (colours and sizes in one place) ---------- */
:root {
    --bg: #F4F6F8;
    --surface: #FFFFFF;
    --border: #E3E8EE;
    --border-strong: #D0D5DD;
    --text: #101828;
    --text-2: #344054;
    --muted: #475467;
    --primary: #1D5BD8;
    --primary-dark: #1546A8;
    --primary-soft: #EEF4FF;
    --sidebar: #0B1B32;
    --sidebar-text: #C5D0DE;
    --sidebar-hover: #13284A;
    --group: #8EA0B8;
    --danger: #B42318;
    --danger-soft: #FEF3F2;
    --danger-border: #FECDCA;
    --success: #067647;
    --success-soft: #ECFDF3;
    --success-border: #ABEFC6;
    --warning: #93370D;
    --warning-soft: #FFFAEB;
    --radius: 8px;
    --control-h: 40px;
    --sidebar-w: 248px;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
}

a {
    color: var(--primary);
}

    a:hover {
        color: var(--primary-dark);
    }

img, svg {
    max-width: 100%;
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ---------- 3. App shell ---------- */
.app {
    min-height: 100vh;
}

.main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
}

/* Sidebar: slides in from the left on phones and tablets */
.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 50;
    width: min(var(--sidebar-w), 85vw);
    padding: 20px 14px;
    overflow-y: auto;
    background: var(--sidebar);
    transform: translateX(-100%);
    transition: transform .2s ease;
}

.nav-open .sidebar {
    transform: translateX(0);
}

.nav-overlay {
    display: none;
}

.nav-open .nav-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(16, 24, 40, .45);
}

body.nav-open {
    overflow: hidden;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px 12px;
    color: #fff;
    text-decoration: none;
}

.brand-logo {
    width: 34px;
    height: 34px;
    flex: none;
    border-radius: 8px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-name {
    font-weight: 700;
    font-size: 15px;
}

.brand-sub {
    font-size: 12px;
    color: var(--group);
}

.nav-group {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--group);
    padding: 18px 12px 6px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 6px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-weight: 500;
}

    .nav-link:hover {
        background: var(--sidebar-hover);
        color: #fff;
    }

    .nav-link.active {
        background: var(--primary);
        color: #fff;
    }

    .nav-link svg {
        width: 18px;
        height: 18px;
        flex: none;
    }

/* Top bar */
.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: 56px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text-2);
    cursor: pointer;
}

.breadcrumb {
    font-size: 15px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

    .breadcrumb strong {
        color: var(--text);
    }

.crumb-section {
    display: none;
}

/* Profile menu */
.profile {
    position: relative;
    flex: none;
}

    .profile summary {
        list-style: none;
        display: flex;
        align-items: center;
        gap: 10px;
        cursor: pointer;
        border: 1px solid var(--border);
        border-radius: 999px;
        padding: 4px;
    }

        .profile summary::-webkit-details-marker {
            display: none;
        }

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #DCE7FD;
    color: #1D4ED8;
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-text {
    display: none;
    line-height: 1.25;
}

.profile-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
}

.profile-role {
    display: block;
    font-size: 12px;
    color: var(--muted);
}

.profile-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 35;
    width: min(240px, 90vw);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 12px 32px rgba(16, 24, 40, .14);
    overflow: hidden;
}

    .profile-menu a, .profile-menu button {
        display: block;
        width: 100%;
        padding: 11px 14px;
        text-align: left;
        font: inherit;
        color: var(--text-2);
        text-decoration: none;
        background: none;
        border: none;
        cursor: pointer;
    }

        .profile-menu a:hover, .profile-menu button:hover {
            background: #F2F4F7;
        }

    .profile-menu form {
        margin: 0;
    }

/* ---------- 4. Page content ---------- */
.content {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px 12px 32px;
}

.page-head {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

    .page-head > div:last-child {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

.page-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -.01em;
}

.page-sub {
    margin: 4px 0 0;
    color: var(--muted);
}

.small {
    font-size: 13px;
}

.muted {
    color: var(--muted);
    font-size: 13px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}

.card-title {
    margin: 0 0 6px;
    font-size: 16px;
}

/* ---------- 5. Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: var(--control-h);
    padding: 0 16px;
    border-radius: 6px;
    border: 1px solid var(--primary);
    background: var(--primary);
    color: #fff;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

    .btn:hover {
        background: var(--primary-dark);
        color: #fff;
    }

.btn-secondary {
    background: var(--surface);
    color: var(--text-2);
    border-color: var(--border-strong);
}

    .btn-secondary:hover {
        background: #F9FAFB;
        color: var(--text);
    }

.btn-danger {
    background: var(--surface);
    color: var(--danger);
    border-color: #FDA29B;
}

    .btn-danger:hover {
        background: var(--danger-soft);
        color: var(--danger);
    }

.btn-block {
    width: 100%;
    height: 44px;
    margin-top: 18px;
}

/* ---------- 6. Forms ---------- */
.label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-2);
    margin-top: 12px;
}
/* 16px text stops iPhones zooming in when a field is tapped */
.input {
    width: 100%;
    height: var(--control-h);
    padding: 0 12px;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 16px;
}

    .input:focus {
        outline: 2px solid var(--primary);
        outline-offset: 1px;
    }

textarea.input {
    height: auto;
    padding: 10px 12px;
}

.field-error {
    color: var(--danger);
    font-size: 13px;
}

.form-card {
    width: 100%;
    max-width: 560px;
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

    .form-actions .btn {
        flex: 1 1 auto;
    }

/* Messages */
.alert-error {
    background: var(--danger-soft);
    border: 1px solid var(--danger-border);
    color: var(--danger);
    border-radius: 6px;
    padding: 10px 12px;
    margin: 0 0 16px;
}

    .alert-error ul {
        margin: 0;
        padding-left: 18px;
    }

.alert-success {
    background: var(--success-soft);
    border: 1px solid var(--success-border);
    color: var(--success);
    border-radius: 6px;
    padding: 10px 14px;
    margin: 0 0 16px;
}

.validation-summary-valid {
    display: none;
}

/* Two columns (form + side card): stacked on small screens */
.two-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}

    .two-col .form-card {
        margin-top: 0;
        max-width: none;
    }

.side-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

    .side-card form {
        margin: 0;
    }

    .side-card .btn {
        width: 100%;
    }

.form-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

    .form-col .form-card {
        max-width: none;
        margin-top: 0;
    }

/* People checklist (projects) */
.people-list {
    max-height: 360px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 2px 12px;
    margin-top: 10px;
}

.person {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    padding: 10px 0;
    border-bottom: 1px solid #F2F4F7;
}

    .person:last-child {
        border-bottom: none;
    }

    .person input {
        width: 18px;
        height: 18px;
        accent-color: var(--primary);
        margin: 0;
    }

    .person .muted {
        margin-left: auto;
    }

/* ---------- 7. Filters ---------- */
.toolbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 16px;
    padding: 12px;
}

    .toolbar > * {
        min-width: 0;
    }

.filter {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
}

.filter-buttons {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

    .filter-buttons .btn {
        flex: 1;
    }

/* ---------- 8. Tables ---------- */
.table-card {
    margin-top: 16px;
    padding: 0;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

    .table th {
        text-align: left;
        font-size: 12px;
        font-weight: 600;
        color: var(--muted);
        text-transform: uppercase;
        letter-spacing: .04em;
        padding: 10px 16px;
        background: #F9FAFB;
        border-bottom: 1px solid var(--border);
        white-space: nowrap;
    }

    .table td {
        padding: 12px 16px;
        border-bottom: 1px solid #EEF1F4;
        vertical-align: top;
    }

        .table td.actions {
            text-align: right;
            white-space: nowrap;
        }

.empty {
    text-align: center;
    color: var(--muted);
}

/* On phones, tables marked .table-stack become one card per row */
@media (max-width: 767px) {
    .table-stack thead {
        display: none;
    }

    .table-stack, .table-stack tbody, .table-stack tr, .table-stack td {
        display: block;
        width: 100%;
    }

        .table-stack tr {
            padding: 10px 14px;
            border-bottom: 1px solid var(--border);
        }

        .table-stack td {
            display: flex;
            justify-content: space-between;
            gap: 12px;
            padding: 4px 0;
            border: none;
            text-align: right;
            overflow-wrap: anywhere;
        }

            .table-stack td::before {
                content: attr(data-label);
                flex: none;
                max-width: 45%;
                text-align: left;
                font-size: 12px;
                font-weight: 600;
                color: var(--muted);
            }

            .table-stack td.actions {
                justify-content: flex-end;
                padding-top: 8px;
            }

                .table-stack td.actions::before, .table-stack td.empty::before {
                    content: none;
                }

            .table-stack td.empty {
                justify-content: center;
            }
}

/* Tags and codes */
.tag {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
    padding: 2px 8px;
    margin: 0 4px 2px 0;
    white-space: nowrap;
}

.tag-green {
    background: var(--success-soft);
    color: var(--success);
}

.tag-grey {
    background: #F2F4F7;
    color: var(--muted);
}

.tag-amber {
    background: var(--warning-soft);
    color: var(--warning);
}

.code-tag {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    color: #1D4ED8;
    background: var(--primary-soft);
    border-radius: 4px;
    padding: 2px 8px;
}

/* Paging */
.pager {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px 18px;
    margin-top: 16px;
    color: var(--muted);
}

    .pager a {
        font-weight: 600;
        text-decoration: none;
        padding: 8px 4px;
    }

/* ---------- 9. Login page ---------- */
.auth {
    background: var(--surface);
}

.auth-wrap {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.auth-brand {
    background: var(--sidebar);
    color: #fff;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

    .auth-brand h1 {
        margin: 0;
        font-size: 24px;
        line-height: 1.25;
        max-width: 440px;
    }

    .auth-brand p {
        margin: 8px 0 0;
        color: var(--sidebar-text);
        font-size: 15px;
        max-width: 440px;
    }

.auth-form {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 32px 20px;
}

.auth-card {
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

    .auth-card h2 {
        margin: 0;
        font-size: 24px;
    }

/* =============================================================
   Bigger screens
   ============================================================= */

/* Small tablets and large phones in landscape */
@media (min-width: 600px) {
    .content {
        padding: 20px 20px 36px;
    }

    .page-head {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-end;
    }

    .toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-buttons {
        grid-column: 1 / -1;
    }

        .filter-buttons .btn {
            flex: 0 0 auto;
        }

    .form-actions .btn {
        flex: 0 0 auto;
    }

    .card {
        padding: 20px;
    }
}

/* Tablets */
@media (min-width: 768px) {
    .crumb-section {
        display: inline;
    }

    .profile summary {
        padding: 4px 12px 4px 4px;
    }

    .profile-text {
        display: block;
    }

    .input {
        font-size: 14px;
    }

    .table {
        min-width: 640px;
    }
}

/* Laptops and desktops: fixed sidebar, compact one-row filters */
@media (min-width: 1024px) {
    .app {
        display: flex;
    }

    .sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
        flex: none;
        width: var(--sidebar-w);
        transform: none;
        transition: none;
    }

    .nav-overlay, .nav-open .nav-overlay {
        display: none;
    }

    body.nav-open {
        overflow: auto;
    }

    .menu-toggle {
        display: none;
    }

    .main {
        flex: 1;
    }

    .topbar {
        height: 64px;
        padding: 0 28px;
    }

    .breadcrumb {
        font-size: 13px;
    }

    .content {
        padding: 28px 32px 40px;
    }

    .page-title {
        font-size: 24px;
    }

    .toolbar {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-end;
        padding: 12px 14px;
    }

    .filter {
        flex: 0 1 180px;
    }

    .toolbar > .input {
        flex: 0 1 220px;
    }

    .toolbar .input {
        height: 36px;
        font-size: 13px;
        padding: 0 10px;
    }

    .toolbar .btn {
        height: 36px;
        padding: 0 14px;
        font-size: 13px;
    }

    .filter-buttons {
        grid-column: auto;
    }

    .two-col {
        flex-direction: row;
        align-items: flex-start;
    }

        .two-col > .form-card, .two-col > .form-col {
            flex: 2 1 460px;
        }

        .two-col > .side-card {
            flex: 1 1 260px;
        }

    .auth-wrap {
        flex-direction: row;
    }

    .auth-brand {
        flex: 1;
        padding: 56px;
        justify-content: space-between;
    }

        .auth-brand h1 {
            font-size: 34px;
        }

    .auth-form {
        align-items: center;
        padding: 48px 24px;
    }
}

/* Large monitors: keep lines readable */
@media (min-width: 1600px) {
    .content {
        max-width: 1440px;
    }
}

/* Touch screens: bigger tap targets */
@media (pointer: coarse) {
    .btn, .input, .menu-toggle {
        min-height: 44px;
    }

    .nav-link {
        padding-top: 12px;
        padding-bottom: 12px;
    }
}

/* People who turn off animations in their device settings */
@media (prefers-reduced-motion: reduce) {
    .sidebar {
        transition: none;
    }
}

/* Printing: content only */
@media print {
    .sidebar, .topbar, .nav-overlay, .toolbar, .pager, .btn {
        display: none !important;
    }

    .content {
        max-width: none;
        padding: 0;
    }

    .card {
        border: none;
    }
}

/* ---------- Today screen ---------- */
.entry-card {
    margin-top: 16px;
}

.entry-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0 12px;
}

.time-inputs {
    display: flex;
    gap: 8px;
}

    .time-inputs .input {
        min-width: 84px;
    }

.entry-submit {
    display: flex;
    align-items: flex-end;
    margin-top: 14px;
}

    .entry-submit .btn {
        width: 100%;
    }

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

    .stats .card {
        padding: 14px 16px;
    }

.stat-label {
    font-size: 13px;
    color: var(--muted);
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    margin-top: 2px;
}

.link-btn {
    background: none;
    border: none;
    padding: 6px 8px;
    font: inherit;
    font-weight: 500;
    color: var(--primary);
    cursor: pointer;
}

.link-danger {
    color: var(--danger);
}

tr.editing td {
    background: var(--primary-soft);
}

tr.editing .input {
    height: 36px;
}

tr.editing .actions .btn {
    height: 36px;
    padding: 0 12px;
}

/* While htmx is waiting for the server, fade the element a little */
.htmx-request {
    opacity: .6;
    transition: opacity .2s;
}

@media (min-width: 768px) {
    .entry-form {
        grid-template-columns: 1fr 1fr;
    }

        .entry-form .span-2 {
            grid-column: 1 / -1;
        }
}

@media (min-width: 1200px) {
    .entry-form {
        grid-template-columns: 1.1fr 1fr 1.6fr auto auto;
    }

        .entry-form .span-2 {
            grid-column: auto;
        }

    .entry-submit .btn {
        width: auto;
    }
}

/* ---------- My Entries ---------- */
[hidden] {
    display: none !important;
}

.period-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
}

    .period-nav .btn {
        height: 36px;
        font-size: 13px;
    }

.day-row td {
    background: #F4F6F8;
    padding: 10px 16px;
    border-top: 1px solid var(--border);
}

.day-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.day-total {
    margin-left: auto;
    font-weight: 700;
}

.project-total {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #F2F4F7;
}

    .project-total:last-child {
        border-bottom: none;
    }

/* Phones: day headers stay full width inside stacked tables */
@media (max-width: 767px) {
    .table-stack tr.day-row {
        padding: 0;
    }

        .table-stack tr.day-row td {
            display: block;
        }

            .table-stack tr.day-row td::before {
                content: none;
            }
}

/* ---------- Unlocks ---------- */
.preview-box {
    margin-top: 12px;
    padding: 12px;
    border: 1px dashed var(--border-strong);
    border-radius: 6px;
    background: #FCFCFD;
}

td.actions form {
    display: inline;
    margin: 0;
}

td.actions .btn {
    height: 34px;
    font-size: 13px;
    padding: 0 12px;
}

/* ---------- Unlock banner ---------- */
.unlock-banner {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: var(--radius);
    background: var(--primary-soft);
    border: 1px solid #C7D7FE;
    color: #1E3A8A;
    line-height: 1.5;
}

    .unlock-banner a {
        font-weight: 600;
        margin-left: 4px;
        white-space: nowrap;
    }

/* ---------- Working days ---------- */
.workdays {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 6px;
}

.check-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.check-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    cursor: pointer;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    font-size: 13px;
    background: var(--surface);
}

    .check-chip input {
        width: 16px;
        height: 16px;
        margin: 0;
        accent-color: var(--primary);
    }

/* ---------- Utilization report ---------- */
.num {
    text-align: right;
    white-space: nowrap;
}

.sub {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: var(--muted);
}

.tag-red {
    background: var(--danger-soft);
    color: var(--danger);
}

.row-over td {
    background: #FFFBFA;
}

.row-under td {
    background: #FFFDF5;
}

.total-row td {
    background: #F9FAFB;
    font-weight: 600;
}

/* ---------- Monthly reports ---------- */
.months-card {
    gap: 4px;
}

.month-link {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text);
    border: 1px solid transparent;
}

    .month-link:hover {
        background: #F9FAFB;
        color: var(--text);
    }

    .month-link.active {
        background: var(--primary-soft);
        border-color: #C7D7FE;
    }

.report-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.report-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

    .report-actions form {
        margin: 0;
    }

    .report-actions .input {
        height: 40px;
        width: auto;
    }

.publish-form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin: 0;
}

    .publish-form .filter {
        flex: 0 1 200px;
    }

/* ---------- Dashboard ---------- */
.segmented {
    display: inline-flex;
    background: #EAEDF1;
    border-radius: 7px;
    padding: 3px;
}

    .segmented a {
        padding: 7px 14px;
        border-radius: 5px;
        font-size: 13px;
        font-weight: 500;
        color: var(--muted);
        text-decoration: none;
    }

        .segmented a.on {
            background: var(--surface);
            color: var(--text);
            box-shadow: 0 1px 2px rgba(16, 24, 40, .12);
        }

.book-panel {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.dash-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 16px;
}

.dash-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 12px;
    color: var(--muted);
    margin: 6px 0 12px;
}

.dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    margin-right: 6px;
    vertical-align: -1px;
}

.dot-ok, .fill-ok {
    background: var(--primary);
}

.dot-over, .fill-over {
    background: var(--danger);
}

.dot-under, .fill-under {
    background: #E8A33D;
}

.bar-row {
    display: grid;
    grid-template-columns: minmax(90px, 140px) 1fr 52px;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
}

.bar-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

a.bar-name:hover {
    color: var(--primary);
}

.bar-track {
    position: relative;
    height: 16px;
    background: #F2F4F7;
    border-radius: 3px;
}

    .bar-track.thin {
        height: 8px;
        border-radius: 4px;
    }

.bar-fill {
    height: 100%;
    border-radius: inherit;
}

.bar-mark {
    position: absolute;
    top: -3px;
    bottom: -3px;
    width: 0;
}

.mark-threshold {
    border-left: 1px dashed #98A2B3;
}

.mark-100 {
    border-left: 1px solid var(--muted);
}

.bar-value {
    font-size: 13px;
    font-weight: 600;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.project-bar {
    margin-top: 12px;
}

.project-bar-label {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
    margin-bottom: 6px;
}

.list-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid #F2F4F7;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
}

    .list-row:last-of-type {
        border-bottom: none;
    }

a.list-row:hover {
    color: var(--primary);
}

.trend {
    width: 100%;
    height: auto;
    margin-top: 8px;
}

.trend-grid {
    stroke: #EEF1F4;
    stroke-width: 1;
}

.trend-threshold {
    stroke: #E8A33D;
    stroke-width: 1.5px;
    stroke-dasharray: 5 4;
}

.trend-line {
    fill: none;
    stroke: var(--primary);
    stroke-width: 2.5px;
    stroke-linejoin: round;
}

.trend-dot {
    fill: #fff;
    stroke: var(--primary);
    stroke-width: 2;
}

.trend-axis {
    font-size: 11px;
    fill: var(--muted);
}

.trend-value {
    font-size: 12px;
    font-weight: 600;
    fill: var(--text);
}

@media (min-width: 1024px) {
    .dash-grid {
        grid-template-columns: 1fr 1fr;
    }
}