/* UNi4 Online — Staff Portal chrome. Reuses the public site's design tokens
   (colors/spacing/radius/etc, linked separately by each page) so this looks
   like part of the same product rather than a bolted-on admin tool. */

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  color: var(--text-body);
  background: var(--surface-subtle);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--text-link); }
a:hover { color: var(--text-link-hover); }

.flare { height: 4px; background: var(--gradient-flare); }

/* ---- Auth card (login, first-run setup) ---- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.auth-card__body { padding: 32px; }
.auth-card__logo { height: 36px; width: auto; margin-bottom: 24px; }
.auth-card h1 { font-size: 20px; font-weight: 600; margin: 0 0 8px; color: var(--text-strong); }
.auth-card__sub { font-size: 14px; color: var(--text-muted); margin: 0 0 24px; }

/* ---- Form fields ---- */
.field { display: block; margin-bottom: 16px; }
.field span {
  display: block; margin-bottom: 8px; font-size: 12px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted);
}
.field input, .field select {
  width: 100%; height: 44px; padding: 0 14px; font: inherit;
  border: 1px solid var(--border-default); border-radius: var(--radius-control);
  box-sizing: border-box; background: var(--white);
}
.field input:focus, .field select:focus {
  outline: none; border-color: var(--red-600); box-shadow: var(--focus-ring);
}
.field--inline { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.field--inline input { width: auto; height: auto; }
.field--inline span { margin: 0; text-transform: none; font-size: 14px; font-weight: 500; letter-spacing: normal; color: var(--text-body); }
.hint { font-size: 12px; color: var(--text-muted); margin: -8px 0 16px; }

/* ---- Alerts ---- */
.alert { border-radius: var(--radius-control); padding: 12px 14px; font-size: 14px; margin-bottom: 20px; }
.alert--error { background: var(--danger-100); color: var(--danger-600); }
.alert--ok { background: var(--success-100); color: var(--success-600); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 44px; padding: 0 20px; border: none; border-radius: var(--radius-control);
  background: var(--red-600); color: var(--white); font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none; letter-spacing: .01em;
  transition: var(--transition-control);
}
.btn:hover { background: var(--red-800); color: var(--white); }
.btn--full { width: 100%; }
.btn--ghost { background: transparent; color: var(--navy-800); border: 1px solid var(--border-default); }
.btn--ghost:hover { background: var(--steel-050); color: var(--navy-800); }
.btn--danger { background: var(--danger-600); }
.btn--danger:hover { background: var(--red-800); }
.btn--sm { height: 34px; padding: 0 14px; font-size: 13px; }

/* ---- Portal chrome ---- */
.topbar {
  background: var(--navy-800); color: var(--white);
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 32px);
}
.topbar__brand { display: flex; align-items: center; gap: 12px; }
.topbar__brand img { height: 28px; width: auto; }
.topbar__brand span { font-weight: 600; letter-spacing: .01em; }
.topbar__right { display: flex; align-items: center; gap: 20px; font-size: 14px; }
.topbar__right a { color: rgba(255, 255, 255, .82); text-decoration: none; }
.topbar__right a:hover { color: var(--white); }

.shell { max-width: 960px; margin: 0 auto; padding: clamp(24px, 4vw, 48px) clamp(16px, 4vw, 24px); }

/* ---- Users table ---- */
.panel {
  background: var(--surface-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card); box-shadow: var(--shadow-sm);
  padding: 24px; margin-bottom: 24px;
  transition: var(--transition-lift);
}
.panel h2 { font-size: 16px; font-weight: 600; margin: 0 0 20px; color: var(--text-strong); }
a.panel:hover { box-shadow: var(--shadow-md); border-color: var(--red-600); transform: translateY(-1px); }
table.users { width: 100%; border-collapse: collapse; font-size: 14px; }
table.users th {
  text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-muted); padding: 0 12px 10px; border-bottom: 1px solid var(--border-subtle);
}
table.users td { padding: 12px; border-bottom: 1px solid var(--border-subtle); vertical-align: middle; }
table.users tr:last-child td { border-bottom: none; }
.badge {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px;
  border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: .04em;
  background: var(--surface-accent-soft); color: var(--red-700);
}
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row-actions input[type="password"] { height: 34px; font-size: 13px; width: 140px; padding: 0 10px; border: 1px solid var(--border-default); border-radius: var(--radius-control); }
.muted { color: var(--text-muted); }
