:root {
  --bg: #0f172a;
  --card: #1e293b;
  --text: #e2e8f0;
  --hint: #94a3b8;
  --accent: #3b82f6;
  --green: #22c55e;
  --amber: #f59e0b;
  --red: #ef4444;
  --border: #334155;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding: 16px;
}
.hidden { display: none !important; }
h1, h2, h3 { margin: 0 0 12px; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}
input, select, textarea {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px;
  font-size: 14px;
  width: 100%;
  margin-bottom: 8px;
}
button {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
}
button.secondary { background: var(--border); }
button.danger { background: var(--red); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--border); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.dot.green { background: var(--green); }
.dot.amber { background: var(--amber); }
.dot.red { background: var(--red); }
nav.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
nav.tabs button { background: var(--card); border: 1px solid var(--border); }
nav.tabs button.active { background: var(--accent); }
#asset-filters button { background: var(--card); border: 1px solid var(--border); margin-right: 6px; padding: 6px 10px; font-size: 13px; }
#asset-filters button.active { background: var(--accent); }
.error-banner { background: var(--red); color: white; padding: 8px 12px; border-radius: 6px; margin-bottom: 12px; }
.muted { color: var(--hint); }
.sub { color: var(--hint); font-size: 11px; margin-top: 2px; }
.table-wrap { overflow-x: auto; }
td.actions { white-space: nowrap; }
td.actions button, td.actions a { margin-right: 4px; }
.btn-link {
  display: inline-block;
  background: var(--accent);
  color: white;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 14px;
  text-decoration: none;
}
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 16px; }
.cards .card { margin-bottom: 0; }
.stat .label { color: var(--hint); font-size: 12px; margin-bottom: 6px; }
.stat .big { font-size: 22px; font-weight: 600; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); column-gap: 10px; }
.sync-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: 12px; border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; color: var(--hint); }
.chip.ok { color: var(--green); border-color: var(--green); }
.chip.bad { color: var(--red); border-color: var(--red); }
.chip.warn { color: var(--amber); border-color: var(--amber); }
.sync-problem { margin-top: 8px; font-size: 12px; color: var(--amber); }
.warn-box { background: var(--card); border: 1px solid var(--amber); border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; font-size: 13px; }
.warn-box ul { margin: 6px 0 0; padding-left: 18px; }
.left { font-weight: 600; }
.left.red { color: var(--red); }
.left.amber { color: var(--amber); }
.left.green { color: var(--green); }
.bar { height: 5px; background: var(--border); border-radius: 3px; margin-top: 4px; min-width: 90px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 3px; background: var(--hint); }
.bar-fill.green { background: var(--green); }
.bar-fill.amber { background: var(--amber); }
.bar-fill.red { background: var(--red); }
button:disabled, input:disabled, select:disabled { opacity: 0.55; cursor: not-allowed; }
.badge-synced {
  display: inline-block;
  font-size: 10px;
  color: var(--hint);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 6px;
}
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal-box { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 18px; width: 100%; max-width: 360px; }
.modal-title { font-weight: 600; margin-bottom: 12px; line-height: 1.35; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
.modal-actions button { min-width: 96px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--red); color: white; padding: 10px 16px; border-radius: 8px; z-index: 60; max-width: 90vw; font-size: 14px; }
@media (max-width: 700px) {
  body { padding: 10px; }
  #dashboard-rows { display: block; }
  #tab-dashboard thead { display: none; }
  #tab-dashboard table, #tab-dashboard tbody { display: block; width: 100%; }
  #tab-dashboard tr { display: block; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
  #tab-dashboard td { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: none; padding: 4px 0; text-align: right; }
  #tab-dashboard td::before { content: attr(data-label); color: var(--hint); text-align: left; flex-shrink: 0; }
  #tab-dashboard td.c-dot { display: none; }
  #tab-dashboard td.c-name { display: block; text-align: left; font-weight: 600; font-size: 15px; }
  #tab-dashboard td.actions { justify-content: flex-start; flex-wrap: wrap; padding-top: 8px; }
  #tab-dashboard td .bar { min-width: 120px; }
}
.c-name .chip { margin-left: 6px; padding: 1px 8px; font-size: 11px; vertical-align: middle; }
