:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f8fafb;
  --ink: #17201c;
  --muted: #718078;
  --line: #e6ebe8;
  --brand: #1e7a56;
  --brand-dark: #14563d;
  --brand-soft: #e6f4ed;
  --amber: #d98e18;
  --amber-soft: #fff4df;
  --red: #c9504e;
  --red-soft: #fcebea;
  --blue: #3778c5;
  --blue-soft: #eaf2fb;
  --purple: #7657bf;
  --purple-soft: #f0ebfb;
  --shadow-sm: 0 1px 2px rgba(23, 32, 28, 0.04);
  --shadow-md: 0 16px 48px rgba(28, 46, 37, 0.12);
  --radius: 16px;
  --font: "Segoe UI", "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 14px; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }

.auth-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, .9fr) minmax(480px, 1.1fr); background: white; }
.auth-visual { min-height: 100vh; display: flex; flex-direction: column; justify-content: space-between; padding: 44px 52px; color: white; background: radial-gradient(circle at 78% 18%, rgba(116,190,157,.27), transparent 32%), linear-gradient(145deg, #0d3325, #185d43 58%, #1e7a56); position: relative; overflow: hidden; }
.auth-visual::after { content: ""; position: absolute; width: 460px; height: 460px; right: -180px; bottom: -210px; border: 70px solid rgba(255,255,255,.06); border-radius: 50%; }
.auth-brand { display: flex; align-items: center; gap: 13px; position: relative; z-index: 1; }
.auth-brand img { width: 48px; height: 48px; object-fit: cover; border-radius: 13px; background: white; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.auth-brand strong { display: block; font-size: 21px; letter-spacing: .09em; }
.auth-brand small { display: block; margin-top: 3px; opacity: .65; font-size: 8px; letter-spacing: .15em; }
.auth-message { position: relative; z-index: 1; margin-bottom: 8vh; }
.auth-message > span { display: inline-flex; padding: 6px 10px; border: 1px solid rgba(255,255,255,.18); border-radius: 20px; background: rgba(255,255,255,.08); font-size: 10px; letter-spacing: .1em; }
.auth-message h1 { margin: 22px 0 16px; font-size: clamp(31px, 3vw, 48px); line-height: 1.22; letter-spacing: -.04em; }
.auth-message p { margin: 0; color: rgba(255,255,255,.66); font-size: 13px; }
.auth-form-side { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px; background: linear-gradient(145deg, #fff, #f8fbf9); }
.auth-panel { width: min(410px, 100%); }
.auth-panel-head > span { color: var(--brand); font-size: 10px; font-weight: 700; letter-spacing: .12em; }
.auth-panel-head h2 { margin: 10px 0 7px; font-size: 28px; letter-spacing: -.03em; }
.auth-panel-head p { margin: 0 0 26px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.auth-form { display: grid; gap: 16px; }
.auth-form label { display: grid; gap: 7px; }
.auth-form label > span { font-size: 11px; font-weight: 700; }
.auth-form input { width: 100%; height: 46px; padding: 0 13px; border: 1px solid var(--line); border-radius: 10px; outline: none; background: white; }
.auth-form input:focus { border-color: #70ae94; box-shadow: 0 0 0 4px rgba(30,122,86,.08); }
.auth-form input[readonly] { color: #536159; background: #f5f7f6; }
.auth-submit { width: 100%; height: 46px; margin-top: 5px; }
.auth-submit:disabled { cursor: wait; opacity: .7; }
.auth-alert { margin: -10px 0 18px; padding: 11px 12px; border: 1px solid #f4d3d1; border-radius: 9px; color: #91413e; background: var(--red-soft); font-size: 11px; }
.auth-security { display: flex; align-items: flex-start; gap: 10px; margin-top: 20px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: #f9fbfa; }
.auth-security > i { width: 25px; height: 25px; flex: none; display: grid; place-items: center; border-radius: 50%; color: var(--brand); background: var(--brand-soft); font-size: 11px; font-style: normal; font-weight: 700; }
.auth-security p { margin: 0; }
.auth-security strong, .auth-security small { display: block; }
.auth-security strong { font-size: 11px; }
.auth-security small { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.auth-copyright { width: min(410px, 100%); margin-top: 24px; color: #a1aaa5; font-size: 9px; text-align: center; }
.auth-loading { display: grid; justify-items: center; gap: 16px; color: var(--muted); }
.auth-loading i { width: 32px; height: 32px; border: 3px solid var(--brand-soft); border-top-color: var(--brand); border-radius: 50%; animation: auth-spin .8s linear infinite; }
.auth-loading strong { font-size: 12px; }
@keyframes auth-spin { to { transform: rotate(360deg); } }

.app-shell { display: flex; min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 250px; background: #f9fbfa; border-right: 1px solid var(--line); padding: 24px 16px 18px; display: flex; flex-direction: column; z-index: 30; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 10px 26px; }
.brand-logo { width: 40px; height: 40px; object-fit: cover; border-radius: 11px; border: 1px solid var(--line); background: #fff; box-shadow: 0 3px 10px rgba(23, 32, 28, .08); }
.brand strong { display: block; font-size: 19px; letter-spacing: .08em; }
.brand small { display: block; font-size: 7px; letter-spacing: .12em; color: var(--muted); margin-top: 2px; }
.nav { overflow-y: auto; padding-right: 2px; }
.nav-label { font-size: 11px; color: #9aa69f; font-weight: 700; letter-spacing: .12em; margin: 17px 12px 7px; }
.nav-label:first-child { margin-top: 0; }
.nav-item { width: 100%; border: 0; background: transparent; display: flex; align-items: center; gap: 12px; min-height: 43px; padding: 0 12px; border-radius: 10px; cursor: pointer; color: #607067; text-align: left; transition: .18s ease; }
.nav-item:hover { color: var(--ink); background: #f0f4f2; }
.nav-item.active { color: var(--brand-dark); background: var(--brand-soft); font-weight: 600; }
.nav-item svg { width: 18px; height: 18px; stroke-width: 1.8; }
.nav-item span { flex: 1; }
.nav-item em { font-style: normal; font-size: 11px; color: var(--muted); background: #e9eeeb; min-width: 22px; padding: 2px 6px; border-radius: 10px; text-align: center; }
.nav-item em.warning { color: #9b6211; background: var(--amber-soft); }
.sidebar-card { margin-top: auto; border: 1px solid var(--line); background: var(--surface); border-radius: 13px; padding: 12px; display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow-sm); }
.sidebar-card strong, .user-card strong { display: block; font-size: 12px; }
.sidebar-card small, .user-card small { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }
.progress-ring { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--brand) 72%, #e6ece8 0); position: relative; }
.progress-ring.verified { background: var(--brand); }
.progress-ring::after { content: ""; position: absolute; inset: 4px; background: white; border-radius: 50%; }
.progress-ring span { font-size: 9px; font-weight: 700; z-index: 1; }
.user-card { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); margin-top: 14px; padding: 16px 7px 0; }
.user-card > div:nth-child(2) { flex: 1; }
.avatar { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: #d7eadf; color: var(--brand-dark); font-weight: 700; }
.icon-btn { width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { border-color: #cbd5cf; background: var(--surface-2); }
.icon-btn svg { width: 18px; height: 18px; }

.main { margin-left: 250px; width: calc(100% - 250px); min-width: 0; }
.topbar { position: sticky; top: 0; height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 30px; background: rgba(255,255,255,.92); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); z-index: 20; }
.workspace-switcher { display: flex; align-items: center; gap: 10px; }
.workspace-switcher .flag { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 10px; color: #f4d967; background: #244a9a; font-size: 9px; font-weight: 700; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.workspace-switcher small { display: block; font-size: 10px; color: var(--muted); }
.workspace-switcher strong { font-size: 13px; }
.chevron { color: var(--muted); margin-left: 5px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.save-status { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.save-status > i { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.save-status.saving > i { background: var(--amber); animation: status-pulse .8s ease-in-out infinite alternate; }
.save-status.error { color: var(--red); }
.save-status.error > i { background: var(--red); }
@keyframes status-pulse { to { opacity: .35; } }
.search-trigger { width: 265px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); display: flex; align-items: center; gap: 8px; color: #89968f; padding: 0 10px; cursor: pointer; }
.search-trigger svg { width: 16px; }
.search-trigger span:nth-child(2) { flex: 1; text-align: left; }
kbd { border: 1px solid #dce3df; border-radius: 5px; background: white; padding: 2px 5px; font-size: 10px; box-shadow: 0 1px 0 #d9dfdc; }
.notification { position: relative; }
.notification i { position: absolute; right: 8px; top: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--red); border: 1px solid white; }
.primary-btn { height: 38px; border: 0; border-radius: 10px; padding: 0 15px; background: var(--brand); color: white; font-weight: 600; cursor: pointer; box-shadow: 0 4px 12px rgba(30,122,86,.2); }
.primary-btn:hover { background: var(--brand-dark); }
.secondary-btn { height: 38px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 0 14px; cursor: pointer; font-weight: 500; }
.secondary-btn:hover { border-color: #bdcac3; background: var(--surface-2); }
.danger-btn { color: var(--red); }
.mobile-menu { display: none; }

.content { padding: 30px; max-width: 1600px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-head h1 { margin: 0; font-size: 25px; line-height: 1.2; letter-spacing: -.025em; }
.page-head p { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.head-actions { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.period-select { height: 38px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 0 32px 0 12px; color: #596860; outline: none; }
.report-mode { display: inline-flex; height: 38px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.report-mode button { border: 0; border-radius: 7px; padding: 0 11px; color: var(--muted); background: transparent; cursor: pointer; font-size: 11px; white-space: nowrap; }
.report-mode button.active { color: var(--brand-dark); background: white; box-shadow: 0 1px 4px rgba(27,61,46,.1); font-weight: 600; }
.dashboard-site-select { min-width: 160px; }
.dashboard-currency-select { min-width: 120px; }
.dashboard-fx-notice { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: -5px 0 14px; padding: 10px 14px; border: 1px solid #cfe5da; border-radius: 10px; background: #f2faf6; color: var(--brand-dark); }
.dashboard-fx-notice > div { min-width: 0; }
.dashboard-fx-notice strong { display: block; font-size: 11px; }
.dashboard-fx-notice small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.dashboard-fx-notice.loading { justify-content: flex-start; color: var(--muted); }
.dashboard-fx-notice.loading > span { width: 13px; height: 13px; border: 2px solid #cfe5da; border-top-color: var(--brand); border-radius: 50%; animation: fx-spin .7s linear infinite; }
.dashboard-fx-notice.error { border-color: #efd5d2; background: #fff7f6; color: var(--red); }
@keyframes fx-spin { to { transform: rotate(360deg); } }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.card { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.kpi-card { padding: 19px 20px 18px; position: relative; overflow: hidden; }
.kpi-top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; }
.kpi-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }
.kpi-icon svg { width: 17px; }
.kpi-icon.green { background: var(--brand-soft); color: var(--brand); }
.kpi-icon.blue { background: var(--blue-soft); color: var(--blue); }
.kpi-icon.amber { background: var(--amber-soft); color: var(--amber); }
.kpi-icon.purple { background: var(--purple-soft); color: var(--purple); }
.kpi-value { margin-top: 11px; font-size: 25px; font-weight: 700; letter-spacing: -.025em; }
.kpi-meta { display: flex; align-items: center; gap: 7px; margin-top: 7px; color: var(--muted); font-size: 11px; }
.trend { font-weight: 600; padding: 2px 6px; border-radius: 6px; }
.trend.up { color: var(--brand); background: var(--brand-soft); }
.trend.down { color: var(--red); background: var(--red-soft); }
.trend.neutral { color: #65736c; background: #edf1ef; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .85fr); gap: 14px; margin-bottom: 14px; }
.card-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px 0; }
.card-head h2 { font-size: 15px; margin: 0; }
.card-head p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.text-btn { border: 0; background: none; color: var(--brand); cursor: pointer; font-weight: 600; font-size: 12px; padding: 6px; }
.legend { display: flex; gap: 14px; color: var(--muted); font-size: 10px; }
.legend span::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); margin-right: 5px; }
.legend span:last-child::before { background: #b9ddd0; }
.chart-wrap { position: relative; padding: 14px 18px 12px; height: 260px; touch-action: pan-y; }
.line-chart { width: 100%; height: 100%; overflow: visible; }
.chart-label { fill: #89968f; font-size: 10px; font-family: var(--font); }
.chart-hover-zone { cursor: crosshair; outline: none; pointer-events: all; }
.chart-hover-zone:focus { outline: none; }
.chart-wrap::before { content: ""; position: absolute; z-index: 2; left: var(--chart-guide-x, -20px); top: 28px; bottom: 31px; width: 1px; border-left: 1px dashed rgba(30,122,86,.5); opacity: 0; pointer-events: none; }
.chart-wrap::after { content: ""; position: absolute; z-index: 3; left: calc(var(--chart-guide-x, -20px) - 5px); top: calc(var(--chart-point-y, -20px) - 5px); width: 10px; height: 10px; border: 2px solid var(--brand); border-radius: 50%; background: white; box-shadow: 0 0 0 4px rgba(30,122,86,.12); opacity: 0; pointer-events: none; }
.chart-wrap.chart-hovering::before, .chart-wrap.chart-hovering::after { opacity: 1; }
.chart-tooltip { position: absolute; z-index: 6; width: 188px; padding: 11px 12px; border: 1px solid rgba(21,79,57,.15); border-radius: 11px; color: white; background: rgba(20,56,43,.96); box-shadow: 0 10px 28px rgba(18,51,39,.22); opacity: 0; visibility: hidden; transform: translate(-50%, calc(-100% - 12px)); pointer-events: none; transition: opacity .12s ease; }
.chart-tooltip.visible { opacity: 1; visibility: visible; }
.chart-tooltip::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 10px; height: 10px; background: rgba(20,56,43,.96); transform: translateX(-50%) rotate(45deg); }
.chart-tooltip strong { display: block; margin-bottom: 7px; font-size: 12px; }
.chart-tooltip div { display: flex; justify-content: space-between; gap: 10px; padding-top: 4px; font-size: 10px; }
.chart-tooltip span { color: rgba(255,255,255,.68); }
.chart-tooltip b { font-weight: 600; }
.channel-list { padding: 14px 20px 20px; }
.channel-row { display: grid; grid-template-columns: 32px 1fr auto; gap: 11px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.channel-row:last-child { border-bottom: 0; }
.channel-logo { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; font-weight: 700; font-size: 11px; }
.channel-row strong { display: block; font-size: 12px; }
.channel-row small { display: block; color: var(--muted); font-size: 10px; margin-top: 2px; }
.channel-value { text-align: right; }
.channel-value strong { font-size: 13px; }

.lower-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); gap: 14px; }
.table-wrap { max-width: 100%; overflow-x: auto; padding: 6px 0 8px; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.pagination > div { display: flex; gap: 8px; }
.pagination .secondary-btn { min-height: 34px; padding: 7px 12px; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th { color: #8a9790; font-size: 10px; font-weight: 600; letter-spacing: .03em; text-align: left; padding: 11px 20px; background: #fafcfb; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
td { padding: 13px 20px; border-bottom: 1px solid var(--line); font-size: 12px; }
tbody tr { transition: .15s; }
tbody tr:hover { background: #fafcfb; }
tbody tr:last-child td { border-bottom: 0; }
.order-id { color: var(--brand); font-weight: 600; cursor: pointer; }
.customer-cell { display: flex; align-items: center; gap: 9px; }
.mini-avatar { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 8px; font-size: 10px; font-weight: 700; color: #355347; background: #e5efea; }
.customer-cell strong { display: block; font-size: 12px; }
.customer-cell small { display: block; color: var(--muted); font-size: 10px; }
.status { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 20px; font-size: 10px; font-weight: 600; }
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status.shipped, .status.completed, .status.in-stock, .status.paid { color: var(--brand); background: var(--brand-soft); }
.status.processing, .status.low, .status.pending { color: #b47111; background: var(--amber-soft); }
.status.in-transit { color: var(--blue); background: var(--blue-soft); }
.status.cancelled, .status.out { color: var(--red); background: var(--red-soft); }
.status.draft { color: #6a778a; background: #edf0f4; }
.activity-list { padding: 10px 20px 16px; }
.activity-item { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 10px 0; position: relative; }
.activity-item:not(:last-child)::after { content: ""; position: absolute; left: 14px; top: 40px; height: calc(100% - 22px); width: 1px; background: var(--line); }
.activity-dot { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); z-index: 1; }
.activity-dot svg { width: 14px; }
.activity-item p { margin: 0; font-size: 11px; line-height: 1.5; }
.activity-item time { color: var(--muted); font-size: 9px; }

.toolbar { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.toolbar-search { position: relative; flex: 1; max-width: 360px; }
.toolbar-search svg { position: absolute; left: 12px; top: 11px; width: 16px; color: var(--muted); }
.toolbar-search input { width: 100%; height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px 0 38px; background: var(--surface); outline: none; }
.toolbar-search input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: #83b9a4; box-shadow: 0 0 0 3px rgba(30,122,86,.08); }
.filter-btn { height: 40px; border: 1px solid var(--line); border-radius: 10px; background: white; padding: 0 13px; cursor: pointer; display: flex; align-items: center; gap: 7px; }
.filter-btn svg { width: 15px; }
.order-site-filter { min-width: 168px; }
.order-period-filter { min-width: 150px; }
.order-date-range { min-height: 40px; display: flex; align-items: center; gap: 7px; padding: 4px 9px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--muted); font-size: 10px; }
.order-date-range label { display: flex; align-items: center; gap: 5px; }
.order-date-range input { width: 124px; border: 0; outline: none; background: transparent; color: var(--text); font: inherit; font-size: 10px; }
.inventory-sort-select { min-width: 172px; }
.data-card { overflow: hidden; }
.data-card .table-wrap { padding: 0; }
.data-card th { padding-top: 12px; padding-bottom: 12px; }
.sort-header { display: inline-flex; align-items: center; gap: 6px; margin: -6px; padding: 6px; border: 0; border-radius: 6px; color: inherit; background: transparent; font: inherit; letter-spacing: inherit; cursor: pointer; }
.sort-header:hover { color: var(--brand); background: var(--brand-soft); }
.sort-header.active { color: var(--brand); font-weight: 700; }
.sort-header i { min-width: 10px; font-size: 12px; font-style: normal; line-height: 1; }
.rank-badge { display: inline-grid; min-width: 30px; height: 25px; place-items: center; padding: 0 7px; border-radius: 8px; color: var(--muted); background: #f1f4f2; font-size: 10px; font-weight: 700; }
.rank-badge.top { color: var(--brand); background: var(--brand-soft); }
.table-product { display: flex; align-items: center; gap: 10px; }
.product-thumb { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; background: linear-gradient(135deg, #f3f7f5, #e5eee9); border: 1px solid #e5ebe8; }
.table-product strong { display: block; font-size: 12px; }
.table-product small { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }
.stock-cell { min-width: 120px; }
.stock-number { display: flex; justify-content: space-between; font-size: 11px; margin-bottom: 6px; }
.stock-number span { color: var(--muted); }
.stock-bar { width: 100%; height: 5px; border-radius: 4px; background: #edf1ef; overflow: hidden; }
.stock-bar i { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.stock-bar i.low { background: var(--amber); }
.stock-bar i.out { background: var(--red); }
.row-actions { border: 0; background: transparent; cursor: pointer; color: var(--muted); font-size: 18px; padding: 4px 8px; }
.listing-url { display: inline-block; max-width: 110px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; color: var(--brand); font-size: 11px; font-weight: 600; text-decoration: none; }
.listing-url:hover { text-decoration: underline; }
.summary-strip { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); background: #fbfcfc; }
.summary-item { padding: 16px 20px; border-right: 1px solid var(--line); }
.summary-item:last-child { border-right: 0; }
.summary-item small { display: block; color: var(--muted); font-size: 10px; }
.summary-item strong { display: block; font-size: 19px; margin-top: 4px; }
.summary-item span { font-size: 10px; margin-left: 5px; color: var(--muted); font-weight: 400; }
.empty-state { padding: 60px 20px; text-align: center; color: var(--muted); }
.empty-state strong { color: var(--ink); display: block; margin-bottom: 5px; }

.finance-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 14px; }
.finance-card { padding: 20px; }
.finance-card small { color: var(--muted); }
.finance-card .amount { font-size: 25px; font-weight: 700; margin: 8px 0; }
.finance-card p { margin: 0; color: var(--muted); font-size: 11px; }
.finance-layout { display: grid; grid-template-columns: 1.2fr .8fr; gap: 14px; }
.donut-layout { display: flex; align-items: center; justify-content: center; gap: 30px; padding: 25px; }
.donut { width: 150px; height: 150px; border-radius: 50%; background: conic-gradient(var(--brand) 0 46%, var(--blue) 46% 72%, var(--amber) 72% 89%, #d8dfdb 89%); position: relative; }
.donut::after { content: ""; position: absolute; inset: 24px; background: white; border-radius: 50%; }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; z-index: 1; }
.donut-center strong { font-size: 18px; }
.donut-center small { font-size: 9px; color: var(--muted); }
.donut-legend { display: grid; gap: 11px; }
.donut-legend div { display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 8px; font-size: 11px; }
.donut-legend i { width: 8px; height: 8px; border-radius: 50%; }
.daily-profit-wrap { padding: 18px 20px 20px; }
.daily-profit-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.daily-profit-grid > div { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.daily-profit-grid small, .daily-profit-total small { display: block; color: var(--muted); font-size: 9px; }
.daily-profit-grid strong { display: block; margin-top: 5px; font-size: 13px; }
.daily-profit-grid strong.positive { color: var(--brand); }
.daily-profit-grid strong.negative { color: var(--red); }
.daily-profit-total { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.daily-profit-total > div { position: relative; padding: 4px 2px; }
.daily-profit-total strong { display: block; margin-top: 5px; font-size: 21px; }
.daily-profit-total span { position: absolute; right: 0; bottom: 4px; color: var(--muted); font-size: 11px; }
.daily-dimension-card { margin-top: 14px; }

.ad-summary { margin-bottom: 14px; overflow: hidden; }
.ad-guide { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-bottom: 14px; overflow: hidden; }
.ad-guide > div { display: grid; grid-template-columns: 30px 1fr; column-gap: 10px; padding: 18px 20px; border-right: 1px solid var(--line); }
.ad-guide > div:last-child { border-right: 0; }
.ad-guide span { grid-row: 1 / 3; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; color: var(--brand); background: var(--brand-soft); font-size: 11px; font-weight: 700; }
.ad-guide strong { font-size: 12px; }
.ad-guide small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.ad-section { margin-bottom: 14px; }
.period-select.compact { height: 34px; }
.danger-text, .text-danger { color: var(--red) !important; }

.settings-grid { display: grid; grid-template-columns: 220px 1fr; min-height: 500px; overflow: hidden; }
.settings-nav { padding: 15px; background: #fafcfb; border-right: 1px solid var(--line); }
.settings-nav button { width: 100%; border: 0; background: transparent; padding: 11px 12px; text-align: left; border-radius: 8px; color: var(--muted); cursor: pointer; }
.settings-nav button.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.settings-panel { padding: 26px 30px; max-width: 760px; }
.settings-panel h2 { margin: 0 0 5px; font-size: 17px; }
.settings-panel > p { color: var(--muted); margin: 0 0 24px; font-size: 12px; }
.setting-row { display: grid; grid-template-columns: 180px 1fr; gap: 24px; margin-bottom: 18px; align-items: start; }
.setting-row label { font-size: 12px; font-weight: 600; padding-top: 10px; }
.setting-row small { color: var(--muted); display: block; font-weight: 400; margin-top: 3px; }
.settings-divider { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
.security-note { display: flex; align-items: flex-start; gap: 11px; max-width: 560px; margin: 8px 0 0 204px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); }
.security-note > i { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 50%; color: var(--brand); background: var(--brand-soft); font-style: normal; font-weight: 700; }
.security-note strong, .security-note small { display: block; }
.security-note strong { font-size: 11px; }
.security-note small { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.security-stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 22px; }
.security-stat-grid > div { padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); }
.security-stat-grid small, .security-stat-grid strong, .security-stat-grid span { display: block; }
.security-stat-grid small { color: var(--muted); font-size: 9px; }
.security-stat-grid strong { margin-top: 6px; font-size: 16px; }
.security-stat-grid span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.data-actions { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.data-actions { display: grid; grid-template-columns: 1fr auto; align-items: center; }
.data-actions > div, .data-actions > button { margin: 12px 14px; }
.data-actions > div { min-width: 0; }
.data-actions > div:not(:first-child), .data-actions > div:not(:first-child) + button { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 0; }
.data-actions strong, .data-actions small { display: block; }
.data-actions strong { font-size: 11px; }
.data-actions small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.data-actions button { min-width: 96px; }
.integration-list { margin-top: 18px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.integration-row { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 10px; padding: 12px 14px; }
.integration-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: #fff0cf; color: #9c6500; font-weight: 800; font-size: 12px; }
.integration-row strong, .integration-row small { display: block; }
.integration-row strong { font-size: 11px; }
.integration-row small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.integration-row em { border-radius: 999px; padding: 4px 8px; color: var(--brand-dark); background: var(--brand-soft); font-style: normal; font-size: 9px; }
.integration-loading { padding: 22px 14px; color: var(--muted); font-size: 10px; text-align: center; }
.backup-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; margin: 27px 0 10px; }
.backup-head h3 { margin: 0; font-size: 14px; }
.backup-head p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.backup-list { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.backup-row { display: grid; grid-template-columns: 31px 1fr auto; align-items: center; gap: 10px; padding: 11px 13px; border-bottom: 1px solid var(--line); }
.backup-row:last-child { border-bottom: 0; }
.backup-icon { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; color: var(--brand); background: var(--brand-soft); font-size: 9px; font-weight: 800; }
.backup-row strong, .backup-row small { display: block; }
.backup-row strong { font-size: 10px; }
.backup-row small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.backup-row em { color: var(--muted); font-size: 9px; font-style: normal; }
.backup-loading { padding: 24px; color: var(--muted); font-size: 10px; text-align: center; }
.backup-loading.error { color: var(--red); }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(14,27,21,.45); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 20px; }
.modal-backdrop[hidden] { display: none; }
.modal { width: min(620px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; background: white; border-radius: 18px; box-shadow: var(--shadow-md); animation: modal-in .18s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.985); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 17px; margin: 0; }
.modal-head p { color: var(--muted); font-size: 11px; margin: 3px 0 0; }
.close-btn { border: 0; background: var(--surface-2); width: 32px; height: 32px; border-radius: 9px; cursor: pointer; font-size: 18px; }
.modal-body { padding: 22px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 7px; }
.field-label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.field-label-row .text-btn { padding: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 11px; font-weight: 600; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 9px; min-height: 40px; padding: 9px 11px; outline: none; background: white; }
.field textarea { min-height: 76px; resize: vertical; }
.field-hint { color: var(--muted); font-size: 10px; }
.market-pricing { grid-column: 1 / -1; border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px; padding: 14px; }
.market-pricing-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 12px; }
.market-pricing-head strong { display: block; font-size: 12px; }
.market-pricing-head small { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }
.market-pricing-head em { flex: none; font-style: normal; color: var(--brand); background: var(--brand-soft); border-radius: 7px; padding: 4px 7px; font-size: 9px; font-weight: 600; }
.market-price-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.market-price-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; background: white; border: 1px solid var(--line); border-radius: 9px; padding: 7px 8px; }
.market-price-item > span { display: flex; align-items: center; gap: 6px; font-size: 10px; white-space: nowrap; }
.market-price-item b { font-size: 14px; font-weight: 400; }
.market-price-item > div { position: relative; width: 92px; }
.market-price-item i { position: absolute; left: 8px; top: 7px; color: var(--muted); font-size: 10px; font-style: normal; }
.market-price-item input { width: 100%; height: 30px; min-height: 30px; border: 1px solid var(--line); border-radius: 7px; padding: 4px 6px 4px 19px; text-align: right; outline: none; }
.market-price-item input:focus { border-color: #83b9a4; }
.modal-footer { display: flex; justify-content: flex-end; gap: 9px; padding: 16px 22px; border-top: 1px solid var(--line); background: #fbfcfc; }
.order-preview { background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; padding: 13px; display: flex; justify-content: space-between; align-items: center; }
.order-preview small { display: block; color: var(--muted); font-size: 10px; }
.order-preview strong { display: block; font-size: 16px; margin-top: 3px; }
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.detail-box { padding: 12px; background: var(--surface-2); border-radius: 10px; }
.detail-box small { display: block; color: var(--muted); font-size: 9px; }
.detail-box strong { display: block; margin-top: 5px; font-size: 12px; }
.modal .security-note { max-width: none; margin: 0; }
#profit-result { margin-bottom: 0; }

.toast-region { position: fixed; right: 24px; bottom: 24px; display: grid; gap: 9px; z-index: 150; }
.toast { width: 320px; background: #173d2e; color: white; border-radius: 12px; padding: 13px 15px; box-shadow: var(--shadow-md); display: flex; align-items: center; gap: 10px; animation: toast-in .25s ease-out; }
.toast.error { background: #743936; }
.toast-icon { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.15); font-size: 12px; }
.toast strong { display: block; font-size: 12px; }
.toast small { display: block; opacity: .72; margin-top: 2px; font-size: 10px; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid, .lower-grid, .finance-layout { grid-template-columns: 1fr; }
  .ad-guide { grid-template-columns: 1fr; }
  .ad-guide > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .ad-guide > div:last-child { border-bottom: 0; }
  .search-trigger { width: 200px; }
  .toolbar { align-items: stretch; flex-wrap: wrap; }
  .toolbar-search { flex: 1 1 280px; max-width: none; }
}

@media (max-width: 760px) {
  html, body { overflow-x: hidden; }
  .auth-screen { grid-template-columns: 1fr; min-height: 100svh; background: linear-gradient(160deg, #f4faf7, white 45%); }
  .auth-visual { min-height: auto; padding: 26px 22px 38px; background: linear-gradient(145deg, #0f3d2d, #1e7a56); border-radius: 0 0 26px 26px; }
  .auth-brand img { width: 42px; height: 42px; }
  .auth-brand strong { font-size: 18px; }
  .auth-message { margin: 52px 0 0; }
  .auth-message > span, .auth-message p { display: none; }
  .auth-message h1 { margin: 0; font-size: 26px; line-height: 1.3; }
  .auth-form-side { justify-content: flex-start; padding: 34px 22px 28px; background: transparent; }
  .auth-panel-head h2 { font-size: 24px; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-md); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; width: 100%; }
  .mobile-menu { display: grid; }
  .topbar { padding: 0 16px; }
  .workspace-switcher { display: none; }
  .search-trigger { width: 38px; padding: 0; display: grid; place-items: center; }
  .search-trigger span:nth-child(2), .search-trigger kbd { display: none; }
  .save-status { display: none; }
  .content { padding: 20px 16px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .head-actions { width: 100%; }
  .head-actions .period-select { flex: 1; min-width: 145px; }
  .dashboard-fx-notice { align-items: flex-start; flex-direction: column; }
  .kpi-grid, .finance-grid { grid-template-columns: 1fr; }
  .summary-strip { grid-template-columns: 1fr 1fr; }
  .summary-item:nth-child(2) { border-right: 0; }
  .summary-item:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-nav { display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .settings-nav button { white-space: nowrap; }
  .setting-row { grid-template-columns: 1fr; gap: 7px; }
  .setting-row label { padding-top: 0; }
  .security-note { margin-left: 0; }
  .security-stat-grid { grid-template-columns: 1fr; }
  .data-actions { grid-template-columns: 1fr; }
  .data-actions > div { margin-bottom: 4px; }
  .data-actions > button { width: calc(100% - 28px); margin-top: 0; }
  .data-actions > div:not(:first-child), .data-actions > div:not(:first-child) + button { border-top: 0; padding-top: 0; }
  .data-actions > div:not(:first-child) { border-top: 1px solid var(--line); padding-top: 13px; }
  .integration-row { grid-template-columns: 32px 1fr; }
  .integration-row em { grid-column: 2; justify-self: start; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .market-price-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .daily-profit-grid { grid-template-columns: 1fr 1fr; }
  .daily-profit-total { grid-template-columns: 1fr; }
  .pagination { align-items: stretch; flex-direction: column; }
  .pagination > div, .pagination .secondary-btn { width: 100%; }
  .toolbar > .filter-btn { flex: 1 1 145px; min-width: 0; }
  .order-date-range { flex: 1 1 100%; justify-content: space-between; }
  .order-date-range label { flex: 1; }
  .order-date-range input { width: 100%; }
  .donut-layout { flex-direction: column; }
}

.auth-link { display:block; margin:16px 0 0 auto; padding:4px 0; border:0; background:transparent; color:var(--brand); cursor:pointer; font-size:13px; }
.sms-fields { display:grid; gap:16px; min-width:0; border:0; padding:0; margin:0; }
.sms-code-row { display:flex; gap:10px; }
.sms-code-row input { min-width:0; flex:1; }
.sms-code-row button { flex:none; white-space:nowrap; }
.sms-fields:disabled { opacity:.6; }
