.platform-update-module {
  min-width: 0;
  padding: 18px 0 32px;
}

.platform-update-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 0 4px 16px;
  border-bottom: 1px solid var(--line);
}

.platform-update-header h3 {
  margin: 0;
  color: var(--text);
  font-size: 24px;
  letter-spacing: 0;
}

.platform-update-header p {
  max-width: 820px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.platform-update-header-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 10px;
}

.platform-update-server-badge {
  padding: 4px 8px;
  border: 1px solid #b8c8d8;
  border-radius: 4px;
  color: #36526b;
  background: #f5f8fb;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.platform-update-server-badge.is-ready {
  border-color: #76b88a;
  color: #176b36;
  background: #edf8f0;
}

.platform-update-server-badge.is-warning {
  border-color: #d0a14d;
  color: #7a4c00;
  background: #fff8e8;
}

.platform-update-admin-band {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(300px, 430px) minmax(180px, auto);
  align-items: end;
  gap: 16px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
}

.platform-update-admin-band > div:first-child {
  display: grid;
  gap: 3px;
}

.platform-update-admin-band strong,
.platform-update-admin-band label span {
  color: var(--text);
  font-size: 12px;
}

.platform-update-admin-band > div:first-child span {
  color: var(--muted);
  font-size: 11px;
}

.platform-update-admin-band label {
  display: grid;
  gap: 5px;
}

.platform-update-admin-band input,
.platform-update-dialog input,
.platform-update-dialog textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  color: var(--text);
}

.platform-update-admin-band input,
.platform-update-dialog input {
  min-height: 34px;
  padding: 6px 9px;
}

.platform-update-status {
  min-height: 34px;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.platform-update-status.is-error {
  color: #a4262c;
}

.platform-update-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.platform-update-summary-item {
  display: grid;
  gap: 4px;
  min-height: 74px;
  padding: 13px 16px;
  border-right: 1px solid var(--line);
}

.platform-update-summary-item:last-child {
  border-right: 0;
}

.platform-update-summary-item span {
  color: var(--muted);
  font-size: 11px;
}

.platform-update-summary-item strong {
  color: var(--text);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.platform-update-summary-item.is-alert strong {
  color: #b45309;
}

.platform-update-filters {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.platform-update-filter {
  min-height: 34px;
  padding: 6px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.platform-update-filter:hover,
.platform-update-filter.is-active {
  color: #0067b8;
  border-bottom-color: #0067b8;
}

.platform-update-list {
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--panel);
}

.platform-update-row {
  display: grid;
  grid-template-columns: minmax(260px, 1.45fr) minmax(150px, 0.7fr) minmax(185px, 0.8fr) minmax(185px, 0.8fr) minmax(190px, auto);
  align-items: center;
  min-height: 78px;
  border-bottom: 1px solid var(--line);
}

.platform-update-row:last-child {
  border-bottom: 0;
}

.platform-update-row:hover {
  background: #f7fafc;
}

.platform-update-row > div {
  min-width: 0;
  padding: 11px 14px;
}

.platform-update-row-main {
  display: grid;
  gap: 4px;
}

.platform-update-row-main strong {
  color: var(--text);
  font-size: 13px;
}

.platform-update-row-main p {
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform-update-meta {
  display: grid;
  gap: 3px;
}

.platform-update-meta span {
  color: var(--muted);
  font-size: 10px;
}

.platform-update-meta strong {
  overflow: hidden;
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform-update-state {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  padding: 3px 7px;
  border-radius: 4px;
  background: #e8f2fb;
  color: #185b8d;
  font-size: 10px;
  font-weight: 800;
}

.platform-update-state.is-overdue,
.platform-update-state.is-error {
  background: #fdecec;
  color: #a4262c;
}

.platform-update-state.is-due-soon,
.platform-update-state.is-warning {
  background: #fff4d6;
  color: #8a5700;
}

.platform-update-state.is-current,
.platform-update-state.is-ok,
.platform-update-state.is-unchanged,
.platform-update-state.is-reviewed {
  background: #e8f5ec;
  color: #176b36;
}

.platform-update-row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.platform-update-row-actions .btn {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 11px;
}

.platform-update-history-panel {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--text);
}

.platform-update-history-panel summary {
  padding: 12px 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.platform-update-history {
  display: grid;
  max-height: 300px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.platform-update-history-row {
  display: grid;
  grid-template-columns: 150px 150px 110px 1fr;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}

.platform-update-history-row:last-child {
  border-bottom: 0;
}

.platform-update-history-row span {
  color: var(--muted);
}

.platform-update-dialog {
  width: min(900px, calc(100vw - 32px));
}

.platform-update-dialog form {
  display: grid;
  gap: 14px;
}

.platform-update-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.platform-update-dialog-head h3 {
  margin: 0;
  font-size: 18px;
}

.platform-update-dialog-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.platform-update-form-grid {
  display: grid;
  grid-template-columns: 170px 190px minmax(230px, 1fr);
  gap: 12px;
}

.platform-update-form-grid label,
.platform-update-data-field {
  display: grid;
  align-content: start;
  gap: 5px;
  color: var(--text);
  font-size: 11px;
}

.platform-update-form-grid label:first-child {
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.platform-update-form-grid input[type="checkbox"] {
  width: 16px;
  min-height: 16px;
}

.platform-update-note-field {
  grid-column: 1 / -1;
}

.platform-update-data-field textarea {
  min-height: 360px;
  padding: 10px;
  resize: vertical;
  font-family: Consolas, "Courier New", monospace;
  font-size: 11px;
  line-height: 1.5;
}

.platform-update-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

body.dark .platform-update-server-badge {
  border-color: #40566a;
  background: #162736;
  color: #b8cada;
}

body.dark .platform-update-server-badge.is-ready {
  border-color: #347850;
  background: #132c20;
  color: #92d3a8;
}

body.dark .platform-update-server-badge.is-warning {
  border-color: #8b6d2e;
  background: #302713;
  color: #f0ca7a;
}

body.dark .platform-update-row:hover {
  background: #142738;
}

body.dark .platform-update-filter:hover,
body.dark .platform-update-filter.is-active {
  color: #8ecbfa;
  border-bottom-color: #8ecbfa;
}

body.dark .platform-update-state {
  background: #17344b;
  color: #9bd0f7;
}

body.dark .platform-update-state.is-current,
body.dark .platform-update-state.is-ok,
body.dark .platform-update-state.is-unchanged,
body.dark .platform-update-state.is-reviewed {
  background: #163323;
  color: #91d2a8;
}

body.dark .platform-update-state.is-overdue,
body.dark .platform-update-state.is-error {
  background: #3b1d22;
  color: #ffadb5;
}

body.dark .platform-update-state.is-due-soon,
body.dark .platform-update-state.is-warning {
  background: #382d16;
  color: #f3ce80;
}

@media (max-width: 1100px) {
  .platform-update-admin-band {
    grid-template-columns: 1fr 1fr;
  }

  .platform-update-status {
    grid-column: 1 / -1;
  }

  .platform-update-row {
    grid-template-columns: minmax(230px, 1.3fr) 130px 160px 170px;
  }

  .platform-update-row-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding-top: 0 !important;
  }
}

@media (max-width: 720px) {
  .platform-update-header,
  .platform-update-header-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .platform-update-admin-band,
  .platform-update-form-grid {
    grid-template-columns: 1fr;
  }

  .platform-update-summary {
    grid-template-columns: 1fr 1fr;
  }

  .platform-update-summary-item:nth-child(2) {
    border-right: 0;
  }

  .platform-update-summary-item:nth-child(-n+2) {
    border-bottom: 1px solid var(--line);
  }

  .platform-update-filters {
    overflow-x: auto;
  }

  .platform-update-filter {
    flex: 0 0 auto;
  }

  .platform-update-row {
    grid-template-columns: 1fr 1fr;
  }

  .platform-update-row-main,
  .platform-update-row-actions {
    grid-column: 1 / -1;
  }

  .platform-update-row-main p {
    white-space: normal;
  }

  .platform-update-history-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .platform-update-note-field {
    grid-column: auto;
  }

  .platform-update-dialog-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }
}
