/* Dayche Profile Blocks - Icons on Right */

.dayche-wrapper {
    width: 100%;
    max-width: 900px;
    margin: 0 auto 80px auto;
    /* Doubled from 40px to 80px */
    padding: 0 15px;
    box-sizing: border-box;
}

/* ============================================
   GRID LAYOUT - WITH INSTALLMENTS
============================================ */
#dayche-profile-nav.has-installments {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr 0.5fr !important;
    grid-template-rows: 90px 60px !important;
    gap: 8px !important;
    direction: rtl;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

/* ============================================
   GRID LAYOUT - WITHOUT INSTALLMENTS
============================================ */
#dayche-profile-nav.no-installments {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    grid-template-rows: 90px 60px !important;
    gap: 8px !important;
    direction: rtl;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

#dayche-profile-nav::before,
#dayche-profile-nav::after {
    display: none !important;
    content: none !important;
}

/* Wrapper to fix spacing issues on raw pages (e.g. Student Profile) */
.dayche-wrapper {
    margin-top: 30px !important;
    margin-bottom: 30px !important;
    width: 100%;
}

/* On WooCommerce Account pages, the theme already adds padding. 
   Remove our extra margin to prevent "Double Spacing". */
body.woocommerce-account .dayche-wrapper {
    margin-top: 0 !important;
}

/* ============================================
   START V11 REFACTOR - ORDERS & SCHEDULED ORDERS
============================================ */

/* --- GLOBAL: ORDERS PAGE HEADER (Arrow & Badge LEFT) --- */
/* Parent Container - Mobile First (Column) */
body .dayche-orders-list .order-main {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    padding: 15px 15px 15px 50px !important;
}



/* Accordion Arrow - Mobile Default (Absolute) */
body .dayche-orders-list .accordion-arrow {
    position: absolute !important;
    left: 15px !important;
    top: 15px !important;
    right: auto !important;
    margin: 0 !important;
    font-size: 1.2em !important;
    color: #9ca3af !important;
}

/* Parent Info Row: Order # + Product (Right Side) */
body .dayche-orders-list .order-info {
    width: 100% !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
    margin-bottom: 8px !important;
    /* Mobile margin */
    font-size: 0.9em !important;
}

body .dayche-orders-list .order-number {
    margin-left: 10px !important;
    font-weight: 700 !important;
    color: #4b5563 !important;
}

body .dayche-orders-list .order-product-highlight {
    font-weight: 900 !important;
    color: #111827 !important;
    margin-left: 8px !important;
}

/* Payment Count Text */
body .dayche-orders-list .payment-count-thin {
    font-size: 0.85em !important;
    color: #6b7280 !important;
    font-weight: 400 !important;
}

/* Parent Meta Row */
body .dayche-orders-list .order-meta {
    width: 100% !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 15px !important;
    flex-wrap: wrap !important;
}

/* Percentage - Push to LEFT of this row */
body .dayche-orders-list .progress-percentage {
    position: static !important;
    /* Back to flow */
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: #e0e7ff;
    /* Indigo-100 */
    color: #4338ca;
    /* Indigo-700 */
    padding: 2px 8px !important;
    border-radius: 6px !important;
    font-weight: 700 !important;
    font-size: 0.9em !important;

    /* MAGIC TO PUSH LEFT IN RTL: */
    /* In RTL, Start is Right. Items stack R->L. */
    /* To push one item to the "End" (Left), we use margin-right: auto */
    margin-right: auto !important;
    order: 99 !important;
    /* Ensure it's visually the last item (Far Left) */
}

/* DESKTOP LAYOUT (Single Line) */
@media screen and (min-width: 769px) {
    body .dayche-orders-list .order-main {
        flex-direction: row !important;
        align-items: center !important;
        padding: 15px !important;
        /* Reset padding */
        justify-content: space-between !important;
        gap: 10px !important;
    }

    /* 1. INFO (Right Side) */
    body .dayche-orders-list .order-info {
        order: 1 !important;
        width: auto !important;
        flex-grow: 1 !important;
        margin-bottom: 0 !important;
    }

    /* 2. META GROUP (Left Side) */
    body .dayche-orders-list .order-meta {
        order: 2 !important;
        width: auto !important;
        display: flex !important;
        align-items: center !important;
        gap: 15px !important;
    }

    /* Meta Items Ordering (R->L): Date, Amount, Status, Percentage */
    body .dayche-orders-list .order-meta .order-date {
        order: 1 !important;
    }

    body .dayche-orders-list .order-meta .order-amount {
        order: 2 !important;
    }

    body .dayche-orders-list .progress-percentage {
        order: 3 !important;
    }

    /* Percentage - Far Left of Meta Group */
    body .dayche-orders-list .order-meta .status-badge {
        position: static !important;
        margin-right: 0 !important;
        margin-left: 0 !important;
        order: 4 !important;
    }

    /* 3. ARROW (Far Left of Main) */
    body .dayche-orders-list .accordion-arrow {
        position: static !important;
        /* Reset Absolute */
        order: 3 !important;
        margin-right: 15px !important;
    }
}

/* --- GLOBAL: SCHEDULED ORDERS COLORS (Overdue vs Future) --- */
/* Default Button (Future/Paid) */
body .dayche-installments-table .dayche-btn-pay {
    background-color: #4b5563 !important;
    /* Dark Grey */
    color: #fff !important;
    transition: all 0.2s ease !important;
}

body .dayche-installments-table .dayche-btn-pay:hover {
    background-color: #374151 !important;
}

/* Overdue Button (Red) */
body .dayche-installments-table tr.status-overdue .dayche-btn-pay {
    background-color: #ef4444 !important;
    /* Red */
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.2) !important;
}

body .dayche-installments-table tr.status-overdue .dayche-btn-pay:hover {
    background-color: #dc2626 !important;
}

/* Overdue Status Badge (Pink) */
body .dayche-installments-table .status-badge.status-overdue {
    background-color: #ffe4e6 !important;
    /* Rose-100 */
    color: #be123c !important;
    /* Rose-700 */
}

/* Overdue Date Text */
body .dayche-installments-table tr.status-overdue td.order-date,
body .dayche-installments-table tr.status-overdue .days-remaining {
    color: #e11d48 !important;
    /* Rose-600 */
}

/* ============================================
   MOBILE SPECIFIC OVERRIDES (Max Width 768px)
============================================ */
@media screen and (max-width: 768px) {

    /* --- ORDERS PAGE CHILD ROWS (Inside Accordion) --- */
    /* Layout: 3 Lines */
    /* Line 1: Order # (Right) + Product (Right next to it) */
    /* Line 2: Date (Right) + Amount (Left) */
    /* Line 3: Status Badge (Center) */

    body .order-children .child-row {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: space-between !important;
        padding: 15px 10px !important;
        border-bottom: 5px solid #f3f4f6 !important;
        gap: 8px !important;
        align-items: center !important;
        position: relative !important;
    }

    /* 1. Order ID (Right) */
    body .order-children .child-id {
        order: 1 !important;
        width: auto !important;
        margin-left: 10px !important;
        position: static !important;
        font-size: 0.85em !important;
        background: #f3f4f6 !important;
        padding: 2px 8px !important;
        border-radius: 6px !important;
    }

    /* 2. Product Name (Right, fills space) */
    body .order-children .child-product {
        order: 2 !important;
        width: auto !important;
        flex-grow: 1 !important;
        text-align: right !important;
        font-weight: 700 !important;
        font-size: 0.9em !important;
        margin: 0 !important;
    }

    /* Line Break after row 1 */
    body .order-children .child-product::after {
        content: "" !important;
        display: block !important;
        width: 100% !important;
        height: 0 !important;
    }

    /* 3. Date (Right side of Line 2) */
    body .order-children .child-date {
        order: 3 !important;
        width: 95% !important;
        text-align: right !important;
        color: #6b7280 !important;
        font-size: 0.85em !important;
        margin-top: 8px !important;
    }

    /* 4. Amount (Left side of Line 2) */
    body .order-children .child-amount {
        order: 4 !important;
        width: 30% !important;
        text-align: right !important;
        font-weight: 700 !important;
        color: #374151 !important;
        margin-top: 8px !important;
    }

    /* 5. Status Badge (Line 3, Centered) */
    body .order-children .status-badge {
        order: 5 !important;
        width: 60% !important;
        /* Good width */
        margin: 12px auto 5px auto !important;
        display: flex !important;
        justify-content: center !important;
    }


    /* --- SCHEDULED ORDERS (Installments) MOBILE CARD --- */
    body .dayche-table-container {
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
        padding: 0 5px !important;
    }

    body .dayche-installments-table tr {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        padding: 10px 12px !important;
        margin: 0 0 10px 0 !important;
        border: 2px solid #e5e7eb !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
        border-radius: 10px !important;
        background: #fff !important;
        gap: 4px !important;
        position: relative !important;
        align-items: center !important;
    }

    /* Overdue Red Styling */
    body .dayche-installments-table tr.status-overdue {
        border: 1px solid #fecaca !important;
        background-color: #fffafa !important;
    }

    body .dayche-installments-table td {
        display: flex !important;
        padding: 1px 0 !important;
        border: none !important;
        background: transparent !important;
        min-height: auto !important;
        box-shadow: none !important;
        align-items: center !important;
        width: auto !important;
    }

    body .dayche-installments-table td::before {
        display: none !important;
    }

    /* Row 1: Product(Grow) + Order#(Left margin auto) */
    body .dayche-installments-table td.order-product {
        order: 1 !important;
        max-width: 75% !important;
        justify-content: flex-start !important;
        text-align: right !important;
        font-weight: 700 !important;
        font-size: 0.9em !important;
        color: #111827 !important;
        margin-left: 6px !important;
    }

    body .dayche-installments-table td.order-number {
        order: 1 !important;
        margin-left: auto !important;
    }

    body .dayche-installments-table .badge-order {
        background-color: #f3f4f6 !important;
        color: #6b7280 !important;
        font-size: 0.85em !important;
        padding: 2px 8px !important;
        border-radius: 6px !important;
        font-weight: 600 !important;
    }

    /* Row 2: Date (Right) + Status (Left) */
    body .dayche-installments-table td.order-date {
        order: 2 !important;
        width: 55% !important;
        justify-content: flex-start !important;
        font-size: 0.9em !important;
        color: #4b5563 !important;
        padding-right: 0 !important;
    }

    body .dayche-installments-table td.order-date .date-main::after {
        content: "|" !important;
        margin: 0 6px !important;
        color: #d1d5db !important;
        font-weight: 300 !important;
    }

    body .dayche-installments-table td.order-status {
        order: 2 !important;
        width: 43% !important;
        justify-content: flex-end !important;
    }

    body .dayche-installments-table .status-badge {
        display: inline-flex !important;
        width: auto !important;
        padding: 3px 10px !important;
        font-size: 0.8rem !important;
        border-radius: 99px !important;
        font-weight: 500 !important;
    }

    body .dayche-installments-table .status-badge.status-future {
        background-color: #f3f4f6 !important;
        color: #6b7280 !important;
    }

    /* Row 3: Amount (Left) */
    body .dayche-installments-table td.order-total {
        order: 3 !important;
        width: 100% !important;
        font-weight: 800 !important;
        color: #111827 !important;
        font-size: 1.1em !important;
        justify-content: flex-end !important;
        margin: 2px 0 6px 0 !important;
    }

    /* Row 4: Button */
    body .dayche-installments-table td.order-actions {
        order: 4 !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        border: none !important;
    }

    body .dayche-btn-pay {
        display: block !important;
        width: 100% !important;
        text-align: center !important;
        padding: 8px 16px !important;
        font-size: 0.95rem !important;
        border-radius: 8px !important;
    }
}

.dayche-nav-item {
    display: flex !important;
    flex-direction: row !important;
    /* Normal row direction */
    justify-content: flex-start !important;
    /* Right-align in RTL */
    align-items: center !important;
    padding: 0 15px !important;
    border-radius: 5px !important;
    text-decoration: none !important;
    transition: all 0.2s ease;
    height: 100% !important;
    box-sizing: border-box !important;
    position: relative !important;
    overflow: hidden !important;
    border: none !important;
    margin: 0 !important;
}

.dayche-nav-item:hover {
    opacity: 0.9;
}

/* Icon - Right side with spacing */
.dayche-nav-icon {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-left: 12px !important;
    /* Space between icon and text */
    margin-right: 0 !important;
    opacity: 0.7 !important;
    flex-shrink: 0 !important;
    color: inherit !important;
}

.dayche-nav-icon .iconify {
    display: block !important;
}

/* Text Content - After icon */
.dayche-nav-content {
    display: flex !important;
    flex-direction: column !important;
    text-align: right !important;
    flex-grow: 0 !important;
}

.dayche-nav-title {
    font-size: 1rem !important;
    font-weight: 500 !important;
    margin: 0 0 3px 0 !important;
    line-height: 1.4 !important;
    display: block !important;
}

.dayche-nav-subtitle {
    font-size: 0.75rem !important;
    opacity: 0.85;
    font-weight: 400 !important;
    margin: 0 !important;
    line-height: 1.3 !important;
    display: block !important;
}

/* ============================================
   COLOR PALETTE
============================================ */

/* ROW 1 (Primary): INACTIVE = #6d737f */
.dayche-nav-item.item-primary {
    background-color: #6d737f !important;
    color: #fff !important;
}

/* ROW 1 (Primary): ACTIVE = Green */
.dayche-nav-item.item-primary.active {
    background-color: #3fa376 !important;
}

/* ROW 2 (Secondary): INACTIVE = #e0e1e5 */
.dayche-nav-item.item-secondary {
    background-color: #e0e1e5 !important;
    color: #5e5e65 !important;
}

.dayche-nav-item.item-secondary .dayche-nav-title {
    color: #5e5e65 !important;
}

.dayche-nav-item.item-secondary .dayche-nav-icon {
    color: #5e5e65 !important;
    opacity: 0.5 !important;
}

/* ROW 2 (Secondary): ACTIVE = Green */
.dayche-nav-item.item-secondary.active {
    background-color: #3fa376 !important;
    color: #fff !important;
}

.dayche-nav-item.item-secondary.active .dayche-nav-title,
.dayche-nav-item.item-secondary.active .dayche-nav-icon {
    color: #fff !important;
}

/* ============================================
   INSTALLMENTS BLOCK - Special Dark Blue
============================================ */
.dayche-nav-item.item-installments {
    grid-column: 4 !important;
    grid-row: 1 / 3 !important;
    background-color: #394762 !important;
    color: #fff !important;
    flex-direction: column !important;
    justify-content: center !important;
    text-align: center !important;
}

.dayche-nav-item.item-installments.active {
    background-color: #3fa376 !important;
}

/* Overdue warning - Red theme */
.dayche-nav-item.item-installments.has-overdue {
    background-color: #c53030 !important;
    animation: pulse-warning 2s infinite;
}

.dayche-nav-item.item-installments.has-overdue .dayche-nav-subtitle {
    font-weight: 600;
}

@keyframes pulse-warning {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.85;
    }
}

.dayche-nav-item.item-installments .dayche-nav-content {
    align-items: center !important;
}

.dayche-nav-item.item-installments .dayche-nav-icon {
    margin-left: 0 !important;
    margin-bottom: 8px !important;
    opacity: 0.8 !important;
}

/* Logout - same as other secondary blocks, no special color */

/* ============================================
   RESPONSIVE
============================================ */
@media (max-width: 900px) {

    #dayche-profile-nav.has-installments,
    #dayche-profile-nav.no-installments {
        grid-template-columns: repeat(2, 1fr) !important;
        grid-template-rows: repeat(4, 70px) !important;
    }

    .dayche-nav-item.item-installments {
        grid-column: auto !important;
        grid-row: auto !important;
        /* Same layout as other blocks on mobile */
        flex-direction: row !important;
        justify-content: flex-start !important;
        text-align: right !important;
    }

    .dayche-nav-item.item-installments .dayche-nav-icon {
        margin-left: 12px !important;
        margin-bottom: 0 !important;
    }

    .dayche-nav-item.item-installments .dayche-nav-content {
        align-items: flex-start !important;
    }
}

@media (max-width: 600px) {

    #dayche-profile-nav.has-installments,
    #dayche-profile-nav.no-installments {
        grid-template-columns: 1fr !important;
        grid-template-rows: repeat(7, 60px) !important;
    }
}

/* Hide WooCommerce default navigation */
.woocommerce-MyAccount-navigation {
    display: none !important;
}

.woocommerce-MyAccount-content {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
}

/* ============================================
   INSTALLMENTS TABLE - Modern Design
============================================ */
.dayche-installments-wrapper {
    direction: rtl;
    margin-top: 20px;
}

.dayche-section-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e1e5;
}

.dayche-table-container {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.dayche-installments-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 0.9rem;
}

.dayche-installments-table thead {
    background: #f5f6f8;
}

.dayche-installments-table th {
    padding: 15px 12px;
    text-align: center;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #e0e1e5;
}

.dayche-installments-table td {
    padding: 14px 12px;
    text-align: center;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

/* Row Colors */
.installment-row.status-future {
    background: #f9f9fa;
    color: #888;
}

.installment-row.status-paid {
    background: #e8f6ef;
    color: #2d7a4f;
}

.installment-row.status-overdue {
    background: #fef2f2;
    color: #c53030;
}

/* Installment Number Badge */
.num-badge {
    display: inline-block;
    min-width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    background: #e0e1e5;
    border-radius: 50%;
    font-weight: 600;
    font-size: 0.85rem;
}

.status-paid .num-badge {
    background: #3fa376;
    color: #fff;
}

.status-overdue .num-badge {
    background: #e53e3e;
    color: #fff;
}

/* Badge order styling - Light highlight */
.badge-order {
    background: #f3f4f6;
    color: #4b5563;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: inherit;
    font-weight: 500;
}

/* Pay Button - Grey style with hover */
.dayche-btn-pay {
    display: inline-block;
    padding: 6px 12px;
    background-color: #f3f4f6;
    /* Light grey */
    color: #4b5563;
    /* Dark grey text */
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9em;
    transition: all 0.2s ease;
    border: 1px solid #e5e7eb;
}

.dayche-btn-pay:hover {
    background-color: #e5e7eb;
    /* Darker grey on hover */
    color: #1f2937;
    border-color: #d1d5db;
}

/* Progress Percentage Badge */
.progress-percentage {
    display: inline-flex;
    align-items: center;
    background: #e0e7ff;
    /* Light indigo */
    color: #4338ca;
    /* Indigo text */
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: bold;
    margin-right: 8px;
}

/* Adjust child row for new columns */
.child-row {
    display: flex;
    /* Ensure flexbox is used */
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    background-color: #fff;
    /* White background by default */
}

.child-row:last-child {
    border-bottom: none;
}

.child-row span {
    margin-left: 15px;
}

.child-row .child-id {
    font-weight: bold;
    color: #666;
    min-width: 60px;
}

/* Product Highlight in Parent Row */
.order-product-highlight {
    font-size: 1.1em;
    font-weight: 700;
    color: #1f2937;
    margin-right: 12px;
    margin-left: 12px;
}

.payment-count-thin {
    font-weight: 400;
    color: #6b7280;
    font-size: 0.9em;
}

/* Overdue Pay Button */
/* Overdue Pay Button */
.dayche-btn-pay.status-overdue {
    background-color: rgba(220, 38, 38, 0.15);
    /* Darker Red bg */
    color: #dc2626;
    /* Darker Red text */
    border-color: rgba(220, 38, 38, 0.3);
    font-weight: 600;
    /* Bold text */
}

.dayche-btn-pay.status-overdue:hover {
    background-color: rgba(220, 38, 38, 0.25);
    border-color: rgba(220, 38, 38, 0.4);
    color: #b91c1c;
}

/* Overdue Order Badge */
.badge-order.status-overdue {
    background-color: rgba(239, 68, 68, 0.1);
    color: #EF4444;
}

/* Order Link */
.order-link {
    display: inline-block;
    padding: 4px 10px;
    background: #f0f1f3;
    border-radius: 4px;
    color: #555;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.order-link:hover {
    background: #e0e1e5;
    color: #333;
}

.status-paid .order-link {
    background: #d4edda;
    color: #2d7a4f;
}

.status-overdue .order-link {
    background: #fde8e8;
    color: #c53030;
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-badge.status-paid {
    background-color: rgba(16, 185, 129, 0.1);
    color: #10B981;
}

.status-badge.status-future {
    background-color: rgba(107, 114, 128, 0.1);
    color: #6B7280;
}

.status-badge.status-overdue {
    background-color: rgba(239, 68, 68, 0.1);
    color: #EF4444;
}

.status-badge.status-inprogress {
    background-color: rgba(107, 114, 128, 0.1);
    /* Grey background */
    color: #6B7280;
    /* Grey text */
}

.status-icon {
    margin-left: 4px;
    font-weight: bold;
}

/* Payment Button - Dark grey, thinner */
.pay-button {
    display: block;
    width: calc(100% - 16px);
    margin: 0 8px;
    padding: 4px 0;
    background: #6d737f;
    color: #fff;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.2s;
    text-align: center;
}

.pay-button:hover {
    background: #5a5f6a;
    color: #fff;
}

.no-action {
    color: #bbb;
}

/* Date column with days remaining */
.col-date {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.date-value {
    font-weight: 500;
}

.days-remaining {
    font-size: 0.75rem;
    color: #888;
}

.status-overdue .days-remaining {
    color: #c53030;
}

.status-paid .days-remaining {
    color: #2d7a4f;
}

/* Pagination */
.dayche-pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.page-btn {
    padding: 8px 16px;
    background: #f0f1f3;
    border-radius: 5px;
    color: #555;
    text-decoration: none;
    transition: all 0.2s;
}

.page-btn:hover {
    background: #e0e1e5;
}

/* Empty Message */
.empty-message {
    text-align: center;
    padding: 40px;
    background: #f9f9fa;
    border-radius: 8px;
}

.shop-link {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 20px;
    background: #3fa376;
    color: #fff;
    border-radius: 5px;
    text-decoration: none;
}

/* Responsive Table - Card Layout on Mobile */
@media (max-width: 768px) {

    .dayche-installments-table {
        display: block;
    }

    .dayche-installments-table thead {
        display: none;
    }

    .dayche-installments-table tbody {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .installment-row {
        display: flex;
        flex-wrap: wrap;
        padding: 10px 12px !important;
        border-radius: 6px;
        border: 1px solid #e0e1e5;
        gap: 6px;
    }

    .dayche-installments-table td {
        display: flex;
        align-items: center;
        padding: 2px 0 !important;
        border: none !important;
        text-align: right !important;
        font-size: 0.85rem;
    }

    /* First row: Number + Order ID + Status */
    .col-num {
        order: 1;
        width: auto;
    }

    .col-id {
        order: 2;
        width: auto;
    }

    .col-status {
        order: 3;
        margin-right: auto;
    }

    /* Second row: Product Name */
    .col-product {
        order: 4;
        width: 100%;
        font-weight: 500;
        font-size: 0.8rem;
        padding-top: 5px !important;
        border-top: 1px solid #eee !important;
    }

    /* Third row: Amount (right) + Date (left) */
    .col-amount {
        order: 5;
        width: auto;
        font-weight: 600;
        text-align: right !important;
    }

    .col-date {
        order: 6;
        width: auto;
        margin-right: auto;
        text-align: left !important;
        justify-content: flex-start !important;
    }

    /* Fourth row: Pay Button */
    .col-actions {
        order: 7;
        width: 100%;
        padding-top: 6px !important;
    }

    .pay-button {
        width: 100%;
        margin: 0;
        padding: 8px 0;
        font-size: 0.8rem;
    }
}

/* ============================================
   ORDERS PAGE - Cards with Accordion
============================================ */

/* Hide WooCommerce default orders table */
.woocommerce-orders-table,
.woocommerce-pagination--without-numbers {
    display: none !important;
}

.dayche-orders-wrapper {
    direction: rtl;
    margin-top: 20px;
}

.dayche-orders-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Order Card */
.order-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    border: 1px solid #e0e1e5;
}

.order-card.status-paid {
    border-right: 4px solid #3fa376;
}

.order-card.status-future {
    border-right: 4px solid #9ca3af;
}

.order-card.status-overdue {
    border-right: 4px solid #e53e3e;
}

/* Order Main Row */
.order-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    gap: 15px;
    flex-wrap: wrap;
}

.order-main.accordion-toggle {
    cursor: pointer;
    transition: background 0.2s;
}

.order-main.accordion-toggle:hover {
    background: #f9fafb;
}

.order-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.order-number {
    flex-shrink: 0;
}

.order-link {
    display: inline-block;
    padding: 4px 10px;
    background: #f0f1f3;
    border-radius: 4px;
    color: #555;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

.order-link:hover {
    background: #e0e1e5;
    color: #333;
}

.order-product {
    color: #555;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 250px;
}

.order-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.order-date {
    color: #666;
    font-size: 0.85rem;
}

.order-amount {
    font-weight: 600;
    color: #333;
}

/* Accordion Arrow */
.accordion-arrow {
    font-size: 0.7rem;
    color: #9ca3af;
    transition: transform 0.3s;
    margin-right: 10px;
}

/* Child Orders Container */
.order-children {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: #f9fafb;
    border-top: 1px solid #e0e1e5;
}

.order-children.open {
    max-height: 1000px;
}

.children-header {
    padding: 10px 16px;
    font-weight: 600;
    font-size: 0.85rem;
    color: #555;
    background: #f3f4f6;
    border-bottom: 1px solid #e0e1e5;
}

/* Child Row */
.child-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px 10px 30px;
    gap: 12px;
    border-bottom: 1px solid #eee;
}

.child-row:last-child {
    border-bottom: none;
}

.child-row.status-paid {
    background: #f0fdf4;
}

.child-row.status-future {
    background: #f9fafb;
}

.child-row.status-overdue {
    background: #fef2f2;
}

.child-num {
    font-weight: 500;
    color: #555;
    min-width: 60px;
}

.child-date {
    color: #666;
    font-size: 0.85rem;
}

.child-amount {
    font-weight: 600;
    color: #333;
    margin-right: auto;
}

/* Mobile Responsiveness moved to v6 block at end of file */

/* All mobile overrides consolidated in v6 block below */

/* ============================================
   LOGIN FORM WRAPPER
   Mimics standard WooCommerce "Boxed" Login
============================================ */
.dayche-login-wrapper {
    max-width: 480px;
    margin: 60px auto;
    padding: 40px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    border: 1px solid #f0f0f1;
}

/* Ensure form inside fits perfectly */
.dayche-login-wrapper .woocommerce-form-login {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

.dayche-login-wrapper .woocommerce-form-login p.form-row {
    margin-bottom: 20px !important;
}

/* Header "Loign" text fix if needed */
.dayche-login-wrapper h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.8rem;
    color: #333;
}