/* SGH DDNS Admin — minimal vanilla styles. No external fonts. */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  color: #1a1a1a;
  background: #f7f7f8;
  line-height: 1.4;
}

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  flex-wrap: wrap;
  gap: 12px;
}
.topbar h1 { font-size: 16px; margin: 0; font-weight: 600; }

/* Tabs */
.tabs { display: flex; gap: 4px; }
.tab {
  background: transparent;
  border: 1px solid transparent;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 13px;
  border-radius: 6px;
  color: #555;
}
.tab:hover { background: #f0f0f0; }
.tab.active { background: #1a73e8; color: #fff; }

/* Banner */
.banner {
  padding: 10px 20px;
  margin: 0;
  font-size: 13px;
}
.banner-error { background: #fde7e7; color: #a01e1e; border-bottom: 1px solid #f5b3b3; }
.banner-info  { background: #e7f0fd; color: #1a3e8e; border-bottom: 1px solid #b7cef5; }

/* Main panels */
main { padding: 20px; max-width: 1200px; margin: 0 auto; }
.panel[hidden] { display: none; }

.toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.toolbar input[type="search"] {
  flex: 1;
  min-width: 200px;
  padding: 7px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 13px;
}

.btn {
  padding: 7px 14px;
  border: 1px solid #ccc;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: #333;
}
.btn:hover { background: #f0f0f0; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-danger { background: #d93025; color: #fff; border-color: #b9261d; }
.btn-danger:hover { background: #b9261d; }

/* Table */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid #e0e0e0; border-radius: 6px; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th, td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
}
th { background: #fafafa; font-weight: 600; color: #555; }
tbody tr:last-child td { border-bottom: none; }
tbody tr.empty td { text-align: center; color: #888; padding: 20px; }
td.actions { white-space: nowrap; }
td.actions .btn { padding: 4px 8px; font-size: 12px; margin-right: 4px; }

/* Status dots */
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.dot.live   { background: #1e8e3e; }
.dot.stale  { background: #aaa; }
.dot.orphan { background: #d93025; }

/* Audit lists */
.audit-list {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  list-style: none;
  padding: 0;
  margin: 0 0 16px 0;
}
.audit-list li {
  padding: 8px 12px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.audit-list li:last-child { border-bottom: none; }
.audit-list li.empty { color: #888; justify-content: center; }
.hint { color: #888; font-weight: 400; font-size: 12px; }
.meta { color: #888; font-size: 12px; margin-top: 8px; }

h2 { font-size: 14px; margin: 16px 0 6px 0; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.45);
}
.modal-card {
  position: relative;
  background: #fff;
  border-radius: 8px;
  padding: 20px 24px;
  max-width: 480px;
  width: 92%;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-card h2 { margin: 0 0 12px 0; font-size: 16px; }
.modal-fields { display: grid; grid-template-columns: 100px 1fr; gap: 4px 12px; margin: 0 0 12px 0; font-size: 13px; }
.modal-fields dt { color: #555; }
.modal-fields dd { margin: 0; word-break: break-all; }
.modal-section-title { font-weight: 600; margin: 8px 0 4px 0; }
.modal-steps { margin: 4px 0 12px 18px; padding: 0; font-size: 13px; }
.modal-steps li { margin: 2px 0; }
.modal-steps code { background: #f3f3f3; padding: 1px 4px; border-radius: 3px; font-size: 12px; }
.modal-consequence {
  background: #fff8e0;
  border-left: 3px solid #f4b400;
  padding: 8px 10px;
  margin: 8px 0 16px 0;
  font-size: 12.5px;
  color: #5a4500;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* Mobile: stack table rows */
@media (max-width: 640px) {
  main { padding: 12px; }
  .topbar { padding: 10px 12px; }
  table thead { display: none; }
  table, tbody, tr, td { display: block; width: 100%; }
  tr {
    border-bottom: 1px solid #eee;
    padding: 8px 10px;
  }
  td {
    border: none;
    padding: 3px 0;
  }
  td::before {
    content: attr(data-label) ": ";
    font-weight: 600;
    color: #555;
    margin-right: 4px;
  }
  td.actions { padding-top: 6px; }
}
