:root {
  --bg: #f4faf7;
  --panel: #ffffff;
  --text: #17352c;
  --muted: #718980;
  --line: #d9ebe3;
  --primary: #168466;
  --primary-dark: #0f674f;
  --primary-soft: #e4f6ed;
  --danger: #c23c42;
  --warning: #aa7619;
}

* { box-sizing: border-box; }
body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
body::before {
  position: fixed; top: 0; right: 0; width: 42vw; height: 250px;
  border-radius: 0 0 0 100%; background: #edf9f3; content: ""; pointer-events: none;
}
button, input, select { font: inherit; }
button {
  min-height: 40px; padding: 0 16px; border: 1px solid transparent; border-radius: 6px;
  background: var(--primary); color: #fff; cursor: pointer; font-weight: 700;
  transition: background-color .18s ease, border-color .18s ease, transform .18s ease;
}
button:hover { background: var(--primary-dark); }
button:active { transform: translateY(1px); }
button.secondary { border-color: #d5ede2; background: var(--primary-soft); color: var(--primary-dark); }
button.secondary:hover { border-color: #a9d8c4; background: #d4f0e3; }
input, select {
  min-height: 40px; padding: 0 12px; border: 1px solid #cfe1d9; border-radius: 6px;
  background: #fff; color: var(--text); outline: none; transition: border-color .18s ease, box-shadow .18s ease;
}
input::placeholder { color: #9aaca5; }
input:focus, select:focus { border-color: #44af87; box-shadow: 0 0 0 3px rgba(38, 159, 114, .12); }
.hidden { display: none !important; }

/* Login */
.login-shell { position: relative; display: grid; min-height: 100vh; place-items: center; padding: 32px 24px; overflow: hidden; background: #f6fbf9; }
.login-shell::before, .login-shell::after { position: absolute; border: 32px solid #d8f3e5; border-radius: 50%; content: ""; }
.login-shell::before { top: -190px; left: -150px; width: 440px; height: 330px; transform: rotate(-19deg); }
.login-shell::after { right: -170px; bottom: -260px; width: 510px; height: 390px; border-color: #c7eedc; transform: rotate(13deg); }
.login-panel {
  position: relative; z-index: 1; width: min(440px, 100%); padding: 34px 36px 30px; overflow: hidden;
  border: 1px solid #d9ebe3; border-radius: 8px; background: rgba(255, 255, 255, .96); box-shadow: 0 18px 50px rgba(35, 103, 76, .10);
}
.login-panel-glow { position: absolute; border-radius: 50%; pointer-events: none; }
.glow-one { top: -62px; right: -36px; width: 150px; height: 150px; background: #e8f8ef; }
.glow-two { top: -30px; right: 76px; width: 80px; height: 80px; background: #f2fbf6; }
.login-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; color: var(--primary-dark); font-size: 15px; font-weight: 800; }
.logo-slot { display: grid; width: 82px; height: 36px; place-items: center; border: 1px dashed #90cbb4; border-radius: 6px; background: #fff; color: #258467; font-size: 12px; font-weight: 700; }
.login-illustration { position: relative; width: 82px; height: 82px; margin: 28px auto 16px; border-radius: 24px; background: #d9f6e8; }
.login-illustration .store-roof { position: absolute; top: 20px; left: 15px; width: 52px; height: 18px; border-radius: 8px 8px 4px 4px; background: #16a174; }
.login-illustration .store-front { position: absolute; left: 21px; bottom: 17px; width: 40px; height: 34px; border-radius: 4px; background: #fff; }
.login-illustration .store-door { position: absolute; right: 28px; bottom: 17px; width: 11px; height: 22px; border-radius: 3px 3px 0 0; background: #75d7ad; }
.login-eyebrow { position: relative; margin: 0 0 6px; color: #56947e; font-size: 12px; font-weight: 700; letter-spacing: 2px; text-align: center; }
.login-panel h1 { position: relative; margin: 0; color: #17382d; font-size: 28px; line-height: 1.25; text-align: center; }
.login-copy { position: relative; margin: 10px 0 28px; color: var(--muted); font-size: 14px; line-height: 1.6; text-align: center; }
.stack { position: relative; display: grid; gap: 16px; }
.stack label { display: grid; gap: 8px; color: #3b5e51; font-size: 14px; font-weight: 700; }
.stack input { width: 100%; }.stack button { min-height: 46px; margin-top: 4px; font-size: 16px; }
.login-footnote { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 28px 0 0; color: #95aaa1; font-size: 12px; }
.login-footnote i { width: 38px; height: 1px; background: #d9eae3; }

/* Application shell */
.app-shell { position: relative; display: grid; min-height: 100vh; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar { position: relative; display: flex; flex-direction: column; gap: 30px; padding: 28px 18px 20px; overflow: hidden; border-right: 1px solid #d8ebe2; background: #fff; }
.sidebar-aurora { position: absolute; top: -110px; left: -56px; width: 330px; height: 190px; border: 22px solid #ddf5e8; border-radius: 50%; transform: rotate(-12deg); pointer-events: none; }
.brand-row { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; padding: 0 10px; }
.brand-icon { position: relative; width: 48px; height: 48px; border-radius: 14px; background: #d9f5e7; }
.brand-icon::before { position: absolute; top: 12px; left: 9px; width: 30px; height: 11px; border-radius: 5px 5px 2px 2px; background: #15936e; content: ""; }
.brand-icon span { position: absolute; left: 14px; bottom: 10px; width: 20px; height: 16px; border-radius: 2px; background: #fff; }
.brand-icon span::after { position: absolute; right: 4px; bottom: 0; width: 6px; height: 10px; border-radius: 2px 2px 0 0; background: #68cf9f; content: ""; }
.brand-row strong, .brand-row span { display: block; }.brand-row strong { color: #1b4436; font-size: 17px; }.brand-row > div:last-child span { margin-top: 3px; color: #749087; font-size: 12px; }
nav { position: relative; display: grid; gap: 8px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; color: #386254; background: transparent; text-align: left; }
.nav-item:hover { background: #eaf7f0; color: #147655; }.nav-item.active { background: var(--primary); color: #fff; box-shadow: 0 9px 16px rgba(21, 132, 101, .17); }
.nav-glyph { display: grid; width: 22px; height: 22px; place-items: center; color: currentColor; font-size: 20px; font-weight: 400; line-height: 1; }.glyph-store { font-size: 19px; }.glyph-users { font-size: 18px; }.glyph-list { font-size: 22px; }
.sidebar-actions { position: relative; display: grid; gap: 8px; margin-top: auto; padding-top: 18px; border-top: 1px solid #e3f0ea; }
.sidebar-label { margin: 0 10px 2px; color: #91a89e; font-size: 12px; font-weight: 700; }
.last-login-ip { margin: 0 10px 4px; overflow-wrap: anywhere; color: #507a6b; font-size: 13px; line-height: 1.55; }
.sidebar-action { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 0 10px; border: 0; background: transparent; color: #58756b; font-size: 13px; font-weight: 600; text-align: left; }
.sidebar-action:hover { background: #eef8f3; color: #137d5e; }.sidebar-action > span { display: inline-grid; width: 18px; place-items: center; color: #65a28d; font-size: 18px; }.logout-action:hover { color: var(--danger); background: #fff4f4; }.logout-action:hover > span { color: var(--danger); }
.content { position: relative; min-width: 0; padding: 34px clamp(22px, 4vw, 56px) 44px; }
.topbar { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.page-kicker, .section-kicker { display: block; color: #52957c; font-size: 12px; font-weight: 800; letter-spacing: 1.6px; }
.topbar h2 { margin: 5px 0 0; color: #17382d; font-size: 30px; line-height: 1.2; }.topbar p { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.topbar-tools { display: flex; align-items: center; gap: 14px; }.topbar-orbit { display: none; }.icon-button { display: inline-flex; align-items: center; gap: 7px; }.icon-button span { font-size: 20px; font-weight: 400; }

/* Content */
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 34px; }
.metric { position: relative; display: flex; min-height: 134px; align-items: center; gap: 15px; padding: 22px; overflow: hidden; border: 1px solid #dbece5; border-radius: 8px; background: #fff; box-shadow: 0 10px 25px rgba(48, 105, 82, .045); }
.metric::after { position: absolute; right: -18px; bottom: -42px; width: 124px; height: 90px; border: 14px solid #ecf8f2; border-radius: 50%; content: ""; transform: rotate(-18deg); }.metric-verified::after { border-color: #dcf2e6; }.metric-pending::after { border-color: #e2f3f7; }
.metric-icon { position: relative; z-index: 1; display: grid; width: 48px; height: 48px; flex: 0 0 48px; place-items: center; border-radius: 14px; background: #e0f6ea; color: #168466; font-size: 25px; font-weight: 800; }.metric-verified .metric-icon { background: #d7f3e3; }.metric-pending .metric-icon { background: #e8f5fb; color: #3687ae; }
.metric > div { position: relative; z-index: 1; display: grid; gap: 6px; }.metric span:not(.metric-icon) { color: var(--muted); font-size: 14px; }.metric strong { color: #193d31; font-size: 34px; line-height: 1; }
.section-title-row { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 0 0 13px; } h3 { margin: 5px 0 0; color: #21473a; font-size: 20px; }.heading-count, .detail-summary { color: #658277; font-size: 13px; }
.tab-intro { display: flex; align-items: center; gap: 13px; margin: 0 0 20px; }.tab-intro-icon { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 14px; background: #e1f6eb; color: #168466; font-size: 23px; font-weight: 700; }.tab-intro p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.customer-toolbar, .merchant-toolbar { display: grid; gap: 12px; margin-bottom: 14px; }.inline-form, .import-actions, .filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.merchant-command-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px; border: 1px solid #dceee6; border-radius: 8px; background: #fff; box-shadow: 0 7px 18px rgba(42, 103, 78, .035); }
.inline-form { padding: 14px; border: 1px solid #dceee6; border-radius: 8px; background: #fff; box-shadow: 0 7px 18px rgba(42, 103, 78, .035); }.inline-form input { width: 150px; }.inline-form input[name="password"] { width: 250px; }
.import-actions { min-height: 58px; padding: 9px 10px; border: 1px solid #dceee6; border-radius: 8px; background: #fff; }.file-picker { display: inline-flex; min-height: 40px; align-items: center; padding: 0 14px; border: 1px solid #cfe3d9; border-radius: 6px; background: #f9fcfb; color: #385d50; cursor: pointer; font-weight: 700; }.file-picker:hover { border-color: #60b18d; color: var(--primary-dark); }
.selected-file { min-width: 118px; max-width: 230px; overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.customer-second-row { display: grid; grid-template-columns: minmax(260px, auto) minmax(500px, 1fr); gap: 12px; align-items: stretch; }.customer-second-row .filters { margin: 0; }.customer-import-actions { justify-content: flex-start; }.merchant-import-actions { min-height: 40px; padding: 0; border: 0; box-shadow: none; }
.filters { margin: 0 0 14px; }.filters input { min-width: 230px; }.merchant-filters { margin-bottom: 14px; }.detail-summary { margin: 0 0 10px; font-weight: 700; }
.table-wrap { overflow: auto; border: 1px solid #cde2d8; border-radius: 8px; background: #fff; box-shadow: 0 8px 22px rgba(40, 95, 74, .04); } table { width: 100%; min-width: 760px; border-collapse: separate; border-spacing: 0; }
th, td { padding: 14px 16px; border-bottom: 1px solid #d9e9e2; text-align: center; white-space: nowrap; } th { border-bottom: 2px solid #1c5442; background: #234b3e; color: #fff; font-size: 14px; font-weight: 700; text-align: center; } th + th { border-left: 1px solid rgba(255, 255, 255, .18); } td { color: #29463c; font-size: 14px; } td + td { border-left: 1px solid #e4efe9; } tbody tr:nth-child(even) { background: #f9fcfa; } tbody tr:hover { background: #eef9f3; } tbody tr:last-child td { border-bottom: 0; }
.status { display: inline-flex; min-height: 24px; align-items: center; padding: 0 9px; border-radius: 14px; background: #e2f4ff; color: #3180ad; font-size: 12px; font-weight: 700; }.status.disabled, .status.verified { background: #fff3d9; color: var(--warning); }.danger { background: var(--danger); }.danger:hover { background: #a62e35; }

.app-dialog { width: min(460px, calc(100vw - 32px)); padding: 0; border: 1px solid #d2e8dc; border-radius: 8px; background: #fff; box-shadow: 0 24px 60px rgba(23, 68, 51, .22); color: var(--text); }
.app-dialog::backdrop { background: rgba(21, 50, 40, .38); }
.dialog-form { display: grid; gap: 16px; padding: 26px; }.dialog-form label { display: grid; gap: 8px; color: #3b5e51; font-size: 14px; font-weight: 700; }.dialog-form input, .dialog-form select { width: 100%; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 2px; }.dialog-kicker { color: #53957d; font-size: 12px; font-weight: 800; letter-spacing: 1.4px; }.dialog-heading h3 { margin-top: 5px; }.dialog-close { display: grid; width: 34px; min-height: 34px; padding: 0; place-items: center; border-color: #d7ebe1; background: #f2faf6; color: #4d7d6b; font-size: 24px; font-weight: 400; line-height: 1; }.dialog-close:hover { background: #e1f3e9; color: var(--primary-dark); }
.dialog-copy { margin: -2px 0 0; color: var(--muted); font-size: 14px; line-height: 1.65; }.dialog-file-picker { display: flex !important; min-height: 84px; align-items: center; justify-content: space-between; gap: 16px; padding: 16px; border: 1px dashed #a8d5bf; border-radius: 6px; background: #f8fcfa; cursor: pointer; }.dialog-file-picker:hover { border-color: #4aad82; background: #f0faf5; }.dialog-file-picker span { color: var(--primary-dark); }.dialog-file-picker strong { max-width: 220px; overflow: hidden; color: var(--muted); font-size: 13px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }.dialog-actions button { min-width: 96px; }

@media (max-width: 980px) { .app-shell { grid-template-columns: 210px minmax(0, 1fr); }.sidebar { padding-left: 12px; padding-right: 12px; }.metric-grid { gap: 12px; }.metric { padding: 17px; }.metric-icon { width: 42px; height: 42px; flex-basis: 42px; }.metric strong { font-size: 29px; }.customer-second-row { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  body::before { width: 85vw; height: 160px; }.app-shell { grid-template-columns: 1fr; }.sidebar { position: sticky; top: 0; z-index: 10; gap: 12px; padding: 12px 14px; border-right: 0; border-bottom: 1px solid #d8ebe2; }.sidebar-aurora, .sidebar-actions { display: none; }.brand-row { padding: 0; }.brand-icon { width: 36px; height: 36px; border-radius: 10px; }.brand-icon::before { top: 9px; left: 7px; width: 22px; height: 8px; }.brand-icon span { left: 10px; bottom: 7px; width: 16px; height: 13px; }.brand-icon span::after { right: 3px; width: 5px; height: 8px; }.brand-row strong { font-size: 15px; } nav { display: flex; width: 100%; overflow: auto; gap: 5px; }.nav-item { width: auto; min-height: 36px; flex: 0 0 auto; gap: 6px; padding: 0 10px; font-size: 13px; }.nav-glyph { font-size: 16px; }.content { padding: 24px 16px 36px; }.topbar { align-items: flex-start; margin-bottom: 22px; }.topbar h2 { font-size: 25px; }.topbar p { font-size: 13px; line-height: 1.6; }.topbar-tools { gap: 0; }.icon-button { min-height: 38px; padding: 0 11px; font-size: 13px; }.metric-grid { grid-template-columns: 1fr; margin-bottom: 26px; }.metric { min-height: 96px; }.inline-form { padding: 12px; }.inline-form input, .inline-form input[name="password"], .filters input { width: 100%; min-width: 0; }.inline-form select { flex: 1; }.inline-form > button { flex: 1; }.merchant-command-bar { padding: 12px; }.merchant-command-bar button { flex: 1 1 120px; }.customer-second-row { gap: 10px; }.import-actions { align-items: stretch; }.selected-file { display: flex; min-height: 40px; align-items: center; }.import-actions .secondary { flex: 1; }.section-title-row { align-items: flex-start; }.login-panel { padding: 28px 22px; }.dialog-form { padding: 22px; }.dialog-file-picker { align-items: flex-start; flex-direction: column; }
}
