/* =========================================
   團購主專區 - 桌面版樣式
   ========================================= */

/* === 團購主專區容器 === */
#leader-portal-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* === 標籤頁樣式 === */
.portal-tabs,
.tab-bar[data-v-be0f379c] {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.portal-tab,
.tab-button {
    padding: 12px 24px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    color: #333;
}

.portal-tab:hover,
.tab-button:hover {
    background: #f5f5f5;
    border-color: #999;
}

.portal-tab.active,
.portal-tab[data-active="true"],
.tab-button.active,
.tab-button[data-active="true"] {
    background: #4f3b2d;
    color: #fff;
    border-color: #4f3b2d;
}

/* === 面板樣式 === */
.portal-panel {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.portal-panel-title {
    font-size: 20px;
    font-weight: 700;
    color: #2f241b;
    margin-bottom: 16px;
}

/* === 表格樣式 === */
.recipient-table,
.order-table,
.cart-table,
table[data-v-d01c8096],
table[data-v-c33c0989],
table[data-v-438c25e4] {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.recipient-table thead,
.order-table thead,
.cart-table thead,
table[data-v-d01c8096] thead,
table[data-v-c33c0989] thead,
table[data-v-438c25e4] thead {
    background: #f8f9fa;
}

.recipient-table th,
.order-table th,
.cart-table th,
table[data-v-d01c8096] th,
table[data-v-c33c0989] th,
table[data-v-438c25e4] th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #4f3b2d;
    border-bottom: 2px solid #e9ecef;
    font-size: 14px;
}

.recipient-table td,
.order-table td,
.cart-table td,
table[data-v-d01c8096] td,
table[data-v-c33c0989] td,
table[data-v-438c25e4] td {
    padding: 12px 16px;
    border-bottom: 1px solid #e9ecef;
    font-size: 14px;
    color: #333;
}

.recipient-table tr:hover,
.order-table tr:hover,
.cart-table tr:hover,
table[data-v-d01c8096] tr:hover,
table[data-v-c33c0989] tr:hover,
table[data-v-438c25e4] tr:hover {
    background: #f8f9fa;
}

/* === 按鈕樣式 === */
.btn-primary,
button.btn-primary {
    background: #4f3b2d;
    color: #fff;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary:hover,
button.btn-primary:hover {
    background: #3d2e22;
    transform: translateY(-1px);
}

.btn-secondary,
button.btn-secondary {
    background: #6c757d;
    color: #fff;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-secondary:hover,
button.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger,
button.btn-danger {
    background: #dc3545;
    color: #fff;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-danger:hover,
button.btn-danger:hover {
    background: #c82333;
}

.btn-success,
button.btn-success {
    background: #28a745;
    color: #fff;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-success:hover,
button.btn-success:hover {
    background: #218838;
}

/* === 表單元素 === */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #4f3b2d;
    box-shadow: 0 0 0 3px rgba(79, 59, 45, 0.1);
}

/* === 常用收件人簿樣式 === */
.recipient-intro {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.recipient-intro h3 {
    margin: 0 0 8px 0;
    color: #2f241b;
    font-size: 18px;
}

.recipient-intro p {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
}

/* === Checkbox 樣式 === */
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* === 操作按鈕群組 === */
.action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* === 狀態標籤 === */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.pending {
    background: #fff3cd;
    color: #856404;
}

.status-badge.completed {
    background: #d4edda;
    color: #155724;
}

.status-badge.cancelled {
    background: #f8d7da;
    color: #721c24;
}

/* === 空狀態樣式 === */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* === 載入中樣式 === */
.loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4f3b2d;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* === 響應式設計 - 平板 === */
@media (max-width: 1024px) {
    #leader-portal-section {
        padding: 16px;
    }

    .portal-panel {
        padding: 20px;
    }
}

/* === 響應式設計 - 手機版 === */
@media (max-width: 768px) {
    .portal-tabs,
    .tab-bar[data-v-be0f379c] {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .portal-panel {
        padding: 16px;
        border-radius: 8px;
    }

    .portal-panel-title {
        font-size: 18px;
    }

    /* 手機版表格卡片式顯示 */
    .recipient-table,
    .order-table,
    .cart-table,
    table[data-v-d01c8096],
    table[data-v-c33c0989],
    table[data-v-438c25e4] {
        display: block;
    }

    .recipient-table thead,
    .order-table thead,
    .cart-table thead,
    table[data-v-d01c8096] thead,
    table[data-v-c33c0989] thead,
    table[data-v-438c25e4] thead {
        display: none;
    }

    .recipient-table tbody,
    .order-table tbody,
    .cart-table tbody,
    table[data-v-d01c8096] tbody,
    table[data-v-c33c0989] tbody,
    table[data-v-438c25e4] tbody {
        display: block;
    }

    .recipient-table tr,
    .order-table tr,
    .cart-table tr,
    table[data-v-d01c8096] tr,
    table[data-v-c33c0989] tr,
    table[data-v-438c25e4] tr {
        display: block;
        margin-bottom: 16px;
        border: 1px solid #e9ecef;
        border-radius: 8px;
        padding: 12px;
        background: #fff;
    }

    .recipient-table td,
    .order-table td,
    .cart-table td,
    table[data-v-d01c8096] td,
    table[data-v-c33c0989] td,
    table[data-v-438c25e4] td {
        display: block;
        border: none;
        padding: 8px 0;
        text-align: left;
    }

    .recipient-table td::before,
    .order-table td::before,
    .cart-table td::before,
    table[data-v-d01c8096] td::before,
    table[data-v-c33c0989] td::before,
    table[data-v-438c25e4] td::before {
        content: attr(data-label);
        display: inline-block;
        font-weight: 600;
        color: #4f3b2d;
        margin-right: 8px;
        min-width: 80px;
    }

    .action-buttons {
        flex-wrap: wrap;
    }
}
