/* Modern My Orders layout */

.metric-tile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 16px;
    padding: 1.1rem 1.25rem;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
    background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0));
}

.metric-tile .label {
    letter-spacing: 0.02em;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    opacity: 0.8;
}

.metric-tile .metric-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
}

.metric-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.12);
    display: grid;
    place-items: center;
    font-size: 1.4rem;
}

.bg-gradient-success {
    background: linear-gradient(135deg, rgba(var(--bs-success-rgb), 0.14) 0%, rgba(var(--bs-success-rgb), 0.05) 100%);
}

.bg-gradient-info {
    background: linear-gradient(135deg, rgba(var(--bs-info-rgb), 0.14) 0%, rgba(var(--bs-info-rgb), 0.05) 100%);
}

.orders-panel {
    background: var(--bs-body-bg);
    border-radius: 16px;
    border: 1px solid var(--bs-border-color);
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.06);
}

.orders-head {
    display: grid;
    grid-template-columns: 1.4fr 0.6fr 0.9fr 1.3fr 0.8fr;
    gap: 0.5rem;
    padding: 0.95rem 1.25rem;
    background: rgba(var(--bs-secondary-rgb), 0.08);
    color: var(--bs-secondary-color);
    font-weight: 600;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.order-row {
    display: grid;
    grid-template-columns: 1.4fr 0.6fr 0.9fr 1.3fr 0.8fr;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    align-items: center;
    border-bottom: 1px solid var(--bs-border-color);
    transition: background 0.2s ease, transform 0.2s ease;
}

.order-row:last-child { border-bottom: none; }

.order-row:hover {
    background: rgba(var(--bs-secondary-rgb), 0.05);
    transform: translateY(-1px);
}

.order-type .pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.01em;
}

.pill-sell { background: rgba(var(--bs-success-rgb), 0.12); color: var(--bs-success); }
.pill-buy { background: rgba(var(--bs-info-rgb), 0.12); color: var(--bs-info); }

.status-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    border: 1px solid rgba(var(--bs-secondary-rgb), 0.2);
}

.status-chip.success { color: var(--bs-success); border-color: rgba(var(--bs-success-rgb), 0.35); background: rgba(var(--bs-success-rgb), 0.08); }
.status-chip.warning { color: var(--bs-warning); border-color: rgba(var(--bs-warning-rgb), 0.35); background: rgba(var(--bs-warning-rgb), 0.08); }
.status-chip.danger { color: var(--bs-danger); border-color: rgba(var(--bs-danger-rgb), 0.35); background: rgba(var(--bs-danger-rgb), 0.08); }
.status-chip.info { color: var(--bs-info); border-color: rgba(var(--bs-info-rgb), 0.35); background: rgba(var(--bs-info-rgb), 0.08); }

.order-items .value,
.order-total .value {
    font-weight: 700;
    font-size: 1.1rem;
}

.order-items .muted,
.order-total .muted {
    color: var(--bs-secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.75rem;
}

.order-progress-modern {
    position: relative;
    padding: 0.4rem 0.25rem 0.2rem;
}

.order-progress-modern .progress-track {
    position: absolute;
    top: 16px;
    left: 2%;
    right: 2%;
    height: 6px;
    background: rgba(var(--bs-secondary-rgb), 0.25);
    border-radius: 999px;
}

.order-progress-modern .progress-fill {
    position: absolute;
    top: 16px;
    left: 2%;
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(var(--bs-info-rgb), 0.8) 0%, rgba(var(--bs-success-rgb), 0.9) 100%);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
    transition: width 0.25s ease;
}

.order-progress-modern .steps {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0.25rem;
}

.order-progress-modern .step {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--bs-body-bg);
    border: 1px solid rgba(var(--bs-secondary-rgb), 0.35);
    color: var(--bs-secondary-color);
    font-size: 0.95rem;
    z-index: 1;
}

.order-progress-modern .step.done {
    background: rgba(var(--bs-success-rgb), 0.14);
    color: var(--bs-success);
    border-color: rgba(var(--bs-success-rgb), 0.45);
    box-shadow: 0 0 0 2px rgba(var(--bs-success-rgb), 0.12);
}

.order-progress-modern .progress-label {
    margin-top: 0.35rem;
    font-size: 0.85rem;
    color: var(--bs-secondary-color);
    font-weight: 600;
}

.order-action .btn {
    min-width: 88px;
}

@media (max-width: 991.98px) {
    .orders-head { display: none; }
    .order-row {
        grid-template-columns: 1fr;
        gap: 0.65rem;
        border-left: 4px solid transparent;
    }
    .order-row:hover { border-left-color: var(--bs-primary); }
    .order-action { text-align: left !important; }
}

/* Dark mode refinement */
html[data-theme="darkly"] .orders-panel {
    background: rgba(var(--bs-secondary-rgb), 0.12);
    border-color: rgba(var(--bs-border-color-rgb, 200,200,200), 0.35);
}

html[data-theme="darkly"] .order-progress-modern .step {
    background: rgba(20, 20, 20, 0.75);
}
