:root {
  --bg: #f6f7fb; --card: #ffffff; --text: #172033; --muted: #6b7280; --line: #e5e7eb;
  --primary: #2563eb; --primary-dark: #1d4ed8; --green: #16a34a; --red: #dc2626; --orange: #ea580c;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif; color: var(--text); background: var(--bg); }
.app-header { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 28px clamp(16px, 4vw, 48px); background: linear-gradient(135deg, #1e3a8a, #2563eb); color: #fff; }
h1, h2, h3, p { margin: 0; } h1 { font-size: clamp(28px, 5vw, 44px); } h2 { font-size: 20px; } h3 { font-size: 16px; margin-bottom: 10px; }
.subtitle { margin-top: 8px; opacity: .9; } .eyebrow { font-size: 13px; letter-spacing: 2px; opacity: .8; margin-bottom: 6px; }
main { padding: 22px clamp(14px, 4vw, 48px) 48px; }
.view-tabs { display: flex; gap: 10px; margin-bottom: 18px; }
.view-tab { width: auto; min-height: 38px; padding: 0 16px; border-radius: 12px; color: var(--primary); background: #eff6ff; }
.view-tab.active { color: #fff; background: var(--primary); }
.header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.header-actions span { font-size: 14px; opacity: .9; }
.hidden { display: none !important; }
.auth-card { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: center; padding: 18px; margin-bottom: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.auth-form { display: grid; gap: 10px; }
.secondary-btn { background: #0f172a; }
.secondary-btn:hover { background: #111827; }
.muted { color: var(--muted); margin-top: 8px; }
.dark { color: var(--primary); opacity: 1; }
.month-card, .panel, .stat-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.month-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: 18px; flex-wrap: wrap; }
.period-tabs { display: flex; gap: 8px; padding: 4px; border-radius: 14px; background: #eef2ff; }
.period-tab { min-height: 34px; padding: 0 14px; border-radius: 10px; color: var(--primary); background: transparent; }
.period-tab.active { color: #fff; background: var(--primary); }
.month-card input { max-width: 180px; }
.stats-grid, .layout-grid { display: grid; gap: 16px; } .stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } .layout-grid { grid-template-columns: 1.1fr .9fr; margin-top: 16px; }
.stat-card { padding: 18px; } .stat-card span { color: var(--muted); font-size: 14px; } .stat-card strong { display: block; margin-top: 10px; font-size: 26px; }
.stat-card.income strong { color: var(--green); } .stat-card.expense strong { color: var(--red); } .stat-card.profit strong { color: var(--primary); } .stat-card.stock strong { color: var(--orange); }
.stat-card small { display: block; margin-top: 8px; color: var(--muted); line-height: 1.5; }
.profit-breakdown { display: grid; gap: 5px; margin-top: 8px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.profit-breakdown b { color: var(--text); }
.profit-breakdown .profit-status-up { color: var(--green); font-weight: 700; }
.profit-breakdown .profit-status-down { color: var(--red); font-weight: 700; }
.profit-breakdown .profit-status-even { color: var(--primary); font-weight: 700; }
.stat-card.profit.profit-up strong { color: var(--green); }
.stat-card.profit.profit-down strong { color: var(--red); }
.stat-card.profit.profit-even strong { color: var(--primary); }
.stat-card.profit.profit-down { border-color: #fecaca; background: #fff7f7; }
.stat-card.profit.profit-up { border-color: #bbf7d0; background: #f7fff9; }
.panel { padding: 18px; margin-top: 16px; } .panel-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; } .panel-title span { color: var(--muted); font-size: 14px; }
.panel-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.report-export-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.staff-create-section { margin-bottom: 20px; }
.staff-create-section h3 { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.staff-list-section h3 { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.staff-list { display: flex; flex-direction: column; gap: 8px; }
.staff-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; }
.staff-row b { color: var(--text); }
.staff-list-section { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.location-selector { min-height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; background: #fff; color: var(--text); margin-right: 8px; }
.location-selector.hidden { display: none; }
.enterprise-subtab { min-height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; background: #fff; color: var(--text); cursor: pointer; }
.enterprise-subtab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.ent-hidden { display: none !important; }
.enterprise-subtab { min-height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; background: #fff; color: var(--text); cursor: pointer; }
.enterprise-subtab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.ent-hidden { display: none !important; }
.location-selector { min-height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; background: #fff; color: var(--text); margin-right: 8px; }
.location-selector.hidden { display: none; }
.secondary-light-btn { width: auto; min-height: 36px; padding: 0 12px; color: var(--primary); background: #eff6ff; }
.secondary-light-btn:hover { background: #dbeafe; }
.secondary-light-btn:disabled { cursor: not-allowed; color: var(--muted); background: #f3f4f6; }
.list-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.pager-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pager-info { line-height: 1.6; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .form-grid button { grid-column: 1 / -1; }
.product-tools { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 8px; }
.stacked-form { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; } .stacked-form:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
input, select, button { width: 100%; min-height: 42px; border-radius: 12px; border: 1px solid var(--line); padding: 0 12px; font: inherit; background: #fff; }
input, textarea { cursor: text; } select { cursor: pointer; } input:disabled, select:disabled, textarea:disabled, button:disabled { cursor: not-allowed; opacity: .58; }
button { border: 0; color: #fff; background: var(--primary); cursor: pointer; font-weight: 700; } button:hover { background: var(--primary-dark); }
.ghost-btn { background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.35); max-width: 120px; } .danger-btn { background: #fee2e2; color: var(--red); max-width: 100px; } .danger-btn:hover { background: #fecaca; }
.report-panel { margin-top: 16px; }
.report-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.report-metric { padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fbfdff; }
.report-metric span { display: block; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.report-metric strong { font-size: 18px; }
.report-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mini-list { display: grid; gap: 8px; }
.history-list { display: grid; gap: 8px; margin-bottom: 12px; }
.history-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid #bfdbfe; border-radius: 12px; background: #eff6ff; }
.history-item small { display: block; margin-top: 3px; color: var(--muted); }
.mini-item { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.mini-item small { display: block; margin-top: 4px; color: var(--muted); }
.list, .ledger-list { display: grid; gap: 10px; } .product-item, .ledger-item { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fbfdff; }
.product-top, .ledger-top { display: flex; justify-content: space-between; gap: 8px; }
.ledger-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.mini-danger-btn, .mini-primary-btn { width: auto; min-height: 30px; padding: 0 10px; border-radius: 9px; font-size: 13px; }
.mini-primary-btn { background: #dbeafe; color: #1d4ed8; }
.mini-primary-btn:hover { color: #fff; background: #2563eb; }
.mini-danger-btn { background: #fee2e2; color: var(--red); }
.mini-danger-btn:hover { background: #fecaca; } .product-meta, .ledger-meta { color: var(--muted); font-size: 13px; line-height: 1.7; }
.low-stock { color: var(--red); font-weight: 700; }
.search-input { margin-bottom: 12px; }
.low-stock-card { border-color: #fecaca; background: #fff7f7; }
.inactive-product-card { border-color: #d1d5db; background: #f8fafc; opacity: .82; }
.product-status-badge { display: inline-flex; align-items: center; margin-left: 8px; padding: 2px 8px; border-radius: 999px; color: #64748b; background: #e2e8f0; font-size: 12px; font-style: normal; font-weight: 800; vertical-align: middle; }
.stock-alert { color: var(--red); font-size: 13px; font-weight: 700; } .empty { color: var(--muted); padding: 18px; text-align: center; border: 1px dashed var(--line); border-radius: 14px; }
@media (max-width: 900px) { .stats-grid, .layout-grid, .auth-card, .report-summary, .report-columns { grid-template-columns: 1fr; } .app-header { align-items: flex-start; flex-direction: column; } .ghost-btn { max-width: 100%; } }
@media (max-width: 560px) { .form-grid, .two-cols { grid-template-columns: 1fr; } .panel-title { align-items: flex-start; flex-direction: column; } .list-pager { align-items: flex-start; flex-direction: column; } }















.debt-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.debt-focus-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.debt-focus-card { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.debt-action-row { display: flex; flex-wrap: wrap; gap: 10px; }
.debt-action-row button { width: auto; }
.debt-list-title { margin-top: 6px; }
.debt-list { margin-top: 12px; }
.debt-item { border-color: #bfdbfe; background: #f8fbff; }
.debt-item.active { border-color: #2563eb; background: #eff6ff; box-shadow: 0 0 0 2px rgba(37, 99, 235, .08); }
.debt-overpaid { border-color: #bbf7d0; background: #f7fff9; }
.debt-record-title { margin-top: 18px; }
.debt-record-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.debt-record-card { padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
@media (max-width: 900px) { .debt-summary, .debt-focus-grid, .debt-record-grid { grid-template-columns: 1fr; } }

.onboarding-card { border-color: #bfdbfe; background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%); }
.onboarding-card .panel-title { align-items: flex-start; }
.onboarding-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.onboarding-step { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.onboarding-step small { display: block; margin-top: 4px; color: var(--muted); line-height: 1.5; }
.step-badge { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 999px; color: #fff; background: var(--primary); font-weight: 800; }
.onboarding-step.done { border-color: #bbf7d0; background: #f7fff9; }
.onboarding-step.done .step-badge { background: var(--green); }
.onboarding-step.done button { color: var(--green); background: #dcfce7; }
@media (max-width: 900px) { .onboarding-steps { grid-template-columns: 1fr; } .onboarding-step { grid-template-columns: auto 1fr; } .onboarding-step button { grid-column: 1 / -1; } }

.auth-copy { display: grid; gap: 10px; }
.auth-tips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.auth-tips span { padding: 6px 10px; border-radius: 999px; color: var(--primary); background: #eff6ff; font-size: 13px; font-weight: 700; }
.auth-box { display: grid; gap: 10px; }
.auth-mode-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.auth-mode-tab { min-height: 38px; color: var(--primary); background: #eff6ff; }
.auth-mode-tab.active { color: #fff; background: var(--primary); }
.auth-help { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }

.account-security-card { border-color: #bfdbfe; background: #f8fbff; margin-bottom: 16px; }
.recovery-code-box { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 12px; border: 1px dashed #93c5fd; border-radius: 14px; background: #fff; }
.recovery-code-box span { color: var(--muted); font-size: 13px; }
.recovery-code-box strong { font-size: 20px; letter-spacing: 2px; color: var(--primary-dark); }
@media (max-width: 560px) { .recovery-code-box { grid-template-columns: 1fr; } }
.support-strip { padding: 10px 12px; border: 1px solid #bfdbfe; border-radius: 12px; color: var(--primary); background: #eff6ff; font-size: 13px; font-weight: 700; line-height: 1.5; }
.support-panel { background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%); }
.support-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.support-card { display: grid; gap: 6px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.support-card span { color: var(--muted); font-size: 13px; }
.support-card strong { color: var(--primary-dark); font-size: 20px; }
.support-card small { color: var(--muted); line-height: 1.5; }
.support-faq { margin-top: 16px; }
.support-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.support-links a { padding: 10px 12px; border-radius: 12px; color: var(--primary); background: #eff6ff; text-decoration: none; font-weight: 700; }
@media (max-width: 900px) { .support-grid { grid-template-columns: 1fr; } }
.smart-support-card { display: grid; gap: 12px; margin-top: 16px; padding: 14px; border: 1px solid #bfdbfe; border-radius: 16px; background: #fff; }
.compact-title { margin-bottom: 0; }
.smart-support-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.smart-support-form button { width: auto; padding: 0 18px; }
.quick-questions { display: flex; flex-wrap: wrap; gap: 8px; }
.quick-questions button { width: auto; min-height: 34px; padding: 0 12px; border-radius: 999px; color: var(--primary); background: #eff6ff; font-size: 13px; }
.smart-support-answer { padding: 12px; border-radius: 14px; color: #0f172a; background: #f8fafc; border: 1px solid var(--line); line-height: 1.7; }
@media (max-width: 560px) { .smart-support-form { grid-template-columns: 1fr; } .smart-support-form button { width: 100%; } }

.membership-form { display: grid; grid-template-columns: 150px 170px minmax(180px, 1fr) auto; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.membership-form button { min-height: 38px; }
@media (max-width: 900px) { .membership-form { grid-template-columns: 1fr; } }

.membership-card { border-color: #bfdbfe; background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%); }
.membership-usage { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
.membership-usage-item { padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.membership-usage-item span { display: block; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.membership-usage-item strong { font-size: 20px; }
.membership-usage-item.ok { border-color: #bbf7d0; background: #f0fdf4; }
.membership-usage-item.ok strong { color: #15803d; }
.membership-usage-item.warning { border-color: #fde68a; background: #fffbeb; }
.membership-usage-item.warning strong { color: #b45309; }
.membership-usage-item.expired { border-color: #fecaca; background: #fff7f7; }
.membership-usage-item.expired strong { color: #991b1b; }
.membership-access-notice { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 12px 0; padding: 14px 16px; border: 1px solid #dbeafe; border-radius: 16px; background: #f8fbff; box-shadow: 0 12px 24px rgba(15, 23, 42, .04); }
.membership-access-notice.hidden { display: none !important; }
.membership-access-notice span { display: block; color: #2563eb; font-size: 12px; font-weight: 900; }
.membership-access-notice strong { display: block; margin-top: 3px; color: #0f172a; font-size: 17px; }
.membership-access-notice p { margin: 4px 0 0; color: #475569; font-size: 13px; line-height: 1.55; }
.membership-access-notice button { width: auto; min-width: 104px; white-space: nowrap; }
.membership-access-notice.free { border-color: #e2e8f0; background: #f8fafc; }
.membership-access-notice.warning { border-color: #fde68a; background: #fffbeb; }
.membership-access-notice.warning span, .membership-access-notice.warning p { color: #92400e; }
.membership-access-notice.warning button { color: #fff; background: #f97316; }
.membership-access-notice.expired { border-color: #fecaca; background: #fff7f7; }
.membership-access-notice.expired span, .membership-access-notice.expired p { color: #991b1b; }
.membership-access-notice.expired button { color: #fff; background: #dc2626; }
.support-upgrade-btn { text-decoration: none; }
.admin-toolbar { margin: 12px 0; }
.admin-toolbar input { max-width: 360px; }
@media (max-width: 900px) { .membership-usage { grid-template-columns: 1fr; } .membership-access-notice { align-items: stretch; flex-direction: column; } .membership-access-notice button { width: 100%; } }

/* Admin SaaS v2 */
.admin-v2-body { min-height: 100vh; background: radial-gradient(circle at 12% 10%, #dbeafe 0, transparent 26%), radial-gradient(circle at 86% 20%, #e0f2fe 0, transparent 22%), linear-gradient(135deg, #eef4ff 0%, #f7faff 48%, #e9f2ff 100%); }
.admin-login-shell { display: grid; grid-template-columns: 1.2fr 460px; gap: 28px; align-items: center; max-width: 1120px; min-height: 100vh; margin: 0 auto; padding: 40px; }
.admin-login-brand { color: #fff; padding: 44px; border-radius: 30px; background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 62%, #38bdf8 100%); box-shadow: 0 28px 60px rgba(15, 23, 42, .18); }
.admin-login-brand h1 { margin: 12px 0; font-size: 44px; }
.admin-login-brand p { line-height: 1.8; }
.admin-login-card { padding: 30px; border: 1px solid var(--line); border-radius: 28px; background: #fff; box-shadow: 0 28px 60px rgba(15, 23, 42, .14); }
.admin-login-back { display: grid; place-items: center; text-decoration: none; }
.admin-shell { display: grid; grid-template-columns: 226px 1fr; max-width: 1240px; min-height: 780px; margin: 46px auto; overflow: hidden; border-radius: 30px; background: #fff; box-shadow: 0 28px 60px rgba(15, 23, 42, .16); }
.admin-sidebar { display: flex; flex-direction: column; gap: 28px; padding: 28px 20px; background: #f8fafc; border-right: 1px solid var(--line); }
.admin-logo { display: flex; gap: 12px; align-items: center; }
.admin-logo > span { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; color: #fff; background: var(--primary); font-weight: 900; }
.admin-logo strong { display: block; color: #0f172a; font-size: 20px; }
.admin-logo small { color: var(--muted); }
.admin-nav { display: grid; gap: 8px; }
.admin-nav a { padding: 12px 14px; border-radius: 13px; color: #475569; text-decoration: none; font-weight: 800; }
.admin-nav a.active { color: #fff; background: var(--primary); }
.admin-sidebar-note { display: grid; gap: 8px; margin-top: auto; color: var(--muted); font-size: 13px; }
.admin-main { padding: 0 26px 28px; background: #f7f9fc; }
.admin-topbar { display: grid; grid-template-columns: 260px 1fr auto; gap: 18px; align-items: center; min-height: 76px; margin: 0 -26px 26px; padding: 0 26px; background: #fff; border-bottom: 1px solid var(--line); }
.admin-topbar h1 { margin: 2px 0 0; font-size: 22px; }
.admin-search input { min-height: 38px; border-radius: 999px; background: #f8fafc; }
.admin-top-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.admin-top-actions span { color: var(--muted); font-size: 13px; }
.admin-top-actions a { text-decoration: none; display: grid; place-items: center; }
.admin-top-actions button { width: auto; min-height: 38px; padding: 0 14px; }
.admin-summary-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.admin-metric-card { padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 10px 22px rgba(37, 99, 235, .08); }
.admin-metric-card span { display: block; color: var(--muted); font-size: 13px; }
.admin-metric-card strong { display: block; margin-top: 8px; color: #0f172a; font-size: 26px; }
.admin-metric-card small { display: block; margin-top: 6px; color: var(--muted); }
.admin-dashboard-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-top: 16px; }
.admin-chart-card, .admin-users-card { padding: 18px; border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: 0 10px 22px rgba(37, 99, 235, .08); }
.admin-bar-chart { display: grid; grid-template-columns: repeat(7, 1fr); gap: 14px; align-items: end; height: 180px; padding: 10px 8px 0; }
.admin-bar-item { display: grid; gap: 8px; justify-items: center; height: 100%; }
.admin-bar-track { display: flex; align-items: end; width: 100%; height: 145px; border-radius: 12px; background: #f1f5f9; overflow: hidden; }
.admin-bar-track span { display: block; width: 100%; border-radius: 12px 12px 0 0; background: linear-gradient(180deg, #60a5fa 0%, #2563eb 100%); }
.admin-bar-item small { color: var(--muted); font-size: 12px; }
.admin-plan-chart { display: grid; place-items: center; gap: 12px; min-height: 180px; }
.admin-donut { --paid: 0; display: grid; place-items: center; width: 138px; height: 138px; border-radius: 50%; background: conic-gradient(#2563eb calc(var(--paid) * 1%), #93c5fd 0); position: relative; }
.admin-donut::after { content: ''; position: absolute; inset: 22px; border-radius: 50%; background: #fff; }
.admin-donut strong, .admin-donut span { position: relative; z-index: 1; }
.admin-donut strong { color: #0f172a; font-size: 24px; }
.admin-donut span { margin-top: 30px; color: var(--muted); font-size: 12px; }
.admin-plan-legend { display: flex; gap: 12px; color: var(--muted); font-size: 13px; }
.admin-plan-legend i { display: inline-block; width: 9px; height: 9px; margin-right: 5px; border-radius: 50%; background: #93c5fd; }
.admin-plan-legend i.paid { background: #2563eb; }
.admin-dashboard-ops-grid { grid-template-columns: 1.35fr 1fr; }
.admin-dashboard-list { display: grid; gap: 10px; }
.admin-dashboard-list.compact { gap: 8px; }
.admin-dashboard-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 15px; background: #f8fbff; }
.admin-dashboard-row b, .admin-dashboard-row strong { display: block; color: #0f172a; }
.admin-dashboard-row small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.admin-dashboard-row.paid { border-color: #bbf7d0; background: #f0fdf4; }
.admin-dashboard-row.pending_payment, .admin-dashboard-row.pending, .admin-dashboard-row.warning { border-color: #fde68a; background: #fffbeb; }
.admin-dashboard-row.expired, .admin-dashboard-row.cancelled { border-color: #fecaca; background: #fff7f7; }
.admin-dashboard-row > div:last-child { text-align: right; }
.admin-users-card { margin-top: 16px; }
.admin-user-table { display: grid; gap: 8px; }
.admin-table-head, .admin-table-row { display: grid; grid-template-columns: 1.2fr 1fr .8fr 1.1fr .8fr 1.5fr; gap: 10px; align-items: center; }
.admin-table-head { padding: 0 12px 8px; color: var(--muted); font-size: 13px; border-bottom: 1px solid var(--line); }
.admin-table-row { padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: #fbfdff; }
.admin-table-row b { display: block; color: #0f172a; }
.admin-table-row small { display: block; margin-top: 4px; color: var(--muted); line-height: 1.4; }
.admin-table-row select, .admin-table-row input { min-height: 36px; padding: 0 10px; font-size: 13px; }
.admin-row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-row-actions button { width: auto; min-height: 34px; padding: 0 10px; font-size: 13px; }
.admin-row-actions button[type="submit"] { background: var(--primary); color: #fff; }
@media (max-width: 1100px) { .admin-shell { grid-template-columns: 1fr; margin: 0; border-radius: 0; } .admin-sidebar { display: none; } .admin-topbar, .admin-dashboard-grid { grid-template-columns: 1fr; } .admin-summary-grid { grid-template-columns: repeat(2, 1fr); } .admin-table-head { display: none; } .admin-table-row { grid-template-columns: 1fr; } .payment-order-head, .payment-order-row { grid-template-columns: 1fr; } .payment-order-row .admin-row-actions { justify-content: flex-start; } }
@media (max-width: 720px) { .admin-login-shell { grid-template-columns: 1fr; padding: 18px; } .admin-login-brand { padding: 24px; } .admin-login-brand h1 { font-size: 32px; } .admin-summary-grid { grid-template-columns: 1fr; } .admin-plan-legend { flex-direction: column; } }

/* Front SaaS v2 */
.front-v2-body { min-height: 100vh; color: #06142f; background: #eef5ff; }
.front-v2-body .hidden { display: none !important; }
.front-auth-shell { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); max-width: 1144px; margin: 58px auto; padding: 0 0 70px; border: 1px solid #dbe7f6; border-radius: 8px; background: linear-gradient(180deg, #f4f8ff 0%, #f8fbff 100%); box-shadow: none; overflow: hidden; }
.front-auth-hero { min-height: 286px; padding: 40px 60px; color: #fff; background: radial-gradient(circle at 80% 26%, rgba(255,255,255,.14) 0 90px, transparent 91px), radial-gradient(circle at 88% 72%, rgba(255,255,255,.12) 0 150px, transparent 151px), linear-gradient(135deg, #2450df 0%, #2b72f1 58%, #35aeea 100%); }
.front-auth-hero h1 { max-width: 760px; margin: 12px 0 10px; font-size: clamp(34px, 5vw, 46px); line-height: 1.15; letter-spacing: -1px; }
.front-auth-hero p { font-size: 17px; }
.front-version { font-size: 13px !important; font-weight: 700; }
.front-hero-pills { margin-top: 34px; }
.front-hero-pills span, .front-hero-pill-btn { min-width: 138px; min-height: 32px; padding: 6px 10px; text-align: center; color: #fff; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.28); border-radius: 999px; font-size: 13px; font-weight: 700; }
.front-hero-pill-btn { width: auto; cursor: pointer; }
.front-hero-pill-btn:hover { background: rgba(255,255,255,.28); }
.front-auth-card { display: grid; grid-template-columns: 1fr 450px; gap: 54px; align-items: center; width: calc(100% - 120px); margin: -16px auto 0; padding: 34px 36px; border-radius: 24px; background: #fff; box-shadow: 0 20px 42px rgba(15, 23, 42, .1); }
.front-auth-card h2 { margin: 8px 0 12px; font-size: 32px; letter-spacing: -1px; }
.front-plan-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 26px 0 30px; }
.front-plan-row div { padding: 16px; border: 1px solid #dbe7f6; border-radius: 14px; background: #f8fbff; }
.front-plan-row b, .front-plan-row span { display: block; }
.front-plan-row span { margin-top: 6px; color: #52627a; font-size: 13px; }
.front-auth-box { padding: 18px; border: 1px solid #dbe7f6; border-radius: 18px; background: #fff; }
.front-auth-box input { border-radius: 14px; background: #f8fbff; min-height: 44px; }
.front-auth-box button { min-height: 44px; border-radius: 14px; }
.front-safe-tip { padding: 12px 14px; border: 1px solid #bfdbfe; border-radius: 14px; color: #0758d8; background: #eff6ff; font-size: 13px; font-weight: 800; }
.front-auth-shell:not(.hidden) ~ .front-app-shell { display: none; }
.front-app-shell { display: grid; grid-template-columns: 196px minmax(0, 1fr); max-width: 1144px; min-height: 760px; margin: 58px auto; border: 1px solid #d8e3f3; border-radius: 14px; background: #fff; overflow: hidden; }
.front-sidebar { display: flex; flex-direction: column; gap: 26px; padding: 24px 18px; border-right: 1px solid #e2e8f0; background: #fff; }
.front-brand strong { display: block; font-size: 28px; letter-spacing: -1px; }
.front-brand span { display: block; margin-top: 8px; color: #64748b; font-size: 12px; }
.front-sidebar .view-tabs { display: grid; gap: 8px; margin: 0; }
.front-sidebar .view-tabs.hidden { display: none !important; }
.front-sidebar .view-tab { justify-content: flex-start; width: 100%; min-height: 36px; padding: 0 14px; border-radius: 10px; color: #0f2a4d; background: transparent; text-align: left; font-size: 14px; font-weight: 800; }
.front-sidebar .view-tab.active { color: #2563eb; background: #eaf3ff; }
.front-sidebar-footer { margin-top: auto; padding-top: 22px; border-top: 1px solid #e2e8f0; color: #64748b; font-size: 12px; line-height: 1.8; }
.front-main { padding: 0 32px 36px; background: #f5f8fc; }
.front-topbar { display: flex; align-items: center; justify-content: space-between; min-height: 62px; margin: 0 -32px 28px; padding: 0 32px; color: #06142f; background: #fff; border-bottom: 1px solid #e2e8f0; }
.front-topbar h1 { font-size: 22px; }
.front-topbar p { margin-top: 4px; color: #64748b; font-size: 12px; }
.front-topbar .header-actions { margin-left: auto; }
.front-topbar .secondary-light-btn { min-height: 36px; border-radius: 12px; }
#appRoot { display: grid; gap: 16px; }
.front-v2-body .membership-card { order: 1; margin-top: 0; padding: 18px; border-radius: 18px; border-color: #e2e8f0; background: #fff; box-shadow: 0 16px 35px rgba(15, 23, 42, .07); }
.front-v2-body .membership-card .panel-title { margin-bottom: 6px; }
.front-v2-body .membership-card h2 { font-size: 18px; }
.front-v2-body .membership-card .panel-title span { display: inline-block; margin-top: 6px; color: #52627a; }
.front-v2-body .membership-usage { grid-template-columns: repeat(2, minmax(0, 180px)); margin-top: 10px; }
.front-v2-body .membership-usage-item { background: #f8fbff; }
.front-v2-body .account-security-card { order: 6; margin-top: 0; }
.front-v2-body .onboarding-card { order: 7; margin-top: 0; }
.front-v2-body .month-card { order: 0; justify-content: flex-end; margin: -86px 116px 0 auto; padding: 0; border: 0; box-shadow: none; background: transparent; }
.front-v2-body .month-card label { display: none; }
.front-v2-body .period-tabs { background: #eef5ff; border: 1px solid #cbdcf1; }
.front-v2-body .period-tab { min-height: 30px; border-radius: 999px; font-size: 12px; }
.front-v2-body .month-card input { min-height: 30px; max-width: 145px; border-radius: 999px; font-size: 12px; text-align: center; }
.front-v2-body .stats-grid { order: 2; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.front-v2-body .stat-card { min-height: 104px; padding: 18px; border-radius: 16px; background: #fff; box-shadow: 0 14px 30px rgba(15, 23, 42, .06); }
.front-v2-body .stat-card span { color: #52627a; }
.front-v2-body .stat-card strong { color: #06142f; font-size: 30px; letter-spacing: -1px; }
.front-v2-body .stat-card small { font-weight: 800; }
.front-v2-body .home-renew-card { order: 1; }
.front-dashboard-grid { order: 3; display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
.front-secondary-grid { order: 4; display: grid; gap: 18px; margin-top: 18px; }
.front-activity-card, .front-trend-card, .front-quick-card { margin-top: 0; border-radius: 18px; box-shadow: 0 14px 30px rgba(15, 23, 42, .06); }
.front-activity-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.front-activity-grid h3 { margin-bottom: 10px; color: #0f172a; font-size: 15px; }
.front-mini-list { display: grid; gap: 10px; }
.front-mini-empty { min-height: 84px; display: grid; place-items: center; padding: 12px; border: 1px dashed #cbdcf1; border-radius: 14px; color: #64748b; background: #f8fbff; font-size: 13px; text-align: center; }
.front-mini-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 14px; background: #f8fbff; }
.front-mini-row strong { display: block; color: #0f172a; font-size: 14px; }
.front-mini-row small { display: block; margin-top: 4px; color: #64748b; font-size: 12px; line-height: 1.45; }
.front-mini-row span { flex: none; color: #2563eb; font-size: 12px; font-weight: 800; }
.front-debt-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.front-debt-chip { padding: 12px 14px; border-radius: 14px; background: #eef6ff; }
.front-debt-chip b { display: block; color: #52627a; font-size: 12px; }
.front-debt-chip strong { display: block; margin-top: 4px; color: #06142f; font-size: 18px; }
.front-v2-body #appRoot[data-home-tier="free"] .front-dashboard-grid { grid-template-columns: 1fr; }
.front-v2-body #appRoot[data-home-tier="free"] .front-quick-card { grid-column: 1 / -1; }
.front-v2-body #appRoot[data-home-tier="free"] .front-quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.front-v2-body #appRoot[data-home-tier="free"] .front-quick-card.compact .front-quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.home-renew-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; border: 1px solid #fde68a; border-radius: 18px; background: #fffbeb; box-shadow: 0 16px 35px rgba(180, 83, 9, .08); }
.home-renew-card.hidden { display: none !important; }
.home-renew-card span { display: block; color: #b45309; font-size: 12px; font-weight: 900; }
.home-renew-card strong { display: block; margin-top: 3px; color: #0f172a; font-size: 17px; }
.home-renew-card p { margin: 4px 0 0; color: #92400e; font-size: 13px; line-height: 1.5; }
.home-renew-card button { white-space: nowrap; background: #f97316; color: #fff; }
.home-renew-card.expired { border-color: #fecaca; background: #fff7f7; box-shadow: 0 16px 35px rgba(153, 27, 27, .08); }
.home-renew-card.expired span, .home-renew-card.expired p { color: #991b1b; }
.home-renew-card.expired button { background: #dc2626; color: #fff; }
.front-trend-card { padding-bottom: 10px; }
.front-line-chart { padding: 0 18px; }
.front-line-chart svg { width: 100%; height: 178px; }
.front-chart-legend { display: flex; justify-content: flex-end; gap: 16px; margin: -4px 0 4px; color: #52627a; font-size: 12px; }
.front-chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.front-chart-legend i { width: 10px; height: 10px; border-radius: 999px; }
.front-chart-legend .income-dot { background: #2563eb; }
.front-chart-legend .profit-dot { background: #16a34a; }
.front-chart-grid line { stroke: #e2e8f0; stroke-width: 1; }
.income-line, .profit-line { fill: none; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.income-line { stroke: #2563eb; }
.profit-line { stroke: #16a34a; }
.income-dot { fill: #2563eb; }
.profit-dot { fill: #16a34a; }
.front-chart-labels { fill: #64748b; font-size: 14px; }
.front-chart-empty { display: grid; place-items: center; min-height: 178px; color: #64748b; border: 1px dashed #cbdcf1; border-radius: 16px; background: #f8fbff; font-weight: 700; text-align: center; }
.front-quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.front-quick-grid button,
.front-quick-grid a { display: grid; place-items: center; min-height: 46px; padding: 0 12px; border-radius: 14px; text-decoration: none; color: #0758d8; background: #eef6ff; font-weight: 800; }
.front-quick-grid button:nth-child(2),
.front-quick-grid a:nth-child(2) { color: #099250; background: #ecfdf3; }
.front-quick-grid button:nth-child(3),
.front-quick-grid a:nth-child(3) { color: #f97316; background: #fff7ed; }
.front-quick-grid button:nth-child(4),
.front-quick-grid a:nth-child(4) { color: #0f2a4d; background: #f8fbff; border: 1px solid #cbdcf1; }
.front-quick-grid button:nth-child(5) { color: #b45309; background: #fff7ed; }
.front-quick-grid button:nth-child(6) { color: #7c3aed; background: #f5f3ff; }
.front-alert-line { margin-top: 16px; padding: 12px; border-radius: 12px; color: #dc2626; background: #fff1f2; font-size: 13px; font-weight: 800; text-align: center; }
.front-v2-body .report-panel { order: 5; }
.front-v2-body .layout-grid { order: 4; }
.front-v2-body .panel { border-radius: 18px; border-color: #e2e8f0; box-shadow: 0 14px 30px rgba(15, 23, 42, .05); }
.front-v2-body .ledger-list + *, .front-v2-body .history-list { margin-bottom: 12px; }
.enterprise-overview-card { order: 3; display: grid; gap: 16px; border: 1px solid #bfdbfe; background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%); }
.enterprise-overview-title { align-items: flex-start; }
.enterprise-scope-select { width: auto; min-width: 190px; border-radius: 999px; background: #fff; font-weight: 800; }
.enterprise-overview-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.enterprise-stat { padding: 14px; border-radius: 16px; background: #fff; border: 1px solid #dbeafe; box-shadow: 0 10px 24px rgba(37, 99, 235, .07); }
.enterprise-stat span { display: block; color: #52627a; font-size: 12px; font-weight: 800; }
.enterprise-stat strong { display: block; margin-top: 8px; color: #06142f; font-size: 24px; letter-spacing: -1px; }
.enterprise-stat small { display: block; margin-top: 5px; color: #64748b; font-size: 12px; line-height: 1.45; }
.enterprise-overview-info { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.enterprise-overview-info div { padding: 12px; border-radius: 14px; background: #eef6ff; }
.enterprise-overview-info b { display: block; color: #2563eb; font-size: 12px; }
.enterprise-overview-info span { display: block; margin-top: 5px; color: #0f172a; font-size: 13px; font-weight: 800; line-height: 1.45; }
.front-v2-body [data-view-panel]:not(#appRoot) { margin-top: 0; }
@media (max-width: 980px) { .front-auth-card, .front-app-shell { grid-template-columns: 1fr; } .front-sidebar { display: none; } .front-main { padding: 0 16px 24px; } .front-topbar { margin: 0 -16px 20px; padding: 14px 16px; flex-direction: column; align-items: flex-start; } .front-v2-body .month-card { margin: 0; justify-content: flex-start; } .front-v2-body .stats-grid, .front-dashboard-grid, .front-secondary-grid, .front-activity-grid, .front-debt-summary, .enterprise-overview-stats, .enterprise-overview-info { grid-template-columns: 1fr; } .home-renew-card { align-items: stretch; flex-direction: column; } .home-renew-card button { width: 100%; } .front-auth-card { width: calc(100% - 32px); } }
@media (max-width: 680px) { .front-auth-shell, .front-app-shell { margin: 0; border-radius: 0; } .front-auth-hero { padding: 28px 20px; } .front-auth-card { grid-template-columns: 1fr; gap: 22px; padding: 22px; } .front-plan-row, .front-v2-body .stats-grid, .front-quick-grid, .front-activity-grid, .front-debt-summary { grid-template-columns: 1fr; } }



/* Front SaaS reference layout corrections */
.front-sidebar .front-nav-link {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  color: #0f2a4d;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
}
.front-sidebar .front-nav-link:hover,
.front-sidebar .front-nav-link:focus {
  color: #2563eb;
  background: #eaf3ff;
}
.front-nav-divider {
  display: block;
  height: 1px;
  margin: 14px 0 6px;
  background: #e2e8f0;
}
.front-header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.front-primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 130px;
  min-height: 36px;
  padding: 0 22px;
  border-radius: 10px;
  color: #fff;
  background: #2563eb;
  text-decoration: none;
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 10px 20px rgba(37, 99, 235, .18);
}
.front-primary-action:hover { background: #1d4ed8; }
.front-v2-body .front-period-card {
  order: initial;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.front-v2-body .front-period-card label { display: none; }
.front-v2-body .front-period-card .period-tabs {
  display: flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid #cbdcf1;
  border-radius: 999px;
  background: #eef5ff;
}
.front-v2-body .front-period-card .period-tab {
  width: auto;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  color: #52627a;
  background: transparent;
  font-size: 12px;
  font-weight: 800;
}
.front-v2-body .front-period-card .period-tab.active {
  color: #0758d8;
  background: #fff;
  box-shadow: 0 4px 10px rgba(37, 99, 235, .08);
}
.front-v2-body .front-period-card input {
  width: 144px;
  min-height: 30px;
  border-radius: 999px;
  border-color: #cbdcf1;
  color: #25405f;
  background: #f8fbff;
  font-size: 12px;
  text-align: center;
}
.front-store-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}
.front-store-actions .secondary-light-btn {
  width: auto;
  min-width: 106px;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 12px;
  text-align: center;
}
.front-v2-body .front-ledger-panel {
  order: 4;
  margin-top: 8px;
}
.front-v2-body .report-panel { order: 5; }
.front-v2-body .layout-grid { order: 6; }
.front-v2-body .account-security-card { order: 7; }
.front-v2-body .onboarding-card { order: 8; }
.front-v2-body .front-ledger-panel .panel-title {
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}
.front-see-all {
  color: #0758d8;
  text-decoration: none;
  font-size: 12px;
  font-weight: 900;
}
.front-v2-body .front-ledger-panel .history-list,
.front-v2-body .front-ledger-panel .ledger-list {
  gap: 0;
  margin: 0;
}
.front-v2-body .front-ledger-panel .ledger-item,
.front-v2-body .front-ledger-panel .history-item {
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid #eef2f7;
  background: transparent;
  padding: 10px 0;
}
.front-v2-body .front-ledger-panel .ledger-item:last-child,
.front-v2-body .front-ledger-panel .history-item:last-child { border-bottom: 0; }
.front-v2-body .income small,
.front-v2-body .profit-up small { color: #099250; }
.front-v2-body .profit-down small,
.front-v2-body .stock small,
.front-v2-body .receivable small { color: #dc2626; }
@media (max-width: 980px) {
  .front-header-actions { width: 100%; flex-wrap: wrap; }
  .front-v2-body .front-period-card { justify-content: flex-start; flex-wrap: wrap; }
  .front-primary-action { flex: 1; }
}

/* Front SaaS v1.0.1 polish */
.front-v2-body {
  color: #07152f;
  background:
    radial-gradient(circle at 10% 0%, rgba(37, 99, 235, .14) 0 220px, transparent 221px),
    radial-gradient(circle at 90% 8%, rgba(14, 165, 233, .12) 0 220px, transparent 221px),
    #eef5ff;
}
.front-auth-shell {
  max-width: 1180px;
  margin: 34px auto;
  padding: 0;
  border-radius: 26px;
  border: 1px solid rgba(203, 213, 225, .9);
  background: #ffffff;
  box-shadow: 0 28px 70px rgba(15, 23, 42, .14);
}
.front-auth-hero {
  min-height: 390px;
  padding: 34px 42px 54px;
  background:
    radial-gradient(circle at 76% 20%, rgba(255, 255, 255, .16) 0 110px, transparent 111px),
    linear-gradient(135deg, #0f2f88 0%, #1f58df 55%, #14b8d7 100%);
}
.front-auth-brandline {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
}
.front-auth-logo {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  color: #1d4ed8;
  background: #fff;
  font-size: 22px;
  font-weight: 950;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .18);
}
.front-auth-brandline strong,
.front-auth-brandline span {
  display: block;
}
.front-auth-brandline strong {
  font-size: 22px;
  letter-spacing: -.5px;
}
.front-auth-brandline span {
  margin-top: 2px;
  color: rgba(255, 255, 255, .78);
  font-size: 12px;
  font-weight: 800;
}
.front-auth-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 46px;
  align-items: center;
  margin-top: 40px;
}
.front-auth-copy-main h1 {
  max-width: 640px;
  margin: 14px 0;
  font-size: clamp(38px, 5vw, 58px);
  line-height: 1.08;
  letter-spacing: -2px;
}
.front-auth-copy-main > p:not(.front-version) {
  max-width: 620px;
  color: rgba(255, 255, 255, .84);
  font-size: 17px;
  line-height: 1.8;
}
.front-auth-preview {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 24px;
  background: rgba(255, 255, 255, .96);
  color: #07152f;
  box-shadow: 0 24px 52px rgba(15, 23, 42, .2);
}
.front-preview-top,
.front-preview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.front-preview-top span {
  font-size: 18px;
  font-weight: 950;
}
.front-preview-top b {
  padding: 6px 12px;
  border-radius: 999px;
  color: #1d4ed8;
  background: #eff6ff;
  font-size: 12px;
}
.front-preview-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 18px 0 16px;
}
.front-preview-metrics div {
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #f8fbff;
}
.front-preview-metrics div:first-child {
  grid-column: 1 / -1;
}
.front-preview-metrics span,
.front-preview-row span {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}
.front-preview-metrics strong {
  display: block;
  margin-top: 5px;
  font-size: 24px;
  letter-spacing: -.8px;
}
.front-preview-chart {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 9px;
  align-items: end;
  height: 92px;
  margin: 8px 0 14px;
  padding: 12px;
  border-radius: 18px;
  background: linear-gradient(180deg, #f8fbff 0%, #eef6ff 100%);
}
.front-preview-chart i {
  display: block;
  border-radius: 999px 999px 8px 8px;
  background: linear-gradient(180deg, #60a5fa 0%, #2563eb 100%);
}
.front-preview-chart i:nth-child(1) { height: 34px; }
.front-preview-chart i:nth-child(2) { height: 52px; }
.front-preview-chart i:nth-child(3) { height: 44px; }
.front-preview-chart i:nth-child(4) { height: 70px; }
.front-preview-chart i:nth-child(5) { height: 82px; }
.front-preview-row {
  min-height: 38px;
  border-top: 1px solid #e2e8f0;
  font-size: 13px;
}
.front-preview-row b {
  color: #16a34a;
}
.front-preview-row:last-child b {
  color: #ef4444;
}
.front-auth-card {
  width: calc(100% - 84px);
  margin: -32px auto 42px;
  padding: 30px;
  border: 1px solid #e2e8f0;
  border-radius: 26px;
  box-shadow: 0 24px 54px rgba(15, 23, 42, .12);
}
.front-auth-card h2 {
  font-size: 30px;
  line-height: 1.18;
}
.front-auth-box {
  padding: 22px;
  border-radius: 22px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 18px 40px rgba(37, 99, 235, .08);
}
.front-auth-box-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.front-auth-box-head strong {
  font-size: 20px;
  letter-spacing: -.4px;
}
.front-auth-box-head span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}
.front-auth-box .auth-form {
  display: grid;
  gap: 10px;
}
.front-auth-box input {
  min-height: 46px;
  border-color: #dbe7f6;
  background: #f8fbff;
  font-size: 14px;
}
.front-auth-box input:focus,
.front-v2-body input:focus,
.front-v2-body select:focus {
  outline: 3px solid rgba(37, 99, 235, .12);
  border-color: #2563eb;
}
.front-auth-box button[type="submit"],
.front-primary-action {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}
.front-app-shell {
  max-width: 1180px;
  min-height: 800px;
  margin: 34px auto;
  border-radius: 24px;
  border-color: rgba(203, 213, 225, .95);
  box-shadow: 0 28px 70px rgba(15, 23, 42, .12);
}
.front-sidebar {
  padding: 28px 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}
.front-brand {
  padding: 0 8px 4px;
}
.front-brand strong {
  font-size: 30px;
  color: #07152f;
}
.front-brand span {
  color: #64748b;
  font-weight: 800;
}
.front-sidebar .view-tabs {
  gap: 6px;
}
.front-sidebar .view-tab,
.front-sidebar .front-nav-link {
  min-height: 40px;
  border-radius: 12px;
  font-size: 14px;
}
.front-sidebar .view-tab.active {
  color: #0758d8;
  background: #eaf3ff;
  box-shadow: inset 3px 0 0 #2563eb;
}
.front-main {
  padding: 0 30px 34px;
  background: #f4f7fb;
}
.front-topbar {
  min-height: 70px;
  margin: 0 -30px 28px;
  padding: 0 30px;
}
.front-topbar h1 {
  font-size: 24px;
  letter-spacing: -.7px;
}
.front-v2-body .membership-card,
.front-v2-body .stat-card,
.front-trend-card,
.front-quick-card,
.front-v2-body .panel {
  border-color: #e2e8f0;
  background: #fff;
  box-shadow: 0 16px 36px rgba(15, 23, 42, .06);
}
.front-v2-body .membership-card {
  padding: 20px;
}
.front-v2-body .stat-card {
  position: relative;
  overflow: hidden;
}
.front-v2-body .stat-card::after {
  content: '';
  position: absolute;
  right: -22px;
  top: -22px;
  width: 74px;
  height: 74px;
  border-radius: 999px;
  background: rgba(37, 99, 235, .08);
}
.front-v2-body .profit::after { background: rgba(22, 163, 74, .09); }
.front-v2-body .stock::after { background: rgba(249, 115, 22, .1); }

.front-v2-body .payable strong { color: #dc2626; }
.front-v2-body .payable::after { background: rgba(239, 68, 68, .08); }
.front-v2-body .stat-card strong {
  font-size: clamp(24px, 3vw, 32px);
}
.front-v2-body .panel-title h2 {
  letter-spacing: -.4px;
}
.front-v2-body .layout-grid .panel {
  border-radius: 22px;
}
.front-v2-body .form-grid,
.front-v2-body .stacked-form,
.front-v2-body .two-cols {
  gap: 12px;
}
.front-v2-body input,
.front-v2-body select,
.front-v2-body button {
  min-height: 44px;
  border-radius: 13px;
}
.front-v2-body .front-ledger-panel .panel-actions {
  flex-wrap: wrap;
}
@media (max-width: 980px) {
  .front-auth-shell,
  .front-app-shell {
    margin: 0;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
  .front-auth-hero-grid {
    grid-template-columns: 1fr;
  }
  .front-auth-preview {
    max-width: 520px;
  }
  .front-auth-card {
    grid-template-columns: 1fr;
    width: calc(100% - 32px);
    margin-bottom: 24px;
  }
  .front-header-actions {
    align-items: stretch;
  }
}
@media (max-width: 680px) {
  .front-auth-hero {
    padding: 24px 18px 38px;
  }
  .front-auth-hero-grid {
    margin-top: 26px;
    gap: 24px;
  }
  .front-auth-copy-main h1 {
    font-size: 34px;
    letter-spacing: -1.2px;
  }
  .front-auth-card {
    width: calc(100% - 20px);
    margin-top: -20px;
    padding: 18px;
  }
  .front-auth-box-head,
  .front-store-actions {
    flex-direction: column;
  }
  .front-preview-metrics,
  .front-plan-row,
  .front-v2-body .stats-grid,
  .front-dashboard-grid,
  .front-v2-body .layout-grid,
  .front-v2-body .report-summary,
  .front-v2-body .report-columns {
    grid-template-columns: 1fr;
  }
  .front-v2-body .front-period-card input {
    width: 100%;
    max-width: none;
  }
}


/* Independent feature pages */
.front-page-panel {
  display: grid;
  gap: 16px;
}
.front-page-panel.hidden {
  display: none !important;
}
.front-v2-body .front-page-panel > .panel,
.front-v2-body .front-page-panel.panel {
  margin-top: 0;
}
.front-quick-grid button {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 46px;
  border-radius: 14px;
  border: 0;
  color: #0758d8;
  background: #eef6ff;
  font-weight: 800;
  box-shadow: none;
}
.front-quick-grid button:nth-child(2) { color: #099250; background: #ecfdf3; }
.front-quick-grid button:nth-child(3) { color: #f97316; background: #fff7ed; }
.front-quick-grid button:nth-child(4) { color: #0f2a4d; background: #f8fbff; border: 1px solid #cbdcf1; }
.front-quick-grid button:hover { filter: brightness(.98); }
.scan-lookup-form { border-top: 0; padding-top: 0; margin-top: 0; }
.scan-lookup-row { display: grid; grid-template-columns: minmax(0, 1fr) 140px; gap: 10px; }
.scan-camera-actions { display: flex; gap: 10px; margin: 8px 0 12px; flex-wrap: wrap; }
.scan-camera-actions button { width: auto; min-height: 38px; padding: 0 14px; }
.scan-mode-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 10px 0 12px; }
.scan-mode-btn { min-height: 78px; border: 1px solid #bfdbfe; border-radius: 16px; line-height: 1.35; box-shadow: 0 10px 22px rgba(37, 99, 235, .12); }
.scan-mode-btn span { font-size: 12px; font-weight: 700; opacity: .9; }
.scan-mode-btn.sale { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.scan-mode-btn.purchase { background: linear-gradient(135deg, #059669, #16a34a); }
.scan-mode-btn.active { outline: 3px solid rgba(59, 130, 246, .25); transform: translateY(-1px); }
.scan-reader-warning { color: #b45309 !important; }
.barcode-scan-box { position: relative; overflow: hidden; min-height: 260px; margin: 10px 0 12px; border-radius: 18px; background: #0f172a; border: 1px solid #1e293b; }
.barcode-scan-box video { display: block; width: 100%; height: 320px; object-fit: cover; }
.barcode-scan-line { position: absolute; left: 12%; right: 12%; top: 50%; height: 2px; background: #22c55e; box-shadow: 0 0 18px rgba(34, 197, 94, .9); }
.barcode-scan-box p { position: absolute; left: 12px; right: 12px; bottom: 12px; margin: 0; padding: 8px 10px; border-radius: 999px; color: #e0f2fe; background: rgba(15, 23, 42, .72); text-align: center; font-size: 13px; font-weight: 800; }
.scan-product-result { margin-top: 14px; padding: 14px; border: 1px solid #bfdbfe; border-radius: 16px; background: #f8fbff; }
.scan-product-result.empty { color: var(--muted); background: #fff; border-style: dashed; }
.scan-product-card { display: grid; gap: 12px; }
.scan-product-card strong { display: block; color: #0f172a; font-size: 20px; }
.scan-product-card small { display: block; margin-top: 4px; color: var(--muted); }
.scan-product-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.scan-product-metrics span { padding: 12px; border-radius: 14px; color: var(--muted); background: #fff; border: 1px solid #e2e8f0; }
.scan-product-metrics b { display: block; margin-top: 6px; color: #0758d8; font-size: 18px; }
.scan-type-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.scan-type-btn { min-height: 70px; border: 1px solid #dbeafe; color: #1d4ed8; background: #eff6ff; line-height: 1.35; }
.scan-type-btn span { color: #64748b; font-size: 12px; font-weight: 700; }
.scan-type-btn:hover { color: #fff; background: #2563eb; }
.scan-type-btn:hover span { color: #dbeafe; }
.scan-type-btn.active { border-color: #1d4ed8; color: #fff; background: linear-gradient(135deg, #1d4ed8, #0ea5e9); box-shadow: 0 12px 24px rgba(29, 78, 216, .22); }
.scan-type-btn.active span { color: #e0f2fe; }
.scan-record-feedback { margin-top: 10px; padding: 12px; border-radius: 14px; color: #166534; background: #dcfce7; border: 1px solid #86efac; font-size: 14px; font-weight: 800; }
.scan-new-product-form { border: 1px solid #bfdbfe; border-radius: 18px; padding: 16px; background: #f8fbff; }
.scan-new-product-form input[readonly] { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe; font-weight: 800; }
.form-hint { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
@media (max-width: 680px) {
  .scan-lookup-row,
  .scan-product-metrics,
  .scan-type-actions,
  .scan-mode-actions { grid-template-columns: 1fr; }
  .scan-camera-actions button { width: 100%; }
  .barcode-scan-box { min-height: 220px; }
  .barcode-scan-box video { height: 260px; }
}
.front-sidebar .view-tab {
  display: flex;
  align-items: center;
}
.front-sidebar .view-tab:not(.active):hover,
.front-sidebar .view-tab:not(.active):focus {
  color: #2563eb;
  background: #eaf3ff;
}

/* Admin independent pages */
.admin-nav button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 13px;
  color: #475569;
  background: transparent;
  text-align: left;
  text-decoration: none;
  font-weight: 800;
  box-shadow: none;
}
.admin-nav button:hover,
.admin-nav button:focus {
  color: #2563eb;
  background: #eaf3ff;
}
.admin-nav button.active {
  color: #fff;
  background: var(--primary);
}
.admin-page-panel {
  display: block;
}
.admin-page-panel.hidden {
  display: none !important;
}
.admin-info-list {
  display: grid;
  gap: 10px;
}
.admin-info-list > div {
  display: grid;
  gap: 5px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfdff;
}
.admin-info-list b {
  color: #0f172a;
}
.admin-info-list span {
  color: var(--muted);
  line-height: 1.6;
  font-size: 13px;
}
#adminBackupPage .admin-summary-grid {
  margin-bottom: 14px;
}
@media (max-width: 1100px) {
  .admin-sidebar {
    display: flex;
  }
  .admin-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .admin-nav {
    grid-template-columns: 1fr;
  }
}

/* ICP footer link */
.support-strip a,
.front-sidebar-footer a {
  color: inherit;
  text-decoration: none;
  font-weight: 800;
}
.support-strip a:hover,
.front-sidebar-footer a:hover {
  text-decoration: underline;
}


/* Legal modal */
.support-links button {
  width: auto;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  color: var(--primary);
  background: #eff6ff;
  text-decoration: none;
  font-weight: 700;
}
.legal-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, .42);
}
.legal-modal.hidden {
  display: none !important;
}
.legal-modal-card {
  width: min(720px, 100%);
  max-height: min(78vh, 720px);
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(15, 23, 42, .24);
}
.legal-modal-card .panel-title {
  position: sticky;
  top: -22px;
  z-index: 1;
  padding: 0 0 12px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.legal-content {
  display: grid;
  gap: 12px;
  color: #334155;
  line-height: 1.8;
  font-size: 14px;
}
.legal-content b {
  color: #0f172a;
  font-size: 16px;
}

.version-modal-card {
  width: min(680px, 100%);
}

.version-content {
  gap: 10px;
}

.version-content h3 {
  margin: 6px 0 0;
  color: #0f172a;
  font-size: 15px;
}

.version-content ul {
  margin: 0;
  padding-left: 20px;
}

.version-content li {
  margin: 4px 0;
}

.version-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-right: 8px;
  padding: 0 10px;
  border-radius: 999px;
  color: #1d4ed8;
  background: #dbeafe;
  font-size: 12px;
  font-weight: 800;
}

.product-import-modal-card {
  width: min(1180px, 100%);
}

.import-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin: 14px 0 16px;
}

.import-summary-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fbff;
}

.import-summary-item span {
  display: block;
  color: #64748b;
  font-size: 13px;
}

.import-summary-item strong {
  display: block;
  margin-top: 6px;
  color: #0f172a;
  font-size: 22px;
}

.import-preview-columns {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 16px;
}

.import-preview-columns h3 {
  margin: 0 0 10px;
  color: #0f172a;
  font-size: 15px;
}

.import-preview-list {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.import-preview-item {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .04);
}

.import-preview-item-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.import-preview-item-title {
  display: grid;
  gap: 4px;
}

.import-preview-item-title b {
  color: #0f172a;
}

.import-preview-item-title small,
.import-preview-item-meta,
.import-preview-item-issue {
  color: #64748b;
  font-size: 13px;
  line-height: 1.6;
}

.import-preview-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.import-preview-badge.insert {
  color: #1d4ed8;
  background: #dbeafe;
}

.import-preview-badge.update {
  color: #166534;
  background: #dcfce7;
}

.import-preview-badge.skip {
  color: #b45309;
  background: #fef3c7;
}

.import-preview-item-issues {
  display: grid;
  gap: 4px;
  margin-top: 10px;
}

.import-preview-item-issue {
  color: #b45309;
}

.product-import-edit-item {
  padding: 16px;
}

.product-import-edit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.product-import-edit-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.product-import-edit-field.wide {
  grid-column: span 2;
}

.product-import-edit-field span {
  color: #475569;
  font-size: 14px;
  font-weight: 800;
}

.product-import-edit-field input,
.product-import-edit-field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  font-size: 15px;
  line-height: 1.5;
}

.product-import-edit-field textarea {
  min-height: 76px;
  resize: vertical;
}

.product-import-edit-field input:focus,
.product-import-edit-field textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.import-source-text {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed #dbe3ef;
  overflow-wrap: anywhere;
}

.debt-form-hint {
  min-height: 40px;
  padding: 10px 12px;
  border: 1px dashed #bfdbfe;
  border-radius: 12px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 13px;
  line-height: 1.6;
}


/* Admin chart clarity */
.admin-bar-item {
  grid-template-rows: 20px 1fr auto;
}
.admin-bar-value {
  color: #0f172a;
  font-size: 13px;
  line-height: 1;
}
.admin-bar-track span[style*="height:0%"] {
  min-height: 0;
}
.admin-donut {
  display: grid;
  place-items: center;
}
.admin-donut > strong,
.admin-donut > span {
  display: none;
}
.admin-donut-center {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  gap: 4px;
  text-align: center;
}
.admin-donut-center strong {
  color: #0f172a;
  font-size: 25px;
  line-height: 1;
}
.admin-donut-center span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
}
.admin-plan-summary {
  display: grid;
  gap: 5px;
  justify-items: center;
  text-align: center;
}
.admin-plan-summary b {
  color: #0f172a;
  font-size: 15px;
}
.admin-plan-summary span {
  color: var(--muted);
  font-size: 12px;
}


/* Mobile function navigation */
@media (max-width: 980px) {
  .front-app-shell {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 100vh;
    overflow: visible;
  }
  .front-sidebar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    gap: 10px;
    padding: 12px 12px 10px;
    border-right: 0;
    border-bottom: 1px solid #dbe7f6;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(10px);
  }
  .front-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 2px;
  }
  .front-brand strong {
    font-size: 20px;
  }
  .front-brand span,
  .front-sidebar-footer,
  .front-nav-divider {
    display: none !important;
  }
  .front-sidebar .view-tabs:not(.hidden) {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 0 4px;
    margin: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .front-sidebar .view-tabs:not(.hidden)::-webkit-scrollbar {
    display: none;
  }
  .front-sidebar .view-tab {
    flex: 0 0 auto;
    width: auto;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    white-space: nowrap;
    color: #0f2a4d;
    background: #f3f7fc;
    box-shadow: none;
  }
  .front-sidebar .view-tab.active {
    color: #fff;
    background: #2563eb;
    box-shadow: 0 8px 18px rgba(37, 99, 235, .22);
  }
  .front-main {
    padding-top: 0;
  }
}


/* Full mobile responsive pass */
@media (max-width: 980px) {
  html,
  body,
  .front-v2-body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }
  .front-v2-body {
    background: #eef5ff;
  }
  .front-auth-shell {
    width: 100%;
    max-width: none;
    min-height: 100vh;
    margin: 0;
    padding: 0 0 22px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .front-auth-hero {
    min-height: auto;
    padding: 24px 18px 34px;
    border-radius: 0 0 22px 22px;
  }
  .front-auth-brandline {
    align-items: flex-start;
  }
  .front-auth-logo {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    font-size: 19px;
  }
  .front-auth-hero-grid {
    grid-template-columns: 1fr;
    gap: 22px;
    margin-top: 22px;
  }
  .front-auth-copy-main h1 {
    max-width: 100%;
    font-size: clamp(30px, 9vw, 42px);
    line-height: 1.12;
    letter-spacing: -1px;
  }
  .front-auth-copy-main > p:not(.front-version) {
    font-size: 15px;
    line-height: 1.7;
  }
  .front-hero-pills,
  .auth-tips {
    gap: 7px;
  }
  .auth-tips span {
    padding: 6px 9px;
    font-size: 12px;
  }
  .front-auth-preview {
    width: 100%;
    max-width: none;
    padding: 14px;
    border-radius: 18px;
  }
  .front-preview-metrics {
    grid-template-columns: 1fr;
  }
  .front-auth-card {
    grid-template-columns: 1fr;
    width: calc(100% - 24px);
    margin: -14px auto 0;
    padding: 18px;
    gap: 18px;
    border-radius: 20px;
  }
  .front-auth-card h2 {
    font-size: 24px;
    line-height: 1.2;
  }
  .front-plan-row {
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 16px 0;
  }
  .support-strip {
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.7;
  }
  .front-auth-box {
    padding: 16px;
  }
  .front-auth-box-head {
    flex-direction: column;
  }
  .auth-mode-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
  .auth-mode-tab {
    padding: 0 6px;
    font-size: 13px;
  }
  .front-app-shell {
    width: 100%;
    max-width: none;
    min-height: 100vh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }
  .front-main {
    min-width: 0;
    width: 100%;
    padding: 0 12px 24px;
  }
  .front-topbar {
    align-items: stretch;
    gap: 12px;
    min-height: auto;
    margin: 0 -12px 14px;
    padding: 14px 12px;
  }
  .front-topbar h1 {
    font-size: 22px;
  }
  .front-header-actions,
  .header-actions {
    width: 100%;
    margin-left: 0;
    align-items: stretch;
    gap: 10px;
  }
  .front-v2-body .front-period-card,
  .front-v2-body .month-card {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    margin: 0;
  }
  .front-v2-body .front-period-card .period-tabs,
  .period-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
  .front-v2-body .front-period-card .period-tab,
  .period-tab {
    width: 100%;
    min-height: 34px;
  }
  .front-v2-body .front-period-card input,
  .front-v2-body .month-card input,
  #dayPicker,
  #monthPicker,
  #yearPicker {
    width: 100%;
    max-width: none;
  }
  .front-primary-action,
  .front-topbar .secondary-light-btn,
  .front-store-actions .secondary-light-btn {
    width: 100%;
    min-width: 0;
  }
  .front-page-panel,
  #appRoot {
    width: 100%;
    min-width: 0;
    gap: 12px;
  }
  .front-v2-body .panel,
  .front-v2-body .membership-card,
  .front-trend-card,
  .front-quick-card,
  .account-security-card,
  .support-panel {
    width: 100%;
    min-width: 0;
    margin-top: 0;
    padding: 14px;
    border-radius: 16px;
  }
  .panel-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
  .panel-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }
  .panel-actions button,
  .panel-actions .secondary-light-btn,
  .danger-btn {
    width: 100%;
    max-width: none;
  }
  .front-v2-body .stats-grid,
  .front-dashboard-grid,
  .front-v2-body .layout-grid,
  .report-summary,
  .report-columns,
  .form-grid,
  .two-cols,
  .debt-summary,
  .support-grid,
  .membership-usage {
    grid-template-columns: 1fr;
  }
  .front-v2-body .stats-grid {
    gap: 10px;
  }
  .front-v2-body .stat-card {
    min-height: 92px;
    padding: 14px;
  }
  .front-v2-body .stat-card strong {
    font-size: 26px;
  }
  .front-line-chart {
    padding: 0;
    overflow-x: auto;
  }
  .front-line-chart svg {
    min-width: 310px;
  }
  input,
  select,
  button,
  textarea {
    max-width: 100%;
    font-size: 16px;
  }
  .stacked-form,
  .form-grid,
  .two-cols,
  .contact-form {
    gap: 10px;
  }
  .product-top,
  .ledger-top,
  .history-item,
  .mini-item {
    align-items: flex-start;
    flex-direction: column;
  }
  .product-item,
  .ledger-item,
  .history-item,
  .mini-item,
  .report-metric,
  .support-card,
  .membership-usage-item {
    width: 100%;
    min-width: 0;
    word-break: break-word;
  }
  .ledger-actions,
  .front-store-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }
  .front-quick-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .onboarding-step {
    grid-template-columns: auto 1fr;
  }
  .onboarding-step button {
    grid-column: 1 / -1;
    width: 100%;
  }
  .recovery-code-box {
    grid-template-columns: 1fr;
  }
  .recovery-code-box strong {
    font-size: 18px;
    word-break: break-all;
  }
  .smart-support-form {
    grid-template-columns: 1fr;
  }
  .smart-support-form button,
  .quick-questions button,
  .support-links button {
    width: 100%;
  }
  .support-links {
    display: grid;
    grid-template-columns: 1fr;
  }
  .legal-modal {
    padding: 10px;
    align-items: stretch;
  }
  .legal-modal-card {
    width: 100%;
    max-height: calc(100vh - 20px);
    padding: 16px;
    border-radius: 18px;
  }
  .legal-modal-card .panel-title {
    top: -16px;
  }
}

@media (max-width: 420px) {
  .front-auth-card {
    width: calc(100% - 16px);
    padding: 14px;
  }
  .front-auth-hero {
    padding: 20px 14px 30px;
  }
  .front-auth-copy-main h1 {
    font-size: 29px;
  }
  .front-sidebar {
    padding: 10px 10px 8px;
  }
  .front-sidebar .view-tab {
    min-height: 34px;
    padding: 0 10px;
    font-size: 13px;
  }
  .front-main {
    padding-left: 10px;
    padding-right: 10px;
  }
  .front-topbar {
    margin-left: -10px;
    margin-right: -10px;
    padding-left: 10px;
    padding-right: 10px;
  }
  .front-v2-body .panel,
  .front-v2-body .membership-card,
  .front-v2-body .stat-card {
    padding: 12px;
  }
}


/* Mobile overflow hard fix */
@media (max-width: 980px) {
  .front-v2-body,
  .front-v2-body * {
    min-width: 0;
  }
  .front-v2-body {
    position: relative;
    overflow-x: hidden !important;
  }
  .front-auth-shell,
  .front-app-shell,
  .front-sidebar,
  .front-main,
  .front-topbar,
  .front-page-panel,
  .front-page-panel.panel,
  .front-v2-body .panel,
  .front-dashboard-grid,
  .front-trend-card,
  .front-quick-card,
  .stats-grid,
  .stat-card,
  .report-panel,
  .report-summary,
  .report-columns,
  .support-panel,
  .membership-card,
  #appRoot,
  [data-view-panel] {
    max-width: 100% !important;
    box-sizing: border-box;
  }
  .front-app-shell,
  .front-main,
  .front-page-panel,
  #appRoot,
  [data-view-panel] {
    overflow-x: hidden !important;
  }
  .front-sidebar {
    width: 100% !important;
    max-width: 100vw !important;
    overflow: hidden;
  }
  .front-sidebar .view-tabs:not(.hidden) {
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
    overflow-y: hidden;
  }
  .front-topbar {
    width: auto !important;
  }
  .front-header-actions,
  .header-actions,
  .front-v2-body .front-period-card,
  .front-v2-body .month-card,
  .front-v2-body .front-period-card .period-tabs,
  .period-tabs {
    max-width: 100% !important;
  }
  .front-v2-body .front-period-card .period-tabs,
  .period-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
  .front-v2-body .front-period-card .period-tab,
  .period-tab {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-width: 0 !important;
    padding-left: 6px !important;
    padding-right: 6px !important;
    color: #52627a;
    overflow: hidden;
  }
  .front-v2-body .front-period-card .period-tab.active,
  .period-tab.active {
    color: #0758d8 !important;
    background: #fff !important;
  }
  .front-v2-body .front-period-card input,
  .front-v2-body .month-card input,
  #dayPicker,
  #monthPicker,
  #yearPicker {
    display: block;
    max-width: 100% !important;
    min-width: 0 !important;
  }
  .front-primary-action,
  .front-quick-grid button,
  .front-quick-grid a,
  .secondary-light-btn,
  .danger-btn,
  .mini-danger-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    max-width: 100% !important;
    min-width: 0 !important;
    white-space: normal !important;
    text-align: center;
    overflow: visible;
  }
  .front-primary-action {
    color: #fff !important;
    min-height: 42px;
  }
  .front-quick-grid {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden;
  }
  .front-quick-grid button,
  .front-quick-grid a {
    width: 100% !important;
    min-height: 46px;
    padding: 0 10px;
    font-size: 14px;
  }
  .front-quick-grid button:nth-child(1),
  .front-quick-grid a:nth-child(1) { color: #0758d8 !important; background: #eef6ff !important; }
  .front-quick-grid button:nth-child(2),
  .front-quick-grid a:nth-child(2) { color: #099250 !important; background: #ecfdf3 !important; }
  .front-quick-grid button:nth-child(3),
  .front-quick-grid a:nth-child(3) { color: #f97316 !important; background: #fff7ed !important; }
  .front-quick-grid button:nth-child(4),
  .front-quick-grid a:nth-child(4) { color: #0f2a4d !important; background: #f8fbff !important; }
  .front-line-chart {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    overflow: hidden !important;
  }
  .front-line-chart svg {
    display: block;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 160px;
  }
  .front-chart-legend {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 8px;
  }
  .front-chart-empty {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 150px;
    padding: 14px;
    text-align: center;
    white-space: normal !important;
    word-break: break-word;
    overflow-wrap: anywhere;
  }
  .stat-card,
  .report-metric,
  .product-item,
  .ledger-item,
  .history-item,
  .mini-item,
  .support-card,
  .onboarding-step,
  .membership-usage-item,
  .debt-item {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .stat-card strong {
    max-width: 100%;
    overflow-wrap: anywhere;
  }
  .front-alert-line {
    width: 100%;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
  }
  .support-strip {
    max-width: 100% !important;
  }
}

.membership-plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.membership-plan-card {
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 16px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.membership-plan-card.active {
  border-color: #2563eb;
  box-shadow: 0 14px 34px rgba(37, 99, 235, 0.14);
}

.membership-plan-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.membership-plan-head span,
.membership-plan-head strong,
.membership-plan-head em {
  display: block;
}

.membership-plan-head span {
  color: #64748b;
  font-size: 13px;
}

.membership-plan-head strong {
  margin-top: 4px;
  color: #0f172a;
  font-size: 20px;
}

.membership-plan-head em {
  border-radius: 999px;
  padding: 4px 8px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
}

.membership-plan-card p {
  min-height: 42px;
  margin: 12px 0;
  color: #475569;
  line-height: 1.6;
}

.membership-plan-card ul {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.membership-plan-card li {
  color: #334155;
  font-size: 14px;
}

.membership-plan-card li::before {
  content: '✓';
  margin-right: 6px;
  color: #16a34a;
}

@media (max-width: 860px) {
  .membership-plan-grid {
    grid-template-columns: 1fr;
  }
}

.readonly-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.readonly-grid div {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px;
  background: #f8fafc;
}

.readonly-grid span,
.readonly-grid strong {
  display: block;
}

.readonly-grid span {
  color: #64748b;
  font-size: 13px;
}

.readonly-grid strong {
  margin-top: 4px;
  color: #0f172a;
}

@media (max-width: 720px) {
  .readonly-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .import-summary-grid,
  .import-preview-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .import-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}





.inline-receipt-details { margin-top: 12px; border: 1px solid #dbeafe; border-radius: 14px; background: #f8fbff; overflow: hidden; }
.inline-receipt-details summary { cursor: pointer; list-style: none; padding: 10px 14px; color: #fff; background: #2563eb; font-weight: 800; text-align: center; }
.inline-receipt-details summary::-webkit-details-marker { display: none; }
.inline-receipt-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; color: #475569; font-size: 12px; border-bottom: 1px solid #dbeafe; }
.receipt-print-guide { margin: 10px 12px 0; padding: 10px 12px; border: 1px dashed #93c5fd; border-radius: 12px; background: #eff6ff; color: #1e3a8a; font-size: 12px; line-height: 1.55; }
.receipt-print-guide b { display: block; margin-bottom: 4px; color: #1d4ed8; }
.receipt-print-guide ul { margin: 0; padding-left: 18px; }
.receipt-print-guide li { margin: 2px 0; }
.inline-receipt-print-area { display: grid; justify-content: center; padding: 12px; }
.inline-receipt-print-area .receipt-paper { box-shadow: none; }
.receipt-modal-card { width: min(520px, 100%); }
.receipt-content { display: grid; justify-content: center; padding: 10px 0 4px; }
.receipt-paper { width: 300px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: #111827; box-shadow: 0 12px 28px rgba(15, 23, 42, .08); }
.receipt-paper header { text-align: center; }
.receipt-paper h3 { margin: 0; font-size: 20px; font-weight: 800; }
.receipt-paper p { margin: 5px 0; color: #475569; }
.receipt-shop-meta { margin-top: 7px; display: grid; gap: 3px; color: #334155; font-size: 12px; line-height: 1.45; word-break: break-word; }
.receipt-line { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: 12px; line-height: 1.4; }
.receipt-line span { color: #64748b; white-space: nowrap; }
.receipt-line b { color: #111827; text-align: right; overflow-wrap: anywhere; }
.receipt-line.receipt-total { font-size: 14px; font-weight: 800; }
.receipt-divider { margin: 8px 0; border-top: 1px dashed #94a3b8; }
.receipt-table { width: 100%; border-collapse: collapse; font-size: 11px; table-layout: fixed; }
.receipt-table th, .receipt-table td { padding: 6px 2px; border-bottom: 1px dotted #cbd5e1; text-align: right; vertical-align: top; word-break: break-word; }
.receipt-table th:first-child, .receipt-table td:first-child { width: 38%; text-align: left; }
.receipt-table th:nth-child(2), .receipt-table td:nth-child(2) { width: 18%; }
.receipt-table th:nth-child(3), .receipt-table td:nth-child(3) { width: 20%; }
.receipt-table th:nth-child(4), .receipt-table td:nth-child(4) { width: 24%; }
.receipt-paper footer { margin-top: 12px; text-align: center; color: #64748b; font-size: 11px; line-height: 1.45; }
.receipt-paper footer small { display: block; margin-top: 4px; }
@media print {
  body * { visibility: hidden !important; }
  #receiptModal, #receiptModal *, .inline-receipt-details[open], .inline-receipt-details[open] * { visibility: visible !important; }
  html, body { width: 58mm !important; margin: 0 !important; padding: 0 !important; background: #fff !important; }
  #receiptModal { position: static !important; display: block !important; visibility: visible !important; background: #fff !important; padding: 0 !important; }
  #receiptModal .receipt-modal-card { width: 58mm !important; margin: 0 !important; padding: 0 !important; border: 0 !important; box-shadow: none !important; }
  #receiptModal .receipt-print-actions, #receiptModal .receipt-print-guide { display: none !important; }
  #receiptModal .receipt-content { display: block !important; padding: 0 !important; }
  #receiptModal .receipt-paper, .inline-receipt-details[open] .receipt-paper { width: 58mm !important; padding: 3mm !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; }
  #receiptModal .receipt-line b { overflow-wrap: anywhere !important; }
  #receiptModal .receipt-table { table-layout: fixed !important; font-size: 10px !important; }
  #receiptModal .receipt-table th:first-child, #receiptModal .receipt-table td:first-child { width: 42% !important; }
  .inline-receipt-details[open] { position: absolute !important; left: 0 !important; top: 0 !important; width: 58mm !important; margin: 0 !important; border: 0 !important; background: #fff !important; }
  .inline-receipt-details[open] summary, .inline-receipt-details[open] .inline-receipt-toolbar, .inline-receipt-details[open] .receipt-print-guide { display: none !important; }
  .inline-receipt-details[open] .inline-receipt-print-area { display: block !important; padding: 0 !important; }
}

/* Sale cart checkout */
.sale-cart-form .form-hint { margin-top: -4px; }
.sale-cart-scan-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px 120px; gap: 10px; align-items: stretch; }
.sale-cart-scan-row button { white-space: nowrap; }
.sale-cart-scan-error { color: #b91c1c !important; font-weight: 800; }
@media (max-width: 780px) {
  .sale-cart-scan-row { grid-template-columns: 1fr; }
}
.sale-cart-picker { display: grid; grid-template-columns: minmax(0, 1.6fr) 120px 140px 120px; gap: 10px; align-items: stretch; }
.sale-cart-box { display: grid; gap: 10px; padding: 14px; border: 1px solid #dbeafe; border-radius: 18px; background: #f8fbff; }
.sale-cart-head, .sale-cart-total, .sale-cart-item, .sale-cart-item-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sale-cart-head b { color: #0f172a; }
.sale-cart-head button { width: auto; min-height: 34px; padding: 0 12px; }
.sale-cart-list { display: grid; gap: 8px; }
.sale-cart-item { padding: 12px; border: 1px solid #e2e8f0; border-radius: 14px; background: #fff; }
.sale-cart-item b { display: block; color: #0f172a; }
.sale-cart-item small { display: block; margin-top: 4px; color: var(--muted); }
.sale-cart-item em { display: block; margin-top: 4px; color: #b91c1c; font-style: normal; font-weight: 800; }
.sale-cart-item.stock-risk { border-color: #fecaca; background: #fff7f7; }
.sale-cart-item-actions { flex-shrink: 0; }
.sale-cart-item-actions strong { color: #0758d8; white-space: nowrap; }
.sale-cart-total { padding-top: 8px; border-top: 1px dashed #bfdbfe; }
.sale-cart-total span { color: var(--muted); font-weight: 800; }
.sale-cart-total strong { color: #0758d8; font-size: 22px; }
@media (max-width: 780px) {
  .sale-cart-picker { grid-template-columns: 1fr; }
  .sale-cart-item { align-items: flex-start; flex-direction: column; }
  .sale-cart-item-actions { width: 100%; }
}
@media (max-width: 680px) {
  .front-auth-hero-grid { display: flex; flex-direction: column; }
  .front-auth-copy-main { order: 1; }
  .front-auth-preview { display: none; }
  .front-auth-card { margin: -12px auto 0; }
  .front-auth-card .auth-copy { order: 2; }
  .front-auth-card .front-auth-box { order: 1; }
  .front-auth-card .auth-copy h2 { font-size: 22px; }
  .front-auth-card .auth-copy > .muted,
  .front-auth-card .front-plan-row { display: none; }
  .front-auth-box { border-color: #bfdbfe; box-shadow: 0 16px 34px rgba(37, 99, 235, .12); }
}
/* Sale order ledger grouping */
.sale-order-ledger-item { background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%); }
.ledger-order-products { margin-top: 10px; padding: 10px 12px; border-radius: 12px; color: #334155; background: #f1f5f9; line-height: 1.7; font-size: 13px; }
@media (max-width: 680px) {
  .ledger-order-products { font-size: 12px; }
}
.payment-status-card, .wechat-pay-status-card { display: grid; gap: 6px; padding: 12px 14px; border: 1px solid #dbeafe; border-radius: 14px; background: #f8fbff; color: #1e3a8a; }
.payment-status-card b, .wechat-pay-status-card b { color: #0f172a; }
.payment-status-card span, .wechat-pay-status-card span, .wechat-pay-status-card small { color: #475569; font-size: 13px; line-height: 1.5; }
.payment-status-card.ready, .wechat-pay-status-card.ready { border-color: #bbf7d0; background: #f0fdf4; }
.payment-status-card.pending, .wechat-pay-status-card.pending { border-color: #fde68a; background: #fffbeb; }
.payment-order-actions { display: flex; align-items: center; gap: 10px; padding-top: 8px; border-top: 1px dashed #dbeafe; }
.payment-order-actions button { width: auto; min-width: 108px; }
.payment-order-actions small { color: #64748b; line-height: 1.5; }
.payment-order-actions button:disabled { cursor: not-allowed; opacity: .62; background: #cbd5e1; color: #475569; }
.wechat-qr-panel { display: flex; align-items: center; gap: 14px; margin-top: 10px; padding: 12px; border: 1px solid #bbf7d0; border-radius: 14px; background: #f0fdf4; }
.wechat-qr-box { position: relative; display: grid; place-items: center; width: 178px; min-width: 178px; min-height: 178px; padding: 10px; border: 1px solid #dcfce7; border-radius: 12px; background: #fff; color: #64748b; text-align: center; font-size: 13px; overflow: hidden; }
.wechat-qr-box img { display: block; width: 150px; height: 150px; }
.wechat-qr-panel b { display: block; color: #166534; }
.wechat-qr-panel p { margin: 5px 0 0; color: #166534; line-height: 1.6; }
.wechat-qr-panel em { display: inline-flex; margin-top: 5px; padding: 3px 8px; border-radius: 999px; color: #166534; background: #dcfce7; font-size: 12px; font-style: normal; font-weight: 800; }
.wechat-qr-panel.expired { border-color: #fed7aa; background: #fff7ed; }
.wechat-qr-panel.expired b, .wechat-qr-panel.expired p { color: #9a3412; }
.wechat-qr-panel.expired em { color: #9a3412; background: #ffedd5; }
.wechat-qr-box.expired img { filter: blur(4px) grayscale(1); opacity: .38; }
.wechat-qr-expired-mask { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; color: #9a3412; background: rgba(255, 247, 237, .72); font-size: 18px; font-weight: 900; }
@media (max-width: 680px) { .payment-order-actions, .wechat-qr-panel { align-items: stretch; flex-direction: column; } .payment-order-actions button { width: 100%; } .wechat-qr-box { width: 100%; min-width: 0; } }.payment-order-panel { margin-top: 18px; padding: 16px; border: 1px solid #dbeafe; border-radius: 18px; background: #f8fbff; }
.payment-order-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.payment-order-title h3 { margin: 2px 0 0; color: #0f172a; }
.payment-order-title > span { padding: 5px 10px; border-radius: 999px; color: #1d4ed8; background: #dbeafe; font-size: 12px; font-weight: 800; white-space: nowrap; }
.payment-order-title .secondary-light-btn { min-height: 34px; border-radius: 999px; white-space: nowrap; }
.payment-order-help { display: grid; gap: 5px; margin-top: 10px; padding: 10px 12px; border: 1px dashed #bfdbfe; border-radius: 14px; color: #1e3a8a; background: #eff6ff; font-size: 13px; font-weight: 700; line-height: 1.5; }
.payment-order-list { display: grid; gap: 10px; margin-top: 12px; }
.payment-order-item { display: grid; gap: 6px; padding: 12px; border: 1px solid #e2e8f0; border-radius: 14px; background: #fff; }
.payment-order-item > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.payment-order-item b { color: #0f172a; }
.payment-order-item strong { color: #dc2626; }
.payment-order-item span, .payment-order-item small, .payment-order-item p { color: #64748b; }
.payment-order-item p { margin: 0; font-size: 13px; line-height: 1.5; }
.payment-order-item.paid { border-color: #bbf7d0; background: #f0fdf4; }
.payment-order-item.paid strong { color: #15803d; }
.payment-order-item.cancelled { border-color: #fecaca; background: #fff7f7; }
.payment-order-item.cancelled strong { color: #991b1b; }
.payment-order-item.expired { border-color: #fed7aa; background: #fff7ed; }
.payment-order-item.expired strong { color: #c2410c; }
.payment-order-head, .payment-order-row { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, .8fr) minmax(0, .75fr) minmax(0, .9fr) minmax(0, 1fr); }
.payment-order-head > *, .payment-order-row > * { min-width: 0; }
.payment-order-row b, .payment-order-row small, .payment-order-row span { overflow-wrap: anywhere; word-break: break-word; }
.admin-paid-tag { display: inline-flex; align-items: center; min-height: 34px; padding: 0 10px; border-radius: 999px; color: #15803d; background: #dcfce7; font-size: 13px; font-weight: 800; }
.admin-cancelled-tag { display: inline-flex; align-items: center; min-height: 34px; padding: 0 10px; border-radius: 999px; color: #991b1b; background: #fee2e2; font-size: 13px; font-weight: 800; }
.admin-expired-tag { display: inline-flex; align-items: center; min-height: 34px; padding: 0 10px; border-radius: 999px; color: #c2410c; background: #ffedd5; font-size: 13px; font-weight: 800; }
.admin-expiry-tag { display: inline-flex; align-items: center; width: fit-content; min-height: 24px; margin-top: 6px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.admin-expiry-tag.free { color: #475569; background: #f1f5f9; }
.admin-expiry-tag.ok { color: #15803d; background: #dcfce7; }
.admin-expiry-tag.warning { color: #b45309; background: #fef3c7; }
.admin-expiry-tag.expired { color: #991b1b; background: #fee2e2; }
.payment-order-row.cancelled { border-color: #fecaca; background: #fff7f7; }
.payment-order-row.expired { border-color: #fed7aa; background: #fff7ed; }
.admin-order-tools { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 14px; }
.admin-order-tools input, .admin-order-tools select { min-height: 38px; border-radius: 12px; background: #f8fafc; flex: 1 1 150px; min-width: 140px; }
.admin-order-tools input[type="search"] { flex: 1 1 260px; min-width: 220px; }
.admin-order-tools button { flex: 0 0 auto; min-height: 38px; }
.payment-order-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 12px 0 14px; }
.payment-order-stats > div { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid #dbeafe; border-radius: 14px; background: #f8fbff; }
.payment-order-stats span { color: #64748b; font-size: 12px; font-weight: 700; }
.payment-order-stats strong { color: #0f172a; font-size: 22px; }
.payment-order-stats small { color: #64748b; font-size: 12px; line-height: 1.4; }
.payment-order-pager { margin-top: 12px; }
@media (max-width: 780px) {
  .payment-order-title, .payment-order-item > div { align-items: flex-start; flex-direction: column; }
  .payment-order-title > span { white-space: normal; }
  .admin-order-tools { flex-direction: column; }
  .admin-order-tools input, .admin-order-tools select, .admin-order-tools button { width: 100%; min-width: 0; }
  .payment-order-head, .payment-order-row { grid-template-columns: 1fr; }
  .payment-order-row { gap: 12px; }
  .payment-order-row .admin-row-actions { flex-direction: column; align-items: stretch; }
  .payment-order-row .admin-row-actions button { width: 100%; }
  .payment-order-stats { grid-template-columns: 1fr 1fr; }
  .payment-order-stats > div { padding: 10px 12px; }
}




.home-role-hint { margin-top: 10px; padding: 10px 14px; border: 1px solid #dbeafe; border-radius: 14px; background: #eff6ff; color: #1d4ed8; font-size: 12px; font-weight: 800; }
.home-role-hint.boss { border-color: #bfdbfe; background: #eff6ff; color: #1d4ed8; }
.home-role-hint.branch { border-color: #bbf7d0; background: #f0fdf4; color: #15803d; }
.home-role-hint.staff { border-color: #fef3c7; background: #fffbeb; color: #b45309; }


.branch-account-table { width: 100%; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.branch-account-header, .branch-account-row { display: grid; grid-template-columns: 42px minmax(78px, .8fr) minmax(90px, 1fr) minmax(92px, .9fr) minmax(120px, 1fr) minmax(100px, .95fr) 68px minmax(205px, 1.4fr); align-items: center; }
.branch-account-header { min-height: 44px; padding: 0 8px; color: #475569; background: #f8fafc; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 800; }
.branch-account-row { min-height: 64px; padding: 8px; border-bottom: 1px solid var(--line); font-size: 13px; }
.branch-account-row:last-child { border-bottom: 0; }
.branch-account-row:hover { background: #f8fbff; }
.branch-account-cell { min-width: 0; padding-right: 6px; color: #475569; overflow: hidden; overflow-wrap: anywhere; }
.branch-account-cell b { color: var(--text); }
.branch-account-cell code { color: #0f172a; background: transparent; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; }
.branch-account-index { color: #64748b; }
.branch-cell-label { display: none; }
.branch-password-box { display: flex; align-items: center; gap: 4px; width: 100%; min-width: 0; overflow: hidden; }
.branch-password-box code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.branch-password-toggle { display: inline-grid; place-items: center; width: 32px; min-width: 32px; height: 32px; padding: 0; border: 1px solid #dbeafe; border-radius: 9px; color: #1d4ed8; background: #eff6ff; cursor: pointer; font-size: 15px; }
.branch-password-toggle:hover { border-color: #93c5fd; background: #dbeafe; }
.branch-password-toggle:disabled { cursor: wait; opacity: .55; }
.branch-status-tag { display: inline-flex; align-items: center; justify-content: center; min-height: 26px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.branch-status-tag.active { color: #15803d; background: #dcfce7; }
.branch-status-tag.disabled { color: #991b1b; background: #fee2e2; }
.branch-account-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding-right: 0; }
.branch-account-actions button { min-height: 32px; padding: 0 7px; font-size: 11px; white-space: nowrap; }
.branch-status-action.danger { color: #b91c1c; border-color: #fecaca; background: #fff7f7; }
.branch-password-note { margin: 10px 2px 0; color: #64748b; font-size: 12px; line-height: 1.6; }
@media (max-width: 980px) {
  .branch-account-table { border: 0; overflow: visible; background: transparent; }
  .branch-account-header { display: none; }
  .branch-account-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin-bottom: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
  .branch-account-row:last-child { border-bottom: 1px solid var(--line); }
  .branch-account-cell { display: grid; gap: 4px; padding: 0; }
  .branch-account-index { display: none; }
  .branch-cell-label { display: block; color: #94a3b8; font-size: 11px; font-weight: 800; }
  .branch-password-box { justify-content: flex-start; width: min(100%, 180px); }
  .branch-password-box code { flex: 0 1 auto; min-width: 72px; }
  .branch-account-actions { grid-column: 1 / -1; display: flex; flex-direction: row; }
  .branch-account-actions .branch-cell-label { width: 100%; }
  .branch-account-actions button { flex: 1; }
}
@media (max-width: 560px) {
  .branch-account-row { grid-template-columns: 1fr; }
  .branch-account-actions { grid-column: auto; flex-direction: column; align-items: stretch; }
  .branch-account-actions button { width: 100%; }
}

.location-management-table { width: 100%; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.location-management-header, .location-management-row { display: grid; grid-template-columns: minmax(150px, 1.15fr) 90px minmax(220px, 1.8fr) 90px 118px; align-items: center; column-gap: 12px; }
.location-management-header { min-height: 44px; padding: 0 14px; color: #475569; background: #f8fafc; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 800; }
.location-management-row { min-height: 64px; padding: 10px 14px; border-bottom: 1px solid var(--line); color: #475569; font-size: 13px; }
.location-management-row:last-child { border-bottom: 0; }
.location-management-row:hover { background: #f8fbff; }
.location-management-row.closed { background: #f8fafc; opacity: .88; }
.location-management-cell { min-width: 0; overflow: hidden; }
.location-management-cell b { color: var(--text); }
.location-address-cell > span:last-child { display: block; overflow: hidden; color: #64748b; text-overflow: ellipsis; white-space: nowrap; }
.location-cell-label { display: none; }
.location-status-tag, .location-default-tag, .location-type-tag { display: inline-flex; align-items: center; justify-content: center; min-height: 26px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.location-type-tag.store { color: #1d4ed8; background: #dbeafe; }
.location-type-tag.warehouse { color: #7c3aed; background: #ede9fe; }
.location-status-tag.active { color: #15803d; background: #dcfce7; }
.location-status-tag.closed { color: #991b1b; background: #fee2e2; }
.location-default-tag { color: #475569; background: #f1f5f9; }
.location-management-actions { display: flex; align-items: center; justify-content: flex-end; min-width: 0; }
@media (max-width: 780px) {
  .location-management-table { overflow: visible; border: 0; background: transparent; }
  .location-management-header { display: none; }
  .location-management-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name status" "type type" "address address" "actions actions"; gap: 10px 12px; margin-bottom: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
  .location-management-row:last-child { border-bottom: 1px solid var(--line); }
  .location-management-cell { display: flex; align-items: center; gap: 6px; overflow: visible; }
  .location-management-cell:nth-child(1) { grid-area: name; }
  .location-management-cell:nth-child(2) { grid-area: type; }
  .location-management-cell:nth-child(3) { grid-area: address; }
  .location-management-cell:nth-child(4) { grid-area: status; justify-self: end; }
  .location-management-cell:nth-child(5) { grid-area: actions; }
  .location-management-cell:nth-child(1) b { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
  .location-cell-label { display: inline; flex: 0 0 auto; color: #94a3b8; font-size: 11px; font-weight: 800; }
  .location-management-cell:nth-child(1) .location-cell-label, .location-management-cell:nth-child(4) .location-cell-label, .location-management-actions .location-cell-label { display: none; }
  .location-type-tag, .location-status-tag, .location-default-tag { width: auto; justify-self: start; }
  .location-address-cell > span:last-child { white-space: normal; overflow-wrap: anywhere; }
  .location-management-actions { align-items: center; justify-content: flex-end; padding-top: 2px; }
  .location-management-actions button { width: auto; min-width: 96px; }
}
/* V2.4.6 总店初始化与多门店经营范围 */
.location-edit-modal-card { width: min(620px, 100%); }
.location-edit-form { margin-top: 16px; }
.location-edit-form label { display: grid; gap: 7px; color: #475569; font-size: 13px; font-weight: 800; }
.location-edit-form label input { width: 100%; }
.location-edit-type-row { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid #dbeafe; border-radius: 14px; background: #f8fbff; }
.location-edit-type-row span { color: #64748b; font-size: 12px; font-weight: 800; }
.location-edit-type-row b { color: #1d4ed8; }
.location-edit-type-row small { color: #64748b; line-height: 1.5; }
.location-edit-actions { justify-content: flex-end; margin-top: 4px; }
.location-management-actions { gap: 6px; }
.enterprise-overview-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.enterprise-overview-info { display: grid; grid-template-columns: 1fr; gap: 10px; overflow: hidden; }
.enterprise-comparison-head, .enterprise-comparison-row { display: grid; grid-template-columns: minmax(150px, 1.35fr) repeat(5, minmax(90px, .8fr)); align-items: center; gap: 10px; }
.enterprise-comparison-head { padding: 10px 14px; color: #64748b; background: #eff6ff; border-radius: 12px 12px 0 0; font-size: 12px; font-weight: 800; }
.enterprise-comparison-list { overflow: hidden; border: 1px solid #dbeafe; border-radius: 0 0 14px 14px; background: #fff; }
.enterprise-comparison-row { min-height: 58px; padding: 10px 14px; border-bottom: 1px solid #e2e8f0; color: #475569; font-size: 12px; }
.enterprise-comparison-row:last-child { border-bottom: 0; }
.enterprise-comparison-row.selected { background: #eff6ff; }
.enterprise-comparison-row > span:first-child { display: grid; gap: 4px; }
.enterprise-comparison-row > span:first-child b { display: flex; align-items: center; gap: 6px; color: #0f172a; font-size: 13px; }
.enterprise-comparison-row > span:first-child small { color: #94a3b8; }
.enterprise-comparison-row em { display: inline-flex; align-items: center; min-height: 22px; padding: 0 7px; border-radius: 999px; color: #1d4ed8; background: #dbeafe; font-size: 11px; font-style: normal; }
.enterprise-comparison-row > strong { color: #0f172a; font-size: 13px; }
.enterprise-comparison-foot { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 12px 14px; border-radius: 14px; color: #475569; background: #f8fafc; font-size: 12px; }
.enterprise-comparison-foot b { color: #0f172a; }
@media (max-width: 780px) {
  .location-edit-type-row { grid-template-columns: auto 1fr; }
  .location-edit-type-row small { grid-column: 1 / -1; }
  .location-edit-actions, .location-edit-actions button { width: 100%; }
  .enterprise-overview-title { gap: 12px; }
  .enterprise-scope-select { width: 100%; }
  .enterprise-overview-stats { grid-template-columns: 1fr 1fr; }
  .enterprise-comparison-head { display: none; }
  .enterprise-comparison-list { display: grid; gap: 10px; overflow: visible; border: 0; background: transparent; }
  .enterprise-comparison-row { grid-template-columns: 1fr 1fr; gap: 8px 12px; padding: 12px; border: 1px solid #dbeafe; border-radius: 14px; background: #fff; }
  .enterprise-comparison-row > span:first-child { grid-column: 1 / -1; }
  .enterprise-comparison-row > strong::before { content: "营业额 "; color: #94a3b8; font-weight: 700; }
  .enterprise-comparison-row > span:nth-child(3)::before { content: "已收 "; color: #94a3b8; }
  .enterprise-comparison-row > span:nth-child(4)::before { content: "未收 "; color: #94a3b8; }
  .enterprise-comparison-row > span:nth-child(5)::before { content: "毛利 "; color: #94a3b8; }
  .enterprise-comparison-row > span:nth-child(6)::before { content: "订单 "; color: #94a3b8; }
}
@media (max-width: 480px) {
  .enterprise-overview-stats { grid-template-columns: 1fr; }
  .enterprise-comparison-row { grid-template-columns: 1fr; }
  .enterprise-comparison-row > span:first-child { grid-column: auto; }
}
.custom-range-picker { display: flex; align-items: center; gap: 8px; }
.custom-range-picker input { min-width: 142px; }
@media (max-width: 680px) {
  .custom-range-picker { width: 100%; flex-wrap: wrap; }
  .custom-range-picker input { flex: 1; min-width: 130px; }
}

.module-location-filter,
.location-scope-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}
.module-filter-group {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.module-location-filter { min-width: 210px; }
.module-location-filter select,
.location-scope-field select { width: 100%; }
.form-grid .location-scope-field { min-width: 0; }
.stock-adjust-modal-card { width: min(560px, calc(100vw - 32px)); }
.stock-adjust-modal-card .stacked-form { margin-top: 18px; }
.stock-adjust-modal-card .debt-form-hint {
  padding: 12px 14px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #eff6ff;
  color: #1e3a8a;
  line-height: 1.6;
}
.stocktake-panel { display: grid; gap: 18px; }
.stocktake-panel-title { align-items: flex-start; }
.stocktake-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fafc;
}
.stocktake-filter-grid label {
  display: grid;
  min-width: 0;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}
.stocktake-filter-grid select,
.stocktake-filter-grid input { width: 100%; min-width: 0; }
.stocktake-reset-btn { align-self: end; min-height: 46px; }
.stocktake-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.stocktake-summary-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid #dbeafe;
  border-radius: 16px;
  background: #f8fbff;
}
.stocktake-summary-card span { color: var(--muted); font-size: 13px; }
.stocktake-summary-card strong { color: #0f172a; font-size: 22px; }
.stocktake-summary-card.surplus { border-color: #bbf7d0; background: #f0fdf4; }
.stocktake-summary-card.shortage { border-color: #fecaca; background: #fff7f7; }
.stocktake-record-list { display: grid; gap: 12px; }
.stocktake-record-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}
.stocktake-record-head,
.stocktake-record-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.stocktake-record-head > div { display: grid; gap: 4px; min-width: 0; }
.stocktake-record-head strong { color: #0f172a; overflow-wrap: anywhere; }
.stocktake-record-head span,
.stocktake-record-foot span { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.stocktake-difference-badge {
  flex: none;
  padding: 7px 10px;
  border-radius: 999px;
  font-style: normal;
  font-size: 13px;
  font-weight: 800;
}
.stocktake-difference-badge.surplus { color: #15803d; background: #dcfce7; }
.stocktake-difference-badge.shortage { color: #b91c1c; background: #fee2e2; }
.stocktake-record-main {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.stocktake-record-main > div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 11px 12px;
  border-radius: 12px;
  background: #f8fafc;
}
.stocktake-record-main span { color: var(--muted); font-size: 12px; }
.stocktake-record-main b { color: #1e293b; overflow-wrap: anywhere; }
@media (max-width: 720px) {
  .module-filter-group { width: 100%; align-items: stretch; }
  .module-location-filter { width: 100%; min-width: 0; }
  #stockAdjustModal { align-items: center; }
  .stock-adjust-modal-card { width: min(100% - 20px, 560px); max-height: calc(100vh - 20px); overflow-y: auto; }
  .stock-adjust-modal-card .panel-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .stock-adjust-modal-card .panel-actions button { width: 100%; }
  .stocktake-panel-title,
  .stocktake-record-head,
  .stocktake-record-foot { align-items: stretch; flex-direction: column; }
  .stocktake-panel-title .panel-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .stocktake-panel-title .panel-actions button { width: 100%; }
  .stocktake-filter-grid { grid-template-columns: 1fr; padding: 12px; }
  .stocktake-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stocktake-record-main { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stocktake-record-foot button { width: 100%; }
  .stocktake-difference-badge { justify-self: start; }
}
@media (max-width: 420px) {
  .stocktake-panel-title .panel-actions,
  .stocktake-summary,
  .stocktake-record-main { grid-template-columns: 1fr; }
}
/* 2.6.0 商品分类与经营资料规范版 */
.front-nav-section-title{display:block;padding:12px 18px 6px;color:#94a3b8;font-size:12px;font-weight:800;letter-spacing:.08em}.product-management-panel .panel-title{align-items:flex-start}.product-management-panel .module-filter-group{display:flex;flex-wrap:wrap;gap:10px}.product-management-panel .module-location-filter{min-width:145px}.product-detail-form{grid-template-columns:repeat(4,minmax(0,1fr));align-items:end}.product-detail-form label{display:grid;gap:7px;color:#64748b;font-size:12px;font-weight:700}.product-detail-form label select,.product-detail-form textarea{width:100%}.product-detail-form textarea{grid-column:span 2;min-height:70px;resize:vertical}.product-form-actions{display:flex;gap:10px;align-items:center}.product-form-actions button{flex:1}.product-category-manager{margin:18px 0;padding:16px;border:1px solid #dbe7f3;border-radius:16px;background:#f8fbff}.category-manager-head{display:flex;align-items:center;justify-content:space-between;gap:16px}.category-manager-head>div{display:grid;gap:4px}.category-manager-head span{color:#64748b;font-size:12px}.category-create-row{display:grid;grid-template-columns:minmax(180px,1fr) 120px;gap:10px;margin:14px 0}.category-list{display:grid;gap:8px}.category-row{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:12px;border-radius:12px;background:#fff;border:1px solid #e5edf5}.category-row>div:first-child{display:grid;gap:4px}.category-row small{color:#64748b}.category-row>div:last-child{display:flex;flex-wrap:wrap;gap:6px}.compact-empty{padding:24px}.product-search-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center}.product-batch-bar{position:sticky;top:10px;z-index:5;display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin:12px 0;padding:12px 14px;border:1px solid #93c5fd;border-radius:14px;background:#eff6ff;box-shadow:0 8px 22px rgba(37,99,235,.12)}.product-batch-bar select{min-width:180px}.product-title-with-check{display:flex;align-items:center;min-width:0;gap:10px}.product-select-check{width:18px;height:18px;flex:0 0 auto}.product-tags{display:flex;flex-wrap:wrap;gap:7px;margin:10px 0}.product-tags span{padding:4px 9px;border-radius:999px;background:#eef4fa;color:#31506d;font-size:12px;font-weight:700}.product-metric-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px;margin:12px 0}.product-metric-grid span{display:grid;gap:4px;padding:9px;border-radius:10px;background:#f8fafc;color:#64748b;font-size:11px}.product-metric-grid b{overflow:hidden;color:#172b3f;font-size:13px;text-overflow:ellipsis;white-space:nowrap}@media(max-width:1100px){.product-detail-form{grid-template-columns:repeat(2,minmax(0,1fr))}.product-metric-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-width:680px){.front-nav-section-title{padding-left:12px}.product-detail-form{grid-template-columns:1fr}.product-detail-form textarea{grid-column:auto}.product-search-row{grid-template-columns:1fr}.product-search-row button{width:100%}.product-metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.category-manager-head,.category-row{align-items:stretch;flex-direction:column}.category-create-row{grid-template-columns:1fr}.category-row>div:last-child{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.product-batch-bar{top:4px}.product-batch-bar>*{flex:1 1 140px}}

/* 2.7.1老板/分店树形账号管理 */
.admin-account-tree { display: grid; gap: 6px; }
.admin-tree-owner { position: relative; z-index: 1; }
.admin-tree-branches { display: grid; gap: 6px; margin: 0 0 4px 22px; padding-left: 14px; border-left: 2px solid #dbeafe; }
.admin-tree-branch-wrap { margin-left: 22px; padding: 10px 0 4px 14px; border-left: 2px solid #fecaca; }
.admin-owner-row { border-color: #bfdbfe; background: #f8fbff; }
.admin-branch-row { border-color: #e2e8f0; background: #f8fafc; }
.admin-tree-caret, .admin-tree-line { display: inline-block; width: 22px; color: #2563eb; font-weight: 800; }
.admin-tree-line { color: #94a3b8; }
.admin-role-tag { display: inline-flex; align-items: center; min-height: 23px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.admin-role-tag.owner { color: #1d4ed8; background: #dbeafe; }
.admin-role-tag.branch { color: #475569; background: #e2e8f0; }
.admin-inherited-plan { color: #475569; font-weight: 700; }
.admin-status-pill { display: inline-flex; width: fit-content; padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.admin-status-pill.active { color: #166534; background: #dcfce7; }
.admin-status-pill.disabled { color: #991b1b; background: #fee2e2; }
.orphan-tree { border: 1px solid #fecaca; border-radius: 16px; background: #fff7f7; padding: 6px; }
@media (max-width: 1100px) {
  .admin-tree-branches { margin-left: 0; padding-left: 10px; }
  .admin-tree-branch-wrap { margin-left: 0; padding-left: 10px; }
}
/* 2.7.1 管理后台成熟化：账号树、对账、审计 */
.admin-user-tools { margin: 18px 0 8px; }
.admin-tree-toggle { width: 32px; min-width: 32px; height: 32px; padding: 0; margin-right: 8px; border-radius: 8px; background: #eef4ff; color: #2457a7; vertical-align: middle; }
.admin-status-pill.dormant { background: #fff4d6; color: #8a5a00; }
.admin-status-pill.archived { background: #eef0f3; color: #5b6470; }
.admin-status-pill.exception { background: #ffe8e8; color: #a32222; }
.admin-status-pill.matched { background: #e4f7ec; color: #18784b; }
.admin-status-pill.pending { background: #fff4d6; color: #8a5a00; }
.reconciliation-table .admin-table-row,
.reconciliation-table .admin-table-head,
.audit-table .admin-table-row,
.audit-table .admin-table-head { grid-template-columns: minmax(180px,1.45fr) minmax(105px,.8fr) minmax(125px,.9fr) minmax(160px,1.2fr) minmax(125px,.9fr) minmax(100px,.7fr); }
.reconciliation-table small,.audit-table small { overflow-wrap:anywhere; }
.admin-account-tree { border-bottom: 1px solid #e8edf3; }
.admin-tree-branches { background: #f8fafc; border-left: 3px solid #d8e5f5; }
@media (max-width: 1100px) {
  .admin-shell { grid-template-columns: 210px minmax(0,1fr); }
  .admin-table-head { display:none; }
  .admin-table-row,.reconciliation-table .admin-table-row,.audit-table .admin-table-row { grid-template-columns: repeat(2,minmax(0,1fr)); gap:12px; }
  .admin-row-actions { grid-column: 1 / -1; justify-content:flex-start; flex-wrap:wrap; }
}
@media (max-width: 760px) {
  .admin-shell { display:block; }
  .admin-sidebar { position:static; width:auto; min-height:auto; }
  .admin-nav { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
  .admin-main,.admin-topbar,.admin-users-card,.admin-chart-card { min-width:0; }
  .admin-topbar { align-items:stretch; }
  .admin-top-actions { flex-wrap:wrap; }
  .admin-order-tools { grid-template-columns:1fr; }
  .admin-table-row,.reconciliation-table .admin-table-row,.audit-table .admin-table-row { grid-template-columns:1fr; }
  .admin-row-actions { grid-column:auto; }
}


/* 2.7.1 用户树收放与账号状态选择弹窗 */
.admin-dialog { width:min(520px,calc(100vw - 32px)); padding:0; border:0; border-radius:20px; box-shadow:0 24px 70px rgba(28,45,72,.28); color:#1f2d3d; }
.admin-dialog::backdrop { background:rgba(20,32,50,.45); backdrop-filter:blur(3px); }
.admin-dialog-card { display:grid; gap:18px; padding:24px; margin:0; }
.admin-dialog-title { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; }
.admin-dialog-title h2 { margin:4px 0 0; font-size:20px; }
.admin-dialog-close { width:36px; min-width:36px; height:36px; padding:0; border-radius:10px; background:#f0f4f8; color:#586578; font-size:24px; line-height:1; }
.admin-dialog-card label { display:grid; gap:8px; font-weight:700; }
.admin-dialog-card select,.admin-dialog-card textarea { width:100%; box-sizing:border-box; border:1px solid #d9e2ec; border-radius:12px; background:#fff; color:#1f2d3d; font:inherit; }
.admin-dialog-card select { min-height:46px; padding:0 12px; }
.admin-dialog-card textarea { min-height:92px; padding:12px; resize:vertical; }
.admin-dialog-help { display:grid; gap:5px; padding:13px 14px; border-radius:12px; background:#f3f7fc; color:#5d6a7c; font-size:13px; line-height:1.6; }
.admin-dialog-help b { color:#27364a; }
.admin-dialog-actions { display:flex; justify-content:flex-end; gap:10px; }
.admin-dialog-actions button { min-width:106px; }
.admin-tree-toggle { cursor:pointer; position:relative; z-index:2; }
@media (max-width:600px) { .admin-dialog-card { padding:18px; } .admin-dialog-actions { display:grid; grid-template-columns:1fr 1fr; } }

/* 2.7.1 商用级操作审计列表 */
.admin-audit-tools { grid-template-columns:minmax(260px,1fr) minmax(180px,240px); }
.audit-table .audit-row b,.audit-table .audit-row span,.audit-table .audit-row small { overflow-wrap:anywhere; word-break:break-word; }
.audit-time b { font-size:14px; color:#1f2d3d; }
.audit-time small { color:#77869a; font-variant-numeric:tabular-nums; }
.audit-action-badge { display:inline-flex!important; align-self:flex-start; width:auto; padding:5px 9px; border-radius:999px; background:#eef3f8; color:#46576d; font-size:13px; font-weight:700; line-height:1.2; }
.audit-action-badge.account,.audit-action-badge.security { background:#e8f1ff; color:#245da8; }
.audit-action-badge.membership,.audit-action-badge.quota { background:#eeeaff; color:#5a42a6; }
.audit-action-badge.payment,.audit-action-badge.reconciliation { background:#e5f7ed; color:#18784b; }
.audit-action-badge.refund,.audit-action-badge.warning { background:#fff2dc; color:#9a6200; }
.audit-action-badge.activity { background:#e9f7f7; color:#177477; }
.audit-action-badge.danger { background:#ffe9e9; color:#aa2929; }
.audit-code { color:#9aa6b5!important; font-size:11px!important; font-family:ui-monospace,SFMono-Regular,Consolas,monospace; }
.audit-summary span { color:#26364a; line-height:1.55; }
.audit-actor { font-weight:700; color:#34465d; }

/* 2.7.1 对账弹窗、对账列表与活动表单修复 */
#adminActivityForm textarea[name="body"] { height:112px!important; min-height:112px!important; max-height:112px!important; resize:none!important; overflow-y:auto; box-sizing:border-box; }
.reconciliation-table .reconciliation-head,.reconciliation-table .reconciliation-row { grid-template-columns:minmax(0,1.7fr) minmax(88px,.75fr) minmax(105px,1fr) minmax(120px,1.1fr) minmax(100px,.85fr) minmax(88px,.7fr); column-gap:14px; }
.reconciliation-table .reconciliation-row { align-items:center; min-height:72px; padding:14px 12px; }
.reconciliation-table .reconciliation-row > div { min-width:0; display:flex; flex-direction:column; gap:4px; justify-content:center; }
.reconciliation-order-no { display:block; max-width:100%; color:#172b3f; font-size:13px; line-height:1.35; overflow-wrap:anywhere; word-break:break-all; }
.reconciliation-money { color:#172b3f; font-size:15px; white-space:nowrap; }
.reconciliation-anomaly { color:#b42318!important; font-weight:700; }
.admin-reconciliation-dialog { width:min(650px,calc(100vw - 32px)); }
.reconciliation-dialog-summary { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; padding:14px; border:1px solid #dce6f0; border-radius:14px; background:#f7faff; }
.reconciliation-dialog-summary > div { min-width:0; display:grid; gap:4px; padding:8px 10px; border-radius:10px; background:#fff; }
.reconciliation-dialog-summary span { color:#718096; font-size:12px; }
.reconciliation-dialog-summary b { color:#213149; font-size:14px; overflow-wrap:anywhere; word-break:break-word; }
.reconciliation-dialog-summary .has-anomaly { background:#fff0f0; }
.reconciliation-dialog-summary .has-anomaly b { color:#b42318; }
.reconciliation-dialog-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.admin-reconciliation-dialog input { width:100%; min-height:46px; box-sizing:border-box; padding:0 12px; border:1px solid #d9e2ec; border-radius:12px; background:#fff; color:#1f2d3d; font:inherit; }
@media (max-width:1100px) { .reconciliation-table { overflow-x:auto; } .reconciliation-table .reconciliation-head,.reconciliation-table .reconciliation-row { min-width:840px; grid-template-columns:220px 100px 120px 140px 110px 100px; } }
@media (max-width:760px) { .reconciliation-dialog-summary,.reconciliation-dialog-grid { grid-template-columns:1fr; } .reconciliation-table .reconciliation-head { display:none; } .reconciliation-table .reconciliation-row { min-width:0; grid-template-columns:1fr; gap:12px; } .reconciliation-table .reconciliation-row > div { padding-bottom:9px; border-bottom:1px dashed #e4eaf1; } .reconciliation-table .reconciliation-row > div:last-child { border-bottom:0; padding-bottom:0; } }

/* 2.7.1 活动说明输入区可用性修复 */
#adminActivityForm { display:grid; grid-template-columns:minmax(0,1fr); gap:10px; width:100%; min-width:0; }
#adminActivityForm > input,#adminActivityForm > select,#adminActivityForm > label,#adminActivityForm > button,#adminActivityForm > textarea { width:100%; min-width:0; box-sizing:border-box; }
#adminActivityForm > label { display:grid; gap:6px; }
#adminActivityForm textarea[name="body"] { display:block; width:100%!important; height:156px!important; min-height:156px!important; max-height:156px!important; padding:12px 14px; border:1px solid var(--line); border-radius:12px; background:#fff; color:var(--text); font:inherit; line-height:1.6; resize:none!important; overflow-y:auto; }

/* 2.7.1 操作审计紧凑布局修复 */
#adminAuditPage .admin-users-card { min-width:0; overflow:hidden; }
.admin-audit-tools { display:grid; grid-template-columns:minmax(0,1fr) 210px; gap:10px; width:100%; min-width:0; }
.admin-audit-tools > * { width:100%; min-width:0; }
.audit-table { width:100%; min-width:0; overflow:visible!important; }
.audit-table .audit-head,.audit-table .audit-row { width:100%; min-width:0!important; grid-template-columns:120px minmax(280px,1.45fr) minmax(210px,1fr) 88px!important; column-gap:16px; }
.audit-table .audit-row { min-height:76px; padding:14px 14px; align-items:center; }
.audit-table .audit-row > div { min-width:0; }
.audit-operation { display:grid!important; gap:7px!important; }
.audit-operation-title { display:flex; align-items:center; flex-wrap:wrap; gap:8px; min-width:0; }
.audit-operation-title b { min-width:0; color:#26364a; font-size:14px; line-height:1.45; }
.audit-target b { color:#172b3f; }
.audit-target small,.audit-operation > small { color:#718096; line-height:1.45; }
.audit-operator { align-items:flex-start; }
.admin-topbar { grid-template-columns:minmax(200px,230px) minmax(150px,1fr) auto; gap:12px; }
.admin-top-actions { gap:6px; flex-wrap:nowrap; }
.admin-top-actions button { padding:0 10px; }
@media (max-width:1250px) { .admin-top-actions > span { display:none; } }
@media (max-width:900px) { .audit-table .audit-head { display:none; } .audit-table .audit-row { grid-template-columns:110px minmax(0,1fr)!important; gap:12px 16px; } .audit-target { grid-column:2; } .audit-operator { grid-column:2; flex-direction:row!important; align-items:center!important; gap:8px!important; } }
@media (max-width:680px) { .admin-audit-tools { grid-template-columns:1fr; } .audit-table .audit-row { grid-template-columns:1fr!important; gap:12px; } .audit-target,.audit-operator { grid-column:auto; } .audit-table .audit-row > div { padding-bottom:10px; border-bottom:1px dashed #e4eaf1; } .audit-table .audit-row > div:last-child { padding-bottom:0; border-bottom:0; } }

/* 2.7.1 欠款管理商用级重构 */
.debt-workspace {
  display: grid;
  gap: 20px;
}
.debt-workspace.hidden { display: none; }
.debt-page-header { margin-bottom: 0; }
.debt-page-header > div:first-child { max-width: 660px; }
.debt-page-header h2 { margin-bottom: 6px; }
.debt-page-header span { line-height: 1.6; }
.debt-guide-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid #dbe4f0;
  border-radius: 16px;
  background: #dbe4f0;
}
.debt-guide-strip > div {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  background: #f8fbff;
}
.debt-guide-strip b { color: #14366b; font-size: 14px; }
.debt-guide-strip span { color: #64748b; font-size: 12px; line-height: 1.5; }
.debt-tabs {
  display: inline-flex;
  justify-self: start;
  gap: 4px;
  padding: 4px;
  border: 1px solid #dbe4f0;
  border-radius: 14px;
  background: #f4f7fb;
}
.debt-tab {
  width: auto;
  min-height: 38px;
  padding: 0 20px;
  border: 0;
  border-radius: 10px;
  color: #52627a;
  background: transparent;
  font-size: 14px;
  font-weight: 700;
  box-shadow: none;
}
.debt-tab:hover { color: #1d4ed8; background: #eaf2ff; }
.debt-tab.active { color: #fff; background: #2563eb; box-shadow: 0 7px 18px rgba(37, 99, 235, .2); }
.debt-tab-panel { display: grid; gap: 18px; }
.debt-tab-panel.hidden { display: none; }
.debt-section-heading,
.debt-card-heading,
.debt-record-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.debt-section-heading h3,
.debt-card-heading h3,
.debt-record-heading h3 { margin: 0; color: #0f172a; }
.debt-section-heading span,
.debt-card-heading span,
.debt-record-heading span { display: block; margin-top: 5px; color: #64748b; font-size: 13px; line-height: 1.5; }
.debt-primary-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.debt-primary-actions button { width: auto; min-height: 42px; padding-inline: 18px; }
.debt-primary-actions .primary-btn { color: #fff; background: #2563eb; }
.debt-primary-actions .primary-btn:hover { background: #1d4ed8; }
.debt-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.debt-overview-card {
  position: relative;
  display: grid;
  gap: 7px;
  min-height: 126px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid #dbe4f0;
  border-radius: 16px;
  background: #fff;
}
.debt-overview-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: #2563eb;
}
.debt-overview-card.warning::before { background: #f59e0b; }
.debt-overview-card.prepaid::before { background: #7c3aed; }
.debt-overview-card.count::before { background: #64748b; }
.debt-overview-card span { color: #52627a; font-size: 13px; font-weight: 700; }
.debt-overview-card strong { color: #0f172a; font-size: clamp(22px, 2vw, 29px); line-height: 1.1; letter-spacing: -.02em; }
.debt-overview-card small { color: #7b8798; font-size: 12px; line-height: 1.45; }
.debt-content-grid {
  display: grid;
  grid-template-columns: minmax(280px, .82fr) minmax(440px, 1.55fr);
  gap: 16px;
  align-items: start;
}
.debt-list-card,
.debt-detail-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid #dbe4f0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .04);
}
.debt-list-card { display: grid; gap: 14px; }
.debt-detail-card { display: grid; gap: 16px; }
.debt-list-filters,
.debt-unified-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  gap: 10px;
}
.debt-list-filters input,
.debt-list-filters select,
.debt-unified-filters input,
.debt-unified-filters select {
  min-width: 0;
  min-height: 42px;
}
.debt-list { display: grid; gap: 8px; margin: 0; }
.debt-contact-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e1e8f2;
  border-radius: 14px;
  background: #fff;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.debt-contact-row:hover { border-color: #a9c7fb; background: #f8fbff; }
.debt-contact-row.active { border-color: #2563eb; background: #eff6ff; box-shadow: 0 0 0 2px rgba(37, 99, 235, .08); }
.debt-contact-main {
  display: grid;
  justify-items: start;
  gap: 3px;
  min-width: 0;
  min-height: 0;
  padding: 0;
  color: inherit;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.debt-contact-main:hover { color: inherit; background: transparent; }
.debt-contact-name { max-width: 100%; overflow: hidden; color: #0f172a; font-size: 15px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.debt-contact-balance { color: #334155; font-size: 13px; font-weight: 700; }
.debt-contact-main small { color: #7b8798; font-size: 12px; }
.debt-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  margin: 0;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.debt-status-badge.warning { color: #b45309; background: #fff7df; }
.debt-status-badge.partial { color: #a16207; background: #fef9c3; }
.debt-status-badge.prepaid { color: #6d28d9; background: #ede9fe; }
.debt-status-badge.success { color: #15803d; background: #dcfce7; }
.debt-status-badge.neutral { color: #64748b; background: #eef2f7; }
.debt-selected-heading { align-items: flex-start; padding-bottom: 2px; }
.debt-detail-kicker { display: block; margin-bottom: 5px; color: #2563eb; font-size: 12px; font-weight: 800; letter-spacing: .04em; }
.debt-detail-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.debt-detail-summary > .empty { grid-column: 1 / -1; }
.debt-detail-metric {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 13px;
  border: 1px solid #e2e8f0;
  border-radius: 13px;
  background: #f8fafc;
}
.debt-detail-metric span { color: #64748b; font-size: 12px; }
.debt-detail-metric strong { overflow: hidden; color: #0f172a; font-size: 18px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.debt-detail-metric small { color: #94a3b8; font-size: 11px; }
.debt-detail-actions { padding-bottom: 14px; border-bottom: 1px solid #e8edf4; }
.debt-detail-actions button { min-height: 38px; padding-inline: 14px; }
.debt-record-heading { align-items: flex-end; }
.debt-record-list { display: grid; gap: 9px; min-width: 0; }
.debt-record-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, auto);
  align-items: center;
  gap: 16px;
  padding: 13px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
}
.debt-record-row:hover { border-color: #bfdbfe; background: #fbfdff; }
.debt-record-main { min-width: 0; }
.debt-record-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.debt-record-topline b { overflow: hidden; color: #0f172a; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.debt-record-topline time { color: #64748b; font-size: 12px; white-space: nowrap; }
.debt-record-main p { margin: 5px 0 3px; color: #334155; font-size: 13px; line-height: 1.45; }
.debt-record-main small { display: block; overflow: hidden; color: #7b8798; font-size: 12px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.debt-record-values { display: grid; justify-items: end; gap: 4px; text-align: right; }
.debt-record-values strong { color: #334155; font-size: 12px; font-weight: 700; }
.debt-amount { font-size: 13px; font-weight: 800; white-space: nowrap; }
.debt-amount.charge { color: #b45309; }
.debt-amount.payment { color: #15803d; }
.debt-amount.neutral { color: #64748b; }
.debt-unified-filters { grid-template-columns: minmax(260px, 1fr) 190px; max-width: 700px; }
.debt-unified-summary { color: #64748b; font-size: 13px; }
.debt-unified-record-list { padding: 16px; border: 1px solid #dbe4f0; border-radius: 18px; background: #fff; }
.debt-record-type { display: inline-flex; margin-right: 7px; padding: 2px 7px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.debt-record-type.customer { color: #1d4ed8; background: #dbeafe; }
.debt-record-type.supplier { color: #7c3aed; background: #ede9fe; }
.debt-action-modal-card { width: min(620px, calc(100vw - 32px)); max-height: min(760px, calc(100vh - 32px)); overflow-y: auto; }
.debt-modal-heading { margin-bottom: 6px; }
.debt-modal-description { margin: 0 0 16px; color: #64748b; font-size: 13px; line-height: 1.6; }
.debt-modal-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.debt-modal-form.hidden { display: none; }
.debt-modal-form label { display: grid; gap: 7px; min-width: 0; }
.debt-modal-form label > span { color: #334155; font-size: 13px; font-weight: 700; }
.debt-modal-form input,
.debt-modal-form select,
.debt-modal-form textarea { width: 100%; min-width: 0; }
.debt-modal-form textarea { resize: vertical; min-height: 92px; font: inherit; }
.debt-modal-note,
.debt-form-hint,
.debt-modal-actions { grid-column: 1 / -1; }
.debt-form-hint {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  min-height: 0;
  padding: 12px;
  border-style: solid;
  background: #f8fbff;
}
.debt-form-hint > span { display: grid; gap: 3px; color: #64748b; font-size: 11px; }
.debt-form-hint strong { color: #0f172a; font-size: 14px; }
.debt-modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 4px; }
.debt-modal-actions button { width: auto; min-width: 112px; }

@media (max-width: 1120px) {
  .debt-guide-strip,
  .debt-overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .debt-content-grid { grid-template-columns: 1fr; }
  .debt-detail-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .debt-page-header,
  .debt-section-heading,
  .debt-card-heading,
  .debt-record-heading { align-items: stretch; flex-direction: column; }
  .debt-page-header .module-location-filter { width: 100%; }
  .debt-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  .debt-tab { width: 100%; padding-inline: 8px; }
  .debt-primary-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .debt-primary-actions button { width: 100%; }
  .debt-list-filters,
  .debt-unified-filters { grid-template-columns: 1fr; max-width: none; }
  .debt-record-row { grid-template-columns: 1fr; }
  .debt-record-values { justify-items: start; text-align: left; }
  .debt-modal-form { grid-template-columns: 1fr; }
  .debt-modal-note,
  .debt-form-hint,
  .debt-modal-actions { grid-column: auto; }
  .debt-form-hint { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .debt-guide-strip,
  .debt-overview-grid,
  .debt-detail-summary { grid-template-columns: 1fr; }
  .debt-primary-actions { grid-template-columns: 1fr; }
  .debt-overview-card { min-height: 110px; }
  .debt-contact-row { grid-template-columns: minmax(0, 1fr); }
  .debt-status-badge { justify-self: start; }
  .debt-form-hint { grid-template-columns: 1fr; }
  .debt-modal-actions { flex-direction: column-reverse; }
  .debt-modal-actions button { width: 100%; }
}

/* 2.8.0 门店/仓库资料操作列修复：保证编辑、关停归档、恢复营业等操作完整显示。 */
.location-management-table{overflow:visible!important}
.location-management-header,.location-management-row{grid-template-columns:minmax(150px,1.15fr) 90px minmax(220px,1.8fr) 90px minmax(220px,1.35fr)!important}
.location-management-cell{min-width:0!important}
.location-management-actions{display:flex!important;align-items:center!important;justify-content:flex-end!important;gap:8px!important;flex-wrap:wrap!important;min-width:0!important;overflow:visible!important}
.location-management-actions button,.location-management-actions .location-default-tag{flex:0 0 auto!important;white-space:nowrap!important;max-width:none!important}
@media(max-width:780px){
  .location-management-row{grid-template-columns:minmax(0,1fr) auto!important}
  .location-management-actions{justify-content:flex-start!important;align-items:stretch!important;gap:8px!important;width:100%!important}
  .location-management-actions button{flex:1 1 140px!important;width:auto!important;min-width:120px!important;white-space:nowrap!important}
}
@media (max-width: 980px) {
  .product-import-edit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .product-import-edit-grid {
    grid-template-columns: 1fr;
  }

  .product-import-edit-field.wide {
    grid-column: auto;
  }
}