/**
 * Sales Dashboard Public Styles
 */

/* Checkout: hide "(optional)" labels on all billing fields */
.woocommerce-billing-fields .optional {
    display: none;
}

/* Checkout Carwash Field */
#sales_dashboard_carwash_field {
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #e2e4e7;
    border-radius: 4px;
}

#sales_dashboard_carwash_field h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.2em;
}

/* Dashboard Tables */
.sales-dashboard-orders-table,
.sales-dashboard-carwashes-table {
    width: 100%;
    border-collapse: collapse;
}

.sales-dashboard-orders-table th,
.sales-dashboard-orders-table td,
.sales-dashboard-carwashes-table th,
.sales-dashboard-carwashes-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e5e5e5;
}

.sales-dashboard-orders-table th,
.sales-dashboard-carwashes-table th {
    background: #f7f7f7;
    font-weight: 600;
}

.sales-dashboard-orders-table tr:hover,
.sales-dashboard-carwashes-table tr:hover {
    background: #fafafa;
}

/* Customer Info Box */
.sales-dashboard-customer-info {
    margin-bottom: 2em;
    padding: 1.5em;
    background: #f8f9fa;
    border: 1px solid #e2e4e7;
    border-radius: 4px;
}

.sales-dashboard-customer-info p {
    margin: 0 0 10px;
}

.sales-dashboard-customer-info p:last-child {
    margin-bottom: 0;
}

/* Customer Orders Section */
.sales-dashboard-customer-orders h3 {
    margin-bottom: 1em;
    padding-bottom: 0.5em;
    border-bottom: 2px solid #0073aa;
}

/* My Account Styles */
.woocommerce-account .sales-dashboard-customer-info {
    margin: 1.5em 0;
}

.sales-dashboard-my-customers {
    display: grid;
    gap: 1rem;
}

.sales-dashboard-customers-search {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    align-items: end;
    gap: 0.8rem;
    margin: 0 0 1rem;
    padding: 1rem;
    border: 1px solid #dfe5ed;
    border-radius: 8px;
    background: #f8fafc;
}

.sales-dashboard-search-field {
    display: grid;
    gap: 0.35rem;
    margin: 0;
}

.sales-dashboard-search-field span {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #5d7088;
}

.sales-dashboard-search-field input[type="search"] {
    width: 100%;
    min-height: 44px;
    padding: 0.62rem 0.72rem;
    border: 1px solid #cfd8e4;
    border-radius: 6px;
    background: #fff;
}

.sales-dashboard-search-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.sales-dashboard-clear-button {
    background: #fff;
}

.sales-dashboard-customer-count {
    margin: 0;
    color: #5d7088;
    font-weight: 700;
}

.sales-dashboard-account-header {
    display: grid;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.sales-dashboard-account-header h2 {
    margin-bottom: 0;
}

.sales-dashboard-back-link {
    justify-self: start;
    font-weight: 700;
}

.sales-dashboard-account-table {
    overflow: hidden;
    border: 1px solid #dfe5ed;
    border-radius: 8px;
    background: #fff;
}

.sales-dashboard-account-table th {
    background: #f5f7fa;
    color: #07375d;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sales-dashboard-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 1.25rem;
}

.sales-dashboard-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    min-height: 38px;
    padding: 0.45rem 0.7rem;
    border: 1px solid #d8e0ea;
    border-radius: 6px;
    background: #fff;
    color: #07375d;
    font-weight: 700;
    text-decoration: none;
}

.sales-dashboard-pagination .page-numbers.current {
    border-color: #f27f2f;
    background: #f27f2f;
    color: #fff;
}

.sales-dashboard-pagination .page-numbers.dots {
    border-color: transparent;
    background: transparent;
}

/* Responsive Table */
@media screen and (max-width: 768px) {
    .sales-dashboard-customers-search {
        grid-template-columns: 1fr;
    }

    .sales-dashboard-search-actions {
        align-items: stretch;
    }

    .sales-dashboard-search-actions .button,
    .sales-dashboard-search-actions button {
        flex: 1 1 140px;
    }

    .sales-dashboard-orders-table,
    .sales-dashboard-carwashes-table {
        display: block;
    }

    .sales-dashboard-orders-table thead,
    .sales-dashboard-carwashes-table thead {
        display: none;
    }

    .sales-dashboard-orders-table tbody,
    .sales-dashboard-orders-table tr,
    .sales-dashboard-carwashes-table tbody,
    .sales-dashboard-carwashes-table tr {
        display: block;
    }

    .sales-dashboard-orders-table tr,
    .sales-dashboard-carwashes-table tr {
        margin-bottom: 1em;
        border: 1px solid #e5e5e5;
        border-radius: 4px;
    }

    .sales-dashboard-orders-table td,
    .sales-dashboard-carwashes-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 15px;
        border-bottom: 1px solid #f0f0f0;
    }

    .sales-dashboard-orders-table td:last-child,
    .sales-dashboard-carwashes-table td:last-child {
        border-bottom: none;
    }

    .sales-dashboard-orders-table td::before,
    .sales-dashboard-carwashes-table td::before {
        content: attr(data-title);
        font-weight: 600;
        margin-right: 10px;
    }
}

/* Status Badges */
.sales-dashboard-status {
    display: inline-block;
    padding: 4px 8px;
    font-size: 0.85em;
    border-radius: 3px;
    text-transform: capitalize;
}

.sales-dashboard-status.status-completed {
    background: #c6e1c6;
    color: #5b841b;
}

.sales-dashboard-status.status-processing {
    background: #c6d6e1;
    color: #2e4453;
}

.sales-dashboard-status.status-pending {
    background: #f8dda7;
    color: #94660c;
}

.sales-dashboard-status.status-on-hold {
    background: #f8dda7;
    color: #94660c;
}

.sales-dashboard-status.status-cancelled,
.sales-dashboard-status.status-refunded,
.sales-dashboard-status.status-failed {
    background: #eba3a3;
    color: #761919;
}

/* Empty State */
.sales-dashboard-empty {
    padding: 40px 20px;
    text-align: center;
    background: #f9f9f9;
    border: 1px dashed #ddd;
    border-radius: 4px;
}

.sales-dashboard-empty p {
    margin: 0;
    color: #666;
    font-size: 1.1em;
}
