/* ===== 采购系统自定义样式 ===== */

:root {
    --sidebar-width: 220px;
    --sidebar-bg: #f8f9fa;
    --sidebar-hover: #e9ecef;
    --sidebar-active: #0d6efd;
}

/* 通用 */
body {
    background-color: #f5f6fa;
    font-size: 14px;
}

/* ===== 侧边栏 ===== */
.sidebar-wrapper {
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    z-index: 100;
    overflow-y: auto;
    background: var(--sidebar-bg);
    border-right: 1px solid #dee2e6;
}

.sidebar {
    padding: 1rem 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.6rem 1.2rem;
    color: #495057;
    text-decoration: none;
    transition: all 0.15s;
    border-left: 3px solid transparent;
    font-size: 14px;
}

.sidebar-link:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-active);
    text-decoration: none;
}

.sidebar-link.active {
    background: #e7f1ff;
    color: var(--sidebar-active);
    border-left-color: var(--sidebar-active);
    font-weight: 600;
}

.sidebar-icon {
    margin-right: 8px;
    font-size: 16px;
}

.sidebar-divider {
    height: 1px;
    background: #dee2e6;
    margin: 0.5rem 1rem;
}

/* 主内容区偏移 */
.main-content {
    margin-left: var(--sidebar-width);
}

@media (max-width: 767.98px) {
    .sidebar-wrapper { display: none; }
    .main-content { margin-left: 0; }
}

/* 桌面端筛选表单始终展开，移动端折叠 */
@media (min-width: 768px) {
    #filterForm.collapse,
    #filterForm.collapsing,
    #filterForm.collapse:not(.show) {
        display: block !important;
        height: auto !important;
    }
}

/* 移动端侧边栏菜单 */
.offcanvas .sidebar-link {
    padding: 0.8rem 1.2rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}

/* ===== 紧急程度徽章 ===== */
.badge {
    font-size: 0.8em;
    padding: 0.4em 0.7em;
    font-weight: 500;
}

.badge-urgent {
    background-color: #dc3545;
    color: #fff;
}

.badge-warning {
    background-color: #ffc107;
    color: #212529;
}

.badge-normal {
    background-color: #198754;
    color: #fff;
}

.badge-overdue {
    background-color: #dc3545;
    color: #fff;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ===== 状态徽章 ===== */
.badge-pending {
    background-color: #6c757d;
    color: #fff;
}

.badge-purchased {
    background-color: #0d6efd;
    color: #fff;
}

/* ===== 表格 ===== */
.table th {
    background-color: #f8f9fa;
    font-weight: 600;
    white-space: nowrap;
}

.table td {
    vertical-align: middle;
    white-space: nowrap;
}

.table-hover tbody tr:hover {
    background-color: #f0f6ff;
}

/* ===== 卡片 ===== */
.stat-card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.15s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.12);
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: #6c757d;
}

/* ===== 登录页 ===== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-card .card-body {
    padding: 2rem;
}

.login-logo {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 0.5rem;
}

.login-title {
    text-align: center;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #333;
}

/* ===== 工具类 ===== */
.cursor-pointer {
    cursor: pointer;
}

.text-money {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

/* 操作按钮间距 */
.action-btns {
    white-space: nowrap;
    min-width: 180px;
}

.action-btns .btn {
    white-space: nowrap;
    display: inline-block;
    margin-right: 2px;
    margin-bottom: 2px;
}

/* 表单必填标记 */
.required::after {
    content: " *";
    color: #dc3545;
}
