/**
* Supplier Documents Styles
* Styles for document sections on supplier cards
*/

/* ==========================================================================
Supplier Documents Section
========================================================================== */

.supplier-documents-section {
    margin-top: 4rem;
    clear: both;
}

/* ==========================================================================
Supplier Sections
========================================================================== */

.supplier-sections {
    margin-top: 4rem;
    padding-bottom: 1rem;
}
.supplier-sections > div:not(:first-child) {
    margin-top: 2.7rem;
}
/* ==========================================================================
Supplier Events Section
========================================================================== */

.supplier-events-section {
    clear: both;
}

.supplier-events-section .events-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    gap: 10px;
}

.supplier-events-section .events-header p {
    padding: 0;
}

button.toggle-supplier-events.nectar-button.button-secondary-outline-green.button-auto.button-small {
    padding: 0.5rem 0.8rem 0.5rem 1rem !important;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.nectar-button span.event-count-label {
    background: #e7eeec;
    min-width: 1.1rem;
    padding: 0 0.2rem;
    font-size: 0.8rem;
    border-radius: 0.3rem;
    margin-left: 0.2rem;
    transition: all 0.2s ease;
}

button.toggle-supplier-events.nectar-button.button-secondary-outline-green.button-auto.button-small:hover span.event-count-label {
    background: #d4e0dc;
}

.toggle-caret {
    display: inline-block;
    width: 14px;
    height: 14px;
    background-image: url(/wp-content/uploads/2025/09/icon-chevron-down-gg.svg);
    background-size: 12px;
    background-repeat: no-repeat;
    background-position: center;
    margin-left: 0.2rem;
    opacity: 0.6;
    transition: transform 0.3s ease;
}

.toggle-supplier-events.expanded .toggle-caret {
    transform: rotate(180deg);
}

.supplier-documents-section .documents-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    gap: 10px;
}

.supplier-documents-section .documents-header p {
    padding: 0;
}

button.see-all-docs.nectar-button.button-secondary-outline-green.button-auto.button-small {
    padding: 0.5rem 0.8rem 0.5rem 1rem !important;
}

.nectar-button span.doc-count-label, .toggle-archived-docs .archived-count {
    background: #e7eeec;
    min-width: 1.1rem;
    padding: 0 0.4rem;
    font-size: 0.75rem;
    border-radius: var(--border-radius-p-sm);
    margin-left: 0.5rem;
    line-height: 1.5;
    transition: all 0.2s ease;
}
button.see-all-docs.nectar-button.button-secondary-outline-green.button-auto.button-small:hover span.doc-count-label,
.toggle-archived-docs:hover .archived-count {
    background: #d4e0dc;
}
body[data-button-style^="rounded"] button.toggle-archived-docs {
    position: relative;
    height: 40px !important;
    top: 1.5px;
    font-size: 0.85rem !important;
    padding: 0.5rem 0.9rem 0.5rem 2.2rem !important;
}
body[data-button-style^="rounded"] button.toggle-archived-docs.active {
    color: #454f4c !important;
    border: 1px solid rgb(142 152 149) !important;
}
body[data-button-style^="rounded"] button.toggle-archived-docs:before {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%) !important;
    left: 0.6rem;
    background: url(/wp-content/uploads/2025/07/icon-hide-b.svg) no-repeat center center !important;
    background-size: 1.1rem !important;
    width: 1.3rem;
    height: 1.3rem;
    opacity: 0.5;
    transition: all 0.2s ease;
}
body[data-button-style^="rounded"] button.toggle-archived-docs.active:before {
    background-image: url(/wp-content/uploads/2025/09/icon-show-b.svg) !important;
    opacity: 0.8;
}

/* ==========================================================================
Document Preview Card
========================================================================== */

.document-preview-container {
    margin-top: 10px;
}

.document-preview-card {
    display: flex;
    align-items: center;
    gap: 1.6rem;
    padding: 12px;
    border: 1px solid rgb(55 64 61 / 9%);
    border-radius: var(--border-radius-p-2);
    cursor: pointer;
    text-decoration: none;
    position: relative;
    box-shadow: 0 4px 10px rgb(55 64 61 / 8%);
    overflow: hidden;
    transition: all 0.3s ease-in-out;
}

.document-preview-card:hover {
    box-shadow: 0 4px 12px rgb(55 64 61 / 20%);
    border: 1px solid rgb(55 64 61 / 14%);
    transform: translateY(-1px);
}

.doc-thumbnail-wrapper {
    width: 80px;
    height: 80px;
    margin: 0 !important;
    overflow: hidden;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e5e5;
    flex-shrink: 0;
}

.doc-thumbnail {
    max-width: 100%;
    max-height: 100%;
    margin: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block;
}

.doc-thumbnail-wrapper .dashicons {
    color: #666;
    font-size: 20px;
}

.doc-name {
    flex: 1;
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    font-weight: 500;
}

.document-guest-message {
    margin: 0 0 10px 0;
    color: #49635c;
    font-size: 0.95rem;
    display: none;
}

/* ==========================================================================
   Login Document Banner with Inline Registration
   ========================================================================== */

@keyframes bannerGrowIn {
    0% {
        max-height: 0;
        opacity: 0;
        padding-top: 0;
        padding-bottom: 0;
        margin-bottom: 0;
    }
    100% {
        max-height: 1000px;
        opacity: 1;
        padding-top: 2rem;
        padding-bottom: 3rem;
        margin-bottom: 28px;
    }
}

.login-document-banner {
    border-radius: 12px;
    background: #344640;
    margin-bottom: 28px;
    padding: 2rem 3rem 3rem;
    box-shadow: 0 7px 32px rgba(37, 40, 39, 0.08);
    width: 100% !important;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
    color: var(--text-light);
    animation: bannerGrowIn 0.5s ease-out forwards;
}

.login-document-banner .banner-header-text {
    margin: 0 0 2rem;
    padding: 0;
    font-size: 2rem;

    color: var(--text-light) !important;
}

/* Content - Two Column Layout */
.login-document-banner .banner-content {
    display: flex;
    gap: 5rem;
    padding: 1rem 0 2.5rem;
}

/* LEFT: Preview Section (40%) */
.login-document-banner .banner-preview {
    flex: 0 0 40%;
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    align-self: flex-start;
    border-radius: 0.6rem;
    background: white;
    box-shadow: 0 4px 10px rgb(55 64 61 / 8%);
    padding: 1rem;
    margin-top: 4rem;
}

.login-document-banner .banner-thumbnail {
    width: 120px;
    height: 120px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(55, 64, 61, 0.08);
    background: #fff;
    flex-shrink: 0;
}

.login-document-banner .banner-thumbnail .doc-thumbnail {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
}

.login-document-banner .banner-details {
    flex: 1;
    min-width: 0;
}

.login-document-banner .banner-details .doc-name {
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: #26322f;
    text-wrap: wrap;
    line-height: 1.3;
}

.login-document-banner .doc-info-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: #4e615c;
    font-size: 0.9rem;
}

.login-document-banner .doc-info-row .doc-meta {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* RIGHT: Form Section (30%) */
.login-document-banner .banner-form-container {
    flex: 0 0 40%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.login-document-banner .banner-registration-form {
    width: 100%;
}

.login-document-banner .banner-registration-form .form-row {
    margin-bottom: 0.5rem;
}
.login-document-banner .banner-registration-form .form-row:nth-child(3) {
    margin-bottom: 1rem;
}
.login-document-banner .banner-registration-form .form-row:nth-child(4) {
    margin-bottom: 2rem;
}

.login-document-banner .banner-registration-form input[type="text"],
.login-document-banner .banner-registration-form input[type="email"],
.login-document-banner .banner-registration-form input[type="password"] {
    width: 100%;
    padding: 0.8rem 1rem;
    font-size: 0.95rem;
    background: #455650;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.07) !important;
    border: none !important;
    color: var(--text-dark);
    transition: border-color 0.2s ease;
}
.login-document-banner .banner-registration-form input[type="text"]:focus,
.login-document-banner .banner-registration-form input[type="email"]:focus,
.login-document-banner .banner-registration-form input[type="password"]:focus {
    background: #455650;
}

.login-document-banner .banner-registration-form .field-error {
    color: var(--text-accent);
    font-size: 0.85rem;
    margin-top: 0.3rem;
}

.login-document-banner .banner-registration-form .form-ajax-error {
    color: var(--text-accent);
    font-size: 0.9rem;
    padding: 0.6rem;
    border-radius: 4px;
}

.login-document-banner .banner-registration-form button[type="submit"] {
    width: 100%;
    margin-bottom: 0.8rem;
}

.login-document-banner .banner-registration-form .show-banner-login {
    width: 100%;
    text-align: center;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .login-document-banner .banner-header {
        padding: 1rem 1.5rem;
    }

    .login-document-banner .banner-header-text {
        font-size: 1.4rem;
    }

    .login-document-banner .banner-content {
        flex-direction: column;
        gap: 2rem;
        padding: 1.5rem;
    }

    .login-document-banner .banner-preview {
        flex: 1;
        width: 100%;
    }

    .login-document-banner .banner-form-container {
        flex: 1;
        width: 100%;
    }

    .login-document-banner .banner-registration-form {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .login-document-banner .banner-header {
        padding: 0.8rem 1rem;
    }

    .login-document-banner .banner-content {
        padding: 1rem;
        gap: 10%;
    }

    .login-document-banner .banner-preview {
        flex-direction: column;
        gap: 1rem;
    }

    .login-document-banner .banner-thumbnail {
        width: 100%;
        height: 150px;
    }
}

/* ==========================================================================
Base Modal Styles
========================================================================== */
.psm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.psm-modal-content {
    background: #fff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    max-width: 90vw;
    max-height: 90vh;
    width: 800px;
    display: flex;
    flex-direction: column;
}

.psm-modal-header {
    display: flex;
    position: relative;
    justify-content: space-between;
    align-items: center;
    padding: 1.3rem 2rem;
    border-bottom: 1px solid #ddd;
    background: #fafafa;
    border-radius: 5px 5px 0 0;
    flex-shrink: 0;
}

.psm-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.psm-overlay-modal {
    z-index: 100001;
}

.psm-overlay-modal .psm-modal-content {
    position: relative;
    z-index: 100003;
}

.psm-modal-header h3.modal-title {
    margin: 0 !important;
}

.psm-modal-header h3.modal-title .doc-count {
    background: #e2ede9;
    padding: 0.1rem 0.4rem;
    border-radius: 0.7rem 0.7rem 0.7rem 0;
    color: #7e8a86;
    font-size: 0.75rem;
    margin-left: 1rem;
    min-width: 1.5rem;
    display: inline-block;
    text-align: center;
}

/* ==========================================================================
Document Viewer Modal
========================================================================== */
#psm-document-viewer-modal {
    z-index: 100000;
}

#psm-document-viewer-modal .psm-modal-content {
    width: 75vw;
    height: 95vh;
    max-width: none;
    max-height: none;
    margin: 2.5vh auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 1rem;
}

@media (max-width: 480px) {
    #psm-document-viewer-modal .psm-modal-content {
        width: calc(100% - 2rem);
        height: calc(100% - 2rem);
    }
}

#psm-document-viewer-modal .psm-modal-header {
    flex-shrink: 0;
    padding: 1.3rem 2rem;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#psm-document-viewer-title {
    margin: 0;
}

#psm-document-viewer-modal .psm-modal-body {
    flex: 1;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#psm-document-viewer-modal #psm-document-frame {
    flex: 1;
    width: 100%;
    height: 100%;
    border: none;
    background: white;
    display: block;
    min-height: 0; /* Fix for flexbox in some browsers */
}

/* Ensure PDF renders properly at all viewport sizes */
@media (max-width: 480px) {
    #psm-document-viewer-modal #psm-document-frame {
        min-height: 400px;
        /* Force iframe to use available width for PDF rendering */
        min-width: 100%;
    }

    /* Adjust modal content padding on mobile to maximize space */
    #psm-document-viewer-modal .psm-modal-header {
        padding: 1rem 1rem;
    }

    #psm-document-viewer-modal .psm-modal-footer {
        padding: 0.8rem 1rem;
    }
}

#psm-document-viewer-modal #psm-document-loading,
#psm-document-viewer-modal #psm-document-error {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    text-align: center;
}

#psm-document-viewer-modal .psm-document-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

#psm-document-viewer-modal .psm-modal-footer {
    flex-shrink: 0;
    padding: 1rem 2rem;
    border-top: 1px solid #ddd;
    text-align: right;
}

.psm-document-text-container {
    padding: 2rem;
    font-family: monospace;
    white-space: pre-wrap;
    font-size: 13px;
    line-height: 1.4;
    flex: 1;
    overflow: auto;
    background: white;
}

/* Document container for non-iframe content */
.psm-document-container {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
    position: relative;
    /* Prevent scaled iframe from causing horizontal scroll */
    overflow-x: hidden;
}

/* Spreadsheet Styles */
.psm-spreadsheet-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: white;
}

.psm-spreadsheet-info {
    padding: 10px;
    background: #f9f9f9;
    border-bottom: 1px solid #ddd;
    font-size: 12px;
    color: #666;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.psm-spreadsheet-info span {
    display: inline-block;
}

.psm-spreadsheet-wrapper {
    flex: 1;
    overflow: auto;
    padding: 20px;
    background: white;
}

.psm-spreadsheet-table,
#psm-spreadsheet-table {
    border-collapse: collapse;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 13px;
    width: auto;
    min-width: 100%;
}

.psm-spreadsheet-table td,
.psm-spreadsheet-table th,
#psm-spreadsheet-table td,
#psm-spreadsheet-table th {
    border: 1px solid #d0d0d0;
    padding: 6px 10px;
    white-space: nowrap;
    text-align: left;
}

.psm-spreadsheet-table th,
#psm-spreadsheet-table th {
    background: #f0f0f0;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

.psm-spreadsheet-table tr:nth-child(even),
#psm-spreadsheet-table tr:nth-child(even) {
    background: #f9f9f9;
}

.psm-spreadsheet-table tr:hover,
#psm-spreadsheet-table tr:hover {
    background: #e8f4fd !important;
}

.psm-spreadsheet-table td:empty::after,
#psm-spreadsheet-table td:empty::after {
    content: '\00a0';
}

.psm-document-image-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    background: #f5f5f5;
    overflow: auto;
    padding: 20px;
}

.psm-document-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
Document Loading Progress Bar
========================================================================== */

.psm-document-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(-90deg, var(--color-primary), #1f6f58);
    transition: width 0.3s ease, opacity 0.3s ease;
    z-index: 10;
    box-shadow: 0 0 10px var(--color-primary);
}

.psm-document-progress-bar.error {
    background: linear-gradient(-90deg, var(--color-red), #8d211a);
}

/* ==========================================================================
Documents List Modal
========================================================================== */

#supplier-docs-list-modal .psm-modal-content {
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#supplier-docs-list-modal .psm-modal-header {
    flex-shrink: 0;
    padding: 20px 30px;
    border-bottom: 1px solid #ddd;
}

#supplier-docs-list-modal .psm-modal-body {
    flex: 1;
    padding: 20px 30px;
    overflow-y: auto;
}

.docs-view-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.docs-filters-left {
    display: flex;
    gap: 10px;
    align-items: center;
    flex: 1;
}

.docs-search-wrapper {
    position: relative;
    flex: 1;
    max-width: 300px;
}

.docs-search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.docs-search-clear::before,
.docs-search-clear::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 2px;
    background-color: #666;
    transition: background-color 0.2s ease;
}

.docs-search-clear::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.docs-search-clear::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.docs-search-clear:hover {
    opacity: 1;
}

.docs-search-clear:hover::before,
.docs-search-clear:hover::after {
    background-color: #333;
}

.docs-search-input {
    flex: 1;
    max-width: 300px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.docs-search-input:focus {
    outline: none;
    border-color: #0073aa;
}

.docs-content-type-filter,
.docs-file-type-filter {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.docs-content-type-filter:focus,
.docs-file-type-filter:focus {
    outline: none;
    border-color: #0073aa;
}

.docs-toggles-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

.docs-no-results {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.docs-no-results p {
    margin: 0 0 10px 0;
    font-size: 15px;
}

.docs-no-results p:first-child {
    font-weight: 600;
    font-size: 16px;
    color: #333;
}

.view-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    width: 2rem;
    height: 2rem;
    border: none;
    opacity: 0.4;
    transition: 0.3s all ease-in-out;
}

.view-toggle:hover {
    opacity: 0.6;
}

.view-toggle.active, .view-toggle.active:hover {
    opacity: 1;
}

.view-toggle .dashicons {
    font-size: 16px;
}

button.view-toggle[data-view="grid"] {
    background: url(/wp-content/uploads/2025/07/icon-view-half.svg) center center no-repeat !important;
    background-size: 1.2rem !important;
}

button.view-toggle[data-view="table"] {
    background: url(/wp-content/uploads/2025/07/icon-view-mini-05.svg) center center no-repeat !important;
    background-size: 1.2rem !important;
}

select.docs-media-type-filter, input.docs-search-input {
    width: auto;
}
input.docs-search-input {
    max-width: 20rem !important;
}
body[data-fancy-form-rcs="1"] select.docs-content-type-filter, body[data-fancy-form-rcs="1"] select.docs-file-type-filter {
    max-width: 13rem !important;
}
input[type=text].docs-search-input::placeholder, input[type=text].docs-search-input::-webkit-input-placeholder {
    color: #9daaa8 !important;
}
input.docs-search-input {
    cursor: text;
}
.psm-modal span.select2-selection__arrow:after {
    filter: none !important;
}
.psm-modal input[type=text],
body[data-fancy-form-rcs="1"] .psm-modal .select2-selection--single {
    min-height: 42px !important;
    height: 42px !important;
    font-size: 0.85rem !important;
}
body[data-fancy-form-rcs="1"] .psm-modal .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 42px !important;
}
body[data-fancy-form-rcs="1"] .psm-modal .select2-container--default .select2-selection--single span.select2-selection__arrow:after {
    top: 14px !important;
    left: 17px !important;
    background-size: 11px !important;
    background-position: center;
}
/* Override the general 50px height rule for these specific selects */
body[data-fancy-form-rcs="1"] .psm-modal select.docs-content-type-filter,
body[data-fancy-form-rcs="1"] .psm-modal select.docs-file-type-filter {
    height: 42px !important;
}
body[data-fancy-form-rcs="1"] .psm-modal .select2-container--default .select2-selection--single {
    height: 42px !important;
    padding: 0 0.6rem !important;
}
body[data-fancy-form-rcs="1"] .psm-modal .select2-container--default .select2-selection--single:hover .select2-selection__placeholder {
    color: var(--text-dark) !important;
}

span.select2-dropdown.select2-dropdown--below.select2-dropdown-white-modal {
    min-width: 9rem !important;
}


/* ==========================================================================
Grid View
========================================================================== */

.docs-list-body.view-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.view-grid .doc-list-item {
    padding: 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.view-grid .doc-list-item:hover {
    border-color: #0073aa;
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.15);
    transform: translateY(-2px);
}

.view-grid .doc-thumbnail {
    width: 100%;
    height: 150px;
    background: #f8f9fa;
    overflow: hidden;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e5e5;
    position: relative;
}

.doc-archived-tag {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #61716d;
    color: white;
    padding: 0px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--border-radius-p-med);
    letter-spacing: 0.5px;
    z-index: 10;
}

.doc-list-item.archived .doc-thumbnail img,
.doc-list-item.archived .doc-thumbnail .dashicons {
    opacity: 0.5;
}

.view-grid .doc-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.view-grid .doc-thumbnail .dashicons {
    font-size: 32px;
    color: #999;
}

/* ==========================================================================
Table View
========================================================================== */

.docs-list-body.view-table {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.view-table .doc-list-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-bottom: 1px solid #e5e5e5;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.view-table .doc-list-item:first-child {
    border-top: 1px solid #e5e5e5;
}

.view-table .doc-list-item:hover {
    background: #f8f9fa;
}

.view-table .doc-thumbnail {
    flex-shrink: 0;
    width: 80px !important;
    height: 60px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: 1px solid #e5e5e5;
    overflow: hidden;
    position: relative;
}

.view-table .doc-archived-tag {
    font-size: 9px;
    padding: 2px 6px;
    top: 4px;
    right: 4px;
}

.view-table .doc-thumbnail .dashicons {
    font-size: 24px;
    color: #999;
}

.view-table .doc-thumbnail img {
    object-fit: cover;
    max-height: 100%;
}

.view-table .doc-details {
    flex: 1;
    min-width: 0;
}

.view-table .doc-details h4.doc-name {
    margin: 0 0 8px 0;
    font-size: 0.85rem;
    color: #333;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.view-table .doc-suppliers {
    margin: 0;
    padding: 0;
    font-size: 13px;
    color: #666;
    line-height: 1.3;
}

.view-table .doc-date {
    line-height: 1.6rem;
}

.view-table .doc-meta {
    margin: 0;
    padding: 0;
    font-size: 0.7rem;
    color: #999;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.view-table .doc-type {
    height: 1.6rem;
    display: flex;
    align-items: center;
    background: none;
}

.view-table .doc-info-row {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* ==========================================================================
Document Details
========================================================================== */

.doc-details h4.doc-name {
    margin: 0 0 5px;
    font-size: 16px;
    color: #333;
    font-weight: 600;
    line-height: 1.3;
}

.doc-suppliers {
    margin: 0 0 8px;
    font-size: 13px;
    color: #666;
    line-height: 1.3;
    padding-bottom: 0.4rem;
}

.doc-meta {
    margin: 0;
    font-size: 0.7rem;
    color: #999;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.doc-type {
    background: #eef6f3;
    padding: 0 0.7rem;
    font-weight: 500;
    color: #7e8a86;
}

.doc-date {
    font-style: italic;
}

/* ==========================================================================
Mobile Responsive
========================================================================== */

@media (max-width: 768px) {
    .supplier-documents-section .documents-header {
        align-items: stretch;
        gap: 8px;
    }
    
    /* Grid view adjustments */
    .docs-list-body.view-grid {
        grid-template-columns: 1fr;
    }
    
    /* Table view remains flex on mobile */
    .view-table .doc-list-item {
        align-items: flex-start;
        gap: 1.6rem;
        border: 1px solid #ddd;
        margin-bottom: 15px;
        border-radius: 6px;
        background: #fff;
    }

    .view-table .doc-type {
        padding: 0;
    }

    .view-table .doc-thumbnail {
        width: 100%;
        height: 120px;
        margin: 0;
    }

    .view-table .doc-details {
        width: 100%;
    }

    .view-table .doc-details h4.doc-name {
        white-space: normal;
        margin-bottom: 10px;
    }
    
    #supplier-docs-list-modal .psm-modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    #supplier-docs-list-modal .psm-modal-header,
    #supplier-docs-list-modal .psm-modal-body {
        padding: 15px 20px;
    }
    
    .docs-view-controls {
        flex-wrap: wrap;
        flex-direction: column;
        gap: 8px;
    }
    
    .view-toggle {
        padding: 6px 10px;
        font-size: 13px;
    }
    .docs-filters-left {
        flex-wrap: wrap;
        width: 100% !important;
    }
    .docs-search-wrapper, .psm-modal input[type=text].docs-search-input {
        max-width: 100%;
        width: 100% !important;
        min-width: 100%;
    }
    .psm-modal .select2-container {
        width: calc(50% - 5px) !important;
    }
    .view-grid .doc-list-item {
        width: calc(100% - 5rem);
    }
}

@media (max-width: 480px) {
    .supplier-documents-section {
        margin-top: 15px;
        padding-top: 15px;
    }
    
    #supplier-docs-list-modal .psm-modal-header h2 {
        width: calc(100% - 5rem);
    }
}

.doc-type,
.psm-modal-content,
.doc-thumbnail-wrapper,
.view-table .doc-thumbnail,
.view-grid .doc-thumbnail {
    border-radius: var(--border-radius-p);
}

/* ==========================================================================
Palomarr Logo on Supplier Cards
========================================================================== */

.card-palomarr-logo-container {
    display: flex;
    justify-content: flex-end;
    padding: 1rem 0.2rem 1rem 0;
}

.card-palomarr-logo {
    width: 6rem !important;
    height: auto !important;
}

body[data-col-gap="50px"] .wpb_row:not(.full-width-section):not(.full-width-content).supplier-content {
    margin-bottom: 0 !important;
}

@media (max-width: 640px) {
    .card-palomarr-logo-container {
        padding: 0 0 2rem 0;
    }
}