* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f5f5;
  color: #222;
  line-height: 1.5;
}

header {
  background: #fff;
  border-bottom: 1px solid #ddd;
  padding: 0.75rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 { font-size: 1rem; }

.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.status-dot.online { background: #22c55e; }
.status-dot.offline { background: #ef4444; }
.status-label { font-size: 0.8rem; color: #888; margin-left: 0.35rem; }

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.25rem;
}

.stats-row { display: flex; gap: 0.75rem; margin-bottom: 1rem; }
.stat-card {
  flex: 1;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 0.75rem 1rem;
}
.stat-value { font-size: 1.2rem; font-weight: 600; display: block; }
.stat-label { font-size: 0.75rem; color: #888; }

.panel {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.panel h2 { font-size: 0.9rem; margin-bottom: 0.75rem; }

.tabs { display: flex; gap: 0; margin-bottom: 0.75rem; border-bottom: 2px solid #eee; }
.tab {
  background: none;
  border: none;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  font-size: 0.82rem;
  color: #888;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}
.tab.active { color: #2563eb; border-bottom-color: #2563eb; }

.tab-content { display: none; }
.tab-content.active { display: block; }

.drop-zone {
  border: 2px dashed #ccc;
  border-radius: 6px;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  color: #888;
  position: relative;
  overflow: hidden;
}
.drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 5;
}

.browse-btn {
  background: none;
  border: none;
  color: #2563eb;
  cursor: pointer;
  font-size: inherit;
  text-decoration: underline;
  padding: 0;
}
.drop-zone:hover { border-color: #2563eb; background: #f8faff; }

.file-info {
  margin-top: 0.5rem;
  padding: 0.4rem 0.75rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
}

.form-row { margin-top: 0.5rem; }
.form-inline { display: flex; gap: 0.5rem; }

input[type="text"] {
  flex: 1;
  padding: 0.4rem 0.6rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.84rem;
  outline: none;
}
input[type="text"]:focus { border-color: #2563eb; }

.btn {
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  font-size: 0.82rem;
  border: none;
  cursor: pointer;
}
.btn-primary {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: #2563eb;
  color: #fff;
}
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-secondary { background: #eee; color: #333; }

.template-options { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.template-btn {
  flex: 1;
  background: #fafafa;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  overflow: hidden;
}
.template-btn:hover { border-color: #2563eb; }
.tpreview { height: 48px; padding: 0.4rem; }
.tpreview-blank { background: #f5f5f5; }
.tpreview-spa { background: #0f0f23; }
.tmeta { padding: 0.5rem 0.65rem; border-top: 1px solid #eee; }
.tmeta strong { font-size: 0.8rem; display: block; }
.tmeta span { font-size: 0.7rem; color: #888; }

.progress { margin-top: 0.5rem; }
.progress-bar { height: 4px; background: #eee; border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; background: #2563eb; width: 0; }
.progress-text { font-size: 0.74rem; color: #888; margin-top: 0.15rem; display: block; }

.result {
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.82rem;
}
.result.success { background: #f0fdf4; border: 1px solid #22c55e; color: #16a34a; }
.result.error { background: #fef2f2; border: 1px solid #ef4444; color: #dc2626; }

table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  padding: 0.4rem 0.75rem;
  font-size: 0.72rem;
  color: #888;
  border-bottom: 1px solid #eee;
}
td {
  padding: 0.55rem 0.75rem;
  font-size: 0.84rem;
  border-bottom: 1px solid #f5f5f5;
}
tr:hover td { background: #fafafa; }

.site-actions button {
  background: none;
  border: 1px solid #ddd;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.72rem;
  cursor: pointer;
  color: #666;
}
.site-actions button:hover { border-color: #2563eb; color: #2563eb; }
.site-actions button.delete:hover { border-color: #dc2626; color: #dc2626; }

.toggle-access { font-weight: 500; }
.toggle-access.public { background: #f0fdf4; border-color: #22c55e; color: #16a34a; }
.toggle-access.local { background: #f8f8f8; border-color: #ccc; color: #666; }
.toggle-access:hover { opacity: 0.85; }

.empty-state { text-align: center; padding: 2rem; color: #888; }

.toast {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  padding: 0.5rem 0.85rem;
  border-radius: 6px;
  font-size: 0.82rem;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}
.toast.success { background: #16a34a; color: #fff; }
.toast.error { background: #dc2626; color: #fff; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.modal {
  background: #fff;
  border-radius: 6px;
  padding: 1.25rem;
  max-width: 380px;
  width: 90%;
}
.modal h3 { font-size: 0.9rem; margin-bottom: 0.35rem; }
.modal p { color: #888; margin-bottom: 1rem; font-size: 0.84rem; }
.modal-actions { display: flex; gap: 0.5rem; justify-content: flex-end; }

footer {
  text-align: center;
  padding: 1rem;
  color: #888;
  font-size: 0.76rem;
  border-top: 1px solid #ddd;
}

.hidden { display: none !important; }

@media (max-width: 600px) {
  header { flex-direction: column; text-align: center; }
  .form-inline { flex-direction: column; }
  .template-options { flex-direction: column; }
  .stats-row { flex-direction: column; }
  th { display: none; }
  td { display: flex; justify-content: space-between; }
  td::before { content: attr(data-label); font-weight: 600; font-size: 0.7rem; color: #888; }
}
