/* Hue ovládanie – mobile-first, tmavá téma */
:root { --bg: #0f1115; --card: #171a21; --line: #262a33; --muted: #8b93a3; --accent: #fbbf24; }
body { background: var(--bg); font-size: 15px; -webkit-tap-highlight-color: transparent; }
.page { max-width: 760px; margin: 0 auto; padding: 16px 14px 24px; }
.page.with-nav { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
.card { background: var(--card); border-color: var(--line); border-radius: 16px; }
a { color: var(--accent); }

.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px; padding: 10px 16px; background: rgba(15, 17, 21, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { font-weight: 800; color: #fff; text-decoration: none; font-size: 18px; }
.brand i { color: var(--accent); }
.topnav { gap: 4px; }
.topnav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: 14px; }
.topnav a i { margin-right: 4px; }
.topnav a.on, .topnav a:hover { color: #fff; background: #1f232c; }

.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; background: rgba(15, 17, 21, .96); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); backdrop-filter: blur(8px); }
.bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); text-decoration: none; font-size: 11px; padding: 4px 0; }
.bottomnav a i { font-size: 21px; }
.bottomnav a.on { color: var(--accent); }

.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 2px 10px; }
.section-head h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0; font-weight: 700; }

/* režimy – veľké prepínače */
.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.mode { --c: #6366f1; position: relative; min-height: 96px; border-radius: 18px; border: 2px solid var(--line); background: var(--card); color: #fff; text-align: left; padding: 14px 16px; display: flex; flex-direction: column; justify-content: flex-end; transition: all .15s; }
.mode .mode-name { font-size: 26px; font-weight: 800; line-height: 1.1; }
.mode .mode-sub { font-size: 12px; color: var(--muted); }
.mode.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 28%, var(--card)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 25%, transparent); }
.mode.on::after { content: "\F26E"; font-family: bootstrap-icons; position: absolute; top: 10px; right: 12px; font-size: 20px; color: var(--c); }
.mode:disabled { opacity: .45; }

/* miestnosti */
.room { position: relative; overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; }
.room-glow { position: absolute; inset: 0; opacity: 0; transition: opacity .3s; pointer-events: none; }
.room.on .room-glow { opacity: .22; }
.room > * { position: relative; }
.room-head { display: flex; align-items: center; gap: 12px; }
.room-name { font-size: 17px; font-weight: 700; }
.room-meta { color: var(--muted); }
.room .form-switch .form-check-input { width: 3.1em; height: 1.7em; cursor: pointer; }
.room .form-switch .form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.room .bri { margin-top: 10px; accent-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { border: 1px solid var(--line); background: #1f232c; color: #e5e7eb; border-radius: 999px; padding: 6px 12px; font-size: 13px; }
.chip.on { border-color: var(--accent); color: #111; background: var(--accent); }
.lights { margin-top: 8px; }
.lights summary { font-size: 13px; color: var(--muted); cursor: pointer; }
.lights ul { list-style: none; padding: 0; margin: 8px 0 0; }
.light { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 14px; }
.light .sw { width: 14px; height: 14px; border-radius: 50%; border: 1px solid #3a3f4b; flex: 0 0 auto; }

/* senzory */
.sensor { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; }
.sensor .dot { width: 12px; height: 12px; border-radius: 50%; background: #3a3f4b; flex: 0 0 auto; }
.sensor .dot.live { background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, .2); }

/* login */
.login { max-width: 380px; margin: 8vh auto 0; }
.login-logo { width: 64px; height: 64px; border-radius: 18px; background: #1f232c; display: inline-grid; place-items: center; font-size: 30px; color: var(--accent); }

/* diff */
.diff { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; background: #0b0d11; border: 1px solid var(--line); border-radius: 10px; padding: 8px 0; overflow-x: auto; margin: 0; }
.diff div { padding: 0 10px; white-space: pre-wrap; word-break: break-all; }
.diff .add { background: rgba(34, 197, 94, .15); color: #bbf7d0; }
.diff .del { background: rgba(239, 68, 68, .15); color: #fecaca; }
.op-badge { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.rule-row { border-top: 1px solid var(--line); padding: 12px 0; }
.rule-row:first-child { border-top: 0; }
code.cond { font-size: 12px; color: #cbd5e1; }
.sticky-actions { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom)); background: var(--bg); padding: 10px 0; }
@media (min-width: 768px) { .sticky-actions { bottom: 0; } }

.form-range::-webkit-slider-thumb { background: var(--accent); }
.form-range::-moz-range-thumb { background: var(--accent); }
.form-range:focus::-webkit-slider-thumb { box-shadow: 0 0 0 .25rem rgba(251, 191, 36, .3); }

/* Pohyb: režimy v karte senzora a časové úseky */
.mode-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.mode-tab { --c: #6366f1; flex: 1; min-width: 64px; border: 2px solid var(--line); background: #1f232c; color: #e5e7eb; border-radius: 12px; padding: 8px 10px; font-weight: 700; }
.mode-tab.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 30%, #1f232c); color: #fff; }
.slot { border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; margin-bottom: 8px; background: #13161c; }
.slot-row { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.slot-row label { width: 62px; flex: 0 0 auto; margin: 0; }
.slot-row input[type=time] { max-width: 120px; }
.slot-row input[type=number] { max-width: 110px; }
.slot-row .s-del { margin-left: auto; }
