* { box-sizing: border-box; font-family: sans-serif; }
body { margin: 0; background: #111418; color: #ddd; }
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 200px; background: #1a1e24; padding: 20px 0; display: flex; flex-direction: column; }
.sidebar .brand { font-weight: bold; padding: 0 20px 20px; font-size: 1.1em; }
.sidebar a { color: #ccc; padding: 10px 20px; text-decoration: none; display: block; }
.sidebar a.active { background: #2a2f38; color: #fff; border-left: 3px solid #4c9aff; }
.sidebar a:hover { background: #23272e; }
.sidebar-footer { margin-top: auto; padding: 20px; font-size: 0.85em; }
.sidebar-footer .who { color: #888; margin-bottom: 6px; }
.content { flex: 1; padding: 30px 40px; max-width: 900px; }
.content-plain { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box { background: #1a1e24; padding: 30px; border-radius: 8px; width: 320px; }
.login-box label, form label { display: block; margin-top: 12px; margin-bottom: 4px; }
input, select { padding: 6px; width: 100%; margin-bottom: 6px; background: #22262d; border: 1px solid #333; color: #eee; border-radius: 4px; }
input.small { width: 80px; }
button, .btn { padding: 8px 14px; background: #2a2f38; color: #eee; border: 1px solid #3a4048; border-radius: 4px; cursor: pointer; margin: 6px 0; display: inline-block; text-decoration: none; }
.btn-primary { background: #4c9aff; color: #fff; border: none; }
.card { background: #1a1e24; padding: 16px 20px; border-radius: 8px; margin: 16px 0; }
.subcard { background: #20242c; padding: 10px 14px; border-radius: 6px; margin: 10px 0; }
.chrow { display: flex; gap: 10px; align-items: center; margin: 6px 0; }
/* Left-edge grab handle: only this element starts a row/zone drag
   (drag() is toggled on by mousedown, see configure.html makeHandle()),
   so text inputs and checkboxes in the same row remain normal. */
.drag-handle { cursor: grab; color: #666; padding: 0 6px; user-select: none; line-height: 1; }
.drag-handle:hover { color: #aaa; }
.subcard[draggable="true"], .chrow[draggable="true"] { cursor: grabbing; }
.subcard h4 { display: flex; align-items: center; gap: 4px; }
.zone-name-input { width: auto; flex: 1; max-width: 260px; margin: 0; }
/* Checkbox sits to the LEFT of its label text everywhere. */
.checkline { display: flex; align-items: center; gap: 6px; width: auto; }
.checkline input[type="checkbox"] { width: auto; margin: 0; order: -1; }
.checkline.wide { min-width: 110px; }
table { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid #2a2f38; }
.muted { color: #888; font-size: 0.9em; }
.error { color: #ff6b6b; }
.success { color: #6bff9e; }
.hint { font-size: 0.8em; color: #888; }
