/* ====== 全局样式 ====== */
:root {
    --sidebar-width: 260px;
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --sidebar-active: #0ea5e9;
    --top-nav-height: 56px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f1f5f9;
    overflow-x: hidden;
}

/* ====== 侧边栏 ====== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    color: #cbd5e1;
    z-index: 1000;
    transition: transform 0.3s;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1rem 1.25rem;
    background: rgba(0,0,0,0.2);
    font-size: 1.1rem;
    font-weight: 600;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar-user-info {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 0.9rem;
}

.sidebar-nav {
    padding: 0.5rem 0;
}

.sidebar-link {
    color: #cbd5e1 !important;
    padding: 0.6rem 1.25rem !important;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background: var(--sidebar-hover);
    color: #fff !important;
}

.sidebar-link i:first-child {
    width: 20px;
    text-align: center;
}

.sidebar-link .bi-chevron-down {
    font-size: 0.7rem;
    transition: transform 0.3s;
}

.sidebar-link[aria-expanded="true"] .bi-chevron-down {
    transform: rotate(180deg);
}

.sidebar-sub {
    padding-left: 3.5rem !important;
    font-size: 0.85rem;
}

.sidebar-sub:hover {
    background: var(--sidebar-hover);
}

/* ====== 主内容区 ====== */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s;
}

.top-navbar {
    position: sticky;
    top: 0;
    z-index: 999;
    border-bottom: 1px solid #e2e8f0;
}

/* ====== 折叠侧边栏 ====== */
.sidebar.collapsed {
    transform: translateX(-100%);
}

.main-content.expanded {
    margin-left: 0;
}

/* ====== 统计卡片 ====== */
.stat-card {
    transition: transform 0.2s, box-shadow 0.2s;
    border-radius: 0.5rem;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.icon-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.bg-primary-light { background: rgba(13,110,253,0.1); }
.bg-success-light { background: rgba(25,135,84,0.1); }
.bg-warning-light { background: rgba(255,193,7,0.1); }
.bg-danger-light { background: rgba(220,53,69,0.1); }

/* ====== 登录页 ====== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    background: white;
    border-radius: 1rem;
    padding: 2.5rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

/* ====== 数据表格 ====== */
.dataTables_wrapper .dataTables_filter input {
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    padding: 0.25rem 0.5rem;
}

.table > thead {
    background: #f8fafc;
}

/* ====== 待办事项 ====== */
.todo-item {
    border-left: 4px solid transparent;
    transition: background 0.2s;
}

.todo-item:hover {
    background: #f8fafc;
}

.todo-item.overdue { border-left-color: var(--bs-danger); }
.todo-item.rectifying { border-left-color: var(--bs-warning); }
.todo-item.pending { border-left-color: var(--bs-info); }
.todo-item.completed { border-left-color: var(--bs-success); }

/* ====== 其他 ====== */
.page-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.card {
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border-radius: 0.5rem;
}

.card-header {
    background: white;
    border-bottom: 1px solid #f1f5f9;
    font-weight: 600;
}

.badge-施工中 {
    background: #fef3c7;
    color: #92400e;
    font-size: 0.7rem;
}

/* ====== 响应式 ====== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.mobile-show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
}
