/* Toppoint brand theme — derived from toppoint.eu
   Palette: grey #7A7C7F, near-black #121110, text #252526,
   warm light grey #E9E6E2, white. Font: Poppins. Squared corners. */

:root {
    --tp-grey: #7a7c7f;
    --tp-grey-dark: #252526;
    --tp-black: #121110;
    --tp-sand: #e9e6e2;
    --tp-light: #f2f2f2;

    /* Map onto Bootstrap */
    --bs-primary: var(--tp-black);
    --bs-primary-rgb: 18, 17, 16;
    --bs-secondary: var(--tp-grey);
    --bs-secondary-rgb: 122, 124, 127;
    --bs-body-color: var(--tp-grey-dark);
    --bs-body-color-rgb: 37, 37, 38;
    --bs-body-font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
    --bs-body-font-weight: 400;
    --bs-body-line-height: 1.56;
    --bs-border-radius: 0;
    --bs-border-radius-sm: 0;
    --bs-border-radius-lg: 0;
    --bs-link-color: var(--tp-black);
    --bs-link-color-rgb: 18, 17, 16;
    --bs-link-hover-color: var(--tp-grey);
}

body {
    background-color: #fff;
    color: var(--tp-grey-dark);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Spacing under navbar + comfortable reading width */
main.container {
    max-width: 860px;
    padding-top: 2.5rem;
    padding-bottom: 4rem;
}

main.container.logs-wide {
    max-width: 1320px;
}

/* TV board (/statistieken/bord): full-bleed, and a bumped root scale so every
   rem-sized label/value below is ~25% larger than the desk-monitor default —
   this is viewed from several meters away, not from an arm's length.
   overflow: hidden on `main` alone only clips overflow inside main — if the
   document (body/html) itself ends up even a few px taller than the viewport,
   the PAGE still scrolls regardless. Scoped to body.bord-page (set via the
   body_class block) so other pages that legitimately need to scroll aren't affected. */
html:has(body.bord-page),
body.bord-page {
    height: 100%;
    overflow: hidden;
}

main.container.bord-full {
    max-width: 100%;
    padding: 1.5rem 2.5rem 2rem;
    font-size: 1.25rem;
    /* A hard cap, not a minimum — min-height would let content grow past the
       viewport and force a scrollbar, which a kiosk screen should never have.
       overflow: hidden is the backstop if content still asks for more than fits. */
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* The header and stat-tile row stay their natural height; this row (the two
   charts) grows to absorb whatever vertical space is left, so the board
   always fills the screen instead of leaving a blank band at the bottom.
   min-height: 0 overrides the flex default (which sizes to content and would
   otherwise force the fixed-height ancestor above to overflow instead of
   letting this actually shrink to fit). */
.bord-fill {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.bord-charts-row {
    flex: 1 1 auto;
    min-height: 0;
}

.bord-charts-row > [class*="col-"] {
    min-height: 0;
    display: flex;
}

/* Header row: logo + date stacked on the left, hero figure on the right. */
.bord-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.bord-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.bord-full .bord-logo {
    height: 3.5rem;
    width: auto;
    display: block;
}

.bord-full .bord-date {
    font-size: 2.25rem;
    font-weight: 600;
    color: var(--tp-black);
    text-transform: capitalize;
}

/* Hero figure: the one number this board leads with — exactly one, sized well
   above every other number on the screen so it reads instantly from across a room. */
.bord-hero {
    background: var(--tp-sand);
    padding: 1.5rem 2rem;
}

.bord-hero .bord-hero-label {
    font-size: 1.2rem;
    line-height: 1.25;
    color: var(--tp-grey-dark);
}

.bord-hero .bord-hero-value {
    font-size: 5.5rem;
    font-weight: 700;
    line-height: 1;
    color: var(--tp-black);
    font-variant-numeric: proportional-nums;
}

/* Stat tiles: icon + label, big value, optional delta, decorative week sparkline */
.bord-tile {
    border: 1px solid #e7e7e7;
    padding: 1.25rem 1.25rem 0.75rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.bord-tile-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.bord-tile-icon {
    color: var(--tp-grey);
    display: inline-flex;
    flex-shrink: 0;
}

.bord-tile .bord-tile-label {
    font-size: 1.05rem;
    color: var(--tp-grey);
    line-height: 1.2;
}

.bord-tile .bord-tile-value {
    font-size: 3.25rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--tp-black);
    font-variant-numeric: proportional-nums;
}

.bord-tile .bord-tile-delta {
    font-size: 1.05rem;
    font-weight: 600;
}

.bord-tile .bord-tile-delta.is-up { color: var(--tp-black); }
.bord-tile .bord-tile-delta.is-down { color: var(--tp-grey); }
.bord-tile .bord-tile-delta.is-flat { color: var(--tp-grey); }

.bord-tile .bord-tile-week {
    font-size: 0.95rem;
    color: var(--tp-grey);
    margin-top: auto;
}

.bord-full h2 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

/* The card itself becomes a flex column so the chart wrapper can take
   "whatever's left after the h2" via flex, rather than height:100% of the
   whole card (which would double-count the h2's height and overflow it). */
.bord-chart-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
}

.bord-chart-tall {
    position: relative;
    flex: 1 1 auto;
    min-height: 16rem;
}

.navbar {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

/* Squared corners everywhere */
.btn, .card, .form-control, .alert, .dropdown-menu {
    border-radius: 0 !important;
}

/* Headings: bold Poppins, near-black */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-weight: 600;
    color: var(--tp-black);
}

/* Navbar */
.navbar {
    background-color: #fff;
}
.navbar-brand img {
    height: 38px;
    width: auto;
    display: block;
}

/* Primary button = near-black, grey on hover (matches toppoint.eu) */
.btn-primary {
    --bs-btn-bg: var(--tp-black);
    --bs-btn-border-color: var(--tp-black);
    --bs-btn-hover-bg: var(--tp-grey);
    --bs-btn-hover-border-color: var(--tp-grey);
    --bs-btn-active-bg: var(--tp-grey);
    --bs-btn-active-border-color: var(--tp-grey);
}

.btn-outline-primary {
    --bs-btn-color: var(--tp-black);
    --bs-btn-border-color: var(--tp-black);
    --bs-btn-hover-bg: var(--tp-grey);
    --bs-btn-hover-border-color: var(--tp-grey);
    --bs-btn-hover-color: #fff;
}

.btn-outline-secondary {
    --bs-btn-color: var(--tp-grey);
    --bs-btn-border-color: var(--tp-grey);
    --bs-btn-hover-bg: var(--tp-grey);
    --bs-btn-hover-border-color: var(--tp-grey);
}

/* Cards: subtle, on warm-grey page sections */
.card {
    border-color: #e7e7e7;
}

/* Optional warm section background utility */
.bg-sand { background-color: var(--tp-sand) !important; }

/* Markdown-rendered chat answers: trim outer margins, keep readable spacing */
.chat-md > :first-child { margin-top: 0; }
.chat-md > :last-child { margin-bottom: 0; }
.chat-md ul, .chat-md ol { margin-bottom: 0.5rem; padding-left: 1.25rem; }
.chat-md p { margin-bottom: 0.5rem; }
.chat-md code { background: rgba(0,0,0,0.06); padding: 0.1em 0.3em; }
