:root {
  --cc-bg: #ffffff;
  --cc-accent: #0d9488;
  --bg-deep: #ffffff;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-elevated: #ffffff;
  --text: #0f172a;
  --text-soft: #334155;
  --muted: #64748b;
  --accent: #0d9488;
  --accent-soft: rgba(13, 148, 136, 0.1);
  --accent-blue: #0d9488;
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.14);
  --success: #059669;
  --warn: #d97706;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow: 0 16px 48px rgba(15, 23, 42, 0.08);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  min-height: 100dvh;
  background: var(--bg);
  background-image: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
}

/* ——— Welcome / login ——— */
.welcome-screen {
  min-height: 100dvh;
  display: flex;
  align-items: stretch;
  padding: 0;
}

.welcome-inner {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.welcome-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 0 1.5rem;
}

.brand-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.5rem;
}

.product-logo {
  border-radius: 16px;
  box-shadow: var(--shadow), 0 0 0 1px var(--border-strong);
}

.publisher {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

.product-name {
  margin: 0.2rem 0 0;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.hero-tagline {
  font-size: 1.1rem;
  line-height: 1.5;
  margin: 0 0 1.25rem;
  color: var(--text-soft);
  font-weight: 400;
}

.hero-bullets {
  margin: 0 0 1.75rem;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.hero-bullets li {
  padding-left: 1.25rem;
  position: relative;
  margin-bottom: 0.5rem;
}

.hero-bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.welcome-card {
  background: var(--surface-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.env-banner {
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
  margin-top: 1rem;
  line-height: 1.4;
}

/* ——— App shell ——— */
.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 0.85rem 1.25rem max(0.85rem, env(safe-area-inset-top));
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.header-brand {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  min-width: 0;
}

.header-brand h1 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tenant-label {
  margin: 0.15rem 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.role-line {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(232, 184, 74, 0.35);
  flex-shrink: 0;
}

.pill.lab::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 8px var(--warn);
}

.header-actions .link-btn {
  font-size: 0.78rem;
}

#shell:not(.hidden) {
  display: block;
}

#shell main {
  padding: 1rem 1.25rem calc(5.5rem + env(safe-area-inset-bottom));
  max-width: 520px;
  margin: 0 auto;
}

#shell:not(.hidden) .bottom-nav {
  visibility: visible;
  opacity: 1;
}

.page-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
}

.page-sub {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0 0 1.25rem;
}

/* ——— Cards ——— */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.15rem;
  margin-bottom: 0.85rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.card-hero {
  background: linear-gradient(135deg, #f0fdfa 0%, #f8fafc 100%);
  border-color: var(--border-strong);
  padding: 1.35rem;
}

.card h2,
.card .card-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}

.card p {
  margin: 0.35rem 0 0;
}

.chip {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.5rem;
}

.chip-pending { background: rgba(240, 180, 41, 0.2); color: var(--warn); }
.chip-ok { background: rgba(93, 206, 158, 0.18); color: var(--success); }
.chip-neutral { background: #f1f5f9; color: var(--text-soft); }

.muted {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

/* ——— Nav ——— */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  justify-content: space-around;
  gap: 0.15rem;
  padding: 0.4rem 0.5rem max(0.55rem, env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-strong);
  box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.06);
  max-width: 520px;
  margin: 0 auto;
}

nav.bottom-nav button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.45rem 0.25rem;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  min-width: 0;
}

nav.bottom-nav button .nav-icon {
  width: 22px;
  height: 22px;
  opacity: 0.75;
}

nav.bottom-nav button.active {
  color: var(--accent);
  background: var(--accent-soft);
}

nav.bottom-nav button.active .nav-icon {
  opacity: 1;
}

/* ——— Tiles / stats ——— */
.action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
}

.action-tile {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: left;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  transition: border-color 0.15s, transform 0.15s;
}

.action-tile:active {
  transform: scale(0.98);
  border-color: var(--accent);
}

.action-tile strong {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 0.2rem;
}

.action-tile span {
  font-size: 0.74rem;
  color: var(--muted);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
}

.stat {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem;
}

.stat span {
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat strong {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

/* ——— Forms ——— */
.login-panel {
  padding: 1.5rem;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
}

.field-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

input,
textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: #ffffff;
  color: var(--text);
  margin-bottom: 0.85rem;
  font: inherit;
  font-size: 1rem;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

button.primary {
  width: 100%;
  padding: 0.85rem 1rem;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #0f766e 0%, #0d9488 100%);
  color: #ffffff;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
  box-shadow: 0 10px 28px rgba(13, 148, 136, 0.22);
}

button.primary:active {
  transform: scale(0.99);
}

.secondary-btn {
  width: 100%;
  margin-top: 0.65rem;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0 0.85rem;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.social-btn {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.google-btn .social-icon {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 4px;
  background: linear-gradient(135deg, #ea4335, #fbbc05 40%, #34a853 70%, #4285f4);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.whatsapp-btn {
  border-color: #25d366;
  color: #128c7e;
}

.site-card-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 1rem;
}

.site-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
  text-align: left;
}

.site-card .badge-active {
  display: inline-block;
  margin-top: 0.25rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.card button.primary,
.card button:not(.primary):not(.action-tile) {
  width: auto;
  margin-top: 0.65rem;
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
}

.hidden { display: none !important; }
.error { color: #dc2626; font-size: 0.88rem; }
.small, .tiny { font-size: 0.75rem; }
.link-btn {
  background: none;
  border: none;
  color: var(--accent-blue);
  font-size: 0.85rem;
  padding: 0;
  cursor: pointer;
}

.back-link { margin-bottom: 1rem; display: inline-block; }

.demo-credentials {
  background: #f8fafc;
}

.demo-credentials code {
  color: var(--accent-blue);
  font-size: 0.8rem;
}

.badge {
  display: inline-block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.2rem 0.45rem;
  margin-bottom: 0.5rem;
}

.empty-hint {
  color: var(--text-soft);
  font-size: 0.9rem;
  margin: 0.5rem 0 1rem;
}

.build-label { display: none; }

.cc-elevated {
  border: 1px solid var(--border-strong);
  background: var(--surface-elevated);
  box-shadow: var(--shadow);
}

.sync-event-list {
  margin: 0.75rem 0 0;
  padding-left: 1.1rem;
  color: var(--text-soft);
  font-size: 0.82rem;
}

@media (min-width: 768px) {
  .bottom-nav {
    left: 50%;
    transform: translateX(-50%);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
  #shell main {
    padding-bottom: 6rem;
  }
}

/* Finish the existing CreatorCore light interface; no new navigation or flows. */
:root {
  --accent: #087c72;
  --accent-blue: #087c72;
  --border: rgba(20, 36, 43, 0.085);
  --border-strong: rgba(20, 36, 43, 0.13);
  --shadow: 0 24px 72px -32px rgba(24, 43, 48, 0.22);
}
body { background: #f5f7f6; }
.welcome-screen {
  align-items: center;
  padding: clamp(20px, 6vh, 72px) 20px;
}
.welcome-inner {
  max-width: 480px;
  padding: clamp(28px, 5vw, 48px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 28px;
  background: #fff;
  box-shadow: var(--shadow), 0 1px 4px rgba(24, 43, 48, 0.03);
  gap: 32px;
}
.welcome-hero { flex: initial; padding: 0; }
.welcome-inner .brand-row { margin-bottom: 32px; }
.welcome-inner .product-name {
  font-size: clamp(30px, 7vw, 40px);
  font-weight: 600;
  letter-spacing: -0.055em;
}
.publisher { font-size: 9px; letter-spacing: 0.12em; }
.hero-tagline { font-size: 17px; line-height: 1.65; }
.hero-bullets { margin-bottom: 0; font-size: 13px; line-height: 1.75; }
.welcome-card {
  padding: 24px 0 0;
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
}
.env-banner { font-size: 11px; margin: 16px 0 0; line-height: 1.6; }
button.primary {
  min-height: 52px;
  border-radius: 12px;
  background: var(--accent);
  box-shadow: 0 6px 14px -8px rgba(8, 124, 114, 0.5);
  font-weight: 600;
  transition: background 150ms, box-shadow 150ms;
}
button.primary:hover { background: #06685f; }
button:focus-visible, a:focus-visible {
  outline: 3px solid rgba(8, 124, 114, 0.4);
  outline-offset: 4px;
}
.login-panel {
  max-width: 460px;
  margin: 40px auto;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow);
}
.login-panel .brand-row { margin-bottom: 28px; }
.login-panel input { min-height: 50px; border-radius: 10px; }
.card { box-shadow: 0 4px 18px rgba(24, 43, 48, 0.045); }
.pill.lab::before { box-shadow: none; }
@media (max-width: 480px) {
  .welcome-screen { padding: 20px 16px; }
  .welcome-inner { border-radius: 22px; }
  .login-panel { width: calc(100% - 32px); margin: 20px auto; padding: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
