/*
|--------------------------------------------------------------------------
| Users Hub
|--------------------------------------------------------------------------
| Screens
|--------------------------------------------------------------------------
*/

/*
|--------------------------------------------------------------------------
| Base Screen
|--------------------------------------------------------------------------
*/

.screen {
    width: 100%;
    min-height: 100%;
    padding: 0;
    background: transparent;
}

.screen h1 {
    margin-top: 0;
}

/*
|--------------------------------------------------------------------------
| Standalone Error Screen
|--------------------------------------------------------------------------
*/

.screen-error {
    width: 100%;
    min-height: 100%;
    display: grid;
    place-items: center;
    padding: 24px;
    text-align: center;
}

/*
|--------------------------------------------------------------------------
| Dashboard Screen
|--------------------------------------------------------------------------
*/

.dashboard-screen {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

/*
|--------------------------------------------------------------------------
| Dashboard Heading
|--------------------------------------------------------------------------
*/

.dashboard-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.dashboard-heading h1 {
    margin: 3px 0 8px;
}

.dashboard-heading p {
    margin: 0;
    color: #667085;
}

.dashboard-eyebrow {
    margin: 0;
    color: #0a7c3e !important;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.dashboard-primary-action {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    border-radius: 10px;
    background: #0a7c3e;
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
}

.dashboard-primary-action:hover {
    background: #086b35;
}

/*
|--------------------------------------------------------------------------
| Dashboard Welcome Card
|--------------------------------------------------------------------------
*/

.dashboard-welcome-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 28px;
    border-radius: 18px;
    background: #123524;
    color: #ffffff;
}

.dashboard-welcome-card span {
    color: rgba(255, 255, 255, 0.7);
}

.dashboard-welcome-card h2 {
    margin: 8px 0;
}

.dashboard-welcome-card p {
    margin: 0;
}

.subscription-badge {
    flex: 0 0 auto;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    white-space: nowrap;
}

/*
|--------------------------------------------------------------------------
| Dashboard Statistics
|--------------------------------------------------------------------------
*/

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 20px;
}

.stat-card,
.dashboard-panel {
    min-width: 0;
    padding: 22px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #ffffff;
}

.stat-card span,
.stat-card small {
    display: block;
    color: #667085;
}

.stat-card strong {
    display: block;
    margin: 10px 0 6px;
    font-size: 30px;
}

/*
|--------------------------------------------------------------------------
| Dashboard Sections
|--------------------------------------------------------------------------
*/

.dashboard-sections {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 20px;
}

.panel-heading h2 {
    margin: 0 0 6px;
}

.panel-heading p,
.empty-state p {
    margin: 0;
    color: #667085;
}

.quick-actions {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.quick-actions a {
    display: block;
    padding: 13px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    color: #123524;
    text-decoration: none;
    font-weight: 700;
}

.quick-actions a:hover {
    border-color: #0a7c3e;
    background: #f8faf9;
}

.empty-state {
    margin-top: 18px;
    padding: 26px;
    border-radius: 12px;
    background: #f8faf9;
    text-align: center;
}

/*
|--------------------------------------------------------------------------
| Products Screen
|--------------------------------------------------------------------------
*/

.products-screen {
    width: 100%;
    max-width: none;
    margin: 0;
}

.products-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.products-heading h1 {
    margin: 3px 0 8px;
}

.products-heading p {
    margin: 0;
    color: #667085;
}

.products-summary {
    flex: 0 0 auto;
    min-width: 130px;
    padding: 14px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #ffffff;
    text-align: center;
}

.products-summary span,
.products-summary strong {
    display: block;
}

.products-summary span {
    color: #667085;
    font-size: 12px;
}

.products-summary strong {
    margin-top: 4px;
    color: #123524;
    font-size: 24px;
}

/*
|--------------------------------------------------------------------------
| Products Toolbar
|--------------------------------------------------------------------------
*/

.products-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin: 20px 0;
}

.products-search-group {
    width: 100%;
    max-width: 520px;
}

.products-search-group label,
.products-search-label {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 700;
}

.products-search {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid #d9dfdc;
    border-radius: 10px;
    background: #ffffff;
    outline: none;
}

.products-search:focus {
    border-color: #0a7c3e;
    box-shadow: 0 0 0 3px rgba(10, 124, 62, 0.12);
}

/*
|--------------------------------------------------------------------------
| Grid / Line View Switcher
|--------------------------------------------------------------------------
*/

.products-view-switcher {
    flex: 0 0 auto;
    display: inline-flex;
    gap: 5px;
    padding: 5px;
    border: 1px solid #dfe5e1;
    border-radius: 10px;
    background: #ffffff;
}

.products-view-switcher button {
    width: auto;
    margin: 0;
    padding: 8px 15px;
    border-radius: 7px;
    background: transparent;
    color: #667085;
    font-size: 13px;
}

.products-view-switcher button:hover,
.products-view-switcher button.is-active {
    background: #0a7c3e;
    color: #ffffff;
}

/*
|--------------------------------------------------------------------------
| Products Grid Mode
|--------------------------------------------------------------------------
*/

.products-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.product-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #ffffff;
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        border-color 0.15s ease;
}

.product-card:hover {
    transform: translateY(-2px);
    border-color: #cddbd3;
    box-shadow: 0 8px 22px rgba(18, 53, 36, 0.08);
}

.product-image-wrap {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    overflow: hidden;
    background: #f8faf9;
}

.product-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-card-body {
    min-width: 0;
    padding: 11px;
}

.product-card-meta {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    color: #667085;
    font-size: 9px;
}

.product-card-meta span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-card-meta span:first-child {
    color: #0a7c3e;
    font-weight: 800;
}

.product-card-body h2 {
    min-height: 36px;
    margin: 8px 0;
    overflow: hidden;
    color: #1f2937;
    font-size: 13px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-values {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 10px;
}

.product-values div {
    min-width: 0;
    padding: 7px;
    border-radius: 7px;
    background: #f8faf9;
}

.product-values span,
.product-values strong {
    display: block;
}

.product-values span {
    margin-bottom: 2px;
    color: #667085;
    font-size: 9px;
}

.product-values strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #123524;
    font-size: 12px;
}

/*
|--------------------------------------------------------------------------
| Shared Product Quantity Control
|--------------------------------------------------------------------------
*/

.product-quantity {
    display: grid;
    grid-template-columns: 32px minmax(32px, 1fr) 32px;
    align-items: center;
    gap: 6px;
}

.product-quantity button {
    width: 32px;
    height: 32px;
    margin: 0;
    padding: 0;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #0a7c3e;
    color: #ffffff;
    font-size: 17px;
    font-weight: 800;
    line-height: 1;
}

.product-quantity button:hover {
    background: #086b35;
}

.product-quantity span {
    min-width: 32px;
    min-height: 32px;
    display: grid;
    place-items: center;
    border: 1px solid #e1e7e3;
    border-radius: 8px;
    background: #ffffff;
    color: #123524;
    font-size: 13px;
    font-weight: 800;
}

/*
|--------------------------------------------------------------------------
| Products Line Mode
|--------------------------------------------------------------------------
*/

.products-line-list {
    width: 100%;
    display: grid;
    gap: 8px;
}

.product-line {
    min-width: 0;
    display: grid;
    grid-template-columns:
        60px
        minmax(220px, 1fr)
        70px
        115px
        105px
        120px;
    align-items: center;
    gap: 12px;
    padding: 11px 13px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #ffffff;
}

.product-line:hover {
    border-color: #cddbd3;
    background: #fbfdfc;
}

.product-line-sku {
    color: #0a7c3e;
    font-size: 13px;
    font-weight: 800;
}

.product-line-name {
    min-width: 0;
}

.product-line-name strong,
.product-line-name small {
    display: block;
}

.product-line-name strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #1f2937;
    font-size: 13px;
}

.product-line-name small {
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #667085;
    font-size: 11px;
}

.product-line-value {
    min-width: 0;
}

.product-line-value span,
.product-line-value strong {
    display: block;
}

.product-line-value span {
    color: #667085;
    font-size: 9px;
}

.product-line-value strong {
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #123524;
    font-size: 12px;
}

/*
|--------------------------------------------------------------------------
| Product Loading and Empty States
|--------------------------------------------------------------------------
*/

.products-loading,
.products-empty,
.products-error {
    grid-column: 1 / -1;
    padding: 40px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #ffffff;
    text-align: center;
}

.products-loading,
.products-empty p,
.products-error p {
    color: #667085;
}

/*
|--------------------------------------------------------------------------
| Price Tables and Retail Order
|--------------------------------------------------------------------------
*/

.table-scroll {
    width: 100%;
    overflow-x: auto;
}

.price-table {
    min-width: 920px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
}

.price-table-head,
.price-table-row {
    display: grid;
    grid-template-columns:
        80px
        minmax(220px, 1fr)
        180px
        80px
        130px
        130px;
    align-items: center;
}

.price-table-head {
    padding: 12px 14px;
    background: #123524;
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
}

.price-table-row {
    min-height: 52px;
    padding: 10px 14px;
    border-top: 1px solid #eef1ef;
    color: #374151;
    font-size: 13px;
}

.price-table-row:nth-child(even) {
    background: #fafcfb;
}

.price-table-row:hover {
    background: #f3f8f5;
}

.price-table-row > div {
    min-width: 0;
    padding-right: 12px;
}

.price-table-row strong {
    color: #0a7c3e;
}

.retail-order-table .price-table-head,
.retail-order-table .price-table-row {
    grid-template-columns:
        80px
        minmax(220px, 1fr)
        180px
        80px
        130px
        130px;
}

/*
|--------------------------------------------------------------------------
| Compact Quantity Arrows
|--------------------------------------------------------------------------
*/

.quantity-arrow {
    width: 30px !important;
    height: 30px !important;
    margin: 0 !important;
    padding: 0 !important;

    display: grid !important;
    place-items: center !important;

    border: 1px solid #cfd9d3 !important;
    border-radius: 50% !important;

    background: #ffffff !important;
    color: #0a7c3e !important;

    font-size: 20px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
}

.quantity-arrow:hover {
    border-color: #0a7c3e !important;
    background: #eef7f2 !important;
}

.product-quantity {
    display: inline-grid;
    grid-template-columns: 30px 34px 30px;
    align-items: center;
    gap: 5px;
}

.product-quantity span {
    min-width: 34px;
    min-height: 30px;

    display: grid;
    place-items: center;

    border: 1px solid #e1e7e3;
    border-radius: 7px;

    background: #ffffff;
    color: #123524;
    font-weight: 800;
}

/*
|--------------------------------------------------------------------------
| Responsive Product Layout
|--------------------------------------------------------------------------
*/

@media (max-width: 1250px) {
    .products-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .product-line {
        grid-template-columns:
            55px
            minmax(200px, 1fr)
            65px
            105px
            100px
            115px;
        gap: 10px;
    }
}

@media (max-width: 1050px) {
    .products-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .product-line {
        grid-template-columns:
            52px
            minmax(180px, 1fr)
            65px
            95px
            110px;
    }

    .product-line-value:nth-of-type(2) {
        display: none;
    }
}

@media (max-width: 850px) {
    .products-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .products-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .products-search-group,
    .products-view-switcher {
        width: 100%;
        max-width: none;
    }

    .products-view-switcher button {
        flex: 1 1 50%;
    }

    .product-line {
        grid-template-columns:
            50px
            minmax(0, 1fr)
            110px;
    }

    .product-line-value {
        display: none;
    }
}

/*
|--------------------------------------------------------------------------
| Dashboard Responsive
|--------------------------------------------------------------------------
*/

@media (max-width: 760px) {
    .dashboard-heading,
    .dashboard-welcome-card {
        align-items: stretch;
        flex-direction: column;
    }

    .dashboard-primary-action {
        width: 100%;
    }

    .subscription-badge {
        align-self: flex-start;
    }

    .dashboard-stats,
    .dashboard-sections {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 650px) {
    .products-heading {
        flex-direction: column;
    }

    .products-summary {
        width: 100%;
    }

    .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 440px) {
    .products-grid {
        grid-template-columns: 1fr;
    }

    .product-line {
        grid-template-columns:
            44px
            minmax(0, 1fr)
            104px;
        padding: 10px;
    }

    .product-line-name strong {
        font-size: 12px;
    }

    .product-quantity {
        grid-template-columns: 29px 32px 29px;
        gap: 4px;
    }

    .product-quantity button {
        width: 29px;
        height: 29px;
    }

    .product-quantity span {
        min-width: 32px;
        min-height: 29px;
    }
}