:root {
  --gold: #ffa500;
  --cream: #fff8ec;
  --ink: #231f18;
  --muted: #675f55;
  --line: #e6d9c5;
  --white: #ffffff;
  --success: #226c3c;
  --danger: #9d3228;
  --shadow: 0 18px 44px rgba(65, 49, 26, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--cream);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px clamp(18px, 5vw, 72px);
  background: rgba(252, 251, 244, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
  text-decoration: none;
}

.brand img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border: 2px solid var(--gold);
  border-radius: 50%;
}

nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

nav a,
.nav-button {
  padding: 9px 12px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
}

nav a:hover,
.nav-button:hover {
  color: var(--ink);
  background: var(--gold);
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(255, 165, 0, 0.16), rgba(255, 255, 255, 0.88)),
    var(--white);
}

.login-shell {
  display: grid;
  width: min(100% - 36px, 520px);
  margin: 0 auto;
}

.login-panel {
  padding: clamp(24px, 6vw, 42px);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-panel img {
  width: 92px;
  height: 92px;
  object-fit: contain;
  margin-bottom: 16px;
}

.login-panel h1 {
  margin: 0 0 24px;
  font-size: clamp(1.55rem, 6vw, 2.4rem);
  line-height: 1.05;
}

.login-form {
  display: grid;
  gap: 16px;
}

.reset-form {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.login-button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.login-hint {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.login-copyright {
  display: flex;
  justify-content: center;
  justify-self: stretch;
  margin: 72px 0 0;
  width: 100%;
  color: #8a8176;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

main {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}

.hero {
  min-height: 420px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 380px);
  align-items: center;
  gap: clamp(28px, 6vw, 72px);
  padding: 42px 0 28px;
}

.hero-copy h1 {
  margin: 0;
  max-width: 820px;
  font-size: clamp(2.2rem, 6vw, 5rem);
  line-height: 1;
}

.hero-copy p:not(.eyebrow) {
  max-width: 620px;
  color: var(--muted);
  font-size: 1.12rem;
}

.hero-logo {
  width: 100%;
  max-height: 380px;
  object-fit: contain;
  filter: drop-shadow(0 22px 24px rgba(54, 43, 27, 0.18));
}

.eyebrow {
  margin: 0 0 10px;
  color: #81500d;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

.department-grid article,
.workspace {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.department-grid article {
  display: grid;
  gap: 7px;
  min-height: 100px;
  padding: 18px;
}

.department-grid span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.department-grid strong {
  font-size: 2.05rem;
  line-height: 1;
}

.workspace {
  margin: 0 0 30px;
  padding: clamp(18px, 4vw, 34px);
}

.section-heading h2 {
  margin: 0 0 18px;
  font-size: 1.35rem;
}

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

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--cream);
  font: inherit;
}

input:focus,
select:focus {
  outline: 3px solid rgba(255, 192, 103, 0.4);
  border-color: #d58d25;
}

.span-2 {
  grid-column: 1 / -1;
}

.form-buttons {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 11px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  text-decoration: none;
}

.primary {
  color: var(--ink);
  background: var(--gold);
}

.secondary {
  color: var(--ink);
  background: var(--white);
  border-color: var(--line);
}

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

.compact {
  min-height: 36px;
  padding: 8px 10px;
  white-space: nowrap;
}

.form-status {
  min-height: 24px;
  margin: 0;
  color: var(--success);
  font-weight: 900;
}

.form-status.error {
  color: var(--danger);
}

.records-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.record-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 12px;
}

.record-actions label {
  min-width: 200px;
}

.record-count {
  flex: 0 0 auto;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--gold);
  font-weight: 900;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

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

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

tbody tr:hover {
  background: var(--cream);
}

.member-photo {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border: 2px solid var(--gold);
  border-radius: 8px;
  background: var(--white);
}

.empty-photo {
  display: inline-flex;
  min-width: 70px;
  min-height: 36px;
  align-items: center;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.row-actions {
  display: inline-flex;
  gap: 8px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 860px) {
  .app-header,
  .records-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero,
  .department-grid,
  .member-form {
    grid-template-columns: 1fr;
  }

  .record-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .form-buttons {
    grid-template-columns: 1fr;
  }

  .record-actions label {
    min-width: 0;
  }
}

@media (max-width: 560px) {
  main {
    width: min(100% - 24px, 1180px);
  }

  .brand span {
    font-size: 0.9rem;
  }

  nav {
    flex-wrap: wrap;
  }

  .login-button-row {
    grid-template-columns: 1fr;
  }
}
