/* Open Order Book - Paper Work Style */

/* 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 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;
}
