/* Overview (Components/Pages/Overview.razor): the four figures, "Needs your attention" and the websites. The page frame
   and head are the shared app page ones (WebbuilderUI css/app-page.css). Skeleton: Components/Skeletons/OverviewSkeleton.razor. */

/* ===========
     figures
   =========== */

.ov-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin: 0 0 24px;
    padding: 0;
    list-style: none;
}

.ov-stat {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 14px;
    row-gap: 2px;
    padding: 18px 20px;
    border: 1px solid var(--app-line);
    border-radius: 20px;
    background: var(--app-surface);
    box-shadow: var(--app-shadow-soft);
}

.ov-stat-icon {
    display: inline-flex;
    grid-row: 1 / span 3;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--app-accent-soft);
    font-size: 22px;
    color: var(--app-accent);
}

.ov-stat-label {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--app-text-muted);
}

.ov-stat-value {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--app-text-strong);
    overflow-wrap: anywhere;
}

.ov-stat-note {
    font-size: 12px;
    line-height: 1.4;
    color: var(--app-text-muted);
}

/* Something to pay: the figure takes the warning colour */
.ov-stat-warn .ov-stat-icon {
    background: var(--app-warning-soft);
    color: var(--app-warning);
}

/* ===========
     figures
   =========== */


/* =========
     cards
   ========= */

/* "Needs your attention" takes the wider column */
.ov-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    align-items: start;
    gap: 20px;
}

.ov-card {
    padding: 22px;
    border: 1px solid var(--app-line);
    border-radius: 24px;
    background: var(--app-surface);
    box-shadow: var(--app-shadow-soft);
}

/* The title, the lead and the View all link; the link takes the 14px from here */
.ov-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 14px;
}

.ov-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--app-text-strong);
}

.ov-card-title .bx {
    font-size: 20px;
    color: var(--app-accent);
}

.ov-card-lead {
    margin: 4px 0 0;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--app-text-muted);
}

/* View all (app-link) beside the card's title */
.ov-link {
    flex: none;
    white-space: nowrap;
}

.ov-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* ---------- needs your attention ---------- */

.ov-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--app-line);
    border-radius: 18px;
    background: var(--app-bg-soft);
}

.ov-item-icon {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 20px;
}

.ov-item-warning .ov-item-icon {
    background: var(--app-warning-soft);
    color: var(--app-warning);
}

.ov-item-danger {
    border-color: color-mix(in srgb, var(--app-danger) 30%, var(--app-line));
}

.ov-item-danger .ov-item-icon {
    background: var(--app-danger-soft);
    color: var(--app-danger);
}

.ov-item-body {
    flex: 1 1 auto;
    min-width: 0;
}

.ov-item-title {
    margin: 0;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--app-text-strong);
    overflow-wrap: anywhere;
}

.ov-item-meta {
    margin: 2px 0 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--app-text-muted);
}

.ov-item-action {
    flex: none;
}

/* ---------- websites ---------- */

.ov-site {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--app-line);
    border-radius: 18px;
    background: var(--app-surface);
    color: inherit;
    text-decoration: none;
    transition: border-color 0.25s ease, box-shadow 0.3s ease, transform 0.35s var(--app-ease-spring);
}

@media (hover: hover) {
    .ov-site:hover {
        border-color: color-mix(in srgb, var(--app-accent) 40%, var(--app-line));
        box-shadow: var(--app-shadow-hover);
        transform: translateY(-2px);
    }
}

.ov-site:focus-visible {
    outline: 2px solid var(--app-accent);
    outline-offset: 2px;
}

.ov-site-avatar {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--app-gradient-brand);
    font-size: 16px;
    font-weight: 600;
    color: #FFFFFF;
}

.ov-site-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
}

.ov-site-name {
    overflow: hidden;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--app-text-strong);
}

.ov-site-meta {
    overflow: hidden;
    font-size: 12.5px;
    line-height: 1.5;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--app-text-muted);
}

/* ---------- empty card ---------- */

.ov-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 28px 16px 20px;
    text-align: center;
}

.ov-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin-bottom: 8px;
    border-radius: 16px;
    background: var(--app-accent-soft);
    font-size: 26px;
    color: var(--app-accent);
}

.ov-empty-icon-ok {
    background: var(--app-success-soft);
    color: var(--app-success);
}

.ov-empty-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--app-text-strong);
}

.ov-empty-text {
    max-width: 360px;
    margin: 0 0 8px;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--app-text-muted);
}

/* =========
     cards
   ========= */


/* ==============
     responsive
   ============== */

@media (max-width: 1199.98px) {
    .ov-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .ov-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 575.98px) {
    .ov-stats {
        gap: 12px;
        margin-bottom: 18px;
    }

    /* Figures stack the icon above the label on a phone */
    .ov-stat {
        grid-template-columns: minmax(0, 1fr);
        padding: 14px 16px;
    }

    .ov-stat-icon {
        grid-row: auto;
        width: 38px;
        height: 38px;
        margin-bottom: 8px;
        font-size: 19px;
    }

    .ov-stat-value {
        font-size: 21px;
    }

    .ov-card {
        padding: 18px 16px;
        border-radius: 20px;
    }

    /* The action goes under the text, the full width of the row */
    .ov-item {
        flex-wrap: wrap;
        padding: 14px;
    }

    .ov-item-body {
        flex-basis: calc(100% - 54px);
    }

    .ov-item-action {
        flex: 1 1 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ov-site {
        transition: none;
    }
}
