:root {
    --ink: #16181d;
    --muted: #6b7280;
    --line: #e3e6ea;
    --bg: #f6f7f9;
    --card: #fff;
    --accent: #1428a0;      /* Samsung blue */
    --warn: #b45309;
    --err: #b91c1c;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font: 15px/1.5 -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ---- login ---- */
.login {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
}
.loginCard {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 32px;
    width: 340px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}
.loginCard h1 { margin: 0 0 4px; font-size: 22px; }
.loginCard p { margin: 0 0 20px; }

/* ---- chrome ---- */
header {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--card);
    border-bottom: 1px solid var(--line);
    padding: 12px 24px;
    position: sticky;
    top: 0;
    z-index: 5;
}
header strong { color: var(--accent); }
nav { display: flex; gap: 16px; }
nav a { color: var(--ink); text-decoration: none; padding: 4px 0; }
nav a:hover { color: var(--accent); border-bottom: 2px solid var(--accent); }
.spacer { flex: 1; }

main { padding: 24px; max-width: 1400px; margin: 0 auto; }
footer { text-align: center; color: var(--muted); padding: 28px; font-size: 13px; line-height: 1.8; }
footer a, .foot a { color: var(--muted); text-decoration: none; }
footer a:hover, .foot a:hover { text-decoration: underline; }

.bar {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin: 28px 0 10px;
}
.bar h2, .bar h3 { margin: 0; }

/* ---- tables ---- */
table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #fafbfc; font-weight: 600; font-size: 13px; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
td.detail { font-family: ui-monospace, Consolas, monospace; font-size: 11px; color: var(--muted); word-break: break-all; }

/* ---- cards + forms ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 18px; }
.card h3 { margin: 0 0 14px; font-size: 15px; }

label { display: block; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
label.check { display: flex; align-items: center; gap: 8px; }
input, select {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font: inherit;
    background: #fff;
    color: var(--ink);
}
label.check input { width: auto; margin: 0; }

button {
    background: var(--accent);
    color: #fff;
    border: 0;
    border-radius: 6px;
    padding: 8px 16px;
    font: inherit;
    cursor: pointer;
}
button:hover { opacity: .9; }
button.link, .link {
    background: none;
    color: var(--accent);
    padding: 0;
    text-decoration: none;
    cursor: pointer;
    border: 0;
    font: inherit;
}

dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; font-size: 13px; }
dt { color: var(--muted); }
dd { margin: 0; word-break: break-all; }

/* ---- bits ---- */
.msg { font-size: 13px; color: var(--muted); margin-top: 8px; min-height: 18px; }
.error { color: var(--err); font-size: 13px; margin-top: 10px; min-height: 18px; }
.warn {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    color: var(--warn);
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 13px;
    margin-top: 12px;
}
.pill {
    display: inline-block;
    background: #eef1f5;
    color: var(--muted);
    border-radius: 20px;
    padding: 1px 9px;
    font-size: 11px;
}
.warnPill { background: #fef3c7; color: var(--warn); }
.errPill { background: #fee2e2; color: var(--err); }

.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
figure { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
figcaption { font-size: 13px; margin-top: 8px; }
img.thumb { width: 100%; border: 1px solid var(--line); border-radius: 4px; display: block; background: #fff; }

/* ---- radios ---- */
.radioMode { margin-bottom: 12px; font-size: 13px; }
.radio { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13px; }
.radio:first-of-type { border-top: 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 10px; margin-top: 5px; }
.dotOn { background: #16a34a; }
.dotOff { background: #cbd5e1; }
.dotUnknown { background: #fbbf24; }

/* ---- sleep-mode buttons ---- */
.modeRow { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.modeRow button { flex: 1; min-width: 96px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }

.removeImg { margin-top: 6px; font-size: 12px; }
figcaption { position: relative; }

.diag { margin-top: 4px; font-size: 12px; color: var(--warn); background: #fffbeb; border: 1px solid #fcd34d; border-radius: 4px; padding: 5px 7px; }
