﻿/* ===============================
   GLOBAL APP SCALE (80%)
   =============================== */

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
    /* Brand blues */
    --accent: #1d4ed8;
    --accent-mid: #2563eb;
    --accent-light: #dbeafe;
    --accent-hover-bg: #eff6ff;
    --accent-hover-bdr: #bfdbfe;
    /* Topbar */
    --topbar-bg: #ffffff;
    --topbar-border: #e2e8f0;
    --topbar-text: #475569;
    --topbar-text-hi: #0f172a;
    --topbar-icon: #64748b;
    --topbar-icon-hover-bg: #f1f5f9;
    /* Brand tile */
    --brand-tile: #1d4ed8;
    --brand-name-color: #0d9488;
    /* Sidebar */
    --sidebar-bg: #ffffff;
    --sidebar-border: #e2e8f0;
    --sidebar-text: #334155;
    --sidebar-text-muted: #64748b;
    --sidebar-hover-bg: #f1f5f9;
    --sidebar-active-bg: #eff6ff;
    --sidebar-active-bdr: #bfdbfe;
    --sidebar-active-text: #1d4ed8;
    --sidebar-group-label: #94a3b8;
    /* Body */
    --body-bg: #f1f5f9;
    /* Sizes */
    --topbar-h: 56px;
    --sidebar-w: 260px;
    --sidebar-w-collapsed: 64px;
    /* Misc */
    --action-radius: 8px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .08);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, .12);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, .16);
    --t-fast: 160ms cubic-bezier(.4, 0, .2, 1);
    --t-mid: 220ms cubic-bezier(.4, 0, .2, 1);
}
html, body {
    height: 100%;
    margin: 0;
}

.app-scale-80 {
    transform: scale(0.8);
    transform-origin: top left;
    /* compensate for shrink */
    width: 125%;
    height: 125%;
}

.tile-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.tile-card {
    background-color: #f8f8f5;
    border: 1px solid #dedede;
    padding: 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 0 0 rgba(0, 0, 0, 0);
    text-align: center;
}

    .tile-card:hover {
        background-color: #ffffff;
        box-shadow: 0 0 10px 3px rgba(0, 191, 165, 0.4);
        border-color: #00bfa5;
        transform: translateY(-2px);
    }

    .tile-card i {
        display: block;
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
        color: green;
    }

    .tile-card strong {
        display: block;
        font-size: 1rem;
        color: #222;
    }

.report-desc {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.25rem;
}



.receiving-page {
    width: 100%;
    padding: 12px;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.grid-card {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    padding: 12px;
}

.grid-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

    .search-box input {
        min-width: 260px;
        border: 1px solid #d8dce3;
        border-radius: 8px;
        padding: 8px 12px;
        outline: none;
    }

        .search-box input:focus {
            border-color: #4f6bed;
            box-shadow: 0 0 0 3px rgba(79, 107, 237, 0.12);
        }

.search-icon {
    font-size: 16px;
}

.search-count {
    font-size: 13px;
    color: #6b7280;
}

.grid-page-size {
    display: flex;
    align-items: center;
    gap: 8px;
}

    .grid-page-size select {
        min-width: 90px;
    }

.grid-range {
    font-size: 13px;
    color: #6b7280;
    background: #f6f7f9;
    padding: 8px 10px;
    border-radius: 8px;
}

.afri-radzen-grid {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
}

    .afri-radzen-grid .rz-grid-table {
        font-size: 14px;
    }

    .afri-radzen-grid .rz-column-title {
        font-weight: 700;
        white-space: nowrap;
    }

    .afri-radzen-grid .rz-cell-data {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .afri-radzen-grid .rz-datatable-data td,
    .afri-radzen-grid .rz-grid-table td {
        vertical-align: middle;
    }

.small-grid {
    max-height: 360px;
    overflow: auto;
}

.highlight {
    background: #fff3cd;
    padding: 1px 3px;
    border-radius: 3px;
    font-weight: 700;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.58);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.modal-content {
    background: #ffffff;
    border-radius: 14px;
    padding: 20px;
    width: min(640px, 96vw);
    max-height: 92vh;
    overflow: auto;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

    .modal-content.large {
        width: min(1180px, 98vw);
    }

.modal-small-popup {
    width: min(420px, 94vw);
}

.modal-medium-popup {
    width: min(620px, 94vw);
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

    .modal-form label {
        font-weight: 600;
        margin-top: 6px;
    }

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.sort-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #edf0f4;
}

.validation-message {
    margin-top: 10px;
    padding: 10px;
    background: #fff3cd;
    border: 1px solid #ffe69c;
    color: #664d03;
    border-radius: 8px;
}

.dropdown,
.search-results {
    list-style: none;
    padding: 0;
    margin: 4px 0 0;
    z-index: 2000;
    max-height: 220px;
    overflow: auto;
    width: 100%;
}

    .dropdown li,
    .search-results li {
        padding: 8px 10px;
        cursor: pointer;
    }

        .dropdown li:hover,
        .search-results li:hover {
            background: #f3f4f6;
        }

.spinner-overlay {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 12px;
}

.upload-result,
.selected-file {
    margin-top: 10px;
    padding: 8px 10px;
    background: #f6f7f9;
    border-radius: 8px;
}

.styled-table {
    width: 100%;
    border-collapse: collapse;
}

    .styled-table th,
    .styled-table td {
        border: 1px solid #e5e7eb;
        padding: 8px;
        white-space: nowrap;
    }

    .styled-table th {
        background: #f9fafb;
        font-weight: 700;
    }

@media (max-width: 768px) {
    .receiving-page {
        padding: 8px;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-left,
    .toolbar-right {
        width: 100%;
    }

        .toolbar-left .btn,
        .toolbar-right .btn {
            flex: 1 1 auto;
        }

    .grid-header {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        width: 100%;
    }

        .search-box input {
            min-width: 100%;
            width: 100%;
        }

    .grid-page-size {
        width: 100%;
        justify-content: space-between;
    }

    .afri-radzen-grid {
        height: calc(100vh - 240px) !important;
    }

    .modal-content.large,
    .modal-content {
        width: 98vw;
    }

    .modal-actions {
        justify-content: stretch;
    }

        .modal-actions .btn {
            flex: 1 1 auto;
        }
}

.ecommerce-page .ecm-panel {
    border: 1px solid #dbe4f0;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .05);
}

.ecommerce-filters {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 180px 180px 140px 140px auto auto 170px auto;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}

.ecommerce-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 42px 18px 18px;
    background: rgba(15, 23, 42, .62);
}

.ecommerce-product-modal {
    width: min(760px, 96vw);
    max-height: calc(100vh - 84px);
    overflow: auto;
    border: 1px solid #dbe4f0;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .32);
    padding: 20px;
}

.ecommerce-product-modal .modal-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.ecommerce-product-modal .tab-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
}

.ecommerce-product-modal .form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ecommerce-field-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.ecommerce-link-btn {
    border: 0;
    background: transparent;
    color: #2563eb;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0;
    font-size: .82rem;
    font-weight: 700;
}

.ecommerce-link-btn:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.ecommerce-select {
    width: 100%;
    min-height: 40px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background-color: #fff;
    color: #0f172a;
    padding: 8px 34px 8px 11px;
    font-size: .95rem;
}

.ecommerce-select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, .16);
    outline: 0;
}

.ecommerce-product-modal .form-field.full-width {
    grid-column: 1 / -1;
}

.ecommerce-product-modal .modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.ecommerce-category-modal {
    width: min(560px, 96vw);
}

.ecommerce-total {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 18px;
    padding-top: 16px;
    color: #475569;
    font-size: .95rem;
}

.ecommerce-total strong {
    color: #0f172a;
    font-size: 1.35rem;
}

.ecommerce-details {
    display: grid;
    grid-template-columns: minmax(260px, 420px) minmax(280px, 1fr);
    gap: 24px;
}

.ecommerce-image-wall {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
    gap: 12px;
}

.ecommerce-image-tile,
.ecommerce-image-placeholder {
    aspect-ratio: 1 / 1;
    border: 1px solid #dbe4f0;
    border-radius: 8px;
    background: #f8fafc;
    overflow: hidden;
    display: grid;
    place-items: center;
}

.ecommerce-image-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ecommerce-image-placeholder i {
    color: #94a3b8;
    font-size: 2rem;
}

.ecommerce-detail-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ecommerce-detail-body h2 {
    margin: 0;
    color: #0f172a;
    font-size: 2rem;
}

.ecommerce-detail-body p {
    color: #475569;
    line-height: 1.6;
}

.ecommerce-stock-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #edf2f7;
}

.ecommerce-checkout .tab-form-grid {
    margin-bottom: 18px;
}

.ecommerce-portal-card {
    border: 1px solid #dbe4f0;
    text-align: left;
    cursor: pointer;
}

.ecommerce-portal-card:hover {
    border-color: #2563eb;
    box-shadow: 0 10px 24px rgba(37, 99, 235, .12);
}

.ecommerce-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.ecommerce-admin-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ecommerce-admin-section-head {
    display: flex;
    gap: 12px;
    align-items: center;
}

.ecommerce-admin-section-head > i {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: #2563eb;
    background: #eff6ff;
}

.ecommerce-admin-section-head h3 {
    margin: 0;
    font-size: 1rem;
    color: #0f172a;
}

.ecommerce-admin-section-head span {
    color: #64748b;
    font-size: .84rem;
}

.ecommerce-admin-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ecommerce-admin-link {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #0f172a;
    display: grid;
    grid-template-columns: 24px 1fr 16px;
    gap: 10px;
    align-items: center;
    padding: 11px 12px;
    text-align: left;
}

.ecommerce-admin-link:hover {
    border-color: #2563eb;
    background: #f8fbff;
}

.ecommerce-admin-link i:first-child {
    color: #2563eb;
}

.ecommerce-admin-link i:last-child {
    color: #94a3b8;
    font-size: .76rem;
}

.ecommerce-upload-box {
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f8fafc;
}

@media (max-width: 980px) {
    .ecommerce-filters,
    .ecommerce-details,
    .ecommerce-product-modal .tab-form-grid {
        grid-template-columns: 1fr;
    }
}
