/* Main form container */
#urakkalaskuri-form {
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
    overflow-x: auto; /* horizontal scroll if needed */
}

/* Table styling */
#urakkalaskuri-form table {
    width: 1600px; /* wider table gives more space */
    border-collapse: collapse;
    margin-bottom: 25px;
}

/* Header cells */
#urakkalaskuri-form th {
    background: #f1f1f1;
    padding: 8px 6px;
    font-size: 14px;
    text-align: left;
    border-bottom: 2px solid #bbb;
    white-space: nowrap;
}

/* Table cells */
#urakkalaskuri-form td {
    padding: 6px 6px;
    font-size: 14px;
    white-space: nowrap;
    border-bottom: 1px solid #ddd;
}

/* Column widths */
#urakkalaskuri-form th:nth-child(1),
#urakkalaskuri-form td:nth-child(1) {
    width: 70px; /* Käs.nro */
}

#urakkalaskuri-form th:nth-child(2),
#urakkalaskuri-form td:nth-child(2) {
    width: 260px; /* Työ name - widened */
}

#urakkalaskuri-form th:nth-child(3),
#urakkalaskuri-form td:nth-child(3) {
    width: 80px; /* €/m2 */
}

#urakkalaskuri-form th:nth-child(4),
#urakkalaskuri-form td:nth-child(4) {
    width: 100px; /* Oma hinta */
}

#urakkalaskuri-form th:nth-child(5),
#urakkalaskuri-form td:nth-child(5) {
    width: 80px; /* qty */
}

#urakkalaskuri-form th:nth-child(6),
#urakkalaskuri-form td:nth-child(6) {
    width: 80px; /* markup */
}

#urakkalaskuri-form th:nth-child(7),
#urakkalaskuri-form td:nth-child(7) {
    width: 120px; /* Hinta total */
}

#urakkalaskuri-form th:nth-child(8),
#urakkalaskuri-form td:nth-child(8) {
    width: 120px; /* Oma hinta total */
}

#urakkalaskuri-form th:nth-child(9),
#urakkalaskuri-form td:nth-child(9) {
    width: 200px; /* TT nro / name - widened */
}

/* Inputs properly spaced */
#urakkalaskuri-form input {
    width: 100%;
    padding: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

/* Special case: name/TT fields need wider cell */
#urakkalaskuri-form input[name^="namett_"] {
    width: 100%;
}

/* Total fields */
#urakkalaskuri-form span[class^="total_"] {
    display: inline-block;
    width: 100%;
    text-align: right;
}

/* Section total */
.section-total {
    display: inline-block;
    width: 100%;
    font-weight: bold;
    text-align: right;
}
