/* === PUBLIC STORE LOCATOR STYLES === */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400&family=Cormorant+Garamond:wght@600&family=Poppins:wght@400;500;600&display=swap');

.rms-stores-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 15px;
    font-family: 'Poppins', sans-serif;
    color: #333;
}

.rms-stores-header {
    text-align: center;
    margin-bottom: 40px;
}

.rms-stores-header h2 {
    font-family: 'Cinzel', serif;
    font-size: 30px;
    font-weight: 400;
    color: #1E3A2E;
    margin: 0 0 10px 0;
    text-transform: uppercase;
    line-height: 1;
    white-space: nowrap;
}

.rms-stores-header p {
    font-size: clamp(14px, 2.5vw, 16px);
    color: #666;
    margin: 0;
    max-width: 34rem;
    margin-left: auto;
    margin-right: auto;
}

.rms-search-form {
    margin-bottom: 40px;
}

#rms-city-search {
    display: block;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding: 15px 20px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: all 0.2s ease-in-out;
}

#rms-city-search:focus {
    outline: none;
    border-color: #0d4a37;
    box-shadow: 0 0 0 4px rgba(13, 74, 55, 0.1);
}

.rms-directory-stores {
    border-radius: 18px;
    padding: 40px 32px;
}

.rms-directory-stores-status {
    text-align: center;
    font-size: 14px;
    color: #0d4a37;
    min-height: 18px;
    margin-bottom: 24px;
}

.rms-directory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 26px;
}

p.rms-no-stores-found, p.rms-no-stock {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #777;
    font-size: 16px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

/* === HOMEPAGE FEATURED STORES === */
.rms-home-stores {
    max-width: 1200px;
    margin: 24px auto;
    padding: 0 20px;
    font-family: 'Poppins', sans-serif;
}

.rms-home-stores-inner {
    border-radius: 18px;
    padding: 32px 32px;
}

.rms-home-stores-title {
    font-family: 'Cinzel', serif;
    font-size: 30px;
    font-weight: 400;
    color: #1E3A2E;
    text-align: center;
    margin: 0 0 10px 0;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
}

.rms-home-stores-subtitle {
    text-align: center;
    color: #666;
    font-size: clamp(13px, 2.4vw, 15px);
    margin: 0 0 30px 0;
    max-width: 32rem;
    margin-left: auto;
    margin-right: auto;
}

.rms-home-stores-status {
    text-align: center;
    font-size: 14px;
    color: #0d4a37;
    min-height: 18px;
    margin-bottom: 24px;
}

.rms-home-stores-grid,
.rms-directory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 28px;
    justify-content: center;
    justify-items: center;
    align-items: stretch;
    padding: 10px 0;
}

.rms-home-store-card,
.rms-store-card {
    background: #ffffff;
    border: 1px solid #e0ebe5;
    border-radius: 18px;
    padding: 28px 26px;
    box-shadow: 0 18px 36px rgba(13, 74, 55, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    max-width: 340px;
    min-height: 0;
    gap: 18px;
    box-sizing: border-box;
}

.rms-home-store-card:hover,
.rms-store-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 44px rgba(13, 74, 55, 0.16);
}

.rms-home-store-name,
.rms-store-card-name {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(18px, 3vw, 22px);
    font-weight: 600;
    color: #111;
    margin: 0;
}

.rms-store-card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    flex: 1 1 auto;
    text-align: center;
}

.rms-home-store-location,
.rms-store-card-location {
    font-size: clamp(13px, 2.6vw, 14px);
    color: #555;
    margin: 0;
    line-height: 1.4;
    text-align: center;
}

.rms-home-store-distance,
.rms-store-card-distance {
    font-size: 12px;
    font-weight: 600;
    color: #1f7a54;
    margin: 4px 0 0;
    text-align: center;
    background: #e6f3ee;
    padding: 4px 10px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    align-self: center;
}

.rms-store-card-contact-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    width: 100%;
    text-align: center;
}

.rms-store-card-contact-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.rms-store-card-contact-link-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #e6f3ee;
    color: #0d4a37;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 10px 22px rgba(13, 74, 55, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.rms-store-card-contact-link-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 32px rgba(13, 74, 55, 0.18);
    background: #0d4a37;
    color: #ffffff;
}

.rms-store-card-contact-icon {
    width: 22px;
    height: 22px;
    display: block;
}

.rms-store-card-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    width: 100%;
    flex-wrap: wrap;
}

.rms-store-card-action-link {
    font-weight: 600;
    font-size: 0.95rem;
    color: #0d4a37;
    text-decoration: none;
    padding-bottom: 2px;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: color 0.2s ease, border-color 0.2s ease;
    text-align: center;
}

.rms-store-card-action-link:focus {
    outline: 3px solid rgba(31, 138, 99, 0.35);
    outline-offset: 2px;
}

.rms-store-card-action-link:hover {
    color: #0a3a2b;
    border-bottom-color: rgba(13, 74, 55, 0.4);
}

.rms-store-card-directions-link {
    color: #176a4c;
}

.rms-store-card-directions-link:hover {
    color: #0f4c35;
    border-bottom-color: rgba(15, 76, 53, 0.4);
}

.rms-store-card.is-active {
    border-color: #1f8a63;
    box-shadow: 0 18px 38px rgba(31, 138, 99, 0.18);
}

.rms-store-details-shortcode {
    width: 100%;
}

.rms-store-details-title {
    font-family: 'Cinzel', serif;
    font-size: 30px;
    font-weight: 400;
    color: #1E3A2E;
    margin-bottom: 24px;
    text-align: center;
    text-transform: uppercase;
    line-height: 1;
    white-space: nowrap;
}

@media (max-width: 1024px) {
    .rms-stores-header h2,
    .rms-home-stores-title,
    .rms-store-details-title {
        font-size: 25px;
    }
}

@media (max-width: 640px) {
    .rms-stores-header h2,
    .rms-home-stores-title,
    .rms-store-details-title {
        font-size: 20px;
    }

}

.rms-single-store-details {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px 32px;
    font-family: 'Poppins', sans-serif;
    color: #10271f;
}

.rms-single-store-card {
    background: #ffffff;
    border: 1px solid #dfe8e3;
    border-radius: 24px;
    box-shadow: 0 28px 56px rgba(13, 74, 55, 0.12);
    padding: clamp(28px, 4vw, 44px);
    display: flex;
    flex-direction: column;
    gap: clamp(22px, 4vw, 36px);
}

.rms-single-store-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
}

.rms-single-store-heading {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rms-single-store-name {
    margin: 0;
    color: #0d4a37;
    font-weight: 700;
    font-size: clamp(1.9rem, 4vw, 2.6rem);
    line-height: 1.15;
}

.rms-single-store-address {
    margin: 0;
    color: #31463d;
    font-size: clamp(1rem, 2.6vw, 1.1rem);
    line-height: 1.6;
}

.rms-single-store-distance {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    background: rgba(13, 74, 55, 0.12);
    color: #0d4a37;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.rms-single-store-content {
    display: grid;
    gap: clamp(18px, 3vw, 28px);
}

.rms-single-store-section {
    background: #f5f9f7;
    border-radius: 20px;
    padding: clamp(18px, 3vw, 24px);
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.rms-single-store-section-title {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #0d4a37;
}

.rms-single-store-meta {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rms-single-store-meta li {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 16px;
    align-items: center;
}

.rms-single-store-meta-label {
    font-weight: 600;
    color: #0d4a37;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.rms-single-store-meta-value {
    font-weight: 600;
    color: #16352a;
    font-size: 1rem;
}

.rms-single-store-meta-value a {
    color: #0d4a37;
    text-decoration: none;
    border-bottom: 1px solid rgba(13, 74, 55, 0.2);
    transition: color 0.2s ease, border-color 0.2s ease;
}

.rms-single-store-meta-value a:hover {
    color: #0a3a2b;
    border-bottom-color: #0a3a2b;
}

.rms-single-store-description-text {
    margin: 0;
    color: #3a5246;
    font-size: 0.98rem;
    line-height: 1.7;
}

.rms-single-store-products {
    background: #ffffff;
    border: 1px solid rgba(13, 74, 55, 0.08);
    box-shadow: none;
}

.rms-single-store-product-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rms-single-store-product-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(49, 70, 61, 0.1);
    font-size: 0.96rem;
    color: #31463d;
}

.rms-single-store-product-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.rms-single-store-product-name {
    font-weight: 600;
    letter-spacing: 0.02em;
}

.rms-single-store-product-qty {
    min-width: 40px;
    padding: 4px 12px;
    border-radius: 999px;
    background: #0d4a37;
    color: #ffffff;
    font-weight: 600;
    text-align: center;
}

.rms-single-store-products-empty {
    text-align: center;
    color: #4a6358;
    align-items: center;
}

.rms-single-store-products-empty p {
    margin: 0;
}

.rms-single-store-actions {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.rms-single-store-action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-decoration: none;
    box-shadow: 0 16px 32px rgba(13, 74, 55, 0.18);
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
    background: rgba(13, 74, 55, 0.92);
    color: #ffffff;
    width: 100%;
    font-size: 0.95rem;
}

.rms-single-store-action-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 36px rgba(13, 74, 55, 0.24);
    background: #0d4a37;
}

.rms-single-store-action-call {
    background: rgba(13, 74, 55, 0.95);
}

.rms-single-store-action-call:hover {
    background: #0a3a2b;
}

.rms-single-store-action-whatsapp {
    background: rgba(13, 74, 55, 0.85);
}

.rms-single-store-action-whatsapp:hover {
    background: #0b3f2e;
}

.rms-single-store-action-directions {
    background: rgba(13, 74, 55, 0.9);
}

.rms-single-store-action-directions:hover {
    background: #0b3f2e;
    color: #ffffff;
}

.rms-single-store-details-placeholder {
    margin-top: 16px;
    border: 1px dashed #cddbd4;
    border-radius: 16px;
    padding: 48px 24px;
    text-align: center;
    color: #4a6358;
    font-size: 1rem;
}

@media (min-width: 720px) {
    .rms-single-store-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
    }

    .rms-single-store-distance {
        align-self: flex-start;
    }

    .rms-single-store-content {
        grid-template-columns: repeat(12, minmax(0, 1fr));
        gap: 24px;
    }

    .rms-single-store-section {
        grid-column: span 6;
    }

    .rms-single-store-description,
    .rms-single-store-products {
        grid-column: span 12;
    }
}

@media (max-width: 540px) {
    .rms-single-store-details {
        padding: 0 16px 28px;
    }

    .rms-single-store-action-link {
        font-size: 0.9rem;
        padding: 0.7rem 1.25rem;
    }

    .rms-single-store-meta li {
        flex-direction: column;
        align-items: flex-start;
    }

    .rms-single-store-distance {
        font-size: 0.78rem;
    }
}

.rms-store-details-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
}

.rms-store-details-list {
    flex: 1 1 55%;
}

.rms-store-details-panel {
    flex: 1 1 35%;
    background: #f5f9f7;
    border-radius: 24px;
    padding: 28px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
    min-height: 260px;
}

.rms-store-details-panel-inner {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.rms-store-details-placeholder {
    margin: 0;
    color: #4a6358;
    font-size: 1rem;
}

.rms-store-details-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 18px;
}

.rms-store-details-name {
    font-size: 1.7rem;
    margin: 0;
    color: #0d4a37;
    text-align: center;
    line-height: 1.2;
    font-weight: 600;
}

.rms-store-details-address {
    margin: 0;
    color: #31463d;
    font-size: 1rem;
    text-align: center;
}

.rms-screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.rms-home-stores-footer {
    margin-top: 35px;
    text-align: center;
}

.rms-view-all-stores {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #0d4a37;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    padding-bottom: 4px;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.rms-view-all-stores:hover {
    color: #0a3a2b;
    border-bottom-color: rgba(13, 74, 55, 0.4);
}

@media (max-width: 1024px) {
    .rms-store-details-layout {
        flex-direction: column;
    }

    .rms-store-details-panel,
    .rms-store-details-list {
        flex: 1 1 100%;
    }
}

.rms-home-stores-empty {
    grid-column: 1 / -1;
    text-align: center;
    background: #f1f4f3;
    border-radius: 14px;
    padding: 42px 20px;
    color: #666;
    font-size: 15px;
}

@media (max-width: 768px) {
    .rms-home-stores-inner {
        padding: 24px 20px;
    }

    .rms-home-store-card,
    .rms-store-card {
        padding: 20px 18px;
        max-width: 100%;
        min-height: auto;
    }

    .rms-home-stores-grid,
    .rms-directory-grid {
        gap: 20px;
    }

    .rms-store-card-actions {
        gap: 14px;
    }

    .rms-store-card-action-link {
        font-size: 0.9rem;
    }

    .rms-single-store-card {
        padding: 24px;
    }
}

@media (max-width: 540px) {
    .rms-store-card-actions {
        gap: 12px;
    }

    .rms-store-card-action-link {
        font-size: 0.85rem;
    }

    .rms-single-store-actions {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .rms-single-store-action-link {
        width: 100%;
        max-width: 320px;
    }

    .rms-single-store-card {
        padding: 20px;
    }
}


/* === RETAILER DASHBOARD STYLES (v3.7 - Finalest Mobile Date Filter Fix) === */

#rms-plugin-dashboard-wrapper.rms-dashboard-redesigned {
    font-family: 'Poppins', sans-serif;
    color: #333;
    margin: 20px auto;
    padding: 0 10px;
    background-color: #f9f9f9;
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}

#rms-plugin-dashboard-wrapper * {
    box-sizing: border-box;
}

/* Tabs */
.rms-dashboard-redesigned .rms-tabs {
    display: flex;
    justify-content: flex-start;
    background-color: #ffffff;
    padding: 0;
    border-bottom: 1px solid #eaeaea;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    border-radius: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.rms-dashboard-redesigned .rms-tabs::-webkit-scrollbar { display: none; }

.rms-dashboard-redesigned .rms-tabs ul {
    list-style: none; padding: 0; margin: 0; display: flex; gap: 0;
    width: 100%;
    justify-content: space-around;
}
.rms-dashboard-redesigned .rms-tabs li { margin: 0; flex-shrink: 0; text-align: center;}
.rms-dashboard-redesigned .rms-tabs li a {
    display: block;
    padding: 12px 10px;
    text-decoration: none; color: #555;
    border-bottom: 3px solid transparent;
    font-weight: 500; font-size: 13px;
    white-space: nowrap; transition: all 0.2s ease-in-out;
}
.rms-dashboard-redesigned .rms-tabs li.active a,
.rms-dashboard-redesigned .rms-tabs li a:hover {
    color: #0d4a37; border-bottom-color: #0d4a37; background-color: #fdfdfd;
}

/* Tab Content Wrapper */
.rms-dashboard-redesigned .rms-dashboard-content {
    padding: 0; background-color: #ffffff;
    border: 1px solid #eaeaea; border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.06);
    overflow: hidden;
}
.rms-dashboard-redesigned .rms-tab-content {
    display: none; animation: fadeIn 0.5s;
    padding: 20px;
}
.rms-dashboard-redesigned .rms-tab-content.active { display: block; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Form Layout */
#rms-record-sale-form .rms-form-grid {
    display: grid; grid-template-columns: 1fr; gap: 12px;
}
#rms-record-sale-form .rms-form-group { display: flex; flex-direction: column; }
#rms-record-sale-form .rms-form-group.full-width { grid-column: 1 / -1; }

/* Input Styles */
#rms-record-sale-form input,
#rms-record-sale-form select {
    width: 100%; padding: 12px; border: 1px solid #dcdcdc; border-radius: 6px;
    font-size: 14px; background-color: #ffffff;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none; -moz-appearance: none; appearance: none;
}
#rms-record-sale-form select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23555' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708 .708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
    background-size: 14px 14px; cursor: pointer;
}
#rms-record-sale-form input:focus,
#rms-record-sale-form select:focus {
    outline: none; border-color: #0d4a37; box-shadow: 0 0 0 3px rgba(13, 74, 55, 0.1);
}
#rms-record-sale-form input:disabled {
    background-color: #f5f5f5; color: #777;
    cursor: not-allowed; border-color: #eaeaea;
    -webkit-text-fill-color: #777; opacity: 1;
}
/* Placeholder color and size */
#rms-record-sale-form ::-webkit-input-placeholder { color: #aaa; font-size: 13px; }
#rms-record-sale-form ::-moz-placeholder { color: #aaa; font-size: 13px; opacity: 1;}
#rms-record-sale-form :-ms-input-placeholder { color: #aaa !important; font-size: 13px;}
#rms-record-sale-form ::placeholder { color: #aaa; font-size: 13px; }

/* Form Footer */
.rms-form-footer {
    display: flex; flex-direction: column; align-items: stretch;
    background-color: transparent; border-radius: 0; padding: 0;
    margin-top: 20px; border: none;
}
.rms-total-display {
    font-size: 20px; font-weight: 600; color: #111; margin-bottom: 15px; text-align: center;
}
.rms-total-display span { color: #0d4a37; margin-left: 5px; }
#rms-submit-sale.rms-button {
    width: 100%; max-width: none; background-color: #0d4a37;
    color: #fff; padding: 14px; font-size: 15px; font-weight: 600; border: none; border-radius: 6px;
    cursor: pointer; transition: background-color 0.2s;
}
#rms-submit-sale.rms-button:hover { background-color: #083326; }

/* Feedback Div */
#rms-sale-feedback, #rms-sale-feedback-history {
    padding: 12px 15px; margin-bottom: 15px; border-radius: 6px; display: none;
    border: 1px solid transparent; font-size: 13px;
}
#rms-sale-feedback p, #rms-sale-feedback-history p { margin: 0; font-weight: 500; }
#rms-sale-feedback.success, #rms-sale-feedback-history.success {
    background-color: rgba(13, 74, 55, 0.1); border-color: rgba(13, 74, 55, 0.2); color: #0d4a37;
}
#rms-sale-feedback.error, #rms-sale-feedback-history.error {
    background-color: rgba(220, 53, 69, 0.1); border-color: rgba(220, 53, 69, 0.2); color: #dc3545;
}

/* Table Styles */
.rms-table {
    border-collapse: collapse; width: 100%; margin: 0;
    border: none; border-radius: 0; overflow: hidden;
}
.rms-table thead { display: none; } /* Hidden on mobile */
.rms-table thead tr { background-color: #333; }
.rms-table th { /* This applies to thead th on desktop */
    padding: 12px 15px; font-size: 13px; font-weight: 600; color: #fff;
    text-align: left; text-transform: uppercase; letter-spacing: 0.5px;
    background-color: #333; /* Ensure background is dark */
}
/* Mobile History Card */
#tab-sales-history .rms-table tr {
    display: block; background: #fff; border: 1px solid #eaeaea;
    border-radius: 6px; margin-bottom: 8px;
    padding: 8px 10px;
}
/* Mobile Stock Card */
#tab-stock-overview .rms-table tr {
     display: block; background: #fff; border: 1px solid #eaeaea;
    border-radius: 6px; margin-bottom: 8px;
    padding: 6px 10px;
}
.rms-table .rms-no-results {
    border: 1px solid #eaeaea; border-radius: 6px; padding: 15px;
    text-align: center; color: #777; margin-bottom: 8px;
}
/* Mobile History Cell */
#tab-sales-history .rms-table td {
    display: flex; justify-content: space-between; align-items: center;
    padding: 4px 0; border: none !important; text-align: right;
    font-size: 12px; color: #333; border-bottom: 1px dashed #eee;
}
/* Mobile Stock Cell */
#tab-stock-overview .rms-table td {
     display: flex; justify-content: space-between; align-items: center;
    padding: 6px 0; border: none !important; text-align: right;
    font-size: 13px; color: #333; border-bottom: 1px dashed #eee;
}
.rms-table tr td:last-child { border-bottom: none; }
/* Mobile History Label */
#tab-sales-history .rms-table td::before {
    content: attr(data-label); font-weight: 600; color: #555;
    text-align: left; padding-right: 8px;
    font-size: 11px; flex-basis: 35%;
    flex-shrink: 0; white-space: nowrap;
}
/* Mobile Stock Label */
#tab-stock-overview .rms-table td::before {
    content: attr(data-label); font-weight: 600; color: #555;
    text-align: left; padding-right: 8px;
    font-size: 12px; flex-basis: 35%; flex-shrink: 0;
}
/* Mobile History Action Row */
#tab-sales-history .rms-table td[data-label="Action"] {
    justify-content: flex-end; padding-top: 6px; padding-bottom: 0;
}
/* Mobile Stock Action Row */
#tab-stock-overview .rms-table td[data-label="Action"] {
    justify-content: flex-end; padding-top: 8px;
}
.rms-table td span:not(.rms-stock-status),
.rms-table td button {
    word-break: break-word; text-align: right; flex-grow: 1;
}

/* Stock Status Pills */
.rms-stock-status {
    padding: 3px 8px; border-radius: 4px; font-size: 11px;
    font-weight: 600; text-transform: uppercase; white-space: nowrap;
}
.rms-stock-status.normal-stock { background-color: #e0f1ff; color: #005a9e; }
.rms-stock-status.low-stock { background-color: #ffe0e0; color: #a00000; }

/* Return Button */
.rms-return-button.rms-button {
    background-color: #aa1e1e; color: #fff !important; border: none;
    padding: 5px 10px; font-size: 12px; font-weight: 500;
    border-radius: 4px; cursor: pointer; line-height: normal;
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 26px;
}
.rms-return-button.rms-button:hover { background-color: #880f0f; }
.rms-return-button.rms-button:disabled { background-color: #ccc; cursor: not-allowed; }

/* Sales History Header (Filters + Export) */
.rms-sales-history-header {
    position: relative; margin-bottom: 20px; padding-bottom: 15px;
    border-bottom: 1px solid #eaeaea;
}
h4.rms-filters-heading {
    font-size: 14px; font-weight: 600; color: #333; margin: 0 0 10px 0;
}
/* Filter layout for mobile */
#rms-sales-filter-form {
    display: grid;
    grid-template-columns: 1fr; /* 1 column first */
    gap: 10px;
}
/* MODIFIED: Put dates side-by-side */
#rms-sales-filter-form .rms-filter-group.date-range {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr; /* Force 2 columns */
    gap: 6px;
}
#rms-sales-filter-form .rms-filter-group { display: flex; flex-direction: column; }
#rms-sales-filter-form label {
    margin-bottom: 4px; font-weight: 500; font-size: 12px; color: #444;
}
#rms-sales-filter-form input,
#rms-sales-filter-form select {
    width: 100%; padding: 10px 12px; border: 1px solid #dcdcdc; border-radius: 6px;
    font-size: 13px; background-color: #ffffff;
}
.rms-export-button-container {
    margin-top: 10px;
    text-align: left;
}
.rms-export-button-container .rms-export-button.rms-button {
    background-color: #0d4a37; color: #fff !important;
    padding: 8px 12px; font-size: 12px;
    font-weight: 500; border-radius: 6px;
    text-align: center; white-space: nowrap; display: inline-block; width: auto;
}
.rms-export-button-container .rms-export-button.rms-button:hover {
    background-color: #083326;
}

/* Desktop Styles */
@media (min-width: 768px) {
    #rms-plugin-dashboard-wrapper.rms-dashboard-redesigned { padding: 0 20px; }
    .rms-dashboard-redesigned .rms-tabs { justify-content: center; overflow-x: hidden;} /* Hide scroll on desktop */
     .rms-dashboard-redesigned .rms-tabs li a { padding: 16px 30px; font-size: 15px; }
    .rms-dashboard-redesigned .rms-tab-content { padding: 30px; }

    /* Form */
    #rms-record-sale-form .rms-form-grid { grid-template-columns: 1fr 1fr; gap: 18px; }
    #rms-record-sale-form input,
    #rms-record-sale-form select { padding: 14px; font-size: 14px; }
    #rms-record-sale-form ::-webkit-input-placeholder { font-size: 14px; }
    #rms-record-sale-form ::-moz-placeholder { font-size: 14px; opacity: 1; }
    #rms-record-sale-form :-ms-input-placeholder { font-size: 14px !important;}
    #rms-record-sale-form ::placeholder { font-size: 14px; }
    #rms-record-sale-form input:disabled { color: #777; }

    .rms-form-footer {
        flex-direction: row; justify-content: space-between; align-items: center; padding: 20px 0 0 0;
    }
    .rms-total-display { font-size: 22px; margin-bottom: 0; text-align: left; }
    #rms-submit-sale.rms-button { width: auto; font-size: 16px; padding: 16px 25px; }

    /* Filters */
     .rms-sales-history-header {
         display: flex; justify-content: space-between; align-items: flex-end;
         flex-wrap: nowrap; padding-bottom: 15px; margin-bottom: 15px; position: relative;
     }
      h4.rms-filters-heading { display: none; }
     #rms-sales-filter-form {
        display: flex; flex-wrap: nowrap; gap: 12px; flex-grow: 1; align-items: flex-end;
        grid-template-columns: none;
     }
     #rms-sales-filter-form .rms-filter-group.date-range { display: contents; }

     #rms-sales-filter-form .rms-filter-group {
         flex-direction: column; flex: 0 1 auto; min-width: 0;
     }
      #rms-sales-filter-form .rms-filter-group.customer { order: 1; flex: 1 1 200px; min-width: 180px; }
      #rms-sales-filter-form .rms-filter-group.product { order: 2; flex: 1 1 200px; min-width: 180px; }
      #rms-sales-filter-form .rms-filter-group.date { order: 3; flex: 0 1 160px; }

     #rms-sales-filter-form label { font-size: 12px; }
     #rms-sales-filter-form input,
     #rms-sales-filter-form select { font-size: 14px; padding: 10px 12px; }

     .rms-export-button-container {
        margin-top: 0; margin-left: 15px; flex-shrink: 0; order: 4; text-align: right;
     }
     .rms-export-button-container .rms-export-button.rms-button {
         padding: 10px 15px; font-size: 13px;
     }

    /* Tables */
    .rms-table thead { display: table-header-group; }
    #tab-sales-history .rms-table tr,
    #tab-stock-overview .rms-table tr {
        display: table-row; border: none; border-radius: 0;
        margin-bottom: 0; padding: 0; border-bottom: 1px solid #eaeaea;
    }
     .rms-table tr:last-child { border-bottom: none; }
     .rms-table tbody tr:hover { background-color: #fdfdfd; }

    /* Restore table cell styles for desktop AND ADD CENTER ALIGNMENT */
     #tab-sales-history .rms-table td,
     #tab-stock-overview .rms-table td,
     .rms-table th { /* Apply center align to thead th too */
        display: table-cell;
        text-align: center !important; /* Center align */
        vertical-align: middle;
        padding: 12px 15px; font-size: 14px; border-bottom: none;
        color: inherit; /* Reset color from mobile */
        background-color: transparent; /* Ensure no background bleed from hover */
    }
    /* Ensure header text remains white and background dark, and no hover effect */
    .rms-table th {
        color: #fff !important;
        background-color: #333 !important; /* Ensure dark background */
    }

    .rms-table td::before { display: none; }
     .rms-table td[data-label="Action"] { text-align: center !important; }
    .rms-return-button.rms-button { padding: 6px 12px; font-size: 13px; }
}

/* Max Width Container for very large screens */
@media (min-width: 1400px) {
    #rms-plugin-dashboard-wrapper.rms-dashboard-redesigned {
        max-width: 1340px; padding: 0;
    }
}