/* 中山镁意 PO 单下载 - 商务风主题 */
:root {
    --primary: #1f4e79;
    --primary-dark: #16385a;
    --primary-light: #eaf1f8;
    --success: #2e7d32;
    --danger: #c62828;
    --text: #2c3e50;
    --text-muted: #7f8c9b;
    --border: #d9e2ec;
    --bg: #f0f3f7;
    --card-bg: #ffffff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: "Microsoft YaHei", "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
}

/* 顶栏 */
.topbar {
    background: var(--primary);
    color: #fff;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
}
.topbar-brand { font-size: 17px; font-weight: 600; letter-spacing: 1px; }
.topbar-logout { color: #cfe0f1; text-decoration: none; font-size: 13px; }
.topbar-logout:hover { color: #fff; }

.container { max-width: 1200px; margin: 24px auto; padding: 0 16px; }

/* 卡片 */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
}
.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary);
    border-left: 4px solid var(--primary);
    padding-left: 10px;
    margin-bottom: 16px;
}
.card-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.card-header-row .btn { margin: 0; }

/* 筛选区 */
.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}
.filter-item label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.filter-item input[type="text"],
.filter-item select,
.filter-bar-custom select {
    width: 100%;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0 10px;
    background: #fff;
}

/* 自定义日期区间行 */
.filter-bar-custom {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    padding: 10px 12px;
    background: var(--primary-light);
    border-radius: 4px;
}
.filter-bar-custom[hidden] { display: none; }
.filter-bar-custom .filter-label { font-size: 13px; color: var(--primary-dark); }
.date-range { display: flex; align-items: center; gap: 8px; }
.date-range input[type="date"] {
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0 8px;
    background: #fff;
}
.date-sep { color: var(--text-muted); font-size: 13px; }
.btn-secondary {
    background: #fff;
    color: var(--primary);
    border: 1px solid var(--primary);
}
.btn-secondary:hover { background: var(--primary-light); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.filter-actions {
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.search-summary { color: var(--text-muted); font-size: 13px; }

/* 按钮 */
.btn {
    display: inline-block;
    border: none;
    border-radius: 4px;
    padding: 9px 22px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { background: #9db4c9; cursor: not-allowed; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #1b5e20; }
.btn-block { width: 100%; }

/* 表格 */
.table-wrap { overflow-x: auto; }
.order-table { width: 100%; border-collapse: collapse; }
.order-table th, .order-table td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: 13px;
    white-space: nowrap;
}
.order-table th {
    background: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 600;
}
.order-table tbody tr:hover { background: #f7fafd; }
.order-table td.num { text-align: right; }
.badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 12px;
    background: #eef1f4;
    color: var(--text-muted);
}
.badge-urgent { background: #fdecea; color: var(--danger); font-weight: 600; }
.po-number { margin-right: 4px; }

/* 分页栏 */
.pagination-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    flex-wrap: wrap;
}
.page-info { font-size: 13px; color: var(--text-muted); }
.page-jump { font-size: 13px; color: var(--text-muted); }
.page-jump input {
    width: 64px;
    height: 30px;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0 6px;
}
.pagination-bar select {
    height: 30px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: #fff;
    padding: 0 6px;
}
.remark-cell {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-muted);
}

/* 进度条 */
.progress-bar {
    height: 8px;
    background: #e3e9ef;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 14px;
}
.progress-fill {
    height: 100%;
    width: 0;
    background: var(--primary);
    transition: width .3s;
}
.progress-text { margin-top: 8px; font-size: 13px; color: var(--text-muted); }
#progress-area { margin: 14px 0 4px; }
#result-area {
    margin: 16px 0 8px;
    text-align: center;
}

/* 登录页 */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary) 0%, #2d6da3 100%);
}
.login-card {
    width: 380px;
    background: var(--card-bg);
    border-radius: 10px;
    padding: 40px 36px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
.login-header { text-align: center; margin-bottom: 26px; }
.login-logo {
    width: 56px; height: 56px;
    margin: 0 auto 12px;
    background: var(--primary);
    color: #fff;
    border-radius: 12px;
    font-size: 28px;
    line-height: 56px;
    font-weight: 700;
}
.login-header h1 { font-size: 19px; color: var(--text); }
.login-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 6px; }
.login-form .form-group { margin-bottom: 16px; }
.login-form label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.login-form input {
    width: 100%;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0 12px;
    font-size: 14px;
}
.login-form input:focus { outline: none; border-color: var(--primary); }

.alert { padding: 10px 14px; border-radius: 4px; margin-bottom: 16px; font-size: 13px; }
.alert-error { background: #fdecea; color: var(--danger); border: 1px solid #f5c6c2; }

/* Select2 微调 */
.select2-container .select2-selection--multiple {
    min-height: 38px;
    border: 1px solid var(--border);
    border-radius: 4px;
}
.select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: var(--primary);
}
