:root {
  color-scheme: dark;
  --bg: #0d1511;
  --bg-soft: #111b17;
  --surface: rgba(19, 27, 23, 0.94);
  --surface-strong: #101714;
  --text: #f2f7f4;
  --muted: #c7d2cb;
  --brand: #1d8745;
  --brand-soft: rgba(29, 135, 69, 0.16);
  --border: rgba(82, 127, 101, 0.34);
  --danger: #ff726a;
  --warning: #f1bb4e;
  --success: #87d98f;
  --radius: 18px;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 0%, rgba(29, 135, 69, .20), transparent 26rem),
    linear-gradient(180deg, #101913 0%, #0d1410 38%, #090c0a 100%);
}

a { color: inherit; }
button, input, select { font: inherit; }

.shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.site-header {
  position: sticky; top: 0; z-index: 10;
  border-bottom: 1px solid var(--border);
  background: rgba(9, 14, 11, .86);
  backdrop-filter: blur(18px);
}
.header-inner { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; text-decoration: none; min-width: 170px; }
.brand img { display: block; width: 170px; max-height: 52px; object-fit: contain; object-position: left center; }
.nav { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.nav a {
  padding: 10px 14px; border-radius: 999px; text-decoration: none;
  color: var(--muted); border: 1px solid transparent;
}
.nav a:hover, .nav a.active { color: var(--text); border-color: var(--border); background: var(--brand-soft); }

main { padding: clamp(34px, 6vw, 72px) 0 72px; }
.hero { display: grid; grid-template-columns: 1.25fr .75fr; gap: 24px; align-items: stretch; }
.hero-copy, .panel, .card {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow);
}
.hero-copy { padding: clamp(28px, 5vw, 58px); }
.eyebrow { margin: 0 0 10px; color: var(--success); font-size: .78rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(2.2rem, 6vw, 4.6rem); line-height: .95; letter-spacing: -.045em; }
h2 { margin: 0 0 14px; font-size: clamp(1.35rem, 3vw, 2rem); }
h3 { margin: 0 0 8px; }
p { color: var(--muted); line-height: 1.6; }
.hero-copy p { max-width: 720px; font-size: 1.05rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-side { display: grid; gap: 16px; }
.card { padding: 24px; }
.metric { font-size: 2rem; font-weight: 900; margin: 8px 0 0; }
.status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--warning); margin-right: 8px; }
.status-dot.ok { background: var(--success); box-shadow: 0 0 0 5px rgba(135,217,143,.10); }

.section { margin-top: 28px; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.panel { padding: clamp(22px, 4vw, 36px); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 46px;
  padding: 11px 18px; border-radius: 12px; border: 1px solid var(--brand);
  background: var(--brand); color: #fff; font-weight: 800; text-decoration: none; cursor: pointer;
}
.btn.secondary { background: transparent; border-color: var(--border); color: var(--text); }
.btn.danger { background: transparent; border-color: rgba(255,114,106,.45); color: #ffd4d1; }
.btn:disabled { opacity: .55; cursor: wait; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
label { color: var(--muted); font-size: .9rem; font-weight: 700; }
input, select {
  width: 100%; min-height: 48px; border: 1px solid var(--border); border-radius: 12px;
  background: #0c120f; color: var(--text); padding: 10px 13px; outline: none;
}
input:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(29,135,69,.18); }
.message { display: none; margin-top: 18px; padding: 13px 15px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-soft); }
.message.show { display: block; }
.message.success { color: #dfffe4; border-color: rgba(135,217,143,.38); }
.message.error { color: #ffd4d1; border-color: rgba(255,114,106,.38); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.application-list { display: grid; gap: 10px; }
.application-item { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); }
.application-item:last-child { border-bottom: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.role-list { display: flex; flex-wrap: wrap; gap: 8px; min-height: 36px; align-items: center; }
.detail-divider { height: 1px; background: var(--border); margin: 28px 0; }
#member-detail-panel { scroll-margin-top: 100px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 13px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; background: rgba(255,255,255,.025); }
tr:last-child td { border-bottom: 0; }
.badge { display: inline-flex; padding: 5px 9px; border-radius: 999px; background: var(--brand-soft); border: 1px solid var(--border); font-size: .82rem; }
.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 10px 0; }

.site-footer { border-top: 1px solid var(--border); padding: 24px 0 36px; color: var(--muted); font-size: .88rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

@media (max-width: 820px) {
  .hero, .grid { grid-template-columns: 1fr; }
  .header-inner { align-items: flex-start; flex-direction: column; padding: 14px 0; }
  .nav { justify-content: flex-start; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .application-item { grid-template-columns: 1fr; }
}
