*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  background: #f5f5f5;
  color: #222;
}

.site-header {
  background: #17324d;
  color: #fff;
  padding: 1rem;
}

.nav {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.nav a,
.nav button {
  color: #fff;
  text-decoration: none;
  background: none;
  border: 0;
  cursor: pointer;
  font: inherit;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.5rem;
}

.stack {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.compact-stack {
  gap: 0.5rem;
  margin-bottom: 0;
}

label {
  display: grid;
  gap: 0.25rem;
}

input,
select,
textarea,
button {
  padding: 0.6rem;
  font: inherit;
  max-width: 100%;
}

input,
select,
textarea {
  width: 100%;
}

.inline-form {
  display: inline;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.flashes {
  list-style: none;
  padding: 0;
}

.flash {
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  background: #e7eef5;
}

.flash.error {
  background: #f8d7da;
}

.flash.success {
  background: #d1e7dd;
}

.lang-switch {
  margin-left: auto;
  display: flex;
  gap: 0.5rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  background: #fff;
}

.data-table th,
.data-table td {
  border: 1px solid #c8d1db;
  padding: 0.6rem;
  text-align: left;
  vertical-align: top;
}

.panel {
  background: #fff;
  padding: 1rem;
  margin-bottom: 1rem;
  min-width: 0;
}

.compact-panel {
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.dashboard-topbar {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
  flex-wrap: wrap;
}

.dashboard-topbar h1 {
  margin: 0 0 0.15rem;
}

.warning-panel {
  border-left: 4px solid #cc7a00;
}

.operational-alert {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  border-left: 5px solid #cc7a00;
}

.dashboard-alerts {
  display: grid;
  gap: 0.75rem;
}

.operational-alert h2,
.operational-alert p {
  margin: 0;
}

.operational-alert h2 {
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
}

.operational-alert-critical {
  background: #fff3cd;
  border-left-color: #b36b00;
}

.operational-alert-warning {
  background: #f8d7da;
  border-left-color: #b02a37;
}

.actions {
  display: flex;
  gap: 0.75rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.metric-card h2 {
  margin-top: 0;
  font-size: 1rem;
}

.metric-value {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0.2rem 0 0.4rem;
}

.muted-text {
  color: #5e6b78;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  min-width: 0;
}

.compact-button-row {
  gap: 0.5rem;
}

.button-link {
  display: inline-block;
  padding: 0.65rem 0.9rem;
  background: #17324d;
  color: #fff;
  text-decoration: none;
}

.secondary-button {
  background: #4a6178;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
  min-width: 0;
}

.section-heading h2 {
  margin: 0;
}

.inline-summary {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  flex-wrap: wrap;
}

.compact-link-row {
  word-break: break-all;
}

.compact-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.compact-summary-grid-tight {
  margin-bottom: 0.75rem;
}

.dashboard-secondary-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) minmax(280px, 1fr);
  gap: 1rem;
  align-items: start;
}

.compact-empty {
  min-height: 0;
}

.compact-table th,
.compact-table td {
  padding: 0.45rem 0.55rem;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}

.bounded-form {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.pool-top-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem 1rem;
}

.summary-item {
  min-width: 0;
}

.summary-label {
  display: block;
  color: #5e6b78;
  font-size: 0.85rem;
  margin-bottom: 0.15rem;
}

.section-jump-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.status-block-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: start;
}

.status-action-form {
  margin: 0;
}

.compact-details {
  margin-top: 0.75rem;
}

.compact-details summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.secondary-blocks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  align-items: start;
}

.admin-entity-nav {
  margin-bottom: 1rem;
}

.admin-body {
  background: #eef2f6;
}

.admin-header {
  background: #22384f;
  color: #fff;
  padding: 0.85rem 1rem;
}

.admin-header-row {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.admin-container {
  padding-top: 1rem;
}

.admin-wallet-sandbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  align-items: start;
}

.admin-status-box {
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  background: #e7eef5;
  border: 1px solid #c8d1db;
}

.admin-status-box.success {
  background: #d1e7dd;
  border-color: #9dc6ac;
}

.admin-status-box.error {
  background: #f8d7da;
  border-color: #df9ea8;
}

.admin-inline-list {
  margin: 0;
  display: grid;
  gap: 0.65rem;
}

.admin-inline-list div {
  display: grid;
  gap: 0.15rem;
}

.admin-inline-list dt {
  font-weight: 700;
}

.admin-inline-list dd {
  margin: 0;
}

.admin-confirm-panel {
  border-left: 4px solid #17324d;
}

.mono-text {
  font-family: Consolas, "Courier New", monospace;
  word-break: break-all;
}

.status-pill {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  background: #e7eef5;
}

.compact-flash {
  margin-bottom: 0.5rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mining-entry-table td {
  vertical-align: middle;
}

.inline-edit-view {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
}

.inline-edit-button {
  padding: 0.35rem 0.55rem;
  min-width: 4.5rem;
}

.inline-edit-form {
  display: grid;
  grid-template-columns: minmax(7rem, 1fr);
  gap: 0.35rem;
  min-width: 0;
}

.inline-edit-form input {
  min-width: 0;
}

.inline-edit-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.inline-edit-form button {
  padding: 0.45rem 0.6rem;
}

.inline-edit-context {
  color: #5e6b78;
  font-size: 0.85rem;
}

.inline-edit-error {
  margin: 0;
}

.server-grid,
.split-grid,
.inline-controls {
  display: grid;
  gap: 0.75rem;
}

.server-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 1rem;
}

.split-grid,
.inline-controls {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: end;
  min-width: 0;
}

@media (max-width: 720px) {
  .status-block-grid {
    grid-template-columns: 1fr;
  }
}
