:root {
  --green: #0e8f68;
  --deep-green: #09664d;
  --gold: #d7b56d;
  --ink: #162126;
  --muted: #66736d;
  --line: #dbe5e0;
  --soft: #eaf8f6;
  --bg: #f4f6f5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
}

.top-strip,
.bottom-strip {
  height: 7px;
  background: var(--green);
  border-bottom: 3px solid var(--gold);
}

.page {
  width: min(1160px, calc(100% - 28px));
  margin: 28px auto;
  background: #fff;
  border: 1px solid var(--line);
  padding: 28px;
}

.portal-page {
  padding: 0;
  overflow: hidden;
}

header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
}

.portal-header {
  background: #fff;
  padding: 30px 34px 24px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  letter-spacing: 0;
}

h1 span {
  color: var(--green);
}

.eyebrow {
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  margin-bottom: 7px;
  text-transform: uppercase;
}

header p,
.login-box p {
  margin-top: 8px;
  color: var(--muted);
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

nav a,
button,
.inline-button {
  border: 0;
  border-radius: 6px;
  background: var(--green);
  color: #fff;
  cursor: pointer;
  display: inline-block;
  font-weight: 700;
  padding: 10px 14px;
  text-decoration: none;
}

nav a.dark {
  background: #2c3333;
}

.inline-button.dark {
  background: #2c3333;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 22px 0;
}

.metrics.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0 0 16px;
}

.metrics div,
.panel,
.login-box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metrics div {
  padding: 16px;
}

.metrics b {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-bottom: 8px;
}

.metrics strong {
  font-size: 20px;
}

.grid {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 18px;
}

.program-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  padding: 24px 34px;
}

.program-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  display: block;
  min-height: 210px;
  padding: 24px;
  position: relative;
  text-decoration: none;
}

.program-card:hover {
  border-color: var(--green);
  box-shadow: 0 12px 32px rgba(20, 70, 55, .08);
  transform: translateY(-1px);
}

.program-card small {
  color: var(--green);
  display: block;
  font-weight: 700;
  margin-bottom: 16px;
  text-transform: uppercase;
}

.program-card b {
  display: block;
  font-size: 24px;
  margin-bottom: 10px;
}

.program-card span {
  color: var(--muted);
  line-height: 1.55;
}

.program-card em {
  bottom: 22px;
  color: var(--deep-green);
  font-style: normal;
  font-weight: 700;
  left: 24px;
  position: absolute;
}

.status-grid {
  background: #f9fbfa;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  border-bottom: 1px solid var(--line);
}

.status-grid div {
  background: #f9fbfa;
  padding: 20px 34px;
}

.status-grid b,
.connection-panel b {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-bottom: 7px;
  text-transform: uppercase;
}

.status-grid strong,
.connection-panel strong {
  display: block;
  font-size: 18px;
  margin-bottom: 7px;
}

.status-grid span,
.connection-panel span,
.portal-note p {
  color: var(--muted);
  line-height: 1.55;
}

.ready {
  color: var(--green);
}

.warning {
  color: #9b6a15;
}

.portal-note {
  border-left: 0;
  border-right: 0;
  border-radius: 0;
  margin: 0 34px 28px;
}

.connection-panel {
  align-items: center;
  background: #f9fbfa;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin: 16px 0 0;
  padding: 18px;
}

.portal-login {
  text-align: center;
}

.portal-login form {
  text-align: left;
}

.brand-mark {
  align-items: center;
  background: var(--green);
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  font-size: 20px;
  font-weight: 800;
  height: 54px;
  justify-content: center;
  margin-bottom: 18px;
  width: 54px;
}

.panel {
  padding: 18px;
}

h2 {
  font-size: 16px;
  margin-bottom: 14px;
}

label {
  display: block;
  font-weight: 700;
  margin: 14px 0 7px;
}

input,
select,
textarea {
  border: 1px solid #cfd9d4;
  border-radius: 6px;
  font: inherit;
  padding: 10px 11px;
  width: 100%;
}

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

.message-box {
  min-height: 140px;
}

.section-gap {
  margin-top: 26px;
}

.hint {
  color: var(--muted);
  font-size: 12px;
  margin-top: 8px;
}

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

.checkline input {
  width: auto;
}

form button {
  margin-top: 14px;
}

.two-cols {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 12px;
}

.inline-form {
  margin: 0;
}

.inline-form button {
  margin-top: 0;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -4px 0 12px;
}

.action-row form {
  margin: 0;
}

.small-button {
  border-radius: 5px;
  font-size: 12px;
  padding: 6px 9px;
}

.muted-button {
  background: #6b7470;
}

table {
  border-collapse: collapse;
  font-size: 13px;
  width: 100%;
}

th {
  background: var(--green);
  color: #fff;
  padding: 10px;
  text-align: left;
}

td {
  padding: 9px 10px;
  vertical-align: top;
}

tr:nth-child(even) td {
  background: var(--soft);
}

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

.right {
  text-align: right;
  white-space: nowrap;
}

.alert {
  background: #effaf3;
  border: 1px solid #bcdcca;
  border-radius: 6px;
  color: #145938;
  margin: 16px 0 0;
  padding: 10px 12px;
}

.alert.danger {
  background: #fff3f3;
  border-color: #e4bcbc;
  color: #973535;
}

.login-box {
  margin: 80px auto;
  padding: 26px;
  width: min(430px, calc(100% - 32px));
}

.login-box.wide {
  width: min(760px, calc(100% - 32px));
}

pre {
  background: #f7faf8;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: auto;
  padding: 12px;
  white-space: pre-wrap;
}

.page > .bottom-strip {
  margin: 28px -28px -28px;
}

.portal-page > .bottom-strip {
  margin: 0;
}

@media (max-width: 880px) {
  header,
  .grid,
  .connection-panel {
    display: block;
  }

  nav {
    justify-content: flex-start;
    margin-top: 16px;
  }

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

  .metrics.compact,
  .two-cols {
    grid-template-columns: 1fr;
  }

  .program-grid {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .panel {
    margin-bottom: 16px;
  }

  .portal-header,
  .status-grid div {
    padding-left: 20px;
    padding-right: 20px;
  }

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

  .portal-note {
    margin: 0 20px 20px;
  }

  .connection-panel .inline-button {
    margin-top: 14px;
  }
}

.wa-console-body {
  background: #f8fafc;
  color: #111827;
  font-family: Arial, Helvetica, sans-serif;
}

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

.wa-sidebar {
  background: #fff;
  border-right: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100vh;
  padding: 22px 16px;
  position: sticky;
  top: 0;
}

.wa-brand-row {
  align-items: center;
  display: flex;
  gap: 12px;
  padding: 0 8px 10px;
}

.wa-brand-mark {
  align-items: center;
  background: #25d366;
  border-radius: 8px;
  color: #fff;
  display: flex;
  font-weight: 900;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.wa-brand-row strong,
.wa-sidebar-footer strong {
  display: block;
  font-size: 14px;
  font-weight: 800;
}

.wa-brand-row span,
.wa-sidebar-footer span {
  color: #6b7280;
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-top: 2px;
}

.wa-nav {
  display: grid;
  gap: 4px;
}

.wa-nav a {
  align-items: center;
  border-radius: 8px;
  color: #6b7280;
  display: flex;
  font-size: 14px;
  font-weight: 750;
  gap: 11px;
  padding: 10px 12px;
  text-decoration: none;
}

.wa-nav a:hover,
.wa-nav a.active {
  background: #ecfdf3;
  color: #0f7a3e;
}

.wa-nav span {
  align-items: center;
  background: #f3f4f6;
  border-radius: 7px;
  display: flex;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.wa-sidebar-footer {
  border-top: 1px solid #e5e7eb;
  margin-top: auto;
  padding: 16px 8px 0;
}

.wa-main {
  min-width: 0;
  padding: 24px;
}

.wa-topbar {
  align-items: center;
  border-bottom: 0;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 22px;
  padding-bottom: 0;
}

.wa-topbar h1 {
  color: #111827;
  font-size: 30px;
  font-weight: 850;
  margin-bottom: 7px;
}

.wa-topbar p {
  color: #6b7280;
  font-weight: 600;
}

.wa-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.wa-actions.tight form {
  margin: 0;
}

.wa-btn,
.wa-submit,
.wa-mini-btn {
  background: #25d366;
  border: 0;
  border-radius: 8px;
  color: #06381c;
  cursor: pointer;
  display: inline-flex;
  font-weight: 900;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  text-decoration: none;
}

.wa-btn.secondary,
.secondary-submit {
  background: #fff;
  border: 1px solid #e5e7eb;
  color: #111827;
}

.wa-mini-btn {
  border-radius: 6px;
  font-size: 12px;
  min-height: 30px;
  padding: 6px 9px;
}

.wa-mini-btn.muted {
  background: #e5e7eb;
  color: #374151;
}

.wa-alert {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  color: #92400e;
  font-weight: 700;
  margin-bottom: 18px;
  padding: 12px 14px;
}

.wa-alert.ok {
  background: #ecfdf3;
  border-color: #bbf7d0;
  color: #0f7a3e;
}

.wa-kpi-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 18px;
}

.wa-kpi-grid div,
.wa-panel,
.wa-preview {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .08);
}

.wa-kpi-grid div {
  min-height: 116px;
  padding: 16px;
}

.wa-kpi-grid span {
  color: #6b7280;
  display: block;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 12px;
}

.wa-kpi-grid strong {
  color: #111827;
  display: block;
  font-size: 28px;
  font-weight: 900;
}

.wa-kpi-grid small {
  color: #22c55e;
  display: block;
  font-size: 12px;
  font-weight: 800;
  margin-top: 8px;
}

.wa-content-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, .65fr);
  margin-bottom: 18px;
}

.wa-panel {
  overflow: hidden;
}

.wa-panel-head {
  align-items: center;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 17px 18px;
}

.wa-panel-head h2 {
  color: #111827;
  font-size: 16px;
  font-weight: 850;
  margin-bottom: 4px;
}

.wa-panel-head span,
.wa-list article span {
  color: #6b7280;
  display: block;
  font-size: 12px;
  font-weight: 650;
}

.wa-panel-body {
  padding: 18px;
}

.wa-form label {
  color: #111827;
  font-size: 13px;
  font-weight: 800;
}

.wa-message-box {
  min-height: 170px;
}

.wa-submit {
  margin-top: 14px;
  width: 100%;
}

.wa-preview {
  min-height: 100%;
  overflow: hidden;
}

.wa-preview-head {
  align-items: center;
  background: #075e54;
  color: #fff;
  display: flex;
  justify-content: space-between;
  min-height: 58px;
  padding: 0 18px;
}

.wa-preview-head span {
  color: #b9f6d0;
  font-size: 12px;
  font-weight: 800;
}

.wa-preview-body {
  background: linear-gradient(135deg, rgba(255,255,255,.72), rgba(255,255,255,.28)), #efe7dd;
  display: flex;
  justify-content: flex-end;
  min-height: 330px;
  padding: 34px;
}

.wa-bubble {
  align-self: flex-end;
  background: #d9fdd3;
  border-radius: 8px 8px 0 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .12);
  color: #111827;
  font-size: 14px;
  max-width: min(470px, 100%);
  min-width: 190px;
  padding: 12px 14px 26px;
  position: relative;
  word-break: break-word;
}

.wa-bubble small {
  bottom: 7px;
  color: #667781;
  font-size: 11px;
  position: absolute;
  right: 12px;
}

.wa-list {
  display: grid;
  gap: 12px;
}

.wa-list article {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 13px;
}

.wa-list article strong {
  color: #111827;
  display: block;
  font-size: 13px;
  line-height: 1.35;
  max-height: 38px;
  overflow: hidden;
}

.wa-list article em {
  color: #0f7a3e;
  display: block;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  margin-top: 8px;
}

.compact-list article strong {
  max-height: none;
}

.wa-empty {
  color: #6b7280;
  font-weight: 700;
}

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

.wa-table-wrap table {
  min-width: 720px;
}

@media (max-width: 1100px) {
  .wa-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .wa-content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .wa-console-shell {
    display: block;
  }

  .wa-sidebar {
    height: auto;
    position: static;
  }

  .wa-main {
    padding: 18px;
  }

  .wa-topbar {
    display: block;
  }

  .wa-actions {
    margin-top: 14px;
  }

  .wa-kpi-grid {
    grid-template-columns: 1fr;
  }
}
