:root {
  --ink: #1a1a1a;
  --muted: #6b6b6b;
  --hairline: #dcdcdc;
  --bg: #ffffff;
  --bg-soft: #fafafa;
  --accent: #262626;
  --accent-hover: #3d3d3d;
  --error: #8a2c2c;
  --error-bg: #fbeaea;
  --font-display: 'Cormorant Garamond', 'Times New Roman', serif;
  --font-body: 'EB Garamond', Georgia, 'Times New Roman', serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
}

a {
  color: inherit;
}

.site-header {
  display: flex;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--hairline);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  object-fit: contain;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

main {
  min-height: calc(100vh - 90px);
  display: flex;
  flex-direction: column;
}

.login-wrap,
.page-wrap {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 3rem 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 440px;
  border: 1px solid var(--hairline);
  padding: 2.5rem 2.5rem 2rem;
  text-align: center;
  background: var(--bg);
}

.emblem {
  margin-bottom: 1.5rem;
}

.emblem-mark {
  width: 140px;
  height: 140px;
  object-fit: contain;
}

.emblem-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin: 0.75rem 0 0;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0 0 1.5rem;
}

form {
  text-align: left;
  margin-top: 1.5rem;
}

.field {
  margin-bottom: 1.25rem;
}

.field label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.field input,
.field select {
  width: 100%;
  padding: 0.6rem 0.1rem;
  border: none;
  border-bottom: 1px solid var(--hairline);
  background: transparent;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s ease;
}

.field select {
  border-radius: 0;
  appearance: auto;
}

.field input:focus,
.field select:focus {
  border-bottom-color: var(--ink);
}

.btn-primary,
.btn-secondary {
  width: 100%;
  padding: 0.85rem 1rem;
  border: none;
  font-family: var(--font-body);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 0.5rem;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--bg-soft);
  color: var(--ink);
  border: 1px solid var(--hairline);
}

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

.helper-text {
  margin-top: 1.75rem;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.6;
}

.error-banner {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid var(--error);
  padding: 0.6rem 0.8rem;
  font-size: 0.85rem;
  margin: 0 0 1rem;
  text-align: left;
}

.success-banner {
  background: var(--bg-soft);
  color: var(--ink);
  border: 1px solid var(--ink);
  padding: 0.6rem 0.8rem;
  font-size: 0.85rem;
  margin: 0 0 1rem;
  text-align: left;
}

.panel {
  width: 100%;
  max-width: 440px;
  border: 1px solid var(--hairline);
  padding: 2.5rem;
}

.panel-wide {
  max-width: 720px;
}

.panel h1 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin: 0 0 0.5rem;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.panel-header h1 {
  margin: 0;
}

.table-wrap {
  overflow-x: auto;
}

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

.link {
  color: var(--ink);
  text-decoration: underline;
  font-size: 0.9rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
  font-size: 0.88rem;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--hairline);
}

.data-table th {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid var(--hairline);
}

.badge-admin {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.badge-member {
  color: var(--muted);
}

.badge-status-active {
  color: var(--muted);
}

.badge-status-terminated {
  color: var(--error);
  border-color: var(--error);
}

.actions-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.actions-cell form {
  display: contents;
}

.btn-link {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--ink);
  text-decoration: underline;
  cursor: pointer;
}

.btn-link-danger {
  color: var(--error);
}

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

@media (max-width: 480px) {
  .site-header {
    padding: 1.25rem;
  }

  .login-card,
  .panel {
    padding: 2rem 1.5rem;
  }
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  flex-shrink: 0;
  border-right: 1px solid var(--hairline);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
}

.sidebar .brand {
  margin-bottom: 2.5rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-nav a {
  display: block;
  padding: 0.55rem 0.75rem;
  margin: 0 -0.75rem;
  font-size: 0.92rem;
  color: var(--muted);
  text-decoration: none;
  border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
  color: var(--ink);
}

.sidebar-nav a.active {
  color: var(--ink);
  border-left-color: var(--ink);
  background: var(--bg-soft);
}

.sidebar-logout {
  margin-top: auto;
  padding-top: 1.5rem;
}

.app-content {
  flex: 1;
  min-width: 0;
  padding: 3rem;
}

.app-content h1 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  margin: 0 0 1.5rem;
}

.home-hero {
  text-align: center;
}

.home-logo {
  width: 180px;
  height: 180px;
  object-fit: contain;
  margin-bottom: 1rem;
}

.tile-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
}

.tile {
  display: block;
  width: 220px;
  padding: 1.5rem;
  border: 1px solid var(--hairline);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s ease;
}

.tile:hover {
  border-color: var(--ink);
}

.tile-title {
  display: block;
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 0.4rem;
}

.tile-desc {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
  cursor: pointer;
}

.checkbox-field input {
  width: auto;
}

@media (max-width: 700px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--hairline);
    padding: 1.5rem;
  }

  .sidebar .brand {
    margin-bottom: 1.25rem;
  }

  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .sidebar-nav a {
    margin: 0;
    border-left: none;
    border-bottom: 2px solid transparent;
  }

  .sidebar-nav a.active {
    border-left: none;
    border-bottom-color: var(--ink);
  }

  .sidebar-logout {
    margin-top: 1rem;
    padding-top: 0;
  }

  .app-content {
    padding: 2rem 1.5rem;
  }
}
