/* Shared interface presentation for private, public, and administration pages. */
body {
  margin: 0;
  background: #f5f7f8;
  color: #35434b;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

body #container { min-width: 0; background: #f5f7f8; }
body #container #content:not(:has(form[name="keyentryform"])),
body.standalone-page {
  box-sizing: border-box;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 30px 40px;
}

body #container #content { overflow-x: auto; }
body #container #footer {
  box-sizing: border-box;
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: none;
  clear: both;
  background: #f5f7f8;
  color: #555;
  border: 0;
  line-height: 1.5;
}

:where(#content, .standalone-page) :is(h1, h2, h3) {
  color: #2b566a;
  font-family: inherit;
  font-weight: 500;
  line-height: 1.5;
  margin: 0 0 20px;
}
:where(#content, .standalone-page) h1 { font-size: 24px; }
:where(#content, .standalone-page) h2 { font-size: 20px; }
:where(#content, .standalone-page) h3 { font-size: 16px; }
:where(#content, .standalone-page) :is(p, li, label) { font-size: 14px; line-height: 1.6; }
:where(#content, .standalone-page) p { margin: 0 0 20px; padding: 0; }
:where(#content, .standalone-page) a:link,
:where(#content, .standalone-page) a:visited { color: #38748e; }
:where(#content, .standalone-page) a:hover { background: transparent; text-decoration: underline; }
:where(#content, .standalone-page) a:focus-visible { outline: 2px solid #38748e; outline-offset: 3px; }
:where(#content, .standalone-page) hr { border: 0; border-top: 1px solid #dce4e8; margin: 28px 0; }

/* Keep data tables as tables: wide reports scroll inside the content area. */
:where(#content, .standalone-page) table:not(.actcode_sticker):not(.actcode_sticker table) {
  border: 1px solid #dce4e8;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 10px;
  background: #fff;
  margin: 0 0 24px;
  width: 100%;
}
:where(#content, .standalone-page) table:not(.actcode_sticker) :is(th, td):not(.actcode_sticker *) {
  padding: 13px 16px;
  border: 0;
  border-bottom: 1px solid #e6ecef;
  color: #35434b;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.6;
  vertical-align: middle;
}
:where(#content, .standalone-page) table:not(.actcode_sticker) th:not(.actcode_sticker *) {
  font-weight: 600;
  text-align: left;
}
:where(#content, .standalone-page) table:not(.actcode_sticker) tr:last-child > :is(td, th):not(.actcode_sticker *) { border-bottom: 0; }
:where(#content, .standalone-page) table:not(.actcode_sticker) thead tr > :is(th, td):not(.actcode_sticker *),
:where(#content, .standalone-page) th.sectionhead,
#content .module caption,
#content .module > h2 {
  background: #eaf0f3;
  color: #2b566a;
  font-weight: 600;
  padding: 14px 16px;
}
:where(#content, .standalone-page) table:not(.actcode_sticker) tbody tr:hover { background: #f8fafb; }
:where(#content, .standalone-page) table table:not(.actcode_sticker) { margin: 0; border: 0; box-shadow: none; }
#content table.systemlist[style*="float"] { width: auto; margin-right: 20px; }

:where(#content, .standalone-page) form:not([name="keyentryform"]) {
  box-sizing: border-box;
  margin: 0 0 28px;
  padding: 24px;
  background: #fff;
  border: 1px solid #dce4e8;
  border-radius: 12px;
  box-shadow: 0 3px 12px rgba(43, 86, 106, .04);
}
:where(#content, .standalone-page) form:not([name="keyentryform"]) > table { margin-bottom: 16px; }
:where(#content, .standalone-page) :is(input, select, textarea) { font-family: inherit; font-size: 14px; }
:where(#content, .standalone-page) input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]),
:where(#content, .standalone-page) :is(select, textarea) {
  box-sizing: border-box;
  min-height: 42px;
  max-width: 100%;
  padding: 9px 12px;
  border: 1px solid #bdcbd3;
  border-radius: 6px;
  background: #fff;
  color: #35434b;
}
:where(#content, .standalone-page) textarea { min-height: 110px; resize: vertical; }
:where(#content, .standalone-page) :is(input[type="checkbox"], input[type="radio"]) { accent-color: #38748e; }
:where(#content, .standalone-page) :is(input[type="submit"], input[type="button"], input[type="reset"], button, .button) {
  box-sizing: border-box;
  min-height: 42px;
  padding: 10px 16px;
  margin: 4px 4px 4px 0;
  border: 1px solid #cad8df;
  border-radius: 6px;
  background: #fff;
  color: #38748e;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
:where(#content, .standalone-page) input[type="submit"] { background: #2b566a; border-color: #2b566a; color: #fff; }
:where(#content, .standalone-page) :is(input[type="button"], button):hover { background: #edf4f7; border-color: #38748e; }
:where(#content, .standalone-page) input[type="submit"]:hover { background: #38748e; }
:where(#content, .standalone-page) :is(input, select, textarea, button):focus-visible { outline: 2px solid #38748e; outline-offset: 3px; }
:where(#content, .standalone-page) :is(input, select, textarea, button):disabled { opacity: .55; cursor: not-allowed; }
:where(#content, .standalone-page) :is(.help_text, .help, .helptext) { color: #71808a; font-family: inherit; font-size: 12px; font-style: normal; line-height: 1.5; }
:where(#content, .standalone-page) .errornote,
:where(#content, .standalone-page) ul.errorlist {
  padding: 12px 16px !important;
  background: #fff2f1;
  border: 1px solid #e4b4ae;
  border-radius: 6px;
  color: #9d3026;
}
:where(#content, .standalone-page) .infonote { padding: 12px 16px; border: 1px solid #bfd4df; border-radius: 6px; background: #edf5f9; color: #2b566a; }
#content .module { border: 1px solid #dce4e8; border-radius: 8px; background: #fff; margin-bottom: 24px; }
#content .module table { margin-bottom: 0; border: 0; }
#content .submit-row { border-color: #dce4e8; background: #f5f7f8; padding: 16px; }

/* Preserve the home page's dedicated layout and activation-code label sizes. */
#content form[name="keyentryform"] table.inputs { background: transparent; border: 0; border-radius: 0; }
#content form[name="keyentryform"] table.inputs tr:hover { background: transparent; }
#content:has(form[name="keyentryform"]) input[type="button"],
#content form[name="keyentryform"] input[type="submit"] { margin: 0; }

@media (max-width: 600px) {
  body #container #content, body.standalone-page { padding: 24px 16px; }
  :where(#content, .standalone-page) form:not([name="keyentryform"]) { padding: 16px; }
  :where(#content, .standalone-page) table:not(.actcode_sticker) :is(th, td):not(.actcode_sticker *) { padding: 10px 12px; }
  /* Simple two-column entry forms stack; data/report tables retain their columns. */
  #content form:not([name="keyentryform"]) > table:not(.keylist):not(:has(table)):has(input):not(:has(th[colspan="6"])) :is(tbody, tfoot, tr, th, td) { display: block; }
  #content form:not([name="keyentryform"]) > table:not(.keylist):not(:has(table)):has(input):not(:has(th[colspan="6"])) input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]) { width: 100%; }
}

:where(#content, .standalone-page) table:not(.actcode_sticker) tfoot :is(td, th):not(.actcode_sticker *) { background: #f5f7f8; }
#content span.key { white-space: nowrap; }
#content span.key a { color: #38748e; }
#content form:is([name="loginform"], [name="monitoraddform"], [name="monitorupdateform"], [name="choosekeyform"], [name="macaddrform"], [name="chgpasswdform"]),
body.standalone-page form { max-width: 960px; }
#content form:is([name="loginform"], [name="monitoraddform"], [name="monitorupdateform"], [name="choosekeyform"], [name="macaddrform"], [name="chgpasswdform"]) input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]) { width: 100%; max-width: 480px; }
#content form[name="loginform"] { max-width: 640px; }

#container.public-interface { min-height: 100vh; display: flex; flex-direction: column; }
#container.public-interface #content { flex: 1 0 auto; }
#container.public-interface #header {
  box-sizing: border-box;
  height: auto;
  min-height: 100px;
  max-height: none;
  background-position: 30px center;
  border-bottom: 4px solid #2b566a;
  padding: 22px 30px;
}
#container.public-interface #header h1 { padding-top: 10px; font-family: inherit; font-size: 20px; font-weight: 500; }
#container.public-interface #footer { padding: 18px 30px; }

/* The admin owns its header markup; keep its navigation and sidebar intact. */
#container:not(.private-interface):not(.public-interface) #header {
  box-sizing: border-box;
  background: #fff;
  color: #555;
  border-bottom: 4px solid #2b566a;
  padding: 22px 30px;
}
#container:not(.private-interface):not(.public-interface) #header h1 { color: #555; font-family: inherit; font-size: 20px; }
#container:not(.private-interface):not(.public-interface) #header a { color: #38748e; }
#container:not(.private-interface):not(.public-interface) .breadcrumbs { padding: 8px 30px; border: 0; background: #2b566a; color: #fff; }
#container:not(.private-interface):not(.public-interface) .breadcrumbs a { color: #fff; }
body.dashboard #content { display: grid; grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr); gap: 24px; }
body.dashboard #content > h1 { grid-column: 1 / -1; }
body.dashboard #content-main, body.dashboard #content-related { float: none; width: auto; margin: 0; }
body.dashboard #content-related { padding: 0; }
@media (max-width: 600px) {
  #container.public-interface #header { padding: 80px 16px 16px; background-position: 16px 16px; }
  #container.public-interface #header h1 { margin-left: 0; }
  body.dashboard #content { display: block; }
  #container:not(.private-interface):not(.public-interface) #header #user-tools { position: static; margin-top: 12px; text-align: left; }
}

body.standalone-page > img { max-width: 100%; height: auto; }

/* One consistent content heading across interface layouts. */
#content > h1.page-heading,
body.standalone-page > h1.page-heading {
  margin: 0 0 28px;
  padding: 0;
  color: #2b566a;
  font-size: 24px;
  font-weight: 500;
  line-height: 1.4;
}
#content table.monitored-systems { margin-top: 24px; }
