* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", sans-serif;
    background: #f0f2f5;
    overflow: hidden;
}

.top-navbar {
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.navbar-left {
    display: flex;
    align-items: center;
}

.navbar-title {
    font-size: 18px;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-title i {
    font-size: 20px;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.user-name {
    font-size: 13px;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.3);
}

.sidebar {
    position: fixed;
    top: 50px;
    left: 0;
    width: 180px;
    height: calc(100vh - 50px);
    background: white;
    box-shadow: 2px 0 6px rgba(0, 0, 0, 0.04);
    overflow-y: auto;
    z-index: 999;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu-item {
    border-bottom: 1px solid #f5f5f5;
}

.sidebar-menu-item:last-child {
    border-bottom: none;
}

.sidebar-menu-item a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s;
    gap: 10px;
}

.sidebar-menu-item a:hover {
    background: #f8f9fa;
    color: #667eea;
}

.sidebar-menu-item a.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.sidebar-menu-item a i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.sidebar-menu-item a span {
    font-size: 13px;
}

.main-content {
    margin-top: 50px;
    margin-left: 180px;
    padding: 15px;
    height: calc(100vh - 50px);
    overflow-y: auto;
    overflow-x: hidden;
}

.tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    height: 36px;
    padding: 0 10px;
    margin-bottom: 8px;
    overflow-x: auto;
    white-space: nowrap;
}

.tab-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    height: 36px;
    line-height: 36px;
    color: #333;
    cursor: pointer;
    position: relative;
    user-select: none;
}

.tab-item .title {
    font-size: 13px;
}

.tab-item .close {
    font-size: 14px;
    color: #999;
    cursor: pointer;
}

.tab-item .close:hover {
    color: #ff4d4f;
}

.tab-item.active {
    color: #1890ff;
}

.tab-item.active::after {
    content: '';
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: -1px;
    height: 2px;
    background: #1890ff;
    border-radius: 2px;
}

.tab-menu {
    position: absolute;
    display: none;
    background: #fff;
    border: 1px solid #e8e8e8;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    z-index: 2000;
    min-width: 140px;
    border-radius: 6px;
    overflow: hidden;
}

.tab-menu .item {
    padding: 8px 12px;
    font-size: 12px;
    color: #333;
    cursor: pointer;
}

.tab-menu .item:hover {
    background: #f5f5f5;
}

.content-container {
    width: 100%;
    margin: 0 auto;
}

.page-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e8e8e8;
}

.page-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.page-header p {
    font-size: 12px;
    color: #999;
    margin: 3px 0 0 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

.stat-card {
    background: white;
    padding: 12px 15px;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stat-card .icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 8px;
}

.stat-card .label {
    color: #999;
    font-size: 11px;
    margin-bottom: 4px;
}

.stat-card .value {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin-bottom: 3px;
}

.stat-card .trend {
    font-size: 11px;
    color: #666;
}

.stat-card .trend .up {
    color: #52c41a;
}

.stat-card .trend .down {
    color: #ff4d4f;
}

.stat-card.customer .icon { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; }
.stat-card.ad .icon { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); color: white; }
.stat-card.debt .icon { background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%); color: white; }
.stat-card.pending .icon { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); color: white; }

.charts-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

.chart-card {
    background: white;
    padding: 15px;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.chart-card .title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.chart-container {
    height: 220px;
}

.todo-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

.todo-card {
    background: white;
    padding: 15px;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.todo-card .header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.todo-card .header h3 {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.todo-card .header .count {
    background: #f5f7fa;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    color: #666;
}

.todo-card .header .count.warn {
    background: #fff7e6;
    color: #fa8c16;
}

.todo-list {
    max-height: 180px;
    overflow-y: auto;
}

.todo-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: 6px;
    transition: all 0.2s;
    cursor: pointer;
    margin-bottom: 6px;
}

.todo-item:hover {
    background: #f5f7fa;
}

.todo-item:last-child {
    margin-bottom: 0;
}

.todo-item .icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: #f5f7fa;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    flex-shrink: 0;
}

.todo-item .info {
    flex: 1;
}

.todo-item .title {
    font-size: 12px;
    color: #333;
    margin-bottom: 2px;
}

.todo-item .time {
    font-size: 11px;
    color: #999;
}

.todo-item .action {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    color: white;
}

.todo-item .action.view {
    background: #1890ff;
}

.todo-item .action.ocr {
    background: #52c41a;
}

.empty-state {
    text-align: center;
    padding: 30px 15px;
    color: #999;
}

.empty-state i {
    font-size: 36px;
    margin-bottom: 8px;
    display: block;
    opacity: 0.3;
}

.empty-state p {
    font-size: 12px;
}

.loading {
    text-align: center;
    padding: 30px 15px;
}

.loading i {
    font-size: 24px;
    color: #1890ff;
}

.loading p {
    font-size: 12px;
    color: #999;
    margin-top: 8px;
}

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .charts-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .navbar-title {
        font-size: 16px;
    }

    .user-name {
        display: none;
    }

    .sidebar {
        width: 60px;
    }

    .sidebar-menu-item a span {
        display: none;
    }

    .sidebar-menu-item a {
        justify-content: center;
        padding: 12px 8px;
    }

    .sidebar-menu-item a i {
        font-size: 18px;
        width: auto;
    }

    .main-content {
        margin-left: 60px;
        padding: 10px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-card {
        padding: 10px 12px;
    }

    .stat-card .value {
        font-size: 18px;
    }

    .stat-card .icon {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .chart-card {
        padding: 12px;
    }

    .chart-container {
        height: 200px;
    }

    .todo-section {
        grid-template-columns: 1fr;
    }

    .todo-card {
        padding: 12px;
    }

    .todo-list {
        max-height: 150px;
    }
}

@media (max-width: 480px) {
    .top-navbar {
        height: 45px;
        padding: 0 10px;
    }

    .navbar-title {
        font-size: 15px;
    }

    .main-content {
        margin-top: 45px;
        margin-left: 60px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card .value {
        font-size: 20px;
    }

    .page-header {
        margin-bottom: 12px;
    }

    .page-header h2 {
        font-size: 16px;
    }

    .page-header p {
        font-size: 11px;
    }
}
