:root {
    color-scheme: light;
    --bg: #f4f6f8;
    --panel: #ffffff;
    --panel-soft: #f8fafc;
    --line: #dfe5ec;
    --text: #1d2530;
    --muted: #687386;
    --accent: #18794e;
    --accent-2: #9fcf8a;
    --danger: #b42318;
    --warning: #946200;
    --sidebar: #111820;
    --sidebar-soft: #1b2632;
    --shadow: 0 12px 32px rgba(19, 31, 44, .08);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 252px;
    overflow-y: auto;
    background:
        radial-gradient(circle at 20% 4%, rgba(159,207,138,.20), transparent 180px),
        var(--sidebar);
    color: #fff;
    padding: 20px 14px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 8px 20px;
}

.brand strong { display:block; font-size: 17px; letter-spacing: 0; }
.brand small { display:block; color:#93a2b3; margin-top:2px; }

.brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #35a873, #dff5d8);
    box-shadow: 0 10px 28px rgba(0,0,0,.22);
}

.brand-logo img,
.nav-icon,
.metric-icon,
.todo-icon {
    width: 20px;
    height: 20px;
    display: inline-block;
    object-fit: contain;
}

.brand-logo img {
    width: 24px;
    height: 24px;
}

.nav-icon {
    flex: none;
    margin-right: 9px;
    filter: invert(1);
    opacity: .86;
}

.sidebar a.active .nav-icon,
.sidebar a:hover .nav-icon {
    opacity: 1;
}

.nav-group { margin: 12px 0 18px; }
.nav-title {
    padding: 0 10px 7px;
    color: #7f8fa3;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
}

.sidebar a {
    display: flex;
    align-items: center;
    min-height: 38px;
    padding: 9px 11px;
    margin: 2px 0;
    border-radius: 10px;
    color: #dce5ef;
    font-weight: 650;
}

.sidebar a.active,
.sidebar a:hover {
    background: rgba(255,255,255,.10);
    color: #fff;
    text-decoration: none;
}

.sidebar a.active {
    box-shadow: inset 3px 0 0 #7bd17b;
}

.main {
    min-height: 100vh;
    margin-left: 252px;
    padding: 24px 28px 36px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.breadcrumb {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 4px;
}

h1 { font-size: 24px; line-height:1.25; margin: 0; letter-spacing: 0; }
h2 { font-size: 17px; margin: 0 0 14px; }
h3 { font-size: 15px; margin: 0 0 10px; }

.userbar {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    white-space: nowrap;
}

.env-pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: #fff6d8;
    color: #7a5300;
    font-size: 12px;
    font-weight: 800;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
}

.metric,
.panel,
.toolbar {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.metric {
    position: relative;
    overflow: hidden;
    padding: 18px;
}

.metric-icon {
    float: right;
    opacity: .62;
}

.metric:after {
    content: "";
    position: absolute;
    right: -18px;
    bottom: -28px;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: rgba(24,121,78,.08);
}

.metric span { color: var(--muted); font-weight: 650; }
.metric strong { display: block; margin-top: 8px; font-size: 30px; line-height:1.1; letter-spacing: 0; }

.panel {
    margin-top: 16px;
    padding: 18px;
    overflow: auto;
}

.toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 14px;
    margin-bottom: 14px;
    position: relative;
}

.toolbar:before {
    content: "";
    position: absolute;
    left: 14px;
    top: 0;
    right: 14px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), rgba(24,121,78,0));
}

.actions,
.row-actions,
.form-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

input,
select,
textarea,
button,
.button {
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 8px 11px;
    background: #fff;
    color: var(--text);
    font: inherit;
}

textarea { resize: vertical; }

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 750;
    cursor: pointer;
    text-decoration: none;
}

button:hover,
.button:hover { filter: brightness(.96); text-decoration:none; }

.secondary,
.button.secondary {
    background: #eef2f6;
    border-color: var(--line);
    color: var(--text);
}

.link-button {
    min-height: auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent);
    font-weight: 750;
}

.notice {
    margin-top: 12px;
    border: 1px solid #f0c36d;
    background: #fff8e6;
    border-radius: 12px;
    padding: 12px 14px;
    color: #6d4c00;
}

.ux-summary {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 14px;
    padding: 13px 15px;
    border: 1px solid #cfe8d5;
    background: #f2faf3;
    border-radius: 12px;
    color: #275b3d;
}

.ux-summary strong { color: #174f35; white-space: nowrap; }

.empty-state {
    display: grid;
    gap: 5px;
    place-items: center;
    color: var(--muted);
    padding: 38px 0;
}

.empty-state strong { color: var(--text); font-size: 16px; }

.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 2px 10px;
    border-radius: 999px;
    background: #eef2f6;
    color: #3b4656;
    font-weight: 800;
}

.status-paid,
.status-completed,
.status-refunded,
.status-refund_success,
.status-resolved,
.status-enabled {
    background: #e7f6ec;
    color: #18794e;
}

.status-pending_ship,
.status-pending,
.status-open,
.status-wait_return,
.status-refund_pending,
.status-pending_pay,
.status-pending_review {
    background: #fff7df;
    color: var(--warning);
}

.status-canceled,
.status-closed,
.status-rejected,
.status-refund_failed,
.status-exception,
.status-disabled {
    background: #fff0f0;
    color: var(--danger);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 13px 11px;
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f6faf7;
    color: #526070;
    font-size: 12px;
    font-weight: 850;
}

tr:hover td { background: #fbfcfd; }

.money-cell {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
}

.action-cluster {
    min-width: 180px;
}

.action-cluster > a,
.action-cluster > form,
.action-cluster > button {
    margin: 2px 4px 2px 0;
}

.detail-table {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
}

.detail-table th {
    width: 220px;
    color: var(--muted);
    background: #f6faf7;
}

.edit-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    padding: 4px 0;
}

.edit-form label {
    display: grid;
    gap: 7px;
    color: #2d3745;
    font-weight: 750;
}

.edit-form input,
.edit-form select,
.edit-form textarea { width: 100%; }

.form-actions { grid-column: 1 / -1; padding-top: 6px; }

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 36px;
    background:
        radial-gradient(circle at 12% 16%, rgba(159,207,138,.28), transparent 320px),
        radial-gradient(circle at 86% 12%, rgba(216,167,63,.20), transparent 280px),
        linear-gradient(135deg, #071018, #111820 48%, #1c2b38);
}

.login-stage {
    width: min(1080px, 100%);
    min-height: 620px;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(400px, .95fr);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 30px;
    background:
        linear-gradient(120deg, rgba(255,255,255,.08), rgba(255,255,255,.03)),
        rgba(255,255,255,.04);
    box-shadow: 0 36px 120px rgba(0,0,0,.38);
    backdrop-filter: blur(8px);
}

.login-vision {
    position: relative;
    padding: 56px;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background:
        linear-gradient(135deg, rgba(10,22,31,.68), rgba(10,22,31,.30)),
        radial-gradient(circle at 72% 28%, rgba(123,209,123,.20), transparent 260px);
}

.login-vision:after {
    content: "";
    position: absolute;
    right: -92px;
    bottom: -108px;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    border: 64px solid rgba(255,255,255,.06);
}

.login-brand-mark {
    width: 76px;
    height: 76px;
    border-radius: 22px;
    display: grid;
    place-items: center;
    margin-bottom: 34px;
    background: linear-gradient(135deg, #35a873, #dff5d8);
    color: #071018;
    font-size: 42px;
    font-weight: 950;
    box-shadow: 0 20px 54px rgba(53,168,115,.28);
}

.login-kicker {
    color: #9fcf8a;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .16em;
}

.login-kicker.dark {
    color: var(--accent);
}

.login-vision h1 {
    max-width: 640px;
    margin: 14px 0 18px;
    font-size: clamp(34px, 4.2vw, 54px);
    line-height: 1.08;
    letter-spacing: 0;
}

.login-vision p {
    max-width: 620px;
    margin: 0;
    color: #c9d5df;
    font-size: 17px;
    line-height: 1.9;
}

.login-points {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 56px;
    max-width: 680px;
}

.login-points div {
    min-height: 104px;
    padding: 18px;
    border-radius: 18px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.10);
}

.login-points strong {
    display: block;
    margin-bottom: 8px;
    font-size: 22px;
    color: #fff;
}

.login-points span {
    color: #b8c6d3;
    font-size: 13px;
}

.login-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 44px;
    background: rgba(246,248,250,.96);
}

.login-box {
    width: min(430px, 100%);
    background: #ffffff;
    border: 1px solid rgba(223,229,236,.92);
    border-radius: 24px;
    padding: 34px;
    box-shadow: 0 28px 80px rgba(19,31,44,.16);
}

.wechat-login-panel {
    width: min(430px, 100%);
    background: rgba(255,255,255,.72);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px 14px;
    color: var(--muted);
}

.wechat-login-panel summary {
    cursor: pointer;
    color: var(--accent);
    font-weight: 850;
}

.wechat-inline-form {
    display: grid;
    gap: 10px;
    padding-top: 12px;
}

.wechat-inline-form p {
    margin: 0;
    font-size: 12px;
}

.wechat-inline-form label {
    display: grid;
    gap: 6px;
    font-weight: 800;
    color: #2d3745;
}

.wechat-inline-form input,
.wechat-inline-form button {
    width: 100%;
}

.login-box-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 8px;
}

.login-box h2 {
    margin: 8px 0 0;
    font-size: 30px;
    line-height: 1.15;
}

.login-secure {
    flex: none;
    padding: 7px 10px;
    border-radius: 999px;
    background: #eef9f2;
    color: var(--accent);
    font-size: 12px;
    font-weight: 900;
}

.login-subtitle {
    margin: 0 0 24px;
    color: var(--muted);
}

.login-box label { display:grid; gap:8px; margin-bottom:16px; font-weight:800; color:#2d3745; }
.login-box input,
.login-box button { width: 100%; }
.login-box input {
    min-height: 48px;
    border-radius: 13px;
    background: #f8fafc;
}

.login-box button {
    min-height: 50px;
    margin-top: 4px;
    border-radius: 14px;
    font-weight: 950;
    background: linear-gradient(135deg, #18794e, #35a873);
    box-shadow: 0 14px 30px rgba(24,121,78,.24);
}

.login-footnote {
    margin-top: 16px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

@media (max-width: 860px) {
    .login-page {
        padding: 18px;
        align-items: flex-start;
    }
    .login-stage {
        min-height: auto;
        grid-template-columns: 1fr;
        border-radius: 22px;
    }
    .login-vision {
        display: none;
    }
    .login-panel {
        padding: 18px;
        min-height: calc(100vh - 36px);
    }
    .login-box {
        border-radius: 20px;
        padding: 24px;
        box-shadow: 0 18px 54px rgba(19,31,44,.18);
    }
    .login-box h2 {
        font-size: 26px;
    }
    .login-secure {
        font-size: 11px;
    }
}
.permission-tree {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.permission-tree fieldset {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
    background: #fbfcfd;
}

.permission-tree legend { font-weight: 850; color: #2d3745; }

.checkbox-line {
    display: flex !important;
    grid-template-columns: none !important;
    align-items: center;
    gap: 8px;
    font-weight: 600 !important;
}

.chart-bars {
    min-height: 230px;
    display: flex;
    align-items: end;
    gap: 14px;
    padding: 16px 8px 4px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: linear-gradient(#fff, #f8fafc);
}

.chart-bar-item {
    flex: 1;
    min-width: 54px;
    display: grid;
    justify-items: center;
    gap: 7px;
}

.chart-bar {
    width: min(46px, 80%);
    border-radius: 8px 8px 0 0;
    background: linear-gradient(180deg, #35a873, #18794e);
    display: flex;
    align-items: start;
    justify-content: center;
    color: #fff;
    padding-top: 6px;
    font-size: 12px;
    font-weight: 800;
}

.chart-bar-item small { color: var(--muted); }
.chart-bar-item strong { font-size: 12px; }

.dashboard-hero,
.supplier-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 16px;
    padding: 22px;
    border-radius: 18px;
    background:
        radial-gradient(circle at 82% 20%, rgba(159,207,138,.22), transparent 240px),
        linear-gradient(135deg, #0f2218, #1d4f35);
    color: #fff;
    box-shadow: var(--shadow);
}

.dashboard-hero span,
.supplier-hero span {
    color: #bde7ad;
    font-size: 12px;
    font-weight: 900;
}

.dashboard-hero h2,
.supplier-hero h2 {
    margin: 6px 0 8px;
    font-size: 26px;
}

.dashboard-hero p,
.supplier-hero p { margin: 0; color: #bac6d4; }

.dashboard-health {
    min-width: 130px;
    padding: 16px;
    border-radius: 16px;
    background: rgba(255,255,255,.1);
    text-align: center;
}
.dashboard-health strong { display:block; font-size: 34px; }
.dashboard-health span { color:#fff; }

.kpi-grid .metric {
    min-height: 112px;
}

.dashboard-two-col {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(300px, .9fr);
    gap: 16px;
}

.dashboard-two-col .panel { min-width: 0; }

.bi-panel .chart-bars {
    min-height: 280px;
}

.todo-list {
    display: grid;
    gap: 10px;
}

.todo-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--text);
    background: #fbfcfd;
    transition: transform .12s ease, border-color .12s ease, background .12s ease;
}

.todo-list a:hover {
    border-color: #bddbc4;
    background: #f5fbf6;
    transform: translateY(-1px);
}

.todo-list .todo-icon {
    flex: none;
}

.todo-list strong {
    font-size: 18px;
    color: var(--accent);
}

.todo-list span { color: var(--muted); }

.detail-tabs {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin-bottom: 14px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255,255,255,.94);
    box-shadow: var(--shadow);
}

.detail-tabs a {
    flex: none;
    padding: 8px 12px;
    border-radius: 999px;
    background: #eef2f6;
    color: var(--text);
    font-weight: 800;
}

.detail-tabs a.active {
    background: var(--accent);
    color: #fff;
}

.finance-summary,
.after-sale-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.finance-summary article,
.after-sale-board article {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel);
    box-shadow: var(--shadow);
    min-height: 108px;
}

.finance-summary span {
    color: var(--muted);
    font-weight: 700;
}

.finance-summary strong {
    display: block;
    margin-top: 8px;
    font-size: 25px;
    font-variant-numeric: tabular-nums;
}

.preview-note {
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 1px dashed #bddbc4;
    border-radius: 12px;
    background: #f7fbf7;
    color: var(--muted);
}

.thumb {
    width: 46px;
    height: 46px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
}

.inline-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 12px;
}

.danger,
.button.danger,
button.danger {
    background: #b42318;
    border-color: #b42318;
    color: #fff;
}

.money,
td.money {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 850;
}

.timeline-list {
    margin: 0;
    padding-left: 20px;
}

.timeline-list li {
    margin: 8px 0;
}

.timeline-list span {
    display: block;
    color: var(--muted);
}

.money-positive { color: #18794e !important; }
.money-negative { color: #b42318 !important; }
td.money-positive,
td.money-negative {
    text-align: right;
    font-weight: 850;
}

@media (max-width: 900px) {
    .sidebar {
        position: static;
        width: auto;
        max-height: 340px;
    }
    .main {
        margin-left: 0;
        padding: 18px;
    }
    .topbar,
    .toolbar {
        display: grid;
    }
}
