/* App-level patterns shared by many pages (page header, stat tiles, dashboards, bid markers).
   Page-only styling belongs in the page's scoped .razor.css, using tokens. */

/* ---------- Page header: large light title, muted subtitle, actions on the right ---------- */
.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--ap-space-3) var(--ap-space-5);
    margin-bottom: var(--ap-space-5);
}
.page-header h1, .page-header .page-title {
    font-size: var(--ap-text-2xl);
    margin: 0;
}
.page-header .page-subtitle { color: var(--ap-ink-muted); margin: var(--ap-space-1) 0 0; }
.eyebrow {
    font-size: var(--ap-text-xs);
    font-weight: var(--ap-weight-strong);
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ap-accent);
}

/* ---------- Surfaces ---------- */
.surface {
    background: var(--ap-surface);
    border: 1px solid var(--ap-line);
    border-radius: var(--ap-radius);
    box-shadow: var(--ap-shadow-1);
}
.card-interactive, a.card {
    transition: transform var(--ap-dur) var(--ap-ease), box-shadow var(--ap-dur) var(--ap-ease), border-color var(--ap-dur) var(--ap-ease);
}
.card-interactive:hover, a.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--ap-shadow-2);
    border-color: var(--ap-line-strong);
}

/* ---------- Stat tile ---------- */
.stat-tile { padding: var(--ap-space-4) var(--ap-space-5); }
.stat-tile .stat-label { font-size: var(--ap-text-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--ap-ink-muted); font-weight: var(--ap-weight-strong); }
.stat-tile .stat-value { font-family: var(--ap-font-heading); font-size: var(--ap-text-xl); font-weight: var(--ap-weight-heading); letter-spacing: var(--ap-tracking-heading); font-variant-numeric: tabular-nums; }

/* ---------- Live marker: the one place cognac appears ---------- */
.live-dot {
    display: inline-block;
    width: .5rem;
    height: .5rem;
    border-radius: 50%;
    background: var(--ap-live);
    animation: ap-pulse 2s var(--ap-ease) infinite;
    vertical-align: middle;
}
.text-live { color: var(--ap-live) !important; }

/* ---------- Bid markers ---------- */
/* Flagged bid rows (only rendered for users allowed to see suspicion data): left stripe + the badge in the row. */
.e-grid .e-row.bid-row-flagged td:first-child,
tr.bid-row-flagged td:first-child {
    box-shadow: inset 4px 0 0 var(--ap-warning-fill);
}
.text-suspicious { color: var(--ap-suspicious) !important; }
.bg-suspicious-soft { background: var(--ap-suspicious-soft) !important; }
.text-house { color: var(--ap-house) !important; }
.bg-house-soft { background: var(--ap-house-soft) !important; }

/* ---------- Configurable dashboards (Components/Dashboards). Panels fill their SfDashboardLayout cell. ---------- */
.dash .e-dashboardlayout.e-control .e-panel .e-panel-container .e-panel-header {
    padding: 0;
    height: auto;
}
.dash-panel-header {
    display: flex;
    align-items: center;
    gap: .35rem;
    padding: .55rem .85rem;
    font-family: var(--ap-font-heading);
    font-weight: var(--ap-weight-strong);
    font-size: var(--ap-text-sm);
    border-bottom: 1px solid var(--ap-line);
    min-width: 0;
}
.dash-panel-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-editing .dash-panel-header { cursor: move; background: var(--ap-surface-2); }
.dash .e-panel-content { height: calc(100% - 2.4rem) !important; }
.dash-panel-body { height: 100%; overflow: hidden; }
.dash-panel-state {
    height: 100%;
    min-height: 6rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    font-size: var(--ap-text-sm);
    color: var(--ap-ink-muted);
}
.dash-empty {
    border: 1px dashed var(--ap-line-strong);
    border-radius: var(--ap-radius);
    padding: 1.5rem;
    text-align: center;
    color: var(--ap-ink-muted);
}
.dash-editing .e-dashboardlayout { outline: 1px dashed var(--ap-line-strong); outline-offset: 4px; }
.dash-choice { flex: 1; border: 1px solid var(--ap-line); border-radius: var(--ap-radius); }
.dash-choice.active { border-color: var(--ap-accent); background: var(--ap-accent-soft); }
/* Syncfusion lets template cells overflow; clip them like plain cells (full text in the ellipsis tooltip). */
.dash .e-grid td.e-rowcell.e-templatecell { overflow: hidden !important; text-overflow: ellipsis; white-space: nowrap; }
/* Inside a panel the grid is already framed by the panel card. */
.dash .e-grid { border: 0; border-radius: 0; }
/* Stacked (phone) layout: SfDashboardLayout computes huge heights from its cell maths there, so the panels
   flow normally at a fixed height instead. */
@media (max-width: 768px) {
    .dash .e-dashboardlayout.e-control { height: auto !important; }
    .dash .e-dashboardlayout .e-panel {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        width: 100% !important;
        height: 360px !important;
        margin-bottom: 12px;
    }
}
/* Chart panel: measured by size-watch.js; the chart is drawn at exactly this size. */
.dash-chart { height: 100%; width: 100%; overflow: hidden; }

/* ---------- Cookie banner (Components/Shared/CookieBanner.razor) ----------
   A consent card docked bottom-left like most consent dialogs; it does not block the page. Accept and reject
   share one style on purpose (no nudging, the-registrar). */
.cookie-banner {
    position: fixed;
    left: var(--ap-space-4);
    bottom: var(--ap-space-4);
    z-index: 1080;
    width: min(460px, calc(100vw - 2 * var(--ap-space-4)));
    max-height: calc(100vh - 2 * var(--ap-space-4));
    overflow-y: auto;
    background: var(--ap-surface);
    color: var(--ap-ink);
    border: 1px solid var(--ap-line);
    border-radius: var(--ap-radius-lg);
    box-shadow: var(--ap-shadow-3);
    padding: var(--ap-space-5);
    animation: ap-page-enter var(--ap-dur-slow) var(--ap-ease-out) both;
}
.cookie-banner-head { display: flex; gap: var(--ap-space-3); align-items: flex-start; }
.cookie-banner-icon { font-size: 1.5rem; line-height: 1; color: var(--ap-accent); }
.cookie-banner-title {
    font-family: var(--ap-font-heading);
    font-weight: var(--ap-weight-strong);
    font-size: var(--ap-text-md);
    margin: 0 0 var(--ap-space-1);
}
.cookie-banner-intro { font-size: var(--ap-text-sm); color: var(--ap-ink-muted); margin: 0; }
.cookie-banner-groups { display: grid; gap: var(--ap-space-2); margin: var(--ap-space-4) 0; }
.cookie-group {
    background: var(--ap-surface-2);
    border: 1px solid var(--ap-line);
    border-radius: var(--ap-radius);
    padding: var(--ap-space-3);
}
.cookie-group-head { display: flex; align-items: center; justify-content: space-between; gap: var(--ap-space-2); }
.cookie-group-head .form-switch { display: flex; align-items: center; gap: var(--ap-space-2); padding-left: 0; }
.cookie-group-head .form-switch .form-check-input { margin: 0; float: none; cursor: pointer; }
.cookie-group-name { font-weight: var(--ap-weight-strong); font-size: var(--ap-text-sm); margin: 0; cursor: default; }
label.cookie-group-name { cursor: pointer; }
.cookie-group-state { font-size: var(--ap-text-xs); color: var(--ap-ink-muted); white-space: nowrap; }
.cookie-group-desc { font-size: var(--ap-text-xs); color: var(--ap-ink-muted); margin: var(--ap-space-1) 0; }
.cookie-group-list { font-size: var(--ap-text-sm); margin: 0; padding-left: var(--ap-space-5); }
.cookie-new {
    font-size: var(--ap-text-xs);
    font-weight: var(--ap-weight-strong);
    color: var(--ap-accent-ink);
    background: var(--ap-accent);
    border-radius: var(--ap-radius-pill);
    padding: 0 var(--ap-space-2);
    margin-left: var(--ap-space-1);
}
.cookie-banner-foot { display: flex; flex-direction: column; gap: var(--ap-space-3); }
.cookie-banner-link { font-size: var(--ap-text-sm); }
.cookie-banner-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--ap-space-2); }
.cookie-banner-actions .btn:only-child { grid-column: 1 / -1; }
@media (max-width: 420px) {
    .cookie-banner { left: var(--ap-space-2); bottom: var(--ap-space-2); width: calc(100vw - 2 * var(--ap-space-2)); padding: var(--ap-space-4); }
    .cookie-banner-actions { grid-template-columns: 1fr; }
}
/* /privacy settings card reuses the banner groups. */
.cookie-settings { max-width: 640px; }

/* "..." button that opens a record's context menu (docs/design/context-menus.md). Quiet in a row, a full touch
   target below desktop (couturier rule 9). */
.ap-row-menu {
    color: inherit;
    padding: 0 var(--ap-space-1);
    line-height: 1;
    text-decoration: none;
}
.ap-row-menu:hover, .ap-row-menu:focus-visible { color: var(--ap-accent); }
@media (max-width: 1199.98px) {
    .ap-row-menu { min-width: 2.5rem; min-height: 2.5rem; }
}
