:root {
  --bg: #eef2f5;
  --surface: #fff;
  --line: #d3dce3;
  --text: #17232d;
  --muted: #687782;
  --blue: #1769aa;
  --green: #177245;
  --red: #b42318;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif; }
button, input, select { font: inherit; }
.rooms-page { padding: 12px; min-height: 100vh; }
.page-header, .header-actions, .dialog-header, .dialog-actions {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
h1 { margin: 0; font-size: 21px; }
p { margin: 3px 0 0; color: var(--muted); }
.status { min-height: 30px; padding: 8px 0; color: var(--muted); }
.table-shell { overflow: auto; max-height: calc(100vh - 105px); border: 1px solid var(--line); background: var(--surface); }
table { width: 100%; border-collapse: collapse; min-width: 980px; }
th, td { padding: 7px 9px; border-bottom: 1px solid #e6ebef; text-align: left; white-space: nowrap; }
th { position: sticky; top: 0; z-index: 1; background: #f4f7f9; font-size: 12px; color: #495963; }
tr:hover td { background: #f8fafb; }
.number { text-align: right; }
.actions { text-align: right; }
.badge { display: inline-flex; padding: 3px 6px; border-radius: 3px; background: #e8edf1; color: #485863; font-size: 11px; font-weight: 700; }
.badge.on { background: #e5f4ec; color: var(--green); }
.badge.off { background: #fdecea; color: var(--red); }
.command, .icon-btn {
  min-height: 34px; border: 1px solid #adb9c2; border-radius: 5px; background: #fff; color: var(--text); cursor: pointer;
}
.command { padding: 0 10px; }
.command.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.command.danger { color: var(--red); border-color: #e4b5b0; }
.icon-btn { width: 34px; }
dialog { width: min(680px, calc(100vw - 24px)); border: 1px solid var(--line); border-radius: 6px; padding: 0; box-shadow: 0 12px 42px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(23,35,45,.42); }
#roomForm { padding: 14px; }
.dialog-header { font-size: 16px; margin-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 700; }
.form-grid input:not([type=checkbox]), .form-grid select { height: 36px; border: 1px solid #b7c2ca; border-radius: 4px; padding: 0 8px; background: #fff; color: var(--text); }
.toggle-row { display: flex !important; grid-template-columns: auto 1fr; align-items: center; justify-content: start; color: var(--text) !important; font-size: 13px !important; }
.toggle-row input { width: 17px; height: 17px; }
.dialog-actions { justify-content: flex-end; margin-top: 16px; }
.empty { text-align: center; padding: 25px; color: var(--muted); }
@media (max-width: 640px) {
  .page-header { align-items: flex-start; }
  .form-grid { grid-template-columns: 1fr; }
}
