﻿@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;0,9..40,800;1,9..40,400&display=swap');

/* ============================================================
   ShadowQS — Stylesheet
   ============================================================ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #f5f5f5;
    --fg: #172b4d;
    --card: #fff;
    --primary: #2f6bff;
    --primary-light: #e9efff;
    --muted: #717171;
    --border: #e5e7eb;
    --radius: 0.75rem;
    --risk: #c0392b;
    --attention: #e67e22;
    --healthy: #27ae60;
    --sidebar-w: 220px;
    --topbar-h: 52px;
    --font: 'DM Sans', system-ui, sans-serif;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--fg);
    display: flex;
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.5;
}

[hidden] {
    display: none !important;
}

body.modal-open {
    overflow: hidden;
}

.draft-response-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.22);
    backdrop-filter: blur(6px);
    z-index: 260;
}

.draft-response-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 261;
}

.draft-response-modal-card {
    width: min(560px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
}

.draft-response-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
}

.draft-response-modal-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--fg);
}

.draft-response-modal-subtitle {
    margin-top: 2px;
    font-size: 11px;
    color: var(--muted);
}

.draft-response-modal-close {
    border: none;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    padding: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.draft-response-modal-fields {
    padding: 10px 18px 0;
}

.draft-response-modal-field {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    column-gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.draft-response-modal-field-label {
    font-size: 11px;
    color: var(--muted);
}

.draft-response-modal-field-value {
    min-width: 0;
    font-size: 12px;
    color: var(--fg);
}

.draft-response-modal-body {
    padding: 16px 18px;
    white-space: pre-wrap;
    font-size: 13px;
    line-height: 1.75;
    color: var(--fg);
}

.draft-response-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px 16px;
    border-top: 1px solid var(--border);
}

.draft-response-modal-note {
    font-size: 11px;
    color: #9aa4b2;
}

@media (max-width: 680px) {
    .draft-response-modal {
        padding: 16px;
        align-items: flex-end;
    }

    .draft-response-modal-card {
        width: 100%;
        max-height: calc(100vh - 32px);
    }

    .draft-response-modal-footer {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ============================================================
   ShadowQS — Stylesheet (continued)
   ============================================================ */

.nav-link.disabled,
.nav-link[aria-disabled="true"] {
    color: #9aa4b2;
    background: transparent;
    cursor: not-allowed;
    opacity: 0.7;
    pointer-events: none;
}

    .nav-link.disabled svg,
    .nav-link[aria-disabled="true"] svg {
        opacity: 0.7;
    }

/* Prevent text overflow in cards/lists */
.card,
.summary-item,
.timeline-item,
.history-item {
    min-width: 0;
}

    /* Force wrap for long tokens */
    .summary-item,
    .meta,
    .fact-value,
    .detail-meta-grid .value,
    .timeline-meta,
    .event-sub,
    .event-title,
    .evidence-item,
    .history-item,
    .card p,
    .card div,
    .card span {
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
    }



/* ── TOPBAR (mobile only, hidden on desktop) ── */
.topbar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-h);
    background: var(--card);
    border-bottom: 1px solid var(--border);
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 200;
}

.topbar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 15px;
    color: var(--fg);
    cursor: pointer;
}

.topbar-logo img {
    display: block;
    height: 32px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.topbar-menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: var(--fg);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── SIDEBAR OVERLAY (mobile) ── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 149;
}

    .sidebar-overlay.visible {
        display: block;
    }


/* ── SIDEBAR ── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 150;
    transition: transform 0.25s ease;
    padding: 4px;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
}

    .sidebar-logo img {
        display: block;
        height: 32px;
        width: auto;
        max-width: 100%;
        object-fit: contain;
    }


.logo-icon {
    width: 28px;
    height: 28px;
    background: var(--primary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 13px;
    flex-shrink: 0;
}

.login-logo img {
    display: block;
    height: 32px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.sidebar-nav {
    flex: 1;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--muted);
    font-size: 13.5px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    cursor: pointer;
}

    .nav-link:hover {
        background: var(--bg);
        color: var(--fg);
    }

    .nav-link.active {
        background: var(--primary-light);
        color: var(--primary);
    }

    .nav-link svg {
        width: 16px;
        height: 16px;
        flex-shrink: 0;
    }

.nav-badge {
    margin-left: auto;
    background: var(--attention);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
}

.nav-alpha {
    margin-left: auto;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
}

.sidebar-footer {
    border-top: 1px solid var(--border);
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
}

.avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--fg);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--fg);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 11px;
    color: var(--muted);
}


/* ── MAIN CONTENT ── */
.main {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-width: 0;
    min-height: 100vh;
}

.main--preview {
    margin-left: 0;
}

.page {
    display: none;
}

    .page.active {
        display: block;
    }

/* Inner content wrapper — centred within the available space */
.page-inner {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    padding: 32px 32px;
}

.main--preview .page-inner {
    padding-top: 24px;
}


/* ── TYPOGRAPHY ── */
h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--fg);
    margin-bottom: 4px;
}

h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--fg);
    margin-bottom: 12px;
}

.subtitle {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 20px;
}


/* ── CARDS ── */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 12px;
}

.card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 10px;
    transition: border-color 0.15s, box-shadow 0.15s;
    cursor: pointer;
}

    .card-link:hover {
        border-color: #c0c8d8;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    }


/* ── STATUS BADGES ── */
.badge {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
    white-space: nowrap;
}

.badge-risk {
    color: var(--risk);
}

.badge-attention {
    color: var(--attention);
}

.badge-healthy {
    color: var(--healthy);
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}

.dot-risk {
    background: var(--risk);
}

.dot-attention {
    background: var(--attention);
}

.dot-healthy {
    background: var(--healthy);
}

.dot-muted {
    background: #ccc;
}

.coverage-dot-good {
    background: var(--healthy);
}

.coverage-dot-partial {
    background: var(--attention);
}

.coverage-dot-neutral {
    background: #94a3b8;
}

.coverage-dot-poor {
    background: var(--risk);
}


/* ── SEARCH ── */
.search-bar {
    width: 100%;
    padding: 9px 14px 9px 36px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    color: var(--fg);
    font-size: 13.5px;
    font-family: var(--font);
    margin-bottom: 20px;
    outline: none;
    transition: border-color 0.15s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%23717171' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 12px center;
}

    .search-bar:focus {
        border-color: var(--primary);
    }


/* ── GROUP HEADER ── */
.group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 20px 0 10px;
    cursor: pointer;
    user-select: none;
}

    .group-header .count {
        font-weight: 500;
        text-transform: none;
        letter-spacing: 0;
    }

    .group-header .chevron {
        transition: transform 0.2s;
        font-size: 10px;
    }

    .group-header.collapsed .chevron {
        transform: rotate(-90deg);
    }


/* ── PROJECT CARD ── */
.project-card-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.project-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--fg);
}

.project-name--with-context {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    line-height: 1.25;
}

.inferred-marker {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: #f8fafc;
    color: var(--muted);
    font-size: 10.5px;
    font-style: normal;
    font-weight: 600;
    line-height: 1.35;
}

.decision-tooltip-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    color: var(--primary);
    outline: none;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 3;
}

.decision-tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 5px;
    background: #eaf0ff;
    transition: background-color 0.15s, box-shadow 0.15s;
}

.decision-tooltip-icon svg {
    width: 12px;
    height: 12px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.decision-tooltip {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    width: 205px;
    max-width: 205px;
    transform: translate(-50%, 4px);
    padding: 8px 10px;
    border-radius: 8px;
    background: #10264a;
    color: #fff;
    box-shadow: 0 10px 24px rgba(10, 24, 48, 0.24);
    font-size: 10.5px;
    font-style: normal;
    font-weight: 500;
    line-height: 1.35;
    white-space: normal;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
}

.project-name--with-context:hover .decision-tooltip-wrap,
.project-name--with-context:focus-within .decision-tooltip-wrap {
    opacity: 1;
}

.decision-tooltip strong {
    display: block;
    margin-bottom: 1px;
    font-weight: 700;
}

.decision-tooltip::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translateX(-50%);
    border: 7px solid transparent;
    border-top-color: #10264a;
}

.decision-tooltip-wrap:hover .decision-tooltip,
.decision-tooltip-wrap:focus .decision-tooltip,
.decision-tooltip-wrap:focus-within .decision-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

.decision-tooltip-wrap:hover .decision-tooltip-icon,
.decision-tooltip-wrap:focus .decision-tooltip-icon {
    background: #dfe7ff;
    box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.08);
}

.project-contractor {
    font-size: 12.5px;
    color: var(--muted);
    margin-bottom: 10px;
}

.project-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 14px;
    font-size: 12.5px;
    color: var(--muted);
}

    .project-meta strong {
        color: var(--fg);
        font-weight: 500;
    }

.project-dates {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--muted);
    margin-top: 8px;
}

.inferred-tag {
    font-size: 10px;
    color: var(--muted);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 5px;
    margin-left: 6px;
    vertical-align: middle;
    white-space: nowrap;
}

.project-overview-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.project-card-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 0;
}

.project-card-main {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

.project-card-heading {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.project-name,
.project-contractor,
.project-card-summary {
    margin: 0;
}

.project-contractor {
    font-size: 12.5px;
    color: var(--muted);
}

.project-card-summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.projects-footnote {
    margin: 24px 0 4px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.project-dates {
    margin-top: 0;
}


/* ── EVENTS ── */
.filter-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.filter-select {
    padding: 7px 28px 7px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    color: var(--fg);
    font-size: 13px;
    font-family: var(--font);
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%23717171' stroke-width='2' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    transition: border-color 0.15s;
}

    .filter-select:focus {
        border-color: var(--primary);
    }

.filter-btn {
    padding: 7px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    color: var(--muted);
    font-size: 13px;
    font-family: var(--font);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: border-color 0.15s;
}

    .filter-btn:hover {
        border-color: #c0c8d8;
    }

.events-count {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 10px;
}

.event-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 18px;
    border-bottom: 1px solid var(--bg);
    text-decoration: none;
    color: inherit;
    transition: background 0.12s;
    cursor: pointer;
}

    .event-row:last-child {
        border-bottom: none;
    }

    .event-row:hover {
        background: #fafafa;
    }

.event-main {
    flex: 1;
    min-width: 0;
}

.event-title {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--fg);
    margin-bottom: 2px;
}

.event-sub {
    font-size: 12px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.event-type {
    font-size: 11px;
    font-weight: 600;
    background: var(--bg);
    color: var(--muted);
    padding: 1px 7px;
    border-radius: 5px;
    white-space: nowrap;
}

.event-amount {
    font-size: 13px;
    font-weight: 500;
    color: var(--fg);
    white-space: nowrap;
}


/* ── RETENTION ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
}

.stat-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 6px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--fg);
}

.stat-sub {
    font-size: 11.5px;
    color: var(--muted);
    margin-top: 3px;
}

.section-header {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 12px;
    margin-top: 4px;
}

.section-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 10px;
}

.ret-legend {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.ret-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--muted);
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-released {
    background: var(--healthy);
}

.legend-due {
    background: var(--attention);
}

.legend-held {
    background: #e5e7eb;
}

.ret-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

    .ret-row:last-child {
        border-bottom: none;
    }

.ret-name {
    min-width: 160px;
    flex: 1;
}

.ret-project {
    font-size: 13.5px;
    font-weight: 500;
}

.ret-contractor {
    font-size: 12px;
    color: var(--muted);
}

.ret-bar-wrap {
    flex: 2;
    min-width: 100px;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
}

.ret-bar-released {
    background: var(--healthy);
}

.ret-bar-due {
    background: var(--attention);
    opacity: 0.6;
}

.ret-bar-held {
    background: #d1d5db;
}

.ret-amount {
    min-width: 44px;
    text-align: right;
    font-size: 13px;
    font-weight: 600;
}

.ret-rate {
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
}

.ret-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0 0;
    font-size: 13px;
    color: var(--muted);
    font-weight: 500;
}

    .ret-total-row strong {
        color: var(--fg);
        font-size: 14px;
    }

.release-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

    .release-item:last-child {
        border-bottom: none;
    }

.release-icon {
    width: 32px;
    height: 32px;
    background: var(--bg);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.release-main {
    flex: 1;
    min-width: 0;
}

.release-title {
    font-size: 13.5px;
    font-weight: 500;
}

.release-sub {
    font-size: 12px;
    color: var(--muted);
    margin-top: 1px;
}

.release-right {
    text-align: right;
    flex-shrink: 0;
}

.release-amount {
    font-size: 13px;
    font-weight: 600;
}

.release-date {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: flex-end;
}

.coming-soon-card {
    background: linear-gradient(135deg, #f8faff, #eef3ff);
    border: 1px dashed #c5d3f0;
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 20px;
    text-align: center;
}

.coming-soon-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.coming-soon-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
}

.coming-soon-desc {
    font-size: 12.5px;
    color: var(--muted);
    margin-bottom: 14px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

form:has(.btn-primary),
form:has(.btn-outline) {
    display: contents;
}

a.btn-primary,
a.btn-outline,
a.btn-sm,
a.btn-save,
a.btn-nudge,
a.btn-reconnect {
    text-decoration: none;
}

.btn-outline,
a.btn-outline,
button.btn-outline {
        padding: 7px 16px;
        border: 1px solid var(--primary);
        border-radius: 7px;
        color: var(--primary);
        background: transparent;
        font-size: 13px;
        font-family: var(--font);
        font-weight: 500;
        cursor: pointer;
        transition: background 0.15s;
    }

    .btn-outline:hover,
    a.btn-outline:hover,
    button.btn-outline:hover {
        background: var(--primary-light);
    }
    /* ── PROJECT DETAIL ── */
    .back-link {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        color: var(--muted);
        font-size: 13px;
        margin-bottom: 16px;
        cursor: pointer;
        text-decoration: none;
        transition: color 0.15s;
    }

        .back-link:hover {
            color: var(--fg);
        }

    .detail-header {
        background: var(--card);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 20px;
        margin-bottom: 16px;
        position: relative;
    }

    .detail-header--mockup {
        padding: 20px 20px 14px;
    }

    .detail-title {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
        font-size: 17px;
        font-weight: 700;
    }

    .detail-subtype {
        font-size: 13px;
        color: var(--fg);
        margin-top: 8px;
    }

    .detail-risk-badge {
        position: absolute;
        top: 20px;
        right: 20px;
        font-size: 13px;
        gap: 6px;
    }

    .detail-meta-grid--mockup {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px 36px;
        margin-top: 12px;
        margin-bottom: 14px;
    }

    .detail-meta-col {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .detail-meta-row {
        font-size: 13px;
        line-height: 1.45;
    }

    .detail-meta-row .label {
        color: var(--muted);
    }

    .detail-meta-row .value {
        color: var(--fg);
        font-weight: 500;
    }

    .coverage-row {
        display: flex;
        align-items: center;
        gap: 6px;
        flex-wrap: wrap;
        font-size: 12.5px;
        color: var(--muted);
        margin-top: 0;
        padding-top: 12px;
        border-top: 1px solid var(--border);
    }

    .contract-row {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 12px;
        flex-wrap: wrap;
    }

    .contract-form-text {
        font-size: 13px;
        color: var(--muted);
    }

.detail-contract-block {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

@media (max-width: 680px) {
    .sidebar {
        transform: translateX(-100%);
        top: 0;
        bottom: 0;
        height: 100vh;
        z-index: 150;
        padding: 4px;
    }

        .sidebar.open {
            transform: translateX(0);
        }

    .sidebar-nav {
        padding-top: calc(var(--topbar-h) + 10px);
    }

    .sidebar-footer {
        padding-bottom: 10px;
    }

    .detail-meta-grid--mockup {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}


    /* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */
    /* ── TABLET (≤900px) ── */
    @media (max-width: 900px) {
        .page-inner {
            padding: 24px 20px;
        }

        .stats-grid {
            grid-template-columns: repeat(2, 1fr);
        }

        .detail-meta-grid {
            grid-template-columns: 1fr;
        }

        .admin-tabs {
            width: 150px;
        }

        .contractor-bar-wrap {
            width: 100px;
        }
    }
    /* ── MOBILE (≤680px) — sidebar becomes drawer ── */
    @media (max-width: 680px) {
        body {
            display: block;
        }
        /* Show topbar, hide desktop sidebar logo */
        .topbar {
            display: flex;
        }

        .sidebar-logo {
            display: none;
        }
        /* Sidebar slides off-canvas by default */
        .sidebar {
            transform: translateX(-100%);
            top: 0;
            z-index: 150;
        }

            .sidebar.open {
                transform: translateX(0);
            }
        /* Main fills full width, offset for topbar */
        .main {
            margin-left: 0;
            min-height: 0;
        }

        .page-inner {
            padding: 16px 16px;
            padding-top: calc(var(--topbar-h) + 16px);
        }

        .main--preview .page-inner {
            padding-top: 16px;
        }

        h1 {
            font-size: 18px;
        }
        /* Stats 2-col on mobile */
        .stats-grid {
            grid-template-columns: repeat(2, 1fr);
            gap: 8px;
        }

        .stat-value {
            font-size: 20px;
        }
        /* Admin stacks vertically */
        /*.admin-layout {
            flex-direction: column;
        }

        .admin-tabs {
            width: 100%;
            display: flex;
            flex-direction: row;
            flex-wrap: wrap;
            gap: 4px;
        }

        .admin-tab {
            flex: 1;
            min-width: 130px;
            justify-content: center;
        }*/
        /* Retention bars stack */
        .ret-row {
            flex-wrap: wrap;
            gap: 8px;
        }

        .ret-name {
            min-width: 100%;
        }

        .ret-bar-wrap {
            flex: 1;
            min-width: 120px;
        }
        /* Events hide amount on small screens */
        .event-amount {
            display: none;
        }
        /* Project cards tighten */
        .card-link {
            padding: 14px 14px;
        }

        .card {
            padding: 14px 14px;
        }
        /* Project detail meta single column */
        .detail-meta-grid {
            grid-template-columns: 1fr;
            gap: 6px;
        }

        .detail-header {
            padding: 14px;
        }
        /* Filter row scrolls */
        .filter-row {
            flex-wrap: nowrap;
            overflow-x: auto;
            padding-bottom: 4px;
            -webkit-overflow-scrolling: touch;
        }

        .filter-select, .filter-btn {
            flex-shrink: 0;
        }
        /* Phases wrap */
        .demo-phases {
            gap: 6px;
        }

        .phase-sep {
            display: none;
        }

        .phase-step {
            font-size: 11.5px;
            padding: 4px 10px;
        }
        /* Invite card */
        .invite-card {
            padding: 16px;
        }

        .invite-card-header {
            flex-direction: column;
            gap: 8px;
        }
        /* Contractor bars */
        .contractor-bar-wrap {
            width: 80px;
        }
        /* Release items */
        .release-item {
            flex-wrap: wrap;
            gap: 8px;
        }
        /* Event card actions */
        .event-card-footer {
            flex-direction: column;
            align-items: flex-start;
        }

        .event-card-actions {
            flex-wrap: wrap;
        }
        /* Nudge row */
        .nudge-row {
            flex-direction: column;
            align-items: flex-start;
        }
        /* Member card actions */
        .member-actions {
            margin-left: 0;
            width: 100%;
            justify-content: flex-end;
        }
    }
    /* ── VERY SMALL (≤400px) ── */
    @media (max-width: 400px) {
        .stats-grid {
            grid-template-columns: 1fr 1fr;
            gap: 6px;
        }

        .stat-value {
            font-size: 18px;
        }

        .stat-card {
            padding: 12px 12px;
        }

        .summary-tabs {
            flex-wrap: wrap;
        }

        .event-card-actions {
            gap: 6px;
        }

        .btn-sm {
            padding: 5px 8px;
            font-size: 11px;
        }

        .page-inner {
            padding: 12px;
            padding-top: calc(var(--topbar-h) + 12px);
        }
    }
    /* ============================================================
   LOGIN PAGE — additional styles
   (used when User.Identity.IsAuthenticated == false)
   ============================================================ */
    /* ── LOGIN PAGE ── */
    .login-wrap {
        width: 100%;
        min-height: 100vh;
        display: flex;
        flex-direction: row;
        align-items: stretch;
    }
    /* Override the app-level body flex layout for the login page */
    body:has(.login-wrap) {
        display: block;
        min-height: 100vh;
    }
    /* ── LEFT PANEL ── */
.login-left {
    flex: 0 0 55%;
    min-width: 0;
    min-height: 100vh;
    background: #172b4d;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px 56px;
}

    .login-logo {
        display: flex;
        align-items: center;
        gap: 10px;
        text-decoration: none;
        margin-bottom: 64px;
    }

    .login-logo-icon {
        width: 32px;
        height: 32px;
        background: var(--primary);
        border-radius: 7px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        font-weight: 800;
        font-size: 14px;
    }

    .login-logo-text {
        font-size: 17px;
        font-weight: 700;
        color: #fff;
        font-family: var(--font);
    }

.login-hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 0;
}

    .login-headline {
        font-size: 36px;
        font-weight: 800;
        color: #fff;
        line-height: 1.2;
        margin-bottom: 16px;
        font-family: var(--font);
    }

    .login-subhead {
        font-size: 15px;
        color: rgba(255,255,255,0.65);
        line-height: 1.65;
        max-width: 380px;
        margin-bottom: 48px;
    }

    .login-features {
        display: flex;
        flex-direction: column;
        gap: 28px;
        margin-bottom: 48px;
    }

    .login-feature {
        display: flex;
        align-items: flex-start;
        gap: 14px;
    }

    .login-feature-icon {
        width: 36px;
        height: 36px;
        border-radius: 9px;
        background: rgba(47, 107, 255, 0.2);
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        margin-top: 2px;
    }

        .login-feature-icon svg {
            width: 17px;
            height: 17px;
            color: #6b9fff;
        }

    .login-feature-title {
        font-size: 14px;
        font-weight: 600;
        color: #fff;
        margin-bottom: 3px;
    }

    .login-feature-desc {
        font-size: 13px;
        color: rgba(255,255,255,0.55);
        line-height: 1.55;
    }

    .login-quote {
        border-left: 3px solid rgba(47,107,255,0.5);
        padding-left: 18px;
        margin-bottom: 32px;
    }

    .login-quote-text {
        font-size: 13.5px;
        color: rgba(255,255,255,0.7);
        line-height: 1.65;
        font-style: italic;
        margin-bottom: 10px;
    }

    .login-quote-author {
        font-size: 12.5px;
        color: rgba(255,255,255,0.45);
        font-weight: 500;
    }

    .login-quote-role {
        font-size: 12px;
        color: rgba(255,255,255,0.35);
        margin-top: 2px;
    }

    .login-badges {
        display: flex;
        align-items: center;
        gap: 20px;
        flex-wrap: wrap;
        padding-top: 24px;
        border-top: 1px solid rgba(255,255,255,0.1);
    }

    .login-badge {
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 12px;
        color: rgba(255,255,255,0.45);
    }

        .login-badge svg {
            width: 14px;
            height: 14px;
            color: rgba(255,255,255,0.35);
        }
    /* ── RIGHT PANEL ── */
    .login-right {
        flex: 1 1 0%;
        min-width: 0;
        background: #f7f8fa;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 48px 24px;
    }

    .login-form-box {
        width: 100%;
        max-width: 360px;
    }

    .login-form-title {
        font-size: 22px;
        font-weight: 700;
        color: var(--fg);
        margin-bottom: 6px;
        font-family: var(--font);
    }

    .login-form-sub {
        font-size: 13.5px;
        color: var(--muted);
        margin-bottom: 28px;
    }

    .login-btn {
        width: 100%;
        padding: 11px 16px;
        border: 1px solid var(--border);
        border-radius: 9px;
        background: #fff;
        color: var(--fg);
        font-size: 14px;
        font-weight: 500;
        font-family: var(--font);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        margin-bottom: 10px;
        transition: border-color 0.15s, box-shadow 0.15s;
        text-decoration: none;
    }

        .login-btn:hover {
            border-color: #c0c8d8;
            box-shadow: 0 2px 8px rgba(0,0,0,0.07);
        }

        .login-btn svg, .login-btn img {
            width: 18px;
            height: 18px;
            flex-shrink: 0;
        }

    .login-btn-disabled {
        opacity: 0.55;
        pointer-events: none;
        cursor: default;
        color: #98a2b3;
        border-color: #eaecf0;
        background: #f8fafc;
    }

        .login-btn-disabled svg {
            opacity: 0.8;
        }

        .login-btn-disabled:hover {
            transform: none;
            box-shadow: none;
        }


    .login-divider {
        display: flex;
        align-items: center;
        gap: 12px;
        margin: 14px 0;
        color: var(--muted);
        font-size: 12.5px;
    }

        .login-divider::before, .login-divider::after {
            content: '';
            flex: 1;
            height: 1px;
            background: var(--border);
        }

    .login-request {
        width: 100%;
        padding: 11px 16px;
        border: 1px solid var(--border);
        border-radius: 9px;
        background: transparent;
        color: var(--muted);
        font-size: 14px;
        font-family: var(--font);
        cursor: pointer;
        text-align: center;
        transition: border-color 0.15s, color 0.15s;
        display: block;
        text-decoration: none;
    }

        .login-request:hover {
            border-color: #c0c8d8;
            color: var(--fg);
        }

    .login-small-print {
        font-size: 12px;
        color: #aaa;
        margin-top: 20px;
        line-height: 1.6;
        text-align: center;
    }

    .field-select,
.field-textarea,
.field-input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    color: var(--fg);
    font-size: 13px;
    font-family: var(--font);
    padding: 9px 12px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.open-events-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 10px 0 8px;
    margin-left:4px;
    flex-wrap: wrap;
}

.risk-bar {
    display: none;
}

.project-card-status {
    flex-shrink: 0;
    margin-top: 1px;
    gap: 6px;
}

.field-select:focus,
.field-textarea:focus,
.field-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.08);
}

.field-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%23717171' stroke-width='2' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 34px;
}

.field-textarea {
    min-height: 88px;
    resize: vertical;
    line-height: 1.5;
}

@media (max-width: 900px) {
    .admin-tabs {
        width: 150px;
    }
}



@media (max-width: 900px) {
    .login-wrap {
        flex-direction: column;
        min-height: auto;
    }

    .login-left,
    .login-right {
        flex: 1 1 auto;
        width: 100%;
        min-height: auto;
    }

    .login-left {
        padding: 28px 24px;
    }

    .login-right {
        padding: 32px 24px;
    }

    .login-logo {
        margin-bottom: 28px;
    }

    .login-hero {
        padding: 0;
    }

    .login-subhead {
        max-width: none;
    }

    .login-form-box {
        max-width: 420px;
    }
}

@media (max-width: 680px) {
    .login-left {
        padding: 20px 16px;
    }

    .login-right {
        padding: 24px 16px 28px;
    }

    .login-headline {
        font-size: 28px;
        line-height: 1.15;
        margin-bottom: 12px;
    }

    .login-subhead {
        font-size: 14px;
        margin-bottom: 28px;
    }

    .login-features {
        gap: 18px;
        margin-bottom: 28px;
    }

    .login-feature {
        gap: 10px;
    }

    .login-feature-icon {
        width: 32px;
        height: 32px;
    }

    .login-feature-title {
        font-size: 13px;
    }

    .login-feature-desc {
        font-size: 12.5px;
    }

    .login-quote {
        margin-bottom: 20px;
        padding-left: 12px;
    }

    .login-quote-text {
        font-size: 12.5px;
    }

    .login-badges {
        gap: 12px;
        padding-top: 16px;
    }

    .login-badge {
        font-size: 11.5px;
    }

    .login-form-box {
        max-width: none;
    }

    .login-form-title {
        font-size: 20px;
    }

    .login-form-sub {
        margin-bottom: 20px;
    }

    .login-btn {
        font-size: 13.5px;
        padding: 10px 14px;
    }

    .login-small-print {
        margin-top: 16px;
    }
}

@media (max-width: 400px) {
    .login-left,
    .login-right {
        padding-left: 12px;
        padding-right: 12px;
    }

    .login-headline {
        font-size: 24px;
    }

    .login-subhead {
        font-size: 13px;
    }
}

.event-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 12px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.event-card-type {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
}

.event-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.event-card-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--fg);
}

    .event-card-title a {
        color: inherit;
        text-decoration: none;
    }

    .event-card-title a:hover {
        text-decoration: underline;
    }

.event-card-desc {
    font-size: 13px;
    line-height: 1.5;
    color: var(--muted);
    margin-bottom: 12px;
}

.event-card-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

.event-card-amount {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--fg);
}

.event-card-date {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
}

.event-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-sm,
a.btn-sm,
button.btn-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: 12px;
    font-family: var(--font);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.btn-sm-primary,
a.btn-sm-primary,
button.btn-sm-primary {
    background: var(--primary-light);
    border-color: #cfd9ff;
    color: var(--primary);
}

    .btn-sm-primary:hover,
    a.btn-sm-primary:hover,
    button.btn-sm-primary:hover {
        background: #dfe8ff;
    }
/* ============================================================
   SETTINGS / ADMIN
   ============================================================ */
.toggle-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.toggle-info h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 3px;
}

.toggle-info p {
    font-size: 13px;
    color: var(--muted);
}

.toggle {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    cursor: pointer;
}

    .toggle input {
        opacity: 0;
        width: 0;
        height: 0;
    }

.toggle-slider {
    position: absolute;
    inset: 0;
    background: #e5e7eb;
    border-radius: 12px;
    transition: background 0.2s;
}

    .toggle-slider::after {
        content: '';
        position: absolute;
        width: 18px;
        height: 18px;
        border-radius: 50%;
        background: #fff;
        top: 3px;
        left: 3px;
        transition: transform 0.2s;
        box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    }

.toggle input:checked ~ .toggle-slider {
    background: var(--healthy);
}

    .toggle input:checked ~ .toggle-slider::after {
        transform: translateX(20px);
    }

.notif-on {
    color: var(--healthy);
    font-size: 12.5px;
    font-weight: 500;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.notif-off {
    color: var(--risk);
    font-size: 12.5px;
    font-weight: 500;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.account-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: nowrap;
    padding: 16px 18px;
}

.account-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--fg);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.account-name {
    font-size: 14px;
    font-weight: 600;
}

.account-email {
    font-size: 12.5px;
    color: var(--muted);
}

.account-detail {
    font-size: 12.5px;
    color: var(--muted);
    margin-top: 4px;
}

    .account-detail strong {
        color: var(--fg);
    }

.settings-note {
    font-size: 12.5px;
    color: var(--muted);
    margin-top: 16px;
    line-height: 1.6;
}

    .settings-note span {
        color: var(--primary);
    }

.admin-layout {
    display: flex;
    gap: 24px;
}

.admin-tabs {
    width: 180px;
    flex-shrink: 0;
}

.admin-tab {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    margin-bottom: 2px;
}

    .admin-tab:hover {
        background: var(--bg);
        color: var(--fg);
    }

    .admin-tab.active {
        background: var(--primary-light);
        color: var(--primary);
    }

    .admin-tab svg {
        width: 15px;
        height: 15px;
        flex-shrink: 0;
    }

.admin-content {
    flex: 1;
    min-width: 0;
}

.summary-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.summary-item:first-of-type {
    padding-top: 0;
}

.summary-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.summary-date {
    flex-shrink: 0;
    font-size: 12px;
    color: var(--muted);
    text-align: right;
    white-space: nowrap;
}

@media (max-width: 680px) {
    .account-card {
        flex-wrap: wrap;
    }

    .summary-item {
        flex-direction: column;
        gap: 6px;
    }

    .summary-date {
        text-align: left;
        white-space: normal;
    }
}

.account-actions {
    margin-top: 16px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-tab-panel {
    display: none;
}

.admin-tab-panel.active {
    display: block;
}

.team-progress-row {
    margin-bottom: 18px;
}

.team-progress-row--referenced {
    margin: 16px 0;
}

.team-progress-label {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 6px;
}

.team-progress-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 4px;
}

.team-progress-fill {
    height: 100%;
    background: var(--healthy);
    border-radius: 4px;
    width: 60%;
}

.team-progress-sub {
    font-size: 12px;
    color: var(--muted);
    text-align: right;
}

.settings-message {
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.4;
}

.settings-message-success {
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.settings-message-error {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.team-connect-warning {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 20px;
    padding: 14px 16px;
    border: 1px solid #fed7aa;
    border-radius: 14px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 13px;
    line-height: 1.45;
}

.team-connect-warning strong {
    color: #c2410c;
}

.team-progress-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    margin: 14px 0 18px;
    padding: 20px 18px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.team-progress-meter {
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: #e5e7eb;
}

.team-progress-meter span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--healthy);
}

.team-progress-count {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.member-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.member-card-muted {
    border-color: #e5e7eb;
    background: #fff;
}

.member-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.member-info {
    flex: 1;
    min-width: 140px;
}

.member-name {
    font-size: 13.5px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.member-role {
    font-size: 11px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 5px;
    border: 1px solid var(--border);
    color: var(--muted);
    background: var(--bg);
}

.member-email {
    font-size: 12px;
    color: var(--muted);
}

.member-status {
    font-size: 12px;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-connected {
    color: var(--healthy);
}

.status-error {
    color: var(--attention);
}

.status-none {
    color: var(--muted);
}

.member-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.notification-toggle-form {
    margin: 0;
}

.member-tooltip-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.notification-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s, opacity 0.15s, box-shadow 0.15s;
}

.notification-toggle.is-on {
    color: var(--healthy);
}

.notification-toggle.is-off {
    color: var(--muted);
    opacity: 0.6;
}

.notification-toggle:hover,
.notification-toggle:focus-visible {
    background: #dcfce7;
    color: var(--healthy);
    opacity: 1;
    outline: none;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}

.notification-toggle:disabled {
    cursor: not-allowed;
    background: transparent;
    box-shadow: none;
}

.member-tooltip {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 9px);
    width: max-content;
    max-width: 220px;
    transform: translate(-50%, 4px);
    padding: 7px 9px;
    border-radius: 7px;
    background: #10264a;
    color: #fff;
    box-shadow: 0 10px 24px rgba(10, 24, 48, 0.24);
    font-size: 10.5px;
    font-weight: 650;
    line-height: 1.25;
    white-space: normal;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
    z-index: 10;
}

.member-tooltip::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #10264a;
}

.member-tooltip-wrap:hover .member-tooltip,
.member-tooltip-wrap:focus-within .member-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

.team-referenced-heading {
    margin: 18px 0 8px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.bell-icon {
    color: var(--healthy);
    cursor: pointer;
    opacity: 0.7;
}

.bell-off {
    color: var(--muted);
    cursor: pointer;
    opacity: 0.5;
}

.invite-section {
    margin-top: 20px;
}

.invite-section-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 6px;
}

.invite-section-desc {
    font-size: 12.5px;
    color: var(--muted);
    margin-bottom: 10px;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    display: block;
}

.form-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    color: var(--fg);
    font-size: 13.5px;
    font-family: var(--font);
    outline: none;
    transition: border-color 0.15s;
}

.form-input:focus {
    border-color: var(--primary);
}

.form-hint {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
}

.form-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.form-select {
    padding: 9px 28px 9px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    color: var(--fg);
    font-size: 13.5px;
    font-family: var(--font);
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%23717171' stroke-width='2' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    transition: border-color 0.15s;
}

.form-select:focus {
    border-color: var(--primary);
}

.form-time {
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    color: var(--fg);
    font-size: 13.5px;
    font-family: var(--font);
    outline: none;
    transition: border-color 0.15s;
}

.btn-save {
    padding: 9px 22px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
    margin-top: 8px;
    transition: background 0.15s, opacity 0.15s;
}

.btn-save:hover {
    background: #1a57f0;
}

.btn-save:disabled {
    background: #cbd5e1;
    color: #64748b;
    cursor: not-allowed;
    opacity: 1;
}

.btn-save:disabled:hover {
    background: #cbd5e1;
}

.invite-link-row {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--card);
    margin-top: 4px;
}

.invite-link-input {
    flex: 1;
    padding: 8px 12px;
    font-size: 12.5px;
    color: var(--muted);
    border: none;
    outline: none;
    background: transparent;
    font-family: var(--font);
    min-width: 0;
}

.invite-link-btn {
    padding: 8px 14px;
    background: var(--primary);
    color: #fff;
    border: none;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background 0.15s;
    white-space: nowrap;
}

.invite-link-btn:hover {
    background: #1a57f0;
}

@media (max-width: 680px) {
    .admin-layout {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .admin-tabs {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        column-gap: 12px;
        row-gap: 0;
        align-items: start;
    }

    .admin-tab {
        width: 100%;
        min-width: 0;
        margin-bottom: 0;
        padding: 10px 12px;
        display: inline-flex;
        align-items: center;
        justify-content: flex-start;
        gap: 8px;
        text-align: left;
        white-space: normal;
        line-height: 1.3;
        font-size: 13px;
        border-radius: 10px;
        align-self: start;
    }

        .admin-tab svg {
            width: 15px;
            height: 15px;
            flex-shrink: 0;
        }

    .member-actions {
        margin-left: 0;
        width: 100%;
        justify-content: flex-end;
    }
}

.project-summary-card {
    padding: 16px;
}

.project-summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: nowrap;
    margin-bottom: 12px;
}

.project-summary-title {
    margin: 0;
    min-width: 0;
    flex: 1 1 auto;
}

.project-summary-range {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 2px;
    border-radius: 10px;
    background: var(--bg);
}

.project-summary-range-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

    .project-summary-range-option:hover {
        color: var(--fg);
    }

    .project-summary-range-option.active {
        background: #fff;
        color: var(--fg);
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.10);
    }

.project-summary-body {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    background: var(--card);
}

.project-summary-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.project-summary-list-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 13px;
    color: var(--fg);
}

.project-summary-bullet {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #9ca3af;
    margin-top: 7px;
    flex-shrink: 0;
}

.project-summary-text {
    flex: 1;
    min-width: 0;
}

.project-summary-date-inline {
    display: inline-block;
    margin-left: 6px;
    color: var(--muted);
    font-size: 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    white-space: nowrap;
}

.project-summary-empty {
    font-size: 13px;
    color: var(--muted);
}

.generated-project-summary-card {
    border-color: #dbeafe;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.generated-summary-subtitle {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11.5px;
}

.generated-summary-body {
    border-color: #dbeafe;
}

.generated-summary-sections {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.generated-summary-section-title {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.project-summary-range-option {
    border: none;
    background: transparent;
    font-family: var(--font);
    cursor: pointer;
}

@media (max-width: 680px) {
    .project-summary-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        flex-wrap: nowrap;
        margin-bottom: 12px;
    }

    .project-summary-title {
        flex: 1 1 auto;
        min-width: 0;
    }

    .project-summary-range {
        margin-left: auto;
        flex: 0 0 auto;
    }

    .project-summary-date-inline {
        display: inline-block;
        margin-left: 8px;
        margin-top: 0;
        white-space: nowrap;
    }
}

@media (max-width: 768px) {
    .project-summary-header {
        flex-direction: row;
        align-items: center;
        flex-wrap: nowrap;
    }

    .project-summary-range {
        margin-left: auto;
    }
}

.team-coverage-card {
    padding: 16px;
}

.team-coverage-summary {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.5;
}

    .team-coverage-summary strong {
        color: var(--fg);
        font-weight: 600;
    }

.team-coverage-callout {
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card);
}

.team-coverage-warning {
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid #fed7aa;
    border-radius: 10px;
    background: #fff7ed;
    color: #7c2d12;
    font-size: 12.5px;
    line-height: 1.45;
}

.team-coverage-callout-text {
    flex: 1;
    min-width: 0;
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.5;
}

.team-coverage-callout-text strong {
    color: var(--fg);
    font-weight: 650;
}

.team-coverage-nudge-form {
    margin: 0;
}

.nudge-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.btn-nudge,
a.btn-nudge,
button.btn-nudge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 7px 12px;
    border: none;
    border-radius: 999px;
    background: #f59e0b;
    color: #fff;
    font-size: 12px;
    font-family: var(--font);
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.btn-nudge svg,
a.btn-nudge svg,
button.btn-nudge svg {
    flex: 0 0 auto;
    margin-right: 2px;
}

.btn-nudge-secondary,
a.btn-nudge-secondary {
    border: 1px solid #fed7aa;
    background: #fff;
    color: #c2410c;
    text-decoration: none;
}

    .btn-nudge:hover,
    a.btn-nudge:hover,
    button.btn-nudge:hover {
        background: #d97706;
    }

    .btn-nudge-secondary:hover,
    a.btn-nudge-secondary:hover {
        background: #fff7ed;
    }

    .btn-nudge:disabled,
    button.btn-nudge:disabled {
        cursor: not-allowed;
        opacity: 0.55;
        background: #f59e0b;
    }

.team-coverage-toggle {
    display: inline-flex;
    margin-top: 12px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--primary);
    font-family: var(--font);
    font-size: 12.5px;
    font-weight: 650;
    cursor: pointer;
}

.team-coverage-toggle:hover {
    text-decoration: underline;
}

.team-coverage-summary-main {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.team-coverage-summary-icon {
    flex: 0 0 auto;
    color: var(--muted);
    margin-top: 2px;
}

.event-card--mockup {
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.event-card-type-row {
    margin-bottom: 8px;
}

.event-card-type-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fafafa;
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    line-height: 1.2;
}

.event-card-header--mockup {
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 8px;
}

.event-card-title--mockup {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 6px;
}

.event-card-status {
    flex-shrink: 0;
    margin-top: 1px;
    gap: 6px;
}

.event-card-desc--mockup {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 10px;
}

.event-card-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.event-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
}

.event-card-amount--mockup {
    font-size: 12px;
    font-weight: 600;
    color: var(--fg);
}

.event-card-date--mockup {
    margin-top: 0;
    font-size: 12px;
    color: var(--muted);
}

.event-card-actions--mockup {
    justify-content: flex-start;
}

.event-card-state {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.event-card-state-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex: 0 0 auto;
}

.event-state-risk {
    color: var(--risk);
}

    .event-state-risk .event-card-state-dot {
        background: var(--risk);
    }

.event-state-attention {
    color: var(--attention);
}

    .event-state-attention .event-card-state-dot {
        background: var(--attention);
    }

.event-state-healthy {
    color: var(--healthy);
}

    .event-state-healthy .event-card-state-dot {
        background: var(--healthy);
    }

.btn-sm-primary--subtle,
a.btn-sm-primary--subtle,
button.btn-sm-primary--subtle {
    background: #eef2ff;
    border-color: #dbe4ff;
    color: #4f6ef7;
    font-weight: 500;
    padding: 6px 10px;
}

.event-card-state,
.event-state-risk,
.event-state-attention,
.event-state-healthy,
.event-card-state-dot {
    all: unset;
}

.events-feed-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.events-feed-bullet-col {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
}

.events-feed-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}

    .events-feed-item:last-child {
        border-bottom: none;
    }

.events-feed-main {
    min-width: 0;
}

.events-feed-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.events-feed-dot {
    width: 6px;
    height: 6px;
    flex: 0 0 auto;
}

.events-feed-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}

.events-feed-line-one,
.events-feed-line-two {
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
    flex-wrap: wrap;
}

.events-feed-line-two {
    color: var(--muted);
    font-size: 11px;
    font-weight: 400;
    line-height: 1.4;
}


.events-feed-title-link {
    color: #4f46e5;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.35;
    text-decoration: none;
}

    .events-feed-title-link:hover {
        text-decoration: underline;
    }

.events-feed-subline {
    font-size: 11px;
    color: var(--muted);
    line-height: 1.45;
    margin-left: 14px;
}

.events-feed-type-inline {
    color: var(--muted);
    font-size: 11px;
    font-weight: 400;
    line-height: 1.4;
}

.events-feed-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 2px;
    margin-left: 14px;
    font-size: 11px;
    color: var(--muted);
}

    .events-feed-meta a {
        color: #4f46e5;
        text-decoration: underline;
    }

.events-feed-empty {
    padding: 14px 16px;
    font-size: 13px;
    color: var(--muted);
}

.events-filters-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 16px;
}

.events-filters-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.events-filters-top-row,
.events-filters-middle-row,
.events-filters-bottom-row,
.events-filters-extra-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-select {
    min-width: 0;
    padding: 7px 28px 7px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    color: var(--fg);
    font-size: 12px;
    font-family: var(--font);
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%23717171' stroke-width='2' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    transition: border-color 0.15s;
}

    .filter-select:focus {
        border-color: var(--primary);
    }

.filter-select--search {
    flex: 1 1 180px;
    appearance: auto;
    background-image: none;
}

.events-filters-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 16px;
}

.events-filters-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.events-filters-primary-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.events-filters-secondary-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-select {
    min-width: 0;
    width: 100%;
    padding: 7px 28px 7px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    color: var(--fg);
    font-size: 12px;
    font-family: var(--font);
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%23717171' stroke-width='2' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    transition: border-color 0.15s;
}

    .filter-select:focus {
        border-color: var(--primary);
    }


.filter-btn {
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--muted);
    font-size: 12px;
    font-family: var(--font);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    white-space: nowrap;
}

.events-feed-item-link {
    text-decoration: none;
    color: inherit;
    transition: background-color 0.12s ease;
}

    .events-feed-item-link:hover {
        background: #fafafa;
    }

    .events-feed-item-link .events-feed-title-link {
        text-decoration: none;
    }

    .events-feed-item-link:hover .events-feed-title-link {
        text-decoration: none;
    }

.events-feed-title-text {
    color: var(--fg);
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.35;
}

.event-detail-header {
    position: relative;
}

.event-detail-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 14px;
}

.event-detail-title-wrap {
    min-width: 0;
    flex: 1 1 auto;
    padding-right: 88px;
}

.event-detail-title-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
    flex-wrap: wrap;
}

.event-detail-title {
    font-size: 16px;
}

.event-detail-subtype-inline {
    margin-top: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.event-detail-risk-badge {
    position: static;
    margin-left: auto;
    flex: 0 0 auto;
}

.event-detail-meta-grid {
    margin-top: 0;
}

    .event-detail-meta-grid .detail-meta-row {
        line-height: 1.5;
    }

.event-detail-meta-inline {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    font-size: 12.5px;
    color: var(--muted);
}

.event-detail-meta-inline-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
}

.event-detail-meta-inline .label {
    color: var(--muted);
}


.event-detail-meta-inline .value {
    color: var(--fg);
    font-weight: 500;
}

.event-detail-meta-icon {
    width: 13px;
    height: 13px;
    color: var(--muted);
    flex: 0 0 auto;
}

.what-happened-card {
    padding-top: 16px;
}

.what-happened-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.what-happened-intro {
    font-size: 13px;
    line-height: 1.65;
    color: var(--fg);
    margin: 0;
}

.what-happened-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-left: 10px;
    position: relative;
}

    .what-happened-section::before {
        content: "";
        position: absolute;
        left: 0;
        top: 1px;
        bottom: 1px;
        width: 4px;
        border-radius: 999px;
        background: var(--border);
    }

.what-happened-section--risk::before {
    background: var(--risk);
}

.what-happened-section--action::before {
    background: var(--primary);
}

.what-happened-section--time::before {
    background: var(--attention);
}

.what-happened-section--last {
    padding-top: 2px;
}

.what-happened-subtitle {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    line-height: 1.2;
    padding-left: 0;
}

.what-happened-section--risk .what-happened-subtitle {
    color: var(--risk);
}

.what-happened-section--action .what-happened-subtitle {
    color: var(--primary);
}

.what-happened-section--time .what-happened-subtitle {
    color: var(--attention);
}

.what-happened-text {
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--fg);
}

.what-happened-action-row {
    padding-top: 4px;
}

.what-happened-action-btn {
    gap: 6px;
}

    .what-happened-action-btn svg {
        flex: 0 0 auto;
    }

.correspondence-timeline-card {
    padding-top: 16px;
}

.correspondence-timeline-subtitle {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
    margin-bottom: 12px;
}

.correspondence-timeline-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.correspondence-timeline-kind-col {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding-top: 2px;
}

.correspondence-timeline-kind-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #6b7280;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    margin-bottom: 8px;
}

.correspondence-timeline-item {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr);
    column-gap: 12px;
    align-items: flex-start;
}

.correspondence-timeline-rail {
    position: relative;
    display: flex;
    justify-content: center;
    align-self: stretch;
}

    .correspondence-timeline-rail::before {
        content: "";
        position: absolute;
        top: 0;
        bottom: -12px;
        left: 50%;
        width: 1px;
        background: var(--border);
        transform: translateX(-50%);
    }

.correspondence-timeline-item:last-child .correspondence-timeline-rail::before {
    bottom: 12px;
}

.correspondence-timeline-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #c7ced9;
    margin-top: 8px;
    position: relative;
    z-index: 1;
}

.correspondence-timeline-card-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.correspondence-timeline-item-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.correspondence-timeline-item-main {
    min-width: 0;
    flex: 1 1 auto;
}

/*.correspondence-timeline-kind {
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
}*/

.correspondence-timeline-datetime {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    font-size: 10.5px;
    color: var(--muted);
    white-space: nowrap;
}

.correspondence-timeline-title {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--fg);
    margin-bottom: 4px;
}

.correspondence-timeline-sender-email {
    font-size: 10.5px;
    color: var(--muted);
    line-height: 1.4;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.correspondence-timeline-participants {
    font-size: 10.5px;
    color: var(--muted);
    line-height: 1.45;
    margin-bottom: 6px;
}

.correspondence-timeline-summary {
    font-size: 11.5px;
    color: var(--fg);
    line-height: 1.6;
    white-space: normal;
}

.correspondence-timeline-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.correspondence-timeline-attachment-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #f8fafc;
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 500;
}

a.correspondence-timeline-attachment-pill {
    text-decoration: none;
}

    a.correspondence-timeline-attachment-pill:hover {
        border-color: #bfdbfe;
        background: #eff6ff;
        color: var(--primary);
    }

.correspondence-timeline-expand {
    margin-top: 8px;
}

    .correspondence-timeline-expand summary {
        list-style: none;
        cursor: pointer;
        color: var(--primary);
        font-size: 10.5px;
        font-weight: 500;
    }

        .correspondence-timeline-expand summary::-webkit-details-marker {
            display: none;
        }

/*.correspondence-timeline-raw {
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid var(--border);
    font-size: 11px;
    line-height: 1.5;
    color: var(--fg);
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: auto;
}*/

.correspondence-timeline-plain-text {
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid var(--border);
    font-size: 11.5px;
    line-height: 1.6;
    color: var(--fg);
    white-space: pre-wrap;
    word-break: break-word;
}

.btn-sm svg,
a.btn-sm svg,
button.btn-sm svg {
    flex: 0 0 auto;
    margin-right: 6px;
}

.event-actions-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-sm svg,
a.btn-sm svg,
button.btn-sm svg {
    flex: 0 0 auto;
    margin-right: 6px;
}

.btn-sm-success,
a.btn-sm-success,
button.btn-sm-success {
    background: #f3fcf6;
    border-color: #7bd9a0;
    color: var(--healthy);
}

    .btn-sm-success:hover,
    a.btn-sm-success:hover,
    button.btn-sm-success:hover {
        background: #e8f8ee;
    }


.activity-log-list {
    margin-top: 2px;
}

.activity-log-row {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    column-gap: 12px;
    align-items: start;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

    .activity-log-row:first-child {
        padding-top: 0;
    }

    .activity-log-row:last-child {
        padding-bottom: 0;
        border-bottom: none;
    }

.activity-log-date {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
}

.activity-log-summary {
    min-width: 0;
    font-size: 12px;
    color: var(--fg);
    line-height: 1.45;
}

@media (max-width: 680px) {
    .activity-log-row {
        grid-template-columns: 1fr;
        row-gap: 4px;
    }

    .activity-log-date {
        white-space: normal;
    }
}

/* Simplified Microsoft sign-in page */
body:has(.login-wrap) {
    display: block;
    min-height: 100vh;
    overflow-x: hidden;
    background: #ffffff;
}

.login-wrap {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    background: #ffffff;
}

.login-panel {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 40px;
    text-decoration: none;
}

.login-logo img {
    display: block;
    width: auto;
    height: 36px;
    object-fit: contain;
}

.login-card {
    width: 100%;
}

.login-form-title {
    margin: 0 0 8px;
    color: #172b4d;
    font-family: var(--font);
    font-size: 26px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0;
    text-align: center;
}

.login-form-sub {
    margin: 0 0 32px;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.55;
    text-align: center;
}

.login-btn {
    width: 100%;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 0;
    padding: 13px 20px;
    border: 1px solid #172b4d;
    border-radius: 12px;
    background: #172b4d;
    color: #ffffff;
    font-family: var(--font);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(15, 31, 61, 0.10);
    transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.login-btn:hover {
    border-color: #0f1f3d;
    background: #0f1f3d;
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(15, 31, 61, 0.14);
}

.login-btn:active {
    transform: scale(0.98);
}

.login-btn svg {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
}

.login-small-print {
    margin: 20px 0 0;
    color: #9ca3af;
    font-size: 11px;
    line-height: 1.6;
    text-align: center;
}

.login-small-print a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.15s ease;
}

.login-small-print a:hover {
    color: #172b4d;
}

@media (max-width: 680px) {
    .login-wrap {
        min-height: 100dvh;
        padding: 32px 20px;
    }

    .login-logo {
        margin-bottom: 34px;
    }

    .login-logo img {
        height: 34px;
    }

    .login-form-title {
        font-size: 25px;
    }
}
