.vendor-master-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.vendor-master-hero {
    background: linear-gradient(135deg, #111827 0%, #4c1d95 50%, #7c3aed 100%);
    color: #f9fafb;
    padding: 22px 26px;
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.vendor-master-hero::after {
    content: '';
    position: absolute;
    right: -80px;
    top: -80px;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.25), transparent 60%);
    opacity: 0.8;
    pointer-events: none;
}

.vendor-master-title {
    display: flex;
    align-items: center;
    gap: 16px;
}

.vendor-master-title h2 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 700;
}

.vendor-master-title p {
    margin: 4px 0 0;
    color: rgba(249, 250, 251, 0.72);
    font-size: 0.95rem;
}

.vendor-master-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.vendor-master-actions .btn {
    border-color: rgba(255, 255, 255, 0.35);
    color: #0c1f32;
}

.vendor-master-tabs {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
    border: 1px solid #eef1f5;
    overflow: hidden;
}

.vendor-tab-header {
    display: flex;
    gap: 10px;
    padding: 12px;
    border-bottom: 1px solid #edf1f7;
    background: #f8fafc;
}

.vendor-tab-btn {
    padding: 10px 16px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    transition: all 0.2s ease;
    border-radius: 999px;
    white-space: nowrap;
}

.vendor-tab-btn:hover {
    background: rgba(15, 23, 42, 0.06);
}

.vendor-tab-btn.active {
    color: #fff;
    background: #111827;
    border-color: #111827;
    box-shadow: 0 8px 18px rgba(17, 24, 39, 0.2);
}

.vendor-tab-btn.active:after {
    display: none;
}

.vendor-tab-btn.vendor-tab-hidden {
    display: none !important;
}

.vendor-tab-content {
    display: none;
    padding: 26px;
    background: #fff;
}

.vendor-tab-content.active {
    display: block;
}

.vendor-form {
    max-width: 1000px;
}

#add-details-tab .vendor-form {
    max-width: none;
    width: 100%;
}

#add-details-tab .vendor-details-container {
    width: 100%;
    align-items: start;
}

#add-details-tab .vendor-details-section {
    min-width: 0;
}

.vendor-details-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.vendor-details-section {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

@media (max-width: 900px) {
    .vendor-master-hero {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .vendor-master-actions {
        width: 100%;
    }

    .vendor-master-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .vendor-tab-header {
        flex-wrap: wrap;
    }

    .agreement-view-grid {
        grid-template-columns: 1fr;
    }
}

.vendor-details-section h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 16px;
    display: flex;
    align-items: center;
}

.vendor-details-section h4 i {
    margin-right: 8px;
    color: #3498db;
}

/* vendor actiive/inactive, delete button style*/

.badge {
    display: inline-block;
    padding: 0.25em 0.6em;
    font-size: 75%;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

.badge-success {
    color: #fff;
    background-color: #28a745;
}

.badge-danger {
    color: #fff;
    background-color: #dc3545;
}

.badge-warning {
    color: #212529;
    background-color: #ffc107;
}

.vendor-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #dee2e6;
}

.vendor-detail-header h3 {
    margin: 0;
}

.btn-group {
    display: inline-flex;
    gap: 5px;
}

.vendor-action-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.vendor-action-icons {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.vendor-icon-btn {
    width: 30px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.vendor-action-menu {
    position: relative;
}

.vendor-action-menu-list {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 190px;
    background: #fff;
    border: 1px solid #dbe3ef;
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
    padding: 6px;
    display: none;
    z-index: 30;
}

.vendor-action-menu.open .vendor-action-menu-list {
    display: block;
}

.vendor-action-menu-item {
    width: 100%;
    border: none;
    background: transparent;
    padding: 8px 10px;
    border-radius: 8px;
    text-align: left;
    font-size: 13px;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 8px;
}

.vendor-action-menu-item:hover {
    background: #f8fafc;
}

.vendor-action-menu-item.warning {
    color: #9a6700;
}

.vendor-action-menu-item.success {
    color: #166534;
}

.vendor-action-menu-item.danger {
    color: #b91c1c;
}

.vendor-agreement-view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.vendor-agreement-view-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #0f172a;
}

.vendor-agreement-view-header p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 0.9rem;
}

.vendor-agreement-view-container {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    padding: 16px;
    min-height: 220px;
}

.agreement-view-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.agreement-summary-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
}

.agreement-summary-strip > div {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    padding: 10px 12px;
    display: grid;
    gap: 4px;
}

.agreement-summary-strip span {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #64748b;
}

.agreement-summary-strip strong {
    color: #0f172a;
}

.agreement-status-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-left: 6px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    border: 1px solid #cbd5e1;
    color: #475569;
    background: #f8fafc;
    vertical-align: middle;
}

.agreement-status-badge.active {
    color: #166534;
    border-color: #bbf7d0;
    background: #dcfce7;
}

.agreement-status-badge.expiring-soon {
    color: #9a3412;
    border-color: #fed7aa;
    background: #ffedd5;
}

.agreement-status-badge.critical {
    color: #b91c1c;
    border-color: #fecaca;
    background: #fee2e2;
}

.agreement-status-badge.expired {
    color: #fee2e2;
    border-color: #7f1d1d;
    background: #7f1d1d;
}

.agreement-status-badge.no-agreement {
    color: #64748b;
    background: #f1f5f9;
}

.agreement-view-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 12px;
}

.agreement-view-item .label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #64748b;
    margin-bottom: 4px;
}

.agreement-view-item .value {
    color: #0f172a;
    font-weight: 600;
    word-break: break-word;
}

.agreement-view-item a {
    color: #0369a1;
    text-decoration: none;
}

.agreement-view-item a:hover {
    text-decoration: underline;
}

.agreement-view-empty {
    color: #64748b;
}

.agreement-version-history {
    margin-top: 14px;
    border: 1px solid #dbe5f1;
    border-radius: 12px;
    background: #ffffff;
    padding: 14px;
    display: grid;
    gap: 8px;
}

.agreement-version-row {
    display: grid;
    grid-template-columns: 24px minmax(90px, 1fr) minmax(100px, 1fr) auto minmax(130px, auto) auto auto;
    gap: 8px;
    align-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 9px 10px;
    background: #f8fafc;
}

.agreement-version-row.selected {
    border-color: #a855f7;
    background: #faf5ff;
}

.agreement-version-select {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.agreement-version-select input {
    width: 15px;
    height: 15px;
    accent-color: #8b5cf6;
}

.agreement-version-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    border: 1px solid #eadcff;
    border-radius: 10px;
    background: #fbf8ff;
    padding: 8px 10px;
}

.agreement-version-selected-count {
    color: #4c1d95;
    font-size: 0.82rem;
    font-weight: 800;
}

.agreement-version-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.agreement-comparison-quick-text {
    color: #5b21b6;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 2px 4px;
}

.agreement-comparison-quick-text span {
    margin-left: 12px;
}

.agreement-version-limit-message {
    min-height: 18px;
    color: #991b1b;
    font-size: 0.78rem;
    font-weight: 700;
}

.agreement-version-compare-menu {
    position: relative;
    justify-self: end;
}

.agreement-version-compare-toggle {
    white-space: nowrap;
}

.agreement-version-compare-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 30;
    display: none;
    width: 220px;
    border: 1px solid #dbe5f1;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.14);
    overflow: hidden;
}

.agreement-version-compare-menu.open .agreement-version-compare-dropdown {
    display: grid;
}

.agreement-version-compare-action {
    border: 0;
    border-bottom: 1px solid #eef2f7;
    background: #ffffff;
    color: #172033;
    padding: 9px 11px;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}

.agreement-version-compare-action:last-child {
    border-bottom: 0;
}

.agreement-version-compare-action:hover:not(:disabled) {
    background: #faf5ff;
    color: #6d28d9;
}

.agreement-version-compare-action:disabled {
    color: #94a3b8;
    cursor: not-allowed;
}

.agreement-comparison-dialog {
    width: min(920px, 100%);
}

.agreement-comparison-modal-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.agreement-comparison-modal-card {
    border: 1px solid #dbe5f1;
    border-radius: 10px;
    background: #f8fafc;
    padding: 12px;
}

.agreement-comparison-modal-card > span {
    display: block;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.agreement-comparison-modal-card > strong {
    display: block;
    margin-top: 4px;
    color: #111827;
    font-size: 1rem;
}

.agreement-comparison-modal-card dl {
    display: grid;
    gap: 7px;
    margin: 12px 0 0;
}

.agreement-comparison-modal-card dl div {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 8px;
}

.agreement-comparison-modal-card dt {
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 700;
}

.agreement-comparison-modal-card dd {
    margin: 0;
    color: #172033;
    font-size: 0.8rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.agreement-comparison-swap-btn {
    width: 38px;
    height: 38px;
    border: 1px solid #8b5cf6;
    border-radius: 999px;
    background: #ffffff;
    color: #7c3aed;
    cursor: pointer;
}

.agreement-comparison-status {
    min-height: 20px;
    color: #5b21b6;
    font-size: 0.82rem;
    font-weight: 700;
}

.agreement-version-status {
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: capitalize;
    background: #e0f2fe;
    color: #075985;
}

.agreement-version-status.approved {
    background: #dcfce7;
    color: #166534;
}

.agreement-version-status.rejected {
    background: #fee2e2;
    color: #991b1b;
}

.agreement-version-view-dialog {
    width: min(840px, 100%);
}

.agreement-version-view-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.agreement-version-rejection {
    border: 1px solid #fecaca;
    border-radius: 10px;
    background: #fff5f5;
    padding: 10px 12px;
}

.agreement-version-rejection .label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #991b1b;
    margin-bottom: 4px;
}

.agreement-version-rejection p {
    margin: 0;
    color: #7f1d1d;
}

.agreement-update-notice {
    border: 1px solid #fecaca;
    background: #fff5f5;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.agreement-update-notice h4 {
    margin: 0;
    font-size: 0.94rem;
    color: #b91c1c;
}

.agreement-update-notice p {
    margin: 4px 0 0;
    color: #7f1d1d;
    font-size: 0.8rem;
}

.agreement-pending-inline {
    display: inline-block;
    margin-top: 4px;
    font-size: 0.76rem;
    color: #dc2626;
    font-weight: 700;
}

.agreement-update-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.agreement-update-modal.open {
    display: flex;
}

.agreement-update-dialog {
    width: min(760px, 100%);
    max-height: 88vh;
    overflow-y: auto;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    padding: 14px;
    display: grid;
    gap: 12px;
}

.agreement-update-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
}

.agreement-update-header h4 {
    margin: 0;
    color: #0f172a;
    font-size: 1rem;
}

.agreement-update-header p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 0.8rem;
}

.agreement-update-body {
    display: grid;
    gap: 8px;
}

.agreement-compare-row {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px;
    background: #f8fafc;
    display: grid;
    gap: 8px;
}

.agreement-compare-label {
    font-size: 0.76rem;
    text-transform: uppercase;
    color: #475569;
    letter-spacing: 0.05em;
}

.agreement-compare-values {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.agreement-compare-old {
    color: #64748b;
    text-decoration: line-through;
}

.agreement-compare-arrow {
    color: #94a3b8;
}

.agreement-compare-new {
    color: #b91c1c;
    font-weight: 700;
}

.agreement-update-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.agreement-request-shell {
    margin-top: 18px;
    border: 1px solid #dbe5f1;
    border-radius: 12px;
    background: #ffffff;
    padding: 14px;
}

.agreement-request-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.agreement-request-header h4 {
    margin: 0;
    font-size: 1rem;
    color: #0f172a;
}

.agreement-request-header p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 0.86rem;
}

.agreement-request-form {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fbff;
    padding: 12px;
    margin-bottom: 12px;
}

.agreement-request-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.agreement-request-form-grid .form-group {
    margin-bottom: 0;
}

.agreement-request-form-grid .form-group-wide {
    grid-column: 1 / -1;
}

.agreement-request-form-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.agreement-request-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
}

.agreement-request-list-panel {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    padding: 10px;
    min-height: 320px;
}

.agreement-request-list-panel h5 {
    margin: 0 0 8px;
    font-size: 0.9rem;
    color: #334155;
}

.agreement-request-list {
    display: grid;
    gap: 8px;
}

.agreement-request-list-empty {
    color: #64748b;
    font-size: 0.86rem;
    padding: 8px;
}

.agreement-request-row {
    border: 1px solid #d7e3f1;
    border-radius: 10px;
    background: #fff;
    padding: 8px;
    width: 100%;
    text-align: left;
}

.agreement-request-row:hover {
    border-color: #8fc4f8;
    background: #f3f8ff;
}

.agreement-request-row.active {
    border-color: #2563eb;
    background: #e8f1ff;
}

.agreement-request-row-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.agreement-request-row-top strong {
    font-size: 0.84rem;
    color: #0f172a;
}

.agreement-request-row-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
    font-size: 0.78rem;
    color: #475569;
}

.agreement-request-row-time {
    margin-top: 5px;
    font-size: 0.74rem;
    color: #64748b;
}

.agreement-request-unread {
    background: #dc2626;
    color: #fff;
    font-size: 0.68rem;
    padding: 2px 6px;
    border-radius: 999px;
}

.agreement-request-status {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.agreement-request-status.open {
    color: #b45309;
    background: #fff7ed;
    border: 1px solid #fdba74;
}

.agreement-request-status.in-progress {
    color: #1d4ed8;
    background: #eff6ff;
    border: 1px solid #93c5fd;
}

.agreement-request-status.resolved {
    color: #166534;
    background: #f0fdf4;
    border: 1px solid #86efac;
}

.agreement-request-thread {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    padding: 12px;
    min-height: 320px;
    display: grid;
    gap: 10px;
}

.agreement-request-thread-empty {
    color: #64748b;
    font-size: 0.88rem;
}

.agreement-request-thread-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.agreement-request-thread-header h4 {
    margin: 0;
    font-size: 0.95rem;
}

.agreement-request-thread-header p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 0.78rem;
}

.agreement-request-thread-status {
    width: 170px;
}

.agreement-request-thread-status label {
    display: block;
    font-size: 0.72rem;
    color: #64748b;
    margin-bottom: 4px;
}

.agreement-request-thread-body {
    display: grid;
    gap: 10px;
}

.agreement-request-origin {
    border: 1px solid #e2e8f0;
    background: #ffffff;
    border-radius: 10px;
    padding: 10px;
    display: grid;
    gap: 6px;
}

.agreement-request-origin .label {
    font-size: 0.68rem;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.05em;
}

.agreement-request-origin strong {
    font-size: 0.88rem;
    color: #0f172a;
}

.agreement-request-origin p {
    margin: 0;
    color: #334155;
    white-space: pre-wrap;
    font-size: 0.85rem;
}

.agreement-chat-history {
    display: grid;
    gap: 8px;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 2px;
}

.agreement-chat-row {
    display: flex;
}

.agreement-chat-row.admin {
    justify-content: flex-end;
}

.agreement-chat-row.vendor {
    justify-content: flex-start;
}

.agreement-chat-bubble {
    max-width: min(78%, 520px);
    border-radius: 12px;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
}

.agreement-chat-bubble.admin {
    background: #dbeafe;
    border-color: #93c5fd;
}

.agreement-chat-bubble.vendor {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.agreement-chat-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
    margin-bottom: 4px;
}

.agreement-chat-meta strong {
    font-size: 0.75rem;
    color: #1e293b;
}

.agreement-chat-meta span {
    font-size: 0.68rem;
    color: #64748b;
}

.agreement-chat-bubble p {
    margin: 0;
    font-size: 0.83rem;
    color: #0f172a;
    white-space: pre-wrap;
}

.agreement-request-reply-form {
    display: grid;
    gap: 8px;
}

.agreement-request-reply-form label {
    font-size: 0.78rem;
    color: #475569;
}

.agreement-request-reply-actions {
    display: flex;
    justify-content: flex-end;
}

@media (max-width: 1100px) {
    .agreement-version-row {
        grid-template-columns: 24px minmax(0, 1fr) auto;
    }

    .agreement-version-row small,
    .agreement-version-row .agreement-version-compare-menu,
    .agreement-version-row .agreement-version-view-btn {
        grid-column: 2 / -1;
        justify-self: start;
    }

    .agreement-version-toolbar,
    .agreement-comparison-modal-body {
        grid-template-columns: 1fr;
        display: grid;
    }

    .agreement-comparison-quick-text span {
        display: block;
        margin-left: 0;
        margin-top: 3px;
    }

    .agreement-request-form-grid {
        grid-template-columns: 1fr;
    }

    .agreement-request-layout {
        grid-template-columns: 1fr;
    }

    .agreement-update-notice {
        flex-direction: column;
        align-items: flex-start;
    }

    .agreement-update-actions {
        justify-content: stretch;
    }

    .agreement-update-actions .btn {
        flex: 1;
    }
}

/* Template styles */
.uploaded-files-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    margin-top: 10px;
}

.uploaded-files-list .list-group-item {
    padding: 8px 12px;
    border-left: none;
    border-right: none;
}

.uploaded-files-list .list-group-item:first-child {
    border-top: none;
}

.uploaded-files-list .list-group-item:last-child {
    border-bottom: none;
}

.template-name {
    font-weight: 500;
    color: #333;
}

.detail-files-list {
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    max-height: 200px;
    overflow-y: auto;
}

.detail-files-list .list-group-item {
    background-color: transparent;
    border: 1px solid #dee2e6;
    margin-bottom: 5px;
}

.progress {
    height: 25px;
}

.progress-bar {
    font-size: 12px;
    line-height: 25px;
}

#files-list {
    max-height: 150px;
    overflow-y: auto;
}

/* Vendor Detail Modal Styles */
.vendor-detail-container {
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 10px;
}

.vendor-detail-section {
    margin-bottom: 20px;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
}

.detail-row {
    display: flex;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.detail-row:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: #555;
    min-width: 150px;
}

.detail-value {
    color: #333;
    flex-grow: 1;
}

/* Template Notes Styles */
.template-notes {
    background-color: #f8f9fa;
    border-left: 3px solid #17a2b8;
    padding: 8px 12px;
    border-radius: 4px;
    margin-top: 5px;
}

.uploaded-files-list .list-group-item {
    border: 1px solid #dee2e6;
    margin-bottom: 8px;
    border-radius: 6px;
}

.uploaded-files-list .list-group-item:hover {
    background-color: #f8f9fa;
}

/* Notes Modal Styles */
#template-notes-modal .modal-content {
    border-radius: 8px;
    border: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

#template-notes-modal .modal-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    border-radius: 8px 8px 0 0;
    padding: 15px 20px;
}

#template-notes-modal .modal-body {
    padding: 20px;
}

#template-notes-modal .modal-footer {
    border-top: 1px solid #dee2e6;
    padding: 15px 20px;
}

/* Bulk Upload Modal Styles */
#template-upload-modal .modal-content {
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

#template-upload-modal .modal-header {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.98) 45%, rgba(91, 33, 182, 0.94) 100%);
    color: white;
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    padding: 20px;
}

#template-upload-modal .modal-body {
    padding: 25px;
    background-color: #f8f9fa;
}

#template-upload-modal .modal-footer {
    border-top: 1px solid #e9ecef;
    padding: 15px 20px;
    background-color: white;
    border-radius: 0 0 10px 10px;
}

#selected-files-list {
    background-color: white;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #e9ecef;
}

#files-list .list-group-item {
    border: 1px solid #e9ecef;
    margin-bottom: 5px;
    border-radius: 6px;
    transition: all 0.2s;
}

#files-list .list-group-item:hover {
    background-color: #f8f9fa;
    transform: translateX(5px);
}

#bulk-upload-notes {
    resize: vertical;
    min-height: 100px;
}

/* Progress Bar Styles */
#upload-progress {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e9ecef;
}

.progress {
    height: 20px;
    border-radius: 10px;
    overflow: hidden;
    background-color: #e9ecef;
}

.progress-bar {
    background: linear-gradient(45deg, #667eea, #764ba2);
    transition: width 0.3s ease;
}

#progress-text {
    font-weight: 600;
    color: #495057;
}

/* Notes display in templates list */
.template-notes {
    background-color: #f0f7ff;
    border-left: 3px solid #4dabf7;
    padding: 8px 12px;
    border-radius: 4px;
    margin-top: 8px;
    font-style: italic;
    color: #495057;
}

.template-notes i {
    color: #4dabf7;
}

/* Button styles */
#start-upload-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 10px 25px;
    font-weight: 600;
    transition: all 0.3s;
}

#start-upload-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

#start-upload-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Form Styles for Vendor Section */
.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .vendor-details-container {
        grid-template-columns: 1fr;
    }

    .vendor-tab-header {
        flex-wrap: wrap;
    }

    .vendor-tab-btn {
        flex: 1;
        text-align: center;
        padding: 10px 5px;
        font-size: 13px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .detail-row {
        flex-direction: column;
    }

    .detail-label {
        margin-bottom: 5px;
    }
}

/* Vendor Table Styles */
#vendors-table_wrapper {
    margin-top: 20px;
}

#vendors-table {
    width: 100% !important;
}

#vendors-table th {
    background: #2c3e50;
    color: white;
    font-weight: 500;
}

#vendors-table td {
    vertical-align: middle;
}

/* DataTables sorting polish: one compact cue per sortable vendor column */
#vendors-table.dataTable thead th.sorting,
#vendors-table.dataTable thead th.sorting_asc,
#vendors-table.dataTable thead th.sorting_desc,
#vendors-table.dataTable thead th.sorting_asc_disabled,
#vendors-table.dataTable thead th.sorting_desc_disabled {
    background-image: none !important;
    background-repeat: no-repeat !important;
    position: relative;
    padding-right: 30px !important;
}

#vendors-table.dataTable thead th.sorting:before,
#vendors-table.dataTable thead th.sorting_asc:before,
#vendors-table.dataTable thead th.sorting_desc:before,
#vendors-table.dataTable thead th.sorting_asc_disabled:before,
#vendors-table.dataTable thead th.sorting_desc_disabled:before {
    content: none !important;
    display: none !important;
}

#vendors-table.dataTable thead th.sorting:after,
#vendors-table.dataTable thead th.sorting_asc:after,
#vendors-table.dataTable thead th.sorting_desc:after {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 12px;
    top: 50%;
    width: 15px;
    height: 15px;
    transform: translateY(-50%);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0;
    pointer-events: none;
}

#vendors-table.dataTable thead th.sorting:after {
    content: "\2195" !important;
    color: rgba(226, 232, 240, 0.72);
    opacity: 0.72 !important;
}

#vendors-table.dataTable thead th.sorting_asc:after {
    content: "\2191" !important;
    color: #ffffff;
    background: rgba(139, 92, 246, 0.35);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
    opacity: 1 !important;
}

#vendors-table.dataTable thead th.sorting_desc:after {
    content: "\2193" !important;
    color: #ffffff;
    background: rgba(139, 92, 246, 0.35);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
    opacity: 1 !important;
}

#vendors-table.dataTable thead th.sorting_asc_disabled:after,
#vendors-table.dataTable thead th.sorting_desc_disabled:after,
#vendors-table.dataTable thead th.sorting_disabled:after {
    content: none !important;
    display: none !important;
}

.vendor-tag-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.vendor-tag-filter-control {
    min-width: 180px;
    max-width: 240px;
}

@media (max-width: 900px) {
    .vendor-tag-filter-control {
        min-width: 0;
        max-width: none;
        width: 100%;
    }
}

.vendor-tag-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 700;
    color: #166534;
    background: #dcfce7;
    border: 1px solid #86efac;
    line-height: 1.25;
}

.vendor-master-logo {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    overflow: hidden;
    background: linear-gradient(135deg, #22d3ee, #a3e635);
    color: #0f172a;
    font-size: 0.78rem;
    font-weight: 800;
}

.vendor-master-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.vendor-master-name-cell {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    font-weight: 700;
    color: #0f172a;
}

.vendor-master-name-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vendor-tag-empty {
    font-size: 12px;
    color: #64748b;
}

.vendor-tag-predefined {
    margin-left: auto;
    font-size: 10px;
    font-weight: 700;
    color: #14532d;
    background: #bbf7d0;
    border: 1px solid #86efac;
    border-radius: 999px;
    padding: 2px 8px;
}

.vendor-tag-modal-content {
    width: min(680px, 94vw);
}

.vendor-tag-modal-subtitle {
    margin: 0 0 12px;
    color: #334155;
    font-weight: 600;
}

.vendor-tag-modal-controls {
    display: grid;
    gap: 10px;
    margin-bottom: 10px;
}

.vendor-tag-create-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

.vendor-tag-modal-selected {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
    margin-bottom: 10px;
    min-height: 40px;
}

.vendor-tag-modal-list {
    max-height: 280px;
    overflow: auto;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 6px;
}

.vendor-tag-option {
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
}

.vendor-tag-option:hover {
    background: #f8fafc;
}

.vendor-tag-option input {
    width: 16px;
    height: 16px;
}

.vendor-tag-option-name {
    font-size: 13px;
    color: #0f172a;
    font-weight: 600;
}

.view-vendor-btn {
    padding: 5px 10px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
}

.view-vendor-btn i {
    margin-right: 5px;
}

/* Status Messages */
#vendor-basic-status,
#vendor-details-status {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
    display: none;
}

#vendor-basic-status.success,
#vendor-details-status.success {
    background: #d4edda;
    color: #155724;
    display: block;
}

#vendor-basic-status.error,
#vendor-details-status.error {
    background: #f8d7da;
    color: #721c24;
    display: block;
}

/* TDS Section Styles */
#tds-details {
    background: #f1f1f1;
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
}

/* MSME Section Styles */
#msme-details {
    background: #f1f1f1;
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
}

/* Radio Group Styles */
.radio-group {
    display: flex;
    gap: 15px;
    margin-top: 5px;
}

.radio-container {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.radio-container input {
    margin-right: 5px;
}

/* Loading Spinner for Vendor Operations */
.vendor-loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.vendor-loading.active {
    display: block;
}

.vendor-loading .spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 4px solid #3498db;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Export Button Styles */
#export-vendors {
    margin-left: 10px;
    display: inline-flex;
    align-items: center;
}

#export-vendors i {
    margin-right: 5px;
}

/* Vendor detail styles */
.vendor-detail-container {
    max-height: 60vh;
    overflow-y: auto;
}

.vendor-detail-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.vendor-detail-section h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.detail-row {
    display: flex;
    margin-bottom: 8px;
}

.detail-label {
    font-weight: 600;
    min-width: 150px;
    color: #555;
}

.detail-value {
    flex: 1;
    color: #333;
}

/* Extracted data styles */
.extracted-data-container {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 15px;
}

.extracted-data-container h4 {
    color: #2c3e50;
    margin-bottom: 15px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .detail-row {
        flex-direction: column;
    }

    .detail-label {
        min-width: auto;
        margin-bottom: 5px;
    }
}

/* ============================================
   VENDOR DOCUMENT MANAGEMENT STYLES
   ============================================ */

/* Document Status Badges */
.badge {
    display: inline-block;
    padding: 0.25em 0.6em;
    font-size: 0.75em;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out;
}

.badge-success {
    background-color: #28a745;
    color: white;
}

.badge-warning {
    background-color: #ffc107;
    color: #212529;
}

.badge-danger {
    background-color: #dc3545;
    color: white;
}

.badge-info {
    background-color: #17a2b8;
    color: white;
}

.badge-secondary {
    background-color: #6c757d;
    color: white;
}

/* Document Cards */
.document-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    background: white;
    transition: box-shadow 0.3s ease;
}

.document-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.document-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.document-info {
    flex: 1;
}

.document-actions {
    display: flex;
    gap: 0.5rem;
}

.document-type-badge {
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.document-name {
    font-weight: 600;
    color: #333;
    margin: 0.5rem 0;
}

.document-meta {
    color: #666;
    font-size: 0.85rem;
    display: flex;
    gap: 1rem;
}

.document-notes {
    background: #f8f9fa;
    padding: 0.75rem;
    border-radius: 6px;
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: #555;
}

.document-notes i {
    color: #6c757d;
    margin-right: 0.5rem;
}

/* Document List */
.document-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

.document-list-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
}

.document-list-item:last-child {
    border-bottom: none;
}

.document-list-item:hover {
    background-color: #f8f9fa;
}

.document-list-info {
    flex: 1;
}

.document-list-name {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.document-list-meta {
    font-size: 0.8rem;
    color: #6c757d;
}

/* OCR Status Indicators */
.ocr-status {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.ocr-status.pending {
    background: #e9ecef;
    color: #6c757d;
}

.ocr-status.processing {
    background: #fff3cd;
    color: #856404;
}

.ocr-status.completed {
    background: #d4edda;
    color: #155724;
}

.ocr-status.failed {
    background: #f8d7da;
    color: #721c24;
}

/* Document Preview */
.document-preview-container {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: #f8f9fa;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pdf-preview {
    width: 100%;
    height: 400px;
    border: none;
}

.preview-placeholder {
    text-align: center;
    color: #6c757d;
}

.preview-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #adb5bd;
}

/* OCR Data Display */
.ocr-data-display {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.structured-data-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.structured-data-table th {
    background: #e9ecef;
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
}

.structured-data-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #dee2e6;
}

.structured-data-table tr:hover {
    background: #f8f9fa;
}

.raw-text-preview {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 0.75rem;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
}

/* JSON Data Controls */
.json-controls {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.json-controls .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* File Upload Area */
.file-upload-area {
    border: 2px dashed #adb5bd;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    background: #f8f9fa;
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: #6c757d;
    background: #e9ecef;
}

.file-upload-area.dragover {
    border-color: #007bff;
    background: #e7f1ff;
}

.file-upload-icon {
    font-size: 3rem;
    color: #adb5bd;
    margin-bottom: 1rem;
}

.file-upload-text {
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.file-upload-hint {
    font-size: 0.85rem;
    color: #adb5bd;
}

/* Selected Files List */
.selected-files {
    margin-top: 1rem;
}

.selected-file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.file-icon {
    color: #dc3545;
    font-size: 1.25rem;
}

.file-details {
    flex: 1;
}

.file-name {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.file-size {
    font-size: 0.8rem;
    color: #6c757d;
}

.file-remove {
    color: #dc3545;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.file-remove:hover {
    background: #f8d7da;
}

/* Upload Progress */
.upload-progress {
    margin-top: 1rem;
}

.progress-container {
    background: #e9ecef;
    border-radius: 4px;
    height: 6px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #0056b3);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-text {
    text-align: center;
    color: #6c757d;
    font-size: 0.85rem;
}

/* Document Type Selector */
.document-type-selector {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.type-option {
    flex: 1;
    text-align: center;
    padding: 1rem;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.type-option:hover {
    border-color: #adb5bd;
    background: #f8f9fa;
}

.type-option.selected {
    border-color: #007bff;
    background: #e7f1ff;
}

.type-icon {
    font-size: 2rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.type-option.selected .type-icon {
    color: #007bff;
}

.type-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.type-desc {
    font-size: 0.85rem;
    color: #6c757d;
}

/* Document View Modal */
.document-modal .modal-content {
    max-width: 1000px;
    max-height: 90vh;
    overflow: hidden;
}

.document-modal .modal-body {
    padding: 0;
    display: flex;
    flex-direction: column;
}

.document-view-container {
    display: flex;
    height: 600px;
    overflow: hidden;
}

.document-preview-section {
    flex: 1;
    border-right: 1px solid #dee2e6;
    padding: 1rem;
    overflow-y: auto;
}

.ocr-data-section {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    background: #f8f9fa;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #dee2e6;
}

.section-title {
    font-weight: 600;
    color: #333;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    min-width: 300px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 1rem;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #dee2e6;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.toast-body {
    padding: 1rem;
}

.toast-success .toast-header {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.toast-error .toast-header {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.toast-info .toast-header {
    background: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}

/* Responsive Design */
@media (max-width: 768px) {
    .document-view-container {
        flex-direction: column;
        height: auto;
    }

    .document-preview-section {
        border-right: none;
        border-bottom: 1px solid #dee2e6;
    }

    .document-type-selector {
        flex-direction: column;
    }

    .selected-file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .file-actions {
        align-self: flex-end;
    }

    .document-modal .modal-content {
        margin: 1rem;
        width: calc(100% - 2rem);
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .document-card {
        background: #2d3748;
        border-color: #4a5568;
    }

    .document-list {
        border-color: #4a5568;
        background: #2d3748;
    }

    .document-list-item {
        border-color: #4a5568;
    }

    .document-list-item:hover {
        background: #374151;
    }

    .ocr-data-display {
        background: #374151;
    }

    .structured-data-table th {
        background: #4a5568;
        color: white;
    }

    .raw-text-preview {
        background: #2d3748;
        border-color: #4a5568;
        color: #cbd5e0;
    }

    .file-upload-area {
        background: #374151;
        border-color: #4a5568;
    }

    .selected-file-item {
        background: #2d3748;
        border-color: #4a5568;
    }

    .type-option {
        background: #2d3748;
        border-color: #4a5568;
    }

    .type-option:hover {
        background: #374151;
    }

    .type-option.selected {
        background: #2c5282;
        border-color: #4299e1;
    }
}

/* Animation for loading states */
@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

.loading {
    animation: pulse 1.5s infinite;
}

/* Scrollbar Styling */
.document-list::-webkit-scrollbar,
.ocr-data-display::-webkit-scrollbar {
    width: 6px;
}

.document-list::-webkit-scrollbar-track,
.ocr-data-display::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.document-list::-webkit-scrollbar-thumb,
.ocr-data-display::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.document-list::-webkit-scrollbar-thumb:hover,
.ocr-data-display::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Print Styles */
@media print {

    .document-actions,
    .upload-progress,
    .file-upload-area,
    .type-option,
    .toast-container {
        display: none !important;
    }

    .document-view-container {
        height: auto;
        overflow: visible;
    }

    .document-preview-section,
    .ocr-data-section {
        page-break-inside: avoid;
        overflow: visible;
    }
}

/* Accessibility */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus Styles */
.btn:focus,
.type-option:focus,
.file-remove:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Document Statistics */
.document-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #007bff;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Document Filters */
.document-filters {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.filter-label {
    font-weight: 500;
    color: #495057;
}

.filter-select {
    min-width: 150px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state-icon {
    font-size: 4rem;
    color: #adb5bd;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #495057;
}

.empty-state-description {
    margin-bottom: 1.5rem;
}

/* Document Tags */
.document-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.document-tag {
    background: #e9ecef;
    color: #495057;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.document-tag.invoice {
    background: #d4edda;
    color: #155724;
}

.document-tag.po {
    background: #d1ecf1;
    color: #0c5460;
}

.document-tag.additional {
    background: #f8d7da;
    color: #721c24;
}

/* Document Search */
.document-search {
    position: relative;
    margin-bottom: 1.5rem;
}

.document-search input {
    padding-left: 2.5rem;
}

.document-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

/* Document Grid View */
.document-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.document-grid-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.document-grid-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.document-grid-header {
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
}

.document-grid-body {
    padding: 1rem;
}

.document-grid-footer {
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

/* Document Timeline */
.document-timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline-item {
    position: relative;
    padding-bottom: 2rem;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -2rem;
    top: 0;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: #007bff;
    border: 3px solid white;
    box-shadow: 0 0 0 3px #007bff;
}

.timeline-content {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 1rem;
}

.timeline-date {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

/* Custom Checkbox for Document Selection */
.document-select-checkbox {
    position: relative;
    width: 1.25rem;
    height: 1.25rem;
}

.document-select-checkbox input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.document-select-checkbox .checkmark {
    position: absolute;
    top: 0;
    left: 0;
    width: 1.25rem;
    height: 1.25rem;
    background: white;
    border: 2px solid #adb5bd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.document-select-checkbox input:checked~.checkmark {
    background: #007bff;
    border-color: #007bff;
}

.document-select-checkbox .checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 0.4rem;
    top: 0.1rem;
    width: 0.4rem;
    height: 0.8rem;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.document-select-checkbox input:checked~.checkmark:after {
    display: block;
}

/* Batch Actions Bar */
.batch-actions-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #007bff;
    color: white;
    padding: 1rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.batch-actions-bar.active {
    transform: translateY(0);
}

.batch-actions-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.batch-selection-count {
    font-weight: 500;
}

.batch-actions-buttons {
    display: flex;
    gap: 0.5rem;
}

/* Loading Skeletons */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-text:last-child {
    margin-bottom: 0;
    width: 80%;
}

.skeleton-card {
    padding: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

/* Document Quick Actions */
.quick-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.document-card:hover .quick-actions {
    opacity: 1;
}

.quick-action-btn {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    color: #6c757d;
    transition: all 0.2s ease;
}

.quick-action-btn:hover {
    background: #007bff;
    border-color: #007bff;
    color: white;
}

/* Document Version History */
.version-history {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
}

.version-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.version-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.version-number {
    font-weight: 500;
    color: #007bff;
}

.version-date {
    font-size: 0.85rem;
    color: #6c757d;
}

/* Document Comments */
.document-comments {
    margin-top: 1rem;
}

.comment-item {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.comment-author {
    font-weight: 500;
    color: #333;
}

.comment-time {
    font-size: 0.8rem;
    color: #6c757d;
}

.comment-text {
    color: #555;
    line-height: 1.4;
}

/* Document Sharing */
.share-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    color: #495057;
    transition: all 0.2s ease;
}

.share-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

/* Watermark for Sensitive Documents */
.watermarked {
    position: relative;
}

.watermarked::before {
    content: "CONFIDENTIAL";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    font-size: 4rem;
    color: rgba(0, 0, 0, 0.1);
    z-index: 1;
    pointer-events: none;
    font-weight: bold;
    opacity: 0.5;
}

/* 31 december*/

/* Header Tags Display Styles */
.header-tags-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.header-tag-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

.header-tag-section {
    padding: 15px;
}

.header-tag-title {
    color: #495057;
    font-weight: 600;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid #dee2e6;
    text-transform: capitalize;
}

.header-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.header-tag-item {
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 0.85rem;
    color: #495057;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.header-tag-item:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-2px);
}

.header-tag-item i {
    color: #6c757d;
    font-size: 0.75rem;
}

/* Raw text toggle button */
.btn-toggle-raw-text {
    font-size: 0.8rem;
    padding: 3px 10px;
}

/* Modal improvements for better viewing */
.modal-body {
    max-height: calc(90vh - 150px);
    overflow-y: auto;
}

.ocr-data-display {
    padding: 10px;
}

.vendor-detail-review-modal-content {
    width: min(1200px, 96vw);
    max-height: 92vh;
}

.vendor-detail-review-meta {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 14px;
    font-size: 13px;
    display: grid;
    gap: 6px;
}

.vendor-detail-review-layout {
    display: grid;
    gap: 12px;
    grid-template-columns: 1.1fr 1fr 1fr;
}

.vendor-detail-review-panel {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #ffffff;
    padding: 12px;
    min-height: 320px;
    max-height: 60vh;
    overflow: auto;
}

.vendor-detail-review-panel h4 {
    margin: 0 0 10px;
    font-size: 14px;
    color: #111827;
    font-weight: 700;
}

.vendor-detail-compare-row {
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 8px;
}

.vendor-detail-compare-row .label {
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 4px;
}

.vendor-detail-compare-row .value {
    font-size: 13px;
    word-break: break-word;
}

.vendor-detail-compare-row.old {
    background: #fff1f2;
    border: 1px solid #fecdd3;
    color: #9f1239;
}

.vendor-detail-compare-row.new {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.vendor-detail-activity-row {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f8fafc;
    padding: 8px 10px;
    margin-bottom: 8px;
}

.vendor-detail-activity-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.vendor-detail-activity-head strong {
    font-size: 13px;
}

.vendor-detail-activity-head small {
    font-size: 11px;
    color: #6b7280;
}

.vendor-detail-activity-meta {
    display: grid;
    gap: 3px;
    font-size: 12px;
    color: #334155;
}

.vendor-detail-activity-note {
    margin-top: 6px;
    font-size: 12px;
    color: #0f172a;
}

.vendor-detail-review-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.vendor-detail-review-subtabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 12px;
}

.vendor-detail-review-subtab-btn {
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    border-radius: 999px;
    transition: all 0.2s ease;
}

.vendor-detail-review-subtab-btn:hover {
    background: rgba(15, 23, 42, 0.06);
}

.vendor-detail-review-subtab-btn.active {
    color: #fff;
    background: #111827;
    border-color: #111827;
}

.vendor-detail-review-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.vendor-detail-review-empty-state i {
    font-size: 40px;
    color: #cbd5e1;
    margin-bottom: 14px;
    display: block;
}

.vendor-detail-review-empty-state h4 {
    font-size: 16px;
    font-weight: 700;
    color: #334155;
    margin: 0 0 6px;
}

.vendor-detail-review-empty-state p {
    font-size: 13px;
    margin: 0;
}

.vendor-detail-log-by {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}

#vendor-detail-review-logs-table td {
    vertical-align: top;
}

#vendor-detail-review-logs-table td:nth-child(1) > div,
#vendor-detail-review-logs-table td:nth-child(2) > div,
#vendor-detail-review-logs-table td:nth-child(3) > div {
    padding: 2px 0;
}

#vendor-detail-review-logs-table td:nth-child(1) > div:not(:last-child),
#vendor-detail-review-logs-table td:nth-child(2) > div:not(:last-child),
#vendor-detail-review-logs-table td:nth-child(3) > div:not(:last-child) {
    border-bottom: 1px dashed #eef1f6;
}

.vendor-detail-review-final-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #334155;
}

.vendor-action-modal {
    padding: 18px;
}

.vendor-action-modal.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.vendor-action-modal .modal-dialog {
    width: min(480px, calc(100vw - 32px));
    margin: 0 auto;
    pointer-events: auto;
}

.vendor-action-modal__content {
    width: 100%;
    max-width: none;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 26px 70px rgba(15, 23, 42, 0.28);
}

.vendor-action-modal__content::before {
    content: "";
    display: block;
    height: 5px;
    background: #10b981;
}

.vendor-action-modal--reject .vendor-action-modal__content::before {
    background: #ef4444;
}

.vendor-action-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin: 0;
    padding: 22px 24px 18px;
    border-bottom: 1px solid #e5e7eb;
}

.vendor-action-modal__title-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.vendor-action-modal__icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #047857;
    background: #d1fae5;
    box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.2);
}

.vendor-action-modal--reject .vendor-action-modal__icon {
    color: #b91c1c;
    background: #fee2e2;
    box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.22);
}

.vendor-action-modal__eyebrow {
    display: block;
    margin-bottom: 3px;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0;
    text-transform: uppercase;
}

.vendor-action-modal__header .modal-title {
    margin: 0;
    color: #0f172a;
    font-size: 18px;
    font-weight: 750;
    line-height: 1.25;
}

.vendor-action-modal__close {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: #f1f5f9;
    color: #475569;
    cursor: pointer;
    opacity: 1;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.vendor-action-modal__close::before {
    content: "\00d7";
    font-size: 22px;
    line-height: 1;
}

.vendor-action-modal__close:hover {
    background: #e2e8f0;
    color: #0f172a;
    transform: translateY(-1px);
}

.vendor-action-modal__body {
    padding: 22px 24px 20px;
    color: #334155;
    overflow: visible;
    max-height: none;
}

.vendor-action-modal__message {
    margin: 0;
    color: #334155;
    font-size: 14px;
    line-height: 1.6;
}

.vendor-action-modal__notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 16px;
    padding: 12px 14px;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    background: #f0fdf4;
    color: #166534;
    font-size: 13px;
    line-height: 1.45;
}

.vendor-action-modal__notice i {
    margin-top: 2px;
    color: #059669;
}

.vendor-action-modal__field {
    margin-top: 18px;
}

.vendor-action-modal__field .form-label {
    margin-bottom: 8px;
    color: #0f172a;
    font-size: 13px;
    font-weight: 700;
}

.vendor-action-modal__field .form-control {
    min-height: 112px;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    color: #0f172a;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.vendor-action-modal__field .form-control:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
    outline: none;
}

.vendor-action-modal__field .form-control::placeholder {
    color: #94a3b8;
}

.vendor-action-modal .field-error-msg {
    margin-top: 8px;
    font-size: 12px;
    font-weight: 600;
}

.vendor-action-modal__footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin: 0;
    padding: 16px 24px 22px;
    border-top: 1px solid #e5e7eb;
    background: #f8fafc;
}

.vendor-action-modal__secondary-btn,
.vendor-action-modal__primary-btn {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
}

.vendor-action-modal__secondary-btn {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
}

.vendor-action-modal__secondary-btn:hover {
    border-color: #94a3b8;
    background: #f1f5f9;
    color: #0f172a;
}

.vendor-action-modal__primary-btn {
    border: 1px solid #059669;
    background: #059669;
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(5, 150, 105, 0.22);
}

.vendor-action-modal__primary-btn:hover {
    border-color: #047857;
    background: #047857;
    color: #ffffff;
    transform: translateY(-1px);
}

.vendor-action-modal--reject .vendor-action-modal__primary-btn {
    border-color: #dc2626;
    background: #dc2626;
    box-shadow: 0 8px 18px rgba(220, 38, 38, 0.22);
}

.vendor-action-modal--reject .vendor-action-modal__primary-btn:hover {
    border-color: #b91c1c;
    background: #b91c1c;
}

.vendor-action-modal__secondary-btn:focus,
.vendor-action-modal__primary-btn:focus,
.vendor-action-modal__close:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.22);
}

@media (max-width: 1100px) {
    .vendor-detail-review-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .vendor-action-modal {
        padding: 12px;
    }

    .vendor-action-modal__header,
    .vendor-action-modal__body {
        padding-left: 18px;
        padding-right: 18px;
    }

    .vendor-action-modal__footer {
        flex-direction: column-reverse;
        align-items: stretch;
        padding: 14px 18px 18px;
    }

    .vendor-action-modal__secondary-btn,
    .vendor-action-modal__primary-btn {
        width: 100%;
    }
}

/* Dashboard theme alignment */
.vendor-master-page {
    padding: 0.25rem 0 1.5rem;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.06), transparent 26rem),
        linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

.vendor-master-hero {
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.98) 45%, rgba(91, 33, 182, 0.94) 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 1.4rem;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}

.vendor-master-hero::after {
    inset: 0;
    right: auto;
    top: auto;
    width: auto;
    height: auto;
    background:
        radial-gradient(circle at 12% 0%, rgba(255, 255, 255, 0.18), transparent 24rem),
        linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.07));
}

.vendor-master-title h2 {
    font-weight: 700;
    letter-spacing: -0.03em;
}

.vendor-master-title p {
    color: rgba(226, 232, 240, 0.82);
}

.vendor-master-icon {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.28);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.24);
}

.vendor-master-actions .btn {
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(255, 255, 255, 0.64);
    color: #4338ca;
    border-radius: 0.75rem;
    font-weight: 700;
}

.vendor-master-tabs {
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 1.15rem;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
}

.vendor-tab-header {
    background: #f8fafc;
    border-bottom-color: rgba(148, 163, 184, 0.18);
}

.vendor-tab-btn {
    color: #475569;
    border-radius: 0.85rem;
    font-weight: 700;
}

.vendor-tab-btn:hover {
    color: #1d4ed8;
    background: rgba(37, 99, 235, 0.08);
}

.vendor-tab-btn.active {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    border-color: transparent;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
}

.vendor-tab-content {
    background: #ffffff;
}

.vendor-details-section {
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 1rem;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.vendor-details-section h4 {
    color: #0f172a;
    font-weight: 700;
}

.vendor-details-section h4 i {
    color: #2563eb;
}

.vendor-master-page .form-control {
    border-color: rgba(148, 163, 184, 0.36);
    border-radius: 0.75rem;
}

.vendor-master-page .form-control:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 0.18rem rgba(37, 99, 235, 0.12);
}

.vendor-master-page .btn-primary {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    border-color: transparent;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
}

/* Vendor Details view modal refresh */
#vendor-detail-modal {
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    overflow: hidden;
    background:
        radial-gradient(circle at 18% 12%, rgba(124, 58, 237, 0.28), transparent 30rem),
        linear-gradient(135deg, rgba(2, 6, 23, 0.72), rgba(15, 23, 42, 0.64));
    backdrop-filter: blur(10px) saturate(1.05);
}

#vendor-detail-modal .modal-content {
    width: min(920px, calc(100vw - 3rem));
    max-width: 920px;
    height: min(86vh, 780px);
    max-height: min(86vh, 780px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 0;
    border-radius: 1.5rem;
    background: #ffffff;
    box-shadow: 0 34px 90px rgba(15, 23, 42, 0.32);
}

#vendor-detail-modal .modal-header {
    position: relative;
    flex: 0 0 auto;
    padding: 1.35rem 1.6rem;
    border: 0;
    color: #ffffff;
    background:
        radial-gradient(circle at 8% 0%, rgba(255, 255, 255, 0.18), transparent 18rem),
        linear-gradient(135deg, #111827 0%, #312e81 52%, #6d28d9 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

#vendor-detail-modal .modal-header::after {
    content: "";
    position: absolute;
    left: 1.6rem;
    right: 1.6rem;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.42), transparent);
}

#vendor-detail-modal .modal-header h3 {
    margin: 0;
    color: #ffffff;
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.035em;
}

#vendor-detail-modal .modal-close {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease;
}

#vendor-detail-modal .modal-close:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: translateY(-1px);
}

#vendor-detail-modal .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 1.4rem 1.6rem;
    overflow: auto;
    background:
        radial-gradient(circle at 100% 0%, rgba(124, 58, 237, 0.06), transparent 20rem),
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

#vendor-detail-modal .modal-body,
#vendor-detail-modal .vendor-detail-container,
#vendor-detail-modal .document-list,
#vendor-detail-modal .ocr-data-display,
#vendor-detail-modal .raw-text-preview,
#vendor-detail-modal .detail-files-list {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#vendor-detail-modal .modal-body::-webkit-scrollbar,
#vendor-detail-modal .vendor-detail-container::-webkit-scrollbar,
#vendor-detail-modal .document-list::-webkit-scrollbar,
#vendor-detail-modal .ocr-data-display::-webkit-scrollbar,
#vendor-detail-modal .raw-text-preview::-webkit-scrollbar,
#vendor-detail-modal .detail-files-list::-webkit-scrollbar {
    width: 0;
    height: 0;
}

#vendor-detail-modal .vendor-detail-container {
    max-height: none;
    overflow: visible;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

#vendor-detail-modal .vendor-detail-header {
    grid-column: 1 / -1;
    margin: 0;
    padding: 1.15rem;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 1.1rem;
    background:
        radial-gradient(circle at 0 0, rgba(37, 99, 235, 0.08), transparent 16rem),
        #ffffff;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

#vendor-detail-modal .vendor-detail-header h3 {
    margin: 0;
    color: #0f172a;
    font-size: 1.22rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    overflow-wrap: anywhere;
}

#vendor-detail-modal .vendor-detail-section {
    margin: 0;
    padding: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 1rem;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

#vendor-detail-modal .vendor-detail-section:has(.detail-files-list),
#vendor-detail-modal .vendor-detail-section:has(.document-management-controls) {
    grid-column: 1 / -1;
}

#vendor-detail-modal .vendor-detail-section h4 {
    margin: 0 0 0.9rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    color: #0f172a;
    font-size: 0.98rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

#vendor-detail-modal .vendor-detail-section h4 i {
    color: #7c3aed;
}

#vendor-detail-modal .detail-row {
    margin: 0;
    padding: 0.7rem 0;
    border-bottom: 1px solid rgba(226, 232, 240, 0.75);
    display: grid;
    grid-template-columns: minmax(130px, 0.4fr) minmax(0, 1fr);
    gap: 0.75rem;
    align-items: start;
}

#vendor-detail-modal .detail-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

#vendor-detail-modal .detail-label {
    min-width: 0;
    color: #64748b;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

#vendor-detail-modal .detail-value {
    color: #1e293b;
    font-weight: 750;
    text-align: right;
    overflow-wrap: anywhere;
    line-height: 1.45;
}

#vendor-detail-modal .badge,
#vendor-detail-modal .detail-value.badge {
    width: max-content;
    max-width: 100%;
    justify-self: end;
    border-radius: 999px;
    padding: 0.35rem 0.65rem;
    font-weight: 700;
    text-transform: lowercase;
}

#vendor-detail-modal .detail-files-list,
#vendor-detail-modal .document-list,
#vendor-detail-modal .ocr-data-display {
    max-height: none;
    overflow: auto;
}

#vendor-detail-modal .document-management-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

#vendor-detail-modal .document-management-controls .btn {
    border-radius: 0.8rem;
    font-weight: 700;
}

@media (max-width: 860px) {
    #vendor-detail-modal {
        padding: 0.75rem;
    }

    #vendor-detail-modal .modal-content {
        width: calc(100vw - 1.5rem);
        height: min(90vh, 780px);
        border-radius: 1.1rem;
    }

    #vendor-detail-modal .modal-header,
    #vendor-detail-modal .modal-body {
        padding: 1rem;
    }

    #vendor-detail-modal .vendor-detail-container {
        grid-template-columns: 1fr;
    }

    #vendor-detail-modal .vendor-detail-header {
        align-items: flex-start;
        flex-direction: column;
    }

    #vendor-detail-modal .detail-row {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }

    #vendor-detail-modal .detail-value {
        text-align: left;
    }

    #vendor-detail-modal .badge,
    #vendor-detail-modal .detail-value.badge {
        justify-self: start;
    }
}
