/* Admin site of the Farm heating: black with Farm orange, like the tablet. */
:root {
    --black: #000000;
    --orange: #F37022;
    --orange-soft: #f5a25d;
    --green: #8de855;
    --gray100: #E1E1E1;
    --gray200: #C8C8C8;
    --gray300: #ACACAC;
    --gray400: #919191;
    --gray500: #6E6E6E;
    --gray600: #404040;
    --gray900: #212121;
    --gray950: #141414;
    --red: #e5534b;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    background: var(--black);
    color: var(--gray100);
    font-family: "Open Sans", "Segoe UI", Arial, sans-serif;
    font-size: 15px;
}

a { color: var(--orange); }
code, pre { font-family: Consolas, "Cascadia Mono", monospace; }
h1 { margin: 0 0 1rem; font-weight: 600; }
h2 { margin: 0 0 .75rem; font-size: 1.2rem; color: var(--orange); }
h3 { margin: 1.25rem 0 .5rem; font-size: 1rem; }
small { color: var(--gray400); }

.shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 220px;
    background: var(--gray950);
    border-right: 1px solid var(--gray600);
    display: flex;
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
}

.brand { display: flex; flex-direction: column; gap: .5rem; text-decoration: none; color: var(--gray100); font-weight: 600; }
.brand img { width: 100%; border-radius: 8px; }

.sidebar nav { display: flex; flex-direction: column; gap: .25rem; }
.sidebar nav a { color: var(--gray200); text-decoration: none; padding: .5rem .75rem; border-radius: 8px; }
.sidebar nav a:hover { background: var(--gray900); }
.sidebar nav a.active { background: var(--orange); color: var(--black); font-weight: 600; }

.user { margin-top: auto; display: flex; flex-direction: column; gap: .25rem; color: var(--gray300); }

.content { flex: 1; padding: 1.5rem 2rem; max-width: 1400px; }

.card {
    background: var(--gray950);
    border: 1px solid var(--gray600);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}
.card.highlight { border-color: var(--orange); }
.card.chart { height: 420px; display: flex; flex-direction: column; }
.card.chart canvas { flex: 1; min-height: 0; }

.spaces { display: grid; grid-template-columns: repeat(auto-fit, minmax(520px, 1fr)); gap: 1rem; }
.space header { display: flex; align-items: center; gap: 1rem; }
.space header h2 { margin: 0; flex: 1; }
.space.on { border-color: var(--orange); }
.big { font-size: 2rem; font-weight: 600; }
.status { font-size: 1.05rem; color: var(--gray100); }
.target { display: flex; align-items: center; gap: .75rem; margin: .5rem 0 1rem; }
.target span { font-size: 1.5rem; min-width: 5rem; text-align: center; }

button, .button {
    background: var(--orange);
    color: var(--black);
    border: none;
    border-radius: 8px;
    padding: .5rem 1rem;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}
button:disabled { opacity: .4; cursor: default; }
button.secondary, .button.secondary { background: var(--gray600); color: var(--gray100); }
button.small { padding: .2rem .6rem; font-size: .85rem; }
button.small.on { background: var(--green); color: var(--black); }
button.link { background: none; color: var(--orange); padding: 0; font-weight: normal; }
button.toggle { min-width: 5rem; background: var(--gray600); color: var(--gray100); }
button.toggle.on { background: var(--green); color: var(--black); }

input, select {
    background: var(--gray900);
    color: var(--gray100);
    border: 1px solid var(--gray500);
    border-radius: 6px;
    padding: .4rem .5rem;
    font: inherit;
}
input.wide { flex: 1; min-width: 300px; }
input[type=checkbox] { width: 1.1rem; height: 1.1rem; accent-color: var(--orange); }

label { display: flex; flex-direction: column; gap: .25rem; margin-bottom: .5rem; }
label.check { flex-direction: row; align-items: center; gap: .5rem; }
.form-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem; margin-bottom: 1rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .5rem 1.5rem; }
form.inline { display: inline-block; margin-right: .5rem; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--gray300); font-weight: 600; border-bottom: 1px solid var(--gray600); padding: .4rem; }
td { border-bottom: 1px solid var(--gray900); padding: .4rem; vertical-align: top; }
td.reason { color: var(--gray300); font-size: .9rem; }
table.log tr.fault td, table.log tr.alert td { color: var(--orange-soft); }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: .2rem 1rem; margin: 0 0 1rem; }
.facts dt { color: var(--gray400); }
.facts dd { margin: 0; }
.notes { color: var(--gray200); padding-left: 1.2rem; }

.health { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.pill { border-radius: 999px; padding: .2rem .75rem; background: var(--gray900); border: 1px solid var(--gray600); font-size: .85rem; }
.pill.healthy { border-color: var(--green); }
.pill.degraded { border-color: var(--orange); }
.pill.unhealthy { border-color: var(--red); color: var(--red); }

.state { padding: .1rem .5rem; border-radius: 6px; background: var(--gray900); }
.state.heating { background: var(--orange); color: var(--black); }
.state.circulating { background: var(--gray600); }
.state.defrosting { background: #5aa9e6; color: var(--black); }
.state.fault { background: var(--red); color: var(--black); }
.state.manual { background: var(--orange-soft); color: var(--black); }

.error { color: var(--red); }
.warning { color: var(--orange-soft); }
.notice { color: var(--green); }
pre.codes { background: var(--gray900); padding: .75rem; border-radius: 8px; user-select: all; white-space: pre-wrap; word-break: break-all; }
img.qr { background: white; padding: .5rem; border-radius: 8px; width: 220px; }

.account { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.account-card { width: 100%; max-width: 420px; background: var(--gray950); border: 16px solid var(--orange); border-radius: 20px; padding: 1.5rem; }
.account-card .logo { width: 100%; border-radius: 8px; }
.account-card h2 { text-align: center; }
.account-card input:not([type=checkbox]) { width: 100%; }

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--red);
    color: var(--black);
    padding: .75rem 1.25rem;
    z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 1rem; }

@media (max-width: 800px) {
    .shell { flex-direction: column; }
    .sidebar { width: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
    .brand img { width: 120px; }
    .sidebar nav { flex-direction: row; flex-wrap: wrap; }
    .user { margin-top: 0; }
    .content { padding: 1rem; }
    .spaces { grid-template-columns: 1fr; }
}
