* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    height: 100vh;
    padding: 20px;
    overflow: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

header {
    background: white;
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
}

.nav-links {
    display: flex;
    gap: 10px;
    margin-right: 30px;
}

.nav-links a {
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    color: #666;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.nav-links a:hover {
    background: #e3f2fd;
    color: #1976d2;
}

.nav-links a.active {
    background: #1976d2;
    color: white;
    border-color: #1976d2;
}

/* 用户信息 */
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.user-name {
    color: #666;
    font-size: 14px;
}
.btn-logout {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    color: #666;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
}
.btn-logout:hover {
    border-color: #1976d2;
    color: #1976d2;
}

/* ==================== Dashboard 内容 ==================== */

.main-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-bottom: 20px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.dashboard-header h2 {
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

.dashboard-summary {
    display: flex;
    gap: 16px;
}

.summary-item {
    font-size: 14px;
    color: #666;
    padding: 6px 14px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.summary-item.computed { color: #2e7d32; }
.summary-item.pending { color: #e65100; }

/* 卡片网格 */
.tenant-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.tenant-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: 4px solid #ccc;
}
.tenant-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}
.tenant-card.status-done { border-left-color: #4caf50; }
.tenant-card.status-pending { border-left-color: #ff9800; }

.card-header {
    padding: 16px 20px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.status-badge {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 12px;
    white-space: nowrap;
}
.status-badge.status-done {
    background: #e8f5e9;
    color: #2e7d32;
}
.status-badge.status-pending {
    background: #fff3e0;
    color: #e65100;
}

.card-body { padding: 12px 20px; }

.card-meta {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 13px;
}
.meta-label { color: #999; }
.meta-value { color: #333; font-weight: 500; }
.text-muted { color: #bbb; }

.card-footer {
    padding: 12px 20px;
    display: flex;
    justify-content: flex-end;
    min-height: 48px;
}

.btn-compute {
    display: inline-block;
    padding: 8px 20px;
    background: #1976d2;
    color: white;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s;
}
.btn-compute:hover { background: #1565c0; }

/* 加载 & 空态 */
.loading-indicator {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}
.spinner {
    width: 32px; height: 32px;
    border: 3px solid #e0e0e0;
    border-top-color: #1976d2;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 16px;
}
.error-state {
    text-align: center;
    padding: 40px;
    color: #e53935;
    font-size: 15px;
}

/* 响应式 */
@media (max-width: 768px) {
    .tenant-grid { grid-template-columns: 1fr; }
    .dashboard-header { flex-direction: column; gap: 12px; align-items: flex-start; }
}
