/* ═══════════════════════════════════════════════════════════════════════
   Layout shells: public / auth / customer / admin
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── App shell ────────────────────────────────────────────────── */
.app-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ═══════════════════════════════════════════════════════════════════════
   PUBLIC LAYOUT (home, pricing, reseller, apps, about, faq, contact)
   ═══════════════════════════════════════════════════════════════════════ */

.public-layout {
  padding-top: 0;
}

/* ═══════════════════════════════════════════════════════════════════════
   AUTH LAYOUT (login, register, forgot, reset, verify)
   Centered, single-column, focused
   ═══════════════════════════════════════════════════════════════════════ */

.auth-layout {
  min-height: calc(100dvh - var(--header-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5) var(--space-4);
  background:
    radial-gradient(ellipse at center top, rgba(255,46,198,0.06) 0%, transparent 50%),
    var(--ink);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: var(--space-6) var(--space-5);
  box-shadow: var(--shadow-xl);
  position: relative;
}

@media (min-width: 640px) {
  .auth-card { padding: var(--space-7) var(--space-6); }
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  inset-inline: 0;
  height: 2px;
  background: var(--grad-gold-line);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
}

.auth-head {
  text-align: center;
  margin-bottom: var(--space-6);
}

.auth-head .auth-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--space-4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--gold-soft);
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold);
}

.auth-head h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  margin-bottom: var(--space-2);
  color: var(--gold);
}

.auth-head p {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.auth-foot {
  text-align: center;
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* ═══════════════════════════════════════════════════════════════════════
   CUSTOMER LAYOUT (dashboard, subscriptions, profile, billing, apps)
   Single column on mobile; sidebar + main on desktop
   ═══════════════════════════════════════════════════════════════════════ */

.customer-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  padding: var(--space-5) 0 var(--space-7);
  min-height: calc(100dvh - var(--header-h));
}

@media (min-width: 1024px) {
  .customer-layout {
    grid-template-columns: 260px 1fr;
    gap: var(--space-6);
    padding: var(--space-6) 0 var(--space-8);
  }
}

.customer-sidebar {
  display: none;
}

@media (min-width: 1024px) {
  .customer-sidebar {
    display: block;
    position: sticky;
    top: calc(var(--header-h) + var(--space-4));
    height: fit-content;
    max-height: calc(100dvh - var(--header-h) - var(--space-7));
    overflow-y: auto;
    background: var(--surface-1);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: var(--space-4);
  }
}

.customer-sidebar nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.customer-sidebar nav a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  color: var(--text-soft);
  text-decoration: none;
  border-radius: var(--r-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  transition: all var(--tr-fast);
  min-height: var(--touch);
}

.customer-sidebar nav a:hover {
  background: var(--surface-2);
  color: var(--gold);
}

.customer-sidebar nav a.active {
  background: var(--gold-soft);
  color: var(--gold);
  border-inline-start: 3px solid var(--gold);
}

.customer-sidebar nav a .icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Mobile customer nav: bottom tabs */
.customer-bottom-tabs {
  position: fixed;
  bottom: 0;
  inset-inline: 0;
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  z-index: var(--z-sticky);
  padding: var(--space-1) 0 calc(var(--space-1) + env(safe-area-inset-bottom));
}

@media (min-width: 1024px) {
  .customer-bottom-tabs { display: none; }
}

.customer-bottom-tabs a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-2);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 10px;
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  min-height: var(--touch);
}

.customer-bottom-tabs a .icon {
  width: 22px;
  height: 22px;
}

.customer-bottom-tabs a.active {
  color: var(--gold);
}

.customer-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  min-width: 0;
  padding-bottom: 90px;  /* clearance for mobile bottom tabs */
}

@media (min-width: 1024px) {
  .customer-main { padding-bottom: 0; }
}

.customer-greeting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.customer-greeting h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  margin: 0;
}

@media (min-width: 768px) {
  .customer-greeting h1 { font-size: var(--text-3xl); }
}

/* ═══════════════════════════════════════════════════════════════════════
   ADMIN LAYOUT (21 sections, executive dashboard, sidebar + main)
   ═══════════════════════════════════════════════════════════════════════ */

.admin-layout {
  display: grid;
  grid-template-columns: 1fr;
  min-height: calc(100dvh - var(--header-h));
}

@media (min-width: 1024px) {
  .admin-layout {
    grid-template-columns: 280px 1fr;
  }
}

/* Admin sidebar */
.admin-sidebar {
  display: none;
  background: var(--ink-deep);
  border-inline-end: 1px solid var(--line);
  position: sticky;
  top: var(--header-h);
  height: calc(100dvh - var(--header-h));
  overflow-y: auto;
}

@media (min-width: 1024px) {
  .admin-sidebar { display: block; }
}

.admin-sidebar-inner {
  padding: var(--space-4);
}

.admin-sidebar-group {
  margin-bottom: var(--space-5);
}

.admin-sidebar-label {
  display: block;
  padding: var(--space-2) var(--space-3);
  font-size: 10px;
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--gold-deep);
}

.admin-sidebar a {
  display: grid;
  grid-template-columns: 32px 1fr;
  grid-template-areas: "code label" "code hint";
  align-items: center;
  gap: 2px var(--space-3);
  padding: var(--space-3);
  color: var(--text-soft);
  text-decoration: none;
  border-radius: var(--r-md);
  font-size: var(--text-sm);
  transition: all var(--tr-fast);
  border: 1px solid transparent;
  margin-bottom: 2px;
}

.admin-sidebar a:hover {
  background: var(--surface-2);
}

.admin-sidebar a.active {
  background: var(--gold-soft);
  border-color: var(--gold);
  color: var(--gold);
}

.admin-sidebar a b {
  grid-area: code;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--surface-2);
  color: var(--gold);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: var(--weight-bold);
}

.admin-sidebar a.active b {
  background: var(--gold);
  color: var(--text-on-gold);
}

.admin-sidebar a span {
  grid-area: label;
  font-weight: var(--weight-semibold);
  color: inherit;
}

.admin-sidebar a small {
  grid-area: hint;
  color: var(--text-dim);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-sidebar a.active small { color: var(--gold-deep); }

/* Admin main */
.admin-main {
  min-width: 0;
  padding: var(--space-5) var(--space-4) var(--space-7);
}

@media (min-width: 768px) {
  .admin-main {
    padding: var(--space-6) var(--space-5) var(--space-8);
  }
}

@media (min-width: 1024px) {
  .admin-main {
    padding: var(--space-6) var(--space-7) var(--space-8);
  }
}

.admin-page-head {
  margin-bottom: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

@media (min-width: 768px) {
  .admin-page-head {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }
}

.admin-page-head h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  margin: 0 0 var(--space-2);
  color: var(--gold);
}

@media (min-width: 768px) {
  .admin-page-head h1 { font-size: var(--text-3xl); }
}

.admin-page-head .subtitle {
  color: var(--text-muted);
  font-size: var(--text-sm);
  max-width: 60ch;
}

.admin-page-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}
