* { box-sizing: border-box; }
body {
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
  margin: 0;
  color: #222;
  background: #f6f8fa;
}

header { background: #0b2545; color: #fff; padding: 10px 20px; }
nav { display: flex; gap: 18px; align-items: center; }
nav a { color: #fff; text-decoration: none; }
nav a.logo { font-weight: 700; font-size: 16px; }
nav a:hover { text-decoration: underline; }
nav a.active {
  background: #1d3a6b;
  padding: 4px 10px;
  border-radius: 4px;
  text-decoration: none;
}
nav .user { margin-left: auto; color: #a8bad6; }

main { padding: 20px; max-width: 1500px; margin: 0 auto; }
h1 { margin-top: 0; }

.toolbar {
  display: flex; gap: 20px; align-items: flex-start;
  margin-bottom: 14px; flex-wrap: wrap;
}
.sync-info { color: #555; font-size: 13px; line-height: 1.6; }
.sync-info .err-msg { color: #cf222e; max-width: 900px; word-break: break-word; }
.status-ok { color: #1a7f37; }
.status-error { color: #cf222e; }

.filters {
  display: flex; gap: 14px; flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid #e1e4e8;
  border-radius: 6px;
}
.filters label {
  display: flex; flex-direction: column;
  font-size: 12px; color: #555;
}
.filters select { margin-top: 4px; padding: 5px 6px; min-width: 170px; }

button, .primary {
  background: #0b2545; color: #fff; border: none;
  padding: 8px 14px; border-radius: 4px; cursor: pointer;
  font-size: 14px;
}
button:hover { background: #163866; }

table.issues {
  width: 100%; border-collapse: collapse; background: #fff;
  border: 1px solid #e1e4e8; border-radius: 6px; overflow: hidden;
  font-size: 13px;
}
table.issues th, table.issues td {
  padding: 8px 10px; text-align: left;
  border-bottom: 1px solid #eef0f3;
  vertical-align: top;
}
table.issues th { background: #f1f3f5; font-weight: 600; position: sticky; top: 0; padding: 0; }
table.issues th a.sort-link {
  display: block;
  padding: 8px 10px;
  color: #333;
  text-decoration: none;
  user-select: none;
  white-space: nowrap;
}
table.issues th a.sort-link:hover { background: #e6e9ec; }
table.issues th a.sort-link.active { color: #0969da; }
table.issues th .sort-arrow { margin-left: 4px; font-weight: 700; }
table.issues a { color: #0969da; text-decoration: none; font-family: ui-monospace, monospace; }
table.issues a:hover { text-decoration: underline; }
table.issues tr.row-closed { background: #fafbfc; color: #777; }
table.issues td.summary { max-width: 520px; }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.badge-open        { background: #ddf4ff; color: #0969da; }
.badge-in_progress { background: #fff8c5; color: #9a6700; }
.badge-closed      { background: #dafbe1; color: #1a7f37; }

.flash { padding: 10px 14px; margin-bottom: 14px; border-radius: 4px; }
.flash-ok    { background: #dafbe1; color: #1a7f37; }
.flash-error { background: #ffebe9; color: #cf222e; }

.login-form, .settings {
  max-width: 440px;
  display: flex; flex-direction: column; gap: 12px;
  background: #fff; padding: 20px; border-radius: 6px;
  border: 1px solid #e1e4e8;
  color: #222;
}
.login-form label, .settings label {
  display: flex; flex-direction: column;
  font-size: 13px; gap: 4px;
  color: #222;
}
.login-form input,
.settings input[type=text],
.settings input[type=password],
.settings input[type=number] {
  padding: 8px; border: 1px solid #ccd1d6; border-radius: 4px;
  font-size: 14px; color: #222; background: #fff;
}
.settings .checkbox { flex-direction: row; align-items: center; gap: 8px; }
.settings small { color: #777; font-size: 11px; }

/* Login page: centered vertically-ish, form in the middle */
.login-page {
  max-width: 360px;
  margin: 10vh auto 40px;
  text-align: center;
}
.login-page h1 { margin: 0 0 20px; }
.login-page .login-form {
  margin: 0 auto;
  text-align: left;
}
.login-page .login-form button { align-self: stretch; }

td.empty { text-align: center; padding: 30px; color: #777; }
.count { color: #555; }

.pagination {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 10px; flex-wrap: wrap; gap: 10px;
}
.pager { display: flex; gap: 6px; align-items: center; }
.pager .page-btn {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid #ccd1d6;
  border-radius: 4px;
  background: #fff;
  color: #0969da;
  text-decoration: none;
  font-size: 13px;
  min-width: 28px; text-align: center;
}
.pager .page-btn:hover { background: #eef6ff; }
.pager .page-btn.disabled {
  color: #aaa; pointer-events: none;
  background: #f4f5f7;
}
.pager .page-info {
  font-size: 13px; color: #555; padding: 0 6px;
}

.app-footer {
  max-width: 1500px;
  margin: 30px auto 16px;
  padding: 10px 20px;
  border-top: 1px solid #e1e4e8;
  font-size: 12px;
  color: #888;
  display: flex;
  gap: 14px;
  align-items: center;
}
.app-footer code { background: #eef0f3; padding: 1px 6px; border-radius: 3px; }

table.users {
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #e1e4e8;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 20px;
  min-width: 520px;
}
table.users th, table.users td {
  padding: 8px 12px;
  border-bottom: 1px solid #eef0f3;
  text-align: left;
  vertical-align: middle;
}
table.users th { background: #f1f3f5; font-weight: 600; }
table.users small { color: #888; margin-left: 6px; }
.inline-form { display: flex; gap: 6px; align-items: center; margin: 0; }
.inline-form input[type=password] {
  padding: 5px 8px;
  border: 1px solid #ccd1d6;
  border-radius: 4px;
  font-size: 13px;
  min-width: 160px;
}
button.danger { background: #cf222e; }
button.danger:hover { background: #a40e19; }
.muted { color: #999; }
.app-footer .muted { color: #999; text-decoration: none; }
.app-footer .muted:hover { text-decoration: underline; color: #555; }
