:root {
  --brand: #0f6e56;
  --brand-dark: #084d3d;
  --soft: #eef8f5;
  --ink: #12231d;
  --muted: #687971;
  --line: #dde8e3;
  --danger: #a12626;
  --bg: #f6f9f8;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Vazirmatn, Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
}
button,
input,
textarea,
select {
  font: inherit;
}
.auth-loader {
  min-height: 100dvh;
  display: grid;
  place-content: center;
  text-align: center;
  color: var(--muted);
}
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #d8e7e1;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: auto;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.app {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  background: #fff;
  border-left: 1px solid var(--line);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px 24px;
  text-decoration: none;
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
}
.brand img {
  width: 34px;
  height: 34px;
}
.sidebar nav {
  display: grid;
  gap: 6px;
}
.nav[data-section="home"] { order: 1; }
.nav[data-section="sites"] { order: 2; }
.nav[data-section="new-site"] { order: 3; }
.nav[data-section="analytics"] { order: 4; }
.nav[data-section="link"] { order: 5; }
.sidebar nav > a.nav { order: 6; }
.nav[data-section="settings"] { order: 7; }
.nav {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: #54655e;
  text-decoration: none;
  text-align: right;
  cursor: pointer;
}
.nav span {
  width: 22px;
  height: 22px;
}
.nav svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}
.nav:hover,
.nav.active {
  color: var(--brand);
  background: var(--soft);
}
.nav b {
  font-weight: 700;
}
.account {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  display: grid;
  grid-template-columns: 42px 1fr 32px;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.account span:nth-child(2) {
  min-width: 0;
}
.account b,
.account small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account small {
  color: var(--muted);
  margin-top: 2px;
}
.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}
.account button {
  border: 0;
  background: none;
  cursor: pointer;
  color: var(--muted);
}
.workspace {
  min-width: 0;
}
.topbar {
  height: 66px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 15;
}
.topbar strong {
  font-size: 17px;
}
.topbar-actions {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.language {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 9px;
  padding: 7px 12px;
  cursor: pointer;
}
.icon-button {
  display: none;
  border: 0;
  background: none;
  font-size: 23px;
}
main {
  max-width: 1180px;
  margin: auto;
  padding: 32px;
}
.page {
  display: none;
}
.page.active {
  display: block;
}
.page-head,
.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 22px;
}
.hero {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  border-radius: 20px;
  padding: 30px;
}
.hero h1,
.page-head h1 {
  margin: 4px 0 8px;
}
.hero p {
  margin: 0;
  opacity: 0.84;
}
.eyebrow {
  font-size: 13px;
  font-weight: 800;
}
.plan-pill {
  background: #ffffff20;
  border: 1px solid #ffffff45;
  padding: 8px 13px;
  border-radius: 999px;
}
.card,
.notice {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 8px 28px rgba(15, 55, 43, 0.04);
}
.notice {
  background: var(--soft);
  color: var(--brand-dark);
}
.trial-reminder {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-color: color-mix(in srgb, var(--brand) 32%, var(--line));
}
.trial-reminder strong { font-size: 17px; }
.trial-reminder p { margin: 7px 0 0; line-height: 1.8; }
.trial-reminder .trial-warning { color: var(--muted); max-width: 820px; }
.trial-cta { flex: 0 0 auto; text-align: center; white-space: nowrap; }
@media (max-width: 650px) {
  .trial-reminder { align-items: stretch; flex-direction: column; }
  .trial-cta { width: 100%; }
}
.site-card-head,
.actions,
.link-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.site-card-head {
  justify-content: space-between;
}
.empty-site {
  max-width: 720px;
  padding: clamp(28px, 5vw, 48px);
  text-align: center;
  margin-inline: auto;
}
.empty-site h2 {
  margin: 12px 0 8px;
  font-size: clamp(24px, 4vw, 34px);
}
.empty-site p {
  max-width: 560px;
  margin: 0 auto 24px;
  color: var(--muted);
  line-height: 1.8;
}
.empty-site-step {
  display: inline-flex;
  color: var(--brand-dark);
  background: var(--soft);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 800;
}
.empty-site-action {
  min-width: min(100%, 240px);
}
.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #9aa9a3;
  margin-inline-end: 7px;
}
.status-dot.live {
  background: #18a36f;
}
.url {
  direction: ltr;
  text-align: left;
  background: #f4f7f6;
  border: 1px solid var(--line);
  padding: 12px;
  border-radius: 10px;
  overflow-wrap: anywhere;
  margin: 16px 0;
}
.primary,
.secondary,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  padding: 11px 16px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
}
.primary {
  background: var(--brand);
  color: #fff;
  border: 1px solid var(--brand);
}
.secondary,
.button-link {
  background: #fff;
  color: var(--brand);
  border: 1px solid var(--line);
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.upgrade {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  background: linear-gradient(135deg, #eff8f5, #fff);
}
.upgrade a {
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  padding: 12px 16px;
  border-radius: 10px;
  white-space: nowrap;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.form-grid label {
  display: grid;
  gap: 7px;
  font-weight: 700;
}
.form-grid input,
.form-grid textarea,
.form-grid select {
  width: 100%;
  border: 1px solid #cbd9d3;
  border-radius: 10px;
  padding: 11px;
  background: #fff;
}
.form-grid textarea {
  min-height: 96px;
  resize: vertical;
}
.new-site-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 20px;
}
.new-site-grid .card {
  margin: 0;
}
.new-site-kicker {
  display: inline-flex;
  padding: 6px 10px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 800;
}
.upload-card {
  display: grid;
  gap: 15px;
}
.upload-card h2,
.upload-card p {
  margin: 0;
}
.upload-card > p {
  color: var(--muted);
  line-height: 1.8;
}
.file-picker {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px dashed #a6c9bc;
  border-radius: 12px;
  background: #f7fbf9;
  font-weight: 800;
}
.file-picker small,
.form-grid small {
  color: var(--muted);
  font-weight: 500;
  line-height: 1.6;
}
.site-list {
  display: grid;
  gap: 14px;
}
.site-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}
.site-row h2,
.site-row p { margin: 0; }
.site-row p { color: var(--muted); margin-top: 7px; }
.site-row .url { margin-bottom: 0; }
.full {
  grid-column: 1/-1;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.metric {
  background: #f6faf8;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 18px;
}
.metric strong {
  font-size: 28px;
  display: block;
  margin-top: 6px;
}
.skeleton {
  height: 120px;
  border-radius: 12px;
  background: linear-gradient(90deg, #edf2f0 25%, #f7f9f8 50%, #edf2f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}
@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}
.error {
  color: var(--danger);
}
.danger-zone {
  border-color: #efcaca;
  background: #fffafa;
}
.danger-button {
  border: 1px solid var(--danger);
  background: var(--danger);
  color: #fff;
  border-radius: 10px;
  padding: 11px 16px;
  font-weight: 800;
  cursor: pointer;
}
html[dir="ltr"] .sidebar {
  border-left: 0;
  border-right: 1px solid var(--line);
}
@media (max-width: 820px) {
  .app {
    display: block;
  }
  .sidebar {
    position: fixed;
    right: 0;
    transform: translateX(105%);
    width: min(290px, 88vw);
    transition: 0.2s;
    box-shadow: 0 0 30px #0002;
  }
  .sidebar.open {
    transform: none;
  }
  .icon-button {
    display: block;
  }
  main {
    padding: 22px 16px;
  }
  .topbar {
    padding: 0 16px;
  }
  .form-grid,
  .metrics,
  .new-site-grid {
    grid-template-columns: 1fr;
  }
  .site-row {
    grid-template-columns: 1fr;
  }
  .full {
    grid-column: auto;
  }
  .upgrade,
  .hero {
    align-items: flex-start;
    flex-direction: column;
  }
  .card {
    padding: 19px;
  }
}
html[dir="ltr"] .sidebar {
  left: 0;
  right: auto;
  transform: translateX(-105%);
}
html[dir="ltr"] .sidebar.open {
  transform: none;
}
