/* ===== 养法儿·母公司管理后台 · 共享样式 ===== */
*{margin:0;padding:0;box-sizing:border-box}
body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"PingFang SC",sans-serif;background:#f0f2f5;min-height:100vh;display:flex;color:#1f2937}
::-webkit-scrollbar{width:5px;height:5px}
::-webkit-scrollbar-thumb{background:rgba(102,126,234,0.35);border-radius:3px}

/* ===== 侧边栏 ===== */
.sidebar{width:220px;background:#fff;border-right:1px solid #e8eaf0;display:flex;flex-direction:column;position:fixed;top:0;left:0;height:100vh;z-index:100;overflow-y:auto;flex-shrink:0}
.sidebar::-webkit-scrollbar{width:3px}
.sidebar-brand{padding:1rem 0.9rem 0.8rem;border-bottom:1px solid #f0f2f8;display:flex;align-items:center;gap:0.6rem;flex-shrink:0}
.brand-logo{width:32px;height:32px;border-radius:9px;background:linear-gradient(135deg,#667eea,#764ba2);display:flex;align-items:center;justify-content:center;font-size:1.1rem;flex-shrink:0}
.sidebar-brand h1{font-size:0.87rem;font-weight:800;color:#1f2937;line-height:1.25}
.sidebar-brand p{font-size:0.6rem;color:#9ca3af;margin-top:0.1rem}

.sidebar-nav{padding:0.4rem 0.55rem;flex:1;overflow-y:auto}
.nav-item{display:flex;align-items:center;gap:0.5rem;padding:0.46rem 0.75rem;color:#6b7280;font-size:0.81rem;cursor:pointer;border-radius:8px;margin-bottom:0.04rem;border:1px solid transparent;text-decoration:none;transition:all 0.18s;white-space:nowrap}
.nav-item:hover{background:#f5f3ff;color:#667eea}
.nav-item.active{background:linear-gradient(135deg,#ede9fe,#f0ebff);color:#667eea;font-weight:700;border-color:#ddd6fe}
.nav-icon{font-size:0.9rem;width:18px;text-align:center;flex-shrink:0}
.nav-divider{height:1px;background:#f0f2f8;margin:0.35rem 0.3rem}

.sidebar-footer{margin-top:auto;padding:0.7rem 0.85rem;border-top:1px solid #f0f2f8;display:flex;align-items:center;gap:0.55rem;flex-shrink:0}
.footer-avatar{width:27px;height:27px;border-radius:8px;background:linear-gradient(135deg,#667eea,#764ba2);display:flex;align-items:center;justify-content:center;font-size:0.72rem;color:#fff;font-weight:700;flex-shrink:0}
.footer-name{font-size:0.74rem;color:#374151;font-weight:600}
.footer-role{font-size:0.59rem;color:#9ca3af}

/* ===== 主内容 ===== */
.main-wrapper{margin-left:220px;flex:1;display:flex;flex-direction:column;min-height:100vh}
.topbar{background:#fff;padding:0 1.4rem;height:50px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #eaecf2;position:sticky;top:0;z-index:50;flex-shrink:0}
.breadcrumb{font-size:0.78rem;color:#9ca3af;display:flex;align-items:center;gap:0.3rem}
.breadcrumb .sep{color:#d1d5db;font-size:0.7rem}
.breadcrumb .cur{color:#374151;font-weight:600}
.topbar-right{display:flex;align-items:center;gap:0.55rem}
.tb-btn{width:30px;height:30px;border-radius:8px;background:#f5f6fa;border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:0.85rem;color:#6b7280;transition:all 0.18s;position:relative}
.tb-btn:hover{background:#ede9fe;color:#667eea}
.badge-dot{position:absolute;top:4px;right:4px;width:6px;height:6px;background:#ef4444;border-radius:50%;border:1.5px solid #fff}
.main-content{flex:1;padding:1.3rem 1.4rem;overflow:auto}

/* ===== 页头 ===== */
.page-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:1.1rem;padding-bottom:0.9rem;border-bottom:1px solid #f0f0f0}
.page-header h2{font-size:1.1rem;font-weight:800;color:#1f2937}
.page-header .desc{font-size:0.73rem;color:#9ca3af;margin-top:0.18rem}
.header-actions{display:flex;gap:0.45rem;flex-wrap:wrap}
.section-title{font-size:0.87rem;font-weight:700;color:#1f2937;margin-bottom:0.75rem;display:flex;align-items:center;gap:0.4rem}
.section-title::before{content:'';width:3px;height:14px;background:linear-gradient(135deg,#667eea,#764ba2);border-radius:2px}

/* ===== 卡片 ===== */
.card{background:#fff;border-radius:12px;box-shadow:0 1px 6px rgba(0,0,0,0.06);margin-bottom:1rem;overflow:hidden}
.card-header{padding:0.8rem 1.1rem;border-bottom:1px solid #f1f5f9;display:flex;align-items:center;justify-content:space-between}
.card-header h3{font-size:0.88rem;font-weight:700;color:#1f2937;display:flex;align-items:center;gap:0.4rem}
.card-body{padding:0.9rem 1.1rem}

/* ===== KPI ===== */
.stats-row{display:grid;gap:0.9rem;margin-bottom:1.1rem}
.stats-4{grid-template-columns:repeat(4,1fr)}
.stats-5{grid-template-columns:repeat(5,1fr)}
.kpi-card{background:#fff;border-radius:10px;padding:0.85rem 0.95rem;box-shadow:0 1px 6px rgba(0,0,0,0.06);display:flex;align-items:center;gap:0.7rem}
.kpi-icon{width:38px;height:38px;border-radius:9px;display:flex;align-items:center;justify-content:center;font-size:1.1rem;flex-shrink:0}
.kpi-num{font-size:1.45rem;font-weight:800;color:#1f2937;line-height:1}
.kpi-label{font-size:0.67rem;color:#9ca3af;margin-top:0.15rem}
.kpi-sub{font-size:0.62rem;margin-top:0.15rem}
.trend-up{color:#10b981}.trend-dn{color:#ef4444}

/* ===== 表格 ===== */
.table-wrap{overflow-x:auto}
table{width:100%;border-collapse:collapse}
th{padding:0.6rem 1rem;text-align:left;background:#f8fafc;color:#6b7280;font-weight:600;font-size:0.74rem;border-bottom:1px solid #eaecf2;white-space:nowrap}
td{padding:0.66rem 1rem;border-bottom:1px solid #f1f5f9;color:#374151;font-size:0.82rem;vertical-align:middle}
tr:last-child td{border-bottom:none}
tr:hover td{background:#fafbff}

/* ===== 按钮 ===== */
.btn{display:inline-flex;align-items:center;gap:0.3rem;padding:0.42rem 0.85rem;border-radius:8px;font-size:0.81rem;font-weight:600;cursor:pointer;border:none;transition:all 0.2s;white-space:nowrap}
.btn-primary{background:linear-gradient(135deg,#667eea,#764ba2);color:#fff;box-shadow:0 2px 8px rgba(102,126,234,0.28)}
.btn-primary:hover{box-shadow:0 4px 14px rgba(102,126,234,0.4);transform:translateY(-1px)}
.btn-outline{background:#fff;color:#667eea;border:1.5px solid #667eea}
.btn-outline:hover{background:rgba(102,126,234,0.04)}
.btn-ghost{background:transparent;color:#6b7280;border:1px solid #e5e7eb}
.btn-ghost:hover{background:#f9fafb}
.btn-danger{background:#fff;color:#ef4444;border:1.5px solid #ef4444}
.btn-sm{padding:0.27rem 0.62rem;font-size:0.75rem}

/* ===== 徽标 ===== */
.badge{display:inline-block;font-size:0.69rem;font-weight:700;padding:0.13rem 0.47rem;border-radius:20px;white-space:nowrap}
.badge-green{background:#dcfce7;color:#16a34a}
.badge-blue{background:#eff6ff;color:#2563eb}
.badge-orange{background:#fff7ed;color:#ea580c}
.badge-red{background:#fef2f2;color:#dc2626}
.badge-gray{background:#f3f4f6;color:#6b7280}
.badge-purple{background:#f5f3ff;color:#7c3aed}
.badge-teal{background:#f0fdfa;color:#0d9488}
.badge-yellow{background:#fffbeb;color:#d97706}

/* ===== 标签页 ===== */
.tabs{display:flex;border-bottom:2px solid #f0f0f0;margin-bottom:0.9rem}
.tab-item{padding:0.6rem 1rem;cursor:pointer;font-size:0.83rem;color:#6b7280;border-bottom:2px solid transparent;margin-bottom:-2px;transition:all 0.15s}
.tab-item.active{color:#667eea;font-weight:600;border-bottom-color:#667eea}
.tab-panel{display:none}
.tab-panel.active{display:block}

/* ===== 过滤栏 ===== */
.filter-bar{display:flex;gap:0.55rem;margin-bottom:0.9rem;flex-wrap:wrap;align-items:center}
.filter-input,.filter-select{padding:0.38rem 0.7rem;border:1.5px solid #e5e7eb;border-radius:8px;font-size:0.8rem;outline:none;background:#fff;min-width:120px;color:#374151}
.filter-input:focus,.filter-select:focus{border-color:#667eea}

/* ===== 提示框 ===== */
.alert{padding:0.7rem 0.9rem;border-radius:8px;font-size:0.81rem;margin-bottom:0.9rem;display:flex;align-items:flex-start;gap:0.45rem}
.alert-info{background:#eff6ff;border:1px solid #bfdbfe;color:#1d4ed8}
.alert-warn{background:#fff7ed;border:1px solid #fed7aa;color:#c2410c}
.alert-success{background:#f0fdf4;border:1px solid #bbf7d0;color:#15803d}

/* ===== 弹窗 ===== */
.modal-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,0.45);z-index:1000;align-items:center;justify-content:center}
.modal-overlay.open{display:flex}
.modal{background:#fff;border-radius:16px;width:560px;max-width:92vw;max-height:88vh;overflow-y:auto;box-shadow:0 20px 60px rgba(0,0,0,0.18)}
.modal-lg{width:720px}
.modal-header{padding:1rem 1.4rem;border-bottom:1px solid #f1f5f9;display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;background:#fff;z-index:1;border-radius:16px 16px 0 0}
.modal-header h3{font-size:0.95rem;font-weight:700;color:#1f2937}
.modal-close{width:26px;height:26px;border-radius:50%;background:#f3f4f6;border:none;cursor:pointer;font-size:1rem;color:#6b7280;display:flex;align-items:center;justify-content:center}
.modal-body{padding:1.1rem 1.4rem}
.modal-footer{padding:0.9rem 1.4rem;border-top:1px solid #f1f5f9;display:flex;justify-content:flex-end;gap:0.55rem}

/* ===== 表单 ===== */
.form-group{margin-bottom:0.8rem}
.form-label{display:block;font-size:0.8rem;font-weight:600;color:#374151;margin-bottom:0.3rem}
.form-control{width:100%;padding:0.46rem 0.7rem;border:1.5px solid #e5e7eb;border-radius:8px;font-size:0.83rem;outline:none;transition:border-color 0.2s;font-family:inherit;color:#374151}
.form-control:focus{border-color:#667eea}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:0.8rem}
.form-hint{font-size:0.7rem;color:#9ca3af;margin-top:0.18rem}
textarea.form-control{resize:vertical;min-height:80px}

/* ===== 信息格子 ===== */
.info-grid{display:grid;grid-template-columns:1fr 1fr;gap:0.55rem;margin-bottom:0.8rem}
.info-item{background:#f8fafc;border-radius:8px;padding:0.6rem 0.8rem}
.info-key{font-size:0.72rem;color:#9ca3af;margin-bottom:0.15rem}
.info-val{font-size:0.86rem;font-weight:600;color:#1f2937}

/* ===== 颜色图标 ===== */
.ic1{background:linear-gradient(135deg,#667eea,#764ba2)}
.ic2{background:linear-gradient(135deg,#10b981,#059669)}
.ic3{background:linear-gradient(135deg,#f59e0b,#d97706)}
.ic4{background:linear-gradient(135deg,#ef4444,#dc2626)}
.ic5{background:linear-gradient(135deg,#06b6d4,#0891b2)}
.ic6{background:linear-gradient(135deg,#f43f5e,#e11d48)}
.ic7{background:linear-gradient(135deg,#8b5cf6,#7c3aed)}

/* ===== 子菜单 ===== */
.nav-group-title{display:flex;align-items:center;gap:0.45rem;padding:0.32rem 0.75rem;color:#9ca3af;font-size:0.7rem;font-weight:700;letter-spacing:0.05em;text-transform:uppercase;margin-top:0.1rem;cursor:pointer;border-radius:8px;transition:all 0.15s;border:1px solid transparent;text-decoration:none}
.nav-group-title:hover{background:#f5f3ff;color:#667eea}
.nav-group-title.active{background:linear-gradient(135deg,#ede9fe,#f0ebff);color:#667eea;font-weight:800;border-color:#ddd6fe}
.nav-sub-item{display:flex;align-items:center;gap:0.45rem;padding:0.38rem 0.75rem 0.38rem 1.7rem;color:#6b7280;font-size:0.78rem;cursor:pointer;border-radius:8px;margin-bottom:0.03rem;border:1px solid transparent;text-decoration:none;transition:all 0.18s;white-space:nowrap}
.nav-sub-item:hover{background:#f5f3ff;color:#667eea}
.nav-sub-item.active{background:linear-gradient(135deg,#ede9fe,#f0ebff);color:#667eea;font-weight:700;border-color:#ddd6fe}
.nav-sub-icon{font-size:0.78rem;width:15px;text-align:center;flex-shrink:0}

/* ===== 两列布局 ===== */
.two-col{display:grid;grid-template-columns:1fr 1fr;gap:1rem;margin-bottom:1rem}
.three-col{display:grid;grid-template-columns:1fr 1fr 1fr;gap:0.9rem;margin-bottom:1rem}
