/*
 * 赛茨ERP - 样式文件
 * 设计原则：大字体、高对比度、清晰分区、易于点击
 */

/* ========== 图片上传拖拽区域 ========== */
.image-drop-zone {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
    margin-bottom: 10px;
}

.image-drop-zone:hover {
    border-color: #3498db;
    background: #f0f8ff;
}

.image-drop-zone.dragover {
    border-color: #27ae60;
    background: #e8f5e9;
    transform: scale(1.02);
}

.drop-zone-content {
    pointer-events: none;
}

.drop-icon {
    font-size: 32px;
    margin-bottom: 8px;
    opacity: 0.6;
}

.drop-text {
    font-size: 14px;
    color: #666;
    margin-bottom: 4px;
}

.drop-hint {
    font-size: 12px;
    color: #999;
}

.preview-box {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.preview-box img {
    max-width: 120px;
    max-height: 90px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 2px;
    background: #fff;
}

/* ========== 全局重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", sans-serif;
    background: #f0f2f5;
    color: #333;
    font-size: 15px;
    line-height: 1.5;
    min-height: 100vh;
}

a { color: #3498db; text-decoration: none; }
a:hover { color: #2980b9; text-decoration: underline; }

/* ========== 登录页 ========== */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    width: 380px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-title {
    text-align: center;
    margin-bottom: 30px;
}

.login-title h1 {
    font-size: 26px;
    color: #2c3e50;
    margin-bottom: 8px;
}

.login-title p {
    color: #7f8c8d;
    font-size: 14px;
}

.big-select {
    font-size: 17px !important;
    padding: 12px 15px !important;
    height: auto !important;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    color: #95a5a6;
}

.btn-block {
    width: 100%;
    padding: 14px !important;
    font-size: 18px !important;
    margin-top: 10px;
}

/* ========== 侧边导航栏 ========== */
.layout-wrap {
    display: flex;
    min-height: calc(100vh - 30px);
}

.sidebar {
    width: 200px;
    min-width: 200px;
    background: #2c3e50;
    color: #fff;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 8px rgba(0,0,0,0.1);
}

.sidebar-brand {
    padding: 16px 14px 10px;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-user {
    padding: 12px 14px;
    font-size: 13px;
    text-align: center;
    color: #bdc3c7;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-menu {
    list-style: none;
    padding: 8px 0;
    margin: 0;
    flex: 1;
}

.sidebar-menu li {
    padding: 0;
    margin: 0;
}

.sidebar-link {
    display: block;
    padding: 10px 16px;
    color: #ecf0f1;
    font-size: 14px;
    text-decoration: none;
    transition: background 0.2s;
}

.sidebar-link:hover {
    background: rgba(255,255,255,0.12);
    text-decoration: none;
    color: #fff;
}

.sidebar-link.active {
    background: rgba(255,255,255,0.15);
    border-left: 3px solid #3498db;
    font-weight: bold;
}

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

.sidebar-logout {
    color: #e74c3c !important;
}

.main-area {
    flex: 1;
    overflow-x: auto;
    padding-bottom: 10px;
}

/* ========== 筛选区域 ========== */
.filter-area select, .filter-area input {
    border: 1px solid #ccc !important;
    border-radius: 4px !important;
    background: #fff;
}
.filter-area select:hover, .filter-area input:hover {
    border-color: #3498db !important;
}
.filter-area .btn-secondary {
    background: #3498db;
}

/* ========== 批量操作栏 ========== */
.batch-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 24px;
    background: #f8f9ff;
    border: 1px solid #e0e0ff;
    border-radius: 6px;
    margin: 0 24px 4px;
    font-size: 13px;
}
.batch-bar .checkbox-label {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    user-select: none;
}
.batch-bar .checkbox-label input[type=checkbox] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}
.checkbox-cell {
    width: 36px;
    text-align: center;
    vertical-align: middle;
}
.checkbox-cell input[type=checkbox] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* ========== 统计卡片 ========== */
.stats-bar {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    flex-wrap: wrap;
}

.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 12px 20px;
    flex: 1;
    min-width: 100px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    font-size: 13px;
    color: #666;
}

.stat-card strong {
    display: block;
    font-size: 28px;
    margin-top: 4px;
}

.stat-total strong { color: #2c3e50; }
.stat-pending strong { color: #e67e22; }
.stat-producing strong { color: #3498db; }
.stat-completed strong { color: #27ae60; }
.stat-shipped strong { color: #8e44ad; }

/* ========== 工具栏 ========== */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    flex-wrap: wrap;
    gap: 10px;
}

.search-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.search-form .form-control {
    min-width: 160px;
}

/* ========== 表格 ========== */
.table-container {
    margin: 0 24px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

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

.order-table th {
    background: #f8f9fa;
    padding: 12px 14px;
    text-align: left;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #e0e0e0;
    white-space: nowrap;
}

.order-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.order-table tr:hover {
    background: #f8f9ff;
}

.order-link {
    font-weight: bold;
    color: #2980b9;
}

.empty-row {
    text-align: center;
    padding: 40px !important;
    color: #999;
    font-size: 16px;
}

.action-cell {
    white-space: nowrap;
}

/* ========== 状态标签 ========== */
.status-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.status-待生产 { background: #fff3e0; color: #e67e22; }
.status-生产中 { background: #e3f2fd; color: #1976d2; }
.status-已完工 { background: #e8f5e9; color: #388e3c; }
.status-已发货 { background: #f3e5f5; color: #7b1fa2; }
.status-拆单发货 { background: #fff8e1; color: #f57f17; }
.status-已退款关闭 { background: #f5f5f5; color: #757575; }

.status-large {
    font-size: 16px;
    padding: 6px 16px;
    border-radius: 16px;
}

/* ========== 分页 ========== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 20px;
}

.page-info {
    font-size: 14px;
    color: #666;
}

/* ========== 按钮 ========== */
.btn {
    display: inline-block;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.2s;
    text-decoration: none;
    text-align: center;
    line-height: 1.4;
}

.btn:hover { text-decoration: none; opacity: 0.9; }

.btn-primary {
    background: #3498db;
    color: #fff;
}

.btn-primary:hover {
    background: #2980b9;
    color: #fff;
}

.btn-secondary {
    background: #95a5a6;
    color: #fff;
}

.btn-secondary:hover {
    background: #7f8c8d;
    color: #fff;
}

.btn-danger {
    background: #e74c3c;
    color: #fff;
}

.btn-danger:hover {
    background: #c0392b;
    color: #fff;
}

.btn-small {
    font-size: 12px;
    padding: 4px 10px;
}

.btn-large {
    font-size: 17px;
    padding: 12px 30px;
}

/* ========== 表单 ========== */
.form-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 12px 18px;
}

.order-form {
    width: 100%;
}

.form-section {
    background: #fff;
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.section-title {
    font-size: 16px;
    margin-bottom: 10px;
    padding-bottom: 4px;
    border-bottom: 2px solid #eee;
}

.form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 150px;
}

.form-group-sm {
    flex: 0 0 100px;
    min-width: 80px;
}

.form-group-wide {
    flex: 2;
    min-width: 200px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    margin-bottom: 2px;
}

.form-control {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    background: #fff;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52,152,219,0.15);
}

textarea.form-control {
    resize: vertical;
    min-height: 36px;
}

select.form-control {
    cursor: pointer;
}

.required {
    color: #e74c3c;
}

.field-hint {
    display: block;
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

.readonly-field {
    padding: 6px 10px;
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 4px;
    font-size: 13px;
    color: #555;
    min-height: 30px;
    line-height: 1.4;
}

.role-hint {
    font-weight: normal;
    font-size: 12px;
    color: #999;
    margin-left: 8px;
}

/* ========== 图片预览 ========== */
.image-preview {
    margin-bottom: 8px;
    display: inline-block;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 4px;
}

.image-preview img {
    max-width: 200px;
    max-height: 150px;
    display: block;
}

.img-download {
    display: block;
    text-align: center;
    font-size: 12px;
    padding: 2px;
    background: #f0f0f0;
}

/* ========== 详情页 ========== */
.detail-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 12px 18px;
}

.detail-status-bar {
    background: #fff;
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.order-no-label {
    font-size: 16px;
    color: #333;
}

.order-time-label {
    font-size: 13px;
    color: #999;
    margin-left: auto;
}

/* ========== 表单操作按钮区 ========== */
.form-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding: 6px 0 16px;
    flex-wrap: wrap;
}

/* ========== 消息提示 ========== */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 16px;
}

.alert-danger {
    background: #ffeaea;
    color: #c0392b;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #e8f4fd;
    color: #1a5276;
    border: 1px solid #b8d4e8;
}

.text-muted {
    color: #999;
}

/* ========== 底部提示 ========== */
.footer-hint {
    text-align: center;
    padding: 16px;
    color: #999;
    font-size: 13px;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-form {
        flex-direction: column;
    }

    .search-form .form-control {
        min-width: auto;
        width: 100%;
    }

    .form-row {
        flex-direction: column;
    }

    .form-group-sm {
        flex: 1;
        min-width: auto;
    }

    .stats-bar .stat-card {
        min-width: calc(50% - 8px);
    }

    .navbar {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .table-container {
        margin: 0 8px;
        overflow-x: auto;
    }

    .detail-page, .form-page {
        padding: 12px;
    }
}

/* ========== 打印隐藏 ========== */
@media print {
    .navbar, .toolbar, .pagination, .footer-hint, .form-actions,
    .no-print, .stats-bar { display: none !important; }
}
