/* =========================================
   華懋倉庫系統 - 退料頁面專用樣式 (return.css)
   ========================================= */

:root {
    --dt-navy: #1a365d;
    --dt-blue: #1a73e8;
    --dt-red: #d93025;      /* 退料強調色 */
    --dt-red-hover: #b31412;
    --dt-bg: #f0f2f5;
    --card-shadow: 0 1px 3px 0 rgba(60,64,67,0.3), 0 4px 8px 3px rgba(60,64,67,0.15);
    --border-radius: 12px;
}

body {
    background-color: var(--dt-bg);
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: #202124;
    padding-bottom: 60px;
}

/* 頂部導航 (與主頁一致) */
.navbar {
    background: #fff !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.nav-pills-custom {
    gap: 8px;
    justify-content: center;
    padding: 6px;
    background: #f1f3f4;
    border-radius: 50px;
    display: inline-flex;
}

.nav-link-custom {
    border-radius: 30px !important;
    padding: 10px 24px;
    font-weight: 600;
    color: #5f6368;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.nav-link-custom:hover {
    color: var(--dt-blue);
    background-color: rgba(26, 115, 232, 0.08);
}

.nav-link-custom.active {
    background-color: #fff !important;
    color: var(--dt-blue) !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    font-weight: 700;
}

/* 核心卡片容器 */
.card {
    border: none !important;
    border-radius: var(--border-radius) !important;
    box-shadow: var(--card-shadow) !important;
    background: #ffffff;
    overflow: hidden; /* 為了表格圓角 */
}

/* 標題區塊 */
.section-title {
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--dt-navy);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #dadce0;
    padding-bottom: 12px;
}
.section-title i {
    color: var(--dt-red); /* 退料頁面用紅色強調 */
    margin-right: 12px;
    background: #fce8e6; /* 淺紅底 */
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

/* 搜尋輸入框與按鈕 */
#historyName {
    border-radius: 8px 0 0 8px; /* 連接右邊按鈕 */
    border: 1px solid #dadce0;
    font-size: 1.1rem;
}
#historyName:focus {
    border-color: var(--dt-blue);
    box-shadow: none; /* 移除外框光暈，保持簡潔 */
    z-index: 2; /* 浮在最上層 */
}

.btn-primary {
    background-color: var(--dt-blue);
    border: none;
    border-radius: 0 8px 8px 0;
    transition: background 0.2s;
}
.btn-primary:hover {
    background-color: #1557b0;
}

/* 表格樣式優化 */
.table-responsive {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #dadce0;
}
.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dadce0;
    font-weight: 600;
    color: #444;
    padding: 12px 8px;
    white-space: nowrap;
}
.table tbody td {
    padding: 12px 8px;
    vertical-align: middle;
}
.table tbody tr:last-child td {
    border-bottom: none;
}

/* 已領 / 剩餘 數字樣式 */
.table td:nth-child(3) { /* 已領 */
    font-weight: 500;
    color: #5f6368;
}
.table td:nth-child(4) { /* 剩餘 */
    font-weight: bold;
    color: var(--dt-navy);
    background-color: #f0f4f8; /* 淺藍底突顯 */
    border-radius: 4px;
}

/* 退料按鈕 (表格內) */
.btn-outline-danger {
    border-radius: 6px;
    border: 1px solid var(--dt-red);
    color: var(--dt-red);
    font-weight: 600;
    transition: all 0.2s;
}
.btn-outline-danger:hover:not(:disabled) {
    background-color: var(--dt-red);
    color: white;
}
.btn-outline-danger:disabled {
    border-color: #e0e0e0;
    color: #bdbdbd;
    background: transparent;
}

/* Alert 提示框 */
.alert-info {
    background-color: #e8f0fe;
    border: none;
    color: #174ea6;
    border-radius: 8px;
    display: flex;
    align-items: center;
}
.alert-info i {
    font-size: 1.1rem;
}

/* Modal 彈窗樣式 */
.modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.modal-header {
    border-bottom: none;
    padding: 20px 24px;
}
.modal-body {
    padding: 20px 24px;
}
.modal-footer {
    border-top: none;
    padding: 0 24px 24px 24px;
}

/* Modal 內的輸入框 */
#returnQtyInput {
    border: 2px solid #dadce0;
    border-radius: 8px;
    color: var(--dt-red);
}
#returnQtyInput:focus {
    border-color: var(--dt-red);
    box-shadow: 0 0 0 3px rgba(217, 48, 37, 0.15);
}

#returnReasonInput {
    border-radius: 8px;
    resize: none;
}
#returnReasonInput:focus {
    border-color: var(--dt-red);
    box-shadow: 0 0 0 3px rgba(217, 48, 37, 0.15);
}

/* Modal 底部按鈕 */
.modal-footer .btn-danger {
    background-color: var(--dt-red);
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 1.1rem;
}
.modal-footer .btn-danger:hover {
    background-color: var(--dt-red-hover);
}

/* SweetAlert 字體 */
.swal2-popup {
    font-family: 'Segoe UI', Roboto, sans-serif;
    border-radius: 12px;
}

/* RWD 響應式 */
@media (max-width: 576px) {
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }
    .card {
        padding: 1.5rem !important;
    }
    
    /* 搜尋列變垂直 */
    .row.g-2 {
        flex-direction: column;
        gap: 10px !important;
    }
    .col-8, .col-4 {
        width: 100% !important;
    }
    #historyName {
        border-radius: 8px;
    }
    .btn-primary {
        border-radius: 8px;
        padding: 12px;
    }
    
    /* 表格字體縮小 */
    .table {
        font-size: 0.9rem;
    }
    .table thead th, .table tbody td {
        padding: 8px 4px;
    }
}
