/* ============================================
   新里程供应链 - 工作平台全局样式（暗色主题）
   ============================================ */

:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: #1a1f2e;
    --bg-card-hover: #232a3b;
    --bg-input: #1e2435;
    --bg-sidebar: #0d1220;
    --bg-header: #111827;

    --text-primary: #e5e7eb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --text-accent: #60a5fa;

    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-light: rgba(59, 130, 246, 0.15);
    --accent-green: #10b981;
    --accent-yellow: #f59e0b;
    --accent-red: #ef4444;
    --accent-purple: #8b5cf6;
    --accent-cyan: #06b6d4;

    --border: #1f2937;
    --border-light: #374151;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);

    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    --sidebar-width: 220px;
    --header-height: 56px;

    --transition: all 0.3s ease;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Layout */
.app-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.app-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: var(--transition);
}

.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.app-header {
    height: var(--header-height);
    background: var(--bg-header);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
}

.app-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background: var(--bg-primary);
}

/* Sidebar Logo */
.sidebar-logo {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid var(--border);
    gap: 10px;
}
.sidebar-logo .logo-icon {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, var(--accent), var(--accent-purple));
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-weight: bold; font-size: 16px; color: #fff;
}
.sidebar-logo .logo-text {
    font-size: 15px; font-weight: 600; color: var(--text-primary);
    white-space: nowrap;
}

/* Sidebar Menu */
.sidebar-menu {
    flex: 1; padding: 12px 0; overflow-y: auto;
}
.sidebar-menu .menu-group {
    padding: 0 12px; margin-bottom: 8px;
}
.sidebar-menu .menu-group-title {
    font-size: 11px; color: var(--text-muted); padding: 8px 12px;
    text-transform: uppercase; letter-spacing: 1px;
}
.sidebar-menu .menu-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: var(--radius);
    color: var(--text-secondary); cursor: pointer;
    transition: var(--transition); text-decoration: none;
    font-size: 14px; margin-bottom: 2px;
}
.sidebar-menu .menu-item:hover {
    background: var(--accent-light); color: var(--text-primary);
}
.sidebar-menu .menu-item.active {
    background: var(--accent); color: #fff;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}
.sidebar-menu .menu-item .menu-icon {
    width: 20px; text-align: center; font-size: 16px;
}

/* Header */
.header-left { display: flex; align-items: center; gap: 16px; }
.header-breadcrumb { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); font-size: 14px; }
.header-breadcrumb .sep { color: var(--text-muted); }
.header-right { display: flex; align-items: center; gap: 16px; }
.header-user {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 12px; border-radius: var(--radius);
    cursor: pointer; transition: var(--transition);
}
.header-user:hover { background: var(--bg-card); }
.header-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-purple));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 14px; font-weight: 600;
}
.header-username { font-size: 13px; color: var(--text-primary); }

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: var(--transition);
}
.card:hover { border-color: var(--border-light); }
.card-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px;
}
.card-title { font-size: 15px; font-weight: 600; color: var(--text-primary); }

/* Stat Cards */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    position: relative; overflow: hidden;
    transition: var(--transition);
}
.stat-card:hover { border-color: var(--border-light); transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card .stat-icon {
    width: 44px; height: 44px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; margin-bottom: 12px;
}
.stat-card .stat-value { font-size: 26px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.stat-card .stat-label { font-size: 13px; color: var(--text-secondary); }
.stat-card .stat-trend { font-size: 12px; margin-top: 8px; }
.stat-card .stat-trend.up { color: var(--accent-green); }
.stat-card .stat-trend.down { color: var(--accent-red); }

/* Stat Card Colors */
.stat-card.blue .stat-icon { background: rgba(59, 130, 246, 0.15); color: var(--accent); }
.stat-card.green .stat-icon { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.stat-card.yellow .stat-icon { background: rgba(245, 158, 11, 0.15); color: var(--accent-yellow); }
.stat-card.purple .stat-icon { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }
.stat-card.red .stat-icon { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }
.stat-card.cyan .stat-icon { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); }

/* Charts Grid */
.charts-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 24px; }
.chart-container { height: 300px; }

/* Table */
.data-table-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.data-table {
    width: 100%; border-collapse: collapse;
}
.data-table thead { background: var(--bg-secondary); }
.data-table th {
    padding: 12px 16px; text-align: left;
    font-size: 12px; font-weight: 600;
    color: var(--text-secondary); text-transform: uppercase;
    letter-spacing: 0.5px; border-bottom: 1px solid var(--border);
}
.data-table td {
    padding: 12px 16px; border-bottom: 1px solid var(--border);
    color: var(--text-primary); font-size: 13px;
}
.data-table tbody tr { transition: var(--transition); }
.data-table tbody tr:hover { background: var(--bg-card-hover); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* Tags */
.tag {
    display: inline-flex; align-items: center;
    padding: 2px 8px; border-radius: 4px;
    font-size: 12px; font-weight: 500;
}
.tag.blue { background: rgba(59, 130, 246, 0.15); color: var(--accent); }
.tag.green { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.tag.yellow { background: rgba(245, 158, 11, 0.15); color: var(--accent-yellow); }
.tag.red { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }
.tag.purple { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-card); color: var(--text-primary);
    font-size: 13px; cursor: pointer; transition: var(--transition);
    white-space: nowrap;
}
.btn:hover { background: var(--bg-card-hover); border-color: var(--border-light); }
.btn-primary {
    background: var(--accent); border-color: var(--accent); color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-danger { background: var(--accent-red); border-color: var(--accent-red); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-lg { padding: 10px 24px; font-size: 15px; }

/* Toolbar */
.toolbar {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px; gap: 12px; flex-wrap: wrap;
}
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 8px; }

/* Form */
.form-group { margin-bottom: 16px; }
.form-label {
    display: block; font-size: 13px; color: var(--text-secondary);
    margin-bottom: 6px; font-weight: 500;
}
.form-input, .form-select {
    width: 100%; padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 13px; transition: var(--transition);
    outline: none;
}
.form-input:focus, .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-light); }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right 8px center; background-size: 16px; padding-right: 32px; }
.form-select option { background: var(--bg-card); color: var(--text-primary); }

/* Pagination */
.pagination {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; border-top: 1px solid var(--border);
}
.pagination-info { font-size: 13px; color: var(--text-secondary); }
.pagination-btns { display: flex; gap: 4px; }
.pagination-btns button {
    min-width: 32px; height: 32px; border-radius: 6px;
    border: 1px solid var(--border); background: var(--bg-card);
    color: var(--text-secondary); cursor: pointer;
    font-size: 13px; transition: var(--transition);
}
.pagination-btns button:hover { background: var(--bg-card-hover); }
.pagination-btns button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pagination-btns button:disabled { opacity: 0.4; cursor: not-allowed; }

/* Empty State */
.empty-state {
    text-align: center; padding: 60px 20px; color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.3; }
.empty-state .empty-text { font-size: 14px; }

/* Loading */
.loading-mask {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5); z-index: 9999;
    display: flex; align-items: center; justify-content: center;
}
.loading-spinner {
    width: 40px; height: 40px; border: 3px solid var(--border);
    border-top-color: var(--accent); border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Status Dots */
.status-dot {
    display: inline-block; width: 8px; height: 8px;
    border-radius: 50%; margin-right: 6px;
}
.status-dot.online { background: var(--accent-green); box-shadow: 0 0 6px var(--accent-green); }
.status-dot.offline { background: var(--text-muted); }
.status-dot.warning { background: var(--accent-yellow); }

/* Flex utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.flex-1 { flex: 1; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12px; }
.text-lg { font-size: 16px; }
.font-bold { font-weight: 700; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.p-4 { padding: 16px; }
.w-full { width: 100%; }

/* Responsive */
@media (max-width: 1200px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .charts-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .stat-grid { grid-template-columns: 1fr; }
    .app-sidebar { width: 60px; }
    .sidebar-logo .logo-text,
    .sidebar-menu .menu-group-title,
    .sidebar-menu .menu-item span { display: none; }
    .app-content { padding: 16px; }
}

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}
.login-page::before {
    content: '';
    position: absolute; top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(59, 130, 246, 0.08), transparent 50%),
                radial-gradient(circle at 70% 50%, rgba(139, 92, 246, 0.06), transparent 50%);
    animation: loginBgFloat 20s ease-in-out infinite;
}
@keyframes loginBgFloat {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-2%, 2%); }
}

.login-card {
    width: 400px; padding: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    position: relative; z-index: 1;
    box-shadow: var(--shadow-lg);
}
.login-logo {
    text-align: center; margin-bottom: 32px;
}
.login-logo .logo-circle {
    width: 64px; height: 64px; border-radius: 16px;
    background: linear-gradient(135deg, var(--accent), var(--accent-purple));
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 28px; color: #fff; font-weight: bold;
    margin-bottom: 16px;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}
.login-logo h1 { font-size: 20px; color: var(--text-primary); font-weight: 600; }
.login-logo p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.login-error {
    padding: 8px 12px; background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius); color: var(--accent-red);
    font-size: 13px; margin-bottom: 16px;
    display: none;
}

.login-btn {
    width: 100%; padding: 10px;
    background: linear-gradient(135deg, var(--accent), var(--accent-purple));
    border: none; border-radius: var(--radius);
    color: #fff; font-size: 15px; font-weight: 600;
    cursor: pointer; transition: var(--transition);
}
.login-btn:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4); }
.login-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Dialog/Modal */
.modal-mask {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6); z-index: 1000;
    display: flex; align-items: center; justify-content: center;
}
.modal-dialog {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 24px;
    min-width: 480px; max-width: 90vw;
    box-shadow: var(--shadow-lg);
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px; padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 16px; font-weight: 600; }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 18px; padding: 4px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }

/* Toast */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; }
.toast {
    padding: 12px 20px; border-radius: var(--radius);
    margin-bottom: 8px; font-size: 13px;
    animation: toastIn 0.3s ease;
    box-shadow: var(--shadow);
}
.toast.success { background: var(--accent-green); color: #fff; }
.toast.error { background: var(--accent-red); color: #fff; }
.toast.warning { background: var(--accent-yellow); color: #fff; }
.toast.info { background: var(--accent); color: #fff; }
@keyframes toastIn { from { opacity: 0; transform: translateX(100px); } to { opacity: 1; transform: translateX(0); } }

/* Animate */
.fade-enter-active, .fade-leave-active { transition: opacity 0.3s ease; }
.fade-enter-from, .fade-leave-to { opacity: 0; }

/* Driver Cards */
.driver-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}
.driver-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
}
.driver-card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.driver-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 16px 12px;
    border-left: 3px solid var(--accent);
}
.driver-name { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.driver-plate { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.driver-card-body { padding: 0 16px 16px; }
.driver-info-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 0; font-size: 13px; color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}
.driver-info-row:last-of-type { border-bottom: none; }
.driver-info-label { color: var(--text-muted); }
.driver-stats-row {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 8px; margin-top: 12px; text-align: center;
    padding-top: 12px; border-top: 1px solid var(--border);
}
.driver-stat-value {
    display: block; font-size: 16px; font-weight: 700; color: var(--text-primary);
}
.driver-stat-label {
    display: block; font-size: 11px; color: var(--text-muted); margin-top: 2px;
}

/* Brand Tags */
.brand-tag {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; border-radius: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    font-size: 13px; color: var(--text-primary);
    cursor: pointer; transition: var(--transition);
}
.brand-tag:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}
.brand-type {
    font-size: 11px; color: var(--text-muted);
    background: var(--bg-card);
    padding: 1px 8px; border-radius: 10px;
}

/* Badge */
.badge {
    display: inline-flex; align-items: center;
    padding: 2px 10px; border-radius: 10px;
    font-size: 12px; font-weight: 500; color: #fff;
}
