/* --- MOBIILIVAATE PARANDUSED MASINAARUANNETE LEHELE --- */

@media only screen and (max-width: 768px) {

    /* Filtrite read muutuvad 1 veeruliseks */
    .terake-filter-row, 
    .terake-filter-row div,
    .terake-filters select,
    .terake-filters input {
        width: 100% !important;
        max-width: 100% !important;
        display: block;
        margin-bottom: 10px;
    }

    /* Nupud 100% laiusega */
    .terake-filters button {
        width: 100% !important;
        margin-top: 5px;
    }

    /* Kokkuvõtte plokk ilusamaks */
    .terake-summary-box {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 10px;
        font-size: 15px;
    }

    /* Tabel muudetakse scrollitavaks (ilma et kogu leht jookseks) */
    .terake-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
    }

    table.terake-table {
        width: 700px; /* fikseeritud laius, et tabel ei hüppaks */
        font-size: 14px;
    }

    /* Tabeli tekst väiksemaks */
    table.terake-table th,
    table.terake-table td {
        padding: 6px 8px;
    }
}


/* Terake: värvilised staatuse märgised */
.terake-status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
}

.terake-status-draft .terake-status-badge {
    background: #e0e0e0;
    color: #333;
}

.terake-status-pending .terake-status-badge {
    background: #fff3cd;
    color: #856404;
}

.terake-status-approved .terake-status-badge {
    background: #d4edda;
    color: #155724;
}

.terake-status-rejected .terake-status-badge {
    background: #f8d7da;
    color: #721c24;
}

/* ===== Mehhanism / transport – mobiilivaade ===== */
@media (max-width: 768px) {

  .mech-table,
  .mech-table thead,
  .mech-table tbody,
  .mech-table tr,
  .mech-table th,
  .mech-table td {
    display: block;
    width: 100%;
  }

  .mech-table thead {
    display: none; /* peidame tabeli päise */
  }

  .mech-row {
    border: 2px solid #d1d5db;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 16px;
    background: #fff;
  }

  .mech-row td {
    padding: 8px 0;
  }

  .mech-row td::before {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    color: #374151;
  }

  /* Väljade nimed */
  .mech-row td:nth-child(1)::before { content: "Mehhanism"; }
  .mech-row td:nth-child(2)::before { content: "Auto number"; }
  .mech-row td:nth-child(3)::before { content: "Töötunnid"; }
  .mech-row td:nth-child(4)::before { content: "Seisak"; }

  /* Inputid täislaiuseks */
  .mech-row input,
  .mech-row select {
    width: 100%;
    min-height: 44px;
    font-size: 16px;
  }

  /* + / – nupud alla paremale */
  .mech-row td:last-child {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
  }
}

@media (max-width: 768px) {

  /* Välimine plokk (kogu Mehhanism / transport ala) */
  .mech-table {
    background: #f3f4f6; /* hele hall */
    padding: 12px;
    border-radius: 14px;
  }

  /* Iga mehhanismi kaart */
  .mech-row {
    background: #ffffff; /* puhas valge */
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
  }

  /* Väike vahe väljade vahel */
  .mech-row td {
    margin-bottom: 6px;
  }

}

