/* Offer King History Module Styles */
.ok-history-container {
    padding: 10px;
}

.ok-history-item {
    display: flex;
    align-items: center;
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
    transition: all 0.2s ease;
}

.ok-history-item:hover {
    border-color: #007cba;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.ok-hist-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border: 1px solid #ddd;
    border-radius: 3px;
    margin-right: 15px;
    background: #fff;
}

.ok-hist-details {
    flex-grow: 1;
}

.ok-hist-title {
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 3px;
    display: block;
}

.ok-hist-meta {
    font-size: 11px;
    color: #666;
    line-height: 1.4;
}

.ok-hist-actions {
    margin-left: 10px;
}

.ok-history-btn {
    background-color: #f0f0f1;
    color: #333;
    border: 1px solid #ccc;
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
}

.ok-history-btn:hover {
    background-color: #007cba;
    color: #fff;
    border-color: #007cba;
}

.ok-login-notice, .ok-empty-notice {
    text-align: center;
    padding: 20px;
    color: #555;
    font-style: italic;
}


/* Offer King History & Sidebar Styles */

/* History List */
.ok-history-container {
    padding: 10px;
}
.ok-history-item {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
    transition: all 0.2s ease;
}
.ok-history-item:hover {
    border-color: #007cba;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.ok-hist-img-wrap img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border: 1px solid #eee;
    border-radius: 3px;
    margin-right: 10px;
}
.ok-hist-details {
    flex-grow: 1;
    font-size: 12px;
}
.ok-hist-title {
    font-weight: bold;
    display: block;
    margin-bottom: 2px;
}
.ok-hist-meta {
    color: #666;
    line-height: 1.3;
}
.ok-history-btn {
    background: #f0f0f1;
    border: 1px solid #ccc;
    padding: 5px 10px;
    font-size: 11px;
    border-radius: 3px;
    cursor: pointer;
}
.ok-history-btn:hover {
    background: #007cba;
    color: #fff;
    border-color: #007cba;
}

/* NEW: Sidebar Layout Fixes */
.ok-tools-sidebar {
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Prevent double scrollbars */
}
.ok-tab-content {
    flex-grow: 1;
    overflow-y: auto; /* Scroll ONLY the content area */
    padding-right: 5px; /* Space for scrollbar */
    max-height: calc(100vh - 200px); /* Safety max height */
}

/* NEW: Sidebar Quantity Editor */
.ok-sidebar-qty-editor {
    background: #f9f9f9;
    border-bottom: 1px solid #eee;
    padding: 10px;
    margin-bottom: 15px;
}
.ok-sidebar-qty-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 12px;
}
.ok-sidebar-qty-row:last-child {
    margin-bottom: 0;
}
.ok-sq-label {
    font-weight: 500;
}
.ok-sq-input {
    width: 50px !important;
    padding: 3px !important;
    font-size: 12px !important;
    text-align: center;
    height: 26px !important;
    min-height: 26px !important;
}

/* Ensure canvas area doesn't crush sidebar */
.ok-modal-body {
    display: flex;
    flex-wrap: wrap; 
}
@media (min-width: 768px) {
    .ok-modal-body {
        flex-wrap: nowrap;
    }
    .ok-tools-sidebar {
        min-width: 320px; /* Force minimum width */
        width: 320px;
        border-left: 1px solid #ddd;
        padding-left: 15px;
    }
    .ok-main-panel {
        flex-grow: 1;
        overflow: hidden;
    }
}

/* Offer King History & Sidebar Styles */

/* History List */
.ok-history-container {
    padding: 10px;
}
.ok-history-item {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
    transition: all 0.2s ease;
}
.ok-history-item:hover {
    border-color: #007cba;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.ok-hist-img-wrap img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border: 1px solid #eee;
    border-radius: 3px;
    margin-right: 10px;
}
.ok-hist-details {
    flex-grow: 1;
    font-size: 12px;
}
.ok-hist-title {
    font-weight: bold;
    display: block;
    margin-bottom: 2px;
}
.ok-hist-meta {
    color: #666;
    line-height: 1.3;
}
.ok-history-btn {
    background: #f0f0f1;
    border: 1px solid #ccc;
    padding: 5px 10px;
    font-size: 11px;
    border-radius: 3px;
    cursor: pointer;
}
.ok-history-btn:hover {
    background: #007cba;
    color: #fff;
    border-color: #007cba;
}

/* Sidebar Layout Fixes */
.ok-tools-sidebar {
    display: flex;
    flex-direction: column;
    overflow: hidden; 
    background: #fff;
    z-index: 10;
}
.ok-tab-content {
    flex-grow: 1;
    overflow-y: auto; 
    padding-right: 5px; 
    max-height: calc(100vh - 250px);
}

/* Sidebar Quantity Editor */
.ok-sidebar-qty-editor {
    background: #f1f1f1;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 15px;
}
.ok-sidebar-qty-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 12px;
    background: #fff;
    padding: 5px;
    border-radius: 3px;
    border: 1px solid #eee;
}
.ok-sidebar-qty-row:last-child {
    margin-bottom: 0;
}
.ok-sq-label {
    font-weight: 600;
    color: #333;
}
.ok-sq-input {
    width: 60px !important;
    padding: 3px !important;
    font-size: 13px !important;
    text-align: center;
    height: 30px !important;
    min-height: 30px !important;
    border: 1px solid #ccc !important;
}

@media (min-width: 768px) {
    .ok-modal-body {
        display: flex;
        flex-wrap: nowrap;
    }
    .ok-tools-sidebar {
        min-width: 320px; 
        width: 320px;
        border-left: 1px solid #ddd;
        padding-left: 15px;
        box-sizing: border-box;
    }
    .ok-main-panel {
        flex-grow: 1;
        width: calc(100% - 320px);
        overflow: hidden;
    }
}