:root {
  --bg: #f6f8f5;
  --panel: #ffffff;
  --line: #dfe6dc;
  --text: #1e2b22;
  --muted: #607064;
  --brand: #1f7a4d;
  --brand-strong: #145c39;
  --brand-soft: #e7f4ec;
  --warn: #b7791f;
  --warn-soft: #fff4d6;
  --danger: #b42318;
  --danger-soft: #ffe6e2;
  --info: #2563eb;
  --info-soft: #e7efff;
  --radius: 8px;
  --shadow: 0 12px 30px rgba(31, 55, 38, 0.08);
  --main-gutter-left: 18px;
  --main-gutter-right: 36px;
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-weight: 600;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 18%, rgba(31, 122, 77, 0.16), transparent 30%),
    radial-gradient(circle at 84% 62%, rgba(13, 110, 166, 0.13), transparent 32%),
    linear-gradient(135deg, #f6fbf7 0%, #edf7f0 100%);
  overflow: auto;
}

.login-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(247, 250, 247, 0.08), rgba(238, 246, 240, 0.03)),
    url("login-it-bg.svg") center / cover no-repeat;
  opacity: 1;
  pointer-events: none;
}

.login-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 24% 20%, rgba(255, 255, 255, 0.20), transparent 28%),
    radial-gradient(circle at 82% 70%, rgba(255, 255, 255, 0.16), transparent 30%);
  pointer-events: none;
}

.login-screen.hidden { display: none; }

.login-shell {
  position: relative;
  z-index: 1;
  width: min(1040px, 96vw);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr);
  gap: 18px;
  background: transparent;
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
  margin: auto;
}

.login-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  padding: 58px 36px 40px;
  background: linear-gradient(145deg, var(--brand) 0%, var(--brand-strong) 100%);
  color: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 22px 70px rgba(31, 55, 38, 0.16);
}

.login-visual-content { position: relative; z-index: 1; }

.login-visual-content h2 {
  margin: 0 0 10px;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0;
}

.login-visual-content p {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.92);
}

.login-visual-features {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.login-visual-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.96);
}

.login-feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 15px;
  flex-shrink: 0;
}

.login-visual-art {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
}

.login-card {
  position: relative;
  width: 100%;
  display: grid;
  align-content: start;
  gap: 15px;
  padding: 42px 36px 28px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 22px 70px rgba(31, 55, 38, 0.16);
}

.login-card-head {
  display: grid;
  place-items: center;
  align-items: center;
  margin-bottom: 6px;
}

.login-lang-switch {
  position: absolute;
  top: 20px;
  right: 28px;
  gap: 3px;
  padding: 3px;
  border-radius: 8px;
}

.login-lang-switch .lang-button {
  min-height: 26px;
  padding: 5px 8px;
  font-size: 12px;
}

.login-lang-switch .flag-icon {
  width: 17px;
  height: 12px;
}

.login-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.login-logo-large {
  width: 96px;
  height: 96px;
  border-radius: 18px;
}

.login-title {
  text-align: center;
  margin-bottom: 8px;
}

.login-title h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.22;
}

.login-title p,
.login-hint {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
}

.login-card label {
  display: grid;
  gap: 0;
  color: #123424;
  font-size: 15px;
  font-weight: 800;
}

.login-field {
  position: relative;
  padding-top: 14px;
}

.login-field > span {
  position: absolute;
  left: 0;
  top: 24px;
  z-index: 1;
  color: #315844;
  font-size: 15px;
  font-weight: 900;
  pointer-events: none;
  transform-origin: left center;
  transition: transform .16s ease, color .16s ease, top .16s ease, font-size .16s ease;
}

.login-field:focus-within > span,
.login-field:has(input:not(:placeholder-shown)) > span {
  top: 0;
  color: var(--brand-strong);
  font-size: 13px;
  transform: translateY(0);
}

.login-input-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px 34px;
  align-items: end;
  border-bottom: 1.5px solid #b8c8bd;
}

.login-input-shell:focus-within {
  border-bottom-color: var(--brand);
  box-shadow: 0 1px 0 var(--brand);
}

.login-card input {
  min-height: 38px;
  padding: 8px 0 7px;
  border: 0;
  border-bottom: 1.5px solid #b8c8bd;
  border-radius: 0;
  background: transparent;
  color: #0b2f21;
  font-size: 15px;
  font-weight: 800;
  box-shadow: none;
  outline: none;
}

.login-input-shell input {
  border-bottom: 0;
  box-shadow: none;
}

.login-card input:focus {
  border-bottom-color: var(--brand);
  box-shadow: 0 1px 0 var(--brand);
}

.login-input-shell input:focus {
  border-bottom-color: transparent;
  box-shadow: none;
}

.login-card input::placeholder {
  color: transparent;
  font-weight: 800;
}

.login-inline-icon {
  width: 32px;
  height: 32px;
  margin-bottom: 4px;
  border: 0;
  background: transparent;
  color: #315844;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  font-size: 18px;
  font-weight: 900;
}

.login-password-field .login-inline-icon {
  opacity: 0;
  pointer-events: none;
  transform: translateY(2px);
  transition: opacity .14s ease, transform .14s ease, color .14s ease;
}

.login-password-field:focus-within .login-inline-icon,
.login-password-field.has-password-tools .login-inline-icon {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.login-inline-icon:hover,
.login-inline-icon.is-active {
  color: var(--brand);
}

.login-virtual-keyboard {
  display: grid;
  gap: 5px;
  width: min(100%, 470px);
  padding: 8px;
  margin-top: -7px;
  border: 1px solid #d8e4dc;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 34px rgba(13, 48, 31, 0.16);
}

.login-virtual-keyboard.hidden {
  display: none;
}

.vk-row {
  display: flex;
  justify-content: center;
  gap: 3px;
}

.vk-row button {
  min-width: 25px;
  height: 27px;
  padding: 0 6px;
  border: 1px solid #cfd9d2;
  border-radius: 5px;
  background: linear-gradient(180deg, #fff, #eef3ef);
  color: #1d5592;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 1px rgba(20, 48, 32, .08);
}

.vk-row button:hover,
.vk-row button:focus {
  border-color: var(--brand);
  color: var(--brand-strong);
}

.vk-row .vk-wide {
  min-width: 50px;
}

.vk-row .vk-space {
  min-width: 142px;
}

.vk-row button.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.login-card .button {
  min-height: 48px;
  margin-top: 12px;
  border-radius: 999px;
  background: #2f73ff;
  border-color: #2f73ff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .2px;
}

.login-card .button:hover {
  background: #245fe0;
  border-color: #245fe0;
}

.login-error {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 13.5px;
  font-weight: 700;
}

.captcha-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(184px, 228px) 38px;
  align-items: end;
  gap: 10px;
}

.captcha-row input {
  min-width: 0;
  text-transform: uppercase;
}

.captcha-field > span {
  top: 24px;
}

.captcha-image {
  min-height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-bottom: 1.5px solid #b8c8bd;
  border-radius: 0;
  background: transparent;
  overflow: hidden;
}

.captcha-image svg {
  display: block;
  width: 100%;
  max-width: 230px;
  height: 56px;
}

.captcha-refresh {
  width: 36px;
  height: 36px;
  align-self: center;
  border-radius: 999px;
}

.forgot-password-link {
  justify-self: center;
  border: 0;
  background: transparent;
  color: var(--brand-strong);
  font-weight: 800;
  cursor: pointer;
  padding: 2px 0;
}

.forgot-password-link:hover {
  text-decoration: underline;
}

.login-copyright {
  margin: 30px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  font-style: italic;
  font-weight: 700;
}

.app-shell.auth-hidden { display: none; }

.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #ffffff;
  border-right: 1px solid var(--line);
  padding: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.brand {
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  padding: 12px 10px 14px;
  border-bottom: 1px solid var(--line);
}

.brand-logo-wrap {
  width: 58px;
  height: 58px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #dce7e0;
  box-shadow: 0 8px 22px rgba(31, 55, 38, 0.1);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.brand-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  display: block;
}

.brand h1 {
  font-size: 17px;
  font-weight: 800;
  margin: 0;
  line-height: 1.15;
}

.brand p, .eyebrow {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  flex: 1;
}

.nav-group {
  display: grid;
  gap: 4px;
}

.nav-group:last-child {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.nav-group-title {
  margin: 0 0 2px;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.75;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.language-switch {
  display: flex;
  gap: 4px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 4px;
  box-shadow: 0 6px 18px rgba(31, 55, 38, 0.06);
}

.top-actions-group {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.top-actions-group:first-child {
  padding-left: 0;
  border-left: 0;
}

.search-group {
  flex: 1 1 auto;
  min-width: 240px;
}

.user-badge {
  display: grid;
  align-items: center;
  justify-items: start;
  gap: 3px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 44px;
  padding: 6px 10px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
}

.user-badge-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lang-button {
  border: 0;
  background: transparent;
  color: var(--text);
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.account-language-switch {
  width: 100%;
  max-width: 58px;
  padding: 3px;
  gap: 2px;
}

.account-language-switch .lang-button {
  min-height: 31px;
  width: 25px;
  padding: 5px 4px;
  font-size: 0;
  gap: 5px;
  justify-content: center;
}

.account-language-switch .flag-icon {
  width: 17px;
  height: 12px;
  margin: 0;
}

.lang-button.active,
.lang-button:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.flag-icon {
  width: 20px;
  height: 14px;
  object-fit: cover;
  border-radius: 2px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.row-check {
  width: 44px;
  min-width: 44px;
  text-align: center;
}

.row-check th,
th.row-check {
  text-align: center;
}

.row-check input {
  appearance: none;
  -webkit-appearance: none;
  width: 19px;
  height: 19px;
  border: 1px solid #aeb9b2;
  border-radius: 2px;
  background: #fff;
  display: inline-grid;
  place-content: center;
  vertical-align: middle;
  cursor: pointer;
  padding: 0;
  margin: 0;
}

.row-check input::before {
  content: "";
  width: 11px;
  height: 7px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) scale(0);
  transform-origin: center;
}

.row-check input:checked {
  background: #20a8d8;
  border-color: #20a8d8;
  box-shadow: 0 0 0 2px rgba(32, 168, 216, 0.16);
}

.row-check input:checked::before {
  transform: rotate(-45deg) scale(1);
}

.row-check input:focus-visible {
  outline: 2px solid rgba(32, 168, 216, 0.4);
  outline-offset: 2px;
}

tr.selected-row td {
  background: #edf8f1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 10px 12px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 14.5px;
  font-weight: 700;
  width: 100%;
}

.nav-item .nav-icon { color: var(--muted); }
.nav-item:hover .nav-icon,
.nav-item.active .nav-icon { color: var(--brand-strong); }

.nav-item:hover, .nav-item.active {
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 800;
}

.nav-item.nav-child {
  margin-left: 28px;
  min-height: 34px;
  padding: 7px 10px;
  color: #2d5b40;
  font-size: 13px;
}

.nav-item.nav-child::before {
  content: "";
  width: 6px;
  min-width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9fc9ae;
}

.settings-nav-row {
  display: block;
}

.settings-main-item {
  justify-content: flex-start;
}

.settings-subnav {
  display: none;
  gap: 2px;
  margin: 6px 0 0 28px;
  padding: 4px 0 0 8px;
  border-left: 0;
}

.settings-subnav.active {
  display: grid;
}

.settings-toggle-indicator {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  transition: transform 0.16s ease;
}

.incident-nav-block,
.module-folder-nav-block {
  min-width: 0;
}

.incident-nav-main-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  align-items: center;
  gap: 2px;
}

.incidents-main-item,
.module-folder-main-item {
  min-width: 0;
  padding-right: 4px;
}

.incident-toggle-indicator {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  transition: transform 0.16s ease;
}

.incidents-main-item.expanded .incident-toggle-indicator,
.module-folder-main-item.expanded .incident-toggle-indicator,
.maintenance-main-item.expanded .maintenance-toggle-indicator,
.settings-main-item.expanded .settings-toggle-indicator {
  transform: rotate(180deg);
}

.maintenance-nav-block {
  min-width: 0;
}

.maintenance-main-item {
  justify-content: flex-start;
}

.maintenance-toggle-indicator {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  transition: transform 0.16s ease;
}

.maintenance-subnav {
  display: none;
}

.maintenance-subnav.active {
  display: block;
}

.maintenance-subnav .nav-child {
  width: calc(100% - 28px);
}

.incident-nav-add {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #cfe2d3;
  border-radius: 6px;
  background: #fff;
  color: var(--brand-strong);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.incident-nav-add:hover {
  background: var(--brand-soft);
}

.incident-sidebar-subnav {
  display: none;
  margin: 3px 0 8px 28px;
  padding: 2px 0 2px 8px;
  border-left: 0;
}

.incident-sidebar-subnav.active {
  display: block;
}

.incident-sidebar-root,
.incident-sidebar-folder-select {
  min-width: 0;
  border: 0;
  background: transparent;
  color: #2d5b40;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.incident-sidebar-root {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  min-height: 34px;
  padding: 7px 9px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 800;
}

.incident-sidebar-root-label {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.incident-sidebar-root.unfiled {
  margin-top: 4px;
  border-top: 1px solid #e1ece4;
}

.incident-sidebar-folder-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 34px;
  padding-left: calc(var(--sidebar-folder-depth, 0) * 14px);
  border-radius: 6px;
}

.incident-sidebar-folder-select {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 7px 8px;
  font-size: 13px;
  font-weight: 700;
}

.incident-sidebar-dot {
  display: inline-block;
  width: 6px;
  min-width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9fc9ae;
}

.incident-sidebar-caret {
  display: inline-grid;
  width: 8px;
  height: 14px;
  place-items: center;
  color: #75a98a;
  font-size: 10px;
  font-style: normal;
  transition: transform 0.15s ease;
}

.incident-sidebar-caret.expanded {
  transform: rotate(90deg);
}

.incident-sidebar-root.active .incident-sidebar-dot,
.incident-sidebar-folder-row.active .incident-sidebar-dot {
  background: var(--brand-strong);
}

.incident-sidebar-folder-select span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.incident-sidebar-root b,
.incident-sidebar-folder-select b {
  color: var(--muted);
  font-size: 10.5px;
}

.incident-sidebar-root:hover,
.incident-sidebar-root.active,
.incident-sidebar-folder-row:hover,
.incident-sidebar-folder-row.active {
  background: #e6f4eb;
  color: var(--brand-strong);
}

.incident-sidebar-folder-actions {
  display: none;
  gap: 1px;
}

.incident-sidebar-folder-row:hover .incident-sidebar-folder-actions,
.incident-sidebar-folder-row:focus-within .incident-sidebar-folder-actions {
  display: flex;
}

.incident-sidebar-folder-actions button {
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1px solid #cfe2d3;
  border-radius: 4px;
  background: #fff;
  color: var(--brand-strong);
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.incident-sidebar-empty {
  margin: 5px 7px;
  color: var(--muted);
  font-size: 11px;
}

.settings-main-item.expanded .settings-toggle-indicator {
  transform: rotate(180deg);
}

.settings-subitem {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #3f4f45;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  padding: 7px 10px;
  text-align: left;
}

.settings-subitem:hover,
.settings-subitem.active {
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 800;
}

.main {
  padding: 22px var(--main-gutter-right) 36px var(--main-gutter-left);
  min-width: 0;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: -2px 0 22px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(223, 230, 220, 0.7);
}

.command-bar {
  display: grid;
  grid-template-columns:
    minmax(320px, 1.22fr)
    minmax(220px, .78fr)
    minmax(155px, .54fr)
    minmax(370px, 1.18fr);
  align-items: stretch;
  gap: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.command-zone {
  display: grid;
  align-content: center;
  gap: 5px;
  min-width: 0;
  padding: 0 14px;
  border-left: 1px solid var(--line);
}

.command-zone:first-child {
  padding-left: 0;
  border-left: 0;
}

.command-label {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .04em;
  line-height: 1;
  text-transform: uppercase;
}

.customer-zone {
  display: grid;
  gap: 8px;
  align-items: start;
}

.customer-slot select {
  width: 100%;
  min-width: 0;
  height: 48px;
  min-height: 48px;
  padding: 0 36px 0 14px;
  line-height: normal;
  font-size: 15px;
  font-weight: 800;
  text-overflow: ellipsis;
  -webkit-appearance: none;
  appearance: none;
  background: #fff;
  background-image:
    linear-gradient(45deg, transparent 50%, #10231a 50%),
    linear-gradient(135deg, #10231a 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 21px,
    calc(100% - 13px) 21px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.search-zone {
  justify-content: stretch;
}

.clock-zone,
.account-zone {
  justify-content: stretch;
}

.clock-zone {
  min-width: 155px;
}

.top-timezone {
  height: 32px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 700;
  width: 100%;
  max-width: 190px;
  background: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-clock {
  display: grid;
  gap: 0;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.top-clock strong {
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 800;
}

.top-clock span {
  color: var(--muted);
}

.account-zone {
  gap: 8px;
  min-width: 370px;
}

.account-actions {
  display: grid;
  grid-template-columns: minmax(126px, 1fr) 58px 88px 72px;
  grid-template-areas:
    "user lang pass logout";
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.account-actions .user-badge {
  grid-area: user;
}

.account-language-switch {
  grid-area: lang;
  justify-self: stretch;
}

.account-actions #changePasswordBtn {
  grid-area: pass;
}

.account-actions #logoutBtn {
  grid-area: logout;
}

.account-actions .button {
  min-height: 36px;
  height: 36px;
  padding: 6px 8px;
  font-size: 12.5px;
  line-height: 1.12;
  white-space: normal;
}

.account-actions #changePasswordBtn {
  max-width: 88px;
}

.account-actions #logoutBtn {
  max-width: 72px;
}

@media (min-width: 981px) and (max-width: 1420px) {
  .main {
    padding-left: 16px;
    padding-right: 28px;
  }

  .command-bar {
    grid-template-columns:
      minmax(280px, 1.08fr)
      minmax(200px, .75fr)
      minmax(145px, .52fr)
      minmax(360px, 1.2fr);
  }

  .command-zone {
    padding-left: 10px;
    padding-right: 10px;
  }

  .account-actions {
    grid-template-columns: minmax(112px, 1fr) 58px 82px 66px;
    gap: 6px;
  }

  .account-actions .button {
    padding-left: 6px;
    padding-right: 6px;
    font-size: 12px;
  }

  .account-actions #changePasswordBtn {
    max-width: 82px;
  }

  .account-actions #logoutBtn {
    max-width: 66px;
  }
}

@media (min-width: 981px) and (max-width: 1180px) {
  .command-bar {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .command-zone {
    min-width: 0;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .command-zone:nth-child(odd) {
    border-left: 0;
  }

  .command-zone:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .account-zone {
    min-width: 0;
  }

  .account-actions {
    grid-template-columns: minmax(130px, 1fr) 58px 88px 72px;
  }
}

.topbar h2 {
  font-size: 26px;
  font-weight: 800;
  margin: 0;
  line-height: 1.15;
}

.top-actions {
  display: flex;
  gap: 0;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  flex: 1 1 520px;
  max-width: 980px;
}

input, select, textarea {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 11px;
  font: inherit;
  font-weight: 600;
  background: #fff;
  color: var(--text);
}

textarea {
  min-height: 90px;
  resize: vertical;
}

#globalSearch {
  flex: 1 1 220px;
  min-width: 160px;
  max-width: 360px;
}

.command-bar #globalSearch {
  width: 100%;
  max-width: none;
  flex: none;
  height: 40px;
}

.view { display: none; }
.view.active { display: block; }

.grid {
  display: grid;
  gap: 14px;
}

.kpi-grid {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
}

.kpi-grid-2 {
  grid-template-columns: repeat(2, minmax(130px, 1fr));
}

.dashboard-group {
  margin-bottom: 18px;
}

.dashboard-group-title {
  margin: 0 0 10px;
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.kpi {
  border-left: 4px solid var(--line);
}

.kpi-brand { border-left-color: var(--brand); }
.kpi-warn { border-left-color: var(--warn); }
.kpi-danger { border-left-color: var(--danger); }
.kpi-info { border-left-color: var(--info); }

.status-bar {
  display: flex;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: #eef1ee;
  margin-top: 14px;
}

.status-bar-seg {
  height: 100%;
}

.seg-active { background: var(--brand); }
.seg-expiring { background: var(--warn); }
.seg-expired { background: var(--danger); }
.seg-disabled { background: var(--info); }

.status-bar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot.seg-active { background: var(--brand); }
.legend-dot.seg-expiring { background: var(--warn); }
.legend-dot.seg-expired { background: var(--danger); }
.legend-dot.seg-disabled { background: var(--info); }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.kpi {
  padding: 17px 18px;
  min-height: 94px;
}

.kpi .label {
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 700;
}

.kpi .value {
  font-size: 31px;
  font-weight: 800;
  margin-top: 6px;
}

.section {
  padding: 16px;
  margin-top: 14px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.section-head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.table-titlebar {
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(223, 230, 220, 0.75);
}

.title-stack {
  display: grid;
  gap: 3px;
  min-width: 190px;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.compact-actions {
  flex-wrap: nowrap;
}

.toolbar-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-left: 12px;
  margin-left: 12px;
  border-left: 1px solid var(--line);
}

.toolbar-group:first-child {
  padding-left: 0;
  margin-left: 0;
  border-left: 0;
}

.toolbar-note {
  margin: 0;
  padding: 9px 11px;
  white-space: nowrap;
}

.command-menu {
  position: relative;
}

.command-menu summary {
  list-style: none;
}

.command-menu summary::-webkit-details-marker {
  display: none;
}

.command-menu summary::after {
  content: "▾";
  margin-left: 8px;
  font-size: 11px;
}

.command-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 7px);
  z-index: 8;
  min-width: 178px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 34px rgba(31, 55, 38, 0.16);
}

.menu-command,
.command-menu-panel .button {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 9px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.menu-command:hover,
.command-menu-panel .button:hover {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.danger-command:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.command-menu-panel input[type="file"] {
  display: none;
}

.button {
  border: 0;
  background: var(--brand);
  color: #fff;
  padding: 10px 13px;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 800;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.button:hover { background: var(--brand-strong); }
.button.secondary {
  background: #ffffff;
  color: var(--brand-strong);
  border: 1px solid var(--line);
}
.button.secondary:hover { background: var(--brand-soft); }
.button.danger {
  background: var(--danger);
}

.button.small {
  padding: 7px 10px;
  font-size: 12px;
  border-radius: 6px;
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.backup-table table {
  min-width: 720px;
}

.backup-danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.backup-danger-zone strong {
  display: block;
  color: var(--danger);
  margin-bottom: 3px;
}

.backup-danger-zone span {
  color: var(--muted);
  font-size: 13px;
}

.backup-danger-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.card.section > .table-wrap,
.card.section .backup-table,
.card.section .system-users-table,
.audit-panel .table-wrap,
.library-table-wrap {
  max-height: min(68vh, 720px);
  overflow: auto;
  position: relative;
}

.card.section > .table-wrap thead th,
.card.section .backup-table thead th,
.card.section .system-users-table thead th,
.audit-panel .table-wrap thead th,
.library-table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 6;
  background-clip: padding-box;
  box-shadow: 0 1px 0 var(--line);
}

.library-table-wrap {
  max-width: 100%;
  max-height: min(68vh, 720px);
  overflow: auto;
}

.library-table {
  min-width: 1480px;
}

.library-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
}

.library-table th,
.library-table td {
  line-height: 1.35;
}

.library-table th {
  white-space: nowrap;
}

.library-table .compact-cell {
  min-width: 120px;
}

.library-table .person-cell {
  min-width: 230px;
  white-space: nowrap !important;
}

.library-table .username-cell {
  min-width: 140px;
  white-space: nowrap;
}

.library-table .scope-cell,
.library-table .path-cell {
  min-width: 220px;
}

.library-table .permission-detail-cell {
  min-width: 300px;
  max-width: 420px;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 780px;
  background: #fff;
}

th, td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
  font-weight: 600;
}

th {
  background: #edf5ef;
  color: #244432;
  font-size: 13.5px;
  font-weight: 800;
  position: sticky;
  top: 0;
  z-index: 1;
}

tr:hover td {
  background: #fbfdfb;
}

.editable-row {
  cursor: pointer;
}

.editable-row:hover td {
  background: #f3faf5;
}

.empty-row {
  text-align: center;
  color: var(--muted);
  font-style: italic;
  font-weight: 700;
  padding: 24px 12px;
}

tr:hover .empty-row {
  background: transparent;
}

.status {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status.active { background: var(--brand-soft); color: var(--brand-strong); }
.status.expiring { background: var(--warn-soft); color: var(--warn); }
.status.expired { background: var(--danger-soft); color: var(--danger); }
.status.disabled { background: var(--info-soft); color: var(--info); }
.status.neutral { background: #eef1ee; color: #536158; }

.permission-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 12px;
  padding: 10px 12px;
  border: 1px solid #d6e7dc;
  border-radius: 8px;
  background: #fbfdfb;
}

.permission-legend strong {
  color: #143c27;
  font-size: 13px;
  font-weight: 900;
}

.permission-legend div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.permission-badge,
.permission-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}

.permission-read { background: #38a169; color: #fff; }
.permission-write { background: #a7480f; color: #fff; }
.permission-read-execute { background: #dcecff; color: #0f3c75; }
.permission-read-write { background: #ffd6a6; color: #6f3500; }
.permission-full { background: #ff1616; color: #fff; }
.permission-blank { background: #fff; color: #52635a; border: 1px solid #d3ded7; }
.permission-custom { background: #eef1ee; color: #34463b; }

.permission-select-block {
  display: grid;
  gap: 8px;
}

.permission-select-block .permission-legend {
  margin: 0;
  padding: 8px;
}

.secure-password-field .password-inline-wrap {
  display: flex;
  align-items: stretch;
  min-width: 0;
}

.secure-password-field .password-inline-wrap input {
  flex: 1;
  min-width: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.secure-password-field .password-inline-wrap .password-toggle {
  flex: 0 0 44px;
  border: 1px solid var(--border);
  border-left: 0;
  border-radius: 0 7px 7px 0;
  background: #f9fcfa;
  color: var(--brand-dark);
  font-weight: 900;
  cursor: pointer;
}

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.filter-toolbar {
  --filter-title-width: 210px;
  display: grid;
  align-items: end;
  gap: 12px;
  padding: 14px 16px;
  margin: 0 0 12px;
  border: 1px solid #cfe2d3;
  border-radius: var(--radius);
  background: #f4fbf7;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .75);
}

.product-filter-toolbar {
  grid-template-columns: var(--filter-title-width) minmax(150px, .85fr) minmax(140px, .75fr) minmax(260px, 1.45fr) minmax(150px, .85fr) minmax(150px, .8fr) auto;
}

.compact-filter-toolbar {
  background: #f7fbf8;
  box-shadow: none;
}

.user-filter-toolbar,
.device-filter-toolbar {
  align-items: end;
}

.user-filter-toolbar {
  grid-template-columns: var(--filter-title-width) minmax(220px, 1.1fr) minmax(150px, .75fr) minmax(180px, .9fr) minmax(280px, 1.35fr) auto;
}

.device-filter-toolbar {
  grid-template-columns: var(--filter-title-width) minmax(190px, .9fr) minmax(170px, .8fr) minmax(360px, 1.6fr) auto;
}

.info-filter-toolbar {
  grid-template-columns: var(--filter-title-width) minmax(210px, .9fr) minmax(360px, 1.7fr) auto;
}

.incident-filter-toolbar {
  grid-template-columns: var(--filter-title-width) minmax(170px, .75fr) minmax(190px, .85fr) minmax(360px, 1.55fr) auto;
}

.product-filter-toolbar .filter-title,
.user-filter-toolbar .filter-title,
.device-filter-toolbar .filter-title,
.info-filter-toolbar .filter-title,
.incident-filter-toolbar .filter-title {
  min-width: 0;
  margin-right: 0;
  align-self: stretch;
}

.product-filter-toolbar label,
.user-filter-toolbar label,
.device-filter-toolbar label,
.info-filter-toolbar label,
.incident-filter-toolbar label {
  display: grid;
  align-items: start;
  gap: 5px;
  min-width: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
}

.product-filter-toolbar select,
.product-filter-toolbar input,
.user-filter-toolbar select,
.user-filter-toolbar input,
.device-filter-toolbar select,
.device-filter-toolbar input,
.info-filter-toolbar select,
.info-filter-toolbar input,
.incident-filter-toolbar select,
.incident-filter-toolbar input {
  width: 100%;
  min-width: 0;
}

.product-filter-toolbar .button,
.user-filter-toolbar .button,
.device-filter-toolbar .button,
.info-filter-toolbar .button,
.incident-filter-toolbar .button {
  min-height: 39px;
  white-space: nowrap;
}

.filter-title {
  color: #244432;
  display: grid;
  align-content: end;
  gap: 7px;
  min-width: 0;
  margin-right: 0;
}

.filter-title strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.15;
}

.filter-title span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.filter-toolbar label {
  display: grid;
  align-items: start;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  min-width: 0;
}

.filter-toolbar label span {
  white-space: nowrap;
}

.filter-toolbar select,
.filter-toolbar input {
  min-width: 0;
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-weight: 700;
}

.filter-toolbar .filter-clear {
  min-width: 86px;
  min-height: 40px;
  align-self: end;
}

.filter-toolbar label.is-active-filter,
.filter-toolbar .filter-field.is-active-filter,
.filter-toolbar .filter-field.is-active,
.audit-filter-block label.is-active-filter {
  background: #fff6c9;
  border-color: #f3c64b;
  box-shadow: inset 0 0 0 1px rgba(243, 198, 75, 0.35);
}

.filter-toolbar select.is-active-filter,
.filter-toolbar input.is-active-filter,
.filter-toolbar .filter-field.is-active select,
.filter-toolbar .filter-field.is-active input,
.audit-filter-block select.is-active-filter,
.audit-filter-block input.is-active-filter {
  border-color: #dca90d;
  background: #fffdf0;
}

.library-filter-toolbar {
  grid-template-columns: var(--filter-title-width) minmax(155px, .95fr) minmax(155px, .95fr) minmax(155px, .95fr) minmax(155px, .95fr) minmax(155px, .95fr) minmax(230px, 1.35fr) auto;
}

.library-filter-toolbar .filter-title {
  min-width: 0;
  margin-right: 0;
  display: grid;
  align-content: end;
  justify-content: flex-start;
  gap: 7px;
}

.library-filter-toolbar .filter-title span {
  display: inline-flex;
  align-items: center;
  min-height: auto;
  color: #53645a;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.library-filter-toolbar label {
  display: grid;
  align-items: start;
  gap: 5px;
  border: 1px solid transparent;
  border-radius: 8px;
  min-width: 0;
  padding: 0;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.library-filter-toolbar .filter-field.is-active {
  background: #fff6c9;
  border-color: #f3c64b;
  box-shadow: inset 0 0 0 1px rgba(243, 198, 75, 0.35);
}

.library-filter-toolbar .filter-field.is-active select,
.library-filter-toolbar .filter-field.is-active input {
  border-color: #dca90d;
  background: #fffdf0;
}

.library-filter-toolbar select,
.library-filter-toolbar input {
  width: 100%;
  min-width: 0;
}

.library-filter-toolbar .button {
  min-height: 39px;
  white-space: nowrap;
}

@media (max-width: 1280px) {
  .library-filter-toolbar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .library-filter-toolbar .filter-title {
    grid-column: span 2;
  }
}

@media (max-width: 1400px) {
  .product-filter-toolbar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .user-filter-toolbar,
  .device-filter-toolbar,
  .info-filter-toolbar,
  .incident-filter-toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .product-filter-toolbar .filter-title,
  .user-filter-toolbar .filter-title,
  .device-filter-toolbar .filter-title,
  .info-filter-toolbar .filter-title,
  .incident-filter-toolbar .filter-title {
    grid-column: span 2;
  }
}

.report-compose-card .table-titlebar {
  margin-bottom: 14px;
}

.report-option-panel {
  border: 1px solid #cfe2d3;
  border-radius: var(--radius);
  background: #f7fbf8;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.report-option-head {
  display: flex;
  gap: 10px;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.report-option-panel h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}

.report-option-head span {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
}

.report-option-accordion {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.report-option-group {
  border: 1px solid #d9e8dd;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.report-option-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  padding: 9px 12px;
  cursor: pointer;
  list-style: none;
  color: #083726;
  font-weight: 900;
}

.report-option-group summary::-webkit-details-marker {
  display: none;
}

.report-option-group summary::before {
  content: "▸";
  color: var(--green);
  font-size: 13px;
}

.report-option-group[open] summary::before {
  content: "▾";
}

.report-option-group summary span {
  flex: 1 1 auto;
}

.report-option-group summary strong {
  border-radius: 999px;
  background: #e6f3eb;
  color: #006236;
  padding: 3px 8px;
  font-size: 12px;
  white-space: nowrap;
}

.report-option-group .report-chip-row {
  padding: 0 12px 12px;
}

.report-chip-row {
  margin: 6px 0 0;
}

.report-subhead {
  margin: 0 0 10px;
}

.mini-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid #dfe8df;
  border-radius: 8px;
  background: #fbfdfb;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.checkbox-label input {
  margin: 0;
  width: auto;
}

.action-group {
  justify-content: flex-end;
  margin-bottom: 0;
}

.audit-head {
  align-items: flex-start;
}

.audit-panel {
  padding: 8px 0 0;
}

.audit-layout-head {
  display: grid;
  place-items: center;
  min-height: 30px;
  margin: 0 0 2px;
}

.audit-layout-head h3 {
  margin: 0;
  font-size: 21px;
  font-weight: 900;
  text-align: center;
}

.audit-head {
  display: block;
  margin: 0;
  padding: 0 4px 10px;
}

.audit-control-card {
  display: grid;
  grid-template-columns: minmax(760px, 1fr) minmax(370px, auto);
  grid-template-areas:
    "filters summary"
    "filters actions";
  align-items: end;
  gap: 4px 10px;
  width: 100%;
  max-width: none;
  margin-left: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.audit-filter-block {
  grid-area: filters;
  display: grid;
  grid-template-columns:
    minmax(126px, .82fr)
    minmax(158px, 1fr)
    minmax(124px, .78fr)
    minmax(158px, 1fr)
    minmax(104px, .68fr)
    minmax(250px, 1.55fr);
  align-items: end;
  justify-content: stretch;
  gap: 8px;
  min-width: 0;
}

.audit-filter-summary {
  grid-area: summary;
  display: grid;
  justify-items: end;
  align-content: end;
  gap: 4px;
  min-height: 38px;
  padding-right: 2px;
}

.audit-filter-block .command-label,
.audit-filter-summary .command-label {
  text-align: left;
}

.audit-filter-block .filter-count,
.audit-filter-summary .filter-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 0;
  white-space: nowrap;
}

.audit-action-block {
  grid-area: actions;
  display: grid;
  grid-template-columns: 104px 96px 84px 76px;
  align-items: end;
  justify-content: flex-end;
  gap: 8px;
  white-space: nowrap;
}

.audit-filter-block label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.audit-filter-block select,
.audit-filter-block input {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 8px 10px;
}

.audit-action-block .button {
  min-height: 36px;
  padding: 8px 10px;
}

.audit-panel .table-wrap {
  margin-top: 0;
}

.hidden-control {
  display: none !important;
}

.split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
}

.form-grid label {
  display: grid;
  gap: 6px;
  color: #46564b;
  font-size: 13.5px;
  font-weight: 700;
}

.full { grid-column: 1 / -1; }

.library-permission-form {
  grid-template-columns: minmax(300px, 1fr) minmax(300px, 1fr);
  column-gap: 28px;
  row-gap: 14px;
  align-items: start;
}

.library-permission-form label {
  min-width: 0;
  overflow: hidden;
}

.library-permission-form input,
.library-permission-form select,
.library-permission-form textarea {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.library-folder-tool {
  display: grid;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #cfe2d5;
  border-radius: 8px;
  background: #f7fbf8;
}

.library-folder-manager-panel {
  margin: 14px 0;
}

.library-folder-manager-panel.is-open {
  padding: 0;
  overflow: hidden;
}

.library-folder-manager-panel.is-collapsed {
  padding: 0;
  background: #fff;
}

body.library-folder-window-open {
  overflow: hidden;
}

.library-folder-manager-panel.is-maximized {
  position: fixed;
  inset: 12px;
  z-index: 120;
  width: auto;
  height: auto;
  margin: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border-radius: 12px;
  background: #f7fbf8;
  box-shadow: 0 0 0 100vmax rgba(10, 25, 17, .48), 0 22px 70px rgba(0, 0, 0, .28);
}

.library-folder-manager-panel.is-maximized .library-folder-toggle-head {
  border-bottom: 1px solid #d7e5db;
  border-radius: 12px 12px 0 0;
  background: #fff;
}

.library-folder-manager-panel.is-maximized .library-folder-manager-body {
  min-height: 0;
  overflow: hidden;
  padding-top: 14px;
}

.library-folder-manager-panel.is-maximized .library-file-manager {
  min-height: 0;
  height: 100%;
  grid-template-rows: auto auto auto minmax(0, 1fr);
}

.library-folder-manager-panel.is-maximized .library-file-browser {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.library-folder-manager-panel.is-maximized .library-file-tree {
  min-height: 0;
  height: 100%;
  max-height: none !important;
}

.library-folder-picker {
  padding-top: 10px;
}

.library-folder-toggle-head,
.library-folder-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.library-folder-toggle-head {
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.library-folder-toggle-head:hover {
  background: #eef7f1;
}

.library-folder-toggle-icon {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  background: #e5f3ea;
  color: var(--brand-dark);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}

.library-folder-manager-body {
  display: grid;
  gap: 10px;
  padding: 0 14px 14px;
}

.library-folder-manager-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.library-folder-head strong {
  display: block;
  color: #082c20;
  font-size: 14px;
  font-weight: 800;
}

.library-folder-toggle-head strong,
.library-folder-head span {
  display: block;
}

.library-folder-toggle-head strong {
  color: #082c20;
  font-size: 15px;
  font-weight: 900;
}

.library-folder-toggle-head span:not(.library-folder-toggle-icon),
.library-folder-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

.library-folder-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.library-folder-actions .button {
  min-height: 34px;
  white-space: nowrap;
}

.library-folder-action-menu {
  position: relative;
}

.library-folder-action-menu > summary {
  list-style: none;
  cursor: pointer;
}

.library-folder-action-menu > summary::-webkit-details-marker {
  display: none;
}

.library-folder-action-menu > summary::after {
  content: "▾";
  margin-left: 7px;
  font-size: 11px;
}

.library-folder-action-menu[open] > summary::after {
  content: "▴";
}

.library-folder-action-menu-items {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  right: 0;
  min-width: 150px;
  display: grid;
  gap: 3px;
  padding: 6px;
  border: 1px solid #d4e2d8;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(14, 49, 35, .16);
}

.library-folder-action-menu-items button {
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #173b2e;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.library-folder-action-menu-items button:hover {
  background: #eef6f1;
}

.library-folder-action-menu-items button.danger {
  color: #b42318;
}

.library-folder-action-menu-items button.danger:hover {
  background: #fff0ee;
}

.library-folder-filter {
  display: grid;
  gap: 6px;
  color: #46564b;
  font-size: 13px;
  font-weight: 800;
}

.library-folder-filter input {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  border: 1px solid #d6e4da;
  border-radius: 7px;
  background: #fff;
  padding: 9px 10px;
  color: var(--text);
  font-weight: 700;
}

.library-folder-tree {
  max-height: 300px;
  overflow: auto;
  padding: 6px;
  border: 1px solid #d9e7dd;
  border-radius: 8px;
  background: #fff;
}

.library-folder-manager-panel .library-folder-tree {
  min-height: 74px;
  max-height: 190px;
}

.library-folder-picker .library-folder-tree {
  max-height: 220px;
}

.library-folder-row {
  display: grid;
  gap: 1px;
}

.library-folder-node {
  width: 100%;
  min-height: 30px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 8px 4px calc(6px + var(--folder-depth, 0) * 20px);
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #173b2e;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.library-folder-node:hover {
  background: #eef5f0;
}

.library-folder-node.active {
  background: #dcefe5;
  color: var(--brand-dark);
  box-shadow: inset 3px 0 0 var(--brand);
}

.folder-caret {
  width: 14px;
  color: #326352;
  font-size: 17px;
  line-height: 1;
  text-align: center;
  flex: 0 0 14px;
}

.folder-icon {
  width: 17px;
  height: 13px;
  flex: 0 0 17px;
  position: relative;
  border-radius: 2px;
  background: linear-gradient(#ffd66b, #f4b82e);
  box-shadow: inset 0 -1px 0 rgba(117, 79, 0, .18);
}

.folder-icon::before {
  content: "";
  position: absolute;
  left: 1px;
  top: -4px;
  width: 8px;
  height: 5px;
  border-radius: 2px 2px 0 0;
  background: #f6c24c;
}

.folder-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-badge {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: #eef4ef;
  color: #607267;
  font-size: 11px;
  font-weight: 800;
}

.library-file-manager {
  display: grid;
  gap: 10px;
}

.library-file-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #d9e7dd;
  border-radius: 8px;
  background: #fff;
}

.library-file-toolbar-title strong {
  display: block;
  color: #082c20;
  font-size: 15px;
  font-weight: 900;
}

.library-file-toolbar-title span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
}

.library-file-actions {
  align-items: center;
}

.library-file-breadcrumb {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid #d9e7dd;
  border-radius: 8px;
  background: #fff;
  overflow: auto;
  white-space: nowrap;
}

.library-file-crumb {
  border: 0;
  background: transparent;
  color: var(--brand-dark);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  padding: 2px 4px;
}

.library-file-crumb:hover {
  text-decoration: underline;
}

.library-file-crumb-sep {
  color: #83958b;
  font-weight: 900;
}

.library-file-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 1.35fr);
  gap: 10px;
  align-items: end;
}

.library-file-path-field input {
  background: #f8fbf8;
  color: #0b3d2d;
}

.library-file-browser {
  border: 1px solid #d9e7dd;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.library-file-browser-head {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 9px 12px;
  background: #edf6f0;
  color: #183f31;
  font-size: 12px;
  font-weight: 900;
}

.library-file-tree {
  border: 0;
  border-radius: 0;
  max-height: 260px !important;
}

.library-file-tree .library-folder-node {
  min-height: 34px;
}

@media (max-width: 720px) {
  .library-permission-form {
    grid-template-columns: 1fr;
  }

  .library-filter-toolbar {
    grid-template-columns: 1fr;
  }

  .library-folder-head {
    grid-template-columns: 1fr;
  }

  .library-folder-manager-toolbar {
    grid-template-columns: 1fr;
  }

  .library-file-toolbar,
  .library-file-controls {
    grid-template-columns: 1fr;
  }

  .library-folder-actions {
    justify-content: stretch;
  }

  .library-folder-actions .button {
    flex: 1 1 120px;
  }
}

.library-folder-empty {
  padding: 16px;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.library-permission-add {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid #d9e8dd;
  border-radius: 8px;
  background: #f8fbf8;
}

.library-permission-add span {
  color: #53645a;
  font-size: 13px;
  font-weight: 700;
}

.library-permission-list {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #cfe2d5;
  border-radius: 8px;
  background: #fbfdfb;
}

.library-permission-list-head {
  display: flex;
  gap: 8px;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
}

.library-permission-list-head span,
.library-permission-empty {
  color: #617267;
  font-size: 13px;
  font-weight: 700;
}

.library-permission-rows {
  display: grid;
  gap: 6px;
}

.library-permission-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid #d9e8dd;
  border-radius: 8px;
  background: #fff;
}

.library-permission-row-path {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 800;
  color: #09291d;
}

@media (max-width: 720px) {
  .library-permission-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .library-permission-row .button {
    width: 100%;
  }
}

.document-upload-field small {
  color: var(--muted);
  line-height: 1.45;
}

.file-upload-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 9px;
  border: 1px dashed #b9d9c5;
  border-radius: 7px;
  background: #f7fbf8;
}

.document-drop-zone {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 86px;
  padding: 14px 16px;
  border: 2px dashed #9fcbb0;
  border-radius: 10px;
  background: linear-gradient(135deg, #f7fbf8, #eef8f1);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.document-drop-zone:hover,
.document-drop-zone:focus-visible,
.document-drop-zone.is-dragging {
  border-color: var(--brand-strong);
  background: #e7f6ec;
  box-shadow: 0 0 0 3px rgba(28, 120, 71, 0.12);
  outline: none;
}

.document-drop-zone.is-dragging {
  transform: translateY(-1px);
}

.document-drop-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: var(--brand-strong);
  background: #d9efe0;
  font-size: 27px;
  font-weight: 800;
}

.document-drop-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.document-drop-copy strong {
  color: #183f29;
  font-size: 14px;
}

.document-drop-copy span {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

.document-upload-field > .file-upload-status {
  min-height: 20px;
}

@media (max-width: 640px) {
  .document-drop-zone {
    grid-template-columns: auto 1fr;
  }

  .document-drop-zone .button {
    grid-column: 1 / -1;
    justify-self: stretch;
  }
}

.file-upload-status {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.file-link {
  color: var(--brand-strong);
  font-weight: 700;
  text-decoration: none;
}

.file-link:hover {
  text-decoration: underline;
}

.product-smart-field {
  position: relative;
  z-index: 3;
}

.product-quick-pick {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  max-height: 280px;
  overflow: auto;
  padding: 10px;
  border: 1px solid #cfe2d3;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(31, 55, 38, 0.18);
}

.product-quick-pick.open {
  display: grid;
  gap: 8px;
}

.product-quick-pick-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.product-quick-pick-list {
  display: grid;
  gap: 6px;
}

.product-suggestion-button {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid #dfe8df;
  border-radius: 7px;
  background: #fbfdfb;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.product-suggestion-button:hover,
.product-suggestion-button:focus {
  border-color: #b9d8c6;
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.product-suggestion-empty {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.note {
  background: #eef7f0;
  border: 1px solid #cde5d4;
  border-radius: var(--radius);
  padding: 12px;
  color: #315b3d;
  font-weight: 700;
  line-height: 1.5;
}

.utility-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.system-users-card {
  padding: 18px;
}

.system-users-card .section-head {
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.system-users-table table {
  min-width: 980px;
}

.system-users-table input,
.system-users-table select {
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
}

.customer-access-editor {
  display: grid;
  gap: 6px;
  min-width: 260px;
  color: var(--text);
}

.customer-access-editor label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  font-size: 13px;
  font-weight: 700;
}

.customer-access-editor input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  padding: 0;
  flex: 0 0 16px;
}

.customer-access-editor details {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.customer-access-editor summary {
  min-height: 34px;
  padding: 8px 10px;
  cursor: pointer;
  color: var(--brand-strong);
  font-weight: 800;
}

.customer-access-list {
  max-height: 150px;
  overflow: auto;
  padding: 6px 10px 9px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 4px;
}

.customer-access-all {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--brand-soft);
  font-weight: 800;
}

.customer-access-editor.is-disabled {
  opacity: 0.66;
}

.module-access-editor {
  display: grid;
  gap: 6px;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px dashed #d4e3d7;
}

.module-access-editor > strong {
  color: var(--brand-strong);
  font-size: 12.5px;
  font-weight: 900;
}

.module-access-editor > small {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.3;
}

.module-access-note {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #d6e6d8;
  border-radius: 7px;
  background: #f4faf5;
  color: var(--brand-strong);
  font-size: 12.5px;
  font-weight: 800;
}

.module-access-group {
  border: 1px solid #d6e6d8;
  border-radius: 7px;
  background: #fbfdfb;
}

.module-access-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
  padding: 8px 10px;
  cursor: pointer;
  color: var(--brand-strong);
  font-size: 12.5px;
  font-weight: 900;
}

.module-access-group summary b {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--brand-soft);
  font-size: 11px;
}

.module-access-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px 0;
  border-top: 1px solid var(--line);
}

.module-access-actions button {
  min-height: 26px;
  padding: 5px 8px;
  border: 1px solid #cfe2d3;
  border-radius: 6px;
  background: #fff;
  color: var(--brand-strong);
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
}

.module-access-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 8px;
  max-height: 220px;
  overflow: auto;
  padding: 8px 10px 10px;
}

.module-access-grid label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 26px;
  padding: 3px 0;
  font-size: 12.5px;
}

.module-access-grid label.module-access-custom span {
  color: var(--brand-strong);
}

.module-access-parent {
  min-width: 0;
  border: 1px solid #dbe9de;
  border-radius: 7px;
  background: #fff;
}

.module-access-parent summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 6px 8px;
  cursor: pointer;
  color: var(--brand-strong);
  font-size: 12.5px;
  font-weight: 900;
}

.module-access-parent-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.module-access-parent-count {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 11px;
  font-weight: 900;
}

.module-access-parent-main,
.module-access-children {
  display: grid;
  gap: 2px;
  padding: 4px 8px 8px 18px;
  border-top: 1px dashed #dbe9de;
}

.module-access-parent-main {
  padding-bottom: 2px;
}

.module-access-children {
  padding-top: 2px;
}

.module-access-child {
  min-width: 0;
}

.module-access-child span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-users-table .password-input-wrap {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 38px;
  align-items: stretch;
  gap: 6px;
}

.system-users-table .password-input-wrap input {
  min-width: 160px;
}

.password-toggle {
  width: 38px;
  min-width: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--brand-strong);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}

.password-toggle:hover,
.password-toggle.is-visible {
  background: var(--brand-soft);
  border-color: #b9d8c6;
}

.password-toggle:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.system-users-table input:disabled,
.system-users-table select:disabled {
  background: #f7faf7;
  color: #526158;
  cursor: not-allowed;
}

.system-users-table .center-cell {
  text-align: center;
  vertical-align: middle;
}

.system-users-table .center-cell input {
  width: 17px;
}

.utility-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #fbfdfb;
}

.utility-card .label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.utility-card .value {
  margin-top: 4px;
  font-size: 20px;
  font-weight: 800;
}

.permission-note {
  border: 1px solid #d7e5da;
  border-radius: var(--radius);
  padding: 12px;
  background: #fbfdfb;
  color: var(--muted);
  font-weight: 700;
  margin: 10px 0 0;
}

body[data-role="viewer"] .nav-item[data-view="reports"],
body[data-role="viewer"] .nav-item[data-view="settings"],
body[data-role="viewer"] .nav-item[data-view="infoVault"],
body[data-role="viewer"] .nav-item[data-view="incidents"],
body[data-role="viewer"] .nav-item[data-view="maintenanceSteps"],
body[data-role="viewer"] .nav-item[data-view="maintenanceAgent"],
body[data-role="viewer"] .nav-item[data-view="maintenanceReports"],
body[data-role="viewer"] .incident-nav-block,
body[data-role="viewer"] .maintenance-nav-block,
body[data-role="viewer"] .system-nav-group,
body[data-role="viewer"] .settings-subnav,
body[data-role="viewer"] .data-menu,
body[data-role="viewer"] .toolbar-note,
body[data-role="viewer"] .viewer-only-notice {
  display: none !important;
}

.role-pill {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 800;
}

.audit-readable-detail {
  display: grid;
  gap: 4px;
  max-width: 920px;
  line-height: 1.45;
}

.audit-readable-detail small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

tr.audit-row-danger {
  background: #fff1f1;
}

tr.audit-row-danger td {
  border-bottom-color: #f3c0c0;
}

tr.audit-row-danger td:first-child {
  box-shadow: inset 4px 0 0 #c9221f;
}

tr.audit-row-danger:hover {
  background: #ffe6e6;
}

tr.audit-row-warning {
  background: #fff8df;
}

tr.audit-row-warning td {
  border-bottom-color: #efd99a;
}

tr.audit-row-warning td:first-child {
  box-shadow: inset 4px 0 0 #d99a00;
}

tr.audit-row-warning:hover {
  background: #fff1bf;
}

.maintenance-agent-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 1fr);
  gap: 16px;
  margin-top: 14px;
}

.workstation-workflow,
.stability-plan,
.maintenance-comparison {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid #d5e6d9;
  border-radius: 10px;
  background: #f7fbf8;
}

.workstation-workflow-head,
.stability-plan-head,
.maintenance-comparison-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.workstation-workflow-head h4,
.stability-plan-head h4,
.maintenance-comparison-head h4 {
  margin: 0 0 4px;
  color: var(--brand-strong);
  font-size: 15px;
  font-weight: 900;
}

.workstation-workflow-head p,
.stability-plan-head span,
.maintenance-comparison-head p,
.maintenance-comparison-head > span {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.workstation-workflow-grid,
.stability-plan-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.workstation-workflow-card,
.stability-plan-card {
  min-width: 0;
  padding: 13px;
  border: 1px solid #dce9df;
  border-radius: 9px;
  background: #fff;
}

.workstation-workflow-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
}

.workstation-workflow-card > b {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #dff1e5;
  color: var(--brand-strong);
  font-size: 12px;
}

.workstation-workflow-card h5,
.stability-plan-card h5 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.workstation-workflow-card p,
.stability-plan-card p {
  margin: 0;
  color: #496153;
  font-size: 12px;
  line-height: 1.5;
}

.stability-plan-card > span {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e7f5eb;
  color: var(--brand-strong);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.maintenance-comparison-cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 9px;
  margin-bottom: 12px;
}

.maintenance-comparison-cards article {
  position: relative;
  min-width: 0;
  min-height: 100px;
  padding: 12px;
  border: 1px solid #dce9df;
  border-radius: 9px;
  background: #fff;
}

.maintenance-comparison-cards article > span:first-child {
  display: block;
  min-height: 32px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.35;
  text-transform: uppercase;
}

.maintenance-comparison-cards strong {
  display: inline-block;
  margin-top: 6px;
  color: var(--brand-strong);
  font-size: 24px;
  font-weight: 950;
}

.maintenance-trend {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  margin-left: 8px;
  padding: 3px 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.maintenance-trend.good { background: #dff3e5; color: #116a3b; }
.maintenance-trend.bad { background: #ffe4df; color: #a62819; }
.maintenance-trend.neutral { background: #edf1ee; color: #5c6e63; }

.maintenance-comparison-table-wrap {
  overflow-x: auto;
}

.maintenance-comparison-table {
  min-width: 620px;
}

.maintenance-comparison-table th,
.maintenance-comparison-table td {
  padding: 8px 10px;
}

.maintenance-agent-panel,
.maintenance-agent-guide {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fbfdfb;
  padding: 14px;
}

.maintenance-agent-panel h4,
.maintenance-agent-guide h4 {
  margin: 0 0 12px;
  color: var(--text);
  font-weight: 900;
}

.agent-task-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 8px;
}

.checkbox-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  font-weight: 800;
}

.compact-form-grid {
  gap: 10px;
}

.maintenance-agent-guide {
  margin-top: 14px;
}

.maintenance-agent-guide ol {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
  font-weight: 750;
}

.danger-soft {
  border-color: #f3c7c1;
  background: #fff5f3;
  color: #8c2118;
}

@media (max-width: 980px) {
  .maintenance-agent-layout,
  .agent-task-grid,
  .workstation-workflow-grid,
  .stability-plan-grid {
    grid-template-columns: 1fr;
  }
  .maintenance-comparison-cards {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }
}

.path-box {
  font-family: Consolas, "Courier New", monospace;
  font-weight: 700;
  word-break: break-all;
}

@media (max-width: 980px) {
  .utility-grid { grid-template-columns: 1fr 1fr; }
}

dialog {
  border: 0;
  padding: 0;
  border-radius: var(--radius);
  width: min(720px, 94vw);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.22);
}

dialog.is-maximized {
  width: min(1480px, calc(100vw - 24px)) !important;
  height: calc(100dvh - 24px);
  max-height: calc(100dvh - 24px) !important;
}

dialog.is-maximized .dialog-card,
dialog.is-maximized .incident-detail-shell {
  height: calc(100dvh - 24px);
  max-height: calc(100dvh - 24px) !important;
}

dialog.is-minimized {
  position: fixed;
  inset: auto 22px 22px auto;
  margin: 0;
  width: min(520px, 94vw) !important;
}

dialog.is-minimized .dialog-card,
dialog.is-minimized .incident-detail-shell {
  max-height: none !important;
}

dialog.is-minimized .dialog-body,
dialog.is-minimized .dialog-actions,
dialog.is-minimized .incident-detail-body {
  display: none !important;
}

dialog.incident-edit-dialog {
  width: min(980px, 96vw);
  max-height: 92vh;
}

dialog.library-permission-dialog {
  width: min(1120px, 96vw);
  height: min(92vh, 920px);
  max-height: 92vh;
  overflow: hidden;
}

dialog.library-permission-dialog .dialog-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}

dialog.library-permission-dialog .dialog-head {
  position: sticky;
  top: 0;
  z-index: 8;
}

dialog.library-permission-dialog .dialog-body {
  overflow: auto;
  min-height: 0;
  overscroll-behavior: contain;
}

dialog.library-destination-dialog {
  width: min(940px, 96vw);
  height: min(88vh, 820px);
  max-height: 88vh;
  overflow: hidden;
}

dialog.library-destination-dialog .dialog-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%;
  overflow: hidden;
}

dialog.library-destination-dialog .dialog-body {
  min-height: 0;
  overflow: auto;
}

.library-destination-layout {
  display: grid;
  gap: 12px;
}

.library-destination-source {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid #d7e5db;
  border-radius: 8px;
  background: #f5faf7;
}

.library-destination-source span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.library-destination-source strong {
  color: #123f2d;
  overflow-wrap: anywhere;
}

.library-destination-tree-panel {
  overflow: hidden;
  border: 1px solid #d7e5db;
  border-radius: 8px;
  background: #fff;
}

.library-destination-tree-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border-bottom: 1px solid #d7e5db;
  background: #edf6f0;
}

.library-destination-tree {
  min-height: 180px;
  max-height: 280px;
  border: 0;
  border-radius: 0;
}

.library-destination-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.library-destination-fields > label {
  display: grid;
  gap: 6px;
  color: #46564b;
  font-size: 13px;
  font-weight: 800;
}

.library-destination-fields .full {
  grid-column: 1 / -1;
}

.library-conflict-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
  padding: 10px;
  border: 1px solid #d7e5db;
  border-radius: 8px;
}

.library-conflict-options legend {
  padding: 0 5px;
  color: #234638;
  font-size: 13px;
  font-weight: 900;
}

.library-conflict-options label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px;
  border: 1px solid #dce7df;
  border-radius: 7px;
  cursor: pointer;
}

.library-conflict-options label:has(input:checked) {
  border-color: #2f8a62;
  background: #edf8f2;
}

.library-conflict-options input {
  margin-top: 3px;
}

.library-conflict-options span,
.library-conflict-options small {
  display: block;
}

.library-conflict-options small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.library-destination-error {
  min-height: 18px;
  margin: 0;
  color: var(--danger);
  font-size: 13px;
  font-weight: 800;
}

@media (max-width: 720px) {
  .library-destination-fields,
  .library-conflict-options {
    grid-template-columns: 1fr;
  }

  .library-destination-tree {
    max-height: 36vh;
  }
}

dialog.incident-edit-dialog .dialog-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: 92vh;
}

dialog.incident-edit-dialog .dialog-body {
  overflow: auto;
}

dialog::backdrop { background: rgba(12, 24, 17, 0.35); }

.dialog-card { padding: 0; margin: 0; }
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  z-index: 3;
}

dialog.is-minimized .dialog-head,
dialog.is-minimized .incident-detail-head {
  cursor: move;
  user-select: none;
}
.dialog-head h3 { margin: 0; font-weight: 800; }
.dialog-body { padding: 16px; }
.dialog-actions {
  padding: 14px 16px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
}
.icon-button {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
}

.window-controls {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
}

.window-control {
  width: 34px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #425349;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.window-control:hover {
  border-color: var(--line);
  background: #eef6f1;
  color: var(--brand-strong);
}

.window-control.close:hover {
  border-color: #efb5ae;
  background: #c51d14;
  color: #fff;
}

@media (max-width: 980px) {
  .login-screen {
    padding: 0;
    place-items: stretch;
  }
  .login-shell {
    width: 100%;
    min-height: 100dvh;
    display: block;
    margin: 0;
  }
  .login-visual {
    display: none;
  }
  .login-card {
    min-height: 100dvh;
    align-content: center;
    border-radius: 0;
    box-shadow: none;
    padding: 36px max(24px, calc((100vw - 480px) / 2)) 28px;
  }
  .login-lang-switch {
    top: 18px;
    right: max(18px, calc((100vw - 480px) / 2));
  }
}

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .main {
    padding: 16px 18px 28px;
  }
  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand {
    grid-template-columns: 48px 1fr;
    margin-bottom: 12px;
  }
  .brand-logo-wrap {
    width: 48px;
    height: 48px;
  }
  .brand-logo {
    width: 44px;
    height: 44px;
  }
  .nav {
    gap: 10px;
    overflow: visible;
  }
  .nav-group { grid-template-columns: repeat(2, minmax(0, 1fr)); display: grid; gap: 4px; }
  .nav-group-title { grid-column: 1 / -1; }
  .topbar, .top-actions { align-items: stretch; flex-direction: column; }
  .command-bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }
  .command-zone {
    padding: 10px;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .command-zone:nth-child(-n + 2) {
    border-top: 0;
  }
  .command-zone:nth-child(even) {
    border-left: 1px solid var(--line);
  }
  .customer-slot select,
  .command-bar #globalSearch {
    width: 100%;
    max-width: none;
  }
  .search-zone,
  .clock-zone,
  .language-zone,
  .account-zone {
    justify-content: stretch;
  }
  .account-zone {
    flex-wrap: wrap;
    min-width: 0;
  }
  .account-actions {
    grid-template-columns: minmax(0, 1fr) 88px 72px;
    grid-template-areas:
      "user lang lang"
      "user pass logout";
  }
  .table-titlebar {
    align-items: stretch;
    flex-direction: column;
  }
  .toolbar-actions {
    justify-content: flex-start;
    margin-left: 0;
  }
  .toolbar-group {
    padding-left: 0;
    margin-left: 0;
    border-left: 0;
    padding-top: 8px;
    margin-top: 8px;
    border-top: 1px solid var(--line);
  }
  .toolbar-group:first-child {
    padding-top: 0;
    margin-top: 0;
    border-top: 0;
  }
  .top-actions-group {
    padding-left: 0;
    border-left: 0;
    padding-top: 10px;
    border-top: 1px solid var(--line);
  }
  .top-actions-group:first-child { padding-top: 0; border-top: 0; }
  .language-switch { justify-content: stretch; }
  .lang-button { flex: 1; }
  .search-group { flex-direction: column; align-items: stretch; }
  #globalSearch { width: 100%; max-width: none; }
  .kpi-grid, .split { grid-template-columns: 1fr; }
  .filter-toolbar { grid-template-columns: 1fr; }
  .filter-title { white-space: normal; }
  .form-grid { grid-template-columns: 1fr; }
  .audit-control-card {
    align-items: stretch;
    grid-template-columns: 1fr;
    grid-template-areas:
      "summary"
      "filters"
      "actions";
  }
  .audit-filter-block {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }
  .audit-filter-summary {
    justify-items: start;
  }
  .audit-action-block {
    justify-content: flex-start;
  }
}

.settings-shell {
  display: grid;
  gap: 14px;
}

.settings-tabs {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.settings-tab {
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.settings-tab:hover {
  border-color: #b9d8c6;
  background: var(--brand-soft);
}

.settings-tab.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.settings-panel {
  margin-top: 0;
}

.info-security-note {
  margin: 0 0 12px;
}

.secret-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 190px;
}

.user-password-column {
  min-width: 210px;
}

.secret-mask {
  min-width: 78px;
  color: #203c2d;
  font-family: Consolas, "Courier New", monospace;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.small-icon {
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0;
}

.muted {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.info-preset-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbf8;
}

.info-preset-row span {
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.maintenance-report-builder {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) 120px 120px auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid #d5e6d9;
  border-radius: 8px;
  background: #f7fbf8;
}

.maintenance-report-builder label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.report-content-textarea {
  min-height: 280px;
  white-space: pre-wrap;
}

.support-note-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
  border: 1px solid #d5e6d9;
  border-radius: 8px;
  background: #f7fbf8;
}

.support-note-grid label {
  padding: 10px;
  border: 1px solid #dfe8df;
  border-radius: 8px;
  background: #fff;
}

.support-note-grid textarea {
  min-height: 110px;
  resize: vertical;
}

.incident-detail-grid {
  grid-template-columns: 1fr;
  gap: 14px;
}

.incident-detail-grid .incident-step {
  gap: 9px;
  padding: 14px;
}

.incident-step-title {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #173e28;
  font-size: 14px;
  font-weight: 800;
}

.incident-step-title b {
  display: inline-grid;
  place-items: center;
  flex: 0 0 27px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  color: #fff;
  background: var(--brand-strong);
  font-size: 13px;
}

.incident-detail-grid .incident-step textarea {
  width: 100%;
  min-height: 150px;
  line-height: 1.55;
}

.incident-detail-grid .incident-step-solution textarea {
  min-height: 220px;
}

.issue-summary-cell {
  min-width: 260px;
  max-width: 420px;
}

.issue-summary-cell strong,
.issue-summary-cell small {
  display: block;
}

.issue-summary-cell small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.incident-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.incident-folder-panel {
  min-height: 240px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbf8;
}

.incident-folder-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #d9e8dc;
  color: var(--brand-strong);
  font-size: 12px;
  text-transform: uppercase;
}

.incident-folder-root,
.incident-folder-select {
  min-width: 0;
  border: 0;
  background: transparent;
  color: #254333;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.incident-folder-root {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 850;
}

.incident-folder-root:hover,
.incident-folder-root.active,
.incident-folder-row.active {
  background: #e6f4eb;
  color: var(--brand-strong);
}

.incident-folder-root.unfiled {
  margin-top: 10px;
  border-top: 1px solid #d9e8dc;
  border-radius: 0 0 7px 7px;
}

.incident-folder-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
  margin: 2px 0;
  padding-left: calc(var(--folder-depth, 0) * 16px);
  border-radius: 7px;
}

.incident-folder-select {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  padding: 8px 6px;
  font-size: 13px;
  font-weight: 750;
}

.incident-folder-select span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.incident-folder-select b,
.incident-folder-root b {
  color: var(--muted);
  font-size: 11px;
}

.incident-folder-actions {
  display: none;
  align-items: center;
  gap: 2px;
  padding-right: 4px;
}

.incident-folder-row:hover .incident-folder-actions,
.incident-folder-row:focus-within .incident-folder-actions {
  display: flex;
}

.incident-folder-actions button {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid #cfe2d3;
  border-radius: 5px;
  background: #fff;
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.incident-folder-actions button:hover {
  background: #dff1e5;
}

@media (hover: none) {
  .incident-folder-actions { display: flex; }
}

.incident-folder-empty {
  margin: 8px 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.incident-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  align-items: stretch;
  gap: 12px;
  min-height: 240px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbf8;
}

.incident-list-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 8px 12px;
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.incident-list-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.incident-view-picker {
  position: relative;
  z-index: 12;
  text-transform: none;
}

.incident-view-picker summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #cfe2d3;
  border-radius: 7px;
  background: #fff;
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
  list-style: none;
}

.incident-view-picker summary::-webkit-details-marker { display: none; }

.incident-view-picker[open] summary {
  border-color: #92c5a4;
  background: #eef8f2;
}

.incident-view-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 230px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 16px 38px rgba(8, 44, 27, 0.18);
}

.incident-view-menu button {
  width: 100%;
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) 14px;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #263b2e;
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.incident-view-menu button:hover,
.incident-view-menu button.active {
  background: #eef8f2;
  color: var(--brand-strong);
}

.incident-details-columns {
  display: none;
  grid-column: 1 / -1;
}

.incident-card {
  width: 100%;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 4px 10px;
  margin-bottom: 0;
  padding: 12px;
  border: 1px solid #dfe8df;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.incident-card:hover,
.incident-card.active {
  border-color: #92c5a4;
  background: #eef8f2;
  box-shadow: 0 8px 20px rgba(17, 84, 52, 0.08);
}

.incident-card-check {
  grid-row: 1 / span 3;
  padding-top: 2px;
}

.incident-card-icon {
  display: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: #dff1e5;
  color: var(--brand-strong);
  font-size: 18px;
  font-weight: 950;
}

.incident-card-title {
  color: var(--brand-strong);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.3;
}

.incident-card-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.incident-card-summary {
  max-height: 3.8em;
  overflow: hidden;
  color: #2c4737;
  font-size: 13px;
  line-height: 1.35;
}

.incident-detail-product,
.incident-detail-status,
.incident-detail-owner,
.incident-detail-date,
.incident-detail-created,
.incident-detail-issue {
  display: none;
  min-width: 0;
  color: #365142;
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.incident-view-tiles {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.incident-view-extra-large {
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
}

.incident-view-extra-large .incident-card {
  min-height: 210px;
  grid-template-columns: 28px 58px minmax(0, 1fr);
  align-content: center;
  padding: 22px;
}

.incident-view-extra-large .incident-card-icon {
  display: grid;
  width: 58px;
  height: 58px;
  border-radius: 14px;
  font-size: 27px;
}

.incident-view-extra-large .incident-card-title,
.incident-view-extra-large .incident-card-meta,
.incident-view-extra-large .incident-card-summary {
  grid-column: 3;
}

.incident-view-extra-large .incident-card-title { font-size: 19px; }
.incident-view-extra-large .incident-card-summary { max-height: 5.2em; font-size: 14px; }

.incident-view-large {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.incident-view-large .incident-card {
  min-height: 165px;
  grid-template-columns: 26px 46px minmax(0, 1fr);
  align-content: center;
  padding: 18px;
}

.incident-view-large .incident-card-icon { display: grid; width: 46px; height: 46px; }
.incident-view-large .incident-card-title,
.incident-view-large .incident-card-meta,
.incident-view-large .incident-card-summary { grid-column: 3; }

.incident-view-medium {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.incident-view-medium .incident-card-icon { display: grid; }
.incident-view-medium .incident-card { grid-template-columns: 24px 36px minmax(0, 1fr); }
.incident-view-medium .incident-card-title,
.incident-view-medium .incident-card-meta,
.incident-view-medium .incident-card-summary { grid-column: 3; }

.incident-view-small {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}

.incident-view-small .incident-card {
  grid-template-columns: 22px 25px minmax(0, 1fr);
  align-items: center;
  padding: 8px 10px;
}

.incident-view-small .incident-card-icon { display: grid; width: 25px; height: 25px; border-radius: 6px; font-size: 13px; }
.incident-view-small .incident-card-title { font-size: 13px; }
.incident-view-small .incident-card-meta,
.incident-view-small .incident-card-summary { display: none; }

.incident-view-list,
.incident-view-content,
.incident-view-details {
  grid-template-columns: 1fr;
}

.incident-view-list .incident-card {
  grid-template-columns: 24px 30px minmax(0, 1fr) auto;
  align-items: center;
  padding: 9px 11px;
}

.incident-view-list .incident-card-icon { display: grid; width: 30px; height: 30px; border-radius: 7px; font-size: 14px; }
.incident-view-list .incident-card-meta { grid-column: 4; }
.incident-view-list .incident-card-summary { display: none; }

.incident-view-details .incident-details-columns,
.incident-view-details .incident-card {
  display: grid;
  grid-template-columns: 34px 190px minmax(420px, 1fr) 110px 110px 180px 100px;
  align-items: center;
  gap: 10px;
}

.incident-view-details .incident-details-columns {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.incident-view-details .incident-details-columns span:nth-child(4),
.incident-view-details .incident-details-columns span:nth-child(5),
.incident-view-details .incident-details-columns span:nth-child(7) {
  text-align: center;
}

.incident-view-details .incident-card { padding: 9px 12px; }
.incident-view-details .incident-card-check { grid-row: auto; }
.incident-view-details .incident-card-icon,
.incident-view-details .incident-card-title,
.incident-view-details .incident-card-meta,
.incident-view-details .incident-card-summary { display: none; }
.incident-view-details .incident-detail-issue,
.incident-view-details .incident-detail-product,
.incident-view-details .incident-detail-status,
.incident-view-details .incident-detail-owner,
.incident-view-details .incident-detail-created,
.incident-view-details .incident-detail-date { display: block; }

.incident-view-details .incident-detail-issue {
  min-width: 0;
  overflow: hidden;
  white-space: normal;
}

.incident-view-details .incident-detail-issue strong,
.incident-view-details .incident-detail-issue small {
  display: block;
}

.incident-view-details .incident-detail-issue strong {
  overflow: hidden;
  color: var(--brand-strong);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.incident-view-details .incident-detail-issue small {
  display: -webkit-box;
  max-width: 760px;
  margin-top: 4px;
  overflow: hidden;
  color: #486052;
  font-size: 12.5px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.incident-view-details .incident-detail-status,
.incident-view-details .incident-detail-created,
.incident-view-details .incident-detail-date {
  text-align: center;
}

.incident-search-highlight {
  padding: 0 2px;
  border-radius: 3px;
  background: #ffe66d;
  color: #322600;
  box-shadow: 0 0 0 1px rgba(181, 139, 0, 0.16);
}

.incident-view-content .incident-card {
  grid-template-columns: 24px 42px minmax(0, 1fr);
  padding: 16px;
}

.incident-view-content .incident-card-icon { display: grid; width: 42px; height: 42px; }
.incident-view-content .incident-card-title,
.incident-view-content .incident-card-meta,
.incident-view-content .incident-card-summary { grid-column: 3; }
.incident-view-content .incident-card-summary { max-height: none; font-size: 14px; line-height: 1.55; }

.incident-article-pane {
  min-width: 0;
}

.incident-detail-dialog {
  width: min(1180px, 96vw);
  max-height: 92vh;
  background: transparent;
  box-shadow: none;
}

.incident-detail-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  max-height: 92vh;
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.incident-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: #f7fbf8;
}

.incident-detail-head h3 {
  margin: 0;
  color: var(--brand-strong);
  font-size: 16px;
  font-weight: 900;
}

.incident-detail-body {
  min-height: 0;
  overflow: auto;
}

.incident-detail-body .incident-article {
  min-height: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.incident-article {
  min-height: 520px;
  padding: 34px 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 38px rgba(12, 54, 34, 0.08);
}

.incident-article h2 {
  max-width: 980px;
  margin: 0 0 20px;
  color: #081b12;
  font-size: clamp(24px, 2.1vw, 36px);
  font-weight: 950;
  line-height: 1.18;
}

.incident-article h3 {
  margin: 28px 0 10px;
  color: #081b12;
  font-size: 17px;
  font-weight: 950;
}

.incident-article p,
.incident-article li {
  color: #17261d;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.65;
}

.incident-article ul {
  margin: 8px 0 0;
  padding-left: 22px;
}

.incident-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  padding: 14px 0 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.incident-meta > span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #edf6f0;
  color: #17402a;
  font-size: 12px;
  font-weight: 900;
}

.incident-meta .status {
  margin: 0;
}

.incident-article-actions {
  float: right;
  display: flex;
  gap: 8px;
  margin: 0 0 10px 16px;
}

.incident-figure {
  max-width: 760px;
  margin: 12px 0 22px;
}

.incident-figure img {
  display: block;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf8;
}

.incident-figure figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.incident-file-box {
  display: inline-flex;
  margin: 10px 0 18px;
  padding: 10px 12px;
  border: 1px solid #d5e6d9;
  border-radius: 8px;
  background: #f7fbf8;
}

.empty-list-note,
.empty-article {
  color: var(--muted);
}

@media (max-width: 980px) {
  .incident-workspace {
    grid-template-columns: 1fr;
  }

  .incident-list {
    grid-template-columns: 1fr;
  }

  .incident-view-details {
    overflow-x: auto;
  }

  .incident-view-details .incident-details-columns,
  .incident-view-details .incident-card {
    min-width: 840px;
  }

  .incident-article {
    min-height: 0;
    padding: 24px 20px;
  }

  .incident-article-actions {
    float: none;
    margin: 0 0 16px;
  }

  .maintenance-report-builder {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .support-note-grid {
    grid-template-columns: 1fr;
  }

  .settings-tabs {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .settings-tab {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .main {
    padding: 14px 12px 24px;
  }
  .report-option-accordion {
    grid-template-columns: 1fr;
  }
  .sidebar {
    padding: 12px;
  }
  .nav-group {
    grid-template-columns: 1fr;
  }
  .nav-item {
    min-height: 42px;
  }
  .maintenance-report-builder {
    grid-template-columns: 1fr;
  }
  .command-bar {
    grid-template-columns: 1fr;
    padding: 10px;
  }
  .captcha-row {
    grid-template-columns: minmax(92px, 1fr) minmax(150px, 1.35fr) 38px;
    gap: 8px;
  }
  .captcha-row input {
    grid-column: auto;
  }
  .captcha-image {
    min-height: 44px;
  }
  .captcha-image svg {
    max-width: 190px;
    height: 54px;
  }
  .command-zone,
  .command-zone:nth-child(even),
  .command-zone:nth-child(-n + 2) {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 10px 0 0;
  }
  .command-zone:first-child {
    border-top: 0;
    padding-top: 0;
  }
  .customer-slot select {
    min-width: 0;
  }
  .audit-filter-block {
    display: grid;
    grid-template-columns: 1fr;
  }
  .audit-filter-block label:has(input[type="search"]) {
    grid-column: auto;
  }
  .audit-action-block {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .account-actions,
  .toolbar-actions,
  .filters,
  .filter-toolbar {
    width: 100%;
  }
  .report-option-grid {
    grid-template-columns: 1fr;
  }
  .compact-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .command-menu {
    width: 100%;
  }
  .command-menu summary {
    width: 100%;
  }
  .command-menu-panel {
    left: 0;
    right: 0;
    min-width: 0;
  }
  .account-actions {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas:
      "user"
      "lang"
      "pass"
      "logout";
  }
  .account-actions #changePasswordBtn,
  .account-actions #logoutBtn {
    max-width: none;
  }
  .language-switch {
    width: 100%;
  }
  .button,
  .dialog-actions .button {
    width: 100%;
    justify-content: center;
  }
  dialog {
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
  }
  .dialog-card {
    min-height: 100%;
    display: grid;
    grid-template-rows: auto 1fr auto;
  }
  .dialog-body {
    overflow: auto;
  }
}
