:root {
    --bg-dark: #1a1a1a;
    --bg-card: #2d2d2d;
    --text-main: #e0e0e0;
    --text-muted: #a0a0a0;
    --primary: #007bff;
    --success: #28a745;
    --info: #17a2b8;
    --warning: #ffc107;
    --danger: #dc3545;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* 布局样式 */
.wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: 250px;
    background-color: var(--bg-card);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    border-right: 1px solid #3d3d3d;
}

.sidebar-header {
    padding: 1.5rem;
    text-align: center;
    background-color: rgba(0,0,0,0.1);
    font-weight: bold;
    font-size: 1.2rem;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1rem 1.5rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.sidebar-menu li a:hover,
.sidebar-menu li a.active {
    background-color: rgba(255,255,255,0.05);
    color: var(--text-main);
    border-left-color: var(--primary);
}

/* 菜单图标样式 */
.menu-icon {
    font-size: 1.3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    transition: transform 0.3s ease;
}

.menu-text {
    flex: 1;
}

/* 悬停时图标动画 */
.sidebar-menu li a:hover .menu-icon {
    transform: scale(1.15);
}

/* 激活状态图标增强 */
.sidebar-menu li a.active .menu-icon {
    filter: brightness(1.2);
}

/* 主内容区 */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-dark);
}

.top-navbar {
    background-color: var(--bg-card);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #3d3d3d;
}

.content-wrapper {
    padding: 2rem;
    overflow-y: auto;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem 1rem;
    box-sizing: border-box;
}

.login-card {
    width: 100%;
    max-width: 600px;
    background-color: var(--bg-card);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.login-header h2 {
    margin: 0;
    font-size: 1.6rem;
}

.login-header p {
    margin-top: 0.25rem;
    color: var(--text-muted);
}

/* 卡片 */
.card {
    background-color: var(--bg-card);
    border-radius: 6px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card-header {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #3d3d3d;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: var(--bg-card);
    padding: 1.5rem;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid var(--primary);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    margin-top: 0.5rem;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* 表格 */
.table { width: 100%; color: var(--text-main); border-collapse: collapse; }
.table thead tr { text-align: left; border-bottom: 1px solid #3d3d3d; }
.table th, .table td { padding: 10px; }
.table tbody tr { border-bottom: 1px solid #3d3d3d; }

/* 表单 */
.form-group { margin-bottom: 1rem; }
.form-control { width: 100%; padding: 0.75rem; background-color: #3d3d3d; border: 1px solid #4d4d4d; border-radius: 4px; color: white; box-sizing: border-box; }
.form-control:focus { outline: none; border-color: var(--primary); }
.invalid-feedback { color: var(--danger); font-size: 0.875rem; margin-top: 0.25rem; display: block; }
.is-invalid { border-color: var(--danger); }

/* 按钮 */
.btn { display: inline-block; padding: 0.6rem 1rem; border: none; border-radius: 4px; cursor: pointer; font-size: 1rem; text-align: center; box-sizing: border-box; }
.btn-primary { background-color: var(--primary); color: #fff; }
.btn-primary:hover { background-color: #0056b3; }
.btn-danger { background-color: var(--danger); color: #fff; }
.btn-danger:hover { background-color: #b52a36; }
.btn-success { background-color: var(--success); color: #fff; }
.btn-info { background-color: var(--info); color: #fff; }
.btn-warning { background-color: var(--warning); color: #333; }

.link-danger { color: var(--danger); }

/* 边框色快捷类 */
.border-primary { border-left: 4px solid var(--primary); }
.border-success { border-left: 4px solid var(--success); }
.border-warning { border-left: 4px solid var(--warning); }
.border-info { border-left: 4px solid var(--info); }

/* 警告 */
.alert { padding: 1rem; border-radius: 4px; margin-bottom: 1rem; }
.alert-danger { border-left: 4px solid var(--danger); color: var(--danger); }

/* 栅格 */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }

/* 到期日期颜色样式 */
.expiry-warning {
    color: #e74c3c !important;
    font-weight: bold;
    background: rgba(231, 76, 60, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

.expiry-soon {
    color: #f39c12 !important;
    font-weight: bold;
    background: rgba(243, 156, 18, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

.expiry-normal {
    color: #27ae60 !important;
    font-weight: 500;
}

/* ========== 仪表盘新增样式 ========== */

/* 统计柱状图 */
.stat-bars {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stat-bar-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-bar-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.stat-bar-label span {
    color: var(--text-muted);
}

.stat-bar-label strong {
    color: var(--text-main);
    font-size: 1.1rem;
}

.stat-bar-track {
    height: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    overflow: hidden;
}

.stat-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.6s ease;
}

/* 快捷操作网格 */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 20px;
}

.action-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.action-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    text-decoration: none;
}

.action-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.action-card-text {
    flex: 1;
}

.action-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 4px;
}

.action-card-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* 活动时间线 */
.activity-timeline {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
    padding-top: 4px;
}

.activity-text {
    font-size: 0.9rem;
    color: var(--text-main);
    margin-bottom: 4px;
}

.activity-text strong {
    color: var(--primary);
}

.activity-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* 滚动条美化 */
.activity-timeline::-webkit-scrollbar {
    width: 6px;
}

.activity-timeline::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.activity-timeline::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.activity-timeline::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 响应式 */
@media (max-width: 992px) {
    .sidebar { width: 220px; }
    .stats-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
    .quick-actions-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .wrapper { flex-direction: column; }
    .sidebar { width: 100%; flex-direction: row; align-items: center; overflow-x: auto; border-right: none; border-bottom: 1px solid #3d3d3d; }
    .sidebar-header { padding: 1rem; white-space: nowrap; }
    .sidebar-menu { display: flex; flex-direction: row; }
    .sidebar-menu li { flex-shrink: 0; }
    .sidebar-menu li a { border-left: none; border-bottom: 3px solid transparent; padding: 1rem; flex-direction: column; gap: 4px; }
    .sidebar-menu li a:hover, .sidebar-menu li a.active { border-left-color: transparent; border-bottom-color: var(--primary); }
    .menu-text { font-size: 0.85rem; }
    .grid-3 { grid-template-columns: 1fr; }
    .top-navbar { padding: 0.8rem 1rem; }
    .login-card { padding: 1.5rem; }
    .quick-actions-grid { grid-template-columns: 1fr; }
}
