:root {
  --night: #0a1628;
  --navy: #0d1f3c;
  --navy-2: #142947;
  --gold: #c8a55a;
  --gold-soft: #f2dfaa;
  --white: #ffffff;
  --paper: #f6f7f8;
  --ink: #172033;
  --muted: #657083;
  --line: rgba(10, 22, 40, 0.12);
  --danger: #9d2f3a;
  --success: #24735b;
  --warning: #9b6a12;
  --shadow: 0 18px 58px rgba(10, 22, 40, 0.14);
  font-family: Montserrat, "Open Sans", Lato, Avenir, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

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

h1,
h2 {
  font-family: "Playfair Display", Cinzel, Georgia, serif;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(340px, 460px);
  min-height: 100vh;
  background:
    linear-gradient(130deg, rgba(10, 22, 40, 0.97), rgba(13, 31, 60, 0.94)),
    var(--night);
}

.compact-login {
  grid-template-columns: minmax(320px, 460px);
  place-content: center;
  padding: 24px;
}

.login-card {
  align-self: center;
  margin: 28px;
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.compact-login .login-card {
  width: min(100%, 460px);
  margin: 0;
}

.login-logo {
  display: block;
  width: 82px;
  height: 82px;
  margin-bottom: 20px;
  object-fit: cover;
  border: 1px solid rgba(200, 165, 90, 0.65);
}

.login-card h2 {
  margin-bottom: 22px;
  color: var(--night);
  font-size: 2.4rem;
  line-height: 1;
}

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

label {
  display: grid;
  gap: 8px;
  color: var(--night);
  font-size: 0.86rem;
  font-weight: 900;
}

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

textarea {
  min-height: 108px;
  resize: vertical;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 900;
}

.button.primary {
  color: #07111f;
  background: var(--gold);
}

.button.secondary {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
}

.button.light {
  color: var(--night);
  border-color: var(--line);
  background: var(--white);
}

.button.ghost {
  width: 100%;
  color: rgba(255, 255, 255, 0.78);
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
}

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

.form-error {
  min-height: 18px;
  margin: 0;
  color: var(--danger);
  font-size: 0.86rem;
  font-weight: 800;
}

.demo-box {
  display: grid;
  gap: 5px;
  margin-top: 22px;
  padding: 14px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
  font-size: 0.86rem;
}

.demo-box strong {
  color: var(--night);
}

.demo-box .button {
  margin-top: 8px;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: 100vh;
  padding: 22px;
  color: var(--white);
  background:
    linear-gradient(180deg, rgba(10, 22, 40, 0.98), rgba(13, 31, 60, 0.98)),
    var(--night);
}

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

.brand img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border: 1px solid rgba(200, 165, 90, 0.65);
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.05;
}

.brand small {
  margin-top: 4px;
  color: var(--gold-soft);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.side-nav {
  display: grid;
  gap: 8px;
}

.side-nav button {
  min-height: 42px;
  padding: 0 12px;
  color: rgba(255, 255, 255, 0.78);
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  font-weight: 850;
}

.side-nav button:hover,
.side-nav button.is-active {
  color: var(--white);
  border-color: rgba(200, 165, 90, 0.42);
  background: rgba(255, 255, 255, 0.08);
}

.sidebar .button {
  margin-top: auto;
}

.main-shell {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 96px;
  padding: 22px clamp(18px, 4vw, 42px);
  border-bottom: 1px solid var(--line);
  background: rgba(246, 247, 248, 0.9);
  backdrop-filter: blur(18px);
}

.topbar h1 {
  margin: 0;
  color: var(--night);
  font-size: 2.9rem;
  line-height: 1;
}

.account-chip {
  min-width: 210px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  text-align: right;
}

.account-chip span,
.account-chip small {
  display: block;
}

.account-chip span {
  color: var(--night);
  font-weight: 900;
}

.account-chip small {
  margin-top: 2px;
  color: var(--muted);
}

.view {
  padding: 26px clamp(18px, 4vw, 42px) 54px;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card,
.member-card,
.stat-card,
.form-card,
.table-card,
.notice {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 16px 48px rgba(13, 31, 60, 0.07);
}

.card,
.member-card,
.form-card,
.notice {
  padding: 20px;
}

.card h2,
.member-card h2,
.form-card h2,
.table-card h2 {
  margin-bottom: 14px;
  color: var(--night);
  font-size: 1.25rem;
}

.card p,
.member-card p,
.notice p,
.empty-state p {
  color: var(--muted);
  line-height: 1.58;
}

.member-card p {
  white-space: pre-line;
}

.member-card {
  position: relative;
  overflow: hidden;
  min-height: 210px;
}

.member-card::before {
  position: absolute;
  top: 0;
  right: 0;
  width: 70px;
  height: 100%;
  content: "";
  background: linear-gradient(180deg, var(--gold), var(--navy-2));
  opacity: 0.14;
}

.member-avatar {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 14px;
  color: var(--night);
  border-radius: 50%;
  background: var(--gold-soft);
  font-weight: 900;
}

.stat-card {
  padding: 18px;
}

.metric {
  display: block;
  color: var(--night);
  font-family: "Playfair Display", Cinzel, Georgia, serif;
  font-size: 2.45rem;
  font-weight: 800;
  line-height: 1;
}

.stat-card span:last-child {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 800;
}

.meeting-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 24px;
  color: var(--white);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(10, 22, 40, 0.98), rgba(20, 41, 71, 0.96)),
    var(--night);
  box-shadow: var(--shadow);
}

.meeting-hero h2 {
  color: var(--white);
  font-size: 2rem;
}

.meeting-hero p {
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.76);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

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

.form-grid .full {
  grid-column: 1 / -1;
}

.table-card {
  overflow: hidden;
}

.table-card h2 {
  padding: 18px 18px 0;
}

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

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

th,
td {
  padding: 14px 18px;
  text-align: left;
  border-top: 1px solid rgba(10, 22, 40, 0.09);
  vertical-align: top;
}

th {
  color: var(--night);
  background: #f2f4f3;
  font-size: 0.78rem;
  text-transform: uppercase;
}

td small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--night);
  background: rgba(200, 165, 90, 0.2);
  font-size: 0.78rem;
  font-weight: 900;
}

.status.success {
  color: var(--success);
  background: rgba(36, 115, 91, 0.12);
}

.status.warning {
  color: var(--warning);
  background: rgba(155, 106, 18, 0.13);
}

.status.danger {
  color: var(--danger);
  background: rgba(157, 47, 58, 0.12);
}

.empty-state {
  padding: 24px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
}

.empty-state strong {
  display: block;
  margin-bottom: 5px;
  color: var(--night);
}

.email-preview {
  white-space: pre-wrap;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.inline-select {
  min-width: 180px;
}

@media (max-width: 1100px) {
  .grid.four,
  .grid.three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .login-shell,
  .app-shell,
  .grid.two,
  .grid.three,
  .grid.four,
  .form-grid,
  .meeting-hero {
    grid-template-columns: 1fr;
  }

  .login-card {
    margin: 0 18px 28px;
  }

  .sidebar {
    position: relative;
    height: auto;
  }

  .side-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sidebar .button {
    margin-top: 0;
  }

  .topbar {
    display: grid;
    min-height: auto;
  }

  .topbar h1 {
    font-size: 2.2rem;
  }

  .account-chip {
    width: 100%;
    text-align: left;
  }
}

@media (max-width: 540px) {
  .side-nav {
    grid-template-columns: 1fr;
  }

  .view {
    padding-right: 14px;
    padding-left: 14px;
  }

  .actions .button,
  .actions select {
    width: 100%;
  }
}
