/* FASHION QUEEN 进销存管理系统 - 全局样式 */

/* ===== 基础重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #d4707e;
    --primary-dark: #b85a68;
    --primary-light: #f0d5d9;
    --secondary: #3a3a4a;
    --bg: #f5f5f7;
    --white: #ffffff;
    --border: #e0e0e0;
    --text: #333333;
    --text-light: #666666;
    --text-muted: #999999;
    --success: #4caf50;
    --warning: #ff9800;
    --danger: #f44336;
    --info: #2196f3;
    --sidebar-width: 230px;
    --header-height: 56px;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);
}

body {
    font-family: 'Microsoft YaHei', '微软雅黑', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
}

/* ===== 登录页面 ===== */
.login-body {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #d4707e 0%, #8b4a5a 100%);
    z-index: 9999;
}

.login-container {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    width: 380px;
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, #d4707e 0%, #c45a6a 100%);
    color: white;
    text-align: center;
    padding: 36px 24px 28px;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 6px;
}

.login-header p {
    font-size: 14px;
    opacity: 0.9;
}

.login-form {
    padding: 32px 28px 24px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    color: var(--text-light);
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-login:hover {
    background: var(--primary-dark);
}

.login-error {
    color: var(--danger);
    font-size: 13px;
    min-height: 18px;
    margin-bottom: 8px;
}

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

/* ===== 主框架布局 ===== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: var(--sidebar-width);
    background: var(--secondary);
    color: #ccc;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    overflow: visible;
}

.sidebar-header {
    padding: 18px 20px;
    background: rgba(0, 0, 0, 0.2);
    text-align: center;
}

.sidebar-header h2 {
    color: var(--primary);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1px;
}

.sidebar-header p {
    font-size: 11px;
    color: #888;
    margin-top: 2px;
}

.sidebar-nav {
    flex: 1;
    padding: 4px 0;
    overflow-y: auto;
}

/* 直接入口（首页） */
.nav-direct {
    padding: 12px 20px 12px 24px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ccc;
}
.nav-direct:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
}
.nav-direct.active {
    background: rgba(212, 112, 126, 0.15);
    border-left-color: var(--primary);
    color: var(--primary);
}

/* 一级菜单区块（hover展开） */
.nav-section {
    position: relative;
}

.nav-section-title {
    padding: 12px 20px 12px 24px;
    cursor: pointer;
    font-size: 13px;
    color: #ccc;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    border-left: 3px solid transparent;
    transition: all 0.2s;
    user-select: none;
}
.nav-section-title:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
}
.nav-section-title .nav-section-arrow {
    margin-left: auto;
    font-size: 10px;
    color: #666;
    transition: transform 0.2s;
}

/* 二级菜单：默认隐藏，JS控制显示，fixed定位不受overflow限制 */
.nav-submenu {
    visibility: hidden;
    opacity: 0;
    transform: translateX(-12px);
    position: fixed;
    min-width: 180px;
    background: #2a2a38;
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.4);
    border-radius: 0 8px 8px 0;
    padding: 6px 0;
    z-index: 9999;
    max-height: 90vh;
    overflow-y: auto;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
}

.nav-submenu.show {
    visibility: visible;
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s;
}

.nav-section:hover .nav-section-title {
    background: rgba(212, 112, 126, 0.12);
    color: var(--primary);
    border-left-color: var(--primary);
}
/* arrow rotation now controlled by JS */

/* 二级分组标签 */
.nav-subgroup-label {
    padding: 6px 16px 4px;
    font-size: 11px;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 二级菜单项 */
.nav-sub-item {
    padding: 9px 16px 9px 20px;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 12.5px;
    color: #aaa;
    border-left: 2px solid transparent;
}
.nav-sub-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--white);
}
.nav-sub-item.active {
    background: rgba(212, 112, 126, 0.12);
    border-left-color: var(--primary);
    color: var(--primary);
}

/* 通用 nav-item 样式兼容 */
.nav-item {
    padding: 10px 20px 10px 28px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
}

.nav-item.active {
    background: rgba(212, 112, 126, 0.15);
    border-left-color: var(--primary);
    color: var(--primary);
}

.nav-item .nav-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* 主内容区 */
.main-area {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
}

/* 顶部栏 */
.topbar {
    height: var(--header-height);
    background: var(--white);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-name {
    font-size: 13px;
    color: var(--text-light);
}

.user-role-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--primary-light);
    color: var(--primary-dark);
}

.user-role-badge.super {
    background: #fff3cd;
    color: #856404;
}

.btn-logout {
    padding: 5px 14px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--white);
    color: var(--text-light);
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.btn-logout:hover {
    border-color: var(--danger);
    color: var(--danger);
}

/* ===== 标签栏 ===== */
.tab-bar {
    display: flex;
    align-items: center;
    background: #f0f0f0;
    border-bottom: 1px solid var(--border);
    padding: 0 8px;
    height: 34px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    flex-shrink: 0;
}

.tab-bar::-webkit-scrollbar {
    height: 3px;
}
.tab-bar::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

.tab-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px 5px 12px;
    margin-right: 2px;
    background: #e8e8e8;
    border: 1px solid #d0d0d0;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    cursor: pointer;
    font-size: 12.5px;
    color: var(--text-light);
    transition: all 0.15s;
    position: relative;
    top: 1px;
    max-width: 200px;
}

.tab-item:hover {
    background: #f5f5f5;
    color: var(--text);
}

.tab-item.active {
    background: var(--white);
    color: var(--text);
    font-weight: 600;
    border-color: var(--border);
    z-index: 2;
}

.tab-item .tab-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tab-item .tab-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    font-size: 14px;
    color: #999;
    line-height: 1;
    flex-shrink: 0;
}

.tab-item .tab-close:hover {
    background: var(--danger);
    color: white;
}

/* 内容区域 */
.content {
    padding: 16px;
    flex: 1;
}

/* ===== 通用组件 ===== */

/* 按钮 */
.btn {
    padding: 8px 18px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--white);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #d32f2f;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-warning:hover {
    background: #e68a00;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #3d8b40;
}

.btn-info {
    background: var(--info);
    color: white;
}

.btn-info:hover {
    background: #1976d2;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 表格 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.data-table thead {
    background: var(--secondary);
    color: white;
}

.data-table th {
    padding: 8px 10px;
    text-align: left;
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
}

.data-table td {
    padding: 6px 10px;
    border-bottom: 1px solid var(--border);
    font-size: 12.5px;
}

.data-table tbody tr:hover {
    background: #fafafa;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* 紧凑表格（用于弹窗内的明细展示） */
.data-table.compact th {
    padding: 7px 8px;
    font-size: 12px;
}
.data-table.compact td {
    padding: 6px 8px;
    font-size: 12px;
}

.table-empty {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 14px;
}

/* 卡片/面板 */
.panel {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px 16px;
    margin-bottom: 12px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 10px;
}

.panel-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

/* 搜索栏 */
.search-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.search-bar input,
.search-bar select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.search-bar input:focus,
.search-bar select:focus {
    border-color: var(--primary);
}

.search-bar input {
    min-width: 200px;
}

/* 模态框 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    width: 900px;
    max-width: 95vw;
    max-height: 92vh;
    overflow-y: auto;
}

.modal-header {
    padding: 14px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
}

.modal-close:hover {
    color: var(--text);
}

.modal-body {
    padding: 16px 24px;
}

.modal-footer {
    padding: 12px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 表单行 */
.form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.form-group {
    margin-bottom: 10px;
}

/* 紧凑头部栏：次要信息横向排列，占约20%空间 */
.form-header-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
    padding: 10px 14px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
}
.form-header-bar .fh-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.form-header-bar .fh-item label {
    font-size: 11px;
    color: var(--text-light);
    font-weight: 500;
    white-space: nowrap;
}
.form-header-bar .fh-item input,
.form-header-bar .fh-item select {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}
.form-header-bar .fh-item input:focus,
.form-header-bar .fh-item select:focus {
    border-color: var(--primary);
}
.form-header-bar .fh-item.fh-readonly input {
    background: #f0f0f0;
    color: var(--text-light);
}

/* 明细区域：占约80%空间，突出显示 */
.form-detail-section {
    flex: 1;
}
.form-detail-section .detail-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 2px solid var(--primary);
}

.form-group-full {
    margin-bottom: 10px;
}

.form-group-full label {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    color: var(--text-light);
    font-weight: 500;
}

.form-group-full input,
.form-group-full select,
.form-group-full textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.form-group-full input:focus,
.form-group-full select:focus,
.form-group-full textarea:focus {
    border-color: var(--primary);
}

/* ===== 产品表单紧凑布局 ===== */
.product-form-compact {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.pf-row {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}
.pf-field {
    flex: 1;
    min-width: 0;
}
.pf-field label {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    color: var(--text-light);
    font-weight: 500;
}
.pf-field input,
.pf-field select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}
.pf-field input:focus,
.pf-field select:focus {
    border-color: var(--primary);
}
.pf-auto {
    font-size: 10px;
    color: var(--text-muted);
    margin-left: 4px;
}
.pf-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px;
}

/* 利润预览横向条 */
.profit-bar {
    display: flex;
    gap: 0;
    padding: 12px 8px;
    background: linear-gradient(135deg, #f8f9fa, #eef0f3);
    border-radius: 8px;
    border: 1px solid var(--border);
    margin-top: 4px;
}
.profit-bar-item {
    flex: 1;
    text-align: center;
    padding: 0 6px;
    border-right: 1px solid #e0e0e0;
}
.profit-bar-item:last-child {
    border-right: none;
}
.profit-bar-item.highlight {
    background: rgba(39,174,96,0.06);
    border-radius: 6px;
    padding: 4px 6px;
}
.profit-bar-item .pb-label {
    display: block;
    font-size: 11px;
    color: var(--text-light);
    margin-bottom: 2px;
}
.profit-bar-item .pb-val {
    font-size: 14px;
    font-weight: 700;
}

/* 移动端紧凑表单 */
@media (max-width: 640px) {
    .pf-row {
        flex-direction: column;
        gap: 10px;
    }
    .profit-bar {
        flex-wrap: wrap;
        gap: 6px;
    }
    .profit-bar-item {
        flex: 1 1 45%;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        padding-bottom: 6px;
    }
}

/* 状态标签 */
.status-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.status-tag.pending { background: #fff3cd; color: #856404; }
.status-tag.in-transit { background: #d1ecf1; color: #0c5460; }
.status-tag.completed { background: #d4edda; color: #155724; }
.status-tag.received { background: #d4edda; color: #155724; }
.status-tag.cancelled { background: #f8d7da; color: #721c24; }
.status-tag.active { background: #d4edda; color: #155724; }
.status-tag.audited { background: #c8e6c9; color: #1b5e20; border: 1px solid #4caf50; }

/* 权限选择器 */
.permission-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 8px;
}

.permission-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.permission-item label {
    font-size: 13px;
    color: var(--text);
}

.permission-item select {
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 12px;
    outline: none;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 12px 14px;
}

.stat-card .stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.stat-card .stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

/* 明细行 */
.detail-row {
    display: flex;
    gap: 6px;
    margin-bottom: 4px;
    align-items: center;
}

.detail-row select,
.detail-row input {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 13px;
    outline: none;
    min-width: 0;
}

.detail-row .col-product {
    flex: 2.5;
}

.detail-row .col-color {
    flex: 0.7;
}

.detail-row .col-qty,
.detail-row .col-price {
    flex: 0.8;
}

.detail-row .col-subtotal {
    flex: 0.9;
}

.detail-row .col-commission {
    flex: 0.7;
}

.detail-row .col-commission-amount {
    flex: 0.8;
}

.detail-row .col-stock-status {
    flex: 1;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
}

.detail-row .col-actual {
    flex: 0.8;
}

.detail-row .col-diff {
    flex: 0.7;
}

.detail-row .btn-remove {
    flex: 0 0 auto;
    width: 40px;
    padding: 6px 4px;
    font-size: 12px;
}

/* 产品搜索选择器 */
.product-search-wrap {
    position: relative;
    flex: 2.5;
    min-width: 0;
}

.product-search-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 13px;
    outline: none;
    min-width: 0;
    box-sizing: border-box;
}

.product-search-input:focus {
    border-color: var(--primary);
}

.product-search-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 220px;
    overflow-y: auto;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 0 0 5px 5px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10000;
    margin-top: -1px;
}

.product-search-dropdown.show {
    display: block;
}

.product-search-item {
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    line-height: 1.4;
}

.product-search-item:last-child {
    border-bottom: none;
}

.product-search-item:hover,
.product-search-item.active {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.product-search-item .ps-code {
    font-weight: 600;
    color: var(--primary);
    margin-right: 4px;
}

.product-search-item .ps-color {
    color: var(--text-muted);
    font-size: 11px;
}

.product-search-empty {
    padding: 10px;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
}

/* 明细行表头 — 必须与数据行完全对齐 */
.detail-row-header {
    display: flex;
    gap: 6px;
    margin-bottom: 4px;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
}
.detail-row-header > * { flex: 1; text-align: center; min-width: 0; }
.detail-row-header .col-product { flex: 2.5; text-align: left; }
.detail-row-header .col-color { flex: 0.7; }
.detail-row-header .col-qty,
.detail-row-header .col-price { flex: 0.8; }
.detail-row-header .col-subtotal { flex: 0.9; }
.detail-row-header .col-commission { flex: 0.7; }
.detail-row-header .col-commission-amount { flex: 0.8; }
.detail-row-header .col-stock-status { flex: 1; }
.detail-row-header .col-actual { flex: 0.8; }
.detail-row-header .col-diff { flex: 0.7; }
.detail-row-header .col-btn-placeholder { flex: 0 0 auto; width: 40px; }

/* 库存状态标签 */
.stock-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}
.stock-tag.in-stock { background: #d4edda; color: #155724; }
.stock-tag.low-stock { background: #fff3cd; color: #856404; }
.stock-tag.out-stock { background: #f8d7da; color: #721c24; }

/* 只读输入框样式 */
.detail-row input[readonly],
.detail-row input[disabled] {
    background: #f9f9f9;
    color: var(--text-light);
}

.detail-row .btn-remove {
    flex: 0 0 auto;
    padding: 5px 10px;
    font-size: 12px;
    background: #f8d7da;
    color: #721c24;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.detail-row .btn-remove:hover {
    background: #f5c2c7;
}

.detail-total {
    text-align: right;
    padding: 6px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.detail-total span {
    color: var(--primary);
    font-size: 18px;
}

/* 通知提示 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 24px;
    border-radius: 6px;
    color: white;
    font-size: 14px;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s;
}

.toast.show {
    opacity: 1;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--info); }

/* ===== 首页仪表盘 ===== */

/* 突出的大数字卡片 */
.stat-card.highlight {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}
.stat-card.highlight .stat-label { color: rgba(255,255,255,0.85); }
.stat-card.highlight .stat-value { color: white; font-size: 22px; }
.stat-card.highlight .stat-sub { color: rgba(255,255,255,0.7); font-size: 11px; margin-top: 2px; }

/* 双列布局用于排名表 */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

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

/* 排名表格 */
.rank-table td:first-child {
    width: 48px;
    text-align: center;
    font-weight: 700;
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
}
.rank-badge.rank-1 { background: #ffd700; color: #8b6914; }
.rank-badge.rank-2 { background: #c0c0c0; color: #555; }
.rank-badge.rank-3 { background: #cd7f32; color: white; }
.rank-badge.rank-other { background: var(--primary-light); color: var(--primary-dark); }

/* 销售额进度条 */
.sales-bar-container {
    background: #f0f0f0;
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
    margin-top: 4px;
}
.sales-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    border-radius: 4px;
    transition: width 0.5s;
}

/* 销量进度条 */
.qty-bar-container {
    background: #f0f0f0;
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
    margin-top: 4px;
}
.qty-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #2e7d32);
    border-radius: 4px;
    transition: width 0.5s;
}

/* 响应式 */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }
    .sidebar-header h2,
    .sidebar-header p,
    .nav-section-title span:not(.nav-icon),
    .nav-direct span:not(.nav-icon),
    .nav-section-arrow {
        display: none;
    }
    .nav-submenu {
        max-height: 600px;
    }
    .main-area {
        margin-left: 60px;
    }
    .form-row {
        flex-direction: column;
    }
}
