.emo-portal {
  --emo-ink: #17202a;
  --emo-muted: #657282;
  --emo-line: #dfe6ee;
  --emo-soft: #f6f8fb;
  --emo-green: #0f8b6f;
  --emo-green-dark: #075f4c;
  --emo-blue: #2563eb;
  --emo-red: #c83a3a;
  --emo-amber: #b76d00;
  --emo-shadow: 0 18px 45px rgba(23, 32, 42, 0.12);
  color: var(--emo-ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

.emo-portal * {
  box-sizing: border-box;
}

.emo-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 22px;
  margin: 0 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: linear-gradient(135deg, #111a22, #244353);
  color: #fff;
  box-shadow: var(--emo-shadow);
}

.emo-brand-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.emo-mark,
.emo-user-logo {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: linear-gradient(135deg, var(--emo-green), #f36f56);
  color: #fff;
  font-size: 32px;
  font-weight: 900;
}

.emo-user-logo {
  object-fit: contain;
  background: #fff;
  padding: 6px;
}

.emo-hero h1 {
  font-size: 32px;
  line-height: 1.1;
  margin: 0;
  letter-spacing: 0;
  color: #fff;
}

.emo-hero p {
  margin: 5px 0 0;
  color: #c8d5df;
}

.emo-user-box {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.emo-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px;
  margin: 0 0 16px;
  border: 1px solid var(--emo-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(23, 32, 42, 0.06);
}

.emo-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.emo-nav a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--emo-ink);
  font-weight: 900;
  text-decoration: none;
}

.emo-nav a:hover {
  border-color: var(--emo-line);
  background: var(--emo-soft);
}

.emo-nav a.is-active {
  color: #fff;
  border-color: var(--emo-green);
  background: var(--emo-green);
}

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

.emo-grid-3 {
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.9fr) minmax(260px, 0.75fr);
}

.emo-auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.emo-card {
  border: 1px solid var(--emo-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 12px 30px rgba(23, 32, 42, 0.07);
  padding: 18px;
  margin: 0 0 16px;
}

.emo-card h2 {
  font-size: 20px;
  margin: 0 0 12px;
  letter-spacing: 0;
  color: var(--emo-ink);
}

.emo-muted {
  color: var(--emo-muted);
  margin-top: 0;
  line-height: 1.5;
}

.emo-warning {
  color: #8a5300;
  background: #fff2d7;
  border: 1px solid #f4cc8a;
  border-radius: 8px;
  padding: 10px;
}

.emo-form,
.emo-card form {
  display: grid;
  gap: 12px;
}

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

.emo-portal label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.emo-portal input,
.emo-portal select,
.emo-portal textarea {
  width: 100%;
  border: 1px solid #cfd8e2;
  border-radius: 8px;
  min-height: 40px;
  padding: 9px 10px;
  color: var(--emo-ink);
  background: #fff;
  font: inherit;
}

.emo-portal textarea {
  min-height: 220px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.45;
}

.emo-inline {
  display: flex !important;
  align-items: center;
  gap: 8px;
}

.emo-inline input {
  width: 18px;
  height: 18px;
  min-height: 18px;
}

.emo-drop {
  border: 1.5px dashed #b7c3ce;
  border-radius: 8px;
  background: var(--emo-soft);
  padding: 18px;
}

.emo-button-row,
.emo-bulk-actions,
.emo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.emo-btn,
.emo-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--emo-line);
  border-radius: 8px;
  min-height: 38px;
  padding: 9px 13px;
  background: #fff;
  color: var(--emo-ink);
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
}

.emo-btn-primary {
  color: #fff;
  background: var(--emo-green);
  border-color: var(--emo-green);
}

.emo-btn-primary:hover {
  background: var(--emo-green-dark);
}

.emo-btn-danger {
  color: #fff;
  background: var(--emo-red);
  border-color: var(--emo-red);
}

.emo-mini {
  min-height: 30px;
  padding: 6px 9px;
  font-size: 12px;
}

.emo-section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.emo-section-head h2 {
  margin: 0;
}

.emo-section-head span {
  color: var(--emo-muted);
  font-weight: 800;
}

.emo-bulk-actions {
  padding: 12px;
  margin: 0 0 12px;
  border: 1px solid var(--emo-line);
  border-radius: 8px;
  background: var(--emo-soft);
}

.emo-bulk-actions form,
.emo-actions form {
  display: inline;
}

.emo-table-wrap {
  overflow: auto;
  border: 1px solid var(--emo-line);
  border-radius: 8px;
}

.emo-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  margin: 0;
  background: #fff;
}

.emo-table th,
.emo-table td {
  border-bottom: 1px solid #edf1f5;
  padding: 12px 11px;
  text-align: left;
  vertical-align: top;
}

.emo-table th {
  background: #f7f9fb;
  color: #53606d;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.emo-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  color: #425466;
  background: #edf1f5;
}

.emo-status-ready,
.emo-status-sent {
  color: #08624f;
  background: #dff7ef;
}

.emo-status-error,
.emo-status-failed {
  color: #9d2424;
  background: #ffe2e2;
}

.emo-status-validated {
  color: #8a5300;
  background: #fff1d8;
}

.emo-editor-row {
  background: #fbfcfe;
}

.emo-editor-row summary {
  cursor: pointer;
  font-weight: 800;
}

.emo-delete-form {
  margin-top: 10px;
}

.emo-alert {
  border-radius: 8px;
  padding: 12px 14px;
  margin: 0 0 14px;
  font-weight: 700;
}

.emo-alert-ok {
  color: #08624f;
  background: #dff7ef;
  border: 1px solid #a5e8d1;
}

.emo-alert-error {
  color: #9d2424;
  background: #ffe2e2;
  border: 1px solid #ffc6c6;
}

.emo-auth-page {
  max-width: 1040px;
  margin: 28px auto;
}

.emo-auth-shell {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(320px, 1fr);
  min-height: 620px;
  overflow: hidden;
  border: 1px solid var(--emo-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--emo-shadow);
}

.emo-auth-copy {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 14px;
  padding: 34px;
  color: #fff;
  background: linear-gradient(145deg, #111a22, #244353 62%, #0f8b6f);
}

.emo-auth-copy .emo-mark {
  width: 68px;
  height: 68px;
  font-size: 38px;
  background: rgba(255, 255, 255, 0.16);
}

.emo-auth-copy h1 {
  margin: 8px 0 0;
  color: #fff;
  font-size: 36px;
  line-height: 1.05;
  letter-spacing: 0;
}

.emo-auth-copy p {
  margin: 0;
  color: #d9e6ec;
  font-weight: 800;
}

.emo-auth-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.emo-auth-badges span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  font-size: 12px;
  font-weight: 900;
}

.emo-auth-card {
  display: grid;
  align-content: center;
  gap: 18px;
  padding: 34px;
}

.emo-auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--emo-line);
  border-radius: 8px;
  background: var(--emo-soft);
}

.emo-auth-tabs button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--emo-muted);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.emo-auth-tabs button.is-active {
  color: #fff;
  border-color: var(--emo-green);
  background: var(--emo-green);
}

.emo-auth-form h2 {
  margin: 0 0 14px;
  font-size: 24px;
  color: var(--emo-ink);
  letter-spacing: 0;
}

.emo-auth-form form {
  display: grid;
  gap: 12px;
}

.emo-inline-form {
  display: inline;
}

@media (max-width: 1100px) {
  .emo-grid-3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .emo-hero {
    display: grid;
    padding: 16px;
  }

  .emo-hero h1 {
    font-size: 26px;
  }

  .emo-user-box {
    justify-items: stretch;
  }

  .emo-nav,
  .emo-nav-links,
  .emo-nav a {
    width: 100%;
  }

  .emo-nav-links,
  .emo-button-row,
  .emo-bulk-actions,
  .emo-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .emo-form-grid,
  .emo-auth-grid,
  .emo-auth-shell {
    grid-template-columns: 1fr;
  }

  .emo-auth-shell {
    min-height: auto;
  }

  .emo-auth-copy,
  .emo-auth-card {
    padding: 22px;
  }

  .emo-auth-copy h1 {
    font-size: 28px;
  }

  .emo-btn,
  .emo-mini {
    width: 100%;
  }

  .emo-table {
    min-width: 760px;
  }
}
