:root {
  --bg: #eef4f2;
  --panel: #ffffff;
  --panel-2: #f6faf8;
  --text: #14231f;
  --muted: #687872;
  --line: #dce8e3;
  --primary: #117864;
  --primary-2: #0c6554;
  --primary-soft: #e8f5f1;
  --accent: #ff9f1c;
  --success: #158569;
  --success-soft: #e8f6f1;
  --warning: #d97706;
  --warning-soft: #fff6e5;
  --danger: #dc3f4f;
  --danger-soft: #fff0f2;
  --info: #278b80;
  --shadow: 0 18px 50px rgba(17, 72, 60, .10);
  --shadow-sm: 0 8px 24px rgba(17, 72, 60, .08);
  --radius: 18px;
  --radius-sm: 12px;
  --font: Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans Thai", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: var(--font); color: var(--text); background: var(--bg); }
body { font-size: 14px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.xsmall { font-size: 11px; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary); }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.stack { display: flex; flex-direction: column; }
.w-full { width: 100%; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px;
  background: var(--panel-2); color: var(--muted); font-size: 12px; white-space: nowrap;
}
.pill.success { color: var(--success); background: var(--success-soft); }
.pill.warning { color: var(--warning); background: var(--warning-soft); }
.pill.danger { color: var(--danger); background: var(--danger-soft); }
.pill.primary { color: var(--primary); background: var(--primary-soft); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }
.btn {
  border: 0; border-radius: 11px; padding: 10px 16px; background: var(--panel-2); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-weight: 650;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease; min-height: 40px;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 7px 18px rgba(20,40,80,.09); }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--primary); color: white; }
.btn.primary:hover { background: var(--primary-2); }
.btn.success { background: var(--success); color: white; }
.btn.danger { background: var(--danger); color: white; }
.btn.warning { background: var(--warning); color: white; }
.btn.outline { background: transparent; border: 1px solid var(--line); }
.btn.ghost { background: transparent; }
.btn.sm { min-height: 32px; padding: 7px 10px; border-radius: 9px; font-size: 12px; }
.btn.lg { min-height: 50px; padding: 13px 22px; border-radius: 14px; font-size: 16px; }
.btn.icon { width: 40px; padding: 0; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line); background: white; border-radius: 11px; padding: 10px 12px;
  min-height: 42px; outline: none; color: var(--text); transition: border .15s, box-shadow .15s;
}
.textarea { min-height: 96px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: #83bcae; box-shadow: 0 0 0 4px rgba(17,120,100,.10); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 700; color: #4b5563; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.form-grid .span-2 { grid-column: span 2; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card.pad { padding: 20px; }
.card-title { font-size: 16px; font-weight: 800; }
.card-subtitle { color: var(--muted); font-size: 12px; margin-top: 4px; }
.empty { text-align: center; color: var(--muted); padding: 30px 12px; }
.empty-icon { width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 18px; background: var(--panel-2); display: grid; place-items: center; font-size: 24px; }
.avatar { width: 38px; height: 38px; border-radius: 13px; background: linear-gradient(135deg, #c6e4dc, #e8f5f1); color: var(--primary); display: grid; place-items: center; font-weight: 800; flex: 0 0 auto; overflow: hidden; }
.avatar.sm { width: 30px; height: 30px; border-radius: 10px; font-size: 12px; }
.avatar.lg { width: 58px; height: 58px; border-radius: 18px; font-size: 20px; }
.badge-count { min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--danger); color: white; font-size: 11px; display: grid; place-items: center; font-weight: 800; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; background: #fafbfc; position: sticky; top: 0; }
td { font-size: 13px; }
tr:hover td { background: #fbfcff; }
.modal-backdrop { position: fixed; inset: 0; z-index: 2000; background: rgba(10,20,40,.46); display: grid; place-items: center; padding: 20px; backdrop-filter: blur(3px); }
.modal { width: min(620px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: white; border-radius: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.modal.wide { width: min(920px, 100%); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: white; z-index: 2; }
.modal-title { font-size: 17px; font-weight: 800; }
.modal-body { padding: 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: white; }
.close-btn { border: 0; background: var(--panel-2); width: 34px; height: 34px; border-radius: 10px; font-size: 18px; }
.toast-stack { position: fixed; right: 20px; top: 20px; z-index: 5000; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 40px)); }
.toast { background: #172033; color: white; border-radius: 13px; padding: 13px 15px; box-shadow: 0 18px 50px rgba(0,0,0,.22); display: flex; align-items: flex-start; gap: 10px; animation: toastIn .2s ease; }
.toast.success { background: #0b7f59; }
.toast.error { background: #b72d3b; }
.toast.warning { background: #a35b00; }
@keyframes toastIn { from { transform: translateY(-10px); opacity: 0; } }
.spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.4); border-top-color: white; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, #eef1f5 25%, #f8f9fb 40%, #eef1f5 60%); background-size: 300% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* Login */
.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0,1.15fr) minmax(420px,.85fr); background: #0d2a22; }
.login-hero { position: relative; overflow: hidden; padding: clamp(34px,5vw,80px); color: white; display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; }
.login-hero::before { content:""; position: absolute; width: 560px; height: 560px; border-radius: 50%; background: radial-gradient(circle, rgba(40,153,132,.60), rgba(17,120,100,0)); right: -140px; top: -160px; }
.login-hero::after { content:""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.025) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.025) 1px,transparent 1px); background-size: 38px 38px; mask-image: linear-gradient(to bottom,black,transparent 85%); }
.login-brand, .login-copy, .login-features { position: relative; z-index: 1; }
.login-brand { display: flex; align-items: center; gap: 12px; font-size: 19px; font-weight: 850; letter-spacing: .04em; }
.brand-mark { width: 45px; height: 45px; border-radius: 15px; background: linear-gradient(135deg,#35a48d,#117864); box-shadow: 0 14px 32px rgba(17,120,100,.30); display: grid; place-items: center; color: white; font-weight: 900; }
.login-copy { max-width: 700px; margin: auto 0; }
.login-copy h1 { margin: 0 0 18px; font-size: clamp(34px,5.2vw,70px); line-height: 1.04; letter-spacing: -.04em; }
.login-copy p { margin: 0; font-size: clamp(15px,1.5vw,19px); color: rgba(255,255,255,.72); max-width: 610px; line-height: 1.75; }
.login-features { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.login-feature { border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.06); border-radius: 16px; padding: 15px; backdrop-filter: blur(12px); }
.login-feature b { display: block; font-size: 13px; margin-bottom: 5px; }
.login-feature span { color: rgba(255,255,255,.58); font-size: 11px; line-height: 1.5; }
.login-panel { background: #f1f6f4; display: grid; place-items: center; padding: 30px; }
.login-card { width: min(450px,100%); background: white; border-radius: 24px; padding: 30px; box-shadow: var(--shadow); border: 1px solid #edf0f4; }
.login-card h2 { margin: 0 0 8px; font-size: 25px; }
.login-card .lead { color: var(--muted); margin-bottom: 24px; }
.login-card .field { margin-bottom: 14px; }
.quick-accounts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.quick-account { border: 1px solid var(--line); border-radius: 13px; padding: 11px; background: #fbfcfe; cursor: pointer; text-align: left; }
.quick-account:hover { border-color: #8bc4b6; background: var(--primary-soft); }
.quick-account b { display: block; font-size: 12px; }
.quick-account span { font-size: 11px; color: var(--muted); }
.login-foot { text-align: center; color: var(--muted); font-size: 11px; margin-top: 20px; line-height: 1.6; }

/* Admin */
.admin-app { display: grid; grid-template-columns: 244px minmax(0,1fr); min-height: 100vh; }
.admin-sidebar { background: #102d25; color: white; padding: 20px 14px; position: fixed; inset: 0 auto 0 0; width: 244px; overflow-y: auto; z-index: 30; }
.admin-brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 20px; }
.admin-brand strong { font-size: 16px; letter-spacing: .02em; }
.admin-brand small { display:block; color:rgba(255,255,255,.48); margin-top:2px; font-size:10px; }
.admin-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-section { color: rgba(255,255,255,.34); font-size: 10px; font-weight: 800; letter-spacing: .1em; margin: 16px 10px 7px; }
.admin-nav button { width: 100%; color: rgba(255,255,255,.72); border: 0; background: transparent; border-radius: 11px; padding: 11px 12px; display: flex; align-items: center; gap: 10px; text-align: left; }
.admin-nav button:hover { color: white; background: rgba(255,255,255,.06); }
.admin-nav button.active { color: white; background: linear-gradient(90deg,rgba(29,112,93,.98),rgba(24,84,70,.96)); box-shadow: 0 10px 24px rgba(16,93,76,.22); }
.nav-group { margin-top: 8px; }
.admin-nav .nav-group-toggle { color: white; font-weight: 800; background: rgba(255,255,255,.045); }
.admin-nav .nav-group-toggle:hover { background: rgba(255,255,255,.09); }
.nav-chevron { margin-left: auto; font-size: 15px; transition: transform .18s ease; }
.nav-group.open .nav-chevron { transform: rotate(180deg); }
.nav-group-items { display: none; padding: 3px 0 2px 9px; border-left: 1px solid rgba(255,255,255,.12); margin-left: 18px; }
.nav-group.open > .nav-group-items { display: flex; flex-direction: column; gap: 3px; }
.admin-nav .nav-group-items > button { padding-left: 9px; }
.trade-permission-head-v24{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 15px;border:1px solid #b9ddd2;background:#eff9f6;border-radius:14px 14px 0 0}.trade-permission-head-v24 b,.trade-permission-head-v24 span{display:block}.trade-permission-head-v24 span{font-size:11px;color:#55766d;margin-top:4px}.trade-permission-groups-v24{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));border:1px solid var(--line);border-top:0;border-radius:0 0 14px 14px;overflow:hidden}.trade-permission-group-v24{padding:13px 14px;border-right:1px solid var(--line);border-bottom:1px solid var(--line)}.trade-permission-group-v24:nth-child(2n){border-right:0}.trade-permission-group-v24 h4{margin:0 0 8px;color:var(--primary)}.trade-permission-item-v24{display:flex;gap:9px;align-items:flex-start;padding:7px;border-radius:9px}.trade-permission-item-v24:hover{background:var(--primary-soft)}.trade-permission-item-v24 input{margin-top:3px}.trade-permission-item-v24 b,.trade-permission-item-v24 small{display:block}.trade-permission-item-v24 small{color:var(--muted);margin-top:2px;line-height:1.4}@media(max-width:760px){.trade-permission-head-v24{align-items:flex-start;flex-direction:column}.trade-permission-groups-v24{grid-template-columns:1fr}.trade-permission-group-v24{border-right:0}}
.nav-icon { width: 23px; text-align:center; font-size: 16px; }
.admin-main { grid-column: 2; min-width: 0; }
.admin-topbar { height: 68px; padding: 0 26px; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 25; backdrop-filter: blur(12px); }
.admin-content { padding: 24px 26px 42px; max-width: 1800px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.page-title { font-size: 25px; font-weight: 850; letter-spacing: -.02em; }
.page-desc { color: var(--muted); margin-top: 5px; }
.top-user { display: flex; align-items:center; gap:10px; }
.top-user .meta { line-height:1.25; text-align:right; }
.top-user b { display:block; font-size:12px; }
.top-user span { font-size:10px; color:var(--muted); }
.stats-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 15px; margin-bottom: 18px; }
.stat-card { background: white; border: 1px solid var(--line); border-radius: 17px; padding: 18px; box-shadow: var(--shadow-sm); position: relative; overflow:hidden; }
.stat-card::after { content:""; position:absolute; width:70px; height:70px; border-radius:50%; background: var(--primary-soft); right:-20px; top:-25px; }
.stat-label { color:var(--muted); font-size:12px; }
.stat-value { font-size:28px; font-weight:850; margin-top:8px; letter-spacing:-.03em; }
.stat-foot { color:var(--muted); font-size:11px; margin-top:8px; }
.dashboard-grid { display:grid; grid-template-columns:minmax(0,1.45fr) minmax(320px,.75fr); gap:16px; }
.panel-head { padding:17px 18px; border-bottom:1px solid var(--line); display:flex; align-items:center; justify-content:space-between; }
.panel-body { padding:18px; }
.activity-list { display:flex; flex-direction:column; }
.activity-item { display:flex; gap:12px; padding:12px 0; border-bottom:1px dashed var(--line); }
.activity-item:last-child { border-bottom:0; }
.activity-main { min-width:0; flex:1; }
.activity-title { font-weight:750; font-size:13px; }
.activity-sub { color:var(--muted); font-size:11px; margin-top:4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:14px; flex-wrap:wrap; }
.search-box { display:flex; align-items:center; border:1px solid var(--line); background:white; border-radius:11px; padding:0 11px; min-width:270px; }
.search-box input { border:0; outline:0; padding:10px 8px; width:100%; background:transparent; }
.status-cell { display:inline-flex; align-items:center; gap:5px; font-size:12px; font-weight:700; }
.status-cell::before { content:""; width:7px; height:7px; border-radius:50%; background:currentColor; }
.status-pending { color:var(--warning); }
.status-approved,.status-active,.status-signed,.status-normal,.status-success,.status-not_required { color:var(--success); }
.status-rejected,.status-closed,.status-out_of_range,.status-exception { color:var(--danger); }
.status-pending_review { color:var(--warning); }
.notice-composer { display:grid; grid-template-columns:minmax(0,1fr) 330px; gap:16px; }
.preview-phone { width:300px; min-height:560px; border:10px solid #182135; border-radius:38px; background:#eef4f2; box-shadow:0 22px 60px rgba(0,0,0,.18); margin:auto; overflow:hidden; }
.preview-phone-top { height:27px; background:#182135; width:110px; border-radius:0 0 16px 16px; margin:auto; }
.preview-phone-screen { padding:12px; }
.chat-admin-layout { display:grid; grid-template-columns:330px minmax(0,1fr); height:670px; overflow:hidden; }
.chat-sidebar { border-right:1px solid var(--line); overflow-y:auto; }
.chat-conv { display:flex; gap:10px; padding:13px; border-bottom:1px solid var(--line); cursor:pointer; }
.chat-conv:hover,.chat-conv.active { background:#edf7f3; }
.chat-pane { display:flex; flex-direction:column; min-width:0; }
.chat-pane-head { padding:14px 16px; border-bottom:1px solid var(--line); font-weight:800; }
.chat-messages { flex:1; overflow-y:auto; padding:18px; background:#f2f7f5; }
.chat-composer { padding:12px; border-top:1px solid var(--line); display:flex; gap:8px; }

/* Mobile employee */
.mobile-body { background:#e7efec; min-height:100vh; }
.phone-app { width:min(100%,500px); min-height:100vh; margin:0 auto; background:#eef4f2; position:relative; box-shadow:0 0 50px rgba(20,40,70,.12); overflow-x:hidden; }
.mobile-header { position:sticky; top:0; z-index:30; background:linear-gradient(135deg,#126c5b,#1a8a73); color:white; padding:16px 17px 18px; }
.mobile-header-row { display:flex; align-items:center; justify-content:space-between; }
.mobile-user { display:flex; gap:10px; align-items:center; }
.mobile-user .avatar { background:rgba(255,255,255,.18); color:white; }
.mobile-user b { display:block; font-size:14px; }
.mobile-user span { display:block; color:rgba(255,255,255,.68); font-size:10px; margin-top:2px; }
.mobile-header-actions { display:flex; gap:8px; }
.header-circle { width:36px; height:36px; border-radius:12px; background:rgba(255,255,255,.12); color:white; border:0; display:grid; place-items:center; position:relative; }
.mobile-content { padding:14px 14px 92px; min-height:calc(100vh - 70px); }
.mobile-page { display:none; }
.mobile-page.active { display:block; animation:fadeIn .18s ease; }
@keyframes fadeIn { from { opacity:0; transform:translateY(4px); } }
.mobile-bottom-nav { position:fixed; z-index:50; bottom:0; left:50%; transform:translateX(-50%); width:min(100%,500px); height:72px; background:rgba(255,255,255,.97); border-top:1px solid var(--line); display:grid; grid-template-columns:repeat(5,1fr); padding-bottom:max(5px,env(safe-area-inset-bottom)); backdrop-filter:blur(12px); }
.mobile-bottom-nav button { border:0; background:transparent; color:#7b8595; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; font-size:10px; position:relative; }
.mobile-bottom-nav button .mi { font-size:21px; line-height:1; }
.mobile-bottom-nav button.active { color:var(--primary); font-weight:800; }
.mobile-bottom-nav .nav-badge { position:absolute; top:8px; right:20%; }
.hero-card { background:linear-gradient(135deg,#102c63,#0c4ec5); color:white; border-radius:20px; padding:19px; box-shadow:0 16px 34px rgba(14,72,174,.25); position:relative; overflow:hidden; }
.hero-card::after { content:""; position:absolute; width:180px; height:180px; border:36px solid rgba(255,255,255,.05); border-radius:50%; right:-80px; top:-75px; }
.hero-label { color:rgba(255,255,255,.7); font-size:11px; }
.hero-time { font-size:23px; font-weight:850; margin:6px 0 12px; }
.hero-status { display:flex; align-items:center; gap:8px; font-size:11px; color:rgba(255,255,255,.78); }
.hero-status .dot { color:#37e1a1; }
.checkin-row { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:15px; }
.checkin-btn { border:0; border-radius:14px; min-height:53px; font-weight:800; background:white; color:#16499e; display:flex; align-items:center; justify-content:center; gap:8px; }
.checkin-btn.out { background:rgba(255,255,255,.13); color:white; border:1px solid rgba(255,255,255,.18); }
.mobile-section-title { display:flex; align-items:center; justify-content:space-between; margin:18px 2px 10px; }
.mobile-section-title b { font-size:15px; }
.mobile-section-title button { border:0; background:transparent; color:var(--primary); font-size:11px; }
.quick-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:9px; }
.quick-item { background:white; border:1px solid var(--line); border-radius:15px; padding:13px 5px 11px; display:flex; flex-direction:column; align-items:center; gap:7px; font-size:11px; color:#3a4658; box-shadow:0 4px 14px rgba(20,40,70,.04); }
.quick-icon { width:38px; height:38px; border-radius:13px; display:grid; place-items:center; background:var(--primary-soft); color:var(--primary); font-size:18px; }
.quick-item:nth-child(2) .quick-icon { background:#e9f8f2; color:var(--success); }
.quick-item:nth-child(3) .quick-icon { background:#fff4df; color:#d47b00; }
.quick-item:nth-child(4) .quick-icon { background:#f4eefe; color:#8656cc; }
.mobile-stats { display:grid; grid-template-columns:repeat(2,1fr); gap:10px; }
.mobile-stat { background:white; border:1px solid var(--line); border-radius:16px; padding:14px; }
.mobile-stat span { color:var(--muted); font-size:10px; }
.mobile-stat strong { display:block; font-size:20px; margin-top:5px; }
.notice-card { background:white; border:1px solid var(--line); border-radius:15px; padding:13px; display:flex; gap:10px; margin-bottom:9px; }
.notice-icon { width:36px; height:36px; border-radius:12px; background:var(--warning-soft); color:var(--warning); display:grid; place-items:center; flex:0 0 auto; }
.notice-main { min-width:0; flex:1; }
.notice-title { font-size:13px; font-weight:800; }
.notice-body { color:var(--muted); font-size:11px; line-height:1.55; margin-top:4px; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.list-card { background:white; border:1px solid var(--line); border-radius:16px; overflow:hidden; }
.list-row { display:flex; align-items:center; gap:11px; padding:13px 14px; border-bottom:1px solid var(--line); }
.list-row:last-child { border-bottom:0; }
.list-row-main { flex:1; min-width:0; }
.list-row-title { font-size:13px; font-weight:750; display:flex; align-items:center; gap:6px; }
.list-row-sub { color:var(--muted); font-size:10px; margin-top:4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.list-row-end { color:var(--muted); font-size:11px; text-align:right; }
.page-banner { background:linear-gradient(135deg,#163d82,#1264df); color:white; border-radius:18px; padding:18px; margin-bottom:12px; }
.page-banner h2 { margin:0; font-size:20px; }
.page-banner p { margin:6px 0 0; color:rgba(255,255,255,.7); font-size:11px; line-height:1.55; }
.attendance-state { background:white; border:1px solid var(--line); border-radius:18px; padding:18px; text-align:center; }
.face-ring { width:120px; height:120px; border-radius:50%; margin:6px auto 16px; background:conic-gradient(var(--primary) 0 82%,#e9eef6 82%); padding:5px; }
.face-ring-inner { width:100%; height:100%; border-radius:50%; background:#f1f6f4; display:grid; place-items:center; font-size:42px; }
.steps { display:flex; justify-content:center; gap:7px; flex-wrap:wrap; margin:12px 0; }
.step-chip { padding:7px 9px; border-radius:10px; background:#f1f4f8; color:var(--muted); font-size:10px; }
.step-chip.done { color:var(--success); background:var(--success-soft); }
.work-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.work-item { background:white; border:1px solid var(--line); border-radius:16px; padding:15px 6px; text-align:center; }
.work-item .wi { width:42px; height:42px; border-radius:14px; background:var(--primary-soft); display:grid; place-items:center; margin:0 auto 8px; font-size:20px; }
.work-item b { display:block; font-size:11px; }
.work-item span { color:var(--muted); font-size:9px; }
.message-layout { position:fixed; top:0; bottom:0; left:50%; transform:translateX(-50%); width:min(100%,500px); background:#eef4f2; z-index:80; display:flex; flex-direction:column; }
.message-topbar { height:60px; flex:0 0 auto; background:white; border-bottom:1px solid var(--line); display:flex; align-items:center; justify-content:space-between; padding:0 13px; }
.message-topbar button { border:0; background:transparent; font-size:20px; width:38px; height:38px; }
.message-topbar .title { text-align:center; min-width:0; }
.message-topbar .title b { display:block; font-size:14px; }
.message-topbar .title span { display:block; color:var(--muted); font-size:9px; margin-top:2px; }
.message-scroll { flex:1; overflow-y:auto; padding:14px 12px; }
.message-bubble-row { display:flex; align-items:flex-end; gap:7px; margin:10px 0; }
.message-bubble-row.mine { flex-direction:row-reverse; }
.message-bubble { max-width:73%; background:white; border-radius:15px 15px 15px 4px; padding:10px 12px; box-shadow:0 3px 10px rgba(30,50,80,.06); font-size:13px; line-height:1.55; word-break:break-word; }
.mine .message-bubble { background:#aeea84; border-radius:15px 15px 4px 15px; }
.message-meta { color:#8992a2; font-size:8px; margin-top:4px; display:flex; justify-content:flex-end; gap:4px; }
.message-sender { color:#637087; font-size:9px; margin-bottom:3px; }
.voice-bubble { display:flex; align-items:center; gap:8px; min-width:115px; }
.voice-bars { display:flex; align-items:center; gap:2px; height:18px; }
.voice-bars i { display:block; width:2px; background:currentColor; border-radius:3px; }
.voice-bars i:nth-child(1){height:5px}.voice-bars i:nth-child(2){height:12px}.voice-bars i:nth-child(3){height:16px}.voice-bars i:nth-child(4){height:9px}.voice-bars i:nth-child(5){height:14px}
.message-compose { flex:0 0 auto; background:white; border-top:1px solid var(--line); padding:9px 10px max(9px,env(safe-area-inset-bottom)); display:flex; gap:7px; align-items:flex-end; }
.message-compose button { border:0; background:#f2f4f7; width:38px; height:38px; border-radius:12px; flex:0 0 auto; }
.message-compose textarea { flex:1; min-height:38px; max-height:92px; border:1px solid var(--line); border-radius:12px; padding:9px 10px; resize:none; outline:none; }
.message-compose .send { background:var(--primary); color:white; width:auto; padding:0 14px; font-weight:800; }
.chat-extra { background:white; border-top:1px solid var(--line); padding:15px; display:grid; grid-template-columns:repeat(4,1fr); gap:15px; }
.chat-extra button { border:0; background:transparent; display:flex; flex-direction:column; align-items:center; gap:6px; font-size:10px; color:var(--muted); }
.chat-extra .exicon { width:48px; height:48px; border-radius:16px; background:#f2f4f7; display:grid; place-items:center; font-size:20px; color:var(--text); }
.recording-bar { position:absolute; left:50%; bottom:90px; transform:translateX(-50%); background:rgba(17,30,50,.92); color:white; padding:12px 18px; border-radius:16px; min-width:210px; text-align:center; }
.call-screen { position:fixed; inset:0; z-index:500; background:radial-gradient(circle at 50% 10%,#344a75,#081225 62%); color:white; display:flex; flex-direction:column; align-items:center; justify-content:space-between; padding:70px 24px 45px; }
.call-user { text-align:center; }
.incoming-call-label { display:inline-flex; align-items:center; justify-content:center; min-height:26px; padding:5px 12px; border-radius:999px; background:rgba(255,255,255,.12); color:rgba(255,255,255,.78); font-size:10px; font-weight:750; margin-bottom:22px; }
.call-user .avatar { width:92px; height:92px; border-radius:30px; margin:0 auto 18px; font-size:30px; }
.call-user.ringing .avatar { animation:call-ring-pulse 1.35s ease-in-out infinite; box-shadow:0 0 0 0 rgba(255,255,255,.32); }
.call-user h2 { margin:0; font-size:25px; }
.call-user p { color:rgba(255,255,255,.72); font-weight:650; }
.call-actions { display:flex; gap:28px; align-items:flex-end; }
.call-btn { width:64px; height:64px; border-radius:50%; border:0; color:white; background:rgba(255,255,255,.14); font-size:23px; display:grid; place-items:center; position:relative; }
.call-btn span { position:absolute; top:72px; left:50%; transform:translateX(-50%); color:rgba(255,255,255,.86); font-size:10px; font-weight:750; white-space:nowrap; }
.call-btn.end,.call-btn.reject { background:#e53f50; }
.call-btn.accept { background:#23b76b; box-shadow:0 10px 28px rgba(35,183,107,.32); }
@keyframes call-ring-pulse { 0%,100%{transform:scale(1);box-shadow:0 0 0 0 rgba(255,255,255,.28)} 50%{transform:scale(1.06);box-shadow:0 0 0 18px rgba(255,255,255,0)} }
.video-grid { position:absolute; inset:0; overflow:hidden; }
.video-grid video.remote { width:100%; height:100%; object-fit:cover; background:#0a1220; }
.video-grid video.local { position:absolute; width:110px; height:160px; right:14px; top:55px; object-fit:cover; border-radius:16px; border:2px solid rgba(255,255,255,.5); background:#18233b; }
.call-overlay { position:relative; z-index:2; width:100%; height:100%; display:flex; flex-direction:column; justify-content:space-between; align-items:center; }
.profile-card { background:linear-gradient(135deg,#0c4fc7,#1d70ed); color:white; border-radius:18px; padding:18px; display:flex; align-items:center; gap:13px; }
.profile-card .avatar { background:rgba(255,255,255,.18); color:white; }
.setting-row { display:flex; align-items:center; gap:12px; padding:14px; border-bottom:1px solid var(--line); background:white; }
.setting-row:first-child { border-radius:16px 16px 0 0; }
.setting-row:last-child { border-bottom:0; border-radius:0 0 16px 16px; }
.setting-icon { width:36px; height:36px; border-radius:12px; background:var(--primary-soft); color:var(--primary); display:grid; place-items:center; }
.setting-main { flex:1; min-width:0; }
.setting-main b { display:block; font-size:12px; }
.setting-main span { color:var(--muted); font-size:9px; }
.signature-canvas { width:100%; height:190px; border:1px dashed #9aa7bb; border-radius:14px; touch-action:none; background:white; }
.camera-preview { width:100%; height:260px; border-radius:16px; object-fit:cover; background:#101827; }
.contract-content { white-space:pre-wrap; line-height:1.8; font-size:12px; background:#fbfcfe; border:1px solid var(--line); border-radius:14px; padding:15px; max-height:340px; overflow:auto; }
.storage-bar { height:8px; border-radius:999px; background:#e7ebf1; overflow:hidden; }
.storage-bar span { display:block; height:100%; background:var(--primary); border-radius:inherit; }

.call-alert-panel { display:grid; gap:12px; }
.call-alert-state { display:flex; gap:12px; align-items:center; padding:14px; border:1px solid var(--line); border-radius:16px; background:var(--panel-2); }
.call-alert-state .state-icon { width:44px; height:44px; border-radius:15px; display:grid; place-items:center; background:var(--primary-soft); color:var(--primary); font-size:21px; }
.call-alert-state.enabled .state-icon { background:#e7f8ef; color:#158650; }
.call-alert-state .state-copy { flex:1; min-width:0; }
.call-alert-state .state-copy b { display:block; font-size:13px; }
.call-alert-state .state-copy span { display:block; color:var(--muted); font-size:10px; line-height:1.55; margin-top:3px; }

@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-grid { grid-template-columns:1fr; }
  .notice-composer { grid-template-columns:1fr; }
}
@media (max-width: 820px) {
  .login-page { grid-template-columns:1fr; }
  .login-hero { min-height:auto; padding:32px 24px; }
  .login-copy { margin:70px 0; }
  .login-features { grid-template-columns:repeat(2,1fr); }
  .login-panel { padding:20px; }
  .admin-app { grid-template-columns:1fr; }
  .admin-sidebar { transform:translateX(-100%); transition:transform .2s; }
  .admin-sidebar.open { transform:translateX(0); }
  .admin-main { grid-column:1; }
  .admin-content { padding:18px 14px 36px; }
  .admin-topbar { padding:0 14px; }
  .stats-grid { grid-template-columns:1fr 1fr; }
  .chat-admin-layout { grid-template-columns:1fr; }
  .chat-sidebar { display:none; }
}
@media (max-width: 560px) {
  .login-card { padding:22px; }
  .login-hero { display:none; }
  .login-panel { min-height:100vh; }
  .form-grid { grid-template-columns:1fr; }
  .form-grid .span-2 { grid-column:span 1; }
  .stats-grid { grid-template-columns:1fr; }
  .page-head { flex-direction:column; }
  .quick-grid { grid-template-columns:repeat(4,1fr); }
  .modal-backdrop { padding:0; align-items:end; }
  .modal { max-height:92vh; border-radius:22px 22px 0 0; }
}

/* V1-P002: screenshot-inspired emerald / slate palette */
.admin-app::before{content:"";position:fixed;left:0;right:0;top:0;height:3px;background:#318af2;z-index:80;}
.admin-sidebar{background:#112d25;}
.admin-nav button.active{background:#214f42;border-left:3px solid #42b99b;box-shadow:none;}
.admin-topbar{background:rgba(247,250,249,.96);}
.card,.stat-card{border-color:#d8e5e0;box-shadow:0 8px 24px rgba(24,72,59,.06);}
.btn.primary,.btn.success{background:#117864;}
.btn.primary:hover,.btn.success:hover{background:#0d6756;}
th{background:#f1f6f4;color:#63736d;}
tr:hover td{background:#f4faf7;}
.mobile-header{background:linear-gradient(135deg,#125f51,#19826d);}

/* V001R-P004: secure attendance-point setup and three-stage employee check-in */
.justify-center{justify-content:center}.flex-wrap{flex-wrap:wrap}.mt-6{margin-top:6px}
.security-callout{display:flex;flex-direction:column;gap:6px;padding:14px 16px;border:1px solid #b9ddd2;background:#eff9f6;border-radius:14px;color:#144c3e;line-height:1.55}
.security-callout b{font-size:14px}.security-callout span{font-size:12px;color:#4e7167}
.location-flow{display:grid;grid-template-columns:1fr auto 1fr auto 1fr;align-items:center;gap:10px}
.location-flow>div{background:var(--panel-2);border:1px solid var(--line);border-radius:14px;padding:14px;min-height:86px}
.location-flow b,.location-flow span{display:block}.location-flow b{color:var(--primary);margin-bottom:6px}.location-flow span{font-size:11px;color:var(--muted);line-height:1.5}.location-flow i{color:#8da49d;font-style:normal;font-size:20px}
.location-card-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:14px}
.location-card{border:1px solid var(--line);background:linear-gradient(180deg,#fff,#f8fbfa);border-radius:16px;padding:17px;box-shadow:0 5px 15px rgba(17,72,60,.04)}
.location-coordinates{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:14px}
.location-coordinates span{display:block;background:#eef6f3;border-radius:10px;padding:9px;font-size:10px;color:var(--muted)}
.location-coordinates b{display:block;color:var(--text);font-size:12px;margin-top:3px}
.location-capture{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:14px;border:1px dashed #91bfb2;background:#f5fbf9;border-radius:16px;padding:18px}
.location-pin{width:52px;height:52px;border-radius:16px;background:var(--primary-soft);display:grid;place-items:center;font-size:25px}
.qr-print-sheet{text-align:center;border:1px solid var(--line);border-radius:18px;padding:24px;background:white}
.qr-print-sheet img{width:min(390px,90%);image-rendering:pixelated}.qr-company{font-size:14px;font-weight:750;color:var(--muted)}.qr-title{font-size:24px;font-weight:850;margin:8px 0 12px}.qr-rule{max-width:640px;margin:14px auto;line-height:1.75;font-weight:650;color:#1f4f43}
.attendance-steps{margin:15px 0}.attendance-live-status{display:flex;flex-direction:column;gap:5px;text-align:center;padding:13px 15px;border-radius:13px;background:#f2f6f5;border:1px solid var(--line)}
.attendance-live-status b{font-size:14px}.attendance-live-status span{font-size:11px;color:var(--muted);line-height:1.55}.attendance-live-status.success{background:var(--success-soft);border-color:#b8dfd1;color:var(--success)}.attendance-live-status.error{background:var(--danger-soft);border-color:#efc2ca;color:var(--danger)}.attendance-live-status.warning{background:var(--warning-soft);border-color:#efd39d;color:var(--warning)}
.manual-qr-panel{margin-top:12px;padding:12px;background:#fff9ec;border:1px solid #efd7a7;border-radius:12px}.manual-qr-panel label{display:block;font-size:11px;color:#7d5b19;margin-bottom:8px;line-height:1.5}
.qr-camera{height:300px;margin-top:14px;background:radial-gradient(circle at center,#263a34,#0b1713)}
@media(max-width:700px){.location-flow{grid-template-columns:1fr}.location-flow i{transform:rotate(90deg);text-align:center}.location-coordinates{grid-template-columns:1fr}.location-capture{grid-template-columns:auto 1fr}.location-capture .btn{grid-column:1/-1}.qr-camera{height:240px}}

/* V1.1 / P005: organization, employee lifecycle, contract center and system management */
.row-actions{display:flex;gap:6px;flex-wrap:wrap;min-width:170px}
.v11-tabs{grid-column:1/-1;display:flex;gap:8px;overflow:auto;border-bottom:1px solid var(--line);padding-bottom:10px;margin-bottom:4px}
.v11-tabs span{padding:7px 12px;border-radius:999px;background:var(--panel-2);color:var(--muted);font-size:12px;white-space:nowrap}
.v11-tabs span.active{background:var(--primary-soft);color:var(--primary);font-weight:750}
.check-row{display:flex;align-items:center;gap:8px;color:var(--text);line-height:1.5}.check-row input{width:17px;height:17px;accent-color:var(--primary)}
.account-action-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.account-action{border:1px solid var(--line);background:linear-gradient(180deg,#fff,#f7fbf9);border-radius:14px;padding:16px;text-align:left;color:var(--text)}
.account-action:hover{border-color:#9fcbbf;box-shadow:var(--shadow-sm)}.account-action b,.account-action span{display:block}.account-action span{font-size:11px;color:var(--muted);margin-top:5px;line-height:1.5}.account-action.danger{border-color:#efc7ce;background:#fff7f8}.account-action.danger b{color:var(--danger)}
.rule-list-v11{display:grid;gap:12px}.rule-list-v11>div{padding:13px 14px;border:1px solid var(--line);border-radius:13px;background:var(--panel-2)}.rule-list-v11 b,.rule-list-v11 span{display:block}.rule-list-v11 b{color:var(--primary);margin-bottom:5px}.rule-list-v11 span{font-size:11px;color:var(--muted);line-height:1.55}
.weekday-selector{display:flex;gap:8px;flex-wrap:wrap}.weekday-selector label{display:flex;align-items:center;gap:5px;padding:8px 10px;border:1px solid var(--line);border-radius:10px;background:#fff;font-size:12px}.weekday-selector input{accent-color:var(--primary)}
.contract-flow-v11{display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap}.contract-flow-v11 span{background:var(--primary-soft);color:var(--primary);padding:8px 10px;border-radius:10px;font-size:11px;font-weight:700}.contract-flow-v11 i{font-style:normal;color:#8ba39c}
.contract-editor-v11{min-height:360px;line-height:1.75;font-family:var(--font)}
.contract-summary-v11{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}.contract-summary-v11>div{border:1px solid var(--line);border-radius:12px;padding:12px;background:var(--panel-2)}.contract-summary-v11 span,.contract-summary-v11 b{display:block}.contract-summary-v11 span{font-size:10px;color:var(--muted);margin-bottom:5px}
.system-metrics-v11{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}.system-metrics-v11>div{padding:13px;border:1px solid var(--line);border-radius:13px;background:var(--panel-2)}.system-metrics-v11 span,.system-metrics-v11 b{display:block}.system-metrics-v11 span{font-size:10px;color:var(--muted)}.system-metrics-v11 b{font-size:22px;margin-top:5px}
.status-suspended,.status-withdrawn{color:var(--warning);background:var(--warning-soft)}
.status-resigned,.status-voided,.status-blacklisted{color:var(--danger);background:var(--danger-soft)}
.status-active,.status-signed{color:var(--success);background:var(--success-soft)}
.status-draft{color:var(--muted);background:#eef1f0}
@media(max-width:820px){.account-action-grid,.contract-summary-v11,.system-metrics-v11{grid-template-columns:1fr 1fr}}
@media(max-width:560px){.account-action-grid,.contract-summary-v11,.system-metrics-v11{grid-template-columns:1fr}.row-actions{min-width:140px}.contract-editor-v11{min-height:280px}}

/* V1.3 / P007: face enrollment + conditional compensation rules */
.comp-rule-grid-v13{grid-column:1/-1;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:4px}
.comp-rule-card-v13{border:1px solid var(--line);border-radius:15px;padding:14px;background:linear-gradient(180deg,#fff,#f6fbf9);display:grid;gap:10px}
.comp-rule-head-v13{display:flex;align-items:center;justify-content:space-between;gap:8px}.comp-rule-head-v13 b{color:var(--primary)}
.comp-rule-fields-v13{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.comp-rule-fields-v13 .field{min-width:0}
.comp-rule-card-v13 .rule-note-v13{font-size:10px;color:var(--muted);line-height:1.55;background:var(--panel-2);border-radius:10px;padding:9px 10px}
.face-enroll-panel-v13{display:grid;grid-template-columns:minmax(210px,1fr) minmax(210px,320px);gap:12px;padding:14px;border:1px solid #aed4c9;border-radius:16px;background:#f3faf7;align-items:center}
.face-enroll-copy-v13{display:flex;flex-direction:column;gap:6px}.face-enroll-copy-v13 b{color:var(--primary);font-size:14px}.face-enroll-copy-v13 span{font-size:11px;color:var(--muted);line-height:1.6}
.face-enroll-video-v13{width:100%;height:190px;object-fit:cover;border-radius:14px;background:#102820;transform:scaleX(-1)}
.face-enroll-actions-v13{grid-column:1/-1;display:flex;gap:9px;align-items:center;flex-wrap:wrap}.face-enroll-panel-v13>.xsmall{grid-column:1/-1}
.face-action-pill-v13{border:0;cursor:pointer;font:inherit}.face-action-pill-v13:hover{filter:brightness(.96)}
.notice-box{padding:11px 13px;border:1px solid #badbd1;background:#f0f8f5;border-radius:12px;color:#42665c;font-size:11px;line-height:1.6}
@media(max-width:820px){.comp-rule-grid-v13{grid-template-columns:1fr}.comp-rule-fields-v13{grid-template-columns:1fr 1fr}.face-enroll-panel-v13{grid-template-columns:1fr}.face-enroll-video-v13{height:260px}.face-enroll-actions-v13,.face-enroll-panel-v13>.xsmall{grid-column:1}}
@media(max-width:560px){.comp-rule-fields-v13{grid-template-columns:1fr}.face-enroll-video-v13{height:230px}}
.bonus-section-title-v13{display:flex;flex-direction:column;gap:5px;margin:8px 0 10px}.bonus-section-title-v13 b{font-size:14px;color:var(--primary)}.bonus-section-title-v13 span{font-size:11px;color:var(--muted)}
.bonus-rules-grid-v13{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.bonus-rule-card-v13{border:1px solid var(--line);border-radius:15px;padding:14px;background:linear-gradient(180deg,#fff,#f5faf8)}
.bonus-rule-head-v13{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-bottom:10px}.bonus-rule-head-v13 b,.bonus-rule-head-v13 span{display:block}.bonus-rule-head-v13 b{color:var(--primary)}.bonus-rule-head-v13 span{font-size:10px;color:var(--muted);margin-top:4px;line-height:1.5}.switch-line-v13{display:flex;align-items:center;gap:5px;font-size:11px;white-space:nowrap}.switch-line-v13 input{accent-color:var(--primary)}
.bonus-rule-fields-v13{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.face-pill-v13{border:0;cursor:pointer;font:inherit}.face-pill-v13:hover{filter:brightness(.96)}
@media(max-width:820px){.bonus-rules-grid-v13{grid-template-columns:1fr}}@media(max-width:560px){.bonus-rule-fields-v13{grid-template-columns:1fr}}

/* V1.4 / P008: attendance coordinate snapshots, review and export */
.attendance-point{min-width:178px;line-height:1.55}
.attendance-point code{display:block;font-size:11px;color:var(--text);background:#eef6f3;padding:4px 7px;border-radius:7px;margin-top:4px}
.attendance-result-note{max-width:260px;white-space:normal;line-height:1.45}
.attendance-review-actions{display:flex;gap:6px;flex-wrap:wrap;min-width:138px}
.attendance-toolbar-group{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
@media(max-width:900px){.attendance-toolbar-group{width:100%}.attendance-toolbar-group .select,.attendance-toolbar-group .search-box{flex:1;min-width:150px}}

/* V1.8-P012 internal messaging and salesperson portal */
.phone-app.messages-active .mobile-header { display:none; }
.phone-app.messages-active .mobile-content { padding:0 0 72px; background:#ededed; min-height:100vh; }
.wechat-messages-page { position:relative; min-height:calc(100vh - 72px); background:#ededed; }
.wechat-page-header { height:54px; padding:env(safe-area-inset-top) 14px 0; background:#f7f7f7; border-bottom:1px solid #d9d9d9; display:grid; grid-template-columns:44px 1fr 44px; align-items:center; position:sticky; top:0; z-index:34; }
.wechat-page-header b { text-align:center; font-size:17px; letter-spacing:.02em; }
.wechat-header-spacer { width:44px; }
.wechat-plus-btn { width:38px; height:38px; border:0; background:transparent; font-size:27px; line-height:1; border-radius:8px; }
.wechat-plus-btn:active { background:#e2e2e2; }
.wechat-search-bar { margin:8px 12px 7px; height:38px; background:white; border-radius:6px; display:flex; align-items:center; justify-content:center; gap:7px; color:#9b9b9b; padding:0 12px; }
.wechat-search-bar span { font-size:20px; transform:rotate(-15deg); }
.wechat-search-bar input { flex:1; border:0; outline:0; background:transparent; text-align:center; font-size:14px; min-width:0; }
.wechat-search-bar:focus-within input { text-align:left; }
.wechat-plus-menu { position:fixed; z-index:120; top:58px; right:max(12px,calc((100vw - min(100vw,500px))/2 + 12px)); width:196px; color:white; background:#4b4b4b; border-radius:4px; box-shadow:0 13px 34px rgba(0,0,0,.28); overflow:visible; }
.wechat-plus-menu::before { content:""; position:absolute; top:-8px; right:18px; width:16px; height:16px; background:#4b4b4b; transform:rotate(45deg); }
.wechat-plus-menu button { position:relative; z-index:1; width:100%; height:54px; border:0; color:white; background:transparent; display:flex; align-items:center; gap:15px; padding:0 17px; font-size:15px; border-bottom:1px solid rgba(255,255,255,.12); text-align:left; }
.wechat-plus-menu button:last-child { border-bottom:0; }
.wechat-plus-menu button:active { background:#5a5a5a; }
.wechat-plus-menu button span { width:25px; text-align:center; font-size:22px; }
.wechat-conversation-list { background:white; border-top:1px solid #dedede; border-bottom:1px solid #dedede; }
.wechat-conversation-row { width:100%; min-height:72px; border:0; background:white; display:flex; align-items:center; gap:11px; padding:10px 13px; text-align:left; position:relative; }
.wechat-conversation-row::after { content:""; position:absolute; left:75px; right:0; bottom:0; height:1px; background:#e6e6e6; transform:scaleY(.5); }
.wechat-conversation-row:last-child::after { display:none; }
.wechat-conversation-row:active { background:#e9e9e9; }
.wechat-conversation-row .avatar { width:50px; height:50px; border-radius:5px; font-size:16px; background:#dceee9; }
.wechat-conversation-main { flex:1; min-width:0; }
.wechat-conversation-titleline { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.wechat-conversation-title { font-size:16px; font-weight:500; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.wechat-conversation-time { color:#b2b2b2; font-size:11px; white-space:nowrap; }
.wechat-conversation-preview { margin-top:5px; color:#999; font-size:13px; display:flex; align-items:center; justify-content:space-between; gap:8px; min-width:0; }
.wechat-conversation-preview > span:first-child { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.wechat-conversation-row .badge-count { position:absolute; left:53px; top:5px; min-width:18px; height:18px; font-size:10px; }
.wechat-muted { color:#b7b7b7; font-size:12px; }
.wechat-pin { font-size:11px; color:#999; }

.message-layout { width:min(100%,500px); background:#ededed; }
.wechat-chat-topbar { height:55px; padding-top:env(safe-area-inset-top); background:#f7f7f7; border-color:#d5d5d5; }
.wechat-chat-topbar button { border-radius:8px; font-size:25px; color:#111; }
.wechat-chat-topbar button:last-child { font-size:17px; font-weight:800; letter-spacing:1px; }
.wechat-chat-topbar .title b { font-size:16px; font-weight:600; }
.wechat-chat-topbar .title span { font-size:9px; }
.wechat-message-scroll { background:#ededed; padding:13px 12px 18px; }
.message-time-separator { width:max-content; max-width:80%; margin:14px auto 7px; padding:3px 7px; border-radius:4px; color:#a1a1a1; font-size:11px; text-align:center; }
.message-bubble-row { align-items:flex-start; margin:7px 0; }
.message-bubble-row .avatar.sm { width:40px; height:40px; border-radius:5px; font-size:13px; }
.message-bubble { max-width:72%; border-radius:5px; padding:9px 11px; box-shadow:none; background:white; position:relative; font-size:15px; line-height:1.48; }
.message-bubble::before { content:""; position:absolute; left:-6px; top:13px; width:12px; height:12px; background:white; transform:rotate(45deg); border-radius:1px; }
.message-bubble-row.mine .message-bubble { background:#95ec69; border-radius:5px; }
.message-bubble-row.mine .message-bubble::before { left:auto; right:-6px; background:#95ec69; }
.message-meta { margin-top:4px; color:#8e8e8e; font-size:9px; }
.message-sender { margin:-2px 0 5px; color:#8c8c8c; font-size:10px; }
.message-system-row { text-align:center; margin:12px auto; color:#9d9d9d; font-size:11px; line-height:1.5; }
.message-system-row span { display:inline-block; background:#d5d5d5; color:white; border-radius:4px; padding:3px 8px; }
.message-reply-quote { border-left:3px solid rgba(0,0,0,.18); padding-left:7px; margin-bottom:7px; color:#6f6f6f; font-size:11px; max-width:240px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.wechat-image-message { display:block; max-width:220px; max-height:300px; border-radius:5px; object-fit:cover; }
.wechat-file-card { min-width:210px; display:flex; gap:10px; align-items:center; }
.wechat-file-card .file-icon { width:46px; height:50px; background:#f3f3f3; display:grid; place-items:center; font-size:25px; border-radius:4px; }
.wechat-location-card { min-width:220px; }
.wechat-location-card b { display:block; font-size:14px; }
.wechat-location-card span { display:block; margin-top:4px; font-size:11px; color:#888; }
.wechat-location-map { margin-top:8px; height:84px; border-radius:4px; background:linear-gradient(135deg,#d8e9df,#c8dbd2); display:grid; place-items:center; color:#477366; font-size:28px; }
.wechat-location-card,.wechat-contact-card { border:0; background:transparent; color:inherit; font:inherit; text-align:left; width:100%; padding:0; }
.wechat-contact-card { min-width:220px; }
.wechat-contact-card .contact-card-main { display:flex; align-items:center; gap:10px; padding-bottom:8px; }
.wechat-contact-card .contact-card-main .avatar { width:44px; height:44px; border-radius:5px; }
.wechat-contact-card .contact-card-footer { border-top:1px solid rgba(0,0,0,.09); padding-top:6px; color:#888; font-size:10px; }
.voice-bubble { min-width:85px; justify-content:flex-end; }
.message-bubble-row:not(.mine) .voice-bubble { flex-direction:row-reverse; }

.reply-preview { flex:0 0 auto; background:#f7f7f7; border-top:1px solid #ddd; padding:7px 13px; display:flex; align-items:center; gap:10px; }
.reply-preview > div { flex:1; min-width:0; }
.reply-preview b,.reply-preview span { display:block; font-size:11px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.reply-preview span { color:#888; margin-top:2px; }
.reply-preview button { width:28px; height:28px; border:0; background:transparent; font-size:20px; color:#888; }
.wechat-compose { background:#f7f7f7; border-color:#d2d2d2; gap:7px; align-items:center; }
.wechat-compose .compose-icon { width:34px; height:34px; background:transparent; border-radius:50%; border:2px solid #555; color:#444; font-size:18px; line-height:1; }
.wechat-compose textarea { min-height:38px; border:0; border-radius:5px; background:white; padding:9px 10px; font-size:15px; }
.wechat-compose .send { min-width:55px; width:auto; border-radius:4px; height:36px; background:#07c160; padding:0 11px; }
.hold-to-talk { flex:1 !important; width:auto !important; height:38px !important; border-radius:5px !important; background:white !important; font-size:14px; color:#222; }
.hold-to-talk.recording { background:#d7d7d7 !important; }
.emoji-panel { flex:0 0 auto; background:#f7f7f7; border-top:1px solid #ddd; padding:15px 14px calc(16px + env(safe-area-inset-bottom)); display:grid; grid-template-columns:repeat(8,1fr); gap:11px; max-height:230px; overflow:auto; }
.emoji-panel button { border:0; background:transparent; font-size:25px; line-height:1; padding:4px; }
.wechat-chat-extra { background:#f7f7f7; border-color:#d2d2d2; padding:20px 13px calc(18px + env(safe-area-inset-bottom)); gap:20px 10px; }
.wechat-chat-extra button { font-size:11px; color:#777; }
.wechat-chat-extra .exicon { width:58px; height:58px; border-radius:12px; background:white; border:1px solid #e6e6e6; font-size:25px; color:#454545; }
.recording-bar { bottom:110px; z-index:95; border-radius:8px; }

.wechat-group-picker { max-height:420px; overflow:auto; }
.wechat-contact-check { display:flex; align-items:center; gap:11px; padding:11px 4px; border-bottom:1px solid var(--line); }
.wechat-contact-check input { width:20px; height:20px; accent-color:#07c160; }
.wechat-contact-check .avatar { width:42px; height:42px; border-radius:5px; }
.wechat-member-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:13px 8px; }
.wechat-member { min-width:0; text-align:center; }
.wechat-member .avatar { margin:0 auto 5px; width:46px; height:46px; border-radius:5px; }
.wechat-member span { display:block; font-size:10px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.wechat-qr-card { text-align:center; padding:18px; background:white; border-radius:16px; }
.wechat-qr-card img { width:min(260px,80vw); border-radius:8px; }
.wechat-scan-frame { position:relative; overflow:hidden; border-radius:14px; background:#111; }
.wechat-scan-frame video { width:100%; height:330px; object-fit:cover; display:block; }
.wechat-scan-box { position:absolute; width:220px; height:220px; left:50%; top:50%; transform:translate(-50%,-50%); border:2px solid rgba(255,255,255,.9); box-shadow:0 0 0 999px rgba(0,0,0,.35); }
.wechat-scan-line { position:absolute; left:8px; right:8px; top:10px; height:2px; background:#07c160; animation:wechatScan 2s linear infinite; }
@keyframes wechatScan { from{transform:translateY(0)} to{transform:translateY(195px)} }
.message-action-menu { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; }
.message-action-menu button { border:0; background:var(--panel-2); border-radius:10px; padding:13px 5px; font-size:12px; }

@media (max-width:520px){
  .modal-backdrop { padding:0; align-items:end; }
  .modal { width:100%; max-height:92vh; border-radius:18px 18px 0 0; }
  .wechat-member-grid { grid-template-columns:repeat(5,minmax(0,1fr)); }
}

/* V1.8-P012 salesperson order-entry client */
.sales-body{background:#eef6f3}.sales-app{min-height:100vh;padding-bottom:94px}.sales-header{position:sticky;top:0;z-index:20;background:linear-gradient(135deg,#0f6f5c,#178c72);color:#fff;padding:calc(14px + env(safe-area-inset-top)) 18px 16px;display:flex;align-items:center;justify-content:space-between}.sales-user{display:flex;align-items:center;gap:12px}.sales-user .avatar{background:rgba(255,255,255,.18);color:#fff}.sales-user b{display:block;font-size:17px}.sales-user span{display:block;font-size:12px;color:rgba(255,255,255,.75);margin-top:3px}.sales-head-actions{display:flex;gap:8px}.sales-main{padding:16px}.sales-page{display:none}.sales-page.active{display:block}.sales-title-row{display:flex;align-items:flex-start;justify-content:space-between;margin:4px 0 14px}.sales-title-row h1{font-size:25px;margin:0;color:#10241f}.sales-title-row p{margin:4px 0 0;color:#71827e;font-size:12px}.erp-chip{padding:7px 11px;background:#daf3e9;color:#08765f;border-radius:999px;font-size:11px;font-weight:700}.erp-chip.offline{background:#fff1db;color:#b66d00}.customer-selector{width:100%;border:1px solid #cfe1dc;background:#fff;border-radius:18px;padding:15px;display:flex;align-items:center;gap:12px;text-align:left;box-shadow:0 8px 22px rgba(18,66,55,.06)}.customer-selector.selected{border-color:#5eb6a3;background:#f5fffb}.customer-selector-icon{width:45px;height:45px;border-radius:14px;background:#e3f5ef;color:#087c65;display:grid;place-items:center;font-weight:800}.customer-selector-main{flex:1;min-width:0}.customer-selector-main b{display:block;font-size:16px}.customer-selector-main small{display:block;color:#70817c;margin-top:5px;line-height:1.35}.sales-search{height:46px;background:#fff;border:1px solid #d5e3df;border-radius:14px;display:flex;align-items:center;padding:0 13px;gap:8px;margin:14px 0}.sales-search input{border:0;outline:0;width:100%;font-size:14px;background:transparent}.sales-category-row{display:flex;gap:8px;overflow:auto;padding-bottom:9px;scrollbar-width:none}.sales-category-row button{white-space:nowrap;border:0;background:#fff;color:#64736f;border-radius:999px;padding:9px 14px}.sales-category-row button.active{background:#117d68;color:#fff}.sales-product-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:5px}.sales-product-card{background:#fff;border:1px solid #dce8e5;border-radius:17px;overflow:hidden;min-width:0}.sales-product-card.sold-out{opacity:.55}.sales-product-image{height:145px;position:relative;background:#eaf2f0}.sales-product-image img{width:100%;height:100%;object-fit:cover}.sales-product-placeholder{height:100%;display:grid;place-content:center;text-align:center;background:linear-gradient(145deg,#d8eee8,#f5faf8);color:#126c5b}.sales-product-placeholder span{font-size:23px;font-weight:900}.sales-product-placeholder small{margin-top:4px}.stock-badge{position:absolute;left:7px;bottom:7px;background:rgba(13,44,37,.76);color:#fff;border-radius:999px;padding:4px 7px;font-size:9px}.sales-product-info{padding:11px}.sales-product-info>small{color:#0b8a70}.sales-product-info>b{display:block;margin:5px 0;font-size:14px;line-height:1.35}.sales-product-info>span{display:block;font-size:10px;color:#7b8985;min-height:27px}.sales-product-bottom{margin-top:9px;display:flex;gap:7px;align-items:center;justify-content:space-between}.sales-product-bottom strong{font-size:14px;color:#e44d26}.sales-product-bottom button{border:0;background:#13826c;color:#fff;border-radius:10px;padding:7px 8px;font-size:10px}.sales-product-bottom button:disabled{background:#aab6b3}.sales-empty-select{grid-column:1/-1;border:1px dashed #85b9ad;background:#f8fffc;border-radius:20px;padding:35px 20px;display:grid;gap:9px;text-align:center;color:#126c5b}.sales-empty-select span{font-size:34px}.sales-empty-select small{color:#73837f}.sales-bottom-nav{position:fixed;z-index:25;left:0;right:0;bottom:0;background:#fff;border-top:1px solid #dce5e3;padding:8px 8px calc(8px + env(safe-area-inset-bottom));display:grid;grid-template-columns:repeat(5,1fr)}.sales-bottom-nav button{border:0;background:transparent;color:#7b8988;display:grid;gap:3px;place-items:center;font-size:11px}.sales-bottom-nav button span{font-size:21px}.sales-bottom-nav button.active{color:#0b826a}.sales-cart-fab{position:fixed;left:18px;right:18px;bottom:84px;z-index:24;border:0;border-radius:17px;background:#142d27;color:#fff;padding:13px 16px;display:flex;align-items:center;gap:10px;box-shadow:0 14px 30px rgba(13,45,37,.25)}.sales-cart-fab strong{margin-left:auto}.sales-list{display:grid;gap:11px}.sales-customer-card{background:#fff;border:1px solid #d8e5e1;border-radius:17px;padding:14px}.sales-customer-card.blocked{border-color:#f0c98a}.sales-customer-top{display:flex;align-items:center;gap:10px}.sales-customer-top>div:nth-child(2){flex:1}.sales-customer-top b{display:block}.sales-customer-top span{display:block;color:#7b8985;font-size:11px;margin-top:4px}.sales-customer-top button{border:0;background:#e0f5ef;color:#08765f;border-radius:11px;padding:8px 13px}.sales-credit-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:7px;margin-top:12px}.sales-credit-grid span{background:#f4f8f7;border-radius:10px;padding:8px;color:#73817d;font-size:10px}.sales-credit-grid b{display:block;color:#1d302b;font-size:12px;margin-top:3px}.credit-block-note{margin-top:10px;background:#fff3df;color:#9a6106;border-radius:10px;padding:8px;font-size:11px}.sales-order-card{width:100%;border:1px solid #d8e5e1;background:#fff;border-radius:16px;padding:14px;display:flex;justify-content:space-between;text-align:left}.sales-order-card b,.sales-order-card strong{display:block}.sales-order-card span{display:block;font-size:11px;color:#778681;margin-top:5px}.sales-order-card>div:last-child{text-align:right}.modal-sales-search{margin-top:0}.cart-customer-summary{margin-bottom:13px}.sales-cart-item{display:grid;grid-template-columns:68px 1fr auto;gap:10px;padding:12px 0;border-bottom:1px solid #e8efed}.cart-thumb{width:68px;height:68px;border-radius:12px;overflow:hidden}.cart-thumb .sales-product-placeholder{font-size:10px}.cart-thumb .sales-product-placeholder span{font-size:13px}.cart-info b{display:block}.cart-info span{display:block;font-size:10px;color:#7b8985;margin:5px 0}.cart-info strong{color:#e44d26}.cart-qty{display:grid;grid-template-columns:28px 42px 28px;align-content:center}.cart-qty button,.cart-qty input{height:29px;border:1px solid #d9e3e0;background:#fff;text-align:center}.cart-qty input{width:42px}.cart-delete{grid-column:1/-1!important;border:0!important;color:#c43e3e!important;font-size:10px}.sales-checkout-form{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;margin-top:15px}.sales-checkout-form .span-2{grid-column:1/-1}.checkout-totals{grid-column:1/-1;background:#f3f8f6;border-radius:14px;padding:13px;display:grid;gap:7px}.checkout-totals span,.checkout-totals strong{display:flex;justify-content:space-between}.checkout-totals strong{font-size:17px;border-top:1px solid #d8e5e1;padding-top:9px}.order-detail-head{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}.order-detail-head>div{background:#f3f8f6;border-radius:12px;padding:11px}.order-detail-head span{display:block;color:#778681;font-size:10px}.order-detail-head b{display:block;margin-top:4px}.sales-order-items{margin-top:15px}.sales-order-items>div{display:flex;justify-content:space-between;gap:12px;border-bottom:1px solid #e5ecea;padding:11px 0}.sales-order-items span{display:block}.sales-order-items small{display:block;color:#778681;margin-top:4px}.sales-order-items>div>span:last-child{text-align:right}.sales-order-items>div>span:last-child b{display:block;margin-top:5px}.order-detail-note{margin-top:14px;background:#f7faf9;border-radius:13px;padding:13px}.order-detail-note p{white-space:pre-wrap}.language-options{display:grid;gap:9px}.language-options button{border:1px solid #d4e2de;background:#fff;border-radius:13px;padding:14px;font-size:16px}.sales-body .modal{max-height:88vh}.sales-body .modal-body{overflow:auto}.hidden{display:none!important}@media(min-width:720px){.sales-app{max-width:720px;margin:auto;background:#eef6f3;box-shadow:0 0 35px rgba(0,0,0,.08)}.sales-header,.sales-bottom-nav{max-width:720px;margin:auto}.sales-cart-fab{left:50%;right:auto;width:684px;transform:translateX(-50%)}.sales-product-grid{grid-template-columns:repeat(3,1fr)}}
.login-language-row{display:flex;gap:8px;margin:0 0 14px}.login-language-row button{border:1px solid #d5e2de;background:#f7faf9;color:#36514a;border-radius:999px;padding:7px 12px}.login-language-row button:hover{border-color:#13826c;color:#0b826a}

/* V1.8 salesperson ERP order bridge refinements */
.erp-order-hint{background:#eef7f4;border:1px dashed #9fc9bf;border-radius:12px;padding:11px;color:#527069;font-size:11px;line-height:1.55}
.login-language-row button.active{background:#13826c;color:#fff;border-color:#13826c}
.sales-order-card:active,.customer-selector:active,.sales-product-bottom button:active{transform:scale(.99)}
@media(max-width:420px){.sales-product-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.sales-main{padding:12px}.sales-product-image{height:132px}.sales-product-bottom{align-items:flex-end}.sales-product-bottom button{padding:7px 6px}}

/* V1.10-P014 full i18n and per-device local chat */
.admin-chat-nav { position: relative; }
.admin-chat-nav .badge-count { margin-left: auto; min-width: 18px; height: 18px; line-height: 18px; font-size: 10px; }
.admin-wechat-shell { overflow: hidden; min-height: 720px; height: calc(100vh - 150px); display: flex; flex-direction: column; }
.admin-wechat-featurebar { min-height: 48px; padding: 10px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 12px; background: #f8fbfa; }
.admin-wechat-featurebar b { color: var(--text); }
.admin-wechat-frame { flex: 1; width: 100%; min-height: 650px; border: 0; background: #eef4f2; }

html.admin-chat-root,
body.admin-chat-mode { min-height: 100%; height: 100%; background: #eef4f2; }
body.admin-chat-mode { overflow: hidden; }
body.admin-chat-mode .phone-app { width: 100%; max-width: none; min-height: 100vh; height: 100vh; box-shadow: none; background: #eef4f2; }
body.admin-chat-mode .mobile-header,
body.admin-chat-mode .mobile-bottom-nav { display: none !important; }
body.admin-chat-mode .mobile-content { padding: 0; min-height: 100vh; height: 100vh; }
body.admin-chat-mode .mobile-page { display: none !important; }
body.admin-chat-mode .mobile-page[data-page="messages"] { display: flex !important; flex-direction: column; min-height: 100vh; height: 100vh; animation: none; }
body.admin-chat-mode .wechat-page-header { flex: 0 0 auto; min-height: 58px; padding-left: 18px; padding-right: 18px; }
body.admin-chat-mode .wechat-search-bar { flex: 0 0 auto; margin: 10px 14px; }
body.admin-chat-mode .wechat-conversation-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-bottom: 18px; }
body.admin-chat-mode .wechat-conversation-row { min-height: 72px; }
body.admin-chat-mode .message-layout { width: 100%; max-width: none; left: 0; right: 0; }
body.admin-chat-mode .message-scroll { max-width: none; }
body.admin-chat-mode .admin-chat-role-hint { position: absolute; left: 18px; color: var(--muted); font-size: 11px; font-weight: 700; }
body.admin-chat-mode .wechat-header-spacer { width: 90px; }
body.admin-chat-embed .wechat-page-header { border-radius: 0; }

@media (min-width: 900px) {
  body.admin-chat-mode .wechat-conversation-list { width: min(100%, 760px); margin: 0 auto; border-left: 1px solid var(--line); border-right: 1px solid var(--line); background: white; }
  body.admin-chat-mode .wechat-search-bar { width: min(calc(100% - 28px), 732px); margin-left: auto; margin-right: auto; }
  body.admin-chat-mode .wechat-plus-menu { right: calc(50% - 380px); }
  body.admin-chat-mode .message-topbar,
  body.admin-chat-mode .message-compose,
  body.admin-chat-mode .reply-preview,
  body.admin-chat-mode .recording-bar,
  body.admin-chat-mode .emoji-panel,
  body.admin-chat-mode .chat-extra { max-width: 980px; margin-left: auto; margin-right: auto; width: 100%; }
  body.admin-chat-mode .message-scroll { width: min(100%, 980px); margin: 0 auto; }
}

@media (max-width: 900px) {
  .admin-wechat-shell { height: calc(100vh - 126px); min-height: 580px; }
  .admin-wechat-featurebar { display: none; }
  .admin-wechat-frame { min-height: 580px; }
}

/* V1.15 backend roles and login users */
.system-tabs-v15{justify-content:flex-start;gap:8px;margin:0 0 16px;overflow:auto;flex-wrap:nowrap}
.permission-matrix-v15{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:14px}
.permission-group-v15{box-shadow:none;border:1px solid var(--border)}
.permission-check-grid-v15{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.permission-check-v15{display:flex;align-items:flex-start;gap:9px;padding:10px;border:1px solid var(--border);border-radius:12px;background:var(--surface-soft);cursor:pointer}
.permission-check-v15 input{margin-top:3px;flex:none}
.permission-check-v15 span{display:grid;gap:3px;line-height:1.35}
.permission-check-v15 small{color:var(--muted);font-size:10px;word-break:break-all}
.permission-check-v15:has(input:checked){border-color:var(--primary);background:var(--primary-soft)}
@media(max-width:900px){.permission-matrix-v15,.permission-check-grid-v15{grid-template-columns:1fr}.system-tabs-v15 .btn{white-space:nowrap}}
.trade-body{margin:0;background:#f3f7f5;color:#18342c;font-family:system-ui,-apple-system,"PingFang SC",sans-serif}.trade-shell{display:grid;grid-template-columns:245px 1fr;min-height:100vh}.trade-sidebar{background:#0e342b;color:#d9ebe5;padding:24px 16px;display:flex;flex-direction:column}.trade-brand{font-size:22px;font-weight:800;padding:8px 12px 24px}.trade-brand small{display:block;font-size:12px;font-weight:400;opacity:.7;margin-top:6px}.trade-sidebar nav{display:grid;gap:5px}.trade-sidebar button{border:0;background:transparent;color:inherit;text-align:left;padding:12px 14px;border-radius:10px;font-size:15px;cursor:pointer}.trade-sidebar button.active,.trade-sidebar button:hover{background:#1d6654;color:white}.trade-back{margin-top:auto;color:#b8d5cc;text-decoration:none;padding:14px}.trade-main{padding:28px}.trade-main header{display:flex;justify-content:space-between;align-items:center;margin-bottom:25px}.trade-main h1{margin:0}.trade-main header p{margin:5px 0;color:#668078}.trade-stats{display:grid;grid-template-columns:repeat(5,minmax(120px,1fr));gap:14px;margin-bottom:28px}.trade-stats article{background:white;border:1px solid #dce9e4;border-radius:15px;padding:20px;box-shadow:0 4px 18px #153e3310}.trade-stats b{font-size:27px;display:block}.trade-stats span{color:#71847e}.trade-primary{float:right;margin-bottom:15px;background:#137963;color:#fff;border:0;border-radius:10px;padding:11px 18px;cursor:pointer}.trade-table-wrap{clear:both;overflow:auto;background:#fff;border:1px solid #dce9e4;border-radius:14px}.trade-table-wrap table{border-collapse:collapse;width:100%;font-size:13px}.trade-table-wrap th,.trade-table-wrap td{padding:11px 13px;border-bottom:1px solid #edf3f0;text-align:left;white-space:nowrap}.trade-table-wrap th{background:#eaf4f0}.trade-empty,.trade-error{clear:both;padding:55px;text-align:center;background:#fff;border-radius:14px;border:1px solid #dce9e4}.trade-error{color:#a32e2e}@media(max-width:800px){.trade-shell{grid-template-columns:1fr}.trade-sidebar{position:relative}.trade-sidebar nav{grid-template-columns:repeat(2,1fr)}.trade-main{padding:16px}.trade-stats{grid-template-columns:repeat(2,1fr)}}
.trade-nav-group{display:grid;gap:3px;margin-bottom:12px}.trade-nav-group>span{font-size:11px;text-transform:uppercase;opacity:.55;padding:6px 14px}.trade-nav-group button{padding:9px 14px;font-size:14px}.trade-toolbar{display:flex;justify-content:flex-end;gap:8px;min-height:46px}.trade-primary,.trade-secondary{float:none;margin:0;border:0;border-radius:10px;padding:10px 16px;font-weight:700}.trade-secondary{background:#e7f0ed;color:#244c41}.trade-secondary.danger{background:#fff0f1;color:#b62e40}.trade-actions{display:flex;gap:6px}.trade-actions button,.trade-section-head button,.trade-table-wrap td button{border:1px solid #ceded8;background:#f7fbf9;border-radius:8px;padding:6px 10px;color:#1d5c4b}.trade-section-head{display:flex;align-items:center;justify-content:space-between;margin:18px 0 10px}.trade-section-head h2,.trade-section-head h3{margin:0}.trade-modal{position:fixed;inset:0;background:#0b251f99;z-index:1000;display:none;align-items:center;justify-content:center;padding:20px}.trade-modal.open{display:flex}.trade-modal-card{background:white;border-radius:18px;width:min(1000px,96vw);max-height:92vh;display:flex;flex-direction:column;box-shadow:0 30px 90px #001b1466}.trade-modal-card>header{display:flex;align-items:center;justify-content:space-between;padding:18px 22px;border-bottom:1px solid #e2ece8}.trade-modal-card>header h2{margin:0}.trade-modal-card>header button{border:0;background:transparent;font-size:28px}.trade-modal-body{padding:22px;overflow:auto}.trade-modal-card>footer{display:flex;justify-content:flex-end;gap:9px;padding:16px 22px;border-top:1px solid #e2ece8}.trade-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-bottom:18px}.trade-field{display:grid;gap:6px}.trade-field>span{font-size:12px;font-weight:700;color:#557068}.trade-field input,.trade-field select,.trade-table-wrap input,.trade-table-wrap select{width:100%;border:1px solid #ceded8;border-radius:9px;padding:9px;background:#fff;min-width:110px}.trade-check{display:flex;align-items:center;gap:7px}.trade-detail-grid{display:grid;grid-template-columns:130px 1fr 130px 1fr;gap:10px;padding:14px;background:#f0f7f4;border-radius:12px;margin-bottom:18px}.trade-qr{text-align:center}.trade-qr img{width:280px}.trade-qr code{display:block;margin-top:12px;word-break:break-all}.trade-toast{position:fixed;right:24px;bottom:24px;background:#153e33;color:white;padding:13px 18px;border-radius:11px;z-index:1200;opacity:0;transform:translateY(10px);pointer-events:none;transition:.2s}.trade-toast.show{opacity:1;transform:none}.trade-toast.error{background:#a83240}@media(max-width:800px){.trade-sidebar{max-height:44vh;overflow:auto}.trade-main header{align-items:flex-start}.trade-form-grid,.trade-detail-grid{grid-template-columns:1fr}.trade-modal{padding:5px}.trade-modal-card{max-height:98vh}.trade-table-wrap th,.trade-table-wrap td{padding:9px}.trade-toolbar{flex-wrap:wrap}}
