:root {
  color-scheme: light;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  color: #16211c;
  background: #f2f5f1;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  min-width: 320px;
  background: radial-gradient(circle at 12% 0%, #e1eee8 0, transparent 32rem), #f2f5f1;
}
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 10%, rgba(69, 145, 113, 0.2), transparent 30rem),
    linear-gradient(135deg, #0f3328, #174d3c 62%, #1f654e);
}
.login-card {
  width: min(100%, 430px);
  display: grid;
  padding: 32px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 28px 80px rgba(5, 26, 19, 0.32);
}
.login-card .brand-mark {
  margin-bottom: 24px;
  border-color: #c8ddd4;
  background: #e7f1ed;
  color: #174d3c;
}
.login-card h1 {
  margin: 0;
  color: #153d30;
  font-size: 2rem;
  letter-spacing: -0.04em;
}
.login-copy {
  margin: 8px 0 24px;
  color: #607269;
  line-height: 1.55;
}
.login-card label {
  margin-top: 13px;
}
.login-card input {
  margin-top: 7px;
}
.login-card #console-totp {
  font-size: 1.1rem;
  letter-spacing: 0.2em;
}
button,
input {
  font: inherit;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
a {
  color: inherit;
}
.page-shell {
  width: min(1460px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 64px;
}
.hero {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 26px;
  color: #fff;
  background: linear-gradient(125deg, #123d30, #1b5946 58%, #267159);
  border-radius: 22px;
  box-shadow: 0 18px 45px rgba(18, 61, 48, 0.18);
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.12);
  font-weight: 800;
  letter-spacing: -0.04em;
}
.hero-copy {
  flex: 1;
}
.hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.hero .logout-button {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.hero h1,
.hero p {
  margin: 0;
}
.hero h1 {
  margin: 2px 0 4px;
  font-size: clamp(1.45rem, 2.5vw, 2.15rem);
  letter-spacing: -0.035em;
}
.hero-copy > p:last-child {
  color: #d4e7df;
}
.eyebrow {
  margin: 0 0 5px;
  color: #5f776d;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.hero .eyebrow {
  color: #a9d5c3;
}
.local-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  color: #e9f5f0;
  font-size: 0.85rem;
  font-weight: 650;
  white-space: nowrap;
}
.local-badge span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #65e5a9;
  box-shadow: 0 0 0 4px rgba(101, 229, 169, 0.15);
}
main {
  margin-top: 22px;
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.summary-card {
  display: grid;
  padding: 19px 21px;
  border: 1px solid #dfe6e1;
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 24px rgba(31, 58, 46, 0.05);
}
.summary-card span {
  color: #617068;
  font-size: 0.82rem;
  font-weight: 700;
}
.summary-card strong {
  margin: 4px 0 0;
  color: #173c30;
  font-size: 1.8rem;
  letter-spacing: -0.04em;
}
.summary-card small {
  color: #8a9690;
}
.domain-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.6fr);
  gap: 28px;
  align-items: center;
  margin-top: 14px;
  padding: 22px 24px;
  border: 1px solid #dfe6e1;
  border-radius: 17px;
  background: #fff;
}
.domain-panel h2,
.section-heading h2,
.create-panel h2,
dialog h2 {
  margin: 0;
  font-size: 1.18rem;
  letter-spacing: -0.02em;
}
.domain-panel p:not(.eyebrow) {
  max-width: 760px;
  margin: 8px 0 0;
  color: #65726b;
  line-height: 1.55;
}
code {
  padding: 2px 6px;
  border-radius: 6px;
  background: #edf2ef;
  color: #1e5a46;
  font-size: 0.88em;
}
.domain-form label,
form > label,
fieldset > label {
  display: block;
  margin: 13px 0 6px;
  color: #33433b;
  font-size: 0.83rem;
  font-weight: 750;
}
label span {
  color: #87938d;
  font-weight: 500;
}
.input-action {
  display: flex;
  gap: 8px;
}
.remote-form {
  min-width: 0;
}
.connection-fields {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) 100px;
  gap: 10px;
}
.connection-fields label {
  display: block;
  margin: 0 0 6px;
  color: #33433b;
  font-size: 0.83rem;
  font-weight: 750;
}
.connection-message {
  font-weight: 650;
}
.connection-message.success {
  color: #1f7656 !important;
}
.connection-message.error {
  color: #9a3f35 !important;
}
input {
  width: 100%;
  min-height: 43px;
  padding: 9px 12px;
  border: 1px solid #cbd5cf;
  border-radius: 10px;
  outline: none;
  background: #fff;
  color: #16211c;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
input:focus {
  border-color: #2d8062;
  box-shadow: 0 0 0 3px rgba(45, 128, 98, 0.12);
}
input:disabled {
  background: #edf0ee;
  color: #7b8780;
}
.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(350px, 0.55fr);
  gap: 18px;
  align-items: start;
  margin-top: 18px;
}
.customers-panel,
.create-panel {
  border: 1px solid #dfe6e1;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 30px rgba(31, 58, 46, 0.05);
}
.customers-panel {
  padding: 22px;
}
.create-panel {
  position: sticky;
  top: 18px;
  padding: 22px;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 17px;
}
.section-heading.compact {
  margin-bottom: 3px;
}
.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 750;
  transition:
    transform 0.12s,
    opacity 0.12s,
    background 0.12s;
}
.button:hover:not(:disabled) {
  transform: translateY(-1px);
}
.button:disabled {
  cursor: wait;
  opacity: 0.55;
}
.button.primary {
  border-color: #175440;
  background: #175440;
  color: #fff;
}
.button.primary:hover:not(:disabled) {
  background: #0f4634;
}
.button.secondary {
  border-color: #cad8d1;
  background: #f7faf8;
  color: #174b3a;
}
.button.quiet {
  border-color: transparent;
  background: #edf3f0;
  color: #365247;
}
.button.danger {
  border-color: #a33e35;
  background: #a33e35;
  color: #fff;
}
.button.danger:hover:not(:disabled) {
  background: #873129;
}
.button.full {
  width: 100%;
  margin-top: 17px;
}
.customer-list {
  display: grid;
  gap: 12px;
}
.customer-card {
  display: flex;
  gap: 14px;
  padding: 17px;
  border: 1px solid #e0e6e2;
  border-radius: 15px;
  background: #fff;
}
.customer-avatar {
  display: grid;
  place-items: center;
  width: 45px;
  height: 45px;
  flex: 0 0 45px;
  border-radius: 12px;
  background: #e3f0ea;
  color: #1e654e;
  font-weight: 850;
}
.customer-main {
  min-width: 0;
  flex: 1;
}
.customer-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.customer-title-row h3 {
  margin: 0 0 4px;
  font-size: 1.02rem;
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 750;
  white-space: nowrap;
}
.status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.status.healthy {
  background: #e2f5ea;
  color: #177044;
}
.status.warning {
  background: #fff2d9;
  color: #91600b;
}
.status.neutral {
  background: #ecefed;
  color: #66726c;
}
.address-list {
  display: grid;
  gap: 7px;
  margin: 14px 0;
}
.address-list div {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 8px;
}
.address-list dt {
  color: #849089;
  font-size: 0.78rem;
  font-weight: 700;
}
.address-list dd {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.83rem;
}
.address-list a {
  color: #1d6a50;
}
.muted {
  color: #929b96;
}
.customer-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.admin-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 7px 10px;
  color: #738078;
  font-size: 0.78rem;
  font-weight: 750;
}
.admin-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.admin-state.present {
  color: #247451;
}
fieldset {
  margin: 17px 0 0;
  padding: 0;
  border: 0;
}
legend {
  width: 100%;
  padding: 0 0 7px;
  border-bottom: 1px solid #e4e9e6;
  color: #65736c;
  font-size: 0.79rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
fieldset small {
  display: block;
  margin-top: 7px;
  color: #87928c;
  line-height: 1.4;
}
.address-preview {
  margin-top: 10px;
  padding: 10px 11px;
  border-radius: 9px;
  background: #f0f5f2;
  color: #496258;
  font-size: 0.76rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.progress-message {
  min-height: 1.3em;
  margin: 9px 0 0;
  color: #5f7168;
  font-size: 0.82rem;
  line-height: 1.45;
}
.loading-card,
.empty-card,
.error-card {
  padding: 28px;
  border: 1px dashed #cfd9d3;
  border-radius: 14px;
  background: #f8faf9;
  color: #718078;
  text-align: center;
}
.error-card {
  border-color: #e7bcb7;
  background: #fff5f3;
  color: #98453a;
}
dialog {
  width: min(520px, calc(100% - 28px));
  padding: 0;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 26px 80px rgba(19, 44, 34, 0.28);
}
dialog::backdrop {
  background: rgba(16, 34, 27, 0.5);
  backdrop-filter: blur(3px);
}
dialog form {
  padding: 24px;
}
.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.dialog-copy {
  margin: 10px 0 4px;
  color: #6c7972;
}
.danger-copy {
  margin: 16px 0;
  padding: 12px 14px;
  border: 1px solid #e6b7b2;
  border-radius: 10px;
  background: #fff3f1;
  color: #853a32;
  line-height: 1.5;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 18px;
}
.icon-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 9px;
  background: #edf2ef;
  color: #31473d;
  cursor: pointer;
  font-size: 1.3rem;
}
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: min(430px, calc(100% - 48px));
  padding: 13px 16px;
  border-radius: 11px;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  background: #173f32;
  color: #fff;
  box-shadow: 0 12px 36px rgba(15, 45, 34, 0.25);
  transition: 0.2s;
}
.toast.visible {
  opacity: 1;
  transform: translateY(0);
}
.toast.error {
  background: #8d392f;
}

@media (max-width: 980px) {
  .content-grid,
  .domain-panel {
    grid-template-columns: 1fr;
  }
  .create-panel {
    position: static;
  }
}
@media (max-width: 680px) {
  .login-shell {
    padding: 12px;
  }
  .login-card {
    padding: 24px 20px;
  }
  .page-shell {
    width: min(100% - 22px, 1460px);
    padding-top: 11px;
  }
  .hero {
    align-items: flex-start;
    padding: 18px;
  }
  .local-badge {
    display: none;
  }
  .hero-actions {
    margin-left: auto;
  }
  .summary-grid {
    grid-template-columns: 1fr;
  }
  .domain-panel,
  .customers-panel,
  .create-panel {
    padding: 17px;
  }
  .input-action {
    flex-direction: column;
  }
  .connection-fields {
    grid-template-columns: 1fr;
  }
  .customer-title-row {
    flex-direction: column;
  }
  .customer-card {
    align-items: flex-start;
  }
}
