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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f0f2f5;
  color: #333;
  font-size: 15px;
  line-height: 1.5;
}

/* Nav */
nav {
  background: #2c3e50;
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 56px;
  gap: 24px;
}

nav .brand {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  text-decoration: none;
}

nav a {
  color: #aab8c8;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.15s;
}

nav a:hover { color: #fff; }
nav a.active { color: #fff; }

/* Layout */
.container {
  max-width: 860px;
  margin: 32px auto;
  padding: 0 16px;
}

/* Page header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 22px;
  font-weight: 600;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 6px;
  border: none;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s, background 0.15s;
  white-space: nowrap;
}

.btn:hover { opacity: 0.88; }
.btn-primary { background: #4a6fa5; color: #fff; }
.btn-secondary { background: #e2e8f0; color: #444; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* Alerts / Flash messages */
.alerts { margin-bottom: 20px; }

.alert {
  padding: 11px 16px;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 8px;
}

.alert-success { background: #d4edda; color: #1e5631; }
.alert-error   { background: #f8d7da; color: #721c24; }
.alert-warning { background: #fff3cd; color: #856404; }
.alert-info    { background: #d1ecf1; color: #0c5460; }

/* Card */
.card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  margin-bottom: 12px;
  overflow: hidden;
}

.card-body {
  padding: 16px 20px;
}

/* Site row */
.site-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.site-info { flex: 1; min-width: 0; }

.site-name {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 2px;
}

.site-url {
  color: #4a6fa5;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  display: block;
}

.site-url:hover { text-decoration: underline; }

.site-meta {
  display: flex;
  gap: 20px;
  margin-top: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.meta-item {
  font-size: 12px;
  color: #777;
}

.meta-item strong {
  color: #444;
  font-weight: 500;
}

.site-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  align-items: flex-start;
  margin-top: 2px;
}

.site-actions form {
  display: contents;
}

/* Status dot */
.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 5px;
  vertical-align: middle;
}

.dot-green  { background: #2ecc71; }
.dot-orange { background: #f39c12; }
.dot-gray   { background: #bbb; }

/* Add site form */
.add-form {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  padding: 20px;
  margin-bottom: 20px;
}

.add-form h2 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
}

.form-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 180px;
}

.form-group label {
  font-size: 12px;
  font-weight: 500;
  color: #555;
}

input[type="text"],
input[type="url"],
input[type="email"],
input[type="number"],
input[type="password"] {
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  background: #fafafa;
  transition: border-color 0.15s;
  width: 100%;
}

input:focus {
  outline: none;
  border-color: #4a6fa5;
  background: #fff;
}

/* Settings form */
.settings-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  padding: 24px;
  margin-bottom: 20px;
}

.settings-card h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 560px) {
  .settings-grid { grid-template-columns: 1fr; }
}

.setting-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.setting-group label {
  font-size: 13px;
  font-weight: 500;
  color: #444;
}

.setting-group .hint {
  font-size: 11px;
  color: #999;
  margin-top: 2px;
}

/* Toggle / checkbox */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.settings-actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
}

/* Diff page */
.diff-header {
  margin-bottom: 20px;
}

.diff-header h1 { font-size: 20px; font-weight: 600; }
.diff-header .sub { font-size: 13px; color: #777; margin-top: 4px; }

.diff-box {
  background: #1e1e2e;
  color: #cdd6f4;
  border-radius: 10px;
  padding: 20px;
  overflow: auto;
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.diff-add    { color: #a6e3a1; }
.diff-remove { color: #f38ba8; }
.diff-header-line { color: #89b4fa; }
.diff-meta   { color: #6c7086; }

.no-diff {
  text-align: center;
  padding: 48px 16px;
  color: #999;
  font-size: 14px;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: #999;
}

.empty-state p { font-size: 14px; margin-top: 8px; }

/* Toolbar */
.toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}
