/* ============================================
   下料尺寸页 xiaoliao_data.php 专属样式
   工具栏 / 数据表格 / 弹窗 / 表单
   ============================================ */

/* ===== 工具栏 ===== */
.xl-toolbar {
    display: flex; align-items: center;
    justify-content: space-between; gap: 12px;
    margin-bottom: 16px; flex-wrap: wrap;
}
.xl-search-box {
    display: flex; align-items: center; gap: 8px;
    background: var(--card);
    border: 2px solid var(--border);
    padding: 7px 14px;
    max-width: 340px;
    transition: border-color .2s;
}
.xl-search-box:focus-within { border-color: var(--accent); }
.xl-search-box input {
    border: none; outline: none; font-size: 14px;
    background: transparent; width: 240px; font-family: inherit;
}
.xl-search-box input::placeholder { color: #b0bac9; }
.xl-toolbar-right { display: flex; align-items: center; gap: 10px; }
.xl-count-info { font-size: 13px; color: var(--muted); }
.xl-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 8px 18px; border: 1px solid var(--border);
    font-size: 13.5px; cursor: pointer; font-family: inherit;
    background: var(--card); color: var(--text);
    border-radius: 4px; transition: all .15s; white-space: nowrap;
}
.xl-btn:hover { border-color: #aaa; }
.xl-btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.xl-btn-primary:hover { background: var(--accent-hover); }
.xl-btn-icon { font-size: 17px; line-height: 1; font-weight: 600; }

/* ===== 表格 ===== */
.xl-table-wrap { overflow-x: auto; border: 1px solid var(--border); background: var(--card); border-radius: 3px; }
.xl-table {
    width: 100%; border-collapse: collapse; min-width: 920px;
}
.xl-table thead th {
    background: #f5f6fa; font-size: 12.5px; font-weight: 600;
    text-align: left; padding: 11px 14px;
    border-bottom: 2px solid var(--border); color: var(--dark);
    position: sticky; top: 0; z-index: 2;
}
.xl-table tbody tr { transition: background .12s; }
.xl-table tbody tr:hover { background: #fafbfe; }
.xl-table tbody td {
    padding: 9px 14px; font-size: 13.5px;
    border-bottom: 1px solid #eee; vertical-align: middle;
    color: var(--text);
}
.xl-table tbody tr:last-child td { border-bottom: none; }

/* ===== 操作按钮 ===== */
.xl-action-td { white-space: nowrap; }
.xl-btn-sm {
    padding: 4px 12px; font-size: 12px; cursor: pointer;
    border: 1px solid; border-radius: 3px; font-family: inherit;
    transition: all .15s; margin-right: 6px;
}
.xl-edit-btn { background: #eff6ff; color: #2563eb; border-color: #bfdbfe; }
.xl-edit-btn:hover { background: #dbeafe; border-color: #93c5fd; }
.xl-del-btn { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.xl-del-btn:hover { background: #fee2e2; border-color: #fca5a5; }

/* ===== 空状态 ===== */
.xl-empty-msg { text-align: center; padding: 50px 20px; color: #94a3b8; font-size: 15px; }

/* ===== 弹窗 ===== */
.xl-modal-overlay {
    position: fixed; inset: 0; z-index: 9990;
    background: rgba(15,17,27,.55);
    display: flex; align-items: center; justify-content: center;
}
.xl-modal {
    background: var(--card); border-radius: 6px;
    width: 600px; max-width: 92vw; max-height: 90vh;
    overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.xl-modal-sm { width: 380px; }
.xl-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.xl-modal-header h3 { font-size: 16px; font-weight: 600; color: var(--dark); }
.xl-modal-close {
    width: 30px; height: 30px; line-height: 28px; text-align: center;
    border: 1px solid var(--border); cursor: pointer; font-size: 20px;
    color: var(--muted); background: transparent; border-radius: 3px;
}
.xl-modal-close:hover { border-color: var(--accent); color: var(--accent); }

/* ===== 表单 ===== */
.xl-form-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
    padding: 20px 22px;
}
.xl-form-group.full-width { grid-column: span 2; }
.xl-form-group label {
    display: block; font-size: 12.5px; font-weight: 500;
    color: var(--dark); margin-bottom: 5px;
}
.required { color: var(--accent); }
.xl-form-group input {
    width: 100%; padding: 9px 12px; border: 1.5px solid var(--border);
    border-radius: 4px; font-size: 14px; outline: none;
    font-family: inherit; box-sizing: border-box;
    transition: border-color .15s;
}
.xl-form-group input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(185,28,42,.08); }
.xl-modal-foot {
    display: flex; gap: 10px; justify-content: flex-end;
    padding: 14px 22px 18px; border-top: 1px solid #f0f0f0;
}

/* ===== 下料尺寸响应式 ===== */
@media (max-width: 600px) {
    .xl-toolbar { flex-direction: column; align-items: stretch; }
    .xl-search-box { max-width: none; }
    .xl-search-box input { width: 100%; }
    .xl-toolbar-right { justify-content: space-between; }
    .xl-form-grid { grid-template-columns: 1fr; padding: 16px; }
    .xl-form-group.full-width { grid-column: span 1; }
    .xl-modal { width: 95vw; }
}
