/* The dashboard's first page, sized from the reference pictures (1672 px wide). Colours come from the tokens of ridey-theme.css. */

.rd-dash { display: flex; flex-direction: column; gap: .875rem; color: var(--rd-text); }
.rd-dash a { color: inherit; }
.tone-blue { --tone: var(--rd-blue); }
.tone-purple { --tone: var(--rd-purple); }
.tone-emerald { --tone: var(--rd-emerald); }
.tone-orange { --tone: var(--rd-orange); }
.tone-red { --tone: var(--rd-red); }
.rd-ico { width: 1.25rem; height: 1.25rem; }

.rd-head { display: flex; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: .1rem; }
.rd-head h1 { font-size: 1.75rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.rd-head p { font-size: .9rem; color: var(--rd-text-2); }
.rd-views { margin-inline-start: auto; display: flex; flex-wrap: wrap; gap: .15rem; align-self: center; }
.rd-views a { padding: .35rem .7rem; border-radius: 999px; font-size: .78rem; font-weight: 500; color: var(--rd-text-2) !important; }
.rd-views a:hover { background: var(--rd-hover); }
.rd-views a.is-active { background: var(--tk-accent-soft); color: var(--rd-blue) !important; font-weight: 600; }
html.dark .rd-views a.is-active { color: #8FBEFF !important; }

.rd-period { position: relative; }
.rd-period > button { display: flex; align-items: center; gap: .7rem; height: 2.75rem; padding: 0 1.1rem; border-radius: 999px; background: var(--rd-card); border: 1px solid var(--rd-border); font-size: .875rem; font-weight: 500; box-shadow: var(--rd-shadow); }
.rd-ico-line { width: 1.25rem; height: 1.25rem; }
.rd-ico-line.sm { width: 1rem; height: 1rem; }
.rd-period ul { position: absolute; inset-inline-end: 0; top: calc(100% + .4rem); z-index: 30; min-width: 11rem; padding: .35rem; background: var(--rd-card); border: 1px solid var(--rd-border); border-radius: .65rem; box-shadow: 0 16px 34px rgba(2, 10, 30, .22); }
.rd-period li button { width: 100%; text-align: start; padding: .45rem .65rem; border-radius: .45rem; font-size: .85rem; }
.rd-period li button:hover, .rd-period li button.is-active { background: var(--rd-hover); }

/* headline cards */
.rd-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .875rem; }
.rd-kpi { position: relative; display: flex; align-items: flex-start; gap: 1.25rem; min-height: 7.5rem; padding: 1.1rem 1rem; border-radius: .75rem; overflow: hidden;
    background: linear-gradient(135deg, color-mix(in srgb, var(--tone) 13%, var(--rd-card)), color-mix(in srgb, var(--tone) 5%, var(--rd-card)));
    border: 1px solid color-mix(in srgb, var(--tone) 26%, var(--rd-border)); box-shadow: var(--rd-shadow); transition: transform .15s ease, box-shadow .15s ease; }
html.dark .rd-kpi { background: linear-gradient(135deg, color-mix(in srgb, var(--tone) 52%, var(--rd-bg)), color-mix(in srgb, var(--tone) 18%, var(--rd-card))); border-color: color-mix(in srgb, var(--tone) 45%, var(--rd-border)); }
.rd-kpi:hover { transform: translateY(-2px); }
.rd-kpi-icon { display: grid; place-items: center; flex: none; width: 4.25rem; height: 4.25rem; border-radius: .85rem; color: #fff;
    background: linear-gradient(145deg, color-mix(in srgb, var(--tone) 82%, #fff), var(--tone)); box-shadow: 0 8px 18px color-mix(in srgb, var(--tone) 34%, transparent); }
.rd-kpi-icon .rd-ico { width: 2.35rem; height: 2.35rem; }
.rd-kpi-body { position: relative; z-index: 1; min-width: 0; }
.rd-kpi-body h2 { font-size: .875rem; font-weight: 500; line-height: 1.3; }
.rd-kpi-body strong { display: block; font-size: clamp(1.25rem, 1.65vw, 1.65rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.25; white-space: nowrap; }
.rd-dash small.up { color: #0E9F4F; } .rd-dash small.down { color: var(--rd-red); } .rd-dash small.flat { color: var(--rd-muted); }
html.dark .rd-dash small.up { color: #3BE39A; }
.rd-kpi-body small, .rd-stats small { display: block; margin-top: .35rem; font-size: .875rem; font-weight: 700; }
.rd-spark { position: absolute; inset-inline-end: 0; bottom: 0; width: 56%; height: 3.6rem; }
.rd-spark-line { fill: none; stroke: var(--tone); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.rd-spark-fill { fill: var(--tone); opacity: .16; }
html.dark .rd-spark-line { stroke: color-mix(in srgb, var(--tone) 75%, #fff); }
html.dark .rd-spark-fill { opacity: .28; }

/* rows */
.rd-row { display: grid; gap: .875rem; }
.rd-row-analytics { grid-template-columns: minmax(0, 650fr) minmax(0, 366fr) minmax(0, 336fr); }
.rd-row-lists { grid-template-columns: minmax(0, 650fr) minmax(0, 303fr) minmax(0, 398fr); }
.rd-row-bottom { grid-template-columns: minmax(0, 858fr) minmax(0, 507fr); }

.rd-card { background: var(--rd-card); border: 1px solid var(--rd-border); border-radius: .75rem; box-shadow: var(--rd-shadow); padding: .9rem 1rem; min-width: 0; }
.rd-card > header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .6rem; }
.rd-card h3 { display: flex; align-items: center; gap: .65rem; font-size: 1.1rem; font-weight: 700; letter-spacing: -.01em; }
.rd-card > header > a { font-size: .85rem; font-weight: 600; color: var(--rd-blue); white-space: nowrap; }
html.dark .rd-card > header > a { color: #4DA0FF; }
.rd-badge-ico { display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: .6rem; background: var(--rd-blue); color: #fff; }
.rd-badge-ico .rd-ico { width: 1.15rem; height: 1.15rem; }
.rd-plain-ico { color: var(--rd-blue); display: inline-flex; }
.rd-plain-ico .rd-ico { width: 1.15rem; height: 1.15rem; }

.rd-ranges { display: flex; gap: .3rem; }
.rd-ranges button { min-width: 2.75rem; padding: .3rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--rd-card-2); color: var(--rd-text); }
.rd-ranges button.is-active { background: var(--rd-blue); color: #fff; }
.rd-legend { display: flex; justify-content: flex-end; gap: 1.25rem; font-size: .8rem; font-weight: 500; }
.rd-legend span { display: inline-flex; align-items: center; gap: .45rem; }
.rd-legend span::before { content: ""; width: .75rem; height: .75rem; border-radius: 999px; background: var(--tone); }
.rd-area { width: 100%; height: auto; display: block; }
.rd-grid { stroke: var(--rd-border); stroke-width: 1; }
.rd-tick { stroke: var(--rd-border); }
.rd-axis { fill: var(--rd-text-2); font-size: 11px; font-weight: 500; }
.rd-area-line { fill: none; stroke: var(--tone); stroke-width: 2.25; stroke-linejoin: round; }
.rd-area-fill { fill: var(--tone); opacity: .2; }
html.dark .rd-area-fill { opacity: .45; }
.rd-end { fill: var(--tone); stroke: var(--rd-card); stroke-width: 1.5; }
.rd-hover { fill: transparent; }
.rd-hover:hover { fill: color-mix(in srgb, var(--rd-text) 7%, transparent); }
.rd-empty-note { font-size: .78rem; color: var(--rd-muted); margin-top: .25rem; }

.rd-donut-wrap { display: flex; align-items: center; gap: 1rem; min-height: 11.5rem; }
.rd-donut-box { position: relative; width: 11rem; max-width: 52%; flex: none; }
.rd-donut { width: 100%; height: auto; display: block; }
.rd-donut-track { fill: none; stroke: var(--rd-card-2); stroke-width: 24; }
.rd-slice { fill: none; stroke: var(--tone); stroke-width: 24; }
.rd-donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.rd-donut-center strong { font-size: 2rem; font-weight: 800; line-height: 1; }
.rd-donut-center span { font-size: .72rem; font-weight: 500; margin-top: .25rem; }
.rd-donut-wrap ul { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1.2rem; font-size: .82rem; }
.rd-donut-wrap li { display: flex; align-items: center; gap: .55rem; }
.rd-donut-wrap li i { width: .8rem; height: .8rem; border-radius: 999px; background: var(--tone); flex: none; }
.rd-donut-wrap li span { flex: 1; }

.rd-activity ul { display: flex; flex-direction: column; gap: .55rem; }
.rd-activity li { display: flex; align-items: center; gap: .85rem; }
.rd-activity li > div { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: .85rem; font-weight: 500; line-height: 1.3; }
.rd-activity li small { font-size: .75rem; color: var(--rd-text-2); font-weight: 400; }
.rd-act-icon { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: .7rem; flex: none; background: color-mix(in srgb, var(--tone) 15%, var(--rd-card)); color: var(--tone); }
html.dark .rd-act-icon { background: var(--tone); color: #fff; }
.rd-tag { display: inline-block; padding: .22rem .75rem; border-radius: 999px; font-size: .75rem; font-weight: 600; white-space: nowrap; background: color-mix(in srgb, var(--tone) 15%, var(--rd-card)); color: color-mix(in srgb, var(--tone) 85%, #000); }
html.dark .rd-tag { background: color-mix(in srgb, var(--tone) 45%, var(--rd-card)); color: #fff; }
.rd-empty { color: var(--rd-muted); font-size: .85rem; padding: .5rem 0; }

.rd-table { overflow-x: auto; }
.rd-table table { width: 100%; border-collapse: collapse; font-size: .76rem; }
/* specific enough to win over the shared admin table styles: the reference has plain, unshaded headings */
html[data-taara-theme] .fi-main .rd-dash .rd-table table:not(.fi-ta-table) thead th { text-align: start; font-size: .78rem; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--rd-text-2); background: transparent; padding: .35rem .3rem; border-bottom: 1px solid var(--rd-border); white-space: nowrap; }
html[data-taara-theme] .fi-main .rd-dash .rd-table table:not(.fi-ta-table) tbody td { padding: .45rem .3rem; border-bottom: 1px solid var(--rd-border); background: transparent; white-space: nowrap; font-size: .76rem; font-weight: 500; }
.rd-table td:nth-child(3) { max-width: 6rem; overflow: hidden; text-overflow: ellipsis; }
html[data-taara-theme] .fi-main .rd-dash .rd-table table:not(.fi-ta-table) tbody tr:last-child td { border-bottom: 0; }
.rd-table tbody tr:hover { background: var(--rd-hover); }
.rd-table .rd-tag { padding: .18rem .55rem; }
.rd-svc { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; margin-inline-end: .4rem; border-radius: .45rem; vertical-align: middle; background: color-mix(in srgb, var(--tone) 16%, var(--rd-card)); color: var(--tone); }
html.dark .rd-svc { background: var(--tone); color: #fff; }
.rd-svc .rd-ico { width: 1.05rem; height: 1.05rem; }

.rd-health { position: relative; overflow: hidden; background: linear-gradient(165deg, var(--rd-card) 62%, color-mix(in srgb, var(--rd-emerald) 20%, var(--rd-card))); }
.rd-health-main { display: flex; align-items: center; gap: 1rem; margin-top: .75rem; }
.rd-health-main > span { display: grid; place-items: center; width: 2.9rem; height: 2.9rem; border-radius: 999px; color: #fff; background: var(--rd-emerald); flex: none; }
.rd-health-main.is-warn > span { background: var(--rd-orange); }
.rd-health-main > span svg { width: 1.6rem; height: 1.6rem; }
.rd-health-main b { display: block; font-size: .92rem; color: var(--rd-emerald); }
.rd-health-main.is-warn b { color: var(--rd-orange); }
.rd-health-main small { font-size: .75rem; color: var(--rd-text-2); }
.rd-health-checks { display: flex; flex-wrap: wrap; gap: .4rem .9rem; margin-top: .9rem; font-size: .75rem; color: var(--rd-text-2); }
.rd-health-checks li { display: inline-flex; align-items: center; gap: .35rem; }
.rd-health-checks i { width: .5rem; height: .5rem; border-radius: 999px; background: var(--rd-muted); }
.rd-health-checks i.is-ok { background: var(--rd-emerald); } .rd-health-checks i.is-attention { background: var(--rd-orange); } .rd-health-checks i.is-failing { background: var(--rd-red); }

.rd-promo { position: relative; overflow: hidden; border-radius: .75rem; padding: 1.25rem 1.2rem; color: #fff; min-height: 7.8rem;
    background: radial-gradient(120% 140% at 100% 100%, rgba(133, 59, 255, .75), transparent 60%), linear-gradient(120deg, #1B1FA8, #3428C9 55%, #6B35D9); box-shadow: var(--rd-shadow); }
.rd-promo h3 { font-size: 1.1rem; font-weight: 800; }
.rd-promo p { font-size: .78rem; opacity: .92; margin: .35rem 0 .85rem; max-width: 70%; }
.rd-promo a { position: relative; z-index: 1; display: inline-block; padding: .4rem .95rem; border-radius: 999px; background: #fff; color: #14213D !important; font-size: .8rem; font-weight: 700; }
.rd-rocket { position: absolute; inset-inline-end: 1rem; bottom: .2rem; opacity: .95; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .35)); }
.rd-rocket .rd-ico { width: 6.5rem; height: 6.5rem; }

.rd-stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; }
.rd-stats article { display: flex; align-items: flex-start; gap: .8rem; padding: .85rem .75rem; border-radius: .65rem; background: var(--rd-card-2); border: 1px solid var(--rd-border); min-width: 0; }
html.dark .rd-stats article { border-color: transparent; }
.rd-stats .rd-kpi-icon { width: 3rem; height: 3rem; border-radius: .7rem; }
.rd-stats .rd-kpi-icon .rd-ico { width: 1.7rem; height: 1.7rem; }
.rd-stats h4 { font-size: .82rem; font-weight: 500; line-height: 1.3; }
.rd-stats strong { display: block; font-size: 1.55rem; font-weight: 800; line-height: 1.2; }
.rd-stats small { margin-top: .15rem; font-size: .8rem; }

.rd-top ul { display: flex; flex-direction: column; gap: .55rem; }
.rd-top li { display: flex; align-items: center; gap: .7rem; font-size: .84rem; font-weight: 500; }
.rd-top .rd-svc { margin: 0; width: 1.6rem; height: 1.6rem; background: var(--tone); color: #fff; }
.rd-top-name { width: 6.5rem; }
.rd-bar { flex: 1; height: .55rem; border-radius: 999px; background: var(--rd-card-2); overflow: hidden; }
html.dark .rd-bar { background: color-mix(in srgb, #fff 9%, var(--rd-card)); }
.rd-bar i { display: block; height: 100%; border-radius: 999px; background: var(--tone); }
.rd-top li b { width: 2.8rem; text-align: end; }

/* laptops, tablets, phones: the cards are rearranged, not shrunk */
@media (max-width: 1535px) {
    .rd-row-analytics { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .rd-revenue { grid-column: 1 / -1; }
    .rd-row-lists { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .rd-bookings { grid-column: 1 / -1; }
    .rd-row-bottom { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1280px) { .rd-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .rd-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 768px) {
    .rd-row-analytics, .rd-row-lists, .rd-kpis { grid-template-columns: minmax(0, 1fr); }
    .rd-views { margin-inline-start: 0; order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
    .rd-views a { white-space: nowrap; }
    .rd-period { margin-inline-start: auto; }
    .rd-donut-wrap { flex-wrap: wrap; justify-content: center; }
}
@media (max-width: 480px) { .rd-stat-grid { grid-template-columns: minmax(0, 1fr); } }

/* under any other panel theme the dashboard borrows that theme's colours */
html:not([data-taara-theme="ridey"]) .rd-dash {
    --rd-bg: var(--tk-canvas); --rd-card: var(--tk-card-bg); --rd-card-2: color-mix(in srgb, var(--tk-text) 4%, var(--tk-card-bg)); --rd-border: color-mix(in srgb, var(--tk-text) 12%, transparent);
    --rd-text: var(--tk-text); --rd-text-2: var(--tk-text-soft); --rd-muted: var(--tk-text-soft); --rd-hover: color-mix(in srgb, var(--tk-text) 6%, transparent); --rd-shadow: 0 1px 3px rgba(2, 10, 30, .08);
    --rd-blue: #0875FF; --rd-purple: #853BFF; --rd-emerald: #00B981; --rd-orange: #FF9900; --rd-red: #E5484D;
}
