/* 土豆调度管理系统样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f0f2f5; }

#app { display: flex; min-height: 100vh; }

/* 侧边栏 */
.sidebar {
    width: 240px;
    background: linear-gradient(180deg, #1a1f36 0%, #252d4a 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
}

.logo {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo-icon { font-size: 28px; }
.logo-text { font-size: 18px; font-weight: 600; }

.nav-menu { flex: 1; padding: 20px 0; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.2s;
}

.nav-item:hover, .nav-item.active {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.nav-icon { font-size: 18px; width: 24px; text-align: center; }

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.user-info { display: flex; align-items: center; gap: 12px; }

.user-avatar {
    width: 40px;
    height: 40px;
    background: #3b82f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.user-name { font-weight: 500; }
.user-role { font-size: 12px; color: rgba(255,255,255,0.6); }

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: 240px;
    padding: 24px;
}

.page { display: none; }
.page.active { display: block; }

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-header h1 { font-size: 24px; color: #1a1f36; }

.header-actions { display: flex; align-items: center; gap: 16px; }

.update-time { color: #6b7280; font-size: 14px; }

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary { background: #3b82f6; color: #fff; }
.btn-primary:hover { background: #2563eb; }
.btn-secondary { background: #e5e7eb; color: #374151; }
.btn-secondary:hover { background: #d1d5db; }

/* 监控页面 */
.monitor-container { display: flex; gap: 20px; height: calc(100vh - 140px); }

.map-section { flex: 1; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

.map-container { width: 100%; height: 100%; background: #e5e7eb; }

.side-panel {
    width: 320px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.panel-header {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.panel-header h3 { margin-bottom: 8px; }

.status-stats { display: flex; gap: 16px; font-size: 14px; }

.stat-item.online { color: #059669; }
.stat-item.offline { color: #9ca3af; }

.driver-list { flex: 1; overflow-y: auto; }

.driver-card {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
}

.driver-card:hover { background: #f9fafb; }

.driver-card.selected { background: #eff6ff; border-left: 3px solid #3b82f6; }

.driver-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }

.driver-name { font-weight: 500; }
.driver-status { font-size: 12px; padding: 2px 8px; border-radius: 12px; }

.status-online { background: #d1fae5; color: #059669; }
.status-busy { background: #fef3c7; color: #d97706; }
.status-offline { background: #f3f4f6; color: #9ca3af; }

.driver-info { font-size: 12px; color: #6b7280; }

/* 表格 */
.table-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}

.data-table { width: 100%; border-collapse: collapse; }

.data-table th, .data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.data-table th { background: #f9fafb; font-weight: 600; color: #374151; }
.data-table tr:hover { background: #f9fafb; }

.loading { text-align: center; padding: 40px; color: #9ca3af; }

/* 设置页面 */
.settings-container { display: grid; gap: 24px; }

.settings-section {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.settings-section h3 { margin-bottom: 16px; color: #1a1f36; }

.form-group { margin-bottom: 16px; }

.form-group label { display: block; margin-bottom: 6px; font-weight: 500; color: #374151; }

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}

.form-input:focus { outline: none; border-color: #3b82f6; }

.info-card {
    background: #f9fafb;
    border-radius: 8px;
    padding: 16px;
}

.info-card p { margin-bottom: 8px; font-size: 14px; }
.info-card code { background: #e5e7eb; padding: 2px 6px; border-radius: 4px; font-size: 12px; }

/* 响应式 */
@media (max-width: 1024px) {
    .monitor-container { flex-direction: column; }
    .side-panel { width: 100%; height: 300px; }
}
