/* 珠宝订单管理系统 - 全局样式 */
:root {
    --primary: #0d6efd;
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --sidebar-active: #0d6efd;
    --font-main: "Microsoft YaHei", "微软雅黑", "PingFang SC", sans-serif;
}

* { box-sizing: border-box; }

body {
    font-family: var(--font-main);
    font-size: 14px;
    margin: 0;
    background: #f1f5f9;
}

/* 顶部导航 */
.topbar {
    background: linear-gradient(135deg, #1e3a5f 0%, #0d6efd 100%);
    color: white;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}
.topbar .brand { font-size: 18px; font-weight: bold; }
.topbar .user-info { font-size: 13px; opacity: 0.9; }

/* 主布局 */
.main-layout { display: flex; min-height: calc(100vh - 50px); }

/* 侧边栏 */
.sidebar {
    width: 200px;
    background: var(--sidebar-bg);
    color: #cbd5e1;
    padding: 15px 0;
    flex-shrink: 0;
}
.sidebar .nav-section {
    padding: 8px 20px 4px;
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 10px;
}
.sidebar .nav-item {
    display: block;
    padding: 10px 20px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}
.sidebar .nav-item:hover {
    background: var(--sidebar-hover);
    color: white;
}
.sidebar .nav-item.active {
    background: var(--sidebar-active);
    color: white;
    border-left-color: #60a5fa;
}

/* 内容区 */
.content {
    flex: 1;
    padding: 20px;
    overflow-x: auto;
}

/* 卡片 */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 16px;
    border: none;
}
.card-header {
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    font-weight: bold;
    font-size: 15px;
    background: #f8fafc;
    border-radius: 8px 8px 0 0;
}
.card-body { padding: 16px; }

/* 表格 */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
    background: #f1f5f9;
    padding: 10px 8px;
    text-align: left;
    font-weight: 600;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}
.table td {
    padding: 8px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.table tr:hover { background: #f8fafc; }

/* 按钮 */
.btn {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s;
    font-family: var(--font-main);
}
.btn-primary { background: #0d6efd; color: white; }
.btn-primary:hover { background: #0b5ed7; }
.btn-success { background: #16a34a; color: white; }
.btn-success:hover { background: #15803d; }
.btn-warning { background: #f59e0b; color: white; }
.btn-warning:hover { background: #d97706; }
.btn-danger { background: #dc2626; color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-secondary { background: #64748b; color: white; }
.btn-secondary:hover { background: #475569; }
.btn-outline { background: white; border: 1px solid #cbd5e1; color: #475569; }
.btn-outline:hover { background: #f1f5f9; }
.btn-sm { padding: 3px 8px; font-size: 12px; }

/* 表单 */
.form-label { display: block; font-size: 13px; color: #475569; margin-bottom: 4px; font-weight: 500; }
.form-control, .form-select {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    font-size: 13px;
    font-family: var(--font-main);
    background: white;
}
.form-control:focus, .form-select:focus {
    outline: none;
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13,110,253,0.15);
}
.form-group { margin-bottom: 12px; }

/* 徽章 */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-processing { background: #dbeafe; color: #1e40af; }
.badge-done { background: #dcfce7; color: #166534; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }
.badge-info { background: #e0f2fe; color: #075985; }

/* 分页 */
.pagination { display: flex; gap: 4px; margin-top: 12px; justify-content: center; }
.pagination button {
    padding: 5px 10px;
    border: 1px solid #cbd5e1;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}
.pagination button.active { background: #0d6efd; color: white; border-color: #0d6efd; }
.pagination button:disabled { opacity: 0.5; cursor: not-allowed; }

/* 模态框 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: flex-start;
    padding: 30px;
    overflow-y: auto;
}
.modal-overlay.show { display: flex; }
.modal {
    background: white;
    border-radius: 10px;
    width: 100%;
    max-width: 900px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.modal-header {
    padding: 14px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h4 { margin: 0; font-size: 16px; }
.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #94a3b8;
}
.modal-body { padding: 20px; max-height: 70vh; overflow-y: auto; }
.modal-footer {
    padding: 12px 20px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* 图片缩略图 */
.thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    cursor: pointer;
}
.thumb-lg {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-card {
    background: white;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.stat-card .stat-value { font-size: 24px; font-weight: bold; color: #0d6efd; }
.stat-card .stat-label { font-size: 12px; color: #64748b; margin-top: 4px; }

/* 响应式 */
@media (max-width: 768px) {
    .sidebar { width: 60px; }
    .sidebar .nav-item span { display: none; }
    .sidebar .nav-section { display: none; }
    .content { padding: 10px; }
}

/* 工具类 */
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: #94a3b8; }
.text-danger { color: #dc2626; }
.text-success { color: #16a34a; }
.mt-2 { margin-top: 8px; }
.mb-2 { margin-bottom: 8px; }
.me-2 { margin-right: 8px; }
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-2 { gap: 8px; }
.fw-bold { font-weight: bold; }
.nowrap { white-space: nowrap; }
