:root {
  --bg-main: #0f172a;
  --bg-sidebar: #111827;
  --bg-card: #ffffff;
  --bg-table-head: #f1f5f9;

  --text-light: #e5e7eb;
  --text-dark: #0f172a;
  --text-muted: #64748b;

  --accent: #2563eb;
  --accent-hover: #1d4ed8;

  --border: #e2e8f0;
  --danger: #dc2626;

  --radius: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
    font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    "Apple Color Emoji",
    "Segoe UI Emoji",
    "Noto Color Emoji",
    Roboto,
    Arial,
    sans-serif;
  background: var(--bg-main);
  color: var(--text-dark);
}


.layout {
  display: flex;
  height: 100vh;
}

.sidebar {
  width: 240px;
  background: var(--bg-sidebar);
  color: var(--text-light);
  padding: 20px;
}

.sidebar h2 {
  margin-top: 0;
  font-weight: 600;
  font-size: 18px;
  margin-bottom: 30px;
}

.sidebar button {
  width: 100%;
  margin-bottom: 10px;
  background: transparent;
  border: 1px solid #1f2937;
  color: var(--text-light);
  padding: 10px;
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
}

.sidebar button:hover {
  background: #1f2937;
}

.content {
  flex: 1;
  background: #f8fafc;
  padding: 30px;
  overflow: auto;
}

.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

/* unified content buttons */
.content button {
  background: #eef2ff;
  color: #1e293b;
  border: 1px solid #cbd5e1;
  padding: 8px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  line-height: 1.2;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.content button:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}

.content button:disabled {
  opacity: .6;
  cursor: not-allowed;
}

button.primary {
  background: var(--accent);
  color: white;
  border: 1px solid var(--accent);
  padding: 8px 14px;
  border-radius: var(--radius);
  cursor: pointer;
}

button.primary:hover {
  background: var(--accent-hover);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
}

th, td {
  padding: 8px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

th {
  background: var(--bg-table-head);
  text-align: left;
}

input, select {
  padding: 5px 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  width: 100%;
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  padding: 0;
  border-radius: 4px;
  accent-color: var(--accent);
}

.status-select {
  min-width: 150px;
}

.badge-invalid {
  color: white;
  background: var(--danger);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 11px;
}

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: end;
  margin-top: 10px;
  margin-bottom: 10px;
}

.filters .f {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
}

.filters label {
  font-size: 12px;
  color: var(--text-muted);
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 10px;
}

.small {
  font-size: 12px;
  color: var(--text-muted);
}

.badge-valid {
  background:#16a34a;
  color:white;
  padding:4px 8px;
  border-radius:6px;
  font-size:12px;
}

.badge-invalid {
  background:#dc2626;
  color:white;
  padding:4px 8px;
  border-radius:6px;
  font-size:12px;
}

.badge-unknown {
  background:#6b7280;
  color:white;
  padding:4px 8px;
  border-radius:6px;
  font-size:12px;
}

button.green {
    background: #16a34a;
    color: white;
    border: 1px solid #16a34a;
    padding: 8px 14px;
    border-radius: var(--radius);
    cursor: pointer;
}

button.invalid {background: #dc2626;}
button.invalid {border: 1px solid #dc2626;}

.filter-popup {
  position: absolute;
  background: #1f2937;
  color: #f3f4f6;
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 15px 35px rgba(0,0,0,0.35);
  min-width: 220px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 9999;
  font-size: 14px;
}

.filter-popup label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
}

.filter-popup label:hover {
  background: rgba(255,255,255,0.08);
}

.filter-popup input[type="checkbox"] {
  accent-color: #3b82f6;
}

.filter-actions {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
}

.filter-actions button {
  padding: 5px 10px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
}

.filter-actions button:first-child {
  background: #3b82f6;
  color: white;
}

.filter-actions button:last-child {
  background: #374151;
  color: #d1d5db;
}
.copyable {
  cursor: pointer;
}

.copyable:hover {
  background: #f3f4f6;
}

/* domains section */
#section-domains .filters {
  align-items: flex-end;
}

#section-domains textarea {
  min-height: 120px;
  resize: vertical;
}

#domainsBox {
  margin-top: 10px;
}

.domains-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.domains-pager-left,
.domains-pager-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.domains-pager-left span {
  font-size: 13px;
  color: #475569;
}

.domains-pager-left label {
  font-size: 12px;
  color: #64748b;
}

.domains-pager-left select {
  width: 92px;
}

.domains-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
  align-items: stretch;
}

.domain-row {
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: auto;
}

.domain-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  justify-content: flex-start;
}

.domain-name {
  font-weight: 600;
  word-break: break-word;
}

.domain-meta {
  font-size: 13px;
  color: #6b7280;
  margin-top: 2px;
  word-break: break-word;
}

.domain-kv {
  font-size: 13px;
  margin-top: 2px;
  word-break: break-word;
}

@media (max-width: 768px) {
  .content {
    padding: 14px;
  }

  .card {
    padding: 14px;
  }

  .filters .f {
    min-width: 100%;
  }

  .toolbar {
    gap: 8px;
  }

  .domains-grid {
    grid-template-columns: 1fr;
  }

  .domain-row {
    aspect-ratio: auto;
    min-height: 180px;
  }
}
