:root {
  color-scheme: dark;
  --bg: #080c0b;
  --surface: #111714;
  --ink: #f4f7f5;
  --muted: #a9b6ae;
  --line: #2b3630;
  --green: #25d366;
  --deep: #092315;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: radial-gradient(ellipse at 50% 38%, rgb(37 211 102 / 7%), transparent 42%), var(--bg);
  color: var(--ink);
  font: 15px Onest, system-ui, sans-serif;
}

.shell {
  width: min(100% - 40px, 440px);
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 100px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.brand img { width: 132px; height: auto; object-fit: contain; filter: brightness(0) invert(1); }

.brand-tag {
  padding: 4px 6px;
  border: 1px solid #25d36655;
  border-radius: 5px;
  color: var(--green);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
}

.layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px 0 52px;
}

.card {
  width: 100%;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgb(17 23 20 / 92%);
  box-shadow: 0 24px 80px rgb(0 0 0 / 28%);
}

.view[hidden] { display: none; }

.card-icon {
  width: 44px;
  height: 44px;
  margin-bottom: 23px;
  display: grid;
  place-items: center;
  border: 1px solid rgb(37 211 102 / 18%);
  border-radius: 13px;
  background: rgb(37 211 102 / 9%);
  color: var(--green);
}

.ph-icon { width: 20px; height: 20px; flex: 0 0 auto; fill: currentColor; }

.eyebrow {
  margin: 0 0 8px;
  color: #8da398;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
}

.card h1 {
  margin: 0 0 8px;
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -.04em;
  line-height: 1.2;
}

.muted {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.muted strong { color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }

.card label {
  display: block;
  margin-bottom: 8px;
  color: #e4eae6;
  font-size: 12px;
  font-weight: 600;
}

.card input {
  display: block;
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid #344139;
  border-radius: 9px;
  outline: none;
  background: #0b100d;
  color: var(--ink);
  font: inherit;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.card input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgb(37 211 102 / 13%); }
.card input::placeholder { color: #748078; }
.otp-field { position: relative; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.otp-slot { height: 50px; display: grid; place-items: center; border: 1px solid #29352e; border-radius: 8px; background: #0b100d; color: var(--ink); font: 600 20px ui-monospace, SFMono-Regular, Menlo, monospace; transition: border-color .16s ease, box-shadow .16s ease, background .16s ease; }
.otp-slot.is-active { border-color: #c8d2cb; box-shadow: 0 0 0 1px #c8d2cb; }
.otp-field input.otp-input { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 8px; opacity: 0; background: transparent; color: transparent; caret-color: transparent; cursor: text; }
.otp-field input.otp-input:focus { border: 0; box-shadow: none; }
.turnstile-wrap { min-height: 65px; margin-top: 16px; display: flex; justify-content: center; }

.primary {
  width: 100%;
  min-height: 48px;
  margin-top: 17px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 9px;
  background: var(--green);
  color: #06200f;
  font: 600 14px Onest, system-ui, sans-serif;
  cursor: pointer;
  transition: filter .15s ease, transform .15s ease;
}

.primary:hover { filter: brightness(1.06); }
.primary:active { transform: translateY(1px); }
.primary:disabled { opacity: .62; cursor: wait; }
.primary .ph-icon { width: 17px; height: 17px; }

.feedback { min-height: 18px; margin: 12px 0 0; color: #ff9a9a; font-size: 12px; line-height: 1.5; }
.feedback:empty { display: none; }
.view > p.feedback { color: var(--muted); }

.text-button {
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 500 12px Onest, system-ui, sans-serif;
  cursor: pointer;
}

.text-button:hover { color: var(--green); }
.text-button .ph-icon { width: 15px; height: 15px; }
.back-button { margin: 0 0 23px; }
.back-button .ph-icon { transform: rotate(180deg); }

.account-head { display: flex; align-items: flex-start; justify-content: space-between; }
.account-head .card-icon { margin-bottom: 23px; }
.account-head > .text-button { margin-top: 8px; }
.tenant-list { display: grid; gap: 10px; }

.tenant {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0d130f;
}

.tenant-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; font-weight: 600; }
.plan { padding: 4px 8px; border-radius: 20px; background: #143321; color: #8fe8a5; font-size: 10px; font-weight: 700; }
.tenant-meta { margin: 7px 0 14px; color: var(--muted); font-size: 12px; }
.tenant-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.status { color: #c6d6cb; font-size: 11px; }
.status.offline { color: #f0bc72; }
.tenant-actions .primary { width: auto; min-height: 36px; margin: 0; padding: 0 13px; font-size: 12px; }

.empty { padding: 17px; border: 1px dashed #344139; border-radius: 9px; color: var(--muted); font-size: 13px; line-height: 1.6; }

.loading-view { text-align: center; }
.spinner { width: 26px; height: 26px; margin: 30px auto 14px; border: 2px solid #2b3630; border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
.loading-view > p { margin: 0; color: var(--muted); font-size: 13px; }
.security-note { margin: 18px 0 0; display: flex; align-items: center; justify-content: center; gap: 7px; color: var(--green); font-size: 11px; text-align: center; }
.security-note .ph-icon { width: 15px; height: 15px; color: var(--green); }
.security-note strong { color: var(--green); font-weight: 600; }
.cloudflare-mark { width: 16px; height: 16px; display: inline-block; flex: 0 0 auto; background: var(--green); -webkit-mask: url('/cloudflare.png') center / contain no-repeat; mask: url('/cloudflare.png') center / contain no-repeat; }

@keyframes spin { to { transform: rotate(360deg); } }

footer {
  min-height: 64px;
  padding: 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: #849289;
  font-size: 10px;
}

footer nav { display: flex; gap: 16px; }
footer a { color: #a9b6ae; font-size: 11px; text-decoration: none; }
footer a:hover { color: var(--green); }

@media (max-width: 520px) {
  .shell { width: min(100% - 28px, 420px); }
  .topbar { height: 82px; }
  .layout { padding: 18px 0 34px; }
  .card { padding: 25px 22px; }
  .card h1 { font-size: 23px; }
  footer { align-items: center; flex-direction: column; padding: 15px 0; text-align: center; }
  footer nav { justify-content: center; }
}

html { scrollbar-gutter: stable; }

.account-navigation { display: none; }
.account-dashboard { background: var(--bg); -webkit-font-smoothing: antialiased; }
.account-dashboard .shell { width: min(1240px, calc(100% - 96px)); }
.account-dashboard .topbar { height: 94px; justify-content: space-between; border-bottom: 1px solid var(--line); gap: 24px; }
.account-dashboard .brand img { width: 150px; }
.account-dashboard .account-navigation { display: flex; align-items: center; gap: 28px; }
.account-navigation a, .account-navigation .text-button { font-size: 14px; color: var(--muted); text-decoration: none; }
.account-navigation a:hover, .account-navigation .text-button:hover { color: var(--ink); }
.account-navigation .text-button { padding: 9px 16px; border: 1px solid #43574a; border-radius: 8px; }
.account-dashboard .layout { justify-content: flex-start; padding: 48px 0 64px; }
.account-dashboard .card { padding: 0; border: 0; background: transparent; box-shadow: none; }
.account-dashboard .security-note { display: none; }
.account-intro { display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.account-dashboard .card h1 { font-size: 36px; font-weight: 600; letter-spacing: -.03em; margin-bottom: 12px; }
.account-intro .muted { font-size: 15px; margin: 0; }
.account-support { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; color: #b8e8c9; text-decoration: none; flex-shrink: 0; }
.account-support:hover { color: var(--green); }
.account-summary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 24px; padding: 26px 0; margin: 32px 0 40px; border-block: 1px solid var(--line); }
.account-summary article { display: flex; align-items: center; gap: 14px; min-width: 0; }
.account-summary article > .ph-icon { width: 24px; height: 24px; color: #79cc96; }
.account-summary span { display: block; color: var(--muted); font-size: 13px; line-height: 1.5; }
.account-summary strong { display: block; margin-top: 4px; font-size: 24px; font-weight: 500; font-variant-numeric: tabular-nums; }
.account-section-heading { margin-bottom: 24px; }
.account-section-title { font-size: 22px; font-weight: 600; letter-spacing: -.02em; margin: 0 0 6px; }
.account-section-heading p { color: var(--muted); font-size: 14px; margin: 0; line-height: 1.6; }
.account-dashboard .tenant-list { display: grid; gap: 24px; }
.account-dashboard .tenant { padding: 0; background: var(--surface); border: 1px solid #35483c; border-radius: 12px; overflow: hidden; }
.tenant-overview { padding: 24px 28px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.tenant-identity { display: flex; align-items: center; gap: 16px; min-width: 0; }
.environment-icon { width: 44px; height: 44px; display: grid; place-items: center; flex-shrink: 0; border-radius: 10px; background: #1b2b20; color: #8fe8a5; }
.tenant-identity h2 { font-size: 20px; font-weight: 600; letter-spacing: -.02em; margin: 0; }
.tenant-identity p { margin: 6px 0 0; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; line-height: 1.6; }
.account-dashboard .tenant-actions { gap: 20px; flex-shrink: 0; }
.account-dashboard .primary { border-radius: 8px; }
.account-dashboard .tenant-actions .primary { min-height: 44px; font-size: 14px; padding: 0 18px; }
.account-dashboard .status { display: inline-flex; align-items: center; gap: 7px; color: #9ae9b5; font-size: 12px; white-space: nowrap; }
.account-dashboard .status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.account-dashboard .status.offline { color: #f0bc72; }
.tenant-content { display: grid; grid-template-columns: minmax(0,1fr) 300px; }
.tenant-details { padding: 28px; min-width: 0; }
.account-environment-meta { display: flex; flex-wrap: wrap; gap: 24px 32px; }
.account-environment-meta span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 7px; }
.account-environment-meta strong { display: block; font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.account-dashboard .tenant h3 { font-size: 15px; font-weight: 600; margin: 32px 0 12px; }
.account-table-wrap { overflow-x: auto; }
.account-table-wrap table { width: 100%; border-collapse: collapse; font-size: 14px; text-align: left; }
.account-table-wrap th { color: var(--muted); font-weight: 500; font-size: 12px; }
.account-table-wrap td, .account-table-wrap th { padding: 14px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.account-table-wrap td:first-child, .account-table-wrap th:first-child { padding-left: 0; }
.account-table-wrap tr:last-child td { border-bottom: 0; }
.tenant-subscription { background: #1b2b20; padding: 28px; }
.subscription-label { color: #b8c8be; font-size: 12px; }
.subscription-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.subscription-title > strong { font-size: 26px; font-weight: 600; letter-spacing: -.025em; }
.subscription-title .plan { border-radius: 5px; background: #274333; color: #acf5c6; font-size: 11px; }
.tenant-subscription p { color: #b8c8be; font-size: 13px; line-height: 1.6; margin: 12px 0 20px; }
.tenant-subscription ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 13px; }
.tenant-subscription li { display: flex; align-items: center; gap: 9px; color: #d0ddd4; font-size: 13px; line-height: 1.6; }
.tenant-subscription li .ph-icon { width: 16px; height: 16px; color: #6ed897; }
.subscription-link { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: #acf5c6; font-size: 13px; text-decoration: none; border-top: 1px solid #3c5142; padding-top: 20px; margin-top: 24px; }
.subscription-link:hover { color: var(--ink); }
.account-dashboard footer { font-size: 12px; }
.account-dashboard footer a { font-size: 12px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; }
@media(max-width: 1000px) {
    .account-dashboard .shell { width: calc(100% - 48px); }
    .tenant-overview { align-items: flex-start; }
    .account-dashboard .tenant-actions { align-items: flex-end; flex-direction: column; gap: 12px; }
    .tenant-content { grid-template-columns: minmax(0,1fr) 270px; }
}
@media(max-width: 700px) {
    .account-dashboard .shell { width: calc(100% - 32px); }
    .account-dashboard .topbar { height: 80px; gap: 12px; }
    .account-dashboard .brand img { width: 126px; }
    .account-dashboard .account-navigation { gap: 12px; }
    .account-navigation > a { display: none; }
    .account-dashboard .layout { padding: 32px 0 40px; }
    .account-intro { align-items: flex-start; flex-direction: column; gap: 16px; }
    .account-dashboard .card h1 { font-size: 30px; }
    .account-summary { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px 16px; margin: 28px 0 32px; }
    .account-summary article { gap: 10px; }
    .tenant-overview { flex-direction: column; padding: 22px; gap: 20px; }
    .account-dashboard .tenant-actions { width: 100%; flex-direction: row; align-items: center; }
    .tenant-content { grid-template-columns: 1fr; }
    .tenant-details, .tenant-subscription { padding: 22px; }
    .account-environment-meta { gap: 22px; }
    .account-dashboard footer { flex-direction: column; justify-content: center; text-align: center; }
}
@media(prefers-reduced-motion:reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
