* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f0f1f5;
    color: #333;
    font-size: 14px;
    padding-top: 50px;
}
.hidden { display: none !important; }

/* === Header === */
.header {
    position: fixed; top: 0; left: 0; right: 0;
    height: 50px;
    background: #4a5568; color: #fff;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 16px; z-index: 100;
}
.header-title { font-size: 16px; font-weight: 500; flex: 1; text-align: center; }
.header-user { font-size: 13px; opacity: 0.85; }
.header-back {
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    font-size: 32px; font-weight: 300; cursor: pointer; margin-left: -8px;
}

/* === Page === */
.page { display: none; padding: 8px 0 20px; min-height: 100vh; }
.page.active { display: block; }

/* === Card === */
.card {
    background: #fff; margin: 8px 12px; border-radius: 8px;
    padding: 12px 14px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    border: 1px solid #e8e8ec;
}
.card h3 { font-size: 14px; font-weight: 600; color: #4a5568; margin-bottom: 8px; }

/* === Menu Grid === */
.menu-grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 8px; padding: 0 12px;
}
.menu-item {
    background: #fff; border-radius: 8px; padding: 14px 0;
    text-align: center; cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    border: 1px solid #e8e8ec; font-size: 13px;
}
.menu-item:active { background: #f5f5f5; }
.menu-icon { font-size: 26px; margin-bottom: 4px; }

/* === Stats === */
.stats { display: flex; justify-content: space-around; text-align: center; }
.stat-item { flex: 1; }
.stat-label { color: #999; font-size: 12px; margin-bottom: 2px; }
.stat-value { font-size: 20px; font-weight: 600; color: #4a5568; }

/* === List Item (baoxiao style) === */
.list-item {
    background: #fff; margin: 6px 12px; padding: 10px 14px;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    border: 1px solid #e8e8ec;
}
.list-item-title { font-size: 14px; font-weight: 500; margin-bottom: 3px; }
.list-item-meta { display: flex; justify-content: space-between; color: #999; font-size: 12px; }
.list-item-amount { font-size: 16px; color: #4a5568; font-weight: 600; }
.list-item-actions { margin-top: 6px; display: flex; gap: 6px; }
.list-item-actions button {
    flex: 1; height: 30px; border: none; border-radius: 5px;
    font-size: 12px; cursor: pointer;
}

/* === Status Tags === */
.tag {
    display: inline-block; padding: 1px 8px; border-radius: 10px;
    font-size: 11px; vertical-align: middle;
}
.tag-green { background: #e8f0e8; color: #3b7a3b; }
.tag-orange { background: #f5f0e6; color: #8a6d3b; }
.tag-red { background: #f2e8e8; color: #8a3b3b; }
.tag-blue { background: #e8edf2; color: #3b6e8a; }
.tag-gray { background: #edf0f2; color: #666; }
.tag-purple { background: #f0e8f2; color: #6b3b8a; }
.urgent { border-left: 3px solid #e53935; }

/* === Form === */
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 12px; color: #666; margin-bottom: 3px; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 8px 10px;
    border: 1px solid #d9d9de; border-radius: 6px;
    font-size: 13px; background: #fafafa; color: #333;
}
.form-group input:focus, .form-group select:focus { outline: none; border-color: #7b8794; background: #fff; }
.form-group textarea { min-height: 50px; resize: vertical; }

/* === Buttons === */
.btn { display: block; width: 100%; padding: 10px; border: none; border-radius: 6px; font-size: 14px; cursor: pointer; text-align: center; }
.btn-primary { background: #4a5568; color: #fff; }
.btn-primary:active { opacity: 0.85; }
.btn-success { background: #43a047; color: #fff; }
.btn-danger { background: #e53935; color: #fff; }
.btn-sm { display: inline-block; width: auto; padding: 5px 12px; font-size: 12px; }

/* === Progress bar === */
.progress-bar { height: 6px; background: #e0e0e0; border-radius: 3px; margin: 6px 0; overflow: hidden; }
.progress-bar .fill { height: 100%; background: #4a5568; border-radius: 3px; transition: width .3s; }
.progress-bar .fill.danger { background: #e53935; }

/* === KPI compact === */
.kpi-row { display: flex; gap: 6px; margin: 8px 12px; }
.kpi-card {
    flex: 1; background: #fff; border-radius: 8px; padding: 10px 8px;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    border: 1px solid #e8e8ec;
}
.kpi-value { font-size: 16px; font-weight: 700; }
.kpi-label { font-size: 11px; color: #999; margin-top: 2px; }

/* === Vendor phone-book === */
.vendor-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
}
.vendor-row:last-child { border-bottom: none; }
.vendor-name { font-weight: 500; }
.vendor-phone { color: #999; font-size: 12px; }

/* === Toast === */
.toast {
    position: fixed; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.72); color: #fff;
    padding: 10px 18px; border-radius: 6px;
    font-size: 13px; z-index: 1000;
}

/* === Section header === */
.section-header {
    font-size: 13px; font-weight: 600; color: #4a5568;
    padding: 10px 14px 4px; margin: 0;
}

/* === Compact table rows === */
.row-between {
    display: flex; justify-content: space-between; align-items: center;
    padding: 4px 0; font-size: 13px;
}
.row-between .label { color: #999; }
.row-between .value { font-weight: 500; }

/* === Compact table === */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { background: #f7f8fa; color: #999; font-weight: 500; font-size: 12px; padding: 6px 10px; text-align: left; border-bottom: 1px solid #e8e8ec; }
.tbl td { padding: 8px 10px; border-bottom: 1px solid #f0f0f0; }
.tbl-tight th { padding: 4px 6px; font-size: 11px; }
.tbl-tight td { padding: 5px 6px; font-size: 12px; }
.tbl tr:active { background: #f5f5f5; }

@media (max-width: 480px) {
    .menu-grid { grid-template-columns: repeat(3, 1fr); }
}
