/* ── Auth body ──────────────────────────────────────────────────── */
.auth-body {
  min-height: 100vh;
  background: var(--brand-ink);
  display: flex; align-items: stretch;
}

/* ── Login layout ───────────────────────────────────────────────── */
.login {
  display: flex; min-height: 100vh; width: 100%;
}

.login-brand {
  flex: 0 0 50%;
  background: var(--brand-ink);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  padding: 48px 40px;
  position: relative; overflow: hidden;
}
.login-brand-inner {
  display: flex; flex-direction: column; gap: 28px;
  max-width: 440px; width: 100%; position: relative; z-index: 1;
}
.login-brand-inner .brand-name { color: var(--brand-cream); }
.login-brand-inner .brand-sub { color: rgba(245,230,211,.5); }
.login-brand-art { width: 100%; max-width: 400px; align-self: center; }
.login-brand-art svg { width: 100%; height: auto; }
.login-brand-copy { }
.login-brand-tag {
  font-size: 10px; font-weight: 800; letter-spacing: .12em;
  color: var(--brand-gold); opacity: .8;
  text-transform: uppercase; margin-bottom: 12px;
}
.login-brand-copy h2 {
  font-size: 28px; font-weight: 800; line-height: 1.25;
  color: var(--brand-cream); margin-bottom: 10px;
}
.login-brand-copy p { font-size: 14px; color: rgba(245,230,211,.65); line-height: 1.6; }
.login-brand-stats {
  display: flex; gap: 24px; padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.login-brand-stats > div {
  display: flex; flex-direction: column; gap: 2px;
}
.login-brand-stats strong { font-size: 22px; font-weight: 800; color: var(--brand-gold); }
.login-brand-stats span { font-size: 11px; color: rgba(245,230,211,.55); }

.login-form-wrap {
  flex: 0 0 50%;
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  padding: 40px 32px;
  overflow-y: auto;
}
.login-form {
  width: 100%; max-width: 380px;
  display: flex; flex-direction: column; gap: 20px;
}
.login-form-brand { display: none; }
.login-head { }
.login-head-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.login-kicker { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .07em; text-transform: uppercase; }
.login-head h1 { font-size: 26px; font-weight: 800; color: var(--text); letter-spacing: -.02em; margin-bottom: 6px; }
.login-head p { font-size: 14px; color: var(--muted); line-height: 1.5; }

.login-tabs {
  display: flex; gap: 2px;
  background: var(--neutral-bg);
  border-radius: var(--r-sm); padding: 3px; border: 1px solid var(--border);
}
.login-tab {
  flex: 1; text-align: center;
  padding: 7px 12px;
  font-size: 13px; font-weight: 600; color: var(--muted);
  border-radius: calc(var(--r-sm) - 2px);
  transition: background .15s, color .15s;
}
.login-tab:hover { color: var(--text); }
.login-tab-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.login-fields { display: flex; flex-direction: column; gap: 16px; }

.otp-row { display: flex; gap: 8px; }
.otp-cell {
  flex: 1; height: 52px;
  text-align: center; font-size: 22px; font-weight: 700;
  border: 1.5px solid var(--border); border-radius: var(--r-sm);
  outline: none; background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
.otp-cell:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(var(--brand-rgb),.1); }
.otp-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.otp-hint a { color: var(--brand); font-weight: 600; }

.login-trust {
  display: flex; gap: 16px; flex-wrap: wrap;
}
.login-trust-item {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--muted);
}

.login-foot { font-size: 13px; color: var(--muted); line-height: 1.6; }
.login-foot a { color: var(--brand); font-weight: 700; }

.login-register-link {
  text-align: center; font-size: 14px; color: var(--muted);
}
.login-register-link .link { color: var(--brand); font-weight: 600; text-decoration: none; }
.login-register-link .link:hover { text-decoration: underline; }

/* ── Register steps ─────────────────────────────────────────────── */
.register-steps {
  display: flex; align-items: flex-start; gap: 0;
  margin-bottom: 20px; position: relative;
}
.register-steps::before {
  content: ''; position: absolute;
  top: 12px; left: 12px; right: 12px; height: 2px;
  background: var(--border); z-index: 0;
}
.register-step {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 6px; position: relative; z-index: 1;
}
.register-step-dot {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--surface-2); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--muted);
  transition: all .2s;
}
.register-step-active .register-step-dot {
  background: var(--brand); border-color: var(--brand); color: #fff;
}
.register-step-done .register-step-dot {
  background: var(--ok); border-color: var(--ok); color: #fff;
}
.register-step-label {
  font-size: 10px; font-weight: 600; color: var(--muted);
  text-align: center; line-height: 1.3;
}
.register-step-active .register-step-label { color: var(--brand); }
.register-step-done .register-step-label { color: var(--ok); }

/* ── App shell ──────────────────────────────────────────────────── */
.app-shell {
  display: flex;
  height: 100vh; height: 100dvh;
  min-height: 100vh; min-height: 100dvh;
  overflow: hidden;
}
.app-body {
  flex: 1; display: flex; flex-direction: column;
  min-width: 0; min-height: 0;
  height: 100vh; height: 100dvh;
}
.app-main {
  flex: 1; min-height: 0; overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
}

/* ── Sidebar ────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--brand-ink);
  display: flex; flex-direction: column;
  position: sticky; top: 0;
  min-height: 100vh; min-height: 100dvh;
  align-self: stretch;
  flex-shrink: 0; z-index: 50;
}
.sidebar-brand {
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.sidebar-brand .brand-name { color: var(--brand-cream); }
.sidebar-brand .brand-sub { color: rgba(245,230,211,.4); }
.sidebar-brand .brand-glyph { color: var(--brand); }
.brand-logo { width: 28px; height: 28px; object-fit: contain; border-radius: 4px; }

.sidebar-nav {
  flex: 1; padding: 12px 10px;
  display: flex; flex-direction: column; gap: 2px;
  overflow-y: auto;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r-sm);
  color: rgba(255,255,255,.55);
  font-size: 13.5px; font-weight: 600;
  transition: background-color .15s, color .15s;
  position: relative;
  border: 1px solid transparent;
}
.nav-item:hover { background-color: rgba(255,255,255,.07); color: rgba(255,255,255,.85); }
.nav-item-active {
  background-color: rgba(var(--brand-rgb),.2);
  color: #fff;
  border-color: rgba(var(--brand-rgb),.35);
}
.nav-item-active:hover { background-color: rgba(var(--brand-rgb),.25); }
.nav-item-label { flex: 1; }
.nav-item-badge {
  min-width: 18px; height: 18px;
  background: var(--brand); color: #fff;
  border-radius: 20px; font-size: 10px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  padding: 0 5px;
}


/* ── Topbar ─────────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 40;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}
.topbar-title { display: flex; flex-direction: column; }
.topbar-crumb { font-size: 11px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }
.topbar-page { font-size: 17px; font-weight: 800; color: var(--text); letter-spacing: -.01em; line-height: 1.2; }

.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-search {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  min-width: 200px;
  transition: border-color .15s;
}
.topbar-search:focus-within { border-color: var(--brand); background: var(--surface); }
.topbar-search svg { color: var(--faint); }
.topbar-search input { border: none; outline: none; background: transparent; font-size: 13.5px; color: var(--text); flex: 1; }
.topbar-search kbd {
  font-size: 10px; color: var(--faint);
  background: var(--border); border-radius: 3px;
  padding: 1px 5px; font-family: var(--font-mono);
}
.topbar-icon-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: none; background: transparent; cursor: pointer;
  color: var(--muted);
  transition: background .15s, color .15s;
  position: relative;
}
.topbar-icon-btn:hover { background: var(--neutral-bg); color: var(--text); }
.topbar-icon-badge,
.topbar-icon-dot {
  position: absolute; top: 3px; right: 3px;
  min-width: 15px; height: 15px;
  background: var(--brand); color: #fff;
  border-radius: 20px; font-size: 9px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}
.topbar-divider { width: 1px; height: 24px; background: var(--border); }
.topbar-customer { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: var(--r-sm); transition: background .15s; }
.topbar-customer:hover { background: var(--neutral-bg); }
.topbar-customer .avatar { background: var(--brand); }
.topbar-customer-info { }
.topbar-customer-name { font-size: 13px; font-weight: 700; color: var(--text); line-height: 1.3; }
.topbar-customer-shop { font-size: 11px; color: var(--muted); }

/* ── Mobile topbar ──────────────────────────────────────────────── */
.m-topbar {
  display: none;
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--m-topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  align-items: center; justify-content: space-between;
  padding: 0 16px;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}
.m-topbar-title { font-size: 16px; font-weight: 800; color: var(--text); }
.m-topbar-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: transparent; cursor: pointer;
  color: var(--muted); position: relative;
}
.m-topbar-right { display: flex; align-items: center; gap: 8px; }
.m-topbar-badge,
.m-topbar-dot {
  position: absolute; top: 3px; right: 3px;
  min-width: 15px; height: 15px;
  background: var(--brand); color: #fff;
  border-radius: 20px; font-size: 9px; font-weight: 800; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
  border: 2px solid var(--surface);
}

/* ── Bottom nav (mobile) ────────────────────────────────────────── */
.bottomnav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 50;
  padding-bottom: env(safe-area-inset-bottom);
}
.bottomnav { display: none; align-items: stretch; }
.bn-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--muted); font-size: 10px; font-weight: 600;
  padding: 8px 4px; transition: color .15s;
}
.bn-item svg { display: block; overflow: hidden; transition: height .2s ease, opacity .18s ease, transform .15s; }
.bn-item-active { color: var(--brand); }
.bn-item-active svg { transform: scale(1.05); }
.bn-item-primary {
  color: #fff;
  background: var(--brand); border-radius: var(--r);
  margin: 6px 4px;
  padding: 4px 8px;
  box-shadow: 0 2px 8px rgba(var(--brand-rgb),.35);
}
.bn-item-primary.bn-item-active { color: #fff; }

/* ── Page content wrapper ───────────────────────────────────────── */
.page {
  padding: 0 24px 32px;
  max-width: 1100px;
}
.page-narrow {
  max-width: 560px;
}

/* ── Mobile breakpoint ──────────────────────────────────────────── */
@media (max-width: 899px) {
  .sidebar { display: none; }
  .topbar { display: none; }
  .m-topbar { display: flex; }
  .bottomnav { display: flex; }

  .app-main {
    padding-top: var(--m-topbar-h);
    padding-bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom));
  }
  .page { padding: 0 16px 24px; }

  .login-brand { display: none; }
  .login-form-wrap { flex: 1; padding: 32px 20px; align-items: flex-start; padding-top: 48px; }
  .login-form-brand { display: flex; margin-bottom: 4px; }
  .login-form { max-width: 100%; }
  .login-head h1 { font-size: 24px; }
}

@media (min-width: 900px) {
  .app-main { padding-top: 0; }
}
