:root {
  --brand: #1576d1;
  --brand-dark: #0e5aa6;
  --ink: #1f2733;
  --muted: #6b7787;
  --line: #e4e9f0;
  --bg-top: #eef3fb;
  --bg-bottom: #dbe6f6;
  --card: #ffffff;
  --ok-bg: #e6f4ea;
  --ok-ink: #1e7e3c;
  --radius: 16px;
  --shadow: 0 10px 40px rgba(20, 60, 120, 0.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Login ---------- */

.auth-bg {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, var(--bg-top), var(--bg-bottom));
}

.card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 36px 32px;
  text-align: center;
}

.card .logo { width: 190px; height: auto; margin-bottom: 22px; }

.card h1 { font-size: 22px; margin: 0 0 6px; }

.subtitle { color: var(--muted); margin: 0 0 26px; font-size: 15px; }

.login-form { display: flex; flex-direction: column; gap: 10px; text-align: left; }

.login-form label { font-size: 13px; font-weight: 600; color: var(--muted); }

.login-form input {
  padding: 12px 14px;
  font-size: 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.login-form input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(21, 118, 209, 0.15);
}

.login-form button {
  margin-top: 6px;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: var(--brand);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s;
}

.login-form button:hover { background: var(--brand-dark); }

.hint { margin: 22px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.hint code { background: #f1f4f9; padding: 1px 6px; border-radius: 6px; }

.error {
  margin: 0 0 20px;
  padding: 11px 14px;
  font-size: 13.5px;
  text-align: left;
  color: #8a1f1f;
  background: #fdeaea;
  border: 1px solid #f5c6c6;
  border-radius: 10px;
}

/* ---------- Dashboard ---------- */

body.app { background: #f5f7fb; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.topbar .logo-sm { height: 30px; width: auto; }

.user { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.user .who { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.user .name { font-weight: 600; }

.roles { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.role-chip {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--brand-dark);
  background: #e8f1fc;
  border-radius: 999px;
  padding: 2px 10px;
}

.logout {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 12px;
}
.logout:hover { text-decoration: none; color: var(--ink); border-color: var(--muted); }

main.content { max-width: 920px; margin: 0 auto; padding: 28px 24px 60px; }

main.content h1 { font-size: 24px; margin: 8px 0 4px; }
.portal-line { color: var(--muted); font-size: 14px; margin-bottom: 24px; }

.project {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 14px;
}

.project-head { display: flex; align-items: baseline; gap: 10px; }
.project-title { font-size: 16px; font-weight: 600; }

.pubs { list-style: none; margin: 12px 0 0; padding: 0; border-top: 1px solid var(--line); }
.pubs li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid #f0f3f8;
  font-size: 14px;
}
.pubs li:last-child { border-bottom: none; }

.badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: #eef1f6;
  border-radius: 6px;
  padding: 2px 8px;
}
.badge.public { color: var(--ok-ink); background: var(--ok-bg); }

.lang { font-size: 12px; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
