.guest-wrap {
    max-width: 420px;
    margin: 8vh auto;
    padding: 0 16px;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.1;
}

.score-circle {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
    border: 6px solid currentColor;
}

.table td, .table th {
    vertical-align: middle;
}

.text-prewrap {
    white-space: pre-wrap;
}

.report-frame {
    width: 100%;
    height: 80vh;
    border: 1px solid var(--bs-border-color);
    border-radius: .375rem;
    background: #fff;
}

.check-item-note {
    font-size: .85rem;
    color: var(--bs-secondary-color);
}

/* "Running checks" overlay */
.busy-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, .85);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 2000;
}

.busy-overlay.show {
    display: flex;
}

.logo-preview {
    max-height: 56px;
    max-width: 200px;
    object-fit: contain;
    border: 1px solid var(--bs-border-color);
    border-radius: .375rem;
    padding: 4px;
    background: #fff;
}

/* Checkerboard behind logos so transparent (incl. white) logos stay visible */
.logo-preview,
.client-avatar-logo {
    background-color: #e9edf3;
    background-image:
        linear-gradient(45deg, #cfd6e0 25%, transparent 25%, transparent 75%, #cfd6e0 75%),
        linear-gradient(45deg, #cfd6e0 25%, transparent 25%, transparent 75%, #cfd6e0 75%);
    background-size: 12px 12px;
    background-position: 0 0, 6px 6px;
}

/* Flash messages: success alerts fade out on their own (see app.js) */
.flash-alert {
    position: relative;
    overflow: hidden;
}

.flash-alert .flash-timer {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    background: currentColor;
    opacity: .35;
    transform-origin: left;
    animation: flash-timer linear forwards;
}

.flash-alert:hover .flash-timer {
    animation-play-state: paused;
}

@keyframes flash-timer {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

/* Clients list */
.stat-tile {
    border: 1px solid var(--bs-border-color);
    transition: box-shadow .15s ease, transform .15s ease;
}

.stat-tile .stat-value {
    font-size: 1.6rem;
    font-weight: 600;
    line-height: 1.1;
}

button.stat-tile:hover,
button.stat-tile.active {
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .08);
    transform: translateY(-2px);
}

button.stat-tile.active {
    border-color: var(--bs-warning);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--bs-secondary-color);
    pointer-events: none;
}

.client-card {
    border: 1px solid var(--bs-border-color);
    transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}

.client-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 .75rem 1.5rem rgba(13, 110, 253, .10);
    border-color: rgba(13, 110, 253, .35);
}

.client-card .client-name {
    font-weight: 600;
    color: var(--bs-body-color);
    text-decoration: none;
}

.client-card:hover .client-name {
    color: var(--bs-primary);
}

.client-actions {
    position: relative;
    z-index: 2;
    opacity: .55;
    transition: opacity .15s ease;
}

.client-card:hover .client-actions {
    opacity: 1;
}

.client-avatar {
    --hue: 215;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: hsl(var(--hue), 55%, 32%);
    background: hsl(var(--hue), 70%, 92%);
}

.client-avatar-logo {
    width: 72px;
    border-radius: 10px;
    object-fit: contain;
    border: 1px solid var(--bs-border-color);
    padding: 4px;
}

.min-w-0 {
    min-width: 0;
}

.client-table tr[data-href] {
    cursor: pointer;
}

[data-client-item] {
    animation: fade-in .25s ease both;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: none; }
}

.empty-state .empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: var(--bs-primary);
    background: var(--bs-primary-bg-subtle);
}

/* Single client page: light tinted background */
body.page-client {
    background: linear-gradient(180deg, #eef4ff 0, #f6f9ff 320px, #f8fafc 100%) fixed;
}

body.page-client .card {
    border-color: #e3e9f3;
    box-shadow: 0 .25rem .75rem rgba(15, 40, 90, .05);
}

/* Website type picker (website form) */
.type-card {
    display: block;
    padding: 14px 16px;
    border: 1.5px solid var(--bs-border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}

.type-card i {
    display: block;
    font-size: 1.4rem;
    color: var(--bs-secondary-color);
    margin-bottom: 6px;
}

.type-card:hover {
    border-color: rgba(13, 110, 253, .45);
}

.btn-check:checked + .type-card {
    border-color: var(--bs-primary);
    background: var(--bs-primary-bg-subtle);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, .12);
}

.btn-check:checked + .type-card i {
    color: var(--bs-primary);
}

.btn-check:focus-visible + .type-card {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

/* Yes / No answer buttons (report form) */
.answer-group .btn {
    min-width: 64px;
}

/* ---------- Dashboard, client and website pages ---------- */
body.page-soft {
    background: linear-gradient(180deg, #eef4ff 0, #f7f9fc 360px, #f8fafc 100%) fixed;
}

body.page-soft .card,
body.page-client .card {
    border-color: #e3e9f3;
    box-shadow: 0 .25rem .75rem rgba(15, 40, 90, .05);
}

.page-hero h1 {
    font-weight: 600;
}

.kpi {
    color: inherit;
}

.kpi .stat-value {
    font-size: 1.6rem;
    font-weight: 600;
    line-height: 1.1;
}

a.kpi:hover {
    box-shadow: 0 .5rem 1rem rgba(13, 110, 253, .12);
    transform: translateY(-2px);
}

/* Health donut */
.donut {
    width: 168px;
    height: 168px;
    border-radius: 50%;
    position: relative;
}

.donut-hole {
    position: absolute;
    inset: 22px;
    border-radius: 50%;
    background: var(--bs-body-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
    flex-shrink: 0;
}

/* Recent work timeline */
.timeline li {
    position: relative;
    padding: 0 0 14px 18px;
    border-left: 2px solid var(--bs-border-color);
    margin-left: 4px;
}

.timeline li:last-child {
    padding-bottom: 0;
    border-left-color: transparent;
}

.timeline li::before {
    content: "";
    position: absolute;
    left: -6px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--bs-primary);
    box-shadow: 0 0 0 3px var(--bs-primary-bg-subtle);
}

/* Clickable table rows */
tr[data-href] {
    cursor: pointer;
}

/* Profile header (client & website pages) */
.profile-card {
    background: linear-gradient(135deg, #ffffff 0%, #f5f8ff 100%);
}

.profile-avatar {
    width: 72px;
    height: 72px;
    font-size: 1.6rem;
}

.profile-logo {
    max-height: 72px;
    max-width: 180px;
}

.profile-stats {
    border-top: 1px solid var(--bs-border-color);
    padding-top: 12px;
}

.profile-stats .stat-value {
    font-size: 1.5rem;
    font-weight: 600;
}

.contact-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    color: var(--bs-body-color);
    font-size: .875rem;
    text-decoration: none;
}

a.contact-chip:hover {
    border-color: var(--bs-primary);
    color: var(--bs-primary);
}

/* Website cards on the client page: coloured top edge by health */
.site-card {
    border-top-width: 3px !important;
}

.site-card.status-pass { border-top-color: var(--bs-success) !important; }
.site-card.status-warning { border-top-color: var(--bs-warning) !important; }
.site-card.status-fail { border-top-color: var(--bs-danger) !important; }
.site-card.status-none { border-top-color: var(--bs-secondary-bg) !important; }

.site-card .client-actions {
    opacity: 1;
}

/* Website page */
.score-ring {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 5px solid currentColor;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
}

.score-ring .score-num {
    font-size: 1.5rem;
    font-weight: 700;
}

.page-tabs .nav-link {
    color: var(--bs-body-color);
    border-radius: 999px;
}

.page-tabs .nav-link.active .badge {
    background: rgba(255, 255, 255, .25) !important;
    color: #fff !important;
    border-color: transparent !important;
}

.area-pill {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 10px;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    color: var(--bs-body-color);
    font-size: .875rem;
    text-decoration: none;
    transition: border-color .15s ease, transform .15s ease;
}

.area-pill:hover {
    border-color: var(--bs-primary);
    transform: translateY(-1px);
}

/* Small labelled facts inside website cards (client page) */
.mini-fact {
    background: var(--bs-tertiary-bg);
    border-radius: 8px;
    padding: 6px 10px;
    color: var(--bs-body-color);
    line-height: 1.3;
}

.mini-fact span {
    display: block;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--bs-secondary-color);
}

/* Clients list */
.filter-chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid var(--bs-border-color);
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    font-size: .875rem;
    transition: border-color .15s ease, background-color .15s ease;
}

.filter-chip .legend-dot {
    width: 8px;
    height: 8px;
    margin-right: 6px;
}

.filter-chip:hover {
    border-color: var(--bs-primary);
}

.filter-chip.active {
    background: var(--bs-primary);
    border-color: var(--bs-primary);
    color: #fff;
}

.health-bar {
    display: flex;
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--bs-secondary-bg);
    gap: 2px;
}

.health-bar span {
    display: block;
    height: 100%;
}

.site-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--bs-primary-bg-subtle);
    color: var(--bs-primary-text-emphasis);
    font-size: .78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.client-tile {
    border-top-width: 3px !important;
}

.client-tile.status-pass { border-top-color: var(--bs-success) !important; }
.client-tile.status-warning { border-top-color: var(--bs-warning) !important; }
.client-tile.status-fail { border-top-color: var(--bs-danger) !important; }
.client-tile.status-none { border-top-color: var(--bs-secondary-bg) !important; }

.client-tile .client-actions,
.client-contacts {
    position: relative;
    z-index: 2;
    opacity: 1;
}

/* SSL certificate expiring within 30 days (clients list + client page) */
.ssl-alert {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid;
    font-size: .78rem;
    font-weight: 600;
    line-height: 1.35;
    position: relative;
    z-index: 2;
}

.ssl-alert-warning {
    background: var(--bs-warning-bg-subtle);
    border-color: var(--bs-warning-border-subtle);
    color: var(--bs-warning-text-emphasis);
}

.ssl-alert-danger {
    background: var(--bs-danger-bg-subtle);
    border-color: var(--bs-danger-border-subtle);
    color: var(--bs-danger-text-emphasis);
}

.client-card.has-ssl-alert {
    box-shadow: 0 0 0 2px var(--bs-warning-border-subtle);
}
