:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --panel: #ffffff;
  --panel-line: #d7dee8;
  --text: #17202c;
  --muted: #687386;
  --accent: #1b6fb7;
  --accent-strong: #0f548f;
  --danger: #b42318;
  --danger-bg: #fff1f0;
  --ok: #087443;
  --ok-bg: #ecfdf3;
  --warn: #9a6700;
  --warn-bg: #fff8db;
  --shadow: 0 1px 2px rgb(16 24 40 / 8%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
}

.sidebar {
  background: #111827;
  color: #f9fafb;
  padding: 22px 18px;
}

.brand {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 24px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav a,
.nav button {
  width: 100%;
  border: 0;
  background: transparent;
  color: #cbd5e1;
  cursor: pointer;
  display: block;
  font: inherit;
  padding: 8px 0;
  text-align: left;
}

.nav a:hover,
.nav button:hover {
  color: #ffffff;
  text-decoration: none;
}

.content {
  padding: 24px;
}

.topbar {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 18px;
}

h1 {
  font-size: 24px;
  line-height: 1.2;
  margin: 0;
}

h2 {
  font-size: 16px;
  margin: 0 0 14px;
}

.muted {
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 16px;
}

.cols {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stats {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat,
.panel {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.stat {
  padding: 14px;
}

.stat .value {
  font-size: 22px;
  font-weight: 700;
}

.panel {
  padding: 16px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  min-width: 100%;
}

th,
td {
  border-bottom: 1px solid #edf1f5;
  padding: 9px 8px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

code,
.mono {
  background: #eef2f7;
  border-radius: 4px;
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 13px;
  padding: 2px 5px;
}

form.inline {
  display: inline;
}

.form-grid {
  display: grid;
  gap: 12px;
}

label {
  color: var(--muted);
  display: grid;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
}

input,
textarea,
select {
  background: #ffffff;
  border: 1px solid #c9d3df;
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  min-height: 38px;
  padding: 8px 10px;
  width: 100%;
}

textarea {
  font-family: Consolas, "Cascadia Mono", monospace;
  min-height: 260px;
  resize: vertical;
}

.actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

button,
.button {
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 650;
  min-height: 36px;
  padding: 7px 12px;
}

button:hover,
.button:hover {
  background: var(--accent-strong);
  text-decoration: none;
}

button.secondary,
.button.secondary {
  background: #ffffff;
  border-color: #b9c4d2;
  color: var(--text);
}

button.secondary:hover,
.button.secondary:hover {
  background: #f1f5f9;
}

button.danger {
  background: var(--danger);
  border-color: var(--danger);
}

.badge {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
}

.badge.ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.badge.warn {
  background: var(--warn-bg);
  color: var(--warn);
}

.svn-breadcrumb {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.svn-browser-table {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.repo-file-line,
.repo-file-item {
  align-items: center;
  border-bottom: 1px solid #edf1f5;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 0.75fr) 90px;
  min-height: 42px;
  padding: 0 12px;
}

.repo-file-line:last-child,
.repo-file-item:last-child {
  border-bottom: 0;
}

.repo-file-last-commit {
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
}

.repo-file-cell {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-name {
  font-weight: 600;
}

.svn-file-icon {
  color: var(--muted);
  display: inline-block;
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 12px;
  margin-right: 8px;
  min-width: 42px;
}

.code-block {
  background: #0f172a;
  border-radius: 6px;
  color: #e5e7eb;
  overflow-x: auto;
  padding: 14px;
}

.flash {
  border-radius: 8px;
  margin-bottom: 12px;
  padding: 10px 12px;
}

.flash.ok {
  background: var(--ok-bg);
  border: 1px solid #a6f4c5;
  color: var(--ok);
}

.flash.error {
  background: var(--danger-bg);
  border: 1px solid #fecdca;
  color: var(--danger);
}

.login {
  align-items: center;
  display: grid;
  min-height: 100vh;
  padding: 24px;
}

.login .panel {
  margin: 0 auto;
  max-width: 380px;
  width: 100%;
}

.login .otp-panel {
  max-width: 460px;
}

.login .signup-result-panel {
  max-width: 520px;
}

.login .svn-portal-panel {
  max-width: 560px;
}

.svn-clone-box {
  background: #f8fafc;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding: 14px;
}

.admin-login-note {
  margin-bottom: 0;
}

.oauth-signup {
  margin-bottom: 14px;
}

.divider {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 12px;
  font-weight: 700;
  gap: 10px;
  margin: 14px 0;
  text-transform: uppercase;
}

.divider::before,
.divider::after {
  background: var(--panel-line);
  content: "";
  flex: 1;
  height: 1px;
}

.otp-qr {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  display: flex;
  justify-content: center;
  margin: 14px auto 16px;
  padding: 14px;
  width: fit-content;
}

.otp-qr img {
  display: block;
  height: 220px;
  width: 220px;
}

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

  .sidebar {
    padding: 14px 18px;
  }

  .nav {
    grid-template-columns: repeat(3, max-content);
  }

  .stats,
  .cols {
    grid-template-columns: 1fr;
  }
}
