/* 全局样式 */
body { font-family: -apple-system, "Microsoft YaHei", "Segoe UI", Roboto, sans-serif; }

/* 侧边栏 */
.sidebar {
    width: 130px;
    flex: 0 0 130px;      /* 固定在 flex 布局中不被内容挤压（否则长内容页会把菜单挤窄） */
    min-height: 100vh;
    position: sticky;
    top: 0;
    transition: transform .2s ease;
    z-index: 1030;
}
/* 主内容区允许收缩，避免内部宽元素反向挤压侧边栏 */
#app-wrap > .flex-grow-1 { min-width: 0; }
.sidebar .nav-link { color: rgba(255,255,255,.7); border-radius: .25rem; padding: .5rem .8rem; }
.sidebar .nav-link:hover { color: #fff; background: rgba(255,255,255,.08); }
.sidebar .nav-link.active { color: #fff; background: var(--bs-primary); }
.sidebar .sidebar-brand { font-size: 1.05rem; }

/* 移动端侧边栏抽屉 */
@media (max-width: 767.98px) {
    #app-wrap { flex-direction: column; }
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        flex: none;
        transform: translateX(-100%);
        box-shadow: 2px 0 8px rgba(0,0,0,.3);
    }
    .sidebar.show { transform: translateX(0); }
}

/* 表格紧凑 */
table.table-sm td, table.table-sm th { padding: .35rem .4rem; }

/* 必填星标 */
.required::after { content: " *"; color: var(--bs-danger); }

/* 表单错误 */
.invalid-feedback { display: block; }

/* 卡片悬停 */
.card.hover { transition: box-shadow .2s, transform .2s; }
.card.hover:hover { box-shadow: 0 .5rem 1rem rgba(0,0,0,.12); transform: translateY(-2px); }

/* 数字右对齐 */
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* 状态徽章统一 */
.badge { font-weight: 500; }

/* 单据状态色 */
.status-draft   { background: #6c757d; }
.status-pending { background: #ffc107; color: #000; }
.status-approved{ background: #198754; }
.status-void    { background: #dc3545; }

/* 打印时隐藏侧边栏与按钮 */
@media print {
    .sidebar, header, footer, .no-print { display: none !important; }
    #main-content { padding: 0 !important; }
}
