:root {
  --ph-primary: #0F766E;
  --ph-primary-dark: #0d5f59;
  --ph-secondary: #134E4A;
  --ph-accent: #F59E0B;
  --ph-bg: #F8FAFC;
  --ph-surface: #ffffff;
  --ph-text: #0f172a;
  --ph-muted: #64748b;
  --ph-border: #e2e8f0;
  --ph-danger: #dc2626;
  --ph-success: #059669;
  --ph-radius: 14px;
  --ph-shadow: 0 10px 40px rgba(15, 23, 42, .08);
  --sidebar-w: 260px;
  --font: "DM Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ph-text);
  background: var(--ph-bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ph-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; }
h1,h2,h3,h4 { line-height: 1.2; margin: 0 0 .5rem; }

.container { width: min(1120px, 92%); margin: 0 auto; }
.container-sm { width: min(480px, 92%); margin: 0 auto; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border: none; border-radius: 10px; padding: .7rem 1.15rem;
  font-weight: 600; cursor: pointer; transition: .15s ease;
  text-decoration: none !important; line-height: 1.2;
}
.btn-primary { background: var(--ph-primary); color: #fff; }
.btn-primary:hover { background: var(--ph-primary-dark); }
.btn-accent { background: var(--ph-accent); color: #1f2937; }
.btn-outline { background: transparent; border: 1.5px solid var(--ph-border); color: var(--ph-text); }
.btn-outline:hover { border-color: var(--ph-primary); color: var(--ph-primary); }
.btn-danger { background: var(--ph-danger); color: #fff; }
.btn-sm { padding: .4rem .75rem; font-size: .875rem; border-radius: 8px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.card {
  background: var(--ph-surface);
  border: 1px solid var(--ph-border);
  border-radius: var(--ph-radius);
  box-shadow: var(--ph-shadow);
  padding: 1.25rem;
}
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .35rem; }
.form-control {
  width: 100%; padding: .7rem .85rem; border: 1.5px solid var(--ph-border);
  border-radius: 10px; background: #fff; color: var(--ph-text);
}
.form-control:focus { outline: none; border-color: var(--ph-primary); box-shadow: 0 0 0 3px rgba(15,118,110,.15); }
.form-hint { font-size: .8rem; color: var(--ph-muted); margin-top: .25rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
.checkbox { display: flex; align-items: center; gap: .5rem; font-weight: 500; }

.alert {
  padding: .85rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-size: .95rem;
}
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

.badge {
  display: inline-flex; align-items: center; padding: .2rem .55rem;
  border-radius: 999px; font-size: .75rem; font-weight: 700;
  background: #e2e8f0; color: #334155;
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th, table.data td { padding: .75rem .6rem; border-bottom: 1px solid var(--ph-border); text-align: left; }
table.data th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ph-muted); }
table.data tr:hover td { background: #f8fafc; }

/* Landing */
.landing-nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(255,255,255,.85);
  border-bottom: 1px solid var(--ph-border);
}
.landing-nav .inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 0; gap: 1rem;
}
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.15rem; color: var(--ph-text); text-decoration: none !important; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--ph-primary), #14b8a6);
  display: grid; place-items: center; color: #fff; font-weight: 800;
}
.nav-links { display: flex; align-items: center; gap: 1.25rem; }
.nav-links a { color: var(--ph-muted); font-weight: 600; text-decoration: none; font-size: .95rem; }
.nav-links a:hover { color: var(--ph-primary); }
.nav-cta { display: flex; gap: .6rem; align-items: center; }

.hero {
  padding: 4.5rem 0 3rem;
  background:
    radial-gradient(ellipse 80% 60% at 70% -10%, rgba(20,184,166,.25), transparent),
    radial-gradient(ellipse 50% 40% at 10% 20%, rgba(245,158,11,.12), transparent),
    #fff;
}
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 2.5rem; align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }
.hero h1 { font-size: clamp(2rem, 4vw, 3.2rem); letter-spacing: -.03em; margin-bottom: 1rem; }
.hero h1 span { color: var(--ph-primary); }
.hero p.lead { font-size: 1.15rem; color: var(--ph-muted); max-width: 34rem; margin-bottom: 1.5rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.5rem; }
.trust-row { display: flex; flex-wrap: wrap; gap: 1rem; color: var(--ph-muted); font-size: .9rem; font-weight: 600; }
.hero-card {
  background: #fff; border-radius: 20px; padding: 1.25rem;
  box-shadow: 0 25px 60px rgba(15,118,110,.15); border: 1px solid var(--ph-border);
}
.hero-mock-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.hero-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.mini-stat { background: #f0fdfa; border-radius: 12px; padding: .85rem; }
.mini-stat strong { display: block; font-size: 1.25rem; color: var(--ph-primary); }

.section { padding: 4rem 0; }
.section-alt { background: #fff; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 2.5rem; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -.02em; }
.section-head p { color: var(--ph-muted); }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
@media (max-width: 900px) { .features { grid-template-columns: 1fr; } }
.feature {
  background: #fff; border: 1px solid var(--ph-border); border-radius: 16px; padding: 1.4rem;
  transition: .2s ease;
}
.feature:hover { transform: translateY(-3px); box-shadow: var(--ph-shadow); }
.feature-icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: #ccfbf1; color: var(--ph-primary); font-size: 1.2rem; margin-bottom: .85rem;
}
.feature h3 { font-size: 1.05rem; margin-bottom: .4rem; }
.feature p { color: var(--ph-muted); font-size: .95rem; margin: 0; }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
@media (max-width: 900px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }
.step { text-align: center; padding: 1rem; }
.step-num {
  width: 40px; height: 40px; border-radius: 50%; margin: 0 auto .75rem;
  background: var(--ph-primary); color: #fff; display: grid; place-items: center; font-weight: 800;
}

.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; align-items: stretch; }
@media (max-width: 900px) { .pricing { grid-template-columns: 1fr; } }
.price-card {
  background: #fff; border: 1px solid var(--ph-border); border-radius: 18px; padding: 1.6rem;
  display: flex; flex-direction: column;
}
.price-card.featured {
  border: 2px solid var(--ph-primary);
  box-shadow: 0 20px 50px rgba(15,118,110,.18);
  transform: scale(1.02);
}
.price-card .plan-name { font-weight: 800; font-size: 1.1rem; }
.price-card .price { font-size: 2.2rem; font-weight: 800; margin: .5rem 0; letter-spacing: -.03em; }
.price-card .price small { font-size: .95rem; color: var(--ph-muted); font-weight: 600; }
.price-card ul { list-style: none; padding: 0; margin: 1rem 0 1.5rem; flex: 1; }
.price-card li { padding: .4rem 0; font-size: .92rem; color: #334155; display: flex; gap: .45rem; }
.price-card li::before { content: "✓"; color: var(--ph-primary); font-weight: 800; }
.price-card li.no::before { content: "–"; color: #94a3b8; }
.price-card li.no { color: #94a3b8; }

.faq details {
  background: #fff; border: 1px solid var(--ph-border); border-radius: 12px;
  padding: 1rem 1.15rem; margin-bottom: .75rem;
}
.faq summary { font-weight: 700; cursor: pointer; }
.faq p { color: var(--ph-muted); margin: .6rem 0 0; }

.cta-band {
  background: linear-gradient(135deg, var(--ph-secondary), var(--ph-primary));
  color: #fff; border-radius: 24px; padding: 2.5rem; text-align: center;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,.85); max-width: 480px; margin: .5rem auto 1.25rem; }

.landing-footer {
  padding: 2.5rem 0; border-top: 1px solid var(--ph-border); background: #fff;
  color: var(--ph-muted); font-size: .9rem;
}
.landing-footer .inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }

/* Auth */
.auth-page {
  min-height: 100vh; display: grid; place-items: center;
  background:
    radial-gradient(ellipse 60% 50% at 100% 0%, rgba(20,184,166,.2), transparent),
    var(--ph-bg);
  padding: 2rem 0;
}
.auth-card { width: min(440px, 92%); }
.auth-card .brand { justify-content: center; margin-bottom: 1.25rem; }

/* App shell */
.app-shell { display: flex; min-height: 100vh; }
.app-sidebar {
  width: var(--sidebar-w); background: #0b1f1e; color: #e2e8f0;
  padding: 1.25rem .9rem; position: fixed; inset: 0 auto 0 0; overflow-y: auto;
}
.app-sidebar .brand { color: #fff; margin-bottom: 1.5rem; padding: 0 .4rem; }
.app-sidebar nav a {
  display: flex; align-items: center; gap: .6rem;
  padding: .65rem .75rem; border-radius: 10px; color: #94a3b8;
  text-decoration: none; font-weight: 600; font-size: .92rem; margin-bottom: .2rem;
}
.app-sidebar nav a:hover, .app-sidebar nav a.active { background: rgba(255,255,255,.08); color: #fff; }
.app-sidebar .side-section { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #64748b; margin: 1rem .75rem .4rem; }
.app-main { margin-left: var(--sidebar-w); flex: 1; min-width: 0; }
.app-topbar {
  background: #fff; border-bottom: 1px solid var(--ph-border);
  padding: .85rem 1.5rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.app-content { padding: 1.5rem; }
.lock-banner {
  background: linear-gradient(90deg, #fff7ed, #fef3c7);
  border: 1px solid #fde68a; border-radius: 12px; padding: 1rem 1.15rem;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.25rem; }
@media (max-width: 1000px) { .stats-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .stats-grid { grid-template-columns: 1fr; } }
.stat-card h4 { margin: 0; font-size: .85rem; color: var(--ph-muted); font-weight: 600; }
.stat-card .value { font-size: 1.6rem; font-weight: 800; margin-top: .25rem; }

.mobile-toggle { display: none; background: none; border: none; font-size: 1.4rem; cursor: pointer; }
@media (max-width: 900px) {
  .app-sidebar { transform: translateX(-100%); transition: .2s; z-index: 100; }
  .app-sidebar.open { transform: translateX(0); }
  .app-main { margin-left: 0; }
  .mobile-toggle { display: inline-flex; }
  .nav-links { display: none; }
}

/* Catalog tenant */
.cat-header {
  background: var(--tenant-primary, var(--ph-primary));
  color: #fff; padding: 1rem 0;
}
.cat-header .inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.cat-header a { color: #fff; font-weight: 600; text-decoration: none; opacity: .95; }
.cat-header .logo-wrap { display: flex; align-items: center; gap: .75rem; font-weight: 800; font-size: 1.15rem; }
.cat-header .logo-wrap img { max-height: 42px; border-radius: 8px; background: #fff; padding: 2px; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.15rem; }
.product-card {
  background: #fff; border: 1px solid var(--ph-border); border-radius: 16px; overflow: hidden;
  display: flex; flex-direction: column; transition: .15s;
}
.product-card:hover { box-shadow: var(--ph-shadow); transform: translateY(-2px); }
.product-card .thumb {
  aspect-ratio: 4/3; background: #f1f5f9; display: grid; place-items: center; overflow: hidden;
}
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-card .body { padding: 1rem; flex: 1; display: flex; flex-direction: column; }
.product-card h3 { font-size: 1rem; margin: 0 0 .35rem; }
.product-card .price { font-weight: 800; color: var(--tenant-primary, var(--ph-primary)); margin: .35rem 0; }
.product-card .actions { margin-top: auto; display: grid; gap: .5rem; }

.cart-fab {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 40;
  background: var(--tenant-primary, var(--ph-primary)); color: #fff;
  border-radius: 999px; padding: .85rem 1.2rem; font-weight: 700;
  box-shadow: 0 10px 30px rgba(0,0,0,.2); text-decoration: none !important;
}
.cart-summary { display: grid; grid-template-columns: 1.4fr .8fr; gap: 1.25rem; }
@media (max-width: 800px) { .cart-summary { grid-template-columns: 1fr; } }

.totals-box { background: #f8fafc; border-radius: 12px; padding: 1rem; }
.totals-box .row { display: flex; justify-content: space-between; padding: .35rem 0; font-size: .95rem; }
.totals-box .row.total { font-weight: 800; font-size: 1.15rem; border-top: 1px solid var(--ph-border); margin-top: .5rem; padding-top: .75rem; }

.empty-state { text-align: center; padding: 3rem 1rem; color: var(--ph-muted); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }

.muted { color: var(--ph-muted); }
.text-right { text-align: right; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.w-full { width: 100%; }
