:root {
  --ink: #172026;
  --muted: #65717a;
  --line: #d9e0e5;
  --paper: #f7f5f0;
  --panel: #ffffff;
  --accent: #12615c;
  --accent-strong: #0b4642;
  --gold: #b08226;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: "Times New Roman", Times, serif;
  font-size: 12pt;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 32px;
  color: #fff;
  background: #173b3d;
  border-bottom: 4px solid var(--gold);
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #d8c28f;
}

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

h1 {
  margin-bottom: 0;
  font-size: 12pt;
  font-weight: 700;
}

.subscriber-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 6px;
  white-space: nowrap;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #60d394;
}

.layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 24px;
  padding: 24px 32px 32px;
}

.login-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 420px));
  align-items: start;
  justify-content: center;
  gap: 24px;
  min-height: calc(100vh - 170px);
  padding: 18px 24px;
}

.login-box {
  width: min(420px, 100%);
  padding: 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.login-box h2 {
  margin-bottom: 18px;
}

.login-box label {
  display: block;
  margin: 14px 0 6px;
  color: var(--muted);
  font-size: 12pt;
  font-weight: 700;
}

.login-button {
  width: 100%;
  margin-top: 16px;
  border: 0;
  cursor: pointer;
}

.login-message {
  min-height: 20px;
  margin: 12px 0 0;
  color: #9d2f2f;
  font-size: 12pt;
  font-weight: 700;
}

.registration-box {
  width: min(560px, 100%);
}

.form-label {
  display: block;
  margin: 16px 0 8px;
  color: var(--muted);
  font-size: 12pt;
  font-weight: 700;
}

.registration-module-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8faf9;
}

.registration-module-list label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.registration-module-list input {
  width: auto;
  min-height: auto;
}

.registration-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f5f7f7;
}

.registration-total span {
  color: var(--muted);
  font-weight: 700;
}

.access-code-display {
  margin-top: 14px;
  padding: 16px;
  color: #fff;
  background: var(--accent-strong);
  border-radius: 8px;
  text-align: center;
}

.access-code-display span {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.access-code-display strong {
  display: block;
  font-size: 28px;
  letter-spacing: .04em;
}

.secondary-action {
  width: 100%;
  min-height: 40px;
  color: var(--ink);
  background: #edf1f2;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.top-logout {
  min-height: 30px;
  padding: 5px 9px;
  color: #173b3d;
  background: #fff;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.sidebar,
.content {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.sidebar {
  align-self: start;
  padding: 20px;
}

.search-label,
.filter-group label,
.filter-group p {
  display: block;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12pt;
  font-weight: 700;
}

input,
select,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

textarea {
  resize: vertical;
}

.filter-group {
  margin-top: 20px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 4px;
  background: #edf1f2;
  border-radius: 8px;
}

.segmented button {
  min-height: 36px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.segmented button.active {
  color: #fff;
  background: var(--accent);
}

.note {
  margin-top: 24px;
  padding: 12px;
  color: #4f5b63;
  background: #f5f7f7;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.5;
}

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

.payment-panel h2 {
  margin-bottom: 8px;
  font-size: 12pt;
}

.payment-panel p {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.payment-module-list {
  display: grid;
  gap: 10px;
}

.payment-module {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8faf9;
}

.payment-module strong,
.payment-module span {
  display: block;
}

.payment-module span {
  color: var(--muted);
  font-size: 13px;
}

.payment-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.payment-message {
  min-height: 18px;
  color: var(--accent-strong) !important;
  font-weight: 700;
}

.content {
  min-width: 0;
  overflow: hidden;
}

.content-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.content-head p {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 13px;
}

.content-head h2 {
  margin-bottom: 0;
  font-size: 12pt;
}

.table-wrap {
  overflow: auto;
}

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

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

th {
  color: #4d5961;
  background: #f5f7f7;
  font-size: 12pt;
}

td {
  font-size: 12pt;
}

.primary {
  font-weight: 700;
}

.meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12pt;
}

.open-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 10px;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.open-link:hover {
  background: var(--accent-strong);
}

.empty-state {
  padding: 44px 20px;
  color: var(--muted);
  text-align: center;
}

.pdf-viewer-panel {
  border-top: 1px solid var(--line);
  background: #fff;
}

.pdf-viewer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.pdf-viewer-head h2 {
  margin: 0;
  font-size: 12pt;
}

.pdf-frame {
  width: 100%;
  height: 72vh;
  border: 0;
  display: block;
  background: #f5f7f7;
}

@media (max-width: 820px) {
  .topbar,
  .layout {
    padding-left: 16px;
    padding-right: 16px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .layout {
    grid-template-columns: 1fr;
  }

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

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