body {
    min-height: 100vh;
    background-color: #e8e8e8;
}

nav {
    background-color: white;
}

header {
    display: flex;
    justify-content: space-between;
    padding-left: 50px;
    padding-right: 50px;
    height: 100px;
    background-color: white;
    border-radius: 10px;
    margin-top: 10px;
    margin-bottom: 10px;
    margin-left: 1.459vw;
    margin-right: 1.459vw;
}

header button {
    height: 45px;
    font-size: 1em;
    padding-left: 20px;
    padding-right: 20px;
    background-color: #2C97F2;
    border: none;
    color: white;
    border-radius: 10px;
}

#search {
    border-radius: 10px 0px 0px 10px;
    border: 1px solid black;
    width: 30vw;
    height: 35px;
}

.brd {
    border-radius: 10px !important;
}

#search::placeholder {
    text-align: right;
}

#noTask, #noSearch {
    text-align: center;
    display: none;
}

main {
    display: flex;
    justify-content: center;
}

#mainHead {
    display: flex;
    justify-content: space-between;
}

#mainHead div:active,
#mainHead div:hover {
    color: blue;
}

.mainTable,
#mainHead {
    display: flex;
}

.mainTable div,
#mainHead div {
    flex-shrink: 0;
}

.statusInput {
    width: 117px;
    font-size: 12px;
    border: 0px;
}

#filter {
    width: 150px;
    height: 35px;
    border-radius: 0px 10px 10px 0px;
    border: 1px solid black;
}

#numberHead, .tdNumber,
#modelHead, .tdModel,
#statusHead, .tdStatus,
#bugHead, .tdBug,
#priceHead, .tdPrice,
#workerHead, .tdWorker,
#dateBeginHead, .tdBegin,
#dateHead, .days-cell,
#editHead {
    padding: 10px;
    display: flex;
    justify-content: center;
}

.tdModel, .tdBug, .tdWorker {
    word-break: break-word;
}

.tdStatus {
    text-align: center;
}

.tdEdit {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.tdEdit button {
    background-color: #007bff;
    border: 0px;
    color: white;
    border-radius: 5px;
    height: 3vh;
    margin-top: 2px;
}

#mainHead,
.mainTable {
    display: grid;
    grid-template-columns:
        3vw
        23.854vw
        8.958vw
        28.385vw
        5.781vw
        8.385vw
        8.25vw
        10.469vw;
}

#orderTable {
    background-color: white;
    border-radius: 10px 10px 0px 0px;
    min-height: 77vh;
    padding-top: 10px;
}

/* Модальное окно */

#modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 16px;
}

#modal-window {
    width: min(1100px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    position: relative;
    padding: 24px;
}

#modal-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-row {
    display: grid;
    gap: 12px;
}

.modal-row-2 {
    grid-template-columns: repeat(2,1fr);
}

.modal-row-3 {
    grid-template-columns: repeat(3,1fr);
}

.field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.field label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

#modal-window input,
#modal-window select {
    width: 100%;
    height: 40px;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 0 12px;
    font-size: 14px;
    outline: none;
    background: white;
}

#modal-window input:focus,
#modal-window select:focus {
    border-color: #007bff;
}

.checks-row {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.check-field {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
}

.check-field span {
    width: 150px;
}

.check-field input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

.modal-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 8px;
}

#modal-button, .dop-button {
    height: 40px;
    border: none;
    border-radius: 6px;
    padding: 0 20px;
    font-size: 14px;
    font-weight: 500;
    color: white;
    cursor: pointer;
    background: #007bff;
}

#modal-button:hover, .dop-button {
    opacity: 0.9;
}

.dop-button {
    margin-top: 2px;
}

#closeButton {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: #f0f0f0;
    color: #333;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

#closeButton:hover {
    background: #e0e0e0;
}

.price-main-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.mini-button {
    width: 40px !important;
    height: 40px;
    border: none;
    border-radius: 6px;
    background: #007bff;
    color: white;
    font-size: 20px;
    cursor: pointer;
    flex-shrink: 0;
}

.price-calc-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.price-calc-box input {
    width: 100%;
}

#out {
    margin-top: 1vh;
    /*white-space: pre-wrap;*/
    line-height: 1.5; 
}

#archiveTable #mainHead,
#archiveTable .mainTable {
    grid-template-columns:
        46px
        minmax(160px, 1.2fr)
        minmax(120px, 0.8fr)
        minmax(180px, 1.4fr)
        minmax(80px, 0.6fr)
        minmax(130px, 0.9fr)
        minmax(110px, 0.8fr)
        minmax(130px, 0.9fr)
        minmax(100px, 0.7fr);
    min-width: 1050px;
}

.mainTable {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}