:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --border: #e2e6ea;
  --text: #1b2330;
  --muted: #6b7480;
  --accent: #1f6feb;
  --green: #1f9d6b;
  --danger: #c0392b;
  --radius: 10px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}
.layout { display: grid; grid-template-columns: 200px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
}
.brand { font-weight: 600; font-size: 16px; color: var(--green); margin-bottom: 18px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a {
  text-decoration: none;
  color: var(--muted);
  padding: 9px 11px;
  border-radius: var(--radius);
  font-size: 14px;
}
.sidebar nav a:hover { background: var(--bg); color: var(--text); }
.sidebar nav a.active { background: #e9f1ff; color: var(--accent); font-weight: 500; }
.logout { margin-top: auto; color: var(--muted); text-decoration: none; font-size: 13px; padding: 9px 11px; }
.logout:hover { color: var(--danger); }
.content { padding: 26px 32px; max-width: 880px; }
h1 { font-size: 22px; font-weight: 600; margin: 0 0 18px; }
h2 { font-size: 16px; font-weight: 600; margin: 26px 0 10px; }
.flash { background: #e9f7f0; color: var(--green); border: 1px solid #bfe7d6; padding: 9px 13px; border-radius: var(--radius); margin-bottom: 16px; font-size: 14px; }
.flash.error { background: #fdecea; color: var(--danger); border-color: #f3c4bd; }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 8px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.card-label { font-size: 13px; color: var(--muted); }
.card-num { font-size: 26px; font-weight: 600; margin-top: 4px; }
.card-num.accent { color: var(--accent); }
.card-num.ok { color: var(--green); }
.runs { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.run { display: flex; justify-content: space-between; padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: 14px; }
.run:last-child { border-bottom: none; }
.run-ts { color: var(--muted); }
.run.muted { color: var(--muted); justify-content: center; }
label { display: block; font-weight: 500; font-size: 14px; margin: 16px 0 6px; }
label:first-of-type { margin-top: 0; }
.hint { color: var(--muted); font-weight: 400; font-size: 13px; }
textarea, input[type=text], input[type=password], input[type=number], .feed-add input {
  width: 100%;
  font: inherit;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}
textarea { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.55; resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); }
button {
  font: inherit;
  padding: 9px 16px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
  cursor: pointer;
}
button:hover { filter: brightness(0.95); }
button.ghost { background: transparent; color: var(--accent); }
button.danger { background: transparent; color: var(--danger); border-color: #f3c4bd; }
.actions { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.feed-add { display: flex; gap: 8px; margin-bottom: 16px; }
.feed-add .lang { max-width: 90px; }
.feed-add button { white-space: nowrap; }
.feeds { display: flex; flex-direction: column; gap: 6px; }
.feed { display: grid; grid-template-columns: 1fr 1.4fr auto; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 9px 12px; font-size: 14px; }
.feed.off { opacity: 0.5; }
.feed-name { font-weight: 500; }
.feed-url { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed .inline { display: flex; gap: 6px; }
.feed .inline button { padding: 5px 10px; font-size: 13px; }
.settings-form input[type=number] { max-width: 160px; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 28px; width: 300px; display: flex; flex-direction: column; gap: 12px; }
.login-card .brand { text-align: center; margin-bottom: 4px; }
@media (max-width: 640px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .content { padding: 18px; }
}
