body {
  background-color: #05060a;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

.app-shell {
  min-height: 100vh;
}

#content {
  min-height: 100vh;
}

.waf-app-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.waf-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.waf-sidebar-tools {
  width: 100%;
  max-width: 196px;
  justify-content: center;
}

.waf-login-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.login-card .sidebar-lang-select {
  width: 72px;
  height: 38px;
  background: rgba(5, 6, 11, 0.9);
  border: 1px solid rgba(96, 121, 187, 0.35);
  border-radius: 10px;
  color: #f5f7ff;
  padding: 8px 28px 8px 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge-neutral {
  border: 1px solid rgba(96, 121, 187, 0.35);
  background: rgba(96, 121, 187, 0.12);
  color: #dbe5ff;
}

.badge-success {
  border: 1px solid rgba(86, 220, 160, 0.35);
  background: rgba(86, 220, 160, 0.12);
  color: #c8f2df;
}

.badge-danger {
  border: 1px solid rgba(255, 121, 121, 0.35);
  background: rgba(255, 121, 121, 0.12);
  color: #ffcaca;
}

.badge-warning {
  border: 1px solid rgba(255, 196, 102, 0.35);
  background: rgba(255, 196, 102, 0.12);
  color: #ffe5b5;
}

.waf-grid {
  display: grid;
  gap: 24px;
}

.waf-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.waf-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.waf-card {
  background: rgba(20, 26, 38, 0.92);
  border: 1px solid rgba(125, 155, 255, 0.2);
  border-radius: 14px;
  overflow: visible;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.22);
  min-width: 0;
}

.waf-card-head {
  padding: 20px 22px 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.waf-card-head > * {
  min-width: 0;
}

.waf-card-head h3,
.waf-card-head h4 {
  margin: 0;
}

.waf-card-body {
  padding: 0 22px 22px;
  min-width: 0;
}

.waf-card-head + .waf-card-body {
  padding-top: 18px;
}

.waf-stat {
  display: grid;
  gap: 4px;
}

.waf-stat-value {
  font-size: 26px;
  font-weight: 700;
}

.waf-stat-label {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.waf-form,
.waf-filters {
  display: grid;
  gap: 16px;
}

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

.waf-form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.waf-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

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

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

.waf-field label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
}

.waf-field input:not([type="checkbox"]):not([type="radio"]),
.waf-field select,
.waf-field textarea {
  width: 100%;
  box-sizing: border-box;
  background: rgba(5, 6, 11, 0.9);
  border: 1px solid rgba(96, 121, 187, 0.35);
  border-radius: 10px;
  padding: 11px 12px;
  color: #f5f7ff;
  font-size: 14px;
  outline: none;
}

.waf-field textarea {
  min-height: 96px;
  resize: vertical;
}

.waf-field input:not([type="checkbox"]):not([type="radio"]):focus,
.waf-field select:focus,
.waf-field textarea:focus {
  border-color: rgba(125, 155, 255, 0.85);
  box-shadow: 0 0 0 3px rgba(125, 155, 255, 0.22);
}

.waf-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
}

.waf-checkbox input[type="checkbox"],
.waf-checkbox input[type="radio"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
}

.waf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  min-width: 0;
}

.waf-actions.end {
  justify-content: flex-end;
}

.waf-table-wrap {
  overflow-x: auto;
  min-width: 0;
}

.waf-table {
  width: 100%;
  border-collapse: collapse;
}

.waf-table th,
.waf-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(125, 155, 255, 0.14);
  text-align: left;
  vertical-align: top;
}

.waf-table th {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.waf-table td {
  font-size: 14px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.waf-detail-table {
  table-layout: fixed;
}

.waf-detail-table th {
  width: 240px;
  min-width: 240px;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}

.waf-detail-table td {
  min-width: 0;
}

.waf-table tr:last-child td {
  border-bottom: none;
}

.waf-stack {
  display: grid;
  gap: 16px;
}

.waf-inline {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  min-width: 0;
}

.waf-inline > * {
  min-width: 0;
  max-width: 100%;
}

.waf-note {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.66);
  overflow-wrap: anywhere;
}

.muted,
label,
.badge {
  overflow-wrap: anywhere;
}

.waf-empty {
  border: 1px dashed rgba(125, 155, 255, 0.25);
  border-radius: 12px;
  padding: 18px;
  color: rgba(255, 255, 255, 0.72);
}

.waf-section-anchor {
  scroll-margin-top: 20px;
}

.waf-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.waf-list {
  display: grid;
  gap: 14px;
}

.waf-list-item {
  border: 1px solid rgba(125, 155, 255, 0.2);
  border-radius: 12px;
  padding: 16px;
  background: rgba(15, 21, 34, 0.74);
}

.waf-list-item.is-selected,
.waf-site-card.is-selected {
  border-color: rgba(125, 155, 255, 0.55);
  box-shadow: 0 0 0 1px rgba(125, 155, 255, 0.22);
}

.waf-list-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 10px;
}

.waf-list-title {
  font-size: 15px;
  font-weight: 600;
}

.waf-code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  overflow-wrap: anywhere;
}

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

.waf-loading {
  opacity: 0.8;
}

.waf-subcard {
  background: rgba(16, 22, 33, 0.8);
  min-width: 0;
  overflow: hidden;
}

.waf-crs-status-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.waf-crs-release-link {
  width: auto;
  max-width: fit-content;
  white-space: nowrap;
}

.waf-crs-console-wrap {
  display: grid;
  gap: 8px;
}

.waf-crs-console {
  border: 1px solid rgba(125, 155, 255, 0.2);
  border-radius: 10px;
  background: rgba(6, 9, 15, 0.9);
  padding: 10px;
  max-height: 240px;
  overflow: auto;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.45;
}

.waf-crs-console-line {
  color: rgba(242, 246, 255, 0.9);
  overflow-wrap: anywhere;
}

.waf-crs-console-line.is-success {
  color: #9fe6c0;
}

.waf-crs-console-line.is-error {
  color: #ffb5b5;
}

.waf-crs-console-line.is-muted {
  color: rgba(255, 255, 255, 0.6);
}

.waf-page-stack,
.waf-dashboard-stack {
  display: grid;
  gap: 24px;
}

#profile-page .profile-overview-grid {
  gap: 12px;
}

#profile-page .profile-overview-item {
  padding: 12px 14px;
  min-width: 0;
}

#profile-page .profile-overview-inline-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
  min-width: 0;
}

#profile-page .profile-overview-label {
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
  color: rgba(209, 220, 247, 0.74);
  overflow-wrap: anywhere;
}

#profile-page .profile-overview-item strong {
  display: inline;
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
  text-align: right;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  #profile-page .profile-overview-inline-row {
    flex-wrap: wrap;
  }
}

.waf-actions-between {
  justify-content: space-between;
}

.waf-sites-layout {
  align-items: start;
}

.waf-services-toolbar {
  align-items: center;
}

.waf-services-filters {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(220px, 0.7fr);
  gap: 16px;
}

.waf-services-table td,
.waf-services-table th {
  padding-top: 14px;
  padding-bottom: 14px;
}

.waf-check-col {
  width: 36px;
  text-align: center;
}

.waf-upstream-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.waf-upstream-side-col {
  display: flex;
  flex-direction: column;
  min-width: 260px;
  max-width: 340px;
}

.waf-mtls-frame {
  border: 1px solid rgba(255,255,255,0.07);
}

[data-tab-panel="upstream"] .waf-antibot-auth-grid {
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
}

.waf-upstream-3col-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(200px, 1fr);
  gap: 16px;
  align-items: start;
}

@media (max-width: 900px) {
  .waf-upstream-3col-grid {
    grid-template-columns: 1fr;
  }
}

.waf-upstream-target-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.waf-upstream-row-1,
.waf-upstream-row-2,
.waf-upstream-row-3,
.waf-upstream-row-4 {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.waf-upstream-row-1 .waf-checkbox,
.waf-upstream-row-2 .waf-checkbox,
.waf-upstream-row-3 .waf-checkbox,
.waf-upstream-row-4 .waf-checkbox {
  margin-bottom: 6px;
}

.waf-upstream-combined .waf-upstream-section-divider {
  margin-top: 4px;
}

.waf-upstream-section-divider > .waf-card-head {
  padding-top: 12px;
}

.waf-upstream-row-5,
.waf-upstream-row-6 {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.waf-upstream-row-5 .waf-checkbox,
.waf-upstream-row-6 .waf-checkbox {
  margin-bottom: 6px;
}

hr.waf-upstream-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.07);
  margin: 4px 0;
}

[data-tab-panel="websocket"] .waf-antibot-auth-grid,
[data-tab-panel="virtualpatches"] .waf-antibot-auth-grid {
  grid-template-columns: minmax(0, 1fr);
}

.waf-upstream-target-row {
  display: grid;
  grid-template-columns: 78px 220px 86px;
  gap: 12px;
}

.waf-field-compact-xs input:not([type="checkbox"]):not([type="radio"]),
.waf-field-compact-xs select {
  width: 78px;
  min-width: 78px;
  max-width: 78px;
}

.waf-field-compact-md input:not([type="checkbox"]):not([type="radio"]),
.waf-field-compact-md select {
  width: 220px;
  min-width: 220px;
  max-width: 220px;
}

.waf-field-compact-sm input:not([type="checkbox"]):not([type="radio"]),
.waf-field-compact-sm select {
  width: 140px;
  min-width: 140px;
  max-width: 140px;
}

.waf-upstream-toggle-row {
  align-items: center;
}

.waf-upstream-sni-row {
  align-items: end;
}

.waf-subframe {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid rgba(125, 155, 255, 0.22);
  border-radius: 10px;
  background: rgba(14, 21, 33, 0.55);
}

.waf-list-title-sm {
  font-size: 13px;
  font-weight: 600;
}

.waf-upstream-headers-frame .waf-note {
  margin-top: 4px;
  margin-bottom: 10px;
}

.waf-antiddos-frame {
  padding: 14px;
  border: 1px solid rgba(125, 155, 255, 0.2);
  border-radius: 12px;
  background: rgba(12, 17, 27, 0.78);
}

.waf-antiddos-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 210px));
  gap: 10px 12px;
  justify-content: start;
  align-items: start;
}

.waf-antiddos-grid .waf-field input:not([type="checkbox"]):not([type="radio"]),
.waf-antiddos-grid .waf-field select {
  width: 210px;
  min-width: 210px;
  max-width: 210px;
  padding: 9px 10px;
}

.waf-antiddos-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.waf-antiddos-live-feed-card {
  margin-top: 14px;
}

.waf-help-icon-btn {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid rgba(125, 155, 255, 0.45);
  background: rgba(18, 27, 42, 0.95);
  color: #ecf3ff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.waf-help-icon-btn:hover {
  border-color: rgba(125, 155, 255, 0.7);
  background: rgba(35, 50, 73, 0.95);
}

.waf-antiddos-feed-card {
  margin-top: 10px;
}

.waf-modal {
  position: fixed;
  inset: 0;
  z-index: 1800;
  display: grid;
  align-items: center;
  justify-items: center;
  padding: 24px;
}

.waf-modal-overlay {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(5, 8, 14, 0.7);
  cursor: pointer;
}

.waf-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(5, 8, 14, 0.72);
  cursor: pointer;
}

.waf-modal-card,
.waf-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid rgba(125, 155, 255, 0.35);
  border-radius: 14px;
  background: rgba(14, 19, 29, 0.98);
  color: #ecf3ff;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
  padding: 18px 18px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.waf-modal-card {
  width: min(1080px, 100%);
  padding: 0;
  background: rgba(14, 19, 29, 0.98);
}

.waf-modal-dialog.waf-modal-lg {
  width: min(960px, 100%);
}

.waf-modal-dialog .waf-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.waf-modal-dialog .waf-card-head h3 {
  margin: 0 0 4px 0;
  color: #ecf3ff;
}

.waf-modal-dialog .muted {
  color: rgba(232, 240, 255, 0.7);
}

.waf-modal-dialog .waf-table-wrap {
  max-height: 60vh;
  overflow: auto;
  border: 1px solid rgba(125, 155, 255, 0.2);
  border-radius: 10px;
}

.waf-modal-dialog .waf-table {
  width: 100%;
  border-collapse: collapse;
}

.waf-modal-dialog .waf-table th,
.waf-modal-dialog .waf-table td {
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
  color: #ecf3ff;
  border-bottom: 1px solid rgba(125, 155, 255, 0.18);
}

.waf-modal-dialog .waf-table thead th {
  position: sticky;
  top: 0;
  background: rgba(20, 28, 44, 0.98);
  font-weight: 600;
}

.waf-modal-dialog .waf-table tbody tr:last-child td {
  border-bottom: 0;
}

.waf-table-sort {
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.waf-table-sort:hover {
  color: #9bb7ff;
}

.waf-table-row-clickable {
  cursor: pointer;
}

.waf-table-row-clickable:hover {
  background: rgba(58, 81, 126, 0.25);
}

.waf-table-row-clickable:focus {
  outline: 1px solid rgba(125, 155, 255, 0.75);
  outline-offset: -1px;
}

.waf-link-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #f3f6ff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.waf-link-button:hover {
  color: #9bb7ff;
}

.waf-service-compact-section .waf-form-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  justify-content: start;
  min-width: 0;
}

.waf-service-compact-section .waf-field.full {
  max-width: 100%;
}

.waf-field-cert-id {
  max-width: 360px;
}

.waf-traffic-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  min-width: 0;
}

.waf-traffic-layout > * {
  min-width: 0;
}

.waf-traffic-layout .waf-subcard {
  align-self: start;
  min-width: 0;
}

.waf-service-editor-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  min-width: 0;
}

.waf-service-shell-card {
  overflow: visible;
}

.waf-service-settings-search {
  position: relative;
  max-width: 420px;
}

.waf-service-settings-search label {
  font-size: 11px;
}

.waf-service-settings-search input {
  font-size: 12px;
  padding: 8px 10px;
}

.waf-service-settings-search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 80;
  border: 1px solid rgba(125, 155, 255, 0.35);
  border-radius: 10px;
  background: rgba(10, 15, 25, 0.97);
  max-height: 260px;
  overflow-y: auto;
  padding: 6px;
  display: grid;
  gap: 4px;
}

.waf-service-settings-search-item {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #eef3ff;
  text-align: left;
  padding: 8px 10px;
  cursor: pointer;
}

.waf-service-settings-search-item:hover {
  background: rgba(125, 155, 255, 0.2);
}

.waf-service-compact-section[data-tab-panel="geo"] .waf-form-grid {
  grid-template-columns: repeat(2, minmax(220px, 360px));
}

.waf-service-compact-section[data-tab-panel="geo"] .waf-field {
  max-width: 360px;
}

.waf-service-compact-section[data-tab-panel="modsec"] .waf-form-grid {
  grid-template-columns: repeat(3, minmax(220px, 360px));
  align-items: start;
}

.waf-service-compact-section[data-tab-panel="modsec"] .waf-checkbox {
  align-self: center;
}

.waf-service-compact-section[data-tab-panel="modsec"] #service-modsecurity-custom-content {
  min-height: 120px;
}

.waf-service-compact-section[data-tab-panel="http"] .waf-form-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.waf-service-compact-section[data-tab-panel="http"] .waf-list-editor[data-list-field="allowed_methods"] {
  grid-column: span 5;
}

.waf-service-compact-section[data-tab-panel="httpheaders"] .waf-http-max-size {
  grid-column: span 3;
}

.waf-http-row-1 {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
}

.waf-http-row-1 .waf-list-editor {
  flex: 1 1 180px;
}

.waf-http-row-2 {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.waf-http-row-2 .waf-list-editor {
  flex: 1 1 180px;
}

.waf-http-row-3 {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: center;
}


.waf-service-compact-section[data-tab-panel="http"] .waf-list-editor .waf-inline .badge {
  min-height: 26px;
}

.waf-service-compact-section[data-tab-panel="http"] .waf-list-editor .waf-inline:nth-of-type(2) {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  max-height: 112px;
  overflow-y: auto;
  padding-right: 4px;
}

.waf-service-compact-section[data-tab-panel="http"] .waf-http-version-toggle {
  align-self: end;
  min-height: 44px;
}

.waf-search-highlight {
  box-shadow: 0 0 0 3px rgba(255, 208, 94, 0.42) !important;
  border-color: rgba(255, 208, 94, 0.86) !important;
}

.waf-service-wizard-nav {
  display: grid;
  gap: 10px;
}

.waf-service-wizard-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 10px 8px;
  border: none;
  border-radius: 12px;
  background: transparent;
  width: 100%;
  text-align: left;
  color: #eef3ff;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.waf-service-wizard-item:hover {
  background: rgba(24, 32, 48, 0.56);
}

.waf-service-wizard-item.is-active {
  background: rgba(38, 52, 82, 0.42);
}

.waf-service-step-index {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(125, 155, 255, 0.16);
  border: 1px solid rgba(125, 155, 255, 0.28);
  font-weight: 700;
}

.waf-service-wizard-item.is-active .waf-service-step-index {
  background: rgba(125, 155, 255, 0.26);
  border-color: rgba(125, 155, 255, 0.52);
  box-shadow: 0 0 0 1px rgba(125, 155, 255, 0.18);
}

.waf-service-wizard-copy {
  min-width: 0;
}

.waf-service-wizard-title,
.waf-service-wizard-subtitle {
  display: block;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  white-space: normal;
}

.waf-service-wizard-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  color: #f3f6ff;
}

.waf-service-wizard-subtitle {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.66);
  overflow-wrap: anywhere;
}

.waf-mode-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.waf-grid-compact {
  gap: 16px;
}

.waf-card-compact .waf-card-head {
  padding: 16px 18px 10px;
}

.waf-card-compact .waf-card-body {
  padding: 0 18px 16px;
}

.waf-form-grid-compact {
  gap: 12px;
}

.waf-card-compact .waf-field textarea {
  min-height: 72px;
}

.waf-checklist {
  display: grid;
  gap: 10px;
}

.waf-checklist-item {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(125, 155, 255, 0.18);
  background: rgba(11, 15, 24, 0.72);
}

.waf-list-remove {
  margin-left: 8px;
  border: none;
  background: transparent;
  color: #ffd1d1;
  cursor: pointer;
  font-weight: 700;
  padding: 0;
  line-height: 1;
}

.waf-list-remove:hover {
  color: #ff9b9b;
}

.waf-rate-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.waf-rate-wrap input[type="number"] {
  flex: 1 1 80px;
  min-width: 60px;
}

.waf-rate-wrap select {
  flex-shrink: 0;
  width: auto;
}

/* Disabled fields — visual dimming */
input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.waf-field:has(input:disabled) label,
.waf-field:has(select:disabled) label {
  opacity: 0.4;
}

.waf-list-input-wrap.waf-disabled {
  opacity: 0.35;
  pointer-events: none;
}

.waf-field.waf-disabled {
  opacity: 0.35;
  pointer-events: none;
}

/* Field unit suffix (r/s, px, etc.) */
.waf-field-unit {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  white-space: nowrap;
  margin-left: 4px;
}

.waf-custom-limit-rate-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.waf-custom-limit-rate-wrap input {
  width: 70px;
}

/* List editor — inline add button inside input */
.waf-list-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.waf-list-input-wrap input {
  width: 100%;
  padding-right: 40px;
}

.waf-list-add-btn {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 36px;
  border: none;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  color: rgba(255, 255, 255, 0.35);
  font-size: 18px;
  font-weight: 400;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0 6px 6px 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
}

.waf-list-input-wrap.has-value .waf-list-add-btn {
  opacity: 1;
  pointer-events: auto;
}

.waf-list-add-btn:hover {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.06);
}


.waf-status-dropdown {
  border: 1px solid rgba(96, 121, 187, 0.35);
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(5, 6, 11, 0.6);
}

.waf-status-dropdown > summary {
  cursor: pointer;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 10px;
}

.waf-status-options {
  max-height: 220px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-top: 10px;
  padding-right: 4px;
}

.waf-status-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(125, 155, 255, 0.18);
  background: rgba(10, 14, 24, 0.52);
}

.waf-status-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
}

.waf-preset-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.waf-preset-row select {
  flex: 1 1 auto;
}

.waf-template-picker {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.waf-template-option {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}

.waf-list-selected-dropdown {
  margin-top: 0;
}

.waf-list-selected-options {
  max-height: 220px;
}

.waf-list-selected-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(125, 155, 255, 0.18);
  background: rgba(10, 14, 24, 0.52);
}

.waf-list-selected-value {
  overflow-wrap: anywhere;
}

.waf-country-picker {
  width: 100%;
}

.waf-country-search {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 10px;
}

.waf-country-options {
  max-height: 260px;
}

.waf-country-option {
  display: grid;
  grid-template-columns: 18px minmax(42px, auto) minmax(0, 1fr);
  align-items: center;
}

.waf-country-option-name {
  justify-self: end;
  text-align: right;
}

img,
svg,
video,
canvas {
  max-width: 100%;
}

.waf-onboarding-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 20%, rgba(93, 134, 255, 0.14), transparent 35%),
    radial-gradient(circle at 80% 0%, rgba(90, 140, 255, 0.1), transparent 32%),
    #05060a;
}

.waf-onboarding-card {
  width: min(960px, 100%);
}

.waf-onboarding-title {
  margin: 0;
}

.waf-onboarding-steps {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.waf-onboarding-stage {
  display: grid;
  gap: 16px;
}

.waf-onboarding-actions .btn {
  min-width: 132px;
  min-height: 42px;
  padding-inline: 18px;
}

.waf-step {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(96, 121, 187, 0.28);
  background: rgba(96, 121, 187, 0.08);
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.waf-step.is-active {
  border-color: rgba(125, 155, 255, 0.58);
  background: rgba(125, 155, 255, 0.18);
  color: #eef3ff;
}

.waf-step.is-done {
  border-color: rgba(86, 220, 160, 0.38);
  background: rgba(86, 220, 160, 0.12);
  color: #d7f5e8;
}

.waf-site-card {
  border: 1px solid rgba(125, 155, 255, 0.2);
  border-radius: 12px;
  padding: 14px;
  background: rgba(15, 21, 34, 0.74);
  display: grid;
  gap: 10px;
  cursor: pointer;
}

.waf-site-card:hover {
  border-color: rgba(125, 155, 255, 0.4);
}

.waf-site-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.waf-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.waf-summary-card .waf-inline {
  justify-content: space-between;
}

.waf-password-field {
  position: relative;
}

.waf-password-field input {
  padding-right: 42px;
}

.waf-password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background: transparent;
  color: rgba(220, 232, 255, 0.82);
  cursor: pointer;
}

.waf-password-toggle:hover {
  color: #eef3ff;
}

.waf-password-toggle svg {
  width: 18px;
  height: 18px;
}

.administration-table-actions {
  justify-content: flex-end;
  min-width: 92px;
}

.administration-role-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.administration-script-file-note {
  margin-top: 8px;
}

.administration-script-card {
  gap: 14px;
  border-radius: 14px;
  padding: 14px 16px;
  background: rgba(9, 14, 24, 0.72);
  border: 1px solid rgba(125, 155, 255, 0.2);
}

.administration-script-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 2px;
}

.administration-script-title {
  margin: 0;
}

.administration-script-id {
  font-size: 12px;
  opacity: 0.9;
}

.administration-script-form {
  gap: 12px;
}

.administration-script-form-grid {
  gap: 12px;
}

.administration-script-actions {
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
}

.administration-script-result {
  margin-top: 2px;
}

.administration-script-result-card {
  gap: 10px;
  margin: 0;
  padding: 12px;
}

.administration-script-result-row {
  justify-content: space-between;
  gap: 12px;
}

.administration-script-result-row .waf-code {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.administration-script-result-actions {
  justify-content: flex-start;
  margin-top: 4px;
}

.administration-script-result-empty {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
}

.administration-modal-body {
  width: min(860px, 96vw);
}

.administration-modal-body.administration-modal-body-wide {
  width: min(1180px, 98vw);
}

.administration-modal-grid {
  align-items: start;
}

.administration-modal-note {
  margin-top: 2px;
}

.administration-role-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.administration-role-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid rgba(125, 155, 255, 0.22);
  border-radius: 12px;
  background: rgba(12, 17, 27, 0.72);
}

.administration-role-option-title {
  display: block;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.administration-role-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.administration-role-group {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(125, 155, 255, 0.2);
  border-radius: 14px;
  background: rgba(12, 17, 27, 0.78);
  min-width: 0;
}

.administration-role-group-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.administration-role-group-title {
  font-size: 14px;
  font-weight: 700;
  color: #f2f6ff;
}

.administration-role-group-note {
  margin-top: 4px;
  color: rgba(220, 232, 255, 0.68);
  font-size: 12px;
  line-height: 1.45;
}

.administration-permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.administration-permission-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px 13px;
  border: 1px solid rgba(125, 155, 255, 0.16);
  border-radius: 12px;
  background: rgba(7, 11, 19, 0.72);
  min-width: 0;
}

.administration-permission-text {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.administration-permission-label {
  font-size: 13px;
  font-weight: 600;
  color: #eef3ff;
  overflow-wrap: anywhere;
}

.administration-permission-code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  color: rgba(220, 232, 255, 0.66);
  overflow-wrap: anywhere;
}

.administration-modal-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.administration-modal-meta-item {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid rgba(125, 155, 255, 0.18);
  border-radius: 12px;
  background: rgba(12, 17, 27, 0.62);
}

.administration-modal-meta-item span {
  font-size: 12px;
  color: rgba(220, 232, 255, 0.68);
}

.administration-modal-meta-item strong {
  font-size: 14px;
  overflow-wrap: anywhere;
}

.settings-version-note {
  margin-top: 10px;
}

.settings-update-status-note {
  margin-top: 10px;
}

#sidebar {
  width: 240px;
  overflow: visible;
  background: linear-gradient(to bottom, rgba(17, 21, 32, 0.9), rgba(32, 43, 63, 0.9));
  backdrop-filter: blur(10px);
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  z-index: 1300;
}

.sidebar-logo-collapsed {
  display: none;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  align-items: center;
  justify-content: center;
  background: rgba(8, 11, 18, 0.82);
  border: 1px solid rgba(125, 155, 255, 0.35);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  color: #eef3ff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
}

.sidebar-header {
  padding: 15px 15px 10px;
  display: flex;
  flex-direction: row;
  gap: 8px;
  align-items: flex-start;
  justify-content: space-between;
  position: relative;
  overflow: visible;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.brand-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.6px;
}

.brand-subtitle {
  font-size: 13px;
  letter-spacing: 0.4px;
  color: rgba(255, 255, 255, 0.65);
  white-space: nowrap;
}

.sidebar-collapse-btn {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(125, 155, 255, 0.35);
  background: rgba(8, 11, 18, 0.82);
  color: #eef3ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.sidebar-collapse-btn:hover {
  border-color: rgba(125, 155, 255, 0.62);
  background: rgba(25, 35, 56, 0.95);
}

.sidebar-collapse-btn > span {
  display: inline-block;
  transform: rotate(180deg);
  transition: transform 0.2s ease;
  font-size: 13px;
  line-height: 1;
}

.sidebar-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px 16px;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-link {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 38px;
  border: none;
  padding: 10px 14px;
  background-color: transparent;
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s, margin 0.3s;
  margin: 0;
  border-radius: 8px;
  text-decoration: none;
  box-sizing: border-box;
}

.sidebar-link:hover {
  background-color: rgba(42, 47, 59, 0.6);
}

.sidebar-link.active {
  background-color: rgba(42, 47, 59, 0.7);
}

.sidebar-link-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-link-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  flex: 0 0 18px;
  margin-right: 12px;
}

.sidebar-link-icon svg {
  width: 18px;
  height: 18px;
}

.sidebar-link:hover .sidebar-link-icon,
.sidebar-link.active .sidebar-link-icon {
  color: inherit;
}

.sidebar-footer {
  margin-top: auto;
  padding: 18px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  min-height: 188px;
}

.sidebar-footer > * {
  width: 100%;
  max-width: 196px;
  box-sizing: border-box;
}

.sidebar-user {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(125, 155, 255, 0.35);
  background: rgba(125, 155, 255, 0.12);
  color: #e5edff;
  text-align: center;
  font-size: 13px;
}

.sidebar-tools {
  width: 100%;
  max-width: 196px;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-top: auto;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(125, 155, 255, 0.35);
  background: rgba(8, 11, 18, 0.82);
  color: #e8eeff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

.icon-btn:hover {
  border-color: rgba(125, 155, 255, 0.62);
  background: rgba(25, 35, 56, 0.95);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
  transform: translateY(-1px);
}

.sidebar-footer .sidebar-lang-select {
  width: 56px;
  height: 36px;
  max-width: 56px;
  min-width: 56px;
  padding: 6px 20px 6px 8px;
  font-size: 12px;
  border-radius: 10px;
  background: rgba(5, 6, 11, 0.85);
  border: 1px solid rgba(96, 121, 187, 0.35);
  color: #f5f7ff;
}

.sidebar-footer .app-version {
  margin-top: 8px;
  text-align: center;
  font-size: 12px;
}

@media (max-width: 1180px) {
  .waf-grid.two,
  .waf-grid.three,
  .waf-form-grid,
  .waf-form-grid.three,
  .waf-summary-grid,
  .waf-service-editor-layout,
  .waf-services-filters,
  .waf-traffic-layout,
  .waf-upstream-target-row,
  .waf-upstream-layout {
    grid-template-columns: 1fr;
  }

  .waf-field-compact-xs input:not([type="checkbox"]):not([type="radio"]),
  .waf-field-compact-xs select,
  .waf-field-compact-md input:not([type="checkbox"]):not([type="radio"]),
  .waf-field-compact-md select {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .administration-role-groups,
  .administration-permission-grid,
  .administration-role-picker {
    grid-template-columns: 1fr;
  }

  .waf-service-compact-section[data-tab-panel="http"] .waf-form-grid {
    grid-template-columns: 1fr;
  }

  .waf-service-compact-section[data-tab-panel="http"] .waf-list-editor[data-list-field="allowed_methods"],
  .waf-service-compact-section[data-tab-panel="http"] .waf-list-editor[data-list-field="ssl_protocols"],
  .waf-service-compact-section[data-tab-panel="http"] .waf-http-max-size {
    grid-column: auto;
  }
}

@media (max-width: 860px) {
  #sidebar {
    width: 74px;
  }

  #content {
    margin-left: 74px;
  }

  .brand-text,
  .sidebar-user,
  .sidebar-link-label {
    display: none;
  }

  .sidebar-logo-collapsed {
    display: inline-flex;
  }

  .sidebar-nav {
    align-items: center;
  }

  .sidebar-link {
    width: 52px;
    min-height: 44px;
    justify-content: center;
    padding: 10px;
    border-radius: 12px;
  }

  .sidebar-link-icon {
    margin-right: 0;
  }

  .sidebar-footer {
    width: 100%;
    padding: 10px 6px 12px;
    gap: 8px;
    min-height: 140px;
  }

  .sidebar-tools {
    flex-direction: column;
    gap: 8px;
    max-width: none;
    width: 100%;
  }

  .sidebar-footer .app-version {
    margin-top: 2px;
    font-size: 11px;
    white-space: nowrap;
    width: 100%;
  }

  .sidebar-collapse-btn > span {
    transform: rotate(0deg);
  }
}


.waf-custom-limit-row {
  align-items: center;
}

.waf-custom-limit-row input {
  min-width: 0;
  flex: 1 1 0;
}


.btn.active {
  border-color: rgba(125, 155, 255, 0.7);
  background: rgba(125, 155, 255, 0.22);
}

/* Error Pages tab */
.waf-error-pages-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
  transition: opacity 0.2s;
}
.waf-error-pages-list.waf-disabled {
  opacity: 0.35;
  pointer-events: none;
  user-select: none;
}
.waf-error-pages-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,.025);
  border: 1px solid rgba(255,255,255,.055);
  gap: 8px;
}
.waf-error-pages-label {
  font-size: 12.5px;
  color: var(--text-muted, rgba(200,215,255,.65));
  font-family: "SF Mono","Fira Code",Consolas,monospace;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.waf-eprow-off {
  opacity: 0.35;
}
.waf-error-pages-check {
  display: flex;
  align-items: center;
  cursor: pointer;
  flex: 0 0 auto;
}
.waf-error-pages-check input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: #818cf8;
  cursor: pointer;
}
.waf-error-pages-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  margin-bottom: 4px;
}
.waf-error-pages-header-label {
  flex: 1;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(200,215,255,0.3);
}
.waf-error-pages-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* TARINIO incident-console sidebar. Kept here as a final override for the legacy shell. */
#sidebar {
  width: 245px;
  overflow: hidden;
  background: #0d1119;
  border-right: 1px solid rgba(101, 137, 184, .24);
  box-shadow: none;
}

#content { margin-left: 245px; width: auto; }

.sidebar-header {
  min-height: 78px;
  padding: 14px 12px 12px;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(101, 137, 184, .18);
}

.sidebar-brand { display: flex; min-width: 0; align-items: center; gap: 9px; }
.sidebar-logo {
  width: 48px; height: 48px; flex: 0 0 48px; object-fit: contain;
  border-radius: 14px; padding: 4px;
  background: linear-gradient(145deg, #2a4058, #172536);
  border: 1px solid #4e6989; box-shadow: 0 8px 22px rgba(0, 0, 0, .3);
}
.brand-text { gap: 1px; padding-top: 1px; }
.brand-title { color: #f7f2e7; font-size: 15px; font-weight: 800; letter-spacing: .12em; line-height: 1.05; }
.brand-subtitle { color: #9eacbc; font-size: 10px; line-height: 1.24; letter-spacing: .02em; white-space: normal; }
.sidebar-header-actions { margin-left: 0; position: relative; display: flex; flex-direction: row; align-items: center; gap: 6px; }
.sidebar-header .icon-btn, .sidebar-collapse-btn, .sidebar-footer .icon-btn {
  width: 29px; height: 29px; min-width: 29px; border-radius: 50%;
  display: grid; place-items: center; border: 1px solid #384f6c;
  background: #101924; color: #c9d7e8; box-shadow: none;
}
.sidebar-header .icon-btn:hover, .sidebar-collapse-btn:hover, .sidebar-footer .icon-btn:hover { background: #1b293a; border-color: #668bc0; transform: none; }
.sidebar-collapse-btn { margin: 0; }
.sidebar-collapse-btn svg { width: 15px; height: 15px; display: block; }
.sidebar-collapse-btn > span { display: none; }

.sidebar-protection-mode { display: flex; flex-wrap: wrap; gap: 5px; padding: 10px 12px 5px; }
.sidebar-protection-mode span { padding: 5px 7px; border-radius: 5px; background: #1a202c; color: #8fa0b8; font-size: 10px; letter-spacing: .04em; }
.sidebar-protection-mode .sidebar-mode-break { display: none; }
.sidebar-protection-mode .is-on::before,
.sidebar-protection-mode .is-off::before { content: "●"; margin-right: 4px; font-size: 8px; }
.sidebar-protection-mode .is-on { color: #93f1cb; }
.sidebar-protection-mode .is-on::before { color: #74dfae; }
.sidebar-protection-mode .is-off::before { color: #ff6978; }

.sidebar-content { min-height: 0; }
.sidebar-nav { display: block; padding: 12px 12px 18px; overflow-y: auto; }
.sidebar-nav-group { margin: 0; padding: 0 0 15px; }
.sidebar-nav-group + .sidebar-nav-group { padding-top: 14px; border-top: 1px solid rgba(111, 139, 175, .26); }
.sidebar-group-title {
  margin: 0 0 6px; padding: 0; color: #8292a7; font-size: 10px;
  font-weight: 700; line-height: 1.4; letter-spacing: .13em; text-transform: uppercase;
}
.sidebar-link {
  min-height: 36px; margin: 2px 0; padding: 8px 9px; border: 1px solid transparent;
  border-radius: 7px; color: #d8e4f2; font-size: 13px; font-weight: 500; letter-spacing: 0;
}
.sidebar-link:hover { background: rgba(105, 132, 166, .13); border-color: transparent; color: #edf4ff; }
.sidebar-link.active { background: #222938; border-color: transparent; color: #f8fbff; box-shadow: none; }
.sidebar-link-pending { cursor: default; opacity: .92; }
.sidebar-link-icon { width: 17px; height: 17px; flex-basis: 17px; margin-right: 11px; color: #6dc4ff; }
.sidebar-link-icon svg, .sidebar-link-icon img { width: 17px; height: 17px; }
.sidebar-icon-image, .sidebar-control-icon {
  display: block;
  object-fit: contain;
  filter: invert(76%) sepia(39%) saturate(1090%) hue-rotate(171deg) brightness(102%) contrast(101%);
}
.sidebar-control-icon { width: 16px; height: 16px; }
.sidebar-link.active .sidebar-link-icon { color: #6dc4ff; }

.sidebar-footer { min-height: auto; padding: 12px 12px 15px; border-top: 1px solid rgba(101, 137, 184, .16); gap: 8px; align-items: stretch; }
.sidebar-footer > * { width: 100%; max-width: none; }
.sidebar-footer-main { display: grid; grid-template-columns: minmax(0, 1fr) 64px; align-items: center; gap: 8px; width: 100%; }
.sidebar-runtime { display: flex; flex: 0 1 auto; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; padding: 0; font-size: 11px; white-space: nowrap; }
.sidebar-runtime-status { color: #bac8d7; font-weight: 700; }
.sidebar-runtime-status::before { content: "●"; margin-right: 5px; font-size: 12px; }
.sidebar-runtime-status.is-healthy::before { color: #74dfae; }
.sidebar-runtime-status.is-unhealthy::before { color: #ff6978; }
.sidebar-revision { color: #78889c; white-space: nowrap; }
.sidebar-tools { display: grid; grid-template-columns: repeat(2, 29px); flex: 0 0 64px; width: 64px; max-width: none; place-items: center; justify-content: center; gap: 6px; }
.sidebar-footer .icon-btn { padding: 0; }
.sidebar-footer .icon-btn svg, .sidebar-footer .icon-btn img { display: block; margin: auto; }
.sidebar-footer .app-version { margin-top: 0; color: #728297; font-size: 11px; }

body.sidebar-collapsed #sidebar { width: 74px; align-items: stretch; }
body.sidebar-collapsed #content { margin-left: 74px; }
body.sidebar-collapsed .sidebar-header { min-height: auto; padding: 14px 10px; flex-direction: column; align-items: center; }
body.sidebar-collapsed .sidebar-brand { width: 100%; justify-content: center; }
body.sidebar-collapsed .sidebar-logo { width: 46px; height: 46px; flex-basis: 46px; }
body.sidebar-collapsed .brand-text, body.sidebar-collapsed .sidebar-header-actions > #notifications-btn, body.sidebar-collapsed .sidebar-header-actions > #notifications-dropdown, body.sidebar-collapsed .sidebar-group-title, body.sidebar-collapsed .sidebar-link-label, body.sidebar-collapsed #app-update-badge { display: none !important; }
body.sidebar-collapsed .sidebar-header-actions { width: 100%; margin: 0; justify-content: center; }
body.sidebar-collapsed .sidebar-collapse-btn { position: static; margin: 2px 0 0; width: 27px; height: 27px; min-width: 27px; background: #172536; }
body.sidebar-collapsed .sidebar-collapse-btn svg, body.sidebar-collapsed .sidebar-collapse-btn img { transform: rotate(180deg); }
body.sidebar-collapsed .sidebar-protection-mode { display: none; }
body.sidebar-collapsed .sidebar-nav { padding: 10px; }
body.sidebar-collapsed .sidebar-nav-group { margin: 0 0 8px; padding: 0; border: 0; }
body.sidebar-collapsed .sidebar-link { width: 52px; min-height: 44px; justify-content: center; padding: 10px; }
body.sidebar-collapsed .sidebar-link-icon { margin-right: 0; }
body.sidebar-collapsed .sidebar-footer { padding: 10px; }
body.sidebar-collapsed .sidebar-footer-main { grid-template-columns: 1fr; justify-items: center; gap: 8px; }
body.sidebar-collapsed .sidebar-runtime { width: 100%; align-items: center; text-align: center; }
body.sidebar-collapsed .sidebar-tools { grid-template-columns: 29px; width: 100%; flex-basis: auto; justify-content: center; }
body.sidebar-collapsed .sidebar-runtime-status { display: block; max-width: 52px; white-space: normal; line-height: 1.2; text-align: center; }

@media (max-width: 860px) {
  #sidebar { width: 74px; }
  #content { margin-left: 74px; }
  .sidebar-brand { justify-content: center; }
  .sidebar-logo { width: 46px; height: 46px; flex-basis: 46px; }
  .brand-text, .sidebar-header-actions > #notifications-btn, .sidebar-header-actions > #notifications-dropdown, .sidebar-group-title, .sidebar-link-label { display: none !important; }
  .sidebar-header { padding: 14px 10px; min-height: auto; flex-direction: column; }
  .sidebar-header-actions { width: 100%; margin: 0; justify-content: center; }
  .sidebar-collapse-btn { position: static; margin: 2px 0 0; width: 27px; height: 27px; min-width: 27px; background: #172536; }
  .sidebar-collapse-btn svg, .sidebar-collapse-btn img { transform: rotate(180deg); }
  .sidebar-protection-mode { display: none; }
  .sidebar-nav { padding: 10px; }
  .sidebar-nav-group { margin-bottom: 8px; }
  .sidebar-footer { padding: 10px; }
}
