:root {
  --bg: #eef4fc;
  --bg-deep: #e5eef9;
  --surface: #ffffff;
  --surface-soft: #f7faff;
  --ink: #10213f;
  --ink-2: #334b70;
  --muted: #6d809d;
  --line: #dbe6f4;
  --line-strong: #c9d9ec;
  --brand: #2058c7;
  --brand-deep: #123b8f;
  --brand-soft: #e9f1ff;
  --teal: #0e8f86;
  --good: #0f8a62;
  --good-soft: #e5f8ef;
  --warn: #a96800;
  --warn-soft: #fff6df;
  --danger: #c43636;
  --danger-soft: #fff0f0;
  --navy: #081a38;
  --navy-2: #102d55;
  --shadow: 0 18px 50px rgba(22, 55, 105, .09);
  --shadow-sm: 0 8px 24px rgba(22, 55, 105, .07);
  --radius: 24px;
  --radius-sm: 14px;
  --max: 1180px;
  --sidebar: 238px;
  --font: "PingFang SC", "Microsoft YaHei", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-width: 300px; min-height: 100vh; color: var(--ink);
  font-family: var(--font); font-size: 14px; line-height: 1.65;
  background:
    radial-gradient(1100px 480px at 8% -5%, #dceaff 0%, transparent 62%),
    radial-gradient(850px 420px at 95% 8%, #e7f5f2 0%, transparent 58%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -.02em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid rgba(32, 88, 199, .35); outline-offset: 2px; }
::selection { background: #bdd4ff; }
.skip-link { position: fixed; left: 12px; top: -80px; z-index: 999; background: #fff; padding: 9px 14px; border-radius: 9px; }
.skip-link:focus { top: 12px; }
.app-root { min-height: 100vh; }
.container { width: min(calc(100% - 48px), var(--max)); margin: 0 auto; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.strong { font-weight: 750; }
.mono { font-family: "Cascadia Code", Consolas, monospace; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.hidden { display: none !important; }
.noscript { padding: 30px; text-align: center; }

/* Brand */
.brand-lockup { display: flex; align-items: center; gap: 13px; min-width: 0; }
.logo-mark {
  width: 46px; height: 46px; border-radius: 15px; flex: none; display: grid; place-items: center;
  background: linear-gradient(145deg, #2d6be0, #0f3d9c); color: #fff;
  box-shadow: 0 9px 20px rgba(20, 66, 157, .28);
}
.logo-mark svg { width: 27px; height: 27px; }
.brand-name { font-size: 20px; font-weight: 800; letter-spacing: .02em; }
.brand-sub { font-size: 10px; color: var(--muted); letter-spacing: .21em; font-weight: 700; }
.brand-lockup.on-dark .brand-name { color: #fff; }
.brand-lockup.on-dark .brand-sub { color: #a8c4ec; }

/* Buttons */
.btn {
  border: 1px solid transparent; border-radius: 12px; min-height: 42px; padding: 9px 17px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 700; white-space: nowrap; transition: .18s ease; text-decoration: none;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: linear-gradient(135deg, #2b65d4, #1649ad); color: #fff; box-shadow: 0 9px 20px rgba(30, 80, 177, .22); }
.btn-primary:hover { box-shadow: 0 12px 24px rgba(30, 80, 177, .3); }
.btn-ghost { background: #fff; border-color: var(--line-strong); color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-soft); border-color: #a9c3e6; }
.btn-soft { background: var(--brand-soft); color: var(--brand-deep); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { min-height: 34px; padding: 5px 11px; border-radius: 9px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn-icon { width: 38px; height: 38px; min-height: 38px; padding: 0; border-radius: 11px; }
.icon-btn { border: 0; background: transparent; color: var(--muted); width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; }
.icon-btn:hover { background: var(--bg); color: var(--ink); }
.icon-btn svg, .btn-icon svg { width: 18px; height: 18px; }

/* Forms */
.form-stack { display: grid; gap: 16px; }
.field { display: grid; gap: 7px; min-width: 0; }
.field > label, .field-label { font-size: 13px; font-weight: 750; color: var(--ink-2); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap > .input-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: #7f93ae; pointer-events: none; display: grid; place-items: center;
}
.input-wrap > .input-icon svg { width: 17px; height: 17px; }
.input {
  width: 100%; min-height: 47px; border: 1px solid var(--line-strong); border-radius: 12px;
  background: #fff; padding: 10px 13px; transition: border .16s, box-shadow .16s;
}
.input::placeholder { color: #94a6bd; }
.input:hover { border-color: #b5cbe4; }
.input:focus { outline: 0; border-color: #6c9be6; box-shadow: 0 0 0 4px rgba(60, 122, 226, .12); }
.input-wrap > .input-icon + .input { padding-left: 40px; }
.input-wrap.has-suffix > .input { padding-right: 48px; }
.password-toggle {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px;
  border: 0; background: transparent; color: #7f93ae; display: grid; place-items: center; border-radius: 10px;
}
.password-toggle:hover { background: var(--surface-soft); color: var(--brand); }
.password-toggle svg { width: 19px; height: 19px; }
textarea.input { min-height: 100px; resize: vertical; line-height: 1.7; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #7690b1 50%), linear-gradient(135deg, #7690b1 50%, transparent 50%); background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.field-hint { font-size: 12px; color: var(--muted); min-height: 17px; }
.field-hint.error, .form-error { color: var(--danger); }
.form-error { border: 1px solid #f3cccc; background: #fff5f5; border-radius: 10px; padding: 10px 12px; font-size: 12.5px; }
.check-line { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.check-line input { width: 17px; height: 17px; accent-color: var(--brand); }
.helper-card { border: 1px dashed var(--line-strong); background: var(--surface-soft); border-radius: 12px; padding: 11px 13px; font-size: 12px; color: var(--muted); }

/* Auth */
.auth-page { min-height: 100vh; display: flex; flex-direction: column; }
.auth-header { height: 88px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.auth-header .header-actions { display: flex; gap: 10px; align-items: center; }
.auth-main { flex: 1; display: grid; place-items: center; padding: 10px 28px 50px; }
.auth-card { width: min(1060px, 100%); display: grid; grid-template-columns: 1.05fr .95fr; border-radius: 30px; overflow: hidden; background: #fff; box-shadow: var(--shadow); border: 1px solid rgba(206, 222, 242, .8); }
.auth-visual { position: relative; overflow: hidden; min-height: 620px; padding: 46px; color: #fff; background: linear-gradient(154deg, #0a1b3e 0%, #123d7f 48%, #245fbd 100%); display: flex; flex-direction: column; }
.auth-visual::before { content: ""; position: absolute; width: 460px; height: 460px; border: 1px solid rgba(171, 205, 255, .2); border-radius: 50%; right: -140px; top: -135px; }
.auth-visual::after { content: ""; position: absolute; width: 520px; height: 520px; border: 1px solid rgba(171, 205, 255, .12); border-radius: 50%; left: -250px; bottom: -260px; }
.auth-visual .brand-lockup { position: relative; z-index: 1; }
.auth-visual-copy { position: relative; z-index: 1; margin-top: auto; padding-top: 80px; }
.auth-eyebrow { font-size: 10px; letter-spacing: .2em; font-weight: 800; color: #a8c9ff; display: inline-flex; border: 1px solid rgba(173, 207, 255, .3); border-radius: 999px; padding: 6px 12px; }
.auth-visual h1 { margin: 20px 0 14px; font-size: clamp(35px, 4vw, 52px); letter-spacing: -.045em; }
.auth-visual h1 span { color: #9ec6ff; }
.auth-visual-copy p { color: #bbd2f0; max-width: 390px; font-size: 13px; }
.auth-points { position: relative; z-index: 1; display: grid; gap: 11px; margin-top: 30px; }
.auth-points li { display: flex; gap: 10px; align-items: center; color: #d6e6fc; font-size: 12.5px; }
.auth-points svg { width: 16px; height: 16px; color: #81b3ff; }
.auth-footnote { position: relative; z-index: 1; margin-top: auto; display: flex; justify-content: space-between; color: #8eadd5; font-size: 10px; letter-spacing: .12em; padding-top: 45px; }
.auth-form-panel { padding: 44px 46px; display: flex; flex-direction: column; justify-content: center; }
.auth-form-head { margin-bottom: 26px; }
.auth-kicker { color: var(--brand); font-weight: 800; font-size: 10px; letter-spacing: .19em; }
.auth-form-head h2 { font-size: 32px; margin: 10px 0 6px; }
.auth-form-head p { color: var(--muted); font-size: 13px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 20px; }
.auth-tab { border: 0; background: transparent; border-radius: 9px; padding: 9px; font-weight: 700; color: var(--muted); font-size: 13px; }
.auth-tab.active { background: #fff; color: var(--brand); box-shadow: 0 3px 9px rgba(22, 55, 105, .08); }
.auth-links { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; margin-top: 18px; }
.auth-notice { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 17px; color: #8597ae; font-size: 11.5px; }
.demo-tip { background: #f5f9ff; border: 1px dashed #c9dcf3; border-radius: 10px; padding: 9px 11px; font-size: 11.5px; color: #5c7495; }
.sms-row { display: grid; grid-template-columns: 1fr auto; gap: 9px; }
.sms-btn { min-width: 112px; }
.optional-tag { font-size: 10px; font-weight: 500; color: var(--muted); }
.auth-card.admin-auth .auth-visual { background: linear-gradient(155deg, #07172e, #0d2c54 52%, #16477f); }
.admin-auth .auth-form-panel { max-width: 490px; }

/* Client shell */
.client-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(250, 252, 255, .9); border-bottom: 1px solid rgba(210, 225, 242, .85); backdrop-filter: blur(16px); }
.topbar-inner { height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.topbar .brand-lockup .brand-name { font-size: 18px; }
.topbar .logo-mark { width: 40px; height: 40px; border-radius: 13px; }
.client-nav { display: flex; gap: 4px; align-items: center; }
.nav-link { color: #506987; font-weight: 650; font-size: 13px; padding: 9px 15px; border-radius: 10px; display: inline-flex; align-items: center; gap: 7px; }
.nav-link svg { width: 16px; height: 16px; }
.nav-link:hover { background: #eef4fd; color: var(--brand); text-decoration: none; }
.nav-link.active { background: var(--brand-soft); color: var(--brand); }
.topbar-user { display: flex; align-items: center; gap: 12px; }
.user-chip { display: flex; align-items: center; gap: 9px; border-left: 1px solid var(--line); padding-left: 12px; }
.user-chip .meta { line-height: 1.25; }
.user-chip .meta b { font-size: 12.5px; display: block; }
.user-chip .meta span { font-size: 10.5px; color: var(--muted); }
.client-main { flex: 1; padding: 34px 0 70px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.page-head h1 { font-size: clamp(29px, 3vw, 39px); }
.page-head p { color: var(--muted); margin-top: 6px; font-size: 13px; }
.head-actions { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.client-footer { border-top: 1px solid var(--line); padding: 23px 0 27px; color: #8498b3; font-size: 11.5px; }
.client-footer .container { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.footer-nav { display: flex; gap: 18px; }

/* Client dashboard */
.hero {
  position: relative; overflow: hidden; color: #fff; border-radius: 26px; padding: 37px 40px;
  background: linear-gradient(120deg, #0f2d61 0%, #164ba7 54%, #2c6cd5 100%);
  display: grid; grid-template-columns: 1.45fr .85fr; gap: 35px; box-shadow: 0 18px 40px rgba(14, 52, 122, .2);
}
.hero::after { content: ""; position: absolute; width: 360px; height: 360px; border-radius: 50%; border: 1px solid rgba(177, 208, 255, .2); right: -100px; top: -150px; }
.hero-copy { position: relative; z-index: 1; }
.hero-kicker { font-size: 10px; letter-spacing: .18em; font-weight: 800; color: #a9caff; display: flex; align-items: center; gap: 8px; }
.hero-kicker::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #7fb3ff; }
.hero h1 { margin: 15px 0 10px; font-size: clamp(27px, 3.1vw, 40px); line-height: 1.35; letter-spacing: -.04em; }
.hero p { color: #c4d7f1; font-size: 12.5px; max-width: 590px; }
.hero-actions { display: flex; gap: 9px; margin-top: 23px; flex-wrap: wrap; }
.hero .btn-ghost { background: rgba(255,255,255,.1); border-color: rgba(210, 230, 255, .35); color: #fff; }
.hero .btn-primary { background: #fff; color: #16449c; box-shadow: none; }
.invite-mini { align-self: stretch; background: rgba(255, 255, 255, .09); border: 1px solid rgba(194, 218, 255, .22); border-radius: 18px; padding: 20px; display: flex; flex-direction: column; position: relative; z-index: 1; }
.invite-mini-head { display: flex; justify-content: space-between; color: #b9d2f5; font-size: 10.5px; letter-spacing: .09em; }
.invite-code { font-family: "Cascadia Code", Consolas, monospace; font-size: 25px; letter-spacing: .05em; color: #fff; margin-top: 15px; font-weight: 700; }
.invite-mini .divider { height: 1px; background: rgba(193, 217, 255, .22); margin: 15px 0; }
.invite-mini-row { display: flex; justify-content: space-between; font-size: 12px; color: #c0d5f2; }
.invite-mini-row b { color: #fff; }
.invite-mini .btn { margin-top: auto; border-color: rgba(255,255,255,.35); color: #fff; background: rgba(255,255,255,.1); }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 18px 0 28px; }
.stat-card { background: #fff; border: 1px solid rgba(214, 227, 243, .9); border-radius: 15px; padding: 17px 19px; box-shadow: var(--shadow-sm); }
.stat-card-top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 11.5px; }
.stat-ico { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.stat-ico svg { width: 15px; height: 15px; }
.stat-value { font-size: 25px; font-weight: 800; letter-spacing: -.035em; margin-top: 3px; line-height: 1.3; }
.stat-value small { font-size: 12px; font-weight: 500; color: var(--muted); }
.stat-note { color: var(--muted); font-size: 10.5px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 14px; }
.section-head h2 { font-size: 20px; }
.section-head p { color: var(--muted); font-size: 11.5px; margin-top: 3px; }
.text-link { font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 5px; color: var(--brand); }
.text-link svg { width: 14px; height: 14px; }
.section-gap { margin-top: 28px; }
.two-col { display: grid; grid-template-columns: 1.45fr .85fr; gap: 18px; align-items: start; }

/* Products */
.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.product-card { background: #fff; border: 1px solid rgba(213, 226, 243, .95); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; transition: .18s ease; }
.product-card:hover { transform: translateY(-3px); box-shadow: 0 15px 34px rgba(22, 55, 105, .11); border-color: #c5d9ef; }
.product-media { height: 178px; position: relative; display: grid; place-items: center; overflow: hidden; background: linear-gradient(145deg, #eef6ff, #e4effc); }
.product-media[data-tone="teal"] { background: linear-gradient(145deg, #effaf8, #dff2ed); }
.product-media[data-tone="slate"] { background: linear-gradient(145deg, #f3f6f9, #e6edf5); }
.product-media[data-tone="amber"] { background: linear-gradient(145deg, #fff9ec, #f7ead0); }
.product-media[data-tone="violet"] { background: linear-gradient(145deg, #f7f3ff, #ece3fa); }
.product-media[data-tone="sky"] { background: linear-gradient(145deg, #eff9ff, #dbeeff); }
.product-media svg { width: 74%; height: auto; }
.product-media .product-photo { width: 100%; height: 100%; object-fit: cover; }
.product-media .media-tag { position: absolute; left: 12px; top: 12px; background: rgba(255,255,255,.8); backdrop-filter: blur(6px); border-radius: 999px; padding: 3px 8px; font-size: 9.5px; color: #506b8a; font-weight: 700; letter-spacing: .04em; }
.product-media .media-caption { position: absolute; right: 11px; bottom: 10px; font-size: 9px; color: #6c83a1; letter-spacing: .05em; }
.product-body { padding: 17px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.product-cat { font-size: 9px; letter-spacing: .12em; color: var(--brand); font-weight: 800; text-transform: uppercase; }
.product-name { font-size: 17px; margin: 4px 0 5px; }
.product-desc { font-size: 11.5px; color: var(--muted); min-height: 38px; }
.feature-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; min-height: 24px; }
.feature-chip { border: 1px solid var(--line); background: #fbfdff; color: #647a96; border-radius: 6px; padding: 2px 7px; font-size: 10px; }
.product-buy { margin-top: auto; padding-top: 14px; border-top: 1px solid #edf2f8; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.price { color: #102d60; font-size: 22px; font-weight: 800; letter-spacing: -.04em; }
.price small { font-size: 11px; font-weight: 500; }
.old-price { font-size: 10.5px; color: #a0afc1; text-decoration: line-through; margin-left: 4px; }
.product-empty { grid-column: 1 / -1; }

/* Panels, tables, lists */
.panel { background: #fff; border: 1px solid rgba(213, 226, 243, .95); border-radius: 18px; box-shadow: var(--shadow-sm); overflow: hidden; }
.panel-pad { padding: 21px 22px; }
.panel-head { padding: 20px 22px 14px; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.panel-head h3 { font-size: 17px; }
.panel-head p { font-size: 11px; color: var(--muted); margin-top: 2px; }
.panel-body { padding: 0 22px 22px; }
.panel + .panel { margin-top: 16px; }
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th { text-align: left; color: #7d91aa; text-transform: uppercase; font-size: 9px; letter-spacing: .1em; font-weight: 800; padding: 10px 12px; border-top: 1px solid #edf2f8; border-bottom: 1px solid #edf2f8; background: #fbfdff; white-space: nowrap; }
.data-table td { padding: 13px 12px; border-bottom: 1px solid #eef3f9; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tr:hover td { background: #fcfdff; }
.table-main { font-weight: 700; color: var(--ink); }
.table-sub { color: var(--muted); font-size: 10.5px; margin-top: 2px; }
.money { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.money.positive { color: var(--good); }
.money.negative { color: var(--danger); }
.table-actions { display: flex; gap: 6px; justify-content: flex-end; }
.card-list { display: grid; gap: 10px; }
.compact-item { padding: 13px 16px; border: 1px solid #e9f0f8; border-radius: 12px; display: flex; justify-content: space-between; gap: 14px; align-items: center; background: #fcfdff; }
.compact-item:hover { border-color: #cddff2; background: #fff; }
.item-main { display: flex; gap: 10px; align-items: center; min-width: 0; }
.item-title { font-weight: 700; font-size: 12px; }
.item-sub { color: var(--muted); font-size: 10.5px; margin-top: 2px; }
.item-amount { font-weight: 800; font-size: 13px; white-space: nowrap; }
.avatar { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; font-weight: 800; color: #fff; background: linear-gradient(145deg, #5f8bdd, #2251a8); overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 29px; height: 29px; border-radius: 9px; font-size: 11px; }
.avatar-lg { width: 70px; height: 70px; border-radius: 20px; font-size: 25px; }
.avatar.xl { width: 90px; height: 90px; border-radius: 25px; font-size: 30px; }
.avatar[data-tone="teal"] { background: linear-gradient(145deg, #37a99d, #0d706e); }
.avatar[data-tone="violet"] { background: linear-gradient(145deg, #9974d0, #5c3b9c); }
.avatar[data-tone="amber"] { background: linear-gradient(145deg, #d9a44a, #a06b1d); }
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 8px; font-size: 9.5px; font-weight: 800; letter-spacing: .02em; white-space: nowrap; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.good { color: var(--good); background: var(--good-soft); }
.badge.warn { color: var(--warn); background: var(--warn-soft); }
.badge.danger { color: var(--danger); background: var(--danger-soft); }
.badge.info { color: var(--brand); background: var(--brand-soft); }
.badge.neutral { color: #5f7592; background: #eef3f9; }
.badge.no-dot::before { display: none; }
.empty-state { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty-state .empty-icon { width: 50px; height: 50px; margin: 0 auto 12px; border-radius: 16px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; }
.empty-state .empty-icon svg { width: 24px; height: 24px; }
.empty-state h4 { color: var(--ink-2); font-size: 14px; margin-bottom: 4px; }
.empty-state p { font-size: 11.5px; }

/* Orders */
.order-list { display: grid; gap: 11px; }
.order-card { border: 1px solid #e5eef8; border-radius: 14px; padding: 15px 17px; background: #fff; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.order-thumb { width: 48px; height: 48px; border-radius: 11px; background: #f0f6fe; display: grid; place-items: center; flex: none; overflow: hidden; }
.order-thumb svg { width: 40px; }
.order-thumb img { width: 100%; height: 100%; object-fit: cover; }
.order-info { min-width: 0; flex: 1; }
.order-info b { font-size: 12.5px; display: block; }
.order-meta { color: var(--muted); font-size: 10.5px; margin-top: 3px; display: flex; flex-wrap: wrap; gap: 5px 12px; }
.order-price { text-align: right; }
.order-price b { font-size: 15px; display: block; }
.order-actions { display: flex; gap: 6px; margin-top: 6px; justify-content: flex-end; }
.payment-pending { border: 1px solid #ffe1a8; background: #fff9ec; border-radius: 10px; padding: 8px 10px; font-size: 11px; color: #8c5c0a; margin-top: 8px; }
.payment-pending a { color: #8c5c0a; font-weight: 800; text-decoration: underline; }

/* Profile */
.profile-hero { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 25px 26px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; box-shadow: var(--shadow-sm); }
.profile-hero .identity { display: flex; align-items: center; gap: 15px; flex: 1; min-width: 220px; }
.profile-name { font-size: 22px; }
.profile-sub { color: var(--muted); font-size: 11.5px; margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.profile-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.profile-stats { display: flex; gap: 28px; padding-left: 20px; border-left: 1px solid var(--line); }
.profile-stat b { display: block; font-size: 20px; letter-spacing: -.03em; }
.profile-stat span { color: var(--muted); font-size: 10px; }
.invite-panel { position: relative; overflow: hidden; color: #fff; border-radius: 20px; padding: 24px; background: linear-gradient(130deg, #0d2b5d, #164ba5 58%, #2a6bd0); min-height: 200px; }
.invite-panel::after { content: ""; position: absolute; width: 280px; height: 280px; border-radius: 50%; border: 1px solid rgba(181, 211, 255, .2); right: -80px; bottom: -140px; }
.invite-panel .eyebrow { font-size: 9px; letter-spacing: .16em; color: #a6c7f2; font-weight: 800; }
.invite-panel h3 { margin: 7px 0 4px; font-size: 20px; }
.invite-panel p { color: #c2d7f2; font-size: 11.5px; }
.invite-code-line { display: flex; align-items: center; gap: 8px; margin: 15px 0 12px; flex-wrap: wrap; }
.invite-code-line strong { font-family: "Cascadia Code", Consolas, monospace; font-size: 24px; letter-spacing: .05em; }
.invite-panel .share-link { background: rgba(255,255,255,.1); border: 1px solid rgba(190,218,255,.25); color: #d9e9ff; border-radius: 8px; padding: 7px 9px; font-size: 10px; overflow-wrap: anywhere; }
.invite-panel .qr-area { background: #fff; border-radius: 13px; padding: 7px; width: 132px; height: 132px; position: absolute; right: 24px; top: 25px; z-index: 1; }
.invite-panel .qr-area canvas { width: 100% !important; height: 100% !important; }
.invite-panel .share-actions { display: flex; gap: 7px; margin-top: 10px; flex-wrap: wrap; }
.invite-panel .btn-ghost { color: #fff; border-color: rgba(190,218,255,.33); background: rgba(255,255,255,.08); }
.qr-help { font-size: 10px; color: #b8d0ee; margin-top: 5px; }
.rules-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
.rules-card h3 { font-size: 16px; margin-bottom: 12px; }
.rule-list { display: grid; gap: 9px; counter-reset: r; }
.rule-list li { display: flex; gap: 9px; font-size: 11.5px; color: #5b708d; line-height: 1.65; }
.rule-list li::before { counter-increment: r; content: counter(r); flex: none; width: 19px; height: 19px; border-radius: 6px; background: var(--brand-soft); color: var(--brand); font-size: 9px; display: grid; place-items: center; font-weight: 800; margin-top: 1px; }
.rule-current { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.profile-grid { display: grid; grid-template-columns: 1.12fr .88fr; gap: 17px; align-items: start; }
.profile-main { display: grid; gap: 16px; }
.profile-side { display: grid; gap: 16px; }
.archive-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.archive-head { padding: 18px 21px; display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid #edf2f8; }
.archive-head h3 { font-size: 15px; }
.archive-head p { color: var(--muted); font-size: 10.5px; margin-top: 2px; }
.archive-body { padding: 17px 21px 20px; }
.archive-empty { background: #f8fbff; border: 1px dashed var(--line-strong); border-radius: 12px; padding: 20px; text-align: center; color: var(--muted); font-size: 12px; }
.archive-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.archive-field label { font-size: 10px; color: var(--muted); display: block; }
.archive-field b { font-size: 13px; font-weight: 700; display: block; margin-top: 2px; }
.archive-note { margin-top: 16px; border-top: 1px solid #edf2f8; padding-top: 12px; color: #5d7592; font-size: 11.5px; }
.vision-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; margin-top: 14px; }
.vision-box { background: #f8fbff; border: 1px solid #e7eff9; border-radius: 11px; padding: 10px 12px; }
.vision-box span { color: var(--muted); font-size: 10px; display: block; }
.vision-box b { font-size: 13px; display: block; margin-top: 2px; }
.meta-note { color: #9aacc0; font-size: 10px; margin-top: 11px; }

/* Production profile additions */
.brand-name + .brand-sub { margin-left: 8px; }
.profile-hero .profile-stats { margin-left: auto; }
.profile-hero .profile-stats .profile-stat { text-align: right; }
.profile-hero .profile-stat b { font-size: 22px; color: var(--brand-dark); }
.invite-card { position: relative; overflow: hidden; color: #fff; border-radius: 20px; padding: 24px; background: linear-gradient(130deg, #0d2b5d, #164ba5 58%, #2a6bd0); min-height: 300px; min-width: 0; }
.invite-card::after { content: ""; position: absolute; width: 280px; height: 280px; border-radius: 50%; border: 1px solid rgba(181,211,255,.2); right: -80px; bottom: -140px; pointer-events: none; }
.invite-card-top { display: flex; justify-content: space-between; gap: 12px; color: #a6c7f2; font-size: 9px; letter-spacing: .14em; font-weight: 800; text-transform: uppercase; }
.invite-card h2 { color: #fff; margin: 12px 0 5px; font-size: 21px; }
.invite-card p { color: #c2d7f2; font-size: 11.5px; line-height: 1.75; max-width: 540px; }
.invite-code-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0 10px; }
.invite-card .invite-code { color: #fff; margin: 0; font-size: 26px; }
.invite-card .btn-ghost { color: #fff; border-color: rgba(190,218,255,.33); background: rgba(255,255,255,.1); }
.invite-card .btn-ghost:hover { background: rgba(255,255,255,.2); color: #fff; }
.invite-link { background: rgba(255,255,255,.1); border: 1px solid rgba(190,218,255,.25); color: #d9e9ff; border-radius: 9px; padding: 8px 10px; font-size: 10px; overflow-wrap: anywhere; }
.invite-card-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.invite-qr { display: block; width: 170px !important; height: 170px !important; margin-top: 16px; padding: 8px; background: #fff; border-radius: 13px; }
.invite-qr-note { display: block; color: #b8d0ee; font-size: 10px; margin-top: 7px; }
.profile-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.profile-fields > div { min-width: 0; padding: 9px 0; border-bottom: 1px solid #edf2f8; }
.profile-fields span { display: block; color: var(--muted); font-size: 10px; }
.profile-fields b { display: block; font-size: 12.5px; margin-top: 3px; overflow-wrap: anywhere; }
.archive-read-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.archive-read-item { background: #f8fbff; border: 1px solid #e7eff9; border-radius: 11px; padding: 10px 12px; min-width: 0; }
.archive-read-item span { color: var(--muted); font-size: 10px; display: block; }
.archive-read-item b { font-size: 12.5px; display: block; margin-top: 2px; overflow-wrap: anywhere; }
.vision-block { margin-top: 14px; border: 1px solid #e7eff9; border-radius: 11px; overflow: hidden; }
.vision-block h4 { background: #f5f9ff; padding: 9px 12px; display: flex; align-items: center; gap: 6px; font-size: 11px; color: #405c7e; border-bottom: 1px solid #e7eff9; }
.vision-block h4 svg { width: 14px; height: 14px; color: var(--brand); }
.vision-read-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; padding: 9px 12px; border-bottom: 1px solid #edf2f8; font-size: 11px; color: #5d7592; }
.vision-read-row:last-child { border-bottom: 0; }
.vision-read-row > span:first-child { font-weight: 700; color: #405c7e; }
.vision-read-row b { color: var(--text); }
.archive-note { margin-top: 14px; }
.archive-note span { color: var(--muted); font-size: 10px; display: block; }
.archive-note p { margin-top: 3px; color: #5d7592; font-size: 11.5px; line-height: 1.7; }
.archive-meta { color: #9aacc0; font-size: 10px; margin-top: 11px; }
@media (max-width: 900px) {
  .invite-card { min-height: 0; }
  .invite-qr { width: 150px !important; height: 150px !important; }
  .archive-read-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .profile-hero .profile-stats { width: 100%; padding: 10px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .profile-hero .profile-stats .profile-stat { text-align: left; }
  .profile-fields { grid-template-columns: 1fr; }
  .invite-card { padding: 20px; }
  .invite-card .invite-code { font-size: 23px; }
  .invite-qr { width: 140px !important; height: 140px !important; }
  .vision-read-row { grid-template-columns: 1fr; gap: 3px; }
  .vision-read-row > span:first-child { margin-bottom: 2px; }
}
/* Admin */
.admin-shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; background: #f4f8fd; }
.admin-sidebar { background: #0b1d38; color: #d5e3f5; padding: 22px 15px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-sidebar .brand-lockup { padding: 0 8px; }
.admin-sidebar .logo-mark { width: 38px; height: 38px; border-radius: 12px; box-shadow: none; }
.admin-sidebar .brand-name { font-size: 16px; color: #fff; }
.admin-sidebar .brand-sub { color: #819fc5; font-size: 8px; }
.sidebar-note { margin: 0 8px; padding: 9px 10px; border-radius: 9px; background: rgba(112, 164, 229, .1); border: 1px solid rgba(143, 185, 237, .16); font-size: 10px; color: #93b5df; display: flex; align-items: center; gap: 6px; }
.sidebar-note::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #4ecda5; box-shadow: 0 0 0 3px rgba(78, 205, 165, .12); }
.admin-nav { display: grid; gap: 3px; }
.nav-group-title { color: #6485aa; font-size: 8.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; padding: 13px 11px 5px; }
.admin-link { color: #9db5d2; border-radius: 9px; padding: 8px 10px; display: flex; align-items: center; gap: 9px; font-size: 11.5px; font-weight: 650; }
.admin-link svg { width: 16px; height: 16px; opacity: .85; }
.admin-link:hover { background: rgba(119, 162, 222, .12); color: #fff; text-decoration: none; }
.admin-link.active { background: #1c4e9d; color: #fff; box-shadow: inset 3px 0 0 #72b2ff; }
.admin-sidebar-foot { margin-top: auto; padding: 13px 9px 4px; border-top: 1px solid rgba(146, 181, 224, .15); color: #6f8daf; font-size: 9.5px; line-height: 1.7; }
.admin-main { min-width: 0; }
.admin-topbar { height: 65px; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid #dce8f4; background: rgba(255,255,255,.85); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 20; }
.admin-crumb { font-size: 10px; letter-spacing: .08em; color: #8399b3; }
.admin-top-actions { display: flex; align-items: center; gap: 9px; }
.admin-user { display: flex; align-items: center; gap: 8px; font-size: 11px; }
.admin-content { padding: 26px 28px 45px; max-width: 1380px; }
.admin-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.admin-page-head h1 { font-size: 27px; }
.admin-page-head p { color: var(--muted); font-size: 11.5px; margin-top: 3px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.metric-card { background: #fff; border: 1px solid #e1ebf6; border-radius: 14px; padding: 15px 17px; box-shadow: 0 4px 13px rgba(22, 55, 105, .035); }
.metric-top { display: flex; justify-content: space-between; color: var(--muted); font-size: 10.5px; }
.metric-icon { width: 25px; height: 25px; border-radius: 8px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.metric-icon svg { width: 14px; height: 14px; }
.metric-value { font-size: 22px; font-weight: 800; letter-spacing: -.035em; margin-top: 3px; }
.metric-note { color: var(--muted); font-size: 9.5px; }
.admin-two { display: grid; grid-template-columns: 1.38fr .82fr; gap: 15px; align-items: start; }
.admin-two > .panel { margin-top: 0; }
.admin-rate-banner { border-radius: 16px; color: #fff; padding: 20px; background: linear-gradient(130deg, #102c59, #1a54ad); position: relative; overflow: hidden; }
.admin-rate-banner::after { content: ""; position: absolute; width: 180px; height: 180px; border: 1px solid rgba(180, 211, 255, .2); border-radius: 50%; right: -60px; top: -80px; }
.admin-rate-banner .eyebrow { color: #b8d4f7; font-size: 9px; letter-spacing: .08em; }
.big-rate { font-size: 42px; font-weight: 800; line-height: 1.1; letter-spacing: -.05em; margin: 8px 0 3px; }
.big-rate small { font-size: 16px; font-weight: 500; }
.admin-rate-banner p { color: #bcd3ef; font-size: 10.5px; }
.admin-rate-banner .btn { margin-top: 14px; background: rgba(255,255,255,.12); border-color: rgba(190,218,255,.3); color: #fff; font-size: 11px; min-height: 32px; }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 15px; }
.quick-link { border: 1px solid #e8eff8; background: #fbfdff; border-radius: 10px; padding: 11px; color: #526b88; font-size: 10.5px; display: flex; align-items: center; gap: 7px; }
.quick-link svg { width: 15px; height: 15px; color: var(--brand); }
.quick-link:hover { background: #f2f7ff; border-color: #cfdfef; text-decoration: none; }
.filter-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 13px; }
.search-box { position: relative; flex: 1; min-width: 190px; }
.search-box .input { min-height: 40px; padding-left: 36px; font-size: 12px; }
.search-box svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: #8ba1ba; }
.filter-row .input { min-height: 40px; font-size: 12px; }
.filter-count { margin-left: auto; color: var(--muted); font-size: 10.5px; }
.admin-customer-cell { display: flex; align-items: center; gap: 9px; }
.admin-customer-cell .table-main { font-size: 12px; }
.admin-customer-cell .table-sub { font-size: 9.5px; }
.product-manage-cell { display: flex; align-items: center; gap: 10px; }
.product-thumb { width: 44px; height: 44px; border-radius: 10px; background: #f1f6fd; display: grid; place-items: center; overflow: hidden; flex: none; }
.product-thumb svg { width: 38px; }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.archive-admin-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.archive-admin-grid .span-2 { grid-column: 1 / -1; }
.archive-section-title { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 800; color: #405c7e; margin: 4px 0 1px; }
.archive-section-title svg { width: 15px; height: 15px; color: var(--brand); }
.vision-admin-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.vision-admin-box { border: 1px solid #e2ebf6; background: #fbfdff; border-radius: 11px; padding: 10px; }
.vision-admin-box > span { font-size: 10px; color: #69809c; font-weight: 750; display: block; margin-bottom: 6px; }
.vision-admin-box .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.vision-admin-box .pair label { font-size: 9px; color: #8da0b6; display: block; }
.vision-admin-box .input { min-height: 34px; padding: 5px 8px; font-size: 11px; border-radius: 7px; }
.customer-hero { background: #fff; border: 1px solid #e0eaf5; border-radius: 18px; padding: 20px 22px; display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 15px; box-shadow: var(--shadow-sm); }
.customer-hero-left { display: flex; gap: 14px; align-items: center; min-width: 0; flex: 1; }
.customer-hero-left > div { min-width: 0; }
.customer-hero-left p { overflow-wrap: anywhere; }
.customer-hero-stats { display: flex; flex: none; flex-wrap: wrap; gap: 22px; }
.customer-hero-stats > div { display: flex; flex-direction: column; gap: 3px; }
.customer-hero-stats span { color: var(--muted); font-size: 12px; }
.customer-hero-stats b { color: var(--ink); font-size: 16px; }
.customer-hero h2 { font-size: 21px; }
.customer-meta { color: var(--muted); font-size: 10.5px; margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.customer-metrics { display: flex; gap: 22px; }
.customer-metric b { font-size: 18px; display: block; }
.customer-metric span { color: var(--muted); font-size: 9.5px; }
.tier-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; }
.tier-card { border: 1px solid #e4edf7; background: #fbfdff; border-radius: 12px; padding: 13px; }
.tier-card.is-active { border-color: #9fc2f2; background: #f2f8ff; box-shadow: inset 0 0 0 1px #d4e6ff; }
.tier-card.high { border-color: #cfdff0; }
.tier-card h4 { font-size: 11px; color: #667e99; font-weight: 700; }
.tier-rate { font-size: 25px; font-weight: 800; letter-spacing: -.03em; color: #1b3c67; margin: 2px 0; }
.tier-rate small { font-size: 11px; font-weight: 500; }
.tier-card p { font-size: 9.5px; color: #8ba0b8; }
.tier-flag { display: inline-block; border-radius: 5px; background: var(--brand-soft); color: var(--brand); padding: 1px 5px; font-size: 8.5px; font-weight: 800; margin-top: 5px; }
.rule-admin-list { display: grid; gap: 11px; }
.rule-admin-list li { display: flex; gap: 10px; font-size: 11.5px; color: #627996; line-height: 1.7; }
.rule-admin-list .n { flex: none; width: 18px; height: 18px; border-radius: 50%; background: #edf4fe; color: var(--brand); font-size: 9px; font-weight: 800; display: grid; place-items: center; margin-top: 1px; }
.log-list { display: grid; }
.log-item { padding: 13px 18px; border-bottom: 1px solid #eef3f9; display: grid; grid-template-columns: 155px 1fr auto; gap: 12px; align-items: start; }
.log-item:last-child { border-bottom: 0; }
.log-date { color: #8ba0b8; font-size: 10px; }
.log-main b { font-size: 11.5px; }
.log-main p { color: #6d829d; font-size: 10.5px; margin-top: 2px; }
.log-cat { font-size: 9px; padding: 3px 7px; border-radius: 5px; background: #f2f6fb; color: #647d99; white-space: nowrap; }
.log-cat.product { color: #6e48a8; background: #f5efff; }
.log-cat.commission { color: #b36d00; background: #fff7e7; }
.log-cat.rate { color: #0f7c75; background: #eaf9f6; }
.log-cat.auth { color: #1b5cb8; background: var(--brand-soft); }
.log-cat.order { color: #237c46; background: #eefaf2; }
.log-cat.customer { color: #3d5f85; background: #f0f5fa; }

/* Admin products */
.product-admin-name { font-size: 12px; font-weight: 750; }
.product-admin-sub { color: var(--muted); font-size: 10px; }
.product-price-cell { font-weight: 750; font-size: 12.5px; }
.product-edit-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 18px; }
.product-form-side { display: grid; gap: 14px; align-content: start; }
.image-uploader { border: 1px dashed #c7d9ee; background: #f8fbff; border-radius: 13px; padding: 11px; text-align: center; position: relative; min-height: 155px; display: grid; place-items: center; overflow: hidden; }
.image-uploader img { width: 100%; height: 160px; object-fit: cover; border-radius: 9px; }
.image-uploader .placeholder { color: #8ca2bb; font-size: 10.5px; display: grid; justify-items: center; gap: 6px; }
.image-uploader .placeholder svg { width: 25px; height: 25px; color: #9bb4d0; }
.upload-actions { display: flex; justify-content: center; gap: 7px; margin-top: 8px; }
.file-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.image-hint { color: #98aabe; font-size: 9.5px; margin-top: 6px; line-height: 1.6; }
.image-preview-large { width: 100%; max-height: 175px; object-fit: cover; border-radius: 10px; }

/* Invite tree/list */
.invite-tree { display: grid; gap: 6px; }
.tree-node { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border: 1px solid #e9f0f8; border-radius: 9px; background: #fcfdff; font-size: 11.5px; }
.tree-node.child { margin-left: 24px; position: relative; }
.tree-node.child::before { content: ""; position: absolute; left: -12px; top: -7px; width: 11px; height: 17px; border-left: 1px solid #d3e2f2; border-bottom: 1px solid #d3e2f2; border-bottom-left-radius: 6px; }
.tree-node .tree-name { font-weight: 700; }
.tree-node .tree-meta { color: var(--muted); font-size: 10px; margin-left: auto; }

/* Modal, toast */
.modal-region:empty { display: none; }
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(7, 23, 46, .46); backdrop-filter: blur(5px); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 18px 40px; overflow-y: auto; animation: fadeIn .16s ease; }
.modal { width: min(510px, 100%); background: #fff; border-radius: 18px; box-shadow: 0 30px 80px rgba(4, 18, 40, .3); overflow: hidden; animation: popIn .18s ease; max-height: 88vh; display: flex; flex-direction: column; }
.modal.wide { width: min(760px, 100%); }
.modal.xwide { width: min(920px, 100%); }
.modal-head { padding: 18px 21px 12px; border-bottom: 1px solid #edf2f8; display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex: none; }
.modal-head h3 { font-size: 18px; }
.modal-head p { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.modal-body { padding: 19px 21px; overflow-y: auto; }
.modal-foot { padding: 12px 21px 17px; border-top: 1px solid #edf2f8; display: flex; justify-content: flex-end; gap: 8px; flex: none; }
.modal-close { width: 32px; height: 32px; border-radius: 9px; border: 0; background: #f4f8fd; color: #7088a3; display: grid; place-items: center; }
.modal-close:hover { background: #e8f1fc; color: var(--ink); }
.modal-close svg { width: 16px; height: 16px; }
.confirm-body { text-align: left; }
.confirm-icon { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--warn-soft); color: var(--warn); margin-bottom: 10px; }
.confirm-icon.danger { background: var(--danger-soft); color: var(--danger); }
.confirm-icon svg { width: 20px; height: 20px; }
.confirm-body p { color: #5e7490; font-size: 12px; line-height: 1.75; }
.toast-region { position: fixed; z-index: 200; right: 20px; top: 18px; display: grid; gap: 8px; width: min(370px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 9px; padding: 12px 13px; border-radius: 11px; background: #fff; box-shadow: 0 14px 35px rgba(10, 31, 64, .18); border: 1px solid #dfeaf6; animation: toastIn .2s ease; font-size: 11.5px; color: #405a77; }
.toast .toast-icon { width: 18px; height: 18px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--good-soft); color: var(--good); font-size: 10px; font-weight: 800; }
.toast.error .toast-icon { background: var(--danger-soft); color: var(--danger); }
.toast.warn .toast-icon { background: var(--warn-soft); color: var(--warn); }
.toast .toast-text { flex: 1; }
.toast button { border: 0; background: transparent; color: #94a6bb; padding: 0; line-height: 1; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* Payment */
.pay-panel { border: 1px solid #dbe8f6; background: #f8fbff; border-radius: 13px; padding: 14px; }
.pay-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pay-panel-head b { font-size: 12px; }
.pay-amount { font-size: 26px; font-weight: 800; letter-spacing: -.04em; }
.pay-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 12px; }
.pay-method { border: 1px solid #dbe8f6; background: #fff; border-radius: 10px; padding: 10px 11px; display: flex; gap: 8px; align-items: center; text-align: left; }
.pay-method input { accent-color: var(--brand); }
.pay-method span { font-size: 11.5px; font-weight: 700; display: block; }
.pay-method small { color: var(--muted); font-size: 9px; display: block; }
.pay-method.disabled { opacity: .5; }
.qr-pay { display: flex; gap: 16px; align-items: center; padding: 14px; border: 1px solid #dce8f5; background: #fff; border-radius: 13px; margin-top: 12px; }
.qr-pay canvas { width: 132px !important; height: 132px !important; border: 1px solid #edf2f8; border-radius: 8px; }
.qr-pay-info { min-width: 0; }
.qr-pay-info b { font-size: 12.5px; display: block; }
.qr-pay-info p { color: var(--muted); font-size: 10.5px; margin-top: 4px; }
.qr-pay-info code { display: block; font-size: 9px; color: #6c8199; overflow-wrap: anywhere; margin-top: 5px; }
.payment-status { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--warn); margin-top: 8px; }
.payment-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.payment-status.paid { color: var(--good); }
.payment-unavailable { border: 1px solid #f3ddbd; background: #fff9ef; border-radius: 11px; padding: 11px 12px; color: #875c18; font-size: 11px; margin-top: 10px; }
.spinner { width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
.spinner.dark { border-color: #c9ddf4; border-top-color: var(--brand); }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-block { min-height: 55vh; display: grid; place-items: center; color: var(--muted); gap: 10px; font-size: 12px; }

/* Responsive */
@media (max-width: 1050px) {
  .hero { grid-template-columns: 1.2fr .8fr; padding: 30px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-two { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
  .profile-side { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .auth-card { grid-template-columns: 1fr; width: min(540px, 100%); }
  .auth-visual { min-height: 310px; padding: 30px 32px; }
  .auth-visual-copy { padding-top: 35px; }
  .auth-visual h1 { font-size: 35px; margin: 12px 0 8px; }
  .auth-points { grid-template-columns: 1fr 1fr; gap: 7px; }
  .auth-footnote { display: none; }
  .auth-form-panel { padding: 32px; }
  .auth-header { height: 72px; }
  .auth-main { padding: 0 18px 35px; }
  .two-col { grid-template-columns: 1fr; }
  .invite-panel .qr-area { position: static; margin-top: 14px; width: 120px; height: 120px; }
  .profile-side { grid-template-columns: 1fr; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar { position: sticky; top: 0; z-index: 40; height: auto; padding: 10px 12px; flex-direction: row; align-items: center; gap: 10px; overflow-x: auto; }
  .admin-sidebar .brand-lockup { flex: none; padding: 0 7px; }
  .admin-sidebar .brand-lockup .brand-sub, .sidebar-note, .admin-sidebar-foot, .nav-group-title { display: none; }
  .admin-nav { display: flex; flex: 1; gap: 3px; overflow-x: auto; scrollbar-width: none; }
  .admin-nav::-webkit-scrollbar { display: none; }
  .admin-nav .nav-group { display: contents; }
  .admin-nav .nav-group-title { display: none; }
  .sidebar-user { flex: none; }
  .admin-link { white-space: nowrap; font-size: 10.5px; padding: 7px 8px; }
  .admin-link svg { width: 14px; height: 14px; }
  .admin-link.active { box-shadow: inset 0 -2px 0 #72b2ff; }
  .admin-topbar { height: 55px; padding: 0 16px; }
  .admin-content { padding: 20px 16px 35px; }
  .admin-page-head h1 { font-size: 24px; }
  .admin-page-head { align-items: flex-start; }
  .customer-hero { align-items: flex-start; flex-direction: column; }
  .customer-metrics { width: 100%; border-top: 1px solid #edf2f8; padding-top: 10px; }
}
@media (max-width: 720px) {
  .container { width: calc(100% - 32px); }
  .auth-header .brand-name { font-size: 16px; }
  .auth-header .header-actions .btn { font-size: 11px; min-height: 35px; padding: 6px 10px; }
  .auth-header .brand-sub { display: none; }
  .auth-main { padding: 0 12px 25px; }
  .auth-visual { display: none; }
  .auth-form-panel { padding: 27px 20px 31px; }
  .auth-form-head h2 { font-size: 28px; }
  .auth-card { border-radius: 20px; }
  .topbar-inner { height: 62px; }
  .admin-sidebar .sidebar-user { display: none; }
  .admin-sidebar, .admin-main, .admin-shell { min-width: 0; width: 100%; }
  .admin-nav { min-width: 0; overflow-x: auto; }
  .admin-top-actions .btn:first-child { display: none; }
  .admin-nav .admin-link:last-child { display: none; }
  .customer-hero-stats { width: 100%; gap: 16px; border-top: 1px solid #edf2f8; padding-top: 10px; }
  .topbar .brand-lockup .brand-name { font-size: 15px; }
  .topbar .brand-lockup .brand-sub { display: none; }
  .topbar .logo-mark { width: 34px; height: 34px; border-radius: 10px; }
  .client-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: rgba(255,255,255,.96); border-top: 1px solid #dce8f4; padding: 5px 8px calc(5px + env(safe-area-inset-bottom)); backdrop-filter: blur(14px); justify-content: space-around; }
  .nav-link { flex-direction: column; gap: 2px; font-size: 9px; padding: 5px 10px; border-radius: 8px; }
  .nav-link svg { width: 18px; height: 18px; }
  .topbar-user .user-chip .meta { display: none; }
  .topbar-user .user-chip { padding-left: 7px; }
  .client-main { padding: 22px 0 92px; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 11px; margin-bottom: 17px; }
  .page-head h1 { font-size: 28px; }
  .hero { grid-template-columns: 1fr; padding: 24px 21px; gap: 16px; border-radius: 19px; }
  .hero h1 { font-size: 26px; }
  .hero-actions { margin-top: 16px; }
  .invite-mini { display: none; }
  .stat-grid { gap: 8px; margin: 12px 0 19px; }
  .stat-card { padding: 12px; border-radius: 12px; }
  .stat-value { font-size: 20px; }
  .stat-note { font-size: 9px; }
  .product-grid { grid-template-columns: 1fr; }
  .product-media { height: 165px; }
  .section-head h2 { font-size: 18px; }
  .profile-hero { padding: 17px; align-items: flex-start; gap: 12px; }
  .profile-hero .identity { gap: 11px; }
  .profile-name { font-size: 19px; }
  .profile-actions { width: 100%; }
  .profile-actions .btn { flex: 1; }
  .profile-stats { width: 100%; padding: 10px 0 0; border-left: 0; border-top: 1px solid var(--line); justify-content: space-between; gap: 8px; }
  .profile-stat b { font-size: 16px; }
  .profile-side { gap: 12px; }
  .invite-panel { padding: 18px; }
  .invite-code-line strong { font-size: 21px; }
  .invite-panel .qr-area { width: 110px; height: 110px; }
  .rules-card { padding: 17px; }
  .archive-summary { grid-template-columns: 1fr 1fr; }
  .vision-grid { grid-template-columns: 1fr; }
  .order-card { align-items: flex-start; flex-wrap: wrap; gap: 10px; }
  .order-price { margin-left: 66px; text-align: left; }
  .order-price .order-actions { justify-content: flex-start; }
  .metric-grid { gap: 8px; }
  .metric-card { padding: 12px; }
  .metric-value { font-size: 19px; }
  .admin-topbar { flex-wrap: wrap; height: auto; min-height: 54px; padding: 7px 13px; }
  .admin-crumb { font-size: 9px; }
  .admin-top-actions { margin-left: auto; }
  .admin-top-actions .btn { font-size: 10px; min-height: 30px; padding: 4px 8px; }
  .admin-content { padding: 17px 12px 30px; }
  .admin-page-head h1 { font-size: 23px; }
  .admin-page-head { flex-direction: column; gap: 9px; }
  .admin-page-head .head-actions { width: 100%; }
  .admin-page-head .head-actions .btn { flex: 1; }
  .filter-row .search-box { flex-basis: 100%; }
  .filter-count { margin-left: 0; }
  .data-table thead { display: none; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
  .data-table tr { padding: 11px 13px; border: 1px solid #e7eff8; border-radius: 11px; margin-bottom: 8px; background: #fff; }
  .data-table td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; align-items: center; gap: 14px; text-align: right; }
  .data-table td::before { content: attr(data-label); color: #8ba0b8; font-size: 9.5px; text-align: left; flex: none; }
  .data-table td:first-child { padding-top: 0; }
  .data-table td:last-child { border-bottom: 0; padding-bottom: 0; }
  .table-actions { justify-content: flex-end; }
  .admin-customer-cell { justify-content: flex-end; }
  .product-manage-cell { justify-content: flex-end; text-align: right; }
  .product-manage-cell .product-thumb { order: 2; }
  .log-item { grid-template-columns: 1fr; gap: 4px; padding: 12px 14px; }
  .log-date { grid-row: 1; }
  .log-cat { justify-self: start; }
  .archive-admin-grid { grid-template-columns: 1fr; }
  .archive-admin-grid .span-2 { grid-column: auto; }
  .vision-admin-grid { grid-template-columns: 1fr; }
  .product-edit-grid { grid-template-columns: 1fr; }
  .image-uploader { min-height: 130px; }
  .customer-metrics { justify-content: space-between; gap: 9px; }
  .customer-metric b { font-size: 16px; }
  .quick-grid { grid-template-columns: 1fr 1fr; }
  .modal-backdrop { padding: 15px 10px 25px; align-items: flex-end; }
  .modal { max-height: 92vh; border-radius: 18px 18px 13px 13px; }
  .modal-head, .modal-body, .modal-foot { padding-left: 16px; padding-right: 16px; }
  .field-row, .field-row-3 { grid-template-columns: 1fr; }
  .toast-region { top: 10px; right: 10px; width: calc(100vw - 20px); }
  .pay-methods { grid-template-columns: 1fr; }
  .qr-pay { align-items: flex-start; }
  .qr-pay canvas { width: 110px !important; height: 110px !important; }
  .auth-notice { font-size: 10.5px; }
  .client-footer { padding-bottom: 75px; }
  .client-footer .container { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 430px) {
  .stat-card { padding: 10px; }
  .stat-ico { display: none; }
  .stat-card-top { font-size: 10px; }
  .hero h1 { font-size: 23px; }
  .hero-actions .btn { flex: 1; font-size: 11px; }
  .auth-form-panel { padding: 23px 16px 27px; }
  .auth-header .header-actions .btn:first-child { display: none; }
  .admin-sidebar .brand-name { font-size: 13px; }
  .admin-sidebar .brand-lockup { padding: 0 3px; }
  .admin-link { padding: 7px 6px; font-size: 9.5px; }
  .admin-link svg { display: none; }
  .profile-name { font-size: 17px; }
  .invite-panel .qr-area { width: 98px; height: 98px; }
}

/* Brand and admin sidebar text need block-level name/subtitle. */
.brand-lockup > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.brand-lockup .brand-name,
.brand-lockup .brand-sub {
  display: block;
  line-height: 1.25;
}
.brand-name + .brand-sub { margin-left: 0; }
.sidebar-brand .brand-sub {
  white-space: nowrap;
  letter-spacing: .14em;
}
.sidebar-user {
  margin-top: auto;
  padding: 14px 8px 4px;
  border-top: 1px solid rgba(146, 181, 224, .15);
  display: flex;
  align-items: center;
  gap: 9px;
  color: #d5e3f5;
}
.sidebar-user > span:last-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-user b {
  color: #fff;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user small { color: #819fc5; font-size: 9.5px; }

/* Production admin product table: keep art/image thumbs constrained. */
.admin-product-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}
.admin-product-thumb {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 11px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #f1f6fd;
}
.admin-product-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}
.admin-product-thumb svg {
  width: 40px;
  height: 40px;
  display: block;
}
.admin-product-cell b {
  display: block;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--ink);
}
.admin-product-cell small {
  display: block;
  margin-top: 3px;
  font-size: 10.5px;
  color: var(--muted);
}
.data-table td:first-child { min-width: 240px; }

/* table person cell */
.table-person { display: flex; align-items: center; gap: 9px; color: inherit; text-decoration: none; min-width: 0; }
.table-person > span { display: flex; flex-direction: column; min-width: 0; }
.table-person b { font-size: 12px; font-weight: 800; color: var(--ink); white-space: nowrap; }
.table-person small { margin-top: 2px; font-size: 10px; color: var(--muted); white-space: nowrap; }

@media (max-width: 640px) {
  .data-table td:first-child { display: block; text-align: left; }
  .data-table td:first-child::before { display: block; margin-bottom: 5px; }
  .table-person { justify-content: flex-start; }
}

@media (max-width: 900px) {
  .admin-sidebar { flex-wrap: wrap; overflow: visible; row-gap: 7px; }
  .admin-nav { order: 3; flex: 1 0 100%; width: 100%; padding-bottom: 1px; }
  .sidebar-user { margin-left: auto; }
}

.auth-header .brand-lockup > span:last-child,
.auth-brand .brand-lockup > span:last-child { display: flex; flex-direction: column; }
.auth-header .brand-name, .auth-brand .brand-name { line-height: 1.1; }
.auth-header .brand-sub, .auth-brand .brand-sub { margin-top: 2px; }

/* Device confirmation and device list */
.device-confirm-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid #dbe8f5;
  border-radius: 12px;
  background: #f7faff;
  color: var(--ink);
}
.device-confirm-box > svg { flex: none; color: var(--brand); margin-top: 1px; }
.device-confirm-box b { display: block; font-size: 13px; }
.device-confirm-box p { margin: 4px 0 0; font-size: 11.5px; line-height: 1.6; color: var(--muted); }
.device-list { display: flex; flex-direction: column; gap: 8px; }
.device-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border: 1px solid #e6edf5;
  border-radius: 11px;
  background: #fff;
}
.device-icon { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--brand-soft); color: var(--brand); }
.device-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.device-copy b { font-size: 12.5px; color: var(--ink); overflow-wrap: anywhere; }
.device-copy span { font-size: 10.5px; color: var(--muted); }
@media (max-width: 560px) {
  .device-item { align-items: flex-start; }
  .device-item .badge, .device-item .btn { flex: none; }
}

/* --------------------------------------------------------------------------
   v2.2 visual refinement
   A restrained optical-retail theme: deeper navy, clean white surfaces,
   soft blue light and clearer hierarchy. Layout is intentionally unchanged.
   -------------------------------------------------------------------------- */
:root {
  --bg: #f1f6fd;
  --bg-deep: #e6eef9;
  --surface: #ffffff;
  --surface-soft: #f7fafe;
  --ink: #0d1f3b;
  --ink-2: #314a6c;
  --muted: #697e99;
  --line: #dce7f4;
  --line-strong: #c7d8ea;
  --brand: #1f57c3;
  --brand-deep: #123b8f;
  --brand-dark: #123b8f;
  --brand-soft: #eaf2ff;
  --teal: #0e8f86;
  --text: #0d1f3b;
  --shadow: 0 26px 65px -38px rgba(15, 45, 94, .42);
  --shadow-sm: 0 14px 32px -24px rgba(15, 45, 94, .3);
}

body {
  background:
    radial-gradient(1100px 520px at 6% -8%, rgba(205, 225, 255, .78) 0%, transparent 62%),
    radial-gradient(820px 440px at 98% 2%, rgba(215, 244, 239, .7) 0%, transparent 58%),
    linear-gradient(180deg, #f7fbff 0%, var(--bg) 46%, #eef5fd 100%);
}

/* Authentication: framed product entrance, not a plain card on a page. */
.auth-page {
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(720px 430px at 7% 8%, rgba(185, 214, 255, .68), transparent 66%),
    radial-gradient(620px 420px at 100% 15%, rgba(201, 242, 234, .62), transparent 62%),
    linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
}
.auth-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(rgba(34, 84, 158, .1) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.55), transparent 78%);
}
.auth-header { height: 84px; }
.auth-main { padding: 14px 28px 54px; }
.auth-card {
  border-radius: 28px;
  border-color: rgba(190, 211, 236, .72);
  box-shadow:
    0 40px 100px -52px rgba(10, 36, 82, .55),
    0 8px 24px -16px rgba(20, 59, 116, .2);
}
.auth-visual {
  background:
    radial-gradient(560px 360px at 100% 0%, rgba(96, 168, 255, .34), transparent 60%),
    linear-gradient(148deg, #071a35 0%, #0d346b 48%, #1c5bb8 100%);
}
.auth-visual::before {
  border-color: rgba(185, 216, 255, .26);
  box-shadow: 0 0 90px rgba(75, 148, 255, .16);
}
.auth-visual h1 span { color: #a9cdff; text-shadow: 0 0 42px rgba(119, 180, 255, .25); }
.auth-form-panel { padding: 48px 50px; }
.auth-form-head h2 { letter-spacing: -.035em; }
.auth-tabs { background: #f4f8fe; border-color: #e2ebf6; }
.auth-tab.active { box-shadow: 0 5px 16px -8px rgba(28, 75, 147, .35); }
.auth-card.admin-auth .auth-visual {
  background:
    radial-gradient(460px 340px at 92% 0%, rgba(88, 160, 255, .24), transparent 65%),
    linear-gradient(155deg, #06172d, #0a284c 55%, #123f72);
}

/* Global controls: slightly firmer edges and calmer interaction states. */
.btn { border-radius: 11px; }
.btn-primary {
  background: linear-gradient(135deg, #2b67d9 0%, #1b4fb8 58%, #123f99 100%);
  border-color: rgba(255, 255, 255, .12);
  box-shadow: 0 10px 24px -12px rgba(22, 76, 173, .62);
}
.btn-primary:hover { box-shadow: 0 14px 28px -14px rgba(22, 76, 173, .72); }
.btn-ghost { background: rgba(255,255,255,.84); }
.input { background: #fdfefe; border-color: #cfdded; border-radius: 11px; }
.input:hover { border-color: #aec5df; }
.input:focus { border-color: #5b91e9; box-shadow: 0 0 0 4px rgba(42, 103, 214, .11); }
:focus-visible { outline-color: rgba(31, 87, 195, .42); }

/* Client shell and dashboard. */
.topbar {
  background: rgba(255, 255, 255, .88);
  border-bottom-color: rgba(199, 217, 236, .72);
  box-shadow: 0 12px 28px -28px rgba(12, 43, 91, .55);
}
.nav-link { font-weight: 700; }
.nav-link.active {
  background: linear-gradient(180deg, #edf4ff, #e3eeff);
  color: #1549a9;
  box-shadow: inset 0 0 0 1px rgba(191, 213, 244, .85);
}
.hero {
  border: 1px solid rgba(255,255,255,.1);
  background:
    radial-gradient(620px 340px at 102% -8%, rgba(116, 179, 255, .34), transparent 62%),
    linear-gradient(118deg, #09244b 0%, #124798 54%, #2b6dd5 100%);
  box-shadow: 0 32px 70px -38px rgba(10, 45, 105, .72);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.17) 1px, transparent 1px);
  background-size: 18px 18px;
  opacity: .24;
  mask-image: linear-gradient(100deg, #000, transparent 64%);
}
.hero h1 { text-shadow: 0 2px 24px rgba(3, 22, 52, .18); }
.invite-mini {
  background: rgba(255, 255, 255, .1);
  border-color: rgba(194, 218, 255, .28);
  backdrop-filter: blur(9px);
}
.stat-card {
  border-color: #e0eaf6;
  border-radius: 16px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.stat-card:hover { transform: translateY(-2px); border-color: #cbdcf0; box-shadow: 0 18px 34px -24px rgba(15, 45, 94, .42); }
.stat-ico { border-radius: 9px; background: linear-gradient(145deg, #edf4ff, #dcebff); }
.product-card { border-color: #e0eaf6; border-radius: 19px; }
.product-card:hover { transform: translateY(-4px); box-shadow: 0 24px 44px -30px rgba(15, 45, 94, .48); }
.product-media { background: linear-gradient(150deg, #f2f8ff, #e3effc); }
.product-body { padding: 18px 19px 19px; }
.product-buy { border-top-color: #eaf1f9; }
.panel, .rules-card, .archive-card, .profile-hero {
  border-color: #e0eaf6;
  box-shadow: var(--shadow-sm);
}
.panel-head h3, .section-head h2 { letter-spacing: -.03em; }
.data-table th { background: #f8fbff; color: #7087a2; }
.data-table tr:hover td { background: #f9fcff; }

/* Profile / invitation card. */
.profile-hero { border-radius: 21px; }
.invite-card, .invite-panel {
  background:
    radial-gradient(420px 290px at 104% 0%, rgba(93, 165, 255, .26), transparent 62%),
    linear-gradient(132deg, #09244b 0%, #124797 55%, #2869cd 100%);
  box-shadow: 0 28px 60px -36px rgba(10, 45, 105, .65);
}
.invite-card h2, .invite-panel h3 { letter-spacing: -.03em; }
.invite-qr { box-shadow: 0 12px 24px -18px rgba(0,0,0,.45); }

/* Admin shell: deeper navigation, warmer canvas, sharper data hierarchy. */
.admin-shell { background: #f3f7fd; }
.admin-sidebar {
  background:
    radial-gradient(360px 260px at 0% 0%, rgba(55, 124, 230, .16), transparent 65%),
    linear-gradient(180deg, #071a33 0%, #0a2446 56%, #0b2c54 100%);
  border-right: 1px solid rgba(124, 169, 226, .12);
  box-shadow: inset -1px 0 0 rgba(255,255,255,.03);
}
.admin-sidebar .brand-name { letter-spacing: .025em; }
.sidebar-note {
  background: rgba(99, 157, 232, .11);
  border-color: rgba(143, 185, 237, .18);
}
.admin-nav { gap: 4px; }
.admin-link {
  border: 1px solid transparent;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.admin-link.active {
  background: linear-gradient(90deg, rgba(63, 133, 240, .3), rgba(63, 133, 240, .07));
  border-color: rgba(118, 174, 255, .18);
  box-shadow: inset 3px 0 0 #78b5ff;
}
.admin-link:hover { border-color: rgba(118, 174, 255, .1); }
.admin-topbar {
  background: rgba(255, 255, 255, .86);
  border-bottom-color: rgba(204, 220, 238, .7);
  box-shadow: 0 12px 26px -30px rgba(12, 43, 91, .45);
}
.admin-page-head h1 { letter-spacing: -.035em; }
.metric-card {
  position: relative;
  overflow: hidden;
  border-color: #e1ebf6;
  border-radius: 15px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.metric-card::after {
  content: "";
  position: absolute;
  width: 110px;
  height: 110px;
  right: -48px;
  top: -58px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(74, 140, 238, .12), transparent 68%);
  pointer-events: none;
}
.metric-card > * { position: relative; z-index: 1; }
.metric-card:hover { transform: translateY(-2px); border-color: #cadcef; box-shadow: 0 16px 30px -24px rgba(15, 45, 94, .38); }
.metric-icon { width: 29px; height: 29px; border-radius: 9px; }
.metric-value { letter-spacing: -.045em; }
.admin-rate-banner {
  background:
    radial-gradient(360px 240px at 100% 0%, rgba(96, 166, 255, .24), transparent 64%),
    linear-gradient(132deg, #0d2a56, #154c9e);
  box-shadow: 0 20px 40px -30px rgba(8, 36, 80, .7);
}
.quick-link { background: #fbfdff; border-color: #e4eef8; }
.quick-link:hover { background: #f2f8ff; }
.customer-hero { border-color: #dde9f6; box-shadow: 0 14px 30px -26px rgba(15, 45, 94, .4); }
.data-table td { border-bottom-color: #edf3fa; }
.data-table th { border-color: #edf3fa; }

/* Badges, devices, dialogs. */
.badge { border: 1px solid transparent; }
.badge.good { border-color: #c8eedd; }
.badge.warn { border-color: #f2dfb8; }
.badge.danger { border-color: #f2cece; }
.badge.info { border-color: #d3e3fb; }
.badge.neutral { border-color: #e0e9f3; }
.device-item { border-color: #e3edf7; border-radius: 12px; transition: border-color .18s ease, background .18s ease; }
.device-item:hover { border-color: #cbdcf0; background: #fbfdff; }
.modal { border: 1px solid rgba(192, 211, 234, .6); }
.modal-head { background: linear-gradient(180deg, #fff, #fbfdff); }
.modal-backdrop { background: rgba(6, 21, 42, .5); }

@media (max-width: 900px) {
  .admin-sidebar {
    background: linear-gradient(180deg, #071a33, #0b2b52);
    box-shadow: 0 14px 30px -26px rgba(6, 24, 50, .8);
  }
  .admin-topbar { box-shadow: none; }
}
@media (max-width: 720px) {
  .auth-main { padding: 0 12px 28px; }
  .auth-card { border-radius: 22px; }
  .hero { border-radius: 20px; }
  .profile-hero { border-radius: 17px; }
  .invite-card { border-radius: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .stat-card, .product-card, .metric-card, .device-item { transition: none; }
}

/* Service footer and editable content preview */
.admin-content { padding-bottom: 54px; }
.admin-footer {
  position: fixed;
  right: 26px;
  bottom: 14px;
  z-index: 30;
  margin: 0;
  padding: 5px 8px;
  text-align: right;
  color: #94a3b8;
  font-size: 10px;
  line-height: 1.45;
  letter-spacing: .02em;
  background: rgba(248, 251, 255, .82);
  border: 0;
  border-radius: 5px;
  pointer-events: none;
}
.hero-perks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 17px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .15);
  color: rgba(237, 246, 255, .82);
  font-size: 11px;
}
.hero-perks span { display: inline-flex; align-items: center; gap: 6px; }
.hero-perks svg { width: 13px; height: 13px; opacity: .8; }
.content-preview .preview-hero {
  padding: 22px;
  border-radius: 16px;
  background: linear-gradient(145deg, #0c2450, #164a9b);
  color: #eef7ff;
  overflow: hidden;
}
.content-preview .preview-hero h3 {
  margin: 12px 0 9px;
  color: #fff;
  font-size: 25px;
  line-height: 1.35;
  font-weight: 800;
}
.content-preview .preview-hero p { margin: 0; color: rgba(230, 242, 255, .72); font-size: 12px; }
.content-preview .auth-eyebrow { color: #b7dcff; border-color: rgba(183, 220, 255, .28); }
.content-preview .hero-perks { border-top-color: rgba(255, 255, 255, .14); }
@media (max-width: 900px) {
  .admin-footer { right: 18px; bottom: 12px; }
}
@media (max-width: 560px) {
  .admin-footer { right: 14px; bottom: 10px; font-size: 9.5px; }
  .hero-perks { margin-top: 14px; gap: 7px 13px; font-size: 10.5px; }
}


/* v2.4 鍐呭璁剧疆锛氫粎淇濈暀浼氬憳鏉冪泭鏂囨锛涗慨姝ｇ獎灞忕鐞嗙妯悜婧㈠嚭 */
.preview-perks {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.preview-perks .muted { display: block; margin-bottom: 8px; font-size: 11px; }
@media (max-width: 900px) {
  .admin-sidebar { width: 100%; max-width: 100%; box-sizing: border-box; }
  .admin-nav { min-width: 0; }
}

/* v2.4 路 棣栭〉妗ｆ銆佸晢鍝佸簱瀛樹笌瀹氬悜鍙 */
.product-cat-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stock-note { font-size: 10px; color: #64748b; background: #f1f5f9; border-radius: 999px; padding: 3px 7px; white-space: nowrap; }
.stock-note.is-empty { color: #b91c1c; background: #fee2e2; }
.home-archive .archive-read-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.home-archive .archive-read-item b { font-size: 14px; }
.home-archive .archive-note p { margin: 0; }
.archive-panel .archive-form > .form-row:first-child { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.archive-panel .vision-edit-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.archive-panel .vision-group { min-width: 0; }
.archive-panel .archive-form > .field { margin-top: 4px; }
.target-picker { max-height: 190px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 6px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; background: #fbfdff; margin-top: 7px; }
.target-option { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 8px; cursor: pointer; border: 1px solid transparent; }
.target-option:hover { background: #f1f7ff; border-color: #dbeafe; }
.target-option input { width: 15px; height: 15px; accent-color: var(--brand); flex: none; }
.target-option span { display: flex; flex-direction: column; min-width: 0; }
.target-option b { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.target-option small { font-size: 10px; color: var(--muted); }
.preview-home-card { background: linear-gradient(135deg, #0b2d59, #174b9b 58%, #1d5fc4); color: #fff; border-radius: 18px; padding: 22px; min-height: 230px; display: flex; flex-direction: column; justify-content: center; }
.preview-home-card .hero-kicker { color: #9ec9ff; font-size: 9px; letter-spacing: .16em; font-weight: 800; }
.preview-home-card h3 { color: #fff; margin: 13px 0 9px; font-size: 24px; line-height: 1.18; }
.preview-home-card p { color: rgba(235, 246, 255, .76); font-size: 12px; line-height: 1.7; margin: 0 0 8px; }
.preview-home-card .preview-perks { border-top: 1px solid rgba(255, 255, 255, .14); padding-top: 10px; margin-top: 8px; }
.preview-home-card .hero-perks { border-top: 0; padding-top: 4px; margin: 0; }
.preview-home-card .hero-perks span { color: #dbeafe; }
.profile-hero .profile-stats { flex-wrap: wrap; justify-content: flex-end; gap: 16px 26px; max-width: 56%; }
.profile-hero .profile-stats .profile-stat b { font-size: 20px; }
@media (max-width: 900px) {
  .home-archive .archive-read-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .archive-panel .archive-form > .form-row:first-child { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .archive-panel .vision-edit-grid { grid-template-columns: 1fr; }
  .profile-hero .profile-stats { max-width: 100%; justify-content: flex-start; }
}
@media (max-width: 640px) {
  .target-picker { grid-template-columns: 1fr; }
  .home-archive .archive-read-grid { grid-template-columns: 1fr 1fr; }
  .archive-panel .archive-form > .form-row:first-child { grid-template-columns: 1fr; }
  .profile-hero .profile-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
}

.invite-mini-note { margin: 0 0 12px; color: rgba(226, 240, 255, .76); font-size: 11px; line-height: 1.6; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }


@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

/* v2.7 dashboard insights */
.dashboard-insight-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(270px, .8fr); gap: 18px; align-items: stretch; }
.dashboard-insight-grid .panel { margin: 0; overflow: hidden; }
.trend-bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; min-height: 180px; align-items: end; padding: 4px 2px 0; }
.trend-column { display: flex; flex-direction: column; align-items: center; gap: 7px; min-width: 0; }
.trend-value { min-height: 16px; color: #7183a0; font-size: 10px; white-space: nowrap; }
.trend-track { width: 100%; max-width: 34px; height: 112px; border-radius: 7px; background: #f0f5fb; display: flex; align-items: flex-end; overflow: hidden; }
.trend-track i { display: block; width: 100%; border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, #6da9ff, #2e6bd6); min-height: 3px; }
.trend-track i.is-empty { background: #dbe8f8; }
.trend-column small { color: #8b9bb4; font-size: 10px; white-space: nowrap; }
.trend-empty { min-height: 180px; display: grid; place-items: center; align-content: center; gap: 10px; color: #8b9bb4; font-size: 12px; }
.trend-empty svg { color: #aac7f0; }
.todo-list { display: flex; flex-direction: column; gap: 9px; }
.todo-item { display: grid; grid-template-columns: 28px 1fr auto 14px; align-items: center; gap: 9px; padding: 11px 12px; border: 1px solid #e7eff9; border-radius: 11px; color: #324d73; background: #fbfdff; font-size: 12px; }
.todo-item span { min-width: 0; }
.todo-item b { color: #142d52; font-size: 12px; }
.todo-item svg { color: #6c88ad; }
.todo-item:hover { border-color: #cfe0f5; background: #f6faff; }
.todo-empty { min-height: 125px; display: grid; place-items: center; align-content: center; gap: 8px; color: #8b9bb4; font-size: 12px; }
.todo-empty svg { color: #67b89a; }
@media (max-width: 820px) { .dashboard-insight-grid { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .trend-bars { gap: 6px; } .trend-track { max-width: 26px; } .trend-value { font-size: 9px; } }
.vision-edit-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 10px 0 16px; }
.vision-group { border: 1px solid #e5eef9; border-radius: 12px; padding: 11px 12px 12px; background: #fbfdff; min-width: 0; }
.vision-group h4 { margin: 0 0 8px; font-size: 12px; color: #3f5879; }
.vision-group .form-row { gap: 9px; }
.vision-group label { font-size: 10px; color: #8193ab; }
.vision-group .input { min-height: 38px; font-size: 12px; }

/* v2.8 archive action alignment */
.archive-panel .archive-form > .form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.archive-panel .archive-form > .form-actions .muted {
  min-width: 0;
  line-height: 1.55;
}
.archive-panel .archive-form > .form-actions .btn {
  flex: none;
  margin-left: auto;
}
@media (max-width: 640px) {
  .archive-panel .archive-form > .form-actions {
    align-items: flex-end;
    gap: 10px;
  }
  .archive-panel .archive-form > .form-actions .muted {
    max-width: 56%;
  }
}

/* v2.9 product push + simplified audit table */
.push-flag {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  color: #0b4aa2;
  box-shadow: 0 4px 12px rgba(17, 58, 112, .12);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .02em;
}
.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}
.push-product {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}
.push-product-art {
  width: 58px;
  height: 58px;
  flex: none;
  overflow: hidden;
  border-radius: 10px;
  background: #eef5ff;
}
.push-product-art img,
.push-product-art svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.push-product b { display: block; color: var(--ink); font-size: 14px; }
.push-product p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
@media (max-width: 640px) {
  .row-actions { justify-content: flex-start; }
  .push-product-art { width: 48px; height: 48px; }
}

/* v2.11 premium jade — restrained blue-green, deeper surfaces, finer hierarchy */
:root {
  --bg: #f2f8f5;
  --bg-deep: #e7f1ed;
  --surface: #ffffff;
  --surface-soft: #f7fbf9;
  --ink: #0c2b2e;
  --ink-2: #2c4a4e;
  --muted: #6d8386;
  --line: #dce9e4;
  --line-strong: #c7dcd5;
  --brand: #0f766e;
  --brand-deep: #084d48;
  --brand-dark: #073d39;
  --brand-soft: #e7f5f0;
  --teal: #2b9f8f;
  --gold: #b99b62;
  --good: #137a64;
  --warn: #a97728;
  --danger: #b64b46;
  --shadow: 0 30px 72px -42px rgba(4, 45, 41, .4);
  --shadow-sm: 0 14px 34px -26px rgba(4, 45, 41, .26);
  --text: #0c2b2e;
}
html { background: var(--bg); }
body {
  background:
    radial-gradient(1100px 520px at 5% -8%, rgba(178, 224, 211, .5) 0%, transparent 62%),
    radial-gradient(880px 480px at 101% 1%, rgba(194, 225, 220, .42) 0%, transparent 58%),
    linear-gradient(180deg, #f8fcfa 0%, var(--bg) 44%, #edf6f2 100%);
  color: var(--ink);
}
::selection { background: #bfe6db; color: #073d39; }

.logo-mark {
  background: linear-gradient(145deg, #169487 0%, #0b5d57 58%, #073d39 100%);
  border: 1px solid rgba(255,255,255,.24);
  box-shadow: 0 12px 28px -14px rgba(6, 67, 61, .7), inset 0 1px 0 rgba(255,255,255,.24);
}
.brand-name { color: var(--ink); letter-spacing: -.015em; }
.brand-sub { color: #7e9696; letter-spacing: .11em; }
.topbar {
  background: rgba(252, 255, 254, .9);
  border-bottom: 1px solid rgba(202, 222, 215, .78);
  box-shadow: 0 8px 30px -30px rgba(4, 45, 41, .5);
}
.nav-link { color: #617a7c; }
.nav-link:hover { color: var(--brand-deep); background: #f1f8f5; }
.nav-link.active { color: var(--brand-deep); background: var(--brand-soft); }
.nav-link.active svg { color: var(--brand); }
.topbar-user .user-chip { background: #f5faf8; border-color: #dce9e4; }

.btn-primary {
  background: linear-gradient(135deg, #118076 0%, #0b615a 100%);
  color: #fff;
  box-shadow: 0 12px 24px -14px rgba(7, 79, 71, .75), inset 0 1px 0 rgba(255,255,255,.18);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #159488 0%, #0b6c64 100%);
  box-shadow: 0 16px 30px -16px rgba(7, 79, 71, .8), inset 0 1px 0 rgba(255,255,255,.2);
}
.btn-ghost { border-color: #cfdfda; color: var(--ink-2); background: rgba(255,255,255,.6); }
.btn-ghost:hover { border-color: #a9c9c1; background: #f4faf7; color: var(--brand-deep); }
.btn-light { color: var(--brand-deep); background: #f2faf7; border-color: #d7e8e2; }
.btn-danger { background: #b64b46; }

.input, .select, textarea.input {
  border-color: #d3e2dd;
  background: #fcfefd;
  color: var(--ink);
}
.input:hover, .select:hover { border-color: #a8c9c1; }
.input:focus, .select:focus, textarea.input:focus {
  border-color: #2b9f8f;
  box-shadow: 0 0 0 4px rgba(43, 159, 143, .12);
  background: #fff;
}
.auth-tabs { background: #f3f9f7; border-color: #dce9e4; }
.auth-tab.active { background: #fff; color: var(--brand-deep); box-shadow: 0 4px 12px rgba(6, 54, 49, .08); }
.auth-kicker { color: var(--brand); }
.auth-form-panel { background: #fff; }
.auth-page {
  background:
    radial-gradient(720px 430px at 7% 8%, rgba(176, 221, 210, .45), transparent 66%),
    radial-gradient(620px 420px at 100% 15%, rgba(202, 230, 220, .38), transparent 62%),
    linear-gradient(180deg, #f9fcfa 0%, #eff7f3 100%);
}
.auth-page::before { background-image: radial-gradient(rgba(14, 105, 94, .1) 1px, transparent 1px); }
.auth-card {
  border-color: rgba(194, 218, 211, .8);
  box-shadow: 0 44px 100px -54px rgba(4, 48, 43, .5), 0 10px 26px -18px rgba(6, 55, 49, .16);
}
.auth-visual {
  background:
    radial-gradient(560px 380px at 100% 0%, rgba(50, 190, 164, .24), transparent 60%),
    radial-gradient(420px 320px at 5% 100%, rgba(197, 164, 103, .13), transparent 65%),
    linear-gradient(148deg, #061f24 0%, #0a3b3b 50%, #0e655c 100%);
}
.auth-visual::before { border-color: rgba(151, 225, 208, .23); }
.auth-visual::after { border-color: rgba(151, 225, 208, .14); }
.auth-eyebrow { color: #a9e2d3; border-color: rgba(163, 225, 211, .28); background: rgba(255,255,255,.035); }
.auth-visual h1 span { color: #b6eadb; text-shadow: 0 0 46px rgba(80, 210, 181, .22); }
.auth-visual-copy p { color: #c2ddd7; }
.auth-points li { color: #d8ebe6; }
.auth-points svg { color: #68cdb8; }
.auth-footnote { color: #89aaa6; }
.admin-auth .auth-visual {
  background:
    radial-gradient(560px 380px at 100% 0%, rgba(50, 190, 164, .18), transparent 60%),
    linear-gradient(155deg, #061d23, #082f33 52%, #0a4c48);
}

.hero {
  background:
    radial-gradient(520px 340px at 100% 0%, rgba(76, 192, 168, .22), transparent 62%),
    radial-gradient(420px 300px at 0% 110%, rgba(185, 155, 98, .12), transparent 64%),
    linear-gradient(132deg, #071f26 0%, #0a3639 48%, #0e625a 100%);
  border: 1px solid rgba(151, 220, 204, .18);
  box-shadow: 0 30px 62px -36px rgba(3, 43, 38, .58);
}
.hero::before { border-color: rgba(158, 226, 211, .19); }
.hero::after { border-color: rgba(158, 226, 211, .12); }
.hero-kicker { color: #a7dfd1; }
.hero-kicker::before { background: #6bd0b9; box-shadow: 0 0 0 4px rgba(107, 208, 185, .12); }
.hero h1 { color: #fff; text-shadow: 0 2px 30px rgba(0, 22, 20, .3); }
.hero p { color: #c4ded8; }
.hero .btn-primary { background: #f7fcfa; color: #0a4b45; box-shadow: 0 12px 24px -16px rgba(0,0,0,.4); }
.hero .btn-primary:hover { background: #fff; color: #073d39; }
.hero .btn-ghost { background: rgba(255,255,255,.075); border-color: rgba(191, 231, 220, .3); color: #eaf8f4; }
.hero .btn-ghost:hover { background: rgba(255,255,255,.13); border-color: rgba(191, 231, 220, .48); }
.hero-perks { color: #c7e3dc; }
.hero-perks svg { color: #79d3bf; }
.invite-mini {
  background: linear-gradient(155deg, rgba(5, 51, 52, .72), rgba(8, 74, 69, .46));
  border: 1px solid rgba(169, 227, 213, .2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.invite-mini-head { color: #9fd6c9; }
.invite-mini .invite-code-row code { color: #eafff9; }
.invite-mini-note { color: #a9cbc5; }

.card, .panel, .stat-card, .product-card, .order-card, .profile-hero,
.archive-card, .rules-card, .metric-card, .archive-panel {
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}
.panel { background: rgba(255,255,255,.94); }
.panel-head h3, .section-head h2, .admin-page-head h1 { color: var(--ink); letter-spacing: -.025em; }
.panel-head p, .admin-page-head p { color: var(--muted); }
.stat-card { background: linear-gradient(155deg, #fff, #fbfefc); }
.stat-card:hover { border-color: #bfd8d0; box-shadow: 0 18px 36px -26px rgba(4, 52, 45, .34); }
.stat-label, .stat-card-top { color: #6a8283; }
.stat-value b, .stat-value { color: var(--ink); }
.product-card { background: linear-gradient(160deg, #fff 60%, #fbfefc); }
.product-card:hover { border-color: #b9d7ce; box-shadow: 0 18px 38px -26px rgba(4, 56, 47, .34); }
.product-art { background: linear-gradient(145deg, #edf8f4, #e5f2ee); }
.product-price b { color: var(--brand-deep); }
.product-badge, .product-tag { background: #eef8f4; color: var(--brand-deep); border-color: #d1e9e1; }
.order-card { background: #fff; }
.order-card:hover { border-color: #c3dbd3; box-shadow: var(--shadow-sm); }

.profile-hero { background: linear-gradient(130deg, #fff 0%, #f8fcfa 65%, #f1f8f5 100%); }
.profile-hero .profile-name { color: var(--ink); }
.profile-stat b { color: var(--brand-deep); }
.profile-stat span { color: var(--muted); }
.invite-card {
  background:
    radial-gradient(430px 300px at 100% 0%, rgba(69, 193, 168, .2), transparent 62%),
    linear-gradient(142deg, #072326 0%, #093b3c 48%, #0d5c55 100%);
  border-color: rgba(154, 221, 207, .16);
  box-shadow: 0 24px 50px -34px rgba(4, 45, 40, .58);
}
.invite-card h3 { color: #fff; }
.invite-card p, .invite-card .muted { color: #b3d1cb; }
.archive-card, .archive-panel { background: linear-gradient(160deg, #fff, #fbfefc); }
.archive-section-title svg { color: var(--brand); }
.vision-block { background: #f6fbf9; border-color: #dfece7; }
.vision-block h4 { color: var(--ink-2); }

.data-table th {
  background: #f4faf7;
  color: #688082;
  border-color: #e4efeb;
  letter-spacing: .08em;
}
.data-table td { border-color: #edf5f1; color: var(--ink-2); }
.data-table tr:hover td { background: #f8fcfa; }
.data-table td:first-child { color: var(--ink); }
.badge.info { background: var(--brand-soft); color: var(--brand-deep); }
.badge.good { background: #e5f6ef; color: #0d6b57; }
.badge.warn { background: #fbf3e3; color: #8e6320; }
.badge.danger { background: #fbe9e7; color: #9e3733; }

.admin-sidebar {
  background:
    radial-gradient(360px 300px at 100% 0%, rgba(58, 171, 149, .12), transparent 62%),
    linear-gradient(180deg, #061e24 0%, #072b2e 48%, #083d39 100%);
  color: #c6dbd7;
  box-shadow: 22px 0 60px -56px rgba(0, 25, 22, .8);
}
.admin-sidebar .brand-sub { color: #799d98; }
.admin-sidebar .sidebar-env, .admin-sidebar .sidebar-note {
  background: rgba(255,255,255,.045);
  border-color: rgba(153, 213, 201, .16);
  color: #9fcbC1;
}
.admin-link { color: #9bb8b4; }
.admin-link:hover { background: rgba(255,255,255,.06); color: #eafff9; }
.admin-link.active {
  background: linear-gradient(90deg, rgba(42, 155, 136, .28), rgba(42, 155, 136, .08));
  color: #fff;
  box-shadow: inset 3px 0 0 #5bd1b9;
}
.admin-link.active svg { color: #7fe1cb; }
.admin-sidebar-foot { color: #7b9b97; border-color: rgba(151, 207, 195, .14); }
.admin-topbar {
  background: rgba(251, 254, 252, .88);
  border-bottom: 1px solid rgba(204, 224, 217, .8);
}
.admin-topbar .breadcrumb { color: #718889; }
.admin-content { color: var(--ink); }
.admin-page-head h1 { color: var(--ink); }
.metric-card { background: linear-gradient(155deg, #fff, #fbfefc); border-color: var(--line); }
.metric-card::before { background: linear-gradient(90deg, #0f766e, #76d0ba); }
.metric-icon { background: var(--brand-soft); color: var(--brand); }
.metric-value { color: var(--ink); }
.metric-note { color: var(--muted); }
.quick-link:hover { background: #f3faf6; border-color: #c9e1d9; }
.rule-banner { background: linear-gradient(140deg, #08282c, #0b4a45); }
.dashboard-insight-grid .panel { background: linear-gradient(160deg, #fff, #fbfefc); }

.modal-backdrop { background: rgba(4, 24, 22, .52); }
.modal {
  border: 1px solid rgba(206, 224, 218, .9);
  box-shadow: 0 34px 90px -40px rgba(3, 31, 27, .62);
}
.modal-head, .modal-foot { border-color: #e5efeb; }
.modal-close { background: #f2f9f6; color: #6d8584; }
.modal-close:hover { background: #e5f3ee; color: var(--brand-deep); }
.toast { border-color: #dcebe5; box-shadow: 0 18px 40px -24px rgba(3, 42, 36, .36); }

.client-footer { border-top-color: #dcebe5; color: #7c9393; }
.client-footer a { color: var(--brand-deep); }
.admin-footer { color: #8ba09e; }
.page-head h1 { color: var(--ink); }
.page-head p { color: var(--muted); }
.eyebrow, .section-kicker { color: var(--brand); }
.empty-state { color: var(--muted); }
.empty-state .empty-icon { background: var(--brand-soft); color: var(--brand); }

@media (max-width: 720px) {
  .client-nav { background: rgba(252,255,253,.97); border-top-color: #d8e9e3; }
  .nav-link.active { background: #eaf7f2; color: var(--brand-deep); }
  .hero { box-shadow: 0 22px 45px -30px rgba(3, 43, 38, .5); }
  .admin-sidebar {
    background:
      radial-gradient(300px 180px at 100% 0%, rgba(58, 171, 149, .15), transparent 64%),
      linear-gradient(180deg, #061e24, #083936);
  }
  .admin-topbar { background: rgba(252,255,253,.94); }
  .metric-card { box-shadow: 0 10px 22px -20px rgba(4, 52, 45, .3); }
}

/* v2.11b — rounded-out components that previously relied on legacy blue surfaces */
.rule-banner {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  padding: 22px 22px 21px;
  color: #fff;
  background:
    radial-gradient(360px 240px at 100% 0%, rgba(64, 190, 166, .2), transparent 64%),
    linear-gradient(140deg, #08282c 0%, #0a3b3b 55%, #0c5b53 100%);
  border: 1px solid rgba(141, 215, 199, .16);
  box-shadow: 0 18px 32px -28px rgba(4, 47, 42, .52);
}
.rule-banner > span {
  display: block;
  color: #9dd5c8;
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: .13em;
  font-weight: 800;
}
.rule-banner > b {
  display: block;
  margin: 8px 0 10px;
  color: #fff;
  font-size: 32px;
  line-height: 1;
  letter-spacing: -.04em;
}
.rule-banner > p {
  margin: 0 0 16px;
  max-width: 270px;
  color: #c3ded7;
  font-size: 11.5px;
  line-height: 1.7;
}
.rule-banner.small-banner { padding: 18px 20px; margin-bottom: 18px; }
.rule-banner.small-banner > b { font-size: 28px; margin-bottom: 7px; }
.rule-banner.small-banner > p { margin-bottom: 0; }
.rule-banner .btn-light {
  background: #f7fcfa;
  border-color: #f7fcfa;
  color: #084a44;
  box-shadow: 0 8px 18px -14px rgba(0,0,0,.4);
}
.rule-banner .btn-light:hover { background: #fff; color: #073d39; }

.preview-home-card {
  border: 1px solid rgba(151, 220, 204, .18);
  border-radius: 16px;
  padding: 22px 20px;
  color: #fff;
  background:
    radial-gradient(280px 210px at 100% 0%, rgba(76, 192, 168, .18), transparent 62%),
    linear-gradient(140deg, #07262c, #0a3d3c 58%, #0c5b53);
  box-shadow: 0 16px 26px -24px rgba(4, 45, 40, .42);
}
.preview-home-card h3 { color: #fff; font-size: 21px; line-height: 1.45; }
.preview-home-card .hero-kicker { color: #a6dfd1; }
.preview-home-card .muted { color: #b3d3cc !important; }
.preview-home-card .hero-perks { color: #c8e4dd; }
.preview-home-card .hero-perks svg { color: #7bd4c0; }
.preview-perks { margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(179, 226, 214, .2); }
.input-suffix {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.input-suffix > .input { flex: 1 1 auto; min-width: 0; }
.input-suffix > span {
  flex: 0 0 auto;
  min-width: 24px;
  color: var(--brand-deep);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

/* v2.12 — theme, points, activities, popup */
body {
  background:
    radial-gradient(1050px 460px at 8% -8%, color-mix(in srgb, var(--brand) 12%, white) 0%, transparent 64%),
    radial-gradient(820px 400px at 96% 4%, color-mix(in srgb, var(--accent) 12%, white) 0%, transparent 58%),
    var(--bg);
}
.logo-mark { background: linear-gradient(145deg, var(--brand), var(--brand-deep)); }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-deep)); box-shadow: 0 12px 24px -14px color-mix(in srgb, var(--brand) 55%, transparent); }
.admin-sidebar { background: linear-gradient(180deg, var(--brand-dark), #061c22 84%); }
.hero, .invite-card { background: linear-gradient(135deg, var(--brand-dark), var(--brand-deep) 62%, var(--brand) 125%); }
.rule-banner { background: linear-gradient(140deg, var(--brand-dark), var(--brand-deep) 58%, var(--brand) 140%); }
.preview-home-card { background: linear-gradient(140deg, var(--brand-dark), var(--brand-deep) 58%, var(--brand) 140%); }
.color-input { padding: 5px; height: 44px; cursor: pointer; }
.content-subhead { margin: 8px 0 2px; padding-top: 15px; border-top: 1px solid var(--line); }
.content-subhead h4 { font-size: 14px; color: var(--ink); }
.content-subhead p { margin-top: 3px; font-size: 11.5px; color: var(--muted); }
.check-row { display: flex; align-items: center; gap: 9px; min-height: 38px; color: var(--ink-2); font-size: 13px; }
.check-row input { width: 17px; height: 17px; accent-color: var(--brand); }
.client-popup-body { white-space: pre-wrap; color: var(--ink-2); font-size: 13.5px; line-height: 1.85; padding: 4px 0 8px; }
.points-panel .points-balance { display: flex; align-items: baseline; gap: 9px; margin: 3px 0 14px; }
.points-balance b { font-size: 36px; letter-spacing: -.04em; color: var(--brand-deep); line-height: 1; }
.points-balance span { color: var(--muted); font-size: 12px; }
.points-ledger { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.points-entry { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; background: var(--surface); }
.points-entry b { display: block; font-size: 13px; color: var(--brand-deep); }
.points-entry span { display: block; margin-top: 2px; color: var(--muted); font-size: 10.5px; }
.points-entry small { color: var(--muted); font-size: 10px; white-space: nowrap; }
.activity-list { display: grid; gap: 12px; }
.activity-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 16px; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--brand-soft) 28%, white); }
.activity-card h4 { margin: 7px 0 4px; font-size: 14px; }
.activity-card p { margin: 0; color: var(--muted); font-size: 11.5px; line-height: 1.65; }
.activity-card-foot { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: none; }
.activity-card-foot > span { display: inline-flex; align-items: center; gap: 4px; color: var(--accent-ink); font-size: 11.5px; font-weight: 750; white-space: nowrap; }
.activity-cell b { display: block; font-size: 12.5px; }
.activity-cell small { display: block; margin-top: 3px; color: var(--muted); font-size: 10.5px; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) {
  .activity-card { align-items: flex-start; flex-direction: column; gap: 11px; }
  .activity-card-foot { width: 100%; flex-direction: row; align-items: center; justify-content: space-between; }
  .points-entry { align-items: flex-start; }
  .content-subhead { margin-top: 4px; }
}

/* v2.12b — theme completion: every brand surface follows the admin palette */
.auth-page {
  background:
    radial-gradient(720px 430px at 7% 8%, color-mix(in srgb, var(--brand) 10%, transparent), transparent 66%),
    radial-gradient(620px 420px at 100% 15%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 62%),
    linear-gradient(180deg, #fbfefd 0%, #f1f8f5 100%);
}
.auth-page::before { background-image: radial-gradient(color-mix(in srgb, var(--brand) 16%, transparent) 1px, transparent 1px); }
.auth-visual {
  background:
    radial-gradient(560px 380px at 100% 0%, color-mix(in srgb, var(--brand) 28%, transparent), transparent 60%),
    radial-gradient(420px 320px at 5% 100%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 65%),
    linear-gradient(148deg, color-mix(in srgb, var(--brand-dark) 72%, #04181c), var(--brand-deep) 52%, var(--brand) 122%);
}
.admin-auth .auth-visual {
  background:
    radial-gradient(560px 380px at 100% 0%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 60%),
    linear-gradient(155deg, color-mix(in srgb, var(--brand-dark) 78%, #031416), var(--brand-dark) 52%, var(--brand-deep));
}
.auth-visual::before, .auth-visual::after { border-color: color-mix(in srgb, var(--brand) 30%, transparent); }
.auth-eyebrow { color: color-mix(in srgb, var(--brand) 28%, white); border-color: color-mix(in srgb, var(--brand) 35%, transparent); }
.auth-visual h1 span { color: color-mix(in srgb, var(--brand) 32%, white); text-shadow: 0 0 46px color-mix(in srgb, var(--brand) 30%, transparent); }
.auth-visual-copy p, .auth-points li { color: rgba(232, 247, 243, .82); }
.auth-points svg { color: color-mix(in srgb, var(--brand) 35%, white); }
.auth-footnote { color: rgba(210, 234, 228, .62); }
.auth-tabs { background: color-mix(in srgb, var(--brand) 5%, #fff); border-color: color-mix(in srgb, var(--brand) 12%, #dce9e4); }
.auth-tab.active { color: var(--brand-deep); }
.auth-kicker { color: var(--brand); }

.topbar, .admin-topbar {
  background: color-mix(in srgb, var(--brand) 4%, #fcfffe);
  border-bottom-color: color-mix(in srgb, var(--brand) 13%, #dce9e4);
}
.nav-link:hover { background: color-mix(in srgb, var(--brand) 7%, #fff); color: var(--brand-deep); }
.btn-primary:hover { background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 82%, white), var(--brand-deep)); }
.btn-ghost:hover { border-color: color-mix(in srgb, var(--brand) 30%, #cfdfda); background: color-mix(in srgb, var(--brand) 6%, #fff); color: var(--brand-deep); }
.btn-light { background: color-mix(in srgb, var(--brand) 7%, #fff); border-color: color-mix(in srgb, var(--brand) 14%, #d7e8e2); color: var(--brand-deep); }
.btn-light:hover { background: color-mix(in srgb, var(--brand) 13%, #fff); color: var(--brand-deep); }
.input:focus, .select:focus, textarea.input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 14%, transparent); }
.client-nav { background: color-mix(in srgb, var(--brand) 3%, #fcfffd); border-top-color: color-mix(in srgb, var(--brand) 12%, #d8e9e3); }
.nav-link.active { background: var(--brand-soft); color: var(--brand-deep); }

.admin-link.active {
  background: linear-gradient(90deg, color-mix(in srgb, var(--brand) 30%, transparent), color-mix(in srgb, var(--brand) 9%, transparent));
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--brand) 48%, white);
}
.admin-link.active svg { color: color-mix(in srgb, var(--brand) 42%, white); }
.admin-sidebar .brand-sub { color: rgba(198, 226, 220, .62); }
.admin-sidebar .sidebar-env, .admin-sidebar .sidebar-note { background: rgba(255,255,255,.045); border-color: rgba(190, 225, 217, .16); }
.metric-card::before { background: linear-gradient(90deg, var(--brand), color-mix(in srgb, var(--brand) 35%, white)); }

.hero-kicker { color: color-mix(in srgb, var(--brand) 28%, white); }
.hero-kicker::before { background: color-mix(in srgb, var(--brand) 42%, white); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
.hero p, .hero-perks { color: rgba(228, 246, 242, .82); }
.hero-perks svg { color: color-mix(in srgb, var(--brand) 35%, white); }
.hero .btn-primary { color: var(--brand-deep); }
.hero .btn-primary:hover { color: var(--brand-dark); }
.hero .btn-ghost { border-color: rgba(225, 246, 241, .32); }

.invite-card h3 { color: #fff; }
.invite-card p, .invite-card .muted { color: rgba(224, 243, 239, .78); }
.invite-card .invite-code-row code { color: #fff; }
.invite-card .invite-code-row { border-color: rgba(255,255,255,.26); background: rgba(255,255,255,.08); }
.invite-card .btn-light { color: var(--brand-deep); }

.rule-banner > span { color: color-mix(in srgb, var(--brand) 28%, white); }
.rule-banner > p { color: rgba(229, 246, 242, .78); }
.rule-banner .btn-light { background: #fff; border-color: #fff; color: var(--brand-deep); }
.rule-banner .btn-light:hover { background: #fff; color: var(--brand-dark); }
.preview-home-card .hero-kicker { color: color-mix(in srgb, var(--brand) 30%, white); }
.preview-home-card .muted, .preview-home-card .hero-perks { color: rgba(228, 246, 242, .8) !important; }
.preview-home-card .hero-perks svg { color: color-mix(in srgb, var(--brand) 35%, white); }

.data-table th { background: color-mix(in srgb, var(--brand) 4%, #f8fcfa); border-color: color-mix(in srgb, var(--brand) 8%, #e4efeb); }
.stat-card, .metric-card, .product-card, .archive-card, .archive-panel { background: linear-gradient(160deg, #fff, color-mix(in srgb, var(--brand) 2%, #fff)); }
.product-art { background: linear-gradient(145deg, color-mix(in srgb, var(--brand) 9%, #fff), color-mix(in srgb, var(--brand) 5%, #fff)); }
.product-badge, .product-tag { background: var(--brand-soft); color: var(--brand-deep); border-color: color-mix(in srgb, var(--brand) 16%, #d1e9e1); }
.badge.info { background: var(--brand-soft); color: var(--brand-deep); }
.vision-block { background: color-mix(in srgb, var(--brand) 3%, #fff); border-color: color-mix(in srgb, var(--brand) 10%, #dfece7); }
.vision-block h4 { background: color-mix(in srgb, var(--brand) 5%, #fff); border-color: color-mix(in srgb, var(--brand) 10%, #dfece7); color: var(--brand-deep); }
.points-balance b, .points-entry b { color: var(--brand-deep); }
.empty-state .empty-icon { background: var(--brand-soft); color: var(--brand); }

@media (max-width: 720px) {
  .admin-sidebar {
    background:
      radial-gradient(300px 180px at 100% 0%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 64%),
      linear-gradient(180deg, var(--brand-dark), color-mix(in srgb, var(--brand-deep) 72%, #031416));
  }
  .client-nav { background: color-mix(in srgb, var(--brand) 3%, #fcfffd); }
}

/* v2.12c footer: public site ICP/contact and small admin entry */
.auth-footer {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px 18px;
  flex-wrap: wrap;
  width: calc(100% - 56px);
  max-width: 1120px;
  margin: 0 auto;
  padding: 8px 0 22px;
  color: #748985;
  font-size: 10.5px;
  line-height: 1.7;
}
.auth-footer-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
.auth-footer-link {
  margin-left: auto;
  color: #6e817d;
  font-size: 10.5px;
  text-decoration: none;
  white-space: nowrap;
  transition: color .18s ease;
}
.auth-footer-link:hover { color: var(--brand-deep); text-decoration: underline; }
.footer-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  color: #849894;
}
.footer-phone { color: inherit; text-decoration: none; white-space: nowrap; }
.footer-phone:hover { color: var(--brand-deep); text-decoration: underline; }
.footer-phones { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 1px 4px; min-width: 0; }
.footer-phone-sep { color: #a7b8b4; white-space: pre; }
.footer-dot { color: #a7b8b4; }
.client-footer .footer-meta { font-size: 10.5px; }
.client-footer .footer-meta a { color: var(--brand-deep); }
.client-footer .footer-nav { margin-left: auto; }

@media (max-width: 720px) {
  .auth-footer { width: calc(100% - 32px); padding-bottom: 17px; gap: 7px 12px; }
  .auth-footer-info { flex-basis: 100%; }
  .auth-footer-link { margin-left: 0; }
  .client-footer .footer-meta { flex-basis: 100%; order: 3; }
  .client-footer .footer-nav { margin-left: 0; }
}

.auth-header-compact { height: 64px; justify-content: flex-end; }
@media (max-width: 720px) { .auth-header-compact { height: 56px; } }

/* v2.12b lottery & prize UI */
.activity-tags { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:8px; }
.activity-card.lottery-activity { border-color:rgba(199,154,75,.38); background:linear-gradient(180deg,rgba(255,250,238,.78),rgba(255,255,255,.96)); }
.prize-summary { max-width:230px; color:var(--muted); font-size:11px; line-height:1.65; }
.prize-list { display:grid; gap:9px; }
.prize-item { display:flex; align-items:center; gap:11px; padding:12px 13px; border:1px solid var(--line); border-radius:12px; background:var(--panel); }
.prize-icon { width:38px; height:38px; border-radius:11px; display:grid; place-items:center; flex:none; color:var(--brand); background:var(--brand-soft); }
.prize-copy { min-width:0; flex:1; display:flex; flex-direction:column; gap:3px; }
.prize-copy b { font-size:13px; }
.prize-copy span, .prize-copy small { color:var(--muted); font-size:11px; line-height:1.5; }
.prize-copy code, .lottery-code code { font-family:var(--mono); color:var(--brand-deep); background:var(--brand-soft); padding:1px 5px; border-radius:5px; }
.prize-action { display:flex; align-items:center; gap:8px; flex:none; }
.lottery-stage { text-align:center; padding:18px 8px 10px; position:relative; overflow:hidden; }
.lottery-glow { position:absolute; width:220px; height:220px; left:50%; top:45%; transform:translate(-50%,-50%); border-radius:50%; background:radial-gradient(circle,rgba(199,154,75,.22),transparent 68%); pointer-events:none; }
.lottery-reel { position:relative; margin:0 auto 9px; max-width:420px; min-height:86px; display:flex; align-items:center; justify-content:center; border:1px solid rgba(199,154,75,.45); border-radius:17px; background:linear-gradient(145deg,#08282c,#0d5149); color:#eafff9; box-shadow:inset 0 0 24px rgba(0,0,0,.22); font-size:27px; font-weight:800; letter-spacing:.02em; padding:12px 20px; }
.lottery-hint { color:var(--muted); font-size:11px; }
.lottery-result { text-align:center; padding:8px 4px 15px; }
.lottery-result-icon { width:58px; height:58px; margin:0 auto 10px; border-radius:18px; display:grid; place-items:center; color:#8a5a15; background:linear-gradient(145deg,#fff3d5,#f7dfad); }
.lottery-result-kicker { color:var(--muted); font-size:10px; letter-spacing:.12em; text-transform:uppercase; margin:0 0 4px; }
.lottery-result h4 { font-size:23px; margin:0 0 9px; }
.lottery-result p { color:var(--muted); font-size:12px; line-height:1.8; margin:0 auto 9px; max-width:390px; }
.lottery-code { display:inline-flex; align-items:center; gap:5px; font-size:11px; color:var(--muted); margin-bottom:12px; }
.prize-edit-list { display:grid; gap:9px; margin-top:9px; }
.prize-edit-row { display:grid; grid-template-columns:1.4fr .9fr .75fr .75fr .75fr auto; gap:8px; align-items:end; padding:10px; border:1px solid var(--line); border-radius:11px; background:var(--panel); }
.prize-edit-row label { display:flex; flex-direction:column; gap:4px; font-size:10px; color:var(--muted); }
.prize-edit-row label .input { min-height:34px; padding:6px 8px; font-size:12px; }
.prize-edit-row .btn { min-height:34px; }
.panel-head.compact { align-items:flex-start; gap:10px; }
.panel-head.compact h4 { margin:0 0 3px; }
.panel-head.compact p { margin:0; }
@media (max-width: 900px) { .prize-edit-row { grid-template-columns:1fr 1fr; } .prize-edit-row .btn { grid-column:1/-1; } }
@media (max-width: 640px) { .prize-item { align-items:flex-start; flex-wrap:wrap; } .prize-action { width:100%; justify-content:flex-end; } .lottery-reel { font-size:22px; min-height:74px; } }

/* v2.13 multi-profile eye exams */
.profiles-toolbar { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:16px; padding:14px 16px; border:1px solid var(--line); border-radius:16px; background:var(--surface-soft); }
.profiles-toolbar b { display:block; font-size:13px; color:var(--ink); }
.profiles-toolbar p { margin:4px 0 0; }
.profile-read-list, .profile-admin-list { display:flex; flex-direction:column; gap:16px; }
.patient-profile-read, .patient-profile-admin { border:1px solid var(--line); border-radius:18px; background:var(--surface); overflow:hidden; }
.patient-profile-head { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; padding:16px 18px; border-bottom:1px solid var(--line); }
.patient-profile-head h4 { margin:0; font-size:16px; color:var(--ink); display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.patient-profile-head p { margin:5px 0 0; font-size:11px; color:var(--muted); line-height:1.6; }
.patient-profile-read .patient-profile-head { background:linear-gradient(180deg,color-mix(in srgb,var(--brand) 5%,#fff),#fff); }
.profile-exam-summary { display:grid; grid-template-columns:repeat(4,1fr); gap:0; }
.profile-exam-summary > div { padding:13px 16px; border-right:1px solid var(--line); }
.profile-exam-summary > div:last-child { border-right:0; }
.profile-exam-summary span { display:block; font-size:10px; color:var(--muted); }
.profile-exam-summary b { display:block; margin-top:4px; font-size:12px; color:var(--ink); }
.exam-current { padding:16px 18px; }
.exam-read-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.exam-read-block { border:1px solid var(--line); border-radius:14px; padding:12px 14px; background:var(--surface-soft); min-width:0; }
.exam-read-block h5 { margin:0 0 8px; font-size:11px; color:var(--brand-deep); letter-spacing:.06em; }
.exam-read-row { display:grid; grid-template-columns:minmax(86px,1fr) 1fr 1fr; gap:8px; align-items:baseline; padding:5px 0; border-bottom:1px dashed var(--line); font-size:11px; }
.exam-read-row:last-child { border-bottom:0; }
.exam-read-row .exam-label { color:var(--muted); }
.exam-read-row b { color:var(--ink); font-weight:650; }
.exam-history { margin:0 18px 16px; padding-top:12px; border-top:1px solid var(--line); }
.exam-history > summary { cursor:pointer; color:var(--brand-deep); font-size:12px; font-weight:700; }
.exam-history-item { margin-top:12px; padding:12px; border:1px solid var(--line); border-radius:14px; background:var(--surface-soft); }
.exam-history-head { display:flex; justify-content:space-between; gap:12px; margin-bottom:8px; font-size:11px; color:var(--muted); }
.exam-history-head b { color:var(--ink); }
.profile-admin-list .patient-profile-admin { box-shadow:0 8px 24px rgba(15,43,48,.04); }
.profile-admin-list .patient-profile-head { background:var(--surface-soft); }
.exam-form .form-row { grid-template-columns:1fr 1fr; }
.exam-edit-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px 12px; margin-bottom:16px; }
.exam-edit-field { min-width:0; margin:0; }
.exam-edit-field label { font-size:11px; }
.exam-edit-field label small { margin-left:4px; color:var(--muted); font-weight:400; }
.exam-edit-field .input { height:38px; font-size:12px; }
.archive-section-title { margin:18px 0 10px; }
@media (max-width:900px) {
  .profile-exam-summary { grid-template-columns:1fr 1fr; }
  .profile-exam-summary > div:nth-child(2) { border-right:0; }
  .profile-exam-summary > div:nth-child(-n+2) { border-bottom:1px solid var(--line); }
  .exam-read-grid { grid-template-columns:1fr; }
  .exam-edit-grid { grid-template-columns:1fr 1fr; }
}
@media (max-width:640px) {
  .profiles-toolbar { flex-direction:column; }
  .profiles-toolbar .btn { width:100%; }
  .patient-profile-head { flex-direction:column; }
  .patient-profile-head .row-actions { width:100%; flex-wrap:wrap; }
  .patient-profile-head .row-actions .btn { flex:1; }
  .profile-exam-summary { grid-template-columns:1fr; }
  .profile-exam-summary > div { border-right:0; border-bottom:1px solid var(--line); }
  .profile-exam-summary > div:last-child { border-bottom:0; }
  .exam-current { padding:12px; }
  .exam-read-row { grid-template-columns:minmax(74px,1fr) 1fr 1fr; gap:6px; font-size:10.5px; }
  .exam-history { margin:0 12px 12px; }
  .exam-edit-grid, .exam-form .form-row { grid-template-columns:1fr; }
  .exam-history-head { flex-direction:column; gap:2px; }
}

/* v2.14 checkout and coupons */
.checkout-layout { display:grid; grid-template-columns:minmax(0,1.65fr) minmax(280px,.75fr); gap:20px; align-items:start; }
.checkout-card { padding:24px; }
.checkout-order { display:flex; justify-content:space-between; gap:18px; align-items:flex-start; padding-bottom:18px; margin-bottom:20px; border-bottom:1px solid var(--line); }
.checkout-order h3 { margin:5px 0 4px; font-size:20px; }
.pay-amount { color:var(--brand-strong); font-size:27px; letter-spacing:-.04em; white-space:nowrap; }
.pay-method-block { margin-top:2px; }
.pay-methods { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:8px; }
.pay-method { display:flex; align-items:flex-start; gap:9px; border:1px solid var(--line); border-radius:12px; padding:12px; cursor:pointer; background:var(--surface); transition:border-color .18s,background .18s; }
.pay-method:has(input:checked) { border-color:var(--brand); background:var(--brand-soft); }
.pay-method.disabled { opacity:.5; cursor:not-allowed; }
.pay-method input { margin-top:3px; accent-color:var(--brand); }
.pay-method span { display:flex; flex-direction:column; gap:3px; }
.pay-method b { font-size:12.5px; }
.pay-method small { color:var(--muted); font-size:10.5px; line-height:1.4; }
.payment-unavailable { grid-column:1/-1; padding:12px; border-radius:10px; background:#fff7e6; color:#8a5c15; font-size:11px; display:flex; gap:6px; align-items:flex-start; }
.account-funds-row { display:flex; gap:10px; align-items:flex-start; padding:13px; border:1px solid var(--line); border-radius:12px; cursor:pointer; background:var(--soft); }
.account-funds-row input { margin-top:3px; accent-color:var(--brand); }
.account-funds-row span { display:flex; flex-direction:column; gap:3px; }
.account-funds-row b { font-size:12.5px; }
.account-funds-row small { color:var(--muted); font-size:10.5px; line-height:1.5; }
.checkout-summary { margin-top:8px; padding:16px; border-radius:12px; background:var(--soft); display:flex; flex-direction:column; gap:9px; }
.checkout-summary > div { display:flex; justify-content:space-between; gap:12px; color:var(--muted); font-size:12px; }
.checkout-summary b { color:var(--ink); }
.checkout-due { border-top:1px solid var(--line); padding-top:10px; margin-top:2px; align-items:baseline; }
.checkout-due span { color:var(--ink); font-weight:700; }
.checkout-due strong { color:var(--brand-strong); font-size:24px; letter-spacing:-.03em; }
.checkout-note { padding:22px; }
.checkout-note h3 { margin:5px 0 12px; }
.checkout-note p { color:var(--muted); font-size:11.5px; line-height:1.75; margin:0 0 10px; }
.checkout-note .text-link { margin-top:6px; display:inline-flex; }
.payment-result { text-align:center; padding:45px 22px; }
.payment-result .result-icon { width:52px; height:52px; border-radius:50%; display:grid; place-items:center; margin:0 auto 12px; background:var(--brand-soft); color:var(--brand-strong); }
.payment-result h3 { margin:0 0 8px; font-size:22px; }
.payment-result p { color:var(--muted); margin:0 0 20px; }
@media (max-width:900px) { .checkout-layout { grid-template-columns:1fr; } .checkout-note { order:2; } }
@media (max-width:640px) { .checkout-card { padding:17px; } .pay-methods { grid-template-columns:1fr; } .checkout-order { flex-direction:column; } .pay-amount { font-size:24px; } .checkout-summary { padding:13px; } }

.records-entry { display:flex; align-items:center; justify-content:space-between; gap:18px; padding:18px 20px; border:1px solid var(--line); border-radius:14px; background:linear-gradient(135deg,rgba(255,255,255,.96),rgba(240,249,247,.82)); }
.records-entry b { display:block; font-size:14px; color:var(--ink); }
.records-entry p { margin:6px 0 0; font-size:12px; color:var(--muted); line-height:1.7; }
.records-entry .btn { flex:none; }
.exam-pair-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.exam-pair { border:1px solid var(--line); border-radius:12px; padding:11px 12px 12px; background:rgba(255,255,255,.72); }
.exam-pair-head { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:8px; color:var(--ink); font-size:12px; font-weight:700; }
.exam-pair-head small { color:var(--muted); font-size:10px; font-weight:500; }
.exam-pair-inputs { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
.exam-eye { display:flex; flex-direction:column; gap:4px; min-width:0; }
.exam-eye span { font-size:10px; color:var(--muted); }
.exam-eye .input { padding:8px 9px; font-size:12px; min-width:0; }
@media (max-width:760px){
  .records-entry { align-items:flex-start; flex-direction:column; }
  .records-entry .btn { width:100%; justify-content:center; }
  .exam-pair-grid { grid-template-columns:1fr; }
  .exam-pair-inputs { gap:8px; }
}
/* v2.15 profile workbench */
.profile-workbench { display:grid; grid-template-columns:minmax(0,1.08fr) minmax(0,.92fr); gap:18px; align-items:start; }
.profile-workbench .profile-main, .profile-workbench .profile-side { display:grid; gap:16px; min-width:0; }
.profile-workbench .invite-card { min-height:100%; }
.profile-shortcuts { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; align-items:stretch; }
.profile-shortcuts > .panel { height:100%; min-width:0; }
.profile-shortcuts .panel-head { align-items:flex-start; gap:10px; }
.profile-shortcuts .panel-head > div { min-width:0; }
.profile-order-list { display:grid; gap:0; }
.profile-order-row { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 0; border-bottom:1px solid var(--line); text-decoration:none; color:var(--ink); }
.profile-order-row:last-child { border-bottom:0; padding-bottom:0; }
.profile-order-row:first-child { padding-top:0; }
.profile-order-row:hover b { color:var(--brand); }
.profile-order-row > div { min-width:0; display:grid; gap:3px; }
.profile-order-row b { font-size:12px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; transition:color .16s ease; }
.profile-order-row span { font-size:10px; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.profile-order-row strong { font-size:13px; color:var(--ink); flex:none; }
.profile-more { display:inline-flex; align-items:center; gap:5px; margin-top:12px; font-size:11px; font-weight:700; color:var(--brand); text-decoration:none; }
.profile-expand { margin-top:12px; border-top:1px solid var(--line); padding-top:8px; }
.profile-expand summary { cursor:pointer; list-style:none; font-size:11px; color:var(--brand); font-weight:700; }
.profile-expand summary::-webkit-details-marker { display:none; }
.profile-expand summary:after { content:' +'; }
.profile-expand[open] summary:after { content:' −'; }
.profile-expand .card-list { margin-top:8px; }
.profile-shortcuts .records-entry { flex-direction:column; align-items:flex-start; gap:12px; }
.profile-shortcuts .records-entry .btn { margin-top:2px; }
.profile-shortcuts .empty-state { padding:22px 8px; }
@media (max-width: 1180px) {
  .profile-workbench { grid-template-columns:1fr; }
  .profile-workbench .invite-card { min-height:0; }
  .profile-shortcuts { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .profile-shortcuts { grid-template-columns:1fr; }
  .profile-workbench { gap:14px; }
}

/* Empty exam note: keep it on the card's right edge for both client/admin views. */
.patient-profile-read > .profile-empty-exam,
.patient-profile-admin > .profile-empty-exam {
  display: flex;
  justify-content: flex-end;
  width: 100%;
  margin: 0;
  padding: 12px 2px 2px;
  text-align: right;
}
@media (max-width: 640px) {
  .patient-profile-read > .profile-empty-exam,
  .patient-profile-admin > .profile-empty-exam {
    padding-right: 0;
    font-size: 11px;
  }
}
/* v2.16 profile bottom: equal activity/prize columns */
.profile-bottom { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; align-items:stretch; }
.profile-bottom > .panel { height:100%; min-width:0; }
@media (max-width: 900px) {
  .profile-bottom { grid-template-columns:1fr; gap:14px; }
}
/* v2.17 profile subpages */
.profile-tabs { display:flex; gap:6px; max-width:100%; margin-top:18px; padding:6px; overflow-x:auto; border:1px solid var(--line); border-radius:16px; background:#fff; box-shadow:var(--shadow-sm); scrollbar-width:thin; }
.profile-tab { display:inline-flex; align-items:center; gap:7px; flex:none; padding:10px 15px; border-radius:11px; color:var(--muted); font-size:12px; font-weight:700; text-decoration:none; white-space:nowrap; transition:background .16s ease, color .16s ease; }
.profile-tab:hover { color:var(--brand-deep); background:var(--brand-soft); }
.profile-tab.active { color:#fff; background:linear-gradient(135deg,var(--brand-dark),var(--brand)); box-shadow:0 8px 18px -12px rgba(12,74,68,.7); }
.profile-tab svg { flex:none; }
.profile-subpage { display:grid; gap:18px; max-width:1020px; margin-left:auto; margin-right:auto; }
.profile-subpage > .panel { min-width:0; }
.profile-invite-page { max-width:none; }
.profile-invite-card { display:flex; flex-direction:column; justify-content:center; min-height:520px; padding:36px 40px; }
.profile-invite-card h2 { font-size:29px; margin-top:18px; }
.profile-invite-card .invite-code-row { margin-top:14px; }
.profile-invite-card .invite-code { font-size:30px; }
.profile-invite-card .invite-link { max-width:none; margin-top:14px; }
.profile-invite-card .invite-card-actions { margin-top:16px; }
.invite-page-grid { display:grid; grid-template-columns:minmax(0,1fr) 300px; gap:44px; align-items:center; margin-top:22px; }
.invite-page-copy { min-width:0; }
.invite-page-copy p { max-width:none; }
.invite-page-qr { display:grid; justify-items:center; gap:12px; min-width:0; }
.profile-invite-page .invite-qr { width:240px !important; height:240px !important; margin:0; padding:10px; }
.profile-invite-page .invite-qr-note { margin:0; text-align:center; }
@media (max-width: 900px) {
  .profile-tabs { border-radius:14px; }
  .profile-invite-card { min-height:0; padding:24px; }
  .profile-invite-card h2 { font-size:24px; }
  .profile-invite-card .invite-code { font-size:26px; }
  .invite-page-grid { grid-template-columns:1fr; gap:20px; align-items:start; }
  .invite-page-qr { justify-items:start; }
  .profile-invite-page .invite-qr { width:190px !important; height:190px !important; }
}
@media (max-width: 640px) {
  .profile-tabs { margin-top:14px; padding:5px; }
  .profile-tab { padding:9px 12px; font-size:11px; }
  .profile-subpage { gap:14px; }
  .profile-invite-card { padding:20px; }
  .profile-invite-card .invite-code-row { align-items:flex-start; flex-direction:column; }
}

/* v2.18 auth flow: login register button + register slogan */
.auth-register {
  display: grid;
  gap: 10px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  text-align: center;
}
.auth-register-label { color: var(--muted); font-size: 12.5px; }
.auth-register-btn {
  min-height: 46px;
  border: 1.5px solid #c79b57;
  background: #fffaf0;
  color: #835615;
  box-shadow: none;
  font-weight: 800;
}
.auth-register-btn:hover {
  transform: none;
  border-color: #a97728;
  background: #fff3d9;
  color: #6c4508;
  box-shadow: none;
}
.auth-register-invite { color: var(--muted); font-size: 11.5px; word-break: break-all; }

.auth-card.register-auth .auth-visual-copy {
  margin-top: 0;
  padding-top: 44px;
}
.auth-card.register-auth .auth-visual h1 {
  margin: 16px 0 18px;
  font-size: clamp(48px, 4.75vw, 64px);
  line-height: 1.02;
}
@media (max-width: 900px) {
  .auth-card.register-auth .auth-visual-copy { padding-top: 28px; }
  .auth-card.register-auth .auth-visual h1 { font-size: 38px; margin: 12px 0 12px; }
}
@media (max-width: 720px) {
  .auth-register { margin-top: 16px; padding-top: 15px; }
  .auth-register-btn { min-height: 44px; }
}

/* v2.19 — auth visual: centered slogan, quieter premium detail */
.auth-visual {
  padding: 46px 48px;
}
.auth-visual-copy {
  margin: auto 0;
  padding-top: 0;
  max-width: 430px;
}
.auth-visual-copy::before {
  content: "";
  display: block;
  width: 54px;
  height: 1px;
  margin-bottom: 20px;
  background: linear-gradient(90deg, rgba(226, 197, 143, .95), rgba(226, 197, 143, 0));
}
.auth-eyebrow {
  background: rgba(255, 255, 255, .045);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}
.auth-visual h1 {
  margin: 20px 0 16px;
  line-height: 1.05;
  letter-spacing: -.055em;
  font-weight: 800;
  text-wrap: balance;
}
.auth-visual-copy p {
  max-width: 360px;
  line-height: 1.85;
  margin-bottom: 0;
}
.auth-footnote {
  margin-top: 0;
  padding-top: 28px;
}
.auth-card.register-auth .auth-visual-copy {
  margin: auto 0;
  padding-top: 0;
}
.auth-card.register-auth .auth-visual-copy::before {
  width: 64px;
}
.auth-card.register-auth .auth-visual h1 {
  margin: 18px 0 20px;
  font-size: clamp(50px, 4.75vw, 64px);
  line-height: 1.01;
}
@media (max-width: 900px) {
  .auth-visual {
    padding: 30px 32px;
  }
  .auth-visual-copy {
    padding-top: 0;
  }
  .auth-card.register-auth .auth-visual-copy {
    padding-top: 0;
  }
  .auth-visual-copy::before {
    margin-bottom: 14px;
  }
  .auth-footnote {
    padding-top: 20px;
  }
  .auth-card.register-auth .auth-visual h1 {
    margin: 12px 0 12px;
    font-size: 38px;
  }
}

/* v2.20 lottery weight / guarantee editor */
.prize-edit-row .prize-pct { margin-top:2px; color:var(--brand-600); font-size:9px; letter-spacing:.04em; }
@media (max-width: 640px) {
  .prize-edit-row { grid-template-columns:1fr 1fr; }
  .prize-edit-row label:first-of-type { grid-column:1 / -1; }
  .prize-edit-row .btn { grid-column:1 / -1; justify-content:center; }
}

/* v2.20 lottery no-win / guarantee */
.activity-card .activity-rule { margin:6px 0 0; color:var(--brand-700); font-size:11.5px; }
.lottery-result-miss .lottery-result-icon { background:#f1f5f4; color:var(--muted); }
.lottery-result-miss h4 { color:var(--ink); }

/* v2.21 coupon audience selector */
.coupon-audience-options {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 4px 0 2px;
}
.coupon-audience-options label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 12px;
  cursor: pointer;
}
.coupon-customer-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  max-height: 190px;
  overflow: auto;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbfa;
}
.coupon-customer-list.hidden { display: none; }
.coupon-customer-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px;
  border-radius: 8px;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
}
.coupon-customer-option:hover { background: #fff; }
.coupon-customer-option input { margin-top: 2px; }
.coupon-customer-option span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.coupon-customer-option small { color: var(--muted); font-size: 10px; }
@media (max-width: 640px) {
  .coupon-customer-list { grid-template-columns: 1fr; }
}

/* Refined DesC wordmark */
.logo-wordmark {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  flex: 0 0 auto;
  height: 30px;
  line-height: 0;
}
.logo-wordmark img {
  display: block;
  height: 100%;
  width: auto;
  object-fit: contain;
}
.logo-wordmark.logo-lg { height: 34px; }
.logo-wordmark.logo-lg img { height: 34px; width: auto; }
.logo-wordmark.logo-md { height: 28px; }
.logo-wordmark.logo-md img { height: 28px; width: auto; }
.logo-wordmark.logo-sm { height: 24px; }
.logo-wordmark.logo-sm img { height: 24px; width: auto; }
.brand-lockup.on-dark .logo-wordmark img {
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .35));
}
@media (max-width: 900px) {
  .logo-wordmark.logo-lg { height: 30px; }
  .logo-wordmark.logo-lg img { height: 30px; }
  .logo-wordmark.logo-md { height: 25px; }
  .logo-wordmark.logo-md img { height: 25px; }
}
@media (max-width: 480px) {
  .logo-wordmark.logo-md { height: 23px; }
  .logo-wordmark.logo-md img { height: 23px; }
  .logo-wordmark.logo-sm { height: 22px; }
  .logo-wordmark.logo-sm img { height: 22px; }
}

/* Explicit intrinsic widths for the wordmark: avoids a 0-width flex parent collapsing the image. */
.logo-wordmark.logo-lg img { width: 71px; }
.logo-wordmark.logo-md img { width: 59px; }
.logo-wordmark.logo-sm img { width: 50px; }
@media (max-width: 900px) {
  .logo-wordmark.logo-lg img { width: 63px; }
  .logo-wordmark.logo-md img { width: 52px; }
}
@media (max-width: 480px) {
  .logo-wordmark.logo-md img { width: 48px; }
  .logo-wordmark.logo-sm img { width: 46px; }
}
/* Lock the wordmark box itself: the header flex context can otherwise collapse it to 0. */
.logo-wordmark { width: max-content; }
.logo-wordmark img { max-width: none; }
.logo-wordmark.logo-lg { width: 71px; }
.logo-wordmark.logo-md { width: 59px; }
.logo-wordmark.logo-sm { width: 50px; }
@media (max-width: 900px) {
  .logo-wordmark.logo-lg { width: 63px; }
  .logo-wordmark.logo-md { width: 52px; }
}
@media (max-width: 480px) {
  .logo-wordmark.logo-md { width: 48px; }
  .logo-wordmark.logo-sm { width: 46px; }
}

/* Dark logo is the default; use a warm light plate only on dark surfaces. */
.logo-wordmark.is-on-dark {
  height: auto;
  padding: 4px 7px;
  background: #f8f4ea;
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .18);
}
.logo-wordmark.logo-sm.is-on-dark { padding: 2px 5px; border-radius: 6px; }

/* Dark logo plate refinement: a quiet warm badge on dark surfaces. */
.logo-wordmark.is-on-dark {
  padding: 5px 9px;
  background: linear-gradient(180deg, #fbf7ee 0%, #f3eddf 100%);
  border: 0;
  border-radius: 11px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
  margin-right: 2px;
}
.logo-wordmark.logo-sm.is-on-dark {
  padding: 3px 6px;
  border-radius: 7px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .16);
}

/* The plate must size from its content, not the fixed wordmark width. */
.logo-wordmark.is-on-dark {
  width: auto;
  box-sizing: content-box;
}

/* v2.22 invite relationship tree */
.invite-tree,
.invite-tree ul { list-style: none; margin: 0; padding: 0; }
.invite-tree { display: grid; gap: 8px; min-width: 0; }
.invite-tree ul {
  display: grid;
  gap: 8px;
  margin: 8px 0 0 22px;
  padding-left: 18px;
  border-left: 1px solid #d6e8e2;
}
.invite-tree li { min-width: 0; }
.tree-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #e2efeb;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 7px rgba(16, 66, 58, .035);
}
.invite-tree > li > .tree-row {
  background: linear-gradient(180deg, #fbfefd 0%, #f5fbf8 100%);
  border-color: #d8ebe4;
}
.tree-person {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1 1 auto;
  min-width: 0;
}
.tree-identity {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.tree-name {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.tree-code {
  align-self: flex-start;
  padding: 2px 7px;
  border: 1px solid #d6ebe4;
  border-radius: 6px;
  background: #f2faf7;
  color: var(--brand-deep);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1.35;
}
.tree-side {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  margin-left: auto;
  flex: 0 0 auto;
}
.tree-count {
  color: var(--muted);
  font-size: 10.5px;
  white-space: nowrap;
}
.tree-count b { color: var(--ink); font-size: 12px; }
.tree-view { white-space: nowrap; }
@media (max-width: 640px) {
  .tree-row { padding: 10px; gap: 10px; flex-wrap: wrap; }
  .tree-side { width: 100%; margin-left: 0; gap: 10px; }
  .invite-tree ul { margin-left: 12px; padding-left: 12px; }
}

/* v2.23 collapsible invite tree */
.tree-children[hidden] { display: none; }
a.tree-name { color: var(--ink); text-decoration: none; }
a.tree-name:hover { color: var(--brand-deep); text-decoration: underline; text-underline-offset: 2px; }

/* v2.24 invite empty state */
.tree-empty-list { border-left-color: transparent !important; }
.tree-empty {
  padding: 10px 12px;
  border: 1px dashed #dcebe5;
  border-radius: 9px;
  background: #fbfdfc;
  color: var(--muted);
  font-size: 11px;
}

/* v2.25 biological parameters: reference form with OD/OS blocks */
.bio-eye-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.bio-eye-block {
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 12px;
  background: #fbfdfc;
  min-width: 0;
}
.bio-eye-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
  padding-bottom: 8px;
  border-bottom: 1px dashed #dfece6;
  color: var(--muted);
  font-size: 10.5px;
}
.bio-eye-head b { color: var(--ink); font-size: 12.5px; }
.bio-eye-head span { white-space: nowrap; color: var(--brand-deep); font-weight: 600; }
.bio-eye-fields { display: grid; gap: 6px; }
.bio-field {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.bio-field-label {
  display: flex;
  align-items: baseline;
  gap: 4px;
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 600;
}
.bio-field-label small {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 500;
}
.bio-field .input { height: 35px; min-width: 0; padding: 0 9px; font-size: 12px; }
@media (max-width: 760px) {
  .bio-eye-grid { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .bio-field { grid-template-columns: 76px minmax(0, 1fr); gap: 6px; }
  .bio-eye-block { padding: 10px; }
}

/* v2.26 corneal curvature / other parameters blocks */
.corneal-eye-grid,
.other-eye-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.corneal-eye-block,
.other-eye-block {
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 12px;
  background: #fbfdfc;
  min-width: 0;
}
.corneal-eye-head,
.other-eye-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
  padding-bottom: 8px;
  border-bottom: 1px dashed #dfece6;
  color: var(--muted);
  font-size: 10px;
}
.corneal-eye-head b,
.other-eye-head b { color: var(--ink); font-size: 12.5px; }
.corneal-curve {
  display: grid;
  grid-template-columns: 63px repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 6px;
  margin-bottom: 7px;
}
.corneal-curve-name { color: var(--ink); font-size: 11px; font-weight: 600; padding-bottom: 8px; }
.corneal-mini { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.corneal-mini small { color: var(--muted); font-size: 9px; padding-left: 2px; }
.corneal-mini .input { height: 32px; min-width: 0; padding: 0 7px; font-size: 11px; }
.corneal-line {
  display: grid;
  grid-template-columns: 95px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  margin-top: 7px;
}
.corneal-line span { color: var(--ink); font-size: 11px; font-weight: 600; }
.corneal-line span small { color: var(--muted); font-size: 9px; font-weight: 400; margin-left: 3px; }
.corneal-line .input { height: 32px; font-size: 11px; padding: 0 8px; }
.ast-line { grid-template-columns: 95px minmax(0, 1fr); }
.ast-inputs { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(62px, .55fr) auto; align-items: center; gap: 5px; }
.ast-inputs em { color: var(--muted); font-style: normal; font-size: 10px; }

.other-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 7px;
}
.other-row-last { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 0; }
.other-field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.other-label { color: var(--ink); font-size: 10.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.other-label small { color: var(--muted); font-size: 9px; font-weight: 400; margin-left: 2px; }
.other-field .input { height: 32px; min-width: 0; padding: 0 7px; font-size: 11px; }
@media (max-width: 900px) {
  .corneal-eye-grid, .other-eye-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .corneal-curve { grid-template-columns: 55px repeat(3, minmax(0, 1fr)); }
  .corneal-eye-block, .other-eye-block { padding: 10px; }
}

/* v2.27 admin intake page */
.intake-form { display: grid; gap: 12px; }
.intake-panel { padding: 18px 20px; }
.intake-panel .panel-head { margin-bottom: 14px; }
.intake-panel .panel-head h3 { font-size: 16px; }
.intake-panel .panel-head p { margin-top: 4px; }
.field-hint { display: block; margin-top: 5px; color: var(--muted); font-size: 10.5px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.intake-form .form-error { margin-top: 2px; }
@media (max-width: 640px) {
  .intake-panel { padding: 14px; }
}

/* v2.21 — ZEISS-inspired low-fatigue palette, activity redemption and view transitions */
:root {
  --bg: #f3f5f6;
  --bg-deep: #e9edef;
  --surface-soft: #f8fafb;
  --ink: #1b252a;
  --ink-2: #3f4d54;
  --muted: #6d7b82;
  --line: #dce3e6;
  --line-strong: #c9d4d9;
  --brand: #3c6b80;
  --brand-deep: #234b5e;
  --brand-dark: #173947;
  --brand-soft: #e8f0f3;
  --teal: #4c8589;
  --gold: #a88b62;
  --good: #2f7d68;
  --warn: #986a2c;
  --danger: #a94f4a;
  --navy: #0b1720;
  --navy-2: #18313c;
  --shadow: 0 22px 58px -36px rgba(20, 41, 49, .38);
  --shadow-sm: 0 12px 30px -24px rgba(20, 41, 49, .28);
  --radius: 18px;
  --radius-sm: 12px;
}
html { background: var(--bg); }
body {
  background:
    radial-gradient(1120px 520px at 3% -8%, rgba(199, 220, 227, .55) 0%, transparent 62%),
    radial-gradient(920px 460px at 101% 2%, rgba(214, 224, 228, .5) 0%, transparent 58%),
    linear-gradient(180deg, #f8fafb 0%, var(--bg) 46%, #edf1f3 100%);
}
.topbar { background: rgba(250, 252, 252, .92); border-bottom-color: rgba(200, 212, 218, .8); }
.nav-link { color: #586b73; }
.nav-link:hover { color: var(--brand-deep); background: #eef4f6; }
.btn-primary { background: linear-gradient(135deg, #3f7488 0%, #234b5e 100%); box-shadow: 0 12px 24px -14px rgba(24, 60, 74, .6), inset 0 1px 0 rgba(255,255,255,.16); }
.btn-primary:hover { background: linear-gradient(135deg, #4a8398 0%, #2b5a70 100%); }
.btn-ghost { border-color: #d1dde2; background: rgba(255,255,255,.68); }
.auth-visual, .admin-sidebar { background: linear-gradient(160deg, #173947 0%, #0f2a35 58%, #0b1720 100%); }
.hero, .invite-card, .rule-banner, .profile-invite-card { background: linear-gradient(135deg, #173947 0%, #2a5b6d 62%, #3f7488 100%); }
.rule-banner.small-banner { background: linear-gradient(135deg, #234b5e, #173947); }
.activity-card.redeem-activity { border-color: #d3e2e3; background: linear-gradient(180deg, #fbfdfd, #f4f8f8); }
.redeem-prize-list { display: grid; gap: 8px; margin: 12px 0 2px; padding-top: 10px; border-top: 1px dashed var(--line); }
.redeem-prize-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.8); }
.redeem-prize-row b { display: block; font-size: 12.5px; color: var(--ink); }
.redeem-prize-row span { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); }
.activity-code { margin-top: 8px; }
.activity-code code { font-family: var(--mono); color: var(--brand-deep); background: var(--brand-soft); padding: 2px 6px; border-radius: 5px; }
@media (max-width: 640px) {
  .redeem-prize-row { align-items: flex-start; flex-direction: column; }
  .redeem-prize-row .btn { width: 100%; }
}
::view-transition-old(root) { animation: page-out .16s ease both; }
::view-transition-new(root) { animation: page-in .24s cubic-bezier(.2,.7,.2,1) both; }
@keyframes page-out { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-4px); } }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
  html { scroll-behavior: auto; }
}

/* v2.22 — neutral copy on brand surfaces; keep theme for actions, not text */
.auth-visual h1 span {
  color: #f1f3ea;
  text-shadow: 0 0 42px rgba(233, 241, 235, .16);
}
.auth-eyebrow {
  color: rgba(240, 244, 237, .82);
  border-color: rgba(240, 244, 237, .28);
}
.auth-points svg { color: #e2d1a7; }
.auth-footnote { color: rgba(224, 232, 228, .62); }
.auth-visual-copy p { color: rgba(231, 239, 235, .80); }

.hero-kicker { color: rgba(238, 243, 238, .84); }
.hero-kicker::before {
  background: #e2d1a7;
  box-shadow: 0 0 0 4px rgba(226, 209, 167, .15);
}
.hero-perks svg { color: #e2d1a7; }

.invite-card p, .invite-card .muted { color: rgba(232, 240, 236, .70); }
.admin-sidebar .brand-sub { color: rgba(219, 231, 228, .58); }

/* v2.23 — remaining preview/card text should not inherit user brand green */
.preview-home-card .hero-kicker { color: rgba(239, 244, 240, .82); }
.preview-home-card .muted,
.preview-home-card .hero-perks,
.preview-home-card .hero-perks span { color: rgba(237, 243, 239, .74) !important; }

/* v2.24 — invitation small copy: neutral labels, independent of saved brand */
.invite-mini-head,
.invite-card-top { color: rgba(239, 244, 238, .70); }
.invite-mini-row { color: rgba(238, 243, 238, .72); }
.invite-mini-note,
.invite-qr-note,
.qr-help { color: rgba(238, 243, 238, .70); }
.invite-mini .divider { background: rgba(238, 243, 238, .20); }

/* v2.25 — client home membership activity cards */
.home-activity-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.home-activity-head .text-link { font-size: 11px; }
.home-activity-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.home-activity-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(145deg, #fff 0%, var(--surface-soft) 100%);
  color: var(--ink);
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.home-activity-card:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: 0 16px 34px -28px rgba(20, 55, 68, .45); }
.home-activity-icon {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  color: var(--brand-deep);
  background: var(--brand-soft, #eaf2f0);
}
.home-activity-main { display: flex; flex: 1; min-width: 0; flex-direction: column; align-items: flex-start; }
.home-activity-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 5px; }
.home-activity-rule { font-size: 10px; color: var(--muted); }
.home-activity-title { display: block; font-size: 14px; line-height: 1.45; letter-spacing: -.01em; }
.home-activity-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.65;
  color: var(--muted);
}
.home-activity-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; color: var(--brand-deep); font-size: 10.5px; font-weight: 700; }
.home-activity-meta span { display: inline-flex; align-items: center; gap: 4px; }
.home-activity-arrow { flex: 0 0 auto; color: var(--muted); margin-top: 10px; }
.home-activity-empty {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: var(--surface-soft);
}
.home-activity-empty b { display: block; font-size: 13px; }
.home-activity-empty p { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.home-activity-empty .text-link { margin-left: auto; flex: 0 0 auto; font-size: 11px; }
@media (max-width: 900px) {
  .home-activity-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-activity-empty { flex-wrap: wrap; }
  .home-activity-empty .text-link { margin-left: 0; }
}
@media (max-width: 640px) {
  .home-activity-head { width: 100%; justify-content: space-between; }
  .home-activity-grid { grid-template-columns: 1fr; }
  .home-activity-card { padding: 13px; }
  .home-activity-icon { flex-basis: 36px; width: 36px; height: 36px; }
}

/* v2.26 — home invitation card as a premium member gift card */
.invite-mini.invite-mini-gift {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 18px 19px 16px;
  border: 1px solid rgba(214, 188, 137, .62);
  border-radius: 15px;
  background:
    radial-gradient(260px 210px at 110% -12%, rgba(220, 192, 135, .20), transparent 62%),
    repeating-linear-gradient(112deg, transparent 0 15px, rgba(255, 255, 255, .018) 15px 16px),
    linear-gradient(145deg, #0d2e29 0%, #071f1c 56%, #123d35 100%);
  box-shadow: 0 24px 50px -30px rgba(0, 0, 0, .72), inset 0 1px 0 rgba(255, 255, 255, .08);
  color: #f3eee1;
}
.invite-mini.invite-mini-gift::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(216, 190, 139, .18);
  border-radius: 9px;
  pointer-events: none;
  z-index: 0;
}
.invite-mini.invite-mini-gift::after {
  content: "";
  position: absolute;
  width: 190px;
  height: 190px;
  right: -102px;
  bottom: -118px;
  border: 1px solid rgba(216, 190, 139, .16);
  border-radius: 50%;
  box-shadow: 0 0 0 22px rgba(216, 190, 139, .035), 0 0 0 46px rgba(216, 190, 139, .025);
  pointer-events: none;
  z-index: 0;
}
.gift-card-top { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 9px; padding-right: 0; }
.gift-card-kicker { color: #ddc89d; font-size: 8.5px; font-weight: 800; letter-spacing: .15em; white-space: nowrap; }
.gift-card-kind { color: rgba(239, 232, 213, .5); font-size: 8px; letter-spacing: .18em; white-space: nowrap; }
.gift-card-seal {
  position: absolute;
  top: 42px;
  right: 16px;
  z-index: 2;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(216, 190, 139, .65);
  border-radius: 50%;
  color: #e8d4a8;
  background: rgba(216, 190, 139, .055);
  box-shadow: inset 0 0 0 3px rgba(216, 190, 139, .07);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  line-height: 1;
  transform: rotate(8deg);
  opacity: .9;
}
.gift-card-label {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-top: 25px;
  color: rgba(238, 230, 211, .68);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
}
.gift-card-label small { color: rgba(238, 230, 211, .34); font-size: 7.5px; font-weight: 600; letter-spacing: .13em; }
.invite-mini-gift .invite-code {
  position: relative;
  z-index: 1;
  margin: 6px 0 0;
  color: #f6ead1;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: .055em;
  line-height: 1.1;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .28);
}
.invite-mini-gift .divider {
  position: relative;
  z-index: 1;
  height: 1px;
  margin: 14px 0 11px;
  background: linear-gradient(90deg, rgba(216, 190, 139, .56), rgba(216, 190, 139, .10) 72%, transparent);
}
.invite-mini-gift .invite-mini-note {
  position: relative;
  z-index: 1;
  max-width: 265px;
  margin: 0 0 14px;
  color: rgba(237, 238, 226, .72);
  font-size: 11px;
  line-height: 1.7;
}
.gift-card-bottom {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px dashed rgba(216, 190, 139, .22);
}
.gift-card-foot { color: rgba(224, 211, 181, .58); font-size: 8px; font-weight: 700; letter-spacing: .11em; white-space: nowrap; }
.invite-mini-gift .btn {
  flex: 0 0 auto;
  margin-top: 0;
  padding: 7px 10px;
  border: 1px solid rgba(216, 190, 139, .48);
  border-radius: 7px;
  background: rgba(216, 190, 139, .075);
  color: #efddba;
  font-size: 10.5px;
  font-weight: 800;
  box-shadow: none;
}
.invite-mini-gift .btn:hover { background: rgba(216, 190, 139, .16); border-color: rgba(216, 190, 139, .72); color: #fff4dd; }
@media (max-width: 900px) {
  .invite-mini-gift .invite-code { font-size: 25px; }
}
@media (max-width: 480px) {
  .invite-mini.invite-mini-gift { padding: 16px; }
  .gift-card-seal { top: 38px; right: 13px; width: 40px; height: 40px; font-size: 17px; }
  .invite-mini-gift .invite-code { font-size: 24px; }
  .gift-card-foot { font-size: 7.5px; }
}

/* v2.27 — neutral blue-grey gift card */
.invite-mini.invite-mini-gift {
  border-color: rgba(201, 217, 231, .46);
  background:
    radial-gradient(270px 220px at 108% -12%, rgba(151, 181, 205, .19), transparent 63%),
    repeating-linear-gradient(112deg, rgba(196, 214, 230, .022) 0 1px, transparent 1px 9px),
    linear-gradient(148deg, #384e61 0%, #223442 55%, #31485a 100%);
  box-shadow:
    0 26px 56px -32px rgba(8, 20, 30, .72),
    inset 0 1px 0 rgba(255, 255, 255, .14);
}
.invite-mini.invite-mini-gift::before {
  border-color: rgba(198, 216, 231, .26);
}
.invite-mini.invite-mini-gift::after {
  border-color: rgba(202, 219, 233, .15);
  box-shadow: inset 0 0 0 1px rgba(207, 223, 236, .045);
}
.invite-mini-gift .gift-card-kicker { color: #e2ecf4; }
.invite-mini-gift .gift-card-kind { color: rgba(219, 232, 242, .48); }
.gift-card-seal {
  color: #edf4fa;
  border-color: rgba(203, 220, 234, .62);
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, .18), transparent 54%),
    rgba(203, 220, 234, .07);
  box-shadow:
    inset 0 0 0 2px rgba(203, 220, 234, .08),
    0 0 0 3px rgba(203, 220, 234, .035),
    0 8px 20px rgba(6, 19, 29, .24);
}
.gift-card-seal::after { border-color: rgba(203, 220, 234, .3); }
.gift-card-label { color: rgba(226, 237, 245, .68); }
.gift-card-label small { color: rgba(226, 237, 245, .36); }
.invite-mini-gift .invite-code {
  color: #f5f9fc;
  text-shadow: 0 2px 18px rgba(2, 12, 20, .34);
}
.invite-mini-gift .divider {
  background: linear-gradient(90deg, rgba(205, 221, 234, .55), rgba(205, 221, 234, .10) 72%, transparent);
}
.invite-mini-gift .invite-mini-note { color: rgba(220, 232, 242, .72); }
.gift-card-bottom { border-top-color: rgba(205, 221, 234, .22); }
.gift-card-foot { color: rgba(209, 224, 237, .56); }
.invite-mini-gift .btn {
  border-color: rgba(200, 218, 233, .45);
  background: rgba(200, 218, 233, .075);
  color: #edf5fb;
}
.invite-mini-gift .btn:hover {
  border-color: rgba(200, 218, 233, .68);
  background: rgba(200, 218, 233, .16);
  color: #fff;
}

/* v2.28 — warm ivory / champagne details on the blue-grey gift card */
.invite-mini-gift .gift-card-kicker { color: #f3e9d6; }
.invite-mini-gift .gift-card-kind { color: rgba(229, 202, 151, .68); }
.gift-card-seal {
  color: #f2d79c;
  border-color: rgba(220, 191, 137, .66);
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 244, 216, .17), transparent 54%),
    rgba(214, 184, 126, .055);
  box-shadow:
    inset 0 0 0 2px rgba(220, 191, 137, .08),
    0 0 0 3px rgba(220, 191, 137, .035),
    0 8px 20px rgba(6, 19, 29, .24);
}
.gift-card-seal::after { border-color: rgba(220, 191, 137, .32); }
.gift-card-label { color: rgba(247, 237, 218, .86); }
.gift-card-label small { color: rgba(230, 205, 159, .68); }
.invite-mini-gift .invite-code {
  color: #f3d28c;
  font-size: 30px;
  text-shadow: 0 2px 20px rgba(177, 127, 47, .18);
}
.invite-mini-gift .divider {
  background: linear-gradient(90deg, rgba(222, 192, 137, .58), rgba(222, 192, 137, .10) 72%, transparent);
}
.invite-mini-gift .invite-mini-note { color: rgba(245, 235, 216, .76); }
.gift-card-bottom { border-top-color: rgba(222, 192, 137, .22); }
.gift-card-foot { color: rgba(231, 205, 160, .72); }
.invite-mini-gift .btn {
  border-color: rgba(222, 192, 137, .48);
  background: rgba(222, 192, 137, .07);
  color: #f1d7a2;
}
.invite-mini-gift .btn:hover {
  border-color: rgba(222, 192, 137, .72);
  background: rgba(222, 192, 137, .15);
  color: #fff1cf;
}
@media (max-width: 900px) {
  .invite-mini-gift .invite-code { font-size: 27px; }
}
@media (max-width: 480px) {
  .invite-mini-gift .invite-code { font-size: 25px; }
}

/* v2.29 — champagne motto under the invitation number */
.invite-mini-gift .gift-card-motto {
  position: relative;
  z-index: 1;
  margin: 9px 0 0;
  color: rgba(242, 226, 198, .8);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .16em;
  line-height: 1.6;
}
@media (max-width: 480px) {
  .invite-mini-gift .gift-card-motto { font-size: 10.5px; letter-spacing: .12em; }
}

/* v2.30 — horizontal gift-money account card */
.commission-account-flow {
  display: flex;
  align-items: center;
  gap: 26px;
}
.commission-account-metrics {
  display: flex;
  align-items: center;
  gap: 38px;
  flex: 0 0 auto;
}
.commission-account-metric { min-width: 0; }
.commission-account-metric span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
}
.commission-account-metric b {
  color: var(--ink);
  font-size: 21px;
  font-weight: 750;
  line-height: 1.1;
  white-space: nowrap;
}
.commission-account-note {
  flex: 1 1 220px;
  min-width: 160px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}
.commission-withdraw-btn {
  flex: 0 0 auto;
  margin-left: auto;
  white-space: nowrap;
}
@media (max-width: 900px) {
  .commission-account-flow { flex-wrap: wrap; gap: 14px; }
  .commission-account-metrics { flex: 1 1 100%; justify-content: space-between; gap: 16px; }
  .commission-account-note { flex: 1 1 100%; min-width: 0; }
  .commission-withdraw-btn { width: 100%; margin-left: 0; }
}

/* v2.31 — 用户档案编辑/删除操作 */
.patient-profile-head .row-actions { flex-wrap: wrap; }
.profile-delete { color: var(--danger); }
.profile-delete:hover { border-color: #e7b4ae; background: #fff7f6; color: var(--danger); }
@media (max-width: 640px) {
  .patient-profile-head .row-actions { width: 100%; }
  .patient-profile-head .row-actions .btn { flex: 1 1 auto; }
}

/* v2.32 — 历史检查记录删除 */
.exam-history-head .exam-delete { margin-left: auto; color: var(--danger); }
.exam-history-head .exam-delete:hover { border-color: #e7b4ae; background: #fff7f6; }
@media (max-width: 640px) {
  .exam-history-head { flex-wrap: wrap; }
  .exam-history-head .exam-delete { margin-left: 0; }
}

/* v2.33 — 客户详情档案编辑入口移至头部 */
.customer-hero-right { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; flex: none; }
.customer-edit-profile { white-space: nowrap; }
.profile-picker-list { display: flex; flex-direction: column; gap: 8px; }
.profile-picker-item { display: flex; justify-content: space-between; align-items: center; gap: 14px; width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); text-align: left; cursor: pointer; font: inherit; }
.profile-picker-item:hover { border-color: var(--brand); background: var(--surface-soft); }
.profile-picker-item span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.profile-picker-item small { color: var(--muted); font-size: 11px; }
.profile-picker-action { flex-direction: row !important; align-items: center; gap: 6px; color: var(--brand); font-size: 12px; font-weight: 700; white-space: nowrap; }
@media (max-width: 900px) {
  .customer-hero-right { width: 100%; align-items: stretch; }
  .customer-hero-stats { width: 100%; }
  .customer-edit-profile { align-self: flex-end; }
}

/* v2.35: active top navigation blends into the existing topbar background. */
@media (min-width: 901px) {
  .topbar .client-nav .nav-link.active {
    background: transparent;
    box-shadow: none;
  }
}

/* v2.36: on phones, keep exam values inside the archive card. */
@media (max-width: 640px) {
  .exam-read-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3px 10px;
    padding: 8px 0;
    align-items: start;
  }
  .exam-read-row .exam-label {
    grid-column: 1 / -1;
    font-size: 10px;
    letter-spacing: .04em;
  }
  .exam-read-row > span:not(.exam-label) {
    min-width: 0;
    font-size: 10px;
    line-height: 1.4;
    overflow-wrap: anywhere;
  }
  .exam-read-row b {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    line-height: 1.45;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

/* v2.37: mobile client footer wordmark, aligned with the brand line. */
.client-footer-brandline { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; }
.client-footer-logo { display: none; }
@media (max-width: 640px) {
  .client-footer-logo {
    display: inline-flex;
    flex: 0 0 auto;
  }
  .client-footer-logo img {
    width: 100px;
    height: auto;
    object-fit: contain;
    opacity: .92;
  }
}

/* v2.38: client payout accounts and admin batch transfers. */
.payout-account-box { margin: 16px 0 4px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft, #f8fbfa); }
.payout-account-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.payout-account-head b { font-size: 13px; color: var(--ink); }
.payout-account-head span { font-size: 11px; color: var(--muted); line-height: 1.5; text-align: right; }
.payout-account-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px dashed var(--line); }
.payout-account-row:first-of-type { border-top: 0; }
.payout-account-row > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.payout-account-row span { font-size: 11px; color: var(--muted); }
.payout-account-row b { font-size: 13px; color: var(--ink); overflow-wrap: anywhere; }
.payout-account-row small { font-size: 10.5px; color: var(--muted); }
.payout-bind-tip { margin: 6px 0 0; font-size: 11.5px; color: var(--muted); }
.payout-choice-group { display: grid; gap: 8px; }
.payout-choice { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; }
.payout-choice:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent); }
.payout-choice input { accent-color: var(--primary); }
.payout-choice span { display: flex; flex-direction: column; gap: 2px; }
.payout-choice b { font-size: 12.5px; }
.payout-choice small { font-size: 10.5px; color: var(--muted); }
.batch-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft, #f8fbfa); }
.batch-toolbar .btn { margin-left: auto; }
.check-row.compact { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.check-row.compact input { accent-color: var(--primary); }
.payout-channel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.withdrawal-channel .table-wrap { overflow-x: auto; }
.withdrawal-item > div:first-child { display: flex; flex-direction: column; gap: 2px; }
.withdrawal-item small { font-size: 10.5px; color: var(--muted); }
@media (max-width: 900px) {
  .payout-channel-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .payout-account-head { flex-direction: column; align-items: flex-start; gap: 3px; }
  .payout-account-head span { text-align: left; }
  .batch-toolbar { align-items: flex-start; }
  .batch-toolbar .btn { width: 100%; margin-left: 0; }
}

/* v2.39 — authorized payout accounts and gift-account layout */
.commission-account-panel .commission-account-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, .92fr);
  gap: 16px 22px;
  align-items: start;
}
.commission-account-panel .commission-account-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}
.commission-account-panel .commission-account-metric {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft, #f8fbfa);
}
.commission-account-panel .commission-account-metric b { font-size: 19px; }
.commission-account-panel .payout-account-box {
  grid-column: 2;
  grid-row: 1 / span 3;
  margin: 0;
  padding: 12px;
  background: var(--surface);
}
.commission-account-panel .payout-account-row {
  padding: 11px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft, #f8fbfa);
}
.commission-account-panel .payout-account-row:first-of-type { border-top: 1px solid var(--line); }
.commission-account-panel .payout-account-row b { font-size: 12.5px; }
.commission-account-panel .commission-account-note { grid-column: 1; margin: 0; }
.commission-account-panel .commission-withdraw-btn,
.commission-account-panel .payout-bind-tip { grid-column: 1; width: 100%; margin: 0; }
@media (max-width: 900px) {
  .commission-account-panel .commission-account-flow { grid-template-columns: 1fr; }
  .commission-account-panel .payout-account-box { grid-column: 1; grid-row: auto; }
  .commission-account-panel .commission-account-note,
  .commission-account-panel .commission-withdraw-btn,
  .commission-account-panel .payout-bind-tip { grid-column: 1; }
}
@media (max-width: 640px) {
  .commission-account-panel .commission-account-metrics { grid-template-columns: 1fr 1fr; }
  .commission-account-panel .commission-account-metric:last-child { grid-column: 1 / -1; }
  .commission-account-panel .payout-account-row { align-items: flex-start; }
  .commission-account-panel .payout-account-row .btn { flex: 0 0 auto; }
}

/* v2.40 — commission issuance workspace */
.commission-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}
.commission-main { min-width: 0; }
.commission-side { display: grid; gap: 18px; }
.commission-rule-values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.commission-rule-values > div {
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-soft, #f6faf9);
  border: 1px solid var(--line, #e4ece9);
}
.commission-rule-values span,
.commission-quick-summary span {
  display: block;
  color: var(--muted, #6b7d79);
  font-size: 11px;
  margin-bottom: 5px;
}
.commission-rule-values b { font-size: 20px; color: var(--ink, #173c36); }
.commission-rule-list {
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}
.commission-rule-list li {
  position: relative;
  padding-left: 15px;
  color: var(--muted, #5e726d);
  font-size: 12px;
  line-height: 1.55;
}
.commission-rule-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary, #0f766e);
}
.commission-rule-actions { display: grid; gap: 8px; }
.commission-rule-actions .btn { width: 100%; justify-content: center; }
.commission-quick-summary {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}
.commission-quick-summary b { font-size: 14px; color: var(--ink, #173c36); }
.commission-side .panel-body { padding-top: 14px; }
@media (max-width: 1100px) {
  .commission-layout { grid-template-columns: minmax(0, 1fr); }
  .commission-side { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .commission-side { grid-template-columns: 1fr; }
  .commission-quick-summary { grid-template-columns: 1fr; }
}
.footer-icp { color: inherit; text-decoration: none; }
.footer-icp:hover { color: var(--brand-deep); text-decoration: underline; }
