:root { --ink: var(--text); --paper: var(--panel); --accent: #2469a8; }
.installation-page main { max-width: none; }
.installation-page .device-table { table-layout: auto; min-width: 1420px; }
.installation-page .device-table :is(th, td):nth-child(n+2) { width: auto; }
.installation-page .device-table td { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
.installation-page #addDeviceModal .modal-dialog { width: 80vw; }
@media (max-width: 900px) {
  .installation-page #addDeviceModal .modal-dialog { width: calc(100vw - 36px); }
}
.companies-table .company-name { display: flex; align-items: center; gap: 10px; }
.companies-table .company-name form { min-width: 0; margin: 0; }
.companies-table .company-name .row-name { overflow-wrap: anywhere; }
.companies-table .company-toggle { width: 32px; height: 32px; min-height: 32px; padding: 7px; }
.companies-table .company-actions .action-group { flex-wrap: nowrap; }
.company-sites-row > td { padding: 12px 18px 18px 44px; background: #f7fafb; }
.company-sites-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.company-sites-heading h2 { margin: 0; padding: 0; border: 0; font-size: 17px; }
.company-sites .sites-table { background: var(--panel); }
@media (max-width: 600px) {
  .companies-table .company-schema, .company-actions .action-label { display: none; }
  .companies-table .company-actions .action-group { gap: 6px; }
  .companies-table .company-actions :is(.button, button) { width: 36px; height: 36px; padding: 8px; }
  .company-sites-row > td { padding: 10px; }
}
/* Shared Edge rules take precedence over legacy Admin form styling. */
@layer administration {
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--bg); font-family: "Segoe UI", Arial, sans-serif; letter-spacing: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea, select { font: inherit; }
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 34px; padding: 8px 12px; border: 0; border-radius: 6px; color: var(--button-neutral-text); background: var(--button-neutral-bg); font-weight: 700; cursor: pointer; text-decoration: none; }
button:hover, .button:hover { background: #eaf0f0; text-decoration: none; }
button.primary, .button.primary { color: white; background: var(--accent); border-color: var(--accent); }
button.primary:hover, .button.primary:hover { background: #1d568a; }
button:focus-visible, a:focus-visible, input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
svg { width: 18px; height: 18px; flex: 0 0 auto; }
.icon { width: 40px; height: 40px; padding: 9px; flex-shrink: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 18px; color: #fff; background: #20292b; border-bottom: 3px solid var(--accent); }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-size: 19px; font-weight: 700; white-space: nowrap; }
.brand svg { width: 25px; height: 25px; color: #89d7c6; }
.topbar nav { display: flex; flex-wrap: wrap; gap: 6px; }
.topbar nav a { display: inline-flex; align-items: center; min-height: 34px; padding: 7px 12px; color: var(--button-neutral-text); background: var(--button-neutral-bg); border-radius: 6px; font-weight: 700; }
.topbar nav a.active { color: #fff; background: var(--accent); }
.session { display: flex; align-items: center; gap: 10px; }
.session span { max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.session form { display: flex; }
.session .icon { background: transparent; color: #fff; border-color: #5f7477; }
main { max-width: 1280px; margin: 0 auto; padding: 18px; }
h1 { margin: 0; font-size: 26px; line-height: 1.25; overflow-wrap: anywhere; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 10px 0 24px; }
.subheading { color: var(--muted); font-size: 13px; margin-top: 4px; overflow-wrap: anywhere; }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.inline { display: flex; align-items: center; gap: 10px; }
.inline select { min-width: 180px; }
input:not([type=checkbox]):not([type=hidden]), select, textarea { max-width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid #c8d5d7; border-radius: 4px; background: white; color: var(--ink); }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); }
label { font-weight: 600; }
.table-wrap { overflow-x: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--paper); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 15px 18px; border-bottom: 1px solid #e2e8e9; vertical-align: middle; }
th { color: #536266; background: #e9eeee; font-size: 12px; text-transform: uppercase; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f7faf9; }
.row-name { font-weight: 700; color: var(--ink); }
button.name-link { display: inline; min-height: 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--accent); font-weight: inherit; text-align: left; overflow-wrap: anywhere; }
button.name-link.row-name { color: var(--ink); font-weight: 700; overflow-wrap: normal; }
button.name-link:hover { background: transparent; text-decoration: underline; }
.actions { text-align: right; }
.actions .action-group { justify-content: flex-end; }
.action-group, .form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.form-actions { padding-top: 22px; }
.mono { font-family: ui-monospace, monospace; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 4px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.good { background: #dff2e7; color: #12613c; }
.neutral { background: #edf1f2; color: #53666d; }
.warning { background: #fff0ca; color: #805b12; }
.notice { padding: 12px 16px; margin-bottom: 18px; border-left: 4px solid #76878a; background: #eaf0f1; white-space: pre-line; overflow-wrap: anywhere; }
.notice.success { color: #145b3a; background: #e2f3e9; border-color: #1c8655; }
.notice.error, .notice.warning { color: #982622; background: #fff0ec; border-color: #c44234; }
.notice[hidden] { display: none; }
.errorlist { padding-left: 20px; color: #ad2821; }
.empty { padding: 40px 18px; text-align: center; color: var(--muted); }
.section-tabs { display: flex; flex-wrap: wrap; gap: 24px; border-bottom: 1px solid var(--line); margin: 0 0 20px; }
.section-tabs a { color: var(--muted); padding: 10px 0; border-bottom: 3px solid transparent; font-weight: 600; }
.section-tabs a.active { border-color: var(--accent); color: var(--ink); }
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 16px; padding-bottom: 20px; }
.filters label { display: grid; gap: 4px; font-size: 13px; }
.form-stack { display: grid; gap: 14px; }
.form-narrow { max-width: 680px; }
.field { display: grid; gap: 6px; }
.check-field { display: flex; flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: 10px; }
.name-field { max-width: 440px; margin-bottom: 18px; }
.auth-shell { max-width: 400px; margin: 60px auto; }
.auth-shell h1 { margin-bottom: 26px; }
.auth-shell button { margin-top: 12px; }
.code-editor, .source-preview { width: 100%; font: 14px/1.55 ui-monospace, monospace; tab-size: 4; }
.code-editor { min-height: 420px; resize: vertical; }
.editor-mode { display: grid; gap: 4px; min-width: 220px; }
.muted { color: var(--muted); }
.error { color: var(--bad); }
.ok { color: #12613c; }
.form-status { font-size: 14px; }
button:disabled { opacity: 0.55; cursor: not-allowed; }
[data-config-editor] .action.secondary { background: #465469; border-color: #465469; color: #fff; }
[data-config-editor] .action.danger { background: #b5231c; border-color: #b5231c; color: #fff; }
.installation-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.installation-toolbar .tabs { min-width: 0; }
.installation-version { font-size: 13px; font-weight: 700; color: var(--muted); }
.installation-version.pending { color: var(--warn); }
.installation-version.applied { color: var(--good); }
.installation-editor .name-link { background: transparent; }
.device-table tr.configuration-pending { background: #fff6df; }
.version-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.automation-run-help { border-top: 1px solid var(--line); padding-top: 10px; }
.automation-run-help code { display: block; overflow-wrap: anywhere; }
.source-preview { margin: 20px 0 0; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: 4px; overflow: auto; max-height: 65vh; }
.version-status { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 960px) {
  .topbar { flex-wrap: wrap; gap: 14px; }
  .topbar nav { order: 3; flex-basis: 100%; }
  .session { margin-left: auto; }
}
@media (max-width: 600px) {
  main { padding: 18px 14px 32px; }
  .topbar { padding: 12px 14px; }
  .brand { font-size: 19px; }
  .brand svg { width: 22px; height: 22px; }
  .session span { display: none; }
  .topbar nav { gap: 0; }
  .topbar nav a { padding: 7px 9px; font-size: 13px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  h1 { font-size: 23px; }
  .inline { width: 100%; }
  .inline select { min-width: 0; flex: 1; }
  .section-tabs { gap: 16px; }
  th, td { padding: 12px; }
  .sites-table .site-address, .sites-table .action-label { display: none; }
  .sites-table .button { width: 40px; padding: 9px; }
  .auth-shell { margin-top: 30px; }
}
}
.installation-control { margin: 12px 0; }
.installation-control summary { cursor: pointer; font-weight: 700; padding: 8px 0; }
.installation-control .action-group { margin: 4px 0 8px; }
.installation-control .table-wrap { overflow-x: auto; }
.installation-control table { width: 100%; min-width: 560px; }
.automation-log-table { margin: 16px 0; overflow-x: auto; }
.automation-log-table table { min-width: 1100px; table-layout: fixed; width: 100%; }
.automation-log-table :is(th, td):nth-child(1) { width: 150px; }
.automation-log-table :is(th, td):nth-child(2) { width: 110px; }
.automation-log-table :is(th, td):nth-child(3) { width: 240px; }
.automation-log-table :is(th, td):nth-child(4) { width: 80px; }
.automation-log-table :is(th, td):nth-child(5) { width: 300px; }
.automation-log-table td { overflow-wrap: anywhere; white-space: normal; }
.automation-log-filter { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; }
.automation-log-filter select { width: 220px; max-width: 100%; }
.automation-log-filter span { margin-left: auto; }
