:root {
  --bg: #f6f7fb;
  --text: #1f2a44;
  --accent: #2c3e87;
  --accent-dark: #213069;
  --muted: #555;
  --card-bg: white;
  --border: #e0e3ee;
  --danger: #b00020;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: white;
  border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; text-decoration: none; color: var(--accent); font-size: 1.2rem; }
nav { display: flex; gap: 1rem; align-items: center; }
nav a { color: var(--text); text-decoration: none; }
nav a:hover { color: var(--accent); }
main { max-width: 960px; margin: 2rem auto; padding: 0 1rem; }
h1 { font-size: 1.6rem; margin: 0 0 1.5rem; }
h2 { font-size: 1.15rem; margin: 0 0 0.5rem; }

.project-list {
  list-style: none;
  padding: 0;
  margin: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.project {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.project:last-child { border-bottom: none; }
.project:hover { background: #fafbfd; }
.project-title { margin: 0 0 0.3rem; font-size: 1.1rem; }
.project-title a { color: var(--accent); text-decoration: none; }
.project-title a:hover { text-decoration: underline; }
.project-desc { margin: 0 0 0.4rem; color: var(--muted); }
.project-url { margin: 0; font-size: 0.85rem; word-break: break-all; }
.project-url a { color: #777; text-decoration: none; }
.project-url a:hover { color: var(--accent); text-decoration: underline; }

.form { display: flex; flex-direction: column; gap: 1rem; max-width: 500px; }
.form label { display: flex; flex-direction: column; gap: 0.35rem; font-weight: 600; font-size: 0.9rem; }
.form input, .form textarea {
  font: inherit;
  padding: 0.55rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-weight: normal;
  background: white;
}
.form input:focus, .form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.form-actions { display: flex; gap: 1rem; align-items: center; }
.form-actions a { color: var(--muted); }

button, .btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.6rem 1.1rem;
  border-radius: 4px;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
  display: inline-block;
}
button:hover, .btn:hover { background: var(--accent-dark); }
.link-button {
  background: none;
  color: var(--accent);
  padding: 0;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
  border: none;
}
.link-button.danger { color: var(--danger); }
.inline { display: inline; }
.flashes { list-style: none; padding: 0; margin: 0 0 1rem; }
.flash { padding: 0.6rem 1rem; border-radius: 4px; margin-bottom: 0.4rem; }
.flash-error { background: #ffe2e2; color: #841515; }
.flash-message { background: #e8f4ff; color: #0a4870; }

.admin-table { width: 100%; border-collapse: collapse; background: white; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; font-size: 0.95rem; }
.admin-table th, .admin-table td { padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.admin-table th { background: #f0f2f7; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.5px; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table .url-cell { max-width: 240px; word-break: break-all; }
.row-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }
.row-actions a { color: var(--accent); text-decoration: none; }
.row-actions a:hover { text-decoration: underline; }

.muted { color: var(--muted); font-size: 0.95rem; }

.form-fieldset {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 1rem 1rem;
}
.form-fieldset legend { padding: 0 0.4rem; color: var(--muted); font-size: 0.85rem; }
.checklist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.inline-check { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; font-size: 0.95rem; }
.inline-check input { width: auto; }

.inline-dropdown { display: inline; }
.inline-dropdown summary { color: var(--accent); cursor: pointer; }
.inline-form { display: inline-flex; gap: 0.4rem; align-items: center; margin-top: 0.4rem; }
.inline-form input { padding: 0.35rem 0.5rem; border: 1px solid var(--border); border-radius: 4px; }
.inline-form button { padding: 0.35rem 0.7rem; font-size: 0.85rem; }

.project-actions { font-size: 0.9rem; }
.project-actions a { color: var(--accent); text-decoration: none; }
.project-actions a:hover { text-decoration: underline; }

.backup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin: 1rem 0;
  padding: 1rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.backup-actions form { display: inline; }
.backup-actions .inline-dropdown summary { font-size: 0.9rem; }
code {
  background: #eef0f6;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-size: 0.9em;
}

.badge-ok, .badge-missing {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}
.badge-ok      { background: #dcf3df; color: #1d6f2c; }
.badge-missing { background: #fce8e8; color: #8a1f1f; }
