/* Synaptory Portal — minimal local UI (Phase 2C). */

:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --border: #dde3ea;
  --text: #1f2933;
  --muted: #6b7a8c;
  --accent: #2456a6;
  --accent-dark: #1c4486;
  --danger-bg: #fdecec;
  --danger-text: #9b2226;
  --ok-bg: #e7f5ec;
  --ok-text: #1d6f42;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Branding ------------------------------------------------------------ */

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
}

.brand h1 {
  font-size: 1.3rem;
  margin: 0;
}

.brand-name {
  font-weight: 600;
  font-size: 1.05rem;
}

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

.login-body {
  justify-content: center;
  align-items: center;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem 2.2rem;
  box-shadow: 0 8px 24px rgba(31, 41, 51, 0.08);
}

.login-card .brand { justify-content: center; margin-bottom: 0.4rem; }

.subtitle {
  text-align: center;
  color: var(--muted);
  margin: 0 0 1.4rem;
  font-size: 0.92rem;
}

form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0.9rem 0 0.3rem;
}

form input {
  width: 100%;
  padding: 0.6rem 0.7rem;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfcfe;
}

form input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

button {
  margin-top: 1.3rem;
  width: 100%;
  padding: 0.65rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

button:hover { background: var(--accent-dark); }

.btn-secondary {
  margin: 0;
  width: auto;
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
}

.btn-secondary:hover { background: var(--bg); }

.alert {
  background: var(--danger-bg);
  color: var(--danger-text);
  border: 1px solid #f3c4c6;
  border-radius: 8px;
  padding: 0.65rem 0.8rem;
  font-size: 0.88rem;
  margin-bottom: 0.4rem;
}

.footnote {
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  margin: 1.4rem 0 0;
}

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

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.7rem 1.5rem;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-chip {
  font-size: 0.88rem;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.content {
  flex: 1;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 1.8rem 1.5rem 2.5rem;
}

.content h1 { margin: 0 0 0.2rem; font-size: 1.5rem; }
.content h2 { margin: 2rem 0 0.7rem; font-size: 1.1rem; }

.muted { color: var(--muted); font-size: 0.9rem; margin-top: 0; }

.stats {
  display: flex;
  gap: 1rem;
  margin-top: 1.4rem;
  flex-wrap: wrap;
}

.stat-card {
  flex: 1;
  min-width: 150px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.2rem;
  display: flex;
  flex-direction: column;
}

.stat-value { font-size: 1.7rem; font-weight: 700; }
.stat-label { color: var(--muted); font-size: 0.85rem; margin-top: 0.15rem; }

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  font-size: 0.9rem;
}

th, td {
  text-align: left;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--border);
}

th {
  background: #f8fafc;
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }

.num { text-align: right; font-variant-numeric: tabular-nums; }

.status-badge {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--bg);
  color: var(--muted);
}

.status-active { background: var(--ok-bg); color: var(--ok-text); }

/* --- Access level badges & notices (Phase 3A) ----------------------------- */

.access-badge {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.access-admin  { background: #e8eefb; color: var(--accent-dark); }
.access-tenant { background: var(--ok-bg); color: var(--ok-text); }
.access-none   { background: var(--danger-bg); color: var(--danger-text); }

.notice {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  font-size: 0.88rem;
  margin: 1rem 0 0;
  color: var(--muted);
}

.notice-warn {
  border-left-color: var(--danger-text);
  background: var(--danger-bg);
  color: var(--danger-text);
}

/* --- User management (Phase 3B-A) ------------------------------------------ */

.notice-success {
  border-left-color: var(--ok-text);
  background: var(--ok-bg);
  color: var(--ok-text);
}

.nav-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.nav-link:hover { text-decoration: underline; }

.temp-password {
  display: inline-block;
  margin: 0.3rem 0;
  padding: 0.25rem 0.6rem;
  background: var(--surface);
  border: 1px dashed var(--ok-text);
  border-radius: 6px;
  font-size: 1rem;
  letter-spacing: 0.04em;
  user-select: all;
}

.membership-chip {
  display: inline-block;
  margin: 0.1rem 0.25rem 0.1rem 0;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--border);
}

.add-user-form {
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.2rem 1.3rem;
}

.add-user-form select {
  width: 100%;
  padding: 0.6rem 0.7rem;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfcfe;
}

.page-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  padding: 1rem;
  border-top: 1px solid var(--border);
}
