/* My Orders — icopify.co project buyer tasks */

body.my-orders-page .dashboard-layout {
    display: block;
}

body.my-orders-page .dashboard-main {
    margin-left: 280px;
    width: calc(100% - 280px);
    background: #eef1f6;
    min-height: 100vh;
}

body.my-orders-page .dashboard-header {
    position: fixed;
    top: 0;
    left: 280px;
    right: 0;
    z-index: 250;
    background: #fff;
    justify-content: flex-end;
    min-height: 56px;
}

body.my-orders-page .dashboard-content {
    padding: 76px 28px 48px;
    max-width: 1100px;
}

.orders-breadcrumb {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 22px;
}

.orders-breadcrumb a {
    color: #3b82f6;
    text-decoration: none;
}

.orders-breadcrumb a:hover {
    text-decoration: underline;
}

#ordersBreadcrumbProject {
    color: #e11d48;
}

.orders-service-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin-bottom: 28px;
    border-bottom: none;
}

.orders-service-tab,
.orders-status-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.orders-tab-badge--unread {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
    background: #ef4444;
    color: #fff;
    flex-shrink: 0;
}

.orders-tab-count {
    font-size: 0.8125rem;
    font-weight: 700;
    color: #0f172a;
    flex-shrink: 0;
}

.orders-service-tab.active .orders-tab-count,
.orders-status-tab.active .orders-tab-count {
    color: #0f172a;
}

.orders-service-tab {
    flex: 1 1 0;
    min-width: 140px;
    padding: 12px 16px;
    border: 1px solid #3b5998;
    background: #fff;
    color: #3b5998;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    margin-left: -1px;
}

.orders-service-tab:first-child {
    margin-left: 0;
    border-radius: 4px 0 0 4px;
}

.orders-service-tab:last-child {
    border-radius: 0 4px 4px 0;
}

.orders-service-tab:hover:not(.active) {
    background: #f1f5f9;
}

.orders-service-tab.active {
    background: #3b5998;
    color: #fff;
    border-color: #3b5998;
    position: relative;
    z-index: 1;
}

.orders-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    min-height: 320px;
}

.orders-card-title {
    margin: 0;
    padding: 28px 24px 20px;
    text-align: center;
    font-size: 1.35rem;
    font-weight: 700;
    color: #1e293b;
}

.orders-status-tabs {
    display: flex;
    flex-wrap: wrap;
    margin: 0 24px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    overflow: hidden;
}

.orders-status-tab {
    flex: 1 1 0;
    min-width: 0;
    padding: 11px 8px;
    border: none;
    border-right: 1px solid #cbd5e1;
    background: #fff;
    color: #334155;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.orders-status-tab:last-child {
    border-right: none;
}

.orders-status-tab:hover:not(.active) {
    background: #f8fafc;
}

.orders-status-tab.active {
    background: #3b5998;
    color: #fff;
}

.orders-results {
    padding: 48px 24px 56px;
    min-height: 180px;
}

.orders-empty {
    margin: 0;
    text-align: center;
    color: #64748b;
    font-size: 0.95rem;
}

.orders-table-wrap {
    overflow-x: auto;
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.orders-table th,
.orders-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

/* 覆盖 style.css 全局 td 浅色字，避免白底表格「看起来为空」 */
.orders-table td {
    color: #334155;
}

.orders-table td strong {
    color: #0f172a;
    font-weight: 700;
}

.orders-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.orders-table tbody tr:hover {
    background: #f8fafc;
}

.orders-table .cell-ellipsis {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-not-started { background: #f1f5f9; color: #64748b; }
.status-in-progress { background: #dbeafe; color: #2563eb; }
.status-pending-approval { background: #fef3c7; color: #d97706; }
.status-improvement { background: #e0e7ff; color: #4f46e5; }
.status-completed { background: #dcfce7; color: #16a34a; }
.status-rejected { background: #fee2e2; color: #dc2626; }

.action-btn {
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    color: #475569;
    cursor: pointer;
    font-size: 0.8rem;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.action-btn:hover {
    border-color: #3b82f6;
    color: #2563eb;
}

.st-order-checklist {
    margin: 0;
    padding-left: 18px;
    font-size: 0.875rem;
    color: #334155;
    line-height: 1.55;
}

.st-creator-handle {
    font-size: 0.8rem;
    color: #64748b;
}

.order-detail-section {
    margin-bottom: 24px;
}

.order-detail-section h4 {
    margin-bottom: 12px;
    color: #64748b;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.order-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.order-detail-item {
    padding: 12px;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.order-detail-item label {
    display: block;
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 4px;
}

.order-detail-item span {
    font-weight: 500;
    color: #1e293b;
    word-break: break-word;
}

.order-detail-contact-bar {
    width: 100%;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.order-detail-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    border-top: 1px solid #e2e8f0;
    padding: 16px 20px;
}

.order-detail-footer:not([hidden]) {
    display: flex;
}

.btn-order-approve,
.btn-order-improve,
.btn-order-reject,
.btn-order-refund,
.btn-order-dispute {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 6px;
    border: none;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.btn-order-approve {
    background: #16a34a;
    color: #fff;
}

.btn-order-improve {
    background: #f59e0b;
    color: #fff;
}

.btn-order-refund {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.btn-order-refund:hover {
    background: #fde68a;
}

.order-detail-refund-pending {
    margin: 0;
    font-size: 0.9rem;
    color: #b45309;
}

.btn-order-reject {
    background: #fff;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.btn-order-dispute {
    background: #fff;
    color: #4f46e5;
    border: 1px solid #c7d2fe;
}

.order-detail-dispute-open {
    margin: 4px 0 0;
    font-size: 0.8125rem;
    color: #b45309;
    width: 100%;
}

.order-detail-dispute-open a {
    color: #4f46e5;
}

.order-detail-escrow-hint {
    margin: 4px 0 0;
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.45;
}

@media (min-width: 640px) {
    .order-detail-footer {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }

    .order-detail-escrow-hint {
        flex: 1 1 100%;
    }
}

@media (max-width: 992px) {
    body.my-orders-page .dashboard-main {
        margin-left: 0;
        width: 100%;
    }

    body.my-orders-page .dashboard-header {
        left: 0;
    }

    .orders-service-tab,
    .orders-status-tab {
        font-size: 0.75rem;
        padding: 10px 6px;
    }

    .order-detail-grid {
        grid-template-columns: 1fr;
    }
}
