/* Orders View Styles */

:root {
   --c-green-dark: #707400;
   --c-green-mid: #828b37;
   --c-beige: #f0ebe3;
   --c-white: #ffffff;
}

.orders-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.orders-card {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
}

.orders-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.orders-title {
    font-family: var(--f-title, serif);
    font-size: 1.8rem;
    color: var(--c-green-dark);
}

.orders-date {
    font-family: var(--f-body, sans-serif);
    color: #888;
}

/* Search Bar */
.orders-search {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.orders-search input {
    flex-grow: 1;
    padding: 12px 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: var(--f-body, sans-serif);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.orders-search input:focus {
    border-color: var(--c-green-dark);
    outline: none;
    box-shadow: 0 0 0 3px rgba(112, 116, 0, 0.1);
}

.orders-search button {
    background: var(--c-green-dark);
    color: #fff;
    border: none;
    padding: 0 25px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.orders-search button:hover {
    background: var(--c-green-mid);
}

/* Table Styles */
.orders-table-wrapper {
    overflow-x: auto;
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--f-body, sans-serif);
}

.orders-table th {
    text-align: left;
    padding: 15px;
    background: #fdfdfd;
    color: var(--c-green-dark);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    border-bottom: 2px solid #eee;
}

.orders-table td {
    padding: 20px 15px;
    border-bottom: 1px solid #f5f5f5;
    color: #555;
    font-size: 0.95rem;
}

/* Badges */
.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    text-align: center;
    color: #ffffff !important; /* Force white text globally for badges */
}

.bg-success { background: #198754 !important; }
.bg-warning { background: #ffc107 !important; color: #000000 !important; } /* Keep black for yellow as white is unreadable */
.bg-danger { background: #dc3545 !important; }
.bg-secondary { background: #6c757d !important; }
.bg-primary { background: #0d6efd !important; }

/* Status specific overrides - ensuring white text where appropriate */
.status-badge.PENDING { background: #ffc107 !important; color: #000000 !important; } /* Pending usually warning/yellow */
.status-badge.PAID { background: #198754 !important; }
.status-badge.CANCELLED { background: #dc3545 !important; }
.status-badge.PARTIALLY_PAID { background: #0d6efd !important; }


/* Buttons */
.btn-action {
    width: 35px;
    height: 35px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f5f5f5;
    color: #666;
    margin-right: 5px;
}

.btn-action:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

.btn-action.pay {
    background: var(--c-green-dark);
    color: #fff;
    width: auto;
    padding: 0 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 500;
}

.btn-action.pay:hover {
    background: var(--c-green-mid);
}

/* Mobile Responsive (Card View) */
@media screen and (max-width: 768px) {
    .orders-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .invoice-title {
        font-size: 1.5rem;
    }

    .orders-table thead {
        display: none;
    }

    .orders-table tr {
        display: block;
        background: #fff;
        border: 1px solid #eee;
        border-radius: 12px;
        margin-bottom: 20px;
        padding: 20px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.02);
    }

    .orders-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 0;
        border-bottom: 1px solid #f9f9f9;
        text-align: right;
    }

    .orders-table td:last-child {
        border-bottom: none;
        padding-top: 15px;
        /* justify-content: space-between; Inherited */
        gap: 10px;
    }

    .orders-table td:before {
        content: attr(data-title);
        font-weight: 600;
        color: var(--c-green-dark);
        font-size: 0.85rem;
        text-transform: uppercase;
        text-align: left;
    }
    
    .actions-wrapper {
        display: flex;
        gap: 5px;
    }
    
    .orders-search {
        flex-direction: column;
    }
    
    .orders-search button {
        padding: 12px;
    }
}
