:root {
  --ink: #18322b;
  --muted: #6d7c76;
  --green: #1f6b56;
  --green-dark: #173d34;
  --mint: #e8f4ee;
  --cream: #f6f2e8;
  --gold: #c49b55;
  --line: #dbe4df;
  --white: #fff;
  --danger: #a64638;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: #f2f5f3;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.topbar { height: 68px; display: flex; align-items: center; gap: 28px; padding: 0 4vw; background: var(--green-dark); color: white; position: sticky; top: 0; z-index: 10; box-shadow: 0 4px 20px #173d3420; }
.brand { display: flex; align-items: center; gap: 10px; color: white; text-decoration: none; font-weight: 700; font-size: 18px; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #ffffff66; border-radius: 50%; font-family: serif; }
.brand-wordmark { display:grid; place-items:center; min-width:78px; height:34px; padding:0 10px; border:1px solid #ffffff66; border-radius:999px; font-family:serif; font-weight:700; letter-spacing:.18em; text-indent:.18em; }
.portal-label { flex: 1; color: #dfeae6; font-size: 14px; }
.demo-pill { border: 1px solid #ffffff44; border-radius: 999px; padding: 5px 10px; font-size: 12px; }

#app { min-height: calc(100vh - 68px); }
.eyebrow { margin: 0 0 8px; color: var(--gold); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
h1, h2, h3, p { margin-top: 0; }

.phone-shell { width: 390px; height: 770px; margin: 30px auto; position: relative; overflow-y: auto; background: #f7f8f6; border: 10px solid #1d2623; border-radius: 36px; box-shadow: 0 24px 70px #173d3430; scrollbar-width: none; }
.phone-shell::-webkit-scrollbar { display: none; }
.mini-header { height: 72px; padding: 16px 18px 0; display: flex; align-items: center; justify-content: space-between; font-size: 12px; background: var(--cream); }
.mini-header strong { font-size: 15px; }
#customer-content { min-height: calc(100% - 132px); padding: 0 18px 24px; }
.mini-tabs { position: sticky; bottom: 0; z-index: 6; width: 100%; display: flex; justify-content: space-around; padding: 7px 5px calc(7px + env(safe-area-inset-bottom)); background: #fffffff2; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; backdrop-filter: blur(14px); }
.mini-tabs button { flex: 1; display: grid; gap: 3px; place-items: center; border: 0; padding: 5px 2px; background: transparent; color: inherit; }
.mini-tabs button span { font-size: 18px; line-height: 1; }
.mini-tabs button.active { color: var(--green); font-weight: 700; }

.health-hero, .subpage-hero { margin: 0 -18px 18px; padding: 34px 24px 38px; background: linear-gradient(145deg, var(--cream), #e4efe8); }
.health-hero h1, .subpage-hero h1 { margin-bottom: 10px; font: 700 27px/1.35 Georgia, "Songti SC", serif; }
.health-hero p:last-child, .subpage-hero p:last-child { margin-bottom: 0; color: #51645d; font-size: 13px; line-height: 1.7; }
.subpage-hero { padding-bottom: 28px; }
.health-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: -38px 0 14px; position: relative; }
.health-summary div { display: grid; gap: 5px; padding: 14px 6px; border: 1px solid var(--line); border-radius: 13px; background: white; text-align: center; box-shadow: 0 8px 22px #173d340d; }
.health-summary strong { color: var(--green); font-size: 18px; }
.health-summary span { color: var(--muted); font-size: 10px; }
.home-card { margin-top: 14px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.section-heading h3 { margin: 0; font-size: 16px; }
.section-heading span { color: var(--muted); font-size: 10px; }
.section-heading button { border: 0; padding: 3px; background: transparent; color: var(--green); font-size: 11px; }
.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.quick-actions button { display: grid; justify-items: center; gap: 7px; border: 0; padding: 8px 0; background: transparent; color: var(--ink); font-size: 11px; }
.quick-actions b { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; background: var(--mint); color: var(--green); font-size: 20px; }
.profile-card { display: flex; align-items: center; gap: 12px; }
.profile-card h2, .profile-card p { margin: 0; }
.profile-card p { margin-top: 4px; color: var(--muted); font-size: 12px; }
.profile-card .status { margin-left: auto; }
.profile-avatar { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 50%; background: var(--green); color: white; font-size: 20px; font-weight: 800; }
.profile-menu { margin-top: 14px; padding-block: 6px; }
.profile-menu > div, .profile-menu > button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 0; border-bottom: 1px solid var(--line); padding: 14px 4px; background: transparent; color: var(--ink); text-align: left; font-size: 13px; }
.profile-menu > :last-child { border-bottom: 0; }
.profile-menu strong { color: var(--muted); font-size: 12px; font-weight: 500; }
.profile-logout { margin: 16px 0 6px; }
#register-form { margin-top: 18px; }
.guest-hero { margin: 0 -18px 18px; padding: 28px 24px 30px; background: radial-gradient(circle at 90% 0, #d6eadf, transparent 42%), linear-gradient(145deg, #f8f1df, #e7f1eb); }
.guest-brand-mark { width: 96px; height: 44px; display: grid; place-items: center; margin-bottom: 20px; border: 1px solid #b8904e; border-radius: 999px; color: #8a6b35; background: #fff9; font: 700 19px/1 Georgia, "Songti SC", serif; letter-spacing:.18em; text-indent:.18em; box-shadow: 0 10px 30px #8a6b3518; }
.guest-hero h1 { margin-bottom: 12px; font: 700 28px/1.4 Georgia, "Songti SC", serif; }
.guest-hero > p:last-of-type { color: #51645d; font-size: 13px; line-height: 1.8; }
.guest-hero small { display: block; margin-top: 12px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.guest-bind { width: 100%; padding-block: 13px; }
.guest-section { margin-bottom: 14px; }
.guest-service-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.guest-service-grid > div, .guest-service-grid > button { display: grid; gap: 5px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: white; color:var(--ink); text-align:left; }
.guest-service-grid b { width: 32px; height: 32px; display: grid; place-items: center; margin-bottom: 3px; border-radius: 10px; background: var(--mint); color: var(--green); font-family: serif; }
.guest-service-grid strong { font-size: 13px; }
.guest-service-grid span { color: var(--muted); font-size: 10px; line-height: 1.5; }
.guest-flow { display: grid; gap: 0; }
.guest-flow > div:not(.section-heading) { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.guest-flow i { width: 26px; height: 26px; display: grid; place-items: center; flex: none; border-radius: 50%; background: var(--green); color: white; font-size: 11px; font-style: normal; }
.guest-flow p { display: grid; gap: 3px; margin: 0; }
.guest-flow p strong { font-size: 12px; }
.guest-flow p span { color: var(--muted); font-size: 10px; }
.guest-gate { text-align: center; }
.guest-lock { width: 96px; height: 44px; display: grid; place-items: center; margin: 0 auto 16px; border: 1px solid #d7c28f; border-radius: 999px; background: var(--cream); color: #8a713f; font: 700 19px/1 serif; letter-spacing:.15em; text-indent:.15em; }
.guest-gate .secondary { margin-top: 10px; }
.guest-member-actions,.auth-switch { display:grid; grid-template-columns:1fr 1fr; gap:9px; }
.guest-member-actions button { padding:12px 8px; }
.learning-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
.learning-grid button { display:grid; gap:6px; border:1px solid var(--line); border-radius:13px; padding:12px; background:#fff; color:var(--ink); text-align:left; }
.learning-grid b { color:var(--gold); font:700 19px serif; }
.learning-grid strong { font-size:12px; }
.learning-grid span { color:var(--muted); font-size:9px; line-height:1.5; }
.learning-item { margin-bottom:10px; }
.learning-item p { margin:8px 0 0; }
.unbound-member { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:14px; background:#fffaf0; }
.unbound-member p { margin:5px 0 0; }
.record-detail { display:grid; gap:7px; }
.record-detail span { color:var(--green); font-size:11px; }
.record-detail p { margin:4px 0 0; padding:9px; border-radius:8px; background:#f5f7f6; font-size:11px; line-height:1.6; }
.scan-demo { padding:14px; border:1px dashed #7eaa99; border-radius:10px; background:#eef7f2; color:var(--green); font-size:12px; }

.care-hero { position:relative; height:330px; margin:0 -18px 18px; overflow:hidden; color:white; background:#16483f; }
.care-hero > img { width:100%; height:100%; object-fit:cover; }
.care-hero-shade { position:absolute; inset:0; background:linear-gradient(90deg,rgba(9,48,43,.88),rgba(13,66,58,.55) 58%,rgba(12,50,45,.12)),linear-gradient(0deg,rgba(8,35,32,.55),transparent 50%); }
.care-hero-content { position:absolute; inset:0; display:flex; flex-direction:column; align-items:flex-start; justify-content:center; padding:30px 28px; }
.care-hero-content p { margin:10px 0 7px; color:#e3eee9; font-size:11px; letter-spacing:.08em; }
.care-hero-content h1 { max-width:280px; margin:0 0 22px; color:white; font:700 27px/1.42 Georgia,"Songti SC",serif; text-shadow:0 2px 16px #082e29aa; }
.care-brand { padding:8px 13px; border:1px solid #fff8; border-radius:999px; background:#ffffff12; font:700 17px/1 Georgia,"Songti SC",serif; letter-spacing:.16em; text-indent:.16em; backdrop-filter:blur(10px); }
.care-cta { border:1px solid #ffffff99; border-radius:999px; padding:10px 18px; background:#fff; color:#145746; font-size:12px; font-weight:700; }
.member-care-hero { height:270px; }
.member-care-hero .care-hero-content h1 { font-size:25px; }
.service-entry-card { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:-42px; margin-bottom:18px; padding:16px; position:relative; z-index:2; border-radius:15px; background:#fff; box-shadow:0 12px 30px #173d3420; }
.service-entry-card div { display:grid; gap:4px; }
.service-entry-card b { color:var(--green); font-size:14px; }
.service-entry-card span { color:var(--muted); font-size:10px; }
.service-entry-card button { border:0; background:transparent; color:var(--green); font-size:11px; font-weight:700; }
.care-service-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:7px; }
.care-service-grid button { display:grid; justify-items:center; gap:7px; border:0; padding:10px 2px; background:transparent; color:var(--ink); }
.care-service-grid b { width:43px; height:43px; display:grid; place-items:center; border-radius:15px; background:linear-gradient(145deg,#e7f5ef,#f8f1df); color:var(--green); font:700 18px/1 serif; }
.care-service-grid strong { font-size:11px; }
.care-service-grid span { color:var(--muted); font-size:8px; text-align:center; }
.health-feed { margin:20px 0 14px; }
.article-card { width:100%; display:grid; grid-template-columns:118px 1fr; gap:0; overflow:hidden; margin-bottom:12px; border:1px solid var(--line); border-radius:15px; padding:0; background:#fff; color:var(--ink); text-align:left; box-shadow:0 8px 24px #173d340b; }
.article-card.featured { grid-template-columns:1fr; }
.article-card img { width:100%; height:100%; min-height:118px; object-fit:cover; }
.article-card.featured img { height:155px; }
.article-card div { display:grid; align-content:center; gap:7px; padding:14px; }
.article-card em { color:#9b753d; font-size:9px; font-style:normal; font-weight:700; }
.article-card strong { font-size:14px; line-height:1.5; }
.article-card span { color:var(--muted); font-size:10px; line-height:1.6; }
.membership-note { display:grid; gap:7px; margin:18px 0 4px; padding:18px; border-radius:16px; background:linear-gradient(145deg,#f8f1df,#edf6f1); }
.membership-note > span { color:var(--muted); font-size:10px; line-height:1.6; }
.activation-hero { margin:0 -18px 18px; padding:28px 24px 40px; color:white; background:radial-gradient(circle at 85% 15%,#50bfa7,transparent 35%),linear-gradient(145deg,#0b7668,#23ad94); }
.activation-hero h1 { margin-bottom:10px; font:700 27px/1.4 Georgia,"Songti SC",serif; }
.activation-hero p:last-child { margin-bottom:20px; color:#e1f4ef; font-size:11px; line-height:1.7; }
.activation-hero .eyebrow { color:#d9f3eb; }
.activation-card-art { display:grid; gap:6px; min-height:122px; margin-top:24px; padding:21px; border:1px solid #ffffff66; border-radius:17px; background:linear-gradient(135deg,#ffffff2b,#ffffff12); box-shadow:inset 0 1px #fff6; backdrop-filter:blur(14px); }
.activation-card-art span { font:700 18px serif; letter-spacing:.18em; }
.activation-card-art b { margin-top:auto; font-size:19px; }
.activation-card-art small { color:#dff5ef; }
.activation-panel { margin-top:-36px; position:relative; z-index:2; }
.activation-input { display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:10px; margin:12px 0 15px; padding:11px 12px; border:1px solid #55bca7; border-radius:10px; }
.activation-input span { color:var(--muted); font-size:10px; }
.activation-input input { min-width:0; border:0; outline:0; font-size:12px; }
.activation-input b { color:#18a98c; font-size:18px; }
.activation-flow { display:grid; grid-template-columns:repeat(5,1fr); align-items:start; gap:3px; padding:20px 0; }
.activation-flow h3 { grid-column:1/-1; margin-bottom:16px; text-align:center; }
.activation-flow div { display:grid; justify-items:center; gap:7px; text-align:center; }
.activation-flow div span { width:34px; height:34px; display:grid; place-items:center; border-radius:50%; background:#e5f7f1; color:#15977f; font-weight:700; }
.activation-flow div b { font-size:8px; line-height:1.45; }
.activation-flow i { display:none; }
.activation-notice { margin-bottom:8px; padding:14px; border-radius:12px; background:#f5f7f6; }
.activation-notice b { font-size:12px; }
.activation-notice p { margin:6px 0 0; color:var(--muted); font-size:10px; line-height:1.6; }
.learning-header { margin:0 -18px 0; padding:28px 24px 30px; background:linear-gradient(145deg,#f8f1df,#e5f2eb); }
.learning-header h1 { margin-bottom:10px; font:700 27px/1.4 Georgia,"Songti SC",serif; }
.learning-header p:last-child { margin-bottom:0; color:var(--muted); font-size:11px; line-height:1.7; }
.content-tabs { display:flex; gap:5px; margin:14px 0; padding:5px; border-radius:12px; background:#e9efec; }
.content-tabs button { flex:1; border:0; border-radius:9px; padding:9px 4px; background:transparent; color:var(--muted); font-size:10px; }
.content-tabs button.active { background:white; color:var(--green); font-weight:700; box-shadow:0 5px 14px #173d3410; }
.live-preview { display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:10px; }
.live-preview p { margin:4px 0 0; color:var(--muted); font-size:9px; }
.live-preview button { border:0; border-radius:999px; padding:7px 10px; background:var(--mint); color:var(--green); font-size:10px; }
.learning-list { display:grid; gap:10px; }
.learning-item { display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:10px; }
.learning-item p { margin:4px 0 0; color:var(--muted); font-size:9px; }
.learning-item button { border:0; border-radius:999px; padding:7px 10px; background:var(--mint); color:var(--green); font-size:10px; }
.learning-badge { display:grid; place-items:center; width:42px; height:42px; border-radius:13px; background:#edf6f1; color:var(--green); font-size:9px; font-weight:700; }
.live-dot.replay { background:#e8ecea; color:#51635d; }
.live-dot { padding:5px 8px; border-radius:999px; background:#f6e7e4; color:#a64638; font-size:9px; }
.article-detail { margin:0 -18px; padding-bottom:20px; background:white; }
.article-detail > img { width:100%; height:220px; object-fit:cover; }
.article-detail > :not(img) { margin-left:22px; margin-right:22px; }
.article-detail .eyebrow { margin-top:20px; }
.article-detail h1 { font:700 25px/1.45 Georgia,"Songti SC",serif; }
.article-detail p { color:#455a52; font-size:12px; line-height:1.9; }
.article-disclaimer { margin-top:20px; margin-bottom:18px; padding:12px; border-radius:9px; background:#f5f7f6; color:var(--muted); font-size:10px; line-height:1.6; }

.panel { background: white; padding: 20px; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 8px 26px #173d3409; }
.stack { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 12px; color: var(--muted); }
.field input, .field textarea, .field select { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 11px 12px; color: var(--ink); outline: none; background: white; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--green); box-shadow: 0 0 0 3px #1f6b5615; }
.primary, .secondary, .danger { border: 0; border-radius: 9px; padding: 11px 16px; font-weight: 600; }
.primary { background: var(--green); color: white; }
.primary:hover { background: var(--green-dark); }
.secondary { background: var(--mint); color: var(--green); }
.danger { background: #f8e9e6; color: var(--danger); }
.wide { width: 100%; }
.inline-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hint { padding: 11px 12px; border-radius: 8px; background: var(--cream); color: #735c35; font-size: 12px; line-height: 1.6; }

.profile-line { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 16px; }
.profile-line h2 { margin: 0; font-size: 20px; }
.status { display: inline-block; border-radius: 999px; padding: 5px 9px; background: var(--mint); color: var(--green); font-size: 11px; }
.benefit { padding: 15px 0; border-top: 1px solid var(--line); }
.benefit-head { display: flex; justify-content: space-between; gap: 12px; }
.benefit h3 { margin-bottom: 5px; font-size: 15px; }
.benefit p { margin-bottom: 0; font-size: 12px; color: var(--muted); }
.count { font-size: 20px; color: var(--green); white-space: nowrap; }
.record-list { display: grid; gap: 10px; margin-top: 14px; }
.record { padding: 12px; border-left: 3px solid var(--gold); background: #faf8f3; font-size: 12px; }
.record strong { display: block; margin-bottom: 4px; }
.qr-modal { text-align: center; }
.qr-modal img { width: 230px; height: 230px; }
.code-box { padding: 8px; background: #f5f5f5; word-break: break-all; font: 10px/1.35 monospace; color: #667; max-height: 52px; overflow: auto; }
.selected-store-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 14px; padding: 12px; border-radius: 10px; background: var(--cream); }
.selected-store-summary div { display: grid; gap: 4px; }
.selected-store-summary small { color: var(--muted); }
.store-list { display: grid; gap: 10px; margin-top: 16px; }
.store-choice { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: white; text-align: left; color: var(--ink); }
.store-choice span { display: grid; gap: 5px; }
.store-choice small { color: var(--muted); font-weight: 400; }
.store-choice em { flex: none; color: var(--green); font-size: 12px; font-style: normal; }
.store-choice.selected { border-color: var(--green); background: var(--mint); }
.mall-panel { text-align: center; }
.mall-code-placeholder { width: 220px; aspect-ratio: 1; margin: 20px auto; display: grid; place-content: center; gap: 8px; border: 2px dashed #d5c39d; border-radius: 24px; background: var(--cream); color: #8a713f; }
.mall-code-placeholder span { font-size: 12px; }

.workspace { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 68px); }
.sidebar { padding: 34px 24px; color: white; background: #20463c; display: flex; flex-direction: column; justify-content: space-between; }
.sidebar h2 { font-size: 20px; }
.side-links { display: grid; gap: 5px; align-self: start; width: 100%; }
.side-links button { border: 0; background: transparent; color: #cddbd6; text-align: left; padding: 11px 12px; border-radius: 8px; }
.side-links button.active { background: #ffffff15; color: white; }
.sidebar .muted { color: #adbfba; }
.workspace-main { padding: 40px 5vw; max-width: 1200px; width: 100%; }
.page-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.page-heading h1 { margin-bottom: 8px; font: 32px Georgia, "Songti SC", serif; }
.page-heading p { margin-bottom: 0; }
.login-card { max-width: 460px; margin: 8vh auto; }
.scan-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 24px; align-items: start; }
.scan-zone { min-height: 320px; display: grid; place-items: center; text-align: center; border: 1px dashed #adc2bb; border-radius: 16px; background: #f9fbfa; padding: 24px; }
.camera-drawer { width: min(620px, 100vw); }
.camera-frame { position: relative; overflow: hidden; width: 100%; aspect-ratio: 3 / 4; max-height: 68vh; border-radius: 20px; background: #0c1512; }
.camera-frame video { width: 100%; height: 100%; object-fit: cover; }
.camera-guide { position: absolute; inset: 18% 12%; }
.camera-guide span { position: absolute; width: 42px; height: 42px; border-color: #d7c79b; border-style: solid; }
.camera-guide span:nth-child(1) { top: 0; left: 0; border-width: 4px 0 0 4px; }
.camera-guide span:nth-child(2) { top: 0; right: 0; border-width: 4px 4px 0 0; }
.camera-guide span:nth-child(3) { bottom: 0; left: 0; border-width: 0 0 4px 4px; }
.camera-guide span:nth-child(4) { right: 0; bottom: 0; border-width: 0 4px 4px 0; }
.camera-scan-line { position: absolute; top: 22%; left: 14%; right: 14%; height: 2px; background: #e8d7a3; box-shadow: 0 0 12px #e8d7a3; animation: scan-line 2.2s ease-in-out infinite alternate; }
@keyframes scan-line { to { top: 76%; } }
.scan-icon { width: 86px; height: 86px; margin: auto auto 18px; display: grid; place-items: center; border: 2px solid var(--green); border-radius: 18px; color: var(--green); font-size: 34px; }
.customer-result { min-height: 320px; }
.empty { display: grid; place-items: center; min-height: 270px; color: var(--muted); text-align: center; }
.choice { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
.choice input { accent-color: var(--green); }

.crm-layout { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: calc(100vh - 68px); background: #f4f6f5; }
.crm-sidebar { position: sticky; top: 68px; height: calc(100vh - 68px); padding: 25px 18px 18px; display: flex; flex-direction: column; justify-content: space-between; overflow-y: auto; background: #173d34; color: white; z-index: 4; }
.crm-brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 25px; border-bottom: 1px solid #ffffff18; }
.crm-brand div, .crm-account div { display: grid; gap: 3px; }
.crm-brand small, .crm-account small { color: #9fb5ad; font-size: 11px; }
.crm-menu { display: grid; gap: 6px; margin-top: 24px; }
.crm-menu button { display: flex; align-items: center; gap: 12px; border: 0; padding: 12px 14px; border-radius: 9px; background: transparent; color: #c8d7d2; text-align: left; }
.crm-menu button span { width: 20px; text-align: center; }
.crm-menu button.active, .crm-menu button:hover { background: #ffffff16; color: white; }
.crm-account { display: flex; align-items: center; gap: 10px; padding: 14px 10px 0; border-top: 1px solid #ffffff18; font-size: 12px; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; flex: none; border-radius: 50%; background: #cfaa68; color: #173d34; font-weight: 800; }
.crm-main { min-width: 0; }
.crm-top { height: 62px; display: flex; align-items: center; justify-content: space-between; padding: 0 30px; border-bottom: 1px solid var(--line); background: white; }
.crm-top-actions { display: flex; align-items: center; gap: 9px; }
.icon-button, .mobile-menu { border: 0; padding: 9px 11px; border-radius: 8px; background: #f3f6f4; color: var(--green); }
.mobile-menu { display: none; margin-right: 8px; }
.admin-page { padding: 32px 3vw 70px; max-width: 1500px; margin: auto; }
.metrics { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 24px; }
.metric { background: white; border: 1px solid var(--line); border-radius: 13px; padding: 18px; }
.metric span { display: block; font-size: 12px; color: var(--muted); }
.metric strong { display: block; margin-top: 8px; font-size: 26px; }
.admin-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 20px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); font-weight: 500; font-size: 11px; }
.activity { display: grid; gap: 0; }
.activity-item { padding: 13px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.activity-item small { display: block; color: var(--muted); margin-top: 4px; }
.crm-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 18px; }
.search-box { position: relative; max-width: 360px; flex: 1; }
.search-box input { width: 100%; padding: 11px 13px 11px 36px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.search-box::before { content: "⌕"; position: absolute; left: 13px; top: 9px; color: var(--muted); }
.table-wrap { overflow-x: auto; }
.customer-link { border: 0; padding: 0; background: none; color: var(--green); font-weight: 700; }
.tag { display: inline-block; margin: 2px 4px 2px 0; padding: 4px 7px; border-radius: 999px; background: var(--cream); color: #785e34; font-size: 11px; }
.drawer-backdrop { position: fixed; inset: 0; z-index: 30; background: #102a2350; }
.drawer { position: absolute; top: 0; right: 0; width: min(560px, 92vw); height: 100%; padding: 28px; overflow-y: auto; background: #f6f8f7; box-shadow: -20px 0 50px #0002; }
.drawer-head { display: flex; justify-content: space-between; gap: 15px; margin-bottom: 20px; }
.drawer-close { border: 0; width: 34px; height: 34px; border-radius: 50%; background: white; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.detail-box { padding: 13px; border-radius: 10px; background: #f5f7f6; }
.detail-box small { display: block; margin-bottom: 5px; color: var(--muted); }
.mobile-store-summary { display: none; }
.merchant-tabs { display: flex; gap: 6px; margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.merchant-tabs button { flex: none; border: 1px solid var(--line); padding: 9px 13px; border-radius: 999px; background: white; color: var(--muted); }
.merchant-tabs button.active { border-color: var(--green); background: var(--mint); color: var(--green); font-weight: 700; }
.pos-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr); gap: 20px; align-items: start; }
.payment-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.payment-method { display: grid; place-items: center; min-height: 70px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--muted); }
.payment-method:has(input:checked) { border-color: var(--green); background: var(--mint); color: var(--green); font-weight: 700; }
.payment-method input { position: absolute; opacity: 0; }
.money-summary { display: grid; gap: 8px; padding: 14px; border-radius: 11px; background: #f6f8f7; }
.money-row { display: flex; justify-content: space-between; gap: 10px; }
.money-row.total { padding-top: 9px; border-top: 1px solid var(--line); font-size: 18px; font-weight: 800; }
.finance-breakdown { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.permission-list { display: flex; flex-wrap: wrap; gap: 4px; max-width: 360px; }
.status.warn { background: #fff2db; color: #9a681c; }
.status.danger { background: #f8e9e6; color: var(--danger); }
.status.neutral { background: #eef1ef; color: #66736e; }
.warning-panel { margin-bottom: 20px; border-color: #e4b766; background: #fffaf0; }

#toast { position: fixed; left: 50%; bottom: 28px; translate: -50% 20px; opacity: 0; pointer-events: none; z-index: 50; padding: 11px 18px; border-radius: 9px; background: #172a24; color: white; box-shadow: 0 8px 28px #0003; transition: .25s; }
#toast.show { opacity: 1; translate: -50% 0; }
#toast.error { background: var(--danger); }

@media (max-width: 900px) {
  .topbar { padding: 0 16px; gap: 12px; }
  .brand span:last-child, .demo-pill { display: none; }
  .portal-label { text-align: right; }
  .workspace { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .workspace-main, .admin-page { padding: 28px 18px 60px; }
  .scan-grid, .admin-grid { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .crm-layout { grid-template-columns: 1fr; }
  .crm-sidebar { position: fixed; top: 68px; left: -260px; width: 248px; transition: left .22s; }
  .crm-sidebar.open { left: 0; }
  .crm-top { padding: 0 16px; }
  .mobile-menu { display: inline-block; }
  .mobile-store-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
  .mobile-store-summary .metric { padding: 12px; }
  .mobile-store-summary .metric strong { font-size: 18px; }
  .pos-layout, .finance-breakdown { grid-template-columns: 1fr; }
}

@media (max-width: 440px) {
  .phone-shell { width: 100%; height: calc(100vh - 68px); margin: 0; border: 0; border-radius: 0; box-shadow: none; }
  .phone-shell { height: calc(100dvh - 68px); }
  .page-heading h1 { font-size: 26px; }
  .crm-toolbar { align-items: stretch; flex-direction: column; }
  .detail-grid { grid-template-columns: 1fr; }
  .payment-methods { grid-template-columns: repeat(2, 1fr); }
}
