/* NayoCart AI — prototype UI. Brand tokens from docs/brand-guidelines.md */
@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");

:root {
  --navy: #101C2C; --navy-2: #182a40; --teal: #18C6B0; --teal-deep: #12B8AE; --mint: #E4F7F3;
  --slate: #667487; --cloud: #F6F8F9; --white: #fff; --line: #E3E8EC; --text: #101C2C;
  --ok: #0f8a5f; --ok-bg: #e3f6ee; --warn: #9a6200; --warn-bg: #fff4dc; --bad: #b3261e; --bad-bg: #fdecea;
  --info: #1f5fbf; --info-bg: #e8f0fd;
  --radius: 12px; --radius-sm: 8px; --shadow: 0 1px 2px rgba(16,28,44,.06), 0 6px 20px rgba(16,28,44,.06);
  --font: "Plus Jakarta Sans", Inter, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--text); background: var(--cloud); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
code { font-size: .85em; background: var(--mint); padding: 1px 6px; border-radius: 6px; }
.muted { color: var(--slate); } .small { font-size: 13px; } .tabnum { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
h1 { font-size: 24px; font-weight: 700; } h2 { font-size: 18px; font-weight: 700; } h3 { font-size: 15px; font-weight: 600; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 10px;
  padding: 9px 16px; font-weight: 600; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, transform .05s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(24,198,176,.45); outline-offset: 1px; }
.btn-primary { background: var(--teal); color: var(--navy); }
.btn-primary:hover { background: var(--teal-deep); }
.btn-dark { background: var(--navy); color: #fff; } .btn-dark:hover { background: var(--navy-2); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--navy); } .btn-ghost:hover { border-color: var(--slate); }
.btn-link { background: none; color: var(--slate); text-decoration: underline; }
.btn-sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* Inputs */
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field label { font-size: 13px; font-weight: 600; color: var(--slate); }
.input, select.input, textarea.input { width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.b-ok { background: var(--ok-bg); color: var(--ok); } .b-warn { background: var(--warn-bg); color: var(--warn); }
.b-bad { background: var(--bad-bg); color: var(--bad); } .b-info { background: var(--info-bg); color: var(--info); }
.b-neutral { background: #eef1f4; color: var(--slate); } .b-teal { background: var(--mint); color: #0b6f62; }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em; text-decoration: none; }
.logo img { width: 32px; height: 32px; border-radius: 8px; }

/* ---------------- Landing ---------------- */
.landing { max-width: 1080px; margin: 0 auto; padding: 32px 24px 64px; }
.landing header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 56px; }
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; }
.hero h1 { font-size: 46px; line-height: 1.08; font-weight: 800; letter-spacing: -.03em; }
.hero h1 span { color: var(--teal-deep); }
.hero p.lead { font-size: 18px; color: var(--slate); margin: 18px 0 26px; max-width: 520px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.flow { padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.flow-step { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--cloud); }
.flow-step b { display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 12px; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 56px; }
.features .card { padding: 20px; } .features p { color: var(--slate); margin: 6px 0 0; font-size: 14px; }
.note { margin-top: 32px; font-size: 13px; color: var(--slate); }

/* ---------------- Storefront ---------------- */
.store-top { background: var(--navy); color: #fff; }
.store-top .inner { max-width: 1320px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.store-name { font-size: 20px; font-weight: 800; } .store-tag { color: #b9c6d3; font-size: 13px; }
.powered { font-size: 12px; color: #b9c6d3; display: flex; align-items: center; gap: 6px; } .powered img { width: 18px; height: 18px; border-radius: 4px; }
.cart-btn { position: relative; } .cart-count { background: var(--teal); color: var(--navy); border-radius: 999px; padding: 0 7px; font-size: 12px; font-weight: 700; }
.store-layout { max-width: 1320px; margin: 0 auto; padding: 20px 24px 40px; display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 20px; align-items: start; }
.catalog-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.catalog-head .input { max-width: 280px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer; }
.chip.active, .chip:hover { border-color: var(--teal); background: var(--mint); }
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.product { overflow: hidden; display: flex; flex-direction: column; }
.product .img { aspect-ratio: 1/1; background: var(--mint); display: block; width: 100%; object-fit: cover; }
.product .body { padding: 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.product .name { font-weight: 600; font-size: 14px; line-height: 1.3; }
.product .price { font-weight: 700; font-variant-numeric: tabular-nums; }
.product .foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 8px; gap: 6px; }
.product select { padding: 5px 6px; border-radius: 8px; border: 1px solid var(--line); font-size: 13px; }
.oos { opacity: .55; }

.chat { position: sticky; top: 16px; height: calc(100vh - 110px); min-height: 520px; display: flex; flex-direction: column; overflow: hidden; }
.chat-head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.avatar { width: 36px; height: 36px; border-radius: 10px; background: var(--navy); display: grid; place-items: center; flex: none; }
.avatar img { width: 26px; height: 26px; }
.chat-head .status { font-size: 12px; color: var(--ok); } .chat-head .status.staff { color: var(--warn); }
.chat-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: linear-gradient(#fff, var(--cloud)); }
.msg { max-width: 86%; padding: 10px 13px; border-radius: 14px; white-space: pre-wrap; word-wrap: break-word; font-size: 14px; }
.msg.customer { align-self: flex-end; background: var(--navy); color: #fff; border-bottom-right-radius: 4px; }
.msg.agent { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.staff { align-self: flex-start; background: var(--warn-bg); border: 1px solid #f1dca9; border-bottom-left-radius: 4px; }
.msg.system { align-self: center; background: var(--mint); color: #0b5d52; font-size: 13px; text-align: center; max-width: 95%; }
.msg .who { display: block; font-size: 11px; font-weight: 700; color: var(--slate); margin-bottom: 2px; }
.msg.staff .who { color: var(--warn); }
.chat-cards { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; align-self: stretch; }
.mini { min-width: 150px; max-width: 150px; border: 1px solid var(--line); border-radius: 10px; background: #fff; overflow: hidden; font-size: 13px; }
.mini img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; background: var(--mint); }
.mini .b { padding: 8px; display: flex; flex-direction: column; gap: 3px; }
.pay-cta { align-self: flex-start; display: flex; flex-direction: column; gap: 6px; background: #fff; border: 1px solid var(--teal); border-radius: 12px; padding: 12px; max-width: 86%; }
.typing { align-self: flex-start; color: var(--slate); font-size: 13px; padding: 4px 6px; }
.suggest { padding: 8px 12px 0; display: flex; gap: 6px; flex-wrap: wrap; }
.chat-form { padding: 12px; display: flex; gap: 8px; border-top: 1px solid var(--line); background: #fff; }
.chat-form .input { border-radius: 999px; }
.safety { font-size: 11px; color: var(--slate); padding: 0 14px 10px; background: #fff; }

/* Drawer + modal */
.overlay { position: fixed; inset: 0; background: rgba(16,28,44,.45); display: flex; justify-content: flex-end; z-index: 30; }
.overlay.center { justify-content: center; align-items: center; padding: 16px; }
.drawer { width: min(440px, 100%); height: 100%; background: #fff; display: flex; flex-direction: column; }
.drawer header, .modal header { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.drawer .content { padding: 16px 20px; overflow-y: auto; flex: 1; }
.drawer footer { padding: 16px 20px; border-top: 1px solid var(--line); }
.modal { width: min(560px, 100%); max-height: 92vh; overflow-y: auto; background: #fff; border-radius: 16px; }
.modal .content { padding: 18px 20px; }
.line { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.line img { width: 54px; height: 54px; border-radius: 8px; background: var(--mint); }
.line .grow { flex: 1; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 6px; font-variant-numeric: tabular-nums; margin-top: 10px; }
.totals .grand { font-weight: 800; font-size: 17px; }
.x { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--slate); line-height: 1; }
.empty { text-align: center; color: var(--slate); padding: 40px 10px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 50; font-size: 14px; box-shadow: var(--shadow); }
.order-status { text-align: center; padding: 8px 0 4px; }
.order-status .big { font-size: 46px; line-height: 1; }
.steps { display: flex; justify-content: space-between; margin: 18px 0; gap: 6px; }
.steps div { flex: 1; text-align: center; font-size: 12px; color: var(--slate); padding-top: 8px; border-top: 3px solid var(--line); }
.steps div.done { border-color: var(--teal); color: var(--navy); font-weight: 600; }

/* Payment simulator */
.sim-body { min-height: 100vh; display: grid; place-items: center; background: #eef2f5; padding: 16px; }
.sim-card { width: min(420px, 100%); background: #fff; border-radius: 16px; padding: 24px; box-shadow: var(--shadow); text-align: center; }
.sim-banner { background: var(--warn-bg); color: var(--warn); font-size: 12px; font-weight: 700; border-radius: 8px; padding: 6px; margin-bottom: 16px; letter-spacing: .02em; }
.sim-amount { font-size: 36px; font-weight: 800; margin: 8px 0 4px; font-variant-numeric: tabular-nums; }
.sim-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }

/* ---------------- Merchant ---------------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(circle at 20% 10%, #e4f7f3, transparent 40%), var(--cloud); }
.login { width: min(420px, 100%); padding: 28px; }
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--navy); color: #cfd8e2; padding: 18px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.side .logo { color: #fff; margin: 4px 8px 18px; }
.nav { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: #cfd8e2; text-decoration: none; font-weight: 600; font-size: 14px; cursor: pointer; border: none; background: none; text-align: left; }
.nav:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav.active { background: var(--teal); color: var(--navy); }
.nav .count { margin-left: auto; background: #f2b84b; color: var(--navy); border-radius: 999px; padding: 0 7px; font-size: 11px; }
.side .bottom { margin-top: auto; font-size: 12px; padding: 10px; color: #9fb0c1; }
.main { padding: 24px 28px 48px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.kpi { padding: 16px; } .kpi .label { color: var(--slate); font-size: 13px; font-weight: 600; } .kpi .value { font-size: 26px; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12px; color: var(--slate); }
.two { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; margin-bottom: 16px; }
.panel { padding: 18px; } .panel h2 { margin-bottom: 12px; }
.chart { width: 100%; height: 200px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; color: var(--slate); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr.clickable { cursor: pointer; } tr.clickable:hover td { background: var(--cloud); }
.table-wrap { overflow-x: auto; }
.list-item { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.list-item:last-child { border-bottom: none; }
.insight { padding: 8px 0 8px 12px; border-left: 3px solid var(--teal); margin-bottom: 8px; font-size: 14px; }
.inbox { display: grid; grid-template-columns: 340px 1fr; gap: 16px; height: calc(100vh - 120px); }
.inbox .list { overflow-y: auto; padding: 6px; }
.conv { padding: 12px; border-radius: 10px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.conv:hover { background: var(--cloud); } .conv.active { background: var(--mint); }
.conv .row { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.conv .preview { font-size: 13px; color: var(--slate); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread { display: flex; flex-direction: column; overflow: hidden; }
.thread .head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.thread .body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; background: var(--cloud); }
.thread .msg.customer { align-self: flex-start; background: #fff; color: var(--text); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; }
.thread .msg.agent, .thread .msg.staff { align-self: flex-end; border-radius: 14px 14px 4px 14px; }
.thread .msg.agent { background: var(--navy); color: #fff; border: none; } .thread .msg.agent .who { color: #9fd9cf; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--slate); } .kv dd { margin: 0; }
.timeline { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.timeline li { padding: 6px 0 6px 16px; border-left: 2px solid var(--line); position: relative; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 11px; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); }
.stock-input { width: 76px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }

@media (max-width: 980px) {
  .store-layout { grid-template-columns: 1fr; }
  .chat { position: static; height: 72vh; order: -1; }
  .hero, .two, .inbox { grid-template-columns: 1fr; }
  .features, .kpis { grid-template-columns: 1fr 1fr; }
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; }
  .side .bottom { display: none; }
  .inbox { height: auto; }
}
@media (max-width: 560px) { .features, .kpis, .grid-2 { grid-template-columns: 1fr; } .hero h1 { font-size: 34px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
