/* HeatMedia Dashboard — front-end styling
   Huisstijl: rood #DE2918 + warm wit. Display: Sora, body: Hanken Grotesk. */

:root {
    --hm-red: #DE2918;
    --hm-red-dark: #B81F11;
    --hm-ink: #1A1614;
    --hm-paper: #F6F3EF;
    --hm-card: #FFFFFF;
    --hm-line: #ECE7E1;
    --hm-muted: #8C847C;
    --hm-display: 'Sora', sans-serif;
    --hm-body: 'Hanken Grotesk', sans-serif;
    --hm-radius: 16px;
    --hm-shadow: 0 1px 2px rgba(26,22,20,.04), 0 12px 32px rgba(26,22,20,.06);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--hm-paper);
    color: var(--hm-ink);
    font-family: var(--hm-body);
    -webkit-font-smoothing: antialiased;
    font-size: 16px;
    line-height: 1.5;
}

a { color: inherit; }

/* ============================ LOGIN ============================ */

.hm-login {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    min-height: 100vh;
}

/* Linker rode merkpaneel */
.hm-login__brand {
    position: relative;
    overflow: hidden;
    background: var(--hm-red);
    color: #fff;
    padding: 56px 60px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.hm-login__brand::before {
    /* subtiele ruitjes-textuur die de logo-ruit echoot */
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(135deg, rgba(255,255,255,.06) 25%, transparent 25%),
        linear-gradient(225deg, rgba(255,255,255,.06) 25%, transparent 25%);
    background-size: 64px 64px;
    opacity: .5;
    pointer-events: none;
}
.hm-login__brandinner { position: relative; z-index: 1; max-width: 460px; }

.hm-wordmark {
    font-family: var(--hm-display);
    font-weight: 800;
    letter-spacing: .14em;
    font-size: clamp(34px, 4.4vw, 56px);
    line-height: 1;
}
.hm-wordmark span { font-weight: 300; }

.hm-tagline {
    margin: 14px 0 0;
    font-weight: 500;
    letter-spacing: .04em;
    opacity: .85;
}
.hm-login__pitch {
    position: relative;
    z-index: 1;
    max-width: 420px;
    font-size: 18px;
    line-height: 1.6;
    opacity: .92;
}

/* Decoratieve grote ruit met H, rechtsonder */
.hm-diamond {
    position: absolute;
    right: -90px;
    bottom: -90px;
    width: 320px;
    height: 320px;
    border: 3px solid rgba(255,255,255,.25);
    transform: rotate(45deg);
    z-index: 0;
}
.hm-diamond::after {
    content: "H";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    transform: rotate(-45deg);
    font-family: var(--hm-display);
    font-weight: 800;
    font-size: 120px;
    color: rgba(255,255,255,.16);
}

/* Rechter formulierzijde */
.hm-login__form {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 56px 8vw;
    background: var(--hm-card);
}
.hm-login__logo { width: 190px; height: auto; margin-bottom: 40px; border-radius: 6px; }
.hm-login__form h1 {
    font-family: var(--hm-display);
    font-weight: 700;
    font-size: 30px;
    margin: 0 0 6px;
}
.hm-login__form .hm-sub { color: var(--hm-muted); margin: 0 0 28px; }

.hm-field { margin-bottom: 18px; }
.hm-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .02em;
    margin-bottom: 7px;
    color: #5b544d;
}
.hm-field input {
    width: 100%;
    padding: 13px 15px;
    font-family: var(--hm-body);
    font-size: 16px;
    border: 1.5px solid var(--hm-line);
    border-radius: 11px;
    background: #fbfaf8;
    transition: border-color .15s, box-shadow .15s;
}
.hm-field input:focus {
    outline: none;
    border-color: var(--hm-red);
    box-shadow: 0 0 0 4px rgba(222,41,24,.12);
    background: #fff;
}

.hm-btn {
    width: 100%;
    border: 0;
    cursor: pointer;
    padding: 14px 18px;
    border-radius: 11px;
    background: var(--hm-ink);
    color: #fff;
    font-family: var(--hm-display);
    font-weight: 600;
    font-size: 16px;
    letter-spacing: .01em;
    transition: transform .12s, background .15s;
}
.hm-btn:hover { background: #000; transform: translateY(-1px); }

.hm-error {
    background: #fdecea;
    border: 1px solid #f5c4be;
    color: #a01b0f;
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 20px;
}
.hm-login__help { margin-top: 26px; font-size: 14px; color: var(--hm-muted); }

/* ============================ DASHBOARD ============================ */

.hm-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 28px;
    background: var(--hm-card);
    border-bottom: 1px solid var(--hm-line);
    position: sticky;
    top: 0;
    z-index: 10;
}
.hm-top__logo { height: 34px; width: auto; border-radius: 4px; display: block; }
.hm-top__right { display: flex; align-items: center; gap: 18px; }
.hm-top__client { font-weight: 600; }
.hm-top__logout {
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--hm-red);
    padding: 7px 14px;
    border: 1.5px solid var(--hm-line);
    border-radius: 9px;
    transition: border-color .15s, background .15s;
}
.hm-top__logout:hover { border-color: var(--hm-red); background: #fdf1ef; }

.hm-wrap { max-width: 1120px; margin: 0 auto; padding: 44px 28px 80px; }

.hm-intro { margin-bottom: 36px; }
.hm-eyebrow {
    text-transform: uppercase;
    letter-spacing: .18em;
    font-size: 12px;
    font-weight: 700;
    color: var(--hm-red);
    margin: 0 0 10px;
}
.hm-intro h1 {
    font-family: var(--hm-display);
    font-weight: 700;
    font-size: clamp(26px, 3.4vw, 38px);
    margin: 0 0 8px;
    letter-spacing: -.01em;
}
.hm-lead { color: var(--hm-muted); max-width: 560px; margin: 0; font-size: 17px; }

.hm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.hm-card {
    background: var(--hm-card);
    border: 1px solid var(--hm-line);
    border-radius: var(--hm-radius);
    padding: 22px 22px 18px;
    box-shadow: var(--hm-shadow);
    opacity: 0;
    transform: translateY(10px);
    animation: hm-rise .5s cubic-bezier(.2,.7,.2,1) forwards;
    animation-delay: calc(var(--i, 0) * 70ms);
}
@keyframes hm-rise { to { opacity: 1; transform: none; } }

.hm-card__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.hm-card__id { display: flex; align-items: center; gap: 13px; }
.hm-card__mark {
    width: 42px; height: 42px;
    display: grid; place-items: center;
    border-radius: 11px;
    background: #fdf1ef;
    color: var(--hm-red);
    font-family: var(--hm-display);
    font-weight: 700;
    font-size: 18px;
}
.hm-card__id h3 { font-family: var(--hm-display); font-weight: 600; font-size: 16px; margin: 0; }
.hm-card__sub { margin: 1px 0 0; font-size: 13px; color: var(--hm-muted); }

.hm-pill {
    font-size: 12px;
    font-weight: 600;
    padding: 5px 11px;
    border-radius: 100px;
    white-space: nowrap;
}
.hm-pill--connected { background: #e7f6ec; color: #1a7f37; }
.hm-pill--disconnected { background: #f1eee9; color: #8c847c; }
.hm-pill--error { background: #fdecea; color: #b32d2e; }

.hm-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    border-top: 1px solid var(--hm-line);
    padding-top: 16px;
}
.hm-metric { text-align: left; }
.hm-metric__val {
    display: block;
    font-family: var(--hm-display);
    font-weight: 700;
    font-size: 22px;
    color: var(--hm-ink);
    letter-spacing: -.02em;
}
.hm-metric__label {
    display: block;
    font-size: 12px;
    color: var(--hm-muted);
    margin-top: 2px;
}

.hm-empty {
    background: var(--hm-card);
    border: 1px dashed var(--hm-line);
    border-radius: var(--hm-radius);
    padding: 48px 28px;
    text-align: center;
    color: var(--hm-muted);
}
.hm-empty strong { color: var(--hm-ink); display: block; font-family: var(--hm-display); margin-bottom: 6px; }

.hm-note {
    max-width: 520px;
    margin: 12vh auto;
    text-align: center;
    padding: 0 24px;
}
.hm-note img { width: 200px; border-radius: 6px; margin-bottom: 24px; }

/* ============================ RESPONSIVE ============================ */

@media (max-width: 880px) {
    .hm-login { grid-template-columns: 1fr; }
    .hm-login__brand { padding: 40px 32px; min-height: 280px; }
    .hm-login__form { padding: 40px 32px; }
    .hm-diamond { right: -120px; bottom: -120px; width: 240px; height: 240px; }
    .hm-metrics { grid-template-columns: repeat(3, 1fr); }
}

/* ============================ CONTROLS / COMPARE / PANELS ============================ */

.hm-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 0 26px;
    padding: 14px 16px;
    background: var(--hm-card);
    border: 1px solid var(--hm-line);
    border-radius: 12px;
}
.hm-controls select,
.hm-controls input[type="date"] {
    font-family: var(--hm-body);
    font-size: 14px;
    padding: 9px 11px;
    border: 1.5px solid var(--hm-line);
    border-radius: 9px;
    background: #fbfaf8;
}
.hm-controls__custom { display: flex; align-items: center; gap: 8px; color: var(--hm-muted); font-size: 14px; }
.hm-controls button {
    border: 0; cursor: pointer;
    background: var(--hm-ink); color: #fff;
    font-family: var(--hm-display); font-weight: 600; font-size: 14px;
    padding: 9px 16px; border-radius: 9px;
}
.hm-controls__note { margin-left: auto; font-size: 13px; color: var(--hm-muted); }

.hm-metric { position: relative; }
.hm-delta {
    display: inline-block;
    margin-top: 4px;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 100px;
}
.hm-delta--up   { background: #e7f6ec; color: #1a7f37; }
.hm-delta--down { background: #fdecea; color: #b32d2e; }
.hm-delta--flat { background: #f1eee9; color: #8C847C; }

.hm-panel {
    background: var(--hm-card);
    border: 1px solid var(--hm-line);
    border-radius: var(--hm-radius);
    padding: 20px 22px;
    box-shadow: var(--hm-shadow);
    margin-top: 20px;
}
.hm-panel h2 {
    font-family: var(--hm-display);
    font-weight: 600;
    font-size: 17px;
    margin: 0 0 14px;
    display: flex;
    align-items: baseline;
    gap: 10px;
}
.hm-panel__src { font-family: var(--hm-body); font-size: 12px; font-weight: 600; color: var(--hm-red); text-transform: uppercase; letter-spacing: .1em; }
.hm-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.hm-table th {
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--hm-muted);
    font-weight: 600;
    padding: 0 0 10px;
    border-bottom: 1px solid var(--hm-line);
}
.hm-table th + th, .hm-table td + td { text-align: right; }
.hm-table td { padding: 11px 0; border-bottom: 1px solid #f4f1ec; }
.hm-table tr:last-child td { border-bottom: 0; }

/* ============================ CHARTS ============================ */

.hm-chart {
    background: var(--hm-card);
    border: 1px solid var(--hm-line);
    border-radius: var(--hm-radius);
    padding: 20px 22px;
    box-shadow: var(--hm-shadow);
    margin-top: 20px;
}
.hm-chart__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}
.hm-chart__head h2 {
    font-family: var(--hm-display);
    font-weight: 600;
    font-size: 17px;
    margin: 0;
    display: flex;
    align-items: baseline;
    gap: 10px;
}
.hm-chart__src { font-family: var(--hm-body); font-size: 12px; font-weight: 600; color: var(--hm-red); text-transform: uppercase; letter-spacing: .1em; }
.hm-chart__controls { display: flex; gap: 8px; }
.hm-chart__controls select {
    font-family: var(--hm-body);
    font-size: 14px;
    padding: 8px 11px;
    border: 1.5px solid var(--hm-line);
    border-radius: 9px;
    background: #fbfaf8;
}
.hm-chart__canvas { position: relative; height: 300px; }

/* ============================ TILES / DETAIL ============================ */

.hm-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}
.hm-tile {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--hm-card);
    border: 1px solid var(--hm-line);
    border-radius: var(--hm-radius);
    padding: 20px 20px 16px;
    box-shadow: var(--hm-shadow);
    transition: transform .14s, box-shadow .14s, border-color .14s;
    opacity: 0;
    transform: translateY(10px);
    animation: hm-rise .5s cubic-bezier(.2,.7,.2,1) forwards;
    animation-delay: calc(var(--i, 0) * 70ms);
}
.hm-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 1px 2px rgba(26,22,20,.05), 0 18px 40px rgba(26,22,20,.10);
    border-color: #e3ddd5;
}
.hm-tile__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.hm-tile h3 { font-family: var(--hm-display); font-weight: 600; font-size: 18px; margin: 0 0 12px; }
.hm-tile__kpi { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.hm-tile__val { font-family: var(--hm-display); font-weight: 700; font-size: 28px; letter-spacing: -.02em; }
.hm-tile__lbl { font-size: 13px; color: var(--hm-muted); }
.hm-tile__more { display: block; margin-top: 16px; font-size: 13px; font-weight: 600; color: var(--hm-red); }

.hm-back { margin: 0 0 6px; }
.hm-back a { color: var(--hm-muted); text-decoration: none; font-size: 14px; font-weight: 600; }
.hm-back a:hover { color: var(--hm-ink); }
