.foundation-panel {
  margin-top: 16px;
}

.sync-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #fff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .05em;
}

.sync-status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d88914;
}

.sync-status.synced i { background: #2f9651; }
.sync-status.syncing i { background: #3a78c2; animation: sync-pulse 1s infinite alternate; }
.sync-status.failed i { background: #d94d42; }
.sync-status.pending i { background: #d88914; }

@keyframes sync-pulse { to { opacity: .35; transform: scale(.75); } }

.foundation-count {
  display: inline-grid;
  min-width: 32px;
  height: 32px;
  padding: 0 9px;
  place-items: center;
  border-radius: 999px;
  background: #f3f7f4;
  color: var(--primary);
  font-weight: 800;
}

.foundation-alert-list {
  display: grid;
  gap: 10px;
}

.foundation-alert {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.foundation-alert > i {
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 50%;
  background: #6b7a70;
}

.foundation-alert.warning > i { background: #d88914; }
.foundation-alert.critical > i { background: #d94d42; }
.foundation-alert.info > i { background: #3a78c2; }

.foundation-alert strong,
.foundation-alert small {
  display: block;
}

.foundation-alert small {
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.45;
}

.foundation-clear {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid #cfe6d5;
  border-radius: 12px;
  background: #f2faf4;
}

.foundation-clear > span {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  color: #278347;
  background: #dff1e4;
}

.foundation-clear svg { width: 18px; height: 18px; }
.foundation-clear strong,
.foundation-clear small { display: block; }
.foundation-clear small { margin-top: 2px; color: var(--muted); }

.foundation-db-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.foundation-db-state i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3aa35b;
  box-shadow: 0 0 0 3px #e2f4e7;
}

.reconciliation-table td:first-child strong,
.reconciliation-table td:first-child small {
  display: block;
  white-space: nowrap;
}

.reconciliation-table td:first-child small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.foundation-status {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.foundation-status.balanced {
  color: #247a42;
  background: #e4f5e9;
}

.foundation-status.issue {
  color: #b13f35;
  background: #fde9e7;
}

.foundation-footnote {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.foundation-daily-fields {
  margin: 14px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafcfb;
  overflow: hidden;
}

.foundation-daily-fields summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  cursor: pointer;
  color: var(--ink);
  font-weight: 800;
}

.foundation-daily-fields summary small {
  color: var(--muted);
  font-weight: 500;
}

.foundation-daily-fields .form-grid {
  padding: 0 14px 14px;
}

[data-role="locked"] .sidebar,
[data-role="locked"] .topbar,
[data-role="locked"] #pageContent {
  pointer-events: none;
  user-select: none;
}

.central-connection-state {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbf9;
}

.central-connection-state > span {
  display: grid;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 10px;
  color: var(--primary);
  background: #e7f2e9;
}

.central-connection-state svg { width: 18px; height: 18px; }
.central-connection-state strong,
.central-connection-state small { display: block; }
.central-connection-state small { margin-top: 3px; color: var(--muted); line-height: 1.4; }

@media (max-width: 760px) {
  .foundation-footnote,
  .foundation-daily-fields summary {
    align-items: stretch;
    flex-direction: column;
  }

  .foundation-footnote .secondary-btn { width: 100%; }
  .foundation-db-state { margin-top: 5px; }
  .sync-status span { display: none; }
  .sync-status { width: 34px; padding: 0; justify-content: center; }
}
