:root {
  --surface: #f8f9fa;
  --white: #ffffff;
  --graphite: #1a1a1b;
  --muted: #64676d;
  --soft: #eef0f2;
  --border: #e5e7eb;
  --emerald: #10b981;
  --emerald-dark: #006c49;
  --emerald-soft: #dcfce7;
  --blue: #3b82f6;
  --blue-soft: #dbeafe;
  --amber: #f59e0b;
  --red: #ef4444;
  --shadow: 0 18px 55px rgba(15, 23, 42, .08);
}

* { box-sizing: border-box; }
html { overflow-x: clip; scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: clip;
  color: var(--graphite);
  background:
    radial-gradient(circle at 82% 4%, rgba(59, 130, 246, .11), transparent 28rem),
    radial-gradient(circle at 8% 0%, rgba(16, 185, 129, .12), transparent 24rem),
    var(--surface);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.hidden { display: none !important; }
.label {
  font-size: 11px;
  line-height: 1;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 800;
}
.muted { color: var(--muted); line-height: 1.6; }
.mono { font-variant-numeric: tabular-nums; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--emerald-dark);
  background: var(--emerald-soft);
  font-size: 12px;
  font-weight: 800;
}
.pill.blue { color: #1d4ed8; background: var(--blue-soft); }
.pill.amber { color: #92400e; background: #fef3c7; }
.pill.red { color: #991b1b; background: #fee2e2; }
.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 5px color-mix(in srgb, currentColor 14%, transparent);
}

.btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--graphite);
  border-radius: 12px;
  padding: 11px 16px;
  color: var(--white);
  background: var(--graphite);
  font-size: 14px;
  font-weight: 800;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn.primary { border-color: var(--emerald); background: var(--emerald); }
.btn.secondary { color: var(--graphite); background: var(--white); border-color: var(--border); }
.btn.ghost { color: var(--muted); background: transparent; border-color: transparent; }
.btn.small { min-height: 34px; padding: 8px 11px; border-radius: 9px; font-size: 12px; }

.card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
}
.card.pad { padding: clamp(18px, 2.4vw, 28px); }
.dark-card {
  color: var(--white);
  border-color: rgba(255,255,255,.08);
  background:
    radial-gradient(circle at 85% 5%, rgba(16,185,129,.22), transparent 20rem),
    linear-gradient(145deg, #1a1a1b, #111827);
}
.glass {
  border: 1px solid rgba(255,255,255,.42);
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.marketing-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 18px 22px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
}
.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--white);
  background: var(--emerald);
  font-weight: 900;
  letter-spacing: -.08em;
}
.brand small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.landing .hero {
  max-width: 1240px;
  min-height: calc(100vh - 78px);
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(380px, .85fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
  margin: 0 auto;
  padding: 42px 22px 64px;
}
.hero h1, .page-title h1 {
  margin: 0;
  font-size: clamp(46px, 7vw, 92px);
  line-height: .96;
  letter-spacing: -.06em;
}
.hero p { max-width: 640px; font-size: 18px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.product-frame {
  position: relative;
  min-height: 600px;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #fff, #f3f4f6);
  box-shadow: var(--shadow);
}
.floating-app {
  position: absolute;
  inset: 26px;
  display: grid;
  grid-template-rows: auto 1fr;
  border-radius: 22px;
  background: #fff;
  border: 1px solid var(--border);
  overflow: hidden;
}
.mini-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px;
  border-bottom: 1px solid var(--border);
}
.mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 18px; }
.mini-widget {
  min-height: 110px;
  padding: 16px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.mini-line { height: 9px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.mini-line span { display: block; height: 100%; border-radius: inherit; background: var(--emerald); }

.section {
  max-width: 1240px;
  margin: 0 auto;
  padding: 82px 22px;
}
.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 28px;
}
.section-header h2, .card h3 {
  margin: 0;
  letter-spacing: -.03em;
}
.grid { display: grid; gap: 18px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 520px) 1fr;
}
.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(24px, 5vw, 58px);
  background: var(--white);
  box-shadow: var(--shadow);
  z-index: 1;
}
.login-card { max-width: 430px; margin: auto; }
.login-card h1 { margin: 28px 0 8px; font-size: clamp(34px, 5vw, 48px); letter-spacing: -.05em; }
.login-art {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 40px;
  background:
    radial-gradient(circle at 20% 20%, rgba(16,185,129,.30), transparent 25rem),
    radial-gradient(circle at 80% 80%, rgba(59,130,246,.24), transparent 25rem),
    #111827;
}
.login-art h2 {
  max-width: 760px;
  color: var(--white);
  font-size: clamp(42px, 6vw, 80px);
  line-height: .96;
  letter-spacing: -.06em;
}
.field { display: grid; gap: 8px; }
.input, textarea, select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 13px;
  color: var(--graphite);
  background: var(--white);
  outline: none;
}
.input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(59,130,246,.14); }
textarea { min-height: 96px; resize: vertical; }
.error { color: #b91c1c; font-weight: 800; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 264px 1fr;
  overflow-x: clip;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 16px;
  border-right: 1px solid var(--border);
  background: rgba(248,249,250,.92);
  backdrop-filter: blur(16px);
}
.nav-list { display: grid; gap: 5px; overflow: auto; padding-right: 4px; }
.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 0;
  border-radius: 13px;
  padding: 12px 13px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  font-weight: 800;
}
.nav-item.active { color: var(--emerald-dark); background: #ecfdf5; }
.nav-item:hover { color: var(--graphite); background: var(--soft); }
.icon {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  color: currentColor;
}
.main {
  min-width: 0;
  padding: 22px clamp(18px, 3vw, 42px) 56px;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: -22px calc(clamp(18px, 3vw, 42px) * -1) 28px;
  padding: 14px clamp(18px, 3vw, 42px);
  border-bottom: 1px solid var(--border);
  background: rgba(248,249,250,.84);
  backdrop-filter: blur(16px);
}
.search {
  max-width: 460px;
  position: relative;
  flex: 1;
}
.search input { padding-left: 40px; border-radius: 999px; background: #fff; }
.search .icon { position: absolute; left: 12px; top: 9px; color: var(--muted); }
.mobile-menu { display: none; }
.mobile-drawer {
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 18px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(248,249,250,.96);
}

.kpi {
  display: grid;
  gap: 14px;
}
.kpi strong {
  display: block;
  font-size: clamp(27px, 3vw, 38px);
  line-height: 1;
  letter-spacing: -.05em;
}
.chart {
  min-height: 260px;
  display: flex;
  align-items: end;
  gap: 8px;
  padding-top: 24px;
}
.bar {
  flex: 1;
  min-width: 7px;
  border-radius: 999px 999px 3px 3px;
  background: linear-gradient(180deg, var(--blue), var(--emerald));
}
.hbar {
  display: grid;
  gap: 8px;
}
.hbar-row {
  display: grid;
  grid-template-columns: 130px 1fr 50px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}
.hbar-track { height: 10px; border-radius: 99px; overflow: hidden; background: var(--soft); }
.hbar-track span { display: block; height: 100%; border-radius: inherit; background: var(--emerald); }
.donut {
  width: 170px;
  aspect-ratio: 1;
  border-radius: 999px;
  background: conic-gradient(var(--emerald) 0 43%, var(--blue) 43% 71%, #a7f3d0 71% 86%, #e5e7eb 86% 100%);
  position: relative;
}
.donut::after {
  content: "";
  position: absolute;
  inset: 28px;
  border-radius: inherit;
  background: var(--white);
}

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: 13px 12px; border-bottom: 1px solid var(--border); text-align: left; font-size: 13px; }
th { color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }

.workflow {
  display: grid;
  grid-template-columns: repeat(7, minmax(132px, 1fr));
  gap: 12px;
  overflow: auto;
}
.workflow-step {
  position: relative;
  min-height: 142px;
  display: grid;
  gap: 10px;
  align-content: start;
  border: 1px solid var(--border);
  border-radius: 17px;
  padding: 16px;
  background: #fff;
}
.workflow-step.active { border-color: var(--emerald); box-shadow: 0 0 0 4px rgba(16,185,129,.11); }
.calendar-grid {
  display: grid;
  grid-template-columns: 70px repeat(7, minmax(130px, 1fr));
  gap: 1px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--border);
}
.calendar-cell {
  min-height: 82px;
  padding: 10px;
  background: #fff;
}
.booking {
  margin-top: 6px;
  padding: 8px;
  border-radius: 10px;
  background: #ecfdf5;
  color: #065f46;
  font-size: 12px;
  font-weight: 800;
}
.booking.blue { background: #eff6ff; color: #1d4ed8; }
.booking.buffer { background: #f3f4f6; color: #6b7280; border: 1px dashed #cbd5e1; }

.map {
  min-height: 390px;
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--border);
  background:
    linear-gradient(90deg, rgba(59,130,246,.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(59,130,246,.08) 1px, transparent 1px),
    linear-gradient(135deg, #f8fafc, #eef2ff);
  background-size: 46px 46px, 46px 46px, 100% 100%;
}
.pin {
  position: absolute;
  display: grid;
  gap: 4px;
  transform: translate(-50%, -50%);
}
.pin b {
  width: 18px;
  height: 18px;
  border: 4px solid #fff;
  border-radius: 999px;
  background: var(--emerald);
  box-shadow: 0 7px 24px rgba(16,185,129,.45);
}
.pin span {
  padding: 6px 9px;
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow);
  white-space: nowrap;
  font-size: 12px;
  font-weight: 900;
}

.chat {
  height: 540px;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 14px;
}
.messages {
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 12px;
}
.msg {
  max-width: 82%;
  padding: 13px 15px;
  border-radius: 16px;
  background: var(--soft);
}
.msg.ai { background: #ecfdf5; color: #065f46; }
.msg.user { justify-self: end; color: #fff; background: var(--graphite); }

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  max-width: 360px;
  padding: 14px 16px;
  border-radius: 14px;
  color: #fff;
  background: var(--graphite);
  box-shadow: var(--shadow);
  font-weight: 800;
}

@media (max-width: 1100px) {
  .landing .hero, .login-shell, .app-shell { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .sidebar { display: none; }
  .main { padding-top: 88px; }
  .topbar {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    margin: 0;
  }
  .mobile-menu { display: inline-flex; }
  .mobile-drawer.open {
    position: fixed;
    left: 0;
    right: 0;
    top: 70px;
    z-index: 19;
    display: grid;
  }
  .cols-4, .cols-3, .cols-2 { grid-template-columns: 1fr 1fr; }
  .product-frame { min-height: 520px; }
}
@media (max-width: 720px) {
  .marketing-nav { padding: 14px 16px; }
  .marketing-nav .hide-sm, .topbar .hide-sm, .search { display: none; }
  .landing .hero { min-height: auto; padding: 36px 16px 48px; }
  .hero h1, .page-title h1 { font-size: clamp(42px, 14vw, 60px); }
  .section { padding: 58px 16px; }
  .section-header { align-items: start; flex-direction: column; }
  .cols-6, .cols-4, .cols-3, .cols-2 { grid-template-columns: 1fr; }
  .product-frame { min-height: 480px; }
  .floating-app { inset: 12px; }
  .mini-grid { grid-template-columns: 1fr; }
  .login-panel { min-height: 100vh; }
  .main { padding-inline: 16px; }
  .mobile-drawer.open { grid-template-columns: 1fr; }
  .topbar { gap: 10px; padding-inline: 14px; }
  .workflow { grid-template-columns: 1fr; }
  .calendar-grid { grid-template-columns: 64px repeat(7, 130px); }
}
