:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --ink: #17202a;
  --muted: #5d6875;
  --line: #d9dee5;
  --panel: #ffffff;
  --accent: #146c72;
  --accent-strong: #0e4f55;
  --warn: #fff6d8;
  --warn-line: #ecd184;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  min-height: 42px;
  padding: 0 16px;
}

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

button.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

button.secondary:hover {
  background: #eef3f3;
}

.auth-shell {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 28px;
}

.auth-panel,
.admin-panel,
.module-grid article,
.status-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 60px rgba(23, 32, 42, 0.08);
}

.auth-panel {
  max-width: 460px;
  padding: 30px;
  width: 100%;
}

.brand-row {
  align-items: center;
  display: flex;
  gap: 12px;
}

.brand-row div {
  display: grid;
  gap: 2px;
}

.brand-row strong {
  font-size: 1.05rem;
}

.brand-row span:last-child {
  color: var(--muted);
  font-size: 0.88rem;
}

.brand-mark {
  align-items: center;
  background: var(--ink);
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  font-weight: 800;
  height: 42px;
  justify-content: center;
  letter-spacing: 0;
  width: 42px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  font-size: 2rem;
  letter-spacing: 0;
  line-height: 1.08;
  margin: 30px 0 12px;
}

h2 {
  font-size: 1.1rem;
  letter-spacing: 0;
  margin-bottom: 8px;
}

p {
  color: var(--muted);
  line-height: 1.55;
}

.form-stack,
.staff-form {
  display: grid;
  gap: 14px;
}

label {
  color: var(--muted);
  display: grid;
  font-size: 0.88rem;
  font-weight: 700;
  gap: 6px;
}

input,
select {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  min-height: 42px;
  padding: 0 12px;
}

.alert {
  background: var(--warn);
  border: 1px solid var(--warn-line);
  border-radius: 6px;
  color: #59430b;
  margin: 22px 0;
  padding: 12px 14px;
  word-break: break-word;
}

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

.topbar form {
  align-items: center;
  display: flex;
  gap: 12px;
}

.topbar form span {
  color: var(--muted);
  font-size: 0.9rem;
}

.app-shell {
  margin: 0 auto;
  max-width: 1120px;
  padding: 30px 28px 60px;
}

.hero {
  align-items: center;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr) 210px;
  margin-bottom: 24px;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.hero h1 {
  margin-top: 0;
}

.status-card {
  display: grid;
  gap: 8px;
  min-height: 120px;
  padding: 22px;
}

.status-card span {
  color: var(--muted);
  font-weight: 700;
}

.status-card strong {
  color: var(--accent-strong);
  font-size: 1.8rem;
}

.module-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 24px;
}

.module-grid article,
.admin-panel {
  padding: 22px;
}

.section-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
}

.staff-form {
  align-items: end;
  border-bottom: 1px solid var(--line);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
  padding-bottom: 20px;
}

.staff-table {
  display: grid;
  gap: 8px;
}

.staff-row {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 10px;
  grid-template-columns: 1.1fr 1.5fr 0.6fr 0.7fr 1.4fr;
  padding: 10px 12px;
}

.staff-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.table-head {
  background: #eef3f3;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.actions form {
  margin: 0;
}

.actions button {
  min-height: 34px;
  padding: 0 10px;
}

@media (max-width: 820px) {
  .topbar,
  .topbar form,
  .hero {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
    gap: 14px;
  }

  .module-grid,
  .staff-form,
  .staff-row {
    grid-template-columns: 1fr;
  }

  .actions {
    justify-content: flex-start;
  }
}
