/* Open Order Book - Paper Work Style */

/* ---- Modal base (always hidden until JS adds .open) ---- */
.oob-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}
.oob-modal-overlay.open { display: flex; }
.oob-modal {
    background: #1a1a1a;
    color: #fff;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 8px;
    max-width: 520px;
    width: 94%;
    box-shadow: 0 10px 30px rgba(0,0,0,.7);
}
.oob-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255,255,255,.12);
}
.oob-modal-title { font-weight: bold; font-size: 15px; }
.oob-modal-close {
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 22px;
    line-height: 22px;
    cursor: pointer;
    padding: 0 4px;
}
.oob-modal-body { padding: 14px; }
.oob-modal-body table { width: 100%; border-collapse: collapse; }
.oob-modal-body td { padding: 4px 8px; font-size: 13px; border-bottom: 1px solid rgba(255,255,255,.07); }
.oob-modal-body td:first-child { opacity: .75; width: 45%; }
.oob-modal-body td:last-child { font-weight: 600; }
.oob-modal-footer {
    padding: 10px 14px;
    border-top: 1px solid rgba(255,255,255,.12);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
}

/* ---- Delete modal button variants ---- */
.oob-del-footer-3btn { flex-direction: column; align-items: stretch; }
.oob-del-footer-3btn form { margin: 0; }
.oob-btn-danger {
    background: #c0392b; color: #fff;
    border: 1px solid #922b21; border-radius: 4px;
    padding: 5px 12px; font-size: 13px; cursor: pointer; width: 100%;
}
.oob-btn-danger:hover { background: #a93226; }
.oob-btn-warning {
    background: #d35400; color: #fff;
    border: 1px solid #a04000; border-radius: 4px;
    padding: 5px 12px; font-size: 13px; cursor: pointer; width: 100%;
}
.oob-btn-warning:hover { background: #ba4a00; }
.oob-so-linked-notice {
    background: rgba(211,84,0,.15);
    border: 1px solid rgba(211,84,0,.4);
    border-radius: 4px; padding: 6px 8px; margin-bottom: 10px;
    font-size: 12px; color: #e59866;
}

/* Grid table styling */
table.paper-excel {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 12px;
    background: #fff;
}

table.paper-excel th {
    padding: 4px 3px !important;
    text-align: left !important;
    font-weight: bold !important;
    border: 1px solid #ccc !important;
    height: 22px !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
}

table.paper-excel th.center {
    text-align: center !important;
}

table.paper-excel td {
    padding: 2px 3px;
    border: 1px solid #ccc;
    vertical-align: middle;
    height: 24px;
}

/* Input and select styling */
table.paper-excel input[type="text"],
table.paper-excel input[type="number"],
table.paper-excel input[type="date"] {
    width: auto !important;
    min-width: 60px !important;
    max-width: 100% !important;
    padding: 2px !important;
    box-sizing: border-box !important;
    font-size: 11px !important;
    border: 1px solid #999 !important;
    background: #e8e8e8 !important;
    height: 18px !important;
}

table.paper-excel input[type="text"].value-display {
    background: #d3d3d3 !important;
    text-align: right !important;
    width: 100% !important;
}

table.paper-excel input[readonly] {
    background: #d3d3d3 !important;
    text-align: right !important;
}

table.paper-excel input[type="text"].customer-pn-input {
    min-width: 120px !important;
}

table.paper-excel input[type="number"] {
    min-width: 50px !important;
    width: 100% !important;
    text-align: right !important;
}

table.paper-excel input[type="text"]::placeholder,
table.paper-excel input[type="number"]::placeholder,
table.paper-excel input[type="date"]::placeholder {
    color: #999 !important;
}

table.paper-excel input[type="date"] {
    width: auto !important;
    max-width: 120px !important;
    height: 18px !important;
}

table.paper-excel select {
    width: auto !important;
    padding: 1px 2px !important;
    box-sizing: border-box !important;
    font-size: 11px !important;
    border: 1px solid #999 !important;
    background: #e8e8e8 !important;
    white-space: nowrap !important;
    height: 20px !important;
}

table.paper-excel .action-select {
    width: auto !important;
    max-width: 85px !important;
}

/* Cell alignment */
table.paper-excel td.right {
    text-align: right;
}

table.paper-excel td.center {
    text-align: center;
}

/* Input focus styling */
table.paper-excel input:focus,
table.paper-excel select:focus {
    background: #ffffcc;
    outline: none;
    border: 1px solid #666;
}

/* Checkbox styling */
table.paper-excel input[type="checkbox"] {
    cursor: pointer;
    margin: 0;
}

table.paper-excel input[type="checkbox"]:checked {
    accent-color: #0066ff;
}

/* Description label styling */
.oob-desc-label {
    display: block;
    padding: 2px 4px;
    word-wrap: break-word;
    word-break: break-word;
    color: #333;
    font-size: 11px;
    min-height: 18px;
    line-height: 1.3;
}

.oob-desc-hidden {
    display: none;
}

/* Product link styling */
.our-part-link {
    color: #0066ff;
    text-decoration: none;
    font-weight: bold;
    font-size: 11px;
}

.our-part-link:hover {
    text-decoration: underline;
    color: #0052cc;
}

.our-part-display {
    padding: 2px 4px;
    font-size: 11px;
    color: #333;
}

/* Autocomplete dropdown styling */
.oob-ac {
    background: #fff;
    border: 1px solid #bbb;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
    max-height: 240px;
    overflow-y: auto;
    min-width: 320px;
    border-radius: 3px;
}

.oob-ac-item {
    padding: 6px 8px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 11px;
}

.oob-ac-item:hover {
    background: #f0f0f0;
}

/* Top row with button and legend */
.oob-tablewrap table.liste thead tr.paperlist-toprow th {
    border: 0 !important;
    border-top: 0 !important;
    border-right: 0 !important;
    border-bottom: 0 !important;
    border-left: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 0 8px 6px 8px;
    vertical-align: bottom;
}

thead tr.paperlist-toprow .button,
thead tr.paperlist-toprow .butAction,
thead tr.paperlist-toprow a.butAction {
    margin: 0 !important;
    display: inline-block;
}

.doclca-legend {
    text-align: left;
    font-size: 10px;
    line-height: 1.2;
    color: #666;
    white-space: nowrap;
    display: inline-block;
    font-weight: normal;
    position: relative;
    top: -5px;
}

/* Table wrapper with legend positioning */
.oob-tablewrap {
    position: relative;
}

/* ===== KILL border from Dolibarr core for liste table in oob-tablewrap ===== */
.oob-tablewrap table.liste {
    border-collapse: collapse !important;
    border: 0 !important;
}

/* Remove ALL borders from top row (button + legend) */
.oob-tablewrap table.liste thead tr.paperlist-toprow {
    border: 0 !important;
    border-top: 0 !important;
    border-bottom: 0 !important;
}

.oob-tablewrap table.liste thead tr.paperlist-toprow th {
    border: 0 !important;
    border-top: 0 !important;
    border-right: 0 !important;
    border-bottom: 0 !important;
    border-left: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    line-height: 1 !important;
    padding: 0 !important;
}

/* Only first th (button) - align left with no left padding */
.oob-tablewrap table.liste thead tr.paperlist-toprow th:first-child {
    text-align: left !important;
    padding-left: 0 !important;
    padding-right: 8px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Move button up directly */
.oob-tablewrap table.liste thead tr.paperlist-toprow th:first-child .button,
.oob-tablewrap table.liste thead tr.paperlist-toprow th:first-child a.button,
.oob-tablewrap table.liste thead tr.paperlist-toprow th:first-child .butAction,
.oob-tablewrap table.liste thead tr.paperlist-toprow th:first-child a.butAction {
    position: relative !important;
    top: -20px !important;
    display: inline-block !important;
}

/* Add borders ONLY to header row (liste_titre) and tbody */
.oob-tablewrap table.liste thead tr.liste_titre th {
    border-top: 1px solid #d0d0d0 !important;
    border-bottom: 1px solid #d0d0d0 !important;
    border-left: 1px solid #d0d0d0 !important;
    border-right: 1px solid #d0d0d0 !important;
    padding: 5px 6px !important;
    line-height: 1.3 !important;
}

.oob-tablewrap table.liste tbody tr td {
    border: 1px solid #d0d0d0 !important;
    padding: 4px 6px !important;
    height: auto !important;
    line-height: 1.3 !important;
}

.oob-top-actions { display: inline-flex; align-items: center; gap: 8px; }
.oob-top-actions select { margin: 0; vertical-align: middle; }
.oob-top-actions .user-filter-wrap { position: relative; top: -20px; }

/* Resize OPEN and DELETE buttons */
.oob-tablewrap table.liste tbody td .butAction,
.oob-tablewrap table.liste tbody td a.butAction,
.oob-tablewrap table.liste tbody td .butActionDelete,
.oob-tablewrap table.liste tbody td a.butActionDelete {
    padding: 3px 8px !important;
    font-size: 12px !important;
    height: 20px !important;
    line-height: 20px !important;
}

/* Override Dolibarr theme's forced min-width:550px on all tooltips on OOB pages */
div.ui-tooltip.mytooltip {
    min-width: auto !important;
    width: auto !important;
}
